@nuxt/ui 2.11.0 → 2.11.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/module.d.mts +196 -22
- package/dist/module.d.ts +196 -22
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -3
- package/dist/runtime/components/data/Table.vue +3 -3
- package/dist/runtime/components/data/Table.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Accordion.vue +2 -2
- package/dist/runtime/components/elements/Accordion.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Alert.vue +6 -6
- package/dist/runtime/components/elements/Alert.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Avatar.vue +2 -2
- package/dist/runtime/components/elements/Avatar.vue.d.ts +7 -7
- package/dist/runtime/components/elements/AvatarGroup.d.ts +7 -7
- package/dist/runtime/components/elements/AvatarGroup.mjs +2 -2
- package/dist/runtime/components/elements/Badge.vue +2 -2
- package/dist/runtime/components/elements/Badge.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Button.vue +8 -6
- package/dist/runtime/components/elements/Button.vue.d.ts +8 -7
- package/dist/runtime/components/elements/ButtonGroup.d.ts +7 -7
- package/dist/runtime/components/elements/ButtonGroup.mjs +3 -16
- package/dist/runtime/components/elements/Chip.vue +2 -2
- package/dist/runtime/components/elements/Chip.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Dropdown.vue +5 -5
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Kbd.vue +2 -2
- package/dist/runtime/components/elements/Kbd.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Meter.vue +2 -2
- package/dist/runtime/components/elements/Meter.vue.d.ts +7 -7
- package/dist/runtime/components/elements/MeterGroup.d.ts +9 -9
- package/dist/runtime/components/elements/MeterGroup.mjs +8 -21
- package/dist/runtime/components/elements/Progress.vue +5 -94
- package/dist/runtime/components/elements/Progress.vue.d.ts +123 -1
- package/dist/runtime/components/forms/Checkbox.vue +7 -7
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +8 -8
- package/dist/runtime/components/forms/Form.vue +1 -1
- package/dist/runtime/components/forms/FormGroup.vue +2 -2
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +7 -7
- package/dist/runtime/components/forms/Input.vue +7 -7
- package/dist/runtime/components/forms/Input.vue.d.ts +10 -10
- package/dist/runtime/components/forms/Radio.vue +7 -7
- package/dist/runtime/components/forms/Radio.vue.d.ts +7 -7
- package/dist/runtime/components/forms/RadioGroup.vue +4 -4
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +13 -13
- package/dist/runtime/components/forms/Range.vue +5 -5
- package/dist/runtime/components/forms/Range.vue.d.ts +8 -8
- package/dist/runtime/components/forms/Select.vue +7 -7
- package/dist/runtime/components/forms/Select.vue.d.ts +9 -9
- package/dist/runtime/components/forms/SelectMenu.vue +18 -18
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +13 -13
- package/dist/runtime/components/forms/Textarea.vue +3 -3
- package/dist/runtime/components/forms/Textarea.vue.d.ts +10 -10
- package/dist/runtime/components/forms/Toggle.vue +9 -9
- package/dist/runtime/components/forms/Toggle.vue.d.ts +14 -14
- package/dist/runtime/components/layout/Card.vue +2 -2
- package/dist/runtime/components/layout/Card.vue.d.ts +7 -7
- package/dist/runtime/components/layout/Container.vue +2 -2
- package/dist/runtime/components/layout/Container.vue.d.ts +7 -7
- package/dist/runtime/components/layout/Divider.vue +3 -8
- package/dist/runtime/components/layout/Divider.vue.d.ts +7 -7
- package/dist/runtime/components/layout/Skeleton.vue +2 -2
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +7 -7
- package/dist/runtime/components/navigation/Breadcrumb.vue +2 -2
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +7 -7
- package/dist/runtime/components/navigation/CommandPalette.vue +42 -33
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +15 -8
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +1 -3
- package/dist/runtime/components/navigation/Pagination.vue +7 -7
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +7 -7
- package/dist/runtime/components/navigation/Tabs.vue +8 -5
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +9 -9
- package/dist/runtime/components/navigation/VerticalNavigation.vue +2 -2
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/ContextMenu.vue +4 -3
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Modal.vue +3 -6
- package/dist/runtime/components/overlays/Modal.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Notification.vue +7 -7
- package/dist/runtime/components/overlays/Notification.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Notifications.vue +2 -2
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Popover.vue +5 -4
- package/dist/runtime/components/overlays/Popover.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Slideover.vue +6 -6
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Tooltip.vue +6 -5
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +7 -7
- package/dist/runtime/composables/useFormGroup.d.ts +3 -3
- package/dist/runtime/composables/useFormGroup.mjs +1 -1
- package/dist/runtime/composables/useUI.d.ts +3 -3
- package/dist/runtime/types/breadcrumb.d.ts +2 -0
- package/dist/runtime/types/form.d.ts +1 -1
- package/dist/runtime/types/popper.d.ts +2 -0
- package/dist/runtime/types/utils.d.ts +4 -4
- package/dist/runtime/ui.config/data/table.d.ts +2 -2
- package/dist/runtime/ui.config/elements/accordion.d.ts +1 -1
- package/dist/runtime/ui.config/elements/alert.d.ts +5 -4
- package/dist/runtime/ui.config/elements/alert.mjs +1 -0
- package/dist/runtime/ui.config/elements/button.d.ts +4 -0
- package/dist/runtime/ui.config/elements/button.mjs +4 -0
- package/dist/runtime/ui.config/elements/buttonGroup.d.ts +92 -0
- package/dist/runtime/ui.config/elements/buttonGroup.mjs +12 -1
- package/dist/runtime/ui.config/elements/dropdown.d.ts +3 -1
- package/dist/runtime/ui.config/elements/dropdown.mjs +4 -2
- package/dist/runtime/ui.config/elements/meterGroup.d.ts +40 -0
- package/dist/runtime/ui.config/elements/meterGroup.mjs +14 -1
- package/dist/runtime/ui.config/forms/checkbox.d.ts +3 -0
- package/dist/runtime/ui.config/forms/checkbox.mjs +3 -0
- package/dist/runtime/ui.config/forms/input.d.ts +2 -0
- package/dist/runtime/ui.config/forms/input.mjs +2 -0
- package/dist/runtime/ui.config/forms/radio.d.ts +3 -0
- package/dist/runtime/ui.config/forms/radio.mjs +3 -0
- package/dist/runtime/ui.config/forms/select.d.ts +2 -0
- package/dist/runtime/ui.config/forms/select.mjs +1 -0
- package/dist/runtime/ui.config/forms/selectMenu.d.ts +6 -1
- package/dist/runtime/ui.config/forms/selectMenu.mjs +7 -2
- package/dist/runtime/ui.config/forms/textarea.d.ts +2 -0
- package/dist/runtime/ui.config/forms/textarea.mjs +1 -0
- package/dist/runtime/ui.config/layout/divider.d.ts +6 -1
- package/dist/runtime/ui.config/layout/divider.mjs +5 -0
- package/dist/runtime/ui.config/navigation/breadcrumb.mjs +1 -1
- package/dist/runtime/ui.config/navigation/commandPalette.d.ts +5 -1
- package/dist/runtime/ui.config/navigation/commandPalette.mjs +5 -1
- package/dist/runtime/ui.config/navigation/pagination.d.ts +6 -6
- package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +1 -1
- package/dist/runtime/ui.config/overlays/contextMenu.mjs +1 -1
- package/dist/runtime/ui.config/overlays/modal.d.ts +1 -0
- package/dist/runtime/ui.config/overlays/modal.mjs +3 -2
- package/dist/runtime/ui.config/overlays/notification.d.ts +5 -4
- package/dist/runtime/ui.config/overlays/notification.mjs +1 -0
- package/dist/runtime/ui.config/overlays/popover.d.ts +1 -0
- package/dist/runtime/ui.config/overlays/popover.mjs +2 -1
- package/dist/runtime/ui.config/overlays/slideover.d.ts +5 -0
- package/dist/runtime/ui.config/overlays/slideover.mjs +5 -0
- package/dist/runtime/ui.config/overlays/tooltip.d.ts +1 -0
- package/dist/runtime/ui.config/overlays/tooltip.mjs +2 -1
- package/dist/runtime/ui.config/{_popperArrow.d.ts → popper.d.ts} +1 -2
- package/dist/runtime/ui.config/{_popperArrow.mjs → popper.mjs} +2 -2
- package/dist/runtime/ui.css +1 -13
- package/dist/runtime/utils/index.mjs +1 -1
- package/package.json +12 -14
|
@@ -30,18 +30,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
30
|
default: () => any;
|
|
31
31
|
validator(value: string): any;
|
|
32
32
|
};
|
|
33
|
-
class: {
|
|
34
|
-
type: PropType<any>;
|
|
35
|
-
default: undefined;
|
|
36
|
-
};
|
|
37
33
|
size: {
|
|
38
34
|
type: PropType<ToggleSize>;
|
|
39
35
|
default: any;
|
|
40
36
|
validator(value: string): boolean;
|
|
41
37
|
};
|
|
38
|
+
class: {
|
|
39
|
+
type: PropType<any>;
|
|
40
|
+
default: () => "";
|
|
41
|
+
};
|
|
42
42
|
ui: {
|
|
43
|
-
type: PropType<
|
|
44
|
-
default:
|
|
43
|
+
type: PropType<any>;
|
|
44
|
+
default: () => {};
|
|
45
45
|
};
|
|
46
46
|
}, {
|
|
47
47
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -49,7 +49,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
49
49
|
[x: string]: unknown;
|
|
50
50
|
}, string>>;
|
|
51
51
|
name: import("vue").ComputedRef<string | undefined>;
|
|
52
|
-
inputId: import("vue").Ref<string |
|
|
52
|
+
inputId: import("vue").Ref<string | undefined>;
|
|
53
53
|
active: import("vue").WritableComputedRef<boolean>;
|
|
54
54
|
switchClass: import("vue").ComputedRef<string>;
|
|
55
55
|
containerClass: import("vue").ComputedRef<string>;
|
|
@@ -85,24 +85,24 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
85
85
|
default: () => any;
|
|
86
86
|
validator(value: string): any;
|
|
87
87
|
};
|
|
88
|
-
class: {
|
|
89
|
-
type: PropType<any>;
|
|
90
|
-
default: undefined;
|
|
91
|
-
};
|
|
92
88
|
size: {
|
|
93
89
|
type: PropType<ToggleSize>;
|
|
94
90
|
default: any;
|
|
95
91
|
validator(value: string): boolean;
|
|
96
92
|
};
|
|
93
|
+
class: {
|
|
94
|
+
type: PropType<any>;
|
|
95
|
+
default: () => "";
|
|
96
|
+
};
|
|
97
97
|
ui: {
|
|
98
|
-
type: PropType<
|
|
99
|
-
default:
|
|
98
|
+
type: PropType<any>;
|
|
99
|
+
default: () => {};
|
|
100
100
|
};
|
|
101
101
|
}>> & {
|
|
102
102
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
103
103
|
}, {
|
|
104
104
|
size: ToggleSize;
|
|
105
|
-
ui:
|
|
105
|
+
ui: any;
|
|
106
106
|
id: string;
|
|
107
107
|
color: any;
|
|
108
108
|
name: string;
|
|
@@ -6,11 +6,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
};
|
|
7
7
|
class: {
|
|
8
8
|
type: PropType<any>;
|
|
9
|
-
default:
|
|
9
|
+
default: () => string;
|
|
10
10
|
};
|
|
11
11
|
ui: {
|
|
12
|
-
type: PropType<
|
|
13
|
-
default:
|
|
12
|
+
type: PropType<any>;
|
|
13
|
+
default: () => {};
|
|
14
14
|
};
|
|
15
15
|
}, {
|
|
16
16
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -25,14 +25,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
25
25
|
};
|
|
26
26
|
class: {
|
|
27
27
|
type: PropType<any>;
|
|
28
|
-
default:
|
|
28
|
+
default: () => string;
|
|
29
29
|
};
|
|
30
30
|
ui: {
|
|
31
|
-
type: PropType<
|
|
32
|
-
default:
|
|
31
|
+
type: PropType<any>;
|
|
32
|
+
default: () => {};
|
|
33
33
|
};
|
|
34
34
|
}>>, {
|
|
35
|
-
ui:
|
|
35
|
+
ui: any;
|
|
36
36
|
class: any;
|
|
37
37
|
as: string;
|
|
38
38
|
}, {}>;
|
|
@@ -6,11 +6,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
};
|
|
7
7
|
class: {
|
|
8
8
|
type: PropType<any>;
|
|
9
|
-
default:
|
|
9
|
+
default: () => string;
|
|
10
10
|
};
|
|
11
11
|
ui: {
|
|
12
|
-
type: PropType<
|
|
13
|
-
default:
|
|
12
|
+
type: PropType<any>;
|
|
13
|
+
default: () => {};
|
|
14
14
|
};
|
|
15
15
|
}, {
|
|
16
16
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -25,14 +25,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
25
25
|
};
|
|
26
26
|
class: {
|
|
27
27
|
type: PropType<any>;
|
|
28
|
-
default:
|
|
28
|
+
default: () => string;
|
|
29
29
|
};
|
|
30
30
|
ui: {
|
|
31
|
-
type: PropType<
|
|
32
|
-
default:
|
|
31
|
+
type: PropType<any>;
|
|
32
|
+
default: () => {};
|
|
33
33
|
};
|
|
34
34
|
}>>, {
|
|
35
|
-
ui:
|
|
35
|
+
ui: any;
|
|
36
36
|
class: any;
|
|
37
37
|
as: string;
|
|
38
38
|
}, {}>;
|
|
@@ -59,11 +59,11 @@ export default defineComponent({
|
|
|
59
59
|
},
|
|
60
60
|
class: {
|
|
61
61
|
type: [String, Object, Array],
|
|
62
|
-
default:
|
|
62
|
+
default: () => ""
|
|
63
63
|
},
|
|
64
64
|
ui: {
|
|
65
65
|
type: Object,
|
|
66
|
-
default:
|
|
66
|
+
default: () => ({})
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
setup(props) {
|
|
@@ -82,16 +82,11 @@ export default defineComponent({
|
|
|
82
82
|
);
|
|
83
83
|
});
|
|
84
84
|
const borderClass = computed(() => {
|
|
85
|
-
const typeClass = {
|
|
86
|
-
solid: "border-solid",
|
|
87
|
-
dotted: "border-dotted",
|
|
88
|
-
dashed: "border-dashed"
|
|
89
|
-
}[props.type];
|
|
90
85
|
return twJoin(
|
|
91
86
|
ui.value.border.base,
|
|
92
87
|
isHorizontal.value ? ui.value.border.horizontal : ui.value.border.vertical,
|
|
93
88
|
isHorizontal.value ? ui.value.border.size.horizontal : ui.value.border.size.vertical,
|
|
94
|
-
|
|
89
|
+
ui.value.border.type[props.type]
|
|
95
90
|
);
|
|
96
91
|
});
|
|
97
92
|
return {
|
|
@@ -25,11 +25,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
25
25
|
};
|
|
26
26
|
class: {
|
|
27
27
|
type: PropType<any>;
|
|
28
|
-
default:
|
|
28
|
+
default: () => string;
|
|
29
29
|
};
|
|
30
30
|
ui: {
|
|
31
|
-
type: PropType<
|
|
32
|
-
default:
|
|
31
|
+
type: PropType<any>;
|
|
32
|
+
default: () => {};
|
|
33
33
|
};
|
|
34
34
|
}, {
|
|
35
35
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -64,15 +64,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
64
64
|
};
|
|
65
65
|
class: {
|
|
66
66
|
type: PropType<any>;
|
|
67
|
-
default:
|
|
67
|
+
default: () => string;
|
|
68
68
|
};
|
|
69
69
|
ui: {
|
|
70
|
-
type: PropType<
|
|
71
|
-
default:
|
|
70
|
+
type: PropType<any>;
|
|
71
|
+
default: () => {};
|
|
72
72
|
};
|
|
73
73
|
}>>, {
|
|
74
74
|
orientation: "horizontal" | "vertical";
|
|
75
|
-
ui:
|
|
75
|
+
ui: any;
|
|
76
76
|
icon: string;
|
|
77
77
|
avatar: Avatar;
|
|
78
78
|
type: "solid" | "dotted" | "dashed";
|
|
@@ -2,11 +2,11 @@ import type { PropType } from 'vue';
|
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
3
|
class: {
|
|
4
4
|
type: PropType<any>;
|
|
5
|
-
default:
|
|
5
|
+
default: () => string;
|
|
6
6
|
};
|
|
7
7
|
ui: {
|
|
8
|
-
type: PropType<
|
|
9
|
-
default:
|
|
8
|
+
type: PropType<any>;
|
|
9
|
+
default: () => {};
|
|
10
10
|
};
|
|
11
11
|
}, {
|
|
12
12
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -17,14 +17,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
17
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
18
|
class: {
|
|
19
19
|
type: PropType<any>;
|
|
20
|
-
default:
|
|
20
|
+
default: () => string;
|
|
21
21
|
};
|
|
22
22
|
ui: {
|
|
23
|
-
type: PropType<
|
|
24
|
-
default:
|
|
23
|
+
type: PropType<any>;
|
|
24
|
+
default: () => {};
|
|
25
25
|
};
|
|
26
26
|
}>>, {
|
|
27
|
-
ui:
|
|
27
|
+
ui: any;
|
|
28
28
|
class: any;
|
|
29
29
|
}, {}>;
|
|
30
30
|
export default _default;
|
|
@@ -12,11 +12,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
12
12
|
};
|
|
13
13
|
class: {
|
|
14
14
|
type: PropType<any>;
|
|
15
|
-
default:
|
|
15
|
+
default: () => string;
|
|
16
16
|
};
|
|
17
17
|
ui: {
|
|
18
|
-
type: PropType<
|
|
19
|
-
default:
|
|
18
|
+
type: PropType<any>;
|
|
19
|
+
default: () => {};
|
|
20
20
|
};
|
|
21
21
|
}, {
|
|
22
22
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -35,14 +35,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
35
35
|
};
|
|
36
36
|
class: {
|
|
37
37
|
type: PropType<any>;
|
|
38
|
-
default:
|
|
38
|
+
default: () => string;
|
|
39
39
|
};
|
|
40
40
|
ui: {
|
|
41
|
-
type: PropType<
|
|
42
|
-
default:
|
|
41
|
+
type: PropType<any>;
|
|
42
|
+
default: () => {};
|
|
43
43
|
};
|
|
44
44
|
}>>, {
|
|
45
|
-
ui:
|
|
45
|
+
ui: any;
|
|
46
46
|
class: any;
|
|
47
47
|
divider: string;
|
|
48
48
|
links: BreadcrumbLink[];
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
<HComboboxInput
|
|
15
15
|
ref="comboboxInput"
|
|
16
16
|
:value="query"
|
|
17
|
-
:class="[ui.input.base, ui.input.size, ui.input.height, ui.input.padding, icon && ui.input.icon.padding]"
|
|
17
|
+
:class="[ui.input.base, ui.input.size, ui.input.height, ui.input.padding, icon && ui.input.icon.padding, closeButton && ui.input.closeButton.padding]"
|
|
18
18
|
:placeholder="placeholder"
|
|
19
19
|
:aria-label="placeholder"
|
|
20
20
|
autocomplete="off"
|
|
21
21
|
@change="query = $event.target.value"
|
|
22
22
|
/>
|
|
23
23
|
|
|
24
|
-
<UButton v-if="closeButton" aria-label="Close" v-bind="{ ...ui.default.closeButton, ...closeButton }" :class="ui.input.closeButton" @click="onClear" />
|
|
24
|
+
<UButton v-if="closeButton" aria-label="Close" v-bind="{ ...(ui.default.closeButton || {}), ...closeButton }" :class="ui.input.closeButton.base" @click="onClear" />
|
|
25
25
|
</div>
|
|
26
26
|
|
|
27
27
|
<HComboboxOptions
|
|
@@ -165,11 +165,11 @@ export default defineComponent({
|
|
|
165
165
|
},
|
|
166
166
|
class: {
|
|
167
167
|
type: [String, Object, Array],
|
|
168
|
-
default:
|
|
168
|
+
default: () => ""
|
|
169
169
|
},
|
|
170
170
|
ui: {
|
|
171
171
|
type: Object,
|
|
172
|
-
default:
|
|
172
|
+
default: () => ({})
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
175
|
emits: ["update:modelValue", "close"],
|
|
@@ -205,44 +205,53 @@ export default defineComponent({
|
|
|
205
205
|
const commands2 = [];
|
|
206
206
|
for (const group of props.groups) {
|
|
207
207
|
if (!group.search) {
|
|
208
|
-
commands2.push(...group.commands
|
|
208
|
+
commands2.push(...group.commands?.map((command) => ({ ...command, group: group.key })) || []);
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
return commands2;
|
|
212
212
|
});
|
|
213
213
|
const searchResults = ref({});
|
|
214
214
|
const { results } = useFuse(query, commands, options);
|
|
215
|
+
function getGroupWithCommands(group, commands2) {
|
|
216
|
+
if (!group) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (group.filter && typeof group.filter === "function") {
|
|
220
|
+
commands2 = group.filter(query.value, commands2);
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
...group,
|
|
224
|
+
commands: commands2.slice(0, options.value.resultLimit)
|
|
225
|
+
};
|
|
226
|
+
}
|
|
215
227
|
const groups = computed(() => {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
for (const command of results.value) {
|
|
219
|
-
groupedCommands[command.item.group] ||= [];
|
|
220
|
-
groupedCommands[command.item.group].push(command);
|
|
228
|
+
if (!results.value) {
|
|
229
|
+
return [];
|
|
221
230
|
}
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
return {
|
|
227
|
-
...item,
|
|
228
|
-
...data
|
|
229
|
-
};
|
|
230
|
-
});
|
|
231
|
-
if (group.filter && typeof group.filter === "function") {
|
|
232
|
-
commands2 = group.filter(query.value, commands2);
|
|
231
|
+
const groupedCommands = results.value.reduce((acc, command) => {
|
|
232
|
+
const { item, ...data } = command;
|
|
233
|
+
if (!item.group) {
|
|
234
|
+
return acc;
|
|
233
235
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
groups2.push({ ...group, commands: commands2.slice(0, options.value.resultLimit) });
|
|
236
|
+
acc[item.group] ||= [];
|
|
237
|
+
acc[item.group].push({ ...item, ...data });
|
|
238
|
+
return acc;
|
|
239
|
+
}, {});
|
|
240
|
+
const groups2 = Object.entries(groupedCommands).map(([key, commands2]) => {
|
|
241
|
+
const group = props.groups.find((group2) => group2.key === key);
|
|
242
|
+
if (!group) {
|
|
243
|
+
return null;
|
|
243
244
|
}
|
|
244
|
-
|
|
245
|
-
|
|
245
|
+
return getGroupWithCommands(group, commands2);
|
|
246
|
+
}).filter(Boolean);
|
|
247
|
+
const searchGroups = props.groups.filter((group) => !!group.search && searchResults.value[group.key]?.length).map((group) => {
|
|
248
|
+
const commands2 = searchResults.value[group.key] || [];
|
|
249
|
+
return getGroupWithCommands(group, [...commands2]);
|
|
250
|
+
});
|
|
251
|
+
return [
|
|
252
|
+
...groups2,
|
|
253
|
+
...searchGroups
|
|
254
|
+
];
|
|
246
255
|
});
|
|
247
256
|
const debouncedSearch = useDebounceFn(async () => {
|
|
248
257
|
const searchableGroups = props.groups.filter((group) => !!group.search);
|
|
@@ -270,7 +279,7 @@ export default defineComponent({
|
|
|
270
279
|
return twJoin(
|
|
271
280
|
ui.value.input.icon.base,
|
|
272
281
|
ui.value.input.icon.size,
|
|
273
|
-
(props.loading || isLoading.value) && props.loadingIcon &&
|
|
282
|
+
(props.loading || isLoading.value) && props.loadingIcon && ui.value.input.icon.loading
|
|
274
283
|
);
|
|
275
284
|
});
|
|
276
285
|
const emptyState = computed(() => ({ ...ui.value.default.emptyState, ...props.emptyState }));
|
|
@@ -84,18 +84,25 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
84
84
|
};
|
|
85
85
|
class: {
|
|
86
86
|
type: PropType<any>;
|
|
87
|
-
default:
|
|
87
|
+
default: () => string;
|
|
88
88
|
};
|
|
89
89
|
ui: {
|
|
90
|
-
type: PropType<
|
|
91
|
-
default:
|
|
90
|
+
type: PropType<any>;
|
|
91
|
+
default: () => {};
|
|
92
92
|
};
|
|
93
93
|
}, {
|
|
94
94
|
ui: ComputedRef<any>;
|
|
95
95
|
attrs: ComputedRef<Pick<{
|
|
96
96
|
[x: string]: unknown;
|
|
97
97
|
}, string>>;
|
|
98
|
-
groups: ComputedRef<Group
|
|
98
|
+
groups: ComputedRef<(Group | {
|
|
99
|
+
commands: Command[];
|
|
100
|
+
key: string;
|
|
101
|
+
active?: string | undefined;
|
|
102
|
+
inactive?: string | undefined;
|
|
103
|
+
search?: Function | undefined;
|
|
104
|
+
filter?: Function | undefined;
|
|
105
|
+
} | undefined)[]>;
|
|
99
106
|
comboboxInput: import("vue").Ref<ComponentPublicInstance<HTMLInputElement> | undefined>;
|
|
100
107
|
query: import("vue").Ref<string>;
|
|
101
108
|
iconName: ComputedRef<string | undefined>;
|
|
@@ -186,17 +193,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
186
193
|
};
|
|
187
194
|
class: {
|
|
188
195
|
type: PropType<any>;
|
|
189
|
-
default:
|
|
196
|
+
default: () => string;
|
|
190
197
|
};
|
|
191
198
|
ui: {
|
|
192
|
-
type: PropType<
|
|
193
|
-
default:
|
|
199
|
+
type: PropType<any>;
|
|
200
|
+
default: () => {};
|
|
194
201
|
};
|
|
195
202
|
}>> & {
|
|
196
203
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
197
204
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
198
205
|
}, {
|
|
199
|
-
ui:
|
|
206
|
+
ui: any;
|
|
200
207
|
icon: string;
|
|
201
208
|
closeButton: Button;
|
|
202
209
|
class: any;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:size="size"
|
|
7
7
|
:disabled="!canGoFirstOrPrev"
|
|
8
8
|
:class="[ui.base, ui.rounded]"
|
|
9
|
-
v-bind="{ ...ui.default.firstButton, ...firstButton }"
|
|
9
|
+
v-bind="{ ...(ui.default.firstButton || {}), ...firstButton }"
|
|
10
10
|
:ui="{ rounded: '' }"
|
|
11
11
|
aria-label="First"
|
|
12
12
|
@click="onClickFirst"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
:size="size"
|
|
20
20
|
:disabled="!canGoFirstOrPrev"
|
|
21
21
|
:class="[ui.base, ui.rounded]"
|
|
22
|
-
v-bind="{ ...ui.default.prevButton, ...prevButton }"
|
|
22
|
+
v-bind="{ ...(ui.default.prevButton || {}), ...prevButton }"
|
|
23
23
|
:ui="{ rounded: '' }"
|
|
24
24
|
aria-label="Prev"
|
|
25
25
|
@click="onClickPrev"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
:key="`${page}-${index}`"
|
|
32
32
|
:size="size"
|
|
33
33
|
:label="`${page}`"
|
|
34
|
-
v-bind="page === currentPage ? { ...ui.default.activeButton, ...activeButton } : { ...ui.default.inactiveButton, ...inactiveButton }"
|
|
34
|
+
v-bind="page === currentPage ? { ...(ui.default.activeButton || {}), ...activeButton } : { ...(ui.default.inactiveButton || {}), ...inactiveButton }"
|
|
35
35
|
:class="[{ 'pointer-events-none': typeof page === 'string', 'z-[1]': page === currentPage }, ui.base, ui.rounded]"
|
|
36
36
|
:ui="{ rounded: '' }"
|
|
37
37
|
@click="() => onClickPage(page)"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
:size="size"
|
|
44
44
|
:disabled="!canGoLastOrNext"
|
|
45
45
|
:class="[ui.base, ui.rounded]"
|
|
46
|
-
v-bind="{ ...ui.default.nextButton, ...nextButton }"
|
|
46
|
+
v-bind="{ ...(ui.default.nextButton || {}), ...nextButton }"
|
|
47
47
|
:ui="{ rounded: '' }"
|
|
48
48
|
aria-label="Next"
|
|
49
49
|
@click="onClickNext"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
:size="size"
|
|
57
57
|
:disabled="!canGoLastOrNext"
|
|
58
58
|
:class="[ui.base, ui.rounded]"
|
|
59
|
-
v-bind="{ ...ui.default.lastButton, ...lastButton }"
|
|
59
|
+
v-bind="{ ...(ui.default.lastButton || {}), ...lastButton }"
|
|
60
60
|
:ui="{ rounded: '' }"
|
|
61
61
|
aria-label="Last"
|
|
62
62
|
@click="onClickLast"
|
|
@@ -144,11 +144,11 @@ export default defineComponent({
|
|
|
144
144
|
},
|
|
145
145
|
class: {
|
|
146
146
|
type: [String, Object, Array],
|
|
147
|
-
default:
|
|
147
|
+
default: () => ""
|
|
148
148
|
},
|
|
149
149
|
ui: {
|
|
150
150
|
type: Object,
|
|
151
|
-
default:
|
|
151
|
+
default: () => ({})
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
154
|
emits: ["update:modelValue"],
|
|
@@ -61,11 +61,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
61
61
|
};
|
|
62
62
|
class: {
|
|
63
63
|
type: PropType<any>;
|
|
64
|
-
default:
|
|
64
|
+
default: () => "";
|
|
65
65
|
};
|
|
66
66
|
ui: {
|
|
67
|
-
type: PropType<
|
|
68
|
-
default:
|
|
67
|
+
type: PropType<any>;
|
|
68
|
+
default: () => {};
|
|
69
69
|
};
|
|
70
70
|
}, {
|
|
71
71
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -143,17 +143,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
143
143
|
};
|
|
144
144
|
class: {
|
|
145
145
|
type: PropType<any>;
|
|
146
|
-
default:
|
|
146
|
+
default: () => "";
|
|
147
147
|
};
|
|
148
148
|
ui: {
|
|
149
|
-
type: PropType<
|
|
150
|
-
default:
|
|
149
|
+
type: PropType<any>;
|
|
150
|
+
default: () => {};
|
|
151
151
|
};
|
|
152
152
|
}>> & {
|
|
153
153
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
154
154
|
}, {
|
|
155
155
|
size: ButtonSize;
|
|
156
|
-
ui:
|
|
156
|
+
ui: any;
|
|
157
157
|
class: any;
|
|
158
158
|
max: number;
|
|
159
159
|
divider: string;
|
|
@@ -86,11 +86,11 @@ export default defineComponent({
|
|
|
86
86
|
},
|
|
87
87
|
class: {
|
|
88
88
|
type: [String, Object, Array],
|
|
89
|
-
default:
|
|
89
|
+
default: () => ""
|
|
90
90
|
},
|
|
91
91
|
ui: {
|
|
92
92
|
type: Object,
|
|
93
|
-
default:
|
|
93
|
+
default: () => ({})
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
emits: ["update:modelValue", "change"],
|
|
@@ -105,6 +105,9 @@ export default defineComponent({
|
|
|
105
105
|
if (!tab) {
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
|
+
if (!markerRef.value) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
108
111
|
markerRef.value.style.top = `${tab.offsetTop}px`;
|
|
109
112
|
markerRef.value.style.left = `${tab.offsetLeft}px`;
|
|
110
113
|
markerRef.value.style.width = `${tab.offsetWidth}px`;
|
|
@@ -114,16 +117,16 @@ export default defineComponent({
|
|
|
114
117
|
selectedIndex.value = index;
|
|
115
118
|
emit("change", index);
|
|
116
119
|
if (props.modelValue !== void 0) {
|
|
117
|
-
emit("update:modelValue",
|
|
120
|
+
emit("update:modelValue", selectedIndex.value);
|
|
118
121
|
}
|
|
119
|
-
calcMarkerSize(
|
|
122
|
+
calcMarkerSize(selectedIndex.value);
|
|
120
123
|
}
|
|
121
124
|
useResizeObserver(listRef, () => {
|
|
122
125
|
calcMarkerSize(selectedIndex.value);
|
|
123
126
|
});
|
|
124
127
|
watch(() => props.modelValue, (value) => {
|
|
125
128
|
selectedIndex.value = value;
|
|
126
|
-
calcMarkerSize(value);
|
|
129
|
+
calcMarkerSize(selectedIndex.value);
|
|
127
130
|
});
|
|
128
131
|
onMounted(() => calcMarkerSize(selectedIndex.value));
|
|
129
132
|
return {
|