@nuxt/ui 2.11.0 → 2.12.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/module.d.mts +294 -48
- package/dist/module.d.ts +294 -48
- package/dist/module.json +1 -1
- package/dist/module.mjs +6 -4
- package/dist/runtime/components/data/Table.vue +29 -21
- package/dist/runtime/components/data/Table.vue.d.ts +28 -19
- package/dist/runtime/components/elements/Accordion.vue +10 -6
- package/dist/runtime/components/elements/Accordion.vue.d.ts +11 -11
- package/dist/runtime/components/elements/Alert.vue +12 -6
- package/dist/runtime/components/elements/Alert.vue.d.ts +12 -17
- 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 +9 -8
- 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 +9 -9
- package/dist/runtime/components/elements/Dropdown.vue +68 -19
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +37 -9
- 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/Link.vue +2 -2
- 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 +17 -8
- package/dist/runtime/components/forms/Form.vue.d.ts +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 +8 -8
- package/dist/runtime/components/forms/Input.vue.d.ts +11 -11
- package/dist/runtime/components/forms/InputMenu.vue +410 -0
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +331 -0
- 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 +5 -5
- 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 +8 -8
- package/dist/runtime/components/forms/Select.vue.d.ts +10 -10
- package/dist/runtime/components/forms/SelectMenu.vue +69 -36
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +40 -20
- 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 +10 -10
- package/dist/runtime/components/forms/Toggle.vue.d.ts +16 -15
- 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 +9 -6
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +10 -7
- package/dist/runtime/components/navigation/CommandPalette.vue +42 -33
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +16 -9
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +1 -3
- package/dist/runtime/components/navigation/Pagination.vue +16 -11
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +16 -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 +56 -39
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +14 -10
- 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 +8 -8
- 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 +54 -17
- package/dist/runtime/components/overlays/Popover.vue.d.ts +21 -11
- package/dist/runtime/components/overlays/Slideover.vue +6 -6
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +8 -8
- 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/useShortcuts.mjs +3 -1
- package/dist/runtime/composables/useUI.d.ts +3 -3
- package/dist/runtime/types/alert.d.ts +5 -0
- package/dist/runtime/types/breadcrumb.d.ts +3 -0
- package/dist/runtime/types/dropdown.d.ts +2 -0
- package/dist/runtime/types/form.d.ts +2 -1
- package/dist/runtime/types/popper.d.ts +2 -0
- package/dist/runtime/types/utils.d.ts +4 -4
- package/dist/runtime/types/vertical-navigation.d.ts +1 -0
- 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 +14 -12
- package/dist/runtime/ui.config/forms/inputMenu.d.ts +64 -0
- package/dist/runtime/ui.config/forms/inputMenu.mjs +62 -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 +18 -11
- package/dist/runtime/ui.config/forms/selectMenu.mjs +12 -41
- 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/index.d.ts +1 -0
- package/dist/runtime/ui.config/index.mjs +1 -0
- package/dist/runtime/ui.config/layout/card.mjs +1 -1
- 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.d.ts +1 -0
- package/dist/runtime/ui.config/navigation/breadcrumb.mjs +2 -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 +6 -1
- package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +5 -0
- 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/popper.mjs +9 -0
- package/dist/runtime/ui.css +1 -13
- package/dist/runtime/utils/index.mjs +11 -3
- package/dist/runtime/utils/uid.mjs +2 -1
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +29 -28
- package/dist/runtime/ui.config/_popperArrow.mjs +0 -8
|
@@ -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,13 +49,13 @@ 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>;
|
|
56
56
|
onIconClass: import("vue").ComputedRef<string>;
|
|
57
57
|
offIconClass: import("vue").ComputedRef<string>;
|
|
58
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
58
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
59
59
|
id: {
|
|
60
60
|
type: StringConstructor;
|
|
61
61
|
default: null;
|
|
@@ -85,24 +85,25 @@ 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
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
103
104
|
}, {
|
|
104
105
|
size: ToggleSize;
|
|
105
|
-
ui:
|
|
106
|
+
ui: any;
|
|
106
107
|
id: string;
|
|
107
108
|
color: any;
|
|
108
109
|
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;
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
<ULink
|
|
6
6
|
as="span"
|
|
7
7
|
:class="[ui.base, index === links.length - 1 ? ui.active : !!link.to ? ui.inactive : '']"
|
|
8
|
-
v-bind="omit(link, ['label', 'icon', 'iconClass'])"
|
|
8
|
+
v-bind="omit(link, ['label', 'labelClass', 'icon', 'iconClass'])"
|
|
9
9
|
:aria-current="index === links.length - 1 ? 'page' : undefined"
|
|
10
10
|
>
|
|
11
11
|
<slot name="icon" :link="link" :index="index" :is-active="index === links.length - 1">
|
|
12
12
|
<UIcon
|
|
13
13
|
v-if="link.icon"
|
|
14
14
|
:name="link.icon"
|
|
15
|
-
:class="
|
|
15
|
+
:class="twMerge(twJoin(ui.icon.base, index === links.length - 1 ? ui.icon.active : !!link.to ? ui.icon.inactive : ''), link.iconClass)"
|
|
16
16
|
/>
|
|
17
17
|
</slot>
|
|
18
18
|
|
|
19
19
|
<slot :link="link" :index="index" :is-active="index === links.length - 1">
|
|
20
|
-
{{ link.label }}
|
|
20
|
+
<span v-if="link.label" :class="twMerge(ui.label, link.labelClass)">{{ link.label }}</span>
|
|
21
21
|
</slot>
|
|
22
22
|
</ULink>
|
|
23
23
|
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
<script>
|
|
36
36
|
import { defineComponent, toRef } from "vue";
|
|
37
|
+
import { twMerge, twJoin } from "tailwind-merge";
|
|
37
38
|
import UIcon from "../elements/Icon.vue";
|
|
38
39
|
import ULink from "../elements/Link.vue";
|
|
39
40
|
import { useUI } from "../../composables/useUI";
|
|
@@ -58,11 +59,11 @@ export default defineComponent({
|
|
|
58
59
|
},
|
|
59
60
|
class: {
|
|
60
61
|
type: [String, Object, Array],
|
|
61
|
-
default:
|
|
62
|
+
default: () => ""
|
|
62
63
|
},
|
|
63
64
|
ui: {
|
|
64
65
|
type: Object,
|
|
65
|
-
default:
|
|
66
|
+
default: () => ({})
|
|
66
67
|
}
|
|
67
68
|
},
|
|
68
69
|
setup(props) {
|
|
@@ -71,7 +72,9 @@ export default defineComponent({
|
|
|
71
72
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
72
73
|
ui,
|
|
73
74
|
attrs,
|
|
74
|
-
omit
|
|
75
|
+
omit,
|
|
76
|
+
twMerge,
|
|
77
|
+
twJoin
|
|
75
78
|
};
|
|
76
79
|
}
|
|
77
80
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
+
import { twJoin } from 'tailwind-merge';
|
|
2
3
|
import { omit } from '../../utils';
|
|
3
4
|
import type { BreadcrumbLink } from '../../types';
|
|
4
5
|
declare const _default: import("vue").DefineComponent<{
|
|
@@ -12,11 +13,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
12
13
|
};
|
|
13
14
|
class: {
|
|
14
15
|
type: PropType<any>;
|
|
15
|
-
default:
|
|
16
|
+
default: () => string;
|
|
16
17
|
};
|
|
17
18
|
ui: {
|
|
18
|
-
type: PropType<
|
|
19
|
-
default:
|
|
19
|
+
type: PropType<any>;
|
|
20
|
+
default: () => {};
|
|
20
21
|
};
|
|
21
22
|
}, {
|
|
22
23
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -24,6 +25,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
25
|
[x: string]: unknown;
|
|
25
26
|
}, string>>;
|
|
26
27
|
omit: typeof omit;
|
|
28
|
+
twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
|
|
29
|
+
twJoin: typeof twJoin;
|
|
27
30
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
31
|
links: {
|
|
29
32
|
type: PropType<BreadcrumbLink[]>;
|
|
@@ -35,14 +38,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
35
38
|
};
|
|
36
39
|
class: {
|
|
37
40
|
type: PropType<any>;
|
|
38
|
-
default:
|
|
41
|
+
default: () => string;
|
|
39
42
|
};
|
|
40
43
|
ui: {
|
|
41
|
-
type: PropType<
|
|
42
|
-
default:
|
|
44
|
+
type: PropType<any>;
|
|
45
|
+
default: () => {};
|
|
43
46
|
};
|
|
44
47
|
}>>, {
|
|
45
|
-
ui:
|
|
48
|
+
ui: any;
|
|
46
49
|
class: any;
|
|
47
50
|
divider: string;
|
|
48
51
|
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;
|
|
@@ -213,8 +220,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
213
220
|
loadingIcon: string;
|
|
214
221
|
nullable: boolean;
|
|
215
222
|
selectedIcon: string;
|
|
216
|
-
searchable: boolean;
|
|
217
223
|
debounce: number;
|
|
224
|
+
searchable: boolean;
|
|
218
225
|
groups: Group[];
|
|
219
226
|
groupAttribute: string;
|
|
220
227
|
commandAttribute: string;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<UButton
|
|
5
5
|
v-if="firstButton && showFirst"
|
|
6
6
|
:size="size"
|
|
7
|
-
:disabled="!canGoFirstOrPrev"
|
|
7
|
+
:disabled="!canGoFirstOrPrev || disabled"
|
|
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"
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
<UButton
|
|
18
18
|
v-if="prevButton"
|
|
19
19
|
:size="size"
|
|
20
|
-
:disabled="!canGoFirstOrPrev"
|
|
20
|
+
:disabled="!canGoFirstOrPrev || disabled"
|
|
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"
|
|
@@ -30,8 +30,9 @@
|
|
|
30
30
|
v-for="(page, index) of displayedPages"
|
|
31
31
|
:key="`${page}-${index}`"
|
|
32
32
|
:size="size"
|
|
33
|
+
:disabled="disabled"
|
|
33
34
|
:label="`${page}`"
|
|
34
|
-
v-bind="page === currentPage ? { ...ui.default.activeButton, ...activeButton } : { ...ui.default.inactiveButton, ...inactiveButton }"
|
|
35
|
+
v-bind="page === currentPage ? { ...(ui.default.activeButton || {}), ...activeButton } : { ...(ui.default.inactiveButton || {}), ...inactiveButton }"
|
|
35
36
|
:class="[{ 'pointer-events-none': typeof page === 'string', 'z-[1]': page === currentPage }, ui.base, ui.rounded]"
|
|
36
37
|
:ui="{ rounded: '' }"
|
|
37
38
|
@click="() => onClickPage(page)"
|
|
@@ -41,9 +42,9 @@
|
|
|
41
42
|
<UButton
|
|
42
43
|
v-if="nextButton"
|
|
43
44
|
:size="size"
|
|
44
|
-
:disabled="!canGoLastOrNext"
|
|
45
|
+
:disabled="!canGoLastOrNext || disabled"
|
|
45
46
|
:class="[ui.base, ui.rounded]"
|
|
46
|
-
v-bind="{ ...ui.default.nextButton, ...nextButton }"
|
|
47
|
+
v-bind="{ ...(ui.default.nextButton || {}), ...nextButton }"
|
|
47
48
|
:ui="{ rounded: '' }"
|
|
48
49
|
aria-label="Next"
|
|
49
50
|
@click="onClickNext"
|
|
@@ -54,9 +55,9 @@
|
|
|
54
55
|
<UButton
|
|
55
56
|
v-if="lastButton && showLast"
|
|
56
57
|
:size="size"
|
|
57
|
-
:disabled="!canGoLastOrNext"
|
|
58
|
+
:disabled="!canGoLastOrNext || disabled"
|
|
58
59
|
:class="[ui.base, ui.rounded]"
|
|
59
|
-
v-bind="{ ...ui.default.lastButton, ...lastButton }"
|
|
60
|
+
v-bind="{ ...(ui.default.lastButton || {}), ...lastButton }"
|
|
60
61
|
:ui="{ rounded: '' }"
|
|
61
62
|
aria-label="Last"
|
|
62
63
|
@click="onClickLast"
|
|
@@ -99,6 +100,10 @@ export default defineComponent({
|
|
|
99
100
|
return value >= 5 && value < Number.MAX_VALUE;
|
|
100
101
|
}
|
|
101
102
|
},
|
|
103
|
+
disabled: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: false
|
|
106
|
+
},
|
|
102
107
|
size: {
|
|
103
108
|
type: String,
|
|
104
109
|
default: () => config.default.size,
|
|
@@ -144,11 +149,11 @@ export default defineComponent({
|
|
|
144
149
|
},
|
|
145
150
|
class: {
|
|
146
151
|
type: [String, Object, Array],
|
|
147
|
-
default:
|
|
152
|
+
default: () => ""
|
|
148
153
|
},
|
|
149
154
|
ui: {
|
|
150
155
|
type: Object,
|
|
151
|
-
default:
|
|
156
|
+
default: () => ({})
|
|
152
157
|
}
|
|
153
158
|
},
|
|
154
159
|
emits: ["update:modelValue"],
|