sprintify-ui 0.0.168 → 0.0.170
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/sprintify-ui.es.js
CHANGED
|
@@ -1055,40 +1055,40 @@ const Ra = /* @__PURE__ */ new WeakMap(), Fa = (t) => {
|
|
|
1055
1055
|
if (!h)
|
|
1056
1056
|
return;
|
|
1057
1057
|
const d = h.getPlace();
|
|
1058
|
-
let w = "", b = "";
|
|
1059
|
-
const
|
|
1058
|
+
let w = "", b = "", v = "";
|
|
1059
|
+
const g = St(e.modelValue);
|
|
1060
1060
|
if (d.address_components) {
|
|
1061
|
-
for (const
|
|
1062
|
-
switch (
|
|
1061
|
+
for (const n of d.address_components)
|
|
1062
|
+
switch (n.types[0]) {
|
|
1063
1063
|
case "street_number": {
|
|
1064
|
-
w = `${
|
|
1064
|
+
w = `${n.long_name} ${w}`;
|
|
1065
1065
|
break;
|
|
1066
1066
|
}
|
|
1067
1067
|
case "route": {
|
|
1068
|
-
w +=
|
|
1068
|
+
w += n.long_name;
|
|
1069
1069
|
break;
|
|
1070
1070
|
}
|
|
1071
1071
|
case "postal_code": {
|
|
1072
|
-
b = `${
|
|
1072
|
+
b = `${n.long_name}${b}`;
|
|
1073
1073
|
break;
|
|
1074
1074
|
}
|
|
1075
1075
|
case "postal_code_suffix": {
|
|
1076
|
-
b = `${b}-${
|
|
1076
|
+
b = `${b}-${n.long_name}`;
|
|
1077
1077
|
break;
|
|
1078
1078
|
}
|
|
1079
1079
|
case "locality":
|
|
1080
|
-
|
|
1080
|
+
g.city = n.long_name;
|
|
1081
1081
|
break;
|
|
1082
1082
|
case "administrative_area_level_1": {
|
|
1083
|
-
v
|
|
1083
|
+
v = n.short_name.toLowerCase();
|
|
1084
1084
|
break;
|
|
1085
1085
|
}
|
|
1086
1086
|
case "country":
|
|
1087
|
-
|
|
1087
|
+
g.country = n.short_name.toLowerCase();
|
|
1088
1088
|
break;
|
|
1089
1089
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1090
|
+
g.region = g.country + "-" + v, g.address_1 = w, g.postal_code = b, ct(() => {
|
|
1091
|
+
i("update:model-value", g);
|
|
1092
1092
|
});
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
@@ -1107,6 +1107,7 @@ const Ra = /* @__PURE__ */ new WeakMap(), Fa = (t) => {
|
|
|
1107
1107
|
placeholder: d.$t("sui.address_1_placeholder"),
|
|
1108
1108
|
class: "w-full",
|
|
1109
1109
|
"prevent-submit": "",
|
|
1110
|
+
name: "address_search_field",
|
|
1110
1111
|
autocomplete: !1,
|
|
1111
1112
|
required: !1,
|
|
1112
1113
|
"onUpdate:modelValue": w[0] || (w[0] = (b) => u("address_1", b))
|
package/package.json
CHANGED
|
@@ -12,18 +12,18 @@ export default {
|
|
|
12
12
|
{ name: 'Mexico', id: 'mx' },
|
|
13
13
|
],
|
|
14
14
|
regions: [
|
|
15
|
-
{ name: 'Alabama', id: 'al', country_id: 'us' },
|
|
16
|
-
{ name: 'Alaska', id: 'ak', country_id: 'us' },
|
|
17
|
-
{ name: 'Arizona', id: 'az', country_id: 'us' },
|
|
18
|
-
{ name: 'Alberta', id: 'ab', country_id: 'ca' },
|
|
19
|
-
{ name: 'British Columbia', id: 'bc', country_id: 'ca' },
|
|
20
|
-
{ name: 'Manitoba', id: 'mb', country_id: 'ca' },
|
|
21
|
-
{ name: 'Nova Scotia', id: 'ns', country_id: 'ca' },
|
|
22
|
-
{ name: 'Ontario', id: 'on', country_id: 'ca' },
|
|
23
|
-
{ name: 'Prince Edward Island', id: 'pe', country_id: 'ca' },
|
|
24
|
-
{ name: 'Quebec', id: 'qc', country_id: 'ca' },
|
|
25
|
-
{ name: 'Saskatchewan', id: 'sk', country_id: 'ca' },
|
|
26
|
-
{ name: 'Northwest Territories', id: 'nt', country_id: 'ca' },
|
|
15
|
+
{ name: 'Alabama', id: 'us-al', country_id: 'us' },
|
|
16
|
+
{ name: 'Alaska', id: 'us-ak', country_id: 'us' },
|
|
17
|
+
{ name: 'Arizona', id: 'us-az', country_id: 'us' },
|
|
18
|
+
{ name: 'Alberta', id: 'ca-ab', country_id: 'ca' },
|
|
19
|
+
{ name: 'British Columbia', id: 'ca-bc', country_id: 'ca' },
|
|
20
|
+
{ name: 'Manitoba', id: 'ca-mb', country_id: 'ca' },
|
|
21
|
+
{ name: 'Nova Scotia', id: 'ca-ns', country_id: 'ca' },
|
|
22
|
+
{ name: 'Ontario', id: 'ca-on', country_id: 'ca' },
|
|
23
|
+
{ name: 'Prince Edward Island', id: 'ca-pe', country_id: 'ca' },
|
|
24
|
+
{ name: 'Quebec', id: 'ca-qc', country_id: 'ca' },
|
|
25
|
+
{ name: 'Saskatchewan', id: 'ca-sk', country_id: 'ca' },
|
|
26
|
+
{ name: 'Northwest Territories', id: 'ca-nt', country_id: 'ca' },
|
|
27
27
|
],
|
|
28
28
|
},
|
|
29
29
|
};
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
:placeholder="$t('sui.address_1_placeholder')"
|
|
12
12
|
class="w-full"
|
|
13
13
|
prevent-submit
|
|
14
|
+
name="address_search_field"
|
|
14
15
|
:autocomplete="false"
|
|
15
16
|
:required="false"
|
|
16
17
|
@update:model-value="update('address_1', $event)"
|
|
@@ -210,6 +211,7 @@ function fillAddress() {
|
|
|
210
211
|
const place = autocomplete.getPlace();
|
|
211
212
|
let address1 = '';
|
|
212
213
|
let postcode = '';
|
|
214
|
+
let region = '';
|
|
213
215
|
|
|
214
216
|
const newForm = cloneDeep(props.modelValue);
|
|
215
217
|
|
|
@@ -245,7 +247,7 @@ function fillAddress() {
|
|
|
245
247
|
newForm.city = component.long_name;
|
|
246
248
|
break;
|
|
247
249
|
case 'administrative_area_level_1': {
|
|
248
|
-
|
|
250
|
+
region = component.short_name.toLowerCase();
|
|
249
251
|
break;
|
|
250
252
|
}
|
|
251
253
|
case 'country':
|
|
@@ -254,20 +256,16 @@ function fillAddress() {
|
|
|
254
256
|
}
|
|
255
257
|
}
|
|
256
258
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
259
|
+
newForm.region = newForm.country + '-' + region;
|
|
260
|
+
newForm.address_1 = address1;
|
|
261
|
+
newForm.postal_code = postcode;
|
|
260
262
|
|
|
261
263
|
nextTick(() => {
|
|
262
|
-
newForm.address_1 = address1;
|
|
263
|
-
|
|
264
264
|
// Force value change
|
|
265
265
|
/* if (address1Input.value) {
|
|
266
266
|
address1Input.value.value = address1;
|
|
267
267
|
} */
|
|
268
268
|
|
|
269
|
-
newForm.postal_code = postcode;
|
|
270
|
-
|
|
271
269
|
emit('update:model-value', newForm);
|
|
272
270
|
});
|
|
273
271
|
}
|