Module: Klods::Components::Table
- Included in:
- Builders
- Defined in:
- lib/klods/components/table.rb
Instance Method Summary collapse
- #table(a = nil, b = nil, &block) ⇒ Object
- #table_wrap(a = nil, b = nil, &block) ⇒ Object
- #tbody(a = nil, b = nil, &block) ⇒ Object
- #td(a = nil, b = nil, &block) ⇒ Object
- #th(a = nil, b = nil, &block) ⇒ Object
- #thead(a = nil, b = nil, &block) ⇒ Object
- #tr(a = nil, b = nil, &block) ⇒ Object
Instance Method Details
#table(a = nil, b = nil, &block) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/klods/components/table.rb', line 10 def table(a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.build( tag: "table", base: "klods-table", modifiers: { striped: "klods-table--striped", dense: "klods-table--dense" }, props: props, children: children ) end |
#table_wrap(a = nil, b = nil, &block) ⇒ Object
4 5 6 7 8 |
# File 'lib/klods/components/table.rb', line 4 def table_wrap(a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.build(tag: "div", base: "klods-table-wrap", props: props, children: children) end |
#tbody(a = nil, b = nil, &block) ⇒ Object
29 30 31 32 33 |
# File 'lib/klods/components/table.rb', line 29 def tbody(a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.el("tbody", props, children) end |
#td(a = nil, b = nil, &block) ⇒ Object
47 48 49 50 51 |
# File 'lib/klods/components/table.rb', line 47 def td(a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.el("td", props, children) end |
#th(a = nil, b = nil, &block) ⇒ Object
41 42 43 44 45 |
# File 'lib/klods/components/table.rb', line 41 def th(a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.el("th", props, children) end |
#thead(a = nil, b = nil, &block) ⇒ Object
23 24 25 26 27 |
# File 'lib/klods/components/table.rb', line 23 def thead(a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.el("thead", props, children) end |
#tr(a = nil, b = nil, &block) ⇒ Object
35 36 37 38 39 |
# File 'lib/klods/components/table.rb', line 35 def tr(a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.el("tr", props, children) end |