Sha256: 70519946462d03c70a794371e045263f0532b5d3b00357def24765b5f97e8579
Contents?: true
Size: 1.74 KB
Versions: 42
Compression:
Stored size: 1.74 KB
Contents
# frozen_string_literal: true require 'ui_bibz/ui/core/boxes/components/card_col' module UiBibz::Ui::Core::Boxes::Components # Create a card row # # ==== Attributes # # * +content+ - Content of element # * +options+ - Options of element # * +html_options+ - Html Options of element # # ==== Options # # You can add HTML attributes using the +html_options+. # You can pass arguments in options attribute: # # ==== Signatures # # UiBibz::Ui::Core::Boxes::CardRow.new(content, options = nil, html_options = nil) # # UiBibz::Ui::Core::Boxes::CardRow.new(options = nil, html_options = nil) do # content # end # # UiBibz::Ui::Core::Boxes::CardRow.new(options = nil, html_options = nil) do |row| # row.col do # content # end # end # # ==== Examples # # UiBibz::Ui::Core::Boxes::CardRow.new.render # # UiBibz::Ui::Core::Boxes::CardRow.new do # 'Exemple' # end.render # # UiBibz::Ui::Core::Boxes::CardRow.new do |row| # row.col do # 'Exemple' # end # end.render # class CardRow < UiBibz::Ui::Core::Layouts::Row # See UiBibz::Ui::Core::Component.initialize def initialize(content = nil, options = nil, html_options = nil, &block) super @items = [@content] end def pre_render content_tag :div, @items.join.html_safe, html_options end def col(content = nil, options = nil, html_options = nil, &block) @items << if tapped?(block) UiBibz::Ui::Core::Boxes::Components::CardCol.new(content, options, html_options).tap(&block).render else UiBibz::Ui::Core::Layouts::Col.new(content, options, html_options, &block).render end end end end
Version data entries
42 entries across 42 versions & 1 rubygems