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