@bcrs-shared-components/base-address 2.0.44 → 2.0.46

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.
@@ -61,5 +61,6 @@ FilledInBaseAddress['args'] = {
61
61
  postalCode: 'V8N 1A1',
62
62
  deliveryInstructions: 'Leave at front door'
63
63
  },
64
- noPoBox: true
64
+ noPoBox: true,
65
+ isInactive: false
65
66
  }
package/BaseAddress.vue CHANGED
@@ -18,6 +18,7 @@
18
18
  <div
19
19
  v-if="!editing"
20
20
  class="address-block"
21
+ :class="{ 'inactive' : isInactive }"
21
22
  >
22
23
  <div class="address-block__info pre-line">
23
24
  <div class="address-block__info-row street-address">
@@ -70,7 +71,7 @@
70
71
  menu-props="auto"
71
72
  item-text="name"
72
73
  item-value="code"
73
- :items="getCountries()"
74
+ :items="getCountriesList()"
74
75
  :rules="[...rules.addressCountry, ...spaceRules]"
75
76
  @change="resetRegion()"
76
77
  />
@@ -227,6 +228,9 @@ export default class BaseAddress extends Mixins(ValidationMixin, CountriesProvin
227
228
  @Prop({ default: false })
228
229
  readonly excludeBC: boolean
229
230
 
231
+ @Prop({ default: false })
232
+ readonly isInactive: boolean
233
+
230
234
  resetRegion () {
231
235
  this.addressLocal['addressRegion'] = ''
232
236
  }
@@ -497,6 +501,27 @@ export default class BaseAddress extends Mixins(ValidationMixin, CountriesProvin
497
501
  Vue.nextTick(() => { (this.$refs.addressForm as any).validate() })
498
502
  }
499
503
 
504
+ getCountriesList (): Array<object> {
505
+ const countries = this.getCountries()
506
+
507
+ // List of priority countries
508
+ const priorityCountries = ['Canada', 'United States of America']
509
+
510
+ const prioritizedCountries = countries.filter((country: any) =>
511
+ priorityCountries.includes(country.name)
512
+ )
513
+
514
+ const countriesList = countries.filter((country: any) =>
515
+ !priorityCountries.includes(country.name)
516
+ )
517
+
518
+ return [
519
+ ...prioritizedCountries,
520
+ { divider: true },
521
+ ...countriesList
522
+ ]
523
+ }
524
+
500
525
  combineLines (line1: string, line2: string) {
501
526
  if (!line1) return line2
502
527
  if (!line2) return line1
@@ -521,6 +546,10 @@ export default class BaseAddress extends Mixins(ValidationMixin, CountriesProvin
521
546
  color: $gray7;
522
547
  }
523
548
 
549
+ .inactive, .inactive .address-block__info-row {
550
+ color: $gray5 !important;
551
+ }
552
+
524
553
  // Form Row Elements
525
554
  .form__row.three-column {
526
555
  align-items: stretch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bcrs-shared-components/base-address",
3
- "version": "2.0.44",
3
+ "version": "2.0.46",
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": "fc533a2bff2dc2408032d83f8de16cb7e6cdf09f"
17
+ "gitHead": "513fd0f2bb1de514272e80f48d8790b44bb1963d"
18
18
  }