@zat-design/sisyphus-react 4.5.9 → 4.5.10-beta.2
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/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/FormsProvider/index.js +14 -21
- package/es/ProAction/components/CheckModalContent/index.js +12 -26
- package/es/ProAction/index.js +79 -83
- package/es/ProAction/propsType.js +0 -1
- package/es/ProConfigProvider/index.js +63 -110
- package/es/ProConfigProvider/propsType.js +0 -1
- package/es/ProDownload/index.d.ts +2 -1
- package/es/ProDownload/index.js +74 -69
- package/es/ProDownload/propsType.js +0 -1
- package/es/ProDownload/utils.d.ts +10 -5
- package/es/ProDownload/utils.js +63 -95
- package/es/ProDrawerForm/components/ProDrawer/index.js +83 -113
- package/es/ProDrawerForm/components/ProModal/index.js +77 -108
- package/es/ProDrawerForm/components/index.js +6 -2
- package/es/ProDrawerForm/hooks/useConfirmClose.js +20 -39
- package/es/ProDrawerForm/index.js +29 -38
- package/es/ProDrawerForm/propsType.js +0 -1
- package/es/ProDrawerForm/utils/index.js +18 -36
- package/es/ProEditLabel/components/RenderProForm.js +45 -49
- package/es/ProEditLabel/index.js +126 -163
- package/es/ProEditLabel/propsType.js +0 -1
- package/es/ProEditLabel/utils/index.js +5 -8
- package/es/ProEditTable/components/ActionButton/index.js +111 -119
- package/es/ProEditTable/components/RcTable/BaseTable.js +38 -51
- package/es/ProEditTable/components/RcTable/DraggableTable.js +97 -129
- package/es/ProEditTable/components/RcTable/index.js +6 -4
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +77 -95
- package/es/ProEditTable/components/RenderField/index.js +490 -587
- package/es/ProEditTable/components/RenderField/propsType.js +0 -1
- package/es/ProEditTable/components/RenderField/tools.js +115 -112
- package/es/ProEditTable/components/RenderToolbar/index.js +47 -73
- package/es/ProEditTable/components/Summary/index.js +38 -64
- package/es/ProEditTable/components/Validator/index.js +46 -46
- package/es/ProEditTable/components/index.js +12 -5
- package/es/ProEditTable/index.js +456 -378
- package/es/ProEditTable/propsType.js +0 -1
- package/es/ProEditTable/utils/config.js +60 -122
- package/es/ProEditTable/utils/diffOriginal.js +45 -82
- package/es/ProEditTable/utils/getDefaultProps.js +19 -24
- package/es/ProEditTable/utils/index.js +154 -235
- package/es/ProEditTable/utils/tools.js +149 -286
- package/es/ProEditTable/utils/transform.js +25 -30
- package/es/ProEditTable/utils/useEditTableError.js +30 -43
- package/es/ProEditTable/utils/useShouldUpdateForTable.js +42 -72
- package/es/ProEditTable/utils/validateAll.js +87 -154
- package/es/ProEnum/components/Group.js +38 -30
- package/es/ProEnum/components/Tag.js +22 -26
- package/es/ProEnum/hooks/useEnum.js +48 -116
- package/es/ProEnum/hooks/useEnumRequest.js +182 -212
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +40 -48
- package/es/ProEnum/index.js +162 -172
- package/es/ProEnum/propsType.js +0 -1
- package/es/ProEnum/utils/eventCenter.js +10 -12
- package/es/ProEnum/utils/frequentEnum.js +35 -92
- package/es/ProEnum/utils/getEnum.js +32 -90
- package/es/ProEnum/utils/getEnumLabel.js +44 -49
- package/es/ProEnum/utils/index.js +93 -207
- package/es/ProForm/components/Container.js +13 -28
- package/es/ProForm/components/FormFooter/index.js +36 -44
- package/es/ProForm/components/FormFooter/propsType.js +0 -1
- package/es/ProForm/components/base/Checkbox/index.js +32 -59
- package/es/ProForm/components/base/DatePicker/index.js +49 -71
- package/es/ProForm/components/base/Input/index.js +63 -97
- package/es/ProForm/components/base/Input/propsType.js +0 -1
- package/es/ProForm/components/base/InputNumber/index.js +118 -172
- package/es/ProForm/components/base/Radio/index.js +39 -52
- package/es/ProForm/components/base/RangePicker/index.js +109 -127
- package/es/ProForm/components/base/RangePicker/useDateRange.js +20 -17
- package/es/ProForm/components/base/Select/index.js +63 -89
- package/es/ProForm/components/base/Switch/index.js +27 -35
- package/es/ProForm/components/base/SwitchCheckbox/index.js +36 -54
- package/es/ProForm/components/base/TextArea/index.js +30 -41
- package/es/ProForm/components/base/TimePicker/index.js +27 -37
- package/es/ProForm/components/combination/Container/index.js +37 -47
- package/es/ProForm/components/combination/Container/propsType.js +0 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +165 -237
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +98 -102
- package/es/ProForm/components/combination/FormList/components/Empty.js +28 -55
- package/es/ProForm/components/combination/FormList/components/LineFields.js +57 -54
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +61 -109
- package/es/ProForm/components/combination/FormList/index.js +151 -161
- package/es/ProForm/components/combination/FormList/propsType.js +0 -1
- package/es/ProForm/components/combination/FormList/style/index.less +6 -0
- package/es/ProForm/components/combination/FormList/utils.js +22 -38
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +12 -28
- package/es/ProForm/components/combination/Group/component/ComRender.js +50 -111
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +106 -213
- package/es/ProForm/components/combination/Group/hooks/index.js +69 -129
- package/es/ProForm/components/combination/Group/index.js +87 -126
- package/es/ProForm/components/combination/Group/propsType.js +0 -1
- package/es/ProForm/components/combination/Group/utils/index.js +124 -239
- package/es/ProForm/components/combination/ProCascader/index.js +156 -199
- package/es/ProForm/components/combination/ProCascader/propsType.js +0 -1
- package/es/ProForm/components/combination/ProCascader/utils/index.js +12 -21
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +72 -70
- package/es/ProForm/components/combination/ProModalSelect/index.js +309 -347
- package/es/ProForm/components/combination/ProModalSelect/propsType.js +0 -1
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +32 -39
- package/es/ProForm/components/combination/ProNumberRange/index.js +100 -156
- package/es/ProForm/components/combination/ProNumberRange/propsType.js +0 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.js +104 -115
- package/es/ProForm/components/combination/ProRangeLimit/propsType.js +0 -1
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +16 -16
- package/es/ProForm/components/combination/ProTimeLimit/index.js +75 -109
- package/es/ProForm/components/index.js +56 -34
- package/es/ProForm/components/render/ChangedWrapper.js +85 -94
- package/es/ProForm/components/render/ConfirmWrapper.js +27 -39
- package/es/ProForm/components/render/CustomComponentViewWrapper.js +65 -82
- package/es/ProForm/components/render/Render.js +223 -329
- package/es/ProForm/components/render/RenderFields.js +76 -113
- package/es/ProForm/components/render/propsType.js +0 -1
- package/es/ProForm/hooks/useControlled.js +8 -10
- package/es/ProForm/hooks/useDeepCompareMemo.js +11 -11
- package/es/ProForm/hooks/useFieldProps.js +8 -4
- package/es/ProForm/hooks/useForm.js +50 -110
- package/es/ProForm/hooks/useRules.js +17 -33
- package/es/ProForm/hooks/useShouldUpdate.js +77 -152
- package/es/ProForm/hooks/useWatch.js +62 -134
- package/es/ProForm/index.js +157 -194
- package/es/ProForm/propsType.js +15 -7
- package/es/ProForm/utils/buildFormItemProps.js +51 -58
- package/es/ProForm/utils/diffOriginal.js +43 -73
- package/es/ProForm/utils/getDefaultProps.js +18 -24
- package/es/ProForm/utils/index.js +160 -235
- package/es/ProForm/utils/processDependencies.js +21 -60
- package/es/ProForm/utils/reactiveValues.js +20 -34
- package/es/ProForm/utils/rulesCreator.js +42 -40
- package/es/ProForm/utils/transformNames.js +10 -13
- package/es/ProForm/utils/transformValue.js +16 -29
- package/es/ProForm/utils/valueType.js +96 -178
- package/es/ProIcon/config/index.js +340 -274
- package/es/ProIcon/index.js +135 -209
- package/es/ProIcon/propsTypes.js +0 -1
- package/es/ProIcon/utils/index.js +24 -39
- package/es/ProLayout/components/Layout/Header/index.js +108 -141
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +134 -190
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +113 -139
- package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +0 -1
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +23 -31
- package/es/ProLayout/components/Layout/Menu/index.js +92 -89
- package/es/ProLayout/components/Layout/Notice/index.js +13 -27
- package/es/ProLayout/components/Layout/index.js +8 -3
- package/es/ProLayout/components/ProCollapse/PropTypes.js +0 -1
- package/es/ProLayout/components/ProCollapse/index.js +89 -111
- package/es/ProLayout/components/ProFooter/PropTypes.js +0 -1
- package/es/ProLayout/components/ProFooter/index.js +27 -24
- package/es/ProLayout/components/ProHeader/PropTypes.js +0 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +23 -21
- package/es/ProLayout/components/ProHeader/components/Describe/index.js +67 -84
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +18 -21
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +0 -1
- package/es/ProLayout/components/ProHeader/components/index.js +6 -2
- package/es/ProLayout/components/ProHeader/index.js +216 -356
- package/es/ProLayout/components/ProHeader/utils/index.js +19 -26
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +92 -85
- package/es/ProLayout/components/TabsManager/components/TabItem.js +53 -63
- package/es/ProLayout/components/TabsManager/components/TabsContext.js +5 -5
- package/es/ProLayout/components/TabsManager/components/TabsHeader.js +42 -52
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.js +8 -9
- package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.js +19 -32
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +6 -20
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +25 -42
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +320 -350
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.d.ts +19 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.js +332 -0
- package/es/ProLayout/components/TabsManager/index.js +407 -351
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +4 -0
- package/es/ProLayout/components/TabsManager/propTypes.js +7 -15
- package/es/ProLayout/components/TabsManager/style/index.less +1 -1
- package/es/ProLayout/components/TabsManager/utils/historyObserver.d.ts +7 -0
- package/es/ProLayout/components/TabsManager/utils/historyObserver.js +65 -0
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +15 -2
- package/es/ProLayout/components/TabsManager/utils/index.js +156 -159
- package/es/ProLayout/components/index.js +8 -3
- package/es/ProLayout/index.js +173 -228
- package/es/ProLayout/propTypes.d.ts +28 -1
- package/es/ProLayout/propTypes.js +12 -52
- package/es/ProLayout/utils/index.js +48 -128
- package/es/ProSelect/components/AdaptiveTooltip.js +26 -25
- package/es/ProSelect/index.js +187 -223
- package/es/ProSelect/propsType.js +0 -1
- package/es/ProSelect/style/index.less +13 -0
- package/es/ProSelect/utils/index.js +100 -146
- package/es/ProStep/components/Anchor/index.js +71 -82
- package/es/ProStep/components/Item/index.js +49 -56
- package/es/ProStep/components/LazyLoad/index.js +23 -29
- package/es/ProStep/components/Listener/index.js +20 -33
- package/es/ProStep/components/Step/index.js +31 -38
- package/es/ProStep/constants.js +4 -1
- package/es/ProStep/index.js +166 -153
- package/es/ProStep/propsType.js +0 -1
- package/es/ProStep/style/index.less +1 -1
- package/es/ProStep/utils/index.js +29 -55
- package/es/ProStepTab/index.js +83 -138
- package/es/ProStepTab/propsType.js +0 -1
- package/es/ProTable/components/EditableCell/EditIcon.js +10 -14
- package/es/ProTable/components/EditableCell/index.js +37 -71
- package/es/ProTable/components/EditableCell/propsType.js +0 -1
- package/es/ProTable/components/FormatColumn/index.js +209 -340
- package/es/ProTable/components/FormatColumn/propsType.js +0 -1
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +35 -39
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +80 -107
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +54 -48
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +0 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +47 -54
- package/es/ProTable/components/RcTable/index.js +6 -4
- package/es/ProTable/components/RenderColumn/index.js +158 -186
- package/es/ProTable/components/RenderEmptyText/index.js +12 -21
- package/es/ProTable/components/RenderFooter/index.js +15 -15
- package/es/ProTable/components/RenderSummary/index.js +33 -50
- package/es/ProTable/components/RenderTableHeader/index.js +44 -46
- package/es/ProTable/components/RenderTabs/index.js +47 -51
- package/es/ProTable/components/TableResizable/index.js +56 -72
- package/es/ProTable/components/TooltipTitle/index.js +13 -21
- package/es/ProTable/components/index.js +16 -36
- package/es/ProTable/hooks/useAntdTable.js +191 -224
- package/es/ProTable/index.js +232 -249
- package/es/ProTable/propsType.js +0 -1
- package/es/ProTable/utils/columnStorage.js +63 -88
- package/es/ProTable/utils/index.js +57 -90
- package/es/ProTabs/components/Card/index.js +20 -48
- package/es/ProTabs/components/index.js +4 -1
- package/es/ProTabs/index.js +41 -58
- package/es/ProTabs/propType.js +0 -1
- package/es/ProThemeTools/component/ProTools/index.js +106 -158
- package/es/ProThemeTools/component/index.js +4 -1
- package/es/ProThemeTools/context/ThemeContext.js +67 -146
- package/es/ProThemeTools/index.js +103 -156
- package/es/ProThemeTools/propsType.js +0 -1
- package/es/ProThemeTools/utils/index.js +60 -109
- package/es/ProTooltip/index.js +132 -168
- package/es/ProTooltip/propsType.js +0 -1
- package/es/ProTree/components/AdaptiveTooltip.js +15 -17
- package/es/ProTree/components/CloseIcon.js +18 -26
- package/es/ProTree/components/List.js +28 -47
- package/es/ProTree/components/ProTree.js +152 -211
- package/es/ProTree/components/ProTreeSelect/index.js +255 -459
- package/es/ProTree/components/ProTreeSelect/propsType.js +0 -1
- package/es/ProTree/components/SearchTitle.js +23 -42
- package/es/ProTree/components/Tree.js +147 -195
- package/es/ProTree/components/index.js +10 -5
- package/es/ProTree/index.js +12 -16
- package/es/ProTree/propsType.js +0 -1
- package/es/ProTree/utils.js +46 -118
- package/es/ProTreeModal/components/Cascader.js +56 -64
- package/es/ProTreeModal/components/CloseIcon.js +18 -26
- package/es/ProTreeModal/components/List.js +114 -180
- package/es/ProTreeModal/components/SearchTitle.js +15 -18
- package/es/ProTreeModal/components/SortableItem.js +29 -58
- package/es/ProTreeModal/components/Tree.js +99 -113
- package/es/ProTreeModal/components/Trigger.js +87 -121
- package/es/ProTreeModal/components/index.js +14 -6
- package/es/ProTreeModal/index.js +397 -438
- package/es/ProTreeModal/propsType.js +0 -1
- package/es/ProTreeModal/utils.js +52 -95
- package/es/ProUpload/components/ButtonRender.js +44 -54
- package/es/ProUpload/components/DragRender.js +94 -148
- package/es/ProUpload/components/DraggableUploadListItem.js +12 -25
- package/es/ProUpload/components/Example.js +27 -31
- package/es/ProUpload/components/FileItem.js +69 -163
- package/es/ProUpload/components/ImageRender.js +134 -170
- package/es/ProUpload/index.js +68 -100
- package/es/ProUpload/propsType.js +0 -1
- package/es/ProUpload/uitls.js +8 -4
- package/es/ProUtils/utils/index.js +17 -13
- package/es/ProViewer/index.js +154 -175
- package/es/ProViewer/propsType.js +0 -5
- package/es/ProWaterMark/index.js +9 -16
- package/es/ProWaterMark/propsType.js +0 -1
- package/es/hooks/useDraggableRow.js +25 -53
- package/es/index.js +57 -77
- package/es/locale/en_US.js +153 -142
- package/es/locale/index.js +23 -36
- package/es/locale/zh_CN.js +145 -142
- package/es/tokens.js +84 -83
- package/es/utils/index.js +24 -51
- package/package.json +4 -2
- package/es/ProConfigProvider/demo/locale.js +0 -58
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,54 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
2
3
|
import AdaptiveTooltip from "./AdaptiveTooltip";
|
|
3
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
function SearchTitle(props) {
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
searchStr = '',
|
|
8
|
-
showEllipse,
|
|
9
|
-
ellipseWidth,
|
|
10
|
-
otherProps
|
|
11
|
-
} = props;
|
|
12
|
-
const {
|
|
13
|
-
isDiffChange = false
|
|
14
|
-
} = otherProps ?? {};
|
|
5
|
+
const { label, searchStr = "", showEllipse, ellipseWidth, otherProps } = props;
|
|
6
|
+
const { isDiffChange = false } = otherProps ?? {};
|
|
15
7
|
const strTitle = label;
|
|
16
|
-
const index = strTitle
|
|
17
|
-
const beforeStr = strTitle
|
|
18
|
-
const afterStr = strTitle
|
|
8
|
+
const index = strTitle == null ? void 0 : strTitle.indexOf(searchStr);
|
|
9
|
+
const beforeStr = strTitle == null ? void 0 : strTitle.substring(0, index);
|
|
10
|
+
const afterStr = strTitle == null ? void 0 : strTitle.slice(index + searchStr.length);
|
|
19
11
|
let classEllipse;
|
|
20
12
|
const style = {};
|
|
21
13
|
if (showEllipse) {
|
|
22
|
-
classEllipse =
|
|
14
|
+
classEllipse = "ellipse";
|
|
23
15
|
style.width = ellipseWidth;
|
|
24
16
|
}
|
|
25
|
-
const title = index > -1 ?
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
children: strTitle
|
|
36
|
-
});
|
|
37
|
-
const titleTips = index > -1 ? /*#__PURE__*/_jsxs("span", {
|
|
38
|
-
style: style,
|
|
39
|
-
children: [beforeStr, searchStr ? /*#__PURE__*/_jsx("span", {
|
|
40
|
-
className: "pro-tree-modal-search-value",
|
|
41
|
-
children: searchStr
|
|
42
|
-
}) : null, afterStr]
|
|
43
|
-
}) : /*#__PURE__*/_jsx("span", {
|
|
44
|
-
style: style,
|
|
45
|
-
children: strTitle
|
|
46
|
-
});
|
|
17
|
+
const title = index > -1 ? /* @__PURE__ */ jsxs("span", { className: classEllipse, style, children: [
|
|
18
|
+
beforeStr,
|
|
19
|
+
searchStr ? /* @__PURE__ */ jsx("span", { className: "pro-tree-modal-search-value", children: searchStr }) : null,
|
|
20
|
+
afterStr
|
|
21
|
+
] }) : /* @__PURE__ */ jsx("span", { className: classEllipse, style, children: strTitle });
|
|
22
|
+
const titleTips = index > -1 ? /* @__PURE__ */ jsxs("span", { style, children: [
|
|
23
|
+
beforeStr,
|
|
24
|
+
searchStr ? /* @__PURE__ */ jsx("span", { className: "pro-tree-modal-search-value", children: searchStr }) : null,
|
|
25
|
+
afterStr
|
|
26
|
+
] }) : /* @__PURE__ */ jsx("span", { style, children: strTitle });
|
|
47
27
|
if (classEllipse && !isDiffChange) {
|
|
48
|
-
return
|
|
49
|
-
children: titleTips
|
|
50
|
-
});
|
|
28
|
+
return /* @__PURE__ */ jsx(AdaptiveTooltip, { children: titleTips });
|
|
51
29
|
}
|
|
52
30
|
return title;
|
|
53
31
|
}
|
|
54
|
-
|
|
32
|
+
var SearchTitle_default = memo(SearchTitle);
|
|
33
|
+
export {
|
|
34
|
+
SearchTitle_default as default
|
|
35
|
+
};
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { useEffect, useState } from
|
|
3
|
-
import { Tree, Popover } from
|
|
4
|
-
import { useSetState } from
|
|
5
|
-
import { CaretDownOutlined } from
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import { Tree, Popover } from "antd";
|
|
4
|
+
import { useSetState } from "ahooks";
|
|
5
|
+
import { CaretDownOutlined } from "@ant-design/icons";
|
|
6
6
|
import SearchTitle from "./SearchTitle";
|
|
7
7
|
import { filterCheckedNodes, getParentKey } from "../utils";
|
|
8
8
|
import locale from "../../locale";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const tagsBgColors = [
|
|
10
|
+
"rgba(0, 106, 255,0.16)",
|
|
11
|
+
"rgba(0, 196, 74,0.16)",
|
|
12
|
+
"rgba(255, 140, 0,0.16)",
|
|
13
|
+
"rgba(255, 80, 80,0.16)",
|
|
14
|
+
"rgba(97, 97, 97, 0.16)"
|
|
15
|
+
];
|
|
16
|
+
const tagsColors = ["#006AFF", "#00C44A", "#FF8C00", "#FF5050", "#616161"];
|
|
12
17
|
function List(props) {
|
|
18
|
+
var _a, _b;
|
|
13
19
|
const {
|
|
14
20
|
checkedValues,
|
|
15
21
|
disabled,
|
|
@@ -18,7 +24,7 @@ function List(props) {
|
|
|
18
24
|
showCodeName = false,
|
|
19
25
|
checkStrictly = false,
|
|
20
26
|
flatTreeData,
|
|
21
|
-
mode =
|
|
27
|
+
mode = "render",
|
|
22
28
|
fieldNames,
|
|
23
29
|
tags,
|
|
24
30
|
onCheck,
|
|
@@ -26,7 +32,7 @@ function List(props) {
|
|
|
26
32
|
optionRender,
|
|
27
33
|
treeData,
|
|
28
34
|
showLine = true,
|
|
29
|
-
switcherIcon =
|
|
35
|
+
switcherIcon = /* @__PURE__ */ jsx(CaretDownOutlined, {}),
|
|
30
36
|
checkable = false,
|
|
31
37
|
menu,
|
|
32
38
|
innerExpandKeys,
|
|
@@ -37,22 +43,17 @@ function List(props) {
|
|
|
37
43
|
} = props;
|
|
38
44
|
const fieldNameLabel = fieldNames.label;
|
|
39
45
|
const fieldNameValue = fieldNames.value;
|
|
40
|
-
const [{
|
|
41
|
-
expandedKeys,
|
|
42
|
-
autoExpandParent,
|
|
43
|
-
currentClickTreeNode,
|
|
44
|
-
handing
|
|
45
|
-
}, setState] = useSetState({
|
|
46
|
-
expandedKeys: undefined,
|
|
46
|
+
const [{ expandedKeys, autoExpandParent, currentClickTreeNode, handing }, setState] = useSetState({
|
|
47
|
+
expandedKeys: void 0,
|
|
47
48
|
autoExpandParent: true,
|
|
48
49
|
currentClickTreeNode: null,
|
|
49
50
|
handing: false
|
|
50
51
|
});
|
|
51
52
|
useEffect(() => {
|
|
52
53
|
if (searchStr) {
|
|
53
|
-
const newExpandedKeys = flatTreeData.map(item => {
|
|
54
|
+
const newExpandedKeys = flatTreeData.map((item) => {
|
|
54
55
|
const title = item[fieldNameValue] + item[fieldNameLabel];
|
|
55
|
-
if (title
|
|
56
|
+
if ((title == null ? void 0 : title.indexOf(searchStr)) > -1) {
|
|
56
57
|
return getParentKey(item[fieldNameValue], originalTreeData, fieldNames);
|
|
57
58
|
}
|
|
58
59
|
return null;
|
|
@@ -72,14 +73,12 @@ function List(props) {
|
|
|
72
73
|
}, [innerExpandKeys]);
|
|
73
74
|
useEffect(() => {
|
|
74
75
|
if (!checkable) {
|
|
75
|
-
// 单选树,checkedValues为string,选中那个树节点
|
|
76
76
|
setState({
|
|
77
77
|
currentClickTreeNode: checkedValues
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
}, [checkedValues]);
|
|
81
81
|
useEffect(() => {
|
|
82
|
-
// 复选树,配置的selectedKey在这里处理选中,单选树,在ProTree组件里跟value比优先级处理,到这个组件里面是checkedValues了
|
|
83
82
|
if (checkable) {
|
|
84
83
|
setState({
|
|
85
84
|
currentClickTreeNode: selectedKey
|
|
@@ -87,211 +86,166 @@ function List(props) {
|
|
|
87
86
|
}
|
|
88
87
|
}, [selectedKey]);
|
|
89
88
|
const onSelect = async (value, item) => {
|
|
89
|
+
var _a2;
|
|
90
90
|
if (handing) {
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
93
|
let val = value;
|
|
94
94
|
if (!isRadioSelect && value === currentClickTreeNode) {
|
|
95
|
-
|
|
96
|
-
val = '';
|
|
95
|
+
val = "";
|
|
97
96
|
}
|
|
98
97
|
setState({
|
|
99
98
|
currentClickTreeNode: val,
|
|
100
99
|
handing: true
|
|
101
100
|
});
|
|
102
|
-
await props
|
|
101
|
+
await ((_a2 = props == null ? void 0 : props.onSelect) == null ? void 0 : _a2.call(props, val, item));
|
|
103
102
|
setState({
|
|
104
103
|
handing: false
|
|
105
104
|
});
|
|
106
105
|
};
|
|
107
|
-
const TreeNodeRow =
|
|
108
|
-
const {
|
|
109
|
-
nodeClass,
|
|
110
|
-
item,
|
|
111
|
-
index,
|
|
112
|
-
title,
|
|
113
|
-
isChecked,
|
|
114
|
-
onlyKey
|
|
115
|
-
} = props;
|
|
106
|
+
const TreeNodeRow = (props2) => {
|
|
107
|
+
const { nodeClass, item, index, title, isChecked, onlyKey } = props2;
|
|
116
108
|
const [open, setOpen] = useState(false);
|
|
117
|
-
const operateButton = menu && menu(item
|
|
118
|
-
operateButton
|
|
119
|
-
return
|
|
120
|
-
children: item
|
|
121
|
-
}, i);
|
|
109
|
+
const operateButton = menu && menu(item == null ? void 0 : item[fieldNameValue], item);
|
|
110
|
+
operateButton == null ? void 0 : operateButton.map((item2, i) => {
|
|
111
|
+
return /* @__PURE__ */ jsx(React.Fragment, { children: item2 }, i);
|
|
122
112
|
});
|
|
123
113
|
const hide = () => {
|
|
124
114
|
setOpen(false);
|
|
125
115
|
};
|
|
126
|
-
const handleOpenChange = newOpen => {
|
|
116
|
+
const handleOpenChange = (newOpen) => {
|
|
127
117
|
setOpen(newOpen);
|
|
128
118
|
};
|
|
129
|
-
const expandIcon =
|
|
130
|
-
|
|
131
|
-
|
|
119
|
+
const expandIcon = /* @__PURE__ */ jsx("span", { className: "icon-item", children: /* @__PURE__ */ jsx(
|
|
120
|
+
"svg",
|
|
121
|
+
{
|
|
132
122
|
width: "1em",
|
|
133
123
|
height: "1em",
|
|
134
124
|
viewBox: "0 0 16 16",
|
|
135
125
|
version: "1.1",
|
|
136
126
|
className: "icon-item svg-icon-expand",
|
|
137
|
-
children:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
fill: "none",
|
|
142
|
-
fillRule: "evenodd",
|
|
143
|
-
children: /*#__PURE__*/_jsx("g", {
|
|
144
|
-
id: "\u6811\u7ED3\u6784\u4EA4\u4E92",
|
|
127
|
+
children: /* @__PURE__ */ jsx("g", { id: "树结构", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ jsx(
|
|
128
|
+
"g",
|
|
129
|
+
{
|
|
130
|
+
id: "树结构交互",
|
|
145
131
|
transform: "translate(-2285.000000, -2413.000000)",
|
|
146
132
|
fill: "currentColor",
|
|
147
|
-
children:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
transform: "translate(220.000000, 2.000000)",
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
y: "0",
|
|
160
|
-
width: "2",
|
|
161
|
-
height: "2"
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
width: "2",
|
|
183
|
-
height: "2"
|
|
184
|
-
}), /*#__PURE__*/_jsx("rect", {
|
|
185
|
-
id: "\u77E9\u5F62\u5907\u4EFD-3",
|
|
186
|
-
x: "0",
|
|
187
|
-
y: "4",
|
|
188
|
-
width: "2",
|
|
189
|
-
height: "2"
|
|
190
|
-
}), /*#__PURE__*/_jsx("rect", {
|
|
191
|
-
id: "\u77E9\u5F62\u5907\u4EFD-4",
|
|
192
|
-
x: "0",
|
|
193
|
-
y: "8",
|
|
194
|
-
width: "2",
|
|
195
|
-
height: "2"
|
|
196
|
-
})]
|
|
197
|
-
})]
|
|
198
|
-
})
|
|
199
|
-
})
|
|
200
|
-
})
|
|
201
|
-
})
|
|
202
|
-
})
|
|
203
|
-
});
|
|
204
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
205
|
-
className: nodeClass,
|
|
206
|
-
onClick: e => {
|
|
207
|
-
e.stopPropagation();
|
|
208
|
-
onSelect(item?.[fieldNameValue], {
|
|
209
|
-
node: e?.target,
|
|
210
|
-
event: e,
|
|
211
|
-
item,
|
|
212
|
-
selected: !isChecked
|
|
213
|
-
});
|
|
214
|
-
},
|
|
215
|
-
children: [tags && tags.length ? /*#__PURE__*/_jsx("div", {
|
|
216
|
-
className: "pro-tree-tree-node-tag",
|
|
217
|
-
style: {
|
|
218
|
-
backgroundColor: tagsBgColors[index],
|
|
219
|
-
color: tagsColors[index]
|
|
133
|
+
children: /* @__PURE__ */ jsx(
|
|
134
|
+
"g",
|
|
135
|
+
{
|
|
136
|
+
id: "数据展示/树形控件/带连接线备份-3",
|
|
137
|
+
transform: "translate(2065.000000, 2411.000000)",
|
|
138
|
+
children: /* @__PURE__ */ jsxs("g", { id: "编组-4", transform: "translate(220.000000, 2.000000)", children: [
|
|
139
|
+
/* @__PURE__ */ jsxs("g", { id: "icon_more备份-9", transform: "translate(7.000000, 3.000000)", children: [
|
|
140
|
+
/* @__PURE__ */ jsx("rect", { id: "矩形", x: "0", y: "0", width: "2", height: "2" }),
|
|
141
|
+
/* @__PURE__ */ jsx("rect", { id: "矩形备份-3", x: "0", y: "4", width: "2", height: "2" }),
|
|
142
|
+
/* @__PURE__ */ jsx("rect", { id: "矩形备份-4", x: "0", y: "8", width: "2", height: "2" })
|
|
143
|
+
] }),
|
|
144
|
+
/* @__PURE__ */ jsxs("g", { id: "icon_more备份-9", transform: "translate(7.000000, 3.000000)", children: [
|
|
145
|
+
/* @__PURE__ */ jsx("rect", { id: "矩形", x: "0", y: "0", width: "2", height: "2" }),
|
|
146
|
+
/* @__PURE__ */ jsx("rect", { id: "矩形备份-3", x: "0", y: "4", width: "2", height: "2" }),
|
|
147
|
+
/* @__PURE__ */ jsx("rect", { id: "矩形备份-4", x: "0", y: "8", width: "2", height: "2" })
|
|
148
|
+
] })
|
|
149
|
+
] })
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
) })
|
|
154
|
+
}
|
|
155
|
+
) });
|
|
156
|
+
return /* @__PURE__ */ jsxs(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
className: nodeClass,
|
|
160
|
+
onClick: (e) => {
|
|
161
|
+
e.stopPropagation();
|
|
162
|
+
onSelect(item == null ? void 0 : item[fieldNameValue], {
|
|
163
|
+
node: e == null ? void 0 : e.target,
|
|
164
|
+
event: e,
|
|
165
|
+
item,
|
|
166
|
+
selected: !isChecked
|
|
167
|
+
});
|
|
220
168
|
},
|
|
221
|
-
children:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
...other
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
169
|
+
children: [
|
|
170
|
+
tags && tags.length ? /* @__PURE__ */ jsx(
|
|
171
|
+
"div",
|
|
172
|
+
{
|
|
173
|
+
className: "pro-tree-tree-node-tag",
|
|
174
|
+
style: { backgroundColor: tagsBgColors[index], color: tagsColors[index] },
|
|
175
|
+
children: /* @__PURE__ */ jsx("span", { children: tags[index] })
|
|
176
|
+
}
|
|
177
|
+
) : null,
|
|
178
|
+
/* @__PURE__ */ jsxs("div", { className: "tree-node-show-text", children: [
|
|
179
|
+
/* @__PURE__ */ jsx("div", { className: "tree-node-show-text-label", children: optionRender ? optionRender(item, searchStr) : /* @__PURE__ */ jsx(SearchTitle, { label: title, searchStr, ...other }) }),
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
"div",
|
|
182
|
+
{
|
|
183
|
+
className: "operate-tree-node-btns",
|
|
184
|
+
onClick: (e) => {
|
|
185
|
+
e.stopPropagation();
|
|
186
|
+
},
|
|
187
|
+
children: (operateButton == null ? void 0 : operateButton.length) > 1 ? /* @__PURE__ */ jsx(
|
|
188
|
+
Popover,
|
|
189
|
+
{
|
|
190
|
+
classNames: {
|
|
191
|
+
root: "pro-tree-operate-container"
|
|
192
|
+
},
|
|
193
|
+
content: /* @__PURE__ */ jsx("div", { className: "pro-tree-operate-btn-popover", onClick: hide, children: operateButton }),
|
|
194
|
+
trigger: "click",
|
|
195
|
+
open,
|
|
196
|
+
onOpenChange: handleOpenChange,
|
|
197
|
+
placement: "bottomRight",
|
|
198
|
+
children: expandIcon
|
|
199
|
+
}
|
|
200
|
+
) : operateButton
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
] }),
|
|
204
|
+
/* @__PURE__ */ jsx("div", { className: "brand-bg-opa-ten" })
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
onlyKey
|
|
208
|
+
);
|
|
258
209
|
};
|
|
259
210
|
function fn() {
|
|
260
211
|
const loop = (data, index) => {
|
|
261
212
|
index++;
|
|
262
|
-
const treeRow = data.map(item => {
|
|
263
|
-
let nodeClass =
|
|
213
|
+
const treeRow = data.map((item) => {
|
|
214
|
+
let nodeClass = "pro-tree-tree-node ";
|
|
264
215
|
let isChecked = false;
|
|
265
216
|
if (currentClickTreeNode === item[fieldNameValue]) {
|
|
266
|
-
nodeClass +=
|
|
217
|
+
nodeClass += " checked";
|
|
267
218
|
isChecked = true;
|
|
268
219
|
}
|
|
269
220
|
const title = showCodeName ? `${item[fieldNameValue]}-${item[fieldNameLabel]}` : item[fieldNameLabel];
|
|
270
|
-
const nodeTitle =
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
221
|
+
const nodeTitle = /* @__PURE__ */ jsx(
|
|
222
|
+
TreeNodeRow,
|
|
223
|
+
{
|
|
224
|
+
nodeClass,
|
|
225
|
+
item,
|
|
226
|
+
index,
|
|
227
|
+
title: (item == null ? void 0 : item.title) || title,
|
|
228
|
+
isChecked,
|
|
229
|
+
onlyKey: item[fieldNameValue]
|
|
230
|
+
}
|
|
231
|
+
);
|
|
278
232
|
if (item[fieldNames.children]) {
|
|
279
233
|
return {
|
|
280
234
|
...item,
|
|
281
235
|
title: nodeTitle,
|
|
282
|
-
key: item
|
|
236
|
+
key: (item == null ? void 0 : item.key) || item[fieldNameValue],
|
|
283
237
|
children: loop(item[fieldNames.children], index)
|
|
284
238
|
};
|
|
285
239
|
}
|
|
286
240
|
return {
|
|
287
241
|
...item,
|
|
288
242
|
title: nodeTitle,
|
|
289
|
-
key: item
|
|
243
|
+
key: (item == null ? void 0 : item.key) || item[fieldNameValue]
|
|
290
244
|
};
|
|
291
245
|
});
|
|
292
246
|
return treeRow;
|
|
293
247
|
};
|
|
294
|
-
if (other
|
|
248
|
+
if ((other == null ? void 0 : other.mode) === "view") {
|
|
295
249
|
return;
|
|
296
250
|
}
|
|
297
251
|
let newTreeData = originalTreeData;
|
|
@@ -315,31 +269,29 @@ function List(props) {
|
|
|
315
269
|
if (expandedKeys) {
|
|
316
270
|
additionProps.expandedKeys = expandedKeys;
|
|
317
271
|
}
|
|
318
|
-
return
|
|
319
|
-
|
|
320
|
-
|
|
272
|
+
return /* @__PURE__ */ jsx("div", { className: disabledMode === "hide" ? "hide-disable-node" : "", children: (_treeData == null ? void 0 : _treeData.length) ? /* @__PURE__ */ jsx(
|
|
273
|
+
Tree,
|
|
274
|
+
{
|
|
321
275
|
...others,
|
|
322
276
|
...additionProps,
|
|
323
|
-
disabled
|
|
324
|
-
style: {
|
|
325
|
-
width: '100%'
|
|
326
|
-
},
|
|
277
|
+
disabled,
|
|
278
|
+
style: { width: "100%" },
|
|
327
279
|
treeData: _treeData,
|
|
328
|
-
onExpand
|
|
329
|
-
autoExpandParent
|
|
280
|
+
onExpand,
|
|
281
|
+
autoExpandParent,
|
|
330
282
|
selectable: false,
|
|
331
|
-
onCheck
|
|
283
|
+
onCheck,
|
|
332
284
|
checkedKeys: checkedValues,
|
|
333
|
-
checkStrictly
|
|
334
|
-
showLine
|
|
335
|
-
switcherIcon
|
|
336
|
-
checkable
|
|
337
|
-
onSelect
|
|
285
|
+
checkStrictly,
|
|
286
|
+
showLine,
|
|
287
|
+
switcherIcon,
|
|
288
|
+
checkable,
|
|
289
|
+
onSelect,
|
|
338
290
|
blockNode: true
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
children: locale?.ProTree?.emptyTips
|
|
342
|
-
})
|
|
343
|
-
});
|
|
291
|
+
}
|
|
292
|
+
) : /* @__PURE__ */ jsx("div", { className: "empty-tree", children: (_b = (_a = locale) == null ? void 0 : _a.ProTree) == null ? void 0 : _b.emptyTips }) });
|
|
344
293
|
}
|
|
345
|
-
|
|
294
|
+
var Tree_default = List;
|
|
295
|
+
export {
|
|
296
|
+
Tree_default as default
|
|
297
|
+
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
1
|
+
import { default as default2 } from "./CloseIcon";
|
|
2
|
+
import { default as default3 } from "./SearchTitle";
|
|
3
|
+
import { default as default4 } from "./List";
|
|
4
|
+
import { default as default5 } from "./Tree";
|
|
5
|
+
export {
|
|
6
|
+
default2 as CloseIcon,
|
|
7
|
+
default4 as ListView,
|
|
8
|
+
default3 as SearchTitle,
|
|
9
|
+
default5 as TreeView
|
|
10
|
+
};
|
package/es/ProTree/index.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
1
2
|
import ProTree from "./components/ProTree";
|
|
2
3
|
import ProTreeSelect from "./components/ProTreeSelect";
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
mode = 'tree'
|
|
7
|
-
} = props;
|
|
8
|
-
if (mode === 'treeSelect') {
|
|
4
|
+
const ProTreeHandle = (props) => {
|
|
5
|
+
const { mode = "tree" } = props;
|
|
6
|
+
if (mode === "treeSelect") {
|
|
9
7
|
const adaptorProps = {
|
|
10
8
|
...props,
|
|
11
|
-
treeCheckable: props
|
|
12
|
-
treeCheckStrictly: props
|
|
9
|
+
treeCheckable: props == null ? void 0 : props.checkable,
|
|
10
|
+
treeCheckStrictly: props == null ? void 0 : props.checkStrictly
|
|
13
11
|
};
|
|
14
|
-
return
|
|
15
|
-
...adaptorProps
|
|
16
|
-
});
|
|
12
|
+
return /* @__PURE__ */ jsx(ProTreeSelect, { ...adaptorProps });
|
|
17
13
|
}
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
return /* @__PURE__ */ jsx(ProTree, { ...props, checkedValues: props == null ? void 0 : props.checkedKeys });
|
|
15
|
+
};
|
|
16
|
+
var ProTree_default = ProTreeHandle;
|
|
17
|
+
export {
|
|
18
|
+
ProTree_default as default
|
|
22
19
|
};
|
|
23
|
-
export default ProTreeHandle;
|
package/es/ProTree/propsType.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|