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.21.0.pre.alpha.PLAY12582531 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PLAY12582516 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PLAY12582515 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PLAY12582514 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.22.0 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PBNTR243globalpositioningpropinset2504 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PLAY12652489 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PLAY12582474 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PBNTR224letuserresetrowexpansion2466 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PLAY120322465 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2451 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PBNTR224letuserresetrowexpansion2441 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PBNTR225advancedtablefeedback2438 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.PBNTR238DatePickerYearBug2436 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2431 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2415 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.20.0.pre.alpha.play1247htmloptions2404 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.20.0.pre.alpha.play1247htmloptions2403 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.20.0.pre.alpha.PLAY12572402 app/pb_kits/playbook/pb_toggle/toggle.rb
playbook_ui-13.21.0 app/pb_kits/playbook/pb_toggle/toggle.rb