fan-standard-comp 3.1.9 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/Readme.md +35 -0
  2. package/dist/fan-standard-comp.umd.js +15 -10
  3. package/es/ButtonGroup/ButtonList.js +0 -3
  4. package/es/ButtonGroup/ButtonMenu.js +0 -3
  5. package/es/ButtonGroup/PopConfirmTitle.js +5 -15
  6. package/es/ButtonGroup/index.d.ts +2 -0
  7. package/es/ButtonGroup/index.js +223 -193
  8. package/es/ButtonGroup/style/index.less +1 -1
  9. package/es/DragContent/DragBar.js +2 -6
  10. package/es/DragContent/index.js +44 -75
  11. package/es/FormComp/ChunkUploader/api.js +6 -10
  12. package/es/FormComp/ChunkUploader/index.js +105 -171
  13. package/es/FormComp/ChunkUploader/lib.js +4 -17
  14. package/es/FormComp/ChunkUploader/upload-queue.class.js +10 -45
  15. package/es/FormComp/ChunkUploader/worker.js +0 -3
  16. package/es/FormComp/EditButton/index.js +24 -49
  17. package/es/FormComp/FieldComponent/ReUpload.js +18 -38
  18. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +37 -75
  19. package/es/FormComp/FieldComponent/TitleNode.js +1 -3
  20. package/es/FormComp/FieldComponent/index.js +38 -74
  21. package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -63
  22. package/es/FormComp/FieldComponent/style/index.less +6 -0
  23. package/es/FormComp/RenderItemGroup/index.js +46 -74
  24. package/es/FormComp/Uploader/index.js +36 -77
  25. package/es/FormComp/Uploader/util.js +0 -6
  26. package/es/FormComp/VarTemplate/index.js +58 -96
  27. package/es/NavLeafScroll/index.js +172 -154
  28. package/es/NavLeafScroll/style/index.less +33 -1
  29. package/es/RefactorTree/index.js +36 -53
  30. package/es/RefactorTree/indexTreeNode.js +35 -68
  31. package/es/RefactorTree/util.js +9 -43
  32. package/es/SpecIcon/fonts/iconfont.js +7 -12
  33. package/es/SpecIcon/index.js +16 -25
  34. package/es/SplitterLayout/Pane.js +2 -5
  35. package/es/SplitterLayout/index.js +20 -70
  36. package/es/StandardContent/SplitterLayout/Pane.js +6 -10
  37. package/es/StandardContent/SplitterLayout/index.js +12 -63
  38. package/es/StandardContent/SubfieldContent.js +12 -14
  39. package/es/StandardContent/WrapperContent.js +8 -10
  40. package/es/StandardDragModal/ChangeStandardModal.d.ts +44 -0
  41. package/es/StandardDragModal/ChangeStandardModal.js +493 -0
  42. package/es/StandardDragModal/DraggableModal.d.ts +7 -0
  43. package/es/StandardDragModal/DraggableModal.js +31 -0
  44. package/es/StandardDragModal/DraggableModalContext.d.ts +9 -0
  45. package/es/StandardDragModal/DraggableModalContext.js +5 -0
  46. package/es/StandardDragModal/DraggableModalInner.d.ts +16 -0
  47. package/es/StandardDragModal/DraggableModalInner.js +114 -0
  48. package/es/StandardDragModal/DraggableModalProvider.d.ts +4 -0
  49. package/es/StandardDragModal/DraggableModalProvider.js +40 -0
  50. package/es/StandardDragModal/Modal.d.ts +11 -0
  51. package/es/StandardDragModal/Modal.js +24 -0
  52. package/es/StandardDragModal/ResizeHandle.d.ts +2 -0
  53. package/es/StandardDragModal/ResizeHandle.js +8 -0
  54. package/es/StandardDragModal/clamp.d.ts +1 -0
  55. package/es/StandardDragModal/clamp.js +3 -0
  56. package/es/StandardDragModal/draggableModalReducer.d.ts +66 -0
  57. package/es/StandardDragModal/draggableModalReducer.js +157 -0
  58. package/es/StandardDragModal/getWindowSize.d.ts +4 -0
  59. package/es/StandardDragModal/getWindowSize.js +6 -0
  60. package/es/StandardDragModal/index.d.ts +3 -11
  61. package/es/StandardDragModal/index.js +3 -30
  62. package/es/StandardDragModal/index.less +65 -0
  63. package/es/StandardDragModal/useDrag.d.ts +5 -0
  64. package/es/StandardDragModal/useDrag.js +66 -0
  65. package/es/StandardDragModal/usePrevious.d.ts +1 -0
  66. package/es/StandardDragModal/usePrevious.js +8 -0
  67. package/es/StandardDragModal/useResize.d.ts +7 -0
  68. package/es/StandardDragModal/useResize.js +74 -0
  69. package/es/StandardFilter/index.d.ts +1 -0
  70. package/es/StandardFilter/index.js +32 -70
  71. package/es/StandardForm/ActionList.js +5 -7
  72. package/es/StandardForm/StepForm.js +50 -71
  73. package/es/StandardForm/TabForm.js +58 -70
  74. package/es/StandardForm/index.js +37 -56
  75. package/es/StandardModal/UpdateFormRef.js +1 -4
  76. package/es/StandardModal/index.d.ts +0 -1
  77. package/es/StandardModal/index.js +115 -159
  78. package/es/StandardPanel/index.js +19 -35
  79. package/es/StandardTable/index.js +20 -30
  80. package/es/components/IconNode/index.js +0 -4
  81. package/es/index.d.ts +1 -0
  82. package/es/index.js +15 -14
  83. package/es/utils/ValueFormat.js +0 -9
  84. package/es/utils/dictSelectUtil.js +153 -0
  85. package/es/utils/filterPermission.js +16 -34
  86. package/es/utils/getParentNodes.js +24 -47
  87. package/es/utils/index.js +2 -1
  88. package/lib/ButtonGroup/ButtonList.js +1 -13
  89. package/lib/ButtonGroup/ButtonMenu.js +1 -8
  90. package/lib/ButtonGroup/PopConfirmTitle.js +3 -16
  91. package/lib/ButtonGroup/index.d.ts +2 -0
  92. package/lib/ButtonGroup/index.js +226 -216
  93. package/lib/ButtonGroup/style/index.less +1 -1
  94. package/lib/DragContent/DragBar.js +2 -10
  95. package/lib/DragContent/index.js +47 -85
  96. package/lib/FormComp/ChunkUploader/api.js +6 -15
  97. package/lib/FormComp/ChunkUploader/index.js +107 -185
  98. package/lib/FormComp/ChunkUploader/lib.js +8 -27
  99. package/lib/FormComp/ChunkUploader/upload-queue.class.js +10 -46
  100. package/lib/FormComp/ChunkUploader/worker.js +1 -5
  101. package/lib/FormComp/EditButton/index.js +26 -60
  102. package/lib/FormComp/FieldComponent/ReUpload.js +21 -50
  103. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +39 -90
  104. package/lib/FormComp/FieldComponent/TitleNode.js +1 -5
  105. package/lib/FormComp/FieldComponent/index.js +38 -110
  106. package/lib/FormComp/FieldComponent/setReadonlyValues.js +37 -79
  107. package/lib/FormComp/FieldComponent/style/index.less +6 -0
  108. package/lib/FormComp/RenderItemGroup/index.js +46 -87
  109. package/lib/FormComp/Uploader/index.js +38 -95
  110. package/lib/FormComp/Uploader/util.js +1 -9
  111. package/lib/FormComp/VarTemplate/index.js +62 -106
  112. package/lib/FormComp/index.js +0 -2
  113. package/lib/NavLeafScroll/index.js +174 -165
  114. package/lib/NavLeafScroll/style/index.less +33 -1
  115. package/lib/RefactorTree/index.js +36 -67
  116. package/lib/RefactorTree/indexTreeNode.js +37 -83
  117. package/lib/RefactorTree/util.js +11 -45
  118. package/lib/SpecIcon/fonts/iconfont.js +7 -12
  119. package/lib/SpecIcon/index.js +16 -30
  120. package/lib/SplitterLayout/Pane.js +0 -7
  121. package/lib/SplitterLayout/index.js +18 -72
  122. package/lib/StandardContent/SplitterLayout/Pane.js +6 -14
  123. package/lib/StandardContent/SplitterLayout/index.js +12 -68
  124. package/lib/StandardContent/SubfieldContent.js +12 -21
  125. package/lib/StandardContent/WrapperContent.js +8 -16
  126. package/lib/StandardDragModal/ChangeStandardModal.d.ts +44 -0
  127. package/lib/StandardDragModal/ChangeStandardModal.js +502 -0
  128. package/lib/StandardDragModal/DraggableModal.d.ts +7 -0
  129. package/lib/StandardDragModal/DraggableModal.js +40 -0
  130. package/lib/StandardDragModal/DraggableModalContext.d.ts +9 -0
  131. package/lib/StandardDragModal/DraggableModalContext.js +15 -0
  132. package/lib/StandardDragModal/DraggableModalInner.d.ts +16 -0
  133. package/lib/StandardDragModal/DraggableModalInner.js +124 -0
  134. package/lib/StandardDragModal/DraggableModalProvider.d.ts +4 -0
  135. package/lib/StandardDragModal/DraggableModalProvider.js +48 -0
  136. package/lib/StandardDragModal/Modal.d.ts +11 -0
  137. package/lib/StandardDragModal/Modal.js +32 -0
  138. package/lib/StandardDragModal/ResizeHandle.d.ts +2 -0
  139. package/lib/StandardDragModal/ResizeHandle.js +18 -0
  140. package/lib/StandardDragModal/clamp.d.ts +1 -0
  141. package/lib/StandardDragModal/clamp.js +10 -0
  142. package/lib/StandardDragModal/draggableModalReducer.d.ts +66 -0
  143. package/lib/StandardDragModal/draggableModalReducer.js +167 -0
  144. package/lib/StandardDragModal/getWindowSize.d.ts +4 -0
  145. package/lib/StandardDragModal/getWindowSize.js +13 -0
  146. package/lib/StandardDragModal/index.d.ts +3 -11
  147. package/lib/StandardDragModal/index.js +33 -38
  148. package/lib/StandardDragModal/index.less +65 -0
  149. package/lib/StandardDragModal/useDrag.d.ts +5 -0
  150. package/lib/StandardDragModal/useDrag.js +73 -0
  151. package/lib/StandardDragModal/usePrevious.d.ts +1 -0
  152. package/lib/StandardDragModal/usePrevious.js +15 -0
  153. package/lib/StandardDragModal/useResize.d.ts +7 -0
  154. package/lib/StandardDragModal/useResize.js +81 -0
  155. package/lib/StandardFilter/index.d.ts +1 -0
  156. package/lib/StandardFilter/index.js +30 -78
  157. package/lib/StandardForm/ActionList.js +5 -12
  158. package/lib/StandardForm/StepForm.js +52 -90
  159. package/lib/StandardForm/TabForm.js +61 -88
  160. package/lib/StandardForm/index.js +40 -75
  161. package/lib/StandardModal/UpdateFormRef.js +4 -12
  162. package/lib/StandardModal/index.d.ts +0 -1
  163. package/lib/StandardModal/index.js +117 -184
  164. package/lib/StandardPanel/index.js +22 -48
  165. package/lib/StandardTable/index.js +20 -39
  166. package/lib/components/IconNode/index.js +0 -7
  167. package/lib/components/index.js +0 -2
  168. package/lib/data/index.js +4 -7
  169. package/lib/index.d.ts +1 -0
  170. package/lib/index.js +50 -68
  171. package/lib/utils/ValueFormat.js +0 -10
  172. package/lib/utils/dictSelectUtil.js +161 -0
  173. package/lib/utils/filterPermission.js +15 -39
  174. package/lib/utils/getParentNodes.js +25 -52
  175. package/lib/utils/index.js +24 -9
  176. package/package.json +6 -5
@@ -1,105 +1,74 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  require("antd/es/tree-select/style");
11
-
12
9
  var _treeSelect = _interopRequireDefault(require("antd/es/tree-select"));
13
-
14
10
  var _react = _interopRequireWildcard(require("react"));
15
-
16
11
  require("./style/index.less");
17
-
18
12
  var _utils = require("../../utils");
19
-
20
13
  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
-
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
26
16
  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
-
17
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
18
+ 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; }
19
+ 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; }
20
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
22
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
36
23
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
37
-
38
24
  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
25
  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
26
  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
-
27
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
46
28
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
47
-
48
29
  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
30
  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
31
  var TreeNode = _treeSelect.default.TreeNode;
53
-
54
32
  var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
55
33
  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
-
34
+ treeData = _props$treeData === void 0 ? [] : _props$treeData,
35
+ value = props.value,
36
+ showFullLevel = props.showFullLevel,
37
+ _props$separator = props.separator,
38
+ separator = _props$separator === void 0 ? '/' : _props$separator,
39
+ disabled = props.disabled,
40
+ disabledFields = props.disabledFields,
41
+ fieldStatus = props.fieldStatus,
42
+ _props$treeOptionName = props.treeOptionName,
43
+ treeOptionName = _props$treeOptionName === void 0 ? {
44
+ title: 'title',
45
+ value: 'value',
46
+ children: 'children',
47
+ disabled: 'disabled'
48
+ } : _props$treeOptionName,
49
+ placeholder = props.placeholder,
50
+ protoTreeNode = props.protoTreeNode,
51
+ _onSelect = props.onSelect,
52
+ labelInValue = props.labelInValue,
53
+ otherProps = _objectWithoutProperties(props, ["treeData", "value", "showFullLevel", "separator", "disabled", "disabledFields", "fieldStatus", "treeOptionName", "placeholder", "protoTreeNode", "onSelect", "labelInValue"]);
77
54
  var _useState = (0, _react.useState)(null),
78
- _useState2 = _slicedToArray(_useState, 2),
79
- fullLevelName = _useState2[0],
80
- setFullLevelName = _useState2[1];
81
-
55
+ _useState2 = _slicedToArray(_useState, 2),
56
+ fullLevelName = _useState2[0],
57
+ setFullLevelName = _useState2[1];
82
58
  var renderTreeNode = function renderTreeNode(data, dataOptionName) {
83
59
  var nodeProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
84
60
  return data.map(function (dataItem) {
85
61
  var prevDataItem = _objectSpread({}, dataItem);
86
-
87
62
  var item = _extends({}, prevDataItem); // 筛选与禁用字段内值相同的节点进行禁用
88
-
89
-
90
63
  var resetByDisabledFields = function resetByDisabledFields(initItem) {
91
64
  var oldItem = _objectSpread({}, initItem);
92
-
93
65
  var nodeItem = _extends({}, oldItem);
94
-
95
66
  Object.keys(nodeItem).forEach(function (itemKeyName) {
96
67
  var isMatch = disabledFields.find(function (fItem) {
97
68
  return fItem.key === itemKeyName;
98
69
  });
99
-
100
70
  if (isMatch) {
101
71
  var _isMatch$value$split;
102
-
103
72
  // 确认是否匹配数据,进行设置 disabled
104
73
  if ((_isMatch$value$split = isMatch.value.split(',')) === null || _isMatch$value$split === void 0 ? void 0 : _isMatch$value$split.includes(nodeItem[itemKeyName])) {
105
74
  nodeItem.disabled = true;
@@ -110,11 +79,9 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
110
79
  });
111
80
  return nodeItem;
112
81
  };
113
-
114
82
  if (disabledFields && Array.isArray(disabledFields)) {
115
83
  item = resetByDisabledFields(item);
116
84
  }
117
-
118
85
  if (item[dataOptionName.children] && item[dataOptionName.children].length > 0) {
119
86
  return /*#__PURE__*/_react.default.createElement(TreeNode, _extends({
120
87
  title: item[dataOptionName.title],
@@ -126,7 +93,6 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
126
93
  disabled: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.disabled) || 'disabled']
127
94
  }, nodeProps), renderTreeNode(item[dataOptionName.children], dataOptionName));
128
95
  }
129
-
130
96
  return /*#__PURE__*/_react.default.createElement(TreeNode, _extends({
131
97
  title: item[dataOptionName.title],
132
98
  key: item[dataOptionName.value],
@@ -138,7 +104,6 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
138
104
  }, nodeProps));
139
105
  });
140
106
  };
141
-
142
107
  (0, _react.useEffect)(function () {
143
108
  if (value) {
144
109
  // 获取选中节点相关数据:包括当前完整数据值、当前父节点以上层层级节点数据集合及id集合
@@ -152,27 +117,22 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
152
117
  setFullLevelName(null);
153
118
  }
154
119
  }, [value, treeData, fieldStatus]);
155
-
156
120
  var renderParenName = function renderParenName(selectNodeInfo) {
157
121
  // 有父级节点,及当前模式是showFullLevel时,渲染名称为完整层级名称,否则为当前节点名称
158
122
  var parentItems = selectNodeInfo.nodeParent;
159
-
160
123
  if (parentItems.length > 0 && showFullLevel && !otherProps.showCheckedStrategy) {
161
124
  // 当前查找到的父级节点拼合当前节点的标题字段值进行显示
162
125
  return parentItems.reverse().map(function (item) {
163
126
  return item[treeOptionName.title];
164
127
  }).concat(selectNodeInfo.matchNode[0][treeOptionName.title]).join(separator);
165
128
  }
166
-
167
129
  if (Array.isArray(value)) {
168
130
  return selectNodeInfo.matchNode.length > 0 ? selectNodeInfo.matchNode.map(function (item) {
169
131
  return item[treeOptionName.title] || item[treeOptionName.value];
170
132
  }).join(',') : null;
171
133
  }
172
-
173
134
  return selectNodeInfo.matchNode.length > 0 ? selectNodeInfo.matchNode[0][treeOptionName.title] : null;
174
135
  };
175
-
176
136
  var renderTreeSelectNode = function renderTreeSelectNode() {
177
137
  return /*#__PURE__*/_react.default.createElement(_treeSelect.default, _extends({
178
138
  placeholder: placeholder,
@@ -193,24 +153,19 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
193
153
  }
194
154
  }), renderTreeNode(treeData, treeOptionName, protoTreeNode || {}));
195
155
  };
196
-
197
156
  var _useState3 = (0, _react.useState)(false),
198
- _useState4 = _slicedToArray(_useState3, 2),
199
- showAllPath = _useState4[0],
200
- setShowAllPath = _useState4[1]; // 显示所有树选择路径
201
-
202
-
157
+ _useState4 = _slicedToArray(_useState3, 2),
158
+ showAllPath = _useState4[0],
159
+ setShowAllPath = _useState4[1]; // 显示所有树选择路径
203
160
  var renderTreeSelectNodePath = function renderTreeSelectNodePath() {
204
161
  //获取节点路径
205
162
  var pathNodes = (0, _utils.getNodePaths)(treeData, value, {
206
163
  childrenParam: treeOptionName.children,
207
164
  keyParam: treeOptionName.value
208
165
  }, _objectSpread({}, otherProps));
209
-
210
166
  var togglePath = function togglePath() {
211
167
  setShowAllPath(!showAllPath);
212
168
  };
213
-
214
169
  if (pathNodes.length > 0) {
215
170
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
216
171
  className: "tree-select-viewonly-list ".concat(showAllPath ? 'collapsed' : '')
@@ -233,42 +188,36 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
233
188
  return '-';
234
189
  }
235
190
  };
236
-
237
191
  if (fieldStatus === 'viewOnly') {
238
192
  //多选下拉框 详情展示 showCheckedStrategy 有值且显示完整路径时
239
193
  if (otherProps.showCheckedStrategy && showFullLevel) {
240
194
  return renderTreeSelectNodePath();
241
- } // 多选状态
242
-
243
-
195
+ }
196
+ // 多选状态
244
197
  if (otherProps.multiple) {
245
198
  if (labelInValue) {
246
199
  return value && value.length > 0 ? value.map(function (item) {
247
200
  return item[treeOptionName.title] || item['title'] || item['label'];
248
201
  }).join(',') : '-';
249
202
  }
250
-
251
203
  var pathNodes = (0, _utils.getNodePaths)(treeData, value, {
252
204
  childrenParam: treeOptionName.children,
253
205
  keyParam: treeOptionName.value
254
206
  }, _objectSpread({}, otherProps));
255
207
  return pathNodes.length > 0 ? pathNodes.map(function (nItem) {
256
208
  var _nItem;
257
-
258
209
  return (_nItem = nItem[nItem.length - 1]) === null || _nItem === void 0 ? void 0 : _nItem[treeOptionName.title];
259
210
  }).join(',') : '-';
260
211
  }
261
-
262
212
  return fullLevelName || '-'; // 只读显示时,只返回文本
263
213
  }
264
214
 
265
215
  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' : ''),
216
+ className: "refactor-tree-select ".concat(disabled ? 'refactor-disabled' : '').concat(otherProps.size === 'small' ? ' refactor-tree-select-sm' : ''),
267
217
  title: fullLevelName || ''
268
218
  }, renderTreeSelectNode(), /*#__PURE__*/_react.default.createElement("span", {
269
219
  className: "refactor-tree-select-extra"
270
220
  }, fullLevelName)) : renderTreeSelectNode());
271
221
  });
272
-
273
222
  var _default = RefactorTreeSelect;
274
223
  exports.default = _default;
@@ -4,16 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  var TitleNode = function TitleNode(props) {
13
10
  var render = props.render,
14
- data = props.data;
11
+ data = props.data;
15
12
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, render ? render(data) : data.title || data.label);
16
13
  };
17
-
18
14
  var _default = TitleNode;
19
15
  exports.default = _default;