Sha256: 5d1156f9db81aa8e70735609d2545eef375f2386762b1131fc333e8657f045fc

Contents?: true

Size: 1.61 KB

Versions: 11

Compression:

Stored size: 1.61 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbList
    class List < Playbook::KitBase
      prop :borderless, type: Playbook::Props::Boolean,
                        default: false
      prop :dark, type: Playbook::Props::Boolean,
                  default: false
      prop :enable_drag, type: Playbook::Props::Boolean,
                         default: false
      prop :items, type: Playbook::Props::Array,
                   default: []
      prop :layout, type: Playbook::Props::Enum,
                    values: ["left", "right", ""],
                    default: ""
      prop :size
      prop :ordered, type: Playbook::Props::Boolean,
                     default: false
      prop :xpadding, type: Playbook::Props::Boolean,
                      default: false
      prop :role
      prop :tabindex

      def list_classname
        generate_classname("pb_list_kit",
                           xpadding_class,
                           borderless_class,
                           dark_class,
                           size_class,
                           layout_class)
      end

      def ordered_class
        ordered ? "ol" : "ul"
      end

    private

      def borderless_class
        borderless ? "borderless" : nil
      end

      def dark_class
        dark ? "dark" : nil
      end

      def layout_class
        if layout == "right"
          "layout_right"
        elsif layout == "left"
          "layout_left"
        else
          ""
        end
      end

      def size_class
        size ? "large" : nil
      end

      def xpadding_class
        xpadding ? "xpadding" : nil
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
playbook_ui-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-14.11.1.pre.alpha.PBNTR719listdraggablesimple5432 app/pb_kits/playbook/pb_list/list.rb