@volverjs/ui-vue 0.0.7 → 0.0.8-beta.1
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/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/stories/Alert/Alert.settings.ts +10 -0
- package/src/stories/Alert/Alert.test.ts +8 -4
|
@@ -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 -->
|
|
@@ -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
|