Sha256: de0b6d2a458face87d215f589cdba1217cfb94c8455cd76d9c81e4ce2754072c

Contents?: true

Size: 1.52 KB

Versions: 462

Compression:

Stored size: 1.52 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
        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

      # rubocop:disable Style/CaseLikeIf
      def layout_class
        if layout == "right"
          "layout_right"
        elsif layout == "left"
          "layout_left"
        else
          ""
        end
      end
      # rubocop:enable Style/CaseLikeIf

      def size_class
        size ? "large" : nil
      end

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

Version data entries

462 entries across 462 versions & 1 rubygems

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