fan-standard-comp 3.1.4 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +173 -0
  2. package/dist/fan-standard-comp.umd.js +597 -0
  3. package/dist/fonts/iconfont.eot +0 -0
  4. package/dist/fonts/iconfont.ttf +0 -0
  5. package/dist/fonts/iconfont.woff +0 -0
  6. package/es/ButtonGroup/ButtonList.d.ts +2 -0
  7. package/es/ButtonGroup/ButtonList.js +37 -0
  8. package/es/ButtonGroup/ButtonMenu.d.ts +2 -0
  9. package/es/ButtonGroup/ButtonMenu.js +38 -0
  10. package/es/ButtonGroup/PopConfirmTitle.d.ts +9 -0
  11. package/es/ButtonGroup/PopConfirmTitle.js +37 -0
  12. package/es/ButtonGroup/index.d.ts +30 -0
  13. package/es/ButtonGroup/index.js +374 -0
  14. package/es/ButtonGroup/style/index.less +36 -0
  15. package/es/DragContent/DragBar.js +21 -0
  16. package/es/DragContent/index.d.ts +14 -0
  17. package/es/DragContent/index.js +173 -0
  18. package/es/DragContent/index.less +44 -0
  19. package/es/FormComp/ChunkUploader/api.js +76 -0
  20. package/es/FormComp/ChunkUploader/index.js +391 -0
  21. package/es/FormComp/ChunkUploader/lib.js +96 -0
  22. package/es/FormComp/ChunkUploader/style/style.less +3 -0
  23. package/es/FormComp/ChunkUploader/upload-queue.class.js +167 -0
  24. package/es/FormComp/ChunkUploader/worker.js +23 -0
  25. package/es/FormComp/EditButton/index.d.ts +26 -0
  26. package/es/FormComp/EditButton/index.js +140 -0
  27. package/es/FormComp/FieldComponent/ReUpload.d.ts +3 -0
  28. package/es/FormComp/FieldComponent/ReUpload.js +131 -0
  29. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +251 -0
  30. package/es/FormComp/FieldComponent/TitleNode.d.ts +6 -0
  31. package/es/FormComp/FieldComponent/TitleNode.js +9 -0
  32. package/es/FormComp/FieldComponent/index.d.ts +38 -0
  33. package/es/FormComp/FieldComponent/index.js +413 -0
  34. package/es/FormComp/FieldComponent/setReadonlyValues.js +236 -0
  35. package/es/FormComp/FieldComponent/style/index.less +120 -0
  36. package/es/FormComp/RenderItemGroup/index.d.ts +37 -0
  37. package/es/FormComp/RenderItemGroup/index.js +234 -0
  38. package/es/FormComp/Uploader/index.d.ts +21 -0
  39. package/es/FormComp/Uploader/index.js +277 -0
  40. package/es/FormComp/Uploader/style/index.less +14 -0
  41. package/es/FormComp/Uploader/util.d.ts +8 -0
  42. package/es/FormComp/Uploader/util.js +38 -0
  43. package/es/FormComp/VarTemplate/index.js +293 -0
  44. package/es/FormComp/index.d.ts +1 -0
  45. package/es/FormComp/index.js +1 -0
  46. package/es/NavLeafScroll/index.js +379 -0
  47. package/es/NavLeafScroll/style/index.less +119 -0
  48. package/es/RefactorTree/data.d.ts +7 -0
  49. package/es/RefactorTree/index.d.ts +40 -0
  50. package/es/RefactorTree/index.js +167 -0
  51. package/es/RefactorTree/indexTreeNode.d.ts +39 -0
  52. package/es/RefactorTree/indexTreeNode.js +237 -0
  53. package/es/RefactorTree/style/index.d.ts +1 -0
  54. package/es/RefactorTree/style/index.js +1 -0
  55. package/es/RefactorTree/style/index.less +22 -0
  56. package/es/RefactorTree/util.d.ts +42 -0
  57. package/es/RefactorTree/util.js +187 -0
  58. package/es/SpecIcon/fonts/demo.css +539 -0
  59. package/es/SpecIcon/fonts/demo_index.html +1315 -0
  60. package/es/SpecIcon/fonts/iconfont.css +211 -0
  61. package/es/SpecIcon/fonts/iconfont.eot +0 -0
  62. package/es/SpecIcon/fonts/iconfont.js +41 -0
  63. package/es/SpecIcon/fonts/iconfont.json +352 -0
  64. package/es/SpecIcon/fonts/iconfont.svg +173 -0
  65. package/es/SpecIcon/fonts/iconfont.ttf +0 -0
  66. package/es/SpecIcon/fonts/iconfont.woff +0 -0
  67. package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
  68. package/es/SpecIcon/index.d.ts +17 -0
  69. package/es/SpecIcon/index.js +77 -0
  70. package/es/SpecIcon/style/iconfont.less +213 -0
  71. package/es/SpecIcon/style/index.less +98 -0
  72. package/es/SplitterLayout/Pane.d.ts +13 -0
  73. package/es/SplitterLayout/Pane.js +36 -0
  74. package/es/SplitterLayout/index.js +375 -0
  75. package/es/SplitterLayout/index.less +58 -0
  76. package/es/StandardContent/SplitterLayout/Pane.js +50 -0
  77. package/es/StandardContent/SplitterLayout/index.js +374 -0
  78. package/es/StandardContent/SplitterLayout/index.less +58 -0
  79. package/es/StandardContent/SubfieldContent.d.ts +17 -0
  80. package/es/StandardContent/SubfieldContent.js +41 -0
  81. package/es/StandardContent/WrapperContent.d.ts +13 -0
  82. package/es/StandardContent/WrapperContent.js +29 -0
  83. package/es/StandardContent/data.d.ts +101 -0
  84. package/es/StandardContent/style/index.less +80 -0
  85. package/es/StandardDragModal/index.d.ts +11 -0
  86. package/es/StandardDragModal/index.js +30 -0
  87. package/es/StandardFilter/index.d.ts +35 -0
  88. package/es/StandardFilter/index.js +253 -0
  89. package/es/StandardFilter/style/index.less +62 -0
  90. package/es/StandardForm/ActionList.js +44 -0
  91. package/es/StandardForm/StepForm.d.ts +19 -0
  92. package/es/StandardForm/StepForm.js +267 -0
  93. package/es/StandardForm/TabForm.d.ts +19 -0
  94. package/es/StandardForm/TabForm.js +122 -0
  95. package/es/StandardForm/index.d.ts +32 -0
  96. package/es/StandardForm/index.js +170 -0
  97. package/es/StandardForm/style/index.less +58 -0
  98. package/es/StandardModal/UpdateFormRef.js +18 -0
  99. package/es/StandardModal/index.d.ts +44 -0
  100. package/es/StandardModal/index.js +494 -0
  101. package/es/StandardModal/style/index.less +50 -0
  102. package/es/StandardPanel/index.d.ts +28 -0
  103. package/es/StandardPanel/index.js +134 -0
  104. package/es/StandardPanel/style/index.less +135 -0
  105. package/es/StandardTable/index.d.ts +22 -0
  106. package/es/StandardTable/index.js +126 -0
  107. package/es/StandardTable/style/index.d.ts +1 -0
  108. package/es/StandardTable/style/index.js +1 -0
  109. package/es/StandardTable/style/index.less +206 -0
  110. package/es/components/IconNode/index.d.ts +16 -0
  111. package/es/components/IconNode/index.js +28 -0
  112. package/es/components/index.d.ts +2 -0
  113. package/es/components/index.js +2 -0
  114. package/es/data/func.code.js +112 -0
  115. package/es/data/general.config.js +172 -0
  116. package/es/data/index.js +3 -0
  117. package/es/index.d.ts +24 -0
  118. package/es/index.js +31 -0
  119. package/es/styles/index.less +0 -0
  120. package/es/theme/spec-variable.less +48 -0
  121. package/es/utils/ValueFormat.js +50 -0
  122. package/es/utils/filterPermission.js +111 -0
  123. package/es/utils/getParentNodes.js +215 -0
  124. package/es/utils/index.js +3 -0
  125. package/lib/ButtonGroup/ButtonList.d.ts +2 -0
  126. package/lib/ButtonGroup/ButtonList.js +55 -0
  127. package/lib/ButtonGroup/ButtonMenu.d.ts +2 -0
  128. package/lib/ButtonGroup/ButtonMenu.js +51 -0
  129. package/lib/ButtonGroup/PopConfirmTitle.d.ts +9 -0
  130. package/lib/ButtonGroup/PopConfirmTitle.js +48 -0
  131. package/lib/ButtonGroup/index.d.ts +30 -0
  132. package/lib/ButtonGroup/index.js +405 -0
  133. package/lib/ButtonGroup/style/index.less +36 -0
  134. package/lib/DragContent/DragBar.js +33 -0
  135. package/lib/DragContent/index.d.ts +14 -0
  136. package/lib/DragContent/index.js +191 -0
  137. package/lib/DragContent/index.less +44 -0
  138. package/lib/FormComp/ChunkUploader/api.js +89 -0
  139. package/lib/FormComp/ChunkUploader/index.js +410 -0
  140. package/lib/FormComp/ChunkUploader/lib.js +113 -0
  141. package/lib/FormComp/ChunkUploader/style/style.less +3 -0
  142. package/lib/FormComp/ChunkUploader/upload-queue.class.js +174 -0
  143. package/lib/FormComp/ChunkUploader/worker.js +28 -0
  144. package/lib/FormComp/EditButton/index.d.ts +26 -0
  145. package/lib/FormComp/EditButton/index.js +159 -0
  146. package/lib/FormComp/FieldComponent/ReUpload.d.ts +3 -0
  147. package/lib/FormComp/FieldComponent/ReUpload.js +151 -0
  148. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +274 -0
  149. package/lib/FormComp/FieldComponent/TitleNode.d.ts +6 -0
  150. package/lib/FormComp/FieldComponent/TitleNode.js +19 -0
  151. package/lib/FormComp/FieldComponent/index.d.ts +38 -0
  152. package/lib/FormComp/FieldComponent/index.js +457 -0
  153. package/lib/FormComp/FieldComponent/setReadonlyValues.js +263 -0
  154. package/lib/FormComp/FieldComponent/style/index.less +120 -0
  155. package/lib/FormComp/RenderItemGroup/index.d.ts +37 -0
  156. package/lib/FormComp/RenderItemGroup/index.js +255 -0
  157. package/lib/FormComp/Uploader/index.d.ts +21 -0
  158. package/lib/FormComp/Uploader/index.js +303 -0
  159. package/lib/FormComp/Uploader/style/index.less +14 -0
  160. package/lib/FormComp/Uploader/util.d.ts +8 -0
  161. package/lib/FormComp/Uploader/util.js +47 -0
  162. package/lib/FormComp/VarTemplate/index.js +308 -0
  163. package/lib/FormComp/index.d.ts +1 -0
  164. package/lib/FormComp/index.js +15 -0
  165. package/lib/NavLeafScroll/index.js +397 -0
  166. package/lib/NavLeafScroll/style/index.less +119 -0
  167. package/lib/RefactorTree/data.d.ts +7 -0
  168. package/lib/RefactorTree/index.d.ts +40 -0
  169. package/lib/RefactorTree/index.js +190 -0
  170. package/lib/RefactorTree/indexTreeNode.d.ts +39 -0
  171. package/lib/RefactorTree/indexTreeNode.js +260 -0
  172. package/lib/RefactorTree/style/index.d.ts +1 -0
  173. package/lib/RefactorTree/style/index.js +3 -0
  174. package/lib/RefactorTree/style/index.less +22 -0
  175. package/lib/RefactorTree/util.d.ts +42 -0
  176. package/lib/RefactorTree/util.js +195 -0
  177. package/lib/SpecIcon/fonts/demo.css +539 -0
  178. package/lib/SpecIcon/fonts/demo_index.html +1315 -0
  179. package/lib/SpecIcon/fonts/iconfont.css +211 -0
  180. package/lib/SpecIcon/fonts/iconfont.eot +0 -0
  181. package/lib/SpecIcon/fonts/iconfont.js +43 -0
  182. package/lib/SpecIcon/fonts/iconfont.json +352 -0
  183. package/lib/SpecIcon/fonts/iconfont.svg +173 -0
  184. package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
  185. package/lib/SpecIcon/fonts/iconfont.woff +0 -0
  186. package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
  187. package/lib/SpecIcon/index.d.ts +17 -0
  188. package/lib/SpecIcon/index.js +90 -0
  189. package/lib/SpecIcon/style/iconfont.less +213 -0
  190. package/lib/SpecIcon/style/index.less +98 -0
  191. package/lib/SplitterLayout/Pane.d.ts +13 -0
  192. package/lib/SplitterLayout/Pane.js +48 -0
  193. package/lib/SplitterLayout/index.js +386 -0
  194. package/lib/SplitterLayout/index.less +58 -0
  195. package/lib/StandardContent/SplitterLayout/Pane.js +62 -0
  196. package/lib/StandardContent/SplitterLayout/index.js +387 -0
  197. package/lib/StandardContent/SplitterLayout/index.less +58 -0
  198. package/lib/StandardContent/SubfieldContent.d.ts +17 -0
  199. package/lib/StandardContent/SubfieldContent.js +56 -0
  200. package/lib/StandardContent/WrapperContent.d.ts +13 -0
  201. package/lib/StandardContent/WrapperContent.js +43 -0
  202. package/lib/StandardContent/data.d.ts +101 -0
  203. package/lib/StandardContent/style/index.less +80 -0
  204. package/lib/StandardDragModal/index.d.ts +11 -0
  205. package/lib/StandardDragModal/index.js +43 -0
  206. package/lib/StandardFilter/index.d.ts +35 -0
  207. package/lib/StandardFilter/index.js +272 -0
  208. package/lib/StandardFilter/style/index.less +62 -0
  209. package/lib/StandardForm/ActionList.js +57 -0
  210. package/lib/StandardForm/StepForm.d.ts +19 -0
  211. package/lib/StandardForm/StepForm.js +295 -0
  212. package/lib/StandardForm/TabForm.d.ts +19 -0
  213. package/lib/StandardForm/TabForm.js +148 -0
  214. package/lib/StandardForm/index.d.ts +32 -0
  215. package/lib/StandardForm/index.js +197 -0
  216. package/lib/StandardForm/style/index.less +58 -0
  217. package/lib/StandardModal/UpdateFormRef.js +32 -0
  218. package/lib/StandardModal/index.d.ts +44 -0
  219. package/lib/StandardModal/index.js +524 -0
  220. package/lib/StandardModal/style/index.less +50 -0
  221. package/lib/StandardPanel/index.d.ts +28 -0
  222. package/lib/StandardPanel/index.js +155 -0
  223. package/lib/StandardPanel/style/index.less +135 -0
  224. package/lib/StandardTable/index.d.ts +22 -0
  225. package/lib/StandardTable/index.js +143 -0
  226. package/lib/StandardTable/style/index.d.ts +1 -0
  227. package/lib/StandardTable/style/index.js +3 -0
  228. package/lib/StandardTable/style/index.less +206 -0
  229. package/lib/components/IconNode/index.d.ts +16 -0
  230. package/lib/components/IconNode/index.js +39 -0
  231. package/lib/components/index.d.ts +2 -0
  232. package/lib/components/index.js +15 -0
  233. package/lib/data/func.code.js +119 -0
  234. package/lib/data/general.config.js +179 -0
  235. package/lib/data/index.js +23 -0
  236. package/lib/index.d.ts +24 -0
  237. package/lib/index.js +236 -0
  238. package/lib/styles/index.less +0 -0
  239. package/lib/theme/spec-variable.less +48 -0
  240. package/lib/utils/ValueFormat.js +58 -0
  241. package/lib/utils/filterPermission.js +127 -0
  242. package/lib/utils/getParentNodes.js +226 -0
  243. package/lib/utils/index.js +35 -0
  244. package/package.json +1 -1
Binary file
Binary file
Binary file
@@ -0,0 +1,2 @@
1
+ declare const RenderButtonList: (item: any) => JSX.Element;
2
+ export default RenderButtonList;
@@ -0,0 +1,37 @@
1
+ import "antd/es/button/style";
2
+ import _Button from "antd/es/button";
3
+ import "antd/es/dropdown/style";
4
+ import _Dropdown from "antd/es/dropdown";
5
+ // 渲染按钮形式 (用于筛选)
6
+ import React from "react";
7
+ import SpecIcon from "@/SpecIcon";
8
+ import buttonMenu from './ButtonMenu';
9
+ import IconNode from "@/components/IconNode";
10
+ import { btnIsDisabled } from "@/utils/filterPermission";
11
+
12
+ var RenderButtonList = function RenderButtonList(item) {
13
+ if (Array.isArray(item.children) && item.children.length > 0) {
14
+ return /*#__PURE__*/React.createElement(_Dropdown, {
15
+ overlay: buttonMenu(item.children),
16
+ placement: "bottomRight"
17
+ }, /*#__PURE__*/React.createElement(_Button, {
18
+ type: "primary"
19
+ }, item.exName || item.name, " ", /*#__PURE__*/React.createElement(SpecIcon, {
20
+ name: "down"
21
+ })));
22
+ }
23
+
24
+ return /*#__PURE__*/React.createElement(_Button, {
25
+ type: item.type ? item.type : 'primary',
26
+ danger: item.danger,
27
+ icon: /*#__PURE__*/React.createElement(IconNode, {
28
+ icon: item.icon
29
+ }),
30
+ disabled: btnIsDisabled(item.disabled, item.rowParams),
31
+ onClick: item.fn ? function () {
32
+ return item.fn(item);
33
+ } : null
34
+ }, item.exName || item.name);
35
+ };
36
+
37
+ export default RenderButtonList;
@@ -0,0 +1,2 @@
1
+ declare const RenderButtonList: (group: any) => JSX.Element;
2
+ export default RenderButtonList;
@@ -0,0 +1,38 @@
1
+ import "antd/es/menu/style";
2
+ import _Menu from "antd/es/menu";
3
+ // 渲染按钮多层级形式 (用于筛选)
4
+ import React from "react";
5
+ import IconNode from "@/components/IconNode";
6
+
7
+ var RenderButtonList = function RenderButtonList(group) {
8
+ return /*#__PURE__*/React.createElement(_Menu, null, group.map(function (item, index) {
9
+ if (item.children) {
10
+ return /*#__PURE__*/React.createElement(_Menu.SubMenu, {
11
+ title: item.exName || item.name,
12
+ key: index
13
+ }, item.children.map(function (child, childIndex) {
14
+ return /*#__PURE__*/React.createElement(_Menu.Item, {
15
+ key: childIndex
16
+ }, /*#__PURE__*/React.createElement("a", {
17
+ onClick: child.fn ? function () {
18
+ return child.fn(child);
19
+ } : null
20
+ }, /*#__PURE__*/React.createElement(IconNode, {
21
+ icon: child.icon
22
+ }), " ", child.exName || child.name));
23
+ }));
24
+ }
25
+
26
+ return /*#__PURE__*/React.createElement(_Menu.Item, {
27
+ key: index
28
+ }, /*#__PURE__*/React.createElement("a", {
29
+ onClick: item.fn ? function () {
30
+ return item.fn(item);
31
+ } : null
32
+ }, /*#__PURE__*/React.createElement(IconNode, {
33
+ icon: item.icon
34
+ }), " ", item.exName || item.name));
35
+ }));
36
+ };
37
+
38
+ export default RenderButtonList;
@@ -0,0 +1,9 @@
1
+ interface ConfirmTitleProps {
2
+ extraRow?: object;
3
+ confirmText?: any;
4
+ confirmConfig?: {
5
+ title?: any;
6
+ };
7
+ }
8
+ declare const PopConfirmTitle: (propsData: ConfirmTitleProps) => any;
9
+ export default PopConfirmTitle;
@@ -0,0 +1,37 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+
3
+ 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."); }
4
+
5
+ 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); }
6
+
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
8
+
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+
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
+
13
+ import React from "react"; // 气泡确认框标题配置
14
+
15
+ var PopConfirmTitle = function PopConfirmTitle(propsData) {
16
+ var confirmConfig = propsData.confirmConfig,
17
+ confirmText = propsData.confirmText,
18
+ extraRow = propsData.extraRow;
19
+
20
+ if (propsData.hasOwnProperty('confirmConfig') && confirmConfig.title) {
21
+ var title = confirmConfig.title;
22
+ if (!title) return /*#__PURE__*/React.createElement(React.Fragment, null, null);
23
+ return typeof title === "function" ? title.apply(void 0, _toConsumableArray(Object.keys(extraRow).map(function (pItem) {
24
+ return extraRow[pItem];
25
+ }))) : title;
26
+ }
27
+
28
+ if (confirmText) {
29
+ return typeof confirmText === "function" ? confirmText.apply(void 0, _toConsumableArray(Object.keys(extraRow).map(function (pItem) {
30
+ return extraRow[pItem];
31
+ }))) : confirmText;
32
+ }
33
+
34
+ return /*#__PURE__*/React.createElement(React.Fragment, null, null);
35
+ };
36
+
37
+ export default PopConfirmTitle;
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import './style/index.less';
3
+ interface ButtonGroupRowParamsProps {
4
+ text?: any;
5
+ record?: object;
6
+ rowIndex?: number;
7
+ }
8
+ export interface ButtonGroupOptionsProps {
9
+ name?: string;
10
+ code?: string;
11
+ exName?: string;
12
+ isHide?: boolean;
13
+ disabled?: boolean;
14
+ icon?: React.ReactNode | string | string[];
15
+ fn?: any;
16
+ children?: ButtonGroupOptionsProps[];
17
+ render?: (() => React.ReactNode) | React.ReactNode;
18
+ confirmText?: any;
19
+ confirmConfig?: any;
20
+ }
21
+ interface ButtonGroupProps {
22
+ type?: 'button' | 'text';
23
+ rowParams?: ButtonGroupRowParamsProps;
24
+ codes?: object[];
25
+ permissionCodes?: string[];
26
+ options?: ButtonGroupOptionsProps[];
27
+ min?: number;
28
+ }
29
+ declare const ButtonGroup: (props: ButtonGroupProps) => JSX.Element;
30
+ export default ButtonGroup;
@@ -0,0 +1,374 @@
1
+ import "antd/es/popconfirm/style";
2
+ import _Popconfirm from "antd/es/popconfirm";
3
+ import "antd/es/button/style";
4
+ import _Button from "antd/es/button";
5
+ import "antd/es/dropdown/style";
6
+ import _Dropdown from "antd/es/dropdown";
7
+ import "antd/es/menu/style";
8
+ import _Menu from "antd/es/menu";
9
+
10
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
11
+
12
+ 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."); }
13
+
14
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
15
+
16
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
17
+
18
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
19
+
20
+ 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."); }
21
+
22
+ 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); }
23
+
24
+ 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; }
25
+
26
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
27
+
28
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
29
+
30
+ import { __rest } from "tslib";
31
+ import React, { useState, useEffect } from "react";
32
+ import { IconNode } from "../components/index";
33
+ import SpecIcon from "../SpecIcon/index";
34
+ import PopConfirmTitle from './PopConfirmTitle';
35
+ import { funcCode } from "../data/index";
36
+ import { DownOutlined, QuestionCircleOutlined } from "@ant-design/icons";
37
+ import { removeNoPermission, btnIsDisabled } from '../utils/filterPermission.js';
38
+ import './style/index.less';
39
+
40
+ var ButtonGroup = function ButtonGroup(props) {
41
+ var _props$type = props.type,
42
+ type = _props$type === void 0 ? 'button' : _props$type,
43
+ _props$rowParams = props.rowParams,
44
+ rowParams = _props$rowParams === void 0 ? {
45
+ text: undefined,
46
+ record: undefined,
47
+ rowIndex: undefined
48
+ } : _props$rowParams,
49
+ _props$codes = props.codes,
50
+ codes = _props$codes === void 0 ? funcCode.btnFuncCodes : _props$codes,
51
+ permissionCodes = props.permissionCodes;
52
+ var _props$options = props.options,
53
+ options = _props$options === void 0 ? [] : _props$options,
54
+ _props$min = props.min,
55
+ min = _props$min === void 0 ? 3 : _props$min; // 最小展示长度不能小于2
56
+
57
+ if (!options) return null; // 没有配置list返回null
58
+
59
+ var _useState = useState(-1),
60
+ _useState2 = _slicedToArray(_useState, 2),
61
+ popVisibleIndex = _useState2[0],
62
+ setPopVisibleIndex = _useState2[1];
63
+
64
+ var _useState3 = useState({}),
65
+ _useState4 = _slicedToArray(_useState3, 2),
66
+ popRow = _useState4[0],
67
+ setPopRow = _useState4[1];
68
+
69
+ var _useState5 = useState([]),
70
+ _useState6 = _slicedToArray(_useState5, 2),
71
+ resetList = _useState6[0],
72
+ setResetList = _useState6[1];
73
+
74
+ useEffect(function () {
75
+ // 重组选项options集合数据,排除:无权限(有配置code,并且不包含permissionCodes内)的数据及,isHide 为true的数据
76
+ setResetList(_toConsumableArray(removeNoPermission(options, permissionCodes, codes, rowParams)) || []);
77
+ return function () {
78
+ setResetList([]);
79
+ };
80
+ }, [options, codes, permissionCodes]);
81
+ useEffect(function () {
82
+ setPopVisibleIndex(-1);
83
+ }, [rowParams]); // 渲染按钮多层级形式 (用于筛选)
84
+
85
+ var buttonMenu = function buttonMenu(group) {
86
+ return /*#__PURE__*/React.createElement(_Menu, null, group.map(function (item, index) {
87
+ if (item.children) {
88
+ return /*#__PURE__*/React.createElement(_Menu.SubMenu, {
89
+ title: item.exName || item.name,
90
+ key: index
91
+ }, item.children.map(function (child, childIndex) {
92
+ return /*#__PURE__*/React.createElement(_Menu.Item, {
93
+ key: childIndex
94
+ }, /*#__PURE__*/React.createElement("a", {
95
+ onClick: child.fn ? function () {
96
+ return child.fn(child);
97
+ } : null
98
+ }, /*#__PURE__*/React.createElement(IconNode, {
99
+ icon: child.icon
100
+ }), " ", child.exName || child.name));
101
+ }));
102
+ }
103
+
104
+ return /*#__PURE__*/React.createElement(_Menu.Item, {
105
+ key: index
106
+ }, /*#__PURE__*/React.createElement("a", {
107
+ onClick: item.fn ? function () {
108
+ return item.fn(item);
109
+ } : null
110
+ }, /*#__PURE__*/React.createElement(IconNode, {
111
+ icon: item.icon
112
+ }), " ", item.exName || item.name));
113
+ }));
114
+ }; // 渲染按钮形式 (用于筛选)
115
+
116
+
117
+ var RenderButtonList = function RenderButtonList(item) {
118
+ var exName = item.exName,
119
+ name = item.name,
120
+ type = item.type,
121
+ icon = item.icon,
122
+ ghost = item.ghost,
123
+ danger = item.danger,
124
+ disabled = item.disabled,
125
+ loading = item.loading,
126
+ fn = item.fn,
127
+ code = item.code,
128
+ rowParams = item.rowParams,
129
+ others = __rest(item, ["exName", "name", "type", "icon", "ghost", "danger", "disabled", "loading", "fn", "code", "rowParams"]);
130
+
131
+ if (Array.isArray(item.children) && item.children.length > 0) {
132
+ return /*#__PURE__*/React.createElement(_Dropdown, {
133
+ overlay: buttonMenu(item.children),
134
+ placement: "bottomRight"
135
+ }, /*#__PURE__*/React.createElement(_Button, {
136
+ type: "primary"
137
+ }, item.exName || item.name, " ", /*#__PURE__*/React.createElement(SpecIcon, {
138
+ name: "down"
139
+ })));
140
+ }
141
+
142
+ return /*#__PURE__*/React.createElement(_Button, Object.assign({
143
+ type: type || 'primary',
144
+ danger: danger,
145
+ ghost: ghost,
146
+ onClick: fn ? function () {
147
+ return fn(item);
148
+ } : null
149
+ }, others, {
150
+ icon: /*#__PURE__*/React.createElement(IconNode, {
151
+ icon: icon
152
+ }),
153
+ disabled: btnIsDisabled(disabled, rowParams)
154
+ }), exName || name);
155
+ }; // 渲染文本形式多级菜单列表(用于表格)
156
+
157
+
158
+ var textMenu = function textMenu(group) {
159
+ return /*#__PURE__*/React.createElement(_Menu, {
160
+ className: "spec-button-text-dropdown"
161
+ }, group.map(function (gItem, gIndex) {
162
+ if (gItem.children) {
163
+ return /*#__PURE__*/React.createElement(_Menu.SubMenu, {
164
+ title: gItem.exName || gItem.name,
165
+ key: gItem
166
+ }, gItem.children.map(function (child, childIndex) {
167
+ return /*#__PURE__*/React.createElement(_Menu.Item, {
168
+ key: childIndex
169
+ }, /*#__PURE__*/React.createElement("a", {
170
+ onClick: child.fn ? function () {
171
+ return child.fn.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
172
+ return rowParams[pItem];
173
+ })));
174
+ } : null
175
+ }, child.render ? child.render.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
176
+ return rowParams[pItem];
177
+ }))) : child.exName || child.name));
178
+ }));
179
+ }
180
+
181
+ return /*#__PURE__*/React.createElement(_Menu.Item, {
182
+ key: gIndex,
183
+ disabled: btnIsDisabled(gItem.disabled, rowParams)
184
+ }, gItem.hasOwnProperty('confirmText') || gItem.hasOwnProperty('confirmConfig') ?
185
+ /*#__PURE__*/
186
+ // @ts-ignore
187
+ React.createElement("a", {
188
+ disabled: btnIsDisabled(gItem.disabled, rowParams),
189
+ onClick: gItem.fn ? function () {
190
+ setPopVisibleIndex(rowParams.rowIndex);
191
+ setPopRow(gItem);
192
+ } : null
193
+ }, gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
194
+ return rowParams[pItem];
195
+ }))) : gItem.exName || gItem.name) : /*#__PURE__*/React.createElement("a", {
196
+ className: "spec-button-group-text",
197
+ onClick: gItem.fn ? function () {
198
+ return gItem.fn.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
199
+ return rowParams[pItem];
200
+ })));
201
+ } : null,
202
+ // @ts-ignore
203
+ disabled: btnIsDisabled(gItem.disabled, rowParams)
204
+ }, gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
205
+ return rowParams[pItem];
206
+ }))) : gItem.exName || gItem.name));
207
+ }));
208
+ }; // 渲染文本形式 列表(用于表格)
209
+
210
+
211
+ var RenderTextList = function RenderTextList(item) {
212
+ if (Array.isArray(item.children) && item.children.length > 0) {
213
+ return /*#__PURE__*/React.createElement(_Dropdown, {
214
+ overlay: textMenu(item.children),
215
+ placement: "bottomRight"
216
+ }, /*#__PURE__*/React.createElement("a", {
217
+ className: "spec-button-group-text"
218
+ }, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
219
+ return rowParams[pItem];
220
+ }))) : item.exName || item.name, " ", /*#__PURE__*/React.createElement(SpecIcon, {
221
+ name: "down"
222
+ })));
223
+ }
224
+
225
+ return /*#__PURE__*/React.createElement(React.Fragment, null, item.hasOwnProperty('confirmText') || item.hasOwnProperty('confirmConfig') ? /*#__PURE__*/React.createElement(_Popconfirm, Object.assign({
226
+ placement: "topRight",
227
+ icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)
228
+ }, item.hasOwnProperty('confirmConfig') ? item.confirmConfig : {}, {
229
+ title: /*#__PURE__*/React.createElement(PopConfirmTitle, Object.assign({}, item, {
230
+ extraRow: rowParams
231
+ })),
232
+ onCancel: function onCancel() {
233
+ if (item.hasOwnProperty('confirmConfig') && item.confirmConfig.onCancel) {
234
+ var _item$confirmConfig;
235
+
236
+ (_item$confirmConfig = item.confirmConfig).onCancel.apply(_item$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
237
+ return rowParams[pItem];
238
+ })));
239
+ }
240
+ },
241
+ onConfirm: function onConfirm() {
242
+ if (item.hasOwnProperty('confirmConfig') && item.confirmConfig.onConfirm) {
243
+ var _item$confirmConfig2;
244
+
245
+ (_item$confirmConfig2 = item.confirmConfig).onConfirm.apply(_item$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
246
+ return rowParams[pItem];
247
+ })));
248
+ } else if (item.fn) {
249
+ item.fn.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
250
+ return rowParams[pItem];
251
+ })));
252
+ }
253
+ }
254
+ }), /*#__PURE__*/React.createElement("a", {
255
+ className: "spec-button-group-text",
256
+ key: item.index,
257
+ title: item.exName || item.name,
258
+ // @ts-ignore
259
+ disabled: btnIsDisabled(item.disabled, rowParams)
260
+ }, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
261
+ return rowParams[pItem];
262
+ }))) : item.exName || item.name)) : /*#__PURE__*/React.createElement("a", {
263
+ className: "spec-button-group-text",
264
+ title: item.exName || item.name,
265
+ key: item.index,
266
+ // @ts-ignore
267
+ disabled: btnIsDisabled(item.disabled, rowParams),
268
+ onClick: item.fn ? function () {
269
+ return item.fn.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
270
+ return rowParams[pItem];
271
+ })));
272
+ } : null
273
+ }, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
274
+ return rowParams[pItem];
275
+ }))) : item.exName || item.name));
276
+ }; // 渲染展示的按钮列表
277
+
278
+
279
+ var renderDisplayButton = function renderDisplayButton(item, index) {
280
+ /*渲染自定义*/
281
+ if (item.render) {
282
+ return /*#__PURE__*/React.createElement(React.Fragment, null, typeof item.render === 'function' ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
283
+ return rowParams[pItem];
284
+ }))) : item.render);
285
+ }
286
+ /*渲染按钮形式*/
287
+
288
+
289
+ if (type === 'button') {
290
+ return /*#__PURE__*/React.createElement(RenderButtonList, Object.assign({
291
+ key: index
292
+ }, item, {
293
+ rowParams: rowParams
294
+ }));
295
+ }
296
+ /*渲染文本形式*/
297
+
298
+
299
+ return /*#__PURE__*/React.createElement(RenderTextList, Object.assign({
300
+ key: index
301
+ }, item));
302
+ };
303
+
304
+ if (min < 2) min = 2;
305
+
306
+ if (resetList.length === 0) {
307
+ return /*#__PURE__*/React.createElement(React.Fragment, null, type !== 'button' ? '-' : null);
308
+ }
309
+
310
+ if (resetList.length > min) {
311
+ var forGroup = resetList.slice(0, min - 1);
312
+ var forDrop = resetList.slice(min - 1);
313
+ return /*#__PURE__*/React.createElement("span", {
314
+ className: "spec-button-group"
315
+ }, forGroup.map(function (item, index) {
316
+ return index < min - 1 ? renderDisplayButton(item, index) : null;
317
+ }), type === 'button' ? /*#__PURE__*/React.createElement(_Dropdown, {
318
+ overlay: buttonMenu(forDrop),
319
+ placement: "bottomRight"
320
+ }, /*#__PURE__*/React.createElement(_Button, {
321
+ type: "primary"
322
+ }, "\u66F4\u591A ", /*#__PURE__*/React.createElement(SpecIcon, {
323
+ name: "down"
324
+ }))) : /*#__PURE__*/React.createElement(_Popconfirm, Object.assign({
325
+ placement: "topRight",
326
+ visible: popVisibleIndex === rowParams.rowIndex,
327
+ icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null),
328
+ trigger: "click"
329
+ }, popRow.hasOwnProperty('confirmConfig') ? popRow.confirmConfig : {}, {
330
+ title: /*#__PURE__*/React.createElement(PopConfirmTitle, Object.assign({}, popRow, {
331
+ extraRow: rowParams
332
+ })),
333
+ onCancel: function onCancel() {
334
+ setPopVisibleIndex(-1); // 优先调用其 confirmConfig 配置的 onCancel 事件
335
+
336
+ if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onCancel) {
337
+ var _popRow$confirmConfig;
338
+
339
+ (_popRow$confirmConfig = popRow.confirmConfig).onCancel.apply(_popRow$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
340
+ return rowParams[pItem];
341
+ })));
342
+ }
343
+ },
344
+ onConfirm: function onConfirm() {
345
+ setPopVisibleIndex(-1); // 优先调用其 confirmConfig 配置的 onConfirm 事件
346
+
347
+ if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onConfirm) {
348
+ var _popRow$confirmConfig2;
349
+
350
+ (_popRow$confirmConfig2 = popRow.confirmConfig).onConfirm.apply(_popRow$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
351
+ return rowParams[pItem];
352
+ })));
353
+ } else if (popRow.fn) {
354
+ popRow.fn.apply(popRow, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
355
+ return rowParams[pItem];
356
+ })));
357
+ }
358
+ }
359
+ }), /*#__PURE__*/React.createElement(_Dropdown, {
360
+ overlay: textMenu(forDrop),
361
+ placement: "bottomRight"
362
+ }, /*#__PURE__*/React.createElement("a", {
363
+ className: "spec-button-group-text"
364
+ }, "\u66F4\u591A ", /*#__PURE__*/React.createElement(DownOutlined, null)))));
365
+ }
366
+
367
+ return /*#__PURE__*/React.createElement("span", {
368
+ className: "spec-button-group"
369
+ }, resetList.map(function (item, index) {
370
+ return renderDisplayButton(item, index);
371
+ }));
372
+ };
373
+
374
+ export default ButtonGroup;
@@ -0,0 +1,36 @@
1
+ @root-entry-name: default;
2
+ @import (reference) '~antd/es/style/themes/index';
3
+
4
+
5
+ .spec-button-group {
6
+ display: inline-block;
7
+ vertical-align: middle;
8
+ .ant-btn + .ant-btn {
9
+ margin-left: @padding-sm;
10
+ }
11
+ .spec-button-group-text + .spec-button-group-text {
12
+ position: relative;
13
+ margin-left: @padding-sm;
14
+ &:before {
15
+ position: absolute;
16
+ content: '';
17
+ top: 50%;
18
+ left: -@padding-sm/2;
19
+ transform: translate(0, -50%);
20
+ display: inline-block;
21
+ height: .9em;
22
+ vertical-align: middle;
23
+ border-left: 1px solid @border-color-base;
24
+ }
25
+ }
26
+ //& when (@theme = dark) {
27
+ // .ant-btn + .ant-btn {
28
+ // background: #795da3 !important;
29
+ // }
30
+ //}
31
+ //& when not (@theme = dark) {
32
+ // .ant-btn + .ant-btn {
33
+ // background: #c81313 !important;
34
+ // }
35
+ //}
36
+ }
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import classNames from 'classnames';
3
+ import './index.less';
4
+
5
+ var DragBar = function DragBar(props) {
6
+ var direction = props.direction,
7
+ className = props.className,
8
+ onMouseDown = props.onMouseDown;
9
+ var directionStyle = direction === 'left' ? "spec-grid-dragbar-left-horizontal" : direction === 'right' ? "spec-grid-dragbar-right-horizontal" : direction === 'top' ? "spec-grid-dragbar-up-vertical" : "spec-grid-dragbar-down-vertical";
10
+
11
+ var handleMouseDown = function handleMouseDown(e) {
12
+ onMouseDown(e, direction);
13
+ };
14
+
15
+ return /*#__PURE__*/React.createElement("div", {
16
+ className: classNames(directionStyle, className),
17
+ onMouseDown: handleMouseDown
18
+ });
19
+ };
20
+
21
+ export default DragBar;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface DragContentProps {
3
+ children?: React.ReactNode;
4
+ className?: string;
5
+ direction?: string[];
6
+ moveMaxWidth?: number;
7
+ moveMaxHeight?: number;
8
+ style?: React.CSSProperties;
9
+ dragMouseDown?: (evt: any, direction?: string) => void;
10
+ dragMouseMove?: (evt: any, direction?: string) => void;
11
+ dragMouseUp?: (evt: any, direction?: string) => void;
12
+ }
13
+ declare const DragContent: (props: DragContentProps) => JSX.Element;
14
+ export default DragContent;