Sha256: 27145c1ce40be01388aada509c38fa2b13c0cc3f06cfdb6389c01fcbfda32abc

Contents?: true

Size: 875 Bytes

Versions: 9

Compression:

Stored size: 875 Bytes

Contents

require_relative '../helpers/indented_grid'

Voom::Presenters.define(:tables) do
  helpers Demo::Helpers::IndentedGrid
  attach :top_nav
  attach :component_drawer

  helpers do
    def items
      [
          OpenStruct.new(material: 'Acrylic (Transparent)', quantity: 50, price: '$2.90'),
          OpenStruct.new(material: 'Plywood (Birch)', quantity: 10, price: '$1.25'),
          OpenStruct.new(material: 'Laminate (Gold on Blue)', quantity: 50, price: '$2.35')
      ]
    end
  end

  indented_grid do
    display 'Tables'

    table selectable: true do
      header do
        column 'Material'
        column 'Quantity'
        column 'Unit price'
      end

      items.each do |item|
        row do
          column item.material
          column item.quantity
          column item.price
        end
      end
    end

    attach :code, file: __FILE__
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
voom-presenters-0.1.8 app/demo/components/tables.pom
voom-presenters-0.1.7 app/demo/components/tables.pom
voom-presenters-0.1.6 app/demo/components/tables.pom
voom-presenters-0.1.5 app/demo/components/tables.pom
voom-presenters-0.1.4 app/demo/components/tables.pom
voom-presenters-0.1.3 app/demo/components/tables.pom
voom-presenters-0.1.2 app/demo/components/tables.pom
voom-presenters-0.1.1 app/demo/components/tables.pom
voom-presenters-0.1.0 app/demo/components/tables.pom