@volverjs/ui-vue 0.0.9-beta.1 → 0.0.9-beta.10
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/README.md +3 -3
- package/auto-imports.d.ts +2 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +7 -0
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +7 -0
- package/dist/components/VvAction/VvAction.es.js +9 -1
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +9 -0
- package/dist/components/VvAction/index.d.ts +4 -0
- package/dist/components/VvAlert/VvAlert.es.js +14 -6
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
- package/dist/components/VvAlert/index.d.ts +3 -3
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +14 -6
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +7 -0
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -0
- package/dist/components/VvBadge/VvBadge.es.js +7 -0
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +7 -0
- package/dist/components/VvButton/VvButton.es.js +11 -2
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +9 -0
- package/dist/components/VvButton/index.d.ts +4 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +7 -0
- package/dist/components/VvCard/VvCard.es.js +7 -0
- package/dist/components/VvCheckbox/VvCheckbox.es.js +91 -14
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +97 -15
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/VvCombobox/VvCombobox.es.js +127 -84
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +35 -14
- package/dist/components/VvCombobox/index.d.ts +24 -7
- package/dist/components/VvDialog/VvDialog.es.js +34 -26
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +21 -10
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +4 -11
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
- package/dist/components/VvDropdown/index.d.ts +1 -7
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +9 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +7 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +7 -0
- package/dist/components/VvInputText/VvInputText.es.js +87 -14
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
- package/dist/components/VvNav/VvNav.es.js +10 -2
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/index.d.ts +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +7 -0
- package/dist/components/VvRadio/VvRadio.es.js +91 -14
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +97 -15
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +4 -4
- package/dist/components/VvSelect/VvSelect.es.js +87 -14
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +4 -4
- package/dist/components/VvTab/VvTab.es.js +10 -2
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +87 -14
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
- package/dist/components/VvTooltip/VvTooltip.es.js +7 -0
- package/dist/components/common/HintSlot.d.ts +4 -3
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.es.js +905 -437
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +27 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +81 -0
- package/dist/composables/index.umd.js +1 -0
- package/dist/constants.d.ts +10 -0
- package/dist/directives/index.es.js +7 -0
- package/dist/directives/v-tooltip.es.js +7 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +7 -0
- package/dist/resolvers/unplugin.es.js +3 -0
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +43 -258
- package/dist/stories/Alert/Alert.settings.d.ts +3 -7
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +2 -2
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +6 -0
- package/dist/stories/Button/Button.settings.d.ts +3 -13
- package/dist/stories/Combobox/Combobox.settings.d.ts +117 -19
- package/dist/stories/Nav/Nav.settings.d.ts +3 -21
- package/package.json +54 -46
- 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/VvAction/VvAction.vue +2 -1
- package/src/components/VvAlert/VvAlert.vue +5 -1
- package/src/components/VvAlert/index.ts +3 -3
- package/src/components/VvAlertGroup/VvAlertGroup.vue +2 -0
- package/src/components/VvButton/VvButton.vue +1 -0
- package/src/components/VvCheckbox/VvCheckbox.vue +8 -1
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +8 -1
- package/src/components/VvCombobox/VvCombobox.vue +9 -4
- package/src/components/VvCombobox/index.ts +24 -0
- package/src/components/VvDialog/VvDialog.vue +16 -17
- package/src/components/VvDropdown/VvDropdown.vue +7 -3
- package/src/components/VvDropdown/index.ts +2 -8
- package/src/components/VvInputText/VvInputText.vue +8 -1
- package/src/components/VvNav/VvNav.vue +1 -1
- package/src/components/VvNav/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +8 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +8 -1
- package/src/components/VvSelect/VvSelect.vue +8 -1
- package/src/components/VvTextarea/VvTextarea.vue +8 -1
- package/src/components/common/HintSlot.ts +26 -13
- package/src/components/index.ts +5 -0
- package/src/composables/alert/useAlert.ts +103 -0
- package/src/composables/index.ts +1 -0
- package/src/constants.ts +21 -0
- package/src/props/index.ts +7 -0
- package/src/resolvers/unplugin.ts +3 -0
- package/src/stories/Alert/Alert.settings.ts +3 -1
- package/src/stories/AlertGroup/AlertGroup.test.ts +13 -0
- package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +3 -3
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +118 -0
- package/src/stories/Button/Button.settings.ts +5 -3
- package/src/stories/Combobox/Combobox.settings.ts +119 -2
- package/src/stories/Nav/Nav.settings.ts +3 -1
- package/src/stories/Tab/Tab.stories.ts +3 -3
- package/src/stories/Textarea/TextareaLength.stories.ts +1 -1
- package/src/types/alert.d.ts +20 -0
- /package/dist/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue.d.ts +0 -0
- /package/dist/components/{VvNavSeparator → VvNav}/VvNavSeparator.d.ts +0 -0
- /package/src/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue +0 -0
- /package/src/components/{VvNavSeparator → VvNav}/VvNavSeparator.ts +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Option } from '../../types/generic';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
+
transitionName: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
3
7
|
modelValue: {
|
|
4
8
|
type: (ObjectConstructor | ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
5
9
|
default: undefined;
|
|
@@ -28,8 +32,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
28
32
|
type: StringConstructor;
|
|
29
33
|
default: string;
|
|
30
34
|
};
|
|
35
|
+
closeLabel: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
31
39
|
placeholder: StringConstructor;
|
|
32
40
|
searchable: BooleanConstructor;
|
|
41
|
+
searchFunction: {
|
|
42
|
+
type: globalThis.PropType<(search: string, options?: (string | Option)[] | undefined) => (string | Option)[]>;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
33
45
|
searchPlaceholder: {
|
|
34
46
|
type: StringConstructor;
|
|
35
47
|
default: string;
|
|
@@ -77,9 +89,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
77
89
|
default: string;
|
|
78
90
|
validator: (value: "fixed" | "absolute") => boolean;
|
|
79
91
|
};
|
|
80
|
-
transitionName: {
|
|
81
|
-
type: StringConstructor;
|
|
82
|
-
};
|
|
83
92
|
offset: {
|
|
84
93
|
type: globalThis.PropType<string | import("@floating-ui/core").OffsetOptions | undefined>;
|
|
85
94
|
default: number;
|
|
@@ -204,6 +213,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
204
213
|
};
|
|
205
214
|
id: (StringConstructor | NumberConstructor)[];
|
|
206
215
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
216
|
+
transitionName: {
|
|
217
|
+
type: StringConstructor;
|
|
218
|
+
default: string;
|
|
219
|
+
};
|
|
207
220
|
modelValue: {
|
|
208
221
|
type: (ObjectConstructor | ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
209
222
|
default: undefined;
|
|
@@ -232,8 +245,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
232
245
|
type: StringConstructor;
|
|
233
246
|
default: string;
|
|
234
247
|
};
|
|
248
|
+
closeLabel: {
|
|
249
|
+
type: StringConstructor;
|
|
250
|
+
default: string;
|
|
251
|
+
};
|
|
235
252
|
placeholder: StringConstructor;
|
|
236
253
|
searchable: BooleanConstructor;
|
|
254
|
+
searchFunction: {
|
|
255
|
+
type: globalThis.PropType<(search: string, options?: (string | Option)[] | undefined) => (string | Option)[]>;
|
|
256
|
+
default: undefined;
|
|
257
|
+
};
|
|
237
258
|
searchPlaceholder: {
|
|
238
259
|
type: StringConstructor;
|
|
239
260
|
default: string;
|
|
@@ -281,9 +302,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
281
302
|
default: string;
|
|
282
303
|
validator: (value: "fixed" | "absolute") => boolean;
|
|
283
304
|
};
|
|
284
|
-
transitionName: {
|
|
285
|
-
type: StringConstructor;
|
|
286
|
-
};
|
|
287
305
|
offset: {
|
|
288
306
|
type: globalThis.PropType<string | import("@floating-ui/core").OffsetOptions | undefined>;
|
|
289
307
|
default: number;
|
|
@@ -410,6 +428,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
410
428
|
}>> & {
|
|
411
429
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
412
430
|
}, {
|
|
431
|
+
disabled: boolean;
|
|
432
|
+
options: (string | Option)[];
|
|
433
|
+
floating: boolean;
|
|
434
|
+
modelValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
413
435
|
shift: boolean | Partial<import("@floating-ui/core").ShiftOptions & {
|
|
414
436
|
rootBoundary: import("@floating-ui/core").RootBoundary;
|
|
415
437
|
elementContext: import("@floating-ui/core").ElementContext;
|
|
@@ -417,10 +439,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
417
439
|
padding: import("@floating-ui/core").Padding;
|
|
418
440
|
boundary: import("@floating-ui/dom").Boundary;
|
|
419
441
|
}> | undefined;
|
|
420
|
-
disabled: boolean;
|
|
421
|
-
options: (string | Option)[];
|
|
422
|
-
floating: boolean;
|
|
423
|
-
modelValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
424
442
|
tabindex: string | number;
|
|
425
443
|
unselectable: boolean;
|
|
426
444
|
flip: boolean | Partial<import("@floating-ui/core").FlipOptions & {
|
|
@@ -430,6 +448,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
430
448
|
padding: import("@floating-ui/core").Padding;
|
|
431
449
|
boundary: import("@floating-ui/dom").Boundary;
|
|
432
450
|
}> | undefined;
|
|
451
|
+
closeLabel: string;
|
|
433
452
|
iconPosition: "before" | "after";
|
|
434
453
|
loading: boolean;
|
|
435
454
|
loadingLabel: string;
|
|
@@ -465,6 +484,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
465
484
|
disabledKey: string | Function;
|
|
466
485
|
placement: "left" | "right" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end";
|
|
467
486
|
strategy: "fixed" | "absolute";
|
|
487
|
+
transitionName: string;
|
|
468
488
|
offset: string | import("@floating-ui/core").OffsetOptions | undefined;
|
|
469
489
|
autoPlacement: boolean | Partial<import("@floating-ui/core").AutoPlacementOptions & {
|
|
470
490
|
rootBoundary: import("@floating-ui/core").RootBoundary;
|
|
@@ -484,6 +504,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
484
504
|
noOptionsLabel: string;
|
|
485
505
|
deselectActionLabel: string;
|
|
486
506
|
searchable: boolean;
|
|
507
|
+
searchFunction: (search: string, options?: (string | Option)[] | undefined) => (string | Option)[];
|
|
487
508
|
searchPlaceholder: string;
|
|
488
509
|
debounceSearch: string | number;
|
|
489
510
|
separator: string;
|
|
@@ -518,25 +539,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
518
539
|
"no-results"?(_: {}): any;
|
|
519
540
|
"dropdown::after"?(_: {}): any;
|
|
520
541
|
hint?(_: {
|
|
521
|
-
modelValue:
|
|
542
|
+
modelValue: unknown;
|
|
522
543
|
valid: boolean;
|
|
523
544
|
invalid: boolean;
|
|
524
545
|
loading: boolean;
|
|
525
546
|
}): any;
|
|
526
547
|
loading?(_: {
|
|
527
|
-
modelValue:
|
|
548
|
+
modelValue: unknown;
|
|
528
549
|
valid: boolean;
|
|
529
550
|
invalid: boolean;
|
|
530
551
|
loading: boolean;
|
|
531
552
|
}): any;
|
|
532
553
|
valid?(_: {
|
|
533
|
-
modelValue:
|
|
554
|
+
modelValue: unknown;
|
|
534
555
|
valid: boolean;
|
|
535
556
|
invalid: boolean;
|
|
536
557
|
loading: boolean;
|
|
537
558
|
}): any;
|
|
538
559
|
invalid?(_: {
|
|
539
|
-
modelValue:
|
|
560
|
+
modelValue: unknown;
|
|
540
561
|
valid: boolean;
|
|
541
562
|
invalid: boolean;
|
|
542
563
|
loading: boolean;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
+
import type { Option } from '../../types/generic';
|
|
2
3
|
export declare const VvComboboxEvents: string[];
|
|
3
4
|
export declare const VvComboboxProps: {
|
|
5
|
+
/**
|
|
6
|
+
* Dropdown show / hide transition name
|
|
7
|
+
*/
|
|
8
|
+
transitionName: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
4
12
|
/**
|
|
5
13
|
* modelValue can be a string, number, boolean, object or array of string, number, boolean, object
|
|
6
14
|
*/
|
|
@@ -50,6 +58,13 @@ export declare const VvComboboxProps: {
|
|
|
50
58
|
type: StringConstructor;
|
|
51
59
|
default: string;
|
|
52
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Label close button
|
|
63
|
+
*/
|
|
64
|
+
closeLabel: {
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
default: string;
|
|
67
|
+
};
|
|
53
68
|
/**
|
|
54
69
|
* Select input placeholder
|
|
55
70
|
*/
|
|
@@ -58,6 +73,13 @@ export declare const VvComboboxProps: {
|
|
|
58
73
|
* Use input text to search on options
|
|
59
74
|
*/
|
|
60
75
|
searchable: BooleanConstructor;
|
|
76
|
+
/**
|
|
77
|
+
* Search function to filter options
|
|
78
|
+
*/
|
|
79
|
+
searchFunction: {
|
|
80
|
+
type: PropType<(search: string, options?: (Option | string)[]) => (Option | string)[]>;
|
|
81
|
+
default: undefined;
|
|
82
|
+
};
|
|
61
83
|
/**
|
|
62
84
|
* On searchable select is the input search placeholder
|
|
63
85
|
*/
|
|
@@ -141,9 +163,6 @@ export declare const VvComboboxProps: {
|
|
|
141
163
|
default: string;
|
|
142
164
|
validator: (value: "fixed" | "absolute") => boolean;
|
|
143
165
|
};
|
|
144
|
-
transitionName: {
|
|
145
|
-
type: StringConstructor;
|
|
146
|
-
};
|
|
147
166
|
offset: {
|
|
148
167
|
type: PropType<string | import("@floating-ui/core").OffsetOptions | undefined>;
|
|
149
168
|
default: number;
|
|
@@ -227,7 +246,7 @@ export declare const VvComboboxProps: {
|
|
|
227
246
|
validation: (value: import("../../constants").Position) => boolean;
|
|
228
247
|
};
|
|
229
248
|
options: {
|
|
230
|
-
type: PropType<(string |
|
|
249
|
+
type: PropType<(string | Option)[]>;
|
|
231
250
|
default: () => never[];
|
|
232
251
|
};
|
|
233
252
|
labelKey: {
|
|
@@ -243,9 +262,7 @@ export declare const VvComboboxProps: {
|
|
|
243
262
|
default: string;
|
|
244
263
|
};
|
|
245
264
|
modifiers: PropType<string | string[]>;
|
|
246
|
-
readonly: BooleanConstructor;
|
|
247
|
-
* Manage modelValue as string[] or object[]
|
|
248
|
-
*/
|
|
265
|
+
readonly: BooleanConstructor;
|
|
249
266
|
disabled: BooleanConstructor;
|
|
250
267
|
loading: BooleanConstructor;
|
|
251
268
|
loadingLabel: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, Transition, toHandlers, withCtx, withDirectives, createElementVNode, createElementBlock, renderSlot, createTextVNode, toDisplayString, createVNode, vShow } from "vue";
|
|
1
|
+
import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, Transition, toHandlers, withCtx, withDirectives, createElementVNode, withModifiers, createElementBlock, renderSlot, createTextVNode, toDisplayString, createVNode, vShow } from "vue";
|
|
2
2
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useVModel, onClickOutside } from "@vueuse/core";
|
|
4
4
|
const VvIconProps = {
|
|
5
5
|
/**
|
|
6
6
|
* Color
|
|
@@ -436,6 +436,13 @@ const IdProps = {
|
|
|
436
436
|
type: String,
|
|
437
437
|
default: ButtonType.button,
|
|
438
438
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
439
|
+
},
|
|
440
|
+
/**
|
|
441
|
+
* Button aria-label
|
|
442
|
+
*/
|
|
443
|
+
ariaLabel: {
|
|
444
|
+
type: String,
|
|
445
|
+
default: void 0
|
|
439
446
|
}
|
|
440
447
|
});
|
|
441
448
|
const VvDialogEvents = [
|
|
@@ -477,12 +484,13 @@ const VvDialogProps = {
|
|
|
477
484
|
*/
|
|
478
485
|
keepOpen: { type: Boolean, default: false }
|
|
479
486
|
};
|
|
480
|
-
const _hoisted_1 =
|
|
487
|
+
const _hoisted_1 = ["onCancel"];
|
|
488
|
+
const _hoisted_2 = {
|
|
481
489
|
key: 0,
|
|
482
490
|
class: "vv-dialog__header"
|
|
483
491
|
};
|
|
484
|
-
const
|
|
485
|
-
const
|
|
492
|
+
const _hoisted_3 = { class: "vv-dialog__content" };
|
|
493
|
+
const _hoisted_4 = {
|
|
486
494
|
key: 1,
|
|
487
495
|
class: "vv-dialog__footer"
|
|
488
496
|
};
|
|
@@ -496,16 +504,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
496
504
|
setup(__props, { expose: __expose, emit }) {
|
|
497
505
|
const props = __props;
|
|
498
506
|
const dialogEl = ref();
|
|
507
|
+
const modelValue = useVModel(props, "modelValue", emit);
|
|
499
508
|
const localModelValue = ref(false);
|
|
500
|
-
const
|
|
501
|
-
get()
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
localModelValue.value = value;
|
|
509
|
+
const isOpened = computed({
|
|
510
|
+
get: () => modelValue.value ?? localModelValue.value,
|
|
511
|
+
set: (newValue) => {
|
|
512
|
+
if (modelValue.value === void 0) {
|
|
513
|
+
localModelValue.value = newValue;
|
|
514
|
+
return;
|
|
507
515
|
}
|
|
508
|
-
|
|
516
|
+
modelValue.value = newValue;
|
|
509
517
|
}
|
|
510
518
|
});
|
|
511
519
|
const modalWrapper = ref(null);
|
|
@@ -556,36 +564,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
556
564
|
};
|
|
557
565
|
onClickOutside(modalWrapper, () => {
|
|
558
566
|
if (!props.keepOpen) {
|
|
559
|
-
|
|
567
|
+
close();
|
|
560
568
|
}
|
|
561
569
|
});
|
|
562
570
|
function close() {
|
|
563
|
-
|
|
571
|
+
isOpened.value = false;
|
|
564
572
|
}
|
|
565
573
|
function open() {
|
|
566
|
-
|
|
574
|
+
isOpened.value = true;
|
|
567
575
|
}
|
|
568
576
|
__expose({ close, open });
|
|
569
|
-
|
|
570
|
-
if (
|
|
571
|
-
e.preventDefault();
|
|
577
|
+
const onCancel = () => {
|
|
578
|
+
if (!props.keepOpen) {
|
|
572
579
|
close();
|
|
573
580
|
}
|
|
574
|
-
}
|
|
581
|
+
};
|
|
575
582
|
return (_ctx, _cache) => {
|
|
576
583
|
return openBlock(), createBlock(Transition, mergeProps({ name: unref(transitioName) }, toHandlers(dialogTransitionHandlers)), {
|
|
577
584
|
default: withCtx(() => [
|
|
578
585
|
withDirectives(createElementVNode("dialog", mergeProps(unref(dialogAttrs), {
|
|
579
586
|
ref_key: "dialogEl",
|
|
580
587
|
ref: dialogEl,
|
|
581
|
-
class: unref(dialogClass)
|
|
588
|
+
class: unref(dialogClass),
|
|
589
|
+
onCancel: withModifiers(onCancel, ["stop", "prevent"])
|
|
582
590
|
}), [
|
|
583
591
|
createElementVNode("article", {
|
|
584
592
|
ref_key: "modalWrapper",
|
|
585
593
|
ref: modalWrapper,
|
|
586
594
|
class: "vv-dialog__wrapper"
|
|
587
595
|
}, [
|
|
588
|
-
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header",
|
|
596
|
+
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_2, [
|
|
589
597
|
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
590
598
|
createTextVNode(toDisplayString(_ctx.title) + " ", 1),
|
|
591
599
|
createElementVNode("button", {
|
|
@@ -598,15 +606,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
598
606
|
], 32)
|
|
599
607
|
])
|
|
600
608
|
])) : createCommentVNode("", true),
|
|
601
|
-
createElementVNode("div",
|
|
609
|
+
createElementVNode("div", _hoisted_3, [
|
|
602
610
|
renderSlot(_ctx.$slots, "default")
|
|
603
611
|
]),
|
|
604
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer",
|
|
612
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_4, [
|
|
605
613
|
renderSlot(_ctx.$slots, "footer")
|
|
606
614
|
])) : createCommentVNode("", true)
|
|
607
615
|
], 512)
|
|
608
|
-
], 16), [
|
|
609
|
-
[vShow, unref(
|
|
616
|
+
], 16, _hoisted_1), [
|
|
617
|
+
[vShow, unref(isOpened)]
|
|
610
618
|
])
|
|
611
619
|
]),
|
|
612
620
|
_: 3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("@iconify/vue"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvDialog=o(e.vue,e.vue$1,e.core)}(this,(function(e,o,t){"use strict";const
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("@iconify/vue"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvDialog=o(e.vue,e.vue$1,e.core)}(this,(function(e,o,t){"use strict";const n={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{});const a=Symbol.for("volver");const c=e.defineComponent({name:"VvIcon",props:n,setup(t){const n=t,r=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),l=e.ref(!0),i=e.inject(a),{modifiers:c}=e.toRefs(n),s=function(o,t,n){return e.computed((()=>{const r={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{r[`${o}--${t}`]=e.unref(n.value[t])})),r}))}("vv-icon",c),u=e.computed((()=>n.provider||(null==i?void 0:i.iconsProvider))),d=e.computed((()=>{const e=n.name??"",t=`@${u.value}:${n.prefix}:${e}`;if(o.iconExists(t))return t;const r=null==i?void 0:i.iconsCollections.find((t=>{const n=`@${u.value}:${t.prefix}:${e}`;return o.iconExists(n)}));return r?`@${u.value}:${r.prefix}:${e}`:e}));function f(e){const t=function(e){let o;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");o=(new e).window}return(o?new o.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),r=(null==t?void 0:t.innerHTML.trim())||"";t&&r&&o.addIcon(`@${u.value}:${n.prefix}:${n.name}`,{body:r,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&n.src&&!o.iconExists(`@${u.value}:${n.prefix}:${n.name}`)&&(l.value=!1,i.fetchIcon(n.src).then((e=>{e&&(f(e),l.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),n.svg&&f(n.svg),(t,n)=>e.unref(l)?(e.openBlock(),e.createBlock(e.unref(o.Icon),e.mergeProps({key:0,class:e.unref(s)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(r),color:t.color,onLoad:t.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("",!0)}});Boolean,Boolean,Boolean;l.before;const s={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,i.button;const u={...s,title:String,modelValue:{type:Boolean,default:void 0},transition:{type:String,default:"fade-block"},size:String,keepOpen:{type:Boolean,default:!1}},d=["onCancel"],f={key:0,class:"vv-dialog__header"},v={class:"vv-dialog__content"},p={key:1,class:"vv-dialog__footer"};return e.defineComponent({name:"VvDialog",props:u,emits:["open","close","update:modelValue","before-enter","after-leave","enter","after-enter","enter-cancelled","before-leave","leave","leave-cancelled"],setup(o,{expose:n,emit:r}){const l=o,i=e.ref(),a=t.useVModel(l,"modelValue",r),s=e.ref(!1),u=e.computed({get:()=>a.value??s.value,set:e=>{void 0!==a.value?a.value=e:s.value=e}}),m=e.ref(null),g=e.computed((()=>{const{id:e}=l;return{id:e}})),h=e.computed((()=>l.size?["vv-dialog",`vv-dialog--${l.size}`]:"vv-dialog")),b=e.computed((()=>`vv-dialog--${l.transition}`)),y={"before-enter":()=>{var e;null==(e=i.value)||e.showModal(),r("open"),r("before-enter")},"after-leave":()=>{var e;null==(e=i.value)||e.close(),r("close"),r("after-leave")},enter:()=>{r("enter")},"after-enter":()=>{r("after-enter")},"enter-cancelled":()=>{r("enter-cancelled")},"before-leave":()=>{r("before-leave")},leave:()=>{r("leave")},"leave-cancelled":()=>{r("leave-cancelled")}};function $(){u.value=!1}t.onClickOutside(m,(()=>{l.keepOpen||$()})),n({close:$,open:function(){u.value=!0}});const B=()=>{l.keepOpen||$()};return(o,t)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(b)},e.toHandlers(y)),{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("dialog",e.mergeProps(e.unref(g),{ref_key:"dialogEl",ref:i,class:e.unref(h),onCancel:e.withModifiers(B,["stop","prevent"])}),[e.createElementVNode("article",{ref_key:"modalWrapper",ref:m,class:"vv-dialog__wrapper"},[o.$slots.header||o.title?(e.openBlock(),e.createElementBlock("header",f,[e.renderSlot(o.$slots,"header",{},(()=>[e.createTextVNode(e.toDisplayString(o.title)+" ",1),e.createElementVNode("button",{type:"button","aria-label":"Close",class:"vv-dialog__close",onClickPassive:$},[e.createVNode(c,{name:"close"})],32)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",v,[e.renderSlot(o.$slots,"default")]),o.$slots.footer?(e.openBlock(),e.createElementBlock("footer",p,[e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("",!0)],512)],16,d),[[e.vShow,e.unref(u)]])])),_:3},16,["name"]))}})}));
|
|
@@ -106,6 +106,12 @@ const LabelProps = {
|
|
|
106
106
|
*/
|
|
107
107
|
label: [String, Number]
|
|
108
108
|
};
|
|
109
|
+
const ModifiersProps = {
|
|
110
|
+
/**
|
|
111
|
+
* Component BEM modifiers
|
|
112
|
+
*/
|
|
113
|
+
modifiers: [String, Array]
|
|
114
|
+
};
|
|
109
115
|
({
|
|
110
116
|
/**
|
|
111
117
|
* VvIcon name or props
|
|
@@ -237,18 +243,19 @@ const DropdownProps = {
|
|
|
237
243
|
type: String,
|
|
238
244
|
default: ButtonType.button,
|
|
239
245
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
246
|
+
},
|
|
247
|
+
/**
|
|
248
|
+
* Button aria-label
|
|
249
|
+
*/
|
|
250
|
+
ariaLabel: {
|
|
251
|
+
type: String,
|
|
252
|
+
default: void 0
|
|
240
253
|
}
|
|
241
254
|
});
|
|
242
255
|
const VvDropdownProps = {
|
|
243
256
|
...IdProps,
|
|
244
257
|
...DropdownProps,
|
|
245
|
-
|
|
246
|
-
* Component BEM modifiers
|
|
247
|
-
*/
|
|
248
|
-
modifiers: {
|
|
249
|
-
type: [String, Array],
|
|
250
|
-
default: "mobile"
|
|
251
|
-
},
|
|
258
|
+
...ModifiersProps,
|
|
252
259
|
/**
|
|
253
260
|
* Show / hide dropdown programmatically
|
|
254
261
|
*/
|
|
@@ -459,7 +466,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
459
466
|
referenceEl,
|
|
460
467
|
floatingEl,
|
|
461
468
|
{
|
|
462
|
-
whileElementsMounted:
|
|
469
|
+
whileElementsMounted: (...args) => {
|
|
470
|
+
return autoUpdate(...args, {
|
|
471
|
+
animationFrame: props.strategy === "fixed"
|
|
472
|
+
});
|
|
473
|
+
},
|
|
463
474
|
placement: computed(() => props.placement),
|
|
464
475
|
strategy: computed(() => props.strategy),
|
|
465
476
|
middleware
|
|
@@ -546,7 +557,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
546
557
|
onClickOutside(
|
|
547
558
|
floatingEl,
|
|
548
559
|
() => {
|
|
549
|
-
if (!props.keepOpen) {
|
|
560
|
+
if (!props.keepOpen && expanded.value) {
|
|
550
561
|
expanded.value = false;
|
|
551
562
|
}
|
|
552
563
|
},
|
|
@@ -584,7 +595,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
584
595
|
}
|
|
585
596
|
return [
|
|
586
597
|
...element.querySelectorAll(
|
|
587
|
-
'a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'
|
|
598
|
+
'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
588
599
|
)
|
|
589
600
|
].filter(
|
|
590
601
|
(el) => !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@floating-ui/vue"),require("nanoid"),require("@vueuse/core"),require("mitt")):"function"==typeof define&&define.amd?define(["vue","@floating-ui/vue","nanoid","@vueuse/core","mitt"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvDropdown=t(e.vue,e.vue$1,e.nanoid,e.core,e.mitt)}(this,(function(e,t,o,r,l){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),n=(e=>(e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e))(n||{}),u=(e=>(e.before="before",e.after="after",e))(u||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),d=(e=>(e.listbox="listbox",e.menu="menu",e))(d||{}),s=(e=>(e.option="option",e.presentation="presentation",e))(s||{});const f=Symbol.for("dropdownTrigger"),p=Symbol.for("dropdownItem")
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@floating-ui/vue"),require("nanoid"),require("@vueuse/core"),require("mitt")):"function"==typeof define&&define.amd?define(["vue","@floating-ui/vue","nanoid","@vueuse/core","mitt"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvDropdown=t(e.vue,e.vue$1,e.nanoid,e.core,e.mitt)}(this,(function(e,t,o,r,l){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),n=(e=>(e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e))(n||{}),u=(e=>(e.before="before",e.after="after",e))(u||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),d=(e=>(e.listbox="listbox",e.menu="menu",e))(d||{}),s=(e=>(e.option="option",e.presentation="presentation",e))(s||{});const f=Symbol.for("dropdownTrigger"),p=Symbol.for("dropdownItem"),c=(Boolean,Boolean,Boolean,{modifiers:[String,Array]});u.before;const v={id:[String,Number]},m={placement:{type:String,default:a.bottom,validator:e=>Object.values(a).includes(e)||Object.values(n).includes(e)},strategy:{type:String,default:"absolute",validator:e=>["fixed","absolute"].includes(e)},transitionName:{type:String},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean}};i.button;const b={...v,...m,...c,modelValue:{type:Boolean,default:void 0},reference:{type:Object,default:null},role:{type:String,default:d.menu,validator:e=>Object.values(d).includes(e)}};const g=["id","tabindex","role","aria-labelledby"];return e.defineComponent({name:"VvDropdown",inheritAttrs:!1,props:b,emits:["update:modelValue","beforeExpand","beforeCollapse","afterExpand","afterCollapse","before-enter","after-leave","enter","after-enter","enter-cancelled","before-leave","leave","leave-cancelled"],setup(a,{expose:n,emit:u}){const i=a,{id:c}=e.toRefs(i),v=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid()))))(c),m=e.useAttrs(),b=e.ref("auto"),h=e.ref("auto"),y=e.ref(null),x=e.ref(),w=e.ref(null),S=e.ref(null),E=e.computed({get:()=>i.reference??y.value,set:e=>{y.value=e}}),k=e.ref(!1);e.onMounted((()=>{r.useMutationObserver(x.value,(()=>{var e;k.value="true"===(null==(e=window.getComputedStyle(x.value).getPropertyValue("--dropdown-custom-position"))?void 0:e.trim())}),{attributeFilter:["style"],window:window})}));const P=e.computed((()=>{const e=[];if(i.autoPlacement?"boolean"==typeof i.autoPlacement?e.push(t.autoPlacement()):e.push(t.autoPlacement(i.autoPlacement)):i.flip&&("boolean"==typeof i.flip?e.push(t.flip()):e.push(t.flip(i.flip))),i.shift&&("boolean"==typeof i.shift?e.push(t.shift()):e.push(t.shift(i.shift))),i.size){const o=({availableWidth:e,availableHeight:t})=>{b.value=`${e}px`,h.value=`${t}px`};"boolean"==typeof i.size?e.push(t.size({apply:o})):e.push(t.size({...i.size,apply:o}))}return i.offset&&(e.push(t.offset(Number(i.offset))),["string","number"].includes(typeof i.offset)?e.push(t.offset(Number(i.offset))):e.push(t.offset(i.offset))),i.arrow&&e.push(t.arrow({element:w})),e})),{x:$,y:B,strategy:O,middlewareData:z,placement:V}=t.useFloating(E,x,{whileElementsMounted:(...e)=>t.autoUpdate(...e,{animationFrame:"fixed"===i.strategy}),placement:e.computed((()=>i.placement)),strategy:e.computed((()=>i.strategy)),middleware:P}),C=e.computed((()=>{if(!k.value)return{position:O.value,top:`${B.value??0}px`,left:`${$.value??0}px`,maxWidth:b.value,maxHeight:h.value,width:i.triggerWidth&&E.value?`${E.value.offsetWidth}px`:void 0}})),j=e.computed((()=>V.value.split("-")[0])),A=e.computed((()=>{var e,t,o,r,l;if(k.value)return;const a={top:"bottom",right:"left",bottom:"top",left:"right"}[j.value];return{left:void 0!==(null==(e=z.value.arrow)?void 0:e.x)?`${null==(t=z.value.arrow)?void 0:t.x}px`:void 0,top:void 0!==(null==(o=z.value.arrow)?void 0:o.y)?`${null==(r=z.value.arrow)?void 0:r.y}px`:void 0,[a]:-((null==(l=w.value)?void 0:l.offsetWidth)??0)/2+"px"}})),N=r.useVModel(i,"modelValue",u),D=e.ref(!1),_=e.computed({get:()=>N.value??D.value,set:e=>{void 0!==N.value?N.value=e:D.value=e}}),F=()=>{_.value=!0},R=()=>{_.value=!1},T=()=>{_.value=!_.value},W=e=>{E.value=e};n({toggle:T,show:F,hide:R,init:W,customPosition:k}),e.watch(_,(t=>{t&&i.autofocusFirst&&e.nextTick((()=>{const e=Q(x.value);e.length>0&&e[0].focus({preventScroll:!0})}))})),r.onClickOutside(x,(()=>{!i.keepOpen&&_.value&&(_.value=!1)}),{ignore:[E]});const q=e.computed((()=>{var e,t;return(null==(t=null==(e=E.value)?void 0:e.getAttribute)?void 0:t.call(e,"id"))??void 0})),K=e.computed((()=>({"aria-controls":v.value,"aria-haspopup":!0,"aria-expanded":_.value}))),{component:M,bus:H}=function({reference:t,id:o,expanded:r,aria:a}){const n=l(),u=e.defineComponent({name:"VvDropdownTriggerProvider",setup(){e.provide(f,{reference:t,id:o,expanded:r,aria:a,bus:n})},render(){var t,o;return e.h(e.Fragment,{},null==(o=(t=this.$slots).default)?void 0:o.call(t))}});return{bus:n,component:u}}({reference:E,id:v,expanded:_,aria:K});H.on("click",T);const{role:U,modifiers:I}=e.toRefs(i),{itemRole:G}=function({role:t,expanded:o}){const r=e.computed((()=>t.value===d.listbox?s.option:s.presentation));return e.provide(p,{role:r,expanded:o}),{itemRole:r}}({role:U,expanded:_}),J=function(t,o,r){return e.computed((()=>{const l={[t]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(l[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{l[`${t}--${o}`]=e.unref(r.value[o])})),l}))}("vv-dropdown",I,e.computed((()=>({arrow:i.arrow})))),{focused:L}=r.useFocusWithin(x);function Q(e){return e?[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden"))):[]}r.onKeyStroke("Escape",(e=>{_.value&&(e.preventDefault(),R())})),r.onKeyStroke("ArrowDown",(t=>{_.value&&L.value&&(t.preventDefault(),e.nextTick((()=>{if(L.value){const e=Q(x.value);if(0===e.length||!document.activeElement)return;const t=e.indexOf(document.activeElement);t<e.length-1?e[t+1].focus({preventScroll:!0}):e[0].focus({preventScroll:!0})}})))})),r.onKeyStroke("ArrowUp",(t=>{_.value&&L.value&&(t.preventDefault(),e.nextTick((()=>{if(L.value){const e=Q(x.value);if(0===e.length||!document.activeElement)return;const t=e.indexOf(document.activeElement);t>0?e[t-1].focus({preventScroll:!0}):e[e.length-1].focus({preventScroll:!0})}})))})),r.onKeyStroke([" ","Enter"],(e=>{const t=e.target;_.value&&L.value&&t&&(null==t||t.click())}));const X={"before-enter":()=>{u(_.value?"beforeExpand":"beforeCollapse"),u("before-enter")},"after-leave":()=>{u(_.value?"afterExpand":"afterCollapse"),u("after-leave")},enter:()=>{u("enter")},"after-enter":()=>{u("after-enter")},"enter-cancelled":()=>{u("enter-cancelled")},"before-leave":()=>{u("before-leave")},leave:()=>{u("leave")},"leave-cancelled":()=>{u("leave-cancelled")}};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(M),null,{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({init:W,show:F,hide:R,toggle:T,expanded:e.unref(_),aria:e.unref(K)})))])),_:3}),e.createVNode(e.Transition,e.mergeProps({name:t.transitionName},e.toHandlers(X)),{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingEl",ref:x,style:e.normalizeStyle(e.unref(C)),class:e.normalizeClass(e.unref(J))},[i.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowEl",ref:w,style:e.normalizeStyle(e.unref(A)),class:"vv-dropdown__arrow"},null,4)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(_)}))),e.createElementVNode("div",e.mergeProps(e.unref(m),{id:e.unref(v),ref_key:"listEl",ref:S,tabindex:e.unref(_)?void 0:-1,role:e.unref(U),"aria-labelledby":e.unref(q),class:"vv-dropdown__list"}),[e.renderSlot(t.$slots,"items",e.normalizeProps(e.guardReactiveProps({role:e.unref(G)})))],16,g),e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(_)})))],6),[[e.vShow,e.unref(_)]])])),_:3},16,["name"])],64))}})}));
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
-
modifiers: {
|
|
4
|
-
type: globalThis.PropType<string | string[]>;
|
|
5
|
-
default: string;
|
|
6
|
-
};
|
|
7
3
|
modelValue: {
|
|
8
4
|
type: BooleanConstructor;
|
|
9
5
|
default: undefined;
|
|
@@ -17,6 +13,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
17
13
|
default: import("../../constants").DropdownRole;
|
|
18
14
|
validator: (value: import("../../constants").DropdownRole) => boolean;
|
|
19
15
|
};
|
|
16
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
20
17
|
placement: {
|
|
21
18
|
type: globalThis.PropType<"left" | "right" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end">;
|
|
22
19
|
default: import("../../constants").Side;
|
|
@@ -114,10 +111,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
114
111
|
init: (el: HTMLElement) => void;
|
|
115
112
|
customPosition: Ref<boolean>;
|
|
116
113
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "before-enter" | "after-leave" | "enter" | "after-enter" | "enter-cancelled" | "before-leave" | "leave" | "leave-cancelled" | "beforeExpand" | "beforeCollapse" | "afterExpand" | "afterCollapse")[], "update:modelValue" | "before-enter" | "after-leave" | "enter" | "after-enter" | "enter-cancelled" | "before-leave" | "leave" | "leave-cancelled" | "beforeExpand" | "beforeCollapse" | "afterExpand" | "afterCollapse", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
117
|
-
modifiers: {
|
|
118
|
-
type: globalThis.PropType<string | string[]>;
|
|
119
|
-
default: string;
|
|
120
|
-
};
|
|
121
114
|
modelValue: {
|
|
122
115
|
type: BooleanConstructor;
|
|
123
116
|
default: undefined;
|
|
@@ -131,6 +124,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
131
124
|
default: import("../../constants").DropdownRole;
|
|
132
125
|
validator: (value: import("../../constants").DropdownRole) => boolean;
|
|
133
126
|
};
|
|
127
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
134
128
|
placement: {
|
|
135
129
|
type: globalThis.PropType<"left" | "right" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end">;
|
|
136
130
|
default: import("../../constants").Side;
|
|
@@ -236,6 +230,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
236
230
|
onAfterExpand?: ((...args: any[]) => any) | undefined;
|
|
237
231
|
onAfterCollapse?: ((...args: any[]) => any) | undefined;
|
|
238
232
|
}, {
|
|
233
|
+
reference: HTMLElement | null;
|
|
234
|
+
modelValue: boolean;
|
|
239
235
|
shift: boolean | Partial<import("@floating-ui/vue").ShiftOptions & {
|
|
240
236
|
rootBoundary: import("@floating-ui/vue").RootBoundary;
|
|
241
237
|
elementContext: import("@floating-ui/vue").ElementContext;
|
|
@@ -243,9 +239,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
243
239
|
padding: import("@floating-ui/vue").Padding;
|
|
244
240
|
boundary: import("@floating-ui/vue").Boundary;
|
|
245
241
|
}> | undefined;
|
|
246
|
-
reference: HTMLElement | null;
|
|
247
|
-
modelValue: boolean;
|
|
248
|
-
modifiers: string | string[];
|
|
249
242
|
role: "listbox" | "menu";
|
|
250
243
|
flip: boolean | Partial<import("@floating-ui/vue").FlipOptions & {
|
|
251
244
|
rootBoundary: import("@floating-ui/vue").RootBoundary;
|
|
@@ -5,6 +5,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
5
5
|
default: import("../../constants").ButtonType;
|
|
6
6
|
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
7
7
|
};
|
|
8
|
+
ariaLabel: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: undefined;
|
|
11
|
+
};
|
|
8
12
|
to: {
|
|
9
13
|
type: (ObjectConstructor | StringConstructor)[];
|
|
10
14
|
};
|
|
@@ -28,6 +32,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
28
32
|
default: import("../../constants").ButtonType;
|
|
29
33
|
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
30
34
|
};
|
|
35
|
+
ariaLabel: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
31
39
|
to: {
|
|
32
40
|
type: (ObjectConstructor | StringConstructor)[];
|
|
33
41
|
};
|
|
@@ -47,6 +55,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
47
55
|
}>>, {
|
|
48
56
|
disabled: boolean;
|
|
49
57
|
type: "button" | "submit" | "reset";
|
|
58
|
+
ariaLabel: string;
|
|
50
59
|
rel: string;
|
|
51
60
|
active: boolean;
|
|
52
61
|
pressed: boolean;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import { DropdownRole } from '../../constants';
|
|
3
3
|
export declare const VvDropdownProps: {
|
|
4
|
-
/**
|
|
5
|
-
* Component BEM modifiers
|
|
6
|
-
*/
|
|
7
|
-
modifiers: {
|
|
8
|
-
type: PropType<string | string[]>;
|
|
9
|
-
default: string;
|
|
10
|
-
};
|
|
11
4
|
/**
|
|
12
5
|
* Show / hide dropdown programmatically
|
|
13
6
|
*/
|
|
@@ -30,6 +23,7 @@ export declare const VvDropdownProps: {
|
|
|
30
23
|
default: DropdownRole;
|
|
31
24
|
validator: (value: DropdownRole) => boolean;
|
|
32
25
|
};
|
|
26
|
+
modifiers: PropType<string | string[]>;
|
|
33
27
|
placement: {
|
|
34
28
|
type: PropType<"left" | "right" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end">;
|
|
35
29
|
default: import("../../constants").Side;
|
|
@@ -241,6 +241,13 @@ const ActionProps = {
|
|
|
241
241
|
type: String,
|
|
242
242
|
default: ButtonType.button,
|
|
243
243
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
244
|
+
},
|
|
245
|
+
/**
|
|
246
|
+
* Button aria-label
|
|
247
|
+
*/
|
|
248
|
+
ariaLabel: {
|
|
249
|
+
type: String,
|
|
250
|
+
default: void 0
|
|
244
251
|
}
|
|
245
252
|
};
|
|
246
253
|
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
@@ -302,7 +309,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
302
309
|
const hasProps = computed(() => {
|
|
303
310
|
const toReturn = {
|
|
304
311
|
...dropdownAria == null ? void 0 : dropdownAria.value,
|
|
305
|
-
|
|
312
|
+
ariaPressed: pressed.value ? true : void 0,
|
|
313
|
+
ariaLabel: props.ariaLabel,
|
|
306
314
|
role: role == null ? void 0 : role.value
|
|
307
315
|
};
|
|
308
316
|
switch (hasTag.value) {
|