fan-standard-comp 3.1.9 → 3.2.0

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 (176) hide show
  1. package/Readme.md +35 -0
  2. package/dist/fan-standard-comp.umd.js +15 -10
  3. package/es/ButtonGroup/ButtonList.js +0 -3
  4. package/es/ButtonGroup/ButtonMenu.js +0 -3
  5. package/es/ButtonGroup/PopConfirmTitle.js +5 -15
  6. package/es/ButtonGroup/index.d.ts +2 -0
  7. package/es/ButtonGroup/index.js +223 -193
  8. package/es/ButtonGroup/style/index.less +1 -1
  9. package/es/DragContent/DragBar.js +2 -6
  10. package/es/DragContent/index.js +44 -75
  11. package/es/FormComp/ChunkUploader/api.js +6 -10
  12. package/es/FormComp/ChunkUploader/index.js +105 -171
  13. package/es/FormComp/ChunkUploader/lib.js +4 -17
  14. package/es/FormComp/ChunkUploader/upload-queue.class.js +10 -45
  15. package/es/FormComp/ChunkUploader/worker.js +0 -3
  16. package/es/FormComp/EditButton/index.js +24 -49
  17. package/es/FormComp/FieldComponent/ReUpload.js +18 -38
  18. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +37 -75
  19. package/es/FormComp/FieldComponent/TitleNode.js +1 -3
  20. package/es/FormComp/FieldComponent/index.js +38 -74
  21. package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -63
  22. package/es/FormComp/FieldComponent/style/index.less +6 -0
  23. package/es/FormComp/RenderItemGroup/index.js +46 -74
  24. package/es/FormComp/Uploader/index.js +36 -77
  25. package/es/FormComp/Uploader/util.js +0 -6
  26. package/es/FormComp/VarTemplate/index.js +58 -96
  27. package/es/NavLeafScroll/index.js +172 -154
  28. package/es/NavLeafScroll/style/index.less +33 -1
  29. package/es/RefactorTree/index.js +36 -53
  30. package/es/RefactorTree/indexTreeNode.js +35 -68
  31. package/es/RefactorTree/util.js +9 -43
  32. package/es/SpecIcon/fonts/iconfont.js +7 -12
  33. package/es/SpecIcon/index.js +16 -25
  34. package/es/SplitterLayout/Pane.js +2 -5
  35. package/es/SplitterLayout/index.js +20 -70
  36. package/es/StandardContent/SplitterLayout/Pane.js +6 -10
  37. package/es/StandardContent/SplitterLayout/index.js +12 -63
  38. package/es/StandardContent/SubfieldContent.js +12 -14
  39. package/es/StandardContent/WrapperContent.js +8 -10
  40. package/es/StandardDragModal/ChangeStandardModal.d.ts +44 -0
  41. package/es/StandardDragModal/ChangeStandardModal.js +493 -0
  42. package/es/StandardDragModal/DraggableModal.d.ts +7 -0
  43. package/es/StandardDragModal/DraggableModal.js +31 -0
  44. package/es/StandardDragModal/DraggableModalContext.d.ts +9 -0
  45. package/es/StandardDragModal/DraggableModalContext.js +5 -0
  46. package/es/StandardDragModal/DraggableModalInner.d.ts +16 -0
  47. package/es/StandardDragModal/DraggableModalInner.js +114 -0
  48. package/es/StandardDragModal/DraggableModalProvider.d.ts +4 -0
  49. package/es/StandardDragModal/DraggableModalProvider.js +40 -0
  50. package/es/StandardDragModal/Modal.d.ts +11 -0
  51. package/es/StandardDragModal/Modal.js +24 -0
  52. package/es/StandardDragModal/ResizeHandle.d.ts +2 -0
  53. package/es/StandardDragModal/ResizeHandle.js +8 -0
  54. package/es/StandardDragModal/clamp.d.ts +1 -0
  55. package/es/StandardDragModal/clamp.js +3 -0
  56. package/es/StandardDragModal/draggableModalReducer.d.ts +66 -0
  57. package/es/StandardDragModal/draggableModalReducer.js +157 -0
  58. package/es/StandardDragModal/getWindowSize.d.ts +4 -0
  59. package/es/StandardDragModal/getWindowSize.js +6 -0
  60. package/es/StandardDragModal/index.d.ts +3 -11
  61. package/es/StandardDragModal/index.js +3 -30
  62. package/es/StandardDragModal/index.less +65 -0
  63. package/es/StandardDragModal/useDrag.d.ts +5 -0
  64. package/es/StandardDragModal/useDrag.js +66 -0
  65. package/es/StandardDragModal/usePrevious.d.ts +1 -0
  66. package/es/StandardDragModal/usePrevious.js +8 -0
  67. package/es/StandardDragModal/useResize.d.ts +7 -0
  68. package/es/StandardDragModal/useResize.js +74 -0
  69. package/es/StandardFilter/index.d.ts +1 -0
  70. package/es/StandardFilter/index.js +32 -70
  71. package/es/StandardForm/ActionList.js +5 -7
  72. package/es/StandardForm/StepForm.js +50 -71
  73. package/es/StandardForm/TabForm.js +58 -70
  74. package/es/StandardForm/index.js +37 -56
  75. package/es/StandardModal/UpdateFormRef.js +1 -4
  76. package/es/StandardModal/index.d.ts +0 -1
  77. package/es/StandardModal/index.js +115 -159
  78. package/es/StandardPanel/index.js +19 -35
  79. package/es/StandardTable/index.js +20 -30
  80. package/es/components/IconNode/index.js +0 -4
  81. package/es/index.d.ts +1 -0
  82. package/es/index.js +15 -14
  83. package/es/utils/ValueFormat.js +0 -9
  84. package/es/utils/dictSelectUtil.js +153 -0
  85. package/es/utils/filterPermission.js +16 -34
  86. package/es/utils/getParentNodes.js +24 -47
  87. package/es/utils/index.js +2 -1
  88. package/lib/ButtonGroup/ButtonList.js +1 -13
  89. package/lib/ButtonGroup/ButtonMenu.js +1 -8
  90. package/lib/ButtonGroup/PopConfirmTitle.js +3 -16
  91. package/lib/ButtonGroup/index.d.ts +2 -0
  92. package/lib/ButtonGroup/index.js +226 -216
  93. package/lib/ButtonGroup/style/index.less +1 -1
  94. package/lib/DragContent/DragBar.js +2 -10
  95. package/lib/DragContent/index.js +47 -85
  96. package/lib/FormComp/ChunkUploader/api.js +6 -15
  97. package/lib/FormComp/ChunkUploader/index.js +107 -185
  98. package/lib/FormComp/ChunkUploader/lib.js +8 -27
  99. package/lib/FormComp/ChunkUploader/upload-queue.class.js +10 -46
  100. package/lib/FormComp/ChunkUploader/worker.js +1 -5
  101. package/lib/FormComp/EditButton/index.js +26 -60
  102. package/lib/FormComp/FieldComponent/ReUpload.js +21 -50
  103. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +39 -90
  104. package/lib/FormComp/FieldComponent/TitleNode.js +1 -5
  105. package/lib/FormComp/FieldComponent/index.js +38 -110
  106. package/lib/FormComp/FieldComponent/setReadonlyValues.js +37 -79
  107. package/lib/FormComp/FieldComponent/style/index.less +6 -0
  108. package/lib/FormComp/RenderItemGroup/index.js +46 -87
  109. package/lib/FormComp/Uploader/index.js +38 -95
  110. package/lib/FormComp/Uploader/util.js +1 -9
  111. package/lib/FormComp/VarTemplate/index.js +62 -106
  112. package/lib/FormComp/index.js +0 -2
  113. package/lib/NavLeafScroll/index.js +174 -165
  114. package/lib/NavLeafScroll/style/index.less +33 -1
  115. package/lib/RefactorTree/index.js +36 -67
  116. package/lib/RefactorTree/indexTreeNode.js +37 -83
  117. package/lib/RefactorTree/util.js +11 -45
  118. package/lib/SpecIcon/fonts/iconfont.js +7 -12
  119. package/lib/SpecIcon/index.js +16 -30
  120. package/lib/SplitterLayout/Pane.js +0 -7
  121. package/lib/SplitterLayout/index.js +18 -72
  122. package/lib/StandardContent/SplitterLayout/Pane.js +6 -14
  123. package/lib/StandardContent/SplitterLayout/index.js +12 -68
  124. package/lib/StandardContent/SubfieldContent.js +12 -21
  125. package/lib/StandardContent/WrapperContent.js +8 -16
  126. package/lib/StandardDragModal/ChangeStandardModal.d.ts +44 -0
  127. package/lib/StandardDragModal/ChangeStandardModal.js +502 -0
  128. package/lib/StandardDragModal/DraggableModal.d.ts +7 -0
  129. package/lib/StandardDragModal/DraggableModal.js +40 -0
  130. package/lib/StandardDragModal/DraggableModalContext.d.ts +9 -0
  131. package/lib/StandardDragModal/DraggableModalContext.js +15 -0
  132. package/lib/StandardDragModal/DraggableModalInner.d.ts +16 -0
  133. package/lib/StandardDragModal/DraggableModalInner.js +124 -0
  134. package/lib/StandardDragModal/DraggableModalProvider.d.ts +4 -0
  135. package/lib/StandardDragModal/DraggableModalProvider.js +48 -0
  136. package/lib/StandardDragModal/Modal.d.ts +11 -0
  137. package/lib/StandardDragModal/Modal.js +32 -0
  138. package/lib/StandardDragModal/ResizeHandle.d.ts +2 -0
  139. package/lib/StandardDragModal/ResizeHandle.js +18 -0
  140. package/lib/StandardDragModal/clamp.d.ts +1 -0
  141. package/lib/StandardDragModal/clamp.js +10 -0
  142. package/lib/StandardDragModal/draggableModalReducer.d.ts +66 -0
  143. package/lib/StandardDragModal/draggableModalReducer.js +167 -0
  144. package/lib/StandardDragModal/getWindowSize.d.ts +4 -0
  145. package/lib/StandardDragModal/getWindowSize.js +13 -0
  146. package/lib/StandardDragModal/index.d.ts +3 -11
  147. package/lib/StandardDragModal/index.js +33 -38
  148. package/lib/StandardDragModal/index.less +65 -0
  149. package/lib/StandardDragModal/useDrag.d.ts +5 -0
  150. package/lib/StandardDragModal/useDrag.js +73 -0
  151. package/lib/StandardDragModal/usePrevious.d.ts +1 -0
  152. package/lib/StandardDragModal/usePrevious.js +15 -0
  153. package/lib/StandardDragModal/useResize.d.ts +7 -0
  154. package/lib/StandardDragModal/useResize.js +81 -0
  155. package/lib/StandardFilter/index.d.ts +1 -0
  156. package/lib/StandardFilter/index.js +30 -78
  157. package/lib/StandardForm/ActionList.js +5 -12
  158. package/lib/StandardForm/StepForm.js +52 -90
  159. package/lib/StandardForm/TabForm.js +61 -88
  160. package/lib/StandardForm/index.js +40 -75
  161. package/lib/StandardModal/UpdateFormRef.js +4 -12
  162. package/lib/StandardModal/index.d.ts +0 -1
  163. package/lib/StandardModal/index.js +117 -184
  164. package/lib/StandardPanel/index.js +22 -48
  165. package/lib/StandardTable/index.js +20 -39
  166. package/lib/components/IconNode/index.js +0 -7
  167. package/lib/components/index.js +0 -2
  168. package/lib/data/index.js +4 -7
  169. package/lib/index.d.ts +1 -0
  170. package/lib/index.js +50 -68
  171. package/lib/utils/ValueFormat.js +0 -10
  172. package/lib/utils/dictSelectUtil.js +161 -0
  173. package/lib/utils/filterPermission.js +15 -39
  174. package/lib/utils/getParentNodes.js +25 -52
  175. package/lib/utils/index.js +24 -9
  176. package/package.json +6 -5
@@ -0,0 +1,65 @@
1
+ /**
2
+ * NOTE: This is not compiled.
3
+ */
4
+
5
+ .ant-design-draggable-modal {
6
+ pointer-events: none;
7
+ overflow: hidden !important;
8
+ }
9
+
10
+ .ant-design-draggable-modal .ant-modal {
11
+ display: flex;
12
+ max-width: none;
13
+ transform-origin: 50% 50% !important;
14
+ }
15
+
16
+ .ant-design-draggable-modal .ant-modal-content {
17
+ flex: 1;
18
+ display: flex;
19
+ flex-direction: column;
20
+ }
21
+
22
+ .ant-design-draggable-modal .ant-modal-header {
23
+ flex: 0;
24
+ padding: 0;
25
+ }
26
+
27
+ .ant-design-draggable-modal .ant-modal-footer {
28
+ flex: 0;
29
+ padding: 16px;
30
+ }
31
+
32
+ .ant-design-draggable-modal .ant-design-draggable-modal-title {
33
+ cursor: move;
34
+ padding: 16px;
35
+ }
36
+
37
+ .ant-design-draggable-modal .ant-design-draggable-modal-title::before {
38
+ content: '\00a0';
39
+ }
40
+
41
+ .ant-design-draggable-modal .ant-modal-body {
42
+ flex: 1;
43
+ overflow-y: auto;
44
+ padding: 16px;
45
+ }
46
+
47
+ .ant-design-draggable-modal-resize-handle-inner {
48
+ width: 12px;
49
+ right: 14px;
50
+ border: 2px solid grey;
51
+ height: 12px;
52
+ bottom: 14px;
53
+ position: absolute;
54
+ border-top: 0;
55
+ border-left: 0;
56
+ }
57
+
58
+ .ant-design-draggable-modal-resize-handle {
59
+ right: -10px;
60
+ width: 44px;
61
+ bottom: -10px;
62
+ cursor: se-resize;
63
+ height: 44px;
64
+ position: absolute;
65
+ }
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export declare const useDrag: (x: number, y: number, onDrag: (args: {
3
+ x: number;
4
+ y: number;
5
+ }) => void) => (e: React.MouseEvent) => void;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useDrag = void 0;
7
+ var _react = require("react");
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+ var useDrag = function useDrag(x, y, onDrag) {
15
+ var _useState = (0, _react.useState)(false),
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ dragging = _useState2[0],
18
+ setDragging = _useState2[1];
19
+ var _useState3 = (0, _react.useState)({
20
+ initX: 0,
21
+ initY: 0,
22
+ mouseDownX: 0,
23
+ mouseDownY: 0
24
+ }),
25
+ _useState4 = _slicedToArray(_useState3, 2),
26
+ initialDragState = _useState4[0],
27
+ setInitialDragState = _useState4[1];
28
+ var onMouseDown = (0, _react.useCallback)(function (e) {
29
+ e.preventDefault();
30
+ setInitialDragState({
31
+ initX: x,
32
+ initY: y,
33
+ mouseDownX: e.clientX,
34
+ mouseDownY: e.clientY
35
+ });
36
+ setDragging(true);
37
+ }, [x, y, setDragging, setInitialDragState]);
38
+ (0, _react.useEffect)(function () {
39
+ var onMouseMove = function onMouseMove(e) {
40
+ if (dragging) {
41
+ var initX = initialDragState.initX,
42
+ mouseDownX = initialDragState.mouseDownX,
43
+ initY = initialDragState.initY,
44
+ mouseDownY = initialDragState.mouseDownY;
45
+ var dx = e.clientX - mouseDownX;
46
+ var dy = e.clientY - mouseDownY;
47
+ var _x = initX + dx;
48
+ var _y = initY + dy;
49
+ onDrag({
50
+ x: _x,
51
+ y: _y
52
+ });
53
+ }
54
+ };
55
+ window.addEventListener('mousemove', onMouseMove, {
56
+ passive: true
57
+ });
58
+ return function () {
59
+ return window.removeEventListener('mousemove', onMouseMove);
60
+ };
61
+ }, [initialDragState, dragging, onDrag]);
62
+ (0, _react.useEffect)(function () {
63
+ var onMouseUp = function onMouseUp() {
64
+ setDragging(false);
65
+ };
66
+ window.addEventListener('mouseup', onMouseUp);
67
+ return function () {
68
+ return window.removeEventListener('mouseup', onMouseUp);
69
+ };
70
+ }, [setDragging]);
71
+ return onMouseDown;
72
+ };
73
+ exports.useDrag = useDrag;
@@ -0,0 +1 @@
1
+ export declare const usePrevious: <T>(value: T) => T;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.usePrevious = void 0;
7
+ var _react = require("react");
8
+ var usePrevious = function usePrevious(value) {
9
+ var ref = (0, _react.useRef)(value);
10
+ (0, _react.useEffect)(function () {
11
+ ref.current = value;
12
+ }, [value]);
13
+ return ref.current;
14
+ };
15
+ exports.usePrevious = usePrevious;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export declare const useResize: (x: number, y: number, width: number, height: number, onResize: (args: {
3
+ x: number;
4
+ y: number;
5
+ width: number;
6
+ height: number;
7
+ }) => void) => (e: React.MouseEvent) => void;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useResize = void 0;
7
+ var _react = require("react");
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+ var useResize = function useResize(x, y, width, height, onResize) {
15
+ var _useState = (0, _react.useState)(false),
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ dragging = _useState2[0],
18
+ setDragging = _useState2[1];
19
+ var _useState3 = (0, _react.useState)({
20
+ initX: 0,
21
+ initY: 0,
22
+ initWidth: 0,
23
+ initHeight: 0,
24
+ mouseDownX: 0,
25
+ mouseDownY: 0
26
+ }),
27
+ _useState4 = _slicedToArray(_useState3, 2),
28
+ initialDragState = _useState4[0],
29
+ setInitialDragState = _useState4[1];
30
+ var onMouseDown = (0, _react.useCallback)(function (e) {
31
+ e.preventDefault();
32
+ setInitialDragState({
33
+ initX: x,
34
+ initY: y,
35
+ initWidth: width,
36
+ initHeight: height,
37
+ mouseDownX: e.clientX,
38
+ mouseDownY: e.clientY
39
+ });
40
+ setDragging(true);
41
+ }, [width, height, setDragging, setInitialDragState, x, y]);
42
+ (0, _react.useEffect)(function () {
43
+ var onMouseMove = function onMouseMove(e) {
44
+ if (dragging) {
45
+ var initX = initialDragState.initX,
46
+ initY = initialDragState.initY,
47
+ initWidth = initialDragState.initWidth,
48
+ mouseDownX = initialDragState.mouseDownX,
49
+ initHeight = initialDragState.initHeight,
50
+ mouseDownY = initialDragState.mouseDownY;
51
+ var dx = e.clientX - mouseDownX;
52
+ var dy = e.clientY - mouseDownY;
53
+ var _width = initWidth + dx;
54
+ var _height = initHeight + dy;
55
+ return onResize({
56
+ x: initX,
57
+ y: initY,
58
+ width: _width,
59
+ height: _height
60
+ });
61
+ }
62
+ };
63
+ window.addEventListener('mousemove', onMouseMove, {
64
+ passive: true
65
+ });
66
+ return function () {
67
+ return window.removeEventListener('mousemove', onMouseMove);
68
+ };
69
+ }, [initialDragState, dragging, onResize]);
70
+ (0, _react.useEffect)(function () {
71
+ var onMouseUp = function onMouseUp() {
72
+ setDragging(false);
73
+ };
74
+ window.addEventListener('mouseup', onMouseUp);
75
+ return function () {
76
+ return window.removeEventListener('mouseup', onMouseUp);
77
+ };
78
+ }, [setDragging]);
79
+ return onMouseDown;
80
+ };
81
+ exports.useResize = useResize;
@@ -4,6 +4,7 @@ import { ButtonGroupOptionsProps } from '../ButtonGroup/index';
4
4
  import './style/index.less';
5
5
  export interface StandardFilterProps {
6
6
  buttonGroup?: ButtonGroupOptionsProps[];
7
+ buttonGroupConfig?: Object;
7
8
  formItemGroup?: FieldComponentProps[];
8
9
  confirmText?: string;
9
10
  onFilterSearch?: (value?: object) => void;
@@ -1,71 +1,45 @@
1
1
  "use strict";
2
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
-
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  require("antd/es/button/style");
11
-
12
9
  var _button = _interopRequireDefault(require("antd/es/button"));
13
-
14
10
  require("antd/es/form/style");
15
-
16
11
  var _form = _interopRequireDefault(require("antd/es/form"));
17
-
18
12
  var _react = _interopRequireDefault(require("react"));
19
-
20
13
  var _ValueFormat = _interopRequireDefault(require("../utils/ValueFormat.js"));
21
-
22
14
  var _index = _interopRequireDefault(require("../ButtonGroup/index"));
23
-
24
15
  require("./style/index.less");
25
-
26
16
  var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
27
-
28
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
-
30
18
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
-
32
- 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); } }
33
-
34
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
35
-
36
- 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); }
37
-
38
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
-
19
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
20
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
22
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
23
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
24
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
40
25
  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); }; }
41
-
42
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
43
-
26
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
44
27
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
45
-
46
- 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; } }
47
-
48
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
49
-
28
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
29
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } // import { general } from '../data/index';
50
30
  var FormItem = _form.default.Item;
51
-
52
31
  var StandardFilter = /*#__PURE__*/function (_React$Component) {
53
32
  _inherits(StandardFilter, _React$Component);
54
-
55
33
  var _super = _createSuper(StandardFilter);
56
-
57
34
  function StandardFilter(props) {
58
35
  var _this;
59
-
60
36
  _classCallCheck(this, StandardFilter);
61
-
62
37
  _this = _super.call(this, props);
63
- _this.filterFormRef = /*#__PURE__*/_react.default.createRef(); // 更新表单控件值,用于外部获取当前表单实例(force是否强制清空表单)
64
-
38
+ _this.filterFormRef = /*#__PURE__*/_react.default.createRef();
39
+ // 更新表单控件值,用于外部获取当前表单实例(force是否强制清空表单)
65
40
  _this.updateFormFields = function (newVal, force) {
66
41
  var getFormFields = _this.props.getFormFields;
67
42
  var resetValues = {};
68
-
69
43
  if (force) {
70
44
  // this.filterFormRef.current.resetFields()
71
45
  // 先清空 再赋值
@@ -74,33 +48,24 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
74
48
  resetValues[item] = undefined;
75
49
  });
76
50
  }
77
-
78
51
  _this.filterFormRef.current.setFieldsValue(Object.assign(Object.assign({}, resetValues), newVal)); // 直接清空表单的赋值
79
-
80
-
81
52
  if (getFormFields) getFormFields(_this.filterFormRef.current.getFieldsValue(), _this.filterFormRef);
82
53
  }; // 强制更新表单值,用于赋初始化实例值
83
-
84
-
85
54
  _this.forceUpdateForm = function () {
86
55
  var getFormFields = _this.props.getFormFields;
87
56
  if (getFormFields) getFormFields(_this.filterFormRef.current.getFieldsValue(), _this.filterFormRef);
88
57
  };
89
-
90
58
  _this.handleSearch = function (values) {
91
59
  var _this$props = _this.props,
92
- formItemGroup = _this$props.formItemGroup,
93
- onFilterSearch = _this$props.onFilterSearch; // if (Object.prototype.hasOwnProperty.call(values, false)) {
60
+ formItemGroup = _this$props.formItemGroup,
61
+ onFilterSearch = _this$props.onFilterSearch; // if (Object.prototype.hasOwnProperty.call(values, false)) {
94
62
  // delete values.false // TODO 自定义结构会莫名的出来一个false字段
95
63
  // }
96
-
97
64
  var resultValues = (0, _ValueFormat.default)(values, formItemGroup);
98
-
99
65
  if (onFilterSearch) {
100
66
  onFilterSearch(Object.assign({}, resultValues));
101
67
  }
102
68
  };
103
-
104
69
  _this.handleReset = function () {
105
70
  var onFilterReset = _this.props.onFilterReset; // 使用此方法,表单校验无法清空掉
106
71
  // const resetValues = this.filterFormRef.current.getFieldsValue()
@@ -108,34 +73,26 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
108
73
  // resetValues[item] = undefined
109
74
  // })
110
75
  // this.filterFormRef.current.setFieldsValue({ ...resetValues }) // 直接清空表单的赋值
111
-
112
76
  _this.filterFormRef.current.resetFields();
113
-
114
77
  _this.setState({
115
78
  reFormItemGroup: _this.props.formItemGroup // 重新渲染列表
116
-
117
79
  });
118
80
 
119
81
  if (onFilterReset) {
120
82
  onFilterReset(_this.filterFormRef.current.getFieldsValue());
121
83
  }
122
84
  };
123
-
124
85
  _this.itemIsHide = function (isHide) {
125
86
  var current = _this.filterFormRef.current;
126
87
  if (!isHide) return false;
127
-
128
88
  if (typeof isHide === 'function') {
129
89
  return isHide(current ? current.getFieldsValue() : {}, current);
130
90
  }
131
-
132
91
  return isHide;
133
- }; // 表单列表组 formItemGroup 类型为数组或者React.Node
134
-
135
-
92
+ };
93
+ // 表单列表组 formItemGroup 类型为数组或者React.Node
136
94
  _this.renderFormItemGroup = function () {
137
95
  var reFormItemGroup = _this.state.reFormItemGroup;
138
-
139
96
  if (Array.isArray(reFormItemGroup)) {
140
97
  return /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
141
98
  itemGroup: reFormItemGroup,
@@ -180,14 +137,12 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
180
137
 
181
138
  return reFormItemGroup;
182
139
  };
183
-
184
140
  _this.state = {
185
141
  // recombinationGroup: [],
186
142
  reFormItemGroup: undefined
187
143
  };
188
144
  return _this;
189
145
  }
190
-
191
146
  _createClass(StandardFilter, [{
192
147
  key: "componentDidMount",
193
148
  value: function componentDidMount() {
@@ -198,7 +153,6 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
198
153
  key: "componentDidUpdate",
199
154
  value: function componentDidUpdate(prevProps) {
200
155
  var initialValues = this.props.initialValues;
201
-
202
156
  if (prevProps.initialValues !== initialValues) {
203
157
  this.updateFormFields(initialValues, true);
204
158
  }
@@ -207,18 +161,18 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
207
161
  key: "render",
208
162
  value: function render() {
209
163
  var _this$props2 = this.props,
210
- className = _this$props2.className,
211
- style = _this$props2.style,
212
- onFilterReset = _this$props2.onFilterReset,
213
- _this$props2$buttonGr = _this$props2.buttonGroup,
214
- buttonGroup = _this$props2$buttonGr === void 0 ? [] : _this$props2$buttonGr,
215
- min = _this$props2.min,
216
- codes = _this$props2.codes,
217
- permissionCodes = _this$props2.permissionCodes,
218
- confirmText = _this$props2.confirmText,
219
- cancelText = _this$props2.cancelText,
220
- onFilterSearch = _this$props2.onFilterSearch; // const { recombinationGroup } = this.state;
221
-
164
+ className = _this$props2.className,
165
+ style = _this$props2.style,
166
+ onFilterReset = _this$props2.onFilterReset,
167
+ _this$props2$buttonGr = _this$props2.buttonGroup,
168
+ buttonGroup = _this$props2$buttonGr === void 0 ? [] : _this$props2$buttonGr,
169
+ min = _this$props2.min,
170
+ codes = _this$props2.codes,
171
+ permissionCodes = _this$props2.permissionCodes,
172
+ confirmText = _this$props2.confirmText,
173
+ cancelText = _this$props2.cancelText,
174
+ onFilterSearch = _this$props2.onFilterSearch,
175
+ buttonGroupConfig = _this$props2.buttonGroupConfig; // const { recombinationGroup } = this.state;
222
176
  return /*#__PURE__*/_react.default.createElement(_form.default, {
223
177
  name: "standard-filter-form",
224
178
  ref: this.filterFormRef,
@@ -250,23 +204,21 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
250
204
  options: buttonGroup,
251
205
  min: min,
252
206
  codes: codes,
253
- permissionCodes: permissionCodes
207
+ permissionCodes: permissionCodes,
208
+ dropdownConfig: buttonGroupConfig
254
209
  })) : null));
255
210
  }
256
211
  }], [{
257
212
  key: "getDerivedStateFromProps",
258
213
  value: function getDerivedStateFromProps(nextProps) {
259
214
  var formItemGroup = nextProps.formItemGroup; // const restOptionList = removeNoPermission(buttonGroup, permissionCodes, codes) || []
260
-
261
215
  return {
262
216
  // recombinationGroup: restOptionList,
263
217
  reFormItemGroup: formItemGroup
264
218
  };
265
219
  }
266
220
  }]);
267
-
268
221
  return StandardFilter;
269
222
  }(_react.default.Component);
270
-
271
223
  var _default = StandardFilter;
272
224
  exports.default = _default;
@@ -4,24 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  require("antd/es/button/style");
9
-
10
8
  var _button = _interopRequireDefault(require("antd/es/button"));
11
-
12
9
  var _react = _interopRequireDefault(require("react"));
13
-
14
10
  var _IconNode = _interopRequireDefault(require("../components/IconNode"));
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
12
  var ActionList = function ActionList(props) {
19
13
  var list = props.list,
20
- form = props.form,
21
- _props$align = props.align,
22
- align = _props$align === void 0 ? 'default' : _props$align,
23
- other = props.other,
24
- onStep = props.onStep;
14
+ form = props.form,
15
+ _props$align = props.align,
16
+ align = _props$align === void 0 ? 'default' : _props$align,
17
+ other = props.other,
18
+ onStep = props.onStep;
25
19
  return /*#__PURE__*/_react.default.createElement("div", {
26
20
  className: "standardForm-actions",
27
21
  style: {
@@ -52,6 +46,5 @@ var ActionList = function ActionList(props) {
52
46
  }, item.name);
53
47
  }));
54
48
  };
55
-
56
49
  var _default = ActionList;
57
50
  exports.default = _default;