Class: HakumiComponents::Table::Column::Component

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

Constant Summary

Constants inherited from BaseComponent

BaseComponent::ControllerOptions, BaseComponent::DateInput, BaseComponent::DateLikeValue, BaseComponent::DimensionInput, BaseComponent::HtmlPayloadInput, BaseComponent::I18nOptionValue, BaseComponent::PresenceArray, BaseComponent::PresenceScalar, BaseComponent::PresenceValue, BaseComponent::RawHtmlInput, BaseComponent::SIZES, BaseComponent::SizeValue, BaseComponent::SymbolInput

Instance Method Summary collapse

Methods inherited from BaseComponent

#append_data_token, boolean_html_param, #build_inline_style, cast_boolean, #cast_boolean, #class_names, #component_classes, #data_attributes_from, #dimension_to_css, #ensure_dom_id!, float_html_param, #generate_id, #html_classes, html_param, html_primitive_param, #html_style, #i18n_scope, integer_html_param, #merge_attributes, #render_value, #size_to_pixels, #stimulus_attrs, string_html_param, string_or_symbol_array_html_param, symbol_html_param, #t_default, #translate_with_default, #validate_inclusion!, #validate_required!, #value_present?

Constructor Details

#initialize(title:, data_index: nil, key: nil, align: nil, width: nil, ellipsis: false, 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, **extra, &block) ⇒ Component

Returns a new instance of Component.



42
43
44
45
46
47
48
49
50
51
52
53
54
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
# File 'app/components/hakumi_components/table/column/component.rb', line 42

def initialize(
  title:,
  data_index: nil,
  key: nil,
  align: nil,
  width: nil,
  ellipsis: false,
  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,
  **extra,
  &block
)
  @title = T.let(title, HakumiComponents::Table::DefinitionTypes::DefinitionValue)
  @data_index = T.let(data_index, T.nilable(HakumiComponents::Table::DefinitionTypes::ColumnKey))
  @key = T.let(key, T.nilable(HakumiComponents::Table::DefinitionTypes::ColumnKey))
  @align = T.let(align, T.nilable(Symbol))
  @width = T.let(width, HakumiComponents::Table::DefinitionTypes::WidthValue)
  @ellipsis = T.let(ellipsis, HakumiComponents::Table::DefinitionTypes::DefinitionValue)
  @sorter = T.let(sorter, HakumiComponents::Table::DefinitionTypes::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, T.nilable(HakumiComponents::Table::DefinitionTypes::ScalarList))
  @default_filtered_value = T.let(default_filtered_value, T.nilable(HakumiComponents::Table::DefinitionTypes::ScalarList))
  @filter_mode = T.let(filter_mode, T.nilable(Symbol))
  @filter_search = T.let(filter_search, HakumiComponents::Table::DefinitionTypes::SearchValue)
  @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, HakumiComponents::Table::DefinitionTypes::DefinitionValue)
  @should_cell_update = T.let(should_cell_update, T.nilable(HakumiComponents::Table::DefinitionTypes::ColumnKey))
  @drag_handle = T.let(drag_handle, T::Boolean)
  @selection = T.let(selection, T::Boolean)
  @expand = T.let(expand, T::Boolean)
  @extra = T.let(extra, T::Hash[Symbol, HakumiComponents::Table::DefinitionTypes::DefinitionValue])
  @block = T.let(block, T.nilable(Proc))
end

Instance Method Details

#to_hObject



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'app/components/hakumi_components/table/column/component.rb', line 103

def to_h
  {
    title: @title,
    data_index: @data_index,
    key: @key,
    align: @align,
    width: @width,
    ellipsis: @ellipsis,
    sorter: @sorter,
    sort_directions: @sort_directions,
    sort_order: @sort_order,
    default_sort_order: @default_sort_order,
    filters: @filters,
    filter_multiple: @filter_multiple,
    filtered_value: @filtered_value,
    default_filtered_value: @default_filtered_value,
    filter_mode: @filter_mode,
    filter_search: @filter_search,
    hidden: @hidden,
    on_cell: @on_cell,
    class_name: @class_name,
    responsive: @responsive,
    fixed: @fixed,
    editable: @editable,
    should_cell_update: @should_cell_update,
    drag_handle: @drag_handle,
    selection: @selection,
    expand: @expand,
    render: @block
  }.merge(@extra)
end