@oiij/naive-ui 0.0.75 → 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/README.md +3 -3
- 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 +3 -3
- 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 +16 -81
- 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 +34 -38
- 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 +7 -7
- package/dist/components/remote-request/index.d.ts +30 -8
- package/dist/components/search-input/SearchInput.js +1 -1
- 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/index.d.ts +1 -1
- package/dist/composables/use-data-request.d.ts +27 -20
- package/dist/composables/use-data-request.js +23 -4
- 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 +23 -15
- package/dist/composables/use-naive-form.js +49 -40
- package/dist/composables/use-naive-menu.d.ts +104 -0
- package/dist/composables/use-naive-menu.js +133 -0
- package/dist/composables/use-naive-theme.d.ts +27 -14
- package/dist/composables/use-naive-theme.js +22 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- 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
- package/dist/composables/use-auto-menu.d.ts +0 -74
- package/dist/composables/use-auto-menu.js +0 -129
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import { DataObject
|
|
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 vue65 from "vue";
|
|
5
4
|
import * as _vueuse_core31 from "@vueuse/core";
|
|
5
|
+
import * as vue60 from "vue";
|
|
6
6
|
import { DataTableBaseColumn, DataTableFilterState, DataTableInst, DataTableSortState } from "naive-ui";
|
|
7
|
+
import { RowKey } from "naive-ui/es/data-table/src/interface";
|
|
7
8
|
|
|
8
9
|
//#region src/components/data-table-plus/DataTablePlus.vue.d.ts
|
|
9
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<{
|
|
10
|
-
props:
|
|
11
|
-
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
11
|
+
props: vue60.PublicProps & __VLS_PrettifyLocal<DataTablePlusProps<P, D, R> & {
|
|
12
12
|
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
13
|
-
|
|
14
|
-
onScroll?: ((ev: Event) => any) | undefined;
|
|
13
|
+
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
15
14
|
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
16
15
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
17
16
|
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
18
17
|
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
19
18
|
onClickRow?: ((row: R, index: number, event: MouseEvent, currentData: R[]) => any) | undefined;
|
|
20
19
|
onContextMenuRow?: ((row: R, index: number, event: MouseEvent, currentData: R[]) => any) | undefined;
|
|
21
|
-
|
|
22
|
-
"onUpdate:checkedRowKeys"?: ((keys: (string | number)[], rows: (R | undefined)[], meta: {
|
|
20
|
+
"onUpdate:checkedRowKeys"?: ((keys: RowKey[], rows: R[], meta: {
|
|
23
21
|
row: R | undefined;
|
|
24
22
|
action: "check" | "uncheck" | "checkAll" | "uncheckAll";
|
|
25
23
|
}, currentData: R[]) => any) | undefined;
|
|
26
|
-
"onUpdate:expandedRowKeys"?: ((keys: (string | number)[], currentData: R[]) => any) | undefined;
|
|
27
24
|
"onUpdate:filters"?: ((filterState: DataTableFilterState, sourceColumn: DataTableBaseColumn) => any) | undefined;
|
|
28
25
|
"onUpdate:sorter"?: ((options: DataTableSortState | DataTableSortState[] | null) => any) | undefined;
|
|
26
|
+
onLoadedRows?: ((data: R[]) => any) | undefined;
|
|
29
27
|
}> & (typeof globalThis extends {
|
|
30
28
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
31
29
|
} ? P_1 : {});
|
|
32
|
-
expose: (exposed:
|
|
30
|
+
expose: (exposed: vue60.ShallowUnwrapRef<DataTablePlusExpose<P, D, R>>) => void;
|
|
33
31
|
attrs: any;
|
|
34
32
|
slots: {
|
|
35
33
|
header?: (props: {
|
|
@@ -38,7 +36,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
38
36
|
error: Error | undefined;
|
|
39
37
|
params: [] | P[];
|
|
40
38
|
list: R[];
|
|
41
|
-
|
|
39
|
+
pagination: {
|
|
42
40
|
page: number;
|
|
43
41
|
pageSize: number;
|
|
44
42
|
itemCount: number;
|
|
@@ -46,15 +44,6 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
46
44
|
filters: DataTableFilterState | undefined;
|
|
47
45
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
48
46
|
dataTableInst: DataTableInst | null;
|
|
49
|
-
pagination: vue65.Ref<{
|
|
50
|
-
page: number;
|
|
51
|
-
pageSize: number;
|
|
52
|
-
itemCount: number;
|
|
53
|
-
}, UseDataRequestPagination | {
|
|
54
|
-
page: number;
|
|
55
|
-
pageSize: number;
|
|
56
|
-
itemCount: number;
|
|
57
|
-
}>;
|
|
58
47
|
run: (...params: P[]) => void;
|
|
59
48
|
runAsync: (...params: P[]) => Promise<D>;
|
|
60
49
|
refresh: () => void;
|
|
@@ -78,7 +67,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
78
67
|
error: Error | undefined;
|
|
79
68
|
params: [] | P[];
|
|
80
69
|
list: R[];
|
|
81
|
-
|
|
70
|
+
pagination: {
|
|
82
71
|
page: number;
|
|
83
72
|
pageSize: number;
|
|
84
73
|
itemCount: number;
|
|
@@ -86,15 +75,6 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
86
75
|
filters: DataTableFilterState | undefined;
|
|
87
76
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
88
77
|
dataTableInst: DataTableInst | null;
|
|
89
|
-
pagination: vue65.Ref<{
|
|
90
|
-
page: number;
|
|
91
|
-
pageSize: number;
|
|
92
|
-
itemCount: number;
|
|
93
|
-
}, UseDataRequestPagination | {
|
|
94
|
-
page: number;
|
|
95
|
-
pageSize: number;
|
|
96
|
-
itemCount: number;
|
|
97
|
-
}>;
|
|
98
78
|
run: (...params: P[]) => void;
|
|
99
79
|
runAsync: (...params: P[]) => Promise<D>;
|
|
100
80
|
refresh: () => void;
|
|
@@ -116,7 +96,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
116
96
|
error: Error | undefined;
|
|
117
97
|
params: [] | P[];
|
|
118
98
|
list: R[];
|
|
119
|
-
|
|
99
|
+
pagination: {
|
|
120
100
|
page: number;
|
|
121
101
|
pageSize: number;
|
|
122
102
|
itemCount: number;
|
|
@@ -124,15 +104,6 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
124
104
|
filters: DataTableFilterState | undefined;
|
|
125
105
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
126
106
|
dataTableInst: DataTableInst | null;
|
|
127
|
-
pagination: vue65.Ref<{
|
|
128
|
-
page: number;
|
|
129
|
-
pageSize: number;
|
|
130
|
-
itemCount: number;
|
|
131
|
-
}, UseDataRequestPagination | {
|
|
132
|
-
page: number;
|
|
133
|
-
pageSize: number;
|
|
134
|
-
itemCount: number;
|
|
135
|
-
}>;
|
|
136
107
|
run: (...params: P[]) => void;
|
|
137
108
|
runAsync: (...params: P[]) => Promise<D>;
|
|
138
109
|
refresh: () => void;
|
|
@@ -154,7 +125,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
154
125
|
error: Error | undefined;
|
|
155
126
|
params: [] | P[];
|
|
156
127
|
list: R[];
|
|
157
|
-
|
|
128
|
+
pagination: {
|
|
158
129
|
page: number;
|
|
159
130
|
pageSize: number;
|
|
160
131
|
itemCount: number;
|
|
@@ -162,15 +133,6 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
162
133
|
filters: DataTableFilterState | undefined;
|
|
163
134
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
164
135
|
dataTableInst: DataTableInst | null;
|
|
165
|
-
pagination: vue65.Ref<{
|
|
166
|
-
page: number;
|
|
167
|
-
pageSize: number;
|
|
168
|
-
itemCount: number;
|
|
169
|
-
}, UseDataRequestPagination | {
|
|
170
|
-
page: number;
|
|
171
|
-
pageSize: number;
|
|
172
|
-
itemCount: number;
|
|
173
|
-
}>;
|
|
174
136
|
run: (...params: P[]) => void;
|
|
175
137
|
runAsync: (...params: P[]) => Promise<D>;
|
|
176
138
|
refresh: () => void;
|
|
@@ -192,7 +154,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
192
154
|
error: Error | undefined;
|
|
193
155
|
params: [] | P[];
|
|
194
156
|
list: R[];
|
|
195
|
-
|
|
157
|
+
pagination: {
|
|
196
158
|
page: number;
|
|
197
159
|
pageSize: number;
|
|
198
160
|
itemCount: number;
|
|
@@ -200,15 +162,6 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
200
162
|
filters: DataTableFilterState | undefined;
|
|
201
163
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
202
164
|
dataTableInst: DataTableInst | null;
|
|
203
|
-
pagination: vue65.Ref<{
|
|
204
|
-
page: number;
|
|
205
|
-
pageSize: number;
|
|
206
|
-
itemCount: number;
|
|
207
|
-
}, UseDataRequestPagination | {
|
|
208
|
-
page: number;
|
|
209
|
-
pageSize: number;
|
|
210
|
-
itemCount: number;
|
|
211
|
-
}>;
|
|
212
165
|
run: (...params: P[]) => void;
|
|
213
166
|
runAsync: (...params: P[]) => Promise<D>;
|
|
214
167
|
refresh: () => void;
|
|
@@ -230,7 +183,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
230
183
|
error: Error | undefined;
|
|
231
184
|
params: [] | P[];
|
|
232
185
|
list: R[];
|
|
233
|
-
|
|
186
|
+
pagination: {
|
|
234
187
|
page: number;
|
|
235
188
|
pageSize: number;
|
|
236
189
|
itemCount: number;
|
|
@@ -238,15 +191,6 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
238
191
|
filters: DataTableFilterState | undefined;
|
|
239
192
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
240
193
|
dataTableInst: DataTableInst | null;
|
|
241
|
-
pagination: vue65.Ref<{
|
|
242
|
-
page: number;
|
|
243
|
-
pageSize: number;
|
|
244
|
-
itemCount: number;
|
|
245
|
-
}, UseDataRequestPagination | {
|
|
246
|
-
page: number;
|
|
247
|
-
pageSize: number;
|
|
248
|
-
itemCount: number;
|
|
249
|
-
}>;
|
|
250
194
|
run: (...params: P[]) => void;
|
|
251
195
|
runAsync: (...params: P[]) => Promise<D>;
|
|
252
196
|
refresh: () => void;
|
|
@@ -268,7 +212,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
268
212
|
error: Error | undefined;
|
|
269
213
|
params: [] | P[];
|
|
270
214
|
list: R[];
|
|
271
|
-
|
|
215
|
+
pagination: {
|
|
272
216
|
page: number;
|
|
273
217
|
pageSize: number;
|
|
274
218
|
itemCount: number;
|
|
@@ -276,15 +220,6 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
276
220
|
filters: DataTableFilterState | undefined;
|
|
277
221
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
278
222
|
dataTableInst: DataTableInst | null;
|
|
279
|
-
pagination: vue65.Ref<{
|
|
280
|
-
page: number;
|
|
281
|
-
pageSize: number;
|
|
282
|
-
itemCount: number;
|
|
283
|
-
}, UseDataRequestPagination | {
|
|
284
|
-
page: number;
|
|
285
|
-
pageSize: number;
|
|
286
|
-
itemCount: number;
|
|
287
|
-
}>;
|
|
288
223
|
run: (...params: P[]) => void;
|
|
289
224
|
runAsync: (...params: P[]) => Promise<D>;
|
|
290
225
|
refresh: () => void;
|
|
@@ -301,7 +236,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
301
236
|
}) => any;
|
|
302
237
|
};
|
|
303
238
|
emit: DataTablePlusEmits<P, D, R>;
|
|
304
|
-
}>) =>
|
|
239
|
+
}>) => vue60.VNode & {
|
|
305
240
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
306
241
|
};
|
|
307
242
|
declare const _default: typeof __VLS_export;
|
|
@@ -3,57 +3,77 @@ import { RemoteRequestEmits, RemoteRequestProps } from "../remote-request/index.
|
|
|
3
3
|
import { SearchInputProps } from "../search-input/index.js";
|
|
4
4
|
import { _default } from "./DataTablePlus.vue.js";
|
|
5
5
|
import { CSSProperties, Ref, ShallowRef } from "vue";
|
|
6
|
-
import {
|
|
6
|
+
import { DataTableColumns, DataTableFilterState, DataTableInst, DataTableProps, DataTableSortState, PaginationProps } from "naive-ui";
|
|
7
7
|
import { ComponentExposed } from "vue-component-type-helpers";
|
|
8
|
-
import { FilterState, TableBaseColumn } from "naive-ui/es/data-table/src/interface";
|
|
8
|
+
import { FilterState, RowKey, TableBaseColumn } from "naive-ui/es/data-table/src/interface";
|
|
9
9
|
|
|
10
10
|
//#region src/components/data-table-plus/index.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* 类样式类型
|
|
13
|
+
*/
|
|
11
14
|
type ClassStyle = {
|
|
12
|
-
class?: string;
|
|
15
|
+
/** CSS 类名 */class?: string; /** CSS 样式 */
|
|
13
16
|
style?: CSSProperties | string;
|
|
14
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* 数据表格增强组件暴露的方法
|
|
20
|
+
* @template P 请求参数类型
|
|
21
|
+
* @template D 响应数据类型
|
|
22
|
+
* @template R 列表项类型
|
|
23
|
+
*/
|
|
15
24
|
type DataTablePlusExpose<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = UseDataRequestReturns<P, D, R> & {
|
|
16
|
-
filters: Ref<DataTableFilterState | undefined>;
|
|
17
|
-
sorters: Ref<Record<string, DataTableSortState> | undefined>;
|
|
25
|
+
/** 筛选状态 */filters: Ref<DataTableFilterState | undefined>; /** 排序状态 */
|
|
26
|
+
sorters: Ref<Record<string, DataTableSortState> | undefined>; /** 数据表格实例 */
|
|
18
27
|
dataTableInst: Readonly<ShallowRef<DataTableInst | null>>;
|
|
19
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* 数据表格增强字段配置
|
|
31
|
+
*/
|
|
20
32
|
type DataTablePlusFields = DataRequestFields & {
|
|
21
|
-
filter?: string;
|
|
22
|
-
sorter?: string;
|
|
23
|
-
rowKey?: string;
|
|
24
|
-
search?: string;
|
|
33
|
+
/** 筛选字段名 */filter?: string; /** 排序字段名 */
|
|
34
|
+
sorter?: string; /** 行键字段名 */
|
|
35
|
+
rowKey?: string; /** 搜索字段名 */
|
|
36
|
+
search?: string; /** 子节点字段名 */
|
|
25
37
|
children?: string;
|
|
26
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* 数据表格增强组件属性
|
|
41
|
+
* @template P 请求参数类型
|
|
42
|
+
* @template D 响应数据类型
|
|
43
|
+
* @template R 列表项类型
|
|
44
|
+
*/
|
|
27
45
|
type DataTablePlusProps<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestProps<P, D> & {
|
|
28
|
-
title?: string;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
search?: SearchInputProps & ClassStyle | boolean;
|
|
36
|
-
pagination?: Omit<PaginationProps, 'page' | 'pageSize' | 'itemCount'> & ClassStyle | boolean;
|
|
37
|
-
columnsFilterOptions?: (filters: DataTableFilterState) => Record<string, any>;
|
|
38
|
-
columnsSorterOptions?: (sorters: Record<string, DataTableSortState>) => Record<string, any>;
|
|
46
|
+
/** 标题 */title?: string; /** 表格列配置 */
|
|
47
|
+
columns?: DataTableColumns<R>; /** 字段配置 */
|
|
48
|
+
fields?: DataTablePlusFields; /** 搜索配置 */
|
|
49
|
+
search?: SearchInputProps & ClassStyle | boolean; /** 分页配置 */
|
|
50
|
+
pagination?: Omit<PaginationProps, 'page' | 'pageSize' | 'itemCount'> & ClassStyle | boolean; /** 列筛选选项 */
|
|
51
|
+
columnsFilterOptions?: (filters: DataTableFilterState) => Record<string, any>; /** 列排序选项 */
|
|
52
|
+
columnsSorterOptions?: (sorters: Record<string, DataTableSortState>) => Record<string, any>; /** 数据表格属性 */
|
|
39
53
|
dataTableProps?: DataTableProps & ClassStyle;
|
|
40
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* 数据表格增强组件事件
|
|
57
|
+
* @template P 请求参数类型
|
|
58
|
+
* @template D 响应数据类型
|
|
59
|
+
* @template R 列表项类型
|
|
60
|
+
*/
|
|
41
61
|
type DataTablePlusEmits<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestEmits<P, D> & {
|
|
42
|
-
(e: 'clickRow', row: R, index: number, event: MouseEvent, currentData: R[]): void;
|
|
43
|
-
(e: 'contextMenuRow', row: R, index: number, event: MouseEvent, currentData: R[]): void;
|
|
44
|
-
(e: '
|
|
45
|
-
(e: 'scroll', ev: Event): void;
|
|
46
|
-
(e: 'scrollBottom', ev: Event): void;
|
|
47
|
-
(e: 'update:checkedRowKeys', keys: (string | number)[], rows: (R | undefined)[], meta: {
|
|
62
|
+
/** 点击行事件 */(e: 'clickRow', row: R, index: number, event: MouseEvent, currentData: R[]): void; /** 右键点击行事件 */
|
|
63
|
+
(e: 'contextMenuRow', row: R, index: number, event: MouseEvent, currentData: R[]): void; /** 更新选中行键事件 */
|
|
64
|
+
(e: 'update:checkedRowKeys', keys: RowKey[], rows: R[], meta: {
|
|
48
65
|
row: R | undefined;
|
|
49
66
|
action: 'check' | 'uncheck' | 'checkAll' | 'uncheckAll';
|
|
50
|
-
}, currentData: R[]): void;
|
|
51
|
-
(e: 'update:
|
|
52
|
-
(e: 'update:
|
|
53
|
-
(e: 'update:
|
|
54
|
-
(e: 'update:
|
|
55
|
-
(e: '
|
|
67
|
+
}, currentData: R[]): void; /** 更新筛选事件 */
|
|
68
|
+
(e: 'update:filters', filterState: FilterState, sourceColumn: TableBaseColumn): void; /** 更新排序事件 */
|
|
69
|
+
(e: 'update:sorter', options: DataTableSortState | DataTableSortState[] | null): void; /** 更新页码事件 */
|
|
70
|
+
(e: 'update:page', page: number): void; /** 更新每页大小事件 */
|
|
71
|
+
(e: 'update:pageSize', pageSize: number): void; /** 成功事件 */
|
|
72
|
+
(e: 'loadedRows', data: R[]): void;
|
|
56
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* 数据表格增强组件实例类型
|
|
76
|
+
*/
|
|
57
77
|
type DataTablePlusInst = ComponentExposed<typeof _default>;
|
|
58
78
|
//#endregion
|
|
59
79
|
export { ClassStyle, DataTablePlusEmits, DataTablePlusExpose, DataTablePlusFields, DataTablePlusInst, DataTablePlusProps };
|
|
@@ -5,7 +5,7 @@ import { SearchInputProps } from "./search-input/index.js";
|
|
|
5
5
|
import { _default as _default$2 } from "./data-table-plus/DataTablePlus.vue.js";
|
|
6
6
|
import { ClassStyle, DataTablePlusEmits, DataTablePlusExpose, DataTablePlusFields, DataTablePlusInst, DataTablePlusProps } from "./data-table-plus/index.js";
|
|
7
7
|
import { _default as _default$3 } from "./loading-provider/LoadingProvider.vue.js";
|
|
8
|
-
import { LoadingProviderInst, LoadingProviderProps
|
|
8
|
+
import { LOADING_PROVIDER_INJECTION_KEY, LoadingProviderInst, LoadingProviderProps } from "./loading-provider/index.js";
|
|
9
9
|
import { UseNaiveFormRules } from "../composables/use-naive-form.js";
|
|
10
10
|
import { _default as _default$4 } from "./config-providers/ConfigProviders.vue.js";
|
|
11
11
|
import { ConfigProvidersProps } from "./config-providers/index.js";
|
|
@@ -24,6 +24,4 @@ import "./toggle-input/index.js";
|
|
|
24
24
|
import { _default as _default$11 } from "./tooltip-button/TooltipButton.vue.js";
|
|
25
25
|
import { TooltipButtonProps } from "./tooltip-button/index.js";
|
|
26
26
|
import { _default as _default$12 } from "./transition/BaseTransition.vue.js";
|
|
27
|
-
import { TransitionProps } from "./transition/index.js";
|
|
28
|
-
import { _default as _default$13 } from "./type-writer/TypeWriter.vue.js";
|
|
29
|
-
import { TypeWriterProps } from "./type-writer/index.js";
|
|
27
|
+
import { TransitionProps } from "./transition/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseTransition_default from "../transition/BaseTransition.js";
|
|
2
2
|
import { cName, loadingProviderCssr } from "./loading-provider.cssr.js";
|
|
3
|
-
import {
|
|
3
|
+
import { LOADING_PROVIDER_INJECTION_KEY } from "./index.js";
|
|
4
4
|
import { Fragment, Teleport, createBlock, createCommentVNode, createElementBlock, createSlots, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, provide, ref, renderSlot, unref, watchEffect, withCtx } from "vue";
|
|
5
5
|
import { useStyle } from "@oiij/css-render";
|
|
6
6
|
import { NEl, NSpin } from "naive-ui";
|
|
@@ -41,7 +41,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
41
|
}, _duration ?? __props.duration);
|
|
42
42
|
return { hide: hideLoading };
|
|
43
43
|
}
|
|
44
|
-
provide(
|
|
44
|
+
provide(LOADING_PROVIDER_INJECTION_KEY, {
|
|
45
45
|
show: showLoading,
|
|
46
46
|
hide: hideLoading
|
|
47
47
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LoadingProviderProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue63 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: vue63.DefineComponent<LoadingProviderProps, {}, {}, {}, {}, vue63.ComponentOptionsMixin, vue63.ComponentOptionsMixin, {}, string, vue63.PublicProps, Readonly<LoadingProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, vue63.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 & {
|
|
@@ -4,21 +4,30 @@ import { CSSProperties, InjectionKey, RendererElement } from "vue";
|
|
|
4
4
|
import { SpinProps } from "naive-ui";
|
|
5
5
|
|
|
6
6
|
//#region src/components/loading-provider/index.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* 加载提供者实例
|
|
9
|
+
*/
|
|
7
10
|
type LoadingProviderInst = {
|
|
8
|
-
show: (options?: {
|
|
9
|
-
text?: string;
|
|
11
|
+
/** 显示加载 */show: (options?: {
|
|
12
|
+
/** 加载文本 */text?: string; /** 持续时间 */
|
|
10
13
|
duration?: number;
|
|
11
|
-
}) => void;
|
|
14
|
+
}) => void; /** 隐藏加载 */
|
|
12
15
|
hide: () => void;
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
/**
|
|
18
|
+
* 加载提供者注入键
|
|
19
|
+
*/
|
|
20
|
+
declare const LOADING_PROVIDER_INJECTION_KEY: InjectionKey<LoadingProviderInst>;
|
|
21
|
+
/**
|
|
22
|
+
* 加载提供者属性
|
|
23
|
+
*/
|
|
15
24
|
type LoadingProviderProps = {
|
|
16
|
-
show?: boolean;
|
|
17
|
-
appendTo?: string | RendererElement;
|
|
18
|
-
mask?: boolean | CSSProperties;
|
|
19
|
-
blur?: boolean;
|
|
20
|
-
duration?: number;
|
|
25
|
+
/** 是否显示 */show?: boolean; /** 挂载目标元素 */
|
|
26
|
+
appendTo?: string | RendererElement; /** 遮罩层配置 */
|
|
27
|
+
mask?: boolean | CSSProperties; /** 是否模糊 */
|
|
28
|
+
blur?: boolean; /** 持续时间 */
|
|
29
|
+
duration?: number; /** 加载组件属性 */
|
|
21
30
|
spinProps?: Omit<SpinProps, 'show'> & ClassStyle;
|
|
22
31
|
};
|
|
23
32
|
//#endregion
|
|
24
|
-
export { LoadingProviderInst, LoadingProviderProps
|
|
33
|
+
export { LOADING_PROVIDER_INJECTION_KEY, LoadingProviderInst, LoadingProviderProps };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import LoadingProvider_default from "./LoadingProvider.js";
|
|
2
2
|
|
|
3
3
|
//#region src/components/loading-provider/index.ts
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* 加载提供者注入键
|
|
6
|
+
*/
|
|
7
|
+
const LOADING_PROVIDER_INJECTION_KEY = Symbol("loading-provider-key");
|
|
5
8
|
|
|
6
9
|
//#endregion
|
|
7
|
-
export {
|
|
10
|
+
export { LOADING_PROVIDER_INJECTION_KEY };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useNaiveForm } from "../../composables/use-naive-form.js";
|
|
2
2
|
import PresetInput_default from "../preset-input/PresetInput.js";
|
|
3
3
|
import { mergeRule } from "./_utils.js";
|
|
4
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString,
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useTemplateRef, withCtx } from "vue";
|
|
5
5
|
import { NButton, NCollapseTransition, NDivider, NForm, NFormItem, NGi, NGrid } from "naive-ui";
|
|
6
6
|
|
|
7
7
|
//#region src/components/preset-form/PresetForm.vue
|
|
@@ -27,15 +27,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
27
|
emit("validated", value);
|
|
28
28
|
});
|
|
29
29
|
const filterCollapsed = ref(false);
|
|
30
|
+
const visibleOptions = computed(() => {
|
|
31
|
+
return __props.options?.filter((f) => typeof f.hidden === "function" ? !f.hidden() : !f.hidden) || [];
|
|
32
|
+
});
|
|
30
33
|
const _options = computed(() => {
|
|
31
|
-
return
|
|
34
|
+
return visibleOptions.value.filter((f) => typeof f.collapsed === "function" ? !f.collapsed() : !f.collapsed);
|
|
32
35
|
});
|
|
33
36
|
const _collapsedOptions = computed(() => {
|
|
34
|
-
return
|
|
37
|
+
return visibleOptions.value.filter((f) => typeof f.collapsed === "function" ? f.collapsed() : f.collapsed);
|
|
35
38
|
});
|
|
36
39
|
function onPresetInputUpdate(val, key) {
|
|
37
40
|
if (key) setValue({ [key]: val });
|
|
38
41
|
}
|
|
42
|
+
function presetFormProps(options) {
|
|
43
|
+
return options.map((option) => {
|
|
44
|
+
const { key, label, required, span, rule, itemProps, render, ...inputOption } = option;
|
|
45
|
+
const { offset, suffix, ...extraItemProps } = itemProps ?? {};
|
|
46
|
+
return {
|
|
47
|
+
key: typeof key === "string" ? key : void 0,
|
|
48
|
+
label: typeof label === "function" ? label() : label,
|
|
49
|
+
span: typeof span === "function" ? span() : span ?? itemProps?.span,
|
|
50
|
+
required,
|
|
51
|
+
rule,
|
|
52
|
+
offset,
|
|
53
|
+
suffix,
|
|
54
|
+
itemProps: extraItemProps,
|
|
55
|
+
render,
|
|
56
|
+
inputOption
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
}
|
|
39
60
|
const expose = {
|
|
40
61
|
formInst,
|
|
41
62
|
formValue,
|
|
@@ -52,10 +73,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
73
|
const templateBind = computed(() => {
|
|
53
74
|
return {
|
|
54
75
|
...expose,
|
|
55
|
-
formInst:
|
|
56
|
-
formValue:
|
|
57
|
-
formRules:
|
|
58
|
-
formProps:
|
|
76
|
+
formInst: formInst.value,
|
|
77
|
+
formValue: formValue.value,
|
|
78
|
+
formRules: formRules.value,
|
|
79
|
+
formProps: _formProps
|
|
59
80
|
};
|
|
60
81
|
});
|
|
61
82
|
__expose(expose);
|
|
@@ -68,30 +89,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
68
89
|
default: withCtx(() => [
|
|
69
90
|
renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps(templateBind.value))),
|
|
70
91
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(templateBind.value)), () => [_options.value && _options.value.length > 0 ? (openBlock(), createBlock(unref(NGrid), normalizeProps(mergeProps({ key: 0 }, __props.gridProps)), {
|
|
71
|
-
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_options.value, ({
|
|
92
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(presetFormProps(_options.value), ({ span, offset, suffix, label, key, required, rule, itemProps, render, inputOption }, index) => {
|
|
72
93
|
return openBlock(), createBlock(unref(NGi), mergeProps({
|
|
73
|
-
key:
|
|
74
|
-
span
|
|
94
|
+
key: index,
|
|
95
|
+
span
|
|
75
96
|
}, { ref_for: true }, {
|
|
76
97
|
offset,
|
|
77
98
|
suffix
|
|
78
99
|
}), {
|
|
79
100
|
default: withCtx(({ overflow }) => [createVNode(unref(NFormItem), mergeProps({
|
|
80
|
-
label
|
|
81
|
-
path:
|
|
101
|
+
label,
|
|
102
|
+
path: key,
|
|
82
103
|
rule: unref(mergeRule)({
|
|
83
104
|
key,
|
|
84
105
|
label,
|
|
85
106
|
required,
|
|
86
107
|
rule
|
|
87
108
|
})
|
|
88
|
-
}, { ref_for: true },
|
|
109
|
+
}, { ref_for: true }, itemProps), {
|
|
89
110
|
default: withCtx(() => [render ? (openBlock(), createBlock(resolveDynamicComponent(render({
|
|
90
111
|
...expose,
|
|
91
112
|
overflow
|
|
92
113
|
})), { key: 0 })) : (openBlock(), createBlock(unref(PresetInput_default), {
|
|
93
114
|
key: 1,
|
|
94
|
-
options:
|
|
115
|
+
options: inputOption,
|
|
95
116
|
value: key ? unref(formValue)[key] : void 0,
|
|
96
117
|
"onUpdate:value": (val) => onPresetInputUpdate(val, key)
|
|
97
118
|
}, null, 8, [
|
|
@@ -120,30 +141,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
120
141
|
_: 1
|
|
121
142
|
}), createVNode(unref(NCollapseTransition), { show: filterCollapsed.value }, {
|
|
122
143
|
default: withCtx(() => [createVNode(unref(NGrid), normalizeProps(guardReactiveProps(__props.gridProps)), {
|
|
123
|
-
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_collapsedOptions.value, ({
|
|
144
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(presetFormProps(_collapsedOptions.value), ({ span, offset, suffix, label, key, required, rule, itemProps, render, inputOption }, index) => {
|
|
124
145
|
return openBlock(), createBlock(unref(NGi), mergeProps({
|
|
125
|
-
key:
|
|
126
|
-
span
|
|
146
|
+
key: index,
|
|
147
|
+
span
|
|
127
148
|
}, { ref_for: true }, {
|
|
128
149
|
offset,
|
|
129
150
|
suffix
|
|
130
151
|
}), {
|
|
131
152
|
default: withCtx(({ overflow }) => [createVNode(unref(NFormItem), mergeProps({
|
|
132
|
-
label
|
|
133
|
-
path:
|
|
153
|
+
label,
|
|
154
|
+
path: key,
|
|
134
155
|
rule: unref(mergeRule)({
|
|
135
156
|
key,
|
|
136
157
|
label,
|
|
137
158
|
required,
|
|
138
159
|
rule
|
|
139
160
|
})
|
|
140
|
-
}, { ref_for: true },
|
|
161
|
+
}, { ref_for: true }, itemProps), {
|
|
141
162
|
default: withCtx(() => [render ? (openBlock(), createBlock(resolveDynamicComponent(render({
|
|
142
163
|
...expose,
|
|
143
164
|
overflow
|
|
144
165
|
})), { key: 0 })) : (openBlock(), createBlock(unref(PresetInput_default), {
|
|
145
166
|
key: 1,
|
|
146
|
-
options:
|
|
167
|
+
options: inputOption,
|
|
147
168
|
value: key ? unref(formValue)[key] : void 0,
|
|
148
169
|
"onUpdate:value": (val) => onPresetInputUpdate(val, key)
|
|
149
170
|
}, null, 8, [
|