fan-standard-comp 3.1.2 → 3.1.4
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/package.json +1 -1
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fan-standard-comp.umd.js +0 -597
- package/dist/fonts/iconfont.eot +0 -0
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/es/ButtonGroup/ButtonList.d.ts +0 -2
- package/es/ButtonGroup/ButtonList.js +0 -37
- package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/es/ButtonGroup/ButtonMenu.js +0 -38
- package/es/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/es/ButtonGroup/PopConfirmTitle.js +0 -37
- package/es/ButtonGroup/index.d.ts +0 -30
- package/es/ButtonGroup/index.js +0 -374
- package/es/ButtonGroup/style/index.less +0 -36
- package/es/DragContent/DragBar.js +0 -21
- package/es/DragContent/index.d.ts +0 -14
- package/es/DragContent/index.js +0 -173
- package/es/DragContent/index.less +0 -44
- package/es/FormComp/ChunkUploader/api.js +0 -76
- package/es/FormComp/ChunkUploader/index.js +0 -391
- package/es/FormComp/ChunkUploader/lib.js +0 -96
- package/es/FormComp/ChunkUploader/style/style.less +0 -3
- package/es/FormComp/ChunkUploader/upload-queue.class.js +0 -167
- package/es/FormComp/ChunkUploader/worker.js +0 -23
- package/es/FormComp/EditButton/index.d.ts +0 -26
- package/es/FormComp/EditButton/index.js +0 -140
- package/es/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/es/FormComp/FieldComponent/ReUpload.js +0 -131
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +0 -245
- package/es/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/es/FormComp/FieldComponent/TitleNode.js +0 -9
- package/es/FormComp/FieldComponent/index.d.ts +0 -38
- package/es/FormComp/FieldComponent/index.js +0 -413
- package/es/FormComp/FieldComponent/setReadonlyValues.js +0 -236
- package/es/FormComp/FieldComponent/style/index.less +0 -116
- package/es/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/es/FormComp/RenderItemGroup/index.js +0 -234
- package/es/FormComp/Uploader/index.d.ts +0 -19
- package/es/FormComp/Uploader/index.js +0 -275
- package/es/FormComp/Uploader/style/index.less +0 -14
- package/es/FormComp/Uploader/util.d.ts +0 -8
- package/es/FormComp/Uploader/util.js +0 -38
- package/es/FormComp/VarTemplate/index.js +0 -293
- package/es/FormComp/index.d.ts +0 -1
- package/es/FormComp/index.js +0 -1
- package/es/NavLeafScroll/index.js +0 -379
- package/es/NavLeafScroll/style/index.less +0 -119
- package/es/RefactorTree/data.d.ts +0 -7
- package/es/RefactorTree/index.d.ts +0 -40
- package/es/RefactorTree/index.js +0 -167
- package/es/RefactorTree/indexTreeNode.d.ts +0 -39
- package/es/RefactorTree/indexTreeNode.js +0 -237
- package/es/RefactorTree/style/index.d.ts +0 -1
- package/es/RefactorTree/style/index.js +0 -1
- package/es/RefactorTree/style/index.less +0 -22
- package/es/RefactorTree/util.d.ts +0 -42
- package/es/RefactorTree/util.js +0 -187
- package/es/SpecIcon/fonts/demo.css +0 -539
- package/es/SpecIcon/fonts/demo_index.html +0 -1315
- package/es/SpecIcon/fonts/iconfont.css +0 -211
- package/es/SpecIcon/fonts/iconfont.eot +0 -0
- package/es/SpecIcon/fonts/iconfont.js +0 -41
- package/es/SpecIcon/fonts/iconfont.json +0 -352
- package/es/SpecIcon/fonts/iconfont.svg +0 -173
- package/es/SpecIcon/fonts/iconfont.ttf +0 -0
- package/es/SpecIcon/fonts/iconfont.woff +0 -0
- package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/es/SpecIcon/index.d.ts +0 -17
- package/es/SpecIcon/index.js +0 -77
- package/es/SpecIcon/style/iconfont.less +0 -213
- package/es/SpecIcon/style/index.less +0 -98
- package/es/SplitterLayout/Pane.d.ts +0 -13
- package/es/SplitterLayout/Pane.js +0 -36
- package/es/SplitterLayout/index.js +0 -375
- package/es/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SplitterLayout/Pane.js +0 -50
- package/es/StandardContent/SplitterLayout/index.js +0 -374
- package/es/StandardContent/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SubfieldContent.d.ts +0 -17
- package/es/StandardContent/SubfieldContent.js +0 -41
- package/es/StandardContent/WrapperContent.d.ts +0 -13
- package/es/StandardContent/WrapperContent.js +0 -29
- package/es/StandardContent/data.d.ts +0 -101
- package/es/StandardContent/style/index.less +0 -80
- package/es/StandardDragModal/index.d.ts +0 -11
- package/es/StandardDragModal/index.js +0 -30
- package/es/StandardFilter/index.d.ts +0 -35
- package/es/StandardFilter/index.js +0 -253
- package/es/StandardFilter/style/index.less +0 -62
- package/es/StandardForm/ActionList.js +0 -44
- package/es/StandardForm/StepForm.d.ts +0 -19
- package/es/StandardForm/StepForm.js +0 -267
- package/es/StandardForm/TabForm.d.ts +0 -19
- package/es/StandardForm/TabForm.js +0 -122
- package/es/StandardForm/index.d.ts +0 -32
- package/es/StandardForm/index.js +0 -170
- package/es/StandardForm/style/index.less +0 -58
- package/es/StandardModal/UpdateFormRef.js +0 -18
- package/es/StandardModal/index.d.ts +0 -44
- package/es/StandardModal/index.js +0 -495
- package/es/StandardModal/style/index.less +0 -50
- package/es/StandardPanel/index.d.ts +0 -28
- package/es/StandardPanel/index.js +0 -134
- package/es/StandardPanel/style/index.less +0 -135
- package/es/StandardTable/index.d.ts +0 -22
- package/es/StandardTable/index.js +0 -126
- package/es/StandardTable/style/index.d.ts +0 -1
- package/es/StandardTable/style/index.js +0 -1
- package/es/StandardTable/style/index.less +0 -206
- package/es/components/IconNode/index.d.ts +0 -16
- package/es/components/IconNode/index.js +0 -28
- package/es/components/index.d.ts +0 -2
- package/es/components/index.js +0 -2
- package/es/data/func.code.js +0 -112
- package/es/data/general.config.js +0 -172
- package/es/data/index.js +0 -3
- package/es/index.d.ts +0 -24
- package/es/index.js +0 -31
- package/es/styles/index.less +0 -0
- package/es/theme/spec-variable.less +0 -48
- package/es/utils/ValueFormat.js +0 -50
- package/es/utils/filterPermission.js +0 -111
- package/es/utils/getParentNodes.js +0 -215
- package/es/utils/index.js +0 -3
- package/lib/ButtonGroup/ButtonList.d.ts +0 -2
- package/lib/ButtonGroup/ButtonList.js +0 -55
- package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/lib/ButtonGroup/ButtonMenu.js +0 -51
- package/lib/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/lib/ButtonGroup/PopConfirmTitle.js +0 -48
- package/lib/ButtonGroup/index.d.ts +0 -30
- package/lib/ButtonGroup/index.js +0 -405
- package/lib/ButtonGroup/style/index.less +0 -36
- package/lib/DragContent/DragBar.js +0 -33
- package/lib/DragContent/index.d.ts +0 -14
- package/lib/DragContent/index.js +0 -191
- package/lib/DragContent/index.less +0 -44
- package/lib/FormComp/ChunkUploader/api.js +0 -89
- package/lib/FormComp/ChunkUploader/index.js +0 -410
- package/lib/FormComp/ChunkUploader/lib.js +0 -113
- package/lib/FormComp/ChunkUploader/style/style.less +0 -3
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +0 -174
- package/lib/FormComp/ChunkUploader/worker.js +0 -28
- package/lib/FormComp/EditButton/index.d.ts +0 -26
- package/lib/FormComp/EditButton/index.js +0 -159
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/lib/FormComp/FieldComponent/ReUpload.js +0 -151
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +0 -268
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/lib/FormComp/FieldComponent/TitleNode.js +0 -19
- package/lib/FormComp/FieldComponent/index.d.ts +0 -38
- package/lib/FormComp/FieldComponent/index.js +0 -457
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +0 -263
- package/lib/FormComp/FieldComponent/style/index.less +0 -116
- package/lib/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/lib/FormComp/RenderItemGroup/index.js +0 -255
- package/lib/FormComp/Uploader/index.d.ts +0 -19
- package/lib/FormComp/Uploader/index.js +0 -301
- package/lib/FormComp/Uploader/style/index.less +0 -14
- package/lib/FormComp/Uploader/util.d.ts +0 -8
- package/lib/FormComp/Uploader/util.js +0 -47
- package/lib/FormComp/VarTemplate/index.js +0 -308
- package/lib/FormComp/index.d.ts +0 -1
- package/lib/FormComp/index.js +0 -15
- package/lib/NavLeafScroll/index.js +0 -397
- package/lib/NavLeafScroll/style/index.less +0 -119
- package/lib/RefactorTree/data.d.ts +0 -7
- package/lib/RefactorTree/index.d.ts +0 -40
- package/lib/RefactorTree/index.js +0 -190
- package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
- package/lib/RefactorTree/indexTreeNode.js +0 -260
- package/lib/RefactorTree/style/index.d.ts +0 -1
- package/lib/RefactorTree/style/index.js +0 -3
- package/lib/RefactorTree/style/index.less +0 -22
- package/lib/RefactorTree/util.d.ts +0 -42
- package/lib/RefactorTree/util.js +0 -195
- package/lib/SpecIcon/fonts/demo.css +0 -539
- package/lib/SpecIcon/fonts/demo_index.html +0 -1315
- package/lib/SpecIcon/fonts/iconfont.css +0 -211
- package/lib/SpecIcon/fonts/iconfont.eot +0 -0
- package/lib/SpecIcon/fonts/iconfont.js +0 -43
- package/lib/SpecIcon/fonts/iconfont.json +0 -352
- package/lib/SpecIcon/fonts/iconfont.svg +0 -173
- package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/lib/SpecIcon/index.d.ts +0 -17
- package/lib/SpecIcon/index.js +0 -90
- package/lib/SpecIcon/style/iconfont.less +0 -213
- package/lib/SpecIcon/style/index.less +0 -98
- package/lib/SplitterLayout/Pane.d.ts +0 -13
- package/lib/SplitterLayout/Pane.js +0 -48
- package/lib/SplitterLayout/index.js +0 -386
- package/lib/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SplitterLayout/Pane.js +0 -62
- package/lib/StandardContent/SplitterLayout/index.js +0 -387
- package/lib/StandardContent/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SubfieldContent.d.ts +0 -17
- package/lib/StandardContent/SubfieldContent.js +0 -56
- package/lib/StandardContent/WrapperContent.d.ts +0 -13
- package/lib/StandardContent/WrapperContent.js +0 -43
- package/lib/StandardContent/data.d.ts +0 -101
- package/lib/StandardContent/style/index.less +0 -80
- package/lib/StandardDragModal/index.d.ts +0 -11
- package/lib/StandardDragModal/index.js +0 -43
- package/lib/StandardFilter/index.d.ts +0 -35
- package/lib/StandardFilter/index.js +0 -272
- package/lib/StandardFilter/style/index.less +0 -62
- package/lib/StandardForm/ActionList.js +0 -57
- package/lib/StandardForm/StepForm.d.ts +0 -19
- package/lib/StandardForm/StepForm.js +0 -295
- package/lib/StandardForm/TabForm.d.ts +0 -19
- package/lib/StandardForm/TabForm.js +0 -148
- package/lib/StandardForm/index.d.ts +0 -32
- package/lib/StandardForm/index.js +0 -197
- package/lib/StandardForm/style/index.less +0 -58
- package/lib/StandardModal/UpdateFormRef.js +0 -32
- package/lib/StandardModal/index.d.ts +0 -44
- package/lib/StandardModal/index.js +0 -525
- package/lib/StandardModal/style/index.less +0 -50
- package/lib/StandardPanel/index.d.ts +0 -28
- package/lib/StandardPanel/index.js +0 -155
- package/lib/StandardPanel/style/index.less +0 -135
- package/lib/StandardTable/index.d.ts +0 -22
- package/lib/StandardTable/index.js +0 -143
- package/lib/StandardTable/style/index.d.ts +0 -1
- package/lib/StandardTable/style/index.js +0 -3
- package/lib/StandardTable/style/index.less +0 -206
- package/lib/components/IconNode/index.d.ts +0 -16
- package/lib/components/IconNode/index.js +0 -39
- package/lib/components/index.d.ts +0 -2
- package/lib/components/index.js +0 -15
- package/lib/data/func.code.js +0 -119
- package/lib/data/general.config.js +0 -179
- package/lib/data/index.js +0 -23
- package/lib/index.d.ts +0 -24
- package/lib/index.js +0 -236
- package/lib/styles/index.less +0 -0
- package/lib/theme/spec-variable.less +0 -48
- package/lib/utils/ValueFormat.js +0 -58
- package/lib/utils/filterPermission.js +0 -127
- package/lib/utils/getParentNodes.js +0 -226
- package/lib/utils/index.js +0 -35
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
-
|
|
3
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
|
|
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, descriptor.key, descriptor); } }
|
|
6
|
-
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
8
|
-
|
|
9
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
-
|
|
11
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
-
|
|
13
|
-
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); }; }
|
|
14
|
-
|
|
15
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
16
|
-
|
|
17
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
-
|
|
19
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
-
|
|
21
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
-
|
|
23
|
-
import React from 'react'; // import PropTypes from 'prop-types';
|
|
24
|
-
|
|
25
|
-
import Pane from './Pane';
|
|
26
|
-
import './index.less';
|
|
27
|
-
|
|
28
|
-
function clearSelection() {
|
|
29
|
-
if (document.body.createTextRange) {
|
|
30
|
-
// https://github.com/zesik/react-splitter-layout/issues/16
|
|
31
|
-
// https://stackoverflow.com/questions/22914075/#37580789
|
|
32
|
-
var range = document.body.createTextRange();
|
|
33
|
-
range.collapse();
|
|
34
|
-
range.select();
|
|
35
|
-
} else if (window.getSelection) {
|
|
36
|
-
if (window.getSelection().empty) {
|
|
37
|
-
window.getSelection().empty();
|
|
38
|
-
} else if (window.getSelection().removeAllRanges) {
|
|
39
|
-
window.getSelection().removeAllRanges();
|
|
40
|
-
}
|
|
41
|
-
} else if (document.selection) {
|
|
42
|
-
document.selection.empty();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var DEFAULT_SPLITTER_SIZE = 4;
|
|
47
|
-
|
|
48
|
-
var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
49
|
-
_inherits(SplitterLayout, _React$Component);
|
|
50
|
-
|
|
51
|
-
var _super = _createSuper(SplitterLayout);
|
|
52
|
-
|
|
53
|
-
function SplitterLayout(props) {
|
|
54
|
-
var _this;
|
|
55
|
-
|
|
56
|
-
_classCallCheck(this, SplitterLayout);
|
|
57
|
-
|
|
58
|
-
_this = _super.call(this, props);
|
|
59
|
-
_this.handleResize = _this.handleResize.bind(_assertThisInitialized(_this));
|
|
60
|
-
_this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_this));
|
|
61
|
-
_this.handleMouseUp = _this.handleMouseUp.bind(_assertThisInitialized(_this));
|
|
62
|
-
_this.handleTouchMove = _this.handleTouchMove.bind(_assertThisInitialized(_this));
|
|
63
|
-
_this.handleSplitterMouseDown = _this.handleSplitterMouseDown.bind(_assertThisInitialized(_this));
|
|
64
|
-
_this.state = {
|
|
65
|
-
secondaryPaneSize: 0,
|
|
66
|
-
resizing: false
|
|
67
|
-
};
|
|
68
|
-
return _this;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
_createClass(SplitterLayout, [{
|
|
72
|
-
key: "componentDidMount",
|
|
73
|
-
value: function componentDidMount() {
|
|
74
|
-
window.addEventListener('resize', this.handleResize);
|
|
75
|
-
document.addEventListener('mouseup', this.handleMouseUp);
|
|
76
|
-
document.addEventListener('mousemove', this.handleMouseMove);
|
|
77
|
-
document.addEventListener('touchend', this.handleMouseUp);
|
|
78
|
-
document.addEventListener('touchmove', this.handleTouchMove);
|
|
79
|
-
var secondaryPaneSize, primaryPaneSize;
|
|
80
|
-
|
|
81
|
-
if (typeof this.props.secondaryInitialSize !== 'undefined') {
|
|
82
|
-
//设置其余部分大小
|
|
83
|
-
secondaryPaneSize = this.props.secondaryInitialSize;
|
|
84
|
-
} else {
|
|
85
|
-
if (typeof this.props.primaryInitialSize !== 'undefined') {
|
|
86
|
-
//设置主要部分大小
|
|
87
|
-
primaryPaneSize = this.props.primaryInitialSize;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
var containerRect = this.container.getBoundingClientRect();
|
|
91
|
-
var splitterRect;
|
|
92
|
-
|
|
93
|
-
if (this.splitter) {
|
|
94
|
-
splitterRect = this.splitter.getBoundingClientRect();
|
|
95
|
-
} else {
|
|
96
|
-
// Simulate a splitter
|
|
97
|
-
splitterRect = {
|
|
98
|
-
width: DEFAULT_SPLITTER_SIZE,
|
|
99
|
-
height: DEFAULT_SPLITTER_SIZE
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
var totalSize, splitterSize;
|
|
104
|
-
|
|
105
|
-
if (this.props.vertical) {
|
|
106
|
-
//垂直排列
|
|
107
|
-
totalSize = containerRect.height;
|
|
108
|
-
splitterSize = splitterRect.height;
|
|
109
|
-
} else {
|
|
110
|
-
totalSize = containerRect.width;
|
|
111
|
-
splitterSize = splitterRect.width;
|
|
112
|
-
} //计算目标对象位置
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var primarySize = this.props.primaryIndex === 1 ? totalSize - splitterSize - primaryPaneSize : primaryPaneSize || (totalSize - splitterSize) / 2;
|
|
116
|
-
secondaryPaneSize = this.getSecondaryPaneSize(containerRect, splitterRect, {
|
|
117
|
-
left: containerRect.left + primarySize,
|
|
118
|
-
top: containerRect.top + primarySize
|
|
119
|
-
}, false);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
this.setState({
|
|
123
|
-
secondaryPaneSize: secondaryPaneSize
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}, {
|
|
127
|
-
key: "componentDidUpdate",
|
|
128
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
129
|
-
if (prevState.secondaryPaneSize !== this.state.secondaryPaneSize && this.props.onSecondaryPaneSizeChange) {
|
|
130
|
-
this.props.onSecondaryPaneSizeChange(this.state.secondaryPaneSize);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (prevState.resizing !== this.state.resizing) {
|
|
134
|
-
if (this.state.resizing) {
|
|
135
|
-
if (this.props.onDragStart) {
|
|
136
|
-
this.props.onDragStart();
|
|
137
|
-
}
|
|
138
|
-
} else if (this.props.onDragEnd) {
|
|
139
|
-
this.props.onDragEnd();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}, {
|
|
144
|
-
key: "componentWillUnmount",
|
|
145
|
-
value: function componentWillUnmount() {
|
|
146
|
-
window.removeEventListener('resize', this.handleResize);
|
|
147
|
-
document.removeEventListener('mouseup', this.handleMouseUp);
|
|
148
|
-
document.removeEventListener('mousemove', this.handleMouseMove);
|
|
149
|
-
document.removeEventListener('touchend', this.handleMouseUp);
|
|
150
|
-
document.removeEventListener('touchmove', this.handleTouchMove);
|
|
151
|
-
} //获取第二块内容宽度or高度
|
|
152
|
-
|
|
153
|
-
}, {
|
|
154
|
-
key: "getSecondaryPaneSize",
|
|
155
|
-
value: function getSecondaryPaneSize(containerRect, splitterRect, clientPosition, offsetMouse) {
|
|
156
|
-
var totalSize;
|
|
157
|
-
var splitterSize;
|
|
158
|
-
var offset;
|
|
159
|
-
|
|
160
|
-
if (this.props.vertical) {
|
|
161
|
-
//垂直排列
|
|
162
|
-
totalSize = containerRect.height; //总高度
|
|
163
|
-
|
|
164
|
-
splitterSize = splitterRect.height; //划分条高度
|
|
165
|
-
|
|
166
|
-
offset = clientPosition.top - containerRect.top; //移动位置减去原始位置
|
|
167
|
-
} else {
|
|
168
|
-
//默认水平排列
|
|
169
|
-
totalSize = containerRect.width; //总宽度
|
|
170
|
-
|
|
171
|
-
splitterSize = splitterRect.width; //划分条宽度
|
|
172
|
-
|
|
173
|
-
offset = clientPosition.left - containerRect.left; //移动位置减去原始位置
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
if (offsetMouse) {
|
|
177
|
-
//移动
|
|
178
|
-
offset -= splitterSize / 2;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (offset < 0) {
|
|
182
|
-
offset = 0;
|
|
183
|
-
} else if (offset > totalSize - splitterSize) {
|
|
184
|
-
//移动超过容器大小
|
|
185
|
-
offset = totalSize - splitterSize;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
var secondaryPaneSize;
|
|
189
|
-
|
|
190
|
-
if (this.props.primaryIndex === 1) {
|
|
191
|
-
//目标对象是1
|
|
192
|
-
secondaryPaneSize = offset;
|
|
193
|
-
} else {
|
|
194
|
-
secondaryPaneSize = totalSize - splitterSize - offset;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
var primaryPaneSize = totalSize - splitterSize - secondaryPaneSize;
|
|
198
|
-
|
|
199
|
-
if (this.props.percentage) {
|
|
200
|
-
//百分比
|
|
201
|
-
secondaryPaneSize = secondaryPaneSize * 100 / totalSize;
|
|
202
|
-
primaryPaneSize = primaryPaneSize * 100 / totalSize;
|
|
203
|
-
splitterSize = splitterSize * 100 / totalSize;
|
|
204
|
-
totalSize = 100;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
if (primaryPaneSize < this.props.primaryMinSize) {
|
|
208
|
-
secondaryPaneSize = Math.max(secondaryPaneSize - (this.props.primaryMinSize - primaryPaneSize), 0);
|
|
209
|
-
} else if (secondaryPaneSize < this.props.secondaryMinSize) {
|
|
210
|
-
secondaryPaneSize = Math.min(totalSize - splitterSize - this.props.primaryMinSize, this.props.secondaryMinSize);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return secondaryPaneSize;
|
|
214
|
-
}
|
|
215
|
-
}, {
|
|
216
|
-
key: "handleResize",
|
|
217
|
-
value: function handleResize() {
|
|
218
|
-
if (this.splitter && !this.props.percentage) {
|
|
219
|
-
var containerRect = this.container.getBoundingClientRect();
|
|
220
|
-
var splitterRect = this.splitter.getBoundingClientRect();
|
|
221
|
-
var secondaryPaneSize = this.getSecondaryPaneSize(containerRect, splitterRect, {
|
|
222
|
-
left: splitterRect.left,
|
|
223
|
-
top: splitterRect.top
|
|
224
|
-
}, false);
|
|
225
|
-
this.setState({
|
|
226
|
-
secondaryPaneSize: secondaryPaneSize
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}, {
|
|
231
|
-
key: "handleMouseMove",
|
|
232
|
-
value: function handleMouseMove(e) {
|
|
233
|
-
if (this.state.resizing) {
|
|
234
|
-
var containerRect = this.container.getBoundingClientRect();
|
|
235
|
-
var splitterRect = this.splitter.getBoundingClientRect();
|
|
236
|
-
var secondaryPaneSize = this.getSecondaryPaneSize(containerRect, splitterRect, {
|
|
237
|
-
left: e.clientX,
|
|
238
|
-
top: e.clientY
|
|
239
|
-
}, true);
|
|
240
|
-
clearSelection();
|
|
241
|
-
this.setState({
|
|
242
|
-
secondaryPaneSize: secondaryPaneSize
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}, {
|
|
247
|
-
key: "handleTouchMove",
|
|
248
|
-
value: function handleTouchMove(e) {
|
|
249
|
-
this.handleMouseMove(e.changedTouches[0]);
|
|
250
|
-
}
|
|
251
|
-
}, {
|
|
252
|
-
key: "handleSplitterMouseDown",
|
|
253
|
-
value: function handleSplitterMouseDown() {
|
|
254
|
-
clearSelection();
|
|
255
|
-
this.setState({
|
|
256
|
-
resizing: true
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
}, {
|
|
260
|
-
key: "handleMouseUp",
|
|
261
|
-
value: function handleMouseUp() {
|
|
262
|
-
this.setState(function (prevState) {
|
|
263
|
-
return prevState.resizing ? {
|
|
264
|
-
resizing: false
|
|
265
|
-
} : null;
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
}, {
|
|
269
|
-
key: "render",
|
|
270
|
-
value: function render() {
|
|
271
|
-
var _this2 = this;
|
|
272
|
-
|
|
273
|
-
var _this$props = this.props,
|
|
274
|
-
customClassName = _this$props.customClassName,
|
|
275
|
-
vertical = _this$props.vertical,
|
|
276
|
-
_this$props$partClass = _this$props.partClassNames,
|
|
277
|
-
partClassNames = _this$props$partClass === void 0 ? [] : _this$props$partClass,
|
|
278
|
-
_this$props$partStyle = _this$props.partStyles,
|
|
279
|
-
partStyles = _this$props$partStyle === void 0 ? [] : _this$props$partStyle;
|
|
280
|
-
var containerClasses = "splitter-layout ".concat(customClassName || '').concat(vertical ? ' splitter-layout-vertical' : '');
|
|
281
|
-
|
|
282
|
-
if (this.state.resizing) {
|
|
283
|
-
containerClasses += ' layout-changing';
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
var children = React.Children.toArray(this.props.children).slice(0, 2);
|
|
287
|
-
|
|
288
|
-
if (children.length === 0) {
|
|
289
|
-
children.push( /*#__PURE__*/React.createElement("div", null));
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
var wrappedChildren = [];
|
|
293
|
-
var primaryIndex = this.props.primaryIndex !== 0 && this.props.primaryIndex !== 1 ? 0 : this.props.primaryIndex;
|
|
294
|
-
|
|
295
|
-
for (var i = 0; i < children.length; ++i) {
|
|
296
|
-
var primary = true;
|
|
297
|
-
var size = null;
|
|
298
|
-
var classname = partClassNames === null || partClassNames === void 0 ? void 0 : partClassNames[i];
|
|
299
|
-
var styleObj = partStyles === null || partStyles === void 0 ? void 0 : partStyles[i];
|
|
300
|
-
|
|
301
|
-
if (children.length > 1 && i !== primaryIndex) {
|
|
302
|
-
primary = false;
|
|
303
|
-
size = this.state.secondaryPaneSize;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
wrappedChildren.push( /*#__PURE__*/React.createElement(Pane, {
|
|
307
|
-
vertical: vertical,
|
|
308
|
-
percentage: this.props.percentage,
|
|
309
|
-
primary: primary,
|
|
310
|
-
size: size,
|
|
311
|
-
paneClassName: classname,
|
|
312
|
-
paneStyle: styleObj
|
|
313
|
-
}, children[i]));
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
317
|
-
className: containerClasses,
|
|
318
|
-
style: this.props.containerStyle,
|
|
319
|
-
ref: function ref(c) {
|
|
320
|
-
_this2.container = c;
|
|
321
|
-
}
|
|
322
|
-
}, wrappedChildren[0], wrappedChildren.length > 1 && /*#__PURE__*/React.createElement("div", {
|
|
323
|
-
role: "separator",
|
|
324
|
-
className: "layout-splitter ".concat(!this.props.vertical && 'layout-splitter-horizontal', " ").concat(this.props.splitterClassName),
|
|
325
|
-
style: this.props.splitterStyle,
|
|
326
|
-
ref: function ref(c) {
|
|
327
|
-
_this2.splitter = c;
|
|
328
|
-
},
|
|
329
|
-
onMouseDown: this.handleSplitterMouseDown,
|
|
330
|
-
onTouchStart: this.handleSplitterMouseDown
|
|
331
|
-
}), wrappedChildren.length > 1 && wrappedChildren[1]);
|
|
332
|
-
}
|
|
333
|
-
}]);
|
|
334
|
-
|
|
335
|
-
return SplitterLayout;
|
|
336
|
-
}(React.Component); //
|
|
337
|
-
// SplitterLayout.propTypes = {
|
|
338
|
-
// containerStyle: PropTypes.object,
|
|
339
|
-
// customClassName: PropTypes.string,
|
|
340
|
-
// splitterClassName: PropTypes.string,
|
|
341
|
-
// splitterStyle: PropTypes.object,
|
|
342
|
-
// partClassNames: PropTypes.arrayOf(PropTypes.string),
|
|
343
|
-
// partStyles: PropTypes.arrayOf(PropTypes.object),
|
|
344
|
-
// vertical: PropTypes.bool,
|
|
345
|
-
// percentage: PropTypes.bool,
|
|
346
|
-
// primaryIndex: PropTypes.number,
|
|
347
|
-
// primaryMinSize: PropTypes.number,
|
|
348
|
-
// primaryInitialSize:PropTypes.number,
|
|
349
|
-
// secondaryInitialSize: PropTypes.number,
|
|
350
|
-
// secondaryMinSize: PropTypes.number,
|
|
351
|
-
// onDragStart: PropTypes.func,
|
|
352
|
-
// onDragEnd: PropTypes.func,
|
|
353
|
-
// onSecondaryPaneSizeChange: PropTypes.func,
|
|
354
|
-
// children: PropTypes.arrayOf(PropTypes.node)
|
|
355
|
-
// };
|
|
356
|
-
//
|
|
357
|
-
// SplitterLayout.defaultProps = {
|
|
358
|
-
// customClassName: '',
|
|
359
|
-
// splitterClassName: '',
|
|
360
|
-
// partClassNames:[],
|
|
361
|
-
// partStyles:[],
|
|
362
|
-
// vertical: false,
|
|
363
|
-
// percentage: false,
|
|
364
|
-
// primaryIndex: 0,
|
|
365
|
-
// primaryMinSize: 0,
|
|
366
|
-
// secondaryInitialSize: undefined,
|
|
367
|
-
// secondaryMinSize: 0,
|
|
368
|
-
// onDragStart: null,
|
|
369
|
-
// onDragEnd: null,
|
|
370
|
-
// onSecondaryPaneSizeChange: null,
|
|
371
|
-
// children: []
|
|
372
|
-
// };
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
export default SplitterLayout;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
@import '~antd/lib/style/themes/default.less';
|
|
2
|
-
.splitter-layout {
|
|
3
|
-
position: relative;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.spec-grid-content .splitter-layout .layout-pane,.splitter-layout .layout-pane {
|
|
12
|
-
position: relative;
|
|
13
|
-
flex: 0 0 auto;
|
|
14
|
-
overflow: auto;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.spec-grid-content .splitter-layout .layout-pane.layout-pane-primary,.splitter-layout .layout-pane.layout-pane-primary {
|
|
18
|
-
flex: 1 1 auto;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.splitter-layout > .layout-splitter {
|
|
22
|
-
flex: 0 0 auto;
|
|
23
|
-
width: 4px;
|
|
24
|
-
height: 100%;
|
|
25
|
-
cursor: col-resize;
|
|
26
|
-
background-color: rgba(0,0,0,0);
|
|
27
|
-
}
|
|
28
|
-
.splitter-layout > .layout-splitter-horizontal{
|
|
29
|
-
padding-bottom:9999px;
|
|
30
|
-
margin-bottom:-9999px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.splitter-layout .layout-splitter:hover {
|
|
34
|
-
background-color: rgba(0,0,0,.1);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.splitter-layout.layout-changing {
|
|
38
|
-
cursor: col-resize;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.splitter-layout.layout-changing > .layout-splitter {
|
|
42
|
-
background-color: rgba(0,0,0,.1);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.splitter-layout.splitter-layout-vertical {
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
height: 150px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.splitter-layout.splitter-layout-vertical.layout-changing {
|
|
51
|
-
cursor: row-resize;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.splitter-layout.splitter-layout-vertical > .layout-splitter {
|
|
55
|
-
width: 100%;
|
|
56
|
-
height: 4px;
|
|
57
|
-
cursor: row-resize;
|
|
58
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
import './index.less';
|
|
10
|
-
|
|
11
|
-
function Pane(props) {
|
|
12
|
-
var size = props.size || 0;
|
|
13
|
-
var unit = props.percentage ? '%' : 'px';
|
|
14
|
-
var classes = "".concat(props.paneClassName, " layout-pane ");
|
|
15
|
-
var style = {};
|
|
16
|
-
|
|
17
|
-
if (!props.primary) {
|
|
18
|
-
if (props.vertical) {
|
|
19
|
-
style.height = "".concat(size).concat(unit);
|
|
20
|
-
} else {
|
|
21
|
-
style.width = "".concat(size).concat(unit);
|
|
22
|
-
}
|
|
23
|
-
} else {
|
|
24
|
-
classes += ' layout-pane-primary';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
-
className: classes,
|
|
29
|
-
style: _objectSpread(_objectSpread({}, props.paneStyle), style)
|
|
30
|
-
}, props.children);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
Pane.propTypes = {
|
|
34
|
-
paneClassName: PropTypes.string,
|
|
35
|
-
paneStyle: PropTypes.object,
|
|
36
|
-
vertical: PropTypes.bool,
|
|
37
|
-
primary: PropTypes.bool,
|
|
38
|
-
size: PropTypes.number,
|
|
39
|
-
percentage: PropTypes.bool,
|
|
40
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
|
|
41
|
-
};
|
|
42
|
-
Pane.defaultProps = {
|
|
43
|
-
paneClassName: '',
|
|
44
|
-
vertical: false,
|
|
45
|
-
primary: false,
|
|
46
|
-
size: 0,
|
|
47
|
-
percentage: false,
|
|
48
|
-
children: []
|
|
49
|
-
};
|
|
50
|
-
export default Pane;
|