Class: Ruflet::UI::Controls::RufletComponents::DataTableControl

Inherits:
Control
  • Object
show all
Defined in:
lib/ruflet_ui/ruflet/ui/controls/materials/datatable_control.rb

Constant Summary collapse

TYPE =
"datatable".freeze
WIRE =
"DataTable".freeze
KEYWORDS =
[:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :border, :border_radius, :bottom, :checkbox_horizontal_margin, :clip_behavior, :col, :column_spacing, :columns, :data, :data_row_color, :data_row_max_height, :data_row_min_height, :data_text_style, :disabled, :divider_thickness, :expand, :expand_loose, :gradient, :heading_row_color, :heading_row_height, :heading_text_style, :height, :horizontal_lines, :horizontal_margin, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rows, :rtl, :scale, :show_bottom_border, :show_checkbox_column, :size_change_interval, :sort_ascending, :sort_column_index, :tooltip, :top, :vertical_lines, :visible, :width, :on_animation_end, :on_select_all, :on_size_change].freeze

Constants inherited from Control

Control::HOST_EXPANDED_TYPES, Control::SCHEMA_METADATA_CACHE

Instance Attribute Summary

Attributes inherited from Control

#children, #id, #props, #runtime_page, #type, #wire_id

Instance Method Summary collapse

Methods inherited from Control

#attach_handler, #emit, generate_id, #has_handler?, #merge_props, #on, #to_patch

Constructor Details

#initialize(id: nil, **props) ⇒ DataTableControl

Returns a new instance of DataTableControl.



13
14
15
16
17
18
19
20
# File 'lib/ruflet_ui/ruflet/ui/controls/materials/datatable_control.rb', line 13

def initialize(id: nil, **props)
  compact = {}
  props.each do |key, value|
    raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
    compact[key] = value unless value.nil?
  end
  super(type: TYPE, id: id, **compact)
end