@code-coaching/vuetiful 0.24.10 → 0.26.0
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/types/directives/click-outside-group.d.ts +9 -0
- package/dist/types/directives/click-outside-group.test.d.ts +1 -0
- package/dist/types/directives/click-outside.d.ts +9 -0
- package/dist/types/directives/click-outside.test.d.ts +1 -0
- package/dist/types/directives/index.d.ts +3 -1
- package/dist/vuetiful.es.mjs +50 -3
- package/dist/vuetiful.umd.js +19 -19
- package/package.json +2 -1
- package/src/css/overrides/quasar.css +310 -0
- package/src/directives/click-outside-group.test.ts +44 -0
- package/src/directives/click-outside-group.ts +39 -0
- package/src/directives/click-outside.test.ts +38 -0
- package/src/directives/click-outside.ts +28 -0
- package/src/directives/index.ts +3 -1
- package/src/utils/theme/theme-switcher.vue +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-coaching/vuetiful",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "onchange 'src/**/*.vue' 'src/**/*.ts' 'src/**/*.css' -- npm run build",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"types": "./dist/types/index.d.ts"
|
|
54
54
|
},
|
|
55
55
|
"./themes/*": "./src/themes/*",
|
|
56
|
+
"./css/*": "./src/css/*",
|
|
56
57
|
"./styles/*": "./src/styles/*",
|
|
57
58
|
"./tailwind/*": "./src/tailwind/*"
|
|
58
59
|
}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
h1,
|
|
2
|
+
h2,
|
|
3
|
+
h3,
|
|
4
|
+
h4,
|
|
5
|
+
h5,
|
|
6
|
+
h6 {
|
|
7
|
+
@apply mb-4 md:mb-8;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
section.section {
|
|
11
|
+
@apply mb-6 md:mb-14;
|
|
12
|
+
}
|
|
13
|
+
header.header {
|
|
14
|
+
@apply mb-4 md:mb-10;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
summary {
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
html,
|
|
22
|
+
body,
|
|
23
|
+
#q-app {
|
|
24
|
+
/*
|
|
25
|
+
* This is done to prevent double scrollbars
|
|
26
|
+
*/
|
|
27
|
+
height: 100%;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
* Reset several font properties to browser defaults
|
|
32
|
+
*/
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
font-family: var(--theme-font-family-base), sans-serif;
|
|
35
|
+
-moz-osx-font-smoothing: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.flex {
|
|
39
|
+
/*
|
|
40
|
+
* Quasar has a flex utility class that also adds flex-wrap: wrap;
|
|
41
|
+
* This class is used to reset back to flex-wrap: nowrap; the default behavior.
|
|
42
|
+
*/
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-wrap: nowrap;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/*
|
|
48
|
+
* This makes sure the Tailwind flex utility class is not overwritten
|
|
49
|
+
* by the override above.
|
|
50
|
+
*/
|
|
51
|
+
.flex-nowrap {
|
|
52
|
+
flex-wrap: nowrap;
|
|
53
|
+
}
|
|
54
|
+
.flex-wrap {
|
|
55
|
+
flex-wrap: wrap;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* app global css */
|
|
59
|
+
.q-avatar,
|
|
60
|
+
.q-chip .q-avatar {
|
|
61
|
+
@apply rounded-token;
|
|
62
|
+
@apply transition-all;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.q-badge {
|
|
66
|
+
@apply rounded-token;
|
|
67
|
+
|
|
68
|
+
@apply transition-all;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.q-banner {
|
|
72
|
+
@apply rounded-container-token;
|
|
73
|
+
@apply transition-all;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.q-btn {
|
|
77
|
+
@apply rounded-token;
|
|
78
|
+
@apply transition-all;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.q-btn-group {
|
|
82
|
+
@apply rounded-token;
|
|
83
|
+
@apply transition-all;
|
|
84
|
+
|
|
85
|
+
width: fit-content;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.q-btn-dropdown {
|
|
89
|
+
@apply rounded-token;
|
|
90
|
+
@apply transition-all;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.q-menu {
|
|
94
|
+
@apply bg-surface-100-800-token;
|
|
95
|
+
@apply text-surface-900-50-token;
|
|
96
|
+
|
|
97
|
+
@apply rounded-container-token;
|
|
98
|
+
@apply transition-all;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.q-menu--dark {
|
|
102
|
+
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2), 0 2px 2px rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.q-card {
|
|
106
|
+
@apply rounded-container-token;
|
|
107
|
+
@apply transition-all;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Overwrite the white shadow with the normal shadow */
|
|
111
|
+
.q-card--dark {
|
|
112
|
+
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2), 0 2px 2px rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.q-chip {
|
|
116
|
+
@apply rounded-token;
|
|
117
|
+
@apply transition-all;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.q-color-picker {
|
|
121
|
+
@apply rounded-container-token;
|
|
122
|
+
@apply transition-all;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.q-color-picker--dark {
|
|
126
|
+
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2), 0 2px 2px rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.q-color-picker__header-bg {
|
|
130
|
+
@apply rounded-tl-container-token;
|
|
131
|
+
@apply rounded-tr-container-token;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.q-editor {
|
|
135
|
+
@apply rounded-container-token;
|
|
136
|
+
@apply transition-all;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Because of how .q-editor is styled
|
|
141
|
+
* the a tag needs to be styled here
|
|
142
|
+
* Add .light-actions or .dark-actions to the QEditor as a class
|
|
143
|
+
*/
|
|
144
|
+
.light-actions a {
|
|
145
|
+
@apply !text-white;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.dark-actions a {
|
|
149
|
+
@apply !text-black;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Because of how .q-select is styled
|
|
154
|
+
* the dropdown icon needs to be styled here
|
|
155
|
+
* Add .light-actions or .dark-actions to the QSelect as a class
|
|
156
|
+
*/
|
|
157
|
+
.light-actions i {
|
|
158
|
+
@apply !text-white;
|
|
159
|
+
}
|
|
160
|
+
.dark-actions i {
|
|
161
|
+
@apply !text-black;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/*
|
|
165
|
+
* Because of how .q-expansion-item__container -> .q-item is styled
|
|
166
|
+
* the background and text color need to be set here
|
|
167
|
+
*/
|
|
168
|
+
.q-list {
|
|
169
|
+
@apply bg-surface-100-800-token;
|
|
170
|
+
@apply text-surface-900-50-token;
|
|
171
|
+
|
|
172
|
+
@apply rounded-container-token;
|
|
173
|
+
@apply transition-all;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.q-list .q-card {
|
|
177
|
+
@apply bg-surface-100-800-token;
|
|
178
|
+
@apply text-surface-900-50-token;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.q-list > .q-expansion-item:first-child .q-focus-helper {
|
|
182
|
+
@apply rounded-tl-container-token;
|
|
183
|
+
@apply rounded-tr-container-token;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.q-list > .q-expansion-item:last-child .q-focus-helper {
|
|
187
|
+
@apply rounded-bl-container-token;
|
|
188
|
+
@apply rounded-br-container-token;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.q-list > .q-expansion-item:last-child .q-card {
|
|
192
|
+
@apply rounded-bl-container-token;
|
|
193
|
+
@apply rounded-br-container-token;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.q-drawer .q-list {
|
|
197
|
+
border-radius: 0;
|
|
198
|
+
height: 100%;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.q-input {
|
|
202
|
+
@apply rounded-container-token;
|
|
203
|
+
@apply transition-all;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.q-field__control::before {
|
|
207
|
+
@apply rounded-container-token;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.q-field--outlined .q-field__control::after {
|
|
211
|
+
@apply rounded-container-token;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.q-input,
|
|
215
|
+
.q-select,
|
|
216
|
+
.q-file,
|
|
217
|
+
.q-time {
|
|
218
|
+
@apply rounded-container-token;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.q-item--dark {
|
|
222
|
+
color: currentColor;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.q-field__native {
|
|
226
|
+
color: currentColor !important;
|
|
227
|
+
background-color: transparent !important;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.q-time {
|
|
231
|
+
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2), 0 2px 2px rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12);
|
|
232
|
+
|
|
233
|
+
@apply bg-surface-100-800-token;
|
|
234
|
+
@apply text-surface-900-50-token;
|
|
235
|
+
|
|
236
|
+
@apply rounded-tl-container-token;
|
|
237
|
+
@apply rounded-tr-container-token;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.q-time__header {
|
|
241
|
+
@apply bg-surface-300-600-token;
|
|
242
|
+
@apply text-surface-900-50-token;
|
|
243
|
+
|
|
244
|
+
@apply rounded-tl-container-token;
|
|
245
|
+
@apply rounded-tr-container-token;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.q-time__clock-position--active,
|
|
249
|
+
.q-time__clock-pointer {
|
|
250
|
+
@apply bg-surface-900-50-token;
|
|
251
|
+
@apply text-surface-50-900-token;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.q-date {
|
|
255
|
+
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2), 0 2px 2px rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12);
|
|
256
|
+
|
|
257
|
+
@apply bg-surface-100-800-token;
|
|
258
|
+
@apply text-surface-900-50-token;
|
|
259
|
+
|
|
260
|
+
@apply rounded-container-token;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.q-date__calendar-item .q-btn {
|
|
264
|
+
@apply bg-surface-100-800-token;
|
|
265
|
+
@apply text-surface-900-50-token;
|
|
266
|
+
|
|
267
|
+
@apply rounded-token;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.q-date__calendar-item .q-btn--unelevated {
|
|
271
|
+
@apply !bg-surface-900;
|
|
272
|
+
@apply !text-surface-50;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.q-date__navigation .q-btn {
|
|
276
|
+
@apply bg-transparent;
|
|
277
|
+
@apply text-surface-900-50-token;
|
|
278
|
+
|
|
279
|
+
@apply rounded-token;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.q-date__header {
|
|
283
|
+
@apply bg-surface-300-600-token;
|
|
284
|
+
@apply text-surface-900-50-token;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.q-date__months {
|
|
288
|
+
flex-wrap: wrap;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Prevent the outline from showing on focus when the input is within a QInput
|
|
293
|
+
*/
|
|
294
|
+
.q-field__native[type='text']:focus,
|
|
295
|
+
.q-field__native[type='email']:focus,
|
|
296
|
+
.q-field__native[type='url']:focus,
|
|
297
|
+
.q-field__native[type='password']:focus,
|
|
298
|
+
.q-field__native[type='number']:focus,
|
|
299
|
+
.q-field__native[type='date']:focus,
|
|
300
|
+
.q-field__native[type='datetime-local']:focus,
|
|
301
|
+
.q-field__native[type='month']:focus,
|
|
302
|
+
.q-field__native[type='search']:focus,
|
|
303
|
+
.q-field__native[type='tel']:focus,
|
|
304
|
+
.q-field__native[type='time']:focus,
|
|
305
|
+
.q-field__native[type='week']:focus,
|
|
306
|
+
.q-field__native[multiple]:focus,
|
|
307
|
+
.q-field__native textarea:focus,
|
|
308
|
+
.q-field__native select:focus {
|
|
309
|
+
--tw-ring-color: transparent;
|
|
310
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { describe, test, vi, expect } from 'vitest'
|
|
3
|
+
import { vClickOutsideGroup } from '.';
|
|
4
|
+
|
|
5
|
+
interface HTMLElementWithClickOutsideHandler extends HTMLElement {
|
|
6
|
+
_clickOutsideHandler?: (event: MouseEvent) => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
describe('vClickOutsideGroup Directive', () => {
|
|
10
|
+
test("should call the callback when clicking outside the element", async () => {
|
|
11
|
+
const callback = vi.fn();
|
|
12
|
+
|
|
13
|
+
const innerElement = document.createElement('div');
|
|
14
|
+
const outerElement = document.createElement('div');
|
|
15
|
+
outerElement.id = 'outer';
|
|
16
|
+
document.body.appendChild(outerElement);
|
|
17
|
+
document.body.appendChild(innerElement);
|
|
18
|
+
|
|
19
|
+
const directiveBinding = { value: {
|
|
20
|
+
elementsInGroup: ['#outer'],
|
|
21
|
+
callback
|
|
22
|
+
} } as any;
|
|
23
|
+
vClickOutsideGroup.mounted(innerElement, directiveBinding);
|
|
24
|
+
|
|
25
|
+
innerElement.click();
|
|
26
|
+
expect(callback).not.toHaveBeenCalled();
|
|
27
|
+
outerElement.click();
|
|
28
|
+
expect(callback).not.toHaveBeenCalled();
|
|
29
|
+
document.body.click();
|
|
30
|
+
expect(callback).toHaveBeenCalled();
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
test("should remove _clickOutsideHandler when unmounted", async () => {
|
|
34
|
+
const callback = vi.fn();
|
|
35
|
+
const directiveBinding = { value: callback } as any;
|
|
36
|
+
const innerElement = document.createElement('div') as HTMLElementWithClickOutsideHandler;
|
|
37
|
+
document.body.appendChild(innerElement);
|
|
38
|
+
vClickOutsideGroup.mounted(innerElement, directiveBinding);
|
|
39
|
+
|
|
40
|
+
expect(innerElement._clickOutsideHandler).toBeDefined();
|
|
41
|
+
vClickOutsideGroup.beforeUnmount(innerElement);
|
|
42
|
+
expect(innerElement._clickOutsideHandler).toBeUndefined();
|
|
43
|
+
})
|
|
44
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DirectiveBinding } from 'vue';
|
|
2
|
+
|
|
3
|
+
interface HTMLElementWithClickOutsideHandler extends HTMLElement {
|
|
4
|
+
_clickOutsideHandler?: (event: MouseEvent) => void;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const clickOutsideGroup = {
|
|
8
|
+
mounted(el: HTMLElementWithClickOutsideHandler, binding: DirectiveBinding) {
|
|
9
|
+
const { elementsInGroup = [], callback } = binding.value;
|
|
10
|
+
|
|
11
|
+
const elementsToIgnore = elementsInGroup.map((selector: string) => {
|
|
12
|
+
const allElements = document.querySelectorAll(selector);
|
|
13
|
+
const elements = Array.from(allElements) as HTMLElement[];
|
|
14
|
+
return elements;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const allElementsToIgnore = elementsToIgnore.flat();
|
|
18
|
+
|
|
19
|
+
const clickOutsideHandler = (event: MouseEvent) => {
|
|
20
|
+
const clickedIgnoreElement = allElementsToIgnore.some((el: HTMLElement) => el?.contains(event.target as Node));
|
|
21
|
+
if (!el.contains(event.target as Node) && !clickedIgnoreElement) {
|
|
22
|
+
callback();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
document.addEventListener('click', clickOutsideHandler);
|
|
27
|
+
|
|
28
|
+
el._clickOutsideHandler = clickOutsideHandler;
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
beforeUnmount(el: HTMLElementWithClickOutsideHandler) {
|
|
32
|
+
if (el._clickOutsideHandler) {
|
|
33
|
+
document.removeEventListener('click', el._clickOutsideHandler);
|
|
34
|
+
delete el._clickOutsideHandler;
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default clickOutsideGroup;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { describe, test, vi, expect } from 'vitest'
|
|
3
|
+
import { vClickOutside } from '.';
|
|
4
|
+
|
|
5
|
+
interface HTMLElementWithClickOutsideHandler extends HTMLElement {
|
|
6
|
+
_clickOutsideHandler?: (event: MouseEvent) => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
describe('vClickOutside Directive', () => {
|
|
10
|
+
test("should call the callback when clicking outside the element", async () => {
|
|
11
|
+
const callback = vi.fn();
|
|
12
|
+
|
|
13
|
+
const innerElement = document.createElement('div');
|
|
14
|
+
document.body.appendChild(innerElement);
|
|
15
|
+
|
|
16
|
+
const directiveBinding = { value: callback } as any;
|
|
17
|
+
vClickOutside.mounted(innerElement, directiveBinding);
|
|
18
|
+
|
|
19
|
+
innerElement.click();
|
|
20
|
+
expect(callback).not.toHaveBeenCalled();
|
|
21
|
+
document.body.click();
|
|
22
|
+
expect(callback).toHaveBeenCalled();
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test("should remove _clickOutsideHandler when unmounted", async () => {
|
|
26
|
+
const callback = vi.fn();
|
|
27
|
+
|
|
28
|
+
const innerElement = document.createElement('div') as HTMLElementWithClickOutsideHandler;
|
|
29
|
+
document.body.appendChild(innerElement);
|
|
30
|
+
|
|
31
|
+
const directiveBinding = { value: callback } as any;
|
|
32
|
+
vClickOutside.mounted(innerElement, directiveBinding);
|
|
33
|
+
|
|
34
|
+
expect(innerElement._clickOutsideHandler).toBeDefined();
|
|
35
|
+
vClickOutside.beforeUnmount(innerElement);
|
|
36
|
+
expect(innerElement._clickOutsideHandler).toBeUndefined();
|
|
37
|
+
})
|
|
38
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DirectiveBinding } from 'vue';
|
|
2
|
+
|
|
3
|
+
interface HTMLElementWithClickOutsideHandler extends HTMLElement {
|
|
4
|
+
_clickOutsideHandler?: (event: MouseEvent) => void;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const clickOutside = {
|
|
8
|
+
mounted(el: HTMLElementWithClickOutsideHandler, binding: DirectiveBinding) {
|
|
9
|
+
const clickOutsideHandler = (event: MouseEvent) => {
|
|
10
|
+
if (!el.contains(event.target as Node)) {
|
|
11
|
+
binding.value();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
document.addEventListener('click', clickOutsideHandler);
|
|
16
|
+
|
|
17
|
+
el._clickOutsideHandler = clickOutsideHandler;
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
beforeUnmount(el: HTMLElementWithClickOutsideHandler) {
|
|
21
|
+
if (el._clickOutsideHandler) {
|
|
22
|
+
document.removeEventListener('click', el._clickOutsideHandler);
|
|
23
|
+
delete el._clickOutsideHandler;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default clickOutside;
|
package/src/directives/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { CssClasses,
|
|
2
|
+
import { CssClasses, VButton, VLightSwitch, useTheme, vClickOutsideGroup } from '@/index';
|
|
3
3
|
import { ref } from 'vue';
|
|
4
4
|
|
|
5
5
|
defineProps({
|
|
@@ -48,6 +48,10 @@ const showPopup = ref(false);
|
|
|
48
48
|
|
|
49
49
|
<div
|
|
50
50
|
v-if="showPopup"
|
|
51
|
+
v-click-outside-group="{
|
|
52
|
+
elementsInGroup: ['.vuetiful-theme-switcher__button'],
|
|
53
|
+
callback: () => (showPopup = false),
|
|
54
|
+
}"
|
|
51
55
|
class="vuetiful-theme-switcher__popup absolute z-10 mt-1 space-y-4 p-4 shadow-xl rounded-container-token"
|
|
52
56
|
:class="`${background} ${text} ${widthPopup} ${classList}`"
|
|
53
57
|
>
|