@worksafevictoria/wcl7.5 1.1.0-beta.71 → 1.1.0-beta.73

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worksafevictoria/wcl7.5",
3
- "version": "1.1.0-beta.71",
3
+ "version": "1.1.0-beta.73",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -193,7 +193,7 @@ export default {
193
193
  return 6
194
194
  },
195
195
  uniqueClass() {
196
- return `cardGrid-${this.$options._uid}`
196
+ return `cardGrid-${Math.random().toString(36).slice(2, 11)}`
197
197
  }
198
198
  },
199
199
  watch: {
@@ -23,6 +23,7 @@
23
23
  </template>
24
24
 
25
25
  <script>
26
+ import { getCurrentInstance } from 'vue'
26
27
  import Icon from './../../SubComponents/Icon/index.vue'
27
28
  import ChevUp from './../../../assets/icons/chev-up.svg?raw'
28
29
  import CaretUp from './../../../assets/icons/caret-up.svg?url'
@@ -71,11 +72,13 @@ export default {
71
72
  },
72
73
  //Identify if this is a tabbed card WSV2-374
73
74
  isTabbedCard() {
74
- const TabCardClassList = this.$parent.$el.classList
75
- if (TabCardClassList.contains('tabbed-card')) {
76
- return true
75
+ const instance = getCurrentInstance();
76
+ const parentEl = instance?.parent?.proxy?.$el.parentNode;
77
+
78
+ if (parentEl && parentEl.classList.contains('tabbed-card')) {
79
+ return true;
77
80
  } else {
78
- return false
81
+ return false;
79
82
  }
80
83
  },
81
84
  //If isTabbedCard, then supportive text must be displayed for up and down carets. WSV2-374
@@ -50,7 +50,7 @@
50
50
  <slot name="preContent"></slot>
51
51
  </column>
52
52
  </row>
53
-
53
+
54
54
  <div
55
55
  class="section-group__content section-group__row"
56
56
  :class="{
@@ -261,9 +261,9 @@ export default {
261
261
  padding-bottom: 0px;
262
262
  }
263
263
 
264
- // &__row {
265
- // padding-top: $basePadding;
266
- // }
264
+ &__row {
265
+ padding-top: $basePadding;
266
+ }
267
267
 
268
268
  &.rtl {
269
269
  @include makeRTL;
@@ -274,7 +274,7 @@ export default {
274
274
  }
275
275
 
276
276
  &__content {
277
- // padding-bottom: $basePadding;
277
+ padding-bottom: $basePadding;
278
278
  > :deep(.row) {
279
279
  row-gap: calc(#{$basePadding} / 2);
280
280
  }
@@ -322,12 +322,10 @@ export default {
322
322
 
323
323
  if (this.showCookie && bannerDisplayed !== 'true') {
324
324
  // Show the banner if it's not been displayed yet
325
- console.log('** Show the banner if its not been displayed yet:-')
326
325
  cookieElement.classList.remove('hide')
327
326
  cookieElement.classList.add('show')
328
327
  } else {
329
328
  // Hide the banner if user has already made a selection
330
- console.log('** Hide the banner if user has already made a selection:-')
331
329
  // need to remove cookies in rejected categories, but first hide cookie overlay
332
330
  cookieElement.classList.add('hide')
333
331
  cookieElement.classList.remove('show')
@@ -95,16 +95,14 @@ export default {
95
95
  this.setCookie()
96
96
  this.displayGlobal = false
97
97
  } else if (typeof window !== 'undefined') {
98
- console.log('**else this.showGlobalNotice:-', this.showGlobalNotice)
99
- console.log('**else tocalStorage.getItem(globalModalHidden):-', localStorage.getItem('globalModalHidden'))
100
-
98
+
101
99
  this.displayGlobal =
102
100
  this.showGlobalNotice === true &&
103
101
  !localStorage.getItem('globalModalHidden')
104
102
  } else {
105
103
  this.displayGlobal = process.env.SHOW_GLOBAL_NOTICE === true
106
104
  }
107
- console.log('**this.displayGlobal:- ', this.displayGlobal)
105
+
108
106
  }
109
107
  }
110
108
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="tabbedCards.length > 0 && loaded"
4
- :ref="`tabbedCards-${_uid}`"
4
+ :ref="`tabbedCards-${uid}`"
5
5
  class="tabbed-cards"
6
6
  >
7
7
  <div v-for="(r, rIndex) in rows" :key="rIndex">
@@ -40,7 +40,8 @@
40
40
  :is-expandable="true"
41
41
  />
42
42
  </template>
43
- <template v-slot:cardGridFooter>
43
+ <template
44
+ v-slot:cardGridFooter >
44
45
  <column
45
46
  v-if="selectedRow === rIndex && selectedCard"
46
47
  class="listgroup-column"
@@ -64,6 +65,7 @@
64
65
  </template>
65
66
 
66
67
  <script>
68
+ import { toRaw } from 'vue'
67
69
  import CardGrid from './../../Common/CardGrid/index.vue'
68
70
  import CardGridItem from './../../Common/CardGridItem/index.vue'
69
71
  import Column from './../../Containers/Column/index.vue'
@@ -104,16 +106,13 @@ export default {
104
106
  screenWidth: 0,
105
107
  loaded: false,
106
108
  tabList: null,
109
+ uid: Math.random().toString(36).slice(2, 11)
107
110
  }
108
111
  },
109
112
  computed: {
110
113
  rows() {
111
- let r = Math.floor(this.tabbedCards.length / this.cols)
112
- if (r % 1 != 0) {
113
- return r
114
- } else {
115
- return r + 1
116
- }
114
+ let r = Math.ceil(this.tabbedCards.length / this.cols);
115
+ return r;
117
116
  },
118
117
  cols() {
119
118
  if (this.screenWidth < 575.98) {
@@ -142,7 +141,7 @@ export default {
142
141
  },
143
142
  methods: {
144
143
  getCardIdPrefix(rIndex, cardIndex) {
145
- const cardPrefix = `tabbedcards-${this._uid}-r-${rIndex}`
144
+ const cardPrefix = `tabbedcards-${this.uid}-r-${rIndex}`
146
145
  if (cardIndex !== null && cardIndex !== undefined) {
147
146
  return `${cardPrefix}-${cardIndex}`
148
147
  }
@@ -153,9 +152,11 @@ export default {
153
152
  let end = start + this.cols
154
153
  return rows.slice(start, end)
155
154
  },
156
- async setCurrentRow(rowIndex, card) {
155
+ setCurrentRow(rowIndex, card) {
156
+ const rawCard = toRaw(this.selectedCard);
157
157
  const sameCardSelected =
158
- card.selectedCard === this.selectedCard || !card.selectedCard
158
+ card.selectedCard.title === rawCard?.title || !card.selectedCard.title
159
+
159
160
  this.selectedCard = null
160
161
  this.selectedRow = null
161
162
  const cardGrids = this.$refs.cardgrid || []
@@ -164,7 +165,6 @@ export default {
164
165
  cardGrid.clearCards()
165
166
  }
166
167
  })
167
- await nextTick()
168
168
  this.tabList = this.getFocusElements()
169
169
  setTimeout(() => {
170
170
  if (window && !sameCardSelected) {