@nuxt/ui 2.15.2 → 2.17.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/README.md +0 -10
- package/dist/module.d.mts +4 -24
- package/dist/module.d.ts +4 -24
- package/dist/module.json +1 -1
- package/dist/module.mjs +108 -329
- package/dist/runtime/components/data/Table.vue +33 -2
- package/dist/runtime/components/data/Table.vue.d.ts +25 -35
- package/dist/runtime/components/elements/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Alert.vue +11 -7
- package/dist/runtime/components/elements/Alert.vue.d.ts +6 -6
- package/dist/runtime/components/elements/Avatar.vue.d.ts +10 -10
- package/dist/runtime/components/elements/Badge.vue.d.ts +5 -5
- package/dist/runtime/components/elements/Button.vue.d.ts +9 -9
- package/dist/runtime/components/elements/Carousel.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Chip.vue.d.ts +8 -8
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Kbd.vue.d.ts +2 -2
- package/dist/runtime/components/elements/Link.vue.d.ts +3 -3
- package/dist/runtime/components/elements/Meter.vue.d.ts +5 -5
- package/dist/runtime/components/elements/Progress.vue.d.ts +3 -3
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +10 -10
- package/dist/runtime/components/forms/Form.vue +8 -11
- package/dist/runtime/components/forms/Form.vue.d.ts +7 -12
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +7 -7
- package/dist/runtime/components/forms/Input.vue +2 -2
- package/dist/runtime/components/forms/Input.vue.d.ts +14 -14
- package/dist/runtime/components/forms/InputMenu.vue +6 -0
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +30 -21
- package/dist/runtime/components/forms/Radio.vue.d.ts +11 -11
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +8 -8
- package/dist/runtime/components/forms/Range.vue.d.ts +8 -8
- package/dist/runtime/components/forms/Select.vue +2 -2
- package/dist/runtime/components/forms/Select.vue.d.ts +13 -13
- package/dist/runtime/components/forms/SelectMenu.vue +7 -1
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +30 -21
- package/dist/runtime/components/forms/Textarea.vue.d.ts +12 -12
- package/dist/runtime/components/forms/Toggle.vue.d.ts +7 -7
- package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Divider.vue.d.ts +5 -5
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Breadcrumb.vue +2 -1
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/CommandPalette.vue +5 -1
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +10 -10
- package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Pagination.vue +5 -0
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +10 -1
- package/dist/runtime/components/navigation/Tabs.vue +5 -1
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +11 -2
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +3 -3
- package/dist/runtime/components/overlays/Modal.vue.d.ts +5 -5
- package/dist/runtime/components/overlays/Notification.vue +12 -6
- package/dist/runtime/components/overlays/Notification.vue.d.ts +8 -8
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +3 -1
- package/dist/runtime/components/overlays/Popover.vue.d.ts +2 -2
- package/dist/runtime/components/overlays/Slideover.vue +43 -6
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +9 -8
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +2 -2
- package/dist/runtime/composables/useCarouselScroll.mjs +2 -0
- package/dist/runtime/composables/useFormGroup.d.ts +1 -1
- package/dist/runtime/composables/usePopper.d.ts +8 -8
- package/dist/runtime/composables/useToast.d.ts +2 -0
- package/dist/runtime/composables/useToast.mjs +13 -1
- package/dist/runtime/types/link.d.ts +1 -1
- package/dist/runtime/types/slideover.d.ts +11 -12
- package/dist/runtime/ui.config/data/table.d.ts +1 -0
- package/dist/runtime/ui.config/data/table.mjs +1 -0
- package/dist/runtime/ui.config/forms/input.d.ts +0 -8
- package/dist/runtime/ui.config/forms/input.mjs +1 -9
- package/dist/runtime/ui.config/forms/select.d.ts +0 -8
- package/dist/runtime/ui.config/forms/textarea.d.ts +0 -8
- package/dist/runtime/ui.config/overlays/slideover.d.ts +3 -0
- package/dist/runtime/ui.config/overlays/slideover.mjs +4 -1
- package/dist/runtime/utils/colors.d.ts +11 -0
- package/dist/runtime/utils/colors.mjs +299 -0
- package/package.json +30 -30
|
@@ -2,7 +2,7 @@ import type { PropType } from 'vue';
|
|
|
2
2
|
import type { TextareaSize, TextareaVariant } from '../../types';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
5
|
-
type: (
|
|
5
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
6
6
|
default: string;
|
|
7
7
|
};
|
|
8
8
|
id: {
|
|
@@ -102,7 +102,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
102
102
|
onBlur: (event: FocusEvent) => void;
|
|
103
103
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "change" | "update:modelValue")[], "blur" | "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
104
104
|
modelValue: {
|
|
105
|
-
type: (
|
|
105
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
106
106
|
default: string;
|
|
107
107
|
};
|
|
108
108
|
id: {
|
|
@@ -189,24 +189,24 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
189
189
|
default: () => {};
|
|
190
190
|
};
|
|
191
191
|
}>> & {
|
|
192
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
193
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
194
192
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
193
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
194
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
195
195
|
}, {
|
|
196
|
-
resize: boolean;
|
|
197
196
|
size: TextareaSize;
|
|
197
|
+
name: string;
|
|
198
|
+
required: boolean;
|
|
199
|
+
class: any;
|
|
200
|
+
resize: boolean;
|
|
201
|
+
color: any;
|
|
202
|
+
variant: TextareaVariant;
|
|
203
|
+
disabled: boolean;
|
|
198
204
|
ui: any;
|
|
205
|
+
padded: boolean;
|
|
199
206
|
id: string;
|
|
200
|
-
color: any;
|
|
201
|
-
class: any;
|
|
202
|
-
name: string;
|
|
203
207
|
modelValue: string | number;
|
|
204
|
-
variant: TextareaVariant;
|
|
205
208
|
rows: number;
|
|
206
|
-
disabled: boolean;
|
|
207
209
|
placeholder: string;
|
|
208
|
-
padded: boolean;
|
|
209
|
-
required: boolean;
|
|
210
210
|
autofocus: boolean;
|
|
211
211
|
autofocusDelay: number;
|
|
212
212
|
modelModifiers: {
|
|
@@ -116,19 +116,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
116
116
|
default: () => {};
|
|
117
117
|
};
|
|
118
118
|
}>> & {
|
|
119
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
120
119
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
120
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
121
121
|
}, {
|
|
122
122
|
size: ToggleSize;
|
|
123
|
-
ui: any;
|
|
124
|
-
id: string;
|
|
125
|
-
color: any;
|
|
126
|
-
class: any;
|
|
127
123
|
name: string;
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
class: any;
|
|
125
|
+
color: any;
|
|
130
126
|
disabled: boolean;
|
|
127
|
+
ui: any;
|
|
128
|
+
loading: boolean;
|
|
131
129
|
loadingIcon: string;
|
|
130
|
+
id: string;
|
|
131
|
+
modelValue: boolean;
|
|
132
132
|
onIcon: string;
|
|
133
133
|
offIcon: string;
|
|
134
134
|
}, {}>;
|
|
@@ -81,13 +81,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
81
81
|
default: () => {};
|
|
82
82
|
};
|
|
83
83
|
}>>, {
|
|
84
|
-
orientation: "horizontal" | "vertical";
|
|
85
84
|
size: DividerSize;
|
|
86
|
-
ui: any;
|
|
87
|
-
icon: string;
|
|
88
|
-
avatar: Avatar;
|
|
89
85
|
type: "solid" | "dotted" | "dashed";
|
|
90
|
-
class: any;
|
|
91
86
|
label: string;
|
|
87
|
+
class: any;
|
|
88
|
+
avatar: Avatar;
|
|
89
|
+
orientation: "horizontal" | "vertical";
|
|
90
|
+
ui: any;
|
|
91
|
+
icon: string;
|
|
92
92
|
}, {}>;
|
|
93
93
|
export default _default;
|
|
@@ -5,8 +5,9 @@
|
|
|
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="getULinkProps(link)"
|
|
9
8
|
:aria-current="index === links.length - 1 ? 'page' : undefined"
|
|
9
|
+
v-bind="getULinkProps(link)"
|
|
10
|
+
@click="link.click"
|
|
10
11
|
>
|
|
11
12
|
<slot name="icon" :link="link" :index="index" :is-active="index === links.length - 1">
|
|
12
13
|
<UIcon
|
|
@@ -283,7 +283,11 @@ export default defineComponent({
|
|
|
283
283
|
(props.loading || isLoading.value) && props.loadingIcon && ui.value.input.icon.loading
|
|
284
284
|
);
|
|
285
285
|
});
|
|
286
|
-
const emptyState = computed(() =>
|
|
286
|
+
const emptyState = computed(() => {
|
|
287
|
+
if (props.emptyState === null)
|
|
288
|
+
return null;
|
|
289
|
+
return { ...ui.value.default.emptyState, ...props.emptyState };
|
|
290
|
+
});
|
|
287
291
|
function activateFirstOption() {
|
|
288
292
|
setTimeout(() => {
|
|
289
293
|
comboboxInput.value?.$el.dispatchEvent(new KeyboardEvent("keydown", { key: "PageUp" }));
|
|
@@ -3,7 +3,7 @@ import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
|
|
|
3
3
|
import type { Group, Command, Button } from '../../types';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
modelValue: {
|
|
6
|
-
type: (
|
|
6
|
+
type: (StringConstructor | ObjectConstructor | ArrayConstructor | NumberConstructor)[];
|
|
7
7
|
default: null;
|
|
8
8
|
};
|
|
9
9
|
by: {
|
|
@@ -110,9 +110,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
110
110
|
emptyState: ComputedRef<any>;
|
|
111
111
|
onSelect: (option: Command | Command[]) => void;
|
|
112
112
|
onClear: () => void;
|
|
113
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
113
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "close")[], "update:modelValue" | "close", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
114
114
|
modelValue: {
|
|
115
|
-
type: (
|
|
115
|
+
type: (StringConstructor | ObjectConstructor | ArrayConstructor | NumberConstructor)[];
|
|
116
116
|
default: null;
|
|
117
117
|
};
|
|
118
118
|
by: {
|
|
@@ -200,16 +200,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
200
200
|
default: () => {};
|
|
201
201
|
};
|
|
202
202
|
}>> & {
|
|
203
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
204
203
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
204
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
205
205
|
}, {
|
|
206
|
+
class: any;
|
|
206
207
|
ui: any;
|
|
208
|
+
loading: boolean;
|
|
207
209
|
icon: string;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
modelValue: string | number | unknown[] | Record<string, any>;
|
|
210
|
+
loadingIcon: string;
|
|
211
|
+
modelValue: string | number | Record<string, any> | unknown[];
|
|
211
212
|
by: string;
|
|
212
|
-
loading: boolean;
|
|
213
213
|
emptyState: {
|
|
214
214
|
icon: string;
|
|
215
215
|
label: string;
|
|
@@ -217,14 +217,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
217
217
|
};
|
|
218
218
|
multiple: boolean;
|
|
219
219
|
placeholder: string;
|
|
220
|
-
|
|
220
|
+
closeButton: Button;
|
|
221
221
|
nullable: boolean;
|
|
222
222
|
selectedIcon: string;
|
|
223
223
|
debounce: number;
|
|
224
224
|
searchable: boolean;
|
|
225
|
-
groups: Group[];
|
|
226
225
|
groupAttribute: string;
|
|
227
226
|
commandAttribute: string;
|
|
227
|
+
groups: Group[];
|
|
228
228
|
autoselect: boolean;
|
|
229
229
|
autoclear: boolean;
|
|
230
230
|
fuse: UseFuseOptions<Command>;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
<UButton
|
|
30
30
|
v-for="(page, index) of displayedPages"
|
|
31
31
|
:key="`${page}-${index}`"
|
|
32
|
+
:to="typeof page === 'number' ? to?.(page) : null"
|
|
32
33
|
:size="size"
|
|
33
34
|
:disabled="disabled"
|
|
34
35
|
:label="`${page}`"
|
|
@@ -111,6 +112,10 @@ export default defineComponent({
|
|
|
111
112
|
return Object.keys(buttonConfig.size).includes(value);
|
|
112
113
|
}
|
|
113
114
|
},
|
|
115
|
+
to: {
|
|
116
|
+
type: Function,
|
|
117
|
+
default: null
|
|
118
|
+
},
|
|
114
119
|
activeButton: {
|
|
115
120
|
type: Object,
|
|
116
121
|
default: () => config.default.activeButton
|
|
@@ -27,6 +27,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
27
|
default: () => any;
|
|
28
28
|
validator(value: string): boolean;
|
|
29
29
|
};
|
|
30
|
+
to: {
|
|
31
|
+
type: PropType<(page: number) => RouteLocationRaw>;
|
|
32
|
+
default: null;
|
|
33
|
+
};
|
|
30
34
|
activeButton: {
|
|
31
35
|
type: PropType<Button>;
|
|
32
36
|
default: () => Button;
|
|
@@ -113,6 +117,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
113
117
|
default: () => any;
|
|
114
118
|
validator(value: string): boolean;
|
|
115
119
|
};
|
|
120
|
+
to: {
|
|
121
|
+
type: PropType<(page: number) => RouteLocationRaw>;
|
|
122
|
+
default: null;
|
|
123
|
+
};
|
|
116
124
|
activeButton: {
|
|
117
125
|
type: PropType<Button>;
|
|
118
126
|
default: () => Button;
|
|
@@ -161,9 +169,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
161
169
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
162
170
|
}, {
|
|
163
171
|
size: ButtonSize;
|
|
164
|
-
ui: any;
|
|
165
172
|
class: any;
|
|
166
173
|
disabled: boolean;
|
|
174
|
+
to: (page: number) => RouteLocationRaw;
|
|
175
|
+
ui: any;
|
|
167
176
|
max: number;
|
|
168
177
|
prevButton: Button;
|
|
169
178
|
nextButton: Button;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
</HTab>
|
|
33
33
|
</HTabList>
|
|
34
34
|
|
|
35
|
-
<HTabPanels :class="ui.container">
|
|
35
|
+
<HTabPanels v-if="content" :class="ui.container">
|
|
36
36
|
<HTabPanel v-for="(item, index) of items" :key="index" v-slot="{ selected }" :class="ui.base" :unmount="unmount">
|
|
37
37
|
<slot :name="item.slot || 'item'" :item="item" :index="index" :selected="selected">
|
|
38
38
|
{{ item.content }}
|
|
@@ -83,6 +83,10 @@ export default defineComponent({
|
|
|
83
83
|
type: Boolean,
|
|
84
84
|
default: false
|
|
85
85
|
},
|
|
86
|
+
content: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: true
|
|
89
|
+
},
|
|
86
90
|
class: {
|
|
87
91
|
type: [String, Object, Array],
|
|
88
92
|
default: () => ""
|
|
@@ -22,6 +22,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
22
|
type: BooleanConstructor;
|
|
23
23
|
default: boolean;
|
|
24
24
|
};
|
|
25
|
+
content: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
25
29
|
class: {
|
|
26
30
|
type: PropType<any>;
|
|
27
31
|
default: () => string;
|
|
@@ -62,6 +66,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
62
66
|
type: BooleanConstructor;
|
|
63
67
|
default: boolean;
|
|
64
68
|
};
|
|
69
|
+
content: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
65
73
|
class: {
|
|
66
74
|
type: PropType<any>;
|
|
67
75
|
default: () => string;
|
|
@@ -71,12 +79,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
71
79
|
default: () => {};
|
|
72
80
|
};
|
|
73
81
|
}>> & {
|
|
74
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
75
82
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
83
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
76
84
|
}, {
|
|
85
|
+
class: any;
|
|
86
|
+
content: boolean;
|
|
77
87
|
orientation: "horizontal" | "vertical";
|
|
78
88
|
ui: any;
|
|
79
|
-
class: any;
|
|
80
89
|
modelValue: number;
|
|
81
90
|
unmount: boolean;
|
|
82
91
|
items: TabItem[];
|
|
@@ -30,7 +30,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
30
|
wrapperClass: import("vue").ComputedRef<string>;
|
|
31
31
|
popper: import("vue").ComputedRef<PopperOptions>;
|
|
32
32
|
container: Ref<import("@vueuse/core").MaybeElement>;
|
|
33
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
33
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "close")[], "update:modelValue" | "close", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
34
|
modelValue: {
|
|
35
35
|
type: BooleanConstructor;
|
|
36
36
|
default: boolean;
|
|
@@ -52,12 +52,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
52
52
|
default: () => {};
|
|
53
53
|
};
|
|
54
54
|
}>> & {
|
|
55
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
56
55
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
56
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
57
57
|
}, {
|
|
58
|
-
ui: any;
|
|
59
58
|
class: any;
|
|
60
59
|
popper: PopperOptions;
|
|
60
|
+
ui: any;
|
|
61
61
|
modelValue: boolean;
|
|
62
62
|
}, {}>;
|
|
63
63
|
export default _default;
|
|
@@ -41,7 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
41
|
transitionClass: import("vue").ComputedRef<any>;
|
|
42
42
|
onAfterLeave: () => void;
|
|
43
43
|
close: (value: boolean) => void;
|
|
44
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
44
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "close" | "close-prevented" | "after-leave")[], "update:modelValue" | "close" | "close-prevented" | "after-leave", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
45
|
modelValue: {
|
|
46
46
|
type: BooleanConstructor;
|
|
47
47
|
default: boolean;
|
|
@@ -75,18 +75,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
75
75
|
default: () => {};
|
|
76
76
|
};
|
|
77
77
|
}>> & {
|
|
78
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
79
78
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
79
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
80
80
|
"onClose-prevented"?: ((...args: any[]) => any) | undefined;
|
|
81
81
|
"onAfter-leave"?: ((...args: any[]) => any) | undefined;
|
|
82
82
|
}, {
|
|
83
|
+
class: any;
|
|
84
|
+
transition: boolean;
|
|
83
85
|
ui: any;
|
|
86
|
+
modelValue: boolean;
|
|
84
87
|
appear: boolean;
|
|
85
88
|
overlay: boolean;
|
|
86
|
-
transition: boolean;
|
|
87
89
|
preventClose: boolean;
|
|
88
90
|
fullscreen: boolean;
|
|
89
|
-
class: any;
|
|
90
|
-
modelValue: boolean;
|
|
91
91
|
}, {}>;
|
|
92
92
|
export default _default;
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
{{ title }}
|
|
19
19
|
</slot>
|
|
20
20
|
</p>
|
|
21
|
-
<
|
|
21
|
+
<div v-if="(description || $slots.description)" :class="twMerge(ui.description, !(title && $slots.title) && 'mt-0 leading-5')">
|
|
22
22
|
<slot name="description" :description="description">
|
|
23
23
|
{{ description }}
|
|
24
24
|
</slot>
|
|
25
|
-
</
|
|
25
|
+
</div>
|
|
26
26
|
|
|
27
27
|
<div v-if="(description || $slots.description) && actions.length" :class="ui.actions">
|
|
28
28
|
<UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="onAction(action)" />
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
</template>
|
|
44
44
|
|
|
45
45
|
<script>
|
|
46
|
-
import { ref, computed, toRef, onMounted, onUnmounted, watchEffect, defineComponent } from "vue";
|
|
46
|
+
import { ref, computed, toRef, onMounted, onUnmounted, watch, watchEffect, defineComponent } from "vue";
|
|
47
47
|
import { twMerge, twJoin } from "tailwind-merge";
|
|
48
48
|
import UIcon from "../elements/Icon.vue";
|
|
49
49
|
import UAvatar from "../elements/Avatar.vue";
|
|
@@ -124,7 +124,8 @@ export default defineComponent({
|
|
|
124
124
|
ui.value.wrapper,
|
|
125
125
|
ui.value.background?.replaceAll("{color}", props.color),
|
|
126
126
|
ui.value.rounded,
|
|
127
|
-
ui.value.shadow
|
|
127
|
+
ui.value.shadow,
|
|
128
|
+
ui.value.ring?.replaceAll("{color}", props.color)
|
|
128
129
|
), props.class);
|
|
129
130
|
});
|
|
130
131
|
const progressClass = computed(() => {
|
|
@@ -171,7 +172,10 @@ export default defineComponent({
|
|
|
171
172
|
}
|
|
172
173
|
emit("close");
|
|
173
174
|
}
|
|
174
|
-
|
|
175
|
+
function initTimer() {
|
|
176
|
+
if (timer) {
|
|
177
|
+
timer.stop();
|
|
178
|
+
}
|
|
175
179
|
if (!props.timeout) {
|
|
176
180
|
return;
|
|
177
181
|
}
|
|
@@ -181,7 +185,9 @@ export default defineComponent({
|
|
|
181
185
|
watchEffect(() => {
|
|
182
186
|
remaining.value = timer.remaining.value;
|
|
183
187
|
});
|
|
184
|
-
}
|
|
188
|
+
}
|
|
189
|
+
watch(() => props.timeout, initTimer);
|
|
190
|
+
onMounted(initTimer);
|
|
185
191
|
onUnmounted(() => {
|
|
186
192
|
if (timer) {
|
|
187
193
|
timer.stop();
|
|
@@ -2,7 +2,7 @@ import type { PropType } from 'vue';
|
|
|
2
2
|
import type { Avatar, Button, NotificationAction } from '../../types';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
id: {
|
|
5
|
-
type: (
|
|
5
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
8
|
title: {
|
|
@@ -68,7 +68,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
68
68
|
twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
|
|
69
69
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
70
70
|
id: {
|
|
71
|
-
type: (
|
|
71
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
72
72
|
required: true;
|
|
73
73
|
};
|
|
74
74
|
title: {
|
|
@@ -119,16 +119,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
119
119
|
}>> & {
|
|
120
120
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
121
121
|
}, {
|
|
122
|
-
ui: any;
|
|
123
122
|
title: string;
|
|
124
|
-
|
|
125
|
-
icon: string;
|
|
123
|
+
class: any;
|
|
126
124
|
avatar: Avatar;
|
|
125
|
+
color: any;
|
|
126
|
+
ui: any;
|
|
127
|
+
icon: string;
|
|
128
|
+
description: string;
|
|
127
129
|
closeButton: Button;
|
|
128
|
-
timeout: number;
|
|
129
130
|
actions: NotificationAction[];
|
|
131
|
+
timeout: number;
|
|
130
132
|
callback: Function;
|
|
131
|
-
color: any;
|
|
132
|
-
class: any;
|
|
133
133
|
}, {}>;
|
|
134
134
|
export default _default;
|
|
@@ -30,6 +30,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
30
|
ui?: any;
|
|
31
31
|
};
|
|
32
32
|
remove: (id: string) => void;
|
|
33
|
+
update: (id: string, notification: Partial<Notification>) => void;
|
|
34
|
+
clear: () => void;
|
|
33
35
|
};
|
|
34
36
|
notifications: any;
|
|
35
37
|
wrapperClass: import("vue").ComputedRef<string>;
|
|
@@ -43,7 +45,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
43
45
|
default: () => {};
|
|
44
46
|
};
|
|
45
47
|
}>>, {
|
|
46
|
-
ui: any;
|
|
47
48
|
class: any;
|
|
49
|
+
ui: any;
|
|
48
50
|
}, {}>;
|
|
49
51
|
export default _default;
|
|
@@ -112,14 +112,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
112
112
|
}>> & {
|
|
113
113
|
"onUpdate:open"?: ((...args: any[]) => any) | undefined;
|
|
114
114
|
}, {
|
|
115
|
-
ui: any;
|
|
116
|
-
overlay: boolean;
|
|
117
115
|
class: any;
|
|
118
116
|
popper: PopperOptions;
|
|
119
117
|
disabled: boolean;
|
|
118
|
+
ui: any;
|
|
120
119
|
open: boolean;
|
|
121
120
|
mode: "click" | "hover";
|
|
122
121
|
openDelay: number;
|
|
123
122
|
closeDelay: number;
|
|
123
|
+
overlay: boolean;
|
|
124
124
|
}, {}>;
|
|
125
125
|
export default _default;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<TransitionRoot as="template" :appear="appear" :show="isOpen" @after-leave="onAfterLeave">
|
|
3
|
-
<HDialog :class="[ui.wrapper, { 'justify-end': side === 'right' }]" v-bind="attrs" @close="close">
|
|
3
|
+
<HDialog :class="[ui.wrapper, { 'justify-end': side === 'right' }, { 'items-end': side === 'bottom' }]" v-bind="attrs" @close="close">
|
|
4
4
|
<TransitionChild v-if="overlay" as="template" :appear="appear" v-bind="ui.overlay.transition">
|
|
5
5
|
<div :class="[ui.overlay.base, ui.overlay.background]" />
|
|
6
6
|
</TransitionChild>
|
|
7
7
|
|
|
8
8
|
<TransitionChild as="template" :appear="appear" v-bind="transitionClass">
|
|
9
|
-
<HDialogPanel :class="[ui.base, ui.width, ui.background, ui.ring, ui.padding]">
|
|
9
|
+
<HDialogPanel :class="[ui.base, sideType === 'horizontal' ? [ui.width, 'h-full'] : [ui.height, 'w-full'], ui.background, ui.ring, ui.padding]">
|
|
10
10
|
<slot />
|
|
11
11
|
</HDialogPanel>
|
|
12
12
|
</TransitionChild>
|
|
@@ -43,7 +43,7 @@ export default defineComponent({
|
|
|
43
43
|
side: {
|
|
44
44
|
type: String,
|
|
45
45
|
default: "right",
|
|
46
|
-
validator: (value) => ["left", "right"].includes(value)
|
|
46
|
+
validator: (value) => ["left", "right", "top", "bottom"].includes(value)
|
|
47
47
|
},
|
|
48
48
|
overlay: {
|
|
49
49
|
type: Boolean,
|
|
@@ -81,14 +81,50 @@ export default defineComponent({
|
|
|
81
81
|
if (!props.transition) {
|
|
82
82
|
return {};
|
|
83
83
|
}
|
|
84
|
+
let enterFrom, leaveTo;
|
|
85
|
+
switch (props.side) {
|
|
86
|
+
case "left":
|
|
87
|
+
enterFrom = ui.value.translate.left;
|
|
88
|
+
leaveTo = ui.value.translate.left;
|
|
89
|
+
break;
|
|
90
|
+
case "right":
|
|
91
|
+
enterFrom = ui.value.translate.right;
|
|
92
|
+
leaveTo = ui.value.translate.right;
|
|
93
|
+
break;
|
|
94
|
+
case "top":
|
|
95
|
+
enterFrom = ui.value.translate.top;
|
|
96
|
+
leaveTo = ui.value.translate.top;
|
|
97
|
+
break;
|
|
98
|
+
case "bottom":
|
|
99
|
+
enterFrom = ui.value.translate.bottom;
|
|
100
|
+
leaveTo = ui.value.translate.bottom;
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
enterFrom = ui.value.translate.right;
|
|
104
|
+
leaveTo = ui.value.translate.right;
|
|
105
|
+
}
|
|
84
106
|
return {
|
|
85
107
|
...ui.value.transition,
|
|
86
|
-
enterFrom
|
|
108
|
+
enterFrom,
|
|
87
109
|
enterTo: ui.value.translate.base,
|
|
88
110
|
leaveFrom: ui.value.translate.base,
|
|
89
|
-
leaveTo
|
|
111
|
+
leaveTo
|
|
90
112
|
};
|
|
91
113
|
});
|
|
114
|
+
const sideType = computed(() => {
|
|
115
|
+
switch (props.side) {
|
|
116
|
+
case "left":
|
|
117
|
+
return "horizontal";
|
|
118
|
+
case "right":
|
|
119
|
+
return "horizontal";
|
|
120
|
+
case "top":
|
|
121
|
+
return "vertical";
|
|
122
|
+
case "bottom":
|
|
123
|
+
return "vertical";
|
|
124
|
+
default:
|
|
125
|
+
return "right";
|
|
126
|
+
}
|
|
127
|
+
});
|
|
92
128
|
function close(value) {
|
|
93
129
|
if (props.preventClose) {
|
|
94
130
|
emit("close-prevented");
|
|
@@ -107,9 +143,10 @@ export default defineComponent({
|
|
|
107
143
|
attrs,
|
|
108
144
|
isOpen,
|
|
109
145
|
transitionClass,
|
|
146
|
+
sideType,
|
|
110
147
|
onAfterLeave,
|
|
111
148
|
close
|
|
112
149
|
};
|
|
113
150
|
}
|
|
114
151
|
});
|
|
115
|
-
</script>
|
|
152
|
+
</script>
|