srcdev-nuxt-forms 5.1.1 → 6.0.0
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/README.md +16 -0
- package/app/assets/styles/extends-layer/srcdev-forms/components/_form-fieldset.css +38 -0
- package/app/assets/styles/extends-layer/srcdev-forms/components/_input-button.css +66 -0
- package/app/assets/styles/extends-layer/srcdev-forms/components/_input-checkbox-radio-core.css +66 -0
- package/app/assets/styles/extends-layer/srcdev-forms/components/_input-checkbox-radio-options-button.css +76 -0
- package/app/assets/styles/extends-layer/srcdev-forms/components/_input-error.css +54 -0
- package/app/assets/styles/extends-layer/srcdev-forms/components/_input-label.css +21 -0
- package/app/assets/styles/extends-layer/srcdev-forms/components/_input-select.css +140 -0
- package/app/assets/styles/extends-layer/srcdev-forms/components/_input-text.css +190 -0
- package/app/assets/styles/extends-layer/srcdev-forms/components/_input-textarea.css +96 -0
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/components/index.css +3 -4
- package/app/assets/styles/extends-layer/srcdev-forms/setup/_generic.css +21 -0
- package/app/assets/styles/extends-layer/srcdev-forms/setup/index.css +4 -0
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/themes/_error.css +12 -12
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/themes/_ghost.css +12 -12
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/themes/_input-action-underlined.css +7 -7
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/themes/_input-action.css +7 -7
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/themes/_primary.css +12 -12
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/themes/_secondary.css +12 -12
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/themes/_success.css +12 -12
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/themes/_tertiary.css +12 -12
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/themes/_warning.css +12 -12
- package/app/assets/styles/extends-layer/srcdev-forms/setup/variables/_a11y.css +7 -0
- package/app/assets/styles/extends-layer/srcdev-forms/setup/variables/index.css +1 -0
- package/app/assets/styles/extends-layer/srcdev-forms/setup/variants/_normal.css +48 -0
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/variants/_underlined.css +10 -10
- package/app/assets/styles/extends-layer/srcdev-forms/setup/variants/index.css +3 -0
- package/app/assets/styles/extends-layer/srcdev-forms/setup/variants/sizes/_default.css +13 -0
- package/{assets/styles/extends-layer/srcdev-forms/setup → app/assets/styles/extends-layer/srcdev-forms/setup/variants}/sizes/index.css +2 -0
- package/app/assets/styles/setup/_head.css +36 -0
- package/app/assets/styles/setup/index.css +5 -0
- package/{assets/styles/setup/variables → app/assets/styles/setup/theming}/colors/_blue.css +1 -1
- package/{assets/styles/setup/variables → app/assets/styles/setup/theming}/index.css +1 -0
- package/app/assets/styles/setup/theming/themes/_default.css +66 -0
- package/app/assets/styles/setup/theming/themes/_error.css +66 -0
- package/app/assets/styles/setup/theming/themes/_ghost.css +31 -0
- package/app/assets/styles/setup/theming/themes/_info.css +31 -0
- package/app/assets/styles/setup/theming/themes/_primary.css +41 -0
- package/app/assets/styles/setup/theming/themes/_secondary.css +66 -0
- package/app/assets/styles/setup/theming/themes/_success.css +66 -0
- package/app/assets/styles/setup/theming/themes/_tertiary.css +31 -0
- package/app/assets/styles/setup/theming/themes/_warning.css +68 -0
- package/app/assets/styles/setup/theming/themes/index.css +9 -0
- package/app/assets/styles/setup/typography/index.css +2 -0
- package/app/assets/styles/setup/typography/utility-classes/_generic-font-classes.css +217 -0
- package/app/assets/styles/setup/typography/utility-classes/_generic-font-variation-settings.css +29 -0
- package/app/assets/styles/setup/typography/utility-classes/_generic-font-weights.css +39 -0
- package/app/assets/styles/setup/typography/vars/_colors.css +14 -0
- package/{assets → app/assets}/styles/setup/typography/vars/_reponsive-font-sizes.css +2 -0
- package/{assets → app/assets}/styles/setup/typography/vars/index.css +1 -0
- package/app/assets/styles/setup/utility-classes/_fluid-spacing.css +13 -0
- package/app/assets/styles/setup/utility-classes/animations/_auto-rotate.css +13 -0
- package/app/assets/styles/setup/utility-classes/animations/_entry-exit-blur.css +16 -0
- package/app/assets/styles/setup/utility-classes/animations/_entry-slide-in.css +15 -0
- package/app/assets/styles/setup/utility-classes/animations/_entry-zoom-reveal.css +15 -0
- package/app/assets/styles/setup/utility-classes/animations/index.css +4 -0
- package/app/assets/styles/setup/utility-classes/index.css +2 -0
- package/app/assets/styles/setup/variables/index.css +1 -0
- package/{components → app/components}/forms/form-errors/InputError.vue +32 -49
- package/{components → app/components}/forms/form-fieldset/FormFieldset.vue +9 -9
- package/{components → app/components}/forms/input-button/InputButtonCore.vue +20 -18
- package/{components → app/components}/forms/input-button/variants/InputButtonConfirm.vue +1 -1
- package/app/components/forms/input-checkbox-radio/InputCheckboxRadioButton.vue +204 -0
- package/{components → app/components}/forms/input-checkbox-radio/InputCheckboxRadioCore.vue +29 -17
- package/{components → app/components}/forms/input-checkbox-radio/InputCheckboxRadioWithLabel.vue +1 -0
- package/{components → app/components}/forms/input-label/InputLabel.vue +26 -7
- package/{components → app/components}/forms/input-number/InputNumberCore.vue +7 -6
- package/{components → app/components}/forms/input-number/variants/InputNumberDefault.vue +5 -6
- package/{components → app/components}/forms/input-range/InputRangeCore.vue +1 -1
- package/{components → app/components}/forms/input-range/variants/InputRangeDefault.vue +5 -2
- package/{components → app/components}/forms/input-range-fancy/InputRangeFancyCore.vue +1 -1
- package/{components → app/components}/forms/input-range-fancy/InputRangeFancyWithLabel.vue +1 -1
- package/{components → app/components}/forms/input-select/InputSelectCore.vue +23 -21
- package/{components → app/components}/forms/input-select/variants/InputSelectWithLabel.vue +1 -1
- package/app/components/forms/input-text/InputTextCore.vue +341 -0
- package/{components → app/components}/forms/input-text/variants/InputPasswordWithLabel.vue +1 -1
- package/{components → app/components}/forms/input-text/variants/InputTextAsNumberWithLabel.vue +4 -2
- package/app/components/forms/input-text/variants/InputTextWithLabel.vue +158 -0
- package/{components → app/components}/forms/input-textarea/InputTextareaCore.vue +10 -131
- package/app/components/forms/input-textarea/variants/InputTextareaWithLabel.vue +125 -0
- package/{components → app/components}/forms/toggle-switch/ToggleSwitchCore.vue +1 -1
- package/{components → app/components}/forms/toggle-switch/ToggleSwitchCoreOld.vue +1 -1
- package/{components → app/components}/forms/toggle-switch/variants/ToggleSwitchWithLabel.vue +5 -2
- package/{components → app/components}/forms/toggle-switch/variants/ToggleSwitchWithLabelInline.vue +5 -2
- package/{components → app/components}/utils/colour-scheme-select/ColourSchemeSelect.vue +1 -1
- package/{components → app/components}/utils/colour-scheme-select/ColourSchemeSelectOld.vue +1 -1
- package/nuxt.config.ts +5 -2
- package/package.json +9 -11
- package/assets/styles/extends-layer/srcdev-forms/components/_form-core.css +0 -8
- package/assets/styles/extends-layer/srcdev-forms/components/_form-fieldset.css +0 -16
- package/assets/styles/extends-layer/srcdev-forms/components/_input-checkbox-radio-options-button.css +0 -59
- package/assets/styles/extends-layer/srcdev-forms/components/_input-checkbox.css +0 -72
- package/assets/styles/extends-layer/srcdev-forms/components/_input-error.css +0 -55
- package/assets/styles/extends-layer/srcdev-forms/components/_input-label.css +0 -18
- package/assets/styles/extends-layer/srcdev-forms/components/_input-radio.css +0 -68
- package/assets/styles/extends-layer/srcdev-forms/components/_input-select.css +0 -18
- package/assets/styles/extends-layer/srcdev-forms/components/_input-text-as-number.css +0 -22
- package/assets/styles/extends-layer/srcdev-forms/components/_input-textarea.css +0 -5
- package/assets/styles/extends-layer/srcdev-forms/setup/_generic.css +0 -7
- package/assets/styles/extends-layer/srcdev-forms/setup/index.css +0 -4
- package/assets/styles/extends-layer/srcdev-forms/setup/sizes/_default.css +0 -12
- package/assets/styles/extends-layer/srcdev-forms/setup/variants/_normal.css +0 -48
- package/assets/styles/extends-layer/srcdev-forms/setup/variants/index.css +0 -2
- package/assets/styles/setup/_head.css +0 -5
- package/assets/styles/setup/index.css +0 -5
- package/assets/styles/setup/typography/index.css +0 -2
- package/assets/styles/setup/typography/utility-classes/_generic-font-classes.css +0 -192
- package/assets/styles/setup/typography/utility-classes/_generic-font-variation-settings.css +0 -29
- package/assets/styles/setup/typography/utility-classes/_generic-font-weights.css +0 -41
- package/assets/styles/setup/utility-classes/_margin-helpers.css +0 -334
- package/assets/styles/setup/utility-classes/_padding-helpers.css +0 -308
- package/assets/styles/setup/utility-classes/_page.css +0 -49
- package/assets/styles/setup/utility-classes/index.css +0 -3
- package/components/forms/input-checkbox-radio/InputCheckboxRadioButton.vue +0 -218
- package/components/forms/input-text/InputTextCore.vue +0 -390
- package/components/forms/input-text/variants/InputTextWithLabel.vue +0 -300
- package/components/forms/input-textarea/variants/InputTextareaWithLabel.vue +0 -269
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/index.css +0 -0
- package/{assets → app/assets}/styles/extends-layer/srcdev-forms/setup/themes/index.css +0 -0
- package/{assets/styles/extends-layer/srcdev-forms/setup → app/assets/styles/extends-layer/srcdev-forms/setup/variants}/sizes/_large.css +0 -0
- package/{assets/styles/extends-layer/srcdev-forms/setup → app/assets/styles/extends-layer/srcdev-forms/setup/variants}/sizes/_medium.css +0 -0
- package/{assets/styles/extends-layer/srcdev-forms/setup → app/assets/styles/extends-layer/srcdev-forms/setup/variants}/sizes/_small.css +0 -0
- package/{assets/styles/extends-layer/srcdev-forms/setup → app/assets/styles/extends-layer/srcdev-forms/setup/variants}/sizes/_x-small.css +0 -0
- package/{assets → app/assets}/styles/main.css +0 -0
- package/{assets → app/assets}/styles/setup/a11y/_utils.css +0 -0
- package/{assets → app/assets}/styles/setup/a11y/_variables.css +0 -0
- package/{assets → app/assets}/styles/setup/a11y/index.css +0 -0
- package/{assets/styles/setup/variables → app/assets/styles/setup/theming}/colors/_gray.css +0 -0
- package/{assets/styles/setup/variables → app/assets/styles/setup/theming}/colors/_green.css +0 -0
- package/{assets/styles/setup/variables → app/assets/styles/setup/theming}/colors/_orange.css +0 -0
- package/{assets/styles/setup/variables → app/assets/styles/setup/theming}/colors/_red.css +0 -0
- package/{assets/styles/setup/variables → app/assets/styles/setup/theming}/colors/_yellow.css +0 -0
- package/{assets/styles/setup/variables → app/assets/styles/setup/theming}/colors/index.css +3 -3
- package/{assets → app/assets}/styles/setup/typography/utility-classes/index.css +1 -1
- /package/{components → app/components}/forms/c12/prop-validators/index.ts +0 -0
- /package/{components → app/components}/forms/c12/utils.ts +0 -0
- /package/{components → app/components}/forms/form-errors/tests/InputError.spec.ts +0 -0
- /package/{components → app/components}/forms/input-button/variants/InputButtonSubmit.vue +0 -0
- /package/{components → app/components}/forms/input-checkbox/MultipleCheckboxes.vue +0 -0
- /package/{components → app/components}/forms/input-checkbox/SingleCheckbox.vue +0 -0
- /package/{components → app/components}/forms/input-checkbox/tests/MultipleCheckboxes.spec.ts +0 -0
- /package/{components → app/components}/forms/input-checkbox/tests/data/tags.json +0 -0
- /package/{components → app/components}/forms/input-radio/MultipleRadiobuttons.vue +0 -0
- /package/{components → app/components}/forms/input-radio/tests/MultipleRadioButtons.spec.ts +0 -0
- /package/{components → app/components}/forms/input-radio/tests/data/tags.json +0 -0
- /package/{components → app/components}/forms/ui/FormField.vue +0 -0
- /package/{components → app/components}/forms/ui/FormWrapper.vue +0 -0
- /package/{components → app/components}/utils/dark-mode-switcher/DarkModeSwitcher.vue +0 -0
- /package/{composables → app/composables}/useApiRequest.ts +0 -0
- /package/{composables → app/composables}/useColourScheme.ts +0 -0
- /package/{composables → app/composables}/useErrorMessages.ts +0 -0
- /package/{composables → app/composables}/useFormControl.ts +0 -0
- /package/{composables → app/composables}/useSleep.ts +0 -0
- /package/{composables → app/composables}/useStyleClassPassthrough.ts +0 -0
- /package/{composables → app/composables}/useZodValidation.ts +0 -0
- /package/{types → app/types}/types.forms.ts +0 -0
- /package/{types → app/types}/types.zodFormControl.ts +0 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="input-checkbox-radio-options-button" :data-theme="formTheme" :data-size="size" :class="[size, elementClasses, optionsLayout, { error: fieldHasError }]">
|
|
3
|
+
<InputCheckboxRadioCore :isButton="true" :type :id :name :required v-model="modelValue" :size :trueValue :falseValue :fieldHasError :theme :ariaDescribedby :displayAsDisc>
|
|
4
|
+
<template #checkedIcon>
|
|
5
|
+
<slot name="checkedIcon"></slot>
|
|
6
|
+
</template>
|
|
7
|
+
</InputCheckboxRadioCore>
|
|
8
|
+
<label v-if="hasLabelContent" class="input-checkbox-radio-options-button-label" :for="id">
|
|
9
|
+
<slot name="labelContent"></slot>
|
|
10
|
+
</label>
|
|
11
|
+
<label v-else class="input-checkbox-radio-options-button-label" :for="id">{{ label }}</label>
|
|
12
|
+
<div class="decorator-icon">
|
|
13
|
+
<slot name="itemIcon">
|
|
14
|
+
<Icon name="material-symbols:add-2" class="icon" aria-hidden="true" focusable="false" />
|
|
15
|
+
</slot>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import propValidators from '../c12/prop-validators';
|
|
22
|
+
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
type: {
|
|
25
|
+
type: String as PropType<'checkbox' | 'radio'>,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
id: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
name: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
label: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
required: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
fieldHasError: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
48
|
+
trueValue: {
|
|
49
|
+
type: [String, Number, Boolean],
|
|
50
|
+
default: true,
|
|
51
|
+
},
|
|
52
|
+
falseValue: {
|
|
53
|
+
type: [String, Number, Boolean],
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
size: {
|
|
57
|
+
type: String as PropType<string>,
|
|
58
|
+
default: 'medium',
|
|
59
|
+
validator(value: string) {
|
|
60
|
+
return propValidators.size.includes(value);
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
optionsLayout: {
|
|
64
|
+
type: String as PropType<string>,
|
|
65
|
+
default: 'equal-widths',
|
|
66
|
+
validator(value: string) {
|
|
67
|
+
return propValidators.optionsLayout.includes(value);
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
styleClassPassthrough: {
|
|
71
|
+
type: Array as PropType<string[]>,
|
|
72
|
+
default: () => [],
|
|
73
|
+
},
|
|
74
|
+
theme: {
|
|
75
|
+
type: String as PropType<string>,
|
|
76
|
+
default: 'primary',
|
|
77
|
+
validator(value: string) {
|
|
78
|
+
return propValidators.theme.includes(value);
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
direction: {
|
|
82
|
+
type: String as PropType<'row' | 'row-reverse'>,
|
|
83
|
+
default: 'row',
|
|
84
|
+
validator(value: string) {
|
|
85
|
+
return ['row', 'row-reverse'].includes(value);
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
ariaDescribedby: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: null,
|
|
91
|
+
},
|
|
92
|
+
displayAsDisc: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const slots = useSlots();
|
|
99
|
+
const hasLabelContent = computed(() => slots.labelContent !== undefined);
|
|
100
|
+
const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
101
|
+
|
|
102
|
+
const modelValue = defineModel();
|
|
103
|
+
|
|
104
|
+
const formTheme = computed(() => {
|
|
105
|
+
return props.fieldHasError ? 'error' : props.theme;
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const flexDirection = ref(props.direction);
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<style lang="css">
|
|
112
|
+
.input-checkbox-radio-options-button {
|
|
113
|
+
--_white-space: wrap;
|
|
114
|
+
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: v-bind(flexDirection);
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: space-between;
|
|
119
|
+
gap: 1rem;
|
|
120
|
+
border-radius: 1lh;
|
|
121
|
+
transition: all 0.2s ease-in-out;
|
|
122
|
+
|
|
123
|
+
&.inline {
|
|
124
|
+
--_white-space: nowrap;
|
|
125
|
+
}
|
|
126
|
+
background-color: var(--theme-input-surface);
|
|
127
|
+
border: var(--form-element-border-width) solid var(--theme-input-border);
|
|
128
|
+
outline: var(--form-element-outline-width) solid var(--theme-input-outline);
|
|
129
|
+
|
|
130
|
+
box-shadow: 0.1rem 0.1rem 0.8rem 0.1rem transparent;
|
|
131
|
+
padding-block: var(--input-checkbox-radio-options-padding-block);
|
|
132
|
+
padding-inline: var(--input-checkbox-radio-options-padding-inline);
|
|
133
|
+
|
|
134
|
+
&:hover {
|
|
135
|
+
background-color: var(--theme-input-surface-hover);
|
|
136
|
+
border-color: var(--theme-input-border);
|
|
137
|
+
outline-color: var(--theme-input-outline-hover);
|
|
138
|
+
outline-offset: var(--form-element-outline-offset-focus);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&:has(.input-checkbox-radio-core:focus-visible) {
|
|
142
|
+
background-color: var(--theme-input-surface-focus);
|
|
143
|
+
outline-color: var(--theme-input-outline-focus);
|
|
144
|
+
outline-offset: var(--form-element-outline-offset-focus);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Sizes */
|
|
148
|
+
&.x-small {
|
|
149
|
+
padding-block: 0.2rem;
|
|
150
|
+
padding-inline: 1.6rem;
|
|
151
|
+
gap: 1rem;
|
|
152
|
+
}
|
|
153
|
+
&.small {
|
|
154
|
+
padding-block: 0.2rem;
|
|
155
|
+
padding-inline: 1.6rem;
|
|
156
|
+
gap: 1rem;
|
|
157
|
+
}
|
|
158
|
+
&.default {
|
|
159
|
+
padding-block: 0.4rem;
|
|
160
|
+
padding-inline: 1.2rem;
|
|
161
|
+
gap: 1rem;
|
|
162
|
+
}
|
|
163
|
+
&.medium {
|
|
164
|
+
padding-block: 0.4rem;
|
|
165
|
+
padding-inline: 1.2rem;
|
|
166
|
+
gap: 1rem;
|
|
167
|
+
}
|
|
168
|
+
&.large {
|
|
169
|
+
padding-block: 0.4rem;
|
|
170
|
+
padding-inline: 1.2rem;
|
|
171
|
+
gap: 1rem;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.input-checkbox-radio-options-button-label {
|
|
175
|
+
display: flex;
|
|
176
|
+
flex-grow: 1;
|
|
177
|
+
color: var(--theme-checkbox-label-text-color);
|
|
178
|
+
font-size: var(--form-element-font-size);
|
|
179
|
+
width: 100%;
|
|
180
|
+
min-height: var(--form-element-line-height);
|
|
181
|
+
align-items: center;
|
|
182
|
+
justify-content: center;
|
|
183
|
+
padding-block: 0.8rem;
|
|
184
|
+
padding-inline: 0.8rem;
|
|
185
|
+
white-space: var(--_white-space);
|
|
186
|
+
|
|
187
|
+
&:hover {
|
|
188
|
+
cursor: pointer;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.decorator-icon {
|
|
193
|
+
display: flex;
|
|
194
|
+
align-items: center;
|
|
195
|
+
justify-content: center;
|
|
196
|
+
color: var(--theme-checkbox-decorator-color);
|
|
197
|
+
|
|
198
|
+
.icon {
|
|
199
|
+
height: var(--theme-checkbox-decorator-icon-size);
|
|
200
|
+
width: var(--theme-checkbox-decorator-icon-size);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
</style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="input-checkbox-radio-wrapper"
|
|
4
|
-
:data-
|
|
5
|
-
:data-
|
|
4
|
+
:data-theme="formTheme"
|
|
5
|
+
:data-size="size"
|
|
6
6
|
:class="[type, size, elementClasses, { error: fieldHasError }, { button: isButton }, { 'display-as-disc': displayAsDisc }]"
|
|
7
7
|
>
|
|
8
8
|
<slot name="checkedIcon" v-if="isChecked">
|
|
@@ -126,40 +126,52 @@ const isChecked = computed(() => {
|
|
|
126
126
|
grid-template-areas: 'element-stack';
|
|
127
127
|
place-content: center;
|
|
128
128
|
|
|
129
|
-
background-color: var(--
|
|
130
|
-
border: var(--input-
|
|
131
|
-
|
|
132
|
-
outline: var(--input-checkbox-radio-wrapper-outline);
|
|
129
|
+
background-color: var(--theme-checkbox-symbol-surface);
|
|
130
|
+
border: 0.1rem solid var(--theme-input-border);
|
|
131
|
+
outline: var(--form-element-outline-width) solid var(--theme-input-outline);
|
|
133
132
|
box-shadow: var(--_box-shadow);
|
|
134
133
|
|
|
135
|
-
height: var(--
|
|
136
|
-
width: var(--
|
|
134
|
+
height: var(--input-symbol-size);
|
|
135
|
+
width: var(--input-symbol-size);
|
|
137
136
|
|
|
138
|
-
transition: var(--
|
|
137
|
+
transition: all var(--theme-form-transition-duration) ease-in-out;
|
|
139
138
|
|
|
139
|
+
&.checkbox {
|
|
140
|
+
border-radius: var(--form-input-border-radius);
|
|
141
|
+
&.button {
|
|
142
|
+
&.display-as-disc {
|
|
143
|
+
border-radius: 50%;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&.radio {
|
|
149
|
+
border-radius: 50%;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* focus-visible */
|
|
140
153
|
&:not(.button):has(.input-checkbox-radio-core:focus-visible) {
|
|
141
|
-
|
|
142
|
-
outline: var(--input-checkbox-radio-wrapper-outline-on);
|
|
143
|
-
box-shadow: var(--input-checkbox-radio-wrapper-box-shadow-on);
|
|
154
|
+
outline: var(--theme-focus-visible-outline);
|
|
144
155
|
}
|
|
145
156
|
|
|
146
157
|
.input-checked-icon {
|
|
147
158
|
grid-area: element-stack;
|
|
148
|
-
color: var(--
|
|
149
|
-
height: var(--
|
|
150
|
-
width: var(--
|
|
159
|
+
color: var(--theme-checkbox-symbol-color);
|
|
160
|
+
height: var(--input-symbol-size);
|
|
161
|
+
width: var(--input-symbol-size);
|
|
151
162
|
box-shadow: var(--_box-shadow);
|
|
152
163
|
}
|
|
153
164
|
|
|
154
165
|
.input-checkbox-radio-core {
|
|
166
|
+
touch-action: manipulation;
|
|
155
167
|
grid-area: element-stack;
|
|
156
168
|
appearance: none;
|
|
157
169
|
margin: 0;
|
|
158
170
|
overflow: hidden;
|
|
159
171
|
opacity: 0;
|
|
160
172
|
|
|
161
|
-
height: var(--
|
|
162
|
-
width: var(--
|
|
173
|
+
height: var(--input-symbol-size);
|
|
174
|
+
width: var(--input-symbol-size);
|
|
163
175
|
|
|
164
176
|
&:hover {
|
|
165
177
|
cursor: pointer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<label :for="id" class="input-label" :class="[elementClasses]">
|
|
2
|
+
<label :for="id" class="input-label" :class="[elementClasses, inputVariant]">
|
|
3
3
|
<slot v-if="hasHtmlLabel" name="htmlLabel"></slot>
|
|
4
4
|
<slot v-if="hasTextLabel" name="textLabel"></slot>
|
|
5
5
|
</label>
|
|
@@ -34,7 +34,7 @@ const props = defineProps({
|
|
|
34
34
|
},
|
|
35
35
|
inputVariant: {
|
|
36
36
|
type: String as PropType<string>,
|
|
37
|
-
default: '
|
|
37
|
+
default: 'default',
|
|
38
38
|
validator(value: string) {
|
|
39
39
|
return propValidators.inputVariant.includes(value);
|
|
40
40
|
},
|
|
@@ -50,11 +50,30 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
|
50
50
|
|
|
51
51
|
<style lang="css">
|
|
52
52
|
.input-label {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
font-
|
|
57
|
-
|
|
53
|
+
touch-action: manipulation;
|
|
54
|
+
color: var(--form-label-color);
|
|
55
|
+
margin-block: 0.8rem;
|
|
56
|
+
font-size: var(--step-5);
|
|
57
|
+
font-weight: normal;
|
|
58
|
+
line-height: 1.5;
|
|
58
59
|
display: block;
|
|
60
|
+
|
|
61
|
+
&.normal {
|
|
62
|
+
color: var(--form-label-color);
|
|
63
|
+
margin-block: 0.8rem;
|
|
64
|
+
font-size: var(--step-5);
|
|
65
|
+
font-weight: normal;
|
|
66
|
+
line-height: 1.5;
|
|
67
|
+
display: block;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.underlined {
|
|
71
|
+
color: var(--form-label-color);
|
|
72
|
+
margin-block: 0.8rem;
|
|
73
|
+
font-size: var(--step-5);
|
|
74
|
+
font-weight: normal;
|
|
75
|
+
line-height: 1.5;
|
|
76
|
+
display: block;
|
|
77
|
+
}
|
|
59
78
|
}
|
|
60
79
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="input-number-wrapper" :data-
|
|
2
|
+
<div class="input-number-wrapper" :data-theme="formTheme" :data-size="size">
|
|
3
3
|
<div v-if="hasLeftContent" class="slot left">
|
|
4
4
|
<slot name="left"></slot>
|
|
5
5
|
</div>
|
|
@@ -113,9 +113,9 @@ const minLength = computed(() => `${props.max.toString().length + 1}em`);
|
|
|
113
113
|
|
|
114
114
|
width: fit-content;
|
|
115
115
|
|
|
116
|
-
background-color: var(--theme-
|
|
116
|
+
background-color: var(--theme-button-surface);
|
|
117
117
|
border-radius: var(--form-element-border-width);
|
|
118
|
-
border: var(--form-element-border-width) solid var(--theme-
|
|
118
|
+
border: var(--form-element-border-width) solid var(--theme-input-border);
|
|
119
119
|
outline: var(--form-element-outline-width) solid var(--theme-form-input-outline);
|
|
120
120
|
box-shadow: var(--_focus-box-shadow);
|
|
121
121
|
|
|
@@ -142,12 +142,13 @@ const minLength = computed(() => `${props.max.toString().length + 1}em`);
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
.input-number-core {
|
|
145
|
+
touch-action: manipulation;
|
|
145
146
|
background-color: transparent;
|
|
146
147
|
border: none;
|
|
147
148
|
outline: none;
|
|
148
149
|
box-shadow: none;
|
|
149
150
|
|
|
150
|
-
background-color: var(--theme-
|
|
151
|
+
background-color: var(--theme-input-surface);
|
|
151
152
|
color: var(--theme-form-input-text-color-normal);
|
|
152
153
|
font-family: var(--font-family);
|
|
153
154
|
font-size: var(--form-element-font-size);
|
|
@@ -185,12 +186,12 @@ const minLength = computed(() => `${props.max.toString().length + 1}em`);
|
|
|
185
186
|
|
|
186
187
|
.left-slot {
|
|
187
188
|
margin-inline-end: 0;
|
|
188
|
-
border-right: 2px solid var(--theme-
|
|
189
|
+
border-right: 2px solid var(--theme-button-surface-hover);
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
.right-slot {
|
|
192
193
|
margin-inline-end: 0;
|
|
193
|
-
border-left: 2px solid var(--theme-
|
|
194
|
+
border-left: 2px solid var(--theme-button-surface-hover);
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="input-number-with-label" :data-
|
|
3
|
-
<
|
|
2
|
+
<div class="input-number-with-label" :data-theme="formTheme" :data-size="size" :class="[elementClasses, `theme-${theme}`, { error: fieldHasError }]">
|
|
3
|
+
<InputLabel :for="id" :id :theme :name input-variant="normal" :field-has-error :style-class-passthrough="['input-number-label', 'body-normal-bold']">
|
|
4
|
+
<template #textLabel>{{ label }}</template>
|
|
5
|
+
</InputLabel>
|
|
6
|
+
|
|
4
7
|
<template v-if="hasDescription">
|
|
5
8
|
<slot name="description"></slot>
|
|
6
9
|
</template>
|
|
@@ -132,10 +135,6 @@ updateElementClasses(['has-left-button', 'has-right-button']);
|
|
|
132
135
|
|
|
133
136
|
<style lang="css">
|
|
134
137
|
.input-number-with-label {
|
|
135
|
-
--_border-width: var(--form-element-border-width);
|
|
136
|
-
--_outline-width: var(--form-element-outline-width);
|
|
137
|
-
--_label-padding-inline: 1rem;
|
|
138
|
-
|
|
139
138
|
.input-number-label {
|
|
140
139
|
display: block;
|
|
141
140
|
margin-block: 0.8rem;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="input-range-with-label" :data-
|
|
3
|
-
<
|
|
2
|
+
<div class="input-range-with-label" :data-theme="formTheme" :class="[elementClasses, { error: fieldHasError }]">
|
|
3
|
+
<InputLabel :for="id" :id :theme :name input-variant="normal" :field-has-error :style-class-passthrough="['input-number-label', 'body-normal-bold']">
|
|
4
|
+
<template #textLabel>{{ label }}</template>
|
|
5
|
+
</InputLabel>
|
|
6
|
+
|
|
4
7
|
<template v-if="hasDescription">
|
|
5
8
|
<slot name="description"></slot>
|
|
6
9
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="input-range-fancy-with-label" :data-
|
|
2
|
+
<div class="input-range-fancy-with-label" :data-theme="formTheme" :class="[elementClasses, { error: fieldHasError }]">
|
|
3
3
|
<label class="input-range-fancy-label body-normal-bold" :for="id">{{ label }}</label>
|
|
4
4
|
<template v-if="hasDescription">
|
|
5
5
|
<slot name="description"></slot>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="input-select-wrapper" :data-
|
|
3
|
-
<select v-model="modelValue" class="input-select-core" :name :id>
|
|
2
|
+
<div class="input-select-wrapper" :data-theme="formTheme" :data-size="size" :class="[inputVariant, size, { dirty: isDirty }, { active: isActive }, { error: fieldHasError }]">
|
|
3
|
+
<select v-model="modelValue" class="input-select-core" :name :id :title>
|
|
4
4
|
<option v-if="placeholder" value="" readonly :selected="!modelValue" class="input-select-core-option placeholder">{{ placeholder }}</option>
|
|
5
5
|
<option v-for="item in fieldData.data" :key="item.id" :value="item.value" :selected="item.value === modelValue" class="input-select-core-option">
|
|
6
|
-
<Icon :name="item.icon" class="input-select-core-option-icon" />
|
|
6
|
+
<Icon v-if="item.icon" :name="item.icon" class="input-select-core-option-decorator-icon" aria-hidden="true" focusable="false" />
|
|
7
7
|
{{ item.label }}
|
|
8
8
|
</option>
|
|
9
9
|
</select>
|
|
@@ -27,6 +27,10 @@ const props = defineProps({
|
|
|
27
27
|
type: String,
|
|
28
28
|
default: '',
|
|
29
29
|
},
|
|
30
|
+
title: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'Please select an option',
|
|
33
|
+
},
|
|
30
34
|
required: {
|
|
31
35
|
type: Boolean,
|
|
32
36
|
default: false,
|
|
@@ -74,8 +78,8 @@ const fieldData = defineModel('fieldData') as Ref<IFormMultipleOptions>;
|
|
|
74
78
|
|
|
75
79
|
<style lang="css">
|
|
76
80
|
.input-select-wrapper {
|
|
77
|
-
background-color: var(--
|
|
78
|
-
outline: var(--element-
|
|
81
|
+
background-color: var(--theme-input-surface);
|
|
82
|
+
outline: var(--form-element-outline-width) solid var(--theme-input-outline);
|
|
79
83
|
|
|
80
84
|
border-top-left-radius: var(--element-decorator-border-top-left-radius);
|
|
81
85
|
border-top-right-radius: var(--element-decorator-border-top-right-radius);
|
|
@@ -96,7 +100,7 @@ const fieldData = defineModel('fieldData') as Ref<IFormMultipleOptions>;
|
|
|
96
100
|
content: '';
|
|
97
101
|
width: 0.8em;
|
|
98
102
|
height: 0.5em;
|
|
99
|
-
background-color: var(--theme-
|
|
103
|
+
background-color: var(--theme-input-border);
|
|
100
104
|
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
|
|
101
105
|
} */
|
|
102
106
|
|
|
@@ -107,7 +111,7 @@ const fieldData = defineModel('fieldData') as Ref<IFormMultipleOptions>;
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
&::picker(select) {
|
|
110
|
-
transition: display allow-discrete var(--
|
|
114
|
+
transition: display allow-discrete var(--theme-form-transition-duration), opacity var(--theme-form-transition-duration), overlay var(--theme-form-transition-duration) allow-discrete;
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
&:not(:open)::picker(select) {
|
|
@@ -116,7 +120,7 @@ const fieldData = defineModel('fieldData') as Ref<IFormMultipleOptions>;
|
|
|
116
120
|
|
|
117
121
|
&:open::picker(select) {
|
|
118
122
|
opacity: 1;
|
|
119
|
-
border: var(--form-element-border-width) solid var(--theme-
|
|
123
|
+
border: var(--form-element-border-width) solid var(--theme-input-border);
|
|
120
124
|
outline: var(--form-element-outline-width) solid var(--_input-select-outline-color);
|
|
121
125
|
|
|
122
126
|
@starting-style {
|
|
@@ -130,33 +134,31 @@ const fieldData = defineModel('fieldData') as Ref<IFormMultipleOptions>;
|
|
|
130
134
|
width: 100%;
|
|
131
135
|
|
|
132
136
|
&:hover {
|
|
133
|
-
|
|
134
|
-
background-color: var(--form-core-background-color-hover);
|
|
137
|
+
background-color: var(--theme-input-surface-hover);
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
/* END modern Select CSS */
|
|
138
141
|
|
|
139
|
-
/* color: var(--_input-text-core-color); */
|
|
140
142
|
font-family: var(--font-family);
|
|
141
143
|
font-size: var(--form-element-font-size);
|
|
142
144
|
line-height: var(--form-element-line-height);
|
|
143
|
-
padding-block:
|
|
144
|
-
padding-inline:
|
|
145
|
+
padding-block: 1.5rem;
|
|
146
|
+
padding-inline: 1rem;
|
|
145
147
|
|
|
146
148
|
.input-select-core-option {
|
|
147
|
-
padding-block:
|
|
148
|
-
padding-inline:
|
|
149
|
-
gap:
|
|
150
|
-
transition: var(--
|
|
149
|
+
padding-block: 1rem;
|
|
150
|
+
padding-inline: 1.75rem;
|
|
151
|
+
gap: 1.5rem;
|
|
152
|
+
transition: all var(--theme-form-transition-duration) ease-in-out;
|
|
151
153
|
|
|
152
154
|
&:hover {
|
|
153
|
-
background-color: var(--input-
|
|
155
|
+
background-color: var(--theme-input-surface-hover);
|
|
154
156
|
}
|
|
155
157
|
|
|
156
|
-
.input-select-core-option-icon {
|
|
158
|
+
.input-select-core-option-decorator-icon {
|
|
157
159
|
display: inline-block;
|
|
158
|
-
width:
|
|
159
|
-
height:
|
|
160
|
+
width: 1.5rem;
|
|
161
|
+
height: 1.5rem;
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
164
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div class="input-select-with-label" :class="[inputVariant, { dirty: isDirty }, { active: isActive }, { error: fieldHasError }]" :data-testid :data-
|
|
3
|
+
<div class="input-select-with-label" :class="[inputVariant, { dirty: isDirty }, { active: isActive }, { error: fieldHasError }]" :data-testid :data-theme="formTheme" :data-size="size">
|
|
4
4
|
<InputLabel :for="id" :id :theme :name :input-variant :field-has-error :style-class-passthrough="['input-select-label']">
|
|
5
5
|
<template #textLabel>{{ label }}</template>
|
|
6
6
|
</InputLabel>
|