Sha256: 3c6d865b58089bf28c3d26a8b0baf00c2635fc9ef5f08f7dcc63c1171f5147bd
Contents?: true
Size: 1.15 KB
Versions: 16
Compression:
Stored size: 1.15 KB
Contents
module Formstrap class NumberView < ViewModel include Formstrap::Hintable include Formstrap::InputGroupable include Formstrap::Labelable include Formstrap::Listable include Formstrap::Placeholderable include Formstrap::Validatable include Formstrap::Wrappable def input_options keys = attributes - %i[append attribute float form input_group label prepend validate wrapper] options = to_h.slice(*keys) default_input_options.deep_merge(options) end def input_group_options default_input_group_options .deep_merge(label_input_group_options) .deep_merge(@input_group || {}) end def wrapper_options default_wrapper_options.deep_merge({ class: ["mb-3", float_class] }).deep_merge(@wrapper || {}) end private def float_class "form-floating" if float end def default_input_options { aria: {describedby: validation_id}, class: [form_control_class, validation_class], placeholder: placeholder } end def form_control_class plaintext ? "form-control-plaintext" : "form-control" end end end
Version data entries
16 entries across 16 versions & 1 rubygems