Sha256: fcbd26a4fdbe0b3a06ed5f14bf7676151f4b4626c558dd0a326ce6aa1f2646cb
Contents?: true
Size: 1.06 KB
Versions: 19
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true module Playbook module PbCheckbox class Checkbox < Playbook::KitBase prop :error, type: Playbook::Props::Boolean, default: false prop :checked, type: Playbook::Props::Boolean, default: false prop :text prop :value prop :name prop :input_options, type: Playbook::Props::Hash, default: {} prop :required, type: Playbook::Props::Boolean, default: false prop :form_spacing, type: Playbook::Props::Boolean, default: false def checked_html checked ? "checked='true'" : nil end def classname generate_classname("pb_checkbox_kit", checked_class) + error_class end def input check_box_tag(name, value, checked, input_options) end def checkbox_label_status error ? "negative" : nil end private def error_class error ? " error" : "" end def checked_class checked ? "on" : "off" end end end end
Version data entries
19 entries across 19 versions & 1 rubygems