sprintify-ui 0.0.167 → 0.0.168
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 +1752 -1762
- package/package.json +1 -1
- package/src/components/BaseAddressForm.stories.js +25 -16
- package/src/components/BaseAddressForm.vue +13 -13
package/package.json
CHANGED
|
@@ -7,23 +7,23 @@ export default {
|
|
|
7
7
|
argTypes: {},
|
|
8
8
|
args: {
|
|
9
9
|
countries: [
|
|
10
|
-
{
|
|
11
|
-
{
|
|
12
|
-
{
|
|
10
|
+
{ name: 'United States', id: 'us' },
|
|
11
|
+
{ name: 'Canada', id: 'ca' },
|
|
12
|
+
{ name: 'Mexico', id: 'mx' },
|
|
13
13
|
],
|
|
14
14
|
regions: [
|
|
15
|
-
{
|
|
16
|
-
{
|
|
17
|
-
{
|
|
18
|
-
{
|
|
19
|
-
{
|
|
20
|
-
{
|
|
21
|
-
{
|
|
22
|
-
{
|
|
23
|
-
{
|
|
24
|
-
{
|
|
25
|
-
{
|
|
26
|
-
{
|
|
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' },
|
|
27
27
|
],
|
|
28
28
|
},
|
|
29
29
|
};
|
|
@@ -31,7 +31,16 @@ export default {
|
|
|
31
31
|
const Template = (args) => ({
|
|
32
32
|
components: { BaseAddressForm, ShowValue },
|
|
33
33
|
setup() {
|
|
34
|
-
const form = ref({
|
|
34
|
+
const form = ref({
|
|
35
|
+
shipping_address: {
|
|
36
|
+
address_1: '333 rue Sherbrooke Est',
|
|
37
|
+
address_2: 'Suite 100',
|
|
38
|
+
city: 'Montreal',
|
|
39
|
+
country: 'ca',
|
|
40
|
+
region: 'qc',
|
|
41
|
+
postal_code: 'H2X 4E3',
|
|
42
|
+
},
|
|
43
|
+
});
|
|
35
44
|
return { args, form };
|
|
36
45
|
},
|
|
37
46
|
template: `
|
|
@@ -62,15 +62,11 @@
|
|
|
62
62
|
<BaseSelect
|
|
63
63
|
:model-value="normalizedModelValue.country ?? ''"
|
|
64
64
|
class="w-full"
|
|
65
|
+
:options="countries"
|
|
66
|
+
label-key="name"
|
|
67
|
+
value-key="id"
|
|
65
68
|
@update:model-value="update('country', $event)"
|
|
66
69
|
>
|
|
67
|
-
<option
|
|
68
|
-
v-for="country in countries"
|
|
69
|
-
:key="country.id"
|
|
70
|
-
:value="country.id"
|
|
71
|
-
>
|
|
72
|
-
{{ country.name }}
|
|
73
|
-
</option>
|
|
74
70
|
</BaseSelect>
|
|
75
71
|
</BaseField>
|
|
76
72
|
<BaseField
|
|
@@ -85,11 +81,11 @@
|
|
|
85
81
|
:name="`${namePrefix}region`"
|
|
86
82
|
class="w-full"
|
|
87
83
|
required
|
|
84
|
+
:options="regions"
|
|
85
|
+
label-key="name"
|
|
86
|
+
value-key="id"
|
|
88
87
|
@update:model-value="update('region', $event)"
|
|
89
88
|
>
|
|
90
|
-
<option v-for="region in regions" :key="region.id" :value="region.id">
|
|
91
|
-
{{ region.name }}
|
|
92
|
-
</option>
|
|
93
89
|
</BaseSelect>
|
|
94
90
|
</BaseField>
|
|
95
91
|
</div>
|
|
@@ -258,13 +254,17 @@ function fillAddress() {
|
|
|
258
254
|
}
|
|
259
255
|
}
|
|
260
256
|
|
|
257
|
+
update('country', newForm.country + '');
|
|
258
|
+
|
|
259
|
+
// Wait until country updates...
|
|
260
|
+
|
|
261
261
|
nextTick(() => {
|
|
262
262
|
newForm.address_1 = address1;
|
|
263
263
|
|
|
264
264
|
// Force value change
|
|
265
|
-
if (address1Input.value) {
|
|
266
|
-
|
|
267
|
-
}
|
|
265
|
+
/* if (address1Input.value) {
|
|
266
|
+
address1Input.value.value = address1;
|
|
267
|
+
} */
|
|
268
268
|
|
|
269
269
|
newForm.postal_code = postcode;
|
|
270
270
|
|