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.12.0.pre.alpha.PLAY1051removinghighchartsdependency1551 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.12.0.pre.alpha.play900startratingasinput1550 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.12.0.pre.alpha.play900startratingasinput1543 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.11.1.pre.alpha.play900startratingasinput1530 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.12.0 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.11.1 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.11.0 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.PLAY1051removinghighchartsdependency1465 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.webpackerregistercomponents1463 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.dependabotnpmandyarnfortawesomefontawesomepro6421439 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.play10561428 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.play1054tableheadersortconsolidation1416 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.play10561409 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.dependabotnpmandyarntiptapextensionlink21121407 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21365 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21358 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.play10481357 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.play845addswiftkitspage1332 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.PLAY978alphatesthighcharts41330 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21328 app/pb_kits/playbook/pb_toggle/toggle.rb