Sha256: c452814a0175da86d9a87af86dbd28c8c75a23771c17c9588cd65fa5e3cd92e5

Contents?: true

Size: 676 Bytes

Versions: 9

Compression:

Stored size: 676 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbCheckbox
    class Checkbox
      include Playbook::Props

      partial "pb_checkbox/checkbox"

      prop :dark, type: Playbook::Props::Boolean, default: false
      prop :checked, type: Playbook::Props::Boolean, default: false
      prop :text
      prop :value
      prop :name

      def checked_html
        checked ? "checked='true'" : nil
      end

      def classname
        generate_classname("pb_checkbox_kit", dark_class, checked_class)
      end

    private

      def checked_class
        checked ? "on" : "off"
      end

      def dark_class
        dark ? "dark" : nil
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
playbook_ui-3.2.0 app/pb_kits/playbook/pb_checkbox/checkbox.rb
playbook_ui-3.1.0 app/pb_kits/playbook/pb_checkbox/checkbox.rb
playbook_ui-3.0.1 app/pb_kits/playbook/pb_checkbox/checkbox.rb
playbook_ui-3.0.0 app/pb_kits/playbook/pb_checkbox/checkbox.rb
playbook_ui-2.9.9 app/pb_kits/playbook/pb_checkbox/checkbox.rb
playbook_ui-2.9.8 app/pb_kits/playbook/pb_checkbox/checkbox.rb
playbook_ui-2.9.7 app/pb_kits/playbook/pb_checkbox/checkbox.rb
playbook_ui-2.9.6 app/pb_kits/playbook/pb_checkbox/checkbox.rb
playbook_ui-2.9.5 app/pb_kits/playbook/pb_checkbox/checkbox.rb