@weni/unnnic-system 3.2.9-alpha.10 → 3.2.9-alpha.12
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/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue.d.ts.map +1 -1
- package/dist/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue.d.ts +43 -0
- package/dist/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue.d.ts.map +1 -0
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/{es-3cbe331a.js → es-66126ef1.mjs} +1 -1
- package/dist/{index-2241773d.js → index-f6e9b879.mjs} +1539 -1486
- package/dist/{pt-br-9ddee0e9.js → pt-br-3b5a8852.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{unnnic.js → unnnic.mjs} +1 -1
- package/dist/{unnnic.umd.cjs → unnnic.umd.js} +30 -30
- package/package.json +2 -2
- package/src/components/Button/Button.vue +4 -7
- package/src/components/ChartFunnel/ChartFunnel.vue +4 -0
- package/src/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue +9 -2
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelBaseRow.vue +1 -1
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue +65 -0
- package/src/components/Chip/Chip.vue +1 -1
- package/src/components/Input/BaseInput.vue +4 -4
- package/src/components/Input/Input.vue +1 -1
- package/src/components/Input/TextInput.vue +3 -2
- package/src/components/ModalDialog/ModalDialog.vue +26 -29
- package/src/components/Popover/__tests__/Popover.spec.js +18 -18
- package/src/components/Popover/index.vue +78 -93
- package/src/components/Select/SelectOption.vue +37 -43
- package/src/components/Select/__tests__/Select.spec.js +36 -41
- package/src/components/Select/__tests__/SelectItem.spec.js +15 -35
- package/src/components/Select/__tests__/SelectOption.spec.js +3 -6
- package/src/components/Select/index.vue +142 -192
- package/src/components/TemplatePreview/TemplatePreview.vue +25 -28
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +10 -10
- package/src/components/TemplatePreview/types.d.ts +3 -3
- package/src/stories/Button.stories.js +7 -1
- package/src/stories/ChartFunnel.stories.js +19 -0
- package/src/stories/Input.stories.js +4 -4
- package/src/stories/Popover.stories.js +9 -9
- package/src/stories/Select.stories.js +39 -39
- package/src/stories/TemplatePreview.stories.js +27 -27
- package/src/stories/TemplatePreviewModal.stories.js +31 -31
package/package.json
CHANGED
|
@@ -133,11 +133,9 @@ const isSizePropValid = computed(() => {
|
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
const buttonType = computed(() => {
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}[props.type] || props.type
|
|
140
|
-
);
|
|
136
|
+
return {
|
|
137
|
+
'alternative': 'tertiary',
|
|
138
|
+
}[props.type] || props.type;
|
|
141
139
|
});
|
|
142
140
|
|
|
143
141
|
const isTypePropValid = computed(() => {
|
|
@@ -162,8 +160,7 @@ const validateProps = () => {
|
|
|
162
160
|
|
|
163
161
|
if (!isTypePropValid.value) {
|
|
164
162
|
errorMessage += ' Invalid type prop.';
|
|
165
|
-
errorMessage +=
|
|
166
|
-
' Please provide one of the following types: primary, secondary, tertiary, warning, attention. Alternative is discontinued and it was forced renamed to tertiary.';
|
|
163
|
+
errorMessage += ' Please provide one of the following types: primary, secondary, tertiary, warning, attention. Alternative is discontinued and it was forced renamed to tertiary.';
|
|
167
164
|
}
|
|
168
165
|
|
|
169
166
|
throw new Error(errorMessage);
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script>
|
|
9
|
+
import ChartFunnelTwoRows from './SvgFunnel/ChartFunnelTwoRows.vue';
|
|
9
10
|
import ChartFunnelThreeRows from './SvgFunnel/ChartFunnelThreeRows.vue';
|
|
10
11
|
import ChartFunnelFourRows from './SvgFunnel/ChartFunnelFourRows.vue';
|
|
11
12
|
import ChartFunnelFiveRows from './SvgFunnel/ChartFunnelFiveRows.vue';
|
|
@@ -15,6 +16,7 @@ export default {
|
|
|
15
16
|
name: 'UnnnicChartFunnel',
|
|
16
17
|
|
|
17
18
|
components: {
|
|
19
|
+
ChartFunnelTwoRows,
|
|
18
20
|
ChartFunnelThreeRows,
|
|
19
21
|
ChartFunnelFourRows,
|
|
20
22
|
ChartFunnelFiveRows,
|
|
@@ -36,11 +38,13 @@ export default {
|
|
|
36
38
|
chartComponent() {
|
|
37
39
|
const componentMap = {
|
|
38
40
|
default: {
|
|
41
|
+
2: ChartDefaultFunnelBase,
|
|
39
42
|
3: ChartDefaultFunnelBase,
|
|
40
43
|
4: ChartDefaultFunnelBase,
|
|
41
44
|
5: ChartDefaultFunnelBase,
|
|
42
45
|
},
|
|
43
46
|
basic: {
|
|
47
|
+
2: 'ChartFunnelTwoRows',
|
|
44
48
|
3: 'ChartFunnelThreeRows',
|
|
45
49
|
4: 'ChartFunnelFourRows',
|
|
46
50
|
5: 'ChartFunnelFiveRows',
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
</template>
|
|
45
45
|
|
|
46
46
|
<script setup lang="ts">
|
|
47
|
+
import { computed } from 'vue';
|
|
48
|
+
|
|
47
49
|
interface FunnelStep {
|
|
48
50
|
percentage: number | string;
|
|
49
51
|
value: number | string;
|
|
@@ -52,9 +54,14 @@ interface FunnelStep {
|
|
|
52
54
|
color: string;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
defineProps<{
|
|
57
|
+
const props = defineProps<{
|
|
56
58
|
data: FunnelStep[];
|
|
57
59
|
}>();
|
|
60
|
+
|
|
61
|
+
const calculatedTransform = computed(() => {
|
|
62
|
+
return `skew(${props.data.length === 2 ? '-8deg': '-12deg'}, 0deg) translateX(-20px)`;
|
|
63
|
+
});
|
|
64
|
+
|
|
58
65
|
</script>
|
|
59
66
|
|
|
60
67
|
<style lang="scss" scoped>
|
|
@@ -76,7 +83,7 @@ defineProps<{
|
|
|
76
83
|
&__card {
|
|
77
84
|
height: 100%;
|
|
78
85
|
transition: background-color 0.3s ease;
|
|
79
|
-
transform:
|
|
86
|
+
transform: v-bind(calculatedTransform);
|
|
80
87
|
border-radius: 0 0 $unnnic-spacing-xs 0;
|
|
81
88
|
|
|
82
89
|
&.first-item {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ChartFunnelBaseRow
|
|
3
|
+
class="unnnic-chart-funnel-two-rows"
|
|
4
|
+
:rows="rows"
|
|
5
|
+
viewBox="0 0 250 148"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import ChartFunnelBaseRow from './ChartFunnelBaseRow.vue';
|
|
11
|
+
export default {
|
|
12
|
+
name: 'UnnnicChartFunnelTwoRows',
|
|
13
|
+
|
|
14
|
+
components: {
|
|
15
|
+
ChartFunnelBaseRow,
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
props: {
|
|
19
|
+
data: {
|
|
20
|
+
type: Array,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
computed: {
|
|
26
|
+
rows() {
|
|
27
|
+
const { data } = this;
|
|
28
|
+
return [
|
|
29
|
+
{
|
|
30
|
+
pathD:
|
|
31
|
+
'M362.938 0H12.025C6.30976 0 2.43799 5.81972 4.64626 11.0911L31 74H343.75L370.307 11.1122C372.535 5.83818 368.663 0 362.938 0Z',
|
|
32
|
+
titleX: '50%',
|
|
33
|
+
titleY: '32',
|
|
34
|
+
descriptionX: '50%',
|
|
35
|
+
descriptionY: '52',
|
|
36
|
+
title: data[0].title,
|
|
37
|
+
description: data[0].description,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
pathD: 'M344 74H31L63.4654 148H311.535L344 74Z',
|
|
41
|
+
titleX: '50%',
|
|
42
|
+
titleY: '106',
|
|
43
|
+
descriptionX: '50%',
|
|
44
|
+
descriptionY: '126',
|
|
45
|
+
title: data[1].title,
|
|
46
|
+
description: data[1].description,
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style lang="scss">
|
|
55
|
+
@use '@/assets/scss/unnnic' as *;
|
|
56
|
+
.unnnic-chart-funnel-two-rows {
|
|
57
|
+
[class$='row']:nth-child(1) {
|
|
58
|
+
fill: $unnnic-color-weni-950;
|
|
59
|
+
}
|
|
60
|
+
[class$='row']:nth-child(2) {
|
|
61
|
+
fill: $unnnic-color-weni-800;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
65
|
+
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
v-mask="mask"
|
|
5
5
|
v-bind="attributes"
|
|
6
6
|
:value="fullySanitize(modelValue)"
|
|
7
|
-
:class="[classes, { focus: forceActiveStatus }]"
|
|
7
|
+
:class="[classes, { 'focus': forceActiveStatus }]"
|
|
8
8
|
:type="nativeType"
|
|
9
9
|
:readonly="readonly"
|
|
10
10
|
/>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
v-else
|
|
13
13
|
v-bind="attributes"
|
|
14
14
|
:value="fullySanitize(modelValue)"
|
|
15
|
-
:class="[classes, { focus: forceActiveStatus }]"
|
|
15
|
+
:class="[classes, { 'focus': forceActiveStatus }]"
|
|
16
16
|
:type="nativeType"
|
|
17
17
|
:maxlength="maxlength"
|
|
18
18
|
:readonly="readonly"
|
|
@@ -133,8 +133,8 @@ export default {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
&.input--has-clear-icon {
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
padding-right: $unnnic-space-10;
|
|
137
|
+
}
|
|
138
138
|
|
|
139
139
|
&.error {
|
|
140
140
|
@include input-error;
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
@click="onIconRightClick"
|
|
53
53
|
/>
|
|
54
54
|
</section>
|
|
55
|
+
|
|
55
56
|
</div>
|
|
56
57
|
</template>
|
|
57
58
|
|
|
@@ -131,7 +132,7 @@ export default {
|
|
|
131
132
|
showClear: {
|
|
132
133
|
type: Boolean,
|
|
133
134
|
default: false,
|
|
134
|
-
}
|
|
135
|
+
}
|
|
135
136
|
},
|
|
136
137
|
emits: ['icon-left-click', 'icon-right-click', 'clear'],
|
|
137
138
|
data() {
|
|
@@ -232,7 +233,7 @@ export default {
|
|
|
232
233
|
top: 50%;
|
|
233
234
|
transform: translateY(-50%);
|
|
234
235
|
right: $unnnic-space-4;
|
|
235
|
-
|
|
236
|
+
|
|
236
237
|
display: flex;
|
|
237
238
|
align-items: center;
|
|
238
239
|
gap: $unnnic-space-2;
|
|
@@ -24,10 +24,7 @@
|
|
|
24
24
|
</section>
|
|
25
25
|
|
|
26
26
|
<section class="unnnic-modal-dialog__container__body">
|
|
27
|
-
<header
|
|
28
|
-
v-if="title"
|
|
29
|
-
class="unnnic-modal-dialog__container__header"
|
|
30
|
-
>
|
|
27
|
+
<header v-if="title" class="unnnic-modal-dialog__container__header">
|
|
31
28
|
<section class="unnnic-modal-dialog__container__title-container">
|
|
32
29
|
<UnnnicIcon
|
|
33
30
|
v-if="icon || type"
|
|
@@ -99,12 +96,12 @@
|
|
|
99
96
|
</template>
|
|
100
97
|
|
|
101
98
|
<script>
|
|
102
|
-
import UnnnicIcon from
|
|
103
|
-
import UnnnicButton from
|
|
104
|
-
import UnnnicI18n from
|
|
99
|
+
import UnnnicIcon from "../Icon.vue";
|
|
100
|
+
import UnnnicButton from "../Button/Button.vue";
|
|
101
|
+
import UnnnicI18n from "../../mixins/i18n";
|
|
105
102
|
|
|
106
103
|
export default {
|
|
107
|
-
name:
|
|
104
|
+
name: "UnnnicModalDialog",
|
|
108
105
|
components: {
|
|
109
106
|
UnnnicIcon,
|
|
110
107
|
UnnnicButton,
|
|
@@ -121,29 +118,29 @@ export default {
|
|
|
121
118
|
},
|
|
122
119
|
type: {
|
|
123
120
|
type: String,
|
|
124
|
-
default:
|
|
121
|
+
default: "",
|
|
125
122
|
validate(type) {
|
|
126
|
-
return [
|
|
123
|
+
return ["success", "warning", "attention"].includes(type);
|
|
127
124
|
},
|
|
128
125
|
},
|
|
129
126
|
size: {
|
|
130
127
|
type: String,
|
|
131
|
-
default:
|
|
128
|
+
default: "md",
|
|
132
129
|
validate(size) {
|
|
133
|
-
return [
|
|
130
|
+
return ["sm", "md", "lg"].includes(size);
|
|
134
131
|
},
|
|
135
132
|
},
|
|
136
133
|
title: {
|
|
137
134
|
type: String,
|
|
138
|
-
default:
|
|
135
|
+
default: "",
|
|
139
136
|
},
|
|
140
137
|
icon: {
|
|
141
138
|
type: String,
|
|
142
|
-
default:
|
|
139
|
+
default: "",
|
|
143
140
|
},
|
|
144
141
|
iconScheme: {
|
|
145
142
|
type: String,
|
|
146
|
-
default:
|
|
143
|
+
default: "",
|
|
147
144
|
},
|
|
148
145
|
showCloseIcon: {
|
|
149
146
|
type: Boolean,
|
|
@@ -166,26 +163,26 @@ export default {
|
|
|
166
163
|
default: () => ({}),
|
|
167
164
|
},
|
|
168
165
|
},
|
|
169
|
-
emits: [
|
|
166
|
+
emits: ["primaryButtonClick", "secondaryButtonClick", "update:modelValue"],
|
|
170
167
|
|
|
171
168
|
data() {
|
|
172
169
|
return {
|
|
173
170
|
defaultTranslations: {
|
|
174
171
|
cancel: {
|
|
175
|
-
|
|
176
|
-
en:
|
|
177
|
-
es:
|
|
172
|
+
"pt-br": "Cancelar",
|
|
173
|
+
en: "Cancel",
|
|
174
|
+
es: "Cancelar",
|
|
178
175
|
},
|
|
179
176
|
},
|
|
180
177
|
iconsMapper: {
|
|
181
|
-
success: { icon:
|
|
182
|
-
warning: { icon:
|
|
183
|
-
attention: { icon:
|
|
178
|
+
success: { icon: "check_circle", scheme: "aux-green-500" },
|
|
179
|
+
warning: { icon: "warning", scheme: "aux-red-500" },
|
|
180
|
+
attention: { icon: "error", scheme: "aux-yellow-500" },
|
|
184
181
|
},
|
|
185
182
|
primaryButtonTypeMapper: {
|
|
186
|
-
success:
|
|
187
|
-
warning:
|
|
188
|
-
attention:
|
|
183
|
+
success: "primary",
|
|
184
|
+
warning: "warning",
|
|
185
|
+
attention: "attention",
|
|
189
186
|
},
|
|
190
187
|
};
|
|
191
188
|
},
|
|
@@ -196,17 +193,17 @@ export default {
|
|
|
196
193
|
},
|
|
197
194
|
methods: {
|
|
198
195
|
close() {
|
|
199
|
-
this.$emit(
|
|
196
|
+
this.$emit("update:modelValue", false);
|
|
200
197
|
},
|
|
201
198
|
updateBodyOverflow(isHidden) {
|
|
202
|
-
document.body.style.overflow = isHidden ?
|
|
199
|
+
document.body.style.overflow = isHidden ? "hidden" : "";
|
|
203
200
|
},
|
|
204
201
|
},
|
|
205
202
|
};
|
|
206
203
|
</script>
|
|
207
204
|
|
|
208
205
|
<style lang="scss" scoped>
|
|
209
|
-
@use
|
|
206
|
+
@use "@/assets/scss/unnnic" as *;
|
|
210
207
|
* {
|
|
211
208
|
margin: 0;
|
|
212
209
|
padding: 0;
|
|
@@ -313,7 +310,7 @@ export default {
|
|
|
313
310
|
&__actions {
|
|
314
311
|
display: grid;
|
|
315
312
|
grid-template-columns: 1fr 1fr;
|
|
316
|
-
grid-template-areas:
|
|
313
|
+
grid-template-areas: "secondary-button primary-button";
|
|
317
314
|
gap: $unnnic-spacing-sm;
|
|
318
315
|
padding: $unnnic-spacing-md;
|
|
319
316
|
flex-shrink: 0;
|
|
@@ -4,7 +4,7 @@ import UnnnicPopover from '@/components/Popover/index.vue';
|
|
|
4
4
|
|
|
5
5
|
vi.mock('@vueuse/core', () => ({
|
|
6
6
|
onClickOutside: vi.fn(),
|
|
7
|
-
useResizeObserver: vi.fn()
|
|
7
|
+
useResizeObserver: vi.fn()
|
|
8
8
|
}));
|
|
9
9
|
|
|
10
10
|
describe('UnnnicPopover.vue', () => {
|
|
@@ -12,7 +12,7 @@ describe('UnnnicPopover.vue', () => {
|
|
|
12
12
|
|
|
13
13
|
const defaultSlots = {
|
|
14
14
|
trigger: '<button data-testid="trigger-button">Click me</button>',
|
|
15
|
-
content: '<div data-testid="popover-content">Popover content</div>'
|
|
15
|
+
content: '<div data-testid="popover-content">Popover content</div>'
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const mountWrapper = (props) => {
|
|
@@ -20,9 +20,9 @@ describe('UnnnicPopover.vue', () => {
|
|
|
20
20
|
slots: defaultSlots,
|
|
21
21
|
props: {
|
|
22
22
|
...props,
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
24
|
});
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
|
|
27
27
|
beforeEach(() => {
|
|
28
28
|
wrapper = mountWrapper();
|
|
@@ -40,7 +40,7 @@ describe('UnnnicPopover.vue', () => {
|
|
|
40
40
|
test('renders trigger slot', () => {
|
|
41
41
|
const trigger = wrapper.find('[data-testid="popover-trigger"]');
|
|
42
42
|
const triggerButton = wrapper.find('[data-testid="trigger-button"]');
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
expect(trigger.exists()).toBe(true);
|
|
45
45
|
expect(triggerButton.exists()).toBe(true);
|
|
46
46
|
expect(triggerButton.text()).toBe('Click me');
|
|
@@ -51,7 +51,7 @@ describe('UnnnicPopover.vue', () => {
|
|
|
51
51
|
await wrapper.vm.$nextTick();
|
|
52
52
|
const balloon = wrapper.find('[data-testid="popover-balloon"]');
|
|
53
53
|
const content = wrapper.find('[data-testid="popover-content"]');
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
expect(balloon.exists()).toBe(true);
|
|
56
56
|
expect(content.exists()).toBe(true);
|
|
57
57
|
expect(content.text()).toBe('Popover content');
|
|
@@ -64,9 +64,9 @@ describe('UnnnicPopover.vue', () => {
|
|
|
64
64
|
|
|
65
65
|
test('toggles balloon visibility when trigger is clicked', async () => {
|
|
66
66
|
const trigger = wrapper.find('[data-testid="popover-trigger"]');
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
let balloon = wrapper.find('[data-testid="popover-balloon"]');
|
|
69
|
-
|
|
69
|
+
|
|
70
70
|
expect(balloon.exists()).toBe(false);
|
|
71
71
|
|
|
72
72
|
await trigger.trigger('click');
|
|
@@ -85,10 +85,10 @@ describe('UnnnicPopover.vue', () => {
|
|
|
85
85
|
|
|
86
86
|
test('emits update:modelValue when open state changes', async () => {
|
|
87
87
|
await wrapper.setProps({ modelValue: false });
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
const trigger = wrapper.find('[data-testid="popover-trigger"]');
|
|
90
90
|
await trigger.trigger('click');
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
expect(wrapper.emitted('update:modelValue')).toBeTruthy();
|
|
93
93
|
expect(wrapper.emitted('update:modelValue')[0]).toEqual([true]);
|
|
94
94
|
});
|
|
@@ -96,7 +96,7 @@ describe('UnnnicPopover.vue', () => {
|
|
|
96
96
|
test('does not emit update:modelValue when modelValue is undefined', async () => {
|
|
97
97
|
const trigger = wrapper.find('[data-testid="popover-trigger"]');
|
|
98
98
|
await trigger.trigger('click');
|
|
99
|
-
|
|
99
|
+
|
|
100
100
|
expect(wrapper.emitted('update:modelValue')).toBeFalsy();
|
|
101
101
|
});
|
|
102
102
|
|
|
@@ -108,24 +108,24 @@ describe('UnnnicPopover.vue', () => {
|
|
|
108
108
|
test('open ref can be controlled programmatically', async () => {
|
|
109
109
|
wrapper.vm.open = true;
|
|
110
110
|
await wrapper.vm.$nextTick();
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
const balloon = wrapper.find('[data-testid="popover-balloon"]');
|
|
113
113
|
expect(balloon.isVisible()).toBe(true);
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
test('persistent prop prevents closing on outside click', async () => {
|
|
117
117
|
await wrapper.setProps({ persistent: true });
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
const { onClickOutside } = await import('@vueuse/core');
|
|
120
120
|
const mockOnClickOutside = vi.mocked(onClickOutside);
|
|
121
|
-
|
|
121
|
+
|
|
122
122
|
const callback = mockOnClickOutside.mock.calls[0][1];
|
|
123
|
-
|
|
123
|
+
|
|
124
124
|
wrapper.vm.open = true;
|
|
125
125
|
await wrapper.vm.$nextTick();
|
|
126
|
-
|
|
126
|
+
|
|
127
127
|
callback();
|
|
128
|
-
|
|
128
|
+
|
|
129
129
|
const balloon = wrapper.find('[data-testid="popover-balloon"]');
|
|
130
130
|
expect(balloon.isVisible()).toBe(true);
|
|
131
131
|
});
|
|
@@ -136,7 +136,7 @@ describe('UnnnicPopover.vue', () => {
|
|
|
136
136
|
|
|
137
137
|
const popover = wrapper.find('.unnnic-popover');
|
|
138
138
|
const balloon = wrapper.find('.unnnic-popover__balloon');
|
|
139
|
-
|
|
139
|
+
|
|
140
140
|
expect(popover.exists()).toBe(true);
|
|
141
141
|
expect(balloon.exists()).toBe(true);
|
|
142
142
|
});
|