cja-phoenix 1.2.39 → 1.2.41
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/dist/module.d.mts +6 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +29 -16
- package/dist/runtime/assets/iconia/fonts/CGG-icomoon.svg +94 -0
- package/dist/runtime/assets/iconia/fonts/CGG-icomoon.ttf +0 -0
- package/dist/runtime/assets/iconia/fonts/CGG-icomoon.woff +0 -0
- package/dist/runtime/assets/iconia/selection.json +1 -0
- package/dist/runtime/assets/iconia/style.css +281 -0
- package/dist/runtime/assets/scss/main.scss +6 -0
- package/dist/runtime/assets/scss/mixins/_funnel.scss +15 -0
- package/dist/runtime/assets/scss/mixins/_index.scss +46 -0
- package/dist/runtime/assets/scss/mixins/_media-queries.scss +109 -0
- package/dist/runtime/assets/scss/mixins/_results.scss +235 -0
- package/dist/runtime/assets/scss/tippy.scss +31 -0
- package/dist/runtime/assets/scss/variables/_breakpoints.scss +18 -0
- package/dist/runtime/assets/scss/variables/_colors.scss +100 -0
- package/dist/runtime/assets/scss/variables/_forms.scss +121 -0
- package/dist/runtime/assets/scss/variables/_grid.scss +12 -0
- package/dist/runtime/assets/scss/variables/_index.scss +6 -0
- package/dist/runtime/assets/scss/variables/_shadows.scss +7 -0
- package/dist/runtime/assets/scss/variables/_z-index.scss +6 -0
- package/dist/runtime/components/CjaButton.d.vue.ts +33 -0
- package/dist/runtime/components/CjaButton.vue +437 -0
- package/dist/runtime/components/CjaButton.vue.d.ts +33 -0
- package/dist/runtime/components/CollapseContainer.d.vue.ts +35 -0
- package/dist/runtime/components/CollapseContainer.vue +112 -0
- package/dist/runtime/components/CollapseContainer.vue.d.ts +35 -0
- package/dist/runtime/components/ContentTabs.d.vue.ts +23 -0
- package/dist/runtime/components/ContentTabs.vue +103 -0
- package/dist/runtime/components/ContentTabs.vue.d.ts +23 -0
- package/dist/runtime/components/Drawer.d.vue.ts +52 -0
- package/dist/runtime/components/Drawer.vue +169 -0
- package/dist/runtime/components/Drawer.vue.d.ts +52 -0
- package/dist/runtime/components/FixedContainer.d.vue.ts +37 -0
- package/dist/runtime/components/FixedContainer.vue +95 -0
- package/dist/runtime/components/FixedContainer.vue.d.ts +37 -0
- package/dist/runtime/components/GridContainer.d.vue.ts +13 -0
- package/dist/runtime/components/GridContainer.vue +37 -0
- package/dist/runtime/components/GridContainer.vue.d.ts +13 -0
- package/dist/runtime/components/GridItem.d.vue.ts +29 -0
- package/dist/runtime/components/GridItem.vue +93 -0
- package/dist/runtime/components/GridItem.vue.d.ts +29 -0
- package/dist/runtime/components/InfoMessage.d.vue.ts +28 -0
- package/dist/runtime/components/InfoMessage.vue +141 -0
- package/dist/runtime/components/InfoMessage.vue.d.ts +28 -0
- package/dist/runtime/components/LoadingSpinner.d.vue.ts +10 -0
- package/dist/runtime/components/LoadingSpinner.vue +39 -0
- package/dist/runtime/components/LoadingSpinner.vue.d.ts +10 -0
- package/dist/runtime/components/Modal.d.vue.ts +39 -0
- package/dist/runtime/components/Modal.vue +195 -0
- package/dist/runtime/components/Modal.vue.d.ts +39 -0
- package/dist/runtime/components/Scaffold.d.vue.ts +13 -0
- package/dist/runtime/components/Scaffold.vue +3 -0
- package/dist/runtime/components/Scaffold.vue.d.ts +13 -0
- package/dist/runtime/components/StickyContainer.d.vue.ts +21 -0
- package/dist/runtime/components/StickyContainer.vue +57 -0
- package/dist/runtime/components/StickyContainer.vue.d.ts +21 -0
- package/dist/runtime/components/form/CheckboxInput.d.vue.ts +42 -0
- package/dist/runtime/components/form/CheckboxInput.vue +163 -0
- package/dist/runtime/components/form/CheckboxInput.vue.d.ts +42 -0
- package/dist/runtime/components/form/CheckboxInputList.d.vue.ts +37 -0
- package/dist/runtime/components/form/CheckboxInputList.vue +84 -0
- package/dist/runtime/components/form/CheckboxInputList.vue.d.ts +37 -0
- package/dist/runtime/components/form/CurrencyInput.d.vue.ts +37 -0
- package/dist/runtime/components/form/CurrencyInput.vue +134 -0
- package/dist/runtime/components/form/CurrencyInput.vue.d.ts +37 -0
- package/dist/runtime/components/form/DateInput.d.vue.ts +40 -0
- package/dist/runtime/components/form/DateInput.vue +325 -0
- package/dist/runtime/components/form/DateInput.vue.d.ts +40 -0
- package/dist/runtime/components/form/FileInput.d.vue.ts +46 -0
- package/dist/runtime/components/form/FileInput.vue +202 -0
- package/dist/runtime/components/form/FileInput.vue.d.ts +46 -0
- package/dist/runtime/components/form/NumberInput.d.vue.ts +41 -0
- package/dist/runtime/components/form/NumberInput.vue +162 -0
- package/dist/runtime/components/form/NumberInput.vue.d.ts +41 -0
- package/dist/runtime/components/form/PhoneInput.d.vue.ts +44 -0
- package/dist/runtime/components/form/PhoneInput.vue +143 -0
- package/dist/runtime/components/form/PhoneInput.vue.d.ts +44 -0
- package/dist/runtime/components/form/RadioInput.d.vue.ts +42 -0
- package/dist/runtime/components/form/RadioInput.vue +181 -0
- package/dist/runtime/components/form/RadioInput.vue.d.ts +42 -0
- package/dist/runtime/components/form/RadioInputList.d.vue.ts +57 -0
- package/dist/runtime/components/form/RadioInputList.vue +130 -0
- package/dist/runtime/components/form/RadioInputList.vue.d.ts +57 -0
- package/dist/runtime/components/form/SelectInput.d.vue.ts +46 -0
- package/dist/runtime/components/form/SelectInput.vue +362 -0
- package/dist/runtime/components/form/SelectInput.vue.d.ts +46 -0
- package/dist/runtime/components/form/SelectionTiles.d.vue.ts +44 -0
- package/dist/runtime/components/form/SelectionTiles.vue +329 -0
- package/dist/runtime/components/form/SelectionTiles.vue.d.ts +44 -0
- package/dist/runtime/components/form/SliderInput.d.vue.ts +51 -0
- package/dist/runtime/components/form/SliderInput.vue +175 -0
- package/dist/runtime/components/form/SliderInput.vue.d.ts +51 -0
- package/dist/runtime/components/form/TextInput.d.vue.ts +56 -0
- package/dist/runtime/components/form/TextInput.vue +227 -0
- package/dist/runtime/components/form/TextInput.vue.d.ts +56 -0
- package/dist/runtime/components/form/TextareaInput.d.vue.ts +37 -0
- package/dist/runtime/components/form/TextareaInput.vue +76 -0
- package/dist/runtime/components/form/TextareaInput.vue.d.ts +37 -0
- package/dist/runtime/components/form/TileCheckboxInput.d.vue.ts +40 -0
- package/dist/runtime/components/form/TileCheckboxInput.vue +108 -0
- package/dist/runtime/components/form/TileCheckboxInput.vue.d.ts +40 -0
- package/dist/runtime/components/form/ToggleInput.d.vue.ts +43 -0
- package/dist/runtime/components/form/ToggleInput.vue +119 -0
- package/dist/runtime/components/form/ToggleInput.vue.d.ts +43 -0
- package/dist/runtime/components/form/structure/Container.d.vue.ts +16 -0
- package/dist/runtime/components/form/structure/Container.vue +31 -0
- package/dist/runtime/components/form/structure/Container.vue.d.ts +16 -0
- package/dist/runtime/components/form/structure/Description.d.vue.ts +9 -0
- package/dist/runtime/components/form/structure/Description.vue +26 -0
- package/dist/runtime/components/form/structure/Description.vue.d.ts +9 -0
- package/dist/runtime/components/form/structure/Error.d.vue.ts +9 -0
- package/dist/runtime/components/form/structure/Error.vue +23 -0
- package/dist/runtime/components/form/structure/Error.vue.d.ts +9 -0
- package/dist/runtime/components/form/structure/Title.d.vue.ts +12 -0
- package/dist/runtime/components/form/structure/Title.vue +43 -0
- package/dist/runtime/components/form/structure/Title.vue.d.ts +12 -0
- package/dist/runtime/components/funnel/Header.d.vue.ts +18 -0
- package/dist/runtime/components/funnel/Header.vue +62 -0
- package/dist/runtime/components/funnel/Header.vue.d.ts +18 -0
- package/dist/runtime/composables/useCjaGtm.d.ts +19 -0
- package/dist/runtime/composables/useCjaGtm.js +164 -0
- package/dist/runtime/composables/useFunnelConfig.d.ts +11 -0
- package/dist/runtime/composables/useFunnelConfig.js +51 -0
- package/dist/runtime/composables/useFunnelSummary.d.ts +14 -0
- package/dist/runtime/composables/useFunnelSummary.js +16 -0
- package/dist/runtime/composables/useHeaderHeight.d.ts +3 -0
- package/dist/runtime/composables/useHeaderHeight.js +24 -0
- package/dist/runtime/composables/useJourneyConfig.d.ts +11 -0
- package/dist/runtime/composables/useJourneyConfig.js +13 -0
- package/dist/runtime/composables/useValidateForm.d.ts +11 -0
- package/dist/runtime/composables/useValidateForm.js +33 -0
- package/dist/runtime/data/dialCodes.d.ts +7 -0
- package/dist/runtime/data/dialCodes.js +1466 -0
- package/dist/runtime/data/phoneDigits.d.ts +2 -0
- package/dist/runtime/data/phoneDigits.js +231 -0
- package/dist/runtime/plugins/tippy.d.ts +4 -0
- package/dist/runtime/plugins/tippy.js +12 -0
- package/dist/runtime/plugins/v-calendar.d.ts +3 -0
- package/dist/runtime/plugins/v-calendar.js +6 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/types/Form.d.ts +34 -0
- package/dist/runtime/types/Form.js +20 -0
- package/dist/runtime/types/Grid.d.ts +4 -0
- package/dist/runtime/types/Grid.js +0 -0
- package/dist/runtime/types/Icon.d.ts +2 -0
- package/dist/runtime/types/Icon.js +85 -0
- package/dist/runtime/types/JourneyConfig.d.ts +9 -0
- package/dist/runtime/types/JourneyConfig.js +0 -0
- package/dist/runtime/types/index.d.ts +4 -0
- package/dist/runtime/types/index.js +4 -0
- package/dist/runtime/utils/applyProductData.d.ts +10 -0
- package/dist/runtime/utils/applyProductData.js +22 -0
- package/dist/runtime/utils/convertDate.d.ts +5 -0
- package/dist/runtime/utils/convertDate.js +17 -0
- package/dist/runtime/utils/findScrollAncestor.d.ts +1 -0
- package/dist/runtime/utils/findScrollAncestor.js +14 -0
- package/dist/runtime/utils/formValidations.d.ts +78 -0
- package/dist/runtime/utils/formValidations.js +180 -0
- package/dist/runtime/utils/formatValue.d.ts +4 -0
- package/dist/runtime/utils/formatValue.js +20 -0
- package/dist/runtime/utils/getAbTestVersion.d.ts +9 -0
- package/dist/runtime/utils/getAbTestVersion.js +48 -0
- package/dist/runtime/utils/getCalendarUrl.d.ts +8 -0
- package/dist/runtime/utils/getCalendarUrl.js +24 -0
- package/dist/runtime/utils/getFromUrl.d.ts +2 -0
- package/dist/runtime/utils/getFromUrl.js +25 -0
- package/dist/runtime/utils/getStoryblokUrl.d.ts +71 -0
- package/dist/runtime/utils/getStoryblokUrl.js +35 -0
- package/dist/runtime/utils/jsonReviver.d.ts +1 -0
- package/dist/runtime/utils/jsonReviver.js +18 -0
- package/dist/runtime/utils/mediaBreakpoints.d.ts +28 -0
- package/dist/runtime/utils/mediaBreakpoints.js +28 -0
- package/dist/runtime/utils/toggleScroll.d.ts +1 -0
- package/dist/runtime/utils/toggleScroll.js +6 -0
- package/dist/runtime/utils/updateForm.d.ts +11 -0
- package/dist/runtime/utils/updateForm.js +74 -0
- package/dist/runtime/utils/updateMarketingConsent.d.ts +4 -0
- package/dist/runtime/utils/updateMarketingConsent.js +13 -0
- package/dist/runtime/utils/uploadFile.d.ts +8 -0
- package/dist/runtime/utils/uploadFile.js +13 -0
- package/dist/types.d.mts +6 -10
- package/package.json +9 -8
- package/dist/module.d.cts +0 -2
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="input-container">
|
|
3
|
+
<label
|
|
4
|
+
class="input-wrapper"
|
|
5
|
+
:class="[
|
|
6
|
+
`radio-style-${radioStyle}`,
|
|
7
|
+
`size-${size}`,
|
|
8
|
+
{
|
|
9
|
+
checked: model == value,
|
|
10
|
+
disabled,
|
|
11
|
+
error: error || errorMessage
|
|
12
|
+
}
|
|
13
|
+
]"
|
|
14
|
+
>
|
|
15
|
+
<input
|
|
16
|
+
v-bind="{ name, value, disabled }"
|
|
17
|
+
v-model="model"
|
|
18
|
+
type="radio"
|
|
19
|
+
:name="name"
|
|
20
|
+
:aria-label="label"
|
|
21
|
+
/>
|
|
22
|
+
<div class="radio-icon" />
|
|
23
|
+
<div v-if="label || $slots.default" class="text-container">
|
|
24
|
+
<slot v-if="$slots.default" />
|
|
25
|
+
<Scaffold v-else>
|
|
26
|
+
{{ label }}
|
|
27
|
+
</Scaffold>
|
|
28
|
+
</div>
|
|
29
|
+
</label>
|
|
30
|
+
|
|
31
|
+
<FormStructureError
|
|
32
|
+
v-if="errorMessage && errorDisplay"
|
|
33
|
+
v-bind="{ size, errorMessage }"
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup>
|
|
39
|
+
import { useField } from "vee-validate";
|
|
40
|
+
const props = defineProps({
|
|
41
|
+
name: { type: String, required: true },
|
|
42
|
+
value: { type: null, required: true },
|
|
43
|
+
label: { type: String, required: true },
|
|
44
|
+
disabled: { type: null, required: false },
|
|
45
|
+
size: { type: String, required: false },
|
|
46
|
+
error: { type: Boolean, required: false },
|
|
47
|
+
errorDisplay: { type: Boolean, required: false, default: true },
|
|
48
|
+
validation: { type: Object, required: false },
|
|
49
|
+
validationMode: { type: String, required: false },
|
|
50
|
+
radioStyle: { type: String, required: false, default: "default" }
|
|
51
|
+
});
|
|
52
|
+
const model = defineModel({
|
|
53
|
+
required: true
|
|
54
|
+
});
|
|
55
|
+
const { errorMessage, meta, validate } = useField("input", props.validation, {
|
|
56
|
+
validateOnValueUpdate: props.validationMode == "change",
|
|
57
|
+
syncVModel: true
|
|
58
|
+
});
|
|
59
|
+
defineExpose({ errorMessage, meta, validate });
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<style lang="scss" scoped>
|
|
63
|
+
.input-wrapper {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: row;
|
|
66
|
+
align-items: center;
|
|
67
|
+
flex-wrap: nowrap;
|
|
68
|
+
gap: 8px;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
margin: 0;
|
|
71
|
+
font-weight: 400;
|
|
72
|
+
|
|
73
|
+
input {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.radio-style-default {
|
|
78
|
+
.radio-icon {
|
|
79
|
+
width: 20px;
|
|
80
|
+
height: 20px;
|
|
81
|
+
flex-shrink: 0;
|
|
82
|
+
border: 1px solid $blue-grey;
|
|
83
|
+
border-radius: 50%;
|
|
84
|
+
transition: all 0.2s linear;
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.text-container {
|
|
89
|
+
line-height: 20px;
|
|
90
|
+
white-space: pre-line;
|
|
91
|
+
|
|
92
|
+
a {
|
|
93
|
+
color: inherit;
|
|
94
|
+
font-weight: 700;
|
|
95
|
+
text-decoration: underline;
|
|
96
|
+
|
|
97
|
+
&:hover {
|
|
98
|
+
text-decoration: none;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&.size-sm {
|
|
104
|
+
.text-container {
|
|
105
|
+
font-size: 14px;
|
|
106
|
+
line-height: 20px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&.size-md,
|
|
111
|
+
&.size-lg {
|
|
112
|
+
.text-container {
|
|
113
|
+
font-size: 16px;
|
|
114
|
+
line-height: 20px;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&.checked {
|
|
119
|
+
.radio-icon {
|
|
120
|
+
border: 6px solid $main-blue;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&.disabled {
|
|
125
|
+
.radio-icon {
|
|
126
|
+
background: $dark-white;
|
|
127
|
+
border-color: $input-disabled-color;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.radio-style-button {
|
|
133
|
+
justify-content: center;
|
|
134
|
+
padding: 6px 12px;
|
|
135
|
+
border-radius: 8px;
|
|
136
|
+
border: 1px solid $light-grey;
|
|
137
|
+
transition: all 0.2s ease-in-out;
|
|
138
|
+
|
|
139
|
+
.radio-icon {
|
|
140
|
+
display: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.text-container {
|
|
144
|
+
font-size: 14px;
|
|
145
|
+
line-height: 30px;
|
|
146
|
+
font-weight: 700;
|
|
147
|
+
text-align: center;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&.checked {
|
|
151
|
+
border-color: $main-blue;
|
|
152
|
+
color: $extra-dark-blue;
|
|
153
|
+
background: $extra-light-blue;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&.size-sm {
|
|
157
|
+
height: 36px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&.size-md {
|
|
161
|
+
height: 44px;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.text-container {
|
|
166
|
+
user-select: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&.error {
|
|
170
|
+
&.radio-style-default {
|
|
171
|
+
.radio-icon {
|
|
172
|
+
border-color: $input-border-error-color;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&.radio-style-button {
|
|
177
|
+
border-color: $input-border-error-color;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { InputHTMLAttributes } from "vue";
|
|
2
|
+
import type { Lazy, Schema } from "yup";
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
name: string;
|
|
5
|
+
value: any;
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: InputHTMLAttributes["disabled"];
|
|
8
|
+
size?: "sm" | "md" | "lg";
|
|
9
|
+
error?: boolean;
|
|
10
|
+
errorDisplay?: boolean;
|
|
11
|
+
validation?: Schema | Lazy<any>;
|
|
12
|
+
validationMode?: "change" | "none";
|
|
13
|
+
radioStyle?: "default" | "button";
|
|
14
|
+
};
|
|
15
|
+
type __VLS_ModelProps = {
|
|
16
|
+
modelValue: any;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
19
|
+
declare var __VLS_1: {};
|
|
20
|
+
type __VLS_Slots = {} & {
|
|
21
|
+
default?: (props: typeof __VLS_1) => any;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
24
|
+
errorMessage: import("vue").Ref<string | undefined, string | undefined>;
|
|
25
|
+
meta: import("vee-validate").FieldMeta<unknown>;
|
|
26
|
+
validate: import("vee-validate").FieldValidator<unknown>;
|
|
27
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
"update:modelValue": (value: any) => any;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
30
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
errorDisplay: boolean;
|
|
33
|
+
radioStyle: "default" | "button";
|
|
34
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
38
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
39
|
+
new (): {
|
|
40
|
+
$slots: S;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from "vue";
|
|
2
|
+
import type { RadioOption } from "../../types/Form.js";
|
|
3
|
+
import type { Lazy, Schema } from "yup";
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
title?: string;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
layout?: "vertical" | "horizontal";
|
|
8
|
+
listLayout?: "vertical" | "horizontal";
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
validation?: Schema | Lazy<any>;
|
|
11
|
+
validationMode?: "change" | "none";
|
|
12
|
+
errorDisplay?: boolean;
|
|
13
|
+
disabled?: InputHTMLAttributes["disabled"];
|
|
14
|
+
options: RadioOption[] | undefined;
|
|
15
|
+
name: string;
|
|
16
|
+
radioStyle?: {
|
|
17
|
+
variant: "default" | "button";
|
|
18
|
+
breakDisplay?: {
|
|
19
|
+
xs?: number;
|
|
20
|
+
sm?: number;
|
|
21
|
+
md?: number;
|
|
22
|
+
lg?: number;
|
|
23
|
+
xl?: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type __VLS_ModelProps = {
|
|
28
|
+
modelValue: InputHTMLAttributes["value"];
|
|
29
|
+
};
|
|
30
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
31
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
32
|
+
errorMessage: import("vue").Ref<string | undefined, string | undefined>;
|
|
33
|
+
meta: import("vee-validate").FieldMeta<unknown>;
|
|
34
|
+
validate: import("vee-validate").FieldValidator<unknown>;
|
|
35
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
"update:modelValue": (value: any) => any;
|
|
37
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
38
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
size: "sm" | "md" | "lg";
|
|
41
|
+
errorDisplay: boolean;
|
|
42
|
+
validationMode: "change" | "none";
|
|
43
|
+
layout: "vertical" | "horizontal";
|
|
44
|
+
listLayout: "vertical" | "horizontal";
|
|
45
|
+
radioStyle: {
|
|
46
|
+
variant: "default" | "button";
|
|
47
|
+
breakDisplay?: {
|
|
48
|
+
xs?: number;
|
|
49
|
+
sm?: number;
|
|
50
|
+
md?: number;
|
|
51
|
+
lg?: number;
|
|
52
|
+
xl?: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const _default: typeof __VLS_export;
|
|
57
|
+
export default _default;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FormStructureContainer v-bind="{ layout }">
|
|
3
|
+
<FormStructureTitle
|
|
4
|
+
v-if="title"
|
|
5
|
+
v-bind="{ title, tooltip, size, disabled }"
|
|
6
|
+
/>
|
|
7
|
+
<ul
|
|
8
|
+
v-if="options"
|
|
9
|
+
class="input-list"
|
|
10
|
+
:class="[
|
|
11
|
+
`size-${size}`,
|
|
12
|
+
`layout-${listLayout}`,
|
|
13
|
+
`radio-style-${radioStyle.variant}`,
|
|
14
|
+
{
|
|
15
|
+
error: errorMessage
|
|
16
|
+
}
|
|
17
|
+
]"
|
|
18
|
+
:style="cssVars"
|
|
19
|
+
>
|
|
20
|
+
<li v-for="option in options" :key="option.value">
|
|
21
|
+
<FormRadioInput
|
|
22
|
+
v-bind="{
|
|
23
|
+
...option,
|
|
24
|
+
name,
|
|
25
|
+
size,
|
|
26
|
+
disabled,
|
|
27
|
+
error: errorMessage != void 0,
|
|
28
|
+
errorDisplay: false,
|
|
29
|
+
radioStyle: radioStyle.variant
|
|
30
|
+
}"
|
|
31
|
+
v-model="model"
|
|
32
|
+
/>
|
|
33
|
+
</li>
|
|
34
|
+
</ul>
|
|
35
|
+
<FormStructureError
|
|
36
|
+
v-if="errorMessage && errorDisplay"
|
|
37
|
+
v-bind="{ size, errorMessage }"
|
|
38
|
+
/>
|
|
39
|
+
</FormStructureContainer>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup>
|
|
43
|
+
import { computed } from "vue";
|
|
44
|
+
import { useField } from "vee-validate";
|
|
45
|
+
const props = defineProps({
|
|
46
|
+
title: { type: String, required: false },
|
|
47
|
+
tooltip: { type: String, required: false },
|
|
48
|
+
layout: { type: String, required: false, default: "vertical" },
|
|
49
|
+
listLayout: { type: String, required: false, default: "vertical" },
|
|
50
|
+
size: { type: String, required: false, default: "md" },
|
|
51
|
+
validation: { type: Object, required: false },
|
|
52
|
+
validationMode: { type: String, required: false, default: "change" },
|
|
53
|
+
errorDisplay: { type: Boolean, required: false, default: true },
|
|
54
|
+
disabled: { type: null, required: false },
|
|
55
|
+
options: { type: null, required: true },
|
|
56
|
+
name: { type: String, required: true },
|
|
57
|
+
radioStyle: { type: Object, required: false, default: () => ({
|
|
58
|
+
variant: "default"
|
|
59
|
+
}) }
|
|
60
|
+
});
|
|
61
|
+
const model = defineModel({ type: null, ...{
|
|
62
|
+
required: true
|
|
63
|
+
} });
|
|
64
|
+
const { errorMessage, meta, validate } = useField("input", props.validation, {
|
|
65
|
+
validateOnValueUpdate: props.validationMode == "change",
|
|
66
|
+
syncVModel: true
|
|
67
|
+
});
|
|
68
|
+
const cssVars = computed(() => {
|
|
69
|
+
const cssVars2 = [];
|
|
70
|
+
const breakpoints = ["xs", "sm", "md", "lg", "xl"];
|
|
71
|
+
breakpoints.forEach((b, i) => {
|
|
72
|
+
const propCols = props.radioStyle?.breakDisplay?.[b];
|
|
73
|
+
let cols = propCols || 1;
|
|
74
|
+
if (!propCols && i > 0 && cssVars2[i - 1]) {
|
|
75
|
+
cols = cssVars2[i - 1]?.[1];
|
|
76
|
+
}
|
|
77
|
+
cssVars2.push([`--${b}-columns`, cols]);
|
|
78
|
+
});
|
|
79
|
+
return Object.fromEntries(cssVars2);
|
|
80
|
+
});
|
|
81
|
+
defineExpose({ errorMessage, meta, validate });
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<style lang="scss" scoped>
|
|
85
|
+
.input-list {
|
|
86
|
+
margin: 0;
|
|
87
|
+
list-style: none;
|
|
88
|
+
padding: 0;
|
|
89
|
+
|
|
90
|
+
&.radio-style-button {
|
|
91
|
+
display: grid;
|
|
92
|
+
gap: 12px;
|
|
93
|
+
grid-template-columns: repeat(var(--xs-columns), 1fr);
|
|
94
|
+
|
|
95
|
+
@include screen-xs-min {
|
|
96
|
+
grid-template-columns: repeat(var(--sm-columns), 1fr);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@include screen-md-min {
|
|
100
|
+
grid-template-columns: repeat(var(--md-columns), 1fr);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@include screen-lg-min {
|
|
104
|
+
grid-template-columns: repeat(var(--lg-columns), 1fr);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@include screen-xl-min {
|
|
108
|
+
grid-template-columns: repeat(var(--xl-columns), 1fr);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&.radio-style-default {
|
|
113
|
+
display: flex;
|
|
114
|
+
|
|
115
|
+
&.size-md {
|
|
116
|
+
padding: 11px 0 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&.layout-vertical {
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
gap: 8px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&.layout-horizontal {
|
|
125
|
+
gap: 8px 16px;
|
|
126
|
+
padding: 7px 0;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from "vue";
|
|
2
|
+
import type { RadioOption } from "../../types/Form.js";
|
|
3
|
+
import type { Lazy, Schema } from "yup";
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
title?: string;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
layout?: "vertical" | "horizontal";
|
|
8
|
+
listLayout?: "vertical" | "horizontal";
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
validation?: Schema | Lazy<any>;
|
|
11
|
+
validationMode?: "change" | "none";
|
|
12
|
+
errorDisplay?: boolean;
|
|
13
|
+
disabled?: InputHTMLAttributes["disabled"];
|
|
14
|
+
options: RadioOption[] | undefined;
|
|
15
|
+
name: string;
|
|
16
|
+
radioStyle?: {
|
|
17
|
+
variant: "default" | "button";
|
|
18
|
+
breakDisplay?: {
|
|
19
|
+
xs?: number;
|
|
20
|
+
sm?: number;
|
|
21
|
+
md?: number;
|
|
22
|
+
lg?: number;
|
|
23
|
+
xl?: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type __VLS_ModelProps = {
|
|
28
|
+
modelValue: InputHTMLAttributes["value"];
|
|
29
|
+
};
|
|
30
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
31
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
32
|
+
errorMessage: import("vue").Ref<string | undefined, string | undefined>;
|
|
33
|
+
meta: import("vee-validate").FieldMeta<unknown>;
|
|
34
|
+
validate: import("vee-validate").FieldValidator<unknown>;
|
|
35
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
"update:modelValue": (value: any) => any;
|
|
37
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
38
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
size: "sm" | "md" | "lg";
|
|
41
|
+
errorDisplay: boolean;
|
|
42
|
+
validationMode: "change" | "none";
|
|
43
|
+
layout: "vertical" | "horizontal";
|
|
44
|
+
listLayout: "vertical" | "horizontal";
|
|
45
|
+
radioStyle: {
|
|
46
|
+
variant: "default" | "button";
|
|
47
|
+
breakDisplay?: {
|
|
48
|
+
xs?: number;
|
|
49
|
+
sm?: number;
|
|
50
|
+
md?: number;
|
|
51
|
+
lg?: number;
|
|
52
|
+
xl?: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const _default: typeof __VLS_export;
|
|
57
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SelectOption } from "../../types/Form.js";
|
|
2
|
+
import { type InputHTMLAttributes } from "vue";
|
|
3
|
+
import type { Lazy, Schema } from "yup";
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
title?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
tooltip?: string;
|
|
8
|
+
placeholder?: InputHTMLAttributes["placeholder"];
|
|
9
|
+
layout?: "vertical" | "horizontal";
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
error?: string;
|
|
12
|
+
validation?: Schema | Lazy<any>;
|
|
13
|
+
validationMode?: "change" | "blur" | "none";
|
|
14
|
+
errorDisplay?: boolean;
|
|
15
|
+
id?: InputHTMLAttributes["id"];
|
|
16
|
+
disabled?: InputHTMLAttributes["disabled"];
|
|
17
|
+
options: SelectOption[] | undefined;
|
|
18
|
+
multiSelect?: boolean;
|
|
19
|
+
relativeEl?: any;
|
|
20
|
+
searchFilter?: {
|
|
21
|
+
placeholder: string;
|
|
22
|
+
noResults: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type __VLS_ModelProps = {
|
|
26
|
+
modelValue: any | undefined;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
29
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
30
|
+
errorMessage: import("vue").Ref<string | undefined, string | undefined>;
|
|
31
|
+
meta: import("vee-validate").FieldMeta<unknown>;
|
|
32
|
+
validate: import("vee-validate").FieldValidator<unknown>;
|
|
33
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
+
"update:modelValue": (value: any) => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
36
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
disabled: boolean | "true" | "false";
|
|
39
|
+
size: "sm" | "md" | "lg";
|
|
40
|
+
errorDisplay: boolean;
|
|
41
|
+
validationMode: "change" | "blur" | "none";
|
|
42
|
+
layout: "vertical" | "horizontal";
|
|
43
|
+
placeholder: string;
|
|
44
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
45
|
+
declare const _default: typeof __VLS_export;
|
|
46
|
+
export default _default;
|