Class: JetUi::Table::Component
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- JetUi::Table::Component
- Defined in:
- app/components/jet_ui/table/component.rb
Constant Summary collapse
- SIZES =
%i[xs sm md lg].freeze
- DEFAULT_SIZE =
:md
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(bordered: false, full: true, size: DEFAULT_SIZE, hovered: false, **options) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(bordered: false, full: true, size: DEFAULT_SIZE, hovered: false, **options) ⇒ Component
Returns a new instance of Component.
9 10 11 12 13 14 15 |
# File 'app/components/jet_ui/table/component.rb', line 9 def initialize(bordered: false, full: true, size: DEFAULT_SIZE, hovered: false, **) @bordered = bordered @full = full @size = SIZES.include?(size) ? size : DEFAULT_SIZE @hovered = hovered @options = end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 |
# File 'app/components/jet_ui/table/component.rb', line 17 def call content_tag :div, class: 'scroller scroller-x' do content_tag :table, content, class: classes, **@options end end |