sprintify-ui 0.0.175 → 0.0.177
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Country } from '@/types/Country';
|
|
2
2
|
import { Region } from '@/types/Region';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
-
modelValue: Record<string, string | number | null | undefined
|
|
4
|
+
modelValue: Record<string, string | number | null | undefined> | null | undefined;
|
|
5
5
|
prefix: string | null;
|
|
6
6
|
countries?: Country[] | undefined;
|
|
7
7
|
regions?: Region[] | undefined;
|
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
11
11
|
countries(): never[];
|
|
12
12
|
regions(): never[];
|
|
13
13
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:model-value"[], "update:model-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
14
|
-
modelValue: Record<string, string | number | null | undefined
|
|
14
|
+
modelValue: Record<string, string | number | null | undefined> | null | undefined;
|
|
15
15
|
prefix: string | null;
|
|
16
16
|
countries?: Country[] | undefined;
|
|
17
17
|
regions?: Region[] | undefined;
|
|
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
23
23
|
}>>> & {
|
|
24
24
|
"onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
|
|
25
25
|
}, {
|
|
26
|
-
modelValue: Record<string, string | number | null | undefined
|
|
26
|
+
modelValue: Record<string, string | number | null | undefined> | null | undefined;
|
|
27
27
|
prefix: string | null;
|
|
28
28
|
countries: Country[];
|
|
29
29
|
regions: Region[];
|
package/package.json
CHANGED
|
@@ -100,9 +100,11 @@ import BaseInput from './BaseInput.vue';
|
|
|
100
100
|
import BaseSelect from './BaseSelect.vue';
|
|
101
101
|
import { config } from '..';
|
|
102
102
|
|
|
103
|
+
type Address = Record<string, string | number | null | undefined>;
|
|
104
|
+
|
|
103
105
|
const props = withDefaults(
|
|
104
106
|
defineProps<{
|
|
105
|
-
modelValue:
|
|
107
|
+
modelValue: undefined | null | Address;
|
|
106
108
|
prefix: string | null;
|
|
107
109
|
countries?: Country[];
|
|
108
110
|
regions?: Region[];
|
|
@@ -123,18 +125,16 @@ const props = withDefaults(
|
|
|
123
125
|
|
|
124
126
|
const emit = defineEmits(['update:model-value']);
|
|
125
127
|
|
|
126
|
-
const normalizedModelValue = computed(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
);
|
|
128
|
+
const normalizedModelValue = computed((): Address => {
|
|
129
|
+
const form = cloneDeep(props.modelValue ?? {});
|
|
130
|
+
form.address_1 = form.address_1 ?? '';
|
|
131
|
+
form.address_2 = form.address_2 ?? '';
|
|
132
|
+
form.city = form.city ?? '';
|
|
133
|
+
form.postal_code = form.postal_code ?? '';
|
|
134
|
+
form.country = form.country ?? '';
|
|
135
|
+
form.region = form.region ?? '';
|
|
136
|
+
return form;
|
|
137
|
+
});
|
|
138
138
|
|
|
139
139
|
const countries = computed((): Country[] => {
|
|
140
140
|
if (props.countries && isArray(props.countries) && props.countries.length) {
|
|
@@ -211,7 +211,7 @@ function fillAddress() {
|
|
|
211
211
|
let postcode = '';
|
|
212
212
|
let region = '';
|
|
213
213
|
|
|
214
|
-
const newForm = cloneDeep(props.modelValue);
|
|
214
|
+
const newForm = cloneDeep(props.modelValue ?? {});
|
|
215
215
|
|
|
216
216
|
if (!place.address_components) {
|
|
217
217
|
return;
|
|
@@ -232,6 +232,7 @@ import BaseModalSide from './BaseModalSide.vue';
|
|
|
232
232
|
import { config } from '@/index';
|
|
233
233
|
import { useMutationObserver, useResizeObserver } from '@vueuse/core';
|
|
234
234
|
import { useHasPaginatedData } from '@/composables/paginatedData';
|
|
235
|
+
import { useNotificationsStore } from '@/index';
|
|
235
236
|
|
|
236
237
|
const props = defineProps({
|
|
237
238
|
/**
|
|
@@ -289,6 +290,7 @@ const props = defineProps({
|
|
|
289
290
|
});
|
|
290
291
|
|
|
291
292
|
const http = config.http;
|
|
293
|
+
const notificationsStore = useNotificationsStore();
|
|
292
294
|
|
|
293
295
|
defineEmits([
|
|
294
296
|
'click',
|
|
@@ -601,6 +603,7 @@ function fetch(force = false, showLoading = true) {
|
|
|
601
603
|
firstLoad.value = true;
|
|
602
604
|
})
|
|
603
605
|
.catch(() => {
|
|
606
|
+
data.value = null;
|
|
604
607
|
loading.value = false;
|
|
605
608
|
error.value = true;
|
|
606
609
|
});
|