Sha256: abed96f9fe7f1866432808013ebb448fe164369949132ea5f1a730181b8f0587

Contents?: true

Size: 433 Bytes

Versions: 3

Compression:

Stored size: 433 Bytes

Contents

# frozen_string_literal: true

module Phlexi
  module Table
    module Components
      class SelectionColumn < Column
        def header_cell
          SelectionCell.new("all")
        end

        def data_cell(wrapped_object)
          SelectionCell.new(wrapped_object.field(key).dom.value)
        end

        def data_cell_attributes(wrapped_object)
          {scope: :row}.merge(super)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
phlexi-table-0.0.5 lib/phlexi/table/components/selection_column.rb
phlexi-table-0.0.4 lib/phlexi/table/components/selection_column.rb
phlexi-table-0.0.3 lib/phlexi/table/components/selection_column.rb