sprintify-ui 0.6.62 → 0.6.64
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.
|
@@ -47,6 +47,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
47
|
type: import("vue").PropType<boolean>;
|
|
48
48
|
default: boolean;
|
|
49
49
|
};
|
|
50
|
+
requiredFields: {
|
|
51
|
+
type: import("vue").PropType<(keyof Address)[]>;
|
|
52
|
+
default: () => string[];
|
|
53
|
+
};
|
|
50
54
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
51
55
|
"update:model-value": (...args: any[]) => void;
|
|
52
56
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -87,6 +91,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
87
91
|
type: import("vue").PropType<boolean>;
|
|
88
92
|
default: boolean;
|
|
89
93
|
};
|
|
94
|
+
requiredFields: {
|
|
95
|
+
type: import("vue").PropType<(keyof Address)[]>;
|
|
96
|
+
default: () => string[];
|
|
97
|
+
};
|
|
90
98
|
}>> & {
|
|
91
99
|
"onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
|
|
92
100
|
}, {
|
|
@@ -98,5 +106,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
98
106
|
restrictCountry: boolean;
|
|
99
107
|
hideRegion: boolean;
|
|
100
108
|
hideCountry: boolean;
|
|
109
|
+
requiredFields: (keyof Address)[];
|
|
101
110
|
}, {}>;
|
|
102
111
|
export default _default;
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:label="t('sui.address')"
|
|
9
9
|
:name="`${namePrefix}address_1`"
|
|
10
10
|
class="col-span-2"
|
|
11
|
-
:required="
|
|
11
|
+
:required="requiredFields.includes('address_1')"
|
|
12
12
|
:size="size"
|
|
13
13
|
>
|
|
14
14
|
<BaseInput
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<BaseField
|
|
27
27
|
:name="`${namePrefix}address_2`"
|
|
28
28
|
class="col-span-2"
|
|
29
|
-
:required="
|
|
29
|
+
:required="requiredFields.includes('address_2')"
|
|
30
30
|
:size="size"
|
|
31
31
|
>
|
|
32
32
|
<BaseInput
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
<BaseField
|
|
42
42
|
:label="t('sui.city')"
|
|
43
|
-
:required="
|
|
43
|
+
:required="requiredFields.includes('city')"
|
|
44
44
|
:name="`${namePrefix}city`"
|
|
45
45
|
class="col-span-2 || sm:col-span-1"
|
|
46
46
|
:size="size"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
<BaseField
|
|
56
56
|
:label="t('sui.postal_code_zip_code')"
|
|
57
|
-
:required="
|
|
57
|
+
:required="requiredFields.includes('postal_code')"
|
|
58
58
|
:name="`${namePrefix}postal_code`"
|
|
59
59
|
class="col-span-2 || sm:col-span-1"
|
|
60
60
|
:size="size"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
v-if="!props.hideCountry"
|
|
71
71
|
:label="t('sui.country')"
|
|
72
72
|
:name="`${namePrefix}country`"
|
|
73
|
-
:required="
|
|
73
|
+
:required="requiredFields.includes('country') && !props.restrictCountry"
|
|
74
74
|
class="col-span-2 || sm:col-span-1"
|
|
75
75
|
:size="size"
|
|
76
76
|
>
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
v-if="!props.hideRegion"
|
|
90
90
|
:label="t('sui.region')"
|
|
91
91
|
:name="`${namePrefix}region`"
|
|
92
|
-
:required="
|
|
92
|
+
:required="requiredFields.includes('region')"
|
|
93
93
|
class="col-span-2 || sm:col-span-1"
|
|
94
94
|
:size="size"
|
|
95
95
|
>
|
|
@@ -141,6 +141,7 @@ const props = withDefaults(
|
|
|
141
141
|
size?: Size;
|
|
142
142
|
hideRegion?: boolean;
|
|
143
143
|
hideCountry?: boolean;
|
|
144
|
+
requiredFields?: (keyof Address)[];
|
|
144
145
|
}>(),
|
|
145
146
|
{
|
|
146
147
|
modelValue() {
|
|
@@ -157,6 +158,9 @@ const props = withDefaults(
|
|
|
157
158
|
size: undefined,
|
|
158
159
|
hideRegion: false,
|
|
159
160
|
hideCountry: false,
|
|
161
|
+
requiredFields() {
|
|
162
|
+
return ['address_1', 'city', 'postal_code', 'country', 'region'];
|
|
163
|
+
}
|
|
160
164
|
}
|
|
161
165
|
);
|
|
162
166
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
>
|
|
26
26
|
<div
|
|
27
27
|
v-if="modelValueFormatted && !disabled && showInput"
|
|
28
|
-
class="
|
|
28
|
+
:class="closeWrapClasses"
|
|
29
29
|
>
|
|
30
30
|
<button
|
|
31
31
|
type="button"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
<script lang="ts" setup>
|
|
45
45
|
import { Ref } from 'vue';
|
|
46
|
-
import { isArray, isEqual } from 'lodash';
|
|
46
|
+
import { isArray, isEqual, size } from 'lodash';
|
|
47
47
|
import { DateTime } from 'luxon';
|
|
48
48
|
import { Icon as BaseIcon } from '@iconify/vue';
|
|
49
49
|
import { useField } from '@/composables/field';
|
|
@@ -307,7 +307,7 @@ const classes = computed(() => {
|
|
|
307
307
|
const disabled = 'disabled:cursor-not-allowed disabled:text-slate-300';
|
|
308
308
|
const sizeConfig = sizes[sizeInternal.value];
|
|
309
309
|
const padding = {
|
|
310
|
-
'xs': 'pl-
|
|
310
|
+
'xs': 'pl-[1.54rem] pr-5',
|
|
311
311
|
'sm': 'pl-[2.1rem] pr-6',
|
|
312
312
|
'md': 'pl-10 pr-7',
|
|
313
313
|
}[sizeInternal.value];
|
|
@@ -327,7 +327,8 @@ const classes = computed(() => {
|
|
|
327
327
|
});
|
|
328
328
|
|
|
329
329
|
const iconWrapClasses = computed(() => {
|
|
330
|
-
const base = 'pointer-events-none absolute top-0 left-0
|
|
330
|
+
const base = 'pointer-events-none absolute top-0 left-0 flex items-center justify-center';
|
|
331
|
+
const sizeConfig = sizes[sizeInternal.value];
|
|
331
332
|
const padding = {
|
|
332
333
|
'xs': 'pl-2',
|
|
333
334
|
'sm': 'pl-2.5',
|
|
@@ -336,10 +337,21 @@ const iconWrapClasses = computed(() => {
|
|
|
336
337
|
|
|
337
338
|
return twMerge(
|
|
338
339
|
base,
|
|
340
|
+
sizeConfig.height,
|
|
339
341
|
padding
|
|
340
342
|
);
|
|
341
343
|
});
|
|
342
344
|
|
|
345
|
+
const closeWrapClasses = computed(() => {
|
|
346
|
+
const base = 'absolute top-0 right-0 flex justify-center p-1';
|
|
347
|
+
const sizeConfig = sizes[sizeInternal.value];
|
|
348
|
+
|
|
349
|
+
return twMerge(
|
|
350
|
+
base,
|
|
351
|
+
sizeConfig.height,
|
|
352
|
+
);
|
|
353
|
+
});
|
|
354
|
+
|
|
343
355
|
const iconClasses = computed(() => {
|
|
344
356
|
const base = '';
|
|
345
357
|
const error = hasErrorInternal.value ? 'text-red-500' : 'text-slate-500';
|