@dt-frames/ui 1.0.28 → 1.0.30
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/es/components/curd/src/components/dialog.d.ts +15 -0
- package/es/components/curd/src/types/curd.type.d.ts +1 -0
- package/es/components/forms/src/components/formIcon.d.ts +15 -0
- package/es/components/modal/src/components/modal.d.ts +6 -0
- package/es/components/modal/src/index.d.ts +15 -0
- package/es/components/modal/src/props.d.ts +3 -0
- package/es/components/table/index.d.ts +2 -1
- package/es/components/table/src/components/editable/EditTableCell.d.ts +0 -6
- package/es/components/table/src/components/editable/index.d.ts +1 -1
- package/es/components/table/src/components/setting/Download.d.ts +15 -0
- package/es/components/table/src/components/setting/DownloadCtrl.d.ts +15 -0
- package/es/components/table/src/index.d.ts +10 -0
- package/es/components/table/src/props.d.ts +4 -0
- package/es/components/table/src/types/table.type.d.ts +1 -0
- package/es/components/upload/src/upload.d.ts +10 -0
- package/es/index.js +284 -277
- package/package.json +2 -2
|
@@ -289,6 +289,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
289
289
|
};
|
|
290
290
|
closeFunc: FunctionConstructor;
|
|
291
291
|
} & {
|
|
292
|
+
t: {
|
|
293
|
+
type: StringConstructor;
|
|
294
|
+
};
|
|
292
295
|
defaultFullscreen: {
|
|
293
296
|
type: BooleanConstructor;
|
|
294
297
|
};
|
|
@@ -381,6 +384,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
381
384
|
};
|
|
382
385
|
closeFunc: FunctionConstructor;
|
|
383
386
|
} & {
|
|
387
|
+
t: {
|
|
388
|
+
type: StringConstructor;
|
|
389
|
+
};
|
|
384
390
|
defaultFullscreen: {
|
|
385
391
|
type: BooleanConstructor;
|
|
386
392
|
};
|
|
@@ -491,6 +497,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
491
497
|
};
|
|
492
498
|
closeFunc: FunctionConstructor;
|
|
493
499
|
} & {
|
|
500
|
+
t: {
|
|
501
|
+
type: StringConstructor;
|
|
502
|
+
};
|
|
494
503
|
defaultFullscreen: {
|
|
495
504
|
type: BooleanConstructor;
|
|
496
505
|
};
|
|
@@ -578,6 +587,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
578
587
|
};
|
|
579
588
|
closeFunc: FunctionConstructor;
|
|
580
589
|
} & {
|
|
590
|
+
t: {
|
|
591
|
+
type: StringConstructor;
|
|
592
|
+
};
|
|
581
593
|
defaultFullscreen: {
|
|
582
594
|
type: BooleanConstructor;
|
|
583
595
|
};
|
|
@@ -1325,6 +1337,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1325
1337
|
};
|
|
1326
1338
|
closeFunc: FunctionConstructor;
|
|
1327
1339
|
} & {
|
|
1340
|
+
t: {
|
|
1341
|
+
type: StringConstructor;
|
|
1342
|
+
};
|
|
1328
1343
|
defaultFullscreen: {
|
|
1329
1344
|
type: BooleanConstructor;
|
|
1330
1345
|
};
|
|
@@ -2,6 +2,7 @@ import { Recordable, ButtonProps } from "@dt-frames/core";
|
|
|
2
2
|
import { ComputedRef, VNodeChild } from "vue";
|
|
3
3
|
import { FormSchema, FormProps } from "../../../forms/src/types/form.type";
|
|
4
4
|
export declare type CrudOptType = {
|
|
5
|
+
t?: string;
|
|
5
6
|
title?: string | ComputedRef;
|
|
6
7
|
width?: string | number;
|
|
7
8
|
schemas: FormSchema[];
|
|
@@ -1675,6 +1675,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1675
1675
|
};
|
|
1676
1676
|
closeFunc: FunctionConstructor;
|
|
1677
1677
|
} & {
|
|
1678
|
+
t: {
|
|
1679
|
+
type: StringConstructor;
|
|
1680
|
+
};
|
|
1678
1681
|
defaultFullscreen: {
|
|
1679
1682
|
type: BooleanConstructor;
|
|
1680
1683
|
};
|
|
@@ -1767,6 +1770,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1767
1770
|
};
|
|
1768
1771
|
closeFunc: FunctionConstructor;
|
|
1769
1772
|
} & {
|
|
1773
|
+
t: {
|
|
1774
|
+
type: StringConstructor;
|
|
1775
|
+
};
|
|
1770
1776
|
defaultFullscreen: {
|
|
1771
1777
|
type: BooleanConstructor;
|
|
1772
1778
|
};
|
|
@@ -1877,6 +1883,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1877
1883
|
};
|
|
1878
1884
|
closeFunc: FunctionConstructor;
|
|
1879
1885
|
} & {
|
|
1886
|
+
t: {
|
|
1887
|
+
type: StringConstructor;
|
|
1888
|
+
};
|
|
1880
1889
|
defaultFullscreen: {
|
|
1881
1890
|
type: BooleanConstructor;
|
|
1882
1891
|
};
|
|
@@ -1964,6 +1973,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1964
1973
|
};
|
|
1965
1974
|
closeFunc: FunctionConstructor;
|
|
1966
1975
|
} & {
|
|
1976
|
+
t: {
|
|
1977
|
+
type: StringConstructor;
|
|
1978
|
+
};
|
|
1967
1979
|
defaultFullscreen: {
|
|
1968
1980
|
type: BooleanConstructor;
|
|
1969
1981
|
};
|
|
@@ -2711,6 +2723,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
2711
2723
|
};
|
|
2712
2724
|
closeFunc: FunctionConstructor;
|
|
2713
2725
|
} & {
|
|
2726
|
+
t: {
|
|
2727
|
+
type: StringConstructor;
|
|
2728
|
+
};
|
|
2714
2729
|
defaultFullscreen: {
|
|
2715
2730
|
type: BooleanConstructor;
|
|
2716
2731
|
};
|
|
@@ -18,6 +18,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
18
18
|
};
|
|
19
19
|
closeFunc: FunctionConstructor;
|
|
20
20
|
} & {
|
|
21
|
+
t: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
};
|
|
21
24
|
defaultFullscreen: {
|
|
22
25
|
type: BooleanConstructor;
|
|
23
26
|
};
|
|
@@ -105,6 +108,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
108
|
};
|
|
106
109
|
closeFunc: FunctionConstructor;
|
|
107
110
|
} & {
|
|
111
|
+
t: {
|
|
112
|
+
type: StringConstructor;
|
|
113
|
+
};
|
|
108
114
|
defaultFullscreen: {
|
|
109
115
|
type: BooleanConstructor;
|
|
110
116
|
};
|
|
@@ -20,6 +20,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
20
20
|
};
|
|
21
21
|
closeFunc: FunctionConstructor;
|
|
22
22
|
} & {
|
|
23
|
+
t: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
};
|
|
23
26
|
defaultFullscreen: {
|
|
24
27
|
type: BooleanConstructor;
|
|
25
28
|
};
|
|
@@ -112,6 +115,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
112
115
|
};
|
|
113
116
|
closeFunc: FunctionConstructor;
|
|
114
117
|
} & {
|
|
118
|
+
t: {
|
|
119
|
+
type: StringConstructor;
|
|
120
|
+
};
|
|
115
121
|
defaultFullscreen: {
|
|
116
122
|
type: BooleanConstructor;
|
|
117
123
|
};
|
|
@@ -222,6 +228,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
222
228
|
};
|
|
223
229
|
closeFunc: FunctionConstructor;
|
|
224
230
|
} & {
|
|
231
|
+
t: {
|
|
232
|
+
type: StringConstructor;
|
|
233
|
+
};
|
|
225
234
|
defaultFullscreen: {
|
|
226
235
|
type: BooleanConstructor;
|
|
227
236
|
};
|
|
@@ -309,6 +318,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
309
318
|
};
|
|
310
319
|
closeFunc: FunctionConstructor;
|
|
311
320
|
} & {
|
|
321
|
+
t: {
|
|
322
|
+
type: StringConstructor;
|
|
323
|
+
};
|
|
312
324
|
defaultFullscreen: {
|
|
313
325
|
type: BooleanConstructor;
|
|
314
326
|
};
|
|
@@ -1056,6 +1068,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1056
1068
|
};
|
|
1057
1069
|
closeFunc: FunctionConstructor;
|
|
1058
1070
|
} & {
|
|
1071
|
+
t: {
|
|
1072
|
+
type: StringConstructor;
|
|
1073
|
+
};
|
|
1059
1074
|
defaultFullscreen: {
|
|
1060
1075
|
type: BooleanConstructor;
|
|
1061
1076
|
};
|
|
@@ -19,13 +19,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
19
19
|
editValueRefs: Recordable<import("vue").Ref<any>>;
|
|
20
20
|
} & Recordable<any>>>;
|
|
21
21
|
};
|
|
22
|
-
row: ObjectConstructor;
|
|
23
22
|
column: {
|
|
24
23
|
type: PropType<BasicColumn>;
|
|
25
24
|
default: () => BasicColumn;
|
|
26
25
|
};
|
|
27
26
|
index: NumberConstructor;
|
|
28
|
-
dataSource: PropType<Recordable<any>[]>;
|
|
29
27
|
}, {
|
|
30
28
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
31
29
|
value: {
|
|
@@ -45,13 +43,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
45
43
|
editValueRefs: Recordable<import("vue").Ref<any>>;
|
|
46
44
|
} & Recordable<any>>>;
|
|
47
45
|
};
|
|
48
|
-
row: ObjectConstructor;
|
|
49
46
|
column: {
|
|
50
47
|
type: PropType<BasicColumn>;
|
|
51
48
|
default: () => BasicColumn;
|
|
52
49
|
};
|
|
53
50
|
index: NumberConstructor;
|
|
54
|
-
dataSource: PropType<Recordable<any>[]>;
|
|
55
51
|
}>> & {
|
|
56
52
|
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any);
|
|
57
53
|
}>>;
|
|
@@ -80,13 +76,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
80
76
|
editValueRefs: Recordable<import("vue").Ref<any>>;
|
|
81
77
|
} & Recordable<any>>>;
|
|
82
78
|
};
|
|
83
|
-
row: ObjectConstructor;
|
|
84
79
|
column: {
|
|
85
80
|
type: PropType<BasicColumn>;
|
|
86
81
|
default: () => BasicColumn;
|
|
87
82
|
};
|
|
88
83
|
index: NumberConstructor;
|
|
89
|
-
dataSource: PropType<Recordable<any>[]>;
|
|
90
84
|
}>>, {
|
|
91
85
|
value: string;
|
|
92
86
|
column: BasicColumn;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BasicColumn } from "../../types/table.type";
|
|
2
|
-
declare function renderEditCell(column: BasicColumn
|
|
2
|
+
declare function renderEditCell(column: BasicColumn): ({ text: value, record, index }: {
|
|
3
3
|
text: any;
|
|
4
4
|
record: any;
|
|
5
5
|
index: any;
|
|
@@ -1900,6 +1900,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
1900
1900
|
};
|
|
1901
1901
|
closeFunc: FunctionConstructor;
|
|
1902
1902
|
} & {
|
|
1903
|
+
t: {
|
|
1904
|
+
type: StringConstructor;
|
|
1905
|
+
};
|
|
1903
1906
|
defaultFullscreen: {
|
|
1904
1907
|
type: BooleanConstructor;
|
|
1905
1908
|
};
|
|
@@ -1992,6 +1995,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
1992
1995
|
};
|
|
1993
1996
|
closeFunc: FunctionConstructor;
|
|
1994
1997
|
} & {
|
|
1998
|
+
t: {
|
|
1999
|
+
type: StringConstructor;
|
|
2000
|
+
};
|
|
1995
2001
|
defaultFullscreen: {
|
|
1996
2002
|
type: BooleanConstructor;
|
|
1997
2003
|
};
|
|
@@ -2102,6 +2108,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
2102
2108
|
};
|
|
2103
2109
|
closeFunc: FunctionConstructor;
|
|
2104
2110
|
} & {
|
|
2111
|
+
t: {
|
|
2112
|
+
type: StringConstructor;
|
|
2113
|
+
};
|
|
2105
2114
|
defaultFullscreen: {
|
|
2106
2115
|
type: BooleanConstructor;
|
|
2107
2116
|
};
|
|
@@ -2189,6 +2198,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
2189
2198
|
};
|
|
2190
2199
|
closeFunc: FunctionConstructor;
|
|
2191
2200
|
} & {
|
|
2201
|
+
t: {
|
|
2202
|
+
type: StringConstructor;
|
|
2203
|
+
};
|
|
2192
2204
|
defaultFullscreen: {
|
|
2193
2205
|
type: BooleanConstructor;
|
|
2194
2206
|
};
|
|
@@ -2936,6 +2948,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
2936
2948
|
};
|
|
2937
2949
|
closeFunc: FunctionConstructor;
|
|
2938
2950
|
} & {
|
|
2951
|
+
t: {
|
|
2952
|
+
type: StringConstructor;
|
|
2953
|
+
};
|
|
2939
2954
|
defaultFullscreen: {
|
|
2940
2955
|
type: BooleanConstructor;
|
|
2941
2956
|
};
|
|
@@ -751,6 +751,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
751
751
|
};
|
|
752
752
|
closeFunc: FunctionConstructor;
|
|
753
753
|
} & {
|
|
754
|
+
t: {
|
|
755
|
+
type: StringConstructor;
|
|
756
|
+
};
|
|
754
757
|
defaultFullscreen: {
|
|
755
758
|
type: BooleanConstructor;
|
|
756
759
|
};
|
|
@@ -843,6 +846,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
843
846
|
};
|
|
844
847
|
closeFunc: FunctionConstructor;
|
|
845
848
|
} & {
|
|
849
|
+
t: {
|
|
850
|
+
type: StringConstructor;
|
|
851
|
+
};
|
|
846
852
|
defaultFullscreen: {
|
|
847
853
|
type: BooleanConstructor;
|
|
848
854
|
};
|
|
@@ -953,6 +959,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
953
959
|
};
|
|
954
960
|
closeFunc: FunctionConstructor;
|
|
955
961
|
} & {
|
|
962
|
+
t: {
|
|
963
|
+
type: StringConstructor;
|
|
964
|
+
};
|
|
956
965
|
defaultFullscreen: {
|
|
957
966
|
type: BooleanConstructor;
|
|
958
967
|
};
|
|
@@ -1040,6 +1049,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
1040
1049
|
};
|
|
1041
1050
|
closeFunc: FunctionConstructor;
|
|
1042
1051
|
} & {
|
|
1052
|
+
t: {
|
|
1053
|
+
type: StringConstructor;
|
|
1054
|
+
};
|
|
1043
1055
|
defaultFullscreen: {
|
|
1044
1056
|
type: BooleanConstructor;
|
|
1045
1057
|
};
|
|
@@ -1787,6 +1799,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
1787
1799
|
};
|
|
1788
1800
|
closeFunc: FunctionConstructor;
|
|
1789
1801
|
} & {
|
|
1802
|
+
t: {
|
|
1803
|
+
type: StringConstructor;
|
|
1804
|
+
};
|
|
1790
1805
|
defaultFullscreen: {
|
|
1791
1806
|
type: BooleanConstructor;
|
|
1792
1807
|
};
|
|
@@ -81,6 +81,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
81
81
|
type: BooleanConstructor;
|
|
82
82
|
default: boolean;
|
|
83
83
|
};
|
|
84
|
+
canResize: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
84
88
|
pagination: {
|
|
85
89
|
type: import("vue").PropType<boolean | Partial<ExtractPropTypes<{
|
|
86
90
|
total: NumberConstructor;
|
|
@@ -386,6 +390,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
386
390
|
filterFn: (data: Partial<Recordable<string[]>>) => any;
|
|
387
391
|
templates: {};
|
|
388
392
|
ellipsis: boolean;
|
|
393
|
+
canResize: boolean;
|
|
389
394
|
onTableChange: Function;
|
|
390
395
|
showIndexColumn: boolean;
|
|
391
396
|
indexColumnProps: import("./types/table.type").BasicColumn[];
|
|
@@ -538,6 +543,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
538
543
|
type: BooleanConstructor;
|
|
539
544
|
default: boolean;
|
|
540
545
|
};
|
|
546
|
+
canResize: {
|
|
547
|
+
type: BooleanConstructor;
|
|
548
|
+
default: boolean;
|
|
549
|
+
};
|
|
541
550
|
pagination: {
|
|
542
551
|
type: import("vue").PropType<boolean | Partial<ExtractPropTypes<{
|
|
543
552
|
total: NumberConstructor;
|
|
@@ -696,6 +705,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
696
705
|
defSort: any;
|
|
697
706
|
templates: {};
|
|
698
707
|
ellipsis: boolean;
|
|
708
|
+
canResize: boolean;
|
|
699
709
|
onTableChange: Function;
|
|
700
710
|
showIndexColumn: boolean;
|
|
701
711
|
indexColumnProps: import("./types/table.type").BasicColumn[];
|
|
@@ -83,6 +83,10 @@ export declare const TableProps: {
|
|
|
83
83
|
type: BooleanConstructor;
|
|
84
84
|
default: boolean;
|
|
85
85
|
};
|
|
86
|
+
canResize: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: boolean;
|
|
89
|
+
};
|
|
86
90
|
pagination: {
|
|
87
91
|
type: PropType<boolean | Partial<import("vue").ExtractPropTypes<{
|
|
88
92
|
total: NumberConstructor;
|
|
@@ -74,6 +74,7 @@ export declare type LableValOptions = {
|
|
|
74
74
|
[key: string]: string | number | boolean;
|
|
75
75
|
}[];
|
|
76
76
|
export interface BasicColumn extends ColumnProps {
|
|
77
|
+
t?: string;
|
|
77
78
|
children?: BasicColumn[];
|
|
78
79
|
defaultHidden?: boolean;
|
|
79
80
|
ifShow?: boolean | ((row: Recordable) => boolean);
|
|
@@ -1105,6 +1105,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1105
1105
|
type: BooleanConstructor;
|
|
1106
1106
|
default: boolean;
|
|
1107
1107
|
};
|
|
1108
|
+
canResize: {
|
|
1109
|
+
type: BooleanConstructor;
|
|
1110
|
+
default: boolean;
|
|
1111
|
+
};
|
|
1108
1112
|
pagination: {
|
|
1109
1113
|
type: import("vue").PropType<boolean | Partial<import("vue").ExtractPropTypes<{
|
|
1110
1114
|
total: NumberConstructor;
|
|
@@ -1410,6 +1414,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1410
1414
|
filterFn: (data: Partial<import("@dt-frames/core").Recordable<string[]>>) => any;
|
|
1411
1415
|
templates: {};
|
|
1412
1416
|
ellipsis: boolean;
|
|
1417
|
+
canResize: boolean;
|
|
1413
1418
|
onTableChange: Function;
|
|
1414
1419
|
showIndexColumn: boolean;
|
|
1415
1420
|
indexColumnProps: import("../../table/src/types/table.type").BasicColumn[];
|
|
@@ -1562,6 +1567,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1562
1567
|
type: BooleanConstructor;
|
|
1563
1568
|
default: boolean;
|
|
1564
1569
|
};
|
|
1570
|
+
canResize: {
|
|
1571
|
+
type: BooleanConstructor;
|
|
1572
|
+
default: boolean;
|
|
1573
|
+
};
|
|
1565
1574
|
pagination: {
|
|
1566
1575
|
type: import("vue").PropType<boolean | Partial<import("vue").ExtractPropTypes<{
|
|
1567
1576
|
total: NumberConstructor;
|
|
@@ -1720,6 +1729,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1720
1729
|
defSort: any;
|
|
1721
1730
|
templates: {};
|
|
1722
1731
|
ellipsis: boolean;
|
|
1732
|
+
canResize: boolean;
|
|
1723
1733
|
onTableChange: Function;
|
|
1724
1734
|
showIndexColumn: boolean;
|
|
1725
1735
|
indexColumnProps: import("../../table/src/types/table.type").BasicColumn[];
|
package/es/index.js
CHANGED
|
@@ -2141,6 +2141,7 @@ const modalProps = {
|
|
|
2141
2141
|
closeFunc: Function
|
|
2142
2142
|
};
|
|
2143
2143
|
const basicProps$1 = Object.assign({}, modalProps, {
|
|
2144
|
+
t: { type: String },
|
|
2144
2145
|
defaultFullscreen: { type: Boolean },
|
|
2145
2146
|
canFullscreen: { type: Boolean, default: true },
|
|
2146
2147
|
wrapperFooterOffset: { type: Number, default: 0 },
|
|
@@ -4498,6 +4499,248 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
4498
4499
|
};
|
|
4499
4500
|
}
|
|
4500
4501
|
});
|
|
4502
|
+
const componentMap = /* @__PURE__ */ new Map();
|
|
4503
|
+
componentMap.set("Input", Input);
|
|
4504
|
+
componentMap.set("InputNumber", InputNumber);
|
|
4505
|
+
componentMap.set("Select", Select);
|
|
4506
|
+
componentMap.set("TreeSelect", TreeSelect);
|
|
4507
|
+
componentMap.set("Switch", Switch);
|
|
4508
|
+
componentMap.set("Checkbox", Checkbox);
|
|
4509
|
+
componentMap.set("DatePicker", DatePicker);
|
|
4510
|
+
componentMap.set("TimePicker", TimePicker);
|
|
4511
|
+
const CellComponent = ({
|
|
4512
|
+
component = "Input",
|
|
4513
|
+
rule = true,
|
|
4514
|
+
ruleMessage,
|
|
4515
|
+
popoverVisible,
|
|
4516
|
+
getPopupContainer: getPopupContainer2
|
|
4517
|
+
}, { attrs }) => {
|
|
4518
|
+
const Comp = componentMap.get(component);
|
|
4519
|
+
const DefaultComp = h(Comp, attrs);
|
|
4520
|
+
if (!rule)
|
|
4521
|
+
return DefaultComp;
|
|
4522
|
+
return h(Popover, {
|
|
4523
|
+
overlayClassName: "edit-cell-rule-popover",
|
|
4524
|
+
visible: !!popoverVisible,
|
|
4525
|
+
...getPopupContainer2 ? { getPopupContainer: getPopupContainer2 } : {}
|
|
4526
|
+
}, {
|
|
4527
|
+
default: () => DefaultComp,
|
|
4528
|
+
content: () => ruleMessage
|
|
4529
|
+
});
|
|
4530
|
+
};
|
|
4531
|
+
const tableKey = Symbol("dt-page");
|
|
4532
|
+
function createTableInstance(instance) {
|
|
4533
|
+
provide(tableKey, instance);
|
|
4534
|
+
}
|
|
4535
|
+
function getTableInstance() {
|
|
4536
|
+
return inject(tableKey);
|
|
4537
|
+
}
|
|
4538
|
+
var _sfc_main$K = defineComponent({
|
|
4539
|
+
name: "EditableCell",
|
|
4540
|
+
components: {
|
|
4541
|
+
Spin,
|
|
4542
|
+
CellComponent
|
|
4543
|
+
},
|
|
4544
|
+
props: {
|
|
4545
|
+
value: {
|
|
4546
|
+
type: [String, Number, Boolean, Object],
|
|
4547
|
+
default: ""
|
|
4548
|
+
},
|
|
4549
|
+
record: {
|
|
4550
|
+
type: Object
|
|
4551
|
+
},
|
|
4552
|
+
column: {
|
|
4553
|
+
type: Object,
|
|
4554
|
+
default: () => ({})
|
|
4555
|
+
},
|
|
4556
|
+
index: Number
|
|
4557
|
+
},
|
|
4558
|
+
setup(props) {
|
|
4559
|
+
const table = getTableInstance();
|
|
4560
|
+
ref();
|
|
4561
|
+
const {
|
|
4562
|
+
editRule,
|
|
4563
|
+
align = "left"
|
|
4564
|
+
} = props.column;
|
|
4565
|
+
const ruleMessage = ref("");
|
|
4566
|
+
const ruleVisible = ref(false);
|
|
4567
|
+
const optionsRef = ref([]);
|
|
4568
|
+
const currentValueRef = ref(props.value);
|
|
4569
|
+
const getComponent = computed(() => {
|
|
4570
|
+
var _a;
|
|
4571
|
+
return ((_a = props.column) == null ? void 0 : _a.editComponent) || "Input";
|
|
4572
|
+
});
|
|
4573
|
+
const getRuleVisible = computed(() => {
|
|
4574
|
+
return unref(ruleMessage) && unref(ruleVisible);
|
|
4575
|
+
});
|
|
4576
|
+
const getWrapperClass = computed(() => {
|
|
4577
|
+
return `edit-cell-align-${align}`;
|
|
4578
|
+
});
|
|
4579
|
+
const getIsCheckComp = computed(() => {
|
|
4580
|
+
const component = unref(getComponent);
|
|
4581
|
+
return ["Checkbox", "Switch"].includes(component);
|
|
4582
|
+
});
|
|
4583
|
+
const createPlaceholderMessage = (component) => {
|
|
4584
|
+
if (component.includes("Input")) {
|
|
4585
|
+
return "\u8BF7\u8F93\u5165";
|
|
4586
|
+
}
|
|
4587
|
+
return "\u8BF7\u9009\u62E9";
|
|
4588
|
+
};
|
|
4589
|
+
const setTableValue = () => {
|
|
4590
|
+
props.record[props.column.dataIndex] = unref(currentValueRef);
|
|
4591
|
+
};
|
|
4592
|
+
const getComponentProps = computed(() => {
|
|
4593
|
+
var _a, _b, _c;
|
|
4594
|
+
const isCheckValue = unref(getIsCheckComp);
|
|
4595
|
+
const valueField = isCheckValue ? "checked" : "value";
|
|
4596
|
+
const val = unref(currentValueRef);
|
|
4597
|
+
const value = isCheckValue ? isNumber(val) && isBoolean(val) ? val : !!val : val;
|
|
4598
|
+
let compProps = (_b = (_a = props.column) == null ? void 0 : _a.editComponentProps) != null ? _b : {};
|
|
4599
|
+
const {
|
|
4600
|
+
record,
|
|
4601
|
+
column,
|
|
4602
|
+
index
|
|
4603
|
+
} = props;
|
|
4604
|
+
if (isFunction$1(compProps)) {
|
|
4605
|
+
compProps = (_c = compProps({
|
|
4606
|
+
text: val,
|
|
4607
|
+
record,
|
|
4608
|
+
column,
|
|
4609
|
+
index
|
|
4610
|
+
})) != null ? _c : {};
|
|
4611
|
+
}
|
|
4612
|
+
return {
|
|
4613
|
+
size: "small",
|
|
4614
|
+
getPopupContainer: () => document.body,
|
|
4615
|
+
placeholder: createPlaceholderMessage(unref(getComponent)),
|
|
4616
|
+
...omit(compProps, "onChange"),
|
|
4617
|
+
[valueField]: value
|
|
4618
|
+
};
|
|
4619
|
+
});
|
|
4620
|
+
async function handleChange(e) {
|
|
4621
|
+
var _a, _b;
|
|
4622
|
+
const component = unref(getComponent);
|
|
4623
|
+
if (!e) {
|
|
4624
|
+
currentValueRef.value = e;
|
|
4625
|
+
} else if (component === "Checkbox") {
|
|
4626
|
+
currentValueRef.value = e.target.checked;
|
|
4627
|
+
} else if (component === "Switch") {
|
|
4628
|
+
currentValueRef.value = e;
|
|
4629
|
+
} else if ((e == null ? void 0 : e.target) && Reflect.has(e.target, "value")) {
|
|
4630
|
+
currentValueRef.value = e.target.value;
|
|
4631
|
+
} else if (isString(e) || isBoolean(e) || isNumber(e)) {
|
|
4632
|
+
currentValueRef.value = e;
|
|
4633
|
+
}
|
|
4634
|
+
const onChange = (_a = unref(getComponentProps)) == null ? void 0 : _a.onChange;
|
|
4635
|
+
if (onChange && isFunction$1(onChange))
|
|
4636
|
+
onChange(...arguments);
|
|
4637
|
+
setTableValue();
|
|
4638
|
+
(_b = table.emit) == null ? void 0 : _b.call(table, "edit-change", {
|
|
4639
|
+
column: props.column,
|
|
4640
|
+
value: unref(currentValueRef),
|
|
4641
|
+
record: toRaw(props.record),
|
|
4642
|
+
index: props.index
|
|
4643
|
+
});
|
|
4644
|
+
handleSubmitRule();
|
|
4645
|
+
}
|
|
4646
|
+
async function handleSubmitRule() {
|
|
4647
|
+
const {
|
|
4648
|
+
column,
|
|
4649
|
+
record
|
|
4650
|
+
} = props;
|
|
4651
|
+
const {
|
|
4652
|
+
editRule: editRule2
|
|
4653
|
+
} = column;
|
|
4654
|
+
const currentValue = unref(currentValueRef);
|
|
4655
|
+
if (editRule2) {
|
|
4656
|
+
if (isBoolean(editRule2) && !currentValue && !isNumber(currentValue)) {
|
|
4657
|
+
ruleVisible.value = true;
|
|
4658
|
+
const component = unref(getComponent);
|
|
4659
|
+
ruleMessage.value = createPlaceholderMessage(component);
|
|
4660
|
+
return false;
|
|
4661
|
+
}
|
|
4662
|
+
if (isFunction$1(editRule2)) {
|
|
4663
|
+
const res = await editRule2(currentValue, record);
|
|
4664
|
+
if (!!res) {
|
|
4665
|
+
ruleMessage.value = res;
|
|
4666
|
+
ruleVisible.value = true;
|
|
4667
|
+
return false;
|
|
4668
|
+
}
|
|
4669
|
+
}
|
|
4670
|
+
}
|
|
4671
|
+
ruleMessage.value = "";
|
|
4672
|
+
return true;
|
|
4673
|
+
}
|
|
4674
|
+
function handleOptionsChange(options) {
|
|
4675
|
+
optionsRef.value = options;
|
|
4676
|
+
}
|
|
4677
|
+
return {
|
|
4678
|
+
props,
|
|
4679
|
+
getComponentProps,
|
|
4680
|
+
getRuleVisible,
|
|
4681
|
+
editRule,
|
|
4682
|
+
ruleMessage,
|
|
4683
|
+
getWrapperClass,
|
|
4684
|
+
handleChange,
|
|
4685
|
+
handleOptionsChange
|
|
4686
|
+
};
|
|
4687
|
+
}
|
|
4688
|
+
});
|
|
4689
|
+
const _hoisted_1$t = { class: "editable-cell" };
|
|
4690
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4691
|
+
var _a;
|
|
4692
|
+
const _component_CellComponent = resolveComponent("CellComponent");
|
|
4693
|
+
return openBlock(), createElementBlock("div", _hoisted_1$t, [
|
|
4694
|
+
createVNode(_component_CellComponent, mergeProps({ ref: "elRef" }, _ctx.getComponentProps, {
|
|
4695
|
+
component: (_a = _ctx.column) == null ? void 0 : _a.editComponent,
|
|
4696
|
+
popoverVisible: _ctx.getRuleVisible,
|
|
4697
|
+
rule: _ctx.editRule,
|
|
4698
|
+
ruleMessage: _ctx.ruleMessage,
|
|
4699
|
+
class: _ctx.getWrapperClass,
|
|
4700
|
+
onChange: _ctx.handleChange,
|
|
4701
|
+
onOptionsChange: _ctx.handleOptionsChange
|
|
4702
|
+
}), null, 16, ["component", "popoverVisible", "rule", "ruleMessage", "class", "onChange", "onOptionsChange"])
|
|
4703
|
+
]);
|
|
4704
|
+
}
|
|
4705
|
+
var EditableCell = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$3]]);
|
|
4706
|
+
function renderEditCell(column) {
|
|
4707
|
+
return ({ text: value, record, index }) => {
|
|
4708
|
+
record.onValid = async () => {
|
|
4709
|
+
if (isArray$1(record == null ? void 0 : record.validCbs)) {
|
|
4710
|
+
const validFns = ((record == null ? void 0 : record.validCbs) || []).map((fn) => fn());
|
|
4711
|
+
const res = await Promise.all(validFns);
|
|
4712
|
+
return res.every((item) => !!item);
|
|
4713
|
+
}
|
|
4714
|
+
return false;
|
|
4715
|
+
};
|
|
4716
|
+
record.onEdit = async (edit, submit = false) => {
|
|
4717
|
+
var _a, _b;
|
|
4718
|
+
if (!submit) {
|
|
4719
|
+
record.editable = edit;
|
|
4720
|
+
}
|
|
4721
|
+
if (!edit && submit) {
|
|
4722
|
+
if (!await record.onValid())
|
|
4723
|
+
return false;
|
|
4724
|
+
const res = await ((_a = record.onSubmitEdit) == null ? void 0 : _a.call(record));
|
|
4725
|
+
if (res) {
|
|
4726
|
+
record.editable = false;
|
|
4727
|
+
return true;
|
|
4728
|
+
}
|
|
4729
|
+
return false;
|
|
4730
|
+
}
|
|
4731
|
+
if (!edit && !submit) {
|
|
4732
|
+
(_b = record.onCancelEdit) == null ? void 0 : _b.call(record);
|
|
4733
|
+
}
|
|
4734
|
+
return true;
|
|
4735
|
+
};
|
|
4736
|
+
return h(EditableCell, {
|
|
4737
|
+
value,
|
|
4738
|
+
record,
|
|
4739
|
+
column,
|
|
4740
|
+
index
|
|
4741
|
+
});
|
|
4742
|
+
};
|
|
4743
|
+
}
|
|
4501
4744
|
const codeMap = /* @__PURE__ */ new Map();
|
|
4502
4745
|
function useHeaderCode(code, templates = {}, changeColumns) {
|
|
4503
4746
|
const { appConf } = useAppStore();
|
|
@@ -4663,6 +4906,7 @@ const TableProps = {
|
|
|
4663
4906
|
ellipsis: { type: Boolean, default: true },
|
|
4664
4907
|
dataSource: { type: Array, default: null },
|
|
4665
4908
|
bordered: { type: Boolean, default: true },
|
|
4909
|
+
canResize: { type: Boolean, default: false },
|
|
4666
4910
|
pagination: {
|
|
4667
4911
|
type: [Object, Boolean],
|
|
4668
4912
|
default: {}
|
|
@@ -4975,7 +5219,7 @@ function useRowSelection(propsRef, emit) {
|
|
|
4975
5219
|
setSelectedRowKeys
|
|
4976
5220
|
};
|
|
4977
5221
|
}
|
|
4978
|
-
var _sfc_main$
|
|
5222
|
+
var _sfc_main$J = defineComponent({
|
|
4979
5223
|
name: "TableFormat",
|
|
4980
5224
|
props: {
|
|
4981
5225
|
column: {
|
|
@@ -4991,6 +5235,7 @@ var _sfc_main$K = defineComponent({
|
|
|
4991
5235
|
setup(props) {
|
|
4992
5236
|
let renderText = ref();
|
|
4993
5237
|
function renderCell() {
|
|
5238
|
+
var _a;
|
|
4994
5239
|
const {
|
|
4995
5240
|
column,
|
|
4996
5241
|
record,
|
|
@@ -5024,7 +5269,7 @@ var _sfc_main$K = defineComponent({
|
|
|
5024
5269
|
renderText = getDictValueByCode(text, dict);
|
|
5025
5270
|
}
|
|
5026
5271
|
if (date) {
|
|
5027
|
-
renderText.value = dayjs(text).format(date || "YYYY-MM-DD");
|
|
5272
|
+
renderText.value = (_a = text && dayjs(text).format(date || "YYYY-MM-DD")) != null ? _a : "";
|
|
5028
5273
|
}
|
|
5029
5274
|
if (number) {
|
|
5030
5275
|
renderText.value = formatNumber(text, number);
|
|
@@ -5056,253 +5301,10 @@ var _sfc_main$K = defineComponent({
|
|
|
5056
5301
|
return () => createVNode("span", null, [unref(renderText)]);
|
|
5057
5302
|
}
|
|
5058
5303
|
});
|
|
5059
|
-
const
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
}
|
|
5063
|
-
function getTableInstance() {
|
|
5064
|
-
return inject(tableKey);
|
|
5065
|
-
}
|
|
5066
|
-
const componentMap = /* @__PURE__ */ new Map();
|
|
5067
|
-
componentMap.set("Input", Input);
|
|
5068
|
-
componentMap.set("InputNumber", InputNumber);
|
|
5069
|
-
componentMap.set("Select", Select);
|
|
5070
|
-
componentMap.set("TreeSelect", TreeSelect);
|
|
5071
|
-
componentMap.set("Switch", Switch);
|
|
5072
|
-
componentMap.set("Checkbox", Checkbox);
|
|
5073
|
-
componentMap.set("DatePicker", DatePicker);
|
|
5074
|
-
componentMap.set("TimePicker", TimePicker);
|
|
5075
|
-
const CellComponent = ({
|
|
5076
|
-
component = "Input",
|
|
5077
|
-
rule = true,
|
|
5078
|
-
ruleMessage,
|
|
5079
|
-
popoverVisible,
|
|
5080
|
-
getPopupContainer: getPopupContainer2
|
|
5081
|
-
}, { attrs }) => {
|
|
5082
|
-
const Comp = componentMap.get(component);
|
|
5083
|
-
const DefaultComp = h(Comp, attrs);
|
|
5084
|
-
if (!rule)
|
|
5085
|
-
return DefaultComp;
|
|
5086
|
-
return h(Popover, {
|
|
5087
|
-
overlayClassName: "edit-cell-rule-popover",
|
|
5088
|
-
visible: !!popoverVisible,
|
|
5089
|
-
...getPopupContainer2 ? { getPopupContainer: getPopupContainer2 } : {}
|
|
5090
|
-
}, {
|
|
5091
|
-
default: () => DefaultComp,
|
|
5092
|
-
content: () => ruleMessage
|
|
5093
|
-
});
|
|
5304
|
+
const _hoisted_1$s = {
|
|
5305
|
+
key: 0,
|
|
5306
|
+
class: "dt-table-action-btn"
|
|
5094
5307
|
};
|
|
5095
|
-
var _sfc_main$J = defineComponent({
|
|
5096
|
-
name: "EditableCell",
|
|
5097
|
-
components: {
|
|
5098
|
-
Spin,
|
|
5099
|
-
CellComponent
|
|
5100
|
-
},
|
|
5101
|
-
props: {
|
|
5102
|
-
value: {
|
|
5103
|
-
type: [String, Number, Boolean, Object],
|
|
5104
|
-
default: ""
|
|
5105
|
-
},
|
|
5106
|
-
record: {
|
|
5107
|
-
type: Object
|
|
5108
|
-
},
|
|
5109
|
-
row: Object,
|
|
5110
|
-
column: {
|
|
5111
|
-
type: Object,
|
|
5112
|
-
default: () => ({})
|
|
5113
|
-
},
|
|
5114
|
-
index: Number,
|
|
5115
|
-
dataSource: Array
|
|
5116
|
-
},
|
|
5117
|
-
setup(props) {
|
|
5118
|
-
const table = getTableInstance();
|
|
5119
|
-
ref();
|
|
5120
|
-
const {
|
|
5121
|
-
editRule,
|
|
5122
|
-
align = "left"
|
|
5123
|
-
} = props.column;
|
|
5124
|
-
const ruleMessage = ref("");
|
|
5125
|
-
const ruleVisible = ref(false);
|
|
5126
|
-
const optionsRef = ref([]);
|
|
5127
|
-
const currentValueRef = ref(props.value);
|
|
5128
|
-
const getComponent = computed(() => {
|
|
5129
|
-
var _a;
|
|
5130
|
-
return ((_a = props.column) == null ? void 0 : _a.editComponent) || "Input";
|
|
5131
|
-
});
|
|
5132
|
-
const getRuleVisible = computed(() => {
|
|
5133
|
-
return unref(ruleMessage) && unref(ruleVisible);
|
|
5134
|
-
});
|
|
5135
|
-
const getWrapperClass = computed(() => {
|
|
5136
|
-
return `edit-cell-align-${align}`;
|
|
5137
|
-
});
|
|
5138
|
-
const getIsCheckComp = computed(() => {
|
|
5139
|
-
const component = unref(getComponent);
|
|
5140
|
-
return ["Checkbox", "Switch"].includes(component);
|
|
5141
|
-
});
|
|
5142
|
-
const createPlaceholderMessage = (component) => {
|
|
5143
|
-
if (component.includes("Input")) {
|
|
5144
|
-
return "\u8BF7\u8F93\u5165";
|
|
5145
|
-
}
|
|
5146
|
-
return "\u8BF7\u9009\u62E9";
|
|
5147
|
-
};
|
|
5148
|
-
const setTableValue = () => {
|
|
5149
|
-
props.row[props.column.dataIndex] = unref(currentValueRef);
|
|
5150
|
-
};
|
|
5151
|
-
const getComponentProps = computed(() => {
|
|
5152
|
-
var _a, _b, _c;
|
|
5153
|
-
const isCheckValue = unref(getIsCheckComp);
|
|
5154
|
-
const valueField = isCheckValue ? "checked" : "value";
|
|
5155
|
-
const val = unref(currentValueRef);
|
|
5156
|
-
const value = isCheckValue ? isNumber(val) && isBoolean(val) ? val : !!val : val;
|
|
5157
|
-
let compProps = (_b = (_a = props.column) == null ? void 0 : _a.editComponentProps) != null ? _b : {};
|
|
5158
|
-
const {
|
|
5159
|
-
record,
|
|
5160
|
-
column,
|
|
5161
|
-
index
|
|
5162
|
-
} = props;
|
|
5163
|
-
if (isFunction$1(compProps)) {
|
|
5164
|
-
compProps = (_c = compProps({
|
|
5165
|
-
text: val,
|
|
5166
|
-
record,
|
|
5167
|
-
column,
|
|
5168
|
-
index
|
|
5169
|
-
})) != null ? _c : {};
|
|
5170
|
-
}
|
|
5171
|
-
return {
|
|
5172
|
-
size: "small",
|
|
5173
|
-
getPopupContainer: () => document.body,
|
|
5174
|
-
placeholder: createPlaceholderMessage(unref(getComponent)),
|
|
5175
|
-
...omit(compProps, "onChange"),
|
|
5176
|
-
[valueField]: value
|
|
5177
|
-
};
|
|
5178
|
-
});
|
|
5179
|
-
async function handleChange(e) {
|
|
5180
|
-
var _a, _b;
|
|
5181
|
-
const component = unref(getComponent);
|
|
5182
|
-
if (!e) {
|
|
5183
|
-
currentValueRef.value = e;
|
|
5184
|
-
} else if (component === "Checkbox") {
|
|
5185
|
-
currentValueRef.value = e.target.checked;
|
|
5186
|
-
} else if (component === "Switch") {
|
|
5187
|
-
currentValueRef.value = e;
|
|
5188
|
-
} else if ((e == null ? void 0 : e.target) && Reflect.has(e.target, "value")) {
|
|
5189
|
-
currentValueRef.value = e.target.value;
|
|
5190
|
-
} else if (isString(e) || isBoolean(e) || isNumber(e)) {
|
|
5191
|
-
currentValueRef.value = e;
|
|
5192
|
-
}
|
|
5193
|
-
const onChange = (_a = unref(getComponentProps)) == null ? void 0 : _a.onChange;
|
|
5194
|
-
if (onChange && isFunction$1(onChange))
|
|
5195
|
-
onChange(...arguments);
|
|
5196
|
-
setTableValue();
|
|
5197
|
-
(_b = table.emit) == null ? void 0 : _b.call(table, "edit-change", {
|
|
5198
|
-
column: props.column,
|
|
5199
|
-
value: unref(currentValueRef),
|
|
5200
|
-
record: toRaw(props.record),
|
|
5201
|
-
index: props.index
|
|
5202
|
-
});
|
|
5203
|
-
handleSubmitRule();
|
|
5204
|
-
}
|
|
5205
|
-
async function handleSubmitRule() {
|
|
5206
|
-
const {
|
|
5207
|
-
column,
|
|
5208
|
-
record
|
|
5209
|
-
} = props;
|
|
5210
|
-
const {
|
|
5211
|
-
editRule: editRule2
|
|
5212
|
-
} = column;
|
|
5213
|
-
const currentValue = unref(currentValueRef);
|
|
5214
|
-
if (editRule2) {
|
|
5215
|
-
if (isBoolean(editRule2) && !currentValue && !isNumber(currentValue)) {
|
|
5216
|
-
ruleVisible.value = true;
|
|
5217
|
-
const component = unref(getComponent);
|
|
5218
|
-
ruleMessage.value = createPlaceholderMessage(component);
|
|
5219
|
-
return false;
|
|
5220
|
-
}
|
|
5221
|
-
if (isFunction$1(editRule2)) {
|
|
5222
|
-
const res = await editRule2(currentValue, record);
|
|
5223
|
-
if (!!res) {
|
|
5224
|
-
ruleMessage.value = res;
|
|
5225
|
-
ruleVisible.value = true;
|
|
5226
|
-
return false;
|
|
5227
|
-
}
|
|
5228
|
-
}
|
|
5229
|
-
}
|
|
5230
|
-
ruleMessage.value = "";
|
|
5231
|
-
return true;
|
|
5232
|
-
}
|
|
5233
|
-
function handleOptionsChange(options) {
|
|
5234
|
-
optionsRef.value = options;
|
|
5235
|
-
}
|
|
5236
|
-
return {
|
|
5237
|
-
props,
|
|
5238
|
-
getComponentProps,
|
|
5239
|
-
getRuleVisible,
|
|
5240
|
-
editRule,
|
|
5241
|
-
ruleMessage,
|
|
5242
|
-
getWrapperClass,
|
|
5243
|
-
handleChange,
|
|
5244
|
-
handleOptionsChange
|
|
5245
|
-
};
|
|
5246
|
-
}
|
|
5247
|
-
});
|
|
5248
|
-
const _hoisted_1$t = { class: "editable-cell" };
|
|
5249
|
-
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5250
|
-
var _a;
|
|
5251
|
-
const _component_CellComponent = resolveComponent("CellComponent");
|
|
5252
|
-
return openBlock(), createElementBlock("div", _hoisted_1$t, [
|
|
5253
|
-
createVNode(_component_CellComponent, mergeProps({ ref: "elRef" }, _ctx.getComponentProps, {
|
|
5254
|
-
component: (_a = _ctx.column) == null ? void 0 : _a.editComponent,
|
|
5255
|
-
popoverVisible: _ctx.getRuleVisible,
|
|
5256
|
-
rule: _ctx.editRule,
|
|
5257
|
-
ruleMessage: _ctx.ruleMessage,
|
|
5258
|
-
class: _ctx.getWrapperClass,
|
|
5259
|
-
onChange: _ctx.handleChange,
|
|
5260
|
-
onOptionsChange: _ctx.handleOptionsChange
|
|
5261
|
-
}), null, 16, ["component", "popoverVisible", "rule", "ruleMessage", "class", "onChange", "onOptionsChange"])
|
|
5262
|
-
]);
|
|
5263
|
-
}
|
|
5264
|
-
var EditableCell = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$3]]);
|
|
5265
|
-
function renderEditCell(column, dataSource) {
|
|
5266
|
-
return ({ text: value, record, index }) => {
|
|
5267
|
-
record.onValid = async () => {
|
|
5268
|
-
if (isArray$1(record == null ? void 0 : record.validCbs)) {
|
|
5269
|
-
const validFns = ((record == null ? void 0 : record.validCbs) || []).map((fn) => fn());
|
|
5270
|
-
const res = await Promise.all(validFns);
|
|
5271
|
-
return res.every((item) => !!item);
|
|
5272
|
-
}
|
|
5273
|
-
return false;
|
|
5274
|
-
};
|
|
5275
|
-
record.onEdit = async (edit, submit = false) => {
|
|
5276
|
-
var _a, _b;
|
|
5277
|
-
if (!submit) {
|
|
5278
|
-
record.editable = edit;
|
|
5279
|
-
}
|
|
5280
|
-
if (!edit && submit) {
|
|
5281
|
-
if (!await record.onValid())
|
|
5282
|
-
return false;
|
|
5283
|
-
const res = await ((_a = record.onSubmitEdit) == null ? void 0 : _a.call(record));
|
|
5284
|
-
if (res) {
|
|
5285
|
-
record.editable = false;
|
|
5286
|
-
return true;
|
|
5287
|
-
}
|
|
5288
|
-
return false;
|
|
5289
|
-
}
|
|
5290
|
-
if (!edit && !submit) {
|
|
5291
|
-
(_b = record.onCancelEdit) == null ? void 0 : _b.call(record);
|
|
5292
|
-
}
|
|
5293
|
-
return true;
|
|
5294
|
-
};
|
|
5295
|
-
return h(EditableCell, {
|
|
5296
|
-
value,
|
|
5297
|
-
record,
|
|
5298
|
-
column,
|
|
5299
|
-
row: dataSource[index],
|
|
5300
|
-
index,
|
|
5301
|
-
dataSource
|
|
5302
|
-
});
|
|
5303
|
-
};
|
|
5304
|
-
}
|
|
5305
|
-
const _hoisted_1$s = { class: "dt-table-action-btn" };
|
|
5306
5308
|
const _hoisted_2$j = ["color", "onClick"];
|
|
5307
5309
|
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
5308
5310
|
__name: "TableActions",
|
|
@@ -5364,26 +5366,27 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
5364
5366
|
return (_ctx, _cache) => {
|
|
5365
5367
|
const _directive_icon = resolveDirective("icon");
|
|
5366
5368
|
const _directive_auth = resolveDirective("auth");
|
|
5367
|
-
return props.expand ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(
|
|
5368
|
-
return openBlock(), createElementBlock(
|
|
5369
|
-
item.ifShow ? (openBlock(),
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5369
|
+
return props.expand ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(actionBtns.value, (item) => {
|
|
5370
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
5371
|
+
item.ifShow ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1$s, [
|
|
5372
|
+
createVNode(unref(Tooltip), { placement: "bottom" }, {
|
|
5373
|
+
title: withCtx(() => [
|
|
5374
|
+
createTextVNode(toDisplayString(item.title), 1)
|
|
5375
|
+
]),
|
|
5376
|
+
default: withCtx(() => [
|
|
5377
|
+
withDirectives(createElementVNode("span", {
|
|
5378
|
+
color: item.color,
|
|
5379
|
+
onClick: ($event) => handleAction(item)
|
|
5380
|
+
}, null, 8, _hoisted_2$j), [
|
|
5381
|
+
[_directive_icon, item.icon]
|
|
5382
|
+
])
|
|
5383
|
+
]),
|
|
5384
|
+
_: 2
|
|
5385
|
+
}, 1024)
|
|
5386
|
+
])), [
|
|
5387
|
+
[_directive_auth, item.auth]
|
|
5388
|
+
]) : createCommentVNode("", true)
|
|
5389
|
+
], 64);
|
|
5387
5390
|
}), 256)) : (openBlock(), createBlock(unref(Dropdown), {
|
|
5388
5391
|
key: 1,
|
|
5389
5392
|
getPopupContainer: getPopupContainer$1,
|
|
@@ -5574,7 +5577,7 @@ function useColumns(propsRef, getPaginationRef, tableElRef) {
|
|
|
5574
5577
|
const columns = cloneDeep(viewColumns);
|
|
5575
5578
|
return columns.filter((column) => isIfShow(column)).map((column) => {
|
|
5576
5579
|
if (column.edit) {
|
|
5577
|
-
column.customRender = renderEditCell(column
|
|
5580
|
+
column.customRender = renderEditCell(column);
|
|
5578
5581
|
}
|
|
5579
5582
|
return column;
|
|
5580
5583
|
});
|
|
@@ -6459,6 +6462,7 @@ function useTableHeader(propsRef, slots, handlers) {
|
|
|
6459
6462
|
function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
6460
6463
|
const tableHeightRef = ref(0);
|
|
6461
6464
|
const filterSource = ref([]);
|
|
6465
|
+
const tableScrollTopRef = ref(null);
|
|
6462
6466
|
const debounceRedoHeight = useDebounceFn(redoHeight, 100);
|
|
6463
6467
|
watch(() => propsRef.value.dataSource, (v) => {
|
|
6464
6468
|
debounceRedoHeight();
|
|
@@ -6466,7 +6470,7 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
6466
6470
|
deep: true,
|
|
6467
6471
|
flush: "post"
|
|
6468
6472
|
});
|
|
6469
|
-
windowResizeFn(calcTableHeight,
|
|
6473
|
+
windowResizeFn(calcTableHeight, 280);
|
|
6470
6474
|
function redoHeight() {
|
|
6471
6475
|
nextTick(() => {
|
|
6472
6476
|
calcTableHeight();
|
|
@@ -6502,7 +6506,6 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
6502
6506
|
!tableEl.classList.contains("hide-scrollbar-x") && tableEl.classList.add("hide-scrollbar-x");
|
|
6503
6507
|
}
|
|
6504
6508
|
bodyEl.style.height = "unset";
|
|
6505
|
-
filterSource.value = [];
|
|
6506
6509
|
await nextTick();
|
|
6507
6510
|
let headerHeight = 0, paginationHeight = 2, footerHeight = 0, titleHeight = (_b = (_a = tableEl.querySelector(".ant-table-title")) == null ? void 0 : _a.offsetHeight) != null ? _b : 0, marginHeight = 15;
|
|
6508
6511
|
const headEl = tableEl.querySelector(".ant-table-thead ");
|
|
@@ -6556,7 +6559,7 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
6556
6559
|
});
|
|
6557
6560
|
const getScrollRef = computed(() => {
|
|
6558
6561
|
const tableHeight = unref(tableHeightRef);
|
|
6559
|
-
const { scroll } = unref(propsRef);
|
|
6562
|
+
const { canResize, scroll } = unref(propsRef);
|
|
6560
6563
|
return {
|
|
6561
6564
|
x: unref(getScrollX),
|
|
6562
6565
|
y: tableHeight,
|
|
@@ -6597,11 +6600,15 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
6597
6600
|
const { size } = unref(propsRef);
|
|
6598
6601
|
const rowHeight = TABLE_SIZE_HEIGHT[size];
|
|
6599
6602
|
const scrollTop = el.scrollTop;
|
|
6600
|
-
|
|
6603
|
+
if (tableScrollTopRef.value === scrollTop && scrollTop !== 0) {
|
|
6604
|
+
return;
|
|
6605
|
+
}
|
|
6606
|
+
tableScrollTopRef.value = scrollTop;
|
|
6607
|
+
const remainCount = 6;
|
|
6601
6608
|
const remainH = remainCount * rowHeight;
|
|
6602
6609
|
const minItemHeight = scrollTop > remainH ? Math.floor((scrollTop - remainH) / rowHeight) * rowHeight : 0;
|
|
6603
|
-
|
|
6604
|
-
const maxIndex = minIndex + Math.ceil(tableHeightRef.value / rowHeight) + (minItemHeight && remainCount)
|
|
6610
|
+
let minIndex = minItemHeight / rowHeight;
|
|
6611
|
+
const maxIndex = minIndex + Math.ceil(tableHeightRef.value / rowHeight) + (minItemHeight && remainCount);
|
|
6605
6612
|
bodyEl.querySelector("table").style.transform = `translateY(${minItemHeight}px)`;
|
|
6606
6613
|
filterSource.value = (_a = unref(propsRef)) == null ? void 0 : _a.dataSource.slice(minIndex, maxIndex);
|
|
6607
6614
|
}
|
|
@@ -6680,7 +6687,7 @@ const _sfc_main$A = defineComponent({
|
|
|
6680
6687
|
props: TableProps,
|
|
6681
6688
|
components: {
|
|
6682
6689
|
Table,
|
|
6683
|
-
TableRender: _sfc_main$
|
|
6690
|
+
TableRender: _sfc_main$J
|
|
6684
6691
|
},
|
|
6685
6692
|
emits: [
|
|
6686
6693
|
"register",
|
|
@@ -7902,7 +7909,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
7902
7909
|
}
|
|
7903
7910
|
}
|
|
7904
7911
|
},
|
|
7905
|
-
{ title: "\u5220\u9664", icon: "mdi:delete-outline", action: ({ row }) => {
|
|
7912
|
+
{ title: "\u5220\u9664", icon: "mdi:delete-outline", ifShow: true, action: ({ row }) => {
|
|
7906
7913
|
if (!row.status)
|
|
7907
7914
|
historyFilesRef.value = historyFilesRef.value.filter((it) => it.fileId !== row.fileId);
|
|
7908
7915
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dt-frames/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"ui",
|
|
6
6
|
"dt-ui"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"registry": "https://registry.npmjs.org/"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"dev": "vite
|
|
13
|
+
"dev": "vite build -w",
|
|
14
14
|
"build": "vite build"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|