srcdev-nuxt-forms 6.1.13 → 6.1.15
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.
|
@@ -13,7 +13,13 @@
|
|
|
13
13
|
ref="optionGroup"
|
|
14
14
|
>
|
|
15
15
|
<span class="sr-only">{{ option.label }}</span>
|
|
16
|
-
<Icon
|
|
16
|
+
<Icon
|
|
17
|
+
v-if="option.icon"
|
|
18
|
+
:name="option.icon"
|
|
19
|
+
class="option-icon"
|
|
20
|
+
:class="[option.id, { active: modelValue === option.value }]"
|
|
21
|
+
ref="optionIcons"
|
|
22
|
+
/>
|
|
17
23
|
<input
|
|
18
24
|
type="radio"
|
|
19
25
|
:id="option.id"
|
|
@@ -52,8 +58,8 @@ const props = defineProps({
|
|
|
52
58
|
},
|
|
53
59
|
},
|
|
54
60
|
stepAnimationDuration: {
|
|
55
|
-
type:
|
|
56
|
-
default:
|
|
61
|
+
type: String as PropType<string>,
|
|
62
|
+
default: "250ms",
|
|
57
63
|
},
|
|
58
64
|
styleClassPassthrough: {
|
|
59
65
|
type: Array as PropType<string[]>,
|
|
@@ -75,10 +81,13 @@ const selectedOptionIndex = computed(() => {
|
|
|
75
81
|
return fieldData.value.data.findIndex((option) => option.value === modelValue.value)
|
|
76
82
|
})
|
|
77
83
|
|
|
78
|
-
const setupDefaults = () => {
|
|
84
|
+
const setupDefaults = async () => {
|
|
79
85
|
if (Array.isArray(optionGroupRefs.value) && optionGroupRefs.value[0]) {
|
|
80
86
|
iconWidth.value = optionGroupRefs.value[0].getBoundingClientRect().width + "px"
|
|
81
87
|
}
|
|
88
|
+
|
|
89
|
+
await useSleep(250)
|
|
90
|
+
showMarker.value = true
|
|
82
91
|
}
|
|
83
92
|
|
|
84
93
|
onMounted(() => {
|
|
@@ -105,7 +114,7 @@ onMounted(() => {
|
|
|
105
114
|
--_select-scheme-group-background-image: none;
|
|
106
115
|
--_select-scheme-group-padding: 0.5rem;
|
|
107
116
|
--_scheme-icon-font-size: 2rem;
|
|
108
|
-
--_scheme-icon-colour: black;
|
|
117
|
+
/* --_scheme-icon-colour: black; */
|
|
109
118
|
|
|
110
119
|
&:has(input[value="auto"]:checked) {
|
|
111
120
|
--_select-scheme-group-background-color: transparent;
|
|
@@ -165,7 +174,7 @@ onMounted(() => {
|
|
|
165
174
|
.selected-option-marker {
|
|
166
175
|
aspect-ratio: 1;
|
|
167
176
|
width: v-bind(iconWidth);
|
|
168
|
-
transition: all
|
|
177
|
+
transition: all v-bind(stepAnimationDuration) ease-in-out;
|
|
169
178
|
background-color: var(--_select-scheme-group-background-color);
|
|
170
179
|
background-image: var(--_select-scheme-group-background-image);
|
|
171
180
|
border: var(--form-element-border-width) solid light-dark(var(--gray-12), var(--gray-0));
|
|
@@ -177,7 +186,7 @@ onMounted(() => {
|
|
|
177
186
|
v-bind(selectedOptionIndex) * v-bind(iconWidth) + (var(--_form-items-gap) * v-bind(selectedOptionIndex))
|
|
178
187
|
);
|
|
179
188
|
|
|
180
|
-
opacity:
|
|
189
|
+
opacity: 0;
|
|
181
190
|
|
|
182
191
|
&.show {
|
|
183
192
|
opacity: 1;
|
|
@@ -220,11 +229,30 @@ onMounted(() => {
|
|
|
220
229
|
.option-icon {
|
|
221
230
|
grid-area: icon-stack;
|
|
222
231
|
display: block;
|
|
223
|
-
color: light-dark(var(--gray-12), var(--gray-0));
|
|
224
232
|
font-size: var(--_scheme-icon-font-size);
|
|
225
233
|
|
|
226
|
-
|
|
227
|
-
|
|
234
|
+
&.auto {
|
|
235
|
+
color: light-dark(var(--gray-12), var(--gray-3));
|
|
236
|
+
|
|
237
|
+
&.active {
|
|
238
|
+
color: var(--gray-0);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&.light {
|
|
243
|
+
color: light-dark(var(--gray-12), var(--gray-3));
|
|
244
|
+
|
|
245
|
+
&.active {
|
|
246
|
+
color: var(--gray-0);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
&.dark {
|
|
251
|
+
color: light-dark(var(--gray-12), var(--gray-3));
|
|
252
|
+
|
|
253
|
+
&.active {
|
|
254
|
+
color: var(--gray-0);
|
|
255
|
+
}
|
|
228
256
|
}
|
|
229
257
|
|
|
230
258
|
&:hover {
|
|
@@ -242,7 +270,7 @@ onMounted(() => {
|
|
|
242
270
|
}
|
|
243
271
|
}
|
|
244
272
|
|
|
245
|
-
&:has(input[value="auto"]:checked) {
|
|
273
|
+
/* &:has(input[value="auto"]:checked) {
|
|
246
274
|
--_scheme-icon-colour: white;
|
|
247
275
|
}
|
|
248
276
|
|
|
@@ -252,7 +280,7 @@ onMounted(() => {
|
|
|
252
280
|
|
|
253
281
|
&:has(input[value="dark"]:checked) {
|
|
254
282
|
--_scheme-icon-colour: white;
|
|
255
|
-
}
|
|
283
|
+
} */
|
|
256
284
|
}
|
|
257
285
|
}
|
|
258
286
|
}
|
package/package.json
CHANGED