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.
- package/Readme.md +35 -0
- package/dist/fan-standard-comp.umd.js +15 -10
- package/es/ButtonGroup/ButtonList.js +0 -3
- package/es/ButtonGroup/ButtonMenu.js +0 -3
- package/es/ButtonGroup/PopConfirmTitle.js +5 -15
- package/es/ButtonGroup/index.d.ts +2 -0
- package/es/ButtonGroup/index.js +223 -193
- package/es/ButtonGroup/style/index.less +1 -1
- package/es/DragContent/DragBar.js +2 -6
- package/es/DragContent/index.js +44 -75
- package/es/FormComp/ChunkUploader/api.js +6 -10
- package/es/FormComp/ChunkUploader/index.js +105 -171
- package/es/FormComp/ChunkUploader/lib.js +4 -17
- package/es/FormComp/ChunkUploader/upload-queue.class.js +10 -45
- package/es/FormComp/ChunkUploader/worker.js +0 -3
- package/es/FormComp/EditButton/index.js +24 -49
- package/es/FormComp/FieldComponent/ReUpload.js +18 -38
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +37 -75
- package/es/FormComp/FieldComponent/TitleNode.js +1 -3
- package/es/FormComp/FieldComponent/index.js +38 -74
- package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -63
- package/es/FormComp/FieldComponent/style/index.less +6 -0
- package/es/FormComp/RenderItemGroup/index.js +46 -74
- package/es/FormComp/Uploader/index.js +36 -77
- package/es/FormComp/Uploader/util.js +0 -6
- package/es/FormComp/VarTemplate/index.js +58 -96
- package/es/NavLeafScroll/index.js +172 -154
- package/es/NavLeafScroll/style/index.less +33 -1
- package/es/RefactorTree/index.js +36 -53
- package/es/RefactorTree/indexTreeNode.js +35 -68
- package/es/RefactorTree/util.js +9 -43
- package/es/SpecIcon/fonts/iconfont.js +7 -12
- package/es/SpecIcon/index.js +16 -25
- package/es/SplitterLayout/Pane.js +2 -5
- package/es/SplitterLayout/index.js +20 -70
- package/es/StandardContent/SplitterLayout/Pane.js +6 -10
- package/es/StandardContent/SplitterLayout/index.js +12 -63
- package/es/StandardContent/SubfieldContent.js +12 -14
- package/es/StandardContent/WrapperContent.js +8 -10
- package/es/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/es/StandardDragModal/ChangeStandardModal.js +493 -0
- package/es/StandardDragModal/DraggableModal.d.ts +7 -0
- package/es/StandardDragModal/DraggableModal.js +31 -0
- package/es/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/es/StandardDragModal/DraggableModalContext.js +5 -0
- package/es/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/es/StandardDragModal/DraggableModalInner.js +114 -0
- package/es/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/es/StandardDragModal/DraggableModalProvider.js +40 -0
- package/es/StandardDragModal/Modal.d.ts +11 -0
- package/es/StandardDragModal/Modal.js +24 -0
- package/es/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/es/StandardDragModal/ResizeHandle.js +8 -0
- package/es/StandardDragModal/clamp.d.ts +1 -0
- package/es/StandardDragModal/clamp.js +3 -0
- package/es/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/es/StandardDragModal/draggableModalReducer.js +157 -0
- package/es/StandardDragModal/getWindowSize.d.ts +4 -0
- package/es/StandardDragModal/getWindowSize.js +6 -0
- package/es/StandardDragModal/index.d.ts +3 -11
- package/es/StandardDragModal/index.js +3 -30
- package/es/StandardDragModal/index.less +65 -0
- package/es/StandardDragModal/useDrag.d.ts +5 -0
- package/es/StandardDragModal/useDrag.js +66 -0
- package/es/StandardDragModal/usePrevious.d.ts +1 -0
- package/es/StandardDragModal/usePrevious.js +8 -0
- package/es/StandardDragModal/useResize.d.ts +7 -0
- package/es/StandardDragModal/useResize.js +74 -0
- package/es/StandardFilter/index.d.ts +1 -0
- package/es/StandardFilter/index.js +32 -70
- package/es/StandardForm/ActionList.js +5 -7
- package/es/StandardForm/StepForm.js +50 -71
- package/es/StandardForm/TabForm.js +58 -70
- package/es/StandardForm/index.js +37 -56
- package/es/StandardModal/UpdateFormRef.js +1 -4
- package/es/StandardModal/index.d.ts +0 -1
- package/es/StandardModal/index.js +115 -159
- package/es/StandardPanel/index.js +19 -35
- package/es/StandardTable/index.js +20 -30
- package/es/components/IconNode/index.js +0 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +15 -14
- package/es/utils/ValueFormat.js +0 -9
- package/es/utils/dictSelectUtil.js +153 -0
- package/es/utils/filterPermission.js +16 -34
- package/es/utils/getParentNodes.js +24 -47
- package/es/utils/index.js +2 -1
- package/lib/ButtonGroup/ButtonList.js +1 -13
- package/lib/ButtonGroup/ButtonMenu.js +1 -8
- package/lib/ButtonGroup/PopConfirmTitle.js +3 -16
- package/lib/ButtonGroup/index.d.ts +2 -0
- package/lib/ButtonGroup/index.js +226 -216
- package/lib/ButtonGroup/style/index.less +1 -1
- package/lib/DragContent/DragBar.js +2 -10
- package/lib/DragContent/index.js +47 -85
- package/lib/FormComp/ChunkUploader/api.js +6 -15
- package/lib/FormComp/ChunkUploader/index.js +107 -185
- package/lib/FormComp/ChunkUploader/lib.js +8 -27
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +10 -46
- package/lib/FormComp/ChunkUploader/worker.js +1 -5
- package/lib/FormComp/EditButton/index.js +26 -60
- package/lib/FormComp/FieldComponent/ReUpload.js +21 -50
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +39 -90
- package/lib/FormComp/FieldComponent/TitleNode.js +1 -5
- package/lib/FormComp/FieldComponent/index.js +38 -110
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +37 -79
- package/lib/FormComp/FieldComponent/style/index.less +6 -0
- package/lib/FormComp/RenderItemGroup/index.js +46 -87
- package/lib/FormComp/Uploader/index.js +38 -95
- package/lib/FormComp/Uploader/util.js +1 -9
- package/lib/FormComp/VarTemplate/index.js +62 -106
- package/lib/FormComp/index.js +0 -2
- package/lib/NavLeafScroll/index.js +174 -165
- package/lib/NavLeafScroll/style/index.less +33 -1
- package/lib/RefactorTree/index.js +36 -67
- package/lib/RefactorTree/indexTreeNode.js +37 -83
- package/lib/RefactorTree/util.js +11 -45
- package/lib/SpecIcon/fonts/iconfont.js +7 -12
- package/lib/SpecIcon/index.js +16 -30
- package/lib/SplitterLayout/Pane.js +0 -7
- package/lib/SplitterLayout/index.js +18 -72
- package/lib/StandardContent/SplitterLayout/Pane.js +6 -14
- package/lib/StandardContent/SplitterLayout/index.js +12 -68
- package/lib/StandardContent/SubfieldContent.js +12 -21
- package/lib/StandardContent/WrapperContent.js +8 -16
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/lib/StandardDragModal/ChangeStandardModal.js +502 -0
- package/lib/StandardDragModal/DraggableModal.d.ts +7 -0
- package/lib/StandardDragModal/DraggableModal.js +40 -0
- package/lib/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/lib/StandardDragModal/DraggableModalContext.js +15 -0
- package/lib/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/lib/StandardDragModal/DraggableModalInner.js +124 -0
- package/lib/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/lib/StandardDragModal/DraggableModalProvider.js +48 -0
- package/lib/StandardDragModal/Modal.d.ts +11 -0
- package/lib/StandardDragModal/Modal.js +32 -0
- package/lib/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/lib/StandardDragModal/ResizeHandle.js +18 -0
- package/lib/StandardDragModal/clamp.d.ts +1 -0
- package/lib/StandardDragModal/clamp.js +10 -0
- package/lib/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/lib/StandardDragModal/draggableModalReducer.js +167 -0
- package/lib/StandardDragModal/getWindowSize.d.ts +4 -0
- package/lib/StandardDragModal/getWindowSize.js +13 -0
- package/lib/StandardDragModal/index.d.ts +3 -11
- package/lib/StandardDragModal/index.js +33 -38
- package/lib/StandardDragModal/index.less +65 -0
- package/lib/StandardDragModal/useDrag.d.ts +5 -0
- package/lib/StandardDragModal/useDrag.js +73 -0
- package/lib/StandardDragModal/usePrevious.d.ts +1 -0
- package/lib/StandardDragModal/usePrevious.js +15 -0
- package/lib/StandardDragModal/useResize.d.ts +7 -0
- package/lib/StandardDragModal/useResize.js +81 -0
- package/lib/StandardFilter/index.d.ts +1 -0
- package/lib/StandardFilter/index.js +30 -78
- package/lib/StandardForm/ActionList.js +5 -12
- package/lib/StandardForm/StepForm.js +52 -90
- package/lib/StandardForm/TabForm.js +61 -88
- package/lib/StandardForm/index.js +40 -75
- package/lib/StandardModal/UpdateFormRef.js +4 -12
- package/lib/StandardModal/index.d.ts +0 -1
- package/lib/StandardModal/index.js +117 -184
- package/lib/StandardPanel/index.js +22 -48
- package/lib/StandardTable/index.js +20 -39
- package/lib/components/IconNode/index.js +0 -7
- package/lib/components/index.js +0 -2
- package/lib/data/index.js +4 -7
- package/lib/index.d.ts +1 -0
- package/lib/index.js +50 -68
- package/lib/utils/ValueFormat.js +0 -10
- package/lib/utils/dictSelectUtil.js +161 -0
- package/lib/utils/filterPermission.js +15 -39
- package/lib/utils/getParentNodes.js +25 -52
- package/lib/utils/index.js +24 -9
- package/package.json +6 -5
|
@@ -1,105 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
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
|
|
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
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
|
|
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;
|