28 lines
981 B
Text
28 lines
981 B
Text
-# This partial renders a GlToggle root element.
|
|
-# To actually initialize the component, make sure to call the initToggle helper from ~/toggles.
|
|
|
|
- classes = local_assigns.fetch(:classes)
|
|
- name = local_assigns.fetch(:name, nil)
|
|
- is_checked = local_assigns.fetch(:is_checked, false).to_s
|
|
- disabled = local_assigns.fetch(:disabled, false).to_s
|
|
- is_loading = local_assigns.fetch(:is_loading, false).to_s
|
|
- label = local_assigns.fetch(:label, nil)
|
|
- help = local_assigns.fetch(:help, nil)
|
|
- label_position = local_assigns.fetch(:label_position, nil)
|
|
- data = local_assigns.fetch(:data, {})
|
|
|
|
%span{ class: classes,
|
|
data: { name: name,
|
|
is_checked: is_checked,
|
|
disabled: disabled,
|
|
is_loading: is_loading,
|
|
label: label,
|
|
help: help,
|
|
label_position: label_position,
|
|
**data } }
|
|
|
|
-# Leverage this block to render a rich help text. To render a plain text help text,
|
|
-# prefer the `help` parameter.
|
|
- if yield.present?
|
|
.gl-text-secondary.gl-mt-1
|
|
= yield
|