Sha256: 8bcdae058e807af43e331d44228397740bae1252363ab9b38ea9f6fc566324d3

Contents?: true

Size: 1.38 KB

Versions: 123

Compression:

Stored size: 1.38 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 :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
        [
          "pb_list_kit",
          xpadding_class,
          borderless_class,
          dark_class,
          size_class,
          layout_class,
        ].compact.join("_")
      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

123 entries across 123 versions & 1 rubygems

Version Path
playbook_ui-9.3.0.pre.alpha.password.strength.1 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-9.3.0 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-9.2.2.pre.alpha.margin app/pb_kits/playbook/pb_list/list.rb
playbook_ui-9.2.2 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-9.2.1 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-9.2.0 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-9.1.0 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-9.0.0 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.3.0.alpha.select.pre.margin app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.3.0 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.2.1.pre.alpha5 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.2.1.pre.alpha4 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.2.1.alpha.iconacc app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.2.1.pre.alpha3 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.2.1.pre.alpha2 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.3.0.deps2 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.3.0.pre.alpha1 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.2.1.pre.alpha1 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.2.1 app/pb_kits/playbook/pb_list/list.rb
playbook_ui-8.1.3 app/pb_kits/playbook/pb_list/list.rb