sprintify-ui 0.0.168 → 0.0.169

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.
@@ -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 v = St(e.modelValue);
1058
+ let w = "", b = "", v = "";
1059
+ const g = St(e.modelValue);
1060
1060
  if (d.address_components) {
1061
- for (const g of d.address_components)
1062
- switch (g.types[0]) {
1061
+ for (const n of d.address_components)
1062
+ switch (n.types[0]) {
1063
1063
  case "street_number": {
1064
- w = `${g.long_name} ${w}`;
1064
+ w = `${n.long_name} ${w}`;
1065
1065
  break;
1066
1066
  }
1067
1067
  case "route": {
1068
- w += g.long_name;
1068
+ w += n.long_name;
1069
1069
  break;
1070
1070
  }
1071
1071
  case "postal_code": {
1072
- b = `${g.long_name}${b}`;
1072
+ b = `${n.long_name}${b}`;
1073
1073
  break;
1074
1074
  }
1075
1075
  case "postal_code_suffix": {
1076
- b = `${b}-${g.long_name}`;
1076
+ b = `${b}-${n.long_name}`;
1077
1077
  break;
1078
1078
  }
1079
1079
  case "locality":
1080
- v.city = g.long_name;
1080
+ g.city = n.long_name;
1081
1081
  break;
1082
1082
  case "administrative_area_level_1": {
1083
- v.region = g.short_name.toLowerCase();
1083
+ v = n.short_name.toLowerCase();
1084
1084
  break;
1085
1085
  }
1086
1086
  case "country":
1087
- v.country = g.short_name.toLowerCase();
1087
+ g.country = n.short_name.toLowerCase();
1088
1088
  break;
1089
1089
  }
1090
- u("country", v.country + ""), ct(() => {
1091
- v.address_1 = w, v.postal_code = b, i("update:model-value", v);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.0.168",
3
+ "version": "0.0.169",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -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
  };
@@ -210,6 +210,7 @@ function fillAddress() {
210
210
  const place = autocomplete.getPlace();
211
211
  let address1 = '';
212
212
  let postcode = '';
213
+ let region = '';
213
214
 
214
215
  const newForm = cloneDeep(props.modelValue);
215
216
 
@@ -245,7 +246,7 @@ function fillAddress() {
245
246
  newForm.city = component.long_name;
246
247
  break;
247
248
  case 'administrative_area_level_1': {
248
- newForm.region = component.short_name.toLowerCase();
249
+ region = component.short_name.toLowerCase();
249
250
  break;
250
251
  }
251
252
  case 'country':
@@ -254,20 +255,16 @@ function fillAddress() {
254
255
  }
255
256
  }
256
257
 
257
- update('country', newForm.country + '');
258
-
259
- // Wait until country updates...
258
+ newForm.region = newForm.country + '-' + region;
259
+ newForm.address_1 = address1;
260
+ newForm.postal_code = postcode;
260
261
 
261
262
  nextTick(() => {
262
- newForm.address_1 = address1;
263
-
264
263
  // Force value change
265
264
  /* if (address1Input.value) {
266
265
  address1Input.value.value = address1;
267
266
  } */
268
267
 
269
- newForm.postal_code = postcode;
270
-
271
268
  emit('update:model-value', newForm);
272
269
  });
273
270
  }