@worksafevictoria/wcl7.5 1.1.0-beta.95 → 1.1.0-beta.96

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.95",
3
+ "version": "1.1.0-beta.96",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -11,7 +11,7 @@
11
11
  :title-tag="titleTag"
12
12
  class="card-grid"
13
13
  :content-class="contentClass"
14
- :class="`cardGrid-${$.uid}`"
14
+ :class="`cardGrid-${gridId}`"
15
15
  :card-browse-content="cardBrowseContent"
16
16
  >
17
17
  <template v-if="$slots.gridHeaderRight" v-slot:headerRight>
@@ -30,7 +30,7 @@
30
30
  >
31
31
  <column
32
32
  v-for="(item, index) in cards"
33
- :key="`${redrawCounter}-${index}-${$.uid}`"
33
+ :key="`${redrawCounter}-${index}-${gridId}`"
34
34
  ref="cardColumns"
35
35
  :lg="largeViewPort"
36
36
  :md="mediumViewPort"
@@ -55,7 +55,7 @@
55
55
  import Row from './../../Containers/Row/index.vue'
56
56
  import Column from './../../Containers/Column/index.vue'
57
57
  import SectionGroup from './../../Containers/SectionGroup/index.vue'
58
- import debounce from 'lodash/debounce'
58
+ import { debounce } from 'lodash'
59
59
 
60
60
  export default {
61
61
  name: 'CardGrid',
@@ -158,6 +158,10 @@ export default {
158
158
  type: Boolean,
159
159
  default: false,
160
160
  },
161
+ gridId: {
162
+ type: String,
163
+ default: 'default',
164
+ },
161
165
  },
162
166
  data() {
163
167
  return {
@@ -12,23 +12,23 @@
12
12
  <script>
13
13
  import Icon from '../../SubComponents/Icon/index.vue'
14
14
  import ChevUp from '../../../assets/icons/chev-up.svg?raw'
15
- import debounce from 'lodash/debounce'
15
+ import { debounce } from 'lodash'
16
16
 
17
17
  export default {
18
18
  name: 'BackToTop',
19
19
  components: {
20
- Icon
20
+ Icon,
21
21
  },
22
22
  props: {
23
23
  storybook: {
24
24
  type: Boolean,
25
- default: false
26
- }
25
+ default: false,
26
+ },
27
27
  },
28
28
  data() {
29
29
  return {
30
30
  ChevUp,
31
- showBackToTop: false
31
+ showBackToTop: false,
32
32
  }
33
33
  },
34
34
  computed: {
@@ -38,7 +38,7 @@ export default {
38
38
  } else {
39
39
  return this.showBackToTop
40
40
  }
41
- }
41
+ },
42
42
  },
43
43
  mounted() {
44
44
  this.handleDebouncedScroll = debounce(this.showHideBtbBtn, 100)
@@ -57,8 +57,8 @@ export default {
57
57
  },
58
58
  showHideBtbBtn() {
59
59
  this.showBackToTop = window.scrollY > window.innerHeight / 2
60
- }
61
- }
60
+ },
61
+ },
62
62
  }
63
63
  </script>
64
64
 
@@ -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-${tabbedCards[0].cardid}`"
5
5
  class="tabbed-cards"
6
6
  >
7
7
  <div v-for="(r, rIndex) in rows" :key="rIndex">
@@ -40,8 +40,7 @@
40
40
  :is-expandable="true"
41
41
  />
42
42
  </template>
43
- <template
44
- v-slot:cardGridFooter >
43
+ <template v-slot:cardGridFooter>
45
44
  <column
46
45
  v-if="selectedRow === rIndex && selectedCard"
47
46
  class="listgroup-column"
@@ -105,13 +104,12 @@ export default {
105
104
  screenWidth: 0,
106
105
  loaded: false,
107
106
  tabList: null,
108
- uid: Math.random().toString(36).slice(2, 11)
109
107
  }
110
108
  },
111
109
  computed: {
112
110
  rows() {
113
- let r = Math.ceil(this.tabbedCards.length / this.cols);
114
- return r;
111
+ let r = Math.ceil(this.tabbedCards.length / this.cols)
112
+ return r
115
113
  },
116
114
  cols() {
117
115
  if (this.screenWidth < 575.98) {
@@ -140,7 +138,7 @@ export default {
140
138
  },
141
139
  methods: {
142
140
  getCardIdPrefix(rIndex, cardIndex) {
143
- const cardPrefix = `tabbedcards-${this.uid}-r-${rIndex}`
141
+ const cardPrefix = `tabbedcards-${this.tabbedCards[0].cardid}-r-${rIndex}`
144
142
  if (cardIndex !== null && cardIndex !== undefined) {
145
143
  return `${cardPrefix}-${cardIndex}`
146
144
  }
@@ -152,10 +150,11 @@ export default {
152
150
  return rows.slice(start, end)
153
151
  },
154
152
  checkSelectedCard(card) {
155
- return JSON.stringify(card) === JSON.stringify(this.selectedCard);
153
+ return JSON.stringify(card) === JSON.stringify(this.selectedCard)
156
154
  },
157
155
  setCurrentRow(rowIndex, card) {
158
- const sameCardSelected = this.checkSelectedCard(card.selectedCard) || !card.selectedCard
156
+ const sameCardSelected =
157
+ this.checkSelectedCard(card.selectedCard) || !card.selectedCard
159
158
 
160
159
  this.selectedCard = null
161
160
  this.selectedRow = null
@@ -16,14 +16,11 @@
16
16
  <b-tabs v-model="tabIndex">
17
17
  <b-tab
18
18
  v-for="(item, index) in items"
19
- :key="`${index}-${$.uid}`"
19
+ :key="`${index}-${item.cardId}`"
20
20
  :title="item.title"
21
21
  :title-link-class="`tab-item-${index}-${$.uid}`"
22
22
  >
23
- <rich-text
24
- :content="item.content.value"
25
- :without-container="true"
26
- />
23
+ <rich-text :content="item" :without-container="true" />
27
24
  </b-tab>
28
25
  </b-tabs>
29
26
  </template>
@@ -41,7 +41,8 @@
41
41
  </template>
42
42
  <script>
43
43
  import axios from 'axios'
44
- import debounce from 'lodash/debounce'
44
+ import { debounce } from 'lodash'
45
+
45
46
  import { detectBrowser } from '../../../../lib/detect-browser'
46
47
  import { BSpinner } from 'bootstrap-vue-next'
47
48