cc1-form 1.3.7 → 1.3.9

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.
@@ -1,6 +1,6 @@
1
1
  import type { CurdConfigColumn } from '../indexType';
2
2
  import type { CurdConfGetter, CurdProps, CurdRefs } from './types';
3
- export declare const createTableModule: (getConf: CurdConfGetter, props: CurdProps, refs: CurdRefs) => {
3
+ export declare const createTableModule: (_getConf: CurdConfGetter, props: CurdProps, refs: CurdRefs) => {
4
4
  table: {
5
5
  op: {
6
6
  width: (...bool: any[]) => number;
@@ -20,13 +20,123 @@ export declare const createTableModule: (getConf: CurdConfGetter, props: CurdPro
20
20
  list: any[];
21
21
  };
22
22
  };
23
+ sortable: {
24
+ mode: boolean;
25
+ actionLoading: boolean;
26
+ instance: {
27
+ destroy: () => void;
28
+ } | undefined;
29
+ modulePromise: Promise<any> | undefined;
30
+ getOption: () => Partial<{
31
+ [key: string]: any;
32
+ show: boolean;
33
+ button: boolean;
34
+ saveButton: boolean;
35
+ tipText: string;
36
+ width: any;
37
+ label: string;
38
+ fixed: "left" | "right";
39
+ page: boolean;
40
+ scroll: boolean;
41
+ field: string;
42
+ onEnd: (data: any[]) => any;
43
+ rule: "index" | "value";
44
+ api: Partial<{
45
+ list: (param?: any, type?: "sortable") => any;
46
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
47
+ }>;
48
+ }>;
49
+ showTriggerButton: () => boolean | undefined;
50
+ showActionButton: () => boolean | undefined;
51
+ showSaveButton: () => boolean | undefined;
52
+ isActive: () => boolean;
53
+ showPagination: () => boolean | undefined;
54
+ disableScroll: () => boolean;
55
+ getTableBindOption: () => {
56
+ height?: undefined;
57
+ maxHeight?: undefined;
58
+ editMode?: boolean | undefined;
59
+ rowKey?: string | undefined;
60
+ border?: boolean | undefined;
61
+ index?: boolean | Partial<{
62
+ [key: string]: any;
63
+ show: boolean | ((data: any) => boolean);
64
+ on: any;
65
+ }> | ((data: any) => boolean) | undefined;
66
+ sortable?: Partial<{
67
+ [key: string]: any;
68
+ show: boolean;
69
+ button: boolean;
70
+ saveButton: boolean;
71
+ tipText: string;
72
+ width: any;
73
+ label: string;
74
+ fixed: "left" | "right";
75
+ page: boolean;
76
+ scroll: boolean;
77
+ field: string;
78
+ onEnd: (data: any[]) => any;
79
+ rule: "index" | "value";
80
+ api: Partial<{
81
+ list: (param?: any, type?: "sortable") => any;
82
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
83
+ }>;
84
+ }> | undefined;
85
+ selectable?: boolean | Partial<{
86
+ [key: string]: any;
87
+ show: boolean | ((data: any) => boolean);
88
+ on: any;
89
+ }> | ((data: any) => boolean) | undefined;
90
+ column?: CurdConfigColumn<any>[] | undefined;
91
+ showOverflowTooltip?: boolean | undefined;
92
+ showSummary?: boolean | undefined;
93
+ summaryMethod?: ((data: {
94
+ columns: any[];
95
+ data: any[];
96
+ }) => any[]) | undefined;
97
+ inlineEdit?: boolean | undefined;
98
+ operate?: {
99
+ [key: string]: any;
100
+ width?: any;
101
+ } | undefined;
102
+ add?: boolean | ((data: any) => boolean) | undefined;
103
+ update?: boolean | ((data: any) => boolean) | undefined;
104
+ delete?: boolean | ((data: any) => boolean) | undefined;
105
+ view?: boolean | ((data: any) => boolean) | undefined;
106
+ on?: Record<string, any> | undefined;
107
+ fitHeight?: boolean | undefined;
108
+ };
109
+ getColumnBind: () => {
110
+ [x: string]: any;
111
+ };
112
+ destroy: () => void;
113
+ getBody: () => HTMLElement | null;
114
+ loadModule: () => Promise<any>;
115
+ applyRule: (data: any[], field: string, rule: "index" | "value", values: any[]) => void;
116
+ sync: () => Promise<void>;
117
+ refreshList: () => Promise<void>;
118
+ /** 临时保存fitHeight,用于排序时临时关闭 */
119
+ fitHeight: boolean;
120
+ start: () => Promise<void>;
121
+ exit: () => Promise<void>;
122
+ save: () => Promise<void>;
123
+ command: (command: "save" | "exit") => Promise<void>;
124
+ };
23
125
  header: {
24
126
  group: {
25
127
  expand: boolean;
26
128
  toggleExpandAll: () => void;
27
129
  };
28
130
  };
29
- getList: () => Promise<void>;
131
+ parseListResult: (res: any) => Promise<{
132
+ data: any;
133
+ total: any;
134
+ }>;
135
+ applyListResult: (res: any, total?: number) => Promise<{
136
+ data: any;
137
+ total: any;
138
+ }>;
139
+ getList: (type?: "sortable") => Promise<void>;
30
140
  selection: {
31
141
  list: any[];
32
142
  change: (selection: any[]) => void;
@@ -1362,13 +1362,127 @@ export declare const curdConf: (props: CurdProps) => {
1362
1362
  list: any[];
1363
1363
  };
1364
1364
  };
1365
+ sortable: {
1366
+ mode: boolean;
1367
+ actionLoading: boolean;
1368
+ instance: {
1369
+ destroy: () => void;
1370
+ } | undefined;
1371
+ modulePromise: {
1372
+ then: <TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>;
1373
+ catch: <TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined) => Promise<any>;
1374
+ finally: (onfinally?: (() => void) | null | undefined) => Promise<any>;
1375
+ readonly [Symbol.toStringTag]: string;
1376
+ } | undefined;
1377
+ getOption: () => Partial<{
1378
+ [key: string]: any;
1379
+ show: boolean;
1380
+ button: boolean;
1381
+ saveButton: boolean;
1382
+ tipText: string;
1383
+ width: any;
1384
+ label: string;
1385
+ fixed: "left" | "right";
1386
+ page: boolean;
1387
+ scroll: boolean;
1388
+ field: string;
1389
+ onEnd: (data: any[]) => any;
1390
+ rule: "index" | "value";
1391
+ api: Partial<{
1392
+ list: (param?: any, type?: "sortable") => any;
1393
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
1394
+ }>;
1395
+ }>;
1396
+ showTriggerButton: () => boolean | undefined;
1397
+ showActionButton: () => boolean | undefined;
1398
+ showSaveButton: () => boolean | undefined;
1399
+ isActive: () => boolean;
1400
+ showPagination: () => boolean | undefined;
1401
+ disableScroll: () => boolean;
1402
+ getTableBindOption: () => {
1403
+ height?: undefined;
1404
+ maxHeight?: undefined;
1405
+ editMode?: boolean | undefined;
1406
+ rowKey?: string | undefined;
1407
+ border?: boolean | undefined;
1408
+ index?: boolean | Partial<{
1409
+ [key: string]: any;
1410
+ show: boolean | ((data: any) => boolean);
1411
+ on: any;
1412
+ }> | ((data: any) => boolean) | undefined;
1413
+ sortable?: Partial<{
1414
+ [key: string]: any;
1415
+ show: boolean;
1416
+ button: boolean;
1417
+ saveButton: boolean;
1418
+ tipText: string;
1419
+ width: any;
1420
+ label: string;
1421
+ fixed: "left" | "right";
1422
+ page: boolean;
1423
+ scroll: boolean;
1424
+ field: string;
1425
+ onEnd: (data: any[]) => any;
1426
+ rule: "index" | "value";
1427
+ api: Partial<{
1428
+ list: (param?: any, type?: "sortable") => any;
1429
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
1430
+ }>;
1431
+ }> | undefined;
1432
+ selectable?: boolean | Partial<{
1433
+ [key: string]: any;
1434
+ show: boolean | ((data: any) => boolean);
1435
+ on: any;
1436
+ }> | ((data: any) => boolean) | undefined;
1437
+ column?: import("./indexType").CurdConfigColumn<any>[] | undefined;
1438
+ showOverflowTooltip?: boolean | undefined;
1439
+ showSummary?: boolean | undefined;
1440
+ summaryMethod?: ((data: {
1441
+ columns: any[];
1442
+ data: any[];
1443
+ }) => any[]) | undefined;
1444
+ inlineEdit?: boolean | undefined;
1445
+ operate?: {
1446
+ [key: string]: any;
1447
+ width?: any;
1448
+ } | undefined;
1449
+ add?: boolean | ((data: any) => boolean) | undefined;
1450
+ update?: boolean | ((data: any) => boolean) | undefined;
1451
+ delete?: boolean | ((data: any) => boolean) | undefined;
1452
+ view?: boolean | ((data: any) => boolean) | undefined;
1453
+ on?: Record<string, any> | undefined;
1454
+ fitHeight?: boolean | undefined;
1455
+ };
1456
+ getColumnBind: () => {
1457
+ [x: string]: any;
1458
+ };
1459
+ destroy: () => void;
1460
+ getBody: () => HTMLElement | null;
1461
+ loadModule: () => Promise<any>;
1462
+ applyRule: (data: any[], field: string, rule: "index" | "value", values: any[]) => void;
1463
+ sync: () => Promise<void>;
1464
+ refreshList: () => Promise<void>;
1465
+ fitHeight: boolean;
1466
+ start: () => Promise<void>;
1467
+ exit: () => Promise<void>;
1468
+ save: () => Promise<void>;
1469
+ command: (command: "save" | "exit") => Promise<void>;
1470
+ };
1365
1471
  header: {
1366
1472
  group: {
1367
1473
  expand: boolean;
1368
1474
  toggleExpandAll: () => void;
1369
1475
  };
1370
1476
  };
1371
- getList: () => Promise<void>;
1477
+ parseListResult: (res: any) => Promise<{
1478
+ data: any;
1479
+ total: any;
1480
+ }>;
1481
+ applyListResult: (res: any, total?: number) => Promise<{
1482
+ data: any;
1483
+ total: any;
1484
+ }>;
1485
+ getList: (type?: "sortable") => Promise<void>;
1372
1486
  selection: {
1373
1487
  list: any[];
1374
1488
  change: (selection: any[]) => void;
@@ -1874,6 +1988,25 @@ export declare const curdConf: (props: CurdProps) => {
1874
1988
  show?: boolean | ((data: any) => boolean) | undefined;
1875
1989
  on?: any;
1876
1990
  } | undefined;
1991
+ sortable?: {
1992
+ [x: string]: any;
1993
+ show?: boolean | undefined;
1994
+ button?: boolean | undefined;
1995
+ saveButton?: boolean | undefined;
1996
+ tipText?: string | undefined;
1997
+ width?: any;
1998
+ label?: string | undefined;
1999
+ fixed?: "left" | "right" | undefined;
2000
+ page?: boolean | undefined;
2001
+ scroll?: boolean | undefined;
2002
+ field?: string | undefined;
2003
+ onEnd?: ((data: any[]) => any) | undefined;
2004
+ rule?: "index" | "value" | undefined;
2005
+ api?: {
2006
+ list?: ((param?: any, type?: "sortable") => any) | undefined;
2007
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
2008
+ } | undefined;
2009
+ } | undefined;
1877
2010
  selectable?: boolean | ((data: any) => boolean) | {
1878
2011
  [x: string]: any;
1879
2012
  show?: boolean | ((data: any) => boolean) | undefined;
@@ -2779,9 +2912,9 @@ export declare const curdConf: (props: CurdProps) => {
2779
2912
  } | undefined;
2780
2913
  }[];
2781
2914
  api: {
2782
- list: (param?: any) => any;
2915
+ list: (param?: any, type?: "sortable") => any;
2783
2916
  create?: ((param?: any) => any) | undefined;
2784
- update?: ((param?: any, type?: "switch") => any) | undefined;
2917
+ update?: ((param?: any, type?: "switch" | "sortable") => any) | undefined;
2785
2918
  delete?: ((param?: ({
2786
2919
  items: any[];
2787
2920
  } & Record<string, any>) | undefined) => any) | undefined;