@worksafevictoria/wcl7.5 1.7.3 → 1.8.0-beta.10

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.
Files changed (24) hide show
  1. package/lib/utility.js +2 -0
  2. package/package.json +1 -1
  3. package/src/components/Common/CardGrid/index.vue +77 -82
  4. package/src/components/Common/CardGridItem/index.vue +6 -2
  5. package/src/components/Global/AppHeader/ModalSearch/index.vue +1 -0
  6. package/src/components/Global/AppHeader/index.vue +194 -284
  7. package/src/components/Global/AppHeaderNew/ModalSearch/index.vue +16 -14
  8. package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.stories.js +30 -0
  9. package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +182 -0
  10. package/src/components/Paragraphs/Directory/Asbestos/Records/index.stories.js +19 -0
  11. package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +254 -0
  12. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +38 -152
  13. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/styles.scss +127 -0
  14. package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +41 -87
  15. package/src/components/Paragraphs/Directory/HSCP/styles.scss +68 -0
  16. package/src/components/Paragraphs/Directory/Records/PRS/index.stories.js +2 -2
  17. package/src/components/Paragraphs/Directory/styles.scss +2 -0
  18. package/src/components/SubComponents/FormInstance/models/overrides/file.js +2 -1
  19. package/src/components/SubComponents/Search/SearchListing/index.vue +51 -45
  20. package/src/components/SubComponents/Search/index.stories.js +4 -3
  21. package/src/components/SubComponents/Search/index.vue +130 -138
  22. package/src/index.js +2 -0
  23. package/src/mock/asbestos-removalists.js +226 -0
  24. package/src/mock/course-provider.js +33 -19
package/lib/utility.js CHANGED
@@ -35,6 +35,8 @@ function isGovSite(url) {
35
35
  }
36
36
 
37
37
  function navigateToPath(path, newTab, nuxtRouter) {
38
+ debugger
39
+
38
40
  const url = String(path).startsWith('www.') ? `http://${path}` : path
39
41
  const isAbsolute = isAbsoluteUrl(url)
40
42
  const router = nuxtRouter ? nuxtRouter : this.$router
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worksafevictoria/wcl7.5",
3
- "version": "1.7.3",
3
+ "version": "1.8.0-beta.10",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -52,13 +52,13 @@
52
52
  </template>
53
53
 
54
54
  <script>
55
- import Row from './../../Containers/Row/index.vue'
56
- import Column from './../../Containers/Column/index.vue'
57
- import SectionGroup from './../../Containers/SectionGroup/index.vue'
58
- import { debounce } from 'lodash-es'
55
+ import Row from "./../../Containers/Row/index.vue";
56
+ import Column from "./../../Containers/Column/index.vue";
57
+ import SectionGroup from "./../../Containers/SectionGroup/index.vue";
58
+ import { debounce } from "lodash-es";
59
59
 
60
60
  export default {
61
- name: 'CardGrid',
61
+ name: "CardGrid",
62
62
  components: { Row, Column, SectionGroup },
63
63
  props: {
64
64
  title: {
@@ -71,7 +71,7 @@ export default {
71
71
  },
72
72
  titleTag: {
73
73
  type: String,
74
- default: 'h2',
74
+ default: "h2",
75
75
  },
76
76
  cards: {
77
77
  type: Array,
@@ -99,9 +99,9 @@ export default {
99
99
  },
100
100
  size: {
101
101
  type: String,
102
- default: 'page',
102
+ default: "page",
103
103
  validator: (value) =>
104
- ['half-content', 'content', 'page', 'full'].indexOf(value) >= 0,
104
+ ["half-content", "content", "page", "full"].indexOf(value) >= 0,
105
105
  },
106
106
  isSelectable: {
107
107
  type: Boolean,
@@ -112,23 +112,17 @@ export default {
112
112
  },
113
113
  backgroundVariant: {
114
114
  type: String,
115
- default: 'none',
115
+ default: "none",
116
116
  validator: (value) =>
117
- [
118
- 'none',
119
- 'light',
120
- 'dark',
121
- 'grey',
122
- 'yellow',
123
- 'white',
124
- 'lightblue',
125
- ].indexOf(value) >= 0,
117
+ ["none", "light", "dark", "grey", "yellow", "white", "lightblue"].indexOf(
118
+ value
119
+ ) >= 0,
126
120
  },
127
121
  applyBackgroundOn: {
128
122
  type: String,
129
- default: 'section',
123
+ default: "section",
130
124
  validator: (value) =>
131
- ['content', 'block', 'container', 'section'].indexOf(value) >= 0,
125
+ ["content", "block", "container", "section"].indexOf(value) >= 0,
132
126
  },
133
127
  noPaddingTop: {
134
128
  type: Boolean,
@@ -138,8 +132,8 @@ export default {
138
132
  },
139
133
  rowSpacing: {
140
134
  type: String,
141
- default: 'large',
142
- validator: (value) => ['none', 'small', 'large'].indexOf(value) >= 0,
135
+ default: "large",
136
+ validator: (value) => ["none", "small", "large"].indexOf(value) >= 0,
143
137
  },
144
138
  rowClasses: {
145
139
  type: String,
@@ -147,12 +141,12 @@ export default {
147
141
  },
148
142
  columnSpacing: {
149
143
  type: String,
150
- default: 'default',
151
- validator: (value) => ['default', 'none'].indexOf(value) >= 0,
144
+ default: "default",
145
+ validator: (value) => ["default", "none"].indexOf(value) >= 0,
152
146
  },
153
147
  contentClass: {
154
148
  type: String,
155
- default: '',
149
+ default: "",
156
150
  },
157
151
  cardBrowseContent: {
158
152
  type: Boolean,
@@ -160,7 +154,7 @@ export default {
160
154
  },
161
155
  gridId: {
162
156
  type: String,
163
- default: 'default',
157
+ default: "default",
164
158
  },
165
159
  },
166
160
  data() {
@@ -168,89 +162,90 @@ export default {
168
162
  childCards: [],
169
163
  redrawCounter: 0,
170
164
  setColumnSizeDebounce: debounce(this.setColumnSize, 500),
171
- }
165
+ };
172
166
  },
173
167
  computed: {
174
168
  largeViewPort() {
175
169
  if (this.forceLgColumnsPerRow) {
176
- return 12 / this.forceLgColumnsPerRow
170
+ return 12 / this.forceLgColumnsPerRow;
177
171
  }
178
172
  return 12 / this.cards.length > 12 / (this.columnsPerRow || 3)
179
173
  ? 12 / this.cards.length
180
- : 12 / this.columnsPerRow
174
+ : 12 / this.columnsPerRow;
181
175
  },
182
176
  mediumViewPort() {
183
177
  if (this.forceMdColumnsPerRow) {
184
- return 12 / this.forceLgColumnsPerRow
178
+ return 12 / this.forceLgColumnsPerRow;
185
179
  }
186
180
  if (this.largeViewPort === 6) {
187
- return 6
181
+ return 6;
188
182
  }
189
- return 4
183
+ return 4;
190
184
  },
191
185
  smallViewPort() {
192
186
  if (this.forceSmColumnsPerRow) {
193
- return 12 / this.forceLgColumnsPerRow
187
+ return 12 / this.forceLgColumnsPerRow;
194
188
  }
195
- return 6
189
+ return 6;
196
190
  },
197
191
  },
198
192
  watch: {
199
193
  cards: {
200
194
  handler: function () {
201
- this.redrawCounter += 1
202
- this.setColumnSizeDebounce()
195
+ this.redrawCounter += 1;
196
+ this.setColumnSizeDebounce();
203
197
  },
204
198
  deep: true,
205
199
  },
206
200
  columnsPerRow: {
207
201
  handler: function () {
208
- this.setColumnSizeDebounce()
202
+ this.setColumnSizeDebounce();
209
203
  },
210
204
  },
211
205
  forceSmColumnsPerRow: {
212
206
  handler: function () {
213
- this.setColumnSizeDebounce()
207
+ this.setColumnSizeDebounce();
214
208
  },
215
209
  },
216
210
  forceMdColumnsPerRow: {
217
211
  handler: function () {
218
- this.setColumnSizeDebounce()
212
+ this.setColumnSizeDebounce();
219
213
  },
220
214
  },
221
215
  forceLgColumnsPerRow: {
222
216
  handler: function () {
223
- this.setColumnSizeDebounce()
217
+ this.setColumnSizeDebounce();
224
218
  },
225
219
  },
226
220
  },
227
221
  mounted() {
228
- window.addEventListener('resize', this.setColumnSizeDebounce)
229
- this.setColumnSizeDebounce()
222
+ window.addEventListener("resize", this.setColumnSizeDebounce);
223
+ this.setColumnSizeDebounce();
230
224
  },
231
225
  beforeDestroy() {
232
- window.removeEventListener('resize', this.setColumnSizeDebounce)
226
+ window.removeEventListener("resize", this.setColumnSizeDebounce);
233
227
  },
234
228
  methods: {
235
229
  cardTitleSelected(selectedCard, ev) {
236
- this.clearCards()
237
- selectedCard.selected = !!!selectedCard.selected
238
- const selectedCardModelIndex = this.getChildIndex(selectedCard)
230
+ debugger;
231
+ this.clearCards();
232
+ selectedCard.selected = !!!selectedCard.selected;
233
+ const selectedCardModelIndex = this.getChildIndex(selectedCard);
239
234
 
240
- this.$emit('selected-title', {
241
- selectedCard: selectedCard.selected
242
- ? this.cards[selectedCardModelIndex]
243
- : null,
235
+ this.$emit("selected-title", {
236
+ selectedCard: selectedCard.selected ? this.cards[selectedCardModelIndex] : null,
244
237
  selectedCardModelIndex,
245
238
  ev,
246
- })
239
+ });
247
240
  },
248
241
  cardSelected(selectedCard, ev) {
249
- this.clearCards()
250
- selectedCard.selected = !!!selectedCard.selected
251
- const selectedCardModelIndex = this.getChildIndex(selectedCard)
242
+ debugger;
243
+ console.log("cardSelected selectedCard :- ", selectedCard);
244
+ this.clearCards();
245
+ selectedCard.selected = !!!selectedCard.selected;
246
+ const selectedCardModelIndex = this.getChildIndex(selectedCard);
252
247
 
253
- this.$emit('selected', {
248
+ this.$emit("selected", {
254
249
  selectedCard: selectedCard.selected
255
250
  ? this.cardBrowseContent
256
251
  ? this.childCards[selectedCardModelIndex]
@@ -258,59 +253,59 @@ export default {
258
253
  : null,
259
254
  selectedCardModelIndex,
260
255
  ev,
261
- })
256
+ });
262
257
  },
263
258
  clearCards(selectedCard) {
264
259
  this.childCards.forEach((card) => {
265
- card.selected = false
260
+ card.selected = false;
266
261
  if (!selectedCard || selectedCard !== card) {
267
- card.selected = false
262
+ card.selected = false;
268
263
  }
269
- })
264
+ });
270
265
  },
271
266
  getChildIndex(selectedCard) {
272
- return this.childCards.findIndex((item) => item === selectedCard)
267
+ return this.childCards.findIndex((item) => item === selectedCard);
273
268
  },
274
269
  registerChild(child) {
275
- this.childCards.push(child)
276
- this.setColumnSizeDebounce()
270
+ this.childCards.push(child);
271
+ this.setColumnSizeDebounce();
277
272
  },
278
273
  deregisterChild(child) {
279
- const index = this.childCards.indexOf(child)
274
+ const index = this.childCards.indexOf(child);
280
275
  if (index > -1) {
281
- this.childCards.splice(index, 1)
276
+ this.childCards.splice(index, 1);
282
277
  }
283
278
  },
284
279
  setColumnSize() {
285
280
  setTimeout(() => {
286
- const columns = this.$refs.cardColumns
281
+ const columns = this.$refs.cardColumns;
287
282
  if (Array.isArray(columns) && columns.length > 0) {
288
- const row = this.$refs.cardRow
289
- const elementWidth = columns[0].$el.offsetWidth
290
- const parentWidth = row.$el.offsetWidth
291
- const gridColumnSize = parseInt(parentWidth / elementWidth)
292
- const isMobileView = parentWidth < 480
293
- const isTabletView = !isMobileView && parentWidth < 767
294
- this.$emit('isMobileView', isMobileView)
295
- this.$emit('isTabletView', isTabletView)
296
- this.$emit('isDesktopView', !isTabletView && !isMobileView)
297
- this.$emit('isMobileOrTabletView', isMobileView || isTabletView)
298
- this.$emit('gridColumnSize', gridColumnSize)
283
+ const row = this.$refs.cardRow;
284
+ const elementWidth = columns[0].$el.offsetWidth;
285
+ const parentWidth = row.$el.offsetWidth;
286
+ const gridColumnSize = parseInt(parentWidth / elementWidth);
287
+ const isMobileView = parentWidth < 480;
288
+ const isTabletView = !isMobileView && parentWidth < 767;
289
+ this.$emit("isMobileView", isMobileView);
290
+ this.$emit("isTabletView", isTabletView);
291
+ this.$emit("isDesktopView", !isTabletView && !isMobileView);
292
+ this.$emit("isMobileOrTabletView", isMobileView || isTabletView);
293
+ this.$emit("gridColumnSize", gridColumnSize);
299
294
  this.childCards.forEach((card) =>
300
- card.setGridMetaData(gridColumnSize, isMobileView, isTabletView),
301
- )
295
+ card.setGridMetaData(gridColumnSize, isMobileView, isTabletView)
296
+ );
302
297
  }
303
- })
298
+ });
304
299
  },
305
300
  handleFocus(ev) {
306
- this.$emit('focussed', ev)
301
+ this.$emit("focussed", ev);
307
302
  },
308
303
  },
309
- }
304
+ };
310
305
  </script>
311
306
 
312
307
  <style lang="scss" scoped>
313
- @import '../../../includes/scss/all';
308
+ @import "../../../includes/scss/all";
314
309
  .card-grid {
315
310
  &__column {
316
311
  &--default {
@@ -117,8 +117,10 @@
117
117
  </card-grid-item-icon>
118
118
  <span v-if="pillText" class="visually-hidden">{{ pillText }}</span>
119
119
  </div>
120
+ <span class="d-none">Description :- {{ description }}</span>
121
+ <span class="d-none">stripDescriptionHtml :- {{ stripDescriptionHtml }}</span>
120
122
  <b-card-text
121
- v-if="$slots.cardDescription || description"
123
+ v-if="$slots.cardDescription || description || stripDescriptionHtml"
122
124
  tag="div"
123
125
  class="card-grid-item__body"
124
126
  :class="{
@@ -126,7 +128,6 @@
126
128
  }"
127
129
  >
128
130
  <div
129
- v-if="$slots.cardDescription || description"
130
131
  class="card-grid-item__description"
131
132
  :class="{
132
133
  [descriptionClass]: !!descriptionClass,
@@ -402,6 +403,8 @@ export default {
402
403
  },
403
404
  methods: {
404
405
  cardClicked(ev) {
406
+ debugger;
407
+
405
408
  if (this.isSelectable) {
406
409
  this.parentGrid.cardSelected(this, ev);
407
410
  }
@@ -411,6 +414,7 @@ export default {
411
414
  }
412
415
  },
413
416
  cardTitleClicked(ev) {
417
+ debugger;
414
418
  if (this.isCardTitleSelectable) {
415
419
  this.parentGrid.cardTitleSelected(this, ev);
416
420
  }
@@ -13,6 +13,7 @@
13
13
  <label class="app-search__label font-weight-bold" for="app-search--search-input-box"
14
14
  >Search WorkSafe</label
15
15
  >
16
+ googleSearchFlag:- {{ googleSearchFlag }}
16
17
  <search
17
18
  ref="searchInputBox"
18
19
  :google-search-flag="googleSearchFlag"