@dtjoy/dt-design 1.0.6 → 1.0.8
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/esm/_util/easings.d.ts +1 -0
- package/esm/_util/easings.js +9 -0
- package/esm/_util/extendsObject.d.ts +4 -0
- package/esm/_util/extendsObject.js +17 -0
- package/esm/_util/gapSize.d.ts +3 -3
- package/esm/_util/getScroll.d.ts +3 -0
- package/esm/_util/getScroll.js +32 -0
- package/esm/_util/hooks/index.d.ts +4 -1
- package/esm/_util/hooks/index.js +4 -1
- package/esm/_util/hooks/useForceUpdate.d.ts +2 -0
- package/esm/_util/hooks/useForceUpdate.js +6 -0
- package/esm/_util/hooks/useOrientation.d.ts +2 -2
- package/esm/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
- package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
- package/esm/_util/hooks/useSyncState.d.ts +3 -0
- package/esm/_util/hooks/useSyncState.js +20 -0
- package/esm/_util/index.d.ts +3 -3
- package/esm/_util/isNonNullable.d.ts +2 -2
- package/esm/_util/scrollTo.d.ts +10 -0
- package/esm/_util/scrollTo.js +38 -0
- package/esm/_util/type.d.ts +52 -52
- package/esm/_util/warning.d.ts +31 -31
- package/esm/_util/warning.js +5 -5
- package/esm/blockHeader/index.d.ts +50 -48
- package/esm/blockHeader/index.js +13 -15
- package/esm/blockHeader/style/index.d.ts +2 -2
- package/esm/blockHeader/style/index.less +143 -143
- package/esm/button/index.d.ts +10 -10
- package/esm/button/index.js +2 -2
- package/esm/button/style/index.d.ts +2 -2
- package/esm/collapsible/index.d.ts +102 -97
- package/esm/collapsible/index.js +53 -55
- package/esm/collapsible/style/index.d.ts +1 -1
- package/esm/collapsibleActionItems/index.d.ts +24 -24
- package/esm/collapsibleActionItems/index.js +2 -2
- package/esm/collapsibleActionItems/style/index.d.ts +2 -2
- package/esm/flex/index.d.ts +7 -7
- package/esm/flex/index.js +1 -1
- package/esm/flex/interface.d.ts +16 -16
- package/esm/flex/style/index.d.ts +2 -2
- package/esm/flex/style/index.less +76 -76
- package/esm/flex/utils.d.ts +7 -7
- package/esm/flex/utils.js +1 -1
- package/esm/formList/index.d.ts +78 -77
- package/esm/formList/index.js +13 -11
- package/esm/formList/style/index.d.ts +2 -2
- package/esm/formList/style/index.less +45 -45
- package/esm/index.d.ts +17 -14
- package/esm/index.js +3 -1
- package/esm/overflowList/index.d.ts +40 -39
- package/esm/overflowList/index.js +4 -3
- package/esm/overflowList/style/index.d.ts +2 -2
- package/esm/resize/index.d.ts +9 -8
- package/esm/resize/index.js +1 -1
- package/esm/resizeObserver/index.d.ts +45 -45
- package/esm/resizeObserver/index.js +3 -2
- package/esm/splitter/Panel.d.ts +7 -7
- package/esm/splitter/Panel.js +3 -3
- package/esm/splitter/SplitBar.d.ts +24 -24
- package/esm/splitter/SplitBar.js +8 -7
- package/esm/splitter/Splitter.d.ts +5 -5
- package/esm/splitter/Splitter.js +5 -4
- package/esm/splitter/hooks/sizeUtil.d.ts +3 -3
- package/esm/splitter/hooks/useItems.d.ts +14 -14
- package/esm/splitter/hooks/useItems.js +2 -2
- package/esm/splitter/hooks/useResizable.d.ts +10 -10
- package/esm/splitter/hooks/useResize.d.ts +6 -6
- package/esm/splitter/hooks/useResize.js +5 -5
- package/esm/splitter/hooks/useSizes.d.ts +4 -4
- package/esm/splitter/index.d.ts +8 -8
- package/esm/splitter/interface.d.ts +69 -69
- package/esm/splitter/style/index.d.ts +2 -2
- package/esm/statusTag/index.d.ts +29 -28
- package/esm/statusTag/index.js +8 -8
- package/esm/statusTag/style/index.d.ts +2 -2
- package/esm/style/index.d.ts +1 -1
- package/esm/style/index.less +1 -1
- package/esm/style/themes/index.less +2 -2
- package/esm/style/themes/variable.less +4 -0
- package/esm/table/InternalTable.d.ts +32 -0
- package/esm/table/InternalTable.js +429 -0
- package/esm/table/RcTable/VirtualTable.d.ts +2 -0
- package/esm/table/RcTable/VirtualTable.js +9 -0
- package/esm/table/RcTable/index.d.ts +2 -0
- package/esm/table/RcTable/index.js +9 -0
- package/esm/table/Table.d.ts +17 -0
- package/esm/table/Table.js +28 -0
- package/esm/table/TableMeasureRowContext.d.ts +3 -0
- package/esm/table/TableMeasureRowContext.js +3 -0
- package/esm/table/hooks/useContainerWidth.d.ts +1 -0
- package/esm/table/hooks/useContainerWidth.js +14 -0
- package/esm/table/index.d.ts +7 -0
- package/esm/table/index.js +2 -0
- package/esm/table/interface.d.ts +196 -0
- package/esm/table/interface.js +4 -0
- package/esm/table/style/bordered.less +141 -0
- package/esm/table/style/fixed.less +88 -0
- package/esm/table/style/index.d.ts +2 -0
- package/esm/table/style/index.js +2 -0
- package/esm/table/style/index.less +150 -0
- package/esm/table/style/selection.less +90 -0
- package/esm/table/style/sticky.less +55 -0
- package/esm/table/style/virtual.less +65 -0
- package/esm/table/util.d.ts +14 -0
- package/esm/table/util.js +33 -0
- package/lib/_util/easings.d.ts +1 -0
- package/lib/_util/easings.js +15 -0
- package/lib/_util/extendsObject.d.ts +4 -0
- package/lib/_util/extendsObject.js +20 -0
- package/lib/_util/gapSize.d.ts +3 -3
- package/lib/_util/getScroll.d.ts +3 -0
- package/lib/_util/getScroll.js +39 -0
- package/lib/_util/hooks/index.d.ts +4 -1
- package/lib/_util/hooks/index.js +33 -0
- package/lib/_util/hooks/useForceUpdate.d.ts +2 -0
- package/lib/_util/hooks/useForceUpdate.js +12 -0
- package/lib/_util/hooks/useOrientation.d.ts +2 -2
- package/lib/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
- package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
- package/lib/_util/hooks/useSyncState.d.ts +3 -0
- package/lib/_util/hooks/useSyncState.js +19 -0
- package/lib/_util/index.d.ts +3 -3
- package/lib/_util/isNonNullable.d.ts +2 -2
- package/lib/_util/scrollTo.d.ts +10 -0
- package/lib/_util/scrollTo.js +44 -0
- package/lib/_util/type.d.ts +52 -52
- package/lib/_util/warning.d.ts +31 -31
- package/lib/_util/warning.js +7 -8
- package/lib/blockHeader/index.d.ts +50 -48
- package/lib/blockHeader/index.js +13 -12
- package/lib/blockHeader/style/index.d.ts +2 -2
- package/lib/blockHeader/style/index.less +143 -143
- package/lib/button/index.d.ts +10 -10
- package/lib/button/index.js +2 -2
- package/lib/button/style/index.d.ts +2 -2
- package/lib/collapsible/index.d.ts +102 -97
- package/lib/collapsible/index.js +49 -49
- package/lib/collapsible/style/index.d.ts +1 -1
- package/lib/collapsibleActionItems/index.d.ts +24 -24
- package/lib/collapsibleActionItems/index.js +2 -2
- package/lib/collapsibleActionItems/style/index.d.ts +2 -2
- package/lib/flex/index.d.ts +7 -7
- package/lib/flex/index.js +2 -2
- package/lib/flex/interface.d.ts +16 -16
- package/lib/flex/style/index.d.ts +2 -2
- package/lib/flex/style/index.less +76 -76
- package/lib/flex/utils.d.ts +7 -7
- package/lib/flex/utils.js +2 -2
- package/lib/formList/index.d.ts +78 -77
- package/lib/formList/index.js +10 -10
- package/lib/formList/style/index.d.ts +2 -2
- package/lib/formList/style/index.less +45 -45
- package/lib/index.d.ts +17 -14
- package/lib/index.js +21 -2
- package/lib/overflowList/index.d.ts +40 -39
- package/lib/overflowList/index.js +4 -3
- package/lib/overflowList/style/index.d.ts +2 -2
- package/lib/resize/index.d.ts +9 -8
- package/lib/resize/index.js +1 -1
- package/lib/resizeObserver/index.d.ts +45 -45
- package/lib/resizeObserver/index.js +3 -2
- package/lib/splitter/Panel.d.ts +7 -7
- package/lib/splitter/Panel.js +3 -3
- package/lib/splitter/SplitBar.d.ts +24 -24
- package/lib/splitter/SplitBar.js +8 -7
- package/lib/splitter/Splitter.d.ts +5 -5
- package/lib/splitter/Splitter.js +5 -4
- package/lib/splitter/hooks/sizeUtil.d.ts +3 -3
- package/lib/splitter/hooks/useItems.d.ts +14 -14
- package/lib/splitter/hooks/useItems.js +2 -2
- package/lib/splitter/hooks/useResizable.d.ts +10 -10
- package/lib/splitter/hooks/useResize.d.ts +6 -6
- package/lib/splitter/hooks/useResize.js +5 -5
- package/lib/splitter/hooks/useSizes.d.ts +4 -4
- package/lib/splitter/index.d.ts +8 -8
- package/lib/splitter/interface.d.ts +69 -69
- package/lib/splitter/style/index.d.ts +2 -2
- package/lib/statusTag/index.d.ts +29 -28
- package/lib/statusTag/index.js +8 -8
- package/lib/statusTag/style/index.d.ts +2 -2
- package/lib/style/index.d.ts +1 -1
- package/lib/style/index.less +1 -1
- package/lib/style/themes/index.less +2 -2
- package/lib/style/themes/variable.less +4 -0
- package/lib/table/InternalTable.d.ts +32 -0
- package/lib/table/InternalTable.js +395 -0
- package/lib/table/RcTable/VirtualTable.d.ts +2 -0
- package/lib/table/RcTable/VirtualTable.js +17 -0
- package/lib/table/RcTable/index.d.ts +2 -0
- package/lib/table/RcTable/index.js +17 -0
- package/lib/table/Table.d.ts +17 -0
- package/lib/table/Table.js +37 -0
- package/lib/table/TableMeasureRowContext.d.ts +3 -0
- package/lib/{_util/zindexContext.js → table/TableMeasureRowContext.js} +2 -5
- package/lib/table/hooks/useContainerWidth.d.ts +1 -0
- package/lib/table/hooks/useContainerWidth.js +20 -0
- package/lib/table/index.d.ts +7 -0
- package/lib/table/index.js +9 -0
- package/lib/table/interface.d.ts +196 -0
- package/lib/table/interface.js +8 -0
- package/lib/table/style/bordered.less +141 -0
- package/lib/table/style/fixed.less +88 -0
- package/lib/table/style/index.d.ts +2 -0
- package/lib/table/style/index.js +4 -0
- package/lib/table/style/index.less +150 -0
- package/lib/table/style/selection.less +90 -0
- package/lib/table/style/sticky.less +55 -0
- package/lib/table/style/virtual.less +65 -0
- package/lib/table/util.d.ts +14 -0
- package/lib/table/util.js +44 -0
- package/package.json +82 -66
- package/esm/_util/convertToTooltipProps.d.ts +0 -4
- package/esm/_util/convertToTooltipProps.js +0 -15
- package/esm/_util/hooks/useZIndex.d.ts +0 -8
- package/esm/_util/hooks/useZIndex.js +0 -51
- package/esm/_util/zindexContext.d.ts +0 -3
- package/esm/_util/zindexContext.js +0 -6
- package/lib/_util/convertToTooltipProps.d.ts +0 -4
- package/lib/_util/convertToTooltipProps.js +0 -21
- package/lib/_util/hooks/useZIndex.d.ts +0 -8
- package/lib/_util/hooks/useZIndex.js +0 -59
- package/lib/_util/zindexContext.d.ts +0 -3
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
@import '../../style/themes/index.less';
|
|
2
|
-
|
|
3
|
-
@flex-prefix-cls: ~'@{ant-prefix}-flex';
|
|
4
|
-
|
|
5
|
-
// 属性与值的映射
|
|
6
|
-
@align-items-values: {
|
|
7
|
-
stretch: stretch;
|
|
8
|
-
flex-start: flex-start;
|
|
9
|
-
center: center;
|
|
10
|
-
flex-end: flex-end;
|
|
11
|
-
baseline: baseline;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
@justify-content-values: {
|
|
15
|
-
flex-start: flex-start;
|
|
16
|
-
center: center;
|
|
17
|
-
flex-end: flex-end;
|
|
18
|
-
space-between: space-between;
|
|
19
|
-
space-around: space-around;
|
|
20
|
-
space-evenly: space-evenly;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
@flex-wrap-values: {
|
|
24
|
-
nowrap: nowrap;
|
|
25
|
-
wrap: wrap;
|
|
26
|
-
wrap-reverse: wrap-reverse;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
.@{flex-prefix-cls} {
|
|
30
|
-
display: flex;
|
|
31
|
-
margin: 0;
|
|
32
|
-
padding: 0;
|
|
33
|
-
|
|
34
|
-
// 方向
|
|
35
|
-
&-vertical {
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
}
|
|
38
|
-
&-rtl {
|
|
39
|
-
direction: rtl;
|
|
40
|
-
}
|
|
41
|
-
&:empty {
|
|
42
|
-
display: none;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// 间距 (Gap)
|
|
46
|
-
&-gap-small {
|
|
47
|
-
gap: @padding-xs;
|
|
48
|
-
}
|
|
49
|
-
&-gap-middle {
|
|
50
|
-
gap: @padding-md;
|
|
51
|
-
}
|
|
52
|
-
&-gap-large {
|
|
53
|
-
gap: @padding-lg;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// 使用 Loops/Each 抽象重复代码
|
|
57
|
-
// flex-wrap
|
|
58
|
-
each(@flex-wrap-values, .(@value, @key) {
|
|
59
|
-
&-wrap-@{key} {
|
|
60
|
-
flex-wrap: @value;
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// align-items
|
|
65
|
-
each(@align-items-values, .(@value, @key) {
|
|
66
|
-
&-align-@{key} {
|
|
67
|
-
align-items: @value;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// justify-content
|
|
72
|
-
each(@justify-content-values, .(@value, @key) {
|
|
73
|
-
&-justify-@{key} {
|
|
74
|
-
justify-content: @value;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
1
|
+
@import '../../style/themes/index.less';
|
|
2
|
+
|
|
3
|
+
@flex-prefix-cls: ~'@{ant-prefix}-flex';
|
|
4
|
+
|
|
5
|
+
// 属性与值的映射
|
|
6
|
+
@align-items-values: {
|
|
7
|
+
stretch: stretch;
|
|
8
|
+
flex-start: flex-start;
|
|
9
|
+
center: center;
|
|
10
|
+
flex-end: flex-end;
|
|
11
|
+
baseline: baseline;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
@justify-content-values: {
|
|
15
|
+
flex-start: flex-start;
|
|
16
|
+
center: center;
|
|
17
|
+
flex-end: flex-end;
|
|
18
|
+
space-between: space-between;
|
|
19
|
+
space-around: space-around;
|
|
20
|
+
space-evenly: space-evenly;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
@flex-wrap-values: {
|
|
24
|
+
nowrap: nowrap;
|
|
25
|
+
wrap: wrap;
|
|
26
|
+
wrap-reverse: wrap-reverse;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
.@{flex-prefix-cls} {
|
|
30
|
+
display: flex;
|
|
31
|
+
margin: 0;
|
|
32
|
+
padding: 0;
|
|
33
|
+
|
|
34
|
+
// 方向
|
|
35
|
+
&-vertical {
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
}
|
|
38
|
+
&-rtl {
|
|
39
|
+
direction: rtl;
|
|
40
|
+
}
|
|
41
|
+
&:empty {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 间距 (Gap)
|
|
46
|
+
&-gap-small {
|
|
47
|
+
gap: @padding-xs;
|
|
48
|
+
}
|
|
49
|
+
&-gap-middle {
|
|
50
|
+
gap: @padding-md;
|
|
51
|
+
}
|
|
52
|
+
&-gap-large {
|
|
53
|
+
gap: @padding-lg;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 使用 Loops/Each 抽象重复代码
|
|
57
|
+
// flex-wrap
|
|
58
|
+
each(@flex-wrap-values, .(@value, @key) {
|
|
59
|
+
&-wrap-@{key} {
|
|
60
|
+
flex-wrap: @value;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// align-items
|
|
65
|
+
each(@align-items-values, .(@value, @key) {
|
|
66
|
+
&-align-@{key} {
|
|
67
|
+
align-items: @value;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// justify-content
|
|
72
|
+
each(@justify-content-values, .(@value, @key) {
|
|
73
|
+
&-justify-@{key} {
|
|
74
|
+
justify-content: @value;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
77
|
}
|
package/lib/flex/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { FlexProps } from './interface';
|
|
3
|
-
export declare const flexWrapValues: React.CSSProperties['flexWrap'][];
|
|
4
|
-
export declare const justifyContentValues: React.CSSProperties['justifyContent'][];
|
|
5
|
-
export declare const alignItemsValues: React.CSSProperties['alignItems'][];
|
|
6
|
-
declare const createFlexClassNames: (prefixCls: string, props: FlexProps) => string;
|
|
7
|
-
export default createFlexClassNames;
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { FlexProps } from './interface';
|
|
3
|
+
export declare const flexWrapValues: React.CSSProperties['flexWrap'][];
|
|
4
|
+
export declare const justifyContentValues: React.CSSProperties['justifyContent'][];
|
|
5
|
+
export declare const alignItemsValues: React.CSSProperties['alignItems'][];
|
|
6
|
+
declare const createFlexClassNames: (prefixCls: string, props: FlexProps) => string;
|
|
7
|
+
export default createFlexClassNames;
|
package/lib/flex/utils.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.justifyContentValues = exports.flexWrapValues = exports.default = exports.alignItemsValues = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
9
|
const flexWrapValues = exports.flexWrapValues = ['wrap', 'nowrap', 'wrap-reverse'];
|
|
10
10
|
const justifyContentValues = exports.justifyContentValues = ['flex-start', 'flex-end', 'start', 'end', 'center', 'space-between', 'space-around', 'space-evenly', 'stretch', 'normal', 'left', 'right'];
|
|
@@ -31,7 +31,7 @@ const genClsJustify = (prefixCls, props) => {
|
|
|
31
31
|
return justifyCls;
|
|
32
32
|
};
|
|
33
33
|
const createFlexClassNames = (prefixCls, props) => {
|
|
34
|
-
return (0,
|
|
34
|
+
return (0, _clsx.default)({
|
|
35
35
|
...genClsWrap(prefixCls, props),
|
|
36
36
|
...genClsAlign(prefixCls, props),
|
|
37
37
|
...genClsJustify(prefixCls, props)
|
package/lib/formList/index.d.ts
CHANGED
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import '
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
* -
|
|
30
|
-
* - and
|
|
31
|
-
* - and
|
|
32
|
-
* - and
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
export {};
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { FormListFieldData, TableProps } from 'antd';
|
|
4
|
+
import type { FormItemProps, FormListProps, RuleObject, RuleRender } from 'antd/lib/form';
|
|
5
|
+
import type { ColumnType as TableColumnType } from 'antd/lib/table';
|
|
6
|
+
import './style';
|
|
7
|
+
type NotNullRowSelection = NonNullable<TableProps<any>['rowSelection']>;
|
|
8
|
+
/**
|
|
9
|
+
* Override NamePath parameters type
|
|
10
|
+
*/
|
|
11
|
+
type OverrideParameters = (string | number)[];
|
|
12
|
+
type RcFormInstance = Parameters<RuleRender>[0];
|
|
13
|
+
type RawPanelRender = NonNullable<TableProps<any>['footer']>;
|
|
14
|
+
/**
|
|
15
|
+
* Override PanelRender type
|
|
16
|
+
*/
|
|
17
|
+
type PanelRenderFunc = (...args: Parameters<FormListProps['children']>) => ReturnType<RawPanelRender>;
|
|
18
|
+
/**
|
|
19
|
+
* Form.Table 组件类型
|
|
20
|
+
*/
|
|
21
|
+
export interface IFormTableProps
|
|
22
|
+
/**
|
|
23
|
+
* Support all FormListProps except children for which is re-defined in this component
|
|
24
|
+
* and prefixCls for which is not expected to be supported
|
|
25
|
+
*/
|
|
26
|
+
extends Pick<FormListProps, 'name' | 'rules' | 'initialValue'>,
|
|
27
|
+
/**
|
|
28
|
+
* Support all TableProps except
|
|
29
|
+
* - re-define columns and re-defined rowSelection
|
|
30
|
+
* - and pagination which is expect to be not supported in Form.Table
|
|
31
|
+
* - and className which is renamed to tableClassName
|
|
32
|
+
* - and rowKey, dataSource for which are defined and not allowed to be modified
|
|
33
|
+
* - and footer, title, summary for which are re-defined to pass form's operation
|
|
34
|
+
*/
|
|
35
|
+
Omit<TableProps<any>, 'columns' | 'rowSelection' | 'pagination' | 'className' | 'rowKey' | 'dataSource' | 'footer' | 'title' | 'summary'> {
|
|
36
|
+
/**
|
|
37
|
+
* 表格列的配置描述
|
|
38
|
+
*/
|
|
39
|
+
columns?: ColumnType[] | ((...args: Parameters<FormListProps['children']>) => ColumnType[]);
|
|
40
|
+
/**
|
|
41
|
+
* Table 的 className
|
|
42
|
+
*/
|
|
43
|
+
tableClassName?: TableProps<any>['className'];
|
|
44
|
+
/**
|
|
45
|
+
* 表格行是否可选择
|
|
46
|
+
*/
|
|
47
|
+
rowSelection?: Omit<NotNullRowSelection, 'getCheckboxProps'> & {
|
|
48
|
+
getCheckboxProps?: (field: FormListFieldData) => ReturnType<NonNullable<NotNullRowSelection['getCheckboxProps']>>;
|
|
49
|
+
};
|
|
50
|
+
title?: PanelRenderFunc;
|
|
51
|
+
footer?: PanelRenderFunc;
|
|
52
|
+
summary?: PanelRenderFunc;
|
|
53
|
+
}
|
|
54
|
+
export interface ColumnType
|
|
55
|
+
/**
|
|
56
|
+
* Support all FormItemProps, and re-defined `rules` and `dependencies`
|
|
57
|
+
*/
|
|
58
|
+
extends Omit<FormItemProps, 'rules' | 'dependencies' | 'prefixCls' | 'children'>,
|
|
59
|
+
/**
|
|
60
|
+
* Support all TableColumnType, and re-defined `render`
|
|
61
|
+
*/
|
|
62
|
+
Omit<TableColumnType<FormListFieldData>, 'render'> {
|
|
63
|
+
/**
|
|
64
|
+
* 设置依赖字段, 支持通过回调函数获取当前字段名
|
|
65
|
+
*/
|
|
66
|
+
dependencies?: ((namePath: OverrideParameters) => FormItemProps['dependencies']) | FormItemProps['dependencies'];
|
|
67
|
+
/**
|
|
68
|
+
* 校验规则,设置字段的校验逻辑,支持通过回调函数获取当前字段名
|
|
69
|
+
*/
|
|
70
|
+
rules?: (RuleObject | ((form: RcFormInstance, namePath: OverrideParameters) => RuleObject))[];
|
|
71
|
+
/**
|
|
72
|
+
* 渲染函数
|
|
73
|
+
* @param formInstance 只有在设置了 `dependencies` 的情况下才有该参数
|
|
74
|
+
*/
|
|
75
|
+
render?: (fieldData: FormListFieldData, namePath: OverrideParameters, formInstance?: RcFormInstance) => ReactNode;
|
|
76
|
+
}
|
|
77
|
+
export default function InternalTable({ name, rules, initialValue, ...tableProps }: IFormTableProps): React.JSX.Element;
|
|
78
|
+
export {};
|
package/lib/formList/index.js
CHANGED
|
@@ -8,22 +8,22 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _dtUtils = require("@dtinsight/dt-utils");
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _configProvider = require("antd/es/config-provider");
|
|
11
|
-
var
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
12
|
require("./style");
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
-
/**
|
|
18
|
-
* Override NamePath parameters type
|
|
17
|
+
/**
|
|
18
|
+
* Override NamePath parameters type
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* Override PanelRender type
|
|
21
|
+
/**
|
|
22
|
+
* Override PanelRender type
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* Form.Table 组件类型
|
|
25
|
+
/**
|
|
26
|
+
* Form.Table 组件类型
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
function InternalTable({
|
|
@@ -86,9 +86,9 @@ function InternalTable({
|
|
|
86
86
|
const isRequired = required || rawRules?.some(rule => typeof rule === 'object' && rule.required);
|
|
87
87
|
return {
|
|
88
88
|
...cols,
|
|
89
|
-
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isRequired && /*#__PURE__*/_react.default.createElement("span", {
|
|
89
|
+
title: (...titleProps) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isRequired && /*#__PURE__*/_react.default.createElement("span", {
|
|
90
90
|
className: "dtc-form__table__column--required"
|
|
91
|
-
}), cols.title),
|
|
91
|
+
}), typeof cols.title === 'function' ? cols.title(...titleProps) : cols.title),
|
|
92
92
|
render(_, fieldData) {
|
|
93
93
|
const currentNamePath = [fieldData.name, cols.dataIndex].filter(_dtUtils.Utils.checkExist).flat();
|
|
94
94
|
const rules = rawRules?.map(rule => typeof rule === 'function' ? form => rule(form, currentNamePath) : rule);
|
|
@@ -118,7 +118,7 @@ function InternalTable({
|
|
|
118
118
|
rules: rules,
|
|
119
119
|
initialValue: initialValue
|
|
120
120
|
}, (fields, ope, meta) => /*#__PURE__*/_react.default.createElement(_antd.Table, _extends({
|
|
121
|
-
className: (0,
|
|
121
|
+
className: (0, _clsx.default)(prefixCls, tableClassName),
|
|
122
122
|
rowKey: "key",
|
|
123
123
|
dataSource: fields,
|
|
124
124
|
pagination: false,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../style/index.less';
|
|
2
|
-
import './index.less';
|
|
1
|
+
import '../../style/index.less';
|
|
2
|
+
import './index.less';
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
@import '../../style/themes/index.less';
|
|
2
|
-
|
|
3
|
-
@form-list-prefix-cls: ~'@{ant-prefix}-form-list';
|
|
4
|
-
|
|
5
|
-
.@{form-list-prefix-cls} {
|
|
6
|
-
height: 100%;
|
|
7
|
-
|
|
8
|
-
&__column {
|
|
9
|
-
&--required {
|
|
10
|
-
&::before {
|
|
11
|
-
content: "*";
|
|
12
|
-
display: inline-block;
|
|
13
|
-
margin-inline-end: 4px;
|
|
14
|
-
font-size: 14px;
|
|
15
|
-
line-height: 1;
|
|
16
|
-
color: @error-color;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
vertical-align: -0.1em;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.ant-table,
|
|
24
|
-
.ant-table-container {
|
|
25
|
-
height: 100%;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.ant-form-item {
|
|
29
|
-
margin-bottom: 0;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
table colgroup > col.ant-table-selection-col {
|
|
33
|
-
width: 48px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.ant-table-thead > tr > th.ant-table-selection-column {
|
|
37
|
-
padding: 0 16px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.ant-table-tbody > tr > td.ant-table-selection-column {
|
|
41
|
-
padding: 0 16px;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
@import '../../style/themes/index.less';
|
|
2
|
+
|
|
3
|
+
@form-list-prefix-cls: ~'@{ant-prefix}-form-list';
|
|
4
|
+
|
|
5
|
+
.@{form-list-prefix-cls} {
|
|
6
|
+
height: 100%;
|
|
7
|
+
|
|
8
|
+
&__column {
|
|
9
|
+
&--required {
|
|
10
|
+
&::before {
|
|
11
|
+
content: "*";
|
|
12
|
+
display: inline-block;
|
|
13
|
+
margin-inline-end: 4px;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
line-height: 1;
|
|
16
|
+
color: @error-color;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
vertical-align: -0.1em;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ant-table,
|
|
24
|
+
.ant-table-container {
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ant-form-item {
|
|
29
|
+
margin-bottom: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
table colgroup > col.ant-table-selection-col {
|
|
33
|
+
width: 48px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ant-table-thead > tr > th.ant-table-selection-column {
|
|
37
|
+
padding: 0 16px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ant-table-tbody > tr > td.ant-table-selection-column {
|
|
41
|
+
padding: 0 16px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
package/lib/index.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
export { default as BlockHeader } from './blockHeader';
|
|
2
|
-
export type { ButtonProps } from './button';
|
|
3
|
-
export { default as Button } from './button';
|
|
4
|
-
export { default as Collapsible } from './collapsible';
|
|
5
|
-
export { default as CollapsibleActionItems } from './collapsibleActionItems';
|
|
6
|
-
export { default as Flex } from './flex';
|
|
7
|
-
export type { FlexProps } from './flex/interface';
|
|
8
|
-
export { default as FormList } from './formList';
|
|
9
|
-
export * from './formList';
|
|
10
|
-
export { default as OverflowList } from './overflowList';
|
|
11
|
-
export { default as Resize } from './resize';
|
|
12
|
-
export { default as Splitter } from './splitter';
|
|
13
|
-
export * from './splitter';
|
|
14
|
-
export { default as StatusTag } from './statusTag';
|
|
1
|
+
export { default as BlockHeader } from './blockHeader';
|
|
2
|
+
export type { ButtonProps } from './button';
|
|
3
|
+
export { default as Button } from './button';
|
|
4
|
+
export { default as Collapsible } from './collapsible';
|
|
5
|
+
export { default as CollapsibleActionItems } from './collapsibleActionItems';
|
|
6
|
+
export { default as Flex } from './flex';
|
|
7
|
+
export type { FlexProps } from './flex/interface';
|
|
8
|
+
export { default as FormList } from './formList';
|
|
9
|
+
export * from './formList';
|
|
10
|
+
export { default as OverflowList } from './overflowList';
|
|
11
|
+
export { default as Resize } from './resize';
|
|
12
|
+
export { default as Splitter } from './splitter';
|
|
13
|
+
export * from './splitter';
|
|
14
|
+
export { default as StatusTag } from './statusTag';
|
|
15
|
+
export * from './statusTag';
|
|
16
|
+
export { default as Table } from './table';
|
|
17
|
+
export type { ColumnGroupType as TableColumnGroupType, ColumnProps as TableColumnProps, ColumnsType as TableColumnsType, ColumnType as TableColumnType, TablePaginationConfig, TableProps, } from './table';
|
package/lib/index.js
CHANGED
|
@@ -13,7 +13,8 @@ var _exportNames = {
|
|
|
13
13
|
OverflowList: true,
|
|
14
14
|
Resize: true,
|
|
15
15
|
Splitter: true,
|
|
16
|
-
StatusTag: true
|
|
16
|
+
StatusTag: true,
|
|
17
|
+
Table: true
|
|
17
18
|
};
|
|
18
19
|
Object.defineProperty(exports, "BlockHeader", {
|
|
19
20
|
enumerable: true,
|
|
@@ -75,6 +76,12 @@ Object.defineProperty(exports, "StatusTag", {
|
|
|
75
76
|
return _statusTag.default;
|
|
76
77
|
}
|
|
77
78
|
});
|
|
79
|
+
Object.defineProperty(exports, "Table", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function () {
|
|
82
|
+
return _table.default;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
78
85
|
var _blockHeader = _interopRequireDefault(require("./blockHeader"));
|
|
79
86
|
var _button = _interopRequireDefault(require("./button"));
|
|
80
87
|
var _collapsible = _interopRequireDefault(require("./collapsible"));
|
|
@@ -106,7 +113,19 @@ Object.keys(_splitter).forEach(function (key) {
|
|
|
106
113
|
}
|
|
107
114
|
});
|
|
108
115
|
});
|
|
109
|
-
var _statusTag =
|
|
116
|
+
var _statusTag = _interopRequireWildcard(require("./statusTag"));
|
|
117
|
+
Object.keys(_statusTag).forEach(function (key) {
|
|
118
|
+
if (key === "default" || key === "__esModule") return;
|
|
119
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
120
|
+
if (key in exports && exports[key] === _statusTag[key]) return;
|
|
121
|
+
Object.defineProperty(exports, key, {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function () {
|
|
124
|
+
return _statusTag[key];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
var _table = _interopRequireDefault(require("./table"));
|
|
110
129
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
111
130
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
112
131
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
private
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
private
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import './style';
|
|
4
|
+
export type OverflowItem<T = Record<string, any>> = T;
|
|
5
|
+
export interface OverflowListProps<T = Record<string, any>> {
|
|
6
|
+
items: OverflowItem<T>[];
|
|
7
|
+
visibleItemRenderer: (item: OverflowItem<T>, index: number) => ReactElement;
|
|
8
|
+
overflowRenderer: (overflowItems: OverflowItem<T>[]) => ReactNode | ReactNode[];
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
renderMode?: 'collapse' | 'scroll';
|
|
12
|
+
collapseFrom?: 'start' | 'end';
|
|
13
|
+
minVisibleItems?: number;
|
|
14
|
+
onOverflow?: (overflowItems: OverflowItem<T>[]) => void;
|
|
15
|
+
}
|
|
16
|
+
interface OverflowListState {
|
|
17
|
+
visibleCount: number;
|
|
18
|
+
isMeasuring: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare class OverflowList<T extends object> extends Component<OverflowListProps<T>, OverflowListState> {
|
|
21
|
+
static defaultProps: {
|
|
22
|
+
items: never[];
|
|
23
|
+
collapseFrom: string;
|
|
24
|
+
minVisibleItems: number;
|
|
25
|
+
renderMode: string;
|
|
26
|
+
};
|
|
27
|
+
static displayName: string;
|
|
28
|
+
private containerRef;
|
|
29
|
+
private overflowRef;
|
|
30
|
+
private itemRefs;
|
|
31
|
+
private prefixCls;
|
|
32
|
+
constructor(props: OverflowListProps<T>);
|
|
33
|
+
componentDidMount(): void;
|
|
34
|
+
componentUpdate(prevProps: OverflowListProps<T>): void;
|
|
35
|
+
private measureAndAdjust;
|
|
36
|
+
private getOverflowItems;
|
|
37
|
+
renderCollapse(): React.JSX.Element;
|
|
38
|
+
render(): React.JSX.Element;
|
|
39
|
+
}
|
|
40
|
+
export default OverflowList;
|