Sha256: db6ab5c873553b77c44c7d4d9e7d55def9662f23a54d0f99ff29761fec436893

Contents?: true

Size: 949 Bytes

Versions: 4

Compression:

Stored size: 949 Bytes

Contents

require 'tao_ui/components/table/base_builder'
require 'tao_ui/components/table/table_builder'
require 'tao_ui/components/table/head_builder'
require 'tao_ui/components/table/body_builder'
require 'tao_ui/components/table/row_builder'

module TaoUi
  module Components
    class TableComponent < TaoOnRails::Components::Base

      def render &block
        if block_given?
          table_content = view.capture(builder, &block)
          table = view.content_tag('table', table_content, class: 'table')
          view.content_tag tag_name, table, html_options
        else
          super
        end
      end

      def self.component_name
        :table
      end

      private

      def builder
        @builder ||= Table::TableBuilder.new(view, {
          expandable: options[:expandable],
          selectable: options[:selectable]
        })
      end

      def default_options
        {class: 'tao-table'}
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tao_ui-0.2.10 lib/tao_ui/components/table_component.rb
tao_ui-0.2.9 lib/tao_ui/components/table_component.rb
tao_ui-0.2.8 lib/tao_ui/components/table_component.rb
tao_ui-0.2.7 lib/tao_ui/components/table_component.rb