Class: UiBibz::Ui::Ux::Tables::Column

Inherits:
Core::Component show all
Defined in:
lib/ui_bibz/ui/ux/tables/components/column.rb

Constant Summary

Constants inherited from Core::Component

Core::Component::BREAKPOINTS, Core::Component::SIZES, Core::Component::STATUSES

Instance Attribute Summary collapse

Attributes inherited from Core::Component

#content, #html_options, #options

Attributes inherited from Base

#output_buffer

Instance Method Summary collapse

Methods inherited from Core::Component

#pre_render, #render, #tapped?

Methods included from PopoverExtension

#popover_data_html, #tooltip_data_html

Methods included from GlyphExtension

#generate_glyph, #glyph_and_content_html

Methods included from KlassExtension

#exclude_classes, #exclude_classes_in_html_options, #join_classes, #status

Methods inherited from Base

#generate_id, #i18n_set?, #inject_url

Constructor Details

#initialize(content = nil, options = nil, html_options = nil, &block) ⇒ Column

Returns a new instance of Column.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 9

def initialize(content = nil, options = nil, html_options = nil, &block)
  super
  @data_index    = @content
  @id            = @options[:column_id] || @data_index
  @name          = @options[:name]
  @link          = @options[:link] # for show or edit action
  @order         = @options[:order]
  @date_format   = @options[:date_format]
  @sort          = @options[:sort]
  @custom_sort   = @options[:custom_sort]
  @parent        = @options[:parent]
  @count         = @options[:count]
  @as            = @options[:as]
  @format        = @options[:format]
  @class         = @options[:class]
  @hidden        = @options[:hidden]
  @sortable      = @options[:sortable]
  @input_options = @options[:input_options]
  @progress_options = @options[:progress_options] || {}
end

Instance Attribute Details

#asObject

Returns the value of attribute as.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def as
  @as
end

#classObject

Returns the value of attribute class.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def class
  @class
end

#countObject

Returns the value of attribute count.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def count
  @count
end

#custom_sortObject

Returns the value of attribute custom_sort.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def custom_sort
  @custom_sort
end

#data_indexObject

Returns the value of attribute data_index.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def data_index
  @data_index
end

#date_formatObject

Returns the value of attribute date_format.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def date_format
  @date_format
end

#formatObject

Returns the value of attribute format.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def format
  @format
end

#hiddenObject

Returns the value of attribute hidden.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def hidden
  @hidden
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def id
  @id
end

#input_optionsObject

Returns the value of attribute input_options.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def input_options
  @input_options
end

Returns the value of attribute link.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def link
  @link
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def name
  @name
end

#parentObject

Returns the value of attribute parent.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def parent
  @parent
end

#progress_optionsObject

Returns the value of attribute progress_options.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def progress_options
  @progress_options
end

#sortObject

Returns the value of attribute sort.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def sort
  @sort
end

#sortableObject

Returns the value of attribute sortable.



5
6
7
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 5

def sortable
  @sortable
end

Instance Method Details

#hidden?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 38

def hidden?
  @hidden == true
end

#linkable?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 30

def linkable?
  !@link.nil?
end

#orderObject



34
35
36
# File 'lib/ui_bibz/ui/ux/tables/components/column.rb', line 34

def order
  @order || 0
end