@bcrs-shared-components/base-address 2.0.41 → 2.0.43

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.
Files changed (2) hide show
  1. package/BaseAddress.vue +32 -22
  2. package/package.json +3 -3
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 = { key }
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,11 +1,11 @@
1
1
  {
2
2
  "name": "@bcrs-shared-components/base-address",
3
- "version": "2.0.41",
3
+ "version": "2.0.43",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "dependencies": {
8
- "@bcrs-shared-components/mixins": "^1.1.57",
8
+ "@bcrs-shared-components/mixins": "^1.1.58",
9
9
  "lodash.uniqueid": "^4.0.1",
10
10
  "vue": "^2.7.14",
11
11
  "vuelidate": "0.6.2"
@@ -14,5 +14,5 @@
14
14
  "vue-property-decorator": "^9.1.2",
15
15
  "vuelidate-property-decorators": "1.0.28"
16
16
  },
17
- "gitHead": "2970bebeebfb0863543aaa35b09bbd119ac86bf4"
17
+ "gitHead": "957994ce00fc51ddefcc9a2e024c1f4846369025"
18
18
  }