@worksafevictoria/wcl7.5 1.1.0-beta.72 → 1.1.0-beta.74

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.
@@ -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">
@@ -28,19 +28,20 @@
28
28
  :show-divider="false"
29
29
  :header-size="'large'"
30
30
  class="tabbed-card"
31
- :class="card === selectedCard ? 'isSelected' : ''"
31
+ :class="checkSelectedCard(card) ? 'isSelected' : ''"
32
32
  :card-padding="'small'"
33
33
  :card-header-title="card.title"
34
- :caret="card === selectedCard ? 'up' : 'down'"
34
+ :caret="checkSelectedCard(card) ? 'up' : 'down'"
35
35
  :caret-position="'bottom'"
36
36
  :rtl="rtl || card.rtl"
37
37
  :description="card.text"
38
38
  :button-role="'link'"
39
- :is-selected="card === selectedCard"
39
+ :is-selected="checkSelectedCard(card)"
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"
@@ -104,16 +105,13 @@ export default {
104
105
  screenWidth: 0,
105
106
  loaded: false,
106
107
  tabList: null,
108
+ uid: Math.random().toString(36).slice(2, 11)
107
109
  }
108
110
  },
109
111
  computed: {
110
112
  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
- }
113
+ let r = Math.ceil(this.tabbedCards.length / this.cols);
114
+ return r;
117
115
  },
118
116
  cols() {
119
117
  if (this.screenWidth < 575.98) {
@@ -142,7 +140,7 @@ export default {
142
140
  },
143
141
  methods: {
144
142
  getCardIdPrefix(rIndex, cardIndex) {
145
- const cardPrefix = `tabbedcards-${this._uid}-r-${rIndex}`
143
+ const cardPrefix = `tabbedcards-${this.uid}-r-${rIndex}`
146
144
  if (cardIndex !== null && cardIndex !== undefined) {
147
145
  return `${cardPrefix}-${cardIndex}`
148
146
  }
@@ -153,9 +151,12 @@ export default {
153
151
  let end = start + this.cols
154
152
  return rows.slice(start, end)
155
153
  },
156
- async setCurrentRow(rowIndex, card) {
157
- const sameCardSelected =
158
- card.selectedCard === this.selectedCard || !card.selectedCard
154
+ checkSelectedCard(card) {
155
+ return JSON.stringify(card) === JSON.stringify(this.selectedCard);
156
+ },
157
+ setCurrentRow(rowIndex, card) {
158
+ const sameCardSelected = this.checkSelectedCard(card.selectedCard) || !card.selectedCard
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) {
@@ -16,29 +16,28 @@
16
16
  </div>
17
17
  </a>
18
18
  <!-- Modal -->
19
- <div v-if="showModal" :id="wcl-video-modal" class="modal" tabindex="-1" aria-modal="true" role="dialog" style="display: block;">
20
- <div class="modal-dialog modal-dialog-scrollable">
21
- <div class="modal-content">
22
- <div class="modal-header">
23
- <button type="button" class="btn-close" @click="showModal = !showModal" aria-label="close"></button>
24
- </div>
25
- <div class="modal-body">
26
- <div class="wcl-video-modal__video">
27
- <video-media
28
- :media-title="video.mediaTitle"
29
- :media-description="video.mediaDescription"
30
- :video-id="video.id"
31
- :provider="video.provider"
32
- :transcript="video.transcript"
33
- :transcript-title="video.transcriptTitle"
34
- :fix-width="video.fixWidth"
35
- :rtl="video.rtl"
36
- />
37
- </div>
38
- </div>
39
- </div>
19
+ <b-modal
20
+ :id="`wcl-video-modal`"
21
+ v-model="showModal"
22
+ scrollable
23
+ class="wcl-video-modal__modal"
24
+ no-footer
25
+ size="xl"
26
+ >
27
+ <div class="wcl-video-modal__video">
28
+ <video-media
29
+ :media-title="video.mediaTitle"
30
+ :media-description="video.mediaDescription"
31
+ :video-id="video.id"
32
+ :provider="video.provider"
33
+ :transcript="video.transcript"
34
+ :transcript-title="video.transcriptTitle"
35
+ :fix-width="video.fixWidth"
36
+ :rtl="video.rtl"
37
+ />
40
38
  </div>
41
- </div>
39
+ <template #footer><div></div></template>
40
+ </b-modal>
42
41
  </div>
43
42
  </template>
44
43
 
@@ -46,25 +45,27 @@
46
45
  import VideoMedia from './../../Paragraphs/VideoPlayer/index.vue'
47
46
  import VideoPlay from './../../../assets/icons/video-play.svg?url'
48
47
  import IconClose from './../../../assets/icons/icon-close.svg?url'
48
+ import { BModal } from 'bootstrap-vue-next'
49
49
 
50
50
  export default {
51
51
  name: 'VideoThumbnail',
52
52
  components: {
53
53
  VideoMedia,
54
- IconClose
54
+ IconClose,
55
+ 'b-modal': BModal,
55
56
  },
56
57
  props: {
57
58
  video: {
58
59
  type: Object,
59
- required: true
60
- }
60
+ required: true,
61
+ },
61
62
  },
62
63
  data() {
63
64
  return {
64
65
  VideoPlay,
65
66
  IconClose,
66
67
  showModal: false,
67
- videoThumbnail: ''
68
+ videoThumbnail: '',
68
69
  }
69
70
  },
70
71
  mounted() {
@@ -76,7 +77,7 @@ export default {
76
77
  this.videoThumbnail = `https://i.ytimg.com/vi/${this.video.id}/maxresdefault.jpg`
77
78
  if (process.env.IS_STORYBOOK !== 'TRUE') {
78
79
  let thumbnailAvailable = await this.$axios?.get(
79
- `${window.location.origin}/api/v2/urlExists?url=${this.videoThumbnail}`
80
+ `${window.location.origin}/api/v2/urlExists?url=${this.videoThumbnail}`,
80
81
  )
81
82
  if (
82
83
  thumbnailAvailable &&
@@ -92,99 +93,15 @@ export default {
92
93
  },
93
94
  async getVimeoThumbnail() {
94
95
  let thumbnail = await this.$axios.get(
95
- `https://vimeo.com/api/v2/video/${this.video.id}.json`
96
+ `https://vimeo.com/api/v2/video/${this.video.id}.json`,
96
97
  )
97
98
  if (thumbnail.data) {
98
99
  this.videoThumbnail = thumbnail.data[0].thumbnail_large
99
100
  }
100
- }
101
- }
101
+ },
102
+ },
102
103
  }
103
104
  </script>
104
- <style lang="scss">
105
- @import '../../../includes/scss/all';
106
- // The modal styling
107
- .modal {
108
- background: rgba(0,0,0,0.5)
109
- }
110
-
111
- .modal-backdrop {
112
- display: none;
113
- }
114
- .modal-dialog {
115
- max-width: 1110px;
116
- @media only screen and (max-width: 1150px) {
117
- margin: {
118
- left: 15px;
119
- right: 15px;
120
- top: 15px;
121
- }
122
- }
123
-
124
- .modal-content {
125
- position: relative;
126
- border-radius: 8px;
127
- }
128
-
129
- .modal-header {
130
- top: 0;
131
- height: 45px;
132
- background: $white;
133
- z-index: 1;
134
- margin-left: auto;
135
- margin-right:0%;
136
-
137
- &__wrap {
138
- position: relative;
139
- width: 100%;
140
- a {
141
- position: absolute;
142
- right: 0;
143
- z-index: 1;
144
- &.rtl {
145
- right: auto;
146
- left: 0;
147
- }
148
- svg {
149
- fill: $black;
150
- }
151
- }
152
- }
153
- }
154
- .modal-body {
155
- padding: 0px 32px 32px;
156
- margin-top: 16px;
157
- .video-player {
158
- @include fp(min-height, 250, 588);
159
- }
160
-
161
- .paragraph--video-media {
162
- margin: 0;
163
- .container {
164
- padding: 0;
165
- width: 100%;
166
- }
167
- h3 {
168
- margin: 0;
169
- font-style: normal;
170
- font-weight: bold;
171
- font-size: 28px;
172
- line-height: 32px;
173
- margin-bottom: 16px;
174
- display: inline-block;
175
- width: 98%;
176
- }
177
- }
178
- .section-group__block {
179
- max-width: 100%;
180
- }
181
- }
182
- .modal-header,
183
- .modal-footer {
184
- border: none;
185
- }
186
- }
187
- </style>
188
105
  <style lang="scss" scoped>
189
106
  @import '../../../includes/scss/all';
190
107
  // Outside wrapper style
@@ -20,6 +20,20 @@ $yellow: #ffd229;
20
20
  $lightyellow: #fff6d4;
21
21
  $outline: #da47ff;
22
22
  $outline-dark: #ffffff;
23
+ // Functional colours
24
+ $wsv-fun-dark-green: #576D2F;
25
+ $wsv-fun-dark-blue: #104f77;
26
+ $wsv-fun-dark-purple: #55356b;
27
+ $wsv-fun-dark-red: #760031;
28
+ $wsv-fun-dark-brown: #763b00;
29
+ $wsv-fun-dark-caramel: #cb7c2d;
30
+ $wsv-fun-light-teal: #7ac2b5;
31
+ $wsv-fun-light-blue: #8ecade;
32
+ $wsv-fun-light-purple: #9871a8;
33
+ $wsv-fun-light-fuchsia: #f16a7e;
34
+ $wsv-fun-light-green: #edeb72;
35
+ $wsv-fun-light-brown: #dbc38b;
36
+
23
37
 
24
38
  $theme-colors: (
25
39
  'gold': $gold,
@@ -43,7 +57,20 @@ $theme-colors: (
43
57
  'yellow': $yellow,
44
58
  'lightyellow': $lightyellow,
45
59
  'outline': $outline,
46
- 'outline-dark': $outline-dark
60
+ 'outline-dark': $outline-dark,
61
+ // Functional colours
62
+ 'wsv-fun-dark-green':$wsv-fun-dark-green,
63
+ 'wsv-fun-dark-blue':$wsv-fun-dark-blue,
64
+ 'wsv-fun-dark-purple':$wsv-fun-dark-purple,
65
+ 'wsv-fun-dark-red':$wsv-fun-dark-red,
66
+ 'wsv-fun-dark-brown':$wsv-fun-dark-brown,
67
+ 'wsv-fun-dark-caramel':$wsv-fun-dark-caramel,
68
+ 'wsv-fun-light-teal':$wsv-fun-light-teal,
69
+ 'wsv-fun-light-blue':$wsv-fun-light-blue,
70
+ 'wsv-fun-light-purple':$wsv-fun-light-purple,
71
+ 'wsv-fun-light-fuchsia':$wsv-fun-light-fuchsia,
72
+ 'wsv-fun-light-green':$wsv-fun-light-green,
73
+ 'wsv-fun-light-brown':$wsv-fun-light-brown
47
74
  );
48
75
 
49
76
  :export {