Class: HakumiComponents::Table::ColumnDefinition

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
app/components/hakumi_components/table/column_definition.rb

Constant Summary collapse

ColumnKey =
T.type_alias { HakumiComponents::Table::DefinitionTypes::ColumnKey }
WidthValue =
T.type_alias { HakumiComponents::Table::DefinitionTypes::WidthValue }
SorterValue =
T.type_alias { HakumiComponents::Table::DefinitionTypes::SorterValue }
FilterValues =
T.type_alias { T.nilable(HakumiComponents::Table::DefinitionTypes::ScalarList) }
FilterSearchValue =
T.type_alias { HakumiComponents::Table::DefinitionTypes::SearchValue }
SortValue =
T.type_alias { HakumiComponents::Table::DefinitionTypes::SortValue }
EllipsisValue =
T.type_alias do
  T.nilable(T.any(
    HakumiComponents::Table::DefinitionTypes::DefinitionValue,
    HakumiComponents::Table::EllipsisConfig
  ))
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title:, key:, data_index: nil, align: nil, width: nil, ellipsis: nil, sorter: nil, sort_directions: nil, sort_order: nil, default_sort_order: nil, filters: nil, filter_multiple: true, filtered_value: nil, default_filtered_value: nil, filter_mode: nil, filter_search: nil, hidden: false, on_cell: nil, class_name: nil, responsive: nil, fixed: nil, editable: nil, should_cell_update: nil, drag_handle: false, selection: false, expand: false, render: nil, sort_value: nil, children: []) ⇒ ColumnDefinition

Returns a new instance of ColumnDefinition.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'app/components/hakumi_components/table/column_definition.rb', line 55

def initialize(
  title:,
  key:,
  data_index: nil,
  align: nil,
  width: nil,
  ellipsis: nil,
  sorter: nil,
  sort_directions: nil,
  sort_order: nil,
  default_sort_order: nil,
  filters: nil,
  filter_multiple: true,
  filtered_value: nil,
  default_filtered_value: nil,
  filter_mode: nil,
  filter_search: nil,
  hidden: false,
  on_cell: nil,
  class_name: nil,
  responsive: nil,
  fixed: nil,
  editable: nil,
  should_cell_update: nil,
  drag_handle: false,
  selection: false,
  expand: false,
  render: nil,
  sort_value: nil,
  children: []
)
  @title = T.let(title, HakumiComponents::Table::DefinitionTypes::DefinitionValue)
  @key = T.let(key, ColumnKey)
  @data_index = T.let(data_index, T.nilable(ColumnKey))
  @align = T.let(align, T.nilable(Symbol))
  @width = T.let(width, WidthValue)
  @ellipsis = T.let(ellipsis, EllipsisValue)
  @sorter = T.let(sorter, SorterValue)
  @sort_directions = T.let(sort_directions, T.nilable(T::Array[Symbol]))
  @sort_order = T.let(sort_order, T.nilable(Symbol))
  @default_sort_order = T.let(default_sort_order, T.nilable(Symbol))
  @filters = T.let(filters, T.nilable(T::Array[HakumiComponents::Table::DefinitionTypes::DefinitionHash]))
  @filter_multiple = T.let(filter_multiple, T::Boolean)
  @filtered_value = T.let(filtered_value, FilterValues)
  @default_filtered_value = T.let(default_filtered_value, FilterValues)
  @filter_mode = T.let(filter_mode, T.nilable(Symbol))
  @filter_search = T.let(filter_search, FilterSearchValue)
  @hidden = T.let(hidden, T::Boolean)
  @on_cell = T.let(on_cell, T.nilable(Proc))
  @class_name = T.let(class_name, T.nilable(String))
  @responsive = T.let(responsive, T.nilable(T::Array[Symbol]))
  @fixed = T.let(fixed, T.nilable(Symbol))
  @editable = T.let(editable, T.nilable(HakumiComponents::Table::Configs::ColumnEditable))
  @should_cell_update = T.let(should_cell_update, T.nilable(String))
  @drag_handle = T.let(drag_handle, T::Boolean)
  @selection = T.let(selection, T::Boolean)
  @expand = T.let(expand, T::Boolean)
  @render = T.let(render, T.nilable(Proc))
  @sort_value = T.let(sort_value, SortValue)
  @children = T.let(children, T::Array[HakumiComponents::Table::ColumnDefinition])
end

Instance Attribute Details

#alignObject (readonly)

Returns the value of attribute align.



133
134
135
# File 'app/components/hakumi_components/table/column_definition.rb', line 133

def align
  @align
end

#childrenObject (readonly)

Returns the value of attribute children.



163
164
165
# File 'app/components/hakumi_components/table/column_definition.rb', line 163

def children
  @children
end

#class_nameObject (readonly)

Returns the value of attribute class_name.



157
158
159
# File 'app/components/hakumi_components/table/column_definition.rb', line 157

def class_name
  @class_name
end

#data_indexObject (readonly)

Returns the value of attribute data_index.



130
131
132
# File 'app/components/hakumi_components/table/column_definition.rb', line 130

def data_index
  @data_index
end

#default_filtered_valueObject (readonly)

Returns the value of attribute default_filtered_value.



151
152
153
# File 'app/components/hakumi_components/table/column_definition.rb', line 151

def default_filtered_value
  @default_filtered_value
end

#default_sort_orderObject (readonly)

Returns the value of attribute default_sort_order.



133
134
135
# File 'app/components/hakumi_components/table/column_definition.rb', line 133

def default_sort_order
  @default_sort_order
end

#drag_handleObject (readonly)

Returns the value of attribute drag_handle.



148
149
150
# File 'app/components/hakumi_components/table/column_definition.rb', line 148

def drag_handle
  @drag_handle
end

#editableObject (readonly)

Returns the value of attribute editable.



121
122
123
# File 'app/components/hakumi_components/table/column_definition.rb', line 121

def editable
  @editable
end

#ellipsisObject (readonly)

Returns the value of attribute ellipsis.



124
125
126
# File 'app/components/hakumi_components/table/column_definition.rb', line 124

def ellipsis
  @ellipsis
end

#expandObject (readonly)

Returns the value of attribute expand.



148
149
150
# File 'app/components/hakumi_components/table/column_definition.rb', line 148

def expand
  @expand
end

#filter_modeObject (readonly)

Returns the value of attribute filter_mode.



133
134
135
# File 'app/components/hakumi_components/table/column_definition.rb', line 133

def filter_mode
  @filter_mode
end

#filter_multipleObject (readonly)

Returns the value of attribute filter_multiple.



148
149
150
# File 'app/components/hakumi_components/table/column_definition.rb', line 148

def filter_multiple
  @filter_multiple
end

#filter_searchObject (readonly)

Returns the value of attribute filter_search.



139
140
141
# File 'app/components/hakumi_components/table/column_definition.rb', line 139

def filter_search
  @filter_search
end

#filtered_valueObject (readonly)

Returns the value of attribute filtered_value.



151
152
153
# File 'app/components/hakumi_components/table/column_definition.rb', line 151

def filtered_value
  @filtered_value
end

#filtersObject (readonly)

Returns the value of attribute filters.



145
146
147
# File 'app/components/hakumi_components/table/column_definition.rb', line 145

def filters
  @filters
end

#fixedObject (readonly)

Returns the value of attribute fixed.



133
134
135
# File 'app/components/hakumi_components/table/column_definition.rb', line 133

def fixed
  @fixed
end

#hiddenObject (readonly)

Returns the value of attribute hidden.



148
149
150
# File 'app/components/hakumi_components/table/column_definition.rb', line 148

def hidden
  @hidden
end

#keyObject (readonly)

Returns the value of attribute key.



127
128
129
# File 'app/components/hakumi_components/table/column_definition.rb', line 127

def key
  @key
end

#on_cellObject (readonly)

Returns the value of attribute on_cell.



154
155
156
# File 'app/components/hakumi_components/table/column_definition.rb', line 154

def on_cell
  @on_cell
end

#renderObject (readonly)

Returns the value of attribute render.



154
155
156
# File 'app/components/hakumi_components/table/column_definition.rb', line 154

def render
  @render
end

#responsiveObject (readonly)

Returns the value of attribute responsive.



142
143
144
# File 'app/components/hakumi_components/table/column_definition.rb', line 142

def responsive
  @responsive
end

#selectionObject (readonly)

Returns the value of attribute selection.



148
149
150
# File 'app/components/hakumi_components/table/column_definition.rb', line 148

def selection
  @selection
end

#should_cell_updateObject (readonly)

Returns the value of attribute should_cell_update.



157
158
159
# File 'app/components/hakumi_components/table/column_definition.rb', line 157

def should_cell_update
  @should_cell_update
end

#sort_directionsObject (readonly)

Returns the value of attribute sort_directions.



142
143
144
# File 'app/components/hakumi_components/table/column_definition.rb', line 142

def sort_directions
  @sort_directions
end

#sort_orderObject (readonly)

Returns the value of attribute sort_order.



133
134
135
# File 'app/components/hakumi_components/table/column_definition.rb', line 133

def sort_order
  @sort_order
end

#sort_valueObject (readonly)

Returns the value of attribute sort_value.



160
161
162
# File 'app/components/hakumi_components/table/column_definition.rb', line 160

def sort_value
  @sort_value
end

#sorterObject (readonly)

Returns the value of attribute sorter.



139
140
141
# File 'app/components/hakumi_components/table/column_definition.rb', line 139

def sorter
  @sorter
end

#titleObject (readonly)

Returns the value of attribute title.



118
119
120
# File 'app/components/hakumi_components/table/column_definition.rb', line 118

def title
  @title
end

#widthObject (readonly)

Returns the value of attribute width.



136
137
138
# File 'app/components/hakumi_components/table/column_definition.rb', line 136

def width
  @width
end

Instance Method Details

#drag_handle?Boolean

Returns:

  • (Boolean)


176
177
178
# File 'app/components/hakumi_components/table/column_definition.rb', line 176

def drag_handle?
  @drag_handle
end

#expand?Boolean

Returns:

  • (Boolean)


171
172
173
# File 'app/components/hakumi_components/table/column_definition.rb', line 171

def expand?
  @expand
end

#selection?Boolean

Returns:

  • (Boolean)


166
167
168
# File 'app/components/hakumi_components/table/column_definition.rb', line 166

def selection?
  @selection
end