@worksafevictoria/wcl7.5 1.1.0-beta.72 → 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
|
@@ -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
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
265
|
-
|
|
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
|
-
|
|
277
|
+
padding-bottom: $basePadding;
|
|
278
278
|
> :deep(.row) {
|
|
279
279
|
row-gap: calc(#{$basePadding} / 2);
|
|
280
280
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
v-if="tabbedCards.length > 0 && loaded"
|
|
4
|
-
:ref="`tabbedCards-${
|
|
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
|
|
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.
|
|
112
|
-
|
|
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.
|
|
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
|
-
|
|
155
|
+
setCurrentRow(rowIndex, card) {
|
|
156
|
+
const rawCard = toRaw(this.selectedCard);
|
|
157
157
|
const sameCardSelected =
|
|
158
|
-
|
|
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) {
|