disguise-ui 0.2.1 → 0.2.3
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/disguise-ui.js +1107 -1035
- package/dist/style.css +1 -1
- package/dist/types/components/async-select/async-select.type.d.ts +4 -0
- package/dist/types/components/async-select/async-select.utils.d.ts +1 -1
- package/dist/types/components/async-select/async-select.vue.d.ts +3 -3
- package/dist/types/components/async-select/index.d.ts +1 -1
- package/dist/types/components/crud-page/index.type.d.ts +16 -4
- package/dist/types/components/crud-page/index.vue.d.ts +3 -3
- package/dist/types/components/dialog-list/index.vue.d.ts +164 -16
- package/dist/types/components/rich-text-editor/index.type.d.ts +57 -0
- package/dist/types/components/rich-text-editor/index.vue.d.ts +2 -6
- package/dist/types/components/schema-form/index.d.ts +1 -1
- package/dist/types/components/schema-form/schema-form.type.d.ts +23 -6
- package/dist/types/components/table-entity/index.type.d.ts +14 -11
- package/dist/types/components/table-entity/index.vue.d.ts +6 -5
- package/dist/types/entities/registry.d.ts +3 -3
- package/dist/types/index.d.ts +4 -1
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
31
31
|
$data: {};
|
|
32
32
|
$props: {
|
|
33
33
|
readonly columns?: ColumnsItem[] | undefined;
|
|
34
|
-
readonly data?: (
|
|
34
|
+
readonly data?: import("../table-entity/index.type").TableEntityRecord[] | import("../table-entity/index.type").TableEntityDataFetcher<import("../table-entity/index.type").TableEntityRecord> | undefined;
|
|
35
35
|
readonly height?: number | undefined;
|
|
36
36
|
readonly rowHeight?: number | undefined;
|
|
37
37
|
readonly cache?: number | undefined;
|
|
@@ -60,7 +60,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
60
60
|
readonly pushActions?: import("../table-entity/index.type").TableEntityPushAction[] | undefined;
|
|
61
61
|
readonly rowDraggable?: boolean | undefined;
|
|
62
62
|
readonly rowDragHandle?: string | undefined;
|
|
63
|
-
readonly rowDragDisabled?: ((row:
|
|
63
|
+
readonly rowDragDisabled?: ((row: import("../table-entity/index.type").TableEntityRecord) => boolean) | undefined;
|
|
64
64
|
readonly resizable?: boolean | undefined;
|
|
65
65
|
readonly minColumnWidth?: number | undefined;
|
|
66
66
|
readonly showColumnSettings?: boolean | undefined;
|
|
@@ -104,7 +104,44 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
104
104
|
rowKey: import("../table-entity/index.type").TableEntityRowKey;
|
|
105
105
|
}) => void) & ((event: "pageChange", page: number) => void) & ((event: "refresh") => void) & ((event: "handle-action", payload: import("../table-entity/index.type").TableEntityActionPayload) => void) & ((event: "importSuccess", result: import("../import-dialog").ImportDialogSubmitResult) => void) & ((event: "importError", error: Error | import("../import-dialog").ImportDialogSubmitResult) => void) & ((event: "rowSort", payload: import("../table-entity/index.type").TableEntityRowSortPayload) => void);
|
|
106
106
|
$el: any;
|
|
107
|
-
$options: import("vue").ComponentOptionsBase<Readonly<
|
|
107
|
+
$options: import("vue").ComponentOptionsBase<Readonly<{
|
|
108
|
+
columns?: ColumnsItem[];
|
|
109
|
+
data?: import("../table-entity/index.type").TableEntityRecord[] | import("../table-entity/index.type").TableEntityDataFetcher<import("../table-entity/index.type").TableEntityRecord> | undefined;
|
|
110
|
+
height?: number;
|
|
111
|
+
rowHeight?: number;
|
|
112
|
+
cache?: number;
|
|
113
|
+
width?: number;
|
|
114
|
+
selectable?: boolean;
|
|
115
|
+
multiple?: boolean;
|
|
116
|
+
rowKey?: string;
|
|
117
|
+
selectedKeys?: any[];
|
|
118
|
+
tree?: boolean;
|
|
119
|
+
treeChildrenKey?: string;
|
|
120
|
+
expandColumnKey?: string;
|
|
121
|
+
expandedRowKeys?: import("../table-entity/index.type").TableEntityRowKey[];
|
|
122
|
+
defaultExpandedRowKeys?: import("../table-entity/index.type").TableEntityRowKey[];
|
|
123
|
+
indentSize?: number;
|
|
124
|
+
iconSize?: number;
|
|
125
|
+
total?: number;
|
|
126
|
+
per_page?: number;
|
|
127
|
+
current_page?: number;
|
|
128
|
+
query?: import("../table-entity/index.type").TableEntityQueryParams;
|
|
129
|
+
showPagination?: boolean;
|
|
130
|
+
showActions?: boolean;
|
|
131
|
+
maxVisibleActions?: number;
|
|
132
|
+
actionColumnWidth?: number;
|
|
133
|
+
actionColumnTitle?: string;
|
|
134
|
+
actions?: import("../table-entity/index.type").TableEntityActionName[];
|
|
135
|
+
pushActions?: import("../table-entity/index.type").TableEntityPushAction[];
|
|
136
|
+
rowDraggable?: boolean;
|
|
137
|
+
rowDragHandle?: string;
|
|
138
|
+
rowDragDisabled?: ((row: import("../table-entity/index.type").TableEntityRecord) => boolean) | undefined;
|
|
139
|
+
resizable?: boolean;
|
|
140
|
+
minColumnWidth?: number;
|
|
141
|
+
showColumnSettings?: boolean;
|
|
142
|
+
permissionCode?: string;
|
|
143
|
+
importDialog?: import("../table-entity/index.type").TableEntityImportDialogConfig;
|
|
144
|
+
}> & Readonly<{
|
|
108
145
|
onChange?: ((payload: import("../table-entity/index.type").TableEntityChangePayload) => any) | undefined;
|
|
109
146
|
"onUpdate:selectedKeys"?: ((keys: any[]) => any) | undefined;
|
|
110
147
|
"onUpdate:current_page"?: ((page: number) => any) | undefined;
|
|
@@ -154,7 +191,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
154
191
|
importError: (error: Error | import("../import-dialog").ImportDialogSubmitResult) => any;
|
|
155
192
|
rowSort: (payload: import("../table-entity/index.type").TableEntityRowSortPayload) => any;
|
|
156
193
|
}, string, {
|
|
157
|
-
data:
|
|
194
|
+
data: import("../table-entity/index.type").TableEntityRecord[] | import("../table-entity/index.type").TableEntityDataFetcher<import("../table-entity/index.type").TableEntityRecord>;
|
|
158
195
|
columns: ColumnsItem[];
|
|
159
196
|
height: number;
|
|
160
197
|
rowHeight: number;
|
|
@@ -180,7 +217,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
180
217
|
pushActions: import("../table-entity/index.type").TableEntityPushAction[];
|
|
181
218
|
rowDraggable: boolean;
|
|
182
219
|
rowDragHandle: string;
|
|
183
|
-
rowDragDisabled: (row:
|
|
220
|
+
rowDragDisabled: (row: import("../table-entity/index.type").TableEntityRecord) => boolean;
|
|
184
221
|
resizable: boolean;
|
|
185
222
|
minColumnWidth: number;
|
|
186
223
|
showColumnSettings: boolean;
|
|
@@ -207,7 +244,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
207
244
|
$nextTick: typeof import("vue").nextTick;
|
|
208
245
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
209
246
|
} & Readonly<{
|
|
210
|
-
data:
|
|
247
|
+
data: import("../table-entity/index.type").TableEntityRecord[] | import("../table-entity/index.type").TableEntityDataFetcher<import("../table-entity/index.type").TableEntityRecord>;
|
|
211
248
|
columns: ColumnsItem[];
|
|
212
249
|
height: number;
|
|
213
250
|
rowHeight: number;
|
|
@@ -233,13 +270,50 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
233
270
|
pushActions: import("../table-entity/index.type").TableEntityPushAction[];
|
|
234
271
|
rowDraggable: boolean;
|
|
235
272
|
rowDragHandle: string;
|
|
236
|
-
rowDragDisabled: (row:
|
|
273
|
+
rowDragDisabled: (row: import("../table-entity/index.type").TableEntityRecord) => boolean;
|
|
237
274
|
resizable: boolean;
|
|
238
275
|
minColumnWidth: number;
|
|
239
276
|
showColumnSettings: boolean;
|
|
240
277
|
permissionCode: string;
|
|
241
278
|
importDialog: import("../table-entity/index.type").TableEntityImportDialogConfig;
|
|
242
|
-
}> & Omit<Readonly<
|
|
279
|
+
}> & Omit<Readonly<{
|
|
280
|
+
columns?: ColumnsItem[];
|
|
281
|
+
data?: import("../table-entity/index.type").TableEntityRecord[] | import("../table-entity/index.type").TableEntityDataFetcher<import("../table-entity/index.type").TableEntityRecord> | undefined;
|
|
282
|
+
height?: number;
|
|
283
|
+
rowHeight?: number;
|
|
284
|
+
cache?: number;
|
|
285
|
+
width?: number;
|
|
286
|
+
selectable?: boolean;
|
|
287
|
+
multiple?: boolean;
|
|
288
|
+
rowKey?: string;
|
|
289
|
+
selectedKeys?: any[];
|
|
290
|
+
tree?: boolean;
|
|
291
|
+
treeChildrenKey?: string;
|
|
292
|
+
expandColumnKey?: string;
|
|
293
|
+
expandedRowKeys?: import("../table-entity/index.type").TableEntityRowKey[];
|
|
294
|
+
defaultExpandedRowKeys?: import("../table-entity/index.type").TableEntityRowKey[];
|
|
295
|
+
indentSize?: number;
|
|
296
|
+
iconSize?: number;
|
|
297
|
+
total?: number;
|
|
298
|
+
per_page?: number;
|
|
299
|
+
current_page?: number;
|
|
300
|
+
query?: import("../table-entity/index.type").TableEntityQueryParams;
|
|
301
|
+
showPagination?: boolean;
|
|
302
|
+
showActions?: boolean;
|
|
303
|
+
maxVisibleActions?: number;
|
|
304
|
+
actionColumnWidth?: number;
|
|
305
|
+
actionColumnTitle?: string;
|
|
306
|
+
actions?: import("../table-entity/index.type").TableEntityActionName[];
|
|
307
|
+
pushActions?: import("../table-entity/index.type").TableEntityPushAction[];
|
|
308
|
+
rowDraggable?: boolean;
|
|
309
|
+
rowDragHandle?: string;
|
|
310
|
+
rowDragDisabled?: ((row: import("../table-entity/index.type").TableEntityRecord) => boolean) | undefined;
|
|
311
|
+
resizable?: boolean;
|
|
312
|
+
minColumnWidth?: number;
|
|
313
|
+
showColumnSettings?: boolean;
|
|
314
|
+
permissionCode?: string;
|
|
315
|
+
importDialog?: import("../table-entity/index.type").TableEntityImportDialogConfig;
|
|
316
|
+
}> & Readonly<{
|
|
243
317
|
onChange?: ((payload: import("../table-entity/index.type").TableEntityChangePayload) => any) | undefined;
|
|
244
318
|
"onUpdate:selectedKeys"?: ((keys: any[]) => any) | undefined;
|
|
245
319
|
"onUpdate:current_page"?: ((page: number) => any) | undefined;
|
|
@@ -276,7 +350,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
276
350
|
$data: {};
|
|
277
351
|
$props: {
|
|
278
352
|
readonly columns?: ColumnsItem[] | undefined;
|
|
279
|
-
readonly data?: (
|
|
353
|
+
readonly data?: import("../table-entity/index.type").TableEntityRecord[] | import("../table-entity/index.type").TableEntityDataFetcher<import("../table-entity/index.type").TableEntityRecord> | undefined;
|
|
280
354
|
readonly height?: number | undefined;
|
|
281
355
|
readonly rowHeight?: number | undefined;
|
|
282
356
|
readonly cache?: number | undefined;
|
|
@@ -305,7 +379,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
305
379
|
readonly pushActions?: import("../table-entity/index.type").TableEntityPushAction[] | undefined;
|
|
306
380
|
readonly rowDraggable?: boolean | undefined;
|
|
307
381
|
readonly rowDragHandle?: string | undefined;
|
|
308
|
-
readonly rowDragDisabled?: ((row:
|
|
382
|
+
readonly rowDragDisabled?: ((row: import("../table-entity/index.type").TableEntityRecord) => boolean) | undefined;
|
|
309
383
|
readonly resizable?: boolean | undefined;
|
|
310
384
|
readonly minColumnWidth?: number | undefined;
|
|
311
385
|
readonly showColumnSettings?: boolean | undefined;
|
|
@@ -349,7 +423,44 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
349
423
|
rowKey: import("../table-entity/index.type").TableEntityRowKey;
|
|
350
424
|
}) => void) & ((event: "pageChange", page: number) => void) & ((event: "refresh") => void) & ((event: "handle-action", payload: import("../table-entity/index.type").TableEntityActionPayload) => void) & ((event: "importSuccess", result: import("../import-dialog").ImportDialogSubmitResult) => void) & ((event: "importError", error: Error | import("../import-dialog").ImportDialogSubmitResult) => void) & ((event: "rowSort", payload: import("../table-entity/index.type").TableEntityRowSortPayload) => void);
|
|
351
425
|
$el: any;
|
|
352
|
-
$options: import("vue").ComponentOptionsBase<Readonly<
|
|
426
|
+
$options: import("vue").ComponentOptionsBase<Readonly<{
|
|
427
|
+
columns?: ColumnsItem[];
|
|
428
|
+
data?: import("../table-entity/index.type").TableEntityRecord[] | import("../table-entity/index.type").TableEntityDataFetcher<import("../table-entity/index.type").TableEntityRecord> | undefined;
|
|
429
|
+
height?: number;
|
|
430
|
+
rowHeight?: number;
|
|
431
|
+
cache?: number;
|
|
432
|
+
width?: number;
|
|
433
|
+
selectable?: boolean;
|
|
434
|
+
multiple?: boolean;
|
|
435
|
+
rowKey?: string;
|
|
436
|
+
selectedKeys?: any[];
|
|
437
|
+
tree?: boolean;
|
|
438
|
+
treeChildrenKey?: string;
|
|
439
|
+
expandColumnKey?: string;
|
|
440
|
+
expandedRowKeys?: import("../table-entity/index.type").TableEntityRowKey[];
|
|
441
|
+
defaultExpandedRowKeys?: import("../table-entity/index.type").TableEntityRowKey[];
|
|
442
|
+
indentSize?: number;
|
|
443
|
+
iconSize?: number;
|
|
444
|
+
total?: number;
|
|
445
|
+
per_page?: number;
|
|
446
|
+
current_page?: number;
|
|
447
|
+
query?: import("../table-entity/index.type").TableEntityQueryParams;
|
|
448
|
+
showPagination?: boolean;
|
|
449
|
+
showActions?: boolean;
|
|
450
|
+
maxVisibleActions?: number;
|
|
451
|
+
actionColumnWidth?: number;
|
|
452
|
+
actionColumnTitle?: string;
|
|
453
|
+
actions?: import("../table-entity/index.type").TableEntityActionName[];
|
|
454
|
+
pushActions?: import("../table-entity/index.type").TableEntityPushAction[];
|
|
455
|
+
rowDraggable?: boolean;
|
|
456
|
+
rowDragHandle?: string;
|
|
457
|
+
rowDragDisabled?: ((row: import("../table-entity/index.type").TableEntityRecord) => boolean) | undefined;
|
|
458
|
+
resizable?: boolean;
|
|
459
|
+
minColumnWidth?: number;
|
|
460
|
+
showColumnSettings?: boolean;
|
|
461
|
+
permissionCode?: string;
|
|
462
|
+
importDialog?: import("../table-entity/index.type").TableEntityImportDialogConfig;
|
|
463
|
+
}> & Readonly<{
|
|
353
464
|
onChange?: ((payload: import("../table-entity/index.type").TableEntityChangePayload) => any) | undefined;
|
|
354
465
|
"onUpdate:selectedKeys"?: ((keys: any[]) => any) | undefined;
|
|
355
466
|
"onUpdate:current_page"?: ((page: number) => any) | undefined;
|
|
@@ -399,7 +510,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
399
510
|
importError: (error: Error | import("../import-dialog").ImportDialogSubmitResult) => any;
|
|
400
511
|
rowSort: (payload: import("../table-entity/index.type").TableEntityRowSortPayload) => any;
|
|
401
512
|
}, string, {
|
|
402
|
-
data:
|
|
513
|
+
data: import("../table-entity/index.type").TableEntityRecord[] | import("../table-entity/index.type").TableEntityDataFetcher<import("../table-entity/index.type").TableEntityRecord>;
|
|
403
514
|
columns: ColumnsItem[];
|
|
404
515
|
height: number;
|
|
405
516
|
rowHeight: number;
|
|
@@ -425,7 +536,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
425
536
|
pushActions: import("../table-entity/index.type").TableEntityPushAction[];
|
|
426
537
|
rowDraggable: boolean;
|
|
427
538
|
rowDragHandle: string;
|
|
428
|
-
rowDragDisabled: (row:
|
|
539
|
+
rowDragDisabled: (row: import("../table-entity/index.type").TableEntityRecord) => boolean;
|
|
429
540
|
resizable: boolean;
|
|
430
541
|
minColumnWidth: number;
|
|
431
542
|
showColumnSettings: boolean;
|
|
@@ -452,7 +563,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
452
563
|
$nextTick: typeof import("vue").nextTick;
|
|
453
564
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
454
565
|
} & Readonly<{
|
|
455
|
-
data:
|
|
566
|
+
data: import("../table-entity/index.type").TableEntityRecord[] | import("../table-entity/index.type").TableEntityDataFetcher<import("../table-entity/index.type").TableEntityRecord>;
|
|
456
567
|
columns: ColumnsItem[];
|
|
457
568
|
height: number;
|
|
458
569
|
rowHeight: number;
|
|
@@ -478,13 +589,50 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
478
589
|
pushActions: import("../table-entity/index.type").TableEntityPushAction[];
|
|
479
590
|
rowDraggable: boolean;
|
|
480
591
|
rowDragHandle: string;
|
|
481
|
-
rowDragDisabled: (row:
|
|
592
|
+
rowDragDisabled: (row: import("../table-entity/index.type").TableEntityRecord) => boolean;
|
|
482
593
|
resizable: boolean;
|
|
483
594
|
minColumnWidth: number;
|
|
484
595
|
showColumnSettings: boolean;
|
|
485
596
|
permissionCode: string;
|
|
486
597
|
importDialog: import("../table-entity/index.type").TableEntityImportDialogConfig;
|
|
487
|
-
}> & Omit<Readonly<
|
|
598
|
+
}> & Omit<Readonly<{
|
|
599
|
+
columns?: ColumnsItem[];
|
|
600
|
+
data?: import("../table-entity/index.type").TableEntityRecord[] | import("../table-entity/index.type").TableEntityDataFetcher<import("../table-entity/index.type").TableEntityRecord> | undefined;
|
|
601
|
+
height?: number;
|
|
602
|
+
rowHeight?: number;
|
|
603
|
+
cache?: number;
|
|
604
|
+
width?: number;
|
|
605
|
+
selectable?: boolean;
|
|
606
|
+
multiple?: boolean;
|
|
607
|
+
rowKey?: string;
|
|
608
|
+
selectedKeys?: any[];
|
|
609
|
+
tree?: boolean;
|
|
610
|
+
treeChildrenKey?: string;
|
|
611
|
+
expandColumnKey?: string;
|
|
612
|
+
expandedRowKeys?: import("../table-entity/index.type").TableEntityRowKey[];
|
|
613
|
+
defaultExpandedRowKeys?: import("../table-entity/index.type").TableEntityRowKey[];
|
|
614
|
+
indentSize?: number;
|
|
615
|
+
iconSize?: number;
|
|
616
|
+
total?: number;
|
|
617
|
+
per_page?: number;
|
|
618
|
+
current_page?: number;
|
|
619
|
+
query?: import("../table-entity/index.type").TableEntityQueryParams;
|
|
620
|
+
showPagination?: boolean;
|
|
621
|
+
showActions?: boolean;
|
|
622
|
+
maxVisibleActions?: number;
|
|
623
|
+
actionColumnWidth?: number;
|
|
624
|
+
actionColumnTitle?: string;
|
|
625
|
+
actions?: import("../table-entity/index.type").TableEntityActionName[];
|
|
626
|
+
pushActions?: import("../table-entity/index.type").TableEntityPushAction[];
|
|
627
|
+
rowDraggable?: boolean;
|
|
628
|
+
rowDragHandle?: string;
|
|
629
|
+
rowDragDisabled?: ((row: import("../table-entity/index.type").TableEntityRecord) => boolean) | undefined;
|
|
630
|
+
resizable?: boolean;
|
|
631
|
+
minColumnWidth?: number;
|
|
632
|
+
showColumnSettings?: boolean;
|
|
633
|
+
permissionCode?: string;
|
|
634
|
+
importDialog?: import("../table-entity/index.type").TableEntityImportDialogConfig;
|
|
635
|
+
}> & Readonly<{
|
|
488
636
|
onChange?: ((payload: import("../table-entity/index.type").TableEntityChangePayload) => any) | undefined;
|
|
489
637
|
"onUpdate:selectedKeys"?: ((keys: any[]) => any) | undefined;
|
|
490
638
|
"onUpdate:current_page"?: ((page: number) => any) | undefined;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
import type { Component } from 'vue';
|
|
3
|
+
/** 富文本工具始终可用的编辑器上下文。 */
|
|
4
|
+
export type RichTextToolBaseContext = {
|
|
5
|
+
/** 当前 Tiptap 编辑器实例。 */
|
|
6
|
+
editor: Editor;
|
|
7
|
+
/** 编辑器当前是否允许修改。 */
|
|
8
|
+
editable: boolean;
|
|
9
|
+
/** 调用工具时的最新 HTML。 */
|
|
10
|
+
value: string;
|
|
11
|
+
/** 获取最新 HTML,适合在弹窗或异步流程结束后调用。 */
|
|
12
|
+
getValue: () => string;
|
|
13
|
+
/** 更新编辑器 HTML,并同步触发 v-model。 */
|
|
14
|
+
updateValue: (value: string) => void;
|
|
15
|
+
};
|
|
16
|
+
/** 自定义工具收到的完整上下文;泛型可由上层组件补充表单信息。 */
|
|
17
|
+
export type RichTextToolContext<TExtraContext extends object = Record<string, never>> = RichTextToolBaseContext & TExtraContext;
|
|
18
|
+
export type RichTextToolPredicate<TExtraContext extends object = Record<string, never>> = boolean | ((context: RichTextToolContext<TExtraContext>) => boolean);
|
|
19
|
+
type RichTextToolBase<TExtraContext extends object> = {
|
|
20
|
+
/** 工具唯一标识。 */
|
|
21
|
+
key: string;
|
|
22
|
+
/** 按钮提示文案;未提供 icon 时也作为按钮文字。 */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Vue 图标组件。 */
|
|
25
|
+
icon?: Component;
|
|
26
|
+
/** 自定义工具之间的排序值,默认 0;数值越小越靠前。 */
|
|
27
|
+
order?: number;
|
|
28
|
+
/** 是否显示工具。 */
|
|
29
|
+
visible?: RichTextToolPredicate<TExtraContext>;
|
|
30
|
+
/** 是否禁用工具。编辑器不可编辑时,按钮工具始终禁用。 */
|
|
31
|
+
disabled?: RichTextToolPredicate<TExtraContext>;
|
|
32
|
+
};
|
|
33
|
+
/** 直接在工具栏渲染自定义 Vue 组件。组件会收到 context 与 disabled。 */
|
|
34
|
+
export type RichTextComponentTool<TExtraContext extends object = Record<string, never>> = RichTextToolBase<TExtraContext> & {
|
|
35
|
+
component: Component;
|
|
36
|
+
onClick?: never;
|
|
37
|
+
/** 额外透传给自定义组件的属性。 */
|
|
38
|
+
props?: Record<string, unknown>;
|
|
39
|
+
};
|
|
40
|
+
/** 渲染为工具栏按钮,点击后调用 onClick。 */
|
|
41
|
+
export type RichTextActionTool<TExtraContext extends object = Record<string, never>> = RichTextToolBase<TExtraContext> & {
|
|
42
|
+
component?: never;
|
|
43
|
+
onClick: (context: RichTextToolContext<TExtraContext>) => Promise<void> | void;
|
|
44
|
+
props?: never;
|
|
45
|
+
};
|
|
46
|
+
export type RichTextTool<TExtraContext extends object = Record<string, never>> = RichTextActionTool<TExtraContext> | RichTextComponentTool<TExtraContext>;
|
|
47
|
+
export type RichTextEditorProps<TExtraContext extends object = Record<string, never>> = {
|
|
48
|
+
editable?: boolean;
|
|
49
|
+
maxHeight?: string;
|
|
50
|
+
modelValue?: string;
|
|
51
|
+
placeholder?: string;
|
|
52
|
+
/** 追加到内置工具栏末尾的自定义工具。 */
|
|
53
|
+
richTextTools?: RichTextTool<TExtraContext>[];
|
|
54
|
+
/** 上层组件注入的额外上下文;工具使用时会与编辑器上下文合并。 */
|
|
55
|
+
toolContext?: TExtraContext;
|
|
56
|
+
};
|
|
57
|
+
export {};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
maxHeight?: string;
|
|
5
|
-
modelValue?: string;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
};
|
|
2
|
+
import type { RichTextEditorProps } from './index.type';
|
|
3
|
+
type __VLS_Props = RichTextEditorProps<Record<string, unknown>>;
|
|
8
4
|
declare function clearFormat(): void;
|
|
9
5
|
declare const __VLS_template: () => {
|
|
10
6
|
__VLS_Slots: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { registerSchemaFormComponents, resolveSchemaFormComponent, } from './schema-form-registry';
|
|
2
2
|
export type { SchemaFormComponent, SchemaFormComponentConfig, SchemaFormComponentRegistration, } from './schema-form-registry';
|
|
3
|
-
export type { ApiFieldOptions, FieldCondition, FieldContext, FieldOption, FieldOptionsResolver, FieldPropsContext, FieldPropsResolver, SchemaFormField, SchemaFormGroup, SchemaFormItem, SchemaFormMode, SchemaFormProps, SchemaFormSlotProps, TranslateCommand, TranslateConfig, TranslateHandlerContext, TranslateLanguage, TranslateLanguageValues, } from './schema-form.type';
|
|
3
|
+
export type { ApiFieldOptions, FieldCondition, FieldContext, FieldOption, FieldOptionsResolver, FieldPropsContext, FieldPropsResolver, SchemaFormField, SchemaFormGroup, SchemaFormItem, SchemaFormMode, SchemaFormProps, SchemaFormSlotProps, SchemaRichTextEditorProps, SchemaRichTextToolContext, TranslateCommand, TranslateConfig, TranslateHandlerContext, TranslateLanguage, TranslateLanguageValues, } from './schema-form.type';
|
|
4
4
|
export { DEFAULT_TRANSLATE_LANGUAGES } from './schema-form.type';
|
|
5
5
|
export { default as SchemaForm } from './schema-form.vue';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FormItemRule } from 'element-plus';
|
|
2
|
+
import type { RichTextEditorProps } from '../rich-text-editor/index.type';
|
|
2
3
|
import type { SchemaFormComponent, SchemaFormComponentConfig } from './schema-form-registry';
|
|
3
4
|
/** ****************************** 基础 ********************************/
|
|
4
5
|
export type SchemaFormMode = 'create' | 'edit' | 'view';
|
|
@@ -38,7 +39,7 @@ export type FieldOptionsResolver = (ctx: FieldContext) => FieldOption[];
|
|
|
38
39
|
export type FieldPropsContext = FieldContext & {
|
|
39
40
|
updateValue: (value: any) => void;
|
|
40
41
|
};
|
|
41
|
-
export type FieldPropsResolver = (ctx: FieldPropsContext) =>
|
|
42
|
+
export type FieldPropsResolver<TProps extends Record<string, any> = Record<string, any>> = (ctx: FieldPropsContext) => TProps;
|
|
42
43
|
export type TranslateLanguage = {
|
|
43
44
|
code: string;
|
|
44
45
|
label: string;
|
|
@@ -69,7 +70,7 @@ export type TranslateConfig = {
|
|
|
69
70
|
};
|
|
70
71
|
export type FieldType = 'async-select' | 'checkbox' | 'component' | 'date' | 'datetime' | 'file' | 'number' | 'picture' | 'radio' | 'rich-text' | 'select' | 'slot' | 'switch' | 'text' | 'textarea' | 'upload';
|
|
71
72
|
/** ****************************** 字段 ********************************/
|
|
72
|
-
type BaseField = {
|
|
73
|
+
type BaseField<TProps extends Record<string, any> = Record<string, any>> = {
|
|
73
74
|
/** 覆盖内置控件,或配合 type: 'component' 使用注册的自定义组件 */
|
|
74
75
|
component?: SchemaFormComponent | SchemaFormComponentConfig | string;
|
|
75
76
|
/** 只读态是否附带复制按钮,默认跟随 readonly */
|
|
@@ -86,7 +87,7 @@ type BaseField = {
|
|
|
86
87
|
newRow?: boolean;
|
|
87
88
|
placeholder?: string;
|
|
88
89
|
/** 透传给底层控件的额外属性 */
|
|
89
|
-
props?: FieldPropsResolver |
|
|
90
|
+
props?: FieldPropsResolver<TProps> | TProps;
|
|
90
91
|
prop: string;
|
|
91
92
|
/** 渲染为纯文本而非输入控件 */
|
|
92
93
|
readonly?: boolean;
|
|
@@ -100,6 +101,20 @@ type BaseField = {
|
|
|
100
101
|
/** 为 text、textarea、rich-text 字段启用多语言编辑 */
|
|
101
102
|
translateConfig?: TranslateConfig;
|
|
102
103
|
};
|
|
104
|
+
/** SchemaForm 为富文本工具补充的表单上下文。 */
|
|
105
|
+
export type SchemaRichTextToolContext = {
|
|
106
|
+
/** 当前字段元数据。 */
|
|
107
|
+
field: ResolvedField;
|
|
108
|
+
/** 当前整张表单的最新值。 */
|
|
109
|
+
formData: Record<string, any>;
|
|
110
|
+
/** 弹窗或异步操作完成后获取最新表单值。 */
|
|
111
|
+
getFormData: () => Record<string, any>;
|
|
112
|
+
/** 多语言富文本当前正在编辑的语言代码。 */
|
|
113
|
+
language?: string;
|
|
114
|
+
mode: SchemaFormMode;
|
|
115
|
+
};
|
|
116
|
+
/** type: 'rich-text' 字段 props 的完整类型。 */
|
|
117
|
+
export type SchemaRichTextEditorProps = Omit<RichTextEditorProps<SchemaRichTextToolContext>, 'modelValue' | 'toolContext'>;
|
|
103
118
|
export type ApiFieldOptions = {
|
|
104
119
|
entityKey: string;
|
|
105
120
|
labelKey?: string;
|
|
@@ -109,7 +124,7 @@ export type ApiFieldOptions = {
|
|
|
109
124
|
subtitleKey?: string;
|
|
110
125
|
valueKey?: string;
|
|
111
126
|
};
|
|
112
|
-
export type SchemaFormField = BaseField & ({
|
|
127
|
+
export type SchemaFormField = ((BaseField & ({
|
|
113
128
|
apiOptions: ApiFieldOptions;
|
|
114
129
|
optionSource?: 'api';
|
|
115
130
|
type: 'async-select';
|
|
@@ -129,8 +144,10 @@ export type SchemaFormField = BaseField & ({
|
|
|
129
144
|
optionSource?: 'static';
|
|
130
145
|
type: 'checkbox' | 'radio' | 'select';
|
|
131
146
|
} | {
|
|
132
|
-
type: 'date' | 'datetime' | 'file' | 'listExpand' | 'number' | 'picture' | '
|
|
133
|
-
}) & {
|
|
147
|
+
type: 'date' | 'datetime' | 'file' | 'listExpand' | 'number' | 'picture' | 'slot' | 'switch' | 'text' | 'textarea' | 'upload';
|
|
148
|
+
})) | (BaseField<SchemaRichTextEditorProps> & {
|
|
149
|
+
type: 'rich-text';
|
|
150
|
+
})) & {
|
|
134
151
|
label: string;
|
|
135
152
|
};
|
|
136
153
|
/** Omit 作用在联合类型上会丢掉各分支特有字段,分组子项必须按成员展开 */
|
|
@@ -51,18 +51,19 @@ export type TableEntityChangePayload = {
|
|
|
51
51
|
sortOrder?: TableEntitySortOrder;
|
|
52
52
|
};
|
|
53
53
|
export type TableEntityQueryParams = Record<string, any>;
|
|
54
|
-
export type
|
|
55
|
-
|
|
54
|
+
export type TableEntityRecord = Record<string, any>;
|
|
55
|
+
export type TableEntityDataResult<TRecord extends TableEntityRecord = TableEntityRecord> = {
|
|
56
|
+
rows: TRecord[];
|
|
56
57
|
total: number;
|
|
57
58
|
};
|
|
58
|
-
export type TableEntityDataFetcher = (params: {
|
|
59
|
+
export type TableEntityDataFetcher<TRecord extends TableEntityRecord = TableEntityRecord> = (params: {
|
|
59
60
|
current_page: number;
|
|
60
61
|
page?: number;
|
|
61
62
|
per_page: number;
|
|
62
63
|
query?: TableEntityQueryParams;
|
|
63
64
|
sortField?: string;
|
|
64
65
|
sortOrder?: TableEntitySortOrder;
|
|
65
|
-
}) => Promise<TableEntityDataResult
|
|
66
|
+
}) => Promise<TableEntityDataResult<TRecord>>;
|
|
66
67
|
/** ****************************** 列宽拖拽 ********************************/
|
|
67
68
|
export type ColumnResizeState = {
|
|
68
69
|
/** 正在拖拽的列 key */
|
|
@@ -114,9 +115,9 @@ export type TableEntityActionPayload = {
|
|
|
114
115
|
/** ****************************** 组件 Props ********************************/
|
|
115
116
|
/** 导入弹窗(ImportDialog)配置:import-dialog 需要传入什么,就在这里传什么(弹窗显隐由表格内部控制,故不含 modelValue) */
|
|
116
117
|
export type TableEntityImportDialogConfig = Omit<ImportDialogProps, 'modelValue'>;
|
|
117
|
-
export type
|
|
118
|
+
export type TableEntityProps<TRecord extends TableEntityRecord = TableEntityRecord> = {
|
|
118
119
|
columns?: ColumnsItem[];
|
|
119
|
-
data?:
|
|
120
|
+
data?: TRecord[] | TableEntityDataFetcher<TRecord>;
|
|
120
121
|
height?: number;
|
|
121
122
|
rowHeight?: number;
|
|
122
123
|
/** 虚拟列表在可视区外预渲染的行数,值越小滚动渲染压力越低 */
|
|
@@ -158,7 +159,7 @@ export type TableEntlty = {
|
|
|
158
159
|
*/
|
|
159
160
|
rowDragHandle?: string;
|
|
160
161
|
/** 返回 true 的行不可拖动,也不能作为放置目标 */
|
|
161
|
-
rowDragDisabled?: (row:
|
|
162
|
+
rowDragDisabled?: (row: TRecord) => boolean;
|
|
162
163
|
/** 是否允许拖拽调整列宽,默认 false */
|
|
163
164
|
resizable?: boolean;
|
|
164
165
|
/** 列宽最小值,默认 50 */
|
|
@@ -169,19 +170,21 @@ export type TableEntlty = {
|
|
|
169
170
|
/** 导入弹窗配置:传入后点击“导入”按钮打开 ImportDialog 弹窗 */
|
|
170
171
|
importDialog?: TableEntityImportDialogConfig;
|
|
171
172
|
};
|
|
172
|
-
|
|
173
|
+
/** @deprecated 请使用 TableEntityProps。 */
|
|
174
|
+
export type TableEntlty = TableEntityProps;
|
|
175
|
+
export type TableEntityRowSortPayload<TRecord extends TableEntityRecord = TableEntityRecord> = {
|
|
173
176
|
/** 当前拖动层级内的新位置;树形表格为同级数组中的位置 */
|
|
174
177
|
newIndex: number;
|
|
175
178
|
/** 当前拖动层级内的原位置;树形表格为同级数组中的位置 */
|
|
176
179
|
oldIndex: number;
|
|
177
180
|
/** 树形表格重排后的完整树;非树形表格为当前数据行 */
|
|
178
|
-
rows:
|
|
181
|
+
rows: TRecord[];
|
|
179
182
|
/** 树形表格被排序节点的父节点 key;根节点排序时为 null */
|
|
180
183
|
parentRowKey?: TableEntityRowKey | null;
|
|
181
184
|
};
|
|
182
|
-
export type TableEntityExpose = {
|
|
185
|
+
export type TableEntityExpose<TRecord extends TableEntityRecord = TableEntityRecord> = {
|
|
183
186
|
clearSelection: () => void;
|
|
184
|
-
getSelectedRows: () =>
|
|
187
|
+
getSelectedRows: () => TRecord[];
|
|
185
188
|
getSelectedCount: () => number;
|
|
186
189
|
setSelectedKeys: (keys: any[]) => void;
|
|
187
190
|
openImport: () => boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ImportDialogSubmitResult } from '../import-dialog/index.type';
|
|
2
|
-
import type { ColumnsItem, TableEntityActionName, TableEntityActionPayload, TableEntityChangePayload, TableEntityRowKey, TableEntityRowSortPayload,
|
|
2
|
+
import type { ColumnsItem, TableEntityActionName, TableEntityActionPayload, TableEntityChangePayload, TableEntityRowKey, TableEntityRowSortPayload, TableEntityProps } from './index.type';
|
|
3
|
+
type __VLS_Props = TableEntityProps;
|
|
3
4
|
declare function openImport(): boolean;
|
|
4
5
|
declare function reload(page?: number): Promise<void>;
|
|
5
6
|
declare const __VLS_template: () => {
|
|
@@ -8,7 +9,7 @@ declare const __VLS_template: () => {
|
|
|
8
9
|
};
|
|
9
10
|
};
|
|
10
11
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
11
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
12
13
|
clearSelection: () => void;
|
|
13
14
|
getSelectedRows: () => Record<string, any>[];
|
|
14
15
|
getSelectedCount: () => number;
|
|
@@ -36,7 +37,7 @@ declare const __VLS_base: import("vue").DefineComponent<TableEntlty, {
|
|
|
36
37
|
importSuccess: (result: ImportDialogSubmitResult) => any;
|
|
37
38
|
importError: (error: Error | ImportDialogSubmitResult) => any;
|
|
38
39
|
rowSort: (payload: TableEntityRowSortPayload) => any;
|
|
39
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
40
41
|
onChange?: ((payload: TableEntityChangePayload) => any) | undefined;
|
|
41
42
|
"onUpdate:selectedKeys"?: ((keys: any[]) => any) | undefined;
|
|
42
43
|
"onUpdate:current_page"?: ((page: number) => any) | undefined;
|
|
@@ -58,7 +59,7 @@ declare const __VLS_base: import("vue").DefineComponent<TableEntlty, {
|
|
|
58
59
|
onImportError?: ((error: Error | ImportDialogSubmitResult) => any) | undefined;
|
|
59
60
|
onRowSort?: ((payload: TableEntityRowSortPayload) => any) | undefined;
|
|
60
61
|
}>, {
|
|
61
|
-
data:
|
|
62
|
+
data: import("./index.type").TableEntityRecord[] | import("./index.type").TableEntityDataFetcher<import("./index.type").TableEntityRecord>;
|
|
62
63
|
columns: ColumnsItem[];
|
|
63
64
|
height: number;
|
|
64
65
|
rowHeight: number;
|
|
@@ -84,7 +85,7 @@ declare const __VLS_base: import("vue").DefineComponent<TableEntlty, {
|
|
|
84
85
|
pushActions: import("./index.type").TableEntityPushAction[];
|
|
85
86
|
rowDraggable: boolean;
|
|
86
87
|
rowDragHandle: string;
|
|
87
|
-
rowDragDisabled: (row:
|
|
88
|
+
rowDragDisabled: (row: import("./index.type").TableEntityRecord) => boolean;
|
|
88
89
|
resizable: boolean;
|
|
89
90
|
minColumnWidth: number;
|
|
90
91
|
showColumnSettings: boolean;
|
|
@@ -5,6 +5,8 @@ export type EntityFetchParams = {
|
|
|
5
5
|
page: number;
|
|
6
6
|
per_page: number;
|
|
7
7
|
params?: Record<string, any>;
|
|
8
|
+
/** AsyncSelect 回显已选项时传入,接口应按 valueKey 对应字段过滤。 */
|
|
9
|
+
selectedValues?: Array<number | string>;
|
|
8
10
|
};
|
|
9
11
|
export type EntityFetchResult = {
|
|
10
12
|
items: Record<string, any>[];
|
|
@@ -27,7 +29,5 @@ export type EntityDefinition = {
|
|
|
27
29
|
export declare function registerEntity(definition: EntityDefinition): void;
|
|
28
30
|
export declare function getEntity(key: string): EntityDefinition | undefined;
|
|
29
31
|
/** ****************************** 工具 ********************************/
|
|
30
|
-
/**
|
|
31
|
-
* 全量接口转分页结果:接口一次性返回全部数据时,在前端完成关键词过滤与分页。
|
|
32
|
-
*/
|
|
32
|
+
/** @deprecated 远程实体应由接口按 page/per_page 分页;仅保留给纯本地数据。 */
|
|
33
33
|
export declare function paginateLocally(rows: Record<string, any>[], { keyword, page, per_page }: EntityFetchParams, searchKeys: string[]): EntityFetchResult;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as AsyncSelect } from './components/async-select/async-select.vue';
|
|
2
|
+
export type * from './components/async-select/async-select.type.js';
|
|
2
3
|
export { default as BaseCard } from './components/card/index.vue';
|
|
3
4
|
export { CrudPage } from './components/crud-page/index.js';
|
|
4
5
|
export type * from './components/crud-page/index.type.js';
|
|
@@ -13,7 +14,9 @@ export { default as ImportDialog } from './components/import-dialog/index';
|
|
|
13
14
|
export type * from './components/import-dialog/index.type.js';
|
|
14
15
|
export { default as PictureUpload } from './components/picture-upload/picture-upload.vue';
|
|
15
16
|
export { default as RichTextEditor } from './components/rich-text-editor/index.vue';
|
|
17
|
+
export type * from './components/rich-text-editor/index.type.js';
|
|
16
18
|
export { registerSchemaFormComponents, SchemaForm } from './components/schema-form/index.js';
|
|
19
|
+
export type { SchemaFormComponent, SchemaFormComponentConfig, SchemaFormComponentRegistration, } from './components/schema-form/index.js';
|
|
17
20
|
export type * from './components/schema-form/schema-form.type.js';
|
|
18
21
|
export { SearchForm } from './components/search-form/index.js';
|
|
19
22
|
export type * from './components/search-form/index.type.js';
|
|
@@ -22,4 +25,4 @@ export { default as TableEntity } from './components/table-entity/index.vue';
|
|
|
22
25
|
export { getEntity, paginateLocally, registerEntity } from './entities/index';
|
|
23
26
|
export type { EntityDefinition, EntityFetchParams, EntityFetchResult, } from './entities/index';
|
|
24
27
|
export { setupDisguise } from './setup';
|
|
25
|
-
export type { DisguiseOptions } from './setup';
|
|
28
|
+
export type { DisguiseOptions, DisguiseOptions as SetupDisguiseOptions, } from './setup';
|