Sha256: 415b0a0602ac1d0e079d08199fe3afbbd12c3fda2df80166e186077db332b5db

Contents?: true

Size: 713 Bytes

Versions: 6

Compression:

Stored size: 713 Bytes

Contents

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

6 entries across 6 versions & 1 rubygems

Version Path
tao_ui-1.0.0.beta.1 lib/tao_ui/components/table_component.rb
tao_ui-0.3.4 lib/tao_ui/components/table_component.rb
tao_ui-0.3.3 lib/tao_ui/components/table_component.rb
tao_ui-0.3.2 lib/tao_ui/components/table_component.rb
tao_ui-0.3.1 lib/tao_ui/components/table_component.rb
tao_ui-0.3.0 lib/tao_ui/components/table_component.rb