@bcrs-shared-components/base-address 2.0.41 → 2.0.42
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/BaseAddress.vue +32 -22
- package/package.json +2 -2
package/BaseAddress.vue
CHANGED
|
@@ -61,6 +61,26 @@
|
|
|
61
61
|
name="address-form"
|
|
62
62
|
lazy-validation
|
|
63
63
|
>
|
|
64
|
+
<div class="form__row">
|
|
65
|
+
<v-select
|
|
66
|
+
v-model="addressLocal.addressCountry"
|
|
67
|
+
filled
|
|
68
|
+
class="address-country"
|
|
69
|
+
:label="addressCountryLabel"
|
|
70
|
+
menu-props="auto"
|
|
71
|
+
item-text="name"
|
|
72
|
+
item-value="code"
|
|
73
|
+
:items="getCountries()"
|
|
74
|
+
:rules="[...rules.addressCountry, ...spaceRules]"
|
|
75
|
+
@change="resetRegion()"
|
|
76
|
+
/>
|
|
77
|
+
<!-- special field to select AddressComplete country, separate from our model field -->
|
|
78
|
+
<input
|
|
79
|
+
:id="addressCountryId"
|
|
80
|
+
type="hidden"
|
|
81
|
+
:value="addressCountry"
|
|
82
|
+
>
|
|
83
|
+
</div>
|
|
64
84
|
<div class="form__row">
|
|
65
85
|
<!-- NB1: AddressComplete needs to be enabled each time user clicks in this search field.
|
|
66
86
|
NB2: Only process first keypress -- assumes if user moves between instances of this
|
|
@@ -130,25 +150,6 @@
|
|
|
130
150
|
:rules="[...rules.postalCode, ...spaceRules]"
|
|
131
151
|
/>
|
|
132
152
|
</div>
|
|
133
|
-
<div class="form__row">
|
|
134
|
-
<v-select
|
|
135
|
-
v-model="addressLocal.addressCountry"
|
|
136
|
-
filled
|
|
137
|
-
class="address-country"
|
|
138
|
-
:label="addressCountryLabel"
|
|
139
|
-
menu-props="auto"
|
|
140
|
-
item-text="name"
|
|
141
|
-
item-value="code"
|
|
142
|
-
:items="getCountries()"
|
|
143
|
-
:rules="[...rules.addressCountry, ...spaceRules]"
|
|
144
|
-
/>
|
|
145
|
-
<!-- special field to select AddressComplete country, separate from our model field -->
|
|
146
|
-
<input
|
|
147
|
-
:id="addressCountryId"
|
|
148
|
-
type="hidden"
|
|
149
|
-
:value="addressCountry"
|
|
150
|
-
>
|
|
151
|
-
</div>
|
|
152
153
|
<div class="form__row">
|
|
153
154
|
<v-textarea
|
|
154
155
|
v-model="addressLocal.deliveryInstructions"
|
|
@@ -203,7 +204,7 @@ export default class BaseAddress extends Mixins(ValidationMixin, CountriesProvin
|
|
|
203
204
|
addressCity: '',
|
|
204
205
|
addressRegion: '',
|
|
205
206
|
postalCode: '',
|
|
206
|
-
addressCountry: '',
|
|
207
|
+
addressCountry: 'CA',
|
|
207
208
|
deliveryInstructions: ''
|
|
208
209
|
})
|
|
209
210
|
})
|
|
@@ -226,6 +227,10 @@ export default class BaseAddress extends Mixins(ValidationMixin, CountriesProvin
|
|
|
226
227
|
@Prop({ default: false })
|
|
227
228
|
readonly excludeBC: boolean
|
|
228
229
|
|
|
230
|
+
resetRegion () {
|
|
231
|
+
this.addressLocal['addressRegion'] = ''
|
|
232
|
+
}
|
|
233
|
+
|
|
229
234
|
/** A local (working) copy of the address, to contain the fields edited by the component (ie, the model). */
|
|
230
235
|
addressLocal: object = {}
|
|
231
236
|
|
|
@@ -241,7 +246,7 @@ export default class BaseAddress extends Mixins(ValidationMixin, CountriesProvin
|
|
|
241
246
|
}
|
|
242
247
|
|
|
243
248
|
/** A unique id for the Address Country input. */
|
|
244
|
-
addressCountryId (): string {
|
|
249
|
+
get addressCountryId (): string {
|
|
245
250
|
return `address-country-${this.uniqueId}`
|
|
246
251
|
}
|
|
247
252
|
|
|
@@ -438,7 +443,12 @@ export default class BaseAddress extends Mixins(ValidationMixin, CountriesProvin
|
|
|
438
443
|
{ element: this.streetAddressId, field: 'Line1', mode: pca.fieldMode.SEARCH },
|
|
439
444
|
{ element: this.addressCountryId, field: 'CountryName', mode: pca.fieldMode.COUNTRY }
|
|
440
445
|
]
|
|
441
|
-
const options = {
|
|
446
|
+
const options = {
|
|
447
|
+
key,
|
|
448
|
+
bar: {
|
|
449
|
+
visible: false
|
|
450
|
+
}
|
|
451
|
+
}
|
|
442
452
|
|
|
443
453
|
const addressComplete = new pca.Address(fields, options)
|
|
444
454
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcrs-shared-components/base-address",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.42",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"vue-property-decorator": "^9.1.2",
|
|
15
15
|
"vuelidate-property-decorators": "1.0.28"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "1ebcd6ec55a37ba58f8fc98b8884ee55c236bc5b"
|
|
18
18
|
}
|