fan-standard-comp 3.1.3 → 3.1.4

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/package.json +1 -1
  2. package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
  3. package/dist/fan-standard-comp.umd.js +0 -597
  4. package/dist/fonts/iconfont.eot +0 -0
  5. package/dist/fonts/iconfont.ttf +0 -0
  6. package/dist/fonts/iconfont.woff +0 -0
  7. package/es/ButtonGroup/ButtonList.d.ts +0 -2
  8. package/es/ButtonGroup/ButtonList.js +0 -37
  9. package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
  10. package/es/ButtonGroup/ButtonMenu.js +0 -38
  11. package/es/ButtonGroup/PopConfirmTitle.d.ts +0 -9
  12. package/es/ButtonGroup/PopConfirmTitle.js +0 -37
  13. package/es/ButtonGroup/index.d.ts +0 -30
  14. package/es/ButtonGroup/index.js +0 -374
  15. package/es/ButtonGroup/style/index.less +0 -36
  16. package/es/DragContent/DragBar.js +0 -21
  17. package/es/DragContent/index.d.ts +0 -14
  18. package/es/DragContent/index.js +0 -173
  19. package/es/DragContent/index.less +0 -44
  20. package/es/FormComp/ChunkUploader/api.js +0 -76
  21. package/es/FormComp/ChunkUploader/index.js +0 -391
  22. package/es/FormComp/ChunkUploader/lib.js +0 -96
  23. package/es/FormComp/ChunkUploader/style/style.less +0 -3
  24. package/es/FormComp/ChunkUploader/upload-queue.class.js +0 -167
  25. package/es/FormComp/ChunkUploader/worker.js +0 -23
  26. package/es/FormComp/EditButton/index.d.ts +0 -26
  27. package/es/FormComp/EditButton/index.js +0 -140
  28. package/es/FormComp/FieldComponent/ReUpload.d.ts +0 -3
  29. package/es/FormComp/FieldComponent/ReUpload.js +0 -131
  30. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +0 -251
  31. package/es/FormComp/FieldComponent/TitleNode.d.ts +0 -6
  32. package/es/FormComp/FieldComponent/TitleNode.js +0 -9
  33. package/es/FormComp/FieldComponent/index.d.ts +0 -38
  34. package/es/FormComp/FieldComponent/index.js +0 -413
  35. package/es/FormComp/FieldComponent/setReadonlyValues.js +0 -236
  36. package/es/FormComp/FieldComponent/style/index.less +0 -116
  37. package/es/FormComp/RenderItemGroup/index.d.ts +0 -37
  38. package/es/FormComp/RenderItemGroup/index.js +0 -234
  39. package/es/FormComp/Uploader/index.d.ts +0 -19
  40. package/es/FormComp/Uploader/index.js +0 -275
  41. package/es/FormComp/Uploader/style/index.less +0 -14
  42. package/es/FormComp/Uploader/util.d.ts +0 -8
  43. package/es/FormComp/Uploader/util.js +0 -38
  44. package/es/FormComp/VarTemplate/index.js +0 -293
  45. package/es/FormComp/index.d.ts +0 -1
  46. package/es/FormComp/index.js +0 -1
  47. package/es/NavLeafScroll/index.js +0 -379
  48. package/es/NavLeafScroll/style/index.less +0 -119
  49. package/es/RefactorTree/data.d.ts +0 -7
  50. package/es/RefactorTree/index.d.ts +0 -40
  51. package/es/RefactorTree/index.js +0 -167
  52. package/es/RefactorTree/indexTreeNode.d.ts +0 -39
  53. package/es/RefactorTree/indexTreeNode.js +0 -237
  54. package/es/RefactorTree/style/index.d.ts +0 -1
  55. package/es/RefactorTree/style/index.js +0 -1
  56. package/es/RefactorTree/style/index.less +0 -22
  57. package/es/RefactorTree/util.d.ts +0 -42
  58. package/es/RefactorTree/util.js +0 -187
  59. package/es/SpecIcon/fonts/demo.css +0 -539
  60. package/es/SpecIcon/fonts/demo_index.html +0 -1315
  61. package/es/SpecIcon/fonts/iconfont.css +0 -211
  62. package/es/SpecIcon/fonts/iconfont.eot +0 -0
  63. package/es/SpecIcon/fonts/iconfont.js +0 -41
  64. package/es/SpecIcon/fonts/iconfont.json +0 -352
  65. package/es/SpecIcon/fonts/iconfont.svg +0 -173
  66. package/es/SpecIcon/fonts/iconfont.ttf +0 -0
  67. package/es/SpecIcon/fonts/iconfont.woff +0 -0
  68. package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
  69. package/es/SpecIcon/index.d.ts +0 -17
  70. package/es/SpecIcon/index.js +0 -77
  71. package/es/SpecIcon/style/iconfont.less +0 -213
  72. package/es/SpecIcon/style/index.less +0 -98
  73. package/es/SplitterLayout/Pane.d.ts +0 -13
  74. package/es/SplitterLayout/Pane.js +0 -36
  75. package/es/SplitterLayout/index.js +0 -375
  76. package/es/SplitterLayout/index.less +0 -58
  77. package/es/StandardContent/SplitterLayout/Pane.js +0 -50
  78. package/es/StandardContent/SplitterLayout/index.js +0 -374
  79. package/es/StandardContent/SplitterLayout/index.less +0 -58
  80. package/es/StandardContent/SubfieldContent.d.ts +0 -17
  81. package/es/StandardContent/SubfieldContent.js +0 -41
  82. package/es/StandardContent/WrapperContent.d.ts +0 -13
  83. package/es/StandardContent/WrapperContent.js +0 -29
  84. package/es/StandardContent/data.d.ts +0 -101
  85. package/es/StandardContent/style/index.less +0 -80
  86. package/es/StandardDragModal/index.d.ts +0 -11
  87. package/es/StandardDragModal/index.js +0 -30
  88. package/es/StandardFilter/index.d.ts +0 -35
  89. package/es/StandardFilter/index.js +0 -253
  90. package/es/StandardFilter/style/index.less +0 -62
  91. package/es/StandardForm/ActionList.js +0 -44
  92. package/es/StandardForm/StepForm.d.ts +0 -19
  93. package/es/StandardForm/StepForm.js +0 -267
  94. package/es/StandardForm/TabForm.d.ts +0 -19
  95. package/es/StandardForm/TabForm.js +0 -122
  96. package/es/StandardForm/index.d.ts +0 -32
  97. package/es/StandardForm/index.js +0 -170
  98. package/es/StandardForm/style/index.less +0 -58
  99. package/es/StandardModal/UpdateFormRef.js +0 -18
  100. package/es/StandardModal/index.d.ts +0 -44
  101. package/es/StandardModal/index.js +0 -495
  102. package/es/StandardModal/style/index.less +0 -50
  103. package/es/StandardPanel/index.d.ts +0 -28
  104. package/es/StandardPanel/index.js +0 -134
  105. package/es/StandardPanel/style/index.less +0 -135
  106. package/es/StandardTable/index.d.ts +0 -22
  107. package/es/StandardTable/index.js +0 -126
  108. package/es/StandardTable/style/index.d.ts +0 -1
  109. package/es/StandardTable/style/index.js +0 -1
  110. package/es/StandardTable/style/index.less +0 -206
  111. package/es/components/IconNode/index.d.ts +0 -16
  112. package/es/components/IconNode/index.js +0 -28
  113. package/es/components/index.d.ts +0 -2
  114. package/es/components/index.js +0 -2
  115. package/es/data/func.code.js +0 -112
  116. package/es/data/general.config.js +0 -172
  117. package/es/data/index.js +0 -3
  118. package/es/index.d.ts +0 -24
  119. package/es/index.js +0 -31
  120. package/es/styles/index.less +0 -0
  121. package/es/theme/spec-variable.less +0 -48
  122. package/es/utils/ValueFormat.js +0 -50
  123. package/es/utils/filterPermission.js +0 -111
  124. package/es/utils/getParentNodes.js +0 -215
  125. package/es/utils/index.js +0 -3
  126. package/lib/ButtonGroup/ButtonList.d.ts +0 -2
  127. package/lib/ButtonGroup/ButtonList.js +0 -55
  128. package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
  129. package/lib/ButtonGroup/ButtonMenu.js +0 -51
  130. package/lib/ButtonGroup/PopConfirmTitle.d.ts +0 -9
  131. package/lib/ButtonGroup/PopConfirmTitle.js +0 -48
  132. package/lib/ButtonGroup/index.d.ts +0 -30
  133. package/lib/ButtonGroup/index.js +0 -405
  134. package/lib/ButtonGroup/style/index.less +0 -36
  135. package/lib/DragContent/DragBar.js +0 -33
  136. package/lib/DragContent/index.d.ts +0 -14
  137. package/lib/DragContent/index.js +0 -191
  138. package/lib/DragContent/index.less +0 -44
  139. package/lib/FormComp/ChunkUploader/api.js +0 -89
  140. package/lib/FormComp/ChunkUploader/index.js +0 -410
  141. package/lib/FormComp/ChunkUploader/lib.js +0 -113
  142. package/lib/FormComp/ChunkUploader/style/style.less +0 -3
  143. package/lib/FormComp/ChunkUploader/upload-queue.class.js +0 -174
  144. package/lib/FormComp/ChunkUploader/worker.js +0 -28
  145. package/lib/FormComp/EditButton/index.d.ts +0 -26
  146. package/lib/FormComp/EditButton/index.js +0 -159
  147. package/lib/FormComp/FieldComponent/ReUpload.d.ts +0 -3
  148. package/lib/FormComp/FieldComponent/ReUpload.js +0 -151
  149. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +0 -274
  150. package/lib/FormComp/FieldComponent/TitleNode.d.ts +0 -6
  151. package/lib/FormComp/FieldComponent/TitleNode.js +0 -19
  152. package/lib/FormComp/FieldComponent/index.d.ts +0 -38
  153. package/lib/FormComp/FieldComponent/index.js +0 -457
  154. package/lib/FormComp/FieldComponent/setReadonlyValues.js +0 -263
  155. package/lib/FormComp/FieldComponent/style/index.less +0 -116
  156. package/lib/FormComp/RenderItemGroup/index.d.ts +0 -37
  157. package/lib/FormComp/RenderItemGroup/index.js +0 -255
  158. package/lib/FormComp/Uploader/index.d.ts +0 -19
  159. package/lib/FormComp/Uploader/index.js +0 -301
  160. package/lib/FormComp/Uploader/style/index.less +0 -14
  161. package/lib/FormComp/Uploader/util.d.ts +0 -8
  162. package/lib/FormComp/Uploader/util.js +0 -47
  163. package/lib/FormComp/VarTemplate/index.js +0 -308
  164. package/lib/FormComp/index.d.ts +0 -1
  165. package/lib/FormComp/index.js +0 -15
  166. package/lib/NavLeafScroll/index.js +0 -397
  167. package/lib/NavLeafScroll/style/index.less +0 -119
  168. package/lib/RefactorTree/data.d.ts +0 -7
  169. package/lib/RefactorTree/index.d.ts +0 -40
  170. package/lib/RefactorTree/index.js +0 -190
  171. package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
  172. package/lib/RefactorTree/indexTreeNode.js +0 -260
  173. package/lib/RefactorTree/style/index.d.ts +0 -1
  174. package/lib/RefactorTree/style/index.js +0 -3
  175. package/lib/RefactorTree/style/index.less +0 -22
  176. package/lib/RefactorTree/util.d.ts +0 -42
  177. package/lib/RefactorTree/util.js +0 -195
  178. package/lib/SpecIcon/fonts/demo.css +0 -539
  179. package/lib/SpecIcon/fonts/demo_index.html +0 -1315
  180. package/lib/SpecIcon/fonts/iconfont.css +0 -211
  181. package/lib/SpecIcon/fonts/iconfont.eot +0 -0
  182. package/lib/SpecIcon/fonts/iconfont.js +0 -43
  183. package/lib/SpecIcon/fonts/iconfont.json +0 -352
  184. package/lib/SpecIcon/fonts/iconfont.svg +0 -173
  185. package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
  186. package/lib/SpecIcon/fonts/iconfont.woff +0 -0
  187. package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
  188. package/lib/SpecIcon/index.d.ts +0 -17
  189. package/lib/SpecIcon/index.js +0 -90
  190. package/lib/SpecIcon/style/iconfont.less +0 -213
  191. package/lib/SpecIcon/style/index.less +0 -98
  192. package/lib/SplitterLayout/Pane.d.ts +0 -13
  193. package/lib/SplitterLayout/Pane.js +0 -48
  194. package/lib/SplitterLayout/index.js +0 -386
  195. package/lib/SplitterLayout/index.less +0 -58
  196. package/lib/StandardContent/SplitterLayout/Pane.js +0 -62
  197. package/lib/StandardContent/SplitterLayout/index.js +0 -387
  198. package/lib/StandardContent/SplitterLayout/index.less +0 -58
  199. package/lib/StandardContent/SubfieldContent.d.ts +0 -17
  200. package/lib/StandardContent/SubfieldContent.js +0 -56
  201. package/lib/StandardContent/WrapperContent.d.ts +0 -13
  202. package/lib/StandardContent/WrapperContent.js +0 -43
  203. package/lib/StandardContent/data.d.ts +0 -101
  204. package/lib/StandardContent/style/index.less +0 -80
  205. package/lib/StandardDragModal/index.d.ts +0 -11
  206. package/lib/StandardDragModal/index.js +0 -43
  207. package/lib/StandardFilter/index.d.ts +0 -35
  208. package/lib/StandardFilter/index.js +0 -272
  209. package/lib/StandardFilter/style/index.less +0 -62
  210. package/lib/StandardForm/ActionList.js +0 -57
  211. package/lib/StandardForm/StepForm.d.ts +0 -19
  212. package/lib/StandardForm/StepForm.js +0 -295
  213. package/lib/StandardForm/TabForm.d.ts +0 -19
  214. package/lib/StandardForm/TabForm.js +0 -148
  215. package/lib/StandardForm/index.d.ts +0 -32
  216. package/lib/StandardForm/index.js +0 -197
  217. package/lib/StandardForm/style/index.less +0 -58
  218. package/lib/StandardModal/UpdateFormRef.js +0 -32
  219. package/lib/StandardModal/index.d.ts +0 -44
  220. package/lib/StandardModal/index.js +0 -525
  221. package/lib/StandardModal/style/index.less +0 -50
  222. package/lib/StandardPanel/index.d.ts +0 -28
  223. package/lib/StandardPanel/index.js +0 -155
  224. package/lib/StandardPanel/style/index.less +0 -135
  225. package/lib/StandardTable/index.d.ts +0 -22
  226. package/lib/StandardTable/index.js +0 -143
  227. package/lib/StandardTable/style/index.d.ts +0 -1
  228. package/lib/StandardTable/style/index.js +0 -3
  229. package/lib/StandardTable/style/index.less +0 -206
  230. package/lib/components/IconNode/index.d.ts +0 -16
  231. package/lib/components/IconNode/index.js +0 -39
  232. package/lib/components/index.d.ts +0 -2
  233. package/lib/components/index.js +0 -15
  234. package/lib/data/func.code.js +0 -119
  235. package/lib/data/general.config.js +0 -179
  236. package/lib/data/index.js +0 -23
  237. package/lib/index.d.ts +0 -24
  238. package/lib/index.js +0 -236
  239. package/lib/styles/index.less +0 -0
  240. package/lib/theme/spec-variable.less +0 -48
  241. package/lib/utils/ValueFormat.js +0 -58
  242. package/lib/utils/filterPermission.js +0 -127
  243. package/lib/utils/getParentNodes.js +0 -226
  244. package/lib/utils/index.js +0 -35
@@ -1,274 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- require("antd/es/tree-select/style");
11
-
12
- var _treeSelect = _interopRequireDefault(require("antd/es/tree-select"));
13
-
14
- var _react = _interopRequireWildcard(require("react"));
15
-
16
- require("./style/index.less");
17
-
18
- var _utils = require("../../utils");
19
-
20
- var _icons = require("@ant-design/icons");
21
-
22
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23
-
24
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
29
-
30
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
31
-
32
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
33
-
34
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
35
-
36
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
37
-
38
- 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."); }
39
-
40
- 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); }
41
-
42
- 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; }
43
-
44
- 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; }
45
-
46
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
47
-
48
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
49
-
50
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
51
-
52
- var TreeNode = _treeSelect.default.TreeNode;
53
-
54
- var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
55
- var _props$treeData = props.treeData,
56
- treeData = _props$treeData === void 0 ? [] : _props$treeData,
57
- value = props.value,
58
- showFullLevel = props.showFullLevel,
59
- _props$separator = props.separator,
60
- separator = _props$separator === void 0 ? '/' : _props$separator,
61
- disabled = props.disabled,
62
- disabledFields = props.disabledFields,
63
- fieldStatus = props.fieldStatus,
64
- _props$treeOptionName = props.treeOptionName,
65
- treeOptionName = _props$treeOptionName === void 0 ? {
66
- title: 'title',
67
- value: 'value',
68
- children: 'children',
69
- disabled: 'disabled'
70
- } : _props$treeOptionName,
71
- placeholder = props.placeholder,
72
- protoTreeNode = props.protoTreeNode,
73
- _onSelect = props.onSelect,
74
- labelInValue = props.labelInValue,
75
- otherProps = _objectWithoutProperties(props, ["treeData", "value", "showFullLevel", "separator", "disabled", "disabledFields", "fieldStatus", "treeOptionName", "placeholder", "protoTreeNode", "onSelect", "labelInValue"]);
76
-
77
- var _useState = (0, _react.useState)(null),
78
- _useState2 = _slicedToArray(_useState, 2),
79
- fullLevelName = _useState2[0],
80
- setFullLevelName = _useState2[1];
81
-
82
- var renderTreeNode = function renderTreeNode(data, dataOptionName) {
83
- var nodeProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
84
- return data.map(function (dataItem) {
85
- var prevDataItem = _objectSpread({}, dataItem);
86
-
87
- var item = _extends({}, prevDataItem); // 筛选与禁用字段内值相同的节点进行禁用
88
-
89
-
90
- var resetByDisabledFields = function resetByDisabledFields(initItem) {
91
- var oldItem = _objectSpread({}, initItem);
92
-
93
- var nodeItem = _extends({}, oldItem);
94
-
95
- Object.keys(nodeItem).forEach(function (itemKeyName) {
96
- var isMatch = disabledFields.find(function (fItem) {
97
- return fItem.key === itemKeyName;
98
- });
99
-
100
- if (isMatch) {
101
- var _isMatch$value$split;
102
-
103
- // 确认是否匹配数据,进行设置 disabled
104
- if ((_isMatch$value$split = isMatch.value.split(',')) === null || _isMatch$value$split === void 0 ? void 0 : _isMatch$value$split.includes(nodeItem[itemKeyName])) {
105
- nodeItem.disabled = true;
106
- } else if (nodeItem.hasOwnProperty(dataOptionName.disabled || 'disabled')) {
107
- nodeItem.disabled = nodeItem[dataOptionName.disabled || 'disabled'];
108
- }
109
- }
110
- });
111
- return nodeItem;
112
- };
113
-
114
- if (disabledFields && Array.isArray(disabledFields)) {
115
- item = resetByDisabledFields(item);
116
- }
117
-
118
- if (item[dataOptionName.children] && item[dataOptionName.children].length > 0) {
119
- return /*#__PURE__*/_react.default.createElement(TreeNode, _extends({
120
- title: item[dataOptionName.title],
121
- key: item[dataOptionName.value],
122
- value: item[dataOptionName.value],
123
- selectable: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.selectable) || 'selectable'],
124
- checkable: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.checkable) || 'checkable'],
125
- disableCheckbox: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.disableCheckbox) || 'disableCheckbox'],
126
- disabled: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.disabled) || 'disabled']
127
- }, nodeProps), renderTreeNode(item[dataOptionName.children], dataOptionName));
128
- }
129
-
130
- return /*#__PURE__*/_react.default.createElement(TreeNode, _extends({
131
- title: item[dataOptionName.title],
132
- key: item[dataOptionName.value],
133
- value: item[dataOptionName.value],
134
- selectable: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.selectable) || 'selectable'],
135
- checkable: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.checkable) || 'checkable'],
136
- disableCheckbox: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.disableCheckbox) || 'disableCheckbox'],
137
- disabled: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.disabled) || 'disabled']
138
- }, nodeProps));
139
- });
140
- };
141
-
142
- (0, _react.useEffect)(function () {
143
- if (value) {
144
- // 获取选中节点相关数据:包括当前完整数据值、当前父节点以上层层级节点数据集合及id集合
145
- var nodeInfo = (0, _utils.getParentNodes)(treeData, labelInValue ? value.value : value, {
146
- childrenParam: treeOptionName.children,
147
- keyParam: treeOptionName.value
148
- }, _objectSpread({}, otherProps));
149
- setFullLevelName(renderParenName(nodeInfo));
150
- } else {
151
- // value,无值时
152
- setFullLevelName(null);
153
- }
154
- }, [value, treeData, fieldStatus]);
155
-
156
- var renderParenName = function renderParenName(selectNodeInfo) {
157
- // 有父级节点,及当前模式是showFullLevel时,渲染名称为完整层级名称,否则为当前节点名称
158
- var parentItems = selectNodeInfo.nodeParent;
159
-
160
- if (parentItems.length > 0 && showFullLevel && !otherProps.showCheckedStrategy) {
161
- // 当前查找到的父级节点拼合当前节点的标题字段值进行显示
162
- return parentItems.reverse().map(function (item) {
163
- return item[treeOptionName.title];
164
- }).concat(selectNodeInfo.matchNode[0][treeOptionName.title]).join(separator);
165
- }
166
-
167
- if (Array.isArray(value)) {
168
- return selectNodeInfo.matchNode.length > 0 ? selectNodeInfo.matchNode.map(function (item) {
169
- return item[treeOptionName.title];
170
- }).join(',') : null;
171
- }
172
-
173
- return selectNodeInfo.matchNode.length > 0 ? selectNodeInfo.matchNode[0][treeOptionName.title] : null;
174
- };
175
-
176
- var renderTreeSelectNode = function renderTreeSelectNode() {
177
- return /*#__PURE__*/_react.default.createElement(_treeSelect.default, _extends({
178
- placeholder: placeholder,
179
- value: value,
180
- ref: ref
181
- }, otherProps, {
182
- labelInValue: labelInValue,
183
- title: otherProps.title || ((disabled || fieldStatus === 'disabled') && !otherProps.treeCheckable ? fullLevelName : null),
184
- showCheckedStrategy: otherProps.showCheckedStrategy,
185
- disabled: disabled,
186
- onSelect: function onSelect(value, node, extra) {
187
- var newNodeInfo = (0, _utils.getParentNodes)(treeData, value, {
188
- childrenParam: treeOptionName.children,
189
- keyParam: treeOptionName.value
190
- });
191
- setFullLevelName(renderParenName(newNodeInfo));
192
- if (_onSelect) _onSelect(value, _objectSpread(_objectSpread({}, node), newNodeInfo.matchNode[0]), extra, newNodeInfo.nodeParent);
193
- }
194
- }), renderTreeNode(treeData, treeOptionName, protoTreeNode || {}));
195
- };
196
-
197
- var _useState3 = (0, _react.useState)(false),
198
- _useState4 = _slicedToArray(_useState3, 2),
199
- showAllPath = _useState4[0],
200
- setShowAllPath = _useState4[1]; // 显示所有树选择路径
201
-
202
-
203
- var renderTreeSelectNodePath = function renderTreeSelectNodePath() {
204
- //获取节点路径
205
- var pathNodes = (0, _utils.getNodePaths)(treeData, value, {
206
- childrenParam: treeOptionName.children,
207
- keyParam: treeOptionName.value
208
- }, _objectSpread({}, otherProps));
209
-
210
- var togglePath = function togglePath() {
211
- setShowAllPath(!showAllPath);
212
- };
213
-
214
- if (pathNodes.length > 0) {
215
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
216
- className: "tree-select-viewonly-list ".concat(showAllPath ? 'collapsed' : '')
217
- }, pathNodes.map(function (item, index) {
218
- if (item.length > 0) {
219
- // 超过2个且不显示所有
220
- if (index > 1 && !showAllPath) return;
221
- return /*#__PURE__*/_react.default.createElement("div", {
222
- className: 'tree-select-viewonly-item',
223
- key: index
224
- }, /*#__PURE__*/_react.default.createElement("b", null, "\xB7 "), item.map(function (i) {
225
- return i[treeOptionName.title];
226
- }).join(separator));
227
- }
228
- }), pathNodes.length > 2 ? /*#__PURE__*/_react.default.createElement("div", {
229
- className: "toggle-icon",
230
- onClick: togglePath
231
- }, !showAllPath ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "\u5C55\u5F00 ", /*#__PURE__*/_react.default.createElement(_icons.DownOutlined, null)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "\u6536\u8D77 ", /*#__PURE__*/_react.default.createElement(_icons.UpOutlined, null))) : null));
232
- } else {
233
- return '-';
234
- }
235
- };
236
-
237
- if (fieldStatus === 'viewOnly') {
238
- //多选下拉框 详情展示 showCheckedStrategy 有值且显示完整路径时
239
- if (otherProps.showCheckedStrategy && showFullLevel) {
240
- return renderTreeSelectNodePath();
241
- } // 多选状态
242
-
243
-
244
- if (otherProps.multiple) {
245
- if (labelInValue) {
246
- return value && value.length > 0 ? value.map(function (nItem) {
247
- return nItem[treeOptionName.title || 'title' || 'label'];
248
- }).join(',') : '-';
249
- }
250
-
251
- var pathNodes = (0, _utils.getNodePaths)(treeData, value, {
252
- childrenParam: treeOptionName.children,
253
- keyParam: treeOptionName.value
254
- }, _objectSpread({}, otherProps));
255
- return pathNodes.length > 0 ? pathNodes.map(function (nItem) {
256
- var _nItem;
257
-
258
- return (_nItem = nItem[nItem.length - 1]) === null || _nItem === void 0 ? void 0 : _nItem[treeOptionName.title];
259
- }).join(',') : '-';
260
- }
261
-
262
- return fullLevelName || '-'; // 只读显示时,只返回文本
263
- }
264
-
265
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showFullLevel && !otherProps.showCheckedStrategy ? /*#__PURE__*/_react.default.createElement("div", {
266
- className: "refactor-tree-select ".concat(disabled ? 'refactor-disabled' : ''),
267
- title: fullLevelName || ''
268
- }, renderTreeSelectNode(), /*#__PURE__*/_react.default.createElement("span", {
269
- className: "refactor-tree-select-extra"
270
- }, fullLevelName)) : renderTreeSelectNode());
271
- });
272
-
273
- var _default = RefactorTreeSelect;
274
- exports.default = _default;
@@ -1,6 +0,0 @@
1
- interface TitleNodeProps {
2
- render?: any;
3
- data?: any;
4
- }
5
- declare const TitleNode: (props: TitleNodeProps) => JSX.Element;
6
- export default TitleNode;
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- var TitleNode = function TitleNode(props) {
13
- var render = props.render,
14
- data = props.data;
15
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, render ? render(data) : data.title || data.label);
16
- };
17
-
18
- var _default = TitleNode;
19
- exports.default = _default;
@@ -1,38 +0,0 @@
1
- import React from "react";
2
- import PropTypes from 'prop-types';
3
- interface OptionNameProps {
4
- value?: string;
5
- label?: string;
6
- disabled?: string;
7
- title?: string;
8
- children?: string;
9
- [k: string]: any;
10
- }
11
- export interface FieldComponentProps {
12
- label?: any;
13
- type?: String;
14
- filedName?: string;
15
- value?: any;
16
- protoConfig?: any;
17
- onChange?: (value?: any, option?: any) => void;
18
- selectOptions?: any[];
19
- selectOptionName?: OptionNameProps;
20
- fieldNames?: OptionNameProps;
21
- treeData?: PropTypes.ReactNodeArray;
22
- treeOptionName?: OptionNameProps;
23
- placeholder?: string;
24
- fieldStatus?: 'default' | 'disabled' | 'viewonly' | string;
25
- size?: 'large' | 'middle' | 'small' | string;
26
- showFullLevel?: boolean;
27
- separator?: string;
28
- selectOptionRender?: (data: any) => void;
29
- style?: React.CSSProperties;
30
- render?: (props?: any) => React.ReactNode | string;
31
- disabledFields?: {
32
- key: string;
33
- value: string;
34
- }[];
35
- rules?: any;
36
- }
37
- declare const FieldComponent: React.ForwardRefExoticComponent<FieldComponentProps & React.RefAttributes<unknown>>;
38
- export default FieldComponent;