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