Module: HakumiComponents::Table::Concerns::Columns

Extended by:
ActiveSupport::Concern, T::Helpers, T::Sig
Included in:
HakumiComponents::Table::Component
Defined in:
app/components/hakumi_components/table/concerns/columns.rb

Constant Summary collapse

ColumnInputValue =
T.type_alias { HakumiComponents::Table::DefinitionTypes::DefinitionValue }
ColumnInputHash =
T.type_alias { HakumiComponents::Table::DefinitionTypes::RawRecord }
ColumnInput =
T.type_alias { T.any(Symbol, ColumnInputHash) }

Instance Method Summary collapse

Instance Method Details

#columns_dataObject



19
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 19

def columns_data; end

#compute_fixed_offsets(leaf_columns) ⇒ Object



37
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 37

def compute_fixed_offsets(leaf_columns); end

#dimension_to_css(value) ⇒ Object



34
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 34

def dimension_to_css(value); end

#expand_column?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 62

def expand_column?
  expandable_config&.show_expand_column == true
end

#expandable?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 57

def expandable?
  !expandable_config.nil?
end

#expandable_configObject



25
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 25

def expandable_config; end

#generate_id(prefix = "") ⇒ Object



31
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 31

def generate_id(prefix = ""); end

#leaf_column_countObject



47
48
49
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 47

def leaf_column_count
  [ leaf_columns.size, 1 ].max
end

#leaf_columnsObject



40
41
42
43
44
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 40

def leaf_columns
  @leaf_columns = T.let(@leaf_columns, T.nilable(T::Array[HakumiComponents::Table::ColumnDefinition])) if defined?(@leaf_columns)
  @leaf_columns = T.let(nil, T.nilable(T::Array[HakumiComponents::Table::ColumnDefinition])) unless defined?(@leaf_columns)
  @leaf_columns ||= flatten_leaf_columns(normalized_columns)
end

#normalized_columnsObject



67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 67

def normalized_columns
  @normalized_columns = T.let(@normalized_columns, T.nilable(T::Array[HakumiComponents::Table::ColumnDefinition])) if defined?(@normalized_columns)
  @normalized_columns = T.let(nil, T.nilable(T::Array[HakumiComponents::Table::ColumnDefinition])) unless defined?(@normalized_columns)
  @normalized_columns ||= begin
    columns = normalize_columns(columns_data)
    columns = insert_drag_handle_column(columns)
    columns = insert_selection_column(columns)
    columns = insert_expand_column(columns)
    columns = columns.compact
    compute_fixed_offsets(flatten_leaf_columns(columns))
    columns
  end
end

#row_drag_configObject



28
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 28

def row_drag_config; end

#row_selection_configObject



22
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 22

def row_selection_config; end

#selection_column?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'app/components/hakumi_components/table/concerns/columns.rb', line 52

def selection_column?
  !row_selection_config.nil?
end