Class: Maglev::Uikit::Form::RichtextComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Maglev::Uikit::Form::RichtextComponent
- Defined in:
- app/components/maglev/uikit/form/richtext_component.rb
Instance Attribute Summary collapse
-
#html_options ⇒ Object
readonly
Returns the value of attribute html_options.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #build_data_action(actions) ⇒ Object
- #dom_id ⇒ Object
- #edit_link_path ⇒ Object
- #error ⇒ Object
-
#initialize(label:, name:, options: {}, html_options: {}) ⇒ RichtextComponent
constructor
A new instance of RichtextComponent.
- #label_name ⇒ Object
- #line_break? ⇒ Boolean
- #number_of_rows ⇒ Object
- #placeholder ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(label:, name:, options: {}, html_options: {}) ⇒ RichtextComponent
Returns a new instance of RichtextComponent.
9 10 11 12 13 14 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 9 def initialize(label:, name:, options: {}, html_options: {}) @label = label @name = name @options = @html_options = || {} end |
Instance Attribute Details
#html_options ⇒ Object (readonly)
Returns the value of attribute html_options.
7 8 9 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 7 def @html_options end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
7 8 9 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 7 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 7 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 7 def @options end |
Instance Method Details
#build_data_action(actions) ⇒ Object
48 49 50 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 48 def build_data_action(actions) [.dig(:data, :action), actions].compact.join(' ') end |
#dom_id ⇒ Object
16 17 18 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 16 def dom_id name.to_s.parameterize.underscore end |
#edit_link_path ⇒ Object
32 33 34 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 32 def edit_link_path [:edit_link_path] end |
#error ⇒ Object
44 45 46 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 44 def error [:error] end |
#label_name ⇒ Object
40 41 42 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 40 def label_name [:label_name] end |
#line_break? ⇒ Boolean
28 29 30 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 28 def line_break? [:line_break] || false end |
#number_of_rows ⇒ Object
24 25 26 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 24 def number_of_rows [:rows] || 4 end |
#placeholder ⇒ Object
36 37 38 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 36 def placeholder [:placeholder] end |
#value ⇒ Object
20 21 22 |
# File 'app/components/maglev/uikit/form/richtext_component.rb', line 20 def value [:value] end |