@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
package/esm/collapsible/index.js
CHANGED
|
@@ -16,28 +16,70 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
18
|
import React from 'react';
|
|
19
|
-
import { globalConfig } from 'antd/es/config-provider';
|
|
20
|
-
import classNames from 'classnames';
|
|
21
19
|
import { isEqual, pick } from 'lodash-es';
|
|
22
20
|
import "./style";
|
|
21
|
+
import { ConfigConsumer } from 'antd/lib/config-provider/context';
|
|
22
|
+
import clsx from 'clsx';
|
|
23
23
|
var Collapsible = /*#__PURE__*/function (_React$Component) {
|
|
24
24
|
_inherits(Collapsible, _React$Component);
|
|
25
25
|
var _super = _createSuper(Collapsible);
|
|
26
|
-
// public cssClasses = {
|
|
27
|
-
// PREFIX: 'ant-collapsible',
|
|
28
|
-
// TRANSITION: 'ant-collapsible-transition',
|
|
29
|
-
// WRAPPER: 'ant-collapsible-wrapper',
|
|
30
|
-
// };
|
|
31
|
-
|
|
32
26
|
function Collapsible(_props) {
|
|
33
27
|
var _this;
|
|
34
28
|
_classCallCheck(this, Collapsible);
|
|
35
29
|
_this = _super.call(this, _props);
|
|
36
|
-
_defineProperty(_assertThisInitialized(_this), "prefixCls", 'collapsible');
|
|
37
30
|
_defineProperty(_assertThisInitialized(_this), "foundation", void 0);
|
|
38
31
|
_defineProperty(_assertThisInitialized(_this), "domRef", /*#__PURE__*/React.createRef());
|
|
39
32
|
_defineProperty(_assertThisInitialized(_this), "resizeObserver", null);
|
|
40
33
|
_defineProperty(_assertThisInitialized(_this), "hasBeenRendered", false);
|
|
34
|
+
_defineProperty(_assertThisInitialized(_this), "renderCollapsible", function (_ref) {
|
|
35
|
+
var getPrefixCls = _ref.getPrefixCls;
|
|
36
|
+
var _this$props = _this.props,
|
|
37
|
+
isOpen = _this$props.isOpen,
|
|
38
|
+
collapseHeight = _this$props.collapseHeight,
|
|
39
|
+
fade = _this$props.fade,
|
|
40
|
+
motion = _this$props.motion,
|
|
41
|
+
duration = _this$props.duration,
|
|
42
|
+
style = _this$props.style,
|
|
43
|
+
className = _this$props.className,
|
|
44
|
+
id = _this$props.id,
|
|
45
|
+
keepDOM = _this$props.keepDOM,
|
|
46
|
+
lazyRender = _this$props.lazyRender,
|
|
47
|
+
onMotionEnd = _this$props.onMotionEnd,
|
|
48
|
+
customizePrefixCls = _this$props.prefixCls;
|
|
49
|
+
var _this$state = _this.state,
|
|
50
|
+
domHeight = _this$state.domHeight,
|
|
51
|
+
isTransitioning = _this$state.isTransitioning,
|
|
52
|
+
visible = _this$state.visible;
|
|
53
|
+
var prefixCls = getPrefixCls('splitter', customizePrefixCls);
|
|
54
|
+
var wrapperStyle = _objectSpread({
|
|
55
|
+
overflow: 'hidden',
|
|
56
|
+
height: isOpen ? domHeight : collapseHeight,
|
|
57
|
+
opacity: isOpen || !fade || collapseHeight !== 0 ? 1 : 0,
|
|
58
|
+
transitionDuration: "".concat(motion && isTransitioning ? duration : 0, "ms")
|
|
59
|
+
}, style);
|
|
60
|
+
var wrapperCls = clsx("".concat(prefixCls, "-wrapper"), _defineProperty({}, "".concat(prefixCls, "-transition"), motion && isTransitioning), className);
|
|
61
|
+
var shouldRender = keepDOM && (lazyRender ? _this.hasBeenRendered : true) || collapseHeight !== 0 || visible || isOpen;
|
|
62
|
+
if (shouldRender && !_this.hasBeenRendered) {
|
|
63
|
+
_this.hasBeenRendered = true;
|
|
64
|
+
}
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
66
|
+
className: wrapperCls,
|
|
67
|
+
style: wrapperStyle,
|
|
68
|
+
onTransitionEnd: function onTransitionEnd() {
|
|
69
|
+
if (!isOpen) {
|
|
70
|
+
_this.foundation.updateVisible(false);
|
|
71
|
+
}
|
|
72
|
+
_this.foundation.updateIsTransitioning(false);
|
|
73
|
+
onMotionEnd === null || onMotionEnd === void 0 || onMotionEnd();
|
|
74
|
+
}
|
|
75
|
+
}, _this.getDataAttr(_this.props)), /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
ref: _this.domRef,
|
|
77
|
+
style: {
|
|
78
|
+
overflow: 'hidden'
|
|
79
|
+
},
|
|
80
|
+
id: id
|
|
81
|
+
}, shouldRender && _this.props.children));
|
|
82
|
+
});
|
|
41
83
|
_defineProperty(_assertThisInitialized(_this), "handleResize", function (entryList) {
|
|
42
84
|
var entry = entryList[0];
|
|
43
85
|
if (entry) {
|
|
@@ -68,7 +110,6 @@ var Collapsible = /*#__PURE__*/function (_React$Component) {
|
|
|
68
110
|
isTransitioning: false,
|
|
69
111
|
cacheIsOpen: _this.props.isOpen || false
|
|
70
112
|
};
|
|
71
|
-
_this.prefixCls = "".concat(globalConfig().getPrefixCls(_this.prefixCls));
|
|
72
113
|
_this.foundation = {
|
|
73
114
|
updateDOMInRenderTree: function updateDOMInRenderTree(val) {
|
|
74
115
|
return _this.setState({
|
|
@@ -96,6 +137,7 @@ var Collapsible = /*#__PURE__*/function (_React$Component) {
|
|
|
96
137
|
_createClass(Collapsible, [{
|
|
97
138
|
key: "componentDidMount",
|
|
98
139
|
value: function componentDidMount() {
|
|
140
|
+
// eslint-disable-next-line compat/compat
|
|
99
141
|
this.resizeObserver = new ResizeObserver(this.handleResize);
|
|
100
142
|
if (this.domRef.current) {
|
|
101
143
|
this.resizeObserver.observe(this.domRef.current);
|
|
@@ -134,51 +176,7 @@ var Collapsible = /*#__PURE__*/function (_React$Component) {
|
|
|
134
176
|
}, {
|
|
135
177
|
key: "render",
|
|
136
178
|
value: function render() {
|
|
137
|
-
|
|
138
|
-
var _this$props = this.props,
|
|
139
|
-
isOpen = _this$props.isOpen,
|
|
140
|
-
collapseHeight = _this$props.collapseHeight,
|
|
141
|
-
fade = _this$props.fade,
|
|
142
|
-
motion = _this$props.motion,
|
|
143
|
-
duration = _this$props.duration,
|
|
144
|
-
style = _this$props.style,
|
|
145
|
-
className = _this$props.className,
|
|
146
|
-
id = _this$props.id,
|
|
147
|
-
keepDOM = _this$props.keepDOM,
|
|
148
|
-
lazyRender = _this$props.lazyRender,
|
|
149
|
-
onMotionEnd = _this$props.onMotionEnd;
|
|
150
|
-
var _this$state = this.state,
|
|
151
|
-
domHeight = _this$state.domHeight,
|
|
152
|
-
isTransitioning = _this$state.isTransitioning,
|
|
153
|
-
visible = _this$state.visible;
|
|
154
|
-
var wrapperStyle = _objectSpread({
|
|
155
|
-
overflow: 'hidden',
|
|
156
|
-
height: isOpen ? domHeight : collapseHeight,
|
|
157
|
-
opacity: isOpen || !fade || collapseHeight !== 0 ? 1 : 0,
|
|
158
|
-
transitionDuration: "".concat(motion && isTransitioning ? duration : 0, "ms")
|
|
159
|
-
}, style);
|
|
160
|
-
var wrapperCls = classNames("".concat(this.prefixCls, "-wrapper"), _defineProperty({}, "".concat(this.prefixCls, "-transition"), motion && isTransitioning), className);
|
|
161
|
-
var shouldRender = keepDOM && (lazyRender ? this.hasBeenRendered : true) || collapseHeight !== 0 || visible || isOpen;
|
|
162
|
-
if (shouldRender && !this.hasBeenRendered) {
|
|
163
|
-
this.hasBeenRendered = true;
|
|
164
|
-
}
|
|
165
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
166
|
-
className: wrapperCls,
|
|
167
|
-
style: wrapperStyle,
|
|
168
|
-
onTransitionEnd: function onTransitionEnd() {
|
|
169
|
-
if (!isOpen) {
|
|
170
|
-
_this3.foundation.updateVisible(false);
|
|
171
|
-
}
|
|
172
|
-
_this3.foundation.updateIsTransitioning(false);
|
|
173
|
-
onMotionEnd === null || onMotionEnd === void 0 || onMotionEnd();
|
|
174
|
-
}
|
|
175
|
-
}, this.getDataAttr(this.props)), /*#__PURE__*/React.createElement("div", {
|
|
176
|
-
ref: this.domRef,
|
|
177
|
-
style: {
|
|
178
|
-
overflow: 'hidden'
|
|
179
|
-
},
|
|
180
|
-
id: id
|
|
181
|
-
}, shouldRender && this.props.children));
|
|
179
|
+
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderCollapsible);
|
|
182
180
|
}
|
|
183
181
|
}], [{
|
|
184
182
|
key: "getDerivedStateFromProps",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import './index.less';
|
|
1
|
+
import './index.less';
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { ButtonProps } from "..";
|
|
4
|
-
import type { DropDownProps } from 'antd';
|
|
5
|
-
import './style';
|
|
6
|
-
export
|
|
7
|
-
key: React.Key;
|
|
8
|
-
name: ReactNode;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
render?: () => ReactNode;
|
|
11
|
-
};
|
|
12
|
-
interface ICollapsibleActionItems {
|
|
13
|
-
maxCount?: number;
|
|
14
|
-
actionItems: ActionItem[];
|
|
15
|
-
className?: string;
|
|
16
|
-
divider?: ReactNode;
|
|
17
|
-
collapseIcon?: ReactNode;
|
|
18
|
-
dropdownProps?: Partial<DropDownProps>;
|
|
19
|
-
buttonProps?: Partial<ButtonProps>;
|
|
20
|
-
style?: React.CSSProperties;
|
|
21
|
-
onItemClick?: (key: React.Key) => void;
|
|
22
|
-
}
|
|
23
|
-
declare const CollapsibleActionItems: React.FC<ICollapsibleActionItems>;
|
|
24
|
-
export default CollapsibleActionItems;
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ButtonProps } from "..";
|
|
4
|
+
import type { DropDownProps } from 'antd';
|
|
5
|
+
import './style';
|
|
6
|
+
export type ActionItem = {
|
|
7
|
+
key: React.Key;
|
|
8
|
+
name: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
render?: () => ReactNode;
|
|
11
|
+
};
|
|
12
|
+
interface ICollapsibleActionItems {
|
|
13
|
+
maxCount?: number;
|
|
14
|
+
actionItems: ActionItem[];
|
|
15
|
+
className?: string;
|
|
16
|
+
divider?: ReactNode;
|
|
17
|
+
collapseIcon?: ReactNode;
|
|
18
|
+
dropdownProps?: Partial<DropDownProps>;
|
|
19
|
+
buttonProps?: Partial<ButtonProps>;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
onItemClick?: (key: React.Key) => void;
|
|
22
|
+
}
|
|
23
|
+
declare const CollapsibleActionItems: React.FC<ICollapsibleActionItems>;
|
|
24
|
+
export default CollapsibleActionItems;
|
|
@@ -4,8 +4,8 @@ import { EllipsisOutlined } from '@ant-design/icons';
|
|
|
4
4
|
import { Button } from "./..";
|
|
5
5
|
import { Divider, Dropdown, Menu } from 'antd';
|
|
6
6
|
import { globalConfig } from 'antd/es/config-provider';
|
|
7
|
-
import classNames from 'classnames';
|
|
8
7
|
import "./style";
|
|
8
|
+
import clsx from 'clsx';
|
|
9
9
|
var CollapsibleActionItems = function CollapsibleActionItems(props) {
|
|
10
10
|
var actionItems = props.actionItems,
|
|
11
11
|
_props$maxCount = props.maxCount,
|
|
@@ -53,7 +53,7 @@ var CollapsibleActionItems = function CollapsibleActionItems(props) {
|
|
|
53
53
|
return getActionItemNode(item, true);
|
|
54
54
|
})) : null;
|
|
55
55
|
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className:
|
|
56
|
+
className: clsx(prefixCls, className),
|
|
57
57
|
style: style
|
|
58
58
|
}, displayAction.map(function (actionItem, index) {
|
|
59
59
|
var showDivider = index < actionItems.length - 1;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../style/index.less';
|
|
2
|
-
import './index.less';
|
|
1
|
+
import '../../style/index.less';
|
|
2
|
+
import './index.less';
|
package/esm/flex/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './style';
|
|
3
|
-
import type { FlexProps } from './interface';
|
|
4
|
-
declare const Flex: React.ForwardRefExoticComponent<FlexProps<import("../_util/type").AnyObject> & {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
} & React.RefAttributes<HTMLElement>>;
|
|
7
|
-
export default Flex;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
import type { FlexProps } from './interface';
|
|
4
|
+
declare const Flex: React.ForwardRefExoticComponent<FlexProps<import("../_util/type").AnyObject> & {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
export default Flex;
|
package/esm/flex/index.js
CHANGED
|
@@ -16,7 +16,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
16
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import { ConfigContext, globalConfig } from 'antd/es/config-provider';
|
|
19
|
-
import clsx from '
|
|
19
|
+
import clsx from 'clsx';
|
|
20
20
|
import { omit } from 'lodash-es';
|
|
21
21
|
import "./style";
|
|
22
22
|
import { isPresetSize } from "../_util/gapSize";
|
package/esm/flex/interface.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { SizeType } from 'antd/
|
|
3
|
-
import type { Orientation } from '../_util/hooks';
|
|
4
|
-
import type { AnyObject, CustomComponent, LiteralUnion } from '../_util/type';
|
|
5
|
-
export interface FlexProps<P = AnyObject> extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
-
prefixCls?: string;
|
|
7
|
-
rootClassName?: string;
|
|
8
|
-
vertical?: boolean;
|
|
9
|
-
orientation?: Orientation;
|
|
10
|
-
wrap?: boolean | React.CSSProperties['flexWrap'];
|
|
11
|
-
justify?: React.CSSProperties['justifyContent'];
|
|
12
|
-
align?: React.CSSProperties['alignItems'];
|
|
13
|
-
flex?: React.CSSProperties['flex'];
|
|
14
|
-
gap?: LiteralUnion<SizeType, React.CSSProperties['gap']>;
|
|
15
|
-
component?: CustomComponent<P>;
|
|
16
|
-
}
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
3
|
+
import type { Orientation } from '../_util/hooks';
|
|
4
|
+
import type { AnyObject, CustomComponent, LiteralUnion } from '../_util/type';
|
|
5
|
+
export interface FlexProps<P = AnyObject> extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
+
prefixCls?: string;
|
|
7
|
+
rootClassName?: string;
|
|
8
|
+
vertical?: boolean;
|
|
9
|
+
orientation?: Orientation;
|
|
10
|
+
wrap?: boolean | React.CSSProperties['flexWrap'];
|
|
11
|
+
justify?: React.CSSProperties['justifyContent'];
|
|
12
|
+
align?: React.CSSProperties['alignItems'];
|
|
13
|
+
flex?: React.CSSProperties['flex'];
|
|
14
|
+
gap?: LiteralUnion<SizeType, React.CSSProperties['gap']>;
|
|
15
|
+
component?: CustomComponent<P>;
|
|
16
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../style/index.less';
|
|
2
|
-
import './index.less';
|
|
1
|
+
import '../../style/index.less';
|
|
2
|
+
import './index.less';
|
|
@@ -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/esm/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/esm/flex/utils.js
CHANGED
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
import clsx from '
|
|
7
|
+
import clsx from 'clsx';
|
|
8
8
|
export var flexWrapValues = ['wrap', 'nowrap', 'wrap-reverse'];
|
|
9
9
|
export var justifyContentValues = ['flex-start', 'flex-end', 'start', 'end', 'center', 'space-between', 'space-around', 'space-evenly', 'stretch', 'normal', 'left', 'right'];
|
|
10
10
|
export var alignItemsValues = ['center', 'start', 'end', 'flex-start', 'flex-end', 'self-start', 'self-end', 'baseline', 'normal', 'stretch'];
|
package/esm/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 {};
|