class UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh
Create a Button
Refrash
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:
-
status
- status of element with symbol value: (:primary
,:secondary
,:info
,:warning
,:danger
,:link
) -
size
(:xs
,:sm
,:lg
) -
outline
- Boolean -
state
- Symbol (:active
, +:disabled) -
glyph
- Add glyph with name or hash options-
name
- String -
size
- Integer -
type
- Symbol
-
-
connect
- Hash-
event
- String -
mode
- String -
target
- Hash-
selector
- String -
data
- Array -
url
- String
-
-
Signatures¶ ↑
UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new(content, options = nil, html_options = nil) UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new(options = nil, html_options = nil) do content end
Examples¶ ↑
UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new('test', type: :primary, size: :xs).render UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new(type: :primary) do test end.render
Public Instance Methods
pre_render()
click to toggle source
See UiBibz::Ui::Core::Component.initialize
# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 56 def pre_render button_refresh_html_tag end
Private Instance Methods
cnt_opts()
click to toggle source
# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 75 def cnt_opts { events: options[:connect].try(:[], :events) || 'click', mode: options[:connect].try(:[], :mode) || 'remote', target: { selector: options[:connect].try(:[], :target).try(:[], :selector) || '', url: options[:connect].try(:[], :target).try(:[], :url) || '', data: options[:connect].try(:[], :target).try(:[], :data) || [] } } end
component_html_classes()
click to toggle source
Calls superclass method
UiBibz::Ui::Core::Forms::Buttons::Button#component_html_classes
# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 71 def component_html_classes super << %w[input-refresh-button btn] end
component_options()
click to toggle source
Calls superclass method
UiBibz::Ui::Core::Component#component_options
# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 66 def component_options options[:connect] = cnt_opts super.merge({ glyph: 'sync-alt', status: options[:status] }) end
status()
click to toggle source
# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 87 def status "btn-#{options[:status] || :secondary}" end