@zat-design/sisyphus-react 3.1.4 → 3.1.5-beta.10
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/.dumi/theme/builtins/Alert.tsx +19 -0
- package/.dumi/theme/builtins/Previewer.tsx +232 -0
- package/.dumi/theme/builtins/SourceCode.tsx +64 -0
- package/.dumi/theme/hooks/useCodeSandbox.tsx +197 -0
- package/.dumi/theme/hooks/useTheme.tsx +707 -0
- package/.dumi/theme/layouts/BasicLayout.tsx +88 -0
- package/.dumi/theme/layouts/components/Dark.less +157 -0
- package/.dumi/theme/layouts/components/Dark.tsx +78 -0
- package/.dumi/theme/layouts/components/Navbar.tsx +83 -0
- package/.dumi/theme/layouts/components/SideMenu.tsx +61 -0
- package/.dumi/theme/layouts/index.tsx +26 -0
- package/.dumi/theme/layouts/layout.less +87 -0
- package/.dumi/theme/typings.d.ts +7 -0
- package/dist/index.esm.css +122 -249
- package/es/ProAction/index.less +3 -2
- package/es/ProConfigProvider/index.d.ts +2 -0
- package/es/ProConfigProvider/index.js +18 -2
- package/es/ProDrawerForm/index.js +5 -3
- package/es/ProDrawerForm/style/index.less +15 -11
- package/es/ProEditLabel/style/index.less +2 -2
- package/es/ProEditTable/style/index.less +15 -8
- package/es/ProEditTable/utils/config.js +11 -4
- package/es/ProEnum/style/index.less +1 -1
- package/es/ProForm/components/base/RangePicker/index.js +0 -3
- package/es/ProForm/components/base/TextArea/index.less +1 -1
- package/es/ProForm/components/combination/Container/style/index.less +0 -1
- package/es/ProForm/components/combination/FormList/style/index.less +20 -19
- package/es/ProForm/components/combination/Group/index.js +2 -2
- package/es/ProForm/components/combination/ProAddressBar/index.js +81 -61
- package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProModalSelect/index.js +75 -13
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/es/ProForm/components/render/RenderFields.js +10 -5
- package/es/ProForm/components/render/propsType.d.ts +5 -4
- package/es/ProForm/index.js +5 -0
- package/es/ProForm/style/index.less +55 -169
- package/es/ProForm/utils/useShouldUpdate.js +16 -16
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +2 -2
- package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/es/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/es/ProLayout/components/ProHeader/components/index.js +2 -1
- package/es/ProLayout/components/ProHeader/index.js +4 -2
- package/es/ProLayout/components/ProHeader/style/index.less +16 -7
- package/es/ProStep/style/index.less +0 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/es/ProTable/components/RenderColumn/index.js +41 -25
- package/es/ProTable/index.js +3 -2
- package/es/ProTable/propsType.d.ts +2 -0
- package/es/ProTable/style/index.less +14 -1
- package/es/ProTable/utils.d.ts +1 -1
- package/es/ProTable/utils.js +258 -201
- package/es/ProTabs/style/index.less +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +1 -1
- package/es/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/es/ProThemeTools/index.d.ts +2 -2
- package/es/ProThemeTools/index.js +24 -17
- package/es/ProThemeTools/propsType.d.ts +8 -6
- package/es/ProThemeTools/style/index.less +2 -2
- package/es/ProThemeTools/utils/index.d.ts +7 -0
- package/es/ProThemeTools/utils/index.js +19 -1
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/SearchTitle.d.ts +2 -2
- package/es/ProTree/components/SearchTitle.js +11 -1
- package/es/ProTree/components/Tree.js +6 -1
- package/es/ProTree/style/index.less +193 -141
- package/es/ProTreeModal/style/index.less +2 -6
- package/es/ProUpload/style/index.less +41 -39
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/locale/en_US.d.ts +69 -0
- package/es/locale/en_US.js +68 -0
- package/es/locale/index.d.ts +7 -0
- package/es/locale/index.js +21 -0
- package/es/locale/zh_CN.d.ts +69 -0
- package/es/locale/zh_CN.js +68 -0
- package/es/old/ProEditableTable/style/index.less +1 -2
- package/es/style/components.less +0 -1
- package/es/style/core/normalize.less +1 -1
- package/es/style/theme/antd.less +3 -4
- package/es/style/theme/index.less +80 -79
- package/es/style/theme/tokens.less +1 -0
- package/lib/ProAction/index.less +3 -2
- package/lib/ProConfigProvider/index.d.ts +2 -0
- package/lib/ProConfigProvider/index.js +17 -2
- package/lib/ProDrawerForm/index.js +5 -3
- package/lib/ProDrawerForm/style/index.less +15 -11
- package/lib/ProEditLabel/style/index.less +2 -2
- package/lib/ProEditTable/style/index.less +15 -8
- package/lib/ProEditTable/utils/config.js +11 -4
- package/lib/ProEnum/style/index.less +1 -1
- package/lib/ProForm/components/base/RangePicker/index.js +0 -3
- package/lib/ProForm/components/base/TextArea/index.less +1 -1
- package/lib/ProForm/components/combination/Container/style/index.less +0 -1
- package/lib/ProForm/components/combination/FormList/style/index.less +20 -19
- package/lib/ProForm/components/combination/Group/index.js +2 -2
- package/lib/ProForm/components/combination/ProAddressBar/index.js +76 -58
- package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +75 -13
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
- package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/lib/ProForm/components/render/RenderFields.js +9 -4
- package/lib/ProForm/components/render/propsType.d.ts +5 -4
- package/lib/ProForm/index.js +5 -0
- package/lib/ProForm/style/index.less +55 -169
- package/lib/ProForm/utils/useShouldUpdate.js +16 -16
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +2 -2
- package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/lib/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/lib/ProLayout/components/ProHeader/components/index.js +8 -1
- package/lib/ProLayout/components/ProHeader/index.js +4 -2
- package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
- package/lib/ProStep/style/index.less +0 -1
- package/lib/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/lib/ProTable/components/RenderColumn/index.js +38 -24
- package/lib/ProTable/index.js +3 -2
- package/lib/ProTable/propsType.d.ts +2 -0
- package/lib/ProTable/style/index.less +14 -1
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +258 -201
- package/lib/ProTabs/style/index.less +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +1 -1
- package/lib/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/lib/ProThemeTools/index.d.ts +2 -2
- package/lib/ProThemeTools/index.js +23 -16
- package/lib/ProThemeTools/propsType.d.ts +8 -6
- package/lib/ProThemeTools/style/index.less +2 -2
- package/lib/ProThemeTools/utils/index.d.ts +7 -0
- package/lib/ProThemeTools/utils/index.js +20 -2
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/SearchTitle.d.ts +2 -2
- package/lib/ProTree/components/SearchTitle.js +11 -1
- package/lib/ProTree/components/Tree.js +6 -1
- package/lib/ProTree/style/index.less +193 -141
- package/lib/ProTreeModal/style/index.less +2 -6
- package/lib/ProUpload/style/index.less +41 -39
- package/lib/index.d.ts +2 -1
- package/lib/index.js +13 -1
- package/lib/locale/en_US.d.ts +69 -0
- package/lib/locale/en_US.js +74 -0
- package/lib/locale/index.d.ts +7 -0
- package/lib/locale/index.js +28 -0
- package/lib/locale/zh_CN.d.ts +69 -0
- package/lib/locale/zh_CN.js +74 -0
- package/lib/old/ProEditableTable/style/index.less +1 -2
- package/lib/style/components.less +0 -1
- package/lib/style/core/normalize.less +1 -1
- package/lib/style/theme/antd.less +3 -4
- package/lib/style/theme/index.less +80 -79
- package/lib/style/theme/tokens.less +1 -0
- package/package.json +2 -2
- package/typings.d.ts +2 -0
- package/es/old/ProBackBtn/style/index.less +0 -19
- package/lib/old/ProBackBtn/style/index.less +0 -19
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
|
@@ -6,27 +6,27 @@ import _message from "antd/es/message";
|
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
7
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
8
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
9
|
-
var _excluded = ["size", "className", "cacheTime", "color", "mode", "
|
|
9
|
+
var _excluded = ["size", "className", "cacheTime", "color", "mode", "iconFollowTheme", "tableBorder", "tableStripe", "theme"];
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
/* eslint-disable prefer-const */
|
|
12
12
|
import { SettingOutlined } from '@ant-design/icons';
|
|
13
13
|
import { useEffect, useState } from 'react';
|
|
14
14
|
import classnames from 'classnames';
|
|
15
|
-
import { getKebabCase, setThemes, setTableNoStripe, setTableBorder } from './utils/index';
|
|
15
|
+
import { getKebabCase, setThemes, setTableNoStripe, setTableBorder, getMapKebabCase, getMapHumpCase } from './utils/index';
|
|
16
16
|
import { PrdTools } from './component';
|
|
17
17
|
var defaultCacheTime = 1; // 配置保存时间为一天
|
|
18
18
|
var defaultThemeConfig = {
|
|
19
19
|
zauiBrand: '#006AFF',
|
|
20
20
|
zauiText: '#343434',
|
|
21
|
-
zauiFontSize:
|
|
21
|
+
zauiFontSize: '14px',
|
|
22
22
|
zauiFormAlign: 'left',
|
|
23
23
|
zauiFormRequiredBefore: 'none',
|
|
24
24
|
zauiFormRequiredAfter: 'inline',
|
|
25
25
|
zauiSize: 1,
|
|
26
|
-
zauiSpaceSizeLg:
|
|
27
|
-
zauiSpaceSizeMd:
|
|
26
|
+
zauiSpaceSizeLg: '32px',
|
|
27
|
+
zauiSpaceSizeMd: '16px',
|
|
28
28
|
zauiBigText: false,
|
|
29
|
-
zauiBaseFontSize:
|
|
29
|
+
zauiBaseFontSize: '0px',
|
|
30
30
|
zauiTableBorder: false,
|
|
31
31
|
zauiStripe: true
|
|
32
32
|
};
|
|
@@ -36,17 +36,19 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
36
36
|
cacheTime = _ref.cacheTime,
|
|
37
37
|
color = _ref.color,
|
|
38
38
|
mode = _ref.mode,
|
|
39
|
-
|
|
39
|
+
iconFollowTheme = _ref.iconFollowTheme,
|
|
40
40
|
_ref$tableBorder = _ref.tableBorder,
|
|
41
41
|
tableBorder = _ref$tableBorder === void 0 ? false : _ref$tableBorder,
|
|
42
42
|
_ref$tableStripe = _ref.tableStripe,
|
|
43
43
|
tableStripe = _ref$tableStripe === void 0 ? false : _ref$tableStripe,
|
|
44
|
+
_ref$theme = _ref.theme,
|
|
45
|
+
theme = _ref$theme === void 0 ? {} : _ref$theme,
|
|
44
46
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
45
47
|
var _useState = useState(false),
|
|
46
48
|
_useState2 = _slicedToArray(_useState, 2),
|
|
47
49
|
visible = _useState2[0],
|
|
48
50
|
setVisible = _useState2[1];
|
|
49
|
-
var _useState3 = useState(_objectSpread({}, defaultThemeConfig)),
|
|
51
|
+
var _useState3 = useState(_objectSpread(_objectSpread({}, defaultThemeConfig), getMapHumpCase(theme))),
|
|
50
52
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
51
53
|
state = _useState4[0],
|
|
52
54
|
setState = _useState4[1];
|
|
@@ -80,9 +82,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
80
82
|
};
|
|
81
83
|
// 复制
|
|
82
84
|
var onCopy = function onCopy() {
|
|
83
|
-
var data = JSON.stringify(
|
|
84
|
-
return ["@".concat(getKebabCase(item === null || item === void 0 ? void 0 : item[0])), item === null || item === void 0 ? void 0 : item[1]];
|
|
85
|
-
})));
|
|
85
|
+
var data = JSON.stringify(getMapKebabCase(state, '@'));
|
|
86
86
|
var input = document.createElement('input');
|
|
87
87
|
document.body.appendChild(input);
|
|
88
88
|
input.setAttribute('value', data);
|
|
@@ -100,6 +100,10 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
100
100
|
var startTime = curThemeConfig === null || curThemeConfig === void 0 ? void 0 : curThemeConfig.startTime;
|
|
101
101
|
// 默认时间间隔
|
|
102
102
|
var duration = (typeof cacheTime === 'number' ? cacheTime : defaultCacheTime) * 86400000;
|
|
103
|
+
// antd4以下版本不支持主题色的动态配置
|
|
104
|
+
if (!_ConfigProvider.config) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
103
107
|
if (cacheTime && startTime && new Date().getTime() - startTime < duration) {
|
|
104
108
|
var _localThemeConfig;
|
|
105
109
|
var localThemeConfig;
|
|
@@ -111,15 +115,18 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
111
115
|
|
|
112
116
|
setState(_objectSpread(_objectSpread({}, state), localThemeConfig));
|
|
113
117
|
setThemes(cssVariables);
|
|
114
|
-
// antd4以下版本不支持主题色的动态配置
|
|
115
|
-
if (!_ConfigProvider.config) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
118
|
_ConfigProvider.config({
|
|
119
119
|
theme: {
|
|
120
120
|
primaryColor: (_localThemeConfig = localThemeConfig) === null || _localThemeConfig === void 0 ? void 0 : _localThemeConfig.zauiBrand
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
|
+
} else {
|
|
124
|
+
setThemes(getMapKebabCase(state));
|
|
125
|
+
_ConfigProvider.config({
|
|
126
|
+
theme: {
|
|
127
|
+
primaryColor: state === null || state === void 0 ? void 0 : state.zauiBrand
|
|
128
|
+
}
|
|
129
|
+
});
|
|
123
130
|
}
|
|
124
131
|
}, []);
|
|
125
132
|
// 主题色动态切换
|
|
@@ -156,7 +163,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
156
163
|
}, [state, cacheTime]);
|
|
157
164
|
var cls = classnames(_defineProperty({
|
|
158
165
|
'pro-theme-tools': true,
|
|
159
|
-
'pro-theme-tools-follow':
|
|
166
|
+
'pro-theme-tools-follow': iconFollowTheme
|
|
160
167
|
}, className, className));
|
|
161
168
|
return _jsxs("div", _objectSpread(_objectSpread({
|
|
162
169
|
className: cls
|
|
@@ -185,7 +192,7 @@ ProThemeTools.defaultProps = {
|
|
|
185
192
|
size: 24,
|
|
186
193
|
mode: 'prd',
|
|
187
194
|
color: '#343434',
|
|
188
|
-
|
|
195
|
+
iconFollowTheme: false,
|
|
189
196
|
cacheTime: false
|
|
190
197
|
};
|
|
191
198
|
ProThemeTools.setThemes = setThemes;
|
|
@@ -15,8 +15,10 @@ export interface ProThemeToolsProps {
|
|
|
15
15
|
color?: string;
|
|
16
16
|
mode?: 'dev' | 'prd';
|
|
17
17
|
cacheTime?: number | boolean;
|
|
18
|
-
/**
|
|
19
|
-
theme?:
|
|
18
|
+
/** 主题配置信息 */
|
|
19
|
+
theme?: any;
|
|
20
|
+
/** icon是否跟随主题色 */
|
|
21
|
+
iconFollowTheme?: boolean;
|
|
20
22
|
/** 是否有表格边框 */
|
|
21
23
|
tableBorder?: boolean;
|
|
22
24
|
/** 是否有斑马纹 */
|
|
@@ -26,18 +28,18 @@ export interface ProThemeToolsProps {
|
|
|
26
28
|
export interface LocalThemeConfigPropsType {
|
|
27
29
|
zauiBrand?: string;
|
|
28
30
|
zauiText?: string;
|
|
29
|
-
zauiFontSize?:
|
|
31
|
+
zauiFontSize?: string;
|
|
30
32
|
zauiFormAlign?: string;
|
|
31
33
|
zauiFormRequiredAfter?: string;
|
|
32
34
|
zauiFormRequiredBefore?: string;
|
|
33
35
|
zauiSize?: number;
|
|
34
|
-
zauiSpaceSizeLg?:
|
|
35
|
-
zauiSpaceSizeMd?:
|
|
36
|
+
zauiSpaceSizeLg?: string;
|
|
37
|
+
zauiSpaceSizeMd?: string;
|
|
36
38
|
/** 大字号模式 */
|
|
37
39
|
zauiBigText?: boolean;
|
|
38
40
|
/** 是否有表格边框 */
|
|
39
41
|
zauiTableBorder?: boolean;
|
|
40
42
|
/** 是否有斑马纹 */
|
|
41
43
|
zauiStripe?: boolean;
|
|
42
|
-
zauiBaseFontSize?:
|
|
44
|
+
zauiBaseFontSize?: string;
|
|
43
45
|
}
|
|
@@ -11,7 +11,14 @@ export declare const replaceObject: (themes: ThemesProps, themeMapping: ThemesPr
|
|
|
11
11
|
* 设置主题变量
|
|
12
12
|
*/
|
|
13
13
|
export declare const setThemes: (themes: ThemesProps, themeMapping?: ThemesProps) => boolean;
|
|
14
|
+
/** JS实现驼峰命名与横线命名的转换 */
|
|
14
15
|
export declare const getKebabCase: (str: string) => string;
|
|
16
|
+
/** JS实现对象驼峰命名与横线命名的转换 */
|
|
17
|
+
export declare const getMapKebabCase: (obj: any, prefix?: string) => {
|
|
18
|
+
[k: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
/** JS实现对象横线命名与驼峰命名的转换 */
|
|
21
|
+
export declare const getMapHumpCase: (obj?: {}) => {};
|
|
15
22
|
/**
|
|
16
23
|
* 设置表格斑马纹
|
|
17
24
|
* @param stripe boolean
|
|
@@ -41,7 +41,7 @@ export var setThemes = function setThemes(themes, themeMapping) {
|
|
|
41
41
|
document.documentElement.style.setProperty("--".concat(item[0]), item[1]);
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
/** JS实现驼峰命名与横线命名的转换 */
|
|
45
45
|
export var getKebabCase = function getKebabCase(str) {
|
|
46
46
|
var temp = str.replace(/[A-Z]/g, function (i) {
|
|
47
47
|
return "-".concat(i.toLowerCase());
|
|
@@ -52,6 +52,24 @@ export var getKebabCase = function getKebabCase(str) {
|
|
|
52
52
|
|
|
53
53
|
return temp;
|
|
54
54
|
};
|
|
55
|
+
/** JS实现对象驼峰命名与横线命名的转换 */
|
|
56
|
+
export var getMapKebabCase = function getMapKebabCase(obj) {
|
|
57
|
+
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
58
|
+
return Object.fromEntries(Object.entries(obj).map(function (item) {
|
|
59
|
+
return ["".concat(prefix).concat(getKebabCase(item === null || item === void 0 ? void 0 : item[0])), item === null || item === void 0 ? void 0 : item[1]];
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
/** JS实现对象横线命名与驼峰命名的转换 */
|
|
63
|
+
export var getMapHumpCase = function getMapHumpCase() {
|
|
64
|
+
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
65
|
+
return Object.keys(obj).reduce(function (acc, key) {
|
|
66
|
+
var transformedKey = key.replace(/-(\w)/g, function (_, letter) {
|
|
67
|
+
return letter.toUpperCase();
|
|
68
|
+
});
|
|
69
|
+
acc[transformedKey] = obj[key];
|
|
70
|
+
return acc;
|
|
71
|
+
}, {});
|
|
72
|
+
};
|
|
55
73
|
/**
|
|
56
74
|
* 设置表格斑马纹
|
|
57
75
|
* @param stripe boolean
|
|
@@ -85,7 +85,7 @@ var ProTree = function ProTree(props) {
|
|
|
85
85
|
checkAll: false,
|
|
86
86
|
allKeys: [],
|
|
87
87
|
clickShowLoading: false,
|
|
88
|
-
innerExpandKeys:
|
|
88
|
+
innerExpandKeys: props === null || props === void 0 ? void 0 : props.expandedKeys
|
|
89
89
|
}),
|
|
90
90
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
91
91
|
state = _useSetState2[0],
|
|
@@ -30,9 +30,19 @@ function SearchTitle(props) {
|
|
|
30
30
|
style: style,
|
|
31
31
|
children: strTitle
|
|
32
32
|
});
|
|
33
|
+
var titleTips = index > -1 ? _jsxs("span", {
|
|
34
|
+
style: style,
|
|
35
|
+
children: [beforeStr, searchStr ? _jsx("span", {
|
|
36
|
+
className: "pro-tree-modal-search-value",
|
|
37
|
+
children: searchStr
|
|
38
|
+
}) : null, afterStr]
|
|
39
|
+
}) : _jsx("span", {
|
|
40
|
+
style: style,
|
|
41
|
+
children: strTitle
|
|
42
|
+
});
|
|
33
43
|
if (classEllipse) {
|
|
34
44
|
return _jsx(_Tooltip, {
|
|
35
|
-
title:
|
|
45
|
+
title: titleTips,
|
|
36
46
|
placement: "rightTop",
|
|
37
47
|
children: title
|
|
38
48
|
});
|
|
@@ -100,8 +100,13 @@ function List(props) {
|
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
}, [selectedKey]);
|
|
103
|
-
var onSelect = function onSelect(
|
|
103
|
+
var onSelect = function onSelect(value, item) {
|
|
104
104
|
var _props$onSelect;
|
|
105
|
+
var val = value;
|
|
106
|
+
if (value === currentClickTreeNode) {
|
|
107
|
+
// 如果当前点击了已经选中节点,那么取消选择
|
|
108
|
+
val = '';
|
|
109
|
+
}
|
|
105
110
|
setState({
|
|
106
111
|
currentClickTreeNode: val
|
|
107
112
|
});
|