@zat-design/sisyphus-react 3.1.5 → 3.2.0-beta.1
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 +176 -251
- package/es/ProAction/index.js +7 -5
- package/es/ProAction/index.less +3 -2
- package/es/ProConfigProvider/index.d.ts +2 -0
- package/es/ProConfigProvider/index.js +23 -2
- package/es/ProDownload/utils.js +6 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +6 -4
- 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/components/ActionButton/index.js +3 -2
- package/es/ProEditTable/components/RenderField/index.js +2 -1
- package/es/ProEditTable/index.js +7 -6
- package/es/ProEditTable/style/index.less +15 -8
- package/es/ProEditTable/utils/config.d.ts +8 -8
- package/es/ProEditTable/utils/config.js +20 -12
- package/es/ProEditTable/utils/index.js +3 -2
- package/es/ProEnum/hooks/useEnumRequest.js +17 -10
- package/es/ProEnum/index.js +9 -4
- package/es/ProEnum/style/index.less +1 -1
- package/es/ProForm/components/FormFooter/index.js +16 -20
- package/es/ProForm/components/base/Input/index.js +4 -3
- package/es/ProForm/components/base/InputNumber/index.js +4 -3
- package/es/ProForm/components/base/RangePicker/index.js +0 -3
- package/es/ProForm/components/base/Select/index.js +2 -1
- package/es/ProForm/components/base/Switch/index.js +9 -5
- package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -1
- package/es/ProForm/components/base/TextArea/index.js +4 -2
- 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/components/ActionButton.js +13 -17
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -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 +83 -63
- package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProModalSelect/index.js +76 -15
- 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/index.js +3 -2
- 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/ProRangeLimit/index.js +3 -7
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -11
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/es/ProForm/components/render/Render.js +4 -2
- package/es/ProForm/components/render/RenderFields.js +10 -6
- package/es/ProForm/components/render/propsType.d.ts +5 -4
- package/es/ProForm/index.js +14 -2
- package/es/ProForm/style/index.less +77 -169
- package/es/ProForm/utils/index.d.ts +1 -1
- package/es/ProForm/utils/index.js +7 -2
- package/es/ProForm/utils/rulesCreator.js +2 -1
- package/es/ProForm/utils/useRules.js +4 -3
- package/es/ProForm/utils/useShouldUpdate.js +16 -16
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
- package/es/ProLayout/components/Layout/Notice/index.js +3 -2
- package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
- package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +2 -1
- 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 +9 -6
- package/es/ProLayout/components/ProHeader/style/index.less +16 -7
- package/es/ProLayout/utils/index.js +1 -1
- package/es/ProSelect/index.d.ts +3 -3
- package/es/ProSelect/index.js +4 -2
- package/es/ProStep/components/Step/index.js +3 -1
- 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 +10 -8
- package/es/ProTable/propsType.d.ts +2 -0
- package/es/ProTable/style/index.less +14 -1
- package/es/ProTable/useAntdTable.d.ts +12 -4
- package/es/ProTable/useAntdTable.js +18 -6
- 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 +6 -5
- package/es/ProTree/components/SearchTitle.d.ts +2 -2
- package/es/ProTree/components/SearchTitle.js +11 -1
- package/es/ProTree/components/Tree.js +9 -2
- package/es/ProTree/style/index.less +193 -141
- package/es/ProTreeModal/components/List.js +0 -14
- package/es/ProTreeModal/components/Trigger.js +9 -3
- package/es/ProTreeModal/index.js +29 -13
- package/es/ProTreeModal/style/index.less +2 -6
- package/es/ProUpload/components/ButtonRender.js +5 -2
- package/es/ProUpload/components/DragRender.js +8 -8
- package/es/ProUpload/components/Example.js +3 -1
- package/es/ProUpload/components/ImageRender.js +8 -6
- package/es/ProUpload/index.js +8 -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 +138 -0
- package/es/locale/en_US.js +137 -0
- package/es/locale/index.d.ts +13 -0
- package/es/locale/index.js +32 -0
- package/es/locale/zh_CN.d.ts +137 -0
- package/es/locale/zh_CN.js +136 -0
- package/es/old/ProEditableTable/style/index.less +1 -2
- package/es/style/components.less +0 -1
- package/es/style/core/normalize.less +1 -2
- 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.js +7 -5
- package/lib/ProAction/index.less +3 -2
- package/lib/ProConfigProvider/index.d.ts +2 -0
- package/lib/ProConfigProvider/index.js +22 -2
- package/lib/ProDownload/utils.js +4 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +6 -4
- 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/components/ActionButton/index.js +3 -2
- package/lib/ProEditTable/components/RenderField/index.js +4 -1
- package/lib/ProEditTable/index.js +7 -6
- package/lib/ProEditTable/style/index.less +15 -8
- package/lib/ProEditTable/utils/config.d.ts +8 -8
- package/lib/ProEditTable/utils/config.js +20 -12
- package/lib/ProEditTable/utils/index.js +3 -2
- package/lib/ProEnum/hooks/useEnumRequest.js +17 -10
- package/lib/ProEnum/index.js +9 -4
- package/lib/ProEnum/style/index.less +1 -1
- package/lib/ProForm/components/FormFooter/index.js +16 -19
- package/lib/ProForm/components/base/Input/index.js +4 -3
- package/lib/ProForm/components/base/InputNumber/index.js +4 -3
- package/lib/ProForm/components/base/RangePicker/index.js +1 -4
- package/lib/ProForm/components/base/Select/index.js +2 -1
- package/lib/ProForm/components/base/Switch/index.js +8 -5
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -1
- package/lib/ProForm/components/base/TextArea/index.js +4 -2
- 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/components/ActionButton.js +13 -17
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -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 +78 -60
- package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +76 -15
- 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/index.js +3 -2
- 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/ProRangeLimit/index.js +3 -7
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -11
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
- package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/lib/ProForm/components/old/InputRange/index.js +0 -1
- package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
- package/lib/ProForm/components/render/Render.js +5 -2
- package/lib/ProForm/components/render/RenderFields.js +9 -5
- package/lib/ProForm/components/render/propsType.d.ts +5 -4
- package/lib/ProForm/index.js +14 -2
- package/lib/ProForm/style/index.less +77 -169
- package/lib/ProForm/utils/index.d.ts +1 -1
- package/lib/ProForm/utils/index.js +7 -2
- package/lib/ProForm/utils/rulesCreator.js +2 -1
- package/lib/ProForm/utils/useRules.js +4 -3
- package/lib/ProForm/utils/useShouldUpdate.js +16 -16
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
- package/lib/ProLayout/components/Layout/Notice/index.js +3 -2
- package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
- package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +3 -1
- 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 +9 -6
- package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
- package/lib/ProLayout/utils/index.js +1 -1
- package/lib/ProSelect/index.d.ts +3 -3
- package/lib/ProSelect/index.js +4 -2
- package/lib/ProStep/components/Step/index.js +3 -1
- 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/components/TableResizable/index.js +8 -0
- package/lib/ProTable/index.js +10 -8
- package/lib/ProTable/propsType.d.ts +2 -0
- package/lib/ProTable/style/index.less +14 -1
- package/lib/ProTable/useAntdTable.d.ts +12 -4
- package/lib/ProTable/useAntdTable.js +19 -6
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +258 -201
- package/lib/ProTabs/index.js +1 -0
- 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 +24 -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 +6 -5
- package/lib/ProTree/components/SearchTitle.d.ts +2 -2
- package/lib/ProTree/components/SearchTitle.js +11 -1
- package/lib/ProTree/components/Tree.js +16 -2
- package/lib/ProTree/index.js +0 -1
- package/lib/ProTree/style/index.less +193 -141
- package/lib/ProTreeModal/components/List.js +0 -14
- package/lib/ProTreeModal/components/Tree.js +1 -0
- package/lib/ProTreeModal/components/Trigger.js +10 -3
- package/lib/ProTreeModal/index.js +29 -13
- package/lib/ProTreeModal/style/index.less +2 -6
- package/lib/ProUpload/components/ButtonRender.js +5 -2
- package/lib/ProUpload/components/DragRender.js +8 -8
- package/lib/ProUpload/components/Example.js +3 -1
- package/lib/ProUpload/components/ImageRender.js +8 -6
- package/lib/ProUpload/index.js +14 -5
- 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 +138 -0
- package/lib/locale/en_US.js +143 -0
- package/lib/locale/index.d.ts +13 -0
- package/lib/locale/index.js +41 -0
- package/lib/locale/zh_CN.d.ts +137 -0
- package/lib/locale/zh_CN.js +142 -0
- package/lib/old/ProCertValidity/index.js +1 -1
- package/lib/old/ProEditableTable/style/index.less +1 -2
- package/lib/style/components.less +0 -1
- package/lib/style/core/normalize.less +1 -2
- 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 +1 -1
- 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/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/propsType.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
width : 4px;
|
|
30
30
|
height : 14px;
|
|
31
31
|
background : var(--zaui-brand, #006aff);
|
|
32
|
-
border-radius: 2px;
|
|
32
|
+
border-radius: var(zaui-border-radius-card, 2px);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
margin-right : 34px;
|
|
50
50
|
|
|
51
51
|
span {
|
|
52
|
-
font-size : 14px;
|
|
52
|
+
font-size : var(--zaui-font-size, 14px);
|
|
53
53
|
vertical-align: -7px;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
left : 4px;
|
|
146
146
|
z-index : 1;
|
|
147
147
|
color : var(--zaui-text, #343434);
|
|
148
|
-
font-size: 16px;
|
|
148
|
+
font-size: var(--zaui-font-size-lg, 16px);
|
|
149
149
|
transform: translateZ(100px);
|
|
150
150
|
|
|
151
151
|
&:hover {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ProThemeToolsProps } from './propsType';
|
|
2
2
|
declare const ProThemeTools: {
|
|
3
|
-
({ size, className, cacheTime, color, mode,
|
|
3
|
+
({ size, className, cacheTime, color, mode, iconFollowTheme, tableBorder, tableStripe, theme, ...props }: ProThemeToolsProps): JSX.Element;
|
|
4
4
|
defaultProps: {
|
|
5
5
|
size: number;
|
|
6
6
|
mode: string;
|
|
7
7
|
color: string;
|
|
8
|
-
|
|
8
|
+
iconFollowTheme: boolean;
|
|
9
9
|
cacheTime: boolean;
|
|
10
10
|
};
|
|
11
11
|
setThemes: (themes: import("./utils/index").ThemesProps, themeMapping?: import("./utils/index").ThemesProps) => boolean;
|
|
@@ -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
|
|
@@ -22,11 +22,12 @@ import { cloneDeep, isFunction } from 'lodash';
|
|
|
22
22
|
import { ReactSVG } from 'react-svg';
|
|
23
23
|
import { useProConfig } from '../../ProConfigProvider';
|
|
24
24
|
import { TreeView } from './index';
|
|
25
|
+
import locale from '../../locale';
|
|
25
26
|
import { getFlatTreeData, getChildrenKeys, findTreeNodeByKey, getAllKeys } from '../utils';
|
|
26
27
|
import searchSVG from '../../assets/input-search.svg';
|
|
27
28
|
import '../style/index.less';
|
|
28
29
|
var ProTree = function ProTree(props) {
|
|
29
|
-
var _props$otherProps, _props$otherProps2, _state$innerExpandKey2, _state$innerExpandKey3;
|
|
30
|
+
var _props$otherProps, _props$otherProps2, _locale$ProTree, _state$innerExpandKey2, _state$innerExpandKey3, _locale$ProTree2, _locale$ProTree3, _locale$ProTree4;
|
|
30
31
|
var _useProConfig = useProConfig('ProEnum'),
|
|
31
32
|
_useProConfig$dics = _useProConfig.dics,
|
|
32
33
|
dics = _useProConfig$dics === void 0 ? {} : _useProConfig$dics;
|
|
@@ -85,7 +86,7 @@ var ProTree = function ProTree(props) {
|
|
|
85
86
|
checkAll: false,
|
|
86
87
|
allKeys: [],
|
|
87
88
|
clickShowLoading: false,
|
|
88
|
-
innerExpandKeys:
|
|
89
|
+
innerExpandKeys: props === null || props === void 0 ? void 0 : props.expandedKeys
|
|
89
90
|
}),
|
|
90
91
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
91
92
|
state = _useSetState2[0],
|
|
@@ -388,7 +389,7 @@ var ProTree = function ProTree(props) {
|
|
|
388
389
|
disabled: disabled,
|
|
389
390
|
allowClear: true,
|
|
390
391
|
value: state.searchStr,
|
|
391
|
-
placeholder: placeholder ||
|
|
392
|
+
placeholder: placeholder || (locale === null || locale === void 0 ? void 0 : (_locale$ProTree = locale.ProTree) === null || _locale$ProTree === void 0 ? void 0 : _locale$ProTree.inputPlaceholder),
|
|
392
393
|
className: "pro-tree-search",
|
|
393
394
|
onChange: onSearch,
|
|
394
395
|
prefix: _jsx(ReactSVG, {
|
|
@@ -406,7 +407,7 @@ var ProTree = function ProTree(props) {
|
|
|
406
407
|
children: [_jsx("div", {
|
|
407
408
|
className: "expand-icon",
|
|
408
409
|
children: _jsx(CaretDownOutlined, {})
|
|
409
|
-
}), (state === null || state === void 0 ? void 0 : (_state$innerExpandKey3 = state.innerExpandKeys) === null || _state$innerExpandKey3 === void 0 ? void 0 : _state$innerExpandKey3.length) ?
|
|
410
|
+
}), (state === null || state === void 0 ? void 0 : (_state$innerExpandKey3 = state.innerExpandKeys) === null || _state$innerExpandKey3 === void 0 ? void 0 : _state$innerExpandKey3.length) ? locale === null || locale === void 0 ? void 0 : (_locale$ProTree2 = locale.ProTree) === null || _locale$ProTree2 === void 0 ? void 0 : _locale$ProTree2.unExpand : locale === null || locale === void 0 ? void 0 : (_locale$ProTree3 = locale.ProTree) === null || _locale$ProTree3 === void 0 ? void 0 : _locale$ProTree3.expand]
|
|
410
411
|
})]
|
|
411
412
|
})]
|
|
412
413
|
}), _jsx("div", {
|
|
@@ -435,7 +436,7 @@ var ProTree = function ProTree(props) {
|
|
|
435
436
|
checked: state.checkAll,
|
|
436
437
|
disabled: disabled,
|
|
437
438
|
onChange: handleAllCheck,
|
|
438
|
-
children:
|
|
439
|
+
children: locale === null || locale === void 0 ? void 0 : (_locale$ProTree4 = locale.ProTree) === null || _locale$ProTree4 === void 0 ? void 0 : _locale$ProTree4.all
|
|
439
440
|
}) : null
|
|
440
441
|
}), footer]
|
|
441
442
|
})]
|
|
@@ -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
|
});
|
|
@@ -19,9 +19,11 @@ import { useSetState } from 'ahooks';
|
|
|
19
19
|
import { CaretDownOutlined } from '@ant-design/icons';
|
|
20
20
|
import SearchTitle from './SearchTitle';
|
|
21
21
|
import { filterCheckedNodes, getParentKey } from '../utils';
|
|
22
|
+
import locale from '../../locale';
|
|
22
23
|
var tagsBgColors = ['rgba(0, 106, 255,0.16)', 'rgba(0, 196, 74,0.16)', 'rgba(255, 140, 0,0.16)', 'rgba(255, 80, 80,0.16)', 'rgba(97, 97, 97, 0.16)'];
|
|
23
24
|
var tagsColors = ['#006AFF', '#00C44A', '#FF8C00', '#FF5050', '#616161'];
|
|
24
25
|
function List(props) {
|
|
26
|
+
var _locale$ProTree;
|
|
25
27
|
var checkedValues = props.checkedValues,
|
|
26
28
|
disabled = props.disabled,
|
|
27
29
|
searchStr = props.searchStr,
|
|
@@ -100,8 +102,13 @@ function List(props) {
|
|
|
100
102
|
});
|
|
101
103
|
}
|
|
102
104
|
}, [selectedKey]);
|
|
103
|
-
var onSelect = function onSelect(
|
|
105
|
+
var onSelect = function onSelect(value, item) {
|
|
104
106
|
var _props$onSelect;
|
|
107
|
+
var val = value;
|
|
108
|
+
if (value === currentClickTreeNode) {
|
|
109
|
+
// 如果当前点击了已经选中节点,那么取消选择
|
|
110
|
+
val = '';
|
|
111
|
+
}
|
|
105
112
|
setState({
|
|
106
113
|
currentClickTreeNode: val
|
|
107
114
|
});
|
|
@@ -337,7 +344,7 @@ function List(props) {
|
|
|
337
344
|
blockNode: true
|
|
338
345
|
})) : _jsx("div", {
|
|
339
346
|
className: "empty-tree",
|
|
340
|
-
children:
|
|
347
|
+
children: locale === null || locale === void 0 ? void 0 : (_locale$ProTree = locale.ProTree) === null || _locale$ProTree === void 0 ? void 0 : _locale$ProTree.emptyTips
|
|
341
348
|
})
|
|
342
349
|
});
|
|
343
350
|
}
|