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