@oiij/naive-ui 0.0.80 → 0.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +351 -87
- package/dist/_virtual/_/plugin-vue/export-helper.js +1 -2
- package/dist/components/_utils/cssr-bem.js +1 -3
- package/dist/components/config-providers/ConfigProviders.js +3 -6
- package/dist/components/config-providers/ConfigProviders.vue.d.ts +2 -2
- package/dist/components/config-providers/index.d.ts +0 -1
- package/dist/components/copy-button/CopyButton.js +3 -6
- package/dist/components/copy-button/CopyButton.vue.d.ts +4 -4
- package/dist/components/data-table-plus/DataTablePlus.js +3 -6
- package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +38 -39
- package/dist/components/icons/MageCopyFill.js +1 -3
- package/dist/components/icons/MageMultiplyCircleFill.js +1 -3
- package/dist/components/icons/MageSearch.js +1 -3
- package/dist/components/index.d.ts +0 -1
- package/dist/components/loading-provider/LoadingProvider.js +3 -6
- package/dist/components/loading-provider/LoadingProvider.vue.d.ts +2 -2
- package/dist/components/loading-provider/index.js +2 -4
- package/dist/components/loading-provider/loading-provider.cssr.js +1 -3
- package/dist/components/preset-form/PresetForm.js +7 -9
- package/dist/components/preset-form/PresetForm.vue.d.ts +21 -18
- package/dist/components/preset-form/_utils.js +1 -2
- package/dist/components/preset-input/PresetInput.js +3 -6
- package/dist/components/preset-input/PresetInput.vue.d.ts +3 -3
- package/dist/components/preset-picker/PresetPicker.js +1 -4
- package/dist/components/preset-picker/PresetPicker.vue.d.ts +4 -4
- package/dist/components/preset-select/PresetSelect.js +1 -4
- package/dist/components/preset-select/PresetSelect.vue.d.ts +29 -29
- package/dist/components/remote-request/RemoteRequest.js +1 -4
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +11 -11
- package/dist/components/search-input/SearchInput.js +1 -4
- package/dist/components/search-input/SearchInput.vue.d.ts +4 -4
- package/dist/components/toggle-input/ToggleInput.js +1 -4
- package/dist/components/toggle-input/ToggleInput.vue.d.ts +5 -5
- package/dist/components/tooltip-button/TooltipButton.js +1 -4
- package/dist/components/tooltip-button/TooltipButton.vue.d.ts +4 -4
- package/dist/components/transition/BaseTransition.js +1 -4
- package/dist/components/transition/BaseTransition.vue.d.ts +2 -2
- package/dist/components/transition/transition.cssr.js +1 -3
- package/dist/components.d.ts +0 -1
- package/dist/components.js +14 -15
- package/dist/composables/_helper.js +1 -3
- package/dist/composables/use-data-request.d.ts +7 -7
- package/dist/composables/use-data-request.js +1 -3
- package/dist/composables/use-loading.js +1 -3
- package/dist/composables/use-naive-form.d.ts +7 -6
- package/dist/composables/use-naive-form.js +15 -14
- package/dist/composables/use-naive-menu.d.ts +3 -3
- package/dist/composables/use-naive-menu.js +1 -3
- package/dist/composables/use-naive-theme.js +1 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/package.json +20 -20
|
@@ -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_core0 from "@vueuse/core";
|
|
4
|
+
import * as vue 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: vue.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
|
-
onSearch?: ((val: string) => any) | undefined;
|
|
14
|
-
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
15
13
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
16
|
-
"onUpdate:show"?: ((show: boolean) => any) | undefined;
|
|
17
14
|
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
18
15
|
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
16
|
+
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
17
|
+
onSearch?: ((val: string) => any) | undefined;
|
|
18
|
+
"onUpdate:show"?: ((show: boolean) => 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: vue.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_core0.EventHookOn<[P[]]>;
|
|
47
|
+
onSuccess: _vueuse_core0.EventHookOn<[D, P[]]>;
|
|
48
|
+
onError: _vueuse_core0.EventHookOn<[Error, P[]]>;
|
|
49
|
+
onFinally: _vueuse_core0.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_core0.EventHookOn<[P[]]>;
|
|
74
|
+
onSuccess: _vueuse_core0.EventHookOn<[D, P[]]>;
|
|
75
|
+
onError: _vueuse_core0.EventHookOn<[Error, P[]]>;
|
|
76
|
+
onFinally: _vueuse_core0.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_core0.EventHookOn<[P[]]>;
|
|
101
|
+
onSuccess: _vueuse_core0.EventHookOn<[D, P[]]>;
|
|
102
|
+
onError: _vueuse_core0.EventHookOn<[Error, P[]]>;
|
|
103
|
+
onFinally: _vueuse_core0.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_core0.EventHookOn<[P[]]>;
|
|
128
|
+
onSuccess: _vueuse_core0.EventHookOn<[D, P[]]>;
|
|
129
|
+
onError: _vueuse_core0.EventHookOn<[Error, P[]]>;
|
|
130
|
+
onFinally: _vueuse_core0.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_core0.EventHookOn<[P[]]>;
|
|
155
|
+
onSuccess: _vueuse_core0.EventHookOn<[D, P[]]>;
|
|
156
|
+
onError: _vueuse_core0.EventHookOn<[Error, P[]]>;
|
|
157
|
+
onFinally: _vueuse_core0.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
158
158
|
}) => any;
|
|
159
159
|
};
|
|
160
160
|
emit: PresetSelectEmits<V, P, D, R>;
|
|
161
|
-
}>) =>
|
|
161
|
+
}>) => vue.VNode & {
|
|
162
162
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
163
163
|
};
|
|
164
164
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useDataRequest } from "../../composables/use-data-request.js";
|
|
2
2
|
import { computed, defineComponent, guardReactiveProps, normalizeProps, renderSlot } from "vue";
|
|
3
|
-
|
|
4
3
|
//#region src/components/remote-request/RemoteRequest.vue
|
|
5
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
5
|
__name: "RemoteRequest",
|
|
@@ -84,7 +83,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
84
83
|
};
|
|
85
84
|
}
|
|
86
85
|
});
|
|
87
|
-
var RemoteRequest_default = _sfc_main;
|
|
88
|
-
|
|
89
86
|
//#endregion
|
|
90
|
-
export {
|
|
87
|
+
export { _sfc_main as default };
|
|
@@ -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_core0 from "@vueuse/core";
|
|
4
|
+
import * as vue 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: vue.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: vue.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_core0.EventHookOn<[P[]]>;
|
|
40
|
+
onSuccess: _vueuse_core0.EventHookOn<[D, P[]]>;
|
|
41
|
+
onError: _vueuse_core0.EventHookOn<[Error, P[]]>;
|
|
42
|
+
onFinally: _vueuse_core0.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
43
43
|
}) => any;
|
|
44
44
|
};
|
|
45
45
|
emit: RemoteRequestEmits<P, D>;
|
|
46
|
-
}>) =>
|
|
46
|
+
}>) => vue.VNode & {
|
|
47
47
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
48
48
|
};
|
|
49
49
|
declare const _default: typeof __VLS_export;
|
|
@@ -2,7 +2,6 @@ import MageSearch_default from "../icons/MageSearch.js";
|
|
|
2
2
|
import { useDebounceFn, useTimeoutFn } from "@vueuse/core";
|
|
3
3
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createSlots, createTextVNode, createVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, unref, useTemplateRef, watch, watchEffect, withCtx } from "vue";
|
|
4
4
|
import { NButton, NInput, NInputGroup } from "naive-ui";
|
|
5
|
-
|
|
6
5
|
//#region src/components/search-input/SearchInput.vue
|
|
7
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
7
|
__name: "SearchInput",
|
|
@@ -79,7 +78,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
79
78
|
};
|
|
80
79
|
}
|
|
81
80
|
});
|
|
82
|
-
var SearchInput_default = _sfc_main;
|
|
83
|
-
|
|
84
81
|
//#endregion
|
|
85
|
-
export {
|
|
82
|
+
export { _sfc_main as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchInputProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue 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: vue.DefineComponent<SearchInputProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
19
19
|
"update:value": (v: string | null | undefined) => any;
|
|
20
|
-
}, string,
|
|
20
|
+
}, string, vue.PublicProps, Readonly<SearchInputProps> & Readonly<{
|
|
21
21
|
"onUpdate:value"?: ((v: string | null | undefined) => any) | undefined;
|
|
22
|
-
}>, {}, {}, {}, {}, string,
|
|
22
|
+
}>, {}, {}, {}, {}, string, vue.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,6 +1,5 @@
|
|
|
1
1
|
import { createElementBlock, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, nextTick, normalizeProps, openBlock, ref, renderSlot, toDisplayString, unref, useModel, useTemplateRef, watchEffect } from "vue";
|
|
2
2
|
import { NInput } from "naive-ui";
|
|
3
|
-
|
|
4
3
|
//#region src/components/toggle-input/ToggleInput.vue
|
|
5
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
5
|
__name: "ToggleInput",
|
|
@@ -58,7 +57,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
58
57
|
};
|
|
59
58
|
}
|
|
60
59
|
});
|
|
61
|
-
var ToggleInput_default = _sfc_main;
|
|
62
|
-
|
|
63
60
|
//#endregion
|
|
64
|
-
export {
|
|
61
|
+
export { _sfc_main as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClassStyle } from "../data-table-plus/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue from "vue";
|
|
3
3
|
import { InputProps } from "naive-ui";
|
|
4
4
|
|
|
5
5
|
//#region src/components/toggle-input/ToggleInput.vue.d.ts
|
|
@@ -27,14 +27,14 @@ type __VLS_Slots = {} & {
|
|
|
27
27
|
} & {
|
|
28
28
|
default?: (props: typeof __VLS_13) => any;
|
|
29
29
|
};
|
|
30
|
-
declare const __VLS_base:
|
|
30
|
+
declare const __VLS_base: vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
31
31
|
"update:value": (value: string | number | undefined) => any;
|
|
32
32
|
} & {
|
|
33
33
|
trigger: () => any;
|
|
34
|
-
}, string,
|
|
35
|
-
"onUpdate:value"?: ((value: string | number | undefined) => any) | undefined;
|
|
34
|
+
}, string, vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
36
35
|
onTrigger?: (() => any) | undefined;
|
|
37
|
-
|
|
36
|
+
"onUpdate:value"?: ((value: string | number | undefined) => any) | undefined;
|
|
37
|
+
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
38
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
39
39
|
declare const _default: typeof __VLS_export;
|
|
40
40
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createBlock, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
2
2
|
import { NButton, NTooltip } from "naive-ui";
|
|
3
|
-
|
|
4
3
|
//#region src/components/tooltip-button/TooltipButton.vue
|
|
5
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
5
|
__name: "TooltipButton",
|
|
@@ -25,7 +24,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
24
|
};
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
|
-
var TooltipButton_default = _sfc_main;
|
|
29
|
-
|
|
30
27
|
//#endregion
|
|
31
|
-
export {
|
|
28
|
+
export { _sfc_main as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TooltipButtonProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tooltip-button/TooltipButton.vue.d.ts
|
|
5
5
|
declare var __VLS_9: {}, __VLS_19: {}, __VLS_22: {}, __VLS_24: {};
|
|
@@ -12,11 +12,11 @@ type __VLS_Slots = {} & {
|
|
|
12
12
|
} & {
|
|
13
13
|
tooltip?: (props: typeof __VLS_24) => any;
|
|
14
14
|
};
|
|
15
|
-
declare const __VLS_base:
|
|
15
|
+
declare const __VLS_base: vue.DefineComponent<TooltipButtonProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
16
16
|
click: (ev: MouseEvent) => any;
|
|
17
|
-
}, string,
|
|
17
|
+
}, string, vue.PublicProps, Readonly<TooltipButtonProps> & Readonly<{
|
|
18
18
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
|
19
|
-
}>, {}, {}, {}, {}, string,
|
|
19
|
+
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
21
|
declare const _default: typeof __VLS_export;
|
|
22
22
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -2,7 +2,6 @@ import { namespace } from "../_utils/cssr-bem.js";
|
|
|
2
2
|
import { cName, transitionCssr } from "./transition.cssr.js";
|
|
3
3
|
import { Transition, createBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
4
4
|
import { useStyle } from "@oiij/css-render";
|
|
5
|
-
|
|
6
5
|
//#region src/components/transition/BaseTransition.vue
|
|
7
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
7
|
__name: "BaseTransition",
|
|
@@ -24,7 +23,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
});
|
|
27
|
-
var BaseTransition_default = _sfc_main;
|
|
28
|
-
|
|
29
26
|
//#endregion
|
|
30
|
-
export {
|
|
27
|
+
export { _sfc_main as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TransitionProps as TransitionProps$1 } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue 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: vue.DefineComponent<TransitionProps$1, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<TransitionProps$1> & Readonly<{}>, {}, {}, {}, {}, string, vue.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,4 @@
|
|
|
1
1
|
import { cssr, namespace, plugin } from "../_utils/cssr-bem.js";
|
|
2
|
-
|
|
3
2
|
//#region src/components/transition/transition.cssr.ts
|
|
4
3
|
const { c } = cssr;
|
|
5
4
|
const { cB } = plugin;
|
|
@@ -15,6 +14,5 @@ function fadeTransition({ name = "fade", enterDuration = ".3s", leaveDuration =
|
|
|
15
14
|
function transitionCssr() {
|
|
16
15
|
return c([fadeTransition()]);
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
//#endregion
|
|
20
|
-
export { cName, transitionCssr };
|
|
18
|
+
export { cName, transitionCssr };
|
package/dist/components.d.ts
CHANGED
|
@@ -24,6 +24,5 @@ import { _default as _default$11 } from "./components/tooltip-button/TooltipButt
|
|
|
24
24
|
import { TooltipButtonProps } from "./components/tooltip-button/index.js";
|
|
25
25
|
import { _default as _default$12 } from "./components/transition/BaseTransition.vue.js";
|
|
26
26
|
import { TransitionProps } from "./components/transition/index.js";
|
|
27
|
-
import "./components/index.js";
|
|
28
27
|
import { ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots } from "vue-component-type-helpers";
|
|
29
28
|
export { ArrayAwareType, ClassStyle, ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots, ConfigProvidersProps, CopyButtonProps, DataTablePlusEmits, DataTablePlusExpose, DataTablePlusFields, DataTablePlusInst, DataTablePlusProps, LOADING_PROVIDER_INJECTION_KEY, LoadingProviderInst, LoadingProviderProps, _default as NConfigProviders, _default$1 as NCopyButton, _default$2 as NDataTablePlus, _default$3 as NLoadingProvider, _default$4 as NPresetForm, _default$5 as NPresetInput, _default$6 as NPresetPicker, _default$7 as NPresetSelect, _default$8 as NRemoteRequest, _default$9 as NSearchInput, _default$10 as NToggleInput, _default$11 as NTooltipButton, _default$12 as NTransition, OptionFormat, PresetFormExpose, PresetFormInst, PresetFormOptionItem, PresetFormOptions, PresetFormProps, PresetInputOptions, PresetInputProps, PresetInputType, PresetPickerEmits, PresetPickerExpose, PresetPickerInst, PresetPickerProps, PresetPickerValue, PresetSelectEmits, PresetSelectExpose, PresetSelectFields, PresetSelectInst, PresetSelectProps, PresetSelectValue, RemoteRequestEmits, RemoteRequestExpose, RemoteRequestFields, RemoteRequestInst, RemoteRequestProps, SearchInputProps, TooltipButtonProps, TransitionProps, UseNaiveFormRules };
|
package/dist/components.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _sfc_main$12 from "./components/transition/BaseTransition.js";
|
|
2
|
+
import _sfc_main$3 from "./components/loading-provider/LoadingProvider.js";
|
|
3
3
|
import { LOADING_PROVIDER_INJECTION_KEY } from "./components/loading-provider/index.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
4
|
+
import _sfc_main from "./components/config-providers/ConfigProviders.js";
|
|
5
|
+
import _sfc_main$11 from "./components/tooltip-button/TooltipButton.js";
|
|
6
|
+
import _sfc_main$1 from "./components/copy-button/CopyButton.js";
|
|
7
|
+
import _sfc_main$9 from "./components/search-input/SearchInput.js";
|
|
8
|
+
import _sfc_main$2 from "./components/data-table-plus/DataTablePlus.js";
|
|
9
|
+
import _sfc_main$5 from "./components/preset-input/PresetInput.js";
|
|
10
|
+
import _sfc_main$4 from "./components/preset-form/PresetForm.js";
|
|
11
|
+
import _sfc_main$6 from "./components/preset-picker/PresetPicker.js";
|
|
12
|
+
import _sfc_main$7 from "./components/preset-select/PresetSelect.js";
|
|
13
|
+
import _sfc_main$8 from "./components/remote-request/RemoteRequest.js";
|
|
14
|
+
import _sfc_main$10 from "./components/toggle-input/ToggleInput.js";
|
|
15
15
|
import { ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots } from "vue-component-type-helpers";
|
|
16
|
-
|
|
17
|
-
export { ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots, LOADING_PROVIDER_INJECTION_KEY, ConfigProviders_default as NConfigProviders, CopyButton_default as NCopyButton, DataTablePlus_default as NDataTablePlus, LoadingProvider_default as NLoadingProvider, PresetForm_default as NPresetForm, PresetInput_default as NPresetInput, PresetPicker_default as NPresetPicker, PresetSelect_default as NPresetSelect, RemoteRequest_default as NRemoteRequest, SearchInput_default as NSearchInput, ToggleInput_default as NToggleInput, TooltipButton_default as NTooltipButton, BaseTransition_default as NTransition };
|
|
16
|
+
export { ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots, LOADING_PROVIDER_INJECTION_KEY, _sfc_main as NConfigProviders, _sfc_main$1 as NCopyButton, _sfc_main$2 as NDataTablePlus, _sfc_main$3 as NLoadingProvider, _sfc_main$4 as NPresetForm, _sfc_main$5 as NPresetInput, _sfc_main$6 as NPresetPicker, _sfc_main$7 as NPresetSelect, _sfc_main$8 as NRemoteRequest, _sfc_main$9 as NSearchInput, _sfc_main$10 as NToggleInput, _sfc_main$11 as NTooltipButton, _sfc_main$12 as NTransition };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { colord } from "colord";
|
|
2
|
-
|
|
3
2
|
//#region src/composables/_helper.ts
|
|
4
3
|
/**
|
|
5
4
|
* 获取变亮的颜色
|
|
@@ -84,6 +83,5 @@ function getColors(colors) {
|
|
|
84
83
|
error: getStatusColor(error)
|
|
85
84
|
};
|
|
86
85
|
}
|
|
87
|
-
|
|
88
86
|
//#endregion
|
|
89
|
-
export { getColors, getDarkColors };
|
|
87
|
+
export { getColors, getDarkColors };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _vueuse_core0 from "@vueuse/core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue from "vue";
|
|
3
3
|
import { MaybeRefOrGetter } from "vue";
|
|
4
4
|
import { UseRequestOptions, UseRequestPlugin } from "vue-hooks-plus/es/useRequest/types";
|
|
5
5
|
|
|
@@ -56,12 +56,12 @@ type UseDataRequestPagination = {
|
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
declare function useDataRequest<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject>(api: (...args: P[]) => Promise<D>, options?: UseDataRequestOptions<P, D>): {
|
|
59
|
-
loading: Readonly<
|
|
60
|
-
data: Readonly<
|
|
61
|
-
error: Readonly<
|
|
62
|
-
params: Readonly<
|
|
63
|
-
list:
|
|
64
|
-
pagination:
|
|
59
|
+
loading: Readonly<vue.Ref<boolean, boolean>>;
|
|
60
|
+
data: Readonly<vue.Ref<D | undefined, D | undefined>>;
|
|
61
|
+
error: Readonly<vue.Ref<Error | undefined, Error | undefined>>;
|
|
62
|
+
params: Readonly<vue.Ref<[] | P[], [] | P[]>>;
|
|
63
|
+
list: vue.ComputedRef<R[]>;
|
|
64
|
+
pagination: vue.Ref<{
|
|
65
65
|
page: number;
|
|
66
66
|
pageSize: number;
|
|
67
67
|
itemCount: number;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createEventHook } from "@vueuse/core";
|
|
2
2
|
import { computed, ref, toValue } from "vue";
|
|
3
3
|
import useRequest from "vue-hooks-plus/es/useRequest";
|
|
4
|
-
|
|
5
4
|
//#region src/composables/use-data-request.ts
|
|
6
5
|
/**
|
|
7
6
|
* 用于处理数据请求的组合式 API
|
|
@@ -138,6 +137,5 @@ function useDataRequest(api, options) {
|
|
|
138
137
|
onFinally: onFinallyEvent.on
|
|
139
138
|
};
|
|
140
139
|
}
|
|
141
|
-
|
|
142
140
|
//#endregion
|
|
143
|
-
export { useDataRequest };
|
|
141
|
+
export { useDataRequest };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LOADING_PROVIDER_INJECTION_KEY } from "../components/loading-provider/index.js";
|
|
2
2
|
import { inject } from "vue";
|
|
3
|
-
|
|
4
3
|
//#region src/composables/use-loading.ts
|
|
5
4
|
/**
|
|
6
5
|
* 用于获取 Naive UI 加载状态提供者的组合式 API
|
|
@@ -19,6 +18,5 @@ import { inject } from "vue";
|
|
|
19
18
|
function useLoading() {
|
|
20
19
|
return inject(LOADING_PROVIDER_INJECTION_KEY);
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
//#endregion
|
|
24
|
-
export { useLoading };
|
|
22
|
+
export { useLoading };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataObject } from "./use-data-request.js";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _vueuse_core0 from "@vueuse/core";
|
|
3
|
+
import * as vue from "vue";
|
|
4
4
|
import { MaybeRefOrGetter, Ref, TemplateRef } from "vue";
|
|
5
5
|
import { FormInst, FormItemRule, FormRules } from "naive-ui";
|
|
6
6
|
import { ValidateError } from "async-validator";
|
|
@@ -45,12 +45,12 @@ type UseNaiveFormOptions<T extends DataObject> = {
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
declare function useNaiveForm<T extends DataObject = DataObject>(formInstRef: TemplateRef<FormInst>, options?: UseNaiveFormOptions<T>): {
|
|
48
|
-
formInst: Readonly<
|
|
48
|
+
formInst: Readonly<vue.ShallowRef<FormInst | null>>;
|
|
49
49
|
formValues: Ref<T, T>;
|
|
50
50
|
formRules: Ref<Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>>, Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>>>;
|
|
51
51
|
formProps: {
|
|
52
|
-
model:
|
|
53
|
-
rules:
|
|
52
|
+
model: vue.Reactive<T>;
|
|
53
|
+
rules: vue.Reactive<Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>>>;
|
|
54
54
|
};
|
|
55
55
|
setValue: (value: Partial<T>) => void;
|
|
56
56
|
validate: () => Promise<{
|
|
@@ -60,7 +60,8 @@ declare function useNaiveForm<T extends DataObject = DataObject>(formInstRef: Te
|
|
|
60
60
|
resetForm: () => void;
|
|
61
61
|
reset: () => void;
|
|
62
62
|
clear: () => void;
|
|
63
|
-
onValidated:
|
|
63
|
+
onValidated: _vueuse_core0.EventHookOn<[T]>;
|
|
64
|
+
onUpdateValue: _vueuse_core0.EventHookOn<[T]>;
|
|
64
65
|
};
|
|
65
66
|
/**
|
|
66
67
|
* useNaiveForm 返回类型
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { createEventHook } from "@vueuse/core";
|
|
2
|
-
import { reactive, ref, toRaw, toValue,
|
|
2
|
+
import { reactive, ref, toRaw, toValue, watch } from "vue";
|
|
3
3
|
import { cloneDeep } from "es-toolkit/object";
|
|
4
4
|
import { isPlainObject } from "es-toolkit/predicate";
|
|
5
|
-
|
|
6
5
|
//#region src/composables/use-naive-form.ts
|
|
7
6
|
function clearObjectValues(obj, rules) {
|
|
8
7
|
const { string: _string = "", number: _number = null, boolean: _boolean = false } = rules ?? {};
|
|
@@ -11,7 +10,7 @@ function clearObjectValues(obj, rules) {
|
|
|
11
10
|
return obj;
|
|
12
11
|
}
|
|
13
12
|
if (isPlainObject(obj)) {
|
|
14
|
-
for (const key in obj) if (Object.
|
|
13
|
+
for (const key in obj) if (Object.hasOwn(obj, key)) obj[key] = clearObjectValues(obj[key], rules);
|
|
15
14
|
return obj;
|
|
16
15
|
}
|
|
17
16
|
if (typeof obj === "string") return _string;
|
|
@@ -37,19 +36,21 @@ function clearObjectValues(obj, rules) {
|
|
|
37
36
|
function useNaiveForm(formInstRef, options) {
|
|
38
37
|
const { values, rules, clearRules } = options ?? {};
|
|
39
38
|
const cacheValue = cloneDeep(toValue(values) ?? {});
|
|
39
|
+
const onUpdateValueEvent = createEventHook();
|
|
40
|
+
const onValidatedEvent = createEventHook();
|
|
40
41
|
const formValuesRef = ref(toValue(values) ?? {});
|
|
41
|
-
|
|
42
|
-
formValuesRef.value =
|
|
43
|
-
|
|
42
|
+
watch(() => toValue(values), (newValues) => {
|
|
43
|
+
formValuesRef.value = newValues ?? {};
|
|
44
|
+
onUpdateValueEvent.trigger(toRaw(formValuesRef.value));
|
|
45
|
+
}, { deep: true });
|
|
44
46
|
const formRulesRef = ref(toValue(rules));
|
|
45
|
-
|
|
46
|
-
formRulesRef.value =
|
|
47
|
-
});
|
|
47
|
+
watch(() => toValue(rules), (newRules) => {
|
|
48
|
+
formRulesRef.value = newRules ?? {};
|
|
49
|
+
}, { deep: true });
|
|
48
50
|
const formProps = {
|
|
49
51
|
model: reactive(formValuesRef.value),
|
|
50
52
|
rules: reactive(formRulesRef.value)
|
|
51
53
|
};
|
|
52
|
-
const onValidatedEvent = createEventHook();
|
|
53
54
|
/**
|
|
54
55
|
* 设置表单值
|
|
55
56
|
* @param value - 要设置的值
|
|
@@ -77,7 +78,7 @@ function useNaiveForm(formInstRef, options) {
|
|
|
77
78
|
if (!formInstRef.value) throw new Error("useNaiveForm: formInstRef is not found.");
|
|
78
79
|
return new Promise((resolve, reject) => {
|
|
79
80
|
formInstRef.value?.validate().then((res) => {
|
|
80
|
-
onValidatedEvent.trigger(toRaw(
|
|
81
|
+
onValidatedEvent.trigger(toRaw(formValuesRef.value));
|
|
81
82
|
return resolve(res);
|
|
82
83
|
}).catch(reject);
|
|
83
84
|
});
|
|
@@ -135,9 +136,9 @@ function useNaiveForm(formInstRef, options) {
|
|
|
135
136
|
resetForm,
|
|
136
137
|
reset,
|
|
137
138
|
clear,
|
|
138
|
-
onValidated: onValidatedEvent.on
|
|
139
|
+
onValidated: onValidatedEvent.on,
|
|
140
|
+
onUpdateValue: onUpdateValueEvent.on
|
|
139
141
|
};
|
|
140
142
|
}
|
|
141
|
-
|
|
142
143
|
//#endregion
|
|
143
|
-
export { useNaiveForm };
|
|
144
|
+
export { useNaiveForm };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue from "vue";
|
|
2
2
|
import { MaybeRefOrGetter, VNodeChild } from "vue";
|
|
3
3
|
import * as naive_ui0 from "naive-ui";
|
|
4
4
|
import { MenuOption } from "naive-ui";
|
|
@@ -107,8 +107,8 @@ declare function flattenDeep<T extends Record<string, any>>(array: TreeNode<T>[]
|
|
|
107
107
|
* ```
|
|
108
108
|
*/
|
|
109
109
|
declare function useNaiveMenu(routes: MaybeRefOrGetter<RouteRecordRaw[]>, options?: UseNaiveMenuOptions): {
|
|
110
|
-
menuOptions:
|
|
111
|
-
flattenedMenuOptions:
|
|
110
|
+
menuOptions: vue.ComputedRef<MenuOption[]>;
|
|
111
|
+
flattenedMenuOptions: vue.ComputedRef<(MenuOption | naive_ui0.MenuGroupOption | naive_ui0.MenuDividerOption)[]>;
|
|
112
112
|
};
|
|
113
113
|
/**
|
|
114
114
|
* useNaiveMenu 返回类型
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { computed, toValue } from "vue";
|
|
2
|
-
|
|
3
2
|
//#region src/composables/use-naive-menu.ts
|
|
4
3
|
function getConfigValue(route, config, returnType, defaultValue) {
|
|
5
4
|
if (!config) return defaultValue;
|
|
@@ -134,6 +133,5 @@ function useNaiveMenu(routes, options) {
|
|
|
134
133
|
flattenedMenuOptions: computed(() => flattenDeep(menuOptions.value))
|
|
135
134
|
};
|
|
136
135
|
}
|
|
137
|
-
|
|
138
136
|
//#endregion
|
|
139
|
-
export { flattenDeep, useNaiveMenu };
|
|
137
|
+
export { flattenDeep, useNaiveMenu };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getColors, getDarkColors } from "./_helper.js";
|
|
2
2
|
import { computed, ref, toValue, watchEffect } from "vue";
|
|
3
3
|
import { darkTheme, dateEnUS, dateZhCN, enUS, zhCN } from "naive-ui";
|
|
4
|
-
|
|
5
4
|
//#region src/composables/use-naive-theme.ts
|
|
6
5
|
const naiveLocaleMap = {
|
|
7
6
|
"zh-CN": {
|
|
@@ -125,6 +124,5 @@ function useNaiveTheme(options) {
|
|
|
125
124
|
setColor
|
|
126
125
|
};
|
|
127
126
|
}
|
|
128
|
-
|
|
129
127
|
//#endregion
|
|
130
|
-
export { useNaiveTheme };
|
|
128
|
+
export { useNaiveTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,4 @@ import { useLoading } from "./composables/use-loading.js";
|
|
|
3
3
|
import { UseNaiveFormClearRules, UseNaiveFormOptions, UseNaiveFormReturns, UseNaiveFormRules, useNaiveForm } from "./composables/use-naive-form.js";
|
|
4
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
|
-
import "./composables/index.js";
|
|
7
6
|
export { DataObject, DataRequestFields, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, UseNaiveFormClearRules, UseNaiveFormOptions, UseNaiveFormReturns, UseNaiveFormRules, UseNaiveMenuOptions, UseNaiveMenuReturn, UseNaiveThemeOptions, UseNaiveThemeReturns, flattenDeep, useDataRequest, useLoading, useNaiveForm, useNaiveMenu, useNaiveTheme };
|