Sha256: 3065b83c6b4a393a49bbb840a79315bb22cb6aa5169a913b7ae7da128a54c440

Contents?: true

Size: 634 Bytes

Versions: 4

Compression:

Stored size: 634 Bytes

Contents

module Trestle
  class Form
    module Fields
      module CheckBoxHelpers
        def switch?
          options[:switch]
        end

        def inline?
          options[:inline]
        end

        def default_wrapper_class
          [
            "form-check",
            ("form-switch" if switch?),
            ("form-check-inline" if inline?)
          ].compact
        end

        def input_class
          ["form-check-input"]
        end

        def label_class
          ["form-check-label"]
        end

        def defaults
          Trestle::Options.new(disabled: readonly?)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trestle-0.10.1 lib/trestle/form/fields/check_box_helpers.rb
trestle-0.10.0 lib/trestle/form/fields/check_box_helpers.rb
trestle-0.10.0.pre2 lib/trestle/form/fields/check_box_helpers.rb
trestle-0.10.0.pre lib/trestle/form/fields/check_box_helpers.rb