@volverjs/ui-vue 0.0.7 → 0.0.8-beta.3
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/dist/components/VvAlert/VvAlert.es.js +27 -18
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +4 -0
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +27 -18
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +18 -6
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +15 -5
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/index.es.js +18 -6
- package/dist/components/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/stories/Alert/Alert.settings.d.ts +10 -0
- package/package.json +28 -28
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAlert/VvAlert.vue +29 -11
- package/src/components/VvCombobox/VvCombobox.vue +3 -1
- package/src/components/VvDropdown/VvDropdown.vue +15 -5
- package/src/stories/Alert/Alert.settings.ts +10 -0
- package/src/stories/Alert/Alert.test.ts +8 -4
- package/src/stories/Tooltip/Tooltip.test.ts +3 -1
|
@@ -16,27 +16,45 @@
|
|
|
16
16
|
|
|
17
17
|
<template>
|
|
18
18
|
<div v-bind="hasProps">
|
|
19
|
-
<div
|
|
19
|
+
<div
|
|
20
|
+
v-if="
|
|
21
|
+
$slots.header ||
|
|
22
|
+
$slots.title ||
|
|
23
|
+
$slots.close ||
|
|
24
|
+
$slots['title::before'] ||
|
|
25
|
+
$slots['title::after'] ||
|
|
26
|
+
title ||
|
|
27
|
+
dismissable ||
|
|
28
|
+
autoClose
|
|
29
|
+
"
|
|
30
|
+
class="vv-alert__header"
|
|
31
|
+
>
|
|
20
32
|
<VvIcon v-if="hasIcon" v-bind="hasIcon" class="vv-alert__icon" />
|
|
21
33
|
<!-- @slot Header slot -->
|
|
22
34
|
<slot name="header">
|
|
23
35
|
<!-- @slot Before title slot -->
|
|
24
36
|
<slot name="title::before" />
|
|
25
37
|
<strong :id="hasTitleId" class="vv-alert__title">
|
|
26
|
-
|
|
38
|
+
<!-- @slot Title slot -->
|
|
39
|
+
<slot name="title">
|
|
40
|
+
{{ title }}
|
|
41
|
+
</slot>
|
|
27
42
|
</strong>
|
|
28
43
|
<!-- @slot After title slot -->
|
|
29
44
|
<slot name="title::after" />
|
|
30
45
|
</slot>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
<!-- @slot Close button slot -->
|
|
47
|
+
<slot name="close" v-bind="{ close }">
|
|
48
|
+
<button
|
|
49
|
+
v-if="dismissable || autoClose"
|
|
50
|
+
class="vv-alert__close"
|
|
51
|
+
type="button"
|
|
52
|
+
:aria-label="closeLabel"
|
|
53
|
+
@click.stop="close"
|
|
54
|
+
>
|
|
55
|
+
<div class="vv-alert__close-mask"></div>
|
|
56
|
+
</button>
|
|
57
|
+
</slot>
|
|
40
58
|
</div>
|
|
41
59
|
<div v-if="$slots.default || content" class="vv-alert__content">
|
|
42
60
|
<!-- @slot Content slot -->
|
|
@@ -210,7 +210,9 @@
|
|
|
210
210
|
floatingEl.value,
|
|
211
211
|
)
|
|
212
212
|
if (focusableElements.length > 0) {
|
|
213
|
-
focusableElements[0].focus(
|
|
213
|
+
focusableElements[0].focus({
|
|
214
|
+
preventScroll: true,
|
|
215
|
+
})
|
|
214
216
|
}
|
|
215
217
|
})
|
|
216
218
|
}
|
|
@@ -286,9 +288,13 @@
|
|
|
286
288
|
document.activeElement as HTMLElement,
|
|
287
289
|
)
|
|
288
290
|
if (activeElementIndex < focusableElements.length - 1) {
|
|
289
|
-
focusableElements[activeElementIndex + 1].focus(
|
|
291
|
+
focusableElements[activeElementIndex + 1].focus({
|
|
292
|
+
preventScroll: true,
|
|
293
|
+
})
|
|
290
294
|
} else {
|
|
291
|
-
focusableElements[0].focus(
|
|
295
|
+
focusableElements[0].focus({
|
|
296
|
+
preventScroll: true,
|
|
297
|
+
})
|
|
292
298
|
}
|
|
293
299
|
}
|
|
294
300
|
})
|
|
@@ -306,9 +312,13 @@
|
|
|
306
312
|
document.activeElement as HTMLElement,
|
|
307
313
|
)
|
|
308
314
|
if (activeElementIndex > 0) {
|
|
309
|
-
focusableElements[activeElementIndex - 1].focus(
|
|
315
|
+
focusableElements[activeElementIndex - 1].focus({
|
|
316
|
+
preventScroll: true,
|
|
317
|
+
})
|
|
310
318
|
} else {
|
|
311
|
-
focusableElements[focusableElements.length - 1].focus(
|
|
319
|
+
focusableElements[focusableElements.length - 1].focus({
|
|
320
|
+
preventScroll: true,
|
|
321
|
+
})
|
|
312
322
|
}
|
|
313
323
|
}
|
|
314
324
|
})
|
|
@@ -16,7 +16,7 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
|
|
|
16
16
|
|
|
17
17
|
const alertHeaderEl =
|
|
18
18
|
element.getElementsByClassName('vv-alert__header')?.[0]
|
|
19
|
-
const
|
|
19
|
+
const closeButtonEl = element.getElementsByClassName('vv-alert__close')?.[0]
|
|
20
20
|
const alertContentEl =
|
|
21
21
|
element.getElementsByClassName('vv-alert__content')?.[0]
|
|
22
22
|
const alertFooterEl =
|
|
@@ -32,14 +32,18 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
|
|
|
32
32
|
// dismissable
|
|
33
33
|
if (args.dismissable) {
|
|
34
34
|
expect(element).toHaveClass('vv-alert--dismissable')
|
|
35
|
-
expect(
|
|
35
|
+
expect(closeButtonEl).not.toBeUndefined()
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// autoclose
|
|
39
39
|
if (args.autoClose) {
|
|
40
40
|
expect(element).toHaveClass('vv-alert--auto-close')
|
|
41
|
-
expect(
|
|
42
|
-
expect(
|
|
41
|
+
expect(closeButtonEl).not.toBeUndefined()
|
|
42
|
+
expect(closeButtonEl.firstChild).toHaveClass('vv-alert__close-mask')
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!args.autoClose && !args.dismissable) {
|
|
46
|
+
expect(closeButtonEl).toBeUndefined()
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
// icon
|
|
@@ -18,7 +18,9 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
// check if tooltip is visible after focus
|
|
21
|
-
await parentElement.focus(
|
|
21
|
+
await parentElement.focus({
|
|
22
|
+
preventScroll: true,
|
|
23
|
+
})
|
|
22
24
|
await sleep(1200)
|
|
23
25
|
await expect(window.getComputedStyle(element)).toHaveProperty(
|
|
24
26
|
'opacity',
|