Sha256: dedb514e22009c89a9f1835fbb9ce0633dfc987f456e990a340bd04dea492a8f

Contents?: true

Size: 1.42 KB

Versions: 21

Compression:

Stored size: 1.42 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbAdvancedTable
    class TableSubrowHeader < Playbook::KitBase
      prop :column_definitions, type: Playbook::Props::Array,
                                default: []
      prop :depth
      prop :row
      prop :enable_toggle_expansion, type: Playbook::Props::Enum,
                                     values: %w[all header none],
                                     default: "header"
      prop :subrow_header, type: Playbook::Props::String,
                           default: ""
      prop :collapsible_trail, type: Playbook::Props::Boolean,
                               default: true
      prop :subrow_data_attributes, type: Playbook::Props::HashProp,
                                    default: {}
      prop :responsive, type: Playbook::Props::Enum,
                        values: %w[none scroll],
                        default: "scroll"

      def data
        Hash(prop(:data)).merge(subrow_data_attributes)
      end

      def classname
        generate_classname("pb_table_tr", "bg-silver", "pb_subrow_header", subrow_depth_classname, separator: " ")
      end

      def td_classname(index)
        classes = %w[id-cell chrome-styles]
        classes << "pinned-left" if index.zero? && responsive == "scroll"
        classes.join(" ")
      end

    private

      def subrow_depth_classname
        depth.positive? ? "depth-sub-row-#{depth}" : ""
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
playbook_ui-14.13.0.pre.rc.5 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.PLAY1602lightboxoverlapnitrobug5781 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.13.0.pre.rc.4 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.playrailsinputmaskissue5775 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.PBNTR456fixedconftoastrailsautoclose5757 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.PBNTR456fixedconftoastrailsautoclose5754 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.PLAY1602lightboxoverlapnitrobugzindextoken5751 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.PBNTR456fixedconftoastrailsautoclose5738 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.13.0.pre.rc.3 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.PLAY1865reactdatepickerreinitializingbug5732 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.PBNTR456fixedconftoastrailsautoclose5728 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.play1862buttondisabledlinkbug5716 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.play1862buttondisabledlinkbug5714 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.13.0.pre.rc.2 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.13.0.pre.rc.1 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.13.0.pre.rc.0 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.advancedtablealignmentfixes5693 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.testingwithfas5689 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.testingwithfas5686 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb
playbook_ui-14.12.0.pre.alpha.play1828updateviteversion5680 app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb