@oiij/naive-ui 0.0.76 → 0.0.77
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/config-providers/index.d.ts +16 -7
- package/dist/components/copy-button/CopyButton.js +2 -2
- package/dist/components/copy-button/CopyButton.vue.d.ts +4 -4
- package/dist/components/copy-button/index.d.ts +6 -3
- package/dist/components/data-table-plus/DataTablePlus.js +74 -125
- package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +15 -80
- package/dist/components/data-table-plus/index.d.ts +52 -32
- package/dist/components/index.d.ts +2 -4
- package/dist/components/loading-provider/LoadingProvider.js +2 -2
- package/dist/components/loading-provider/LoadingProvider.vue.d.ts +2 -2
- package/dist/components/loading-provider/index.d.ts +19 -10
- package/dist/components/loading-provider/index.js +5 -2
- package/dist/components/preset-form/PresetForm.js +42 -21
- package/dist/components/preset-form/PresetForm.vue.d.ts +17 -17
- package/dist/components/preset-form/_utils.js +23 -8
- package/dist/components/preset-form/index.d.ts +32 -13
- package/dist/components/preset-input/PresetInput.vue.d.ts +3 -3
- package/dist/components/preset-input/index.d.ts +30 -20
- package/dist/components/preset-picker/PresetPicker.js +31 -34
- package/dist/components/preset-picker/PresetPicker.vue.d.ts +5 -10
- package/dist/components/preset-picker/index.d.ts +45 -31
- package/dist/components/preset-select/PresetSelect.js +23 -59
- package/dist/components/preset-select/PresetSelect.vue.d.ts +33 -37
- package/dist/components/preset-select/index.d.ts +56 -22
- package/dist/components/remote-request/RemoteRequest.js +7 -7
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +6 -6
- package/dist/components/remote-request/index.d.ts +30 -8
- package/dist/components/search-input/SearchInput.vue.d.ts +4 -4
- package/dist/components/search-input/index.d.ts +10 -7
- package/dist/components/toggle-input/ToggleInput.vue.d.ts +4 -4
- package/dist/components/tooltip-button/TooltipButton.vue.d.ts +4 -4
- package/dist/components/tooltip-button/index.d.ts +5 -2
- package/dist/components/transition/index.d.ts +4 -1
- package/dist/components.d.ts +2 -4
- package/dist/components.js +2 -3
- package/dist/composables/_helper.d.ts +7 -4
- package/dist/composables/_helper.js +47 -0
- package/dist/composables/use-data-request.d.ts +25 -18
- package/dist/composables/use-data-request.js +22 -3
- package/dist/composables/use-loading.d.ts +6 -0
- package/dist/composables/use-loading.js +8 -2
- package/dist/composables/use-naive-form.d.ts +21 -13
- package/dist/composables/use-naive-form.js +48 -39
- package/dist/composables/use-naive-menu.d.ts +5 -4
- package/dist/composables/use-naive-menu.js +2 -50
- package/dist/composables/use-naive-theme.d.ts +27 -14
- package/dist/composables/use-naive-theme.js +22 -4
- package/package.json +5 -7
- package/dist/components/_utils/prismjs.js +0 -16
- package/dist/components/icons/MageArrowUp.js +0 -29
- package/dist/components/type-writer/TypeWriter.js +0 -75
- package/dist/components/type-writer/TypeWriter.vue.d.ts +0 -22
- package/dist/components/type-writer/index.d.ts +0 -13
- package/dist/components/type-writer/type-writer.cssr.js +0 -27
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import { DataObject
|
|
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_core8 from "@vueuse/core";
|
|
4
|
+
import * as vue43 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:
|
|
9
|
+
props: vue43.PublicProps & __VLS_PrettifyLocal<PresetSelectProps<V, P, D, R> & {
|
|
10
10
|
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
11
11
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
12
|
-
onClear?: (() => any) | undefined;
|
|
13
|
-
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
|
14
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
|
15
|
-
onScroll?: ((ev: Event) => any) | undefined;
|
|
16
12
|
"onUpdate:value"?: ((val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null) => any) | undefined;
|
|
17
|
-
onSearch?: ((
|
|
13
|
+
onSearch?: ((val: string) => any) | undefined;
|
|
18
14
|
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
19
15
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
20
|
-
|
|
16
|
+
"onUpdate:show"?: ((show: boolean) => any) | undefined;
|
|
21
17
|
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
22
18
|
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
23
19
|
}> & (typeof globalThis extends {
|
|
24
20
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
25
21
|
} ? P_1 : {});
|
|
26
|
-
expose: (exposed:
|
|
22
|
+
expose: (exposed: vue43.ShallowUnwrapRef<PresetSelectExpose<P, D, R>>) => void;
|
|
27
23
|
attrs: any;
|
|
28
24
|
slots: {
|
|
29
25
|
header?: (props: {
|
|
@@ -32,7 +28,7 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
32
28
|
error: Error | undefined;
|
|
33
29
|
params: [] | P[];
|
|
34
30
|
list: R[];
|
|
35
|
-
pagination:
|
|
31
|
+
pagination: {
|
|
36
32
|
page: number;
|
|
37
33
|
pageSize: number;
|
|
38
34
|
itemCount: number;
|
|
@@ -47,10 +43,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
47
43
|
setParams: (_params: Partial<P>) => void;
|
|
48
44
|
runParams: (_params: Partial<P>) => void;
|
|
49
45
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
50
|
-
onBefore:
|
|
51
|
-
onSuccess:
|
|
52
|
-
onError:
|
|
53
|
-
onFinally:
|
|
46
|
+
onBefore: _vueuse_core8.EventHookOn<[P[]]>;
|
|
47
|
+
onSuccess: _vueuse_core8.EventHookOn<[D, P[]]>;
|
|
48
|
+
onError: _vueuse_core8.EventHookOn<[Error, P[]]>;
|
|
49
|
+
onFinally: _vueuse_core8.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
54
50
|
}) => any;
|
|
55
51
|
} & {
|
|
56
52
|
footer?: (props: {
|
|
@@ -59,7 +55,7 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
59
55
|
error: Error | undefined;
|
|
60
56
|
params: [] | P[];
|
|
61
57
|
list: R[];
|
|
62
|
-
pagination:
|
|
58
|
+
pagination: {
|
|
63
59
|
page: number;
|
|
64
60
|
pageSize: number;
|
|
65
61
|
itemCount: number;
|
|
@@ -74,10 +70,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
74
70
|
setParams: (_params: Partial<P>) => void;
|
|
75
71
|
runParams: (_params: Partial<P>) => void;
|
|
76
72
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
77
|
-
onBefore:
|
|
78
|
-
onSuccess:
|
|
79
|
-
onError:
|
|
80
|
-
onFinally:
|
|
73
|
+
onBefore: _vueuse_core8.EventHookOn<[P[]]>;
|
|
74
|
+
onSuccess: _vueuse_core8.EventHookOn<[D, P[]]>;
|
|
75
|
+
onError: _vueuse_core8.EventHookOn<[Error, P[]]>;
|
|
76
|
+
onFinally: _vueuse_core8.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
81
77
|
}) => any;
|
|
82
78
|
} & {
|
|
83
79
|
'footer-extra'?: (props: {
|
|
@@ -86,7 +82,7 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
86
82
|
error: Error | undefined;
|
|
87
83
|
params: [] | P[];
|
|
88
84
|
list: R[];
|
|
89
|
-
pagination:
|
|
85
|
+
pagination: {
|
|
90
86
|
page: number;
|
|
91
87
|
pageSize: number;
|
|
92
88
|
itemCount: number;
|
|
@@ -101,10 +97,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
101
97
|
setParams: (_params: Partial<P>) => void;
|
|
102
98
|
runParams: (_params: Partial<P>) => void;
|
|
103
99
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
104
|
-
onBefore:
|
|
105
|
-
onSuccess:
|
|
106
|
-
onError:
|
|
107
|
-
onFinally:
|
|
100
|
+
onBefore: _vueuse_core8.EventHookOn<[P[]]>;
|
|
101
|
+
onSuccess: _vueuse_core8.EventHookOn<[D, P[]]>;
|
|
102
|
+
onError: _vueuse_core8.EventHookOn<[Error, P[]]>;
|
|
103
|
+
onFinally: _vueuse_core8.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
108
104
|
}) => any;
|
|
109
105
|
} & {
|
|
110
106
|
empty?: (props: {
|
|
@@ -113,7 +109,7 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
113
109
|
error: Error | undefined;
|
|
114
110
|
params: [] | P[];
|
|
115
111
|
list: R[];
|
|
116
|
-
pagination:
|
|
112
|
+
pagination: {
|
|
117
113
|
page: number;
|
|
118
114
|
pageSize: number;
|
|
119
115
|
itemCount: number;
|
|
@@ -128,10 +124,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
128
124
|
setParams: (_params: Partial<P>) => void;
|
|
129
125
|
runParams: (_params: Partial<P>) => void;
|
|
130
126
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
131
|
-
onBefore:
|
|
132
|
-
onSuccess:
|
|
133
|
-
onError:
|
|
134
|
-
onFinally:
|
|
127
|
+
onBefore: _vueuse_core8.EventHookOn<[P[]]>;
|
|
128
|
+
onSuccess: _vueuse_core8.EventHookOn<[D, P[]]>;
|
|
129
|
+
onError: _vueuse_core8.EventHookOn<[Error, P[]]>;
|
|
130
|
+
onFinally: _vueuse_core8.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
135
131
|
}) => any;
|
|
136
132
|
} & {
|
|
137
133
|
arrow?: (props: {
|
|
@@ -140,7 +136,7 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
140
136
|
error: Error | undefined;
|
|
141
137
|
params: [] | P[];
|
|
142
138
|
list: R[];
|
|
143
|
-
pagination:
|
|
139
|
+
pagination: {
|
|
144
140
|
page: number;
|
|
145
141
|
pageSize: number;
|
|
146
142
|
itemCount: number;
|
|
@@ -155,14 +151,14 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
155
151
|
setParams: (_params: Partial<P>) => void;
|
|
156
152
|
runParams: (_params: Partial<P>) => void;
|
|
157
153
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
158
|
-
onBefore:
|
|
159
|
-
onSuccess:
|
|
160
|
-
onError:
|
|
161
|
-
onFinally:
|
|
154
|
+
onBefore: _vueuse_core8.EventHookOn<[P[]]>;
|
|
155
|
+
onSuccess: _vueuse_core8.EventHookOn<[D, P[]]>;
|
|
156
|
+
onError: _vueuse_core8.EventHookOn<[Error, P[]]>;
|
|
157
|
+
onFinally: _vueuse_core8.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
162
158
|
}) => any;
|
|
163
159
|
};
|
|
164
160
|
emit: PresetSelectEmits<V, P, D, R>;
|
|
165
|
-
}>) =>
|
|
161
|
+
}>) => vue43.VNode & {
|
|
166
162
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
167
163
|
};
|
|
168
164
|
declare const _default: typeof __VLS_export;
|
|
@@ -7,42 +7,76 @@ import { PaginationProps, SelectGroupOption, SelectInst, SelectOption, SelectPro
|
|
|
7
7
|
import { ComponentExposed } from "vue-component-type-helpers";
|
|
8
8
|
|
|
9
9
|
//#region src/components/preset-select/index.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* 数组感知类型
|
|
12
|
+
* @template V 值类型
|
|
13
|
+
* @template T 目标类型
|
|
14
|
+
*/
|
|
10
15
|
type ArrayAwareType<V, T> = V extends null ? null : (V extends any[] ? T[] : T) | null;
|
|
16
|
+
/**
|
|
17
|
+
* 选项格式化函数
|
|
18
|
+
* @template R 列表项类型
|
|
19
|
+
*/
|
|
11
20
|
type OptionFormat<R extends DataObject = DataObject> = (row: R) => SelectOption | SelectGroupOption | false | undefined | null;
|
|
21
|
+
/**
|
|
22
|
+
* 预设选择器值类型
|
|
23
|
+
*/
|
|
12
24
|
type PresetSelectValue = string | number | (string | number)[] | null;
|
|
25
|
+
/**
|
|
26
|
+
* 预设选择器字段配置
|
|
27
|
+
*/
|
|
13
28
|
type PresetSelectFields = DataRequestFields & {
|
|
14
|
-
label?: string;
|
|
15
|
-
value?: string;
|
|
16
|
-
rowKey?: string;
|
|
17
|
-
search?: string;
|
|
29
|
+
/** 标签字段名 */label?: string; /** 值字段名 */
|
|
30
|
+
value?: string; /** 行键字段名 */
|
|
31
|
+
rowKey?: string; /** 搜索字段名 */
|
|
32
|
+
search?: string; /** 子节点字段名 */
|
|
18
33
|
children?: string;
|
|
19
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* 预设选择器暴露的方法
|
|
37
|
+
* @template P 请求参数类型
|
|
38
|
+
* @template D 响应数据类型
|
|
39
|
+
* @template R 列表项类型
|
|
40
|
+
*/
|
|
20
41
|
type PresetSelectExpose<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = UseDataRequestReturns<P, D, R> & {
|
|
21
|
-
selectInst: Readonly<ShallowRef<SelectInst | null>>;
|
|
42
|
+
/** 选择器实例 */selectInst: Readonly<ShallowRef<SelectInst | null>>;
|
|
22
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* 预设选择器属性
|
|
46
|
+
* @template V 值类型
|
|
47
|
+
* @template P 请求参数类型
|
|
48
|
+
* @template D 响应数据类型
|
|
49
|
+
* @template R 列表项类型
|
|
50
|
+
*/
|
|
23
51
|
type PresetSelectProps<V extends PresetSelectValue, P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestProps<P, D> & {
|
|
24
|
-
value?: V;
|
|
25
|
-
fallbackLabel?: string | ((val: string | number) => SelectOption);
|
|
26
|
-
multiple?: boolean;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
clearable?: boolean;
|
|
29
|
-
debounce?: boolean | number;
|
|
30
|
-
optionFormat?: OptionFormat<R>;
|
|
31
|
-
fields?: PresetSelectFields;
|
|
32
|
-
selectProps?: SelectProps & ClassStyle;
|
|
52
|
+
/** 值 */value?: V; /** 回退标签 */
|
|
53
|
+
fallbackLabel?: string | ((val: string | number) => SelectOption); /** 是否多选 */
|
|
54
|
+
multiple?: boolean; /** 是否禁用 */
|
|
55
|
+
disabled?: boolean; /** 是否可清空 */
|
|
56
|
+
clearable?: boolean; /** 防抖配置 */
|
|
57
|
+
debounce?: boolean | number; /** 选项格式化函数 */
|
|
58
|
+
optionFormat?: OptionFormat<R>; /** 字段配置 */
|
|
59
|
+
fields?: PresetSelectFields; /** 选择器属性 */
|
|
60
|
+
selectProps?: SelectProps & ClassStyle; /** 分页配置 */
|
|
33
61
|
pagination?: Omit<PaginationProps, 'page' | 'pageSize'> & ClassStyle | boolean;
|
|
34
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* 预设选择器事件
|
|
65
|
+
* @template V 值类型
|
|
66
|
+
* @template P 请求参数类型
|
|
67
|
+
* @template D 响应数据类型
|
|
68
|
+
* @template R 列表项类型
|
|
69
|
+
*/
|
|
35
70
|
type PresetSelectEmits<V extends PresetSelectValue, P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestEmits<P, D> & {
|
|
36
|
-
(e: '
|
|
37
|
-
(e: '
|
|
38
|
-
(e: '
|
|
39
|
-
(e: '
|
|
40
|
-
(e: 'scroll', ev: Event): void;
|
|
41
|
-
(e: 'search', value: string): void;
|
|
42
|
-
(e: 'update:value', val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null): void;
|
|
43
|
-
(e: 'update:page', page: number): void;
|
|
71
|
+
/** 搜索事件 */(e: 'search', val: string): void; /** 更新显示事件 */
|
|
72
|
+
(e: 'update:show', show: boolean): void; /** 更新值事件 */
|
|
73
|
+
(e: 'update:value', val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null): void; /** 更新页码事件 */
|
|
74
|
+
(e: 'update:page', page: number): void; /** 更新每页大小事件 */
|
|
44
75
|
(e: 'update:pageSize', pageSize: number): void;
|
|
45
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* 预设选择器实例类型
|
|
79
|
+
*/
|
|
46
80
|
type PresetSelectInst = ComponentExposed<typeof _default>;
|
|
47
81
|
//#endregion
|
|
48
82
|
export { ArrayAwareType, OptionFormat, PresetSelectEmits, PresetSelectExpose, PresetSelectFields, PresetSelectInst, PresetSelectProps, PresetSelectValue };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useDataRequest } from "../../composables/use-data-request.js";
|
|
2
|
-
import { computed, defineComponent, guardReactiveProps, normalizeProps, renderSlot
|
|
2
|
+
import { computed, defineComponent, guardReactiveProps, normalizeProps, renderSlot } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/remote-request/RemoteRequest.vue
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -70,12 +70,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70
70
|
const templateBind = computed(() => {
|
|
71
71
|
return {
|
|
72
72
|
...expose,
|
|
73
|
-
loading:
|
|
74
|
-
data:
|
|
75
|
-
error:
|
|
76
|
-
params:
|
|
77
|
-
list:
|
|
78
|
-
pagination:
|
|
73
|
+
loading: loading.value,
|
|
74
|
+
data: data.value,
|
|
75
|
+
error: error.value,
|
|
76
|
+
params: params.value,
|
|
77
|
+
list: list.value,
|
|
78
|
+
pagination: pagination.value
|
|
79
79
|
};
|
|
80
80
|
});
|
|
81
81
|
__expose(expose);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DataObject
|
|
1
|
+
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { RemoteRequestEmits, RemoteRequestExpose, RemoteRequestProps } from "./index.js";
|
|
3
3
|
import * as _vueuse_core4 from "@vueuse/core";
|
|
4
|
-
import * as
|
|
4
|
+
import * as vue20 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:
|
|
8
|
+
props: vue20.PublicProps & __VLS_PrettifyLocal<RemoteRequestProps<P, D> & {
|
|
9
9
|
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
10
10
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
11
11
|
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
@@ -13,7 +13,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
13
13
|
}> & (typeof globalThis extends {
|
|
14
14
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
15
15
|
} ? P_1 : {});
|
|
16
|
-
expose: (exposed:
|
|
16
|
+
expose: (exposed: vue20.ShallowUnwrapRef<RemoteRequestExpose<P, D, R>>) => void;
|
|
17
17
|
attrs: any;
|
|
18
18
|
slots: {
|
|
19
19
|
default?: (props: {
|
|
@@ -22,7 +22,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
22
22
|
error: Error | undefined;
|
|
23
23
|
params: [] | P[];
|
|
24
24
|
list: R[];
|
|
25
|
-
pagination:
|
|
25
|
+
pagination: {
|
|
26
26
|
page: number;
|
|
27
27
|
pageSize: number;
|
|
28
28
|
itemCount: number;
|
|
@@ -43,7 +43,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
43
43
|
}) => any;
|
|
44
44
|
};
|
|
45
45
|
emit: RemoteRequestEmits<P, D>;
|
|
46
|
-
}>) =>
|
|
46
|
+
}>) => vue20.VNode & {
|
|
47
47
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
48
48
|
};
|
|
49
49
|
declare const _default: typeof __VLS_export;
|
|
@@ -4,22 +4,44 @@ import { ComponentExposed } from "vue-component-type-helpers";
|
|
|
4
4
|
import { UseRequestOptions, UseRequestPlugin } from "vue-hooks-plus/es/useRequest/types";
|
|
5
5
|
|
|
6
6
|
//#region src/components/remote-request/index.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* 远程请求字段配置
|
|
9
|
+
*/
|
|
7
10
|
type RemoteRequestFields = DataRequestFields & {};
|
|
11
|
+
/**
|
|
12
|
+
* 远程请求暴露的方法
|
|
13
|
+
* @template P 请求参数类型
|
|
14
|
+
* @template D 响应数据类型
|
|
15
|
+
* @template R 列表项类型
|
|
16
|
+
*/
|
|
8
17
|
type RemoteRequestExpose<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = UseDataRequestReturns<P, D, R>;
|
|
18
|
+
/**
|
|
19
|
+
* 远程请求属性
|
|
20
|
+
* @template P 请求参数类型
|
|
21
|
+
* @template D 响应数据类型
|
|
22
|
+
*/
|
|
9
23
|
type RemoteRequestProps<P extends DataObject = DataObject, D extends DataObject = DataObject> = {
|
|
10
|
-
api: (...args: P[]) => Promise<D>;
|
|
11
|
-
defaultParams?: Partial<P>;
|
|
12
|
-
manual?: boolean;
|
|
13
|
-
fields?: RemoteRequestFields;
|
|
14
|
-
requestOptions?: UseRequestOptions<D, P[]>;
|
|
24
|
+
/** API 函数 */api: (...args: P[]) => Promise<D>; /** 默认请求参数 */
|
|
25
|
+
defaultParams?: Partial<P>; /** 是否手动触发 */
|
|
26
|
+
manual?: boolean; /** 字段配置 */
|
|
27
|
+
fields?: RemoteRequestFields; /** 请求选项 */
|
|
28
|
+
requestOptions?: UseRequestOptions<D, P[]>; /** 请求插件 */
|
|
15
29
|
requestPlugins?: UseRequestPlugin<D, P[]>[];
|
|
16
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* 远程请求事件
|
|
33
|
+
* @template P 请求参数类型
|
|
34
|
+
* @template D 响应数据类型
|
|
35
|
+
*/
|
|
17
36
|
type RemoteRequestEmits<P extends DataObject = DataObject, D extends DataObject = DataObject> = {
|
|
18
|
-
(e: 'before', params: P[]): void;
|
|
19
|
-
(e: 'success', data: D, params: P[]): void;
|
|
20
|
-
(e: 'error', err: Error, params: P[]): void;
|
|
37
|
+
/** 请求前事件 */(e: 'before', params: P[]): void; /** 请求成功事件 */
|
|
38
|
+
(e: 'success', data: D, params: P[]): void; /** 请求错误事件 */
|
|
39
|
+
(e: 'error', err: Error, params: P[]): void; /** 请求完成事件 */
|
|
21
40
|
(e: 'finally', params: P[], data?: D, err?: Error): void;
|
|
22
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* 远程请求实例类型
|
|
44
|
+
*/
|
|
23
45
|
type RemoteRequestInst = ComponentExposed<typeof _default>;
|
|
24
46
|
//#endregion
|
|
25
47
|
export { RemoteRequestEmits, RemoteRequestExpose, RemoteRequestFields, RemoteRequestInst, RemoteRequestProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchInputProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue55 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: vue55.DefineComponent<SearchInputProps, {}, {}, {}, {}, vue55.ComponentOptionsMixin, vue55.ComponentOptionsMixin, {} & {
|
|
19
19
|
"update:value": (v: string | null | undefined) => any;
|
|
20
|
-
}, string,
|
|
20
|
+
}, string, vue55.PublicProps, Readonly<SearchInputProps> & Readonly<{
|
|
21
21
|
"onUpdate:value"?: ((v: string | null | undefined) => any) | undefined;
|
|
22
|
-
}>, {}, {}, {}, {}, string,
|
|
22
|
+
}>, {}, {}, {}, {}, string, vue55.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 & {
|
|
@@ -3,14 +3,17 @@ import { ClassStyle } from "../data-table-plus/index.js";
|
|
|
3
3
|
import { ButtonProps, InputProps } from "naive-ui";
|
|
4
4
|
|
|
5
5
|
//#region src/components/search-input/index.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* 搜索输入框属性
|
|
8
|
+
*/
|
|
6
9
|
type SearchInputProps = {
|
|
7
|
-
value?: string | null;
|
|
8
|
-
type?: ButtonProps['type'];
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
loading?: boolean;
|
|
11
|
-
autoTrigger?: boolean | number;
|
|
12
|
-
searchButton?: 'text' | 'icon' | boolean;
|
|
13
|
-
inputProps?: InputProps & ClassStyle;
|
|
10
|
+
/** 值 */value?: string | null; /** 按钮类型 */
|
|
11
|
+
type?: ButtonProps['type']; /** 占位符 */
|
|
12
|
+
placeholder?: string; /** 是否加载中 */
|
|
13
|
+
loading?: boolean; /** 是否自动触发 */
|
|
14
|
+
autoTrigger?: boolean | number; /** 搜索按钮类型 */
|
|
15
|
+
searchButton?: 'text' | 'icon' | boolean; /** 输入框属性 */
|
|
16
|
+
inputProps?: InputProps & ClassStyle; /** 按钮属性 */
|
|
14
17
|
buttonProps?: ButtonProps & ClassStyle;
|
|
15
18
|
};
|
|
16
19
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClassStyle } from "../data-table-plus/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue10 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: vue10.DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, vue10.ComponentOptionsMixin, vue10.ComponentOptionsMixin, {
|
|
31
31
|
"update:value": (value: string | number | undefined) => any;
|
|
32
32
|
} & {
|
|
33
33
|
trigger: () => any;
|
|
34
|
-
}, string,
|
|
34
|
+
}, string, vue10.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
35
35
|
"onUpdate:value"?: ((value: string | number | undefined) => any) | undefined;
|
|
36
36
|
onTrigger?: (() => any) | undefined;
|
|
37
|
-
}>, {}, {}, {}, {}, string,
|
|
37
|
+
}>, {}, {}, {}, {}, string, vue10.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,5 +1,5 @@
|
|
|
1
1
|
import { TooltipButtonProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue15 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: vue15.DefineComponent<TooltipButtonProps, {}, {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {} & {
|
|
14
14
|
click: (ev: MouseEvent) => any;
|
|
15
|
-
}, string,
|
|
15
|
+
}, string, vue15.PublicProps, Readonly<TooltipButtonProps> & Readonly<{
|
|
16
16
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
|
17
|
-
}>, {}, {}, {}, {}, string,
|
|
17
|
+
}>, {}, {}, {}, {}, string, vue15.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 & {
|
|
@@ -3,9 +3,12 @@ import { _default } from "./TooltipButton.vue.js";
|
|
|
3
3
|
import { ButtonProps, TooltipProps } from "naive-ui";
|
|
4
4
|
|
|
5
5
|
//#region src/components/tooltip-button/index.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* 提示按钮属性
|
|
8
|
+
*/
|
|
6
9
|
type TooltipButtonProps = {
|
|
7
|
-
tooltip?: string;
|
|
8
|
-
tooltipProps?: TooltipProps & ClassStyle;
|
|
10
|
+
/** 提示文本 */tooltip?: string; /** 提示框属性 */
|
|
11
|
+
tooltipProps?: TooltipProps & ClassStyle; /** 按钮属性 */
|
|
9
12
|
buttonProps?: ButtonProps & ClassStyle;
|
|
10
13
|
};
|
|
11
14
|
//#endregion
|
|
@@ -3,8 +3,11 @@ import { _default } from "./BaseTransition.vue.js";
|
|
|
3
3
|
import { TransitionProps } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/transition/index.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* 过渡动画属性
|
|
8
|
+
*/
|
|
6
9
|
type TransitionProps$1 = {
|
|
7
|
-
name?: string;
|
|
10
|
+
/** 过渡名称 */name?: string; /** 过渡属性 */
|
|
8
11
|
transitionProps?: TransitionProps & ClassStyle;
|
|
9
12
|
};
|
|
10
13
|
//#endregion
|
package/dist/components.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { SearchInputProps } from "./components/search-input/index.js";
|
|
|
5
5
|
import { _default as _default$2 } from "./components/data-table-plus/DataTablePlus.vue.js";
|
|
6
6
|
import { ClassStyle, DataTablePlusEmits, DataTablePlusExpose, DataTablePlusFields, DataTablePlusInst, DataTablePlusProps } from "./components/data-table-plus/index.js";
|
|
7
7
|
import { _default as _default$3 } from "./components/loading-provider/LoadingProvider.vue.js";
|
|
8
|
-
import { LoadingProviderInst, LoadingProviderProps
|
|
8
|
+
import { LOADING_PROVIDER_INJECTION_KEY, LoadingProviderInst, LoadingProviderProps } from "./components/loading-provider/index.js";
|
|
9
9
|
import { UseNaiveFormRules } from "./composables/use-naive-form.js";
|
|
10
10
|
import { _default } from "./components/config-providers/ConfigProviders.vue.js";
|
|
11
11
|
import { ConfigProvidersProps } from "./components/config-providers/index.js";
|
|
@@ -24,8 +24,6 @@ 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 { _default as _default$13 } from "./components/type-writer/TypeWriter.vue.js";
|
|
28
|
-
import { TypeWriterProps } from "./components/type-writer/index.js";
|
|
29
27
|
import "./components/index.js";
|
|
30
28
|
import { ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots } from "vue-component-type-helpers";
|
|
31
|
-
export { ArrayAwareType, ClassStyle, ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots, ConfigProvidersProps, CopyButtonProps, DataTablePlusEmits, DataTablePlusExpose, DataTablePlusFields, DataTablePlusInst, DataTablePlusProps, 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,
|
|
29
|
+
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,6 +1,6 @@
|
|
|
1
1
|
import BaseTransition_default from "./components/transition/BaseTransition.js";
|
|
2
2
|
import LoadingProvider_default from "./components/loading-provider/LoadingProvider.js";
|
|
3
|
-
import {
|
|
3
|
+
import { LOADING_PROVIDER_INJECTION_KEY } from "./components/loading-provider/index.js";
|
|
4
4
|
import ConfigProviders_default from "./components/config-providers/ConfigProviders.js";
|
|
5
5
|
import CopyButton_default from "./components/copy-button/CopyButton.js";
|
|
6
6
|
import SearchInput_default from "./components/search-input/SearchInput.js";
|
|
@@ -12,7 +12,6 @@ import PresetSelect_default from "./components/preset-select/PresetSelect.js";
|
|
|
12
12
|
import RemoteRequest_default from "./components/remote-request/RemoteRequest.js";
|
|
13
13
|
import ToggleInput_default from "./components/toggle-input/ToggleInput.js";
|
|
14
14
|
import TooltipButton_default from "./components/tooltip-button/TooltipButton.js";
|
|
15
|
-
import TypeWriter_default from "./components/type-writer/TypeWriter.js";
|
|
16
15
|
import { ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots } from "vue-component-type-helpers";
|
|
17
16
|
|
|
18
|
-
export { ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots, 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
|
|
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 };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
//#region src/composables/_helper.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* 颜色配置类型,用于定义主题的基础颜色
|
|
4
|
+
*/
|
|
2
5
|
type Colors = {
|
|
3
|
-
primary?: string;
|
|
4
|
-
info?: string;
|
|
5
|
-
success?: string;
|
|
6
|
-
warning?: string;
|
|
6
|
+
/** 主色 */primary?: string; /** 信息色 */
|
|
7
|
+
info?: string; /** 成功色 */
|
|
8
|
+
success?: string; /** 警告色 */
|
|
9
|
+
warning?: string; /** 错误色 */
|
|
7
10
|
error?: string;
|
|
8
11
|
};
|
|
9
12
|
//#endregion
|
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
import { colord } from "colord";
|
|
2
2
|
|
|
3
3
|
//#region src/composables/_helper.ts
|
|
4
|
+
/**
|
|
5
|
+
* 获取变亮的颜色
|
|
6
|
+
* @param color - 原始颜色值
|
|
7
|
+
* @returns 变亮后的颜色值,如果输入无效则返回 undefined
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const darkColor = getDarkColor('#1890ff')
|
|
11
|
+
* // 返回变亮后的颜色值
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
4
14
|
function getDarkColor(color) {
|
|
5
15
|
if (!color) return void 0;
|
|
6
16
|
const colorInst = colord(color);
|
|
7
17
|
if (!colorInst.isValid()) return void 0;
|
|
8
18
|
return colorInst.lighten(.1).toHex();
|
|
9
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* 获取一组变亮的颜色
|
|
22
|
+
* @param colors - 颜色配置对象
|
|
23
|
+
* @returns 包含变亮后颜色的对象
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const darkColors = getDarkColors({
|
|
27
|
+
* primary: '#1890ff',
|
|
28
|
+
* success: '#52c41a'
|
|
29
|
+
* })
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
10
32
|
function getDarkColors(colors) {
|
|
11
33
|
return {
|
|
12
34
|
primary: getDarkColor(colors.primary),
|
|
@@ -16,6 +38,16 @@ function getDarkColors(colors) {
|
|
|
16
38
|
error: getDarkColor(colors.error)
|
|
17
39
|
};
|
|
18
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* 获取状态颜色对象,包含基础颜色和交互状态颜色
|
|
43
|
+
* @param color - 原始颜色值
|
|
44
|
+
* @returns 状态颜色对象,如果输入无效则返回 undefined
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const statusColor = getStatusColor('#1890ff')
|
|
48
|
+
* // 返回 { color: '#1890ff', hover: '...', pressed: '...', suppl: '...' }
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
19
51
|
function getStatusColor(color) {
|
|
20
52
|
if (!color) return void 0;
|
|
21
53
|
const colorInst = colord(color);
|
|
@@ -27,6 +59,21 @@ function getStatusColor(color) {
|
|
|
27
59
|
suppl: colorInst.lighten(.1).toHex()
|
|
28
60
|
};
|
|
29
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* 获取一组状态颜色
|
|
64
|
+
* @param colors - 颜色配置对象
|
|
65
|
+
* @returns 包含各状态颜色的对象
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const colors = getColors({
|
|
69
|
+
* primary: '#1890ff',
|
|
70
|
+
* info: '#1890ff',
|
|
71
|
+
* success: '#52c41a',
|
|
72
|
+
* warning: '#faad14',
|
|
73
|
+
* error: '#f5222d'
|
|
74
|
+
* })
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
30
77
|
function getColors(colors) {
|
|
31
78
|
const { primary, info, success, warning, error } = colors ?? {};
|
|
32
79
|
return {
|