@nuxt/ui 2.18.7 → 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 +45 -37
- package/dist/runtime/components/elements/AvatarGroup.js +2 -2
- package/dist/runtime/components/elements/Carousel.vue +1 -1
- package/dist/runtime/components/elements/Dropdown.vue +6 -2
- 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 +1 -1
- 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 +3 -0
- package/dist/runtime/components/forms/InputMenu.vue +419 -8
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +19 -0
- package/dist/runtime/components/forms/Radio.vue.d.ts +1 -1
- package/dist/runtime/components/forms/RadioGroup.vue +3 -4
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +1 -1
- package/dist/runtime/components/forms/SelectMenu.vue +501 -11
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +30 -2
- package/dist/runtime/components/forms/Textarea.vue +7 -4
- package/dist/runtime/components/forms/Textarea.vue.d.ts +3 -0
- 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/Notifications.vue +1 -1
- package/dist/runtime/components/overlays/Popover.vue +6 -2
- 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/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/lodash.js +1 -1
- package/package.json +21 -19
|
@@ -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
|
};
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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";
|
|
@@ -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
|
}
|
|
@@ -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']>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { meter } from '../ui.config'
|
|
2
|
-
import colors from '#ui-colors'
|
|
1
|
+
import type { meter } from '../ui.config'
|
|
2
|
+
import type colors from '#ui-colors'
|
|
3
3
|
|
|
4
4
|
export type MeterSize = keyof typeof meter.meter.size
|
|
5
5
|
export type MeterColor = keyof typeof meter.color | typeof colors[number]
|
|
@@ -6,7 +6,7 @@ export interface Modal {
|
|
|
6
6
|
transition?: boolean
|
|
7
7
|
preventClose?: boolean
|
|
8
8
|
fullscreen?: boolean
|
|
9
|
-
class?: string |
|
|
9
|
+
class?: string | object | string[]
|
|
10
10
|
ui?: any
|
|
11
11
|
onClose?: () => void
|
|
12
12
|
onClosePrevented?: () => void
|
|
@@ -15,4 +15,4 @@ export interface Modal {
|
|
|
15
15
|
export interface ModalState {
|
|
16
16
|
component: Component | string
|
|
17
17
|
props: Modal
|
|
18
|
-
}
|
|
18
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { progress } from '../ui.config'
|
|
2
|
-
import colors from '#ui-colors'
|
|
1
|
+
import type { progress } from '../ui.config'
|
|
2
|
+
import type colors from '#ui-colors'
|
|
3
3
|
|
|
4
4
|
export type ProgressSize = keyof typeof progress.progress.size
|
|
5
5
|
export type ProgressAnimation = keyof typeof progress.animation
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { range } from '../ui.config'
|
|
2
|
-
import type { ExtractDeepKey } from '.'
|
|
3
1
|
import type { AppConfig } from 'nuxt/schema'
|
|
4
|
-
import
|
|
2
|
+
import type { range } from '../ui.config'
|
|
3
|
+
import type { ExtractDeepKey } from '.'
|
|
4
|
+
import type colors from '#ui-colors'
|
|
5
5
|
|
|
6
6
|
export type RangeSize = keyof typeof range.size | ExtractDeepKey<AppConfig, ['ui', 'range', 'size']>
|
|
7
7
|
export type RangeColor = typeof colors[number]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { select } 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 { select } from '../ui.config'
|
|
3
|
+
import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
|
|
4
|
+
import type colors from '#ui-colors'
|
|
5
5
|
|
|
6
6
|
export type SelectSize = keyof typeof select.size | ExtractDeepKey<AppConfig, ['ui', 'select', 'size']>
|
|
7
7
|
export type SelectColor = keyof typeof select.color | ExtractDeepKey<AppConfig, ['ui', 'select', 'color']> | typeof colors[number]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface TableRow {
|
|
2
|
+
[key: string]: any
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface TableColumn {
|
|
6
|
+
key: string
|
|
7
|
+
sortable?: boolean
|
|
8
|
+
sort?: (a: any, b: any, direction: 'asc' | 'desc') => number
|
|
9
|
+
direction?: 'asc' | 'desc'
|
|
10
|
+
class?: string
|
|
11
|
+
rowClass?: string
|
|
12
|
+
[key: string]: any
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Expanded<T> {
|
|
16
|
+
openedRows: T[]
|
|
17
|
+
row: T | null
|
|
18
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { textarea } 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 { textarea } from '../ui.config'
|
|
3
|
+
import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
|
|
4
|
+
import type colors from '#ui-colors'
|
|
5
5
|
|
|
6
6
|
export type TextareaSize = keyof typeof textarea.size | ExtractDeepKey<AppConfig, ['ui', 'textarea', 'size']>
|
|
7
7
|
export type TextareaColor = keyof typeof textarea.color | ExtractDeepKey<AppConfig, ['ui', 'textarea', 'color']> | typeof colors[number]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { toggle } from '../ui.config'
|
|
2
|
-
import type { ExtractDeepKey } from '.'
|
|
3
1
|
import type { AppConfig } from 'nuxt/schema'
|
|
4
|
-
import
|
|
2
|
+
import type { toggle } from '../ui.config'
|
|
3
|
+
import type { ExtractDeepKey } from '.'
|
|
4
|
+
import type colors from '#ui-colors'
|
|
5
5
|
|
|
6
6
|
export type ToggleSize = keyof typeof toggle.size | ExtractDeepKey<AppConfig, ['ui', 'toggle', 'size']>
|
|
7
7
|
export type ToggleColor = typeof colors[number]
|
|
@@ -14,8 +14,8 @@ export type DeepPartial<T, O = any> = {
|
|
|
14
14
|
|
|
15
15
|
export type NestedKeyOf<ObjectType extends Record<string, any>> = {
|
|
16
16
|
[Key in keyof ObjectType]: ObjectType[Key] extends Record<string, any>
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
? NestedKeyOf<ObjectType[Key]>
|
|
18
|
+
: Key
|
|
19
19
|
}[keyof ObjectType]
|
|
20
20
|
|
|
21
21
|
type DeepKey<T, Keys extends string[]> =
|