fan-standard-comp 3.1.10 → 3.2.1
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/Readme.md +35 -0
- package/dist/fan-standard-comp.umd.js +15 -15
- package/es/ButtonGroup/ButtonList.js +0 -3
- package/es/ButtonGroup/ButtonMenu.js +0 -3
- package/es/ButtonGroup/PopConfirmTitle.js +5 -15
- package/es/ButtonGroup/index.js +214 -215
- package/es/ButtonGroup/style/index.less +1 -1
- package/es/DragContent/DragBar.js +2 -6
- package/es/DragContent/index.js +44 -75
- package/es/FormComp/ChunkUploader/api.js +6 -10
- package/es/FormComp/ChunkUploader/index.js +105 -171
- package/es/FormComp/ChunkUploader/lib.js +4 -17
- package/es/FormComp/ChunkUploader/upload-queue.class.js +10 -45
- package/es/FormComp/ChunkUploader/worker.js +0 -3
- package/es/FormComp/EditButton/index.js +24 -49
- package/es/FormComp/FieldComponent/ReUpload.js +18 -38
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +36 -74
- package/es/FormComp/FieldComponent/TitleNode.js +1 -3
- package/es/FormComp/FieldComponent/index.js +38 -74
- package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -63
- package/es/FormComp/RenderItemGroup/index.js +46 -74
- package/es/FormComp/Uploader/index.js +36 -77
- package/es/FormComp/Uploader/util.js +0 -6
- package/es/FormComp/VarTemplate/index.js +58 -96
- package/es/NavLeafScroll/index.js +172 -154
- package/es/NavLeafScroll/style/index.less +33 -1
- package/es/RefactorTree/index.js +36 -53
- package/es/RefactorTree/indexTreeNode.js +35 -68
- package/es/RefactorTree/util.js +9 -43
- package/es/SpecIcon/fonts/iconfont.js +7 -12
- package/es/SpecIcon/index.js +16 -25
- package/es/SplitterLayout/Pane.js +2 -5
- package/es/SplitterLayout/index.js +20 -70
- package/es/StandardContent/SplitterLayout/Pane.js +6 -10
- package/es/StandardContent/SplitterLayout/index.js +12 -63
- package/es/StandardContent/SubfieldContent.js +12 -14
- package/es/StandardContent/WrapperContent.js +8 -10
- package/es/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/es/StandardDragModal/ChangeStandardModal.js +493 -0
- package/es/StandardDragModal/DraggableModal.d.ts +7 -0
- package/es/StandardDragModal/DraggableModal.js +31 -0
- package/es/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/es/StandardDragModal/DraggableModalContext.js +5 -0
- package/es/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/es/StandardDragModal/DraggableModalInner.js +114 -0
- package/es/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/es/StandardDragModal/DraggableModalProvider.js +40 -0
- package/es/StandardDragModal/Modal.d.ts +11 -0
- package/es/StandardDragModal/Modal.js +24 -0
- package/es/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/es/StandardDragModal/ResizeHandle.js +8 -0
- package/es/StandardDragModal/clamp.d.ts +1 -0
- package/es/StandardDragModal/clamp.js +3 -0
- package/es/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/es/StandardDragModal/draggableModalReducer.js +157 -0
- package/es/StandardDragModal/getWindowSize.d.ts +4 -0
- package/es/StandardDragModal/getWindowSize.js +6 -0
- package/es/StandardDragModal/index.d.ts +3 -11
- package/es/StandardDragModal/index.js +3 -30
- package/es/StandardDragModal/index.less +65 -0
- package/es/StandardDragModal/useDrag.d.ts +5 -0
- package/es/StandardDragModal/useDrag.js +66 -0
- package/es/StandardDragModal/usePrevious.d.ts +1 -0
- package/es/StandardDragModal/usePrevious.js +8 -0
- package/es/StandardDragModal/useResize.d.ts +7 -0
- package/es/StandardDragModal/useResize.js +74 -0
- package/es/StandardFilter/index.js +30 -70
- package/es/StandardForm/ActionList.js +5 -7
- package/es/StandardForm/StepForm.js +50 -71
- package/es/StandardForm/TabForm.js +58 -70
- package/es/StandardForm/index.js +37 -56
- package/es/StandardModal/UpdateFormRef.js +1 -4
- package/es/StandardModal/index.d.ts +0 -1
- package/es/StandardModal/index.js +113 -157
- package/es/StandardPanel/index.js +19 -35
- package/es/StandardTable/index.js +18 -29
- package/es/components/IconNode/index.js +0 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +15 -14
- package/es/utils/ValueFormat.js +0 -9
- package/es/utils/dictSelectUtil.js +153 -0
- package/es/utils/filterPermission.js +16 -34
- package/es/utils/getParentNodes.js +24 -47
- package/es/utils/index.js +2 -1
- package/lib/ButtonGroup/ButtonList.js +1 -13
- package/lib/ButtonGroup/ButtonMenu.js +1 -8
- package/lib/ButtonGroup/PopConfirmTitle.js +3 -16
- package/lib/ButtonGroup/index.js +217 -238
- package/lib/ButtonGroup/style/index.less +1 -1
- package/lib/DragContent/DragBar.js +2 -10
- package/lib/DragContent/index.js +47 -85
- package/lib/FormComp/ChunkUploader/api.js +6 -15
- package/lib/FormComp/ChunkUploader/index.js +107 -185
- package/lib/FormComp/ChunkUploader/lib.js +8 -27
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +10 -46
- package/lib/FormComp/ChunkUploader/worker.js +1 -5
- package/lib/FormComp/EditButton/index.js +26 -60
- package/lib/FormComp/FieldComponent/ReUpload.js +21 -50
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +38 -89
- package/lib/FormComp/FieldComponent/TitleNode.js +1 -5
- package/lib/FormComp/FieldComponent/index.js +38 -110
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +37 -79
- package/lib/FormComp/RenderItemGroup/index.js +46 -87
- package/lib/FormComp/Uploader/index.js +38 -95
- package/lib/FormComp/Uploader/util.js +1 -9
- package/lib/FormComp/VarTemplate/index.js +62 -106
- package/lib/FormComp/index.js +0 -2
- package/lib/NavLeafScroll/index.js +174 -165
- package/lib/NavLeafScroll/style/index.less +33 -1
- package/lib/RefactorTree/index.js +36 -67
- package/lib/RefactorTree/indexTreeNode.js +37 -83
- package/lib/RefactorTree/util.js +11 -45
- package/lib/SpecIcon/fonts/iconfont.js +7 -12
- package/lib/SpecIcon/index.js +16 -30
- package/lib/SplitterLayout/Pane.js +0 -7
- package/lib/SplitterLayout/index.js +18 -72
- package/lib/StandardContent/SplitterLayout/Pane.js +6 -14
- package/lib/StandardContent/SplitterLayout/index.js +12 -68
- package/lib/StandardContent/SubfieldContent.js +12 -21
- package/lib/StandardContent/WrapperContent.js +8 -16
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/lib/StandardDragModal/ChangeStandardModal.js +502 -0
- package/lib/StandardDragModal/DraggableModal.d.ts +7 -0
- package/lib/StandardDragModal/DraggableModal.js +40 -0
- package/lib/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/lib/StandardDragModal/DraggableModalContext.js +15 -0
- package/lib/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/lib/StandardDragModal/DraggableModalInner.js +124 -0
- package/lib/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/lib/StandardDragModal/DraggableModalProvider.js +48 -0
- package/lib/StandardDragModal/Modal.d.ts +11 -0
- package/lib/StandardDragModal/Modal.js +32 -0
- package/lib/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/lib/StandardDragModal/ResizeHandle.js +18 -0
- package/lib/StandardDragModal/clamp.d.ts +1 -0
- package/lib/StandardDragModal/clamp.js +10 -0
- package/lib/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/lib/StandardDragModal/draggableModalReducer.js +167 -0
- package/lib/StandardDragModal/getWindowSize.d.ts +4 -0
- package/lib/StandardDragModal/getWindowSize.js +13 -0
- package/lib/StandardDragModal/index.d.ts +3 -11
- package/lib/StandardDragModal/index.js +33 -38
- package/lib/StandardDragModal/index.less +65 -0
- package/lib/StandardDragModal/useDrag.d.ts +5 -0
- package/lib/StandardDragModal/useDrag.js +73 -0
- package/lib/StandardDragModal/usePrevious.d.ts +1 -0
- package/lib/StandardDragModal/usePrevious.js +15 -0
- package/lib/StandardDragModal/useResize.d.ts +7 -0
- package/lib/StandardDragModal/useResize.js +81 -0
- package/lib/StandardFilter/index.js +28 -78
- package/lib/StandardForm/ActionList.js +5 -12
- package/lib/StandardForm/StepForm.js +52 -90
- package/lib/StandardForm/TabForm.js +61 -88
- package/lib/StandardForm/index.js +40 -75
- package/lib/StandardModal/UpdateFormRef.js +4 -12
- package/lib/StandardModal/index.d.ts +0 -1
- package/lib/StandardModal/index.js +115 -182
- package/lib/StandardPanel/index.js +22 -48
- package/lib/StandardTable/index.js +18 -38
- package/lib/components/IconNode/index.js +0 -7
- package/lib/components/index.js +0 -2
- package/lib/data/index.js +4 -7
- package/lib/index.d.ts +1 -0
- package/lib/index.js +50 -68
- package/lib/utils/ValueFormat.js +0 -10
- package/lib/utils/dictSelectUtil.js +161 -0
- package/lib/utils/filterPermission.js +15 -39
- package/lib/utils/getParentNodes.js +25 -52
- package/lib/utils/index.js +24 -9
- package/package.json +5 -4
|
@@ -1,40 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _Pane = _interopRequireDefault(require("./Pane"));
|
|
13
|
-
|
|
14
10
|
require("./index.less");
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
-
|
|
13
|
+
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); } }
|
|
14
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
17
|
+
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); }
|
|
18
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
28
19
|
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); }; }
|
|
29
|
-
|
|
30
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
31
|
-
|
|
20
|
+
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); }
|
|
32
21
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
-
|
|
22
|
+
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; } }
|
|
23
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } // import PropTypes from 'prop-types';
|
|
38
24
|
function clearSelection() {
|
|
39
25
|
if (document.body.createTextRange) {
|
|
40
26
|
// https://github.com/zesik/react-splitter-layout/issues/16
|
|
@@ -52,19 +38,13 @@ function clearSelection() {
|
|
|
52
38
|
document.selection.empty();
|
|
53
39
|
}
|
|
54
40
|
}
|
|
55
|
-
|
|
56
41
|
var DEFAULT_SPLITTER_SIZE = 4;
|
|
57
|
-
|
|
58
42
|
var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
59
43
|
_inherits(SplitterLayout, _React$Component);
|
|
60
|
-
|
|
61
44
|
var _super = _createSuper(SplitterLayout);
|
|
62
|
-
|
|
63
45
|
function SplitterLayout(props) {
|
|
64
46
|
var _this;
|
|
65
|
-
|
|
66
47
|
_classCallCheck(this, SplitterLayout);
|
|
67
|
-
|
|
68
48
|
_this = _super.call(this, props);
|
|
69
49
|
_this.handleResize = _this.handleResize.bind(_assertThisInitialized(_this));
|
|
70
50
|
_this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_this));
|
|
@@ -77,7 +57,6 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
77
57
|
};
|
|
78
58
|
return _this;
|
|
79
59
|
}
|
|
80
|
-
|
|
81
60
|
_createClass(SplitterLayout, [{
|
|
82
61
|
key: "componentDidMount",
|
|
83
62
|
value: function componentDidMount() {
|
|
@@ -87,7 +66,6 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
87
66
|
document.addEventListener('touchend', this.handleMouseUp);
|
|
88
67
|
document.addEventListener('touchmove', this.handleTouchMove);
|
|
89
68
|
var secondaryPaneSize, primaryPaneSize;
|
|
90
|
-
|
|
91
69
|
if (typeof this.props.secondaryInitialSize !== 'undefined') {
|
|
92
70
|
//设置其余部分大小
|
|
93
71
|
secondaryPaneSize = this.props.secondaryInitialSize;
|
|
@@ -96,10 +74,8 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
96
74
|
//设置主要部分大小
|
|
97
75
|
primaryPaneSize = this.props.primaryInitialSize;
|
|
98
76
|
}
|
|
99
|
-
|
|
100
77
|
var containerRect = this.container.getBoundingClientRect();
|
|
101
78
|
var splitterRect;
|
|
102
|
-
|
|
103
79
|
if (this.splitter) {
|
|
104
80
|
splitterRect = this.splitter.getBoundingClientRect();
|
|
105
81
|
} else {
|
|
@@ -109,9 +85,7 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
109
85
|
height: DEFAULT_SPLITTER_SIZE
|
|
110
86
|
};
|
|
111
87
|
}
|
|
112
|
-
|
|
113
88
|
var totalSize, splitterSize;
|
|
114
|
-
|
|
115
89
|
if (this.props.vertical) {
|
|
116
90
|
//垂直排列
|
|
117
91
|
totalSize = containerRect.height;
|
|
@@ -119,16 +93,14 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
119
93
|
} else {
|
|
120
94
|
totalSize = containerRect.width;
|
|
121
95
|
splitterSize = splitterRect.width;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
96
|
+
}
|
|
97
|
+
//计算目标对象位置
|
|
125
98
|
var primarySize = this.props.primaryIndex === 1 ? totalSize - splitterSize - primaryPaneSize : primaryPaneSize || (totalSize - splitterSize) / 2;
|
|
126
99
|
secondaryPaneSize = this.getSecondaryPaneSize(containerRect, splitterRect, {
|
|
127
100
|
left: containerRect.left + primarySize,
|
|
128
101
|
top: containerRect.top + primarySize
|
|
129
102
|
}, false);
|
|
130
103
|
}
|
|
131
|
-
|
|
132
104
|
this.setState({
|
|
133
105
|
secondaryPaneSize: secondaryPaneSize
|
|
134
106
|
});
|
|
@@ -139,7 +111,6 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
139
111
|
if (prevState.secondaryPaneSize !== this.state.secondaryPaneSize && this.props.onSecondaryPaneSizeChange) {
|
|
140
112
|
this.props.onSecondaryPaneSizeChange(this.state.secondaryPaneSize);
|
|
141
113
|
}
|
|
142
|
-
|
|
143
114
|
if (prevState.resizing !== this.state.resizing) {
|
|
144
115
|
if (this.state.resizing) {
|
|
145
116
|
if (this.props.onDragStart) {
|
|
@@ -159,27 +130,21 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
159
130
|
document.removeEventListener('touchend', this.handleMouseUp);
|
|
160
131
|
document.removeEventListener('touchmove', this.handleTouchMove);
|
|
161
132
|
} //获取第二块内容宽度or高度
|
|
162
|
-
|
|
163
133
|
}, {
|
|
164
134
|
key: "getSecondaryPaneSize",
|
|
165
135
|
value: function getSecondaryPaneSize(containerRect, splitterRect, clientPosition, offsetMouse) {
|
|
166
136
|
var totalSize;
|
|
167
137
|
var splitterSize;
|
|
168
138
|
var offset;
|
|
169
|
-
|
|
170
139
|
if (this.props.vertical) {
|
|
171
140
|
//垂直排列
|
|
172
141
|
totalSize = containerRect.height; //总高度
|
|
173
|
-
|
|
174
142
|
splitterSize = splitterRect.height; //划分条高度
|
|
175
|
-
|
|
176
143
|
offset = clientPosition.top - containerRect.top; //移动位置减去原始位置
|
|
177
144
|
} else {
|
|
178
145
|
//默认水平排列
|
|
179
146
|
totalSize = containerRect.width; //总宽度
|
|
180
|
-
|
|
181
147
|
splitterSize = splitterRect.width; //划分条宽度
|
|
182
|
-
|
|
183
148
|
offset = clientPosition.left - containerRect.left; //移动位置减去原始位置
|
|
184
149
|
}
|
|
185
150
|
|
|
@@ -187,25 +152,20 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
187
152
|
//移动
|
|
188
153
|
offset -= splitterSize / 2;
|
|
189
154
|
}
|
|
190
|
-
|
|
191
155
|
if (offset < 0) {
|
|
192
156
|
offset = 0;
|
|
193
157
|
} else if (offset > totalSize - splitterSize) {
|
|
194
158
|
//移动超过容器大小
|
|
195
159
|
offset = totalSize - splitterSize;
|
|
196
160
|
}
|
|
197
|
-
|
|
198
161
|
var secondaryPaneSize;
|
|
199
|
-
|
|
200
162
|
if (this.props.primaryIndex === 1) {
|
|
201
163
|
//目标对象是1
|
|
202
164
|
secondaryPaneSize = offset;
|
|
203
165
|
} else {
|
|
204
166
|
secondaryPaneSize = totalSize - splitterSize - offset;
|
|
205
167
|
}
|
|
206
|
-
|
|
207
168
|
var primaryPaneSize = totalSize - splitterSize - secondaryPaneSize;
|
|
208
|
-
|
|
209
169
|
if (this.props.percentage) {
|
|
210
170
|
//百分比
|
|
211
171
|
secondaryPaneSize = secondaryPaneSize * 100 / totalSize;
|
|
@@ -213,13 +173,11 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
213
173
|
splitterSize = splitterSize * 100 / totalSize;
|
|
214
174
|
totalSize = 100;
|
|
215
175
|
}
|
|
216
|
-
|
|
217
176
|
if (primaryPaneSize < this.props.primaryMinSize) {
|
|
218
177
|
secondaryPaneSize = Math.max(secondaryPaneSize - (this.props.primaryMinSize - primaryPaneSize), 0);
|
|
219
178
|
} else if (secondaryPaneSize < this.props.secondaryMinSize) {
|
|
220
179
|
secondaryPaneSize = Math.min(totalSize - splitterSize - this.props.primaryMinSize, this.props.secondaryMinSize);
|
|
221
180
|
}
|
|
222
|
-
|
|
223
181
|
return secondaryPaneSize;
|
|
224
182
|
}
|
|
225
183
|
}, {
|
|
@@ -279,40 +237,32 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
279
237
|
key: "render",
|
|
280
238
|
value: function render() {
|
|
281
239
|
var _this2 = this;
|
|
282
|
-
|
|
283
240
|
var _this$props = this.props,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
241
|
+
customClassName = _this$props.customClassName,
|
|
242
|
+
vertical = _this$props.vertical,
|
|
243
|
+
_this$props$partClass = _this$props.partClassNames,
|
|
244
|
+
partClassNames = _this$props$partClass === void 0 ? [] : _this$props$partClass,
|
|
245
|
+
_this$props$partStyle = _this$props.partStyles,
|
|
246
|
+
partStyles = _this$props$partStyle === void 0 ? [] : _this$props$partStyle;
|
|
290
247
|
var containerClasses = "splitter-layout ".concat(customClassName || '').concat(vertical ? ' splitter-layout-vertical' : '');
|
|
291
|
-
|
|
292
248
|
if (this.state.resizing) {
|
|
293
249
|
containerClasses += ' layout-changing';
|
|
294
250
|
}
|
|
295
|
-
|
|
296
251
|
var children = _react.default.Children.toArray(this.props.children).slice(0, 2);
|
|
297
|
-
|
|
298
252
|
if (children.length === 0) {
|
|
299
253
|
children.push( /*#__PURE__*/_react.default.createElement("div", null));
|
|
300
254
|
}
|
|
301
|
-
|
|
302
255
|
var wrappedChildren = [];
|
|
303
256
|
var primaryIndex = this.props.primaryIndex !== 0 && this.props.primaryIndex !== 1 ? 0 : this.props.primaryIndex;
|
|
304
|
-
|
|
305
257
|
for (var i = 0; i < children.length; ++i) {
|
|
306
258
|
var primary = true;
|
|
307
259
|
var size = null;
|
|
308
260
|
var classname = partClassNames === null || partClassNames === void 0 ? void 0 : partClassNames[i];
|
|
309
261
|
var styleObj = partStyles === null || partStyles === void 0 ? void 0 : partStyles[i];
|
|
310
|
-
|
|
311
262
|
if (children.length > 1 && i !== primaryIndex) {
|
|
312
263
|
primary = false;
|
|
313
264
|
size = this.state.secondaryPaneSize;
|
|
314
265
|
}
|
|
315
|
-
|
|
316
266
|
wrappedChildren.push( /*#__PURE__*/_react.default.createElement(_Pane.default, {
|
|
317
267
|
vertical: vertical,
|
|
318
268
|
percentage: this.props.percentage,
|
|
@@ -322,7 +272,6 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
322
272
|
paneStyle: styleObj
|
|
323
273
|
}, children[i]));
|
|
324
274
|
}
|
|
325
|
-
|
|
326
275
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
327
276
|
className: containerClasses,
|
|
328
277
|
style: this.props.containerStyle,
|
|
@@ -341,7 +290,6 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
341
290
|
}), wrappedChildren.length > 1 && wrappedChildren[1]);
|
|
342
291
|
}
|
|
343
292
|
}]);
|
|
344
|
-
|
|
345
293
|
return SplitterLayout;
|
|
346
294
|
}(_react.default.Component); //
|
|
347
295
|
// SplitterLayout.propTypes = {
|
|
@@ -380,7 +328,5 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
380
328
|
// onSecondaryPaneSizeChange: null,
|
|
381
329
|
// children: []
|
|
382
330
|
// };
|
|
383
|
-
|
|
384
|
-
|
|
385
331
|
var _default = SplitterLayout;
|
|
386
332
|
exports.default = _default;
|
|
@@ -4,27 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
require("./index.less");
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function ownKeys(
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
17
|
function Pane(props) {
|
|
23
18
|
var size = props.size || 0;
|
|
24
19
|
var unit = props.percentage ? '%' : 'px';
|
|
25
20
|
var classes = "".concat(props.paneClassName, " layout-pane ");
|
|
26
21
|
var style = {};
|
|
27
|
-
|
|
28
22
|
if (!props.primary) {
|
|
29
23
|
if (props.vertical) {
|
|
30
24
|
style.height = "".concat(size).concat(unit);
|
|
@@ -34,13 +28,11 @@ function Pane(props) {
|
|
|
34
28
|
} else {
|
|
35
29
|
classes += ' layout-pane-primary';
|
|
36
30
|
}
|
|
37
|
-
|
|
38
31
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
39
32
|
className: classes,
|
|
40
33
|
style: _objectSpread(_objectSpread({}, props.paneStyle), style)
|
|
41
34
|
}, props.children);
|
|
42
35
|
}
|
|
43
|
-
|
|
44
36
|
Pane.propTypes = {
|
|
45
37
|
paneClassName: _propTypes.default.string,
|
|
46
38
|
paneStyle: _propTypes.default.object,
|
|
@@ -1,42 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _Pane = _interopRequireDefault(require("./Pane"));
|
|
15
|
-
|
|
16
11
|
require("./index.less");
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
|
|
14
|
+
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); } }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
+
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); }
|
|
19
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
30
20
|
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); }; }
|
|
31
|
-
|
|
32
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
33
|
-
|
|
21
|
+
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); }
|
|
34
22
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
-
|
|
23
|
+
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; } }
|
|
24
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
40
25
|
function clearSelection() {
|
|
41
26
|
if (document.body.createTextRange) {
|
|
42
27
|
// https://github.com/zesik/react-splitter-layout/issues/16
|
|
@@ -54,19 +39,13 @@ function clearSelection() {
|
|
|
54
39
|
document.selection.empty();
|
|
55
40
|
}
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
var DEFAULT_SPLITTER_SIZE = 4;
|
|
59
|
-
|
|
60
43
|
var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
61
44
|
_inherits(SplitterLayout, _React$Component);
|
|
62
|
-
|
|
63
45
|
var _super = _createSuper(SplitterLayout);
|
|
64
|
-
|
|
65
46
|
function SplitterLayout(props) {
|
|
66
47
|
var _this;
|
|
67
|
-
|
|
68
48
|
_classCallCheck(this, SplitterLayout);
|
|
69
|
-
|
|
70
49
|
_this = _super.call(this, props);
|
|
71
50
|
_this.handleResize = _this.handleResize.bind(_assertThisInitialized(_this));
|
|
72
51
|
_this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_this));
|
|
@@ -79,7 +58,6 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
79
58
|
};
|
|
80
59
|
return _this;
|
|
81
60
|
}
|
|
82
|
-
|
|
83
61
|
_createClass(SplitterLayout, [{
|
|
84
62
|
key: "componentDidMount",
|
|
85
63
|
value: function componentDidMount() {
|
|
@@ -89,7 +67,6 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
89
67
|
document.addEventListener('touchend', this.handleMouseUp);
|
|
90
68
|
document.addEventListener('touchmove', this.handleTouchMove);
|
|
91
69
|
var secondaryPaneSize, primaryPaneSize;
|
|
92
|
-
|
|
93
70
|
if (typeof this.props.secondaryInitialSize !== 'undefined') {
|
|
94
71
|
//设置其余部分大小
|
|
95
72
|
secondaryPaneSize = this.props.secondaryInitialSize;
|
|
@@ -98,10 +75,8 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
98
75
|
//设置主要部分大小
|
|
99
76
|
primaryPaneSize = this.props.primaryInitialSize;
|
|
100
77
|
}
|
|
101
|
-
|
|
102
78
|
var containerRect = this.container.getBoundingClientRect();
|
|
103
79
|
var splitterRect;
|
|
104
|
-
|
|
105
80
|
if (this.splitter) {
|
|
106
81
|
splitterRect = this.splitter.getBoundingClientRect();
|
|
107
82
|
} else {
|
|
@@ -111,9 +86,7 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
111
86
|
height: DEFAULT_SPLITTER_SIZE
|
|
112
87
|
};
|
|
113
88
|
}
|
|
114
|
-
|
|
115
89
|
var totalSize, splitterSize;
|
|
116
|
-
|
|
117
90
|
if (this.props.vertical) {
|
|
118
91
|
//垂直排列
|
|
119
92
|
totalSize = containerRect.height;
|
|
@@ -121,16 +94,14 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
121
94
|
} else {
|
|
122
95
|
totalSize = containerRect.width;
|
|
123
96
|
splitterSize = splitterRect.width;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
97
|
+
}
|
|
98
|
+
//计算目标对象位置
|
|
127
99
|
var primarySize = this.props.primaryIndex === 1 ? totalSize - splitterSize - primaryPaneSize : primaryPaneSize || (totalSize - splitterSize) / 2;
|
|
128
100
|
secondaryPaneSize = this.getSecondaryPaneSize(containerRect, splitterRect, {
|
|
129
101
|
left: containerRect.left + primarySize,
|
|
130
102
|
top: containerRect.top + primarySize
|
|
131
103
|
}, false);
|
|
132
104
|
}
|
|
133
|
-
|
|
134
105
|
this.setState({
|
|
135
106
|
secondaryPaneSize: secondaryPaneSize
|
|
136
107
|
});
|
|
@@ -141,7 +112,6 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
141
112
|
if (prevState.secondaryPaneSize !== this.state.secondaryPaneSize && this.props.onSecondaryPaneSizeChange) {
|
|
142
113
|
this.props.onSecondaryPaneSizeChange(this.state.secondaryPaneSize);
|
|
143
114
|
}
|
|
144
|
-
|
|
145
115
|
if (prevState.resizing !== this.state.resizing) {
|
|
146
116
|
if (this.state.resizing) {
|
|
147
117
|
if (this.props.onDragStart) {
|
|
@@ -161,27 +131,21 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
161
131
|
document.removeEventListener('touchend', this.handleMouseUp);
|
|
162
132
|
document.removeEventListener('touchmove', this.handleTouchMove);
|
|
163
133
|
} //获取第二块内容宽度or高度
|
|
164
|
-
|
|
165
134
|
}, {
|
|
166
135
|
key: "getSecondaryPaneSize",
|
|
167
136
|
value: function getSecondaryPaneSize(containerRect, splitterRect, clientPosition, offsetMouse) {
|
|
168
137
|
var totalSize;
|
|
169
138
|
var splitterSize;
|
|
170
139
|
var offset;
|
|
171
|
-
|
|
172
140
|
if (this.props.vertical) {
|
|
173
141
|
//垂直排列
|
|
174
142
|
totalSize = containerRect.height; //总高度
|
|
175
|
-
|
|
176
143
|
splitterSize = splitterRect.height; //划分条高度
|
|
177
|
-
|
|
178
144
|
offset = clientPosition.top - containerRect.top; //移动位置减去原始位置
|
|
179
145
|
} else {
|
|
180
146
|
//默认水平排列
|
|
181
147
|
totalSize = containerRect.width; //总宽度
|
|
182
|
-
|
|
183
148
|
splitterSize = splitterRect.width; //划分条宽度
|
|
184
|
-
|
|
185
149
|
offset = clientPosition.left - containerRect.left; //移动位置减去原始位置
|
|
186
150
|
}
|
|
187
151
|
|
|
@@ -189,25 +153,20 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
189
153
|
//移动
|
|
190
154
|
offset -= splitterSize / 2;
|
|
191
155
|
}
|
|
192
|
-
|
|
193
156
|
if (offset < 0) {
|
|
194
157
|
offset = 0;
|
|
195
158
|
} else if (offset > totalSize - splitterSize) {
|
|
196
159
|
//移动超过容器大小
|
|
197
160
|
offset = totalSize - splitterSize;
|
|
198
161
|
}
|
|
199
|
-
|
|
200
162
|
var secondaryPaneSize;
|
|
201
|
-
|
|
202
163
|
if (this.props.primaryIndex === 1) {
|
|
203
164
|
//目标对象是1
|
|
204
165
|
secondaryPaneSize = offset;
|
|
205
166
|
} else {
|
|
206
167
|
secondaryPaneSize = totalSize - splitterSize - offset;
|
|
207
168
|
}
|
|
208
|
-
|
|
209
169
|
var primaryPaneSize = totalSize - splitterSize - secondaryPaneSize;
|
|
210
|
-
|
|
211
170
|
if (this.props.percentage) {
|
|
212
171
|
//百分比
|
|
213
172
|
secondaryPaneSize = secondaryPaneSize * 100 / totalSize;
|
|
@@ -215,13 +174,11 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
215
174
|
splitterSize = splitterSize * 100 / totalSize;
|
|
216
175
|
totalSize = 100;
|
|
217
176
|
}
|
|
218
|
-
|
|
219
177
|
if (primaryPaneSize < this.props.primaryMinSize) {
|
|
220
178
|
secondaryPaneSize = Math.max(secondaryPaneSize - (this.props.primaryMinSize - primaryPaneSize), 0);
|
|
221
179
|
} else if (secondaryPaneSize < this.props.secondaryMinSize) {
|
|
222
180
|
secondaryPaneSize = Math.min(totalSize - splitterSize - this.props.primaryMinSize, this.props.secondaryMinSize);
|
|
223
181
|
}
|
|
224
|
-
|
|
225
182
|
return secondaryPaneSize;
|
|
226
183
|
}
|
|
227
184
|
}, {
|
|
@@ -281,41 +238,31 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
281
238
|
key: "render",
|
|
282
239
|
value: function render() {
|
|
283
240
|
var _this2 = this;
|
|
284
|
-
|
|
285
241
|
var containerClasses = 'splitter-layout';
|
|
286
|
-
|
|
287
242
|
if (this.props.customClassName) {
|
|
288
243
|
containerClasses += " ".concat(this.props.customClassName);
|
|
289
244
|
}
|
|
290
|
-
|
|
291
245
|
if (this.props.vertical) {
|
|
292
246
|
containerClasses += ' splitter-layout-vertical';
|
|
293
247
|
}
|
|
294
|
-
|
|
295
248
|
if (this.state.resizing) {
|
|
296
249
|
containerClasses += ' layout-changing';
|
|
297
250
|
}
|
|
298
|
-
|
|
299
251
|
var children = _react.default.Children.toArray(this.props.children).slice(0, 2);
|
|
300
|
-
|
|
301
252
|
if (children.length === 0) {
|
|
302
253
|
children.push( /*#__PURE__*/_react.default.createElement("div", null));
|
|
303
254
|
}
|
|
304
|
-
|
|
305
255
|
var wrappedChildren = [];
|
|
306
256
|
var primaryIndex = this.props.primaryIndex !== 0 && this.props.primaryIndex !== 1 ? 0 : this.props.primaryIndex;
|
|
307
|
-
|
|
308
257
|
for (var i = 0; i < children.length; ++i) {
|
|
309
258
|
var primary = true;
|
|
310
259
|
var size = null;
|
|
311
260
|
var classname = this.props.partClassNames[i];
|
|
312
261
|
var styleObj = this.props.partStyles[i];
|
|
313
|
-
|
|
314
262
|
if (children.length > 1 && i !== primaryIndex) {
|
|
315
263
|
primary = false;
|
|
316
264
|
size = this.state.secondaryPaneSize;
|
|
317
265
|
}
|
|
318
|
-
|
|
319
266
|
wrappedChildren.push( /*#__PURE__*/_react.default.createElement(_Pane.default, {
|
|
320
267
|
vertical: this.props.vertical,
|
|
321
268
|
percentage: this.props.percentage,
|
|
@@ -325,7 +272,6 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
325
272
|
paneStyle: styleObj
|
|
326
273
|
}, children[i]));
|
|
327
274
|
}
|
|
328
|
-
|
|
329
275
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
330
276
|
className: containerClasses,
|
|
331
277
|
style: this.props.containerStyle,
|
|
@@ -344,10 +290,8 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
344
290
|
}), wrappedChildren.length > 1 && wrappedChildren[1]);
|
|
345
291
|
}
|
|
346
292
|
}]);
|
|
347
|
-
|
|
348
293
|
return SplitterLayout;
|
|
349
294
|
}(_react.default.Component);
|
|
350
|
-
|
|
351
295
|
SplitterLayout.propTypes = {
|
|
352
296
|
containerStyle: _propTypes.default.object,
|
|
353
297
|
customClassName: _propTypes.default.string,
|
|
@@ -4,35 +4,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
require("antd/es/spin/style");
|
|
9
|
-
|
|
10
8
|
var _spin = _interopRequireDefault(require("antd/es/spin"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _DragContent = _interopRequireDefault(require("../DragContent"));
|
|
17
|
-
|
|
18
12
|
require("./style/index.less");
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
var SubfieldContent = function SubfieldContent(props) {
|
|
23
15
|
var _props$leftSiderWidth = props.leftSiderWidth,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
leftSiderWidth = _props$leftSiderWidth === void 0 ? 180 : _props$leftSiderWidth,
|
|
17
|
+
leftSiderNode = props.leftSiderNode,
|
|
18
|
+
children = props.children,
|
|
19
|
+
className = props.className,
|
|
20
|
+
style = props.style,
|
|
21
|
+
leftSiderClassName = props.leftSiderClassName,
|
|
22
|
+
_props$loading = props.loading,
|
|
23
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
24
|
+
loadingTip = props.loadingTip,
|
|
25
|
+
leftSiderDragDirection = props.leftSiderDragDirection,
|
|
26
|
+
leftSiderMoveMaxWidth = props.leftSiderMoveMaxWidth,
|
|
27
|
+
leftSiderMoveMaxHeight = props.leftSiderMoveMaxHeight;
|
|
36
28
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
29
|
className: (0, _classnames.default)('spec-grid-content', loading ? 'spec-grid-content-loading' : '', className),
|
|
38
30
|
style: style
|
|
@@ -51,6 +43,5 @@ var SubfieldContent = function SubfieldContent(props) {
|
|
|
51
43
|
className: 'spec-grid-right'
|
|
52
44
|
}, children));
|
|
53
45
|
};
|
|
54
|
-
|
|
55
46
|
var _default = SubfieldContent;
|
|
56
47
|
exports.default = _default;
|