Class: Voom::Presenters::DSL::Components::DatetimeBase
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Attributes inherited from TextField
#full_width, #password, #required
Attributes inherited from Input
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #context, #id, #type
Instance Method Summary collapse
- #clear_icon(icon = nil, **attribs, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ DatetimeBase
constructor
A new instance of DatetimeBase.
Methods inherited from TextField
#error, #hint, #icon, #label, #pattern, #readonly, #value
Methods included from Mixins::Tooltips
Methods included from Mixins::Event
Methods inherited from Base
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ DatetimeBase
Returns a new instance of DatetimeBase.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/voom/presenters/dsl/components/datetime_base.rb', line 10 def initialize(**attribs_, &block) super(**attribs_, &block) @config = {} map_config(:format, :alt_format, true) merge_config(:disable) merge_config(:enable) merge_config(:mode) merge_config(:time_24hr, true) clear_icon(:clear) do event :click do 'Clicked' end end end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/voom/presenters/dsl/components/datetime_base.rb', line 8 def config @config end |
Instance Method Details
#clear_icon(icon = nil, **attribs, &block) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/voom/presenters/dsl/components/datetime_base.rb', line 26 def clear_icon(icon=nil, **attribs, &block) return @clear_icon if locked? @clear_icon = icon ? Components::Icon.new(parent: self, icon: icon, context: context, **attribs, &block) : nil end |