Sha256: 43d8434be571c9d4c3eea5d5ad1675176ad044f2ed1a66fae88a8984b90e0814

Contents?: true

Size: 1.46 KB

Versions: 21

Compression:

Stored size: 1.46 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbTable
    class Table
      include Playbook::Props

      partial "pb_table/table"

      prop :size, type: Playbook::Props::Enum,
                  values: %w[sm md lg],
                  default: "md"
      prop :single_line, type: Playbook::Props::Boolean,
                         default: false
      prop :disable_hover, type: Playbook::Props::Boolean,
                           default: false
      prop :data_table, type: Playbook::Props::Boolean,
                        default: false
      prop :container, type: Playbook::Props::Boolean,
                       default: true
      prop :responsive, type: Playbook::Props::Enum,
                        values: %w[collapse scroll none],
                        default: "collapse"
      prop :text

      def classname
        generate_classname(
          "pb_table", "table-#{size}", single_line_class, dark_class,
          disable_hover_class, container_class, data_table_class,
          "table-responsive-#{responsive}", separator: " "
        )
      end

    private

      def dark_class	
        dark ? "table-dark" : nil	
      end	

      def data_table_class
        data_table ? "data_table" : nil
      end

      def single_line_class
        single_line ? "single-line" : nil
      end

      def disable_hover_class
        disable_hover ? "no-hover" : nil
      end

      def container_class
        container ? "table-card" : nil
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
playbook_ui-7.0.1.pre.alpha8 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.1.pre.alpha7 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.1.pre.alpha6 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.1.pre.alpha5 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.1.pre.alpha4 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.1.pre.alpha3 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.1.pre.alpha2 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-6.4.2 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.1.pre.alpha1 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.0.pre.alpha9 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.0.pre.alpha8 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.0.pre.alpha7 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-6.4.1 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.0.pre.alpha6 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.0.pre.alpha5 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-6.4.0 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-6.3.1 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.0.pre.alpha4 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.0.pre.alpha3 app/pb_kits/playbook/pb_table/table.rb
playbook_ui-7.0.0.pre.alpha2 app/pb_kits/playbook/pb_table/table.rb