fan-standard-comp 3.2.0 → 3.2.2

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 (293) hide show
  1. package/Readme.md +1 -33
  2. package/dist/09cd8e9be7081f2166444cce393fe968.svg +54 -0
  3. package/dist/e3378c145b7db195ad068735e15fb28a.svg +165 -0
  4. package/dist/fan-standard-comp.umd.js +166 -444
  5. package/dist/fonts/iconfont.ttf +0 -0
  6. package/dist/fonts/iconfont.woff +0 -0
  7. package/dist/fonts/lg.ttf +0 -0
  8. package/dist/fonts/lg.woff +0 -0
  9. package/dist/fonts/lg.woff2 +0 -0
  10. package/es/ButtonGroup/ButtonList.d.ts +2 -1
  11. package/es/ButtonGroup/ButtonMenu.d.ts +2 -1
  12. package/es/ButtonGroup/PopConfirmTitle.js +5 -5
  13. package/es/ButtonGroup/index.d.ts +3 -1
  14. package/es/ButtonGroup/index.js +147 -178
  15. package/es/ButtonGroup/style/index.less +4 -1
  16. package/es/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
  17. package/es/CalendarCoordPicker/CalendarMonthPicker.js +26 -0
  18. package/es/CalendarCoordPicker/index.d.ts +8 -0
  19. package/es/CalendarCoordPicker/index.js +296 -0
  20. package/es/CalendarCoordPicker/index.less +31 -0
  21. package/es/ConfigContext/index.d.ts +7 -0
  22. package/es/ConfigContext/index.js +12 -0
  23. package/es/DragContent/index.d.ts +1 -1
  24. package/es/DragContent/index.js +5 -5
  25. package/es/FormComp/ChunkUploader/api.js +14 -14
  26. package/es/FormComp/ChunkUploader/index.js +132 -139
  27. package/es/FormComp/ChunkUploader/lib.js +21 -21
  28. package/es/FormComp/ChunkUploader/upload-queue.class.js +64 -66
  29. package/es/FormComp/EditButton/index.d.ts +1 -1
  30. package/es/FormComp/EditButton/index.js +15 -17
  31. package/es/FormComp/FieldComponent/ReUpload.d.ts +1 -1
  32. package/es/FormComp/FieldComponent/ReUpload.js +37 -23
  33. package/es/FormComp/FieldComponent/RefactorTextarea.js +32 -0
  34. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +72 -19
  35. package/es/FormComp/FieldComponent/TitleNode.d.ts +2 -1
  36. package/es/FormComp/FieldComponent/index.d.ts +1 -1
  37. package/es/FormComp/FieldComponent/index.js +33 -23
  38. package/es/FormComp/FieldComponent/setReadonlyValues.js +6 -6
  39. package/es/FormComp/RenderItemGroup/index.js +24 -8
  40. package/es/FormComp/Uploader/index.d.ts +3 -1
  41. package/es/FormComp/Uploader/index.js +243 -119
  42. package/es/FormComp/VarTemplate/index.js +57 -64
  43. package/es/ImageGallery/ImagePreview.d.ts +13 -0
  44. package/es/ImageGallery/ImagePreview.js +168 -0
  45. package/es/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
  46. package/es/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
  47. package/es/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
  48. package/es/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
  49. package/es/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
  50. package/es/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
  51. package/es/ImageGallery/PreviewStyles/lg-video.css +144 -0
  52. package/es/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
  53. package/es/ImageGallery/PreviewStyles/lightgallery.css +728 -0
  54. package/es/ImageGallery/SliderContent.d.ts +7 -0
  55. package/es/ImageGallery/SliderContent.js +699 -0
  56. package/es/ImageGallery/Thumbnail.d.ts +3 -0
  57. package/es/ImageGallery/Thumbnail.js +296 -0
  58. package/es/ImageGallery/hook/uniqueId.d.ts +1 -0
  59. package/es/ImageGallery/hook/uniqueId.js +10 -0
  60. package/es/ImageGallery/index.d.ts +4 -0
  61. package/es/ImageGallery/index.js +29 -0
  62. package/es/ImageGallery/style/index.less +5 -0
  63. package/es/ImageGallery/types.d.ts +5 -0
  64. package/es/ImageGallery/types.js +1 -0
  65. package/es/NavLeafScroll/index.js +94 -50
  66. package/es/RefactorTree/index.d.ts +1 -1
  67. package/es/RefactorTree/index.js +6 -6
  68. package/es/RefactorTree/indexTreeNode.d.ts +1 -1
  69. package/es/RefactorTree/indexTreeNode.js +19 -17
  70. package/es/RefactorTree/util.js +18 -18
  71. package/es/SpecIcon/fonts/demo_index.html +559 -5
  72. package/es/SpecIcon/fonts/iconfont.css +101 -3
  73. package/es/SpecIcon/fonts/iconfont.js +34 -27
  74. package/es/SpecIcon/fonts/iconfont.json +168 -0
  75. package/es/SpecIcon/fonts/iconfont.svg +163 -171
  76. package/es/SpecIcon/fonts/iconfont.ttf +0 -0
  77. package/es/SpecIcon/fonts/iconfont.woff +0 -0
  78. package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
  79. package/es/SpecIcon/style/iconfont.less +106 -11
  80. package/es/SplitterLayout/Pane.d.ts +1 -1
  81. package/es/SplitterLayout/index.js +25 -26
  82. package/es/StandardContent/SplitterLayout/Pane.js +3 -3
  83. package/es/StandardContent/SplitterLayout/index.js +25 -26
  84. package/es/StandardContent/SubfieldContent.d.ts +1 -1
  85. package/es/StandardContent/WrapperContent.d.ts +1 -1
  86. package/es/StandardDragModal/index.d.ts +11 -3
  87. package/es/StandardDragModal/index.js +25 -3
  88. package/es/StandardFilter/index.d.ts +5 -16
  89. package/es/StandardFilter/index.js +212 -200
  90. package/es/StandardFilter/indexClass.d.ts +37 -0
  91. package/es/StandardFilter/indexClass.js +217 -0
  92. package/es/StandardFilter/style/index.less +82 -9
  93. package/es/StandardForm/StepForm.d.ts +1 -1
  94. package/es/StandardForm/StepForm.js +28 -22
  95. package/es/StandardForm/TabForm.d.ts +1 -1
  96. package/es/StandardForm/TabForm.js +41 -43
  97. package/es/StandardForm/index.d.ts +1 -1
  98. package/es/StandardForm/index.js +5 -5
  99. package/es/StandardModal/UpdateFormRef.js +0 -1
  100. package/es/StandardModal/index.d.ts +2 -1
  101. package/es/StandardModal/index.js +25 -39
  102. package/es/StandardPanel/index.d.ts +1 -1
  103. package/es/StandardPanel/index.js +7 -7
  104. package/es/StandardTable/index.d.ts +1 -0
  105. package/es/StandardTable/index.js +44 -26
  106. package/es/components/IconNode/index.d.ts +1 -1
  107. package/es/components/IconNode/index.js +0 -1
  108. package/es/data/general.config.js +31 -0
  109. package/es/index.d.ts +3 -1
  110. package/es/index.js +6 -2
  111. package/es/utils/filterPermission.js +7 -10
  112. package/es/utils/getParentNodes.js +101 -26
  113. package/es/utils/index.js +2 -3
  114. package/es/utils/urlUtils.js +76 -0
  115. package/lib/ButtonGroup/ButtonList.d.ts +2 -1
  116. package/lib/ButtonGroup/ButtonList.js +2 -3
  117. package/lib/ButtonGroup/ButtonMenu.d.ts +2 -1
  118. package/lib/ButtonGroup/ButtonMenu.js +2 -3
  119. package/lib/ButtonGroup/PopConfirmTitle.js +7 -8
  120. package/lib/ButtonGroup/index.d.ts +3 -1
  121. package/lib/ButtonGroup/index.js +151 -183
  122. package/lib/ButtonGroup/style/index.less +4 -1
  123. package/lib/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
  124. package/lib/CalendarCoordPicker/CalendarMonthPicker.js +36 -0
  125. package/lib/CalendarCoordPicker/index.d.ts +8 -0
  126. package/lib/CalendarCoordPicker/index.js +305 -0
  127. package/lib/CalendarCoordPicker/index.less +31 -0
  128. package/lib/ConfigContext/index.d.ts +7 -0
  129. package/lib/ConfigContext/index.js +17 -0
  130. package/lib/DragContent/DragBar.js +2 -3
  131. package/lib/DragContent/index.d.ts +1 -1
  132. package/lib/DragContent/index.js +9 -10
  133. package/lib/FormComp/ChunkUploader/api.js +15 -15
  134. package/lib/FormComp/ChunkUploader/index.js +135 -142
  135. package/lib/FormComp/ChunkUploader/lib.js +22 -22
  136. package/lib/FormComp/ChunkUploader/upload-queue.class.js +66 -69
  137. package/lib/FormComp/ChunkUploader/worker.js +1 -1
  138. package/lib/FormComp/EditButton/index.d.ts +1 -1
  139. package/lib/FormComp/EditButton/index.js +19 -22
  140. package/lib/FormComp/FieldComponent/ReUpload.d.ts +1 -1
  141. package/lib/FormComp/FieldComponent/ReUpload.js +40 -28
  142. package/lib/FormComp/FieldComponent/RefactorTextarea.js +42 -0
  143. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +75 -23
  144. package/lib/FormComp/FieldComponent/TitleNode.d.ts +2 -1
  145. package/lib/FormComp/FieldComponent/TitleNode.js +2 -3
  146. package/lib/FormComp/FieldComponent/index.d.ts +1 -1
  147. package/lib/FormComp/FieldComponent/index.js +38 -26
  148. package/lib/FormComp/FieldComponent/setReadonlyValues.js +15 -20
  149. package/lib/FormComp/RenderItemGroup/index.js +26 -11
  150. package/lib/FormComp/Uploader/index.d.ts +3 -1
  151. package/lib/FormComp/Uploader/index.js +244 -123
  152. package/lib/FormComp/VarTemplate/index.js +63 -71
  153. package/lib/FormComp/index.js +1 -1
  154. package/lib/ImageGallery/ImagePreview.d.ts +13 -0
  155. package/lib/ImageGallery/ImagePreview.js +178 -0
  156. package/lib/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
  157. package/lib/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
  158. package/lib/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
  159. package/lib/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
  160. package/lib/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
  161. package/lib/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
  162. package/lib/ImageGallery/PreviewStyles/lg-video.css +144 -0
  163. package/lib/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
  164. package/lib/ImageGallery/PreviewStyles/lightgallery.css +728 -0
  165. package/lib/ImageGallery/SliderContent.d.ts +7 -0
  166. package/lib/ImageGallery/SliderContent.js +708 -0
  167. package/lib/ImageGallery/Thumbnail.d.ts +3 -0
  168. package/lib/ImageGallery/Thumbnail.js +306 -0
  169. package/lib/ImageGallery/hook/uniqueId.d.ts +1 -0
  170. package/lib/ImageGallery/hook/uniqueId.js +17 -0
  171. package/lib/ImageGallery/index.d.ts +4 -0
  172. package/lib/ImageGallery/index.js +36 -0
  173. package/lib/ImageGallery/style/index.less +5 -0
  174. package/lib/ImageGallery/types.d.ts +5 -0
  175. package/lib/ImageGallery/types.js +5 -0
  176. package/lib/NavLeafScroll/index.js +98 -55
  177. package/lib/RefactorTree/index.d.ts +1 -1
  178. package/lib/RefactorTree/index.js +10 -11
  179. package/lib/RefactorTree/indexTreeNode.d.ts +1 -1
  180. package/lib/RefactorTree/indexTreeNode.js +23 -22
  181. package/lib/RefactorTree/util.js +18 -18
  182. package/lib/SpecIcon/fonts/demo_index.html +559 -5
  183. package/lib/SpecIcon/fonts/iconfont.css +101 -3
  184. package/lib/SpecIcon/fonts/iconfont.js +34 -27
  185. package/lib/SpecIcon/fonts/iconfont.json +168 -0
  186. package/lib/SpecIcon/fonts/iconfont.svg +163 -171
  187. package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
  188. package/lib/SpecIcon/fonts/iconfont.woff +0 -0
  189. package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
  190. package/lib/SpecIcon/index.js +2 -3
  191. package/lib/SpecIcon/style/iconfont.less +106 -11
  192. package/lib/SplitterLayout/Pane.d.ts +1 -1
  193. package/lib/SplitterLayout/Pane.js +2 -3
  194. package/lib/SplitterLayout/index.js +27 -29
  195. package/lib/StandardContent/SplitterLayout/Pane.js +5 -6
  196. package/lib/StandardContent/SplitterLayout/index.js +27 -29
  197. package/lib/StandardContent/SubfieldContent.d.ts +1 -1
  198. package/lib/StandardContent/SubfieldContent.js +2 -3
  199. package/lib/StandardContent/WrapperContent.d.ts +1 -1
  200. package/lib/StandardContent/WrapperContent.js +2 -3
  201. package/lib/StandardDragModal/index.d.ts +11 -3
  202. package/lib/StandardDragModal/index.js +27 -33
  203. package/lib/StandardFilter/index.d.ts +5 -16
  204. package/lib/StandardFilter/index.js +215 -201
  205. package/lib/StandardFilter/indexClass.d.ts +37 -0
  206. package/lib/StandardFilter/indexClass.js +223 -0
  207. package/lib/StandardFilter/style/index.less +82 -9
  208. package/lib/StandardForm/ActionList.js +2 -3
  209. package/lib/StandardForm/StepForm.d.ts +1 -1
  210. package/lib/StandardForm/StepForm.js +32 -27
  211. package/lib/StandardForm/TabForm.d.ts +1 -1
  212. package/lib/StandardForm/TabForm.js +45 -48
  213. package/lib/StandardForm/index.d.ts +1 -1
  214. package/lib/StandardForm/index.js +9 -10
  215. package/lib/StandardModal/UpdateFormRef.js +3 -4
  216. package/lib/StandardModal/index.d.ts +2 -1
  217. package/lib/StandardModal/index.js +29 -43
  218. package/lib/StandardPanel/index.d.ts +1 -1
  219. package/lib/StandardPanel/index.js +11 -12
  220. package/lib/StandardTable/index.d.ts +1 -0
  221. package/lib/StandardTable/index.js +49 -29
  222. package/lib/components/IconNode/index.d.ts +1 -1
  223. package/lib/components/IconNode/index.js +2 -4
  224. package/lib/components/index.js +1 -1
  225. package/lib/data/func.code.js +2 -3
  226. package/lib/data/general.config.js +33 -3
  227. package/lib/data/index.js +1 -1
  228. package/lib/index.d.ts +3 -1
  229. package/lib/index.js +30 -10
  230. package/lib/utils/ValueFormat.js +1 -2
  231. package/lib/utils/filterPermission.js +11 -18
  232. package/lib/utils/getParentNodes.js +103 -29
  233. package/lib/utils/index.js +5 -27
  234. package/lib/utils/urlUtils.js +82 -0
  235. package/package.json +14 -9
  236. package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
  237. package/dist/fonts/iconfont.eot +0 -0
  238. package/es/StandardDragModal/ChangeStandardModal.d.ts +0 -44
  239. package/es/StandardDragModal/ChangeStandardModal.js +0 -493
  240. package/es/StandardDragModal/DraggableModal.d.ts +0 -7
  241. package/es/StandardDragModal/DraggableModal.js +0 -31
  242. package/es/StandardDragModal/DraggableModalContext.d.ts +0 -9
  243. package/es/StandardDragModal/DraggableModalContext.js +0 -5
  244. package/es/StandardDragModal/DraggableModalInner.d.ts +0 -16
  245. package/es/StandardDragModal/DraggableModalInner.js +0 -114
  246. package/es/StandardDragModal/DraggableModalProvider.d.ts +0 -4
  247. package/es/StandardDragModal/DraggableModalProvider.js +0 -40
  248. package/es/StandardDragModal/Modal.d.ts +0 -11
  249. package/es/StandardDragModal/Modal.js +0 -24
  250. package/es/StandardDragModal/ResizeHandle.d.ts +0 -2
  251. package/es/StandardDragModal/ResizeHandle.js +0 -8
  252. package/es/StandardDragModal/clamp.d.ts +0 -1
  253. package/es/StandardDragModal/clamp.js +0 -3
  254. package/es/StandardDragModal/draggableModalReducer.d.ts +0 -66
  255. package/es/StandardDragModal/draggableModalReducer.js +0 -157
  256. package/es/StandardDragModal/getWindowSize.d.ts +0 -4
  257. package/es/StandardDragModal/getWindowSize.js +0 -6
  258. package/es/StandardDragModal/index.less +0 -65
  259. package/es/StandardDragModal/useDrag.d.ts +0 -5
  260. package/es/StandardDragModal/useDrag.js +0 -66
  261. package/es/StandardDragModal/usePrevious.d.ts +0 -1
  262. package/es/StandardDragModal/usePrevious.js +0 -8
  263. package/es/StandardDragModal/useResize.d.ts +0 -7
  264. package/es/StandardDragModal/useResize.js +0 -74
  265. package/es/utils/dictSelectUtil.js +0 -153
  266. package/lib/StandardDragModal/ChangeStandardModal.d.ts +0 -44
  267. package/lib/StandardDragModal/ChangeStandardModal.js +0 -502
  268. package/lib/StandardDragModal/DraggableModal.d.ts +0 -7
  269. package/lib/StandardDragModal/DraggableModal.js +0 -40
  270. package/lib/StandardDragModal/DraggableModalContext.d.ts +0 -9
  271. package/lib/StandardDragModal/DraggableModalContext.js +0 -15
  272. package/lib/StandardDragModal/DraggableModalInner.d.ts +0 -16
  273. package/lib/StandardDragModal/DraggableModalInner.js +0 -124
  274. package/lib/StandardDragModal/DraggableModalProvider.d.ts +0 -4
  275. package/lib/StandardDragModal/DraggableModalProvider.js +0 -48
  276. package/lib/StandardDragModal/Modal.d.ts +0 -11
  277. package/lib/StandardDragModal/Modal.js +0 -32
  278. package/lib/StandardDragModal/ResizeHandle.d.ts +0 -2
  279. package/lib/StandardDragModal/ResizeHandle.js +0 -18
  280. package/lib/StandardDragModal/clamp.d.ts +0 -1
  281. package/lib/StandardDragModal/clamp.js +0 -10
  282. package/lib/StandardDragModal/draggableModalReducer.d.ts +0 -66
  283. package/lib/StandardDragModal/draggableModalReducer.js +0 -167
  284. package/lib/StandardDragModal/getWindowSize.d.ts +0 -4
  285. package/lib/StandardDragModal/getWindowSize.js +0 -13
  286. package/lib/StandardDragModal/index.less +0 -65
  287. package/lib/StandardDragModal/useDrag.d.ts +0 -5
  288. package/lib/StandardDragModal/useDrag.js +0 -73
  289. package/lib/StandardDragModal/usePrevious.d.ts +0 -1
  290. package/lib/StandardDragModal/usePrevious.js +0 -15
  291. package/lib/StandardDragModal/useResize.d.ts +0 -7
  292. package/lib/StandardDragModal/useResize.js +0 -81
  293. package/lib/utils/dictSelectUtil.js +0 -161
@@ -0,0 +1,217 @@
1
+ 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); }
2
+ import "antd/es/button/style";
3
+ import _Button from "antd/es/button";
4
+ import "antd/es/form/style";
5
+ import _Form from "antd/es/form";
6
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
7
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
8
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
12
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
13
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
14
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
15
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
16
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
17
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
18
+ import React from 'react';
19
+ import UtilValueFormat from '../utils/ValueFormat.js';
20
+ import ButtonGroup from '../ButtonGroup/index';
21
+ // import { general } from '../data/index';
22
+ import './style/index.less';
23
+ import RenderItemGroup from '../FormComp/RenderItemGroup';
24
+ var FormItem = _Form.Item;
25
+ var StandardFilter = /*#__PURE__*/function (_React$Component) {
26
+ function StandardFilter(props) {
27
+ var _this;
28
+ _classCallCheck(this, StandardFilter);
29
+ _this = _callSuper(this, StandardFilter, [props]);
30
+ _this.filterFormRef = /*#__PURE__*/React.createRef();
31
+ // 更新表单控件值,用于外部获取当前表单实例(force是否强制清空表单)
32
+ _this.updateFormFields = function (newVal, force) {
33
+ var getFormFields = _this.props.getFormFields;
34
+ var resetValues = {};
35
+ if (force) {
36
+ // this.filterFormRef.current.resetFields()
37
+ // 先清空 再赋值
38
+ resetValues = _this.filterFormRef.current.getFieldsValue();
39
+ Object.keys(resetValues).forEach(function (item) {
40
+ resetValues[item] = undefined;
41
+ });
42
+ }
43
+ _this.filterFormRef.current.setFieldsValue(Object.assign(Object.assign({}, resetValues), newVal)); // 直接清空表单的赋值
44
+ if (getFormFields) getFormFields(_this.filterFormRef.current.getFieldsValue(), _this.filterFormRef);
45
+ }; // 强制更新表单值,用于赋初始化实例值
46
+ _this.forceUpdateForm = function () {
47
+ var getFormFields = _this.props.getFormFields;
48
+ if (getFormFields) getFormFields(_this.filterFormRef.current.getFieldsValue(), _this.filterFormRef);
49
+ };
50
+ _this.handleSearch = function (values) {
51
+ var _this$props = _this.props,
52
+ formItemGroup = _this$props.formItemGroup,
53
+ onFilterSearch = _this$props.onFilterSearch;
54
+ // if (Object.prototype.hasOwnProperty.call(values, false)) {
55
+ // delete values.false // TODO 自定义结构会莫名的出来一个false字段
56
+ // }
57
+ var resultValues = UtilValueFormat(values, formItemGroup);
58
+ if (onFilterSearch) {
59
+ onFilterSearch(Object.assign({}, resultValues));
60
+ }
61
+ };
62
+ _this.handleReset = function () {
63
+ var onFilterReset = _this.props.onFilterReset;
64
+ // 使用此方法,表单校验无法清空掉
65
+ // const resetValues = this.filterFormRef.current.getFieldsValue()
66
+ // Object.keys(resetValues).forEach((item) => {
67
+ // resetValues[item] = undefined
68
+ // })
69
+ // this.filterFormRef.current.setFieldsValue({ ...resetValues }) // 直接清空表单的赋值
70
+ _this.filterFormRef.current.resetFields();
71
+ _this.setState({
72
+ reFormItemGroup: _this.props.formItemGroup // 重新渲染列表
73
+ });
74
+ if (onFilterReset) {
75
+ onFilterReset(_this.filterFormRef.current.getFieldsValue());
76
+ }
77
+ };
78
+ _this.itemIsHide = function (isHide) {
79
+ var current = _this.filterFormRef.current;
80
+ if (!isHide) return false;
81
+ if (typeof isHide === 'function') {
82
+ return isHide(current ? current.getFieldsValue() : {}, current);
83
+ }
84
+ return isHide;
85
+ };
86
+ // 表单列表组 formItemGroup 类型为数组或者React.Node
87
+ _this.renderFormItemGroup = function () {
88
+ var reFormItemGroup = _this.state.reFormItemGroup;
89
+ if (Array.isArray(reFormItemGroup)) {
90
+ return /*#__PURE__*/React.createElement(RenderItemGroup, {
91
+ itemGroup: reFormItemGroup,
92
+ layout: "inline",
93
+ form: _this.filterFormRef,
94
+ doUpdateFormFields: function doUpdateFormFields() {
95
+ return _this.forceUpdateForm();
96
+ }
97
+ });
98
+ /* return <>
99
+ {
100
+ reFormItemGroup.map((item, index) => {
101
+ const { componentStyle, isHide } = item
102
+ if (this.itemIsHide(isHide)) return null
103
+ return (
104
+ <FormItem key={item.filedName} label={item.label}
105
+ name={item.type !== 'custom' && item.filedName}
106
+ rules={item.rules || (item.fieldOptions ? item.fieldOptions.rules : [])}
107
+ {...item.protoFormItem}>
108
+ {
109
+ (item.type === 'custom' && item.customRender) ? item.customRender(this.filterFormRef, { ...item }) :
110
+ <FieldComponent {...item}
111
+ onChange={(val, ...otherParams) => {
112
+ let updateValue = val
113
+ if (item.type === 'input' || item.type === 'textarea' || item.type === 'radio') {
114
+ updateValue = val.target.value
115
+ }
116
+ if (Array.isArray(val)) {
117
+ updateValue = [...val]
118
+ }
119
+ this.updateFormFields({ [item.filedName]: updateValue })
120
+ if (item.onChange) item.onChange(val, this.filterFormRef, ...otherParams)
121
+ }}
122
+ style={{ width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' : general.formItemStyle.xsm.width, ...componentStyle }}/>
123
+ }
124
+ </FormItem>
125
+ )
126
+ })
127
+ }
128
+ </>*/
129
+ }
130
+ return reFormItemGroup;
131
+ };
132
+ _this.state = {
133
+ // recombinationGroup: [],
134
+ reFormItemGroup: undefined
135
+ };
136
+ return _this;
137
+ }
138
+ _inherits(StandardFilter, _React$Component);
139
+ return _createClass(StandardFilter, [{
140
+ key: "componentDidMount",
141
+ value: function componentDidMount() {
142
+ var initialValues = this.props.initialValues;
143
+ this.updateFormFields(initialValues, true);
144
+ }
145
+ }, {
146
+ key: "componentDidUpdate",
147
+ value: function componentDidUpdate(prevProps) {
148
+ var initialValues = this.props.initialValues;
149
+ if (prevProps.initialValues !== initialValues) {
150
+ this.updateFormFields(initialValues, true);
151
+ }
152
+ }
153
+ }, {
154
+ key: "render",
155
+ value: function render() {
156
+ var _this$props2 = this.props,
157
+ className = _this$props2.className,
158
+ style = _this$props2.style,
159
+ onFilterReset = _this$props2.onFilterReset,
160
+ _this$props2$buttonGr = _this$props2.buttonGroup,
161
+ buttonGroup = _this$props2$buttonGr === void 0 ? [] : _this$props2$buttonGr,
162
+ min = _this$props2.min,
163
+ codes = _this$props2.codes,
164
+ permissionCodes = _this$props2.permissionCodes,
165
+ confirmText = _this$props2.confirmText,
166
+ cancelText = _this$props2.cancelText,
167
+ onFilterSearch = _this$props2.onFilterSearch,
168
+ buttonGroupConfig = _this$props2.buttonGroupConfig;
169
+ // const { recombinationGroup } = this.state;
170
+ return /*#__PURE__*/React.createElement(_Form, {
171
+ name: "standard-filter-form",
172
+ ref: this.filterFormRef,
173
+ layout: "inline",
174
+ onFinish: this.handleSearch,
175
+ className: className,
176
+ style: style
177
+ }, /*#__PURE__*/React.createElement("div", {
178
+ className: "filter-grid"
179
+ }, /*#__PURE__*/React.createElement("div", {
180
+ className: "filter-form"
181
+ }, this.state.reFormItemGroup ? /*#__PURE__*/React.createElement(React.Fragment, null, this.renderFormItemGroup(), /*#__PURE__*/React.createElement(FormItem, {
182
+ style: {
183
+ display: !onFilterSearch && !onFilterReset ? 'none' : 'inline-block'
184
+ }
185
+ }, onFilterSearch && /*#__PURE__*/React.createElement(_Button, {
186
+ type: "primary",
187
+ htmlType: "submit"
188
+ }, " ", confirmText || '查询'), onFilterReset && /*#__PURE__*/React.createElement(_Button, {
189
+ type: "primary",
190
+ style: {
191
+ marginLeft: 8
192
+ },
193
+ onClick: this.handleReset,
194
+ ghost: true
195
+ }, cancelText || '重置'))) : null), buttonGroup && buttonGroup.length > 0 ? /*#__PURE__*/React.createElement("div", {
196
+ className: "filter-btns"
197
+ }, /*#__PURE__*/React.createElement(ButtonGroup, {
198
+ options: buttonGroup,
199
+ min: min,
200
+ codes: codes,
201
+ permissionCodes: permissionCodes,
202
+ dropdownConfig: buttonGroupConfig
203
+ })) : null));
204
+ }
205
+ }], [{
206
+ key: "getDerivedStateFromProps",
207
+ value: function getDerivedStateFromProps(nextProps) {
208
+ var formItemGroup = nextProps.formItemGroup;
209
+ // const restOptionList = removeNoPermission(buttonGroup, permissionCodes, codes) || []
210
+ return {
211
+ // recombinationGroup: restOptionList,
212
+ reFormItemGroup: formItemGroup
213
+ };
214
+ }
215
+ }]);
216
+ }(React.Component);
217
+ export default StandardFilter;
@@ -4,40 +4,109 @@
4
4
  .filter-grid {
5
5
  display: flex;
6
6
  width: 100%;
7
+ flex-wrap: wrap;
8
+
9
+ &.filter-grid-horizontal {
10
+ .filter-form {
11
+ width: 100%;
12
+
13
+ & > .ant-row {
14
+ width: 100%;
15
+ }
16
+
17
+ // 标签域自动换行
18
+ //.ant-form-item-label > label {
19
+ // white-space: pre-wrap;
20
+ // height: auto;
21
+ // min-height: @input-height-base;
22
+ //}
23
+
24
+ // 标签域自动换行
25
+ //.ant-form-item-control,
26
+ //.ant-form-item-label {
27
+ // line-height: 16px;
28
+ //}
29
+ }
30
+
31
+ .filter-btns {
32
+ width: 100%;
33
+ text-align: left;
34
+
35
+ .spec-button-group {
36
+ padding-left: 0;
37
+ padding-top: @padding-md;
38
+
39
+ .ant-btn:first-child {
40
+ margin-left: 0;
41
+ }
42
+ }
43
+ }
44
+
45
+ }
46
+
47
+
7
48
  .filter-form {
8
49
  flex: 1;
9
50
  font-size: 0;
10
51
  display: flex;
11
52
  flex-wrap: wrap;
53
+
54
+ &.filter-form-vertical {
55
+ display: block;
56
+
57
+ .ant-form-item {
58
+ margin-right: 0;
59
+ }
60
+ }
61
+
62
+ &.filter-form-horizontal {
63
+ .ant-form-item {
64
+ margin-right: 0;
65
+ }
66
+ }
12
67
  .ant-form-item {
13
68
  margin-right: @padding-md; // 16px
14
69
  margin-bottom: @padding-md;
15
- .ant-form-item{
70
+
71
+ .ant-form-item {
16
72
  margin-bottom: 0;
17
73
  }
18
74
  }
19
- .ant-form-item-control{
75
+
76
+ .ant-form-item-control {
20
77
  .ant-form-item-control-input {
21
- min-width: 180px;
78
+ //min-width: 180px;
22
79
  }
23
80
  }
81
+
24
82
  .ant-form-item-control,
25
83
  .ant-form-item-label {
26
- line-height: 32px;
84
+ line-height: @input-height-base;
85
+ }
86
+ }
87
+
88
+ &.filter-grid-inline {
89
+ .filter-form +.filter-btns {
90
+ .spec-button-group {
91
+ padding-left: 80px;
92
+ }
27
93
  }
28
94
  }
29
95
  .filter-btns {
30
96
  //max-width: 340px;
31
97
  text-align: right;
32
- .spec-button-group {
33
- padding-left: 80px;
34
- }
98
+
35
99
  .ant-btn {
36
100
  margin-bottom: @padding-md;
37
101
  margin-left: @padding-sm;
102
+ &:first-child {
103
+ margin-left: 0;
104
+ }
38
105
  }
106
+
39
107
  }
40
- .ant-select-single:not(.ant-select-customize-input) .ant-select-selector{
108
+
109
+ .ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
41
110
  line-height: @height-base - 2;
42
111
  }
43
112
 
@@ -46,12 +115,15 @@
46
115
  .toolbarBtn {
47
116
  min-height: @btn-height-base;
48
117
  margin-bottom: @padding-md;
118
+
49
119
  .ant-btn {
50
120
  margin-right: @padding-md;
51
121
  }
52
122
  }
123
+
53
124
  .toolbar {
54
125
  margin-bottom: @padding-md;
126
+
55
127
  .toolbar-tForm {
56
128
  //min-height: @btn-height-base;
57
129
  //display: flex;
@@ -59,6 +131,7 @@
59
131
  //align-items: center;
60
132
  }
61
133
  }
62
- .searchForm{
134
+
135
+ .searchForm {
63
136
  margin-bottom: @padding-md;
64
137
  }
@@ -15,5 +15,5 @@ export interface StepFormProp extends StandardFormProps {
15
15
  stepClick?: (type?: string, formChild?: any, values?: any) => void;
16
16
  formItemGroup?: StepItemGroupProps[];
17
17
  }
18
- declare const StepForm: React.ForwardRefExoticComponent<Pick<StepFormProp, string | number> & React.RefAttributes<unknown>>;
18
+ declare const StepForm: React.ForwardRefExoticComponent<Omit<StepFormProp, "ref"> & React.RefAttributes<unknown>>;
19
19
  export default StepForm;
@@ -1,21 +1,22 @@
1
1
  import "antd/es/col/style";
2
2
  import _Col from "antd/es/col";
3
- import "antd/es/steps/style";
4
- import _Steps from "antd/es/steps";
5
3
  import "antd/es/button/style";
6
4
  import _Button from "antd/es/button";
7
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
+ import "antd/es/steps/style";
6
+ import _Steps from "antd/es/steps";
7
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
8
8
  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."); }
9
- 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); }
10
- 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; }
11
- 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; } }
12
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { __rest } from "tslib";
9
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
+ 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; } }
12
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
14
13
  import React, { useEffect, useState, useMemo } from 'react';
15
14
  import StandardForm from './index';
16
15
  import RenderItemGroup from '../FormComp/RenderItemGroup';
17
16
  import ActionList from "./ActionList";
18
17
  import './style/index.less';
18
+ // import { BreadcrumbProps as AntdBreadcrumbProps } from 'antd/es/form';
19
+ var Step = _Steps.Step;
19
20
  var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
20
21
  var getFormFields = props.getFormFields,
21
22
  _props$formItemGroup = props.formItemGroup,
@@ -47,7 +48,8 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
47
48
  var _useState5 = useState(0),
48
49
  _useState6 = _slicedToArray(_useState5, 2),
49
50
  currentStep = _useState6[0],
50
- setCurrentStep = _useState6[1]; // const [fieldFailed, setFieldFailed] = useState(false)
51
+ setCurrentStep = _useState6[1];
52
+ // const [fieldFailed, setFieldFailed] = useState(false)
51
53
  useEffect(function () {
52
54
  if (stepsConfig && (stepsConfig.current || stepsConfig.current === 0)) {
53
55
  setCurrentStep(stepsConfig.current); // 判断是否有设置当前选中的步骤数
@@ -87,7 +89,6 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
87
89
  var errorFields = _ref.errorFields;
88
90
  } // console.log('表单校验不通过 ', errorFields.map(err => err))
89
91
  );
90
-
91
92
  break;
92
93
  case 'prev':
93
94
  if (stepClick) stepClick(type, formChild);
@@ -101,15 +102,6 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
101
102
  break;
102
103
  }
103
104
  };
104
- var stepItems = useMemo(function () {
105
- return (formItemGroup || []).filter(function (fItem) {
106
- return !fItem.hideStep;
107
- }).map(function (item, index) {
108
- var hideStep = item.hideStep,
109
- StepItem = __rest(item, ["hideStep"]);
110
- return Object.assign({}, StepItem);
111
- });
112
- }, [formItemGroup]);
113
105
  /* const handleStepChange = (cur:any) => {
114
106
  // 自行判断是否校验通过
115
107
  /!* if (cur > current) {
@@ -212,9 +204,23 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
212
204
  onFinishFailed: function onFinishFailed() {
213
205
  // setFieldFailed(true)
214
206
  }
215
- }, /*#__PURE__*/React.createElement(_Steps, Object.assign({}, stepsConfig, {
216
- items: stepItems
217
- })), (formItemGroup || []).map(function (item, index) {
207
+ }, /*#__PURE__*/React.createElement(_Steps, Object.assign({}, stepsConfig), formItemGroup.filter(function (fItem) {
208
+ return !fItem.hideStep;
209
+ }).map(function (item, index) {
210
+ return /*#__PURE__*/React.createElement(Step, {
211
+ key: "".concat(item.title).concat(index),
212
+ description: item.description,
213
+ icon: item.icon,
214
+ status: item.status,
215
+ title: item.title,
216
+ subTitle: item.subTitle,
217
+ disabled: item.disabled
218
+ });
219
+ })),
220
+ // 过滤隐藏掉的步骤表单
221
+ formItemGroup.filter(function (fItem) {
222
+ return !fItem.hideStep;
223
+ }).map(function (item, index) {
218
224
  return /*#__PURE__*/React.createElement("div", {
219
225
  key: index,
220
226
  className: "stepForm-content ".concat(layout === 'inline' ? 'stepForm-content-inline' : ''),
@@ -15,5 +15,5 @@ export interface TabFormProp extends StandardFormProps {
15
15
  actionHide?: boolean;
16
16
  formItemGroup?: TabItemGroupProps[];
17
17
  }
18
- declare const TabForm: React.ForwardRefExoticComponent<Pick<TabFormProp, string | number> & React.RefAttributes<unknown>>;
18
+ declare const TabForm: React.ForwardRefExoticComponent<Omit<TabFormProp, "ref"> & React.RefAttributes<unknown>>;
19
19
  export default TabForm;
@@ -1,19 +1,20 @@
1
- import "antd/es/tabs/style";
2
- import _Tabs from "antd/es/tabs";
3
1
  import "antd/es/col/style";
4
2
  import _Col from "antd/es/col";
5
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ import "antd/es/tabs/style";
4
+ import _Tabs from "antd/es/tabs";
5
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
6
6
  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."); }
7
- 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); }
8
- 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; }
9
- 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; } }
10
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
8
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
9
+ 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; } }
10
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
11
11
  import { __rest } from "tslib";
12
12
  import React, { useEffect, useState, useMemo } from 'react';
13
13
  import './style/index.less';
14
14
  import StandardForm from './index';
15
15
  import RenderItemGroup from '../FormComp/RenderItemGroup';
16
16
  import ActionList from "./ActionList";
17
+ var TabPane = _Tabs.TabPane;
17
18
  var TabForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
18
19
  var getFormFields = props.getFormFields,
19
20
  _props$formItemGroup = props.formItemGroup,
@@ -37,7 +38,8 @@ var TabForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
37
38
  var _useState3 = useState(),
38
39
  _useState4 = _slicedToArray(_useState3, 2),
39
40
  formChild = _useState4[0],
40
- setFormChild = _useState4[1]; // const [fieldFailed, setFieldFailed] = useState(false)
41
+ setFormChild = _useState4[1];
42
+ // const [fieldFailed, setFieldFailed] = useState(false)
41
43
  var formGridSize = useMemo(function () {
42
44
  if (typeof grid === 'string') return grid; // 数据格式为字符串,包括 xs,md,lg,xlg
43
45
  var sizeName = 'xs';
@@ -55,39 +57,6 @@ var TabForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
55
57
  getFormFields && getFormFields(formChildFields, formChild);
56
58
  };
57
59
  if (formItemGroup.length === 0) return null;
58
- var items = useMemo(function () {
59
- return formItemGroup.map(function (item, index) {
60
- var title = item.title,
61
- fields = item.fields,
62
- actions = item.actions,
63
- tabConfig = __rest(item, ["title", "fields", "actions"]);
64
- return Object.assign({
65
- key: item.key || index,
66
- label: title || item.label,
67
- children: /*#__PURE__*/React.createElement("div", {
68
- className: "tabForm-content ".concat(layout === 'inline' ? 'tabForm-content-inline' : '')
69
- }, fields && Array.isArray(fields) ? /*#__PURE__*/React.createElement(RenderItemGroup, {
70
- layout: layout,
71
- form: formChild,
72
- fieldStatus: fieldStatus,
73
- size: formGridSize,
74
- displayLayout: displayLayout,
75
- doUpdateFormFields: function doUpdateFormFields() {
76
- return forceUpdateForm();
77
- },
78
- // doUpdateFormFields={() => forceUpdateForm()}
79
- itemGroup: fields
80
- }) : fields, !actionHide && actions && /*#__PURE__*/React.createElement(_Col, {
81
- span: 24
82
- }, /*#__PURE__*/React.createElement(ActionList, {
83
- list: item.actions,
84
- form: formChild,
85
- other: props,
86
- align: actionAlign
87
- })))
88
- }, tabConfig);
89
- });
90
- }, [formItemGroup]);
91
60
  return /*#__PURE__*/React.createElement(StandardForm, {
92
61
  actionGroup: [],
93
62
  ref: ref,
@@ -103,8 +72,37 @@ var TabForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
103
72
  }, /*#__PURE__*/React.createElement(_Tabs, Object.assign({
104
73
  type: "card",
105
74
  animated: false
106
- }, tabsConfig, {
107
- items: items
75
+ }, tabsConfig), formItemGroup.map(function (item, index) {
76
+ var title = item.title,
77
+ fields = item.fields,
78
+ actions = item.actions,
79
+ tabConfig = __rest(item, ["title", "fields", "actions"]);
80
+ return /*#__PURE__*/React.createElement(TabPane, Object.assign({
81
+ key: "".concat(item.key || index),
82
+ tab: title
83
+ }, tabConfig, {
84
+ forceRender: true
85
+ }), /*#__PURE__*/React.createElement("div", {
86
+ className: "tabForm-content ".concat(layout === 'inline' ? 'tabForm-content-inline' : '')
87
+ }, fields && Array.isArray(fields) ? /*#__PURE__*/React.createElement(RenderItemGroup, {
88
+ layout: layout,
89
+ form: formChild,
90
+ fieldStatus: fieldStatus,
91
+ size: formGridSize,
92
+ displayLayout: displayLayout,
93
+ doUpdateFormFields: function doUpdateFormFields() {
94
+ return forceUpdateForm();
95
+ },
96
+ // doUpdateFormFields={() => forceUpdateForm()}
97
+ itemGroup: fields
98
+ }) : fields, !actionHide && actions && /*#__PURE__*/React.createElement(_Col, {
99
+ span: 24
100
+ }, /*#__PURE__*/React.createElement(ActionList, {
101
+ list: item.actions,
102
+ form: formChild,
103
+ other: props,
104
+ align: actionAlign
105
+ }))));
108
106
  })));
109
107
  });
110
108
  export default TabForm;
@@ -28,5 +28,5 @@ export interface StandardFormProps {
28
28
  displayLayout?: any;
29
29
  [k: string]: any;
30
30
  }
31
- declare const StandardForm: React.ForwardRefExoticComponent<Pick<StandardFormProps, string | number> & React.RefAttributes<unknown>>;
31
+ declare const StandardForm: React.ForwardRefExoticComponent<Omit<StandardFormProps, "ref"> & React.RefAttributes<unknown>>;
32
32
  export default StandardForm;
@@ -2,12 +2,12 @@ import "antd/es/button/style";
2
2
  import _Button from "antd/es/button";
3
3
  import "antd/es/form/style";
4
4
  import _Form from "antd/es/form";
5
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
6
6
  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."); }
7
- 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); }
8
- 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; }
9
- 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; } }
10
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
8
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
9
+ 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; } }
10
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
11
11
  import { __rest } from "tslib";
12
12
  import React, { useEffect, useMemo } from 'react';
13
13
  import classNames from 'classnames';
@@ -11,5 +11,4 @@ var updateModalForm = function updateModalForm(props) {
11
11
  return /*#__PURE__*/React.createElement(React.Fragment, null);
12
12
  /* 如果是ReactNode则直接返回 */
13
13
  };
14
-
15
14
  export default updateModalForm;
@@ -3,6 +3,7 @@ import { ModalProps } from 'antd/es/modal';
3
3
  import PropTypes from 'prop-types';
4
4
  import { ItemGroupProps } from '../StandardForm/index';
5
5
  import './style/index.less';
6
+ import 'ant-design-draggable-modal/dist/index.css';
6
7
  export interface StandardModalProps extends ModalProps {
7
8
  children?: React.ReactNode;
8
9
  title?: String;
@@ -39,5 +40,5 @@ export interface StandardModalProps extends ModalProps {
39
40
  dragAble?: boolean;
40
41
  [k: string]: any;
41
42
  }
42
- declare const StandardModal: (props: StandardModalProps) => JSX.Element;
43
+ declare const StandardModal: (props: StandardModalProps) => React.JSX.Element;
43
44
  export default StandardModal;