@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
|
@@ -16,20 +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
|
+
/* eslint-disable prefer-const */
|
|
20
21
|
var defaultCacheTime = 1; // 配置保存时间为一天
|
|
21
22
|
var defaultThemeConfig = {
|
|
22
23
|
zauiBrand: '#006AFF',
|
|
23
24
|
zauiText: '#343434',
|
|
24
|
-
zauiFontSize:
|
|
25
|
+
zauiFontSize: '14px',
|
|
25
26
|
zauiFormAlign: 'left',
|
|
26
27
|
zauiFormRequiredBefore: 'none',
|
|
27
28
|
zauiFormRequiredAfter: 'inline',
|
|
28
29
|
zauiSize: 1,
|
|
29
|
-
zauiSpaceSizeLg:
|
|
30
|
-
zauiSpaceSizeMd:
|
|
30
|
+
zauiSpaceSizeLg: '32px',
|
|
31
|
+
zauiSpaceSizeMd: '16px',
|
|
31
32
|
zauiBigText: false,
|
|
32
|
-
zauiBaseFontSize:
|
|
33
|
+
zauiBaseFontSize: '0px',
|
|
33
34
|
zauiTableBorder: false,
|
|
34
35
|
zauiStripe: true
|
|
35
36
|
};
|
|
@@ -39,17 +40,19 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
39
40
|
cacheTime = _ref.cacheTime,
|
|
40
41
|
color = _ref.color,
|
|
41
42
|
mode = _ref.mode,
|
|
42
|
-
|
|
43
|
+
iconFollowTheme = _ref.iconFollowTheme,
|
|
43
44
|
_ref$tableBorder = _ref.tableBorder,
|
|
44
45
|
tableBorder = _ref$tableBorder === void 0 ? false : _ref$tableBorder,
|
|
45
46
|
_ref$tableStripe = _ref.tableStripe,
|
|
46
47
|
tableStripe = _ref$tableStripe === void 0 ? false : _ref$tableStripe,
|
|
48
|
+
_ref$theme = _ref.theme,
|
|
49
|
+
theme = _ref$theme === void 0 ? {} : _ref$theme,
|
|
47
50
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
48
51
|
var _useState = (0, _react.useState)(false),
|
|
49
52
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
50
53
|
visible = _useState2[0],
|
|
51
54
|
setVisible = _useState2[1];
|
|
52
|
-
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))),
|
|
53
56
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
54
57
|
state = _useState4[0],
|
|
55
58
|
setState = _useState4[1];
|
|
@@ -83,9 +86,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
83
86
|
};
|
|
84
87
|
// 复制
|
|
85
88
|
var onCopy = function onCopy() {
|
|
86
|
-
var data = JSON.stringify(
|
|
87
|
-
return ["@".concat((0, _index.getKebabCase)(item === null || item === void 0 ? void 0 : item[0])), item === null || item === void 0 ? void 0 : item[1]];
|
|
88
|
-
})));
|
|
89
|
+
var data = JSON.stringify((0, _index.getMapKebabCase)(state, '@'));
|
|
89
90
|
var input = document.createElement('input');
|
|
90
91
|
document.body.appendChild(input);
|
|
91
92
|
input.setAttribute('value', data);
|
|
@@ -103,6 +104,10 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
103
104
|
var startTime = curThemeConfig === null || curThemeConfig === void 0 ? void 0 : curThemeConfig.startTime;
|
|
104
105
|
// 默认时间间隔
|
|
105
106
|
var duration = (typeof cacheTime === 'number' ? cacheTime : defaultCacheTime) * 86400000;
|
|
107
|
+
// antd4以下版本不支持主题色的动态配置
|
|
108
|
+
if (!_antd.ConfigProvider.config) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
106
111
|
if (cacheTime && startTime && new Date().getTime() - startTime < duration) {
|
|
107
112
|
var _localThemeConfig;
|
|
108
113
|
var localThemeConfig;
|
|
@@ -114,15 +119,18 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
114
119
|
|
|
115
120
|
setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), localThemeConfig));
|
|
116
121
|
(0, _index.setThemes)(cssVariables);
|
|
117
|
-
// antd4以下版本不支持主题色的动态配置
|
|
118
|
-
if (!_antd.ConfigProvider.config) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
122
|
_antd.ConfigProvider.config({
|
|
122
123
|
theme: {
|
|
123
124
|
primaryColor: (_localThemeConfig = localThemeConfig) === null || _localThemeConfig === void 0 ? void 0 : _localThemeConfig.zauiBrand
|
|
124
125
|
}
|
|
125
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
|
+
});
|
|
126
134
|
}
|
|
127
135
|
}, []);
|
|
128
136
|
// 主题色动态切换
|
|
@@ -159,7 +167,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
159
167
|
}, [state, cacheTime]);
|
|
160
168
|
var cls = (0, _classnames2.default)((0, _defineProperty2.default)({
|
|
161
169
|
'pro-theme-tools': true,
|
|
162
|
-
'pro-theme-tools-follow':
|
|
170
|
+
'pro-theme-tools-follow': iconFollowTheme
|
|
163
171
|
}, className, className));
|
|
164
172
|
return (0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
165
173
|
className: cls
|
|
@@ -188,7 +196,7 @@ ProThemeTools.defaultProps = {
|
|
|
188
196
|
size: 24,
|
|
189
197
|
mode: 'prd',
|
|
190
198
|
color: '#343434',
|
|
191
|
-
|
|
199
|
+
iconFollowTheme: false,
|
|
192
200
|
cacheTime: false
|
|
193
201
|
};
|
|
194
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
|
|
@@ -21,12 +21,13 @@ var _lodash = require("lodash");
|
|
|
21
21
|
var _reactSvg = require("react-svg");
|
|
22
22
|
var _ProConfigProvider = require("../../ProConfigProvider");
|
|
23
23
|
var _index = require("./index");
|
|
24
|
+
var _locale = _interopRequireDefault(require("../../locale"));
|
|
24
25
|
var _utils = require("../utils");
|
|
25
26
|
var _inputSearch = _interopRequireDefault(require("../../assets/input-search.svg"));
|
|
26
27
|
require("../style/index.less");
|
|
27
28
|
var _excluded = ["value", "onChange", "dataSource", "mode", "code", "useRequest", "allValue", "showCodeName", "checkStrictly", "tags", "placeholder", "labelInValue", "fieldNames", "disabled", "isView", "transformResponse", "optionRender", "onSelect", "loading", "style", "className", "showSearch", "title", "footer", "expandedKeys", "showExpand", "selectKey"];
|
|
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 = (0, _ProConfigProvider.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 = (0, _slicedToArray2.default)(_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.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTree = _locale.default.ProTree) === null || _locale$ProTree === void 0 ? void 0 : _locale$ProTree.inputPlaceholder),
|
|
392
393
|
className: "pro-tree-search",
|
|
393
394
|
onChange: onSearch,
|
|
394
395
|
prefix: (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
@@ -406,7 +407,7 @@ var ProTree = function ProTree(props) {
|
|
|
406
407
|
children: [(0, _jsxRuntime.jsx)("div", {
|
|
407
408
|
className: "expand-icon",
|
|
408
409
|
children: (0, _jsxRuntime.jsx)(_icons.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.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTree2 = _locale.default.ProTree) === null || _locale$ProTree2 === void 0 ? void 0 : _locale$ProTree2.unExpand : _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTree3 = _locale.default.ProTree) === null || _locale$ProTree3 === void 0 ? void 0 : _locale$ProTree3.expand]
|
|
410
411
|
})]
|
|
411
412
|
})]
|
|
412
413
|
}), (0, _jsxRuntime.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.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTree4 = _locale.default.ProTree) === null || _locale$ProTree4 === void 0 ? void 0 : _locale$ProTree4.all
|
|
439
440
|
}) : null
|
|
440
441
|
}), footer]
|
|
441
442
|
})]
|
|
@@ -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
|
});
|
|
@@ -16,10 +16,19 @@ var _ahooks = require("ahooks");
|
|
|
16
16
|
var _icons = require("@ant-design/icons");
|
|
17
17
|
var _SearchTitle = _interopRequireDefault(require("./SearchTitle"));
|
|
18
18
|
var _utils = require("../utils");
|
|
19
|
+
var _locale = _interopRequireDefault(require("../../locale"));
|
|
19
20
|
var _excluded = ["checkedValues", "disabled", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "optionRender", "treeData", "showLine", "switcherIcon", "checkable", "menu", "innerExpandKeys", "selectedKey", "disabledMode"];
|
|
21
|
+
/*
|
|
22
|
+
*@Date: 2023-07-25 13:49:35
|
|
23
|
+
*@LastEditTime: 2023-07-25 13:49:35
|
|
24
|
+
*@Author: liudongliang
|
|
25
|
+
*@Description: 树每行节点渲染组件,复选时阻止点击事件冒泡,只有点击树节点文本会向上触发onSelect事件
|
|
26
|
+
*/
|
|
27
|
+
/* eslint-disable no-plusplus */
|
|
20
28
|
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)'];
|
|
21
29
|
var tagsColors = ['#006AFF', '#00C44A', '#FF8C00', '#FF5050', '#616161'];
|
|
22
30
|
function List(props) {
|
|
31
|
+
var _locale$ProTree;
|
|
23
32
|
var checkedValues = props.checkedValues,
|
|
24
33
|
disabled = props.disabled,
|
|
25
34
|
searchStr = props.searchStr,
|
|
@@ -98,8 +107,13 @@ function List(props) {
|
|
|
98
107
|
});
|
|
99
108
|
}
|
|
100
109
|
}, [selectedKey]);
|
|
101
|
-
var onSelect = function onSelect(
|
|
110
|
+
var onSelect = function onSelect(value, item) {
|
|
102
111
|
var _props$onSelect;
|
|
112
|
+
var val = value;
|
|
113
|
+
if (value === currentClickTreeNode) {
|
|
114
|
+
// 如果当前点击了已经选中节点,那么取消选择
|
|
115
|
+
val = '';
|
|
116
|
+
}
|
|
103
117
|
setState({
|
|
104
118
|
currentClickTreeNode: val
|
|
105
119
|
});
|
|
@@ -335,7 +349,7 @@ function List(props) {
|
|
|
335
349
|
blockNode: true
|
|
336
350
|
})) : (0, _jsxRuntime.jsx)("div", {
|
|
337
351
|
className: "empty-tree",
|
|
338
|
-
children:
|
|
352
|
+
children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTree = _locale.default.ProTree) === null || _locale$ProTree === void 0 ? void 0 : _locale$ProTree.emptyTips
|
|
339
353
|
})
|
|
340
354
|
});
|
|
341
355
|
}
|
package/lib/ProTree/index.js
CHANGED
|
@@ -16,7 +16,6 @@ var _ProTreeSelect = _interopRequireDefault(require("../ProTreeSelect"));
|
|
|
16
16
|
*@Author: liudongliang
|
|
17
17
|
*@Description: ProTree组件,集成了tree和treeSelect
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
19
|
var ProTreeHandle = function ProTreeHandle(props) {
|
|
21
20
|
var _props$mode = props.mode,
|
|
22
21
|
mode = _props$mode === void 0 ? 'tree' : _props$mode;
|