@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
|
@@ -16,21 +16,21 @@ var _react = require("react");
|
|
|
16
16
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
17
17
|
var _index = require("./utils/index");
|
|
18
18
|
var _component = require("./component");
|
|
19
|
-
var _excluded = ["size", "className", "cacheTime", "color", "mode", "
|
|
19
|
+
var _excluded = ["size", "className", "cacheTime", "color", "mode", "iconFollowTheme", "tableBorder", "tableStripe", "theme"];
|
|
20
20
|
/* eslint-disable prefer-const */
|
|
21
21
|
var defaultCacheTime = 1; // 配置保存时间为一天
|
|
22
22
|
var defaultThemeConfig = {
|
|
23
23
|
zauiBrand: '#006AFF',
|
|
24
24
|
zauiText: '#343434',
|
|
25
|
-
zauiFontSize:
|
|
25
|
+
zauiFontSize: '14px',
|
|
26
26
|
zauiFormAlign: 'left',
|
|
27
27
|
zauiFormRequiredBefore: 'none',
|
|
28
28
|
zauiFormRequiredAfter: 'inline',
|
|
29
29
|
zauiSize: 1,
|
|
30
|
-
zauiSpaceSizeLg:
|
|
31
|
-
zauiSpaceSizeMd:
|
|
30
|
+
zauiSpaceSizeLg: '32px',
|
|
31
|
+
zauiSpaceSizeMd: '16px',
|
|
32
32
|
zauiBigText: false,
|
|
33
|
-
zauiBaseFontSize:
|
|
33
|
+
zauiBaseFontSize: '0px',
|
|
34
34
|
zauiTableBorder: false,
|
|
35
35
|
zauiStripe: true
|
|
36
36
|
};
|
|
@@ -40,17 +40,19 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
40
40
|
cacheTime = _ref.cacheTime,
|
|
41
41
|
color = _ref.color,
|
|
42
42
|
mode = _ref.mode,
|
|
43
|
-
|
|
43
|
+
iconFollowTheme = _ref.iconFollowTheme,
|
|
44
44
|
_ref$tableBorder = _ref.tableBorder,
|
|
45
45
|
tableBorder = _ref$tableBorder === void 0 ? false : _ref$tableBorder,
|
|
46
46
|
_ref$tableStripe = _ref.tableStripe,
|
|
47
47
|
tableStripe = _ref$tableStripe === void 0 ? false : _ref$tableStripe,
|
|
48
|
+
_ref$theme = _ref.theme,
|
|
49
|
+
theme = _ref$theme === void 0 ? {} : _ref$theme,
|
|
48
50
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
49
51
|
var _useState = (0, _react.useState)(false),
|
|
50
52
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
51
53
|
visible = _useState2[0],
|
|
52
54
|
setVisible = _useState2[1];
|
|
53
|
-
var _useState3 = (0, _react.useState)((0, _objectSpread2.default)({}, defaultThemeConfig)),
|
|
55
|
+
var _useState3 = (0, _react.useState)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultThemeConfig), (0, _index.getMapHumpCase)(theme))),
|
|
54
56
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
55
57
|
state = _useState4[0],
|
|
56
58
|
setState = _useState4[1];
|
|
@@ -84,9 +86,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
84
86
|
};
|
|
85
87
|
// 复制
|
|
86
88
|
var onCopy = function onCopy() {
|
|
87
|
-
var data = JSON.stringify(
|
|
88
|
-
return ["@".concat((0, _index.getKebabCase)(item === null || item === void 0 ? void 0 : item[0])), item === null || item === void 0 ? void 0 : item[1]];
|
|
89
|
-
})));
|
|
89
|
+
var data = JSON.stringify((0, _index.getMapKebabCase)(state, '@'));
|
|
90
90
|
var input = document.createElement('input');
|
|
91
91
|
document.body.appendChild(input);
|
|
92
92
|
input.setAttribute('value', data);
|
|
@@ -104,6 +104,10 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
104
104
|
var startTime = curThemeConfig === null || curThemeConfig === void 0 ? void 0 : curThemeConfig.startTime;
|
|
105
105
|
// 默认时间间隔
|
|
106
106
|
var duration = (typeof cacheTime === 'number' ? cacheTime : defaultCacheTime) * 86400000;
|
|
107
|
+
// antd4以下版本不支持主题色的动态配置
|
|
108
|
+
if (!_antd.ConfigProvider.config) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
107
111
|
if (cacheTime && startTime && new Date().getTime() - startTime < duration) {
|
|
108
112
|
var _localThemeConfig;
|
|
109
113
|
var localThemeConfig;
|
|
@@ -115,15 +119,18 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
115
119
|
|
|
116
120
|
setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), localThemeConfig));
|
|
117
121
|
(0, _index.setThemes)(cssVariables);
|
|
118
|
-
// antd4以下版本不支持主题色的动态配置
|
|
119
|
-
if (!_antd.ConfigProvider.config) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
122
|
_antd.ConfigProvider.config({
|
|
123
123
|
theme: {
|
|
124
124
|
primaryColor: (_localThemeConfig = localThemeConfig) === null || _localThemeConfig === void 0 ? void 0 : _localThemeConfig.zauiBrand
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
|
+
} else {
|
|
128
|
+
(0, _index.setThemes)((0, _index.getMapKebabCase)(state));
|
|
129
|
+
_antd.ConfigProvider.config({
|
|
130
|
+
theme: {
|
|
131
|
+
primaryColor: state === null || state === void 0 ? void 0 : state.zauiBrand
|
|
132
|
+
}
|
|
133
|
+
});
|
|
127
134
|
}
|
|
128
135
|
}, []);
|
|
129
136
|
// 主题色动态切换
|
|
@@ -160,7 +167,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
160
167
|
}, [state, cacheTime]);
|
|
161
168
|
var cls = (0, _classnames2.default)((0, _defineProperty2.default)({
|
|
162
169
|
'pro-theme-tools': true,
|
|
163
|
-
'pro-theme-tools-follow':
|
|
170
|
+
'pro-theme-tools-follow': iconFollowTheme
|
|
164
171
|
}, className, className));
|
|
165
172
|
return (0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
166
173
|
className: cls
|
|
@@ -189,7 +196,7 @@ ProThemeTools.defaultProps = {
|
|
|
189
196
|
size: 24,
|
|
190
197
|
mode: 'prd',
|
|
191
198
|
color: '#343434',
|
|
192
|
-
|
|
199
|
+
iconFollowTheme: false,
|
|
193
200
|
cacheTime: false
|
|
194
201
|
};
|
|
195
202
|
ProThemeTools.setThemes = _index.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
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.setThemes = exports.setTableNoStripe = exports.setTableBorder = exports.replaceObject = exports.getKebabCase = void 0;
|
|
7
|
+
exports.setThemes = exports.setTableNoStripe = exports.setTableBorder = exports.replaceObject = exports.getMapKebabCase = exports.getMapHumpCase = exports.getKebabCase = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
/** 主题配置mapping */
|
|
@@ -47,7 +47,7 @@ var setThemes = exports.setThemes = function setThemes(themes, themeMapping) {
|
|
|
47
47
|
document.documentElement.style.setProperty("--".concat(item[0]), item[1]);
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
/** JS实现驼峰命名与横线命名的转换 */
|
|
51
51
|
var getKebabCase = exports.getKebabCase = function getKebabCase(str) {
|
|
52
52
|
var temp = str.replace(/[A-Z]/g, function (i) {
|
|
53
53
|
return "-".concat(i.toLowerCase());
|
|
@@ -58,6 +58,24 @@ var getKebabCase = exports.getKebabCase = function getKebabCase(str) {
|
|
|
58
58
|
|
|
59
59
|
return temp;
|
|
60
60
|
};
|
|
61
|
+
/** JS实现对象驼峰命名与横线命名的转换 */
|
|
62
|
+
var getMapKebabCase = exports.getMapKebabCase = function getMapKebabCase(obj) {
|
|
63
|
+
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
64
|
+
return Object.fromEntries(Object.entries(obj).map(function (item) {
|
|
65
|
+
return ["".concat(prefix).concat(getKebabCase(item === null || item === void 0 ? void 0 : item[0])), item === null || item === void 0 ? void 0 : item[1]];
|
|
66
|
+
}));
|
|
67
|
+
};
|
|
68
|
+
/** JS实现对象横线命名与驼峰命名的转换 */
|
|
69
|
+
var getMapHumpCase = exports.getMapHumpCase = function getMapHumpCase() {
|
|
70
|
+
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
71
|
+
return Object.keys(obj).reduce(function (acc, key) {
|
|
72
|
+
var transformedKey = key.replace(/-(\w)/g, function (_, letter) {
|
|
73
|
+
return letter.toUpperCase();
|
|
74
|
+
});
|
|
75
|
+
acc[transformedKey] = obj[key];
|
|
76
|
+
return acc;
|
|
77
|
+
}, {});
|
|
78
|
+
};
|
|
61
79
|
/**
|
|
62
80
|
* 设置表格斑马纹
|
|
63
81
|
* @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 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
91
91
|
state = _useSetState2[0],
|
|
@@ -35,9 +35,19 @@ function SearchTitle(props) {
|
|
|
35
35
|
style: style,
|
|
36
36
|
children: strTitle
|
|
37
37
|
});
|
|
38
|
+
var titleTips = index > -1 ? (0, _jsxRuntime.jsxs)("span", {
|
|
39
|
+
style: style,
|
|
40
|
+
children: [beforeStr, searchStr ? (0, _jsxRuntime.jsx)("span", {
|
|
41
|
+
className: "pro-tree-modal-search-value",
|
|
42
|
+
children: searchStr
|
|
43
|
+
}) : null, afterStr]
|
|
44
|
+
}) : (0, _jsxRuntime.jsx)("span", {
|
|
45
|
+
style: style,
|
|
46
|
+
children: strTitle
|
|
47
|
+
});
|
|
38
48
|
if (classEllipse) {
|
|
39
49
|
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
40
|
-
title:
|
|
50
|
+
title: titleTips,
|
|
41
51
|
placement: "rightTop",
|
|
42
52
|
children: title
|
|
43
53
|
});
|
|
@@ -105,8 +105,13 @@ function List(props) {
|
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
}, [selectedKey]);
|
|
108
|
-
var onSelect = function onSelect(
|
|
108
|
+
var onSelect = function onSelect(value, item) {
|
|
109
109
|
var _props$onSelect;
|
|
110
|
+
var val = value;
|
|
111
|
+
if (value === currentClickTreeNode) {
|
|
112
|
+
// 如果当前点击了已经选中节点,那么取消选择
|
|
113
|
+
val = '';
|
|
114
|
+
}
|
|
110
115
|
setState({
|
|
111
116
|
currentClickTreeNode: val
|
|
112
117
|
});
|