Class: Playbook::PbTextInput::TextInput

Inherits:
KitBase
  • Object
show all
Defined in:
app/pb_kits/playbook/pb_text_input/text_input.rb

Instance Method Summary collapse

Methods inherited from KitBase

#object

Methods included from ZIndex

included

Methods included from Spacing

included, #max_width_options, #max_width_props, #max_width_values, #spacing_options, #spacing_props, #spacing_values

Methods included from Classnames

#generate_classname, #generate_classname_without_spacing, included

Methods included from Playbook::Props

#initialize, #prop

Methods included from Playbook::PbKitHelper

#pb_rails

Methods included from Playbook::PbFormsHelper

#pb_form_with

Instance Method Details

#classnameObject



21
22
23
# File 'app/pb_kits/playbook/pb_text_input/text_input.rb', line 21

def classname
  generate_classname("pb_text_input_kit") + error_class
end

#validation_dataObject



33
34
35
36
37
# File 'app/pb_kits/playbook/pb_text_input/text_input.rb', line 33

def validation_data
  fields = {}
  fields[:message] = validation_message unless validation_message.blank?
  fields
end

#validation_messageObject



25
26
27
# File 'app/pb_kits/playbook/pb_text_input/text_input.rb', line 25

def validation_message
  validation[:message] || ""
end

#validation_patternObject



29
30
31
# File 'app/pb_kits/playbook/pb_text_input/text_input.rb', line 29

def validation_pattern
  validation[:pattern] || nil
end