@dtjoy/dt-design 1.0.5 → 1.0.7
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.js +9 -0
- package/esm/_util/extendsObject.js +17 -0
- package/esm/_util/getScroll.js +32 -0
- package/esm/_util/hooks/index.js +4 -1
- package/esm/_util/hooks/useForceUpdate.js +6 -0
- package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
- package/esm/_util/hooks/useSyncState.js +20 -0
- package/esm/_util/scrollTo.js +38 -0
- package/esm/_util/warning.js +63 -0
- package/esm/blockHeader/index.js +10 -8
- package/esm/blockHeader/style/index.less +143 -143
- package/esm/button/index.js +7 -15
- package/esm/button/style/index.less +52 -127
- package/esm/button/style/mixin.less +34 -42
- package/esm/collapsible/index.js +53 -55
- package/esm/collapsibleActionItems/index.js +2 -2
- package/esm/flex/index.js +1 -1
- package/esm/flex/style/index.less +76 -76
- package/esm/flex/utils.js +1 -1
- package/esm/formList/index.js +13 -11
- package/esm/formList/style/index.less +45 -45
- package/esm/index.js +3 -1
- package/esm/overflowList/index.js +4 -3
- package/esm/resize/index.js +1 -1
- package/esm/resizeObserver/index.js +3 -2
- package/esm/splitter/Panel.js +3 -3
- package/esm/splitter/SplitBar.js +8 -7
- package/esm/splitter/Splitter.js +5 -4
- package/esm/splitter/hooks/useItems.js +2 -2
- package/esm/splitter/hooks/useResize.js +5 -5
- package/esm/statusTag/index.js +8 -8
- 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.js +429 -0
- package/esm/table/RcTable/VirtualTable.js +9 -0
- package/esm/table/RcTable/index.js +9 -0
- package/esm/table/Table.js +28 -0
- package/esm/table/TableMeasureRowContext.js +3 -0
- package/esm/table/hooks/useContainerWidth.js +14 -0
- package/esm/table/index.js +2 -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.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.js +33 -0
- package/lib/_util/easings.js +15 -0
- package/lib/_util/extendsObject.js +20 -0
- package/lib/_util/getScroll.js +39 -0
- package/lib/_util/hooks/index.js +33 -0
- package/lib/_util/hooks/useForceUpdate.js +12 -0
- package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
- package/lib/_util/hooks/useSyncState.js +19 -0
- package/lib/_util/scrollTo.js +44 -0
- package/lib/_util/warning.js +75 -0
- package/lib/blockHeader/index.js +10 -8
- package/lib/blockHeader/style/index.less +143 -143
- package/lib/button/index.js +6 -14
- package/lib/button/style/index.less +52 -127
- package/lib/button/style/mixin.less +34 -42
- package/lib/collapsible/index.js +49 -49
- package/lib/collapsibleActionItems/index.js +2 -2
- package/lib/flex/index.js +2 -2
- package/lib/flex/style/index.less +76 -76
- package/lib/flex/utils.js +2 -2
- package/lib/formList/index.js +10 -10
- package/lib/formList/style/index.less +45 -45
- package/lib/index.js +21 -2
- package/lib/overflowList/index.js +4 -3
- package/lib/resize/index.js +1 -1
- package/lib/resizeObserver/index.js +3 -2
- package/lib/splitter/Panel.js +3 -3
- package/lib/splitter/SplitBar.js +8 -7
- package/lib/splitter/Splitter.js +5 -4
- package/lib/splitter/hooks/useItems.js +2 -2
- package/lib/splitter/hooks/useResize.js +5 -5
- package/lib/statusTag/index.js +8 -8
- 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.js +395 -0
- package/lib/table/RcTable/VirtualTable.js +17 -0
- package/lib/table/RcTable/index.js +17 -0
- package/lib/table/Table.js +37 -0
- package/lib/table/TableMeasureRowContext.js +10 -0
- package/lib/table/hooks/useContainerWidth.js +20 -0
- package/lib/table/index.js +9 -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.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.js +44 -0
- package/package.json +82 -66
- package/esm/_util/gapSize.d.ts +0 -3
- package/esm/_util/hooks/index.d.ts +0 -1
- package/esm/_util/hooks/useOrientation.d.ts +0 -2
- package/esm/_util/index.d.ts +0 -3
- package/esm/_util/isNonNullable.d.ts +0 -2
- package/esm/_util/type.d.ts +0 -52
- package/esm/blockHeader/index.d.ts +0 -47
- package/esm/blockHeader/style/index.d.ts +0 -2
- package/esm/button/index.d.ts +0 -10
- package/esm/button/style/index.d.ts +0 -2
- package/esm/collapsible/index.d.ts +0 -97
- package/esm/collapsible/style/index.d.ts +0 -1
- package/esm/collapsibleActionItems/index.d.ts +0 -24
- package/esm/collapsibleActionItems/style/index.d.ts +0 -2
- package/esm/flex/index.d.ts +0 -7
- package/esm/flex/interface.d.ts +0 -16
- package/esm/flex/style/index.d.ts +0 -2
- package/esm/flex/utils.d.ts +0 -7
- package/esm/formList/index.d.ts +0 -77
- package/esm/formList/style/index.d.ts +0 -2
- package/esm/index.d.ts +0 -14
- package/esm/overflowList/index.d.ts +0 -39
- package/esm/overflowList/style/index.d.ts +0 -2
- package/esm/resize/index.d.ts +0 -8
- package/esm/resizeObserver/index.d.ts +0 -45
- package/esm/splitter/Panel.d.ts +0 -7
- package/esm/splitter/SplitBar.d.ts +0 -24
- package/esm/splitter/Splitter.d.ts +0 -5
- package/esm/splitter/hooks/sizeUtil.d.ts +0 -3
- package/esm/splitter/hooks/useItems.d.ts +0 -14
- package/esm/splitter/hooks/useResizable.d.ts +0 -10
- package/esm/splitter/hooks/useResize.d.ts +0 -6
- package/esm/splitter/hooks/useSizes.d.ts +0 -4
- package/esm/splitter/index.d.ts +0 -8
- package/esm/splitter/interface.d.ts +0 -69
- package/esm/splitter/style/index.d.ts +0 -2
- package/esm/statusTag/index.d.ts +0 -28
- package/esm/statusTag/style/index.d.ts +0 -2
- package/esm/style/index.d.ts +0 -1
- package/lib/_util/gapSize.d.ts +0 -3
- package/lib/_util/hooks/index.d.ts +0 -1
- package/lib/_util/hooks/useOrientation.d.ts +0 -2
- package/lib/_util/index.d.ts +0 -3
- package/lib/_util/isNonNullable.d.ts +0 -2
- package/lib/_util/type.d.ts +0 -52
- package/lib/blockHeader/index.d.ts +0 -47
- package/lib/blockHeader/style/index.d.ts +0 -2
- package/lib/button/index.d.ts +0 -10
- package/lib/button/style/index.d.ts +0 -2
- package/lib/collapsible/index.d.ts +0 -97
- package/lib/collapsible/style/index.d.ts +0 -1
- package/lib/collapsibleActionItems/index.d.ts +0 -24
- package/lib/collapsibleActionItems/style/index.d.ts +0 -2
- package/lib/flex/index.d.ts +0 -7
- package/lib/flex/interface.d.ts +0 -16
- package/lib/flex/style/index.d.ts +0 -2
- package/lib/flex/utils.d.ts +0 -7
- package/lib/formList/index.d.ts +0 -77
- package/lib/formList/style/index.d.ts +0 -2
- package/lib/index.d.ts +0 -14
- package/lib/overflowList/index.d.ts +0 -39
- package/lib/overflowList/style/index.d.ts +0 -2
- package/lib/resize/index.d.ts +0 -8
- package/lib/resizeObserver/index.d.ts +0 -45
- package/lib/splitter/Panel.d.ts +0 -7
- package/lib/splitter/SplitBar.d.ts +0 -24
- package/lib/splitter/Splitter.d.ts +0 -5
- package/lib/splitter/hooks/sizeUtil.d.ts +0 -3
- package/lib/splitter/hooks/useItems.d.ts +0 -14
- package/lib/splitter/hooks/useResizable.d.ts +0 -10
- package/lib/splitter/hooks/useResize.d.ts +0 -6
- package/lib/splitter/hooks/useSizes.d.ts +0 -4
- package/lib/splitter/index.d.ts +0 -8
- package/lib/splitter/interface.d.ts +0 -69
- package/lib/splitter/style/index.d.ts +0 -2
- package/lib/statusTag/index.d.ts +0 -28
- package/lib/statusTag/style/index.d.ts +0 -2
- package/lib/style/index.d.ts +0 -1
|
@@ -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/esm/index.js
CHANGED
|
@@ -9,4 +9,6 @@ export { default as OverflowList } from "./overflowList";
|
|
|
9
9
|
export { default as Resize } from "./resize";
|
|
10
10
|
export { default as Splitter } from "./splitter";
|
|
11
11
|
export * from "./splitter";
|
|
12
|
-
export { default as StatusTag } from "./statusTag";
|
|
12
|
+
export { default as StatusTag } from "./statusTag";
|
|
13
|
+
export * from "./statusTag";
|
|
14
|
+
export { default as Table } from "./table";
|
|
@@ -16,8 +16,9 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
16
16
|
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); }
|
|
17
17
|
import React, { Component, createRef } from 'react';
|
|
18
18
|
import { globalConfig } from 'antd/es/config-provider';
|
|
19
|
-
import classNames from 'classnames';
|
|
20
19
|
import "./style";
|
|
20
|
+
import clsx from 'clsx';
|
|
21
|
+
import { uniqueId } from 'lodash-es';
|
|
21
22
|
import ReactResizeObserver from "../resizeObserver";
|
|
22
23
|
var OverflowList = /*#__PURE__*/function (_Component) {
|
|
23
24
|
_inherits(OverflowList, _Component);
|
|
@@ -120,7 +121,7 @@ var OverflowList = /*#__PURE__*/function (_Component) {
|
|
|
120
121
|
var isVisible = isMeasuring || (collapseFrom === 'end' ? i < visibleCount : i >= items.length - visibleCount);
|
|
121
122
|
if (!isVisible) return null;
|
|
122
123
|
return /*#__PURE__*/React.createElement("div", {
|
|
123
|
-
key:
|
|
124
|
+
key: uniqueId('overflow-list-item'),
|
|
124
125
|
ref: function ref(el) {
|
|
125
126
|
if (el) _this2.itemRefs.set(i, el);else _this2.itemRefs.delete(i);
|
|
126
127
|
},
|
|
@@ -140,7 +141,7 @@ var OverflowList = /*#__PURE__*/function (_Component) {
|
|
|
140
141
|
}
|
|
141
142
|
}, /*#__PURE__*/React.createElement("div", {
|
|
142
143
|
ref: this.containerRef,
|
|
143
|
-
className:
|
|
144
|
+
className: clsx(this.prefixCls, className),
|
|
144
145
|
style: containerStyle
|
|
145
146
|
}, collapseFrom === 'start' && overflowNode, renderItems(), collapseFrom === 'end' && overflowNode));
|
|
146
147
|
}
|
package/esm/resize/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var Resize = function Resize(_ref) {
|
|
|
20
20
|
var resizeObserver = new ResizeObserver(onResizeProxy);
|
|
21
21
|
resizeObserver.observe(observerEle);
|
|
22
22
|
return function () {
|
|
23
|
-
resizeObserver.
|
|
23
|
+
resizeObserver.disconnect();
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
}, [observerEle]);
|
|
@@ -42,9 +42,10 @@ var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
|
|
|
42
42
|
_defineProperty(_assertThisInitialized(_this), "formerPropertyValue", new Map());
|
|
43
43
|
_defineProperty(_assertThisInitialized(_this), "getElement", function () {
|
|
44
44
|
try {
|
|
45
|
-
// eslint-disable-next-line react/no-find-dom-node
|
|
45
|
+
// eslint-disable-next-line react-dom/no-find-dom-node
|
|
46
46
|
return findDOMNode(_this.childNode || _assertThisInitialized(_this));
|
|
47
|
-
|
|
47
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
48
|
+
} catch (_error) {
|
|
48
49
|
return null;
|
|
49
50
|
}
|
|
50
51
|
});
|
package/esm/splitter/Panel.js
CHANGED
|
@@ -5,8 +5,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
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
7
|
import React, { forwardRef, useContext } from 'react';
|
|
8
|
-
import { ConfigContext } from 'antd/
|
|
9
|
-
import
|
|
8
|
+
import { ConfigContext } from 'antd/lib/config-provider';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
10
|
export var InternalPanel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
11
11
|
var customizePrefixCls = props.prefixCls,
|
|
12
12
|
className = props.className,
|
|
@@ -17,7 +17,7 @@ export var InternalPanel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
17
17
|
var _useContext = useContext(ConfigContext),
|
|
18
18
|
getPrefixCls = _useContext.getPrefixCls;
|
|
19
19
|
var prefixCls = getPrefixCls('splitter', customizePrefixCls);
|
|
20
|
-
var panelClassName =
|
|
20
|
+
var panelClassName = clsx("".concat(prefixCls, "-panel"), _defineProperty({}, "".concat(prefixCls, "-panel-hidden"), size === 0), className);
|
|
21
21
|
var hasSize = size !== undefined;
|
|
22
22
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
23
|
ref: ref,
|
package/esm/splitter/SplitBar.js
CHANGED
|
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import React, { useState } from 'react';
|
|
12
12
|
import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '@ant-design/icons';
|
|
13
|
-
import
|
|
13
|
+
import clsx from 'clsx';
|
|
14
14
|
import useEvent from 'rc-util/lib/hooks/useEvent';
|
|
15
15
|
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
|
|
16
16
|
function getValidNumber(num) {
|
|
@@ -139,6 +139,7 @@ var SplitBar = function SplitBar(props) {
|
|
|
139
139
|
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
140
140
|
event = _Object$entries$_i[0],
|
|
141
141
|
handler = _Object$entries$_i[1];
|
|
142
|
+
// eslint-disable-next-line react-web-api/no-leaked-event-listener
|
|
142
143
|
window.addEventListener(event, handler);
|
|
143
144
|
}
|
|
144
145
|
return function () {
|
|
@@ -160,26 +161,26 @@ var SplitBar = function SplitBar(props) {
|
|
|
160
161
|
"aria-valuemin": getValidNumber(ariaMin),
|
|
161
162
|
"aria-valuemax": getValidNumber(ariaMax)
|
|
162
163
|
}, lazy && /*#__PURE__*/React.createElement("div", {
|
|
163
|
-
className:
|
|
164
|
+
className: clsx("".concat(splitBarPrefixCls, "-preview"), _defineProperty({}, "".concat(splitBarPrefixCls, "-preview-active"), !!constrainedOffset)),
|
|
164
165
|
style: transformStyle
|
|
165
166
|
}), /*#__PURE__*/React.createElement("div", {
|
|
166
|
-
className:
|
|
167
|
+
className: clsx("".concat(splitBarPrefixCls, "-dragger"), _defineProperty(_defineProperty({}, "".concat(splitBarPrefixCls, "-dragger-disabled"), !resizable), "".concat(splitBarPrefixCls, "-dragger-active"), active)),
|
|
167
168
|
onMouseDown: onMouseDown,
|
|
168
169
|
onTouchStart: onTouchStart
|
|
169
170
|
}), startCollapsible && /*#__PURE__*/React.createElement("div", {
|
|
170
|
-
className:
|
|
171
|
+
className: clsx("".concat(splitBarPrefixCls, "-collapse-bar"), "".concat(splitBarPrefixCls, "-collapse-bar-start"), getVisibilityClass(showStartCollapsibleIcon)),
|
|
171
172
|
onClick: function onClick() {
|
|
172
173
|
return onCollapse(index, 'start');
|
|
173
174
|
}
|
|
174
175
|
}, /*#__PURE__*/React.createElement(StartIcon, {
|
|
175
|
-
className:
|
|
176
|
+
className: clsx("".concat(splitBarPrefixCls, "-collapse-icon"), "".concat(splitBarPrefixCls, "-collapse-start"))
|
|
176
177
|
})), endCollapsible && /*#__PURE__*/React.createElement("div", {
|
|
177
|
-
className:
|
|
178
|
+
className: clsx("".concat(splitBarPrefixCls, "-collapse-bar"), "".concat(splitBarPrefixCls, "-collapse-bar-end"), getVisibilityClass(showEndCollapsibleIcon)),
|
|
178
179
|
onClick: function onClick() {
|
|
179
180
|
return onCollapse(index, 'end');
|
|
180
181
|
}
|
|
181
182
|
}, /*#__PURE__*/React.createElement(EndIcon, {
|
|
182
|
-
className:
|
|
183
|
+
className: clsx("".concat(splitBarPrefixCls, "-collapse-icon"), "".concat(splitBarPrefixCls, "-collapse-end"))
|
|
183
184
|
})));
|
|
184
185
|
};
|
|
185
186
|
export default SplitBar;
|
package/esm/splitter/Splitter.js
CHANGED
|
@@ -13,7 +13,6 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
import React, { useContext, useState } from 'react';
|
|
15
15
|
import { ConfigContext } from 'antd/es/config-provider';
|
|
16
|
-
import classNames from 'classnames';
|
|
17
16
|
import ResizeObserver from 'rc-resize-observer';
|
|
18
17
|
import useEvent from 'rc-util/es/hooks/useEvent';
|
|
19
18
|
import warning from 'rc-util/es/warning';
|
|
@@ -24,6 +23,8 @@ import useSizes from "./hooks/useSizes";
|
|
|
24
23
|
import { InternalPanel } from "./Panel";
|
|
25
24
|
import SplitBar from "./SplitBar";
|
|
26
25
|
import "./style/index.less";
|
|
26
|
+
import clsx from 'clsx';
|
|
27
|
+
import { uniqueId } from 'lodash-es';
|
|
27
28
|
var Splitter = function Splitter(props) {
|
|
28
29
|
var customizePrefixCls = props.prefixCls,
|
|
29
30
|
className = props.className,
|
|
@@ -115,7 +116,7 @@ var Splitter = function Splitter(props) {
|
|
|
115
116
|
});
|
|
116
117
|
(_props$onCollapse = props.onCollapse) === null || _props$onCollapse === void 0 || _props$onCollapse.call(props, collapsed, nextSizes);
|
|
117
118
|
});
|
|
118
|
-
var containerClassName =
|
|
119
|
+
var containerClassName = clsx(prefixCls, className, "".concat(prefixCls, "-").concat(layout), _defineProperty({}, "".concat(prefixCls, "-rtl"), isRTL), rootClassName);
|
|
119
120
|
var maskCls = "".concat(prefixCls, "-mask");
|
|
120
121
|
var stackSizes = React.useMemo(function () {
|
|
121
122
|
var mergedSizes = [];
|
|
@@ -173,11 +174,11 @@ var Splitter = function Splitter(props) {
|
|
|
173
174
|
});
|
|
174
175
|
}
|
|
175
176
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
176
|
-
key: "split-panel-".concat(
|
|
177
|
+
key: "split-panel-".concat(uniqueId())
|
|
177
178
|
}, panel, splitBar);
|
|
178
179
|
}), typeof movingIndex === 'number' && /*#__PURE__*/React.createElement("div", {
|
|
179
180
|
"aria-hidden": true,
|
|
180
|
-
className:
|
|
181
|
+
className: clsx(maskCls, "".concat(maskCls, "-").concat(layout))
|
|
181
182
|
})));
|
|
182
183
|
};
|
|
183
184
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -11,8 +11,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
11
11
|
import * as React from 'react';
|
|
12
12
|
import { getPtg } from "./useSizes";
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Handle user drag resize logic.
|
|
14
|
+
/**
|
|
15
|
+
* Handle user drag resize logic.
|
|
16
16
|
*/
|
|
17
17
|
export default function useResize(items, resizableInfos, percentSizes, containerSize, updateSizes, isRTL) {
|
|
18
18
|
var limitSizes = items.map(function (item) {
|
|
@@ -38,9 +38,9 @@ export default function useResize(items, resizableInfos, percentSizes, container
|
|
|
38
38
|
setCacheSizes = _React$useState2[1];
|
|
39
39
|
var cacheCollapsedSize = React.useRef([]);
|
|
40
40
|
|
|
41
|
-
/**
|
|
42
|
-
* When start drag, check the direct is `start` or `end`.
|
|
43
|
-
* This will handle when 2 splitter bar are in the same position.
|
|
41
|
+
/**
|
|
42
|
+
* When start drag, check the direct is `start` or `end`.
|
|
43
|
+
* This will handle when 2 splitter bar are in the same position.
|
|
44
44
|
*/
|
|
45
45
|
var _React$useState3 = React.useState(null),
|
|
46
46
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
package/esm/statusTag/index.js
CHANGED
|
@@ -12,8 +12,8 @@ import React, { useMemo } from 'react';
|
|
|
12
12
|
import { LoadingOutlined } from '@ant-design/icons';
|
|
13
13
|
import { Spin } from 'antd';
|
|
14
14
|
import { globalConfig } from 'antd/es/config-provider';
|
|
15
|
-
import classNames from 'classnames';
|
|
16
15
|
import "./style";
|
|
16
|
+
import clsx from 'clsx';
|
|
17
17
|
export var PRESET_COLOR_TYPES = Object.freeze(['blue', 'yellow', 'green', 'gray', 'red', 'purple', 'cyan', 'pink']);
|
|
18
18
|
export var STATUS_TAG_TYPES = Object.freeze(['default', 'outline', 'fill']);
|
|
19
19
|
var DEFAULT_OPACITY = 0.15;
|
|
@@ -44,10 +44,10 @@ function calculateTransparentColor(color) {
|
|
|
44
44
|
return char + char;
|
|
45
45
|
}).join('');
|
|
46
46
|
}
|
|
47
|
-
if (!/^[0-9A-
|
|
48
|
-
var r = parseInt(hex.substring(0, 2), 16);
|
|
49
|
-
var g = parseInt(hex.substring(2, 4), 16);
|
|
50
|
-
var b = parseInt(hex.substring(4, 6), 16);
|
|
47
|
+
if (!/^[0-9A-F]{6}$/i.test(hex)) return 'rgba(0, 0, 0, 0.15)';
|
|
48
|
+
var r = Number.parseInt(hex.substring(0, 2), 16);
|
|
49
|
+
var g = Number.parseInt(hex.substring(2, 4), 16);
|
|
50
|
+
var b = Number.parseInt(hex.substring(4, 6), 16);
|
|
51
51
|
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(opacity, ")");
|
|
52
52
|
}
|
|
53
53
|
var StatusTag = /*#__PURE__*/React.memo(function (props) {
|
|
@@ -70,7 +70,7 @@ var StatusTag = /*#__PURE__*/React.memo(function (props) {
|
|
|
70
70
|
return icon === undefined;
|
|
71
71
|
}, [icon]);
|
|
72
72
|
var containerClasses = useMemo(function () {
|
|
73
|
-
return
|
|
73
|
+
return clsx(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "--border"), type === 'outline'), "".concat(prefixCls, "--fill"), type === 'fill'), "".concat(prefixCls, "--rounded"), rounded), "".concat(prefixCls, "__").concat(color, "--fill"), type === 'fill' && isPresetColor(color)));
|
|
74
74
|
}, [className, type, color, rounded, prefixCls]);
|
|
75
75
|
var customColorStyle = useMemo(function () {
|
|
76
76
|
if (type !== 'fill' || isPresetColor(color)) return {};
|
|
@@ -82,12 +82,12 @@ var StatusTag = /*#__PURE__*/React.memo(function (props) {
|
|
|
82
82
|
var iconStyleConfig = useMemo(function () {
|
|
83
83
|
if (isPresetColor(color)) {
|
|
84
84
|
return {
|
|
85
|
-
className:
|
|
85
|
+
className: clsx('anticon', _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "__").concat(color, "--icon"), true), "".concat(prefixCls, "__icon--default"), !icon), "".concat(prefixCls, "__").concat(color, "--iconBg"), !icon)),
|
|
86
86
|
style: {}
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
return {
|
|
90
|
-
className:
|
|
90
|
+
className: clsx('anticon', _defineProperty({}, "".concat(prefixCls, "__icon--default"), !icon)),
|
|
91
91
|
style: {
|
|
92
92
|
color: icon ? color : undefined,
|
|
93
93
|
background: !icon ? color : undefined
|
package/esm/style/index.less
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "./themes/index.less";
|
|
1
|
+
@import "./themes/index.less";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import '~antd/es/style/themes/default.less';
|
|
2
|
-
@import './variable.less';
|
|
1
|
+
@import '~antd/es/style/themes/default.less';
|
|
2
|
+
@import './variable.less';
|