@dtjoy/dt-design 1.0.2 → 1.0.3
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/blockHeader/index.js +4 -4
- package/esm/blockHeader/style/index.less +1 -1
- package/esm/collapsible/index.js +1 -1
- package/esm/flex/index.js +1 -1
- package/esm/flex/utils.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/overflowList/index.d.ts +39 -0
- package/esm/overflowList/index.js +165 -0
- package/esm/overflowList/style/index.d.ts +2 -0
- package/esm/overflowList/style/index.js +2 -0
- package/esm/overflowList/style/index.less +9 -0
- package/esm/resizeObserver/index.d.ts +45 -0
- package/esm/resizeObserver/index.js +175 -0
- package/esm/splitter/SplitBar.js +1 -1
- package/esm/splitter/Splitter.js +3 -21
- package/esm/statusTag/index.js +9 -9
- package/lib/blockHeader/index.js +5 -5
- package/lib/blockHeader/style/index.less +1 -1
- package/lib/collapsible/index.js +3 -3
- package/lib/flex/index.js +2 -2
- package/lib/flex/utils.js +3 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +8 -1
- package/lib/overflowList/index.d.ts +39 -0
- package/lib/overflowList/index.js +143 -0
- package/lib/overflowList/style/index.d.ts +2 -0
- package/lib/overflowList/style/index.js +4 -0
- package/lib/overflowList/style/index.less +9 -0
- package/lib/resizeObserver/index.d.ts +45 -0
- package/lib/resizeObserver/index.js +136 -0
- package/lib/splitter/SplitBar.js +3 -3
- package/lib/splitter/Splitter.js +4 -20
- package/lib/statusTag/index.js +9 -9
- package/package.json +133 -142
package/esm/blockHeader/index.js
CHANGED
|
@@ -12,7 +12,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12
12
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
import React, { useState } from 'react';
|
|
15
|
-
import {
|
|
15
|
+
import { QuestionCircleOutlined, UpOutlined } from '@ant-design/icons';
|
|
16
16
|
import { Tooltip } from 'antd';
|
|
17
17
|
import { globalConfig } from 'antd/es/config-provider';
|
|
18
18
|
import classNames from 'classnames';
|
|
@@ -92,8 +92,8 @@ var BlockHeader = function BlockHeader(props) {
|
|
|
92
92
|
}, title), tooltipProps !== null && tooltipProps !== void 0 && tooltipProps.title ? /*#__PURE__*/React.createElement("div", {
|
|
93
93
|
className: "title__tooltip"
|
|
94
94
|
}, /*#__PURE__*/React.createElement(Tooltip, _extends({}, tooltipProps, {
|
|
95
|
-
className: classNames(tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.className
|
|
96
|
-
}), /*#__PURE__*/React.createElement(
|
|
95
|
+
className: classNames(tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.className)
|
|
96
|
+
}), /*#__PURE__*/React.createElement(QuestionCircleOutlined, null))) : null, description ? /*#__PURE__*/React.createElement("div", {
|
|
97
97
|
className: "title__description"
|
|
98
98
|
}, description) : null), addonAfter && /*#__PURE__*/React.createElement("div", {
|
|
99
99
|
className: "title__addon-after"
|
|
@@ -102,7 +102,7 @@ var BlockHeader = function BlockHeader(props) {
|
|
|
102
102
|
}, /*#__PURE__*/React.createElement("div", {
|
|
103
103
|
className: "collapse__text"
|
|
104
104
|
}, currentExpand ? '收起' : '展开'), /*#__PURE__*/React.createElement(UpOutlined, {
|
|
105
|
-
className: classNames('collapse__icon',
|
|
105
|
+
className: classNames('collapse__icon', {
|
|
106
106
|
'collapse__icon--up': currentExpand,
|
|
107
107
|
'collapse__icon--down': !currentExpand
|
|
108
108
|
})
|
package/esm/collapsible/index.js
CHANGED
|
@@ -18,7 +18,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { globalConfig } from 'antd/es/config-provider';
|
|
20
20
|
import classNames from 'classnames';
|
|
21
|
-
import { isEqual, pick } from 'lodash';
|
|
21
|
+
import { isEqual, pick } from 'lodash-es';
|
|
22
22
|
import "./style";
|
|
23
23
|
var Collapsible = /*#__PURE__*/function (_React$Component) {
|
|
24
24
|
_inherits(Collapsible, _React$Component);
|
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
|
|
19
|
+
import clsx from 'classnames';
|
|
20
20
|
import { omit } from 'lodash-es';
|
|
21
21
|
import "./style";
|
|
22
22
|
import { isPresetSize } from "../_util/gapSize";
|
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
|
|
7
|
+
import clsx from 'classnames';
|
|
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/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import '@dtinsight/react-icons/dist/index.css';
|
|
2
1
|
export { default as BlockHeader } from './blockHeader';
|
|
3
2
|
export type { ButtonProps } from './button';
|
|
4
3
|
export { default as Button } from './button';
|
|
5
4
|
export { default as Flex } from './flex';
|
|
6
5
|
export type { FlexProps } from './flex/interface';
|
|
7
6
|
export { default as CollapsibleActionItems } from './collapsibleActionItems';
|
|
7
|
+
export { default as OverflowList } from './overflowList';
|
|
8
8
|
export { default as Resize } from './resize';
|
|
9
9
|
export { default as Splitter } from './splitter';
|
|
10
10
|
export * from './splitter';
|
package/esm/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import '@dtinsight/react-icons/dist/index.css';
|
|
2
1
|
export { default as BlockHeader } from "./blockHeader";
|
|
3
2
|
export { default as Button } from "./button";
|
|
4
3
|
export { default as Flex } from "./flex";
|
|
5
4
|
// export { default as Catalogue } from './catalogue';
|
|
6
5
|
// export { default as Chat } from './chat';
|
|
7
6
|
export { default as CollapsibleActionItems } from "./collapsibleActionItems";
|
|
7
|
+
export { default as OverflowList } from "./overflowList";
|
|
8
8
|
// export { default as ConfigProvider } from './configProvider';
|
|
9
9
|
// export { default as ContentLayout } from './contentLayout';
|
|
10
10
|
// export { default as ContextMenu } from './contextMenu';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { Component, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
export declare type OverflowItem<T = Record<string, any>> = T;
|
|
4
|
+
export interface OverflowListProps<T = Record<string, any>> {
|
|
5
|
+
items: OverflowItem<T>[];
|
|
6
|
+
visibleItemRenderer: (item: OverflowItem<T>, index: number) => ReactElement;
|
|
7
|
+
overflowRenderer: (overflowItems: OverflowItem<T>[]) => ReactNode | ReactNode[];
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
renderMode?: 'collapse' | 'scroll';
|
|
11
|
+
collapseFrom?: 'start' | 'end';
|
|
12
|
+
minVisibleItems?: number;
|
|
13
|
+
onOverflow?: (overflowItems: OverflowItem<T>[]) => void;
|
|
14
|
+
}
|
|
15
|
+
interface OverflowListState {
|
|
16
|
+
visibleCount: number;
|
|
17
|
+
isMeasuring: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare class OverflowList<T extends object> extends Component<OverflowListProps<T>, OverflowListState> {
|
|
20
|
+
static defaultProps: {
|
|
21
|
+
items: never[];
|
|
22
|
+
collapseFrom: string;
|
|
23
|
+
minVisibleItems: number;
|
|
24
|
+
renderMode: string;
|
|
25
|
+
};
|
|
26
|
+
static displayName: string;
|
|
27
|
+
private containerRef;
|
|
28
|
+
private overflowRef;
|
|
29
|
+
private itemRefs;
|
|
30
|
+
private prefixCls;
|
|
31
|
+
constructor(props: OverflowListProps<T>);
|
|
32
|
+
componentDidMount(): void;
|
|
33
|
+
componentUpdate(prevProps: OverflowListProps<T>): void;
|
|
34
|
+
private measureAndAdjust;
|
|
35
|
+
private getOverflowItems;
|
|
36
|
+
renderCollapse(): React.JSX.Element;
|
|
37
|
+
render(): React.JSX.Element;
|
|
38
|
+
}
|
|
39
|
+
export default OverflowList;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
|
+
import React, { Component, createRef } from 'react';
|
|
18
|
+
import { globalConfig } from 'antd/es/config-provider';
|
|
19
|
+
import classNames from 'classnames';
|
|
20
|
+
import "./style";
|
|
21
|
+
import ReactResizeObserver from "../resizeObserver";
|
|
22
|
+
var OverflowList = /*#__PURE__*/function (_Component) {
|
|
23
|
+
_inherits(OverflowList, _Component);
|
|
24
|
+
var _super = _createSuper(OverflowList);
|
|
25
|
+
function OverflowList(props) {
|
|
26
|
+
var _this;
|
|
27
|
+
_classCallCheck(this, OverflowList);
|
|
28
|
+
_this = _super.call(this, props);
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "containerRef", /*#__PURE__*/createRef());
|
|
30
|
+
_defineProperty(_assertThisInitialized(_this), "overflowRef", /*#__PURE__*/createRef());
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "itemRefs", new Map());
|
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "prefixCls", 'overflow-list');
|
|
33
|
+
_defineProperty(_assertThisInitialized(_this), "measureAndAdjust", function () {
|
|
34
|
+
var _this$overflowRef$cur, _this$overflowRef$cur2;
|
|
35
|
+
var container = _this.containerRef.current;
|
|
36
|
+
if (!container || _this.props.renderMode !== 'collapse') return;
|
|
37
|
+
var _this$props = _this.props,
|
|
38
|
+
items = _this$props.items,
|
|
39
|
+
minVisibleItems = _this$props.minVisibleItems,
|
|
40
|
+
collapseFrom = _this$props.collapseFrom,
|
|
41
|
+
onOverflow = _this$props.onOverflow;
|
|
42
|
+
var containerWidth = container.offsetWidth;
|
|
43
|
+
var overflowWidth = (_this$overflowRef$cur = (_this$overflowRef$cur2 = _this.overflowRef.current) === null || _this$overflowRef$cur2 === void 0 ? void 0 : _this$overflowRef$cur2.offsetWidth) !== null && _this$overflowRef$cur !== void 0 ? _this$overflowRef$cur : 0;
|
|
44
|
+
var totalWidth = 0;
|
|
45
|
+
var newVisibleCount = 0;
|
|
46
|
+
for (var i = 0; i < items.length; i++) {
|
|
47
|
+
var _this$itemRefs$get$ge, _this$itemRefs$get;
|
|
48
|
+
var _index = collapseFrom === 'end' ? i : items.length - 1 - i;
|
|
49
|
+
var itemWidth = (_this$itemRefs$get$ge = (_this$itemRefs$get = _this.itemRefs.get(_index)) === null || _this$itemRefs$get === void 0 ? void 0 : _this$itemRefs$get.getBoundingClientRect().width) !== null && _this$itemRefs$get$ge !== void 0 ? _this$itemRefs$get$ge : 0;
|
|
50
|
+
var isLast = i === items.length - 1;
|
|
51
|
+
var limit = isLast ? containerWidth : containerWidth - overflowWidth;
|
|
52
|
+
if (totalWidth + itemWidth <= limit || newVisibleCount < (minVisibleItems || 0)) {
|
|
53
|
+
totalWidth += itemWidth;
|
|
54
|
+
newVisibleCount++;
|
|
55
|
+
} else {
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
_this.setState({
|
|
60
|
+
visibleCount: newVisibleCount,
|
|
61
|
+
isMeasuring: false
|
|
62
|
+
}, function () {
|
|
63
|
+
if (onOverflow) {
|
|
64
|
+
onOverflow(_this.getOverflowItems(newVisibleCount));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
_defineProperty(_assertThisInitialized(_this), "getOverflowItems", function (count) {
|
|
69
|
+
var _this$props2 = _this.props,
|
|
70
|
+
items = _this$props2.items,
|
|
71
|
+
collapseFrom = _this$props2.collapseFrom;
|
|
72
|
+
return collapseFrom === 'end' ? items.slice(count) : items.slice(0, items.length - count);
|
|
73
|
+
});
|
|
74
|
+
_this.prefixCls = globalConfig().getPrefixCls(_this.prefixCls);
|
|
75
|
+
_this.state = {
|
|
76
|
+
visibleCount: props.items.length,
|
|
77
|
+
isMeasuring: props.renderMode === 'collapse'
|
|
78
|
+
};
|
|
79
|
+
return _this;
|
|
80
|
+
}
|
|
81
|
+
_createClass(OverflowList, [{
|
|
82
|
+
key: "componentDidMount",
|
|
83
|
+
value: function componentDidMount() {
|
|
84
|
+
if (this.props.renderMode === 'collapse') {
|
|
85
|
+
this.measureAndAdjust();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "componentUpdate",
|
|
90
|
+
value: function componentUpdate(prevProps) {
|
|
91
|
+
if (prevProps.items !== this.props.items || prevProps.renderMode !== this.props.renderMode) {
|
|
92
|
+
this.setState({
|
|
93
|
+
isMeasuring: true,
|
|
94
|
+
visibleCount: this.props.items.length
|
|
95
|
+
}, this.measureAndAdjust);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "renderCollapse",
|
|
100
|
+
value: function renderCollapse() {
|
|
101
|
+
var _this2 = this;
|
|
102
|
+
var _this$props3 = this.props,
|
|
103
|
+
items = _this$props3.items,
|
|
104
|
+
visibleItemRenderer = _this$props3.visibleItemRenderer,
|
|
105
|
+
overflowRenderer = _this$props3.overflowRenderer,
|
|
106
|
+
collapseFrom = _this$props3.collapseFrom,
|
|
107
|
+
style = _this$props3.style,
|
|
108
|
+
className = _this$props3.className;
|
|
109
|
+
var _this$state = this.state,
|
|
110
|
+
visibleCount = _this$state.visibleCount,
|
|
111
|
+
isMeasuring = _this$state.isMeasuring;
|
|
112
|
+
var overflowItems = this.getOverflowItems(visibleCount);
|
|
113
|
+
var hasOverflow = overflowItems.length > 0;
|
|
114
|
+
var containerStyle = _objectSpread({
|
|
115
|
+
maxWidth: '100%',
|
|
116
|
+
visibility: 'visible'
|
|
117
|
+
}, style);
|
|
118
|
+
var renderItems = function renderItems() {
|
|
119
|
+
return items.map(function (item, i) {
|
|
120
|
+
var isVisible = isMeasuring || (collapseFrom === 'end' ? i < visibleCount : i >= items.length - visibleCount);
|
|
121
|
+
if (!isVisible) return null;
|
|
122
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
key: i,
|
|
124
|
+
ref: function ref(el) {
|
|
125
|
+
if (el) _this2.itemRefs.set(i, el);else _this2.itemRefs.delete(i);
|
|
126
|
+
},
|
|
127
|
+
className: "".concat(_this2.prefixCls, "-item")
|
|
128
|
+
}, visibleItemRenderer(item, i));
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
var overflowNode = (hasOverflow || isMeasuring) && /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
ref: this.overflowRef,
|
|
133
|
+
className: "".concat(this.prefixCls, "-overflow")
|
|
134
|
+
}, overflowRenderer(isMeasuring ? items : overflowItems));
|
|
135
|
+
return /*#__PURE__*/React.createElement(ReactResizeObserver, {
|
|
136
|
+
onResize: function onResize() {
|
|
137
|
+
return _this2.setState({
|
|
138
|
+
isMeasuring: true
|
|
139
|
+
}, _this2.measureAndAdjust);
|
|
140
|
+
}
|
|
141
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
142
|
+
ref: this.containerRef,
|
|
143
|
+
className: classNames(this.prefixCls, className),
|
|
144
|
+
style: containerStyle
|
|
145
|
+
}, collapseFrom === 'start' && overflowNode, renderItems(), collapseFrom === 'end' && overflowNode));
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "render",
|
|
149
|
+
value: function render() {
|
|
150
|
+
return this.renderCollapse();
|
|
151
|
+
}
|
|
152
|
+
}]);
|
|
153
|
+
return OverflowList;
|
|
154
|
+
}(Component);
|
|
155
|
+
_defineProperty(OverflowList, "defaultProps", {
|
|
156
|
+
items: [],
|
|
157
|
+
collapseFrom: 'end',
|
|
158
|
+
minVisibleItems: 0,
|
|
159
|
+
renderMode: 'collapse'
|
|
160
|
+
});
|
|
161
|
+
_defineProperty(OverflowList, "displayName", void 0);
|
|
162
|
+
if (process.env.NODE_ENV === 'development') {
|
|
163
|
+
OverflowList.displayName = 'OverflowList';
|
|
164
|
+
}
|
|
165
|
+
export default OverflowList;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BaseProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface ResizeEntry {
|
|
8
|
+
contentRect: DOMRectReadOnly;
|
|
9
|
+
target: Element;
|
|
10
|
+
}
|
|
11
|
+
export interface ReactResizeObserverProps extends BaseProps {
|
|
12
|
+
onResize?: (entries: ResizeEntry[]) => void;
|
|
13
|
+
observeParent?: boolean;
|
|
14
|
+
observerProperty?: ObserverProperty;
|
|
15
|
+
delayTick?: number;
|
|
16
|
+
children: React.ReactElement;
|
|
17
|
+
}
|
|
18
|
+
export declare enum ObserverProperty {
|
|
19
|
+
Width = "width",
|
|
20
|
+
Height = "height",
|
|
21
|
+
All = "all"
|
|
22
|
+
}
|
|
23
|
+
export default class ReactResizeObserver extends React.Component<ReactResizeObserverProps> {
|
|
24
|
+
static defaultProps: {
|
|
25
|
+
onResize: () => void;
|
|
26
|
+
observeParent: boolean;
|
|
27
|
+
observerProperty: ObserverProperty;
|
|
28
|
+
delayTick: number;
|
|
29
|
+
};
|
|
30
|
+
observer: ResizeObserver | null;
|
|
31
|
+
childNode: HTMLElement | null;
|
|
32
|
+
element: Element | null;
|
|
33
|
+
_parentNode: HTMLElement | null;
|
|
34
|
+
formerPropertyValue: Map<Element, number>;
|
|
35
|
+
constructor(props: ReactResizeObserverProps);
|
|
36
|
+
getElement: () => Element | null;
|
|
37
|
+
handleResizeEventTriggered: (entries: ResizeEntry[]) => void;
|
|
38
|
+
observeElement: (force?: boolean) => void;
|
|
39
|
+
mergeRef: (ref: React.Ref<any>, node: HTMLElement) => void;
|
|
40
|
+
componentDidMount(): void;
|
|
41
|
+
componentDidUpdate(prevProps: ReactResizeObserverProps): void;
|
|
42
|
+
componentWillUnmount(): void;
|
|
43
|
+
render(): React.ReactElement;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
var _excluded = ["children", "className", "style"];
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
|
+
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; }
|
|
6
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
7
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
17
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
|
+
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); }
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { findDOMNode } from 'react-dom';
|
|
25
|
+
export var ObserverProperty = /*#__PURE__*/function (ObserverProperty) {
|
|
26
|
+
ObserverProperty["Width"] = "width";
|
|
27
|
+
ObserverProperty["Height"] = "height";
|
|
28
|
+
ObserverProperty["All"] = "all";
|
|
29
|
+
return ObserverProperty;
|
|
30
|
+
}({});
|
|
31
|
+
var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
|
|
32
|
+
_inherits(ReactResizeObserver, _React$Component);
|
|
33
|
+
var _super = _createSuper(ReactResizeObserver);
|
|
34
|
+
function ReactResizeObserver(props) {
|
|
35
|
+
var _this;
|
|
36
|
+
_classCallCheck(this, ReactResizeObserver);
|
|
37
|
+
_this = _super.call(this, props);
|
|
38
|
+
_defineProperty(_assertThisInitialized(_this), "observer", null);
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "childNode", null);
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "element", null);
|
|
41
|
+
_defineProperty(_assertThisInitialized(_this), "_parentNode", null);
|
|
42
|
+
_defineProperty(_assertThisInitialized(_this), "formerPropertyValue", new Map());
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "getElement", function () {
|
|
44
|
+
try {
|
|
45
|
+
// eslint-disable-next-line react/no-find-dom-node
|
|
46
|
+
return findDOMNode(_this.childNode || _assertThisInitialized(_this));
|
|
47
|
+
} catch (error) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
_defineProperty(_assertThisInitialized(_this), "handleResizeEventTriggered", function (entries) {
|
|
52
|
+
var _this$props = _this.props,
|
|
53
|
+
observerProperty = _this$props.observerProperty,
|
|
54
|
+
onResize = _this$props.onResize;
|
|
55
|
+
if (observerProperty === ObserverProperty.All) {
|
|
56
|
+
onResize === null || onResize === void 0 || onResize(entries);
|
|
57
|
+
} else {
|
|
58
|
+
var finalEntries = [];
|
|
59
|
+
var _iterator = _createForOfIteratorHelper(entries),
|
|
60
|
+
_step;
|
|
61
|
+
try {
|
|
62
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
63
|
+
var entry = _step.value;
|
|
64
|
+
var currentValue = entry.contentRect[observerProperty];
|
|
65
|
+
if (_this.formerPropertyValue.has(entry.target)) {
|
|
66
|
+
if (currentValue !== _this.formerPropertyValue.get(entry.target)) {
|
|
67
|
+
_this.formerPropertyValue.set(entry.target, currentValue);
|
|
68
|
+
finalEntries.push(entry);
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
_this.formerPropertyValue.set(entry.target, currentValue);
|
|
72
|
+
finalEntries.push(entry);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
} catch (err) {
|
|
76
|
+
_iterator.e(err);
|
|
77
|
+
} finally {
|
|
78
|
+
_iterator.f();
|
|
79
|
+
}
|
|
80
|
+
if (finalEntries.length > 0) {
|
|
81
|
+
onResize === null || onResize === void 0 || onResize(finalEntries);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
_defineProperty(_assertThisInitialized(_this), "observeElement", function () {
|
|
86
|
+
var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
87
|
+
if (!_this.observer) return;
|
|
88
|
+
var element = _this.getElement();
|
|
89
|
+
if (!(element && element instanceof Element)) {
|
|
90
|
+
_this.observer.disconnect();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (element === _this.element && !force) {
|
|
94
|
+
return;
|
|
95
|
+
} else {
|
|
96
|
+
_this.observer.disconnect();
|
|
97
|
+
_this.element = element;
|
|
98
|
+
}
|
|
99
|
+
_this.observer.observe(element);
|
|
100
|
+
if (_this.props.observeParent && element.parentNode) {
|
|
101
|
+
var parentNode = element.parentNode;
|
|
102
|
+
if (parentNode.ownerDocument && parentNode.ownerDocument.defaultView && parentNode instanceof parentNode.ownerDocument.defaultView.HTMLElement) {
|
|
103
|
+
_this._parentNode = parentNode;
|
|
104
|
+
_this.observer.observe(parentNode);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
_defineProperty(_assertThisInitialized(_this), "mergeRef", function (ref, node) {
|
|
109
|
+
_this.childNode = node;
|
|
110
|
+
// 转发外部ref
|
|
111
|
+
if (typeof ref === 'function') {
|
|
112
|
+
ref(node);
|
|
113
|
+
} else if (_typeof(ref) === 'object' && ref && 'current' in ref) {
|
|
114
|
+
ref.current = node;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
if (typeof window !== 'undefined' && window.ResizeObserver) {
|
|
118
|
+
_this.observer = new window.ResizeObserver(_this.handleResizeEventTriggered);
|
|
119
|
+
}
|
|
120
|
+
return _this;
|
|
121
|
+
}
|
|
122
|
+
_createClass(ReactResizeObserver, [{
|
|
123
|
+
key: "componentDidMount",
|
|
124
|
+
value: function componentDidMount() {
|
|
125
|
+
var _this$observeElement;
|
|
126
|
+
(_this$observeElement = this.observeElement) === null || _this$observeElement === void 0 || _this$observeElement.call(this);
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
key: "componentDidUpdate",
|
|
130
|
+
value: function componentDidUpdate(prevProps) {
|
|
131
|
+
if (this.props.observeParent !== prevProps.observeParent) {
|
|
132
|
+
var _this$observeElement2;
|
|
133
|
+
(_this$observeElement2 = this.observeElement) === null || _this$observeElement2 === void 0 || _this$observeElement2.call(this, true);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
key: "componentWillUnmount",
|
|
138
|
+
value: function componentWillUnmount() {
|
|
139
|
+
if (this.observer) {
|
|
140
|
+
this.observer.disconnect();
|
|
141
|
+
this.observer = null;
|
|
142
|
+
}
|
|
143
|
+
this.element = null;
|
|
144
|
+
this._parentNode = null;
|
|
145
|
+
this.formerPropertyValue.clear();
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "render",
|
|
149
|
+
value: function render() {
|
|
150
|
+
var _this2 = this;
|
|
151
|
+
var _this$props2 = this.props,
|
|
152
|
+
children = _this$props2.children,
|
|
153
|
+
className = _this$props2.className,
|
|
154
|
+
style = _this$props2.style,
|
|
155
|
+
rest = _objectWithoutProperties(_this$props2, _excluded);
|
|
156
|
+
var child = React.Children.only(children);
|
|
157
|
+
var childRef = child.ref;
|
|
158
|
+
return /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, rest), {}, {
|
|
159
|
+
className: className ? "".concat(child.props.className || '', " ").concat(className) : child.props.className,
|
|
160
|
+
style: _objectSpread(_objectSpread({}, child.props.style), style),
|
|
161
|
+
ref: function ref(node) {
|
|
162
|
+
return _this2.mergeRef(childRef, node);
|
|
163
|
+
}
|
|
164
|
+
}));
|
|
165
|
+
}
|
|
166
|
+
}]);
|
|
167
|
+
return ReactResizeObserver;
|
|
168
|
+
}(React.Component);
|
|
169
|
+
_defineProperty(ReactResizeObserver, "defaultProps", {
|
|
170
|
+
onResize: function onResize() {},
|
|
171
|
+
observeParent: false,
|
|
172
|
+
observerProperty: ObserverProperty.All,
|
|
173
|
+
delayTick: 0
|
|
174
|
+
});
|
|
175
|
+
export { ReactResizeObserver as default };
|
package/esm/splitter/SplitBar.js
CHANGED
|
@@ -9,7 +9,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
9
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import React, { useState } from 'react';
|
|
12
|
-
import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '@
|
|
12
|
+
import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '@ant-design/icons';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import useEvent from 'rc-util/lib/hooks/useEvent';
|
|
15
15
|
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
|
package/esm/splitter/Splitter.js
CHANGED
|
@@ -11,15 +11,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
11
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
12
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
/* eslint-disable react/no-array-index-key */
|
|
15
14
|
import React, { useContext, useState } from 'react';
|
|
16
|
-
// 替换 v5 配置为 v4 ConfigContext
|
|
17
15
|
import { ConfigContext } from 'antd/es/config-provider';
|
|
18
16
|
import classNames from 'classnames';
|
|
19
17
|
import ResizeObserver from 'rc-resize-observer';
|
|
20
|
-
import useEvent from 'rc-util/
|
|
21
|
-
import warning from 'rc-util/
|
|
22
|
-
|
|
18
|
+
import useEvent from 'rc-util/es/hooks/useEvent';
|
|
19
|
+
import warning from 'rc-util/es/warning';
|
|
23
20
|
import useItems from "./hooks/useItems";
|
|
24
21
|
import useResizable from "./hooks/useResizable";
|
|
25
22
|
import useResize from "./hooks/useResize";
|
|
@@ -127,16 +124,7 @@ var Splitter = function Splitter(props) {
|
|
|
127
124
|
onResize === null || onResize === void 0 || onResize(nextSizes);
|
|
128
125
|
onResizeEnd === null || onResizeEnd === void 0 || onResizeEnd(nextSizes);
|
|
129
126
|
});
|
|
130
|
-
|
|
131
|
-
// ======================== Styles ========================
|
|
132
|
-
// 构建 v4 风格类名(移除 cssinjs 相关 hash 和变量类)
|
|
133
|
-
var containerClassName = classNames(prefixCls, className, "".concat(prefixCls, "-").concat(layout), _defineProperty({}, "".concat(prefixCls, "-rtl"), isRTL), rootClassName
|
|
134
|
-
// 移除 v5 cssinjs 类名
|
|
135
|
-
// contextClassName,
|
|
136
|
-
// cssVarCls,
|
|
137
|
-
// rootCls,
|
|
138
|
-
// hashId
|
|
139
|
-
);
|
|
127
|
+
var containerClassName = classNames(prefixCls, className, "".concat(prefixCls, "-").concat(layout), _defineProperty({}, "".concat(prefixCls, "-rtl"), isRTL), rootClassName);
|
|
140
128
|
|
|
141
129
|
// ======================== Render ========================
|
|
142
130
|
var maskCls = "".concat(prefixCls, "-mask");
|
|
@@ -149,11 +137,7 @@ var Splitter = function Splitter(props) {
|
|
|
149
137
|
}
|
|
150
138
|
return mergedSizes;
|
|
151
139
|
}, [itemPtgSizes]);
|
|
152
|
-
|
|
153
|
-
// 合并样式(移除 v5 上下文样式)
|
|
154
140
|
var mergedStyle = _objectSpread({}, style);
|
|
155
|
-
|
|
156
|
-
// 移除 wrapCSSVar 包装(v4 无需 cssinjs 变量注入)
|
|
157
141
|
return /*#__PURE__*/React.createElement(ResizeObserver, {
|
|
158
142
|
onResize: onContainerResize
|
|
159
143
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -165,8 +149,6 @@ var Splitter = function Splitter(props) {
|
|
|
165
149
|
prefixCls: prefixCls,
|
|
166
150
|
size: panelSizes[idx]
|
|
167
151
|
}));
|
|
168
|
-
|
|
169
|
-
// Split Bar
|
|
170
152
|
var splitBar = null;
|
|
171
153
|
var resizableInfo = resizableInfos[idx];
|
|
172
154
|
if (resizableInfo) {
|