fan-standard-comp 3.2.1 → 3.2.3

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 +2 -32
  2. package/dist/09cd8e9be7081f2166444cce393fe968.svg +54 -0
  3. package/dist/e3378c145b7db195ad068735e15fb28a.svg +165 -0
  4. package/dist/fan-standard-comp.umd.js +183 -439
  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 +146 -180
  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 +37 -26
  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 +9 -2
  41. package/es/FormComp/Uploader/index.js +325 -156
  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 +150 -185
  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 +41 -28
  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 +9 -2
  151. package/lib/FormComp/Uploader/index.js +325 -159
  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 +15 -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
@@ -1,3 +1,9 @@
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
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ 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); }
1
7
  /**
2
8
  * @description 递归查看父级节点数据集合及当前节点数据
3
9
  * @params {Array} list 当前需要过滤查看的数据集合、
@@ -10,7 +16,7 @@
10
16
  * @result {Array} parentKeys 当前传入nodeKey值所有上级别父级数据关键字数据集合(keyParam)(倒序排列,根节点在最后一条)
11
17
  * @result {Array} matchNode 当前传入nodeKey值所在的数据对象集合
12
18
  * */
13
- var getParentNodes = function getParentNodes(list, nodeKey) {
19
+ export var getParentNodes = function getParentNodes(list, nodeKey) {
14
20
  var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
15
21
  childrenParam: 'children',
16
22
  keyParam: 'value'
@@ -30,7 +36,7 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
30
36
  }
31
37
  return null;
32
38
  };
33
- var deepFind = function deepFind(array, nodeId) {
39
+ var _deepFind = function deepFind(array, nodeId) {
34
40
  for (var i = 0; i < array.length; i += 1) {
35
41
  var node = array[i];
36
42
  if (node[params.keyParam] === nodeId) {
@@ -39,7 +45,7 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
39
45
  }
40
46
  // 如果是单个
41
47
  if (node[params.childrenParam] && node[params.childrenParam].length > 0) {
42
- deepFind(node[params.childrenParam] || node[params.childrenParam], nodeId);
48
+ _deepFind(node[params.childrenParam] || node[params.childrenParam], nodeId);
43
49
  nodeParent.push(node); // 将当前节点数据存储到父节点数据中
44
50
  if (matchNode.length > 0) {
45
51
  break; // 在子节点查找到了,需要跳出
@@ -76,12 +82,11 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
76
82
  }
77
83
  }*/
78
84
  }
79
-
80
85
  return matchNode; // 返回查找到的节点数据(格式为数组)
81
86
  };
82
87
 
83
88
  // 查找单个节点
84
- var findMatchItem = function findMatchItem(arrList, key) {
89
+ var _findMatchItem = function findMatchItem(arrList, key) {
85
90
  var matchItem;
86
91
  for (var i = 0; i < arrList.length; i += 1) {
87
92
  var node = arrList[i];
@@ -90,7 +95,7 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
90
95
  break;
91
96
  }
92
97
  if (node[params.childrenParam]) {
93
- matchItem = findMatchItem(node[params.childrenParam], key);
98
+ matchItem = _findMatchItem(node[params.childrenParam], key);
94
99
  }
95
100
  }
96
101
  return matchItem;
@@ -100,11 +105,11 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
100
105
  // const {showCheckedStrategy} = extraProps;
101
106
  // TODO 需要判断 showCheckedStrategy 值为 SHOW_PARENT、 SHOW_CHILD 、SHOW_ALL不同情况展示
102
107
  nodeKey.map(function (key) {
103
- var matchItem = findMatchItem(list, key);
104
- if (matchItem) matchNode.push(findMatchItem(list, key));
108
+ var matchItem = _findMatchItem(list, key);
109
+ if (matchItem) matchNode.push(_findMatchItem(list, key));
105
110
  });
106
111
  } else {
107
- deepFind(list, nodeKey);
112
+ _deepFind(list, nodeKey);
108
113
  }
109
114
  nodeParent.forEach(function (par) {
110
115
  return parentKeys.push(par[params.keyParam]);
@@ -117,42 +122,47 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
117
122
  };
118
123
 
119
124
  /**
120
- * @description 递归查找树的所有节点及id
125
+ * @description 递归查找指定ID所有的子菜单与子功能集合
121
126
  * @params {Array} childNode 当前需要过滤查看的数据集合、
122
127
  * @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
123
- * @value { String } childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名)
124
- * @value { String } keyParam: 指当前匹配标识值字段名)
128
+ * (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
129
+ * @params {Object} extra
125
130
  *
126
131
  * @result {Array} childKeys 所有子项的id
127
- * @result {Array} nodeChildren 所有节点数据对象集合
128
- *
129
- * @usage:
130
- * getChildrenNodes(childNode, params)
132
+ * @result {Array} nodeChildren 当前传入nodeKey值所在的数据对象集合
131
133
  * */
132
134
 
133
- var getChildrenNodes = function getChildrenNodes(childNode) {
135
+ export var getChildrenNodes = function getChildrenNodes(childNode) {
134
136
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
135
137
  childrenParam: 'children',
136
138
  keyParam: 'value'
137
139
  };
138
140
  var childKeys = [];
139
141
  var nodeChildren = []; // 存储:authId, types
140
- var deepFindChild = function deepFindChild(cList) {
142
+ var _deepFindChild = function deepFindChild(cList) {
141
143
  Array.isArray(cList) && cList.forEach(function (item) {
142
144
  childKeys.push(item[params.keyParam]);
143
145
  nodeChildren.push(item);
144
- if (item[params.childrenParam]) deepFindChild(item[params.childrenParam]);
146
+ if (item[params.childrenParam]) _deepFindChild(item[params.childrenParam]);
145
147
  });
146
148
  };
147
- deepFindChild(childNode);
149
+ _deepFindChild(childNode);
148
150
  return {
149
151
  childKeys: childKeys,
150
152
  nodeChildren: nodeChildren
151
153
  };
152
154
  };
153
155
 
154
- // 查找节点路径
155
- var getNodePaths = function getNodePaths(list, nodeKey) {
156
+ /**
157
+ * @description 查找节点路径
158
+ * @params {Array} list 查询的数据源
159
+ * @params {Array} nodeKey 需要查询的key集合
160
+ * @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
161
+ * (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
162
+ *
163
+ * @result {Array} 所有匹配到的层级数据
164
+ * */
165
+ export var getNodePaths = function getNodePaths(list, nodeKey) {
156
166
  var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
157
167
  childrenParam: 'children',
158
168
  keyParam: 'value'
@@ -160,7 +170,7 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
160
170
  var extraProps = arguments.length > 3 ? arguments[3] : undefined;
161
171
  // 获取指定节点的路径数组
162
172
  var getPathByKey = function getPathByKey(value, arr) {
163
- var findNodePath = function findNodePath(node, value, nodePathArray) {
173
+ var _findNodePath = function findNodePath(node, value, nodePathArray) {
164
174
  // 这里可以自定义push的内容,而不是整个node,而且这里node也包含了children
165
175
  nodePathArray.push(node);
166
176
  // 找到符合条件的节点,通过throw终止掉递归
@@ -170,7 +180,7 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
170
180
  }
171
181
  if (node[params.childrenParam] && node[params.childrenParam].length > 0) {
172
182
  for (var i = 0; i < node[params.childrenParam].length; i++) {
173
- findNodePath(node[params.childrenParam][i], value, nodePathArray);
183
+ _findNodePath(node[params.childrenParam][i], value, nodePathArray);
174
184
  }
175
185
  // 当前节点的子节点遍历完依旧没找到,则删除路径中的该节点
176
186
  nodePathArray.pop();
@@ -184,7 +194,7 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
184
194
  var nodePathArray = [];
185
195
  try {
186
196
  for (var i = 0; i < arr.length; i++) {
187
- findNodePath(arr[i], value, nodePathArray);
197
+ _findNodePath(arr[i], value, nodePathArray);
188
198
  }
189
199
  } catch (e) {
190
200
  return nodePathArray;
@@ -199,4 +209,69 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
199
209
  }
200
210
  return pathNode;
201
211
  };
202
- export { getParentNodes, getChildrenNodes, getNodePaths };
212
+
213
+ /**
214
+ * 数组转树形结构
215
+ * @param {array} list 被转换的数组
216
+ * @param {number|string} root 根节点(最外层节点)的 id
217
+ * @param {object} params 字段值(默认 { keyParam: 'id', parentParam: 'parentId' })
218
+ * @return array
219
+ */
220
+ /**
221
+ * 数组转树形结构
222
+ * @param {array} list 被转换的数组
223
+ * @param {number|string} root 根节点(最外层节点)的 id
224
+ * @param {object} params 字段值(默认 { keyParam: 'id', parentParam: 'parentId' })
225
+ * @return array
226
+ */
227
+ var _arrayToTree = function arrayToTree(list, rootId) {
228
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
229
+ _ref$keyParam = _ref.keyParam,
230
+ keyParam = _ref$keyParam === void 0 ? "id" : _ref$keyParam,
231
+ _ref$parentParam = _ref.parentParam,
232
+ parentParam = _ref$parentParam === void 0 ? "parentId" : _ref$parentParam,
233
+ _ref$childrenParam = _ref.childrenParam,
234
+ childrenParam = _ref$childrenParam === void 0 ? "children" : _ref$childrenParam;
235
+ var res = [];
236
+ list.forEach(function (item) {
237
+ if (item[parentParam] === rootId) {
238
+ var itemChildren = _arrayToTree(list, item[keyParam]);
239
+ if (itemChildren.length) item[childrenParam] = itemChildren;
240
+ res.push(item);
241
+ }
242
+ });
243
+ return res;
244
+ };
245
+ /**
246
+ * 多根树转换成数组
247
+ * @param {array} tree 被转换的树(仅限于只有一个根的树
248
+ * @return array
249
+ */
250
+ export { _arrayToTree as arrayToTree };
251
+ export var convertToArray = function convertToArray(tree) {
252
+ var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
253
+ _ref2$keyParam = _ref2.keyParam,
254
+ keyParam = _ref2$keyParam === void 0 ? "id" : _ref2$keyParam,
255
+ _ref2$parentParam = _ref2.parentParam,
256
+ parentParam = _ref2$parentParam === void 0 ? "parentId" : _ref2$parentParam,
257
+ _ref2$childrenParam = _ref2.childrenParam,
258
+ childrenParam = _ref2$childrenParam === void 0 ? "children" : _ref2$childrenParam;
259
+ var result = []; // 存放结果的数组
260
+ var sortCount = 0;
261
+ tree.forEach(function (item) {
262
+ var _loop = function loop(data) {
263
+ sortCount++;
264
+ result.push(_objectSpread(_objectSpread({}, data), {}, {
265
+ sort: sortCount
266
+ }));
267
+ var child = data[childrenParam];
268
+ if (child) {
269
+ for (var i = 0; i < child.length; i++) {
270
+ _loop(child[i]);
271
+ }
272
+ }
273
+ };
274
+ _loop(item);
275
+ });
276
+ return result;
277
+ };
package/es/utils/index.js CHANGED
@@ -1,4 +1,3 @@
1
1
  import UtilValueFormat from './ValueFormat';
2
- import { getParentNodes, getChildrenNodes, getNodePaths } from './getParentNodes';
3
- export { UtilValueFormat, getParentNodes, getChildrenNodes, getNodePaths };
4
- export * from './dictSelectUtil';
2
+ export * from './getParentNodes';
3
+ export { UtilValueFormat };
@@ -0,0 +1,76 @@
1
+ import { parse } from "qs";
2
+ /**
3
+ * 获取url的search,并有条件:`^{变量名}`的条件取本地存储的数据 // 参数格式:^{变量名} 变量名支持数字、字母、下划线
4
+ * */
5
+ export var getUrlSearch = function getUrlSearch(href) {
6
+ var searchKeys = {};
7
+ if (isUrl(href)) {
8
+ var url = new URL(href);
9
+ searchKeys = parse(url.search, {
10
+ ignoreQueryPrefix: true // 去除第一个字符'?'
11
+ });
12
+ } else {
13
+ searchKeys = parse(href.split('?')[1], {
14
+ ignoreQueryPrefix: true // 去除第一个字符'?'
15
+ });
16
+ }
17
+ // 有带参数,取本地的数据
18
+ Object.keys(searchKeys).forEach(function (item) {
19
+ var _searchKeys$item;
20
+ // 取变量名对应本地的值
21
+ if (((_searchKeys$item = searchKeys[item]) === null || _searchKeys$item === void 0 ? void 0 : _searchKeys$item.indexOf('^{')) !== -1) {
22
+ // 清除"^{"与"}"取当前的
23
+ var keyParam = searchKeys[item].replace('^{', '').substring(0, searchKeys[item].replace('^{', '').lastIndexOf('}'));
24
+ searchKeys[item] = localStorage.getItem(keyParam) || undefined;
25
+ }
26
+ });
27
+ return searchKeys;
28
+ };
29
+
30
+ /**
31
+ * 获取url的search,并有条件:`^{变量名}`的条件取本地存储的数据 // 参数格式:^{变量名} 变量名支持数字、字母、下划线
32
+ * 根据url上的参数变量,重新调整跳转链接
33
+ * */
34
+ export var getJumpUrlBySearch = function getJumpUrlBySearch(href) {
35
+ var searchKeys = {};
36
+ var getPath;
37
+ if (isUrl(href)) {
38
+ var url = new URL(href);
39
+ searchKeys = parse(url.search, {
40
+ ignoreQueryPrefix: true // 去除第一个字符'?'
41
+ });
42
+ getPath = url.origin + url.pathname; // 取条件参数外的地址
43
+ } else {
44
+ searchKeys = parse(href.split('?')[1], {
45
+ ignoreQueryPrefix: true // 去除第一个字符'?'
46
+ });
47
+ getPath = href.split('?').length > 0 ? href.split('?')[0] : ''; // 取条件参数外的地址
48
+ }
49
+ // 有带参数,取本地的数据,然后拼接给地址
50
+ Object.keys(searchKeys).forEach(function (item, index) {
51
+ var _searchKeys$item2;
52
+ // 取变量名
53
+ if (((_searchKeys$item2 = searchKeys[item]) === null || _searchKeys$item2 === void 0 ? void 0 : _searchKeys$item2.indexOf('^{')) !== -1) {
54
+ // 清除"^{"与"}"取当前的
55
+ var keyParam = searchKeys[item].replace('^{', '').substring(0, searchKeys[item].replace('^{', '').lastIndexOf('}'));
56
+ searchKeys[item] = localStorage.getItem(keyParam) || '';
57
+ }
58
+ getPath += (index === 0 ? "?" : '&') + item + "=" + searchKeys[item];
59
+ });
60
+ return getPath;
61
+ };
62
+ /**
63
+ * 是否是完整的URL
64
+ *
65
+ * */
66
+ export var isUrl = function isUrl(path) {
67
+ if (!path.startsWith('http')) {
68
+ return false;
69
+ }
70
+ try {
71
+ var url = new URL(path);
72
+ return !!url;
73
+ } catch (error) {
74
+ return false;
75
+ }
76
+ };
@@ -1,2 +1,3 @@
1
- declare const RenderButtonList: (item: any) => JSX.Element;
1
+ import React from "react";
2
+ declare const RenderButtonList: (item: any) => React.JSX.Element;
2
3
  export default RenderButtonList;
@@ -13,7 +13,7 @@ var _SpecIcon = _interopRequireDefault(require("@/SpecIcon"));
13
13
  var _ButtonMenu = _interopRequireDefault(require("./ButtonMenu"));
14
14
  var _IconNode = _interopRequireDefault(require("@/components/IconNode"));
15
15
  var _filterPermission = require("@/utils/filterPermission");
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
17
  // 渲染按钮形式 (用于筛选)
18
18
 
19
19
  var RenderButtonList = function RenderButtonList(item) {
@@ -39,5 +39,4 @@ var RenderButtonList = function RenderButtonList(item) {
39
39
  } : null
40
40
  }, item.exName || item.name);
41
41
  };
42
- var _default = RenderButtonList;
43
- exports.default = _default;
42
+ var _default = exports.default = RenderButtonList;
@@ -1,2 +1,3 @@
1
- declare const RenderButtonList: (group: any) => JSX.Element;
1
+ import React from "react";
2
+ declare const RenderButtonList: (group: any) => React.JSX.Element;
2
3
  export default RenderButtonList;
@@ -8,7 +8,7 @@ require("antd/es/menu/style");
8
8
  var _menu = _interopRequireDefault(require("antd/es/menu"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _IconNode = _interopRequireDefault(require("@/components/IconNode"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  // 渲染按钮多层级形式 (用于筛选)
13
13
 
14
14
  var RenderButtonList = function RenderButtonList(group) {
@@ -40,5 +40,4 @@ var RenderButtonList = function RenderButtonList(group) {
40
40
  }), " ", item.exName || item.name));
41
41
  }));
42
42
  };
43
- var _default = RenderButtonList;
44
- exports.default = _default;
43
+ var _default = exports.default = RenderButtonList;
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
10
10
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
- 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); }
12
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
13
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
14
- 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 _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; } }
12
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
13
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
14
+ 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; }
15
15
  // 气泡确认框标题配置
16
16
  var PopConfirmTitle = function PopConfirmTitle(propsData) {
17
17
  var confirmConfig = propsData.confirmConfig,
@@ -31,5 +31,4 @@ var PopConfirmTitle = function PopConfirmTitle(propsData) {
31
31
  }
32
32
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, null);
33
33
  };
34
- var _default = PopConfirmTitle;
35
- exports.default = _default;
34
+ var _default = exports.default = PopConfirmTitle;
@@ -27,6 +27,8 @@ interface ButtonGroupProps {
27
27
  options?: ButtonGroupOptionsProps[];
28
28
  min?: number;
29
29
  dropdownConfig?: Object;
30
+ moreText?: string;
31
+ moreIcon?: React.ReactNode | string | number;
30
32
  }
31
- declare const ButtonGroup: (props: ButtonGroupProps) => JSX.Element;
33
+ declare const ButtonGroup: (props: ButtonGroupProps) => React.JSX.Element;
32
34
  export default ButtonGroup;