@nuxt/ui 2.10.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/README.md +11 -0
- package/dist/module.d.mts +387 -104
- package/dist/module.d.ts +387 -104
- package/dist/module.json +1 -1
- package/dist/module.mjs +16 -7
- 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 +13 -12
- package/dist/runtime/components/elements/Alert.vue.d.ts +12 -11
- package/dist/runtime/components/elements/Avatar.vue +2 -2
- package/dist/runtime/components/elements/Avatar.vue.d.ts +11 -10
- package/dist/runtime/components/elements/AvatarGroup.d.ts +11 -10
- package/dist/runtime/components/elements/AvatarGroup.mjs +2 -2
- package/dist/runtime/components/elements/Badge.vue +6 -4
- package/dist/runtime/components/elements/Badge.vue.d.ts +11 -11
- package/dist/runtime/components/elements/Button.vue +16 -12
- package/dist/runtime/components/elements/Button.vue.d.ts +13 -12
- package/dist/runtime/components/elements/ButtonGroup.d.ts +12 -11
- package/dist/runtime/components/elements/ButtonGroup.mjs +8 -34
- package/dist/runtime/components/elements/Chip.vue +85 -0
- package/dist/runtime/components/elements/Chip.vue.d.ts +90 -0
- package/dist/runtime/components/elements/Dropdown.vue +35 -21
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +13 -7
- package/dist/runtime/components/elements/Icon.vue +16 -2
- package/dist/runtime/components/elements/Icon.vue.d.ts +14 -2
- package/dist/runtime/components/elements/Kbd.vue +2 -2
- package/dist/runtime/components/elements/Kbd.vue.d.ts +12 -11
- package/dist/runtime/components/elements/Link.vue +2 -5
- package/dist/runtime/components/elements/Meter.vue +2 -2
- package/dist/runtime/components/elements/Meter.vue.d.ts +9 -9
- package/dist/runtime/components/elements/MeterGroup.d.ts +10 -10
- package/dist/runtime/components/elements/MeterGroup.mjs +8 -21
- package/dist/runtime/components/elements/Progress.vue +6 -95
- package/dist/runtime/components/elements/Progress.vue.d.ts +123 -1
- package/dist/runtime/components/forms/Checkbox.vue +8 -10
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +10 -10
- package/dist/runtime/components/forms/Form.vue +1 -1
- package/dist/runtime/components/forms/FormGroup.vue +9 -5
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +21 -11
- package/dist/runtime/components/forms/Input.vue +43 -12
- package/dist/runtime/components/forms/Input.vue.d.ts +38 -15
- package/dist/runtime/components/forms/Radio.vue +18 -12
- package/dist/runtime/components/forms/Radio.vue.d.ts +11 -10
- package/dist/runtime/components/forms/RadioGroup.vue +3 -3
- 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 +11 -10
- package/dist/runtime/components/forms/Select.vue +12 -9
- package/dist/runtime/components/forms/Select.vue.d.ts +15 -14
- package/dist/runtime/components/forms/SelectMenu.vue +42 -25
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +28 -19
- package/dist/runtime/components/forms/Textarea.vue +36 -6
- package/dist/runtime/components/forms/Textarea.vue.d.ts +37 -14
- package/dist/runtime/components/forms/Toggle.vue +25 -7
- package/dist/runtime/components/forms/Toggle.vue.d.ts +20 -7
- 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 +9 -9
- 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 +78 -0
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +50 -0
- package/dist/runtime/components/navigation/CommandPalette.vue +50 -37
- 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 +11 -11
- package/dist/runtime/components/navigation/Tabs.vue +8 -5
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +10 -10
- 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 +30 -31
- package/dist/runtime/components/overlays/Notification.vue.d.ts +10 -9
- package/dist/runtime/components/overlays/Notifications.vue +18 -16
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Popover.vue +14 -4
- package/dist/runtime/components/overlays/Popover.vue.d.ts +20 -9
- 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/defineShortcuts.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.mjs +8 -4
- package/dist/runtime/composables/useButtonGroup.d.ts +20 -0
- package/dist/runtime/composables/useButtonGroup.mjs +52 -0
- package/dist/runtime/composables/useFormGroup.d.ts +2 -0
- package/dist/runtime/composables/useFormGroup.mjs +3 -2
- package/dist/runtime/composables/useShortcuts.d.ts +2 -2
- package/dist/runtime/composables/useUI.d.ts +3 -3
- package/dist/runtime/types/alert.d.ts +7 -0
- package/dist/runtime/types/avatar.d.ts +3 -1
- package/dist/runtime/types/badge.d.ts +5 -4
- package/dist/runtime/types/breadcrumb.d.ts +9 -0
- package/dist/runtime/types/button.d.ts +5 -4
- package/dist/runtime/types/chip.d.ts +11 -0
- package/dist/runtime/types/dropdown.d.ts +2 -2
- package/dist/runtime/types/form-group.d.ts +5 -0
- package/dist/runtime/types/form.d.ts +3 -2
- package/dist/runtime/types/index.d.ts +10 -0
- package/dist/runtime/types/input.d.ts +8 -0
- package/dist/runtime/types/kbd.d.ts +5 -0
- package/dist/runtime/types/popper.d.ts +2 -0
- package/dist/runtime/types/range.d.ts +5 -0
- package/dist/runtime/types/select.d.ts +8 -0
- package/dist/runtime/types/textarea.d.ts +8 -0
- package/dist/runtime/types/toggle.d.ts +5 -0
- package/dist/runtime/types/utils.d.ts +24 -7
- package/dist/runtime/ui.config/data/table.d.ts +60 -0
- package/dist/runtime/ui.config/data/table.mjs +59 -0
- package/dist/runtime/ui.config/elements/accordion.d.ts +21 -0
- package/dist/runtime/ui.config/elements/accordion.mjs +20 -0
- package/dist/runtime/ui.config/elements/alert.d.ts +41 -0
- package/dist/runtime/ui.config/elements/alert.mjs +40 -0
- package/dist/runtime/ui.config/elements/avatar.d.ts +60 -0
- package/dist/runtime/ui.config/elements/avatar.mjs +59 -0
- package/dist/runtime/ui.config/elements/avatarGroup.d.ts +6 -0
- package/dist/runtime/ui.config/elements/avatarGroup.mjs +5 -0
- package/dist/runtime/ui.config/elements/badge.d.ts +34 -0
- package/dist/runtime/ui.config/elements/badge.mjs +33 -0
- package/dist/runtime/ui.config/elements/button.d.ts +81 -0
- package/dist/runtime/ui.config/elements/button.mjs +80 -0
- package/dist/runtime/ui.config/elements/buttonGroup.d.ts +101 -0
- package/dist/runtime/ui.config/elements/buttonGroup.mjs +19 -0
- package/dist/runtime/ui.config/elements/chip.d.ts +35 -0
- package/dist/runtime/ui.config/elements/chip.mjs +34 -0
- package/dist/runtime/ui.config/elements/dropdown.d.ts +55 -0
- package/dist/runtime/ui.config/elements/dropdown.mjs +53 -0
- package/dist/runtime/ui.config/elements/kbd.d.ts +17 -0
- package/dist/runtime/ui.config/elements/kbd.mjs +16 -0
- package/dist/runtime/ui.config/elements/meter.d.ts +77 -0
- package/dist/runtime/ui.config/elements/meter.mjs +76 -0
- package/dist/runtime/ui.config/elements/meterGroup.d.ts +52 -0
- package/dist/runtime/ui.config/elements/meterGroup.mjs +24 -0
- package/dist/runtime/ui.config/elements/progress.d.ts +75 -0
- package/dist/runtime/ui.config/elements/progress.mjs +74 -0
- package/dist/runtime/ui.config/forms/checkbox.d.ts +19 -0
- package/dist/runtime/ui.config/forms/checkbox.mjs +18 -0
- package/dist/runtime/ui.config/forms/formGroup.d.ts +25 -0
- package/dist/runtime/ui.config/forms/formGroup.mjs +25 -0
- package/dist/runtime/ui.config/forms/input.d.ts +107 -0
- package/dist/runtime/ui.config/forms/input.mjs +106 -0
- package/dist/runtime/ui.config/forms/radio.d.ts +18 -0
- package/dist/runtime/ui.config/forms/radio.mjs +17 -0
- package/dist/runtime/ui.config/forms/radioGroup.d.ts +8 -0
- package/dist/runtime/ui.config/forms/radioGroup.mjs +7 -0
- package/dist/runtime/ui.config/forms/range.d.ts +64 -0
- package/dist/runtime/ui.config/forms/range.mjs +63 -0
- package/dist/runtime/ui.config/forms/select.d.ts +108 -0
- package/dist/runtime/ui.config/forms/select.mjs +13 -0
- package/dist/runtime/ui.config/forms/selectMenu.d.ts +68 -0
- package/dist/runtime/ui.config/forms/selectMenu.mjs +66 -0
- package/dist/runtime/ui.config/forms/textarea.d.ts +106 -0
- package/dist/runtime/ui.config/forms/textarea.mjs +10 -0
- package/dist/runtime/ui.config/forms/toggle.d.ts +61 -0
- package/dist/runtime/ui.config/forms/toggle.mjs +60 -0
- package/dist/runtime/ui.config/index.d.ts +40 -0
- package/dist/runtime/ui.config/index.mjs +40 -0
- package/dist/runtime/ui.config/layout/card.d.ts +24 -0
- package/dist/runtime/ui.config/layout/card.mjs +23 -0
- package/dist/runtime/ui.config/layout/container.d.ts +6 -0
- package/dist/runtime/ui.config/layout/container.mjs +5 -0
- package/dist/runtime/ui.config/layout/divider.d.ts +35 -0
- package/dist/runtime/ui.config/layout/divider.mjs +34 -0
- package/dist/runtime/ui.config/layout/skeleton.d.ts +6 -0
- package/dist/runtime/ui.config/layout/skeleton.mjs +5 -0
- package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +20 -0
- package/dist/runtime/ui.config/navigation/breadcrumb.mjs +19 -0
- package/dist/runtime/ui.config/navigation/commandPalette.d.ts +72 -0
- package/dist/runtime/ui.config/navigation/commandPalette.mjs +71 -0
- package/dist/runtime/ui.config/navigation/pagination.d.ts +35 -0
- package/dist/runtime/ui.config/navigation/pagination.mjs +34 -0
- package/dist/runtime/ui.config/navigation/tabs.d.ts +34 -0
- package/dist/runtime/ui.config/navigation/tabs.mjs +33 -0
- package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +28 -0
- package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +27 -0
- package/dist/runtime/ui.config/overlays/contextMenu.d.ts +31 -0
- package/dist/runtime/ui.config/overlays/contextMenu.mjs +25 -0
- package/dist/runtime/ui.config/overlays/modal.d.ts +36 -0
- package/dist/runtime/ui.config/overlays/modal.mjs +37 -0
- package/dist/runtime/ui.config/overlays/notification.d.ts +50 -0
- package/dist/runtime/ui.config/overlays/notification.mjs +50 -0
- package/dist/runtime/ui.config/overlays/notifications.d.ts +7 -0
- package/dist/runtime/ui.config/overlays/notifications.mjs +6 -0
- package/dist/runtime/ui.config/overlays/popover.d.ts +43 -0
- package/dist/runtime/ui.config/overlays/popover.mjs +37 -0
- package/dist/runtime/ui.config/overlays/slideover.d.ts +32 -0
- package/dist/runtime/ui.config/overlays/slideover.mjs +33 -0
- package/dist/runtime/ui.config/overlays/tooltip.d.ts +33 -0
- package/dist/runtime/ui.config/overlays/tooltip.mjs +27 -0
- package/dist/runtime/ui.config/popper.d.ts +8 -0
- package/dist/runtime/ui.config/popper.mjs +8 -0
- package/dist/runtime/ui.css +1 -13
- package/dist/runtime/utils/index.d.ts +5 -0
- package/dist/runtime/utils/index.mjs +7 -3
- package/dist/types.d.mts +3 -2
- package/dist/types.d.ts +3 -2
- package/package.json +32 -21
- package/dist/runtime/ui.config.d.ts +0 -1470
- package/dist/runtime/ui.config.mjs +0 -1273
|
@@ -2,40 +2,38 @@
|
|
|
2
2
|
<Transition appear v-bind="ui.transition">
|
|
3
3
|
<div
|
|
4
4
|
:class="wrapperClass"
|
|
5
|
-
role="status"
|
|
5
|
+
role="status"
|
|
6
6
|
v-bind="attrs"
|
|
7
|
-
@mouseover="onMouseover"
|
|
7
|
+
@mouseover="onMouseover"
|
|
8
8
|
@mouseleave="onMouseleave"
|
|
9
9
|
>
|
|
10
10
|
<div :class="[ui.container, ui.rounded, ui.ring]">
|
|
11
|
-
<div :class="ui.padding">
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
<UAvatar v-if="avatar" v-bind="{ size: ui.avatar.size, ...avatar }" :class="ui.avatar.base" />
|
|
11
|
+
<div class="flex" :class="[ui.padding, ui.gap, { 'items-start': description || $slots.description, 'items-center': !description && !$slots.description }]">
|
|
12
|
+
<UIcon v-if="icon" :name="icon" :class="iconClass" />
|
|
13
|
+
<UAvatar v-if="avatar" v-bind="{ size: ui.avatar.size, ...avatar }" :class="ui.avatar.base" />
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
<div :class="ui.inner">
|
|
16
|
+
<p :class="ui.title">
|
|
17
|
+
<slot name="title" :title="title">
|
|
18
|
+
{{ title }}
|
|
19
|
+
</slot>
|
|
20
|
+
</p>
|
|
21
|
+
<p v-if="(description || $slots.description)" :class="ui.description">
|
|
22
|
+
<slot name="description" :description="description">
|
|
23
|
+
{{ description }}
|
|
24
|
+
</slot>
|
|
25
|
+
</p>
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</div>
|
|
27
|
+
<div v-if="(description || $slots.description) && actions.length" :class="ui.actions">
|
|
28
|
+
<UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="onAction(action)" />
|
|
31
29
|
</div>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
</div>
|
|
31
|
+
<div v-if="closeButton || (!description && !$slots.description && actions.length)" :class="twMerge(ui.actions, 'mt-0')">
|
|
32
|
+
<template v-if="!description && !$slots.description && actions.length">
|
|
33
|
+
<UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="onAction(action)" />
|
|
34
|
+
</template>
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
</div>
|
|
36
|
+
<UButton v-if="closeButton" aria-label="Close" v-bind="{ ...(ui.default.closeButton || {}), ...closeButton }" @click.stop="onClose" />
|
|
39
37
|
</div>
|
|
40
38
|
</div>
|
|
41
39
|
<div v-if="timeout" :class="progressClass" :style="progressStyle" />
|
|
@@ -90,7 +88,7 @@ export default defineComponent({
|
|
|
90
88
|
},
|
|
91
89
|
timeout: {
|
|
92
90
|
type: Number,
|
|
93
|
-
default:
|
|
91
|
+
default: () => config.default.timeout
|
|
94
92
|
},
|
|
95
93
|
actions: {
|
|
96
94
|
type: Array,
|
|
@@ -109,11 +107,11 @@ export default defineComponent({
|
|
|
109
107
|
},
|
|
110
108
|
class: {
|
|
111
109
|
type: [String, Object, Array],
|
|
112
|
-
default:
|
|
110
|
+
default: () => ""
|
|
113
111
|
},
|
|
114
112
|
ui: {
|
|
115
113
|
type: Object,
|
|
116
|
-
default:
|
|
114
|
+
default: () => ({})
|
|
117
115
|
}
|
|
118
116
|
},
|
|
119
117
|
emits: ["close"],
|
|
@@ -124,7 +122,7 @@ export default defineComponent({
|
|
|
124
122
|
const wrapperClass = computed(() => {
|
|
125
123
|
return twMerge(twJoin(
|
|
126
124
|
ui.value.wrapper,
|
|
127
|
-
ui.value.background,
|
|
125
|
+
ui.value.background?.replaceAll("{color}", props.color),
|
|
128
126
|
ui.value.rounded,
|
|
129
127
|
ui.value.shadow
|
|
130
128
|
), props.class);
|
|
@@ -200,7 +198,8 @@ export default defineComponent({
|
|
|
200
198
|
onMouseover,
|
|
201
199
|
onMouseleave,
|
|
202
200
|
onClose,
|
|
203
|
-
onAction
|
|
201
|
+
onAction,
|
|
202
|
+
twMerge
|
|
204
203
|
};
|
|
205
204
|
}
|
|
206
205
|
});
|
|
@@ -27,7 +27,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
27
|
};
|
|
28
28
|
timeout: {
|
|
29
29
|
type: NumberConstructor;
|
|
30
|
-
default:
|
|
30
|
+
default: () => any;
|
|
31
31
|
};
|
|
32
32
|
actions: {
|
|
33
33
|
type: PropType<NotificationAction[]>;
|
|
@@ -44,11 +44,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
44
|
};
|
|
45
45
|
class: {
|
|
46
46
|
type: PropType<any>;
|
|
47
|
-
default:
|
|
47
|
+
default: () => "";
|
|
48
48
|
};
|
|
49
49
|
ui: {
|
|
50
|
-
type: PropType<
|
|
51
|
-
default:
|
|
50
|
+
type: PropType<any>;
|
|
51
|
+
default: () => {};
|
|
52
52
|
};
|
|
53
53
|
}, {
|
|
54
54
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -65,6 +65,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
65
|
onMouseleave: () => void;
|
|
66
66
|
onClose: () => void;
|
|
67
67
|
onAction: (action: NotificationAction) => void;
|
|
68
|
+
twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
|
|
68
69
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
69
70
|
id: {
|
|
70
71
|
type: (NumberConstructor | StringConstructor)[];
|
|
@@ -92,7 +93,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
92
93
|
};
|
|
93
94
|
timeout: {
|
|
94
95
|
type: NumberConstructor;
|
|
95
|
-
default:
|
|
96
|
+
default: () => any;
|
|
96
97
|
};
|
|
97
98
|
actions: {
|
|
98
99
|
type: PropType<NotificationAction[]>;
|
|
@@ -109,15 +110,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
109
110
|
};
|
|
110
111
|
class: {
|
|
111
112
|
type: PropType<any>;
|
|
112
|
-
default:
|
|
113
|
+
default: () => "";
|
|
113
114
|
};
|
|
114
115
|
ui: {
|
|
115
|
-
type: PropType<
|
|
116
|
-
default:
|
|
116
|
+
type: PropType<any>;
|
|
117
|
+
default: () => {};
|
|
117
118
|
};
|
|
118
119
|
}>> & {
|
|
119
120
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
120
121
|
}, {
|
|
122
|
+
ui: any;
|
|
121
123
|
description: string;
|
|
122
124
|
icon: string;
|
|
123
125
|
avatar: Avatar;
|
|
@@ -126,7 +128,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
126
128
|
actions: NotificationAction[];
|
|
127
129
|
callback: Function;
|
|
128
130
|
color: any;
|
|
129
|
-
ui: Partial<any>;
|
|
130
131
|
class: any;
|
|
131
132
|
}, {}>;
|
|
132
133
|
export default _default;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<div
|
|
4
|
-
<div v-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
<Teleport to="body">
|
|
3
|
+
<div :class="wrapperClass" role="region" v-bind="attrs">
|
|
4
|
+
<div v-if="notifications.length" :class="ui.container">
|
|
5
|
+
<div v-for="notification of notifications" :key="notification.id">
|
|
6
|
+
<UNotification
|
|
7
|
+
v-bind="notification"
|
|
8
|
+
:class="notification.click && 'cursor-pointer'"
|
|
9
|
+
@click="notification.click && notification.click(notification)"
|
|
10
|
+
@close="toast.remove(notification.id)"
|
|
11
|
+
>
|
|
12
|
+
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
13
|
+
<slot :name="name" v-bind="slotData" />
|
|
14
|
+
</template>
|
|
15
|
+
</UNotification>
|
|
16
|
+
</div>
|
|
15
17
|
</div>
|
|
16
18
|
</div>
|
|
17
|
-
</
|
|
19
|
+
</Teleport>
|
|
18
20
|
</template>
|
|
19
21
|
|
|
20
22
|
<script>
|
|
@@ -36,11 +38,11 @@ export default defineComponent({
|
|
|
36
38
|
props: {
|
|
37
39
|
class: {
|
|
38
40
|
type: [String, Object, Array],
|
|
39
|
-
default:
|
|
41
|
+
default: () => ""
|
|
40
42
|
},
|
|
41
43
|
ui: {
|
|
42
44
|
type: Object,
|
|
43
|
-
default:
|
|
45
|
+
default: () => ({})
|
|
44
46
|
}
|
|
45
47
|
},
|
|
46
48
|
setup(props) {
|
|
@@ -3,11 +3,11 @@ import type { Notification } from '../../types';
|
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
class: {
|
|
5
5
|
type: PropType<any>;
|
|
6
|
-
default:
|
|
6
|
+
default: () => string;
|
|
7
7
|
};
|
|
8
8
|
ui: {
|
|
9
|
-
type: PropType<
|
|
10
|
-
default:
|
|
9
|
+
type: PropType<any>;
|
|
10
|
+
default: () => {};
|
|
11
11
|
};
|
|
12
12
|
}, {
|
|
13
13
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -36,14 +36,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
36
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
37
|
class: {
|
|
38
38
|
type: PropType<any>;
|
|
39
|
-
default:
|
|
39
|
+
default: () => string;
|
|
40
40
|
};
|
|
41
41
|
ui: {
|
|
42
|
-
type: PropType<
|
|
43
|
-
default:
|
|
42
|
+
type: PropType<any>;
|
|
43
|
+
default: () => {};
|
|
44
44
|
};
|
|
45
45
|
}>>, {
|
|
46
|
-
ui:
|
|
46
|
+
ui: any;
|
|
47
47
|
class: any;
|
|
48
48
|
}, {}>;
|
|
49
49
|
export default _default;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
ref="trigger"
|
|
5
5
|
as="div"
|
|
6
6
|
:disabled="disabled"
|
|
7
|
-
class="
|
|
7
|
+
:class="ui.trigger"
|
|
8
8
|
role="button"
|
|
9
9
|
@mouseover="onMouseOver"
|
|
10
10
|
>
|
|
@@ -15,10 +15,15 @@
|
|
|
15
15
|
</slot>
|
|
16
16
|
</HPopoverButton>
|
|
17
17
|
|
|
18
|
+
<Transition v-if="overlay" appear v-bind="ui.overlay.transition">
|
|
19
|
+
<div v-if="(open !== undefined) ? open : headlessOpen" :class="[ui.overlay.base, ui.overlay.background]" @click="$emit('update:open')" />
|
|
20
|
+
</Transition>
|
|
21
|
+
|
|
18
22
|
<div v-if="(open !== undefined) ? open : headlessOpen" ref="container" :class="[ui.container, ui.width]" :style="containerStyle" @mouseover="onMouseOver">
|
|
19
23
|
<Transition appear v-bind="ui.transition">
|
|
20
24
|
<div>
|
|
21
|
-
<div v-if="popper.arrow" data-popper-arrow :class="
|
|
25
|
+
<div v-if="popper.arrow" data-popper-arrow :class="Object.values(ui.arrow)" />
|
|
26
|
+
|
|
22
27
|
<HPopoverPanel :class="[ui.base, ui.background, ui.ring, ui.rounded, ui.shadow]" static>
|
|
23
28
|
<slot name="panel" :open="(open !== undefined) ? open : headlessOpen" :close="close" />
|
|
24
29
|
</HPopoverPanel>
|
|
@@ -67,19 +72,24 @@ export default defineComponent({
|
|
|
67
72
|
type: Number,
|
|
68
73
|
default: 0
|
|
69
74
|
},
|
|
75
|
+
overlay: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
78
|
+
},
|
|
70
79
|
popper: {
|
|
71
80
|
type: Object,
|
|
72
81
|
default: () => ({})
|
|
73
82
|
},
|
|
74
83
|
class: {
|
|
75
84
|
type: [String, Object, Array],
|
|
76
|
-
default:
|
|
85
|
+
default: () => ""
|
|
77
86
|
},
|
|
78
87
|
ui: {
|
|
79
88
|
type: Object,
|
|
80
|
-
default:
|
|
89
|
+
default: () => ({})
|
|
81
90
|
}
|
|
82
91
|
},
|
|
92
|
+
emits: ["update:open"],
|
|
83
93
|
setup(props) {
|
|
84
94
|
const { ui, attrs } = useUI("popover", toRef(props, "ui"), config, toRef(props, "class"));
|
|
85
95
|
const popper = computed(() => defu(props.mode === "hover" ? { offsetDistance: 0 } : {}, props.popper, ui.value.popper));
|
|
@@ -22,17 +22,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
22
|
type: NumberConstructor;
|
|
23
23
|
default: number;
|
|
24
24
|
};
|
|
25
|
+
overlay: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
25
29
|
popper: {
|
|
26
30
|
type: PropType<PopperOptions>;
|
|
27
31
|
default: () => {};
|
|
28
32
|
};
|
|
29
33
|
class: {
|
|
30
34
|
type: PropType<any>;
|
|
31
|
-
default:
|
|
35
|
+
default: () => string;
|
|
32
36
|
};
|
|
33
37
|
ui: {
|
|
34
|
-
type: PropType<
|
|
35
|
-
default:
|
|
38
|
+
type: PropType<any>;
|
|
39
|
+
default: () => {};
|
|
36
40
|
};
|
|
37
41
|
}, {
|
|
38
42
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -56,7 +60,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
60
|
}>;
|
|
57
61
|
onMouseOver: () => void;
|
|
58
62
|
onMouseLeave: () => void;
|
|
59
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
63
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:open"[], "update:open", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
60
64
|
mode: {
|
|
61
65
|
type: PropType<"click" | "hover">;
|
|
62
66
|
default: string;
|
|
@@ -78,20 +82,26 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
78
82
|
type: NumberConstructor;
|
|
79
83
|
default: number;
|
|
80
84
|
};
|
|
85
|
+
overlay: {
|
|
86
|
+
type: BooleanConstructor;
|
|
87
|
+
default: boolean;
|
|
88
|
+
};
|
|
81
89
|
popper: {
|
|
82
90
|
type: PropType<PopperOptions>;
|
|
83
91
|
default: () => {};
|
|
84
92
|
};
|
|
85
93
|
class: {
|
|
86
94
|
type: PropType<any>;
|
|
87
|
-
default:
|
|
95
|
+
default: () => string;
|
|
88
96
|
};
|
|
89
97
|
ui: {
|
|
90
|
-
type: PropType<
|
|
91
|
-
default:
|
|
98
|
+
type: PropType<any>;
|
|
99
|
+
default: () => {};
|
|
92
100
|
};
|
|
93
|
-
}
|
|
94
|
-
|
|
101
|
+
}>> & {
|
|
102
|
+
"onUpdate:open"?: ((...args: any[]) => any) | undefined;
|
|
103
|
+
}, {
|
|
104
|
+
ui: any;
|
|
95
105
|
popper: PopperOptions;
|
|
96
106
|
class: any;
|
|
97
107
|
disabled: boolean;
|
|
@@ -99,5 +109,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
99
109
|
mode: "click" | "hover";
|
|
100
110
|
openDelay: number;
|
|
101
111
|
closeDelay: number;
|
|
112
|
+
overlay: boolean;
|
|
102
113
|
}, {}>;
|
|
103
114
|
export default _default;
|
|
@@ -58,11 +58,11 @@ export default defineComponent({
|
|
|
58
58
|
},
|
|
59
59
|
class: {
|
|
60
60
|
type: [String, Object, Array],
|
|
61
|
-
default:
|
|
61
|
+
default: () => ""
|
|
62
62
|
},
|
|
63
63
|
ui: {
|
|
64
64
|
type: Object,
|
|
65
|
-
default:
|
|
65
|
+
default: () => ({})
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
emits: ["update:modelValue", "close"],
|
|
@@ -82,10 +82,10 @@ export default defineComponent({
|
|
|
82
82
|
}
|
|
83
83
|
return {
|
|
84
84
|
...ui.value.transition,
|
|
85
|
-
enterFrom: props.side === "left" ?
|
|
86
|
-
enterTo:
|
|
87
|
-
leaveFrom:
|
|
88
|
-
leaveTo: props.side === "left" ?
|
|
85
|
+
enterFrom: props.side === "left" ? ui.value.translate.left : ui.value.translate.right,
|
|
86
|
+
enterTo: ui.value.translate.base,
|
|
87
|
+
leaveFrom: ui.value.translate.base,
|
|
88
|
+
leaveTo: props.side === "left" ? ui.value.translate.left : ui.value.translate.right
|
|
89
89
|
};
|
|
90
90
|
});
|
|
91
91
|
function close(value) {
|
|
@@ -27,11 +27,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
27
|
};
|
|
28
28
|
class: {
|
|
29
29
|
type: PropType<any>;
|
|
30
|
-
default:
|
|
30
|
+
default: () => string;
|
|
31
31
|
};
|
|
32
32
|
ui: {
|
|
33
|
-
type: PropType<
|
|
34
|
-
default:
|
|
33
|
+
type: PropType<any>;
|
|
34
|
+
default: () => {};
|
|
35
35
|
};
|
|
36
36
|
}, {
|
|
37
37
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -69,17 +69,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
69
69
|
};
|
|
70
70
|
class: {
|
|
71
71
|
type: PropType<any>;
|
|
72
|
-
default:
|
|
72
|
+
default: () => string;
|
|
73
73
|
};
|
|
74
74
|
ui: {
|
|
75
|
-
type: PropType<
|
|
76
|
-
default:
|
|
75
|
+
type: PropType<any>;
|
|
76
|
+
default: () => {};
|
|
77
77
|
};
|
|
78
78
|
}>> & {
|
|
79
79
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
80
80
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
81
81
|
}, {
|
|
82
|
-
ui:
|
|
82
|
+
ui: any;
|
|
83
83
|
class: any;
|
|
84
84
|
modelValue: boolean;
|
|
85
85
|
appear: boolean;
|
|
@@ -7,15 +7,16 @@
|
|
|
7
7
|
<div v-if="open && !prevent" ref="container" :class="[ui.container, ui.width]">
|
|
8
8
|
<Transition appear v-bind="ui.transition">
|
|
9
9
|
<div>
|
|
10
|
-
<div v-if="popper.arrow" data-popper-arrow :class="
|
|
10
|
+
<div v-if="popper.arrow" data-popper-arrow :class="Object.values(ui.arrow)" />
|
|
11
11
|
|
|
12
12
|
<div :class="[ui.base, ui.background, ui.color, ui.rounded, ui.shadow, ui.ring]">
|
|
13
13
|
<slot name="text">
|
|
14
14
|
{{ text }}
|
|
15
15
|
</slot>
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
<span v-if="shortcuts?.length" :class="ui.shortcuts">
|
|
18
|
-
<span class="
|
|
18
|
+
<span :class="ui.middot">·</span>
|
|
19
|
+
|
|
19
20
|
<UKbd v-for="shortcut of shortcuts" :key="shortcut" size="xs">
|
|
20
21
|
{{ shortcut }}
|
|
21
22
|
</Ukbd>
|
|
@@ -69,11 +70,11 @@ export default defineComponent({
|
|
|
69
70
|
},
|
|
70
71
|
class: {
|
|
71
72
|
type: [String, Object, Array],
|
|
72
|
-
default:
|
|
73
|
+
default: () => ""
|
|
73
74
|
},
|
|
74
75
|
ui: {
|
|
75
76
|
type: Object,
|
|
76
|
-
default:
|
|
77
|
+
default: () => ({})
|
|
77
78
|
}
|
|
78
79
|
},
|
|
79
80
|
setup(props) {
|
|
@@ -27,11 +27,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
27
|
};
|
|
28
28
|
class: {
|
|
29
29
|
type: PropType<any>;
|
|
30
|
-
default:
|
|
30
|
+
default: () => string;
|
|
31
31
|
};
|
|
32
32
|
ui: {
|
|
33
|
-
type: PropType<
|
|
34
|
-
default:
|
|
33
|
+
type: PropType<any>;
|
|
34
|
+
default: () => {};
|
|
35
35
|
};
|
|
36
36
|
}, {
|
|
37
37
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -71,14 +71,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
71
71
|
};
|
|
72
72
|
class: {
|
|
73
73
|
type: PropType<any>;
|
|
74
|
-
default:
|
|
74
|
+
default: () => string;
|
|
75
75
|
};
|
|
76
76
|
ui: {
|
|
77
|
-
type: PropType<
|
|
78
|
-
default:
|
|
77
|
+
type: PropType<any>;
|
|
78
|
+
default: () => {};
|
|
79
79
|
};
|
|
80
80
|
}>>, {
|
|
81
|
-
ui:
|
|
81
|
+
ui: any;
|
|
82
82
|
popper: PopperOptions;
|
|
83
83
|
class: any;
|
|
84
84
|
text: string;
|
|
@@ -2,7 +2,7 @@ import type { WatchSource } from 'vue';
|
|
|
2
2
|
export interface ShortcutConfig {
|
|
3
3
|
handler: Function;
|
|
4
4
|
usingInput?: string | boolean;
|
|
5
|
-
whenever?: WatchSource<
|
|
5
|
+
whenever?: WatchSource<boolean>[];
|
|
6
6
|
}
|
|
7
7
|
export interface ShortcutsConfig {
|
|
8
8
|
[key: string]: ShortcutConfig | Function;
|
|
@@ -2,6 +2,8 @@ import { ref, computed } from "vue";
|
|
|
2
2
|
import { logicAnd, logicNot } from "@vueuse/math";
|
|
3
3
|
import { useEventListener, useDebounceFn } from "@vueuse/core";
|
|
4
4
|
import { useShortcuts } from "./useShortcuts.mjs";
|
|
5
|
+
const chainedShortcutRegex = /^[^-]+.*-.*[^-]+$/;
|
|
6
|
+
const combinedShortcutRegex = /^[^_]+.*_.*[^_]+$/;
|
|
5
7
|
export const defineShortcuts = (config, options = {}) => {
|
|
6
8
|
const { macOS, usingInput } = useShortcuts();
|
|
7
9
|
let shortcuts = [];
|
|
@@ -58,11 +60,13 @@ export const defineShortcuts = (config, options = {}) => {
|
|
|
58
60
|
return null;
|
|
59
61
|
}
|
|
60
62
|
let shortcut;
|
|
61
|
-
if (key.includes("-") && key.
|
|
62
|
-
console.trace(
|
|
63
|
-
|
|
63
|
+
if (key.includes("-") && key !== "-" && !key.match(chainedShortcutRegex)?.length) {
|
|
64
|
+
console.trace(`[Shortcut] Invalid key: "${key}"`);
|
|
65
|
+
}
|
|
66
|
+
if (key.includes("_") && key !== "_" && !key.match(combinedShortcutRegex)?.length) {
|
|
67
|
+
console.trace(`[Shortcut] Invalid key: "${key}"`);
|
|
64
68
|
}
|
|
65
|
-
const chained = key.includes("-");
|
|
69
|
+
const chained = key.includes("-") && key !== "-";
|
|
66
70
|
if (chained) {
|
|
67
71
|
shortcut = {
|
|
68
72
|
key: key.toLowerCase(),
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import { buttonGroup } from '#ui/ui.config';
|
|
3
|
+
type ButtonGroupProps = {
|
|
4
|
+
orientation?: Ref<'horizontal' | 'vertical'>;
|
|
5
|
+
size?: Ref<string>;
|
|
6
|
+
ui?: Ref<Partial<typeof buttonGroup>>;
|
|
7
|
+
rounded?: Ref<{
|
|
8
|
+
start: string;
|
|
9
|
+
end: string;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
export declare function useProvideButtonGroup(buttonGroupProps: ButtonGroupProps): void;
|
|
13
|
+
export declare function useInjectButtonGroup({ ui, props }: {
|
|
14
|
+
ui: any;
|
|
15
|
+
props: any;
|
|
16
|
+
}): {
|
|
17
|
+
size: import("vue").ComputedRef<any>;
|
|
18
|
+
rounded: import("vue").ComputedRef<any>;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { computed, ref, provide, inject, onMounted, onUnmounted, getCurrentInstance } from "vue";
|
|
2
|
+
export function useProvideButtonGroup(buttonGroupProps) {
|
|
3
|
+
const instance = getCurrentInstance();
|
|
4
|
+
const groupKey = `group-${instance.uid}`;
|
|
5
|
+
const state = ref({
|
|
6
|
+
children: [],
|
|
7
|
+
register(child) {
|
|
8
|
+
this.children.push(child);
|
|
9
|
+
},
|
|
10
|
+
unregister(child) {
|
|
11
|
+
const index = this.children.indexOf(child);
|
|
12
|
+
if (index > -1) {
|
|
13
|
+
this.children.splice(index, 1);
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
...buttonGroupProps
|
|
17
|
+
});
|
|
18
|
+
provide(groupKey, state);
|
|
19
|
+
}
|
|
20
|
+
export function useInjectButtonGroup({ ui, props }) {
|
|
21
|
+
const instance = getCurrentInstance();
|
|
22
|
+
let parent = instance.parent;
|
|
23
|
+
let groupContext;
|
|
24
|
+
while (parent && !groupContext) {
|
|
25
|
+
if (parent.type.name === "ButtonGroup") {
|
|
26
|
+
groupContext = inject(`group-${parent.uid}`);
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
parent = parent.parent;
|
|
30
|
+
}
|
|
31
|
+
const positionInGroup = computed(() => groupContext?.value.children.indexOf(instance));
|
|
32
|
+
onMounted(() => {
|
|
33
|
+
groupContext?.value.register(instance);
|
|
34
|
+
});
|
|
35
|
+
onUnmounted(() => {
|
|
36
|
+
groupContext?.value.unregister(instance);
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
size: computed(() => groupContext?.value.size || props.size),
|
|
40
|
+
rounded: computed(() => {
|
|
41
|
+
if (!groupContext || positionInGroup.value === -1)
|
|
42
|
+
return ui.value.rounded;
|
|
43
|
+
if (groupContext.value.children.length === 1)
|
|
44
|
+
return groupContext.value.ui.rounded;
|
|
45
|
+
if (positionInGroup.value === 0)
|
|
46
|
+
return groupContext.value.rounded.start;
|
|
47
|
+
if (positionInGroup.value === groupContext.value.children.length - 1)
|
|
48
|
+
return groupContext.value.rounded.end;
|
|
49
|
+
return "rounded-none";
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -3,6 +3,8 @@ type InputProps = {
|
|
|
3
3
|
size?: string | number | symbol;
|
|
4
4
|
color?: string;
|
|
5
5
|
name?: string;
|
|
6
|
+
eagerValidation?: boolean;
|
|
7
|
+
legend?: string | null;
|
|
6
8
|
};
|
|
7
9
|
export declare const useFormGroup: (inputProps?: InputProps, config?: any) => {
|
|
8
10
|
inputId: import("vue").Ref<string | undefined>;
|