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