srcdev-nuxt-forms 6.1.6 → 6.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
:checked="isChecked"
|
|
20
20
|
/>
|
|
21
21
|
<div class="symbol-wrapper" :class="[{ round }]">
|
|
22
|
-
<div class="symbol" :class="[{ round }]">
|
|
23
|
-
<div class="symbol-icon icon-on">
|
|
22
|
+
<div class="symbol" :class="[{ round }, { checked: isChecked }]">
|
|
23
|
+
<div class="symbol-icon icon-on" :class="{ active: isChecked }">
|
|
24
24
|
<slot name="iconOn">
|
|
25
25
|
<Icon name="material-symbols:circle-outline" class="icon" />
|
|
26
26
|
</slot>
|
|
27
27
|
</div>
|
|
28
28
|
|
|
29
|
-
<div class="symbol-icon icon-off">
|
|
29
|
+
<div class="symbol-icon icon-off" :class="{ active: !isChecked }">
|
|
30
30
|
<slot name="iconOff">
|
|
31
31
|
<Icon name="material-symbols:circle-outline" class="icon" />
|
|
32
32
|
</slot>
|
|
@@ -121,28 +121,6 @@ const toggleSwitchValue = () => {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
.toggle-switch-wrapper {
|
|
124
|
-
--theme-form-toggle-border-color: var(--blue-12);
|
|
125
|
-
--theme-form-toggle-border-width: 0.1rem;
|
|
126
|
-
--theme-form-toggle-outline-color: var(--gray-2);
|
|
127
|
-
--theme-form-toggle-outline-width: 0.1rem;
|
|
128
|
-
|
|
129
|
-
--_transition-duration: 0.4s;
|
|
130
|
-
--_switch-padding: 0.2rem;
|
|
131
|
-
--_icon-color: inherit;
|
|
132
|
-
--_icon-on-opacity: 0;
|
|
133
|
-
--_icon-off-opacity: 1;
|
|
134
|
-
--_icon-font-size: 2.4rem;
|
|
135
|
-
--_symbol-size: 3.4rem;
|
|
136
|
-
--_symbol-background-color: var(--blue-12);
|
|
137
|
-
--_symbol-outline-color: transparent;
|
|
138
|
-
--_symbol-outline-width: 1px;
|
|
139
|
-
--_symbol-margin-inline-start: 0;
|
|
140
|
-
--_symbol-checked-offset: calc(var(--_symbol-size) * 0.75);
|
|
141
|
-
|
|
142
|
-
&.use-default-icons {
|
|
143
|
-
--_icon-color: transparent;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
124
|
display: flex;
|
|
147
125
|
flex-direction: column;
|
|
148
126
|
|
|
@@ -152,61 +130,39 @@ const toggleSwitchValue = () => {
|
|
|
152
130
|
visibility: hidden;
|
|
153
131
|
}
|
|
154
132
|
|
|
155
|
-
&:has(input:checked) {
|
|
156
|
-
--_icon-on-opacity: 1;
|
|
157
|
-
--_icon-off-opacity: 0;
|
|
158
|
-
--_symbol-margin-inline-start: var(--_symbol-checked-offset);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
133
|
.symbol-wrapper {
|
|
162
|
-
/* background: blue; */
|
|
163
|
-
border: var(--theme-form-toggle-border-width) solid var(--theme-form-toggle-border-color);
|
|
164
|
-
outline: var(--theme-form-toggle-outline-width) solid var(--theme-form-toggle-outline-color);
|
|
165
|
-
border-radius: calc(
|
|
166
|
-
var(--_symbol-size) + calc(var(--theme-form-toggle-border-width) * 2) + calc(var(--_switch-padding) * 2)
|
|
167
|
-
);
|
|
168
134
|
display: inline-flex;
|
|
169
135
|
align-items: center;
|
|
170
136
|
justify-content: start;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
137
|
+
position: relative;
|
|
138
|
+
transition: background-color var(--theme-form-transition-duration);
|
|
139
|
+
|
|
140
|
+
&:hover {
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
}
|
|
176
143
|
|
|
177
144
|
.symbol {
|
|
178
145
|
display: inline-grid;
|
|
179
146
|
grid-template-areas: "icon";
|
|
180
147
|
place-content: center;
|
|
148
|
+
position: absolute;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
left: var(--_switch-padding);
|
|
181
151
|
|
|
182
152
|
aspect-ratio: 1/1;
|
|
183
|
-
/* width: var(--_symbol-size); */
|
|
184
|
-
padding: calc(calc(var(--_symbol-size) - var(--_icon-font-size)) / 2);
|
|
185
153
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
background-color: var(--_symbol-background-color);
|
|
191
|
-
|
|
192
|
-
overflow: clip;
|
|
193
|
-
|
|
194
|
-
transition: margin var(--_transition-duration);
|
|
154
|
+
&.checked {
|
|
155
|
+
left: calc(100% - var(--_symbol-size) - var(--_switch-padding) - (2 * var(--_toggle-symbol-border-width)));
|
|
156
|
+
}
|
|
195
157
|
|
|
196
158
|
.symbol-icon {
|
|
197
159
|
display: grid;
|
|
198
160
|
grid-area: icon;
|
|
199
161
|
place-content: center;
|
|
162
|
+
opacity: 0;
|
|
200
163
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
transition: opacity var(--_transition-duration);
|
|
204
|
-
|
|
205
|
-
&.icon-on {
|
|
206
|
-
opacity: var(--_icon-on-opacity);
|
|
207
|
-
}
|
|
208
|
-
&.icon-off {
|
|
209
|
-
opacity: var(--_icon-off-opacity);
|
|
164
|
+
&.active {
|
|
165
|
+
opacity: 1;
|
|
210
166
|
}
|
|
211
167
|
}
|
|
212
168
|
}
|
package/package.json
CHANGED