Sha256: 085bfdd92ad7a24de62bc4d807a11274ca09f1db3252bdd0fe646c647fa91f15

Contents?: true

Size: 744 Bytes

Versions: 175

Compression:

Stored size: 744 Bytes

Contents

# frozen_string_literal: true

require "action_view"

module Playbook
  module PbToggle
    class Toggle < Playbook::KitBase
      prop :input_options, type: Playbook::Props::HashProp,
                           default: {}

      prop :checked, type: Playbook::Props::Boolean,
                     default: false
      prop :name
      prop :size, type: Playbook::Props::Enum,
                  values: %w[sm md],
                  default: "sm"
      prop :value

      def classname
        generate_classname("pb_toggle_kit", size, checked_class)
      end

      def input
        check_box_tag(name, value, checked, input_options)
      end

    private

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

Version data entries

175 entries across 175 versions & 1 rubygems

Version Path
playbook_ui-13.20.0.pre.alpha.PBNTR225advancedtablefeedback2375 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0.pre.alpha.PBNTR200addadvancedtablekitdarkmodestyles2346 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2345 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2342 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0.pre.alpha.play1186collapsiblenaviconcolorbug2321 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0.pre.alpha.PBNTR211tablekitsubcomponentsreact2318 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2306 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2305 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.20.0 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0.pre.alpha.play1141iconkitusinglibrary2264 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0.pre.alpha.PBNTR207tabledivsupport2261 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0.pre.alpha.PBNTR207tabledivsupport2245 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.19.0 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.18.0.pre.alpha.thor93bargraphoptions2219 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.18.0.pre.alpha.thor93bargraphoptions2211 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.18.0.pre.alpha.play1141iconkitusinglibrary2210 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.18.0.pre.alpha.PLAY12062203 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.18.0.pre.alpha.powercentrainplaybookpt22201 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.18.0.pre.alpha.PLAY8672199 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.18.0.pre.alpha.PBNTR191AdvancedTableFinalFixes2197 app/pb_kits/playbook/pb_toggle/toggle.rb