Sha256: 4367ce05e4e14268b12f7cd5f66bcec7d15910d74ab13fe8d283b7e4ac6f333f
Contents?: true
Size: 1.28 KB
Versions: 17
Compression:
Stored size: 1.28 KB
Contents
# frozen_string_literal: true module Katalyst module Tables module Cells class SelectComponent < CellComponent def initialize(params:, form_id:, **) super(**) @params = params @form_id = form_id end def label tag.label(tag.input(type: :checkbox)) end def rendered_value tag.label(tag.input(type: :checkbox)) end private def default_html_attributes if @row.header? { class: "selection", data: { "#{Selectable::TABLE_CONTROLLER}-target" => "header", action: "change->#{Selectable::TABLE_CONTROLLER}#toggleHeader", }, } else { class: "selection", data: { controller: Selectable::ITEM_CONTROLLER, action: "change->#{Selectable::ITEM_CONTROLLER}#change", "#{Selectable::ITEM_CONTROLLER}-params-value" => @params.to_json, "#{Selectable::ITEM_CONTROLLER}-#{Selectable::FORM_CONTROLLER}-outlet" => "##{@form_id}", "#{Selectable::TABLE_CONTROLLER}-target" => "item", }, } end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems