@asd20/ui 3.2.387 → 3.2.390

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-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asd20/ui",
3
- "version": "3.2.383",
3
+ "version": "3.2.389",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
@@ -13063,6 +13063,19 @@
13063
13063
  "integrity": "sha512-LI7v2mH02R55SekHYdv9pRHR9RajVNyIJ2N5IEkWbg7FT5ZmJ9Hw4mWxHeEUcd+dJo0QmzztHvDvWcc7prVFsw==",
13064
13064
  "dev": true
13065
13065
  },
13066
+ "focus-trap": {
13067
+ "version": "6.9.4",
13068
+ "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-6.9.4.tgz",
13069
+ "integrity": "sha512-v2NTsZe2FF59Y+sDykKY+XjqZ0cPfhq/hikWVL88BqLivnNiEffAsac6rP6H45ff9wG9LL5ToiDqrLEP9GX9mw==",
13070
+ "requires": {
13071
+ "tabbable": "^5.3.3"
13072
+ }
13073
+ },
13074
+ "focus-trap-vue": {
13075
+ "version": "1.1.1",
13076
+ "resolved": "https://registry.npmjs.org/focus-trap-vue/-/focus-trap-vue-1.1.1.tgz",
13077
+ "integrity": "sha512-N+M4d4uYymCogct417gUL7wWSMIW/oUcCicfg3eRdo+gz7jlQnIGwUwViFxPkKV7iyzpc81g6JeSxRWiYWU3eQ=="
13078
+ },
13066
13079
  "follow-redirects": {
13067
13080
  "version": "1.5.10",
13068
13081
  "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
@@ -27968,6 +27981,11 @@
27968
27981
  "integrity": "sha512-R9N6uDkVsghHePKh1TEqbnLddO2IY25OcsksyFp/qBe7XYd0PVbKEWxhcdMhpLzE1I6skj5l4aEZ3CRxcbArlA==",
27969
27982
  "dev": true
27970
27983
  },
27984
+ "tabbable": {
27985
+ "version": "5.3.3",
27986
+ "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-5.3.3.tgz",
27987
+ "integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA=="
27988
+ },
27971
27989
  "table": {
27972
27990
  "version": "4.0.2",
27973
27991
  "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "*.scss",
6
6
  "*.vue"
7
7
  ],
8
- "version": "3.2.387",
8
+ "version": "3.2.390",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -33,6 +33,8 @@
33
33
  "basicscroll": "^3.0.2",
34
34
  "countup.js": "^2.0.0",
35
35
  "date-fns": "^1.30.1",
36
+ "focus-trap": "^6.9.4",
37
+ "focus-trap-vue": "^1.1.1",
36
38
  "js-cookie": "^2.2.1",
37
39
  "lodash-es": "^4.17.15",
38
40
  "swiper": "^5.4.5",
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <div v-show="group.description || group.contactPhone || group.contactEmail" :class="classes">
2
+ <div
3
+ v-show="group.description || group.contactPhone || group.contactEmail"
4
+ :class="classes"
5
+ >
3
6
  <div class="asd20-department-contact-card__header">
4
7
  <h2 v-show="group.description">{{ group.title }}</h2>
5
8
  <p v-show="group.description">{{ group.description }}</p>
@@ -143,7 +146,9 @@ export default {
143
146
  methods: {
144
147
  onItemClick(item) {
145
148
  console.log(item)
146
- if (item.label === 'Send an Email') this.composingEmail = true
149
+ if (item.label === 'Send an Email') {
150
+ this.composingEmail = true
151
+ }
147
152
  },
148
153
  },
149
154
  }
@@ -102,8 +102,10 @@ export default {
102
102
  }
103
103
  },
104
104
  tag() {
105
- if (this.actionable && this.to && this.to[0] === '/' && this.$router)
106
- return 'button'
105
+ if (this.actionable)
106
+ return 'button'
107
+ // if (this.actionable && this.to && this.to[0] === '/' && this.$router)
108
+ // return 'button'
107
109
  if (this.actionable && this.hrefValue) return 'a'
108
110
  return 'div'
109
111
  },
@@ -128,11 +130,17 @@ export default {
128
130
 
129
131
  methods: {
130
132
  onClick(e) {
131
- if (this.tag === 'button') {
133
+ if (this.tag === 'button' && this.$router) {
132
134
  e.preventDefault()
133
135
  this.$router.push(this.to)
134
136
  }
135
137
  },
138
+ // onClick(e) {
139
+ // if (this.tag === 'button') {
140
+ // e.preventDefault()
141
+ // this.$router.push(this.to)
142
+ // }
143
+ // },
136
144
  },
137
145
  }
138
146
  </script>
@@ -6,30 +6,33 @@
6
6
  @before-leave="transitioning = true"
7
7
  >
8
8
  <div v-if="open" :class="classes">
9
- <div class="asd20-modal">
10
- <div v-if="title || $slots.title" class="asd20-modal__header">
11
- <asd20-icon v-if="icon" :name="icon" size="md" />
12
- <h2>{{ title }}<slot name="title" /></h2>
13
-
14
- <asd20-button
15
- v-if="dismissable"
16
- size="md"
17
- icon="close"
18
- label="Close"
19
- hide-label
20
- transparent
21
- @click.native="$emit('dismiss', false)"
22
- />
23
- </div>
24
- <slot name="header" />
25
- <div class="asd20-modal__content">
26
- <slot name="default" :transitioning="transitioning" />
27
- <slot name="main" />
28
- </div>
29
- <div class="asd20-modal__footer">
30
- <slot name="footer" />
9
+ <focus-trap :open="open">
10
+ <div class="asd20-modal">
11
+ <div v-if="title || $slots.title" class="asd20-modal__header">
12
+ <asd20-icon v-if="icon" :name="icon" size="md" />
13
+ <h2>{{ title }}<slot name="title" /></h2>
14
+
15
+ <asd20-button
16
+ ref="closeButton"
17
+ v-if="dismissable"
18
+ size="md"
19
+ icon="close"
20
+ label="Close"
21
+ hide-label
22
+ transparent
23
+ @click.native="$emit('dismiss', false)"
24
+ />
25
+ </div>
26
+ <slot name="header" />
27
+ <div class="asd20-modal__content">
28
+ <slot name="default" :transitioning="transitioning" />
29
+ <slot name="main" />
30
+ </div>
31
+ <div class="asd20-modal__footer">
32
+ <slot name="footer" />
33
+ </div>
31
34
  </div>
32
- </div>
35
+ </focus-trap>
33
36
  </div>
34
37
  </transition>
35
38
  </template>
@@ -37,9 +40,11 @@
37
40
  <script>
38
41
  import Asd20Icon from '../../atoms/Asd20Icon'
39
42
  import Asd20Button from '../../atoms/Asd20Button'
43
+ import { FocusTrap } from 'focus-trap-vue'
44
+
40
45
  export default {
41
46
  name: 'Asd20Modal',
42
- components: { Asd20Icon, Asd20Button },
47
+ components: { Asd20Icon, Asd20Button, FocusTrap },
43
48
  model: { prop: 'open', event: 'dismiss' },
44
49
  props: {
45
50
  open: { type: Boolean, default: false },
@@ -59,6 +64,26 @@ export default {
59
64
  }
60
65
  },
61
66
  },
67
+ watch: {
68
+ open: function(newVal) {
69
+ if (newVal) {
70
+ this.setFocus()
71
+ }
72
+ },
73
+ },
74
+ methods: {
75
+ setFocus() {
76
+ this.$nextTick(() => {
77
+ this.$refs.closeButton.$el.focus()
78
+ })
79
+ },
80
+ },
81
+
82
+ mounted() {
83
+ if (this.open === true) {
84
+ this.setFocus()
85
+ }
86
+ },
62
87
  }
63
88
  </script>
64
89