fan-standard-comp 3.1.4 → 3.1.6

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