Module: WildayUi::Components::Button::Features::Loading
- Included in:
- WildayUi::Components::Button::FeatureEngine
- Defined in:
- app/helpers/wilday_ui/components/button/features/loading.rb
Constant Summary collapse
- FEATURE_CONFIG =
{ wrapper_required: false, stimulus_controller: "button", default_stimulus_action: "click->button#toggleLoading" }.freeze
Class Method Summary collapse
Instance Method Summary collapse
- #setup_loading_data_attributes(options, loading_text) ⇒ Object
- #setup_loading_options(options, loading_text) ⇒ Object
Class Method Details
.feature_config ⇒ Object
12 13 14 |
# File 'app/helpers/wilday_ui/components/button/features/loading.rb', line 12 def self.feature_config { loading: FEATURE_CONFIG } end |
Instance Method Details
#setup_loading_data_attributes(options, loading_text) ⇒ Object
23 24 25 26 27 |
# File 'app/helpers/wilday_ui/components/button/features/loading.rb', line 23 def setup_loading_data_attributes(, loading_text) return unless loading_text.present? [:data] ||= {} [:data][:button_loading_text] = loading_text end |
#setup_loading_options(options, loading_text) ⇒ Object
16 17 18 19 20 21 |
# File 'app/helpers/wilday_ui/components/button/features/loading.rb', line 16 def (, loading_text) return unless loading_text.present? feature_config = FEATURE_CONFIG setup_feature_controller(, feature_config, loading_text) end |