@worksafevictoria/wcl7.5 1.1.12 → 1.1.13

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.12",
3
+ "version": "1.1.13",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -4,33 +4,14 @@ import { tabbedCardsMockLinks } from '../../../mock/tabbed-cards'
4
4
  export default {
5
5
  title: 'Paragraphs/TabbedCards',
6
6
  component: TabbedCards,
7
- argTypes: {
8
- description: {
9
- control: 'text',
10
- defaultValue: 'Tabbed cards h2 heading'
11
- },
12
- heading: {
13
- control: 'text',
14
- defaultValue: 'Tabbed cards h2 heading'
15
- },
16
- tabbedCards: {
17
- control: 'object',
18
- defaultValue: tabbedCardsMockLinks
19
- },
20
- workwell: {
21
- control: 'boolean',
22
- defaultValue: false
23
- }
7
+ tags: ['autodocs'],
8
+ args: {
9
+ description: 'Tabbed cards h2 heading',
10
+ heading: 'Tabbed cards h2 heading',
11
+ tabbedCards: tabbedCardsMockLinks,
12
+ workwell: false,
13
+ rtl: false
24
14
  }
25
15
  }
26
16
 
27
- const Template = (args, { argTypes }) => ({
28
- components: { TabbedCards },
29
- props: Object.keys(argTypes),
30
- template: `
31
- <tabbed-cards
32
- v-bind="$props"
33
- /> `
34
- })
35
-
36
- export const Default = Template.bind({})
17
+ export const Default = {}
@@ -20,7 +20,7 @@
20
20
  :content-class="`tabbed-cards-content`"
21
21
  class="tabbed-cards__grid"
22
22
  @selected="(card, cardIndex) => setCurrentRow(rIndex, card)"
23
- @focussed="focussed($event)"
23
+ @focusin="focussed($event)"
24
24
  >
25
25
  <template v-slot:cardItem="{ card }">
26
26
  <card-grid-item
@@ -46,8 +46,7 @@
46
46
  >
47
47
  <column class="listgroup-column">
48
48
  <div ref="listgroup" class="tabbed-cards__listGroup">
49
- <component
50
- :is="ListGroupComponent"
49
+ <list-group
51
50
  :list="selectedCard.links"
52
51
  :title="selectedCard.linksTitle"
53
52
  :title-tag="selectedCard.linksTag"
@@ -69,10 +68,11 @@ import CardGrid from './../../Common/CardGrid/index.vue'
69
68
  import CardGridItem from './../../Common/CardGridItem/index.vue'
70
69
  import Column from './../../Containers/Column/index.vue'
71
70
  import Icon from './../../SubComponents/Icon/index.vue'
71
+ import ListGroup from './../../Paragraphs/ListGroup/index.vue'
72
72
 
73
73
  export default {
74
74
  name: 'TabbedCards',
75
- components: { CardGrid, CardGridItem, Icon, Column },
75
+ components: { CardGrid, CardGridItem, Icon, Column, ListGroup },
76
76
  props: {
77
77
  heading: {
78
78
  type: String,
@@ -120,19 +120,15 @@ export default {
120
120
  } else {
121
121
  return 3
122
122
  }
123
- },
124
- ListGroupComponent() {
125
- //List group component import to fix storybook bug
126
- return () => import('./../ListGroup/index.vue')
127
123
  }
128
124
  },
129
125
  mounted() {
130
126
  window.addEventListener('resize', this.updateScreenWidth)
131
127
  this.screenWidth = document.documentElement.clientWidth
132
- this.$root.$on('last-focus-out', () => {
128
+ /* this.$root.$on('last-focus-out', () => {
133
129
  this.selectedCard = null
134
130
  this.selectedRow = null
135
- })
131
+ }) */
136
132
  this.loaded = true
137
133
  },
138
134
  beforeDestroy() {
@@ -193,9 +189,7 @@ export default {
193
189
  },
194
190
  focussed(ev) {
195
191
  if (ev.shiftKey) {
196
- let prevTabbedCard = ev.target?.parentElement?.parentElement?.previousSibling?.getElementsByTagName(
197
- 'button'
198
- )[0]
192
+ let prevTabbedCard = ev.target?.parentElement?.parentElement?.previousSibling?.getElementsByTagName('button')[0]
199
193
  if (
200
194
  prevTabbedCard &&
201
195
  prevTabbedCard.getAttribute('aria-expanded') === 'true'
@@ -209,17 +203,13 @@ export default {
209
203
  }
210
204
  const lG = this.$refs.listgroup
211
205
  const isListGroupOpen = Array.isArray(lG) && lG.length > 0
212
- const cardIsSelected = ev.target.parentElement.classList.contains(
213
- 'isSelected'
214
- )
206
+ const cardIsSelected = ev.target.parentElement.classList.contains('isSelected')
215
207
  if (cardIsSelected && isListGroupOpen) {
216
208
  ev.preventDefault()
217
209
  lG[0].getElementsByTagName('button')[0].focus()
218
210
  } else if (!cardIsSelected && isListGroupOpen) {
219
211
  ev.preventDefault()
220
- let nextTabbedCard = ev.target?.parentElement?.parentElement?.nextSibling?.getElementsByTagName(
221
- 'button'
222
- )[0]
212
+ let nextTabbedCard = ev.target?.parentElement?.parentElement?.nextSibling?.getElementsByTagName('button')[0]
223
213
  if (nextTabbedCard) {
224
214
  nextTabbedCard.focus()
225
215
  } else {