Sha256: a9355e15966398b7cf82c91c31d6fa4a19d6b6d751f7861c0b651782ee928556

Contents?: true

Size: 1.15 KB

Versions: 191

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

require "action_view"

module Playbook
  module PbRadio
    class Radio < Playbook::KitBase
      prop :alignment, type: Playbook::Props::String,
                       default: ""
      prop :checked, type: Playbook::Props::Boolean,
                     default: false
      prop :error, type: Playbook::Props::Boolean,
                   default: false
      prop :input_options, type: Playbook::Props::HashProp,
                           default: {}
      prop :name, type: Playbook::Props::String,
                  default: "radio_name"
      prop :text, type: Playbook::Props::String,
                  default: "Radio Text"
      prop :value, type: Playbook::Props::String,
                   default: "radio_text"

      def classname
        generate_classname("pb_radio_kit") + error_class + alignment_class
      end

      def selected
        "checked" if checked == true
      end

      def body_status
        error ? "negative" : nil
      end

    private

      def error_class
        error ? " error" : ""
      end

      def alignment_class
        alignment == "vertical" ? " vertical" : ""
      end
    end
  end
end

Version data entries

191 entries across 191 versions & 1 rubygems

Version Path
playbook_ui-13.22.0 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.PBNTR243globalpositioningpropinset2504 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.PLAY12652489 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.PLAY12582474 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.PBNTR224letuserresetrowexpansion2466 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.PLAY120322465 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2451 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.PBNTR224letuserresetrowexpansion2441 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.PBNTR225advancedtablefeedback2438 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.PBNTR238DatePickerYearBug2436 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2431 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2415 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.20.0.pre.alpha.play1247htmloptions2404 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.20.0.pre.alpha.play1247htmloptions2403 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.20.0.pre.alpha.PLAY12572402 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.21.0 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.20.0.pre.alpha.PBNTR225advancedtablefeedback2375 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.19.0.pre.alpha.PBNTR200addadvancedtablekitdarkmodestyles2346 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2345 app/pb_kits/playbook/pb_radio/radio.rb
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2342 app/pb_kits/playbook/pb_radio/radio.rb