@oiij/naive-ui 0.0.77 → 0.0.78
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/components/config-providers/ConfigProviders.vue.d.ts +2 -2
- package/dist/components/copy-button/CopyButton.vue.d.ts +4 -4
- package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +35 -35
- package/dist/components/loading-provider/LoadingProvider.vue.d.ts +2 -2
- package/dist/components/preset-form/PresetForm.vue.d.ts +18 -18
- package/dist/components/preset-input/PresetInput.vue.d.ts +3 -3
- package/dist/components/preset-picker/PresetPicker.vue.d.ts +4 -4
- package/dist/components/preset-select/PresetSelect.vue.d.ts +27 -27
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +11 -11
- package/dist/components/search-input/SearchInput.vue.d.ts +4 -4
- package/dist/components/tooltip-button/TooltipButton.vue.d.ts +4 -4
- package/dist/components/transition/BaseTransition.vue.d.ts +2 -2
- package/dist/composables/index.d.ts +1 -1
- package/dist/composables/use-data-request.d.ts +1 -1
- package/dist/composables/use-naive-menu.d.ts +16 -2
- package/dist/composables/use-naive-menu.js +17 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ConfigProvidersProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue15 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/config-providers/ConfigProviders.vue.d.ts
|
|
5
5
|
declare var __VLS_44: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
default?: (props: typeof __VLS_44) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_base:
|
|
9
|
+
declare const __VLS_base: vue15.DefineComponent<ConfigProvidersProps, {}, {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {}, string, vue15.PublicProps, Readonly<ConfigProvidersProps> & Readonly<{}>, {}, {}, {}, {}, string, vue15.ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
11
|
declare const _default: typeof __VLS_export;
|
|
12
12
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CopyButtonProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue63 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/copy-button/CopyButton.vue.d.ts
|
|
5
5
|
declare var __VLS_9: {}, __VLS_18: {}, __VLS_25: {};
|
|
@@ -10,11 +10,11 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
} & {
|
|
11
11
|
tooltip?: (props: typeof __VLS_25) => any;
|
|
12
12
|
};
|
|
13
|
-
declare const __VLS_base:
|
|
13
|
+
declare const __VLS_base: vue63.DefineComponent<CopyButtonProps, {}, {}, {}, {}, vue63.ComponentOptionsMixin, vue63.ComponentOptionsMixin, {} & {
|
|
14
14
|
copied: (v: string | undefined) => any;
|
|
15
|
-
}, string,
|
|
15
|
+
}, string, vue63.PublicProps, Readonly<CopyButtonProps> & Readonly<{
|
|
16
16
|
onCopied?: ((v: string | undefined) => any) | undefined;
|
|
17
|
-
}>, {}, {}, {}, {}, string,
|
|
17
|
+
}>, {}, {}, {}, {}, string, vue63.ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
19
|
declare const _default: typeof __VLS_export;
|
|
20
20
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { DataTablePlusEmits, DataTablePlusExpose, DataTablePlusProps } from "./index.js";
|
|
3
3
|
import "../../composables/index.js";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
4
|
+
import * as _vueuse_core24 from "@vueuse/core";
|
|
5
|
+
import * as vue33 from "vue";
|
|
6
6
|
import { DataTableBaseColumn, DataTableFilterState, DataTableInst, DataTableSortState } from "naive-ui";
|
|
7
7
|
import { RowKey } from "naive-ui/es/data-table/src/interface";
|
|
8
8
|
|
|
9
9
|
//#region src/components/data-table-plus/DataTablePlus.vue.d.ts
|
|
10
10
|
declare const __VLS_export: <P extends DataObject, D extends DataObject, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
11
|
-
props:
|
|
12
|
-
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
11
|
+
props: vue33.PublicProps & __VLS_PrettifyLocal<DataTablePlusProps<P, D, R> & {
|
|
13
12
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
14
|
-
|
|
13
|
+
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
15
14
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
16
15
|
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
17
16
|
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
17
|
+
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
18
18
|
onClickRow?: ((row: R, index: number, event: MouseEvent, currentData: R[]) => any) | undefined;
|
|
19
19
|
onContextMenuRow?: ((row: R, index: number, event: MouseEvent, currentData: R[]) => any) | undefined;
|
|
20
20
|
"onUpdate:checkedRowKeys"?: ((keys: RowKey[], rows: R[], meta: {
|
|
@@ -27,7 +27,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
27
27
|
}> & (typeof globalThis extends {
|
|
28
28
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
29
29
|
} ? P_1 : {});
|
|
30
|
-
expose: (exposed:
|
|
30
|
+
expose: (exposed: vue33.ShallowUnwrapRef<DataTablePlusExpose<P, D, R>>) => void;
|
|
31
31
|
attrs: any;
|
|
32
32
|
slots: {
|
|
33
33
|
header?: (props: {
|
|
@@ -53,10 +53,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
53
53
|
setParams: (_params: Partial<P>) => void;
|
|
54
54
|
runParams: (_params: Partial<P>) => void;
|
|
55
55
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
56
|
-
onBefore:
|
|
57
|
-
onSuccess:
|
|
58
|
-
onError:
|
|
59
|
-
onFinally:
|
|
56
|
+
onBefore: _vueuse_core24.EventHookOn<[P[]]>;
|
|
57
|
+
onSuccess: _vueuse_core24.EventHookOn<[D, P[]]>;
|
|
58
|
+
onError: _vueuse_core24.EventHookOn<[Error, P[]]>;
|
|
59
|
+
onFinally: _vueuse_core24.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
60
60
|
}) => any;
|
|
61
61
|
} & {
|
|
62
62
|
title?: (props: {}) => any;
|
|
@@ -84,10 +84,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
84
84
|
setParams: (_params: Partial<P>) => void;
|
|
85
85
|
runParams: (_params: Partial<P>) => void;
|
|
86
86
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
87
|
-
onBefore:
|
|
88
|
-
onSuccess:
|
|
89
|
-
onError:
|
|
90
|
-
onFinally:
|
|
87
|
+
onBefore: _vueuse_core24.EventHookOn<[P[]]>;
|
|
88
|
+
onSuccess: _vueuse_core24.EventHookOn<[D, P[]]>;
|
|
89
|
+
onError: _vueuse_core24.EventHookOn<[Error, P[]]>;
|
|
90
|
+
onFinally: _vueuse_core24.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
91
91
|
}) => any;
|
|
92
92
|
} & {
|
|
93
93
|
filter?: (props: {
|
|
@@ -113,10 +113,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
113
113
|
setParams: (_params: Partial<P>) => void;
|
|
114
114
|
runParams: (_params: Partial<P>) => void;
|
|
115
115
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
116
|
-
onBefore:
|
|
117
|
-
onSuccess:
|
|
118
|
-
onError:
|
|
119
|
-
onFinally:
|
|
116
|
+
onBefore: _vueuse_core24.EventHookOn<[P[]]>;
|
|
117
|
+
onSuccess: _vueuse_core24.EventHookOn<[D, P[]]>;
|
|
118
|
+
onError: _vueuse_core24.EventHookOn<[Error, P[]]>;
|
|
119
|
+
onFinally: _vueuse_core24.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
120
120
|
}) => any;
|
|
121
121
|
} & {
|
|
122
122
|
empty?: (props: {
|
|
@@ -142,10 +142,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
142
142
|
setParams: (_params: Partial<P>) => void;
|
|
143
143
|
runParams: (_params: Partial<P>) => void;
|
|
144
144
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
145
|
-
onBefore:
|
|
146
|
-
onSuccess:
|
|
147
|
-
onError:
|
|
148
|
-
onFinally:
|
|
145
|
+
onBefore: _vueuse_core24.EventHookOn<[P[]]>;
|
|
146
|
+
onSuccess: _vueuse_core24.EventHookOn<[D, P[]]>;
|
|
147
|
+
onError: _vueuse_core24.EventHookOn<[Error, P[]]>;
|
|
148
|
+
onFinally: _vueuse_core24.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
149
149
|
}) => any;
|
|
150
150
|
} & {
|
|
151
151
|
loading?: (props: {
|
|
@@ -171,10 +171,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
171
171
|
setParams: (_params: Partial<P>) => void;
|
|
172
172
|
runParams: (_params: Partial<P>) => void;
|
|
173
173
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
174
|
-
onBefore:
|
|
175
|
-
onSuccess:
|
|
176
|
-
onError:
|
|
177
|
-
onFinally:
|
|
174
|
+
onBefore: _vueuse_core24.EventHookOn<[P[]]>;
|
|
175
|
+
onSuccess: _vueuse_core24.EventHookOn<[D, P[]]>;
|
|
176
|
+
onError: _vueuse_core24.EventHookOn<[Error, P[]]>;
|
|
177
|
+
onFinally: _vueuse_core24.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
178
178
|
}) => any;
|
|
179
179
|
} & {
|
|
180
180
|
footer?: (props: {
|
|
@@ -200,10 +200,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
200
200
|
setParams: (_params: Partial<P>) => void;
|
|
201
201
|
runParams: (_params: Partial<P>) => void;
|
|
202
202
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
203
|
-
onBefore:
|
|
204
|
-
onSuccess:
|
|
205
|
-
onError:
|
|
206
|
-
onFinally:
|
|
203
|
+
onBefore: _vueuse_core24.EventHookOn<[P[]]>;
|
|
204
|
+
onSuccess: _vueuse_core24.EventHookOn<[D, P[]]>;
|
|
205
|
+
onError: _vueuse_core24.EventHookOn<[Error, P[]]>;
|
|
206
|
+
onFinally: _vueuse_core24.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
207
207
|
}) => any;
|
|
208
208
|
} & {
|
|
209
209
|
'footer-extra'?: (props: {
|
|
@@ -229,14 +229,14 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
229
229
|
setParams: (_params: Partial<P>) => void;
|
|
230
230
|
runParams: (_params: Partial<P>) => void;
|
|
231
231
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
232
|
-
onBefore:
|
|
233
|
-
onSuccess:
|
|
234
|
-
onError:
|
|
235
|
-
onFinally:
|
|
232
|
+
onBefore: _vueuse_core24.EventHookOn<[P[]]>;
|
|
233
|
+
onSuccess: _vueuse_core24.EventHookOn<[D, P[]]>;
|
|
234
|
+
onError: _vueuse_core24.EventHookOn<[Error, P[]]>;
|
|
235
|
+
onFinally: _vueuse_core24.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
236
236
|
}) => any;
|
|
237
237
|
};
|
|
238
238
|
emit: DataTablePlusEmits<P, D, R>;
|
|
239
|
-
}>) =>
|
|
239
|
+
}>) => vue33.VNode & {
|
|
240
240
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
241
241
|
};
|
|
242
242
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LoadingProviderProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue58 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/loading-provider/LoadingProvider.vue.d.ts
|
|
5
5
|
declare var __VLS_26: {}, __VLS_29: {}, __VLS_31: {};
|
|
@@ -10,7 +10,7 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
} & {
|
|
11
11
|
default?: (props: typeof __VLS_31) => any;
|
|
12
12
|
};
|
|
13
|
-
declare const __VLS_base:
|
|
13
|
+
declare const __VLS_base: vue58.DefineComponent<LoadingProviderProps, {}, {}, {}, {}, vue58.ComponentOptionsMixin, vue58.ComponentOptionsMixin, {}, string, vue58.PublicProps, Readonly<LoadingProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, vue58.ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
15
|
declare const _default: typeof __VLS_export;
|
|
16
16
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { PresetFormExpose, PresetFormProps } from "./index.js";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
3
|
+
import * as _vueuse_core56 from "@vueuse/core";
|
|
4
|
+
import * as vue49 from "vue";
|
|
5
|
+
import * as naive_ui1 from "naive-ui";
|
|
6
6
|
import { FormInst, FormRules } from "naive-ui";
|
|
7
7
|
import * as async_validator0 from "async-validator";
|
|
8
8
|
|
|
9
9
|
//#region src/components/preset-form/PresetForm.vue.d.ts
|
|
10
10
|
declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
11
|
-
props:
|
|
11
|
+
props: vue49.PublicProps & __VLS_PrettifyLocal<PresetFormProps<V> & {
|
|
12
12
|
onValidated?: ((val: V) => any) | undefined;
|
|
13
13
|
}> & (typeof globalThis extends {
|
|
14
14
|
__VLS_PROPS_FALLBACK: infer P;
|
|
15
15
|
} ? P : {});
|
|
16
|
-
expose: (exposed:
|
|
16
|
+
expose: (exposed: vue49.ShallowUnwrapRef<PresetFormExpose<V>>) => void;
|
|
17
17
|
attrs: any;
|
|
18
18
|
slots: {
|
|
19
19
|
header?: (props: {
|
|
20
20
|
formInst: FormInst | null;
|
|
21
21
|
formValue: V;
|
|
22
|
-
formRules: Partial<Record<keyof V, FormRules |
|
|
22
|
+
formRules: Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>;
|
|
23
23
|
formProps: {
|
|
24
|
-
model:
|
|
25
|
-
rules:
|
|
24
|
+
model: vue49.Reactive<V>;
|
|
25
|
+
rules: vue49.Reactive<Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>>;
|
|
26
26
|
};
|
|
27
27
|
setValue: (value: Partial<V>) => void;
|
|
28
28
|
validate: () => Promise<{
|
|
@@ -32,16 +32,16 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
32
32
|
resetForm: () => void;
|
|
33
33
|
reset: () => void;
|
|
34
34
|
clear: () => void;
|
|
35
|
-
onValidated:
|
|
35
|
+
onValidated: _vueuse_core56.EventHookOn<[V]>;
|
|
36
36
|
}) => any;
|
|
37
37
|
} & {
|
|
38
38
|
default?: (props: {
|
|
39
39
|
formInst: FormInst | null;
|
|
40
40
|
formValue: V;
|
|
41
|
-
formRules: Partial<Record<keyof V, FormRules |
|
|
41
|
+
formRules: Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>;
|
|
42
42
|
formProps: {
|
|
43
|
-
model:
|
|
44
|
-
rules:
|
|
43
|
+
model: vue49.Reactive<V>;
|
|
44
|
+
rules: vue49.Reactive<Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>>;
|
|
45
45
|
};
|
|
46
46
|
setValue: (value: Partial<V>) => void;
|
|
47
47
|
validate: () => Promise<{
|
|
@@ -51,16 +51,16 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
51
51
|
resetForm: () => void;
|
|
52
52
|
reset: () => void;
|
|
53
53
|
clear: () => void;
|
|
54
|
-
onValidated:
|
|
54
|
+
onValidated: _vueuse_core56.EventHookOn<[V]>;
|
|
55
55
|
}) => any;
|
|
56
56
|
} & {
|
|
57
57
|
footer?: (props: {
|
|
58
58
|
formInst: FormInst | null;
|
|
59
59
|
formValue: V;
|
|
60
|
-
formRules: Partial<Record<keyof V, FormRules |
|
|
60
|
+
formRules: Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>;
|
|
61
61
|
formProps: {
|
|
62
|
-
model:
|
|
63
|
-
rules:
|
|
62
|
+
model: vue49.Reactive<V>;
|
|
63
|
+
rules: vue49.Reactive<Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>>;
|
|
64
64
|
};
|
|
65
65
|
setValue: (value: Partial<V>) => void;
|
|
66
66
|
validate: () => Promise<{
|
|
@@ -70,11 +70,11 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
70
70
|
resetForm: () => void;
|
|
71
71
|
reset: () => void;
|
|
72
72
|
clear: () => void;
|
|
73
|
-
onValidated:
|
|
73
|
+
onValidated: _vueuse_core56.EventHookOn<[V]>;
|
|
74
74
|
}) => any;
|
|
75
75
|
};
|
|
76
76
|
emit: (e: "validated", val: V) => void;
|
|
77
|
-
}>) =>
|
|
77
|
+
}>) => vue49.VNode & {
|
|
78
78
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
79
79
|
};
|
|
80
80
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PresetInputProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue44 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/preset-input/PresetInput.vue.d.ts
|
|
5
5
|
declare const __VLS_export: <V>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
6
|
-
props:
|
|
6
|
+
props: vue44.PublicProps & __VLS_PrettifyLocal<PresetInputProps<V> & {
|
|
7
7
|
"onUpdate:value"?: ((val?: V | undefined) => any) | undefined;
|
|
8
8
|
}> & (typeof globalThis extends {
|
|
9
9
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -12,7 +12,7 @@ declare const __VLS_export: <V>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
12
12
|
attrs: any;
|
|
13
13
|
slots: {};
|
|
14
14
|
emit: (e: "update:value", val?: V) => void;
|
|
15
|
-
}>) =>
|
|
15
|
+
}>) => vue44.VNode & {
|
|
16
16
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
17
17
|
};
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { PresetPickerEmits, PresetPickerExpose, PresetPickerProps, PresetPickerValue } from "./index.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as vue46 from "vue";
|
|
4
4
|
import { DataTableColumns } from "naive-ui";
|
|
5
5
|
|
|
6
6
|
//#region src/components/preset-picker/PresetPicker.vue.d.ts
|
|
7
7
|
declare const __VLS_export: <V extends PresetPickerValue, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
|
-
props:
|
|
8
|
+
props: vue46.PublicProps & __VLS_PrettifyLocal<PresetPickerProps<V, R> & {
|
|
9
9
|
"onUpdate:value"?: ((val: V | null, raw: R | R[] | null) => any) | undefined;
|
|
10
10
|
onNegativeClick?: (() => any) | undefined;
|
|
11
11
|
onPositiveClick?: (() => any) | undefined;
|
|
12
12
|
}> & (typeof globalThis extends {
|
|
13
13
|
__VLS_PROPS_FALLBACK: infer P;
|
|
14
14
|
} ? P : {});
|
|
15
|
-
expose: (exposed:
|
|
15
|
+
expose: (exposed: vue46.ShallowUnwrapRef<PresetPickerExpose<R>>) => void;
|
|
16
16
|
attrs: any;
|
|
17
17
|
slots: {
|
|
18
18
|
'button-icon'?: (props: {}) => any;
|
|
@@ -49,7 +49,7 @@ declare const __VLS_export: <V extends PresetPickerValue, R extends DataObject>(
|
|
|
49
49
|
'modal-close'?: (props: {}) => any;
|
|
50
50
|
};
|
|
51
51
|
emit: PresetPickerEmits<V, R>;
|
|
52
|
-
}>) =>
|
|
52
|
+
}>) => vue46.VNode & {
|
|
53
53
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
54
54
|
};
|
|
55
55
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { PresetSelectEmits, PresetSelectExpose, PresetSelectProps, PresetSelectValue } from "./index.js";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as _vueuse_core4 from "@vueuse/core";
|
|
4
|
+
import * as vue30 from "vue";
|
|
5
5
|
import { SelectInst, SelectOption } from "naive-ui";
|
|
6
6
|
|
|
7
7
|
//#region src/components/preset-select/PresetSelect.vue.d.ts
|
|
8
8
|
declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject, D extends DataObject, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
9
|
-
props:
|
|
10
|
-
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
9
|
+
props: vue30.PublicProps & __VLS_PrettifyLocal<PresetSelectProps<V, P, D, R> & {
|
|
11
10
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
11
|
+
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
12
12
|
"onUpdate:value"?: ((val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null) => any) | undefined;
|
|
13
13
|
onSearch?: ((val: string) => any) | undefined;
|
|
14
|
-
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
15
14
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
16
15
|
"onUpdate:show"?: ((show: boolean) => any) | undefined;
|
|
17
16
|
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
18
17
|
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
18
|
+
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
19
19
|
}> & (typeof globalThis extends {
|
|
20
20
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
21
21
|
} ? P_1 : {});
|
|
22
|
-
expose: (exposed:
|
|
22
|
+
expose: (exposed: vue30.ShallowUnwrapRef<PresetSelectExpose<P, D, R>>) => void;
|
|
23
23
|
attrs: any;
|
|
24
24
|
slots: {
|
|
25
25
|
header?: (props: {
|
|
@@ -43,10 +43,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
43
43
|
setParams: (_params: Partial<P>) => void;
|
|
44
44
|
runParams: (_params: Partial<P>) => void;
|
|
45
45
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
46
|
-
onBefore:
|
|
47
|
-
onSuccess:
|
|
48
|
-
onError:
|
|
49
|
-
onFinally:
|
|
46
|
+
onBefore: _vueuse_core4.EventHookOn<[P[]]>;
|
|
47
|
+
onSuccess: _vueuse_core4.EventHookOn<[D, P[]]>;
|
|
48
|
+
onError: _vueuse_core4.EventHookOn<[Error, P[]]>;
|
|
49
|
+
onFinally: _vueuse_core4.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
50
50
|
}) => any;
|
|
51
51
|
} & {
|
|
52
52
|
footer?: (props: {
|
|
@@ -70,10 +70,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
70
70
|
setParams: (_params: Partial<P>) => void;
|
|
71
71
|
runParams: (_params: Partial<P>) => void;
|
|
72
72
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
73
|
-
onBefore:
|
|
74
|
-
onSuccess:
|
|
75
|
-
onError:
|
|
76
|
-
onFinally:
|
|
73
|
+
onBefore: _vueuse_core4.EventHookOn<[P[]]>;
|
|
74
|
+
onSuccess: _vueuse_core4.EventHookOn<[D, P[]]>;
|
|
75
|
+
onError: _vueuse_core4.EventHookOn<[Error, P[]]>;
|
|
76
|
+
onFinally: _vueuse_core4.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
77
77
|
}) => any;
|
|
78
78
|
} & {
|
|
79
79
|
'footer-extra'?: (props: {
|
|
@@ -97,10 +97,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
97
97
|
setParams: (_params: Partial<P>) => void;
|
|
98
98
|
runParams: (_params: Partial<P>) => void;
|
|
99
99
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
100
|
-
onBefore:
|
|
101
|
-
onSuccess:
|
|
102
|
-
onError:
|
|
103
|
-
onFinally:
|
|
100
|
+
onBefore: _vueuse_core4.EventHookOn<[P[]]>;
|
|
101
|
+
onSuccess: _vueuse_core4.EventHookOn<[D, P[]]>;
|
|
102
|
+
onError: _vueuse_core4.EventHookOn<[Error, P[]]>;
|
|
103
|
+
onFinally: _vueuse_core4.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
104
104
|
}) => any;
|
|
105
105
|
} & {
|
|
106
106
|
empty?: (props: {
|
|
@@ -124,10 +124,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
124
124
|
setParams: (_params: Partial<P>) => void;
|
|
125
125
|
runParams: (_params: Partial<P>) => void;
|
|
126
126
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
127
|
-
onBefore:
|
|
128
|
-
onSuccess:
|
|
129
|
-
onError:
|
|
130
|
-
onFinally:
|
|
127
|
+
onBefore: _vueuse_core4.EventHookOn<[P[]]>;
|
|
128
|
+
onSuccess: _vueuse_core4.EventHookOn<[D, P[]]>;
|
|
129
|
+
onError: _vueuse_core4.EventHookOn<[Error, P[]]>;
|
|
130
|
+
onFinally: _vueuse_core4.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
131
131
|
}) => any;
|
|
132
132
|
} & {
|
|
133
133
|
arrow?: (props: {
|
|
@@ -151,14 +151,14 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
151
151
|
setParams: (_params: Partial<P>) => void;
|
|
152
152
|
runParams: (_params: Partial<P>) => void;
|
|
153
153
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
154
|
-
onBefore:
|
|
155
|
-
onSuccess:
|
|
156
|
-
onError:
|
|
157
|
-
onFinally:
|
|
154
|
+
onBefore: _vueuse_core4.EventHookOn<[P[]]>;
|
|
155
|
+
onSuccess: _vueuse_core4.EventHookOn<[D, P[]]>;
|
|
156
|
+
onError: _vueuse_core4.EventHookOn<[Error, P[]]>;
|
|
157
|
+
onFinally: _vueuse_core4.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
158
158
|
}) => any;
|
|
159
159
|
};
|
|
160
160
|
emit: PresetSelectEmits<V, P, D, R>;
|
|
161
|
-
}>) =>
|
|
161
|
+
}>) => vue30.VNode & {
|
|
162
162
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
163
163
|
};
|
|
164
164
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { RemoteRequestEmits, RemoteRequestExpose, RemoteRequestProps } from "./index.js";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as _vueuse_core52 from "@vueuse/core";
|
|
4
|
+
import * as vue41 from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/components/remote-request/RemoteRequest.vue.d.ts
|
|
7
7
|
declare const __VLS_export: <P extends DataObject, D extends DataObject, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
|
-
props:
|
|
9
|
-
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
8
|
+
props: vue41.PublicProps & __VLS_PrettifyLocal<RemoteRequestProps<P, D> & {
|
|
10
9
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
11
|
-
|
|
10
|
+
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
12
11
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
12
|
+
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
13
13
|
}> & (typeof globalThis extends {
|
|
14
14
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
15
15
|
} ? P_1 : {});
|
|
16
|
-
expose: (exposed:
|
|
16
|
+
expose: (exposed: vue41.ShallowUnwrapRef<RemoteRequestExpose<P, D, R>>) => void;
|
|
17
17
|
attrs: any;
|
|
18
18
|
slots: {
|
|
19
19
|
default?: (props: {
|
|
@@ -36,14 +36,14 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
36
36
|
setParams: (_params: Partial<P>) => void;
|
|
37
37
|
runParams: (_params: Partial<P>) => void;
|
|
38
38
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
39
|
-
onBefore:
|
|
40
|
-
onSuccess:
|
|
41
|
-
onError:
|
|
42
|
-
onFinally:
|
|
39
|
+
onBefore: _vueuse_core52.EventHookOn<[P[]]>;
|
|
40
|
+
onSuccess: _vueuse_core52.EventHookOn<[D, P[]]>;
|
|
41
|
+
onError: _vueuse_core52.EventHookOn<[Error, P[]]>;
|
|
42
|
+
onFinally: _vueuse_core52.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
43
43
|
}) => any;
|
|
44
44
|
};
|
|
45
45
|
emit: RemoteRequestEmits<P, D>;
|
|
46
|
-
}>) =>
|
|
46
|
+
}>) => vue41.VNode & {
|
|
47
47
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
48
48
|
};
|
|
49
49
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchInputProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue36 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/search-input/SearchInput.vue.d.ts
|
|
5
5
|
declare var __VLS_19: {}, __VLS_21: {}, __VLS_28: {
|
|
@@ -15,11 +15,11 @@ type __VLS_Slots = {} & {
|
|
|
15
15
|
} & {
|
|
16
16
|
'button-icon'?: (props: typeof __VLS_39) => any;
|
|
17
17
|
};
|
|
18
|
-
declare const __VLS_base:
|
|
18
|
+
declare const __VLS_base: vue36.DefineComponent<SearchInputProps, {}, {}, {}, {}, vue36.ComponentOptionsMixin, vue36.ComponentOptionsMixin, {} & {
|
|
19
19
|
"update:value": (v: string | null | undefined) => any;
|
|
20
|
-
}, string,
|
|
20
|
+
}, string, vue36.PublicProps, Readonly<SearchInputProps> & Readonly<{
|
|
21
21
|
"onUpdate:value"?: ((v: string | null | undefined) => any) | undefined;
|
|
22
|
-
}>, {}, {}, {}, {}, string,
|
|
22
|
+
}>, {}, {}, {}, {}, string, vue36.ComponentProvideOptions, false, {}, any>;
|
|
23
23
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TooltipButtonProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue25 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tooltip-button/TooltipButton.vue.d.ts
|
|
5
5
|
declare var __VLS_17: {}, __VLS_20: {}, __VLS_22: {};
|
|
@@ -10,11 +10,11 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
} & {
|
|
11
11
|
tooltip?: (props: typeof __VLS_22) => any;
|
|
12
12
|
};
|
|
13
|
-
declare const __VLS_base:
|
|
13
|
+
declare const __VLS_base: vue25.DefineComponent<TooltipButtonProps, {}, {}, {}, {}, vue25.ComponentOptionsMixin, vue25.ComponentOptionsMixin, {} & {
|
|
14
14
|
click: (ev: MouseEvent) => any;
|
|
15
|
-
}, string,
|
|
15
|
+
}, string, vue25.PublicProps, Readonly<TooltipButtonProps> & Readonly<{
|
|
16
16
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
|
17
|
-
}>, {}, {}, {}, {}, string,
|
|
17
|
+
}>, {}, {}, {}, {}, string, vue25.ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
19
|
declare const _default: typeof __VLS_export;
|
|
20
20
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TransitionProps as TransitionProps$1 } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue20 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/transition/BaseTransition.vue.d.ts
|
|
5
5
|
declare var __VLS_7: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
default?: (props: typeof __VLS_7) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_base:
|
|
9
|
+
declare const __VLS_base: vue20.DefineComponent<TransitionProps$1, {}, {}, {}, {}, vue20.ComponentOptionsMixin, vue20.ComponentOptionsMixin, {}, string, vue20.PublicProps, Readonly<TransitionProps$1> & Readonly<{}>, {}, {}, {}, {}, string, vue20.ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
11
|
declare const _default: typeof __VLS_export;
|
|
12
12
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataObject, DataRequestFields, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest } from "./use-data-request.js";
|
|
2
2
|
import { useLoading } from "./use-loading.js";
|
|
3
3
|
import { UseNaiveFormClearRules, UseNaiveFormOptions, UseNaiveFormReturns, UseNaiveFormRules, useNaiveForm } from "./use-naive-form.js";
|
|
4
|
-
import { UseNaiveMenuOptions, UseNaiveMenuReturn, useNaiveMenu } from "./use-naive-menu.js";
|
|
4
|
+
import { UseNaiveMenuOptions, UseNaiveMenuReturn, flattenDeep, useNaiveMenu } from "./use-naive-menu.js";
|
|
5
5
|
import { UseNaiveThemeOptions, UseNaiveThemeReturns, useNaiveTheme } from "./use-naive-theme.js";
|
|
@@ -58,7 +58,7 @@ declare function useDataRequest<P extends DataObject = DataObject, D extends Dat
|
|
|
58
58
|
loading: Readonly<vue0.Ref<boolean, boolean>>;
|
|
59
59
|
data: Readonly<vue0.Ref<D | undefined, D | undefined>>;
|
|
60
60
|
error: Readonly<vue0.Ref<Error | undefined, Error | undefined>>;
|
|
61
|
-
params: Readonly<vue0.Ref<
|
|
61
|
+
params: Readonly<vue0.Ref<[] | P[], [] | P[]>>;
|
|
62
62
|
list: vue0.ComputedRef<R[]>;
|
|
63
63
|
pagination: vue0.Ref<{
|
|
64
64
|
page: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as vue8 from "vue";
|
|
2
2
|
import { MaybeRefOrGetter, VNodeChild } from "vue";
|
|
3
|
+
import * as naive_ui0 from "naive-ui";
|
|
3
4
|
import { MenuOption } from "naive-ui";
|
|
4
5
|
import { RouteRecordRaw } from "vue-router";
|
|
5
6
|
|
|
@@ -61,6 +62,19 @@ type UseNaiveMenuOptions = {
|
|
|
61
62
|
*/
|
|
62
63
|
createMenuOption?: (route: RouteRecordRaw) => MenuOption;
|
|
63
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* 定义带有可选 children 属性的树形节点类型
|
|
67
|
+
*/
|
|
68
|
+
type TreeNode<T> = T & {
|
|
69
|
+
children?: TreeNode<T>[];
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* 将树形结构扁平化为一维数组
|
|
73
|
+
* @param array 原始树形节点数组
|
|
74
|
+
* @param childrenKey children 属性名,默认为 'children'
|
|
75
|
+
* @returns 扁平化后的数组
|
|
76
|
+
*/
|
|
77
|
+
declare function flattenDeep<T extends Record<string, any>>(array: TreeNode<T>[], childrenKey?: keyof TreeNode<T>): T[];
|
|
64
78
|
/**
|
|
65
79
|
* 自动菜单组合函数
|
|
66
80
|
* 将路由配置转换为菜单配置,并提供扁平化的菜单选项
|
|
@@ -94,11 +108,11 @@ type UseNaiveMenuOptions = {
|
|
|
94
108
|
*/
|
|
95
109
|
declare function useNaiveMenu(routes: MaybeRefOrGetter<RouteRecordRaw[]>, options?: UseNaiveMenuOptions): {
|
|
96
110
|
menuOptions: vue8.ComputedRef<MenuOption[]>;
|
|
97
|
-
flattenedMenuOptions: vue8.ComputedRef<MenuOption[]>;
|
|
111
|
+
flattenedMenuOptions: vue8.ComputedRef<(MenuOption | naive_ui0.MenuGroupOption | naive_ui0.MenuDividerOption)[]>;
|
|
98
112
|
};
|
|
99
113
|
/**
|
|
100
114
|
* useNaiveMenu 返回类型
|
|
101
115
|
*/
|
|
102
116
|
type UseNaiveMenuReturn = ReturnType<typeof useNaiveMenu>;
|
|
103
117
|
//#endregion
|
|
104
|
-
export { UseNaiveMenuOptions, UseNaiveMenuReturn, useNaiveMenu };
|
|
118
|
+
export { UseNaiveMenuOptions, UseNaiveMenuReturn, flattenDeep, useNaiveMenu };
|
|
@@ -48,13 +48,6 @@ function routes2menu(routes, options) {
|
|
|
48
48
|
}
|
|
49
49
|
return menuOptions;
|
|
50
50
|
}
|
|
51
|
-
function flattenDeepMenuOptions(menuOptions) {
|
|
52
|
-
return menuOptions.reduce((flattened, menu) => {
|
|
53
|
-
flattened.push(menu);
|
|
54
|
-
if (menu.children?.length) flattened.push(...flattenDeepMenuOptions(menu.children));
|
|
55
|
-
return flattened;
|
|
56
|
-
}, []);
|
|
57
|
-
}
|
|
58
51
|
function deepUpRouteParentMeta(routes, parentField, parentFilePath, parent) {
|
|
59
52
|
return routes.map((route) => {
|
|
60
53
|
const emptyPathChild = route.children?.find((f) => f.path === parentFilePath);
|
|
@@ -78,6 +71,21 @@ function deepUpRouteParentMeta(routes, parentField, parentFilePath, parent) {
|
|
|
78
71
|
});
|
|
79
72
|
}
|
|
80
73
|
/**
|
|
74
|
+
* 将树形结构扁平化为一维数组
|
|
75
|
+
* @param array 原始树形节点数组
|
|
76
|
+
* @param childrenKey children 属性名,默认为 'children'
|
|
77
|
+
* @returns 扁平化后的数组
|
|
78
|
+
*/
|
|
79
|
+
function flattenDeep(array, childrenKey = "children") {
|
|
80
|
+
return array.reduce((result, item) => {
|
|
81
|
+
const { [childrenKey]: _, ...currentItem } = item;
|
|
82
|
+
result.push(currentItem);
|
|
83
|
+
const children = item[childrenKey];
|
|
84
|
+
if (children && Array.isArray(children)) result.push(...flattenDeep(children, childrenKey));
|
|
85
|
+
return result;
|
|
86
|
+
}, []);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
81
89
|
* 自动菜单组合函数
|
|
82
90
|
* 将路由配置转换为菜单配置,并提供扁平化的菜单选项
|
|
83
91
|
* @param routes 路由配置数组,可以是响应式或普通数组
|
|
@@ -123,11 +131,9 @@ function useNaiveMenu(routes, options) {
|
|
|
123
131
|
});
|
|
124
132
|
return {
|
|
125
133
|
menuOptions,
|
|
126
|
-
flattenedMenuOptions: computed(() =>
|
|
127
|
-
return flattenDeepMenuOptions(menuOptions.value);
|
|
128
|
-
})
|
|
134
|
+
flattenedMenuOptions: computed(() => flattenDeep(menuOptions.value))
|
|
129
135
|
};
|
|
130
136
|
}
|
|
131
137
|
|
|
132
138
|
//#endregion
|
|
133
|
-
export { useNaiveMenu };
|
|
139
|
+
export { flattenDeep, useNaiveMenu };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataObject, DataRequestFields, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest } from "./composables/use-data-request.js";
|
|
2
2
|
import { useLoading } from "./composables/use-loading.js";
|
|
3
3
|
import { UseNaiveFormClearRules, UseNaiveFormOptions, UseNaiveFormReturns, UseNaiveFormRules, useNaiveForm } from "./composables/use-naive-form.js";
|
|
4
|
-
import { UseNaiveMenuOptions, UseNaiveMenuReturn, useNaiveMenu } from "./composables/use-naive-menu.js";
|
|
4
|
+
import { UseNaiveMenuOptions, UseNaiveMenuReturn, flattenDeep, useNaiveMenu } from "./composables/use-naive-menu.js";
|
|
5
5
|
import { UseNaiveThemeOptions, UseNaiveThemeReturns, useNaiveTheme } from "./composables/use-naive-theme.js";
|
|
6
6
|
import "./composables/index.js";
|
|
7
|
-
export { DataObject, DataRequestFields, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, UseNaiveFormClearRules, UseNaiveFormOptions, UseNaiveFormReturns, UseNaiveFormRules, UseNaiveMenuOptions, UseNaiveMenuReturn, UseNaiveThemeOptions, UseNaiveThemeReturns, useDataRequest, useLoading, useNaiveForm, useNaiveMenu, useNaiveTheme };
|
|
7
|
+
export { DataObject, DataRequestFields, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, UseNaiveFormClearRules, UseNaiveFormOptions, UseNaiveFormReturns, UseNaiveFormRules, UseNaiveMenuOptions, UseNaiveMenuReturn, UseNaiveThemeOptions, UseNaiveThemeReturns, flattenDeep, useDataRequest, useLoading, useNaiveForm, useNaiveMenu, useNaiveTheme };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useDataRequest } from "./composables/use-data-request.js";
|
|
2
2
|
import { useLoading } from "./composables/use-loading.js";
|
|
3
3
|
import { useNaiveForm } from "./composables/use-naive-form.js";
|
|
4
|
-
import { useNaiveMenu } from "./composables/use-naive-menu.js";
|
|
4
|
+
import { flattenDeep, useNaiveMenu } from "./composables/use-naive-menu.js";
|
|
5
5
|
import { useNaiveTheme } from "./composables/use-naive-theme.js";
|
|
6
6
|
|
|
7
|
-
export { useDataRequest, useLoading, useNaiveForm, useNaiveMenu, useNaiveTheme };
|
|
7
|
+
export { flattenDeep, useDataRequest, useLoading, useNaiveForm, useNaiveMenu, useNaiveTheme };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oiij/naive-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.78",
|
|
5
5
|
"description": "Some Composable Functions And Components for Vue 3",
|
|
6
6
|
"author": "oiij",
|
|
7
7
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"vue-component-type-helpers": "^3.2.4",
|
|
47
47
|
"vue-hooks-plus": "^2.4.1",
|
|
48
48
|
"vue-router": "^5.0.2",
|
|
49
|
-
"@oiij/use": "0.0.
|
|
49
|
+
"@oiij/use": "0.0.48",
|
|
50
50
|
"@oiij/css-render": "0.0.11"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vue-hooks-plus": "^2.4.1",
|
|
63
63
|
"vue-router": "^5.0.2",
|
|
64
64
|
"@oiij/css-render": "0.0.11",
|
|
65
|
-
"@oiij/use": "0.0.
|
|
65
|
+
"@oiij/use": "0.0.48"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|