Class: PhlexKit::DataTableSelectAllCheckbox
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::DataTableSelectAllCheckbox
- Defined in:
- app/components/phlex_kit/data_table/data_table_select_all_checkbox.rb
Overview
Header checkbox selecting every DataTableRowCheckbox on the page (the controller sets indeterminate for partial selections). See data_table.rb.
Instance Method Summary collapse
-
#initialize(label: "Select all", **attrs) ⇒ DataTableSelectAllCheckbox
constructor
A new instance of DataTableSelectAllCheckbox.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(label: "Select all", **attrs) ⇒ DataTableSelectAllCheckbox
Returns a new instance of DataTableSelectAllCheckbox.
5 6 7 8 |
# File 'app/components/phlex_kit/data_table/data_table_select_all_checkbox.rb', line 5 def initialize(label: "Select all", **attrs) @label = label @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/components/phlex_kit/data_table/data_table_select_all_checkbox.rb', line 10 def view_template base = { data: { phlex_kit__data_table_target: "selectAll", action: "change->phlex-kit--data-table#toggleAll" } } # label: kwarg (mirrors DataTableRowCheckbox); default only when the # caller didn't supply their own accessible name — `mix` fuses. base[:aria] = { label: @label } unless aria_labelled? render Checkbox.new(**mix(base, @attrs)) end |