@a2simcode/ui 0.0.264 → 0.0.265
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/table/index.d.ts +30 -0
- package/dist/components/table/src/interface.d.ts +42 -0
- package/dist/components/table/src/table.vue.d.ts +25 -1
- package/dist/simcode-ui.es.js +2123 -2110
- package/dist/simcode-ui.umd.js +2 -2
- package/dist/stats.html +1 -1
- package/dist/ui.css +1 -1
- package/docs/components/meta/table.ts +6 -0
- package/docs/components/table.md +30 -0
- package/docs/examples/table/custom-merge-cell.vue +206 -0
- package/docs/examples/table/merge-cell.vue +78 -0
- package/docs/examples/table/row-fixed.vue +7 -1
- package/package.json +4 -4
|
@@ -4,6 +4,10 @@ declare const JTable: {
|
|
|
4
4
|
type: StringConstructor;
|
|
5
5
|
default: string;
|
|
6
6
|
};
|
|
7
|
+
label: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
7
11
|
modelValue: {
|
|
8
12
|
type: import('vue').PropType<Record<string, any>[]>;
|
|
9
13
|
default: () => never[];
|
|
@@ -152,6 +156,10 @@ declare const JTable: {
|
|
|
152
156
|
type: import('vue').PropType<(record: Record<string, any>) => Promise<any[]>>;
|
|
153
157
|
default: null;
|
|
154
158
|
};
|
|
159
|
+
customMergeCell: {
|
|
160
|
+
type: import('vue').PropType<import('.').CustomMergeCellOption>;
|
|
161
|
+
default: null;
|
|
162
|
+
};
|
|
155
163
|
}>> & Readonly<{
|
|
156
164
|
"onUpdate:modelValue"?: ((value: Record<string, any>[]) => any) | undefined;
|
|
157
165
|
onChange?: ((data: {
|
|
@@ -210,6 +218,7 @@ declare const JTable: {
|
|
|
210
218
|
page: number;
|
|
211
219
|
}) => any;
|
|
212
220
|
}, import('vue').PublicProps, {
|
|
221
|
+
label: string;
|
|
213
222
|
id: string;
|
|
214
223
|
modelValue: Record<string, any>[];
|
|
215
224
|
rowNum: number;
|
|
@@ -255,6 +264,7 @@ declare const JTable: {
|
|
|
255
264
|
isSubShowNumber: boolean;
|
|
256
265
|
subActions: import('..').ButtonCompType[];
|
|
257
266
|
loadChildren: (record: Record<string, any>) => Promise<any[]>;
|
|
267
|
+
customMergeCell: import('.').CustomMergeCellOption;
|
|
258
268
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
259
269
|
tableContainer: HTMLDivElement;
|
|
260
270
|
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
@@ -269,6 +279,10 @@ declare const JTable: {
|
|
|
269
279
|
type: StringConstructor;
|
|
270
280
|
default: string;
|
|
271
281
|
};
|
|
282
|
+
label: {
|
|
283
|
+
type: StringConstructor;
|
|
284
|
+
default: string;
|
|
285
|
+
};
|
|
272
286
|
modelValue: {
|
|
273
287
|
type: import('vue').PropType<Record<string, any>[]>;
|
|
274
288
|
default: () => never[];
|
|
@@ -417,6 +431,10 @@ declare const JTable: {
|
|
|
417
431
|
type: import('vue').PropType<(record: Record<string, any>) => Promise<any[]>>;
|
|
418
432
|
default: null;
|
|
419
433
|
};
|
|
434
|
+
customMergeCell: {
|
|
435
|
+
type: import('vue').PropType<import('.').CustomMergeCellOption>;
|
|
436
|
+
default: null;
|
|
437
|
+
};
|
|
420
438
|
}>> & Readonly<{
|
|
421
439
|
"onUpdate:modelValue"?: ((value: Record<string, any>[]) => any) | undefined;
|
|
422
440
|
onChange?: ((data: {
|
|
@@ -450,6 +468,7 @@ declare const JTable: {
|
|
|
450
468
|
setSelection: (records: any[]) => void;
|
|
451
469
|
renderTable: () => void;
|
|
452
470
|
}, {}, {}, {}, {
|
|
471
|
+
label: string;
|
|
453
472
|
id: string;
|
|
454
473
|
modelValue: Record<string, any>[];
|
|
455
474
|
rowNum: number;
|
|
@@ -495,6 +514,7 @@ declare const JTable: {
|
|
|
495
514
|
isSubShowNumber: boolean;
|
|
496
515
|
subActions: import('..').ButtonCompType[];
|
|
497
516
|
loadChildren: (record: Record<string, any>) => Promise<any[]>;
|
|
517
|
+
customMergeCell: import('.').CustomMergeCellOption;
|
|
498
518
|
}>;
|
|
499
519
|
__isFragment?: never;
|
|
500
520
|
__isTeleport?: never;
|
|
@@ -504,6 +524,10 @@ declare const JTable: {
|
|
|
504
524
|
type: StringConstructor;
|
|
505
525
|
default: string;
|
|
506
526
|
};
|
|
527
|
+
label: {
|
|
528
|
+
type: StringConstructor;
|
|
529
|
+
default: string;
|
|
530
|
+
};
|
|
507
531
|
modelValue: {
|
|
508
532
|
type: import('vue').PropType<Record<string, any>[]>;
|
|
509
533
|
default: () => never[];
|
|
@@ -652,6 +676,10 @@ declare const JTable: {
|
|
|
652
676
|
type: import('vue').PropType<(record: Record<string, any>) => Promise<any[]>>;
|
|
653
677
|
default: null;
|
|
654
678
|
};
|
|
679
|
+
customMergeCell: {
|
|
680
|
+
type: import('vue').PropType<import('.').CustomMergeCellOption>;
|
|
681
|
+
default: null;
|
|
682
|
+
};
|
|
655
683
|
}>> & Readonly<{
|
|
656
684
|
"onUpdate:modelValue"?: ((value: Record<string, any>[]) => any) | undefined;
|
|
657
685
|
onChange?: ((data: {
|
|
@@ -710,6 +738,7 @@ declare const JTable: {
|
|
|
710
738
|
page: number;
|
|
711
739
|
}) => any;
|
|
712
740
|
}, string, {
|
|
741
|
+
label: string;
|
|
713
742
|
id: string;
|
|
714
743
|
modelValue: Record<string, any>[];
|
|
715
744
|
rowNum: number;
|
|
@@ -755,6 +784,7 @@ declare const JTable: {
|
|
|
755
784
|
isSubShowNumber: boolean;
|
|
756
785
|
subActions: import('..').ButtonCompType[];
|
|
757
786
|
loadChildren: (record: Record<string, any>) => Promise<any[]>;
|
|
787
|
+
customMergeCell: import('.').CustomMergeCellOption;
|
|
758
788
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
|
|
759
789
|
install: (app: import('vue').App) => void;
|
|
760
790
|
};
|
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
import { BaseSchemaConfig, BaseCompConfig } from '../../comp/src/interface';
|
|
2
|
+
/**
|
|
3
|
+
* @zh 合并单元格配置类型
|
|
4
|
+
*/
|
|
5
|
+
export type MergeCellOption = boolean | ((v1: unknown, v2: unknown, info: {
|
|
6
|
+
source: {
|
|
7
|
+
col: number;
|
|
8
|
+
row: number;
|
|
9
|
+
};
|
|
10
|
+
target: {
|
|
11
|
+
col: number;
|
|
12
|
+
row: number;
|
|
13
|
+
};
|
|
14
|
+
table: any;
|
|
15
|
+
}) => boolean);
|
|
16
|
+
/**
|
|
17
|
+
* @zh 自定义合并单元格规则
|
|
18
|
+
*/
|
|
19
|
+
export interface CustomMergeCellRule {
|
|
20
|
+
/** 合并单元格内的文字 */
|
|
21
|
+
text?: string;
|
|
22
|
+
/** 合并的范围 */
|
|
23
|
+
range: {
|
|
24
|
+
start: {
|
|
25
|
+
col: number;
|
|
26
|
+
row: number;
|
|
27
|
+
};
|
|
28
|
+
end: {
|
|
29
|
+
col: number;
|
|
30
|
+
row: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
/** 合并单元格的样式 */
|
|
34
|
+
style?: Record<string, any>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @zh 自定义合并单元格配置类型
|
|
38
|
+
*/
|
|
39
|
+
export type CustomMergeCellOption = CustomMergeCellRule[] | ((col: number, row: number, table: any) => CustomMergeCellRule | undefined);
|
|
2
40
|
export interface TableColumnConfig {
|
|
3
41
|
/**
|
|
4
42
|
* @zh 列的宽度
|
|
@@ -52,6 +90,10 @@ export interface TableColumnConfig {
|
|
|
52
90
|
* @zh 冻结列 left 左侧冻结 right 右侧冻结
|
|
53
91
|
*/
|
|
54
92
|
frozen?: 'left' | 'right';
|
|
93
|
+
/**
|
|
94
|
+
* @zh 合并单元格配置,为 true 时自动合并相邻相同值的单元格,也可传入自定义合并函数
|
|
95
|
+
*/
|
|
96
|
+
mergeCell?: MergeCellOption;
|
|
55
97
|
}
|
|
56
98
|
export type TableColumnCompConfig = TableColumnConfig & BaseCompConfig;
|
|
57
99
|
export interface TableColumnFilter {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnSchemaConfig } from './interface';
|
|
1
|
+
import { ColumnSchemaConfig, CustomMergeCellOption } from './interface';
|
|
2
2
|
import { ButtonCompType } from '../../buttons/src/interface';
|
|
3
3
|
import { EditConfigType } from '../../input-rows/src/interface';
|
|
4
4
|
import { PropType } from 'vue';
|
|
@@ -7,6 +7,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
7
7
|
type: StringConstructor;
|
|
8
8
|
default: string;
|
|
9
9
|
};
|
|
10
|
+
label: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
10
14
|
/**
|
|
11
15
|
* @zh 输入值【作为表单的编辑表格使用】
|
|
12
16
|
* @vModel
|
|
@@ -261,6 +265,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
261
265
|
type: PropType<(record: Record<string, any>) => Promise<any[]>>;
|
|
262
266
|
default: null;
|
|
263
267
|
};
|
|
268
|
+
/**
|
|
269
|
+
* @zh 自定义合并单元格配置,支持回调函数或合并规则数组
|
|
270
|
+
*/
|
|
271
|
+
customMergeCell: {
|
|
272
|
+
type: PropType<CustomMergeCellOption>;
|
|
273
|
+
default: null;
|
|
274
|
+
};
|
|
264
275
|
}>, {
|
|
265
276
|
getInstance: () => any;
|
|
266
277
|
setRecords: (records: Record<string, any>[]) => void;
|
|
@@ -298,6 +309,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
298
309
|
type: StringConstructor;
|
|
299
310
|
default: string;
|
|
300
311
|
};
|
|
312
|
+
label: {
|
|
313
|
+
type: StringConstructor;
|
|
314
|
+
default: string;
|
|
315
|
+
};
|
|
301
316
|
/**
|
|
302
317
|
* @zh 输入值【作为表单的编辑表格使用】
|
|
303
318
|
* @vModel
|
|
@@ -552,6 +567,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
552
567
|
type: PropType<(record: Record<string, any>) => Promise<any[]>>;
|
|
553
568
|
default: null;
|
|
554
569
|
};
|
|
570
|
+
/**
|
|
571
|
+
* @zh 自定义合并单元格配置,支持回调函数或合并规则数组
|
|
572
|
+
*/
|
|
573
|
+
customMergeCell: {
|
|
574
|
+
type: PropType<CustomMergeCellOption>;
|
|
575
|
+
default: null;
|
|
576
|
+
};
|
|
555
577
|
}>> & Readonly<{
|
|
556
578
|
"onUpdate:modelValue"?: ((value: Record<string, any>[]) => any) | undefined;
|
|
557
579
|
onChange?: ((data: {
|
|
@@ -578,6 +600,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
578
600
|
page: number;
|
|
579
601
|
}) => any) | undefined;
|
|
580
602
|
}>, {
|
|
603
|
+
label: string;
|
|
581
604
|
id: string;
|
|
582
605
|
modelValue: Record<string, any>[];
|
|
583
606
|
rowNum: number;
|
|
@@ -623,6 +646,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
623
646
|
isSubShowNumber: boolean;
|
|
624
647
|
subActions: ButtonCompType[];
|
|
625
648
|
loadChildren: (record: Record<string, any>) => Promise<any[]>;
|
|
649
|
+
customMergeCell: CustomMergeCellOption;
|
|
626
650
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
627
651
|
tableContainer: HTMLDivElement;
|
|
628
652
|
}, HTMLDivElement>;
|