srcdev-nuxt-forms 6.1.0 → 6.1.2
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.
- package/app/assets/styles/extends-layer/srcdev-forms/components/_input-description.css +13 -0
- package/app/assets/styles/extends-layer/srcdev-forms/components/index.css +10 -9
- package/app/assets/styles/setup/theming/themes/_default.css +3 -0
- package/app/assets/styles/setup/theming/themes/_error.css +4 -1
- package/app/assets/styles/setup/theming/themes/_secondary.css +4 -1
- package/app/assets/styles/setup/theming/themes/_success.css +4 -1
- package/app/assets/styles/setup/theming/themes/_warning.css +4 -1
- package/app/assets/styles/setup/utility-classes/_margin.css +334 -0
- package/app/assets/styles/setup/utility-classes/_padding.css +308 -0
- package/app/assets/styles/setup/utility-classes/index.css +4 -2
- package/app/components/forms/form-fieldset/FormFieldset.vue +19 -10
- package/app/components/forms/input-button/InputButtonCore.vue +25 -28
- package/app/components/forms/input-checkbox/MultipleCheckboxes.vue +48 -38
- package/app/components/forms/input-checkbox/SingleCheckbox.vue +52 -33
- package/app/components/forms/input-checkbox-radio/InputCheckboxRadioButton.vue +40 -22
- package/app/components/forms/input-checkbox-radio/InputCheckboxRadioWithLabel.vue +33 -17
- package/app/components/forms/input-description/InputDescription.vue +71 -0
- package/app/components/forms/input-label/InputLabel.vue +14 -12
- package/app/components/forms/input-number/InputNumberCore.vue +26 -22
- package/app/components/forms/input-number/variants/InputNumberDefault.vue +50 -27
- package/app/components/forms/input-radio/MultipleRadiobuttons.vue +31 -25
- package/app/components/forms/input-range/InputRangeCore.vue +30 -28
- package/app/components/forms/input-range/variants/InputRangeDefault.vue +45 -28
- package/app/components/forms/input-range-fancy/InputRangeFancyWithLabel.vue +31 -18
- package/app/components/forms/input-select/variants/InputSelectWithLabel.vue +80 -45
- package/app/components/forms/input-text/InputTextCore.vue +4 -6
- package/app/components/forms/input-text/variants/InputTextAsNumberWithLabel.vue +42 -33
- package/app/components/forms/input-text/variants/InputTextWithLabel.vue +83 -50
- package/app/components/forms/input-textarea/InputTextareaCore.vue +34 -25
- package/app/components/forms/input-textarea/variants/InputTextareaWithLabel.vue +100 -50
- package/app/components/forms/toggle-switch/ToggleSwitchCore.vue +43 -25
- package/app/components/forms/toggle-switch/ToggleSwitchCoreOld.vue +36 -22
- package/app/components/forms/toggle-switch/variants/ToggleSwitchWithLabel.vue +42 -25
- package/app/components/forms/toggle-switch/variants/ToggleSwitchWithLabelInline.vue +30 -26
- package/package.json +1 -1
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/* Padding */
|
|
2
|
+
.p-0 {
|
|
3
|
+
padding: 0;
|
|
4
|
+
}
|
|
5
|
+
.pbs-0 {
|
|
6
|
+
padding-block-start: 0;
|
|
7
|
+
}
|
|
8
|
+
.pbe-0 {
|
|
9
|
+
padding-block-end: 0;
|
|
10
|
+
}
|
|
11
|
+
.pis-0 {
|
|
12
|
+
padding-inline-start: 0;
|
|
13
|
+
}
|
|
14
|
+
.pie-0 {
|
|
15
|
+
padding-inline-end: 0;
|
|
16
|
+
}
|
|
17
|
+
.pi-0 {
|
|
18
|
+
padding-inline: 0;
|
|
19
|
+
}
|
|
20
|
+
.pb-0 {
|
|
21
|
+
padding-block: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.p-1 {
|
|
25
|
+
padding: 0.1rem;
|
|
26
|
+
}
|
|
27
|
+
.pbs-1 {
|
|
28
|
+
padding-block-start: 0.1rem;
|
|
29
|
+
}
|
|
30
|
+
.pbe-1 {
|
|
31
|
+
padding-block-end: 0.1rem;
|
|
32
|
+
}
|
|
33
|
+
.pis-1 {
|
|
34
|
+
padding-inline-start: 0.1rem;
|
|
35
|
+
}
|
|
36
|
+
.pie-1 {
|
|
37
|
+
padding-inline-end: 0.1rem;
|
|
38
|
+
}
|
|
39
|
+
.pi-1 {
|
|
40
|
+
padding-inline: 0.1rem;
|
|
41
|
+
}
|
|
42
|
+
.pb-1 {
|
|
43
|
+
padding-block: 0.1rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.p-2 {
|
|
47
|
+
padding: 0.2rem;
|
|
48
|
+
}
|
|
49
|
+
.pbs-2 {
|
|
50
|
+
padding-block-start: 0.2rem;
|
|
51
|
+
}
|
|
52
|
+
.pbe-2 {
|
|
53
|
+
padding-block-end: 0.2rem;
|
|
54
|
+
}
|
|
55
|
+
.pis-2 {
|
|
56
|
+
padding-inline-start: 0.2rem;
|
|
57
|
+
}
|
|
58
|
+
.pie-2 {
|
|
59
|
+
padding-inline-end: 0.2rem;
|
|
60
|
+
}
|
|
61
|
+
.pi-2 {
|
|
62
|
+
padding-inline: 0.2rem;
|
|
63
|
+
}
|
|
64
|
+
.pb-2 {
|
|
65
|
+
padding-block: 0.2rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.p-4 {
|
|
69
|
+
padding: 0.4rem;
|
|
70
|
+
}
|
|
71
|
+
.pbs-4 {
|
|
72
|
+
padding-block-start: 0.4rem;
|
|
73
|
+
}
|
|
74
|
+
.pbe-4 {
|
|
75
|
+
padding-block-end: 0.4rem;
|
|
76
|
+
}
|
|
77
|
+
.pis-4 {
|
|
78
|
+
padding-inline-start: 0.4rem;
|
|
79
|
+
}
|
|
80
|
+
.pie-4 {
|
|
81
|
+
padding-inline-end: 0.4rem;
|
|
82
|
+
}
|
|
83
|
+
.pi-4 {
|
|
84
|
+
padding-inline: 0.4rem;
|
|
85
|
+
}
|
|
86
|
+
.pb-4 {
|
|
87
|
+
padding-block: 0.4rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.p-6 {
|
|
91
|
+
padding: 0.6rem;
|
|
92
|
+
}
|
|
93
|
+
.pbs-6 {
|
|
94
|
+
padding-block-start: 0.6rem;
|
|
95
|
+
}
|
|
96
|
+
.pbe-6 {
|
|
97
|
+
padding-block-end: 0.6rem;
|
|
98
|
+
}
|
|
99
|
+
.pis-6 {
|
|
100
|
+
padding-inline-start: 0.6rem;
|
|
101
|
+
}
|
|
102
|
+
.pie-6 {
|
|
103
|
+
padding-inline-end: 0.6rem;
|
|
104
|
+
}
|
|
105
|
+
.pi-6 {
|
|
106
|
+
padding-inline: 0.6rem;
|
|
107
|
+
}
|
|
108
|
+
.pb-6 {
|
|
109
|
+
padding-block: 0.6rem;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.p-8 {
|
|
113
|
+
padding: 0.8rem;
|
|
114
|
+
}
|
|
115
|
+
.pbs-8 {
|
|
116
|
+
padding-block-start: 0.8rem;
|
|
117
|
+
}
|
|
118
|
+
.pbe-8 {
|
|
119
|
+
padding-block-end: 0.8rem;
|
|
120
|
+
}
|
|
121
|
+
.pis-8 {
|
|
122
|
+
padding-inline-start: 0.8rem;
|
|
123
|
+
}
|
|
124
|
+
.pie-8 {
|
|
125
|
+
padding-inline-end: 0.8rem;
|
|
126
|
+
}
|
|
127
|
+
.pi-8 {
|
|
128
|
+
padding-inline: 0.8rem;
|
|
129
|
+
}
|
|
130
|
+
.pb-8 {
|
|
131
|
+
padding-block: 0.8rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.p-10 {
|
|
135
|
+
padding: 1rem;
|
|
136
|
+
}
|
|
137
|
+
.pbs-10 {
|
|
138
|
+
padding-block-start: 1rem;
|
|
139
|
+
}
|
|
140
|
+
.pbe-10 {
|
|
141
|
+
padding-block-end: 1rem;
|
|
142
|
+
}
|
|
143
|
+
.pis-10 {
|
|
144
|
+
padding-inline-start: 1rem;
|
|
145
|
+
}
|
|
146
|
+
.pie-10 {
|
|
147
|
+
padding-inline-end: 1rem;
|
|
148
|
+
}
|
|
149
|
+
.pi-10 {
|
|
150
|
+
padding-inline: 1rem;
|
|
151
|
+
}
|
|
152
|
+
.pb-10 {
|
|
153
|
+
padding-block: 1rem;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.p-12 {
|
|
157
|
+
padding: 1.2rem;
|
|
158
|
+
}
|
|
159
|
+
.pbs-12 {
|
|
160
|
+
padding-block-start: 1.2rem;
|
|
161
|
+
}
|
|
162
|
+
.pbe-12 {
|
|
163
|
+
padding-block-end: 1.2rem;
|
|
164
|
+
}
|
|
165
|
+
.pis-12 {
|
|
166
|
+
padding-inline-start: 1.2rem;
|
|
167
|
+
}
|
|
168
|
+
.pie-12 {
|
|
169
|
+
padding-inline-end: 1.2rem;
|
|
170
|
+
}
|
|
171
|
+
.pi-12 {
|
|
172
|
+
padding-inline: 1.2rem;
|
|
173
|
+
}
|
|
174
|
+
.pb-12 {
|
|
175
|
+
padding-block: 1.2rem;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.p-18 {
|
|
179
|
+
padding: 1.8rem;
|
|
180
|
+
}
|
|
181
|
+
.pbs-18 {
|
|
182
|
+
padding-block-start: 1.8rem;
|
|
183
|
+
}
|
|
184
|
+
.pbe-18 {
|
|
185
|
+
padding-block-end: 1.8rem;
|
|
186
|
+
}
|
|
187
|
+
.pis-18 {
|
|
188
|
+
padding-inline-start: 1.8rem;
|
|
189
|
+
}
|
|
190
|
+
.pie-18 {
|
|
191
|
+
padding-inline-end: 1.8rem;
|
|
192
|
+
}
|
|
193
|
+
.pi-18 {
|
|
194
|
+
padding-inline: 1.8rem;
|
|
195
|
+
}
|
|
196
|
+
.pb-18 {
|
|
197
|
+
padding-block: 1.8rem;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.p-20 {
|
|
201
|
+
padding: 2rem;
|
|
202
|
+
}
|
|
203
|
+
.pbs-20 {
|
|
204
|
+
padding-block-start: 2rem;
|
|
205
|
+
}
|
|
206
|
+
.pbe-20 {
|
|
207
|
+
padding-block-end: 2rem;
|
|
208
|
+
}
|
|
209
|
+
.pis-20 {
|
|
210
|
+
padding-inline-start: 2rem;
|
|
211
|
+
}
|
|
212
|
+
.pie-20 {
|
|
213
|
+
padding-inline-end: 2rem;
|
|
214
|
+
}
|
|
215
|
+
.pi-20 {
|
|
216
|
+
padding-inline: 2rem;
|
|
217
|
+
}
|
|
218
|
+
.pb-20 {
|
|
219
|
+
padding-block: 2rem;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.p-24 {
|
|
223
|
+
padding: 2.4rem;
|
|
224
|
+
}
|
|
225
|
+
.pbs-24 {
|
|
226
|
+
padding-block-start: 2.4rem;
|
|
227
|
+
}
|
|
228
|
+
.pbe-24 {
|
|
229
|
+
padding-block-end: 2.4rem;
|
|
230
|
+
}
|
|
231
|
+
.pis-24 {
|
|
232
|
+
padding-inline-start: 2.4rem;
|
|
233
|
+
}
|
|
234
|
+
.pie-24 {
|
|
235
|
+
padding-inline-end: 2.4rem;
|
|
236
|
+
}
|
|
237
|
+
.pi-24 {
|
|
238
|
+
padding-inline: 2.4rem;
|
|
239
|
+
}
|
|
240
|
+
.pb-24 {
|
|
241
|
+
padding-block: 2.4rem;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.p-32 {
|
|
245
|
+
padding: 3.2rem;
|
|
246
|
+
}
|
|
247
|
+
.pbs-32 {
|
|
248
|
+
padding-block-start: 3.2rem;
|
|
249
|
+
}
|
|
250
|
+
.pbe-32 {
|
|
251
|
+
padding-block-end: 3.2rem;
|
|
252
|
+
}
|
|
253
|
+
.pis-32 {
|
|
254
|
+
padding-inline-start: 3.2rem;
|
|
255
|
+
}
|
|
256
|
+
.pie-32 {
|
|
257
|
+
padding-inline-end: 3.2rem;
|
|
258
|
+
}
|
|
259
|
+
.pi-32 {
|
|
260
|
+
padding-inline: 3.2rem;
|
|
261
|
+
}
|
|
262
|
+
.pb-32 {
|
|
263
|
+
padding-block: 3.2rem;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.p-40 {
|
|
267
|
+
padding: 4rem;
|
|
268
|
+
}
|
|
269
|
+
.pbs-40 {
|
|
270
|
+
padding-block-start: 4rem;
|
|
271
|
+
}
|
|
272
|
+
.pbe-40 {
|
|
273
|
+
padding-block-end: 4rem;
|
|
274
|
+
}
|
|
275
|
+
.pis-40 {
|
|
276
|
+
padding-inline-start: 4rem;
|
|
277
|
+
}
|
|
278
|
+
.pie-40 {
|
|
279
|
+
padding-inline-end: 4rem;
|
|
280
|
+
}
|
|
281
|
+
.pi-40 {
|
|
282
|
+
padding-inline: 4rem;
|
|
283
|
+
}
|
|
284
|
+
.pb-40 {
|
|
285
|
+
padding-block: 4rem;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.p-60 {
|
|
289
|
+
padding: 6rem;
|
|
290
|
+
}
|
|
291
|
+
.pbs-60 {
|
|
292
|
+
padding-block-start: 6rem;
|
|
293
|
+
}
|
|
294
|
+
.pbe-60 {
|
|
295
|
+
padding-block-end: 6rem;
|
|
296
|
+
}
|
|
297
|
+
.pis-60 {
|
|
298
|
+
padding-inline-start: 6rem;
|
|
299
|
+
}
|
|
300
|
+
.pie-60 {
|
|
301
|
+
padding-inline-end: 6rem;
|
|
302
|
+
}
|
|
303
|
+
.pi-60 {
|
|
304
|
+
padding-inline: 6rem;
|
|
305
|
+
}
|
|
306
|
+
.pb-60 {
|
|
307
|
+
padding-block: 6rem;
|
|
308
|
+
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<fieldset
|
|
3
|
-
|
|
2
|
+
<fieldset
|
|
3
|
+
:aria-required="required"
|
|
4
|
+
:aria-invalid="fieldHasError"
|
|
5
|
+
role="radiogroup"
|
|
6
|
+
:id
|
|
7
|
+
:name
|
|
8
|
+
class="form-fieldset"
|
|
9
|
+
:class="[elementClasses, { error: fieldHasError }]"
|
|
10
|
+
:data-testid="dataTestid"
|
|
11
|
+
>
|
|
12
|
+
<legend v-if="legend" class="form-fieldset-legend" :class="[{ 'has-description': slots.description }]">
|
|
4
13
|
<slot name="legend">{{ legend }}</slot>
|
|
5
14
|
</legend>
|
|
6
15
|
|
|
7
|
-
<div v-if="
|
|
16
|
+
<div v-if="slots.description" class="form-fieldset-description" :id="`${id}-description`">
|
|
8
17
|
<slot name="description"></slot>
|
|
9
18
|
</div>
|
|
10
19
|
|
|
@@ -28,7 +37,7 @@ const props = defineProps({
|
|
|
28
37
|
},
|
|
29
38
|
legend: {
|
|
30
39
|
type: String,
|
|
31
|
-
default:
|
|
40
|
+
default: "",
|
|
32
41
|
},
|
|
33
42
|
required: {
|
|
34
43
|
type: Boolean,
|
|
@@ -40,18 +49,18 @@ const props = defineProps({
|
|
|
40
49
|
},
|
|
41
50
|
dataTestid: {
|
|
42
51
|
type: String,
|
|
43
|
-
default:
|
|
52
|
+
default: "",
|
|
44
53
|
},
|
|
45
54
|
styleClassPassthrough: {
|
|
46
55
|
type: Array as PropType<string[]>,
|
|
47
56
|
default: () => [],
|
|
48
57
|
},
|
|
49
|
-
})
|
|
58
|
+
})
|
|
50
59
|
|
|
51
|
-
const slots = useSlots()
|
|
52
|
-
const hasDescriptionSlot = computed(() => slots.description !== undefined);
|
|
53
|
-
const hasDescription = computed(() => slots.description !== undefined)
|
|
54
|
-
const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
60
|
+
const slots = useSlots()
|
|
61
|
+
// const hasDescriptionSlot = computed(() => slots.description !== undefined);
|
|
62
|
+
const hasDescription = computed(() => slots.description !== undefined)
|
|
63
|
+
const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
55
64
|
</script>
|
|
56
65
|
|
|
57
66
|
<style lang="css">
|
|
@@ -7,21 +7,21 @@
|
|
|
7
7
|
:data-theme="theme"
|
|
8
8
|
:data-size="size"
|
|
9
9
|
class="input-button-core"
|
|
10
|
-
:class="[`btn-${type}`, effectClass, elementClasses, { 'icon-only':
|
|
10
|
+
:class="[`btn-${type}`, effectClass, elementClasses, { 'icon-only': slots.iconOnly }]"
|
|
11
11
|
>
|
|
12
12
|
<span v-if="useEffect && effect == 'fancy'" class="fancy"></span>
|
|
13
|
-
<template v-if="
|
|
13
|
+
<template v-if="slots.left && !slots.iconOnly">
|
|
14
14
|
<span class="btn-icon left">
|
|
15
15
|
<slot name="left"></slot>
|
|
16
16
|
</span>
|
|
17
17
|
</template>
|
|
18
|
-
<span class="btn-text" :class="[weight, { 'sr-only':
|
|
19
|
-
<template v-if="
|
|
18
|
+
<span class="btn-text" :class="[weight, { 'sr-only': slots.iconOnly }]">{{ buttonText }}</span>
|
|
19
|
+
<template v-if="slots.right && !slots.iconOnly">
|
|
20
20
|
<span class="btn-icon right">
|
|
21
21
|
<slot name="right"></slot>
|
|
22
22
|
</span>
|
|
23
23
|
</template>
|
|
24
|
-
<template v-if="
|
|
24
|
+
<template v-if="slots.iconOnly">
|
|
25
25
|
<span class="btn-icon icon-only">
|
|
26
26
|
<slot name="iconOnly"></slot>
|
|
27
27
|
</span>
|
|
@@ -30,35 +30,35 @@
|
|
|
30
30
|
</template>
|
|
31
31
|
|
|
32
32
|
<script setup lang="ts">
|
|
33
|
-
import propValidators from
|
|
33
|
+
import propValidators from "../c12/prop-validators"
|
|
34
34
|
|
|
35
35
|
const props = defineProps({
|
|
36
36
|
size: {
|
|
37
37
|
type: String as PropType<string>,
|
|
38
|
-
default:
|
|
38
|
+
default: "default",
|
|
39
39
|
validator(value: string) {
|
|
40
|
-
return propValidators.size.includes(value)
|
|
40
|
+
return propValidators.size.includes(value)
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
weight: {
|
|
44
44
|
type: String as PropType<string>,
|
|
45
|
-
default:
|
|
45
|
+
default: "wght-400",
|
|
46
46
|
validator(value: string) {
|
|
47
|
-
return propValidators.weight.includes(value)
|
|
47
|
+
return propValidators.weight.includes(value)
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
50
|
theme: {
|
|
51
51
|
type: String as PropType<string>,
|
|
52
|
-
default:
|
|
52
|
+
default: "primary",
|
|
53
53
|
validator(value: string) {
|
|
54
|
-
return propValidators.theme.includes(value)
|
|
54
|
+
return propValidators.theme.includes(value)
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
type: {
|
|
58
|
-
type: String as PropType<
|
|
59
|
-
default:
|
|
58
|
+
type: String as PropType<"submit" | "button" | "reset">,
|
|
59
|
+
default: "button",
|
|
60
60
|
validator(value: string) {
|
|
61
|
-
return propValidators.inputTypesButton.includes(value)
|
|
61
|
+
return propValidators.inputTypesButton.includes(value)
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
64
|
buttonText: {
|
|
@@ -67,7 +67,7 @@ const props = defineProps({
|
|
|
67
67
|
},
|
|
68
68
|
dataTestid: {
|
|
69
69
|
type: String,
|
|
70
|
-
default:
|
|
70
|
+
default: "",
|
|
71
71
|
},
|
|
72
72
|
styleClassPassthrough: {
|
|
73
73
|
type: Array as PropType<string[]>,
|
|
@@ -79,9 +79,9 @@ const props = defineProps({
|
|
|
79
79
|
},
|
|
80
80
|
effect: {
|
|
81
81
|
type: String as PropType<string>,
|
|
82
|
-
default:
|
|
82
|
+
default: "fancy",
|
|
83
83
|
validator(value: string) {
|
|
84
|
-
return [
|
|
84
|
+
return ["fancy", "pulse"].includes(value)
|
|
85
85
|
},
|
|
86
86
|
},
|
|
87
87
|
isPending: {
|
|
@@ -92,23 +92,20 @@ const props = defineProps({
|
|
|
92
92
|
type: Boolean,
|
|
93
93
|
default: false,
|
|
94
94
|
},
|
|
95
|
-
})
|
|
95
|
+
})
|
|
96
96
|
|
|
97
|
-
const type = toRef(() => props.type)
|
|
97
|
+
const type = toRef(() => props.type)
|
|
98
98
|
const effectClass = computed(() => {
|
|
99
99
|
if (props.useEffect) {
|
|
100
|
-
return props.effect ===
|
|
100
|
+
return props.effect === "fancy" ? "" : props.effect
|
|
101
101
|
} else {
|
|
102
|
-
return
|
|
102
|
+
return ""
|
|
103
103
|
}
|
|
104
|
-
})
|
|
104
|
+
})
|
|
105
105
|
|
|
106
|
-
const slots = useSlots()
|
|
107
|
-
const hasLeftContent = computed(() => slots.left !== undefined);
|
|
108
|
-
const hasRightContent = computed(() => slots.right !== undefined);
|
|
109
|
-
const isIconOnly = computed(() => slots.iconOnly !== undefined);
|
|
106
|
+
const slots = useSlots()
|
|
110
107
|
|
|
111
|
-
const { elementClasses
|
|
108
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
112
109
|
</script>
|
|
113
110
|
|
|
114
111
|
<style lang="css">
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FormFieldset
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<FormFieldset
|
|
3
|
+
:id
|
|
4
|
+
:name
|
|
5
|
+
:legend
|
|
6
|
+
:fieldHasError
|
|
7
|
+
:required
|
|
8
|
+
:data-testid
|
|
9
|
+
:styleClassPassthrough="['multiple-checkboxes-fieldset']"
|
|
10
|
+
>
|
|
11
|
+
<InputDescription :id :name :field-has-error="fieldHasError" :style-class-passthrough="['input-text-description']">
|
|
12
|
+
<template v-if="slots.descriptionHtml" #descriptionHtml>
|
|
13
|
+
<slot name="descriptionHtml"></slot>
|
|
14
|
+
</template>
|
|
15
|
+
<template v-if="slots.descriptionText" #descriptionText>
|
|
16
|
+
<slot name="descriptionText"></slot>
|
|
17
|
+
</template>
|
|
18
|
+
</InputDescription>
|
|
6
19
|
|
|
7
20
|
<template #content>
|
|
8
21
|
<div class="multiple-checkboxes-items" :class="[optionsLayout]">
|
|
@@ -14,15 +27,15 @@
|
|
|
14
27
|
:name
|
|
15
28
|
:required
|
|
16
29
|
:label="item.label"
|
|
17
|
-
:
|
|
30
|
+
:field-has-error
|
|
18
31
|
v-model="modelValue"
|
|
19
32
|
:true-value="item.value"
|
|
20
33
|
:size
|
|
21
|
-
:
|
|
34
|
+
:options-layout
|
|
22
35
|
:theme
|
|
23
36
|
:direction
|
|
24
|
-
:
|
|
25
|
-
:
|
|
37
|
+
:aria-describedby
|
|
38
|
+
:display-as-disc
|
|
26
39
|
>
|
|
27
40
|
<template #checkedIcon>
|
|
28
41
|
<slot name="checkedIcon"></slot>
|
|
@@ -40,14 +53,14 @@
|
|
|
40
53
|
:name
|
|
41
54
|
:required
|
|
42
55
|
:label="item.label"
|
|
43
|
-
:
|
|
56
|
+
:field-has-error
|
|
44
57
|
v-model="modelValue"
|
|
45
58
|
:true-value="item.value"
|
|
46
59
|
:size
|
|
47
|
-
:
|
|
60
|
+
:options-layout
|
|
48
61
|
:theme
|
|
49
|
-
:
|
|
50
|
-
:
|
|
62
|
+
:aria-describedby
|
|
63
|
+
:display-as-disc
|
|
51
64
|
>
|
|
52
65
|
<template #checkedIcon>
|
|
53
66
|
<slot name="checkedIcon"></slot>
|
|
@@ -61,13 +74,13 @@
|
|
|
61
74
|
</template>
|
|
62
75
|
|
|
63
76
|
<script setup lang="ts">
|
|
64
|
-
import propValidators from
|
|
65
|
-
import type { IOptionsConfig, IFormMultipleOptions } from
|
|
77
|
+
import propValidators from "../c12/prop-validators"
|
|
78
|
+
import type { IOptionsConfig, IFormMultipleOptions } from "../../../../shared/types/types.forms"
|
|
66
79
|
|
|
67
|
-
const
|
|
80
|
+
const props = defineProps({
|
|
68
81
|
dataTestid: {
|
|
69
82
|
type: String,
|
|
70
|
-
default:
|
|
83
|
+
default: "multiple-checkboxes",
|
|
71
84
|
},
|
|
72
85
|
name: {
|
|
73
86
|
type: String,
|
|
@@ -83,7 +96,7 @@ const { dataTestid, name, legend, label, required, fieldHasError, placeholder, i
|
|
|
83
96
|
},
|
|
84
97
|
placeholder: {
|
|
85
98
|
type: String,
|
|
86
|
-
default:
|
|
99
|
+
default: "",
|
|
87
100
|
},
|
|
88
101
|
isButton: {
|
|
89
102
|
type: Boolean,
|
|
@@ -107,16 +120,16 @@ const { dataTestid, name, legend, label, required, fieldHasError, placeholder, i
|
|
|
107
120
|
},
|
|
108
121
|
size: {
|
|
109
122
|
type: String as PropType<string>,
|
|
110
|
-
default:
|
|
123
|
+
default: "medium",
|
|
111
124
|
validator(value: string) {
|
|
112
|
-
return propValidators.size.includes(value)
|
|
125
|
+
return propValidators.size.includes(value)
|
|
113
126
|
},
|
|
114
127
|
},
|
|
115
128
|
optionsLayout: {
|
|
116
129
|
type: String as PropType<string>,
|
|
117
|
-
default:
|
|
130
|
+
default: "equal-widths",
|
|
118
131
|
validator(value: string) {
|
|
119
|
-
return propValidators.optionsLayout.includes(value)
|
|
132
|
+
return propValidators.optionsLayout.includes(value)
|
|
120
133
|
},
|
|
121
134
|
},
|
|
122
135
|
equalCols: {
|
|
@@ -129,38 +142,35 @@ const { dataTestid, name, legend, label, required, fieldHasError, placeholder, i
|
|
|
129
142
|
},
|
|
130
143
|
theme: {
|
|
131
144
|
type: String as PropType<string>,
|
|
132
|
-
default:
|
|
145
|
+
default: "primary",
|
|
133
146
|
validator(value: string) {
|
|
134
|
-
return propValidators.theme.includes(value)
|
|
147
|
+
return propValidators.theme.includes(value)
|
|
135
148
|
},
|
|
136
149
|
},
|
|
137
150
|
direction: {
|
|
138
|
-
type: String as PropType<
|
|
139
|
-
default:
|
|
151
|
+
type: String as PropType<"row" | "row-reverse">,
|
|
152
|
+
default: "row",
|
|
140
153
|
validator(value: string) {
|
|
141
|
-
return [
|
|
154
|
+
return ["row", "row-reverse"].includes(value)
|
|
142
155
|
},
|
|
143
156
|
},
|
|
144
157
|
displayAsDisc: {
|
|
145
158
|
type: Boolean,
|
|
146
159
|
default: false,
|
|
147
160
|
},
|
|
148
|
-
})
|
|
161
|
+
})
|
|
149
162
|
|
|
150
|
-
const slots = useSlots()
|
|
151
|
-
const hasDescriptionSlot = computed(() => slots.description !== undefined);
|
|
152
|
-
const hasDescription = computed(() => slots.description !== undefined);
|
|
153
|
-
const { elementClasses, updateElementClasses } = useStyleClassPassthrough(styleClassPassthrough);
|
|
163
|
+
const slots = useSlots()
|
|
154
164
|
|
|
155
|
-
const modelValue = defineModel()
|
|
156
|
-
const fieldData = defineModel(
|
|
165
|
+
const modelValue = defineModel()
|
|
166
|
+
const fieldData = defineModel("fieldData") as Ref<IFormMultipleOptions>
|
|
157
167
|
|
|
158
|
-
const id = `${name}
|
|
159
|
-
const errorId = `${
|
|
168
|
+
const id = `${props.name}-${useId()}`
|
|
169
|
+
const errorId = `${id}-error-message`
|
|
160
170
|
const ariaDescribedby = computed(() => {
|
|
161
|
-
const ariaDescribedbyId =
|
|
162
|
-
return fieldHasError ? errorId : ariaDescribedbyId
|
|
163
|
-
})
|
|
171
|
+
const ariaDescribedbyId = slots.descriptionText || slots.descriptionHtml ? `${id}-description` : undefined
|
|
172
|
+
return props.fieldHasError ? errorId : ariaDescribedbyId
|
|
173
|
+
})
|
|
164
174
|
</script>
|
|
165
175
|
|
|
166
176
|
<style lang="css">
|