Class: Formatic::String
- Inherits:
-
Base
- Object
- ViewComponent::Base
- ApplicationComponent
- Base
- Formatic::String
- Defined in:
- app/components/formatic/string.rb
Overview
Text input for one-liners.
Instance Method Summary collapse
Methods inherited from Base
#input_name, #param_key, #value, #wrapper
Methods inherited from ApplicationComponent
Constructor Details
This class inherits a constructor from Formatic::ApplicationComponent
Instance Method Details
#css_classes ⇒ Object
45 46 47 48 49 50 |
# File 'app/components/formatic/string.rb', line 45 def css_classes classes = i[c-formatic-string__input js-formatic-string] classes.push(:'is-terminal') if terminal? classes.push(:'is-autosubmit') if async_submit classes end |
#input_options ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/components/formatic/string.rb', line 33 def result = { placeholder: wrapper.placeholder, autofocus:, class: css_classes } (result[:value] = value) if value result end |