@worksafevictoria/wcl7.5 1.1.0-beta.94 → 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.94",
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
 
@@ -3,9 +3,9 @@ import hscpRecord from './index.vue'
3
3
  const cpData =
4
4
  {
5
5
  title: 'Australian Nurses and Midwifery Federation - Victorian Branch',
6
- fulladdress: 'Level 8/535 Elizabeth St Melbourne VIC 3000',
7
- workphone: '03 9555 9333',
8
- tollfreephone: '1800 555 333',
6
+ fullAddress: 'Level 8/535 Elizabeth St Melbourne VIC 3000',
7
+ workPhone: '03 9555 9333',
8
+ tollfreePhone: '1800 555 333',
9
9
  email: 'ohs@test.com.au',
10
10
  website: 'https://www.anmfvic.asn.au/education-and-training/hsr-training/events',
11
11
  contact1: 'Christina Groebl',
@@ -15,21 +15,15 @@ const cpData =
15
15
  phone2: '03 9555 0666',
16
16
  email2: 'jbradford@test.com.au',
17
17
  courses: ['HSR Initial', 'HSR Refresher'],
18
- trainingvenues: ['Melbourne CBD', 'All Regional Victoria - HQ in Melbourne'],
18
+ trainingVenues: ['Melbourne CBD', 'All Regional Victoria - HQ in Melbourne'],
19
19
  id: '1'
20
20
  }
21
21
 
22
22
 
23
23
  export default {
24
- title: 'Paragraphs/Directory/Record',
24
+ title: 'Paragraphs/Directory/SingleRecord',
25
25
  component: hscpRecord,
26
- tags: ['autodocs'],
27
- argTypes: {
28
- location: {
29
- control: ['object', 'boolean'],
30
- table: { disable: true }
31
- },
32
- }
26
+ tags: ['autodocs']
33
27
  }
34
28
 
35
29
  export const CourseProvider = {}
@@ -10,7 +10,7 @@
10
10
  </column>
11
11
  <column class="address">
12
12
  <a target="_blank" :href="gMapLink">
13
- {{ item.fulladdress }}
13
+ {{ item.fullAddress }}
14
14
  </a>
15
15
  </column>
16
16
  <column class="contact">
@@ -28,7 +28,7 @@
28
28
  <column class="contact">
29
29
  <div class="label">Phone</div>
30
30
  <a :href="`tel:${item.tollfreephone || item.workphone}`"><span class="sr-only visually-hidden">Phone number</span>
31
- {{ item.tollfreephone || item.workphone }}
31
+ {{ item.tollfreePhone || item.workPhone }}
32
32
  </a>
33
33
  </column>
34
34
  <column class="hscp-caret" sm="1">
@@ -107,7 +107,7 @@
107
107
  <row>
108
108
  <column>
109
109
  <ul>
110
- <li v-for="(venue) in item.trainingvenues" :key="venue.id">
110
+ <li v-for="(venue) in item.trainingVenues" :key="venue.id">
111
111
  {{venue}}
112
112
  </li>
113
113
  </ul>
@@ -148,10 +148,6 @@ export default {
148
148
  item: {
149
149
  type: Object,
150
150
  required: true
151
- },
152
- location: {
153
- type: [Object, Boolean],
154
- default: false
155
151
  }
156
152
  },
157
153
  data() {
@@ -161,6 +157,11 @@ export default {
161
157
  CaretDown,
162
158
  }
163
159
  },
160
+ computed: {
161
+ gMapLink() {
162
+ return `https://google.com/maps?q=${this.item.title}%20${this.item.fullAddress}`
163
+ },
164
+ },
164
165
  methods: {
165
166
  handleClick(title) {
166
167
  this.visible = !this.visible
@@ -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