@nuxt/ui 2.18.6 → 2.19.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 +1 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -3
- package/dist/runtime/components/data/Table.vue +82 -27
- package/dist/runtime/components/data/Table.vue.d.ts +49 -41
- package/dist/runtime/components/elements/Alert.vue.d.ts +1 -1
- package/dist/runtime/components/elements/AvatarGroup.js +2 -2
- package/dist/runtime/components/elements/Carousel.vue +16 -7
- package/dist/runtime/components/elements/Carousel.vue.d.ts +9 -0
- package/dist/runtime/components/elements/Dropdown.vue +7 -3
- package/dist/runtime/components/elements/MeterGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Progress.vue +1 -1
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +5 -5
- package/dist/runtime/components/forms/Form.vue +104 -43
- package/dist/runtime/components/forms/Form.vue.d.ts +5 -3
- package/dist/runtime/components/forms/Input.vue +5 -2
- package/dist/runtime/components/forms/Input.vue.d.ts +5 -2
- package/dist/runtime/components/forms/InputMenu.vue +419 -8
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +22 -3
- package/dist/runtime/components/forms/Radio.vue.d.ts +5 -5
- package/dist/runtime/components/forms/RadioGroup.vue +3 -4
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +8 -8
- package/dist/runtime/components/forms/Range.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Select.vue.d.ts +3 -3
- package/dist/runtime/components/forms/SelectMenu.vue +501 -11
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +33 -5
- package/dist/runtime/components/forms/Textarea.vue +7 -4
- package/dist/runtime/components/forms/Textarea.vue.d.ts +5 -2
- package/dist/runtime/components/forms/Toggle.vue.d.ts +2 -2
- package/dist/runtime/components/layout/Divider.vue +1 -1
- package/dist/runtime/components/layout/Divider.vue.d.ts +5 -2
- package/dist/runtime/components/navigation/CommandPalette.vue +1 -1
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Pagination.vue +4 -4
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Tabs.vue +1 -1
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +6 -2
- package/dist/runtime/components/overlays/Modal.vue +1 -1
- package/dist/runtime/components/overlays/Notification.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Notifications.vue +1 -1
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Popover.vue +7 -3
- package/dist/runtime/components/overlays/Tooltip.vue +5 -3
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +1 -0
- package/dist/runtime/composables/defineShortcuts.js +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +1 -1
- package/dist/runtime/composables/useUI.js +1 -1
- package/dist/runtime/plugins/modals.js +1 -1
- package/dist/runtime/plugins/slideovers.js +1 -1
- package/dist/runtime/types/accordion.d.ts +1 -1
- package/dist/runtime/types/alert.d.ts +4 -4
- package/dist/runtime/types/avatar.d.ts +3 -3
- package/dist/runtime/types/badge.d.ts +3 -3
- package/dist/runtime/types/button.d.ts +3 -5
- package/dist/runtime/types/chip.d.ts +2 -2
- package/dist/runtime/types/command-palette.d.ts +2 -2
- package/dist/runtime/types/component.d.ts +3 -3
- package/dist/runtime/types/divider.d.ts +3 -3
- package/dist/runtime/types/dropdown.d.ts +1 -1
- package/dist/runtime/types/form-group.d.ts +2 -2
- package/dist/runtime/types/form.d.ts +7 -2
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/input.d.ts +3 -3
- package/dist/runtime/types/kbd.d.ts +2 -2
- package/dist/runtime/types/meter.d.ts +2 -2
- package/dist/runtime/types/modal.d.ts +2 -2
- package/dist/runtime/types/notification.d.ts +1 -1
- package/dist/runtime/types/progress.d.ts +2 -2
- package/dist/runtime/types/range.d.ts +3 -3
- package/dist/runtime/types/select.d.ts +3 -3
- package/dist/runtime/types/table.d.ts +18 -0
- package/dist/runtime/types/textarea.d.ts +3 -3
- package/dist/runtime/types/toggle.d.ts +3 -3
- package/dist/runtime/types/utils.d.ts +2 -2
- package/dist/runtime/ui.config/data/table.d.ts +1 -0
- package/dist/runtime/ui.config/data/table.js +1 -0
- package/dist/runtime/ui.config/elements/avatar.js +15 -15
- package/dist/runtime/ui.config/elements/button.js +25 -25
- package/dist/runtime/ui.config/elements/buttonGroup.js +1 -1
- package/dist/runtime/ui.config/elements/carousel.js +2 -2
- package/dist/runtime/ui.config/elements/chip.js +5 -5
- package/dist/runtime/ui.config/elements/meter.js +20 -20
- package/dist/runtime/ui.config/elements/meterGroup.js +1 -1
- package/dist/runtime/ui.config/elements/progress.js +18 -18
- package/dist/runtime/ui.config/forms/formGroup.js +5 -6
- package/dist/runtime/ui.config/forms/input.js +40 -40
- package/dist/runtime/ui.config/forms/inputMenu.d.ts +6 -0
- package/dist/runtime/ui.config/forms/inputMenu.js +7 -1
- package/dist/runtime/ui.config/forms/range.js +20 -20
- package/dist/runtime/ui.config/forms/selectMenu.d.ts +9 -0
- package/dist/runtime/ui.config/forms/selectMenu.js +10 -1
- package/dist/runtime/ui.config/forms/toggle.js +20 -20
- package/dist/runtime/ui.config/layout/divider.d.ts +1 -0
- package/dist/runtime/ui.config/layout/divider.js +12 -11
- package/dist/runtime/ui.config/navigation/horizontalNavigation.js +1 -1
- package/dist/runtime/ui.config/navigation/verticalNavigation.js +1 -1
- package/dist/runtime/ui.config/popper.js +0 -1
- package/dist/runtime/utils/colors.js +7 -7
- package/dist/runtime/utils/index.js +4 -4
- package/dist/runtime/utils/link.js +1 -1
- package/dist/runtime/utils/lodash.js +1 -1
- package/package.json +23 -21
|
@@ -130,7 +130,7 @@ export default defineComponent({
|
|
|
130
130
|
setup(props, { emit }) {
|
|
131
131
|
const { ui, attrs } = useUI("textarea", toRef(props, "ui"), config, toRef(props, "class"));
|
|
132
132
|
const { emitFormBlur, emitFormInput, inputId, color, size, name } = useFormGroup(props, config);
|
|
133
|
-
const modelModifiers = ref(defu({}, props.modelModifiers, { trim: false, lazy: false, number: false }));
|
|
133
|
+
const modelModifiers = ref(defu({}, props.modelModifiers, { trim: false, lazy: false, number: false, nullify: false }));
|
|
134
134
|
const textarea2 = ref(null);
|
|
135
135
|
const autoFocus = () => {
|
|
136
136
|
if (props.autofocus) {
|
|
@@ -146,10 +146,10 @@ export default defineComponent({
|
|
|
146
146
|
const overflow = textarea2.value.style.overflow;
|
|
147
147
|
textarea2.value.style.overflow = "hidden";
|
|
148
148
|
const styles = window.getComputedStyle(textarea2.value);
|
|
149
|
-
const paddingTop = parseInt(styles.paddingTop);
|
|
150
|
-
const paddingBottom = parseInt(styles.paddingBottom);
|
|
149
|
+
const paddingTop = Number.parseInt(styles.paddingTop);
|
|
150
|
+
const paddingBottom = Number.parseInt(styles.paddingBottom);
|
|
151
151
|
const padding = paddingTop + paddingBottom;
|
|
152
|
-
const lineHeight = parseInt(styles.lineHeight);
|
|
152
|
+
const lineHeight = Number.parseInt(styles.lineHeight);
|
|
153
153
|
const { scrollHeight } = textarea2.value;
|
|
154
154
|
const newRows = (scrollHeight - padding) / lineHeight;
|
|
155
155
|
if (newRows > props.rows) {
|
|
@@ -165,6 +165,9 @@ export default defineComponent({
|
|
|
165
165
|
if (modelModifiers.value.number) {
|
|
166
166
|
value = looseToNumber(value);
|
|
167
167
|
}
|
|
168
|
+
if (modelModifiers.value.nullify) {
|
|
169
|
+
value ||= null;
|
|
170
|
+
}
|
|
168
171
|
emit("update:modelValue", value);
|
|
169
172
|
emitFormInput();
|
|
170
173
|
};
|
|
@@ -110,7 +110,7 @@ declare const config: {
|
|
|
110
110
|
};
|
|
111
111
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
112
112
|
modelValue: {
|
|
113
|
-
type:
|
|
113
|
+
type: PropType<string | number | null>;
|
|
114
114
|
default: string;
|
|
115
115
|
};
|
|
116
116
|
id: {
|
|
@@ -195,6 +195,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
195
195
|
trim?: boolean;
|
|
196
196
|
lazy?: boolean;
|
|
197
197
|
number?: boolean;
|
|
198
|
+
nullify?: boolean;
|
|
198
199
|
}>;
|
|
199
200
|
default: () => {};
|
|
200
201
|
};
|
|
@@ -319,7 +320,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
319
320
|
onBlur: (event: FocusEvent) => void;
|
|
320
321
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "change" | "update:modelValue")[], "blur" | "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
321
322
|
modelValue: {
|
|
322
|
-
type:
|
|
323
|
+
type: PropType<string | number | null>;
|
|
323
324
|
default: string;
|
|
324
325
|
};
|
|
325
326
|
id: {
|
|
@@ -404,6 +405,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
404
405
|
trim?: boolean;
|
|
405
406
|
lazy?: boolean;
|
|
406
407
|
number?: boolean;
|
|
408
|
+
nullify?: boolean;
|
|
407
409
|
}>;
|
|
408
410
|
default: () => {};
|
|
409
411
|
};
|
|
@@ -543,6 +545,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
543
545
|
trim?: boolean;
|
|
544
546
|
lazy?: boolean;
|
|
545
547
|
number?: boolean;
|
|
548
|
+
nullify?: boolean;
|
|
546
549
|
};
|
|
547
550
|
maxrows: number;
|
|
548
551
|
autoresize: boolean;
|
|
@@ -72,7 +72,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
72
72
|
default: any;
|
|
73
73
|
};
|
|
74
74
|
modelValue: {
|
|
75
|
-
type:
|
|
75
|
+
type: PropType<boolean | null>;
|
|
76
76
|
default: boolean;
|
|
77
77
|
};
|
|
78
78
|
disabled: {
|
|
@@ -199,7 +199,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
199
199
|
default: any;
|
|
200
200
|
};
|
|
201
201
|
modelValue: {
|
|
202
|
-
type:
|
|
202
|
+
type: PropType<boolean | null>;
|
|
203
203
|
default: boolean;
|
|
204
204
|
};
|
|
205
205
|
disabled: {
|
|
@@ -49,6 +49,7 @@ declare const config: {
|
|
|
49
49
|
label: string;
|
|
50
50
|
default: {
|
|
51
51
|
size: "2xs";
|
|
52
|
+
type: "solid";
|
|
52
53
|
};
|
|
53
54
|
};
|
|
54
55
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -76,7 +77,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
76
77
|
};
|
|
77
78
|
type: {
|
|
78
79
|
type: PropType<"solid" | "dotted" | "dashed">;
|
|
79
|
-
default:
|
|
80
|
+
default: () => "solid";
|
|
80
81
|
validator: (value: string) => boolean;
|
|
81
82
|
};
|
|
82
83
|
class: {
|
|
@@ -139,6 +140,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
139
140
|
label: string;
|
|
140
141
|
default: {
|
|
141
142
|
size: "2xs";
|
|
143
|
+
type: "solid";
|
|
142
144
|
};
|
|
143
145
|
}>;
|
|
144
146
|
attrs: import("vue").ComputedRef<Pick<{
|
|
@@ -172,7 +174,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
172
174
|
};
|
|
173
175
|
type: {
|
|
174
176
|
type: PropType<"solid" | "dotted" | "dashed">;
|
|
175
|
-
default:
|
|
177
|
+
default: () => "solid";
|
|
176
178
|
validator: (value: string) => boolean;
|
|
177
179
|
};
|
|
178
180
|
class: {
|
|
@@ -241,6 +243,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
241
243
|
label?: string;
|
|
242
244
|
default?: DeepPartial<{
|
|
243
245
|
size: "2xs";
|
|
246
|
+
type: "solid";
|
|
244
247
|
}, any>;
|
|
245
248
|
} & {
|
|
246
249
|
[key: string]: any;
|
|
@@ -70,9 +70,9 @@ import { twJoin } from "tailwind-merge";
|
|
|
70
70
|
import { defu } from "defu";
|
|
71
71
|
import UIcon from "../elements/Icon.vue";
|
|
72
72
|
import UButton from "../elements/Button.vue";
|
|
73
|
-
import CommandPaletteGroup from "./CommandPaletteGroup.vue";
|
|
74
73
|
import { useUI } from "../../composables/useUI";
|
|
75
74
|
import { mergeConfig } from "../../utils";
|
|
75
|
+
import CommandPaletteGroup from "./CommandPaletteGroup.vue";
|
|
76
76
|
import appConfig from "#build/app.config";
|
|
77
77
|
import { commandPalette } from "#ui/ui.config";
|
|
78
78
|
import { useId } from "#imports";
|
|
@@ -250,7 +250,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
250
250
|
inactive?: string;
|
|
251
251
|
search?: (...args: any[]) => any[] | Promise<any[]>;
|
|
252
252
|
filter?: (...args: any[]) => Command[];
|
|
253
|
-
static?:
|
|
253
|
+
static?: boolean;
|
|
254
254
|
})[]>;
|
|
255
255
|
comboboxInput: import("vue").Ref<ComponentPublicInstance<HTMLInputElement>, ComponentPublicInstance<HTMLInputElement>>;
|
|
256
256
|
query: import("vue").Ref<string, string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { Command, Group } from '../../types/index.js';
|
|
3
|
-
import { commandPalette } from '#ui/ui.config';
|
|
3
|
+
import type { commandPalette } from '#ui/ui.config';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
5
|
group: {
|
|
6
6
|
type: PropType<Group>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="ui.wrapper" v-bind="attrs">
|
|
3
|
-
<slot name="first" :on-click="onClickFirst">
|
|
3
|
+
<slot name="first" :on-click="onClickFirst" :can-go-first="canGoFirstOrPrev">
|
|
4
4
|
<UButton
|
|
5
5
|
v-if="firstButton && showFirst"
|
|
6
6
|
:size="size"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
/>
|
|
15
15
|
</slot>
|
|
16
16
|
|
|
17
|
-
<slot name="prev" :on-click="onClickPrev">
|
|
17
|
+
<slot name="prev" :on-click="onClickPrev" :can-go-prev="canGoFirstOrPrev">
|
|
18
18
|
<UButton
|
|
19
19
|
v-if="prevButton"
|
|
20
20
|
:size="size"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
@click="() => onClickPage(page)"
|
|
42
42
|
/>
|
|
43
43
|
|
|
44
|
-
<slot name="next" :on-click="onClickNext">
|
|
44
|
+
<slot name="next" :on-click="onClickNext" :can-go-next="canGoLastOrNext">
|
|
45
45
|
<UButton
|
|
46
46
|
v-if="nextButton"
|
|
47
47
|
:size="size"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
/>
|
|
56
56
|
</slot>
|
|
57
57
|
|
|
58
|
-
<slot name="last" :on-click="onClickLast">
|
|
58
|
+
<slot name="last" :on-click="onClickLast" :can-go-last="canGoLastOrNext">
|
|
59
59
|
<UButton
|
|
60
60
|
v-if="lastButton && showLast"
|
|
61
61
|
:size="size"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { RouteLocationRaw } from '#vue-router';
|
|
3
2
|
import type { Button, ButtonSize, DeepPartial, Strategy } from '../../types/index.js';
|
|
3
|
+
import type { RouteLocationRaw } from '#vue-router';
|
|
4
4
|
declare const config: {
|
|
5
5
|
wrapper: string;
|
|
6
6
|
base: string;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
:disabled="item.disabled"
|
|
25
25
|
as="template"
|
|
26
26
|
>
|
|
27
|
-
<button :class="[ui.list.tab.base, ui.list.tab.background, ui.list.tab.height, ui.list.tab.padding, ui.list.tab.size, ui.list.tab.font, ui.list.tab.rounded, ui.list.tab.shadow, selected ? ui.list.tab.active : ui.list.tab.inactive]">
|
|
27
|
+
<button :aria-label="item.ariaLabel" :class="[ui.list.tab.base, ui.list.tab.background, ui.list.tab.height, ui.list.tab.padding, ui.list.tab.size, ui.list.tab.font, ui.list.tab.rounded, ui.list.tab.shadow, selected ? ui.list.tab.active : ui.list.tab.inactive]">
|
|
28
28
|
<slot
|
|
29
29
|
name="icon"
|
|
30
30
|
:item="item"
|
|
@@ -1030,7 +1030,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1030
1030
|
};
|
|
1031
1031
|
type: {
|
|
1032
1032
|
type: PropType<"solid" | "dotted" | "dashed">;
|
|
1033
|
-
default:
|
|
1033
|
+
default: () => "solid";
|
|
1034
1034
|
validator: (value: string) => boolean;
|
|
1035
1035
|
};
|
|
1036
1036
|
class: {
|
|
@@ -1087,6 +1087,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1087
1087
|
label: string;
|
|
1088
1088
|
default: {
|
|
1089
1089
|
size: "2xs";
|
|
1090
|
+
type: "solid";
|
|
1090
1091
|
};
|
|
1091
1092
|
}> & {
|
|
1092
1093
|
strategy?: Strategy;
|
|
@@ -1143,6 +1144,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1143
1144
|
label: string;
|
|
1144
1145
|
default: {
|
|
1145
1146
|
size: "2xs";
|
|
1147
|
+
type: "solid";
|
|
1146
1148
|
};
|
|
1147
1149
|
}>;
|
|
1148
1150
|
attrs: import("vue").ComputedRef<Pick<{
|
|
@@ -1176,7 +1178,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1176
1178
|
};
|
|
1177
1179
|
type: {
|
|
1178
1180
|
type: PropType<"solid" | "dotted" | "dashed">;
|
|
1179
|
-
default:
|
|
1181
|
+
default: () => "solid";
|
|
1180
1182
|
validator: (value: string) => boolean;
|
|
1181
1183
|
};
|
|
1182
1184
|
class: {
|
|
@@ -1233,6 +1235,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1233
1235
|
label: string;
|
|
1234
1236
|
default: {
|
|
1235
1237
|
size: "2xs";
|
|
1238
|
+
type: "solid";
|
|
1236
1239
|
};
|
|
1237
1240
|
}> & {
|
|
1238
1241
|
strategy?: Strategy;
|
|
@@ -1295,6 +1298,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1295
1298
|
label?: string;
|
|
1296
1299
|
default?: DeepPartial<{
|
|
1297
1300
|
size: "2xs";
|
|
1301
|
+
type: "solid";
|
|
1298
1302
|
}, any>;
|
|
1299
1303
|
} & {
|
|
1300
1304
|
[key: string]: any;
|
|
@@ -222,9 +222,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
222
222
|
}>, {
|
|
223
223
|
class: any;
|
|
224
224
|
timeout: number;
|
|
225
|
+
title: string;
|
|
225
226
|
avatar: Avatar;
|
|
226
227
|
color: NotificationColor;
|
|
227
|
-
title: string;
|
|
228
228
|
ui: {
|
|
229
229
|
wrapper?: string;
|
|
230
230
|
container?: string;
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
<script>
|
|
23
23
|
import { computed, toRef, defineComponent } from "vue";
|
|
24
24
|
import { twMerge, twJoin } from "tailwind-merge";
|
|
25
|
-
import UNotification from "./Notification.vue";
|
|
26
25
|
import { useUI } from "../../composables/useUI";
|
|
27
26
|
import { useToast } from "../../composables/useToast";
|
|
28
27
|
import { mergeConfig } from "../../utils";
|
|
28
|
+
import UNotification from "./Notification.vue";
|
|
29
29
|
import { useState } from "#imports";
|
|
30
30
|
import appConfig from "#build/app.config";
|
|
31
31
|
import { notifications } from "#ui/ui.config";
|
|
@@ -341,9 +341,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
341
341
|
}>, {
|
|
342
342
|
class: any;
|
|
343
343
|
timeout: number;
|
|
344
|
+
title: string;
|
|
344
345
|
avatar: import("../../types/avatar").Avatar;
|
|
345
346
|
color: import("../../types/notification").NotificationColor;
|
|
346
|
-
title: string;
|
|
347
347
|
ui: {
|
|
348
348
|
wrapper?: string;
|
|
349
349
|
container?: string;
|
|
@@ -139,7 +139,7 @@ export default defineComponent({
|
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
function onTouchStart(event) {
|
|
142
|
-
if (!event.cancelable || !popoverApi.value) {
|
|
142
|
+
if (!event.cancelable || !popoverApi.value || props.mode === "click") {
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
if (popoverApi.value.popoverState === 0) {
|
|
@@ -160,7 +160,9 @@ export default defineComponent({
|
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
openTimeout = openTimeout || setTimeout(() => {
|
|
163
|
-
|
|
163
|
+
if (popoverApi.value.togglePopover) {
|
|
164
|
+
popoverApi.value.togglePopover();
|
|
165
|
+
}
|
|
164
166
|
openTimeout = null;
|
|
165
167
|
}, props.openDelay);
|
|
166
168
|
}
|
|
@@ -176,7 +178,9 @@ export default defineComponent({
|
|
|
176
178
|
return;
|
|
177
179
|
}
|
|
178
180
|
closeTimeout = closeTimeout || setTimeout(() => {
|
|
179
|
-
|
|
181
|
+
if (popoverApi.value.closePopover) {
|
|
182
|
+
popoverApi.value.closePopover();
|
|
183
|
+
}
|
|
180
184
|
closeTimeout = null;
|
|
181
185
|
}, props.closeDelay);
|
|
182
186
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Hover
|
|
5
5
|
</slot>
|
|
6
6
|
|
|
7
|
-
<div v-if="open && !prevent" ref="container" :class="[ui.container, ui.width]">
|
|
7
|
+
<div v-if="open && !prevent && isVisible" ref="container" :class="[ui.container, ui.width]">
|
|
8
8
|
<Transition appear v-bind="ui.transition">
|
|
9
9
|
<div>
|
|
10
10
|
<div v-if="popper.arrow" data-popper-arrow :class="Object.values(ui.arrow)" />
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
|
-
import { computed, ref, toRef, defineComponent } from "vue";
|
|
32
|
+
import { computed, ref, toRef, defineComponent, useSlots } from "vue";
|
|
33
33
|
import { defu } from "defu";
|
|
34
34
|
import UKbd from "../elements/Kbd.vue";
|
|
35
35
|
import { useUI } from "../../composables/useUI";
|
|
@@ -84,6 +84,7 @@ export default defineComponent({
|
|
|
84
84
|
const open = ref(false);
|
|
85
85
|
let openTimeout = null;
|
|
86
86
|
let closeTimeout = null;
|
|
87
|
+
const isVisible = computed(() => !!(useSlots().text || props.text));
|
|
87
88
|
function onMouseEnter() {
|
|
88
89
|
if (closeTimeout) {
|
|
89
90
|
clearTimeout(closeTimeout);
|
|
@@ -120,7 +121,8 @@ export default defineComponent({
|
|
|
120
121
|
container,
|
|
121
122
|
open,
|
|
122
123
|
onMouseEnter,
|
|
123
|
-
onMouseLeave
|
|
124
|
+
onMouseLeave,
|
|
125
|
+
isVisible
|
|
124
126
|
};
|
|
125
127
|
}
|
|
126
128
|
});
|
|
@@ -117,6 +117,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
117
117
|
open: import("vue").Ref<boolean, boolean>;
|
|
118
118
|
onMouseEnter: () => void;
|
|
119
119
|
onMouseLeave: () => void;
|
|
120
|
+
isVisible: import("vue").ComputedRef<boolean>;
|
|
120
121
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
121
122
|
text: {
|
|
122
123
|
type: StringConstructor;
|
|
@@ -16,7 +16,7 @@ export const defineShortcuts = (config, options = {}) => {
|
|
|
16
16
|
if (!e.key) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const alphabeticalKey = /^[a-z]
|
|
19
|
+
const alphabeticalKey = /^[a-z]$/i.test(e.key);
|
|
20
20
|
let chainedKey;
|
|
21
21
|
chainedInputs.value.push(e.key);
|
|
22
22
|
if (chainedInputs.value.length >= 2) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, toValue, useAttrs } from "vue";
|
|
2
|
-
import { useAppConfig } from "#imports";
|
|
3
2
|
import { mergeConfig, omit, get } from "../utils/index.js";
|
|
3
|
+
import { useAppConfig } from "#imports";
|
|
4
4
|
export const useUI = (key, $ui, $config, $wrapperClass, withAppConfig = false) => {
|
|
5
5
|
const $attrs = useAttrs();
|
|
6
6
|
const appConfig = useAppConfig();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from "#imports";
|
|
2
1
|
import { shallowRef } from "vue";
|
|
3
2
|
import { modalInjectionKey } from "../composables/useModal.js";
|
|
3
|
+
import { defineNuxtPlugin } from "#imports";
|
|
4
4
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
5
|
const modalState = shallowRef({
|
|
6
6
|
component: "div",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from "#imports";
|
|
2
1
|
import { shallowRef } from "vue";
|
|
3
2
|
import { slidOverInjectionKey } from "../composables/useSlideover.js";
|
|
3
|
+
import { defineNuxtPlugin } from "#imports";
|
|
4
4
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
5
|
const slideoverState = shallowRef({
|
|
6
6
|
component: "div",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { alert } from '../ui.config'
|
|
2
|
-
import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
|
|
3
|
-
import type { Button } from './button'
|
|
4
|
-
import colors from '#ui-colors'
|
|
5
1
|
import type { AppConfig } from 'nuxt/schema'
|
|
2
|
+
import type { alert } from '../ui.config'
|
|
3
|
+
import type { Button } from './button'
|
|
4
|
+
import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
|
|
5
|
+
import type colors from '#ui-colors'
|
|
6
6
|
|
|
7
7
|
export type AlertColor = keyof typeof alert.color | ExtractDeepKey<AppConfig, ['ui', 'alert', 'color']> | typeof colors[number]
|
|
8
8
|
export type AlertVariant = keyof typeof alert.variant | ExtractDeepKey<AppConfig, ['ui', 'alert', 'variant']> | NestedKeyOf<typeof alert.color> | NestedKeyOf<ExtractDeepObject<AppConfig, ['ui', 'alert', 'color']>>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { avatar } from '../ui.config'
|
|
2
|
-
import type { ExtractDeepKey } from '.'
|
|
3
|
-
import colors from '#ui-colors'
|
|
4
1
|
import type { AppConfig } from 'nuxt/schema'
|
|
2
|
+
import type { avatar } from '../ui.config'
|
|
3
|
+
import type { ExtractDeepKey } from '.'
|
|
4
|
+
import type colors from '#ui-colors'
|
|
5
5
|
|
|
6
6
|
export type AvatarSize = keyof typeof avatar.size | ExtractDeepKey<AppConfig, ['ui', 'avatar', 'size']>
|
|
7
7
|
export type AvatarChipColor = 'gray' | typeof colors[number]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { badge } from '../ui.config'
|
|
2
|
-
import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
|
|
3
|
-
import colors from '#ui-colors'
|
|
4
1
|
import type { AppConfig } from 'nuxt/schema'
|
|
2
|
+
import type { badge } from '../ui.config'
|
|
3
|
+
import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
|
|
4
|
+
import type colors from '#ui-colors'
|
|
5
5
|
|
|
6
6
|
export type BadgeSize = keyof typeof badge.size | ExtractDeepKey<AppConfig, ['ui', 'badge', 'size']>
|
|
7
7
|
export type BadgeColor = keyof typeof badge.color | ExtractDeepKey<AppConfig, ['ui', 'badge', 'color']> | typeof colors[number]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { AppConfig } from 'nuxt/schema'
|
|
2
|
+
import type { button } from '../ui.config'
|
|
1
3
|
import type { Link } from './link'
|
|
2
|
-
import { button } from '../ui.config'
|
|
3
4
|
import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
|
|
4
|
-
import colors from '#ui-colors'
|
|
5
|
-
import type { AppConfig } from 'nuxt/schema'
|
|
5
|
+
import type colors from '#ui-colors'
|
|
6
6
|
|
|
7
7
|
export type ButtonSize = keyof typeof button.size | ExtractDeepKey<AppConfig, ['ui', 'button', 'size']>
|
|
8
8
|
export type ButtonColor = keyof typeof button.color | ExtractDeepKey<AppConfig, ['ui', 'button', 'color']> | typeof colors[number]
|
|
@@ -24,8 +24,6 @@ export interface Button extends Link {
|
|
|
24
24
|
trailingIcon?: string
|
|
25
25
|
trailing?: boolean
|
|
26
26
|
leading?: boolean
|
|
27
|
-
to?: string | object
|
|
28
|
-
target?: string
|
|
29
27
|
square?: boolean
|
|
30
28
|
truncate?: boolean
|
|
31
29
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FuseResultMatch } from 'fuse.js'
|
|
1
|
+
import type { FuseResultMatch } from 'fuse.js'
|
|
2
2
|
import type { Avatar } from './avatar'
|
|
3
3
|
|
|
4
4
|
export interface Command {
|
|
@@ -24,6 +24,6 @@ export interface Group {
|
|
|
24
24
|
commands?: Command[]
|
|
25
25
|
search?: (...args: any[]) => any[] | Promise<any[]>
|
|
26
26
|
filter?: (...args: any[]) => Command[]
|
|
27
|
-
static?:
|
|
27
|
+
static?: boolean
|
|
28
28
|
[key: string]: any
|
|
29
29
|
}
|
|
@@ -5,10 +5,10 @@ T extends new () => { $props: infer P } ? NonNullable<P> :
|
|
|
5
5
|
|
|
6
6
|
export type ComponentSlots<T> =
|
|
7
7
|
T extends new () => { $slots: infer S } ? NonNullable<S> :
|
|
8
|
-
T extends (props: any, ctx: { slots: infer S
|
|
8
|
+
T extends (props: any, ctx: { slots: infer S, attrs: any, emit: any }, ...args: any) => any ? NonNullable<S> :
|
|
9
9
|
{}
|
|
10
10
|
|
|
11
11
|
export type ComponentEmit<T> =
|
|
12
12
|
T extends new () => { $emit: infer E } ? NonNullable<E> :
|
|
13
|
-
T extends (props: any, ctx: { slots: any
|
|
14
|
-
{}
|
|
13
|
+
T extends (props: any, ctx: { slots: any, attrs: any, emit: infer E }, ...args: any) => any ? NonNullable<E> :
|
|
14
|
+
{}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { divider } from '#ui/ui.config'
|
|
2
|
-
|
|
3
|
-
export type DividerSize = keyof typeof divider.border.size.horizontal | keyof typeof divider.border.size.vertical
|
|
1
|
+
import type { divider } from '#ui/ui.config'
|
|
2
|
+
|
|
3
|
+
export type DividerSize = keyof typeof divider.border.size.horizontal | keyof typeof divider.border.size.vertical
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { formGroup } from '../ui.config'
|
|
2
|
-
import type { ExtractDeepKey } from '.'
|
|
3
1
|
import type { AppConfig } from 'nuxt/schema'
|
|
2
|
+
import type { formGroup } from '../ui.config'
|
|
3
|
+
import type { ExtractDeepKey } from '.'
|
|
4
4
|
|
|
5
5
|
export type FormGroupSize = keyof typeof formGroup.size | ExtractDeepKey<AppConfig, ['ui', 'formGroup', 'size']>
|
|
@@ -5,13 +5,18 @@ export interface FormError<T extends string = string> {
|
|
|
5
5
|
message: string
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
export interface ValidateReturnSchema<T> {
|
|
9
|
+
result: T
|
|
10
|
+
errors: FormError[]
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
export interface FormErrorWithId extends FormError {
|
|
9
14
|
id: string
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
export interface Form<T> {
|
|
13
|
-
validate(path?: string | string[], opts?: { silent?: true }): Promise<T | false
|
|
14
|
-
validate(path?: string | string[], opts?: { silent?: false }): Promise<T
|
|
18
|
+
validate(path?: string | string[], opts?: { silent?: true }): Promise<T | false>
|
|
19
|
+
validate(path?: string | string[], opts?: { silent?: false }): Promise<T>
|
|
15
20
|
clear(path?: string): void
|
|
16
21
|
errors: Ref<FormError[]>
|
|
17
22
|
setErrors(errs: FormError[], path?: string): void
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { input } from '../ui.config'
|
|
2
|
-
import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
|
|
3
|
-
import colors from '#ui-colors'
|
|
4
1
|
import type { AppConfig } from 'nuxt/schema'
|
|
2
|
+
import type { input } from '../ui.config'
|
|
3
|
+
import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
|
|
4
|
+
import type colors from '#ui-colors'
|
|
5
5
|
|
|
6
6
|
export type InputSize = keyof typeof input.size | ExtractDeepKey<AppConfig, ['ui', 'input', 'size']>
|
|
7
7
|
export type InputColor = keyof typeof input.color | ExtractDeepKey<AppConfig, ['ui', 'input', 'color']> | typeof colors[number]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { kbd } from '../ui.config'
|
|
2
|
-
import type { ExtractDeepKey } from '.'
|
|
3
1
|
import type { AppConfig } from 'nuxt/schema'
|
|
2
|
+
import type { kbd } from '../ui.config'
|
|
3
|
+
import type { ExtractDeepKey } from '.'
|
|
4
4
|
|
|
5
5
|
export type KbdSize = keyof typeof kbd.size | ExtractDeepKey<AppConfig, ['ui', 'kbd', 'size']>
|