@zat-design/sisyphus-react 3.0.13 → 3.0.16-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +2726 -1876
- package/es/ProDownload/DownloadHelper.js +2 -0
- package/es/ProDrawerForm/components/ProDrawer/index.js +5 -3
- package/es/ProDrawerForm/components/ProModal/index.js +15 -5
- package/es/ProDrawerForm/index.js +1 -1
- package/es/ProDrawerForm/propsType.d.ts +4 -0
- package/es/ProDrawerForm/style/index.less +88 -55
- package/es/ProEditLabel/components/RenderProForm.d.ts +4 -0
- package/es/ProEditLabel/components/RenderProForm.js +70 -0
- package/es/ProEditLabel/index.js +104 -141
- package/es/ProEditLabel/propsType.d.ts +7 -4
- package/es/ProEditLabel/style/index.less +33 -2
- package/es/ProEditLabel/utils/index.d.ts +5 -7
- package/es/ProEditLabel/utils/index.js +11 -27
- package/es/ProEditTable/components/ActionButton/index.d.ts +2 -1
- package/es/ProEditTable/components/ActionButton/index.js +20 -4
- package/es/ProEditTable/components/RenderField/index.d.ts +2 -1
- package/es/ProEditTable/components/RenderField/index.js +1 -2
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +2 -1
- package/es/ProEditTable/components/Summary/index.d.ts +2 -1
- package/es/ProEditTable/propsType.d.ts +5 -0
- package/es/ProEditTable/style/index.less +16 -13
- package/es/ProEditTable/utils/config.d.ts +2 -1
- package/es/ProEditTable/utils/config.js +25 -14
- package/es/ProEditTable/utils/index.js +5 -3
- package/es/ProEnum/getEnumLabel.d.ts +2 -1
- package/es/ProEnum/index.d.ts +3 -2
- package/es/ProEnum/useEnumRequest.js +6 -11
- package/es/ProForm/components/base/DatePicker/index.js +1 -1
- package/es/ProForm/components/base/FormList/components/ActionButton.js +4 -5
- package/es/ProForm/components/base/FormList/index.d.ts +1 -0
- package/es/ProForm/components/base/FormList/index.js +10 -5
- package/es/ProForm/components/base/FormList/style/index.less +3 -0
- package/es/ProForm/components/base/Input/index.d.ts +2 -1
- package/es/ProForm/components/base/InputNumber/index.js +24 -0
- package/es/ProForm/components/base/RangePicker/index.js +2 -2
- package/es/ProForm/components/combination/ProAddressBar/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProAddressBar/index.js +2 -1
- package/es/ProForm/components/combination/ProCombination/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +3 -2
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -6
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +45 -36
- package/es/ProForm/components/combination/ProRangeLimit/index.js +13 -15
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -1
- package/es/ProForm/components/index.d.ts +2 -0
- package/es/ProForm/components/index.js +2 -0
- package/es/ProForm/components/old/CertNo/index.d.ts +2 -1
- package/es/ProForm/components/old/InputRange/index.d.ts +2 -1
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +2 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/es/ProForm/components/old/ProCertValidity/index.js +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/es/ProForm/components/render/Render.js +6 -22
- package/es/ProForm/components/render/propsType.d.ts +4 -0
- package/es/ProForm/index.js +3 -1
- package/es/ProForm/style/index.less +12 -5
- package/es/ProForm/utils/index.d.ts +5 -2
- package/es/ProForm/utils/index.js +7 -12
- package/es/ProForm/utils/transformValue.js +4 -2
- package/es/ProForm/utils/useShouldUpdate.js +1 -0
- package/es/ProForm/utils/valueType.d.ts +4 -4
- package/es/ProIcon/index.d.ts +1 -0
- package/es/ProIcon/index.js +35 -5
- package/es/ProIcon/propsTypes.d.ts +9 -9
- package/es/ProIcon/symbolIcon.js +43 -0
- package/es/ProLayout/components/Layout/Header/style/index.less +1 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +2 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -0
- package/es/ProLayout/components/ProCollapse/index.d.ts +2 -1
- package/es/ProLayout/components/ProCollapse/style/index.less +1 -0
- package/es/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +2 -1
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.js +2 -4
- package/es/ProLayout/components/ProHeader/style/index.less +3 -3
- package/es/ProLayout/index.d.ts +4 -4
- package/es/ProLayout/index.js +5 -6
- package/es/ProLayout/propTypes.d.ts +2 -5
- package/es/ProLayout/style/index.less +7 -1
- package/es/ProSelect/index.d.ts +1 -1
- package/es/ProSelect/index.js +1 -1
- package/es/ProSelect/propsType.d.ts +7 -0
- package/es/ProStep/components/Anchor/index.d.ts +2 -1
- package/es/ProStep/components/Item/index.d.ts +2 -1
- package/es/ProStep/components/Step/index.d.ts +2 -1
- package/es/ProStep/components/Step/index.js +12 -10
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProStep/style/index.less +1 -1
- package/es/ProTable/components/ResizableLine/index.d.ts +2 -1
- package/es/ProTable/components/TableResizable/index.d.ts +2 -1
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +1 -1
- package/es/ProTable/propsType.d.ts +3 -2
- package/es/ProTable/style/index.less +12 -17
- package/es/ProTable/useAntdTable.d.ts +4 -4
- package/es/ProTable/useAntdTable.js +54 -34
- package/es/ProTable/utils.js +24 -5
- package/es/ProTabs/components/Card/index.d.ts +4 -0
- package/es/ProTabs/components/Card/index.js +24 -0
- package/es/ProTabs/components/index.d.ts +1 -0
- package/es/ProTabs/components/index.js +1 -0
- package/es/ProTabs/index.d.ts +4 -0
- package/es/ProTabs/index.js +98 -0
- package/es/ProTabs/propType.d.ts +31 -0
- package/es/ProTabs/propType.js +1 -0
- package/es/ProTabs/style/index.less +68 -0
- package/es/ProThemeTools/component/PrdTools/index.d.ts +4 -0
- package/es/ProThemeTools/component/PrdTools/index.js +200 -0
- package/es/ProThemeTools/component/PrdTools/style/index.less +164 -0
- package/es/ProThemeTools/component/index.d.ts +2 -0
- package/es/ProThemeTools/component/index.js +2 -0
- package/es/ProThemeTools/index.d.ts +14 -0
- package/es/ProThemeTools/index.js +179 -0
- package/es/ProThemeTools/propsType.d.ts +30 -0
- package/es/ProThemeTools/propsType.js +1 -0
- package/es/ProThemeTools/style/index.less +55 -0
- package/es/ProThemeTools/utils/index.d.ts +14 -0
- package/es/ProThemeTools/utils/index.js +54 -0
- package/es/ProTooltip/index.d.ts +2 -1
- package/es/ProTransferModal/components/SortableItem/index.js +2 -2
- package/es/ProTransferModal/style/index.less +9 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +3 -0
- package/es/ProTreeModal/components/CloseIcon.js +25 -0
- package/es/ProTreeModal/components/List.d.ts +13 -0
- package/es/ProTreeModal/components/List.js +52 -0
- package/es/ProTreeModal/components/SearchTitle.d.ts +7 -0
- package/es/ProTreeModal/components/SearchTitle.js +14 -0
- package/es/ProTreeModal/components/Tree.d.ts +15 -0
- package/es/ProTreeModal/components/Tree.js +149 -0
- package/es/ProTreeModal/components/Trigger.d.ts +10 -0
- package/es/ProTreeModal/components/Trigger.js +32 -0
- package/es/ProTreeModal/components/index.d.ts +5 -0
- package/es/ProTreeModal/components/index.js +5 -0
- package/es/ProTreeModal/data/datasource.d.ts +5 -0
- package/es/ProTreeModal/data/datasource.js +17 -0
- package/es/ProTreeModal/data/mock.d.ts +9 -0
- package/es/ProTreeModal/data/mock.js +39 -0
- package/es/ProTreeModal/index.d.ts +5 -0
- package/es/ProTreeModal/index.js +333 -0
- package/es/ProTreeModal/propsType.d.ts +26 -0
- package/es/ProTreeModal/propsType.js +1 -0
- package/es/ProTreeModal/style/index.less +105 -0
- package/es/ProTreeModal/utils.d.ts +26 -0
- package/es/ProTreeModal/utils.js +136 -0
- package/es/ProTreeSelect/index.d.ts +5 -0
- package/es/ProTreeSelect/index.js +404 -0
- package/es/ProTreeSelect/propsType.d.ts +95 -0
- package/es/ProTreeSelect/propsType.js +1 -0
- package/es/ProTreeSelect/style/index.less +109 -0
- package/es/ProUpload/index.d.ts +0 -1
- package/es/ProUpload/index.js +8 -2
- package/es/ProUpload/style/fileItem.less +3 -1
- package/es/ProUpload/style/index.less +8 -1
- package/es/ProWaterMark/index.js +1 -1
- package/es/assets/close.svg +1 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -8
- package/es/old/ProCertValidity/index.js +1 -1
- package/es/style/components.less +25 -9
- package/es/style/theme/antd.less +60 -29
- package/es/style/theme/index.less +154 -176
- package/es/tokens.js +85 -0
- package/lib/ProDrawerForm/components/ProDrawer/index.js +5 -3
- package/lib/ProDrawerForm/components/ProModal/index.js +13 -5
- package/lib/ProDrawerForm/index.js +1 -1
- package/lib/ProDrawerForm/propsType.d.ts +4 -0
- package/lib/ProDrawerForm/style/index.less +88 -55
- package/lib/ProEditLabel/components/RenderProForm.d.ts +4 -0
- package/lib/ProEditLabel/components/RenderProForm.js +78 -0
- package/lib/ProEditLabel/index.js +102 -137
- package/lib/ProEditLabel/propsType.d.ts +7 -4
- package/lib/ProEditLabel/style/index.less +33 -2
- package/lib/ProEditLabel/utils/index.d.ts +5 -7
- package/lib/ProEditLabel/utils/index.js +14 -31
- package/lib/ProEditTable/components/ActionButton/index.d.ts +2 -1
- package/lib/ProEditTable/components/ActionButton/index.js +20 -4
- package/lib/ProEditTable/components/RenderField/index.d.ts +2 -1
- package/lib/ProEditTable/components/RenderField/index.js +3 -2
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +2 -1
- package/lib/ProEditTable/components/Summary/index.d.ts +2 -1
- package/lib/ProEditTable/propsType.d.ts +5 -0
- package/lib/ProEditTable/style/index.less +16 -13
- package/lib/ProEditTable/utils/config.d.ts +2 -1
- package/lib/ProEditTable/utils/config.js +24 -13
- package/lib/ProEditTable/utils/index.js +5 -3
- package/lib/ProEnum/getEnumLabel.d.ts +2 -1
- package/lib/ProEnum/index.d.ts +3 -2
- package/lib/ProEnum/useEnumRequest.js +6 -11
- package/lib/ProForm/components/base/DatePicker/index.js +1 -1
- package/lib/ProForm/components/base/FormList/components/ActionButton.js +4 -5
- package/lib/ProForm/components/base/FormList/index.d.ts +1 -0
- package/lib/ProForm/components/base/FormList/index.js +10 -5
- package/lib/ProForm/components/base/FormList/style/index.less +3 -0
- package/lib/ProForm/components/base/Input/index.d.ts +2 -1
- package/lib/ProForm/components/base/InputNumber/index.js +24 -0
- package/lib/ProForm/components/base/RangePicker/index.js +2 -2
- package/lib/ProForm/components/combination/ProAddressBar/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProAddressBar/index.js +2 -1
- package/lib/ProForm/components/combination/ProCombination/index.js +3 -3
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -6
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +45 -36
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +13 -15
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -1
- package/lib/ProForm/components/index.d.ts +2 -0
- package/lib/ProForm/components/index.js +14 -0
- package/lib/ProForm/components/old/CertNo/index.d.ts +2 -1
- package/lib/ProForm/components/old/InputRange/index.d.ts +2 -1
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +2 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/lib/ProForm/components/render/Render.js +4 -20
- package/lib/ProForm/components/render/propsType.d.ts +4 -0
- package/lib/ProForm/index.js +2 -0
- package/lib/ProForm/style/index.less +12 -5
- package/lib/ProForm/utils/index.d.ts +5 -2
- package/lib/ProForm/utils/index.js +10 -14
- package/lib/ProForm/utils/transformValue.js +4 -2
- package/lib/ProForm/utils/useShouldUpdate.js +1 -0
- package/lib/ProForm/utils/valueType.d.ts +4 -4
- package/lib/ProIcon/index.d.ts +1 -0
- package/lib/ProIcon/index.js +36 -5
- package/lib/ProIcon/propsTypes.d.ts +9 -9
- package/lib/ProIcon/symbolIcon.js +45 -0
- package/lib/ProLayout/components/Layout/Header/style/index.less +1 -2
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +2 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -0
- package/lib/ProLayout/components/ProCollapse/index.d.ts +2 -1
- package/lib/ProLayout/components/ProCollapse/style/index.less +1 -0
- package/lib/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +2 -1
- package/lib/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/index.js +1 -4
- package/lib/ProLayout/components/ProHeader/style/index.less +3 -3
- package/lib/ProLayout/index.d.ts +4 -4
- package/lib/ProLayout/index.js +5 -6
- package/lib/ProLayout/propTypes.d.ts +2 -5
- package/lib/ProLayout/style/index.less +7 -1
- package/lib/ProSelect/index.d.ts +1 -1
- package/lib/ProSelect/index.js +1 -1
- package/lib/ProSelect/propsType.d.ts +7 -0
- package/lib/ProStep/components/Anchor/index.d.ts +2 -1
- package/lib/ProStep/components/Item/index.d.ts +2 -1
- package/lib/ProStep/components/Step/index.d.ts +2 -1
- package/lib/ProStep/components/Step/index.js +11 -9
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProStep/style/index.less +1 -1
- package/lib/ProTable/components/ResizableLine/index.d.ts +2 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +2 -1
- package/lib/ProTable/components/TableResizable/index.js +8 -0
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +1 -1
- package/lib/ProTable/propsType.d.ts +3 -2
- package/lib/ProTable/style/index.less +12 -17
- package/lib/ProTable/useAntdTable.d.ts +4 -4
- package/lib/ProTable/useAntdTable.js +53 -33
- package/lib/ProTable/utils.js +24 -5
- package/lib/ProTabs/components/Card/index.d.ts +4 -0
- package/lib/ProTabs/components/Card/index.js +31 -0
- package/lib/ProTabs/components/index.d.ts +1 -0
- package/lib/ProTabs/components/index.js +13 -0
- package/lib/ProTabs/index.d.ts +4 -0
- package/lib/ProTabs/index.js +106 -0
- package/lib/ProTabs/propType.d.ts +31 -0
- package/lib/ProTabs/propType.js +5 -0
- package/lib/ProTabs/style/index.less +68 -0
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +4 -0
- package/lib/ProThemeTools/component/PrdTools/index.js +202 -0
- package/lib/ProThemeTools/component/PrdTools/style/index.less +164 -0
- package/lib/ProThemeTools/component/index.d.ts +2 -0
- package/lib/ProThemeTools/component/index.js +13 -0
- package/lib/ProThemeTools/index.d.ts +14 -0
- package/lib/ProThemeTools/index.js +185 -0
- package/lib/ProThemeTools/propsType.d.ts +30 -0
- package/lib/ProThemeTools/propsType.js +5 -0
- package/lib/ProThemeTools/style/index.less +55 -0
- package/lib/ProThemeTools/utils/index.d.ts +14 -0
- package/lib/ProThemeTools/utils/index.js +63 -0
- package/lib/ProTooltip/index.d.ts +2 -1
- package/lib/ProTransferModal/components/SortableItem/index.js +2 -2
- package/lib/ProTransferModal/style/index.less +9 -1
- package/lib/ProTreeModal/components/CloseIcon.d.ts +3 -0
- package/lib/ProTreeModal/components/CloseIcon.js +33 -0
- package/lib/ProTreeModal/components/List.d.ts +13 -0
- package/lib/ProTreeModal/components/List.js +59 -0
- package/lib/ProTreeModal/components/SearchTitle.d.ts +7 -0
- package/lib/ProTreeModal/components/SearchTitle.js +22 -0
- package/lib/ProTreeModal/components/Tree.d.ts +15 -0
- package/lib/ProTreeModal/components/Tree.js +157 -0
- package/lib/ProTreeModal/components/Trigger.d.ts +10 -0
- package/lib/ProTreeModal/components/Trigger.js +39 -0
- package/lib/ProTreeModal/components/index.d.ts +5 -0
- package/lib/ProTreeModal/components/index.js +41 -0
- package/lib/ProTreeModal/data/datasource.d.ts +5 -0
- package/lib/ProTreeModal/data/datasource.js +24 -0
- package/lib/ProTreeModal/data/mock.d.ts +9 -0
- package/lib/ProTreeModal/data/mock.js +47 -0
- package/lib/ProTreeModal/index.d.ts +5 -0
- package/lib/ProTreeModal/index.js +340 -0
- package/lib/ProTreeModal/propsType.d.ts +26 -0
- package/lib/ProTreeModal/propsType.js +5 -0
- package/lib/ProTreeModal/style/index.less +105 -0
- package/lib/ProTreeModal/utils.d.ts +26 -0
- package/lib/ProTreeModal/utils.js +148 -0
- package/lib/ProTreeSelect/index.d.ts +5 -0
- package/lib/ProTreeSelect/index.js +411 -0
- package/lib/ProTreeSelect/propsType.d.ts +95 -0
- package/lib/ProTreeSelect/propsType.js +5 -0
- package/lib/ProTreeSelect/style/index.less +109 -0
- package/lib/ProUpload/index.d.ts +0 -1
- package/lib/ProUpload/index.js +8 -2
- package/lib/ProUpload/style/fileItem.less +3 -1
- package/lib/ProUpload/style/index.less +8 -1
- package/lib/ProWaterMark/index.js +1 -1
- package/lib/assets/close.svg +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +28 -0
- package/lib/old/ProCertValidity/index.js +1 -1
- package/lib/style/components.less +25 -9
- package/lib/style/theme/antd.less +60 -29
- package/lib/style/theme/index.less +154 -176
- package/lib/tokens.js +87 -0
- package/package.json +7 -8
- package/typings.d.ts +4 -0
- package/es/ProEditLabel/components/RenderForm.d.ts +0 -3
- package/es/ProEditLabel/components/RenderForm.js +0 -65
- package/lib/ProEditLabel/components/RenderForm.d.ts +0 -3
- package/lib/ProEditLabel/components/RenderForm.js +0 -75
- package/source-code/package.json +0 -16
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
var _icons = require("@ant-design/icons");
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _index = require("../../utils/index");
|
|
15
|
+
var connect = function connect(Component) {
|
|
16
|
+
var ComponentWrapper = function ComponentWrapper(props) {
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(Component, (0, _objectSpread2.default)({}, props));
|
|
18
|
+
};
|
|
19
|
+
return ComponentWrapper;
|
|
20
|
+
};
|
|
21
|
+
var NewDrawer = connect(_antd.Drawer);
|
|
22
|
+
var PrdTools = function PrdTools(_ref) {
|
|
23
|
+
var onReset = _ref.onReset,
|
|
24
|
+
onClose = _ref.onClose,
|
|
25
|
+
setState = _ref.setState,
|
|
26
|
+
visible = _ref.visible,
|
|
27
|
+
state = _ref.state;
|
|
28
|
+
var _useState = (0, _react.useState)([{
|
|
29
|
+
color: '#006AFF',
|
|
30
|
+
active: true
|
|
31
|
+
}, {
|
|
32
|
+
color: '#00BC70',
|
|
33
|
+
active: false
|
|
34
|
+
}, {
|
|
35
|
+
color: '#FF8C16',
|
|
36
|
+
active: false
|
|
37
|
+
}, {
|
|
38
|
+
color: '#A00F20',
|
|
39
|
+
active: false
|
|
40
|
+
}]),
|
|
41
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
|
+
active = _useState2[0],
|
|
43
|
+
setActive = _useState2[1];
|
|
44
|
+
(0, _react.useEffect)(function () {
|
|
45
|
+
var themeConfig = localStorage.getItem('themeConfig');
|
|
46
|
+
var curThemeConfig = themeConfig ? JSON.parse(themeConfig) : {};
|
|
47
|
+
var _ref2 = curThemeConfig.data || {},
|
|
48
|
+
_ref2$zauiBrand = _ref2.zauiBrand,
|
|
49
|
+
zauiBrand = _ref2$zauiBrand === void 0 ? '#006AFF' : _ref2$zauiBrand;
|
|
50
|
+
if (zauiBrand) {
|
|
51
|
+
var newArray = active.map(function (activeItem) {
|
|
52
|
+
activeItem.active = false;
|
|
53
|
+
return {
|
|
54
|
+
color: activeItem.color,
|
|
55
|
+
active: activeItem.color === zauiBrand
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
setActive(newArray);
|
|
59
|
+
}
|
|
60
|
+
}, []);
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement(NewDrawer, {
|
|
62
|
+
className: "pro-theme-prd-tools-drawer",
|
|
63
|
+
width: 320,
|
|
64
|
+
title: "\u5168\u5C40\u6837\u5F0F\u81EA\u5B9A\u4E49",
|
|
65
|
+
placement: "right",
|
|
66
|
+
onClose: onClose,
|
|
67
|
+
open: visible,
|
|
68
|
+
closable: false
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
className: "pro-drawer-close",
|
|
71
|
+
onClick: onClose
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_icons.CloseOutlined, {
|
|
73
|
+
className: "close-icon"
|
|
74
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
+
className: "pro-theme-tools-space"
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, "\u4E3B\u9898\u8272"), /*#__PURE__*/_react.default.createElement("ul", {
|
|
77
|
+
className: "pro-theme-color"
|
|
78
|
+
}, active.map(function (item, index) {
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
80
|
+
key: item.color,
|
|
81
|
+
className: item.active ? 'active' : '',
|
|
82
|
+
onClick: function onClick() {
|
|
83
|
+
var array = active.map(function (activeItem) {
|
|
84
|
+
activeItem.active = false;
|
|
85
|
+
return {
|
|
86
|
+
color: activeItem.color,
|
|
87
|
+
active: item.color === activeItem.color
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
setActive(array);
|
|
91
|
+
setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
92
|
+
zauiBrand: item.color
|
|
93
|
+
}));
|
|
94
|
+
(0, _index.setThemes)({
|
|
95
|
+
'zaui-brand': item.color
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}, item.active ? /*#__PURE__*/_react.default.createElement(_icons.CheckOutlined, null) : null);
|
|
99
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
100
|
+
className: "pro-theme-tools-space"
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
+
className: "pro-theme-tools-item"
|
|
103
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, "\u5E03\u5C40")), /*#__PURE__*/_react.default.createElement("div", {
|
|
104
|
+
className: "pro-theme-tools-item"
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Radio.Group, {
|
|
106
|
+
value: state.zauiSize,
|
|
107
|
+
onChange: function onChange(e) {
|
|
108
|
+
setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
109
|
+
zauiSize: e.target.value
|
|
110
|
+
}));
|
|
111
|
+
(0, _index.setThemes)({
|
|
112
|
+
'zaui-size': e.target.value
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Radio.Button, {
|
|
116
|
+
value: 0.5
|
|
117
|
+
}, "\u7D27\u51D1"), /*#__PURE__*/_react.default.createElement(_antd.Radio.Button, {
|
|
118
|
+
value: 1
|
|
119
|
+
}, "\u5E38\u89C4"), /*#__PURE__*/_react.default.createElement(_antd.Radio.Button, {
|
|
120
|
+
value: 1.5
|
|
121
|
+
}, "\u5BBD\u677E")))), /*#__PURE__*/_react.default.createElement("div", {
|
|
122
|
+
className: "pro-theme-tools-space pro-theme-tools-form"
|
|
123
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
+
className: "pro-theme-tools-item"
|
|
125
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, "\u8868\u5355\u6807\u9898")), /*#__PURE__*/_react.default.createElement("div", {
|
|
126
|
+
className: "pro-theme-tools-item"
|
|
127
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Radio.Group, {
|
|
128
|
+
value: state.zauiFormAlign,
|
|
129
|
+
onChange: function onChange(e) {
|
|
130
|
+
var after = e.target.value === 'left' ? 'inline' : 'none';
|
|
131
|
+
var before = e.target.value === 'right' ? 'inline' : 'none';
|
|
132
|
+
// 遍历添加className
|
|
133
|
+
var formItemLabels = document.querySelectorAll('.ant-form-item-label');
|
|
134
|
+
// 遍历元素列表,为每个元素添加新的 class
|
|
135
|
+
formItemLabels.forEach(function (label) {
|
|
136
|
+
var _label$classList, _label$classList$valu, _label$classList2, _label$classList2$val;
|
|
137
|
+
if (!label) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if (e.target.value === 'left' && !((_label$classList = label.classList) === null || _label$classList === void 0 ? void 0 : (_label$classList$valu = _label$classList.value) === null || _label$classList$valu === void 0 ? void 0 : _label$classList$valu.includes('ant-form-item-label-left'))) {
|
|
141
|
+
label.classList.add('ant-form-item-label-left');
|
|
142
|
+
}
|
|
143
|
+
if (e.target.value === 'right' && ((_label$classList2 = label.classList) === null || _label$classList2 === void 0 ? void 0 : (_label$classList2$val = _label$classList2.value) === null || _label$classList2$val === void 0 ? void 0 : _label$classList2$val.includes('ant-form-item-label-left'))) {
|
|
144
|
+
label.classList.remove('ant-form-item-label-left');
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
148
|
+
zauiFormAlign: e.target.value,
|
|
149
|
+
zauiFormRequiredAfter: after,
|
|
150
|
+
zauiFormRequiredBefore: before
|
|
151
|
+
}));
|
|
152
|
+
(0, _index.setThemes)({
|
|
153
|
+
'zaui-form-align': e.target.value,
|
|
154
|
+
'zaui-form-required-after': after,
|
|
155
|
+
'zaui-form-required-before': before
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Radio.Button, {
|
|
159
|
+
value: "left"
|
|
160
|
+
}, "\u5DE6\u5BF9\u9F50"), /*#__PURE__*/_react.default.createElement(_antd.Radio.Button, {
|
|
161
|
+
value: "right"
|
|
162
|
+
}, "\u53F3\u5BF9\u9F50")))), /*#__PURE__*/_react.default.createElement("div", {
|
|
163
|
+
className: "pro-theme-tools-box pro-theme-tools-space"
|
|
164
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
165
|
+
className: "pro-theme-tools-item"
|
|
166
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, "\u5927\u5B57\u53F7\u6A21\u5F0F")), /*#__PURE__*/_react.default.createElement("div", {
|
|
167
|
+
className: "pro-theme-tools-item"
|
|
168
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Switch, {
|
|
169
|
+
checkedChildren: "\u5F00",
|
|
170
|
+
unCheckedChildren: "\u5173",
|
|
171
|
+
checked: state.bigText,
|
|
172
|
+
onClick: function onClick(value) {
|
|
173
|
+
setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
174
|
+
zauiBaseFontSize: value ? 2 : 0,
|
|
175
|
+
bigText: value
|
|
176
|
+
}));
|
|
177
|
+
(0, _index.setThemes)({
|
|
178
|
+
'zaui-base-font-size': value ? '2px' : '0px'
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}))), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
182
|
+
className: "copy-btn",
|
|
183
|
+
onClick: function onClick() {
|
|
184
|
+
setActive([{
|
|
185
|
+
color: '#006AFF',
|
|
186
|
+
active: true
|
|
187
|
+
}, {
|
|
188
|
+
color: '#00BC70',
|
|
189
|
+
active: false
|
|
190
|
+
}, {
|
|
191
|
+
color: '#FF8C16',
|
|
192
|
+
active: false
|
|
193
|
+
}, {
|
|
194
|
+
color: '#A00F20',
|
|
195
|
+
active: false
|
|
196
|
+
}]);
|
|
197
|
+
onReset();
|
|
198
|
+
}
|
|
199
|
+
}, "\u91CD\u7F6E"));
|
|
200
|
+
};
|
|
201
|
+
var _default = PrdTools;
|
|
202
|
+
exports.default = _default;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
.pro-theme-prd-tools-drawer {
|
|
2
|
+
.ant-drawer-header {
|
|
3
|
+
border-bottom: none;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ant-drawer-title {
|
|
7
|
+
font-size: var(--zaui-font-size-xl, 18px);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ant-drawer-body {
|
|
11
|
+
padding: 0 32px 32px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ant-space-vertical {
|
|
15
|
+
gap: var(--zaui-space-size-sm, 8px) !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
p {
|
|
19
|
+
padding-left : 12px;
|
|
20
|
+
position : relative;
|
|
21
|
+
margin-bottom: var(--zaui-space-size-md, 16px);
|
|
22
|
+
font-size : var(--zaui-font-size, 14px);
|
|
23
|
+
|
|
24
|
+
&:before {
|
|
25
|
+
content : '';
|
|
26
|
+
position : absolute;
|
|
27
|
+
left : 0;
|
|
28
|
+
top : 4px;
|
|
29
|
+
width : 4px;
|
|
30
|
+
height : 14px;
|
|
31
|
+
background : var(--zaui-brand, #006aff);
|
|
32
|
+
border-radius: 1px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.pro-theme-color {
|
|
37
|
+
display: flex;
|
|
38
|
+
|
|
39
|
+
li {
|
|
40
|
+
width : 38px;
|
|
41
|
+
height : 38px;
|
|
42
|
+
border-radius : 50%;
|
|
43
|
+
background : #fff;
|
|
44
|
+
display : flex;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
align-items : center;
|
|
47
|
+
border : 6px solid #fff;
|
|
48
|
+
color : #fff;
|
|
49
|
+
margin-right : 34px;
|
|
50
|
+
|
|
51
|
+
span {
|
|
52
|
+
font-size : 14px;
|
|
53
|
+
vertical-align: -7px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:nth-child(1) {
|
|
57
|
+
background: #006aff;
|
|
58
|
+
|
|
59
|
+
&.active,
|
|
60
|
+
&:hover {
|
|
61
|
+
border-color: #d6e7ff;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:nth-child(2) {
|
|
66
|
+
background: #00bc70;
|
|
67
|
+
|
|
68
|
+
&.active,
|
|
69
|
+
&:hover {
|
|
70
|
+
border-color: #e0f5e8;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:nth-child(3) {
|
|
75
|
+
background: #ff8c16;
|
|
76
|
+
|
|
77
|
+
&.active,
|
|
78
|
+
&:hover {
|
|
79
|
+
border-color: #ffecdd;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&:nth-child(4) {
|
|
84
|
+
margin-right: 0;
|
|
85
|
+
background : #a00f20;
|
|
86
|
+
|
|
87
|
+
&.active,
|
|
88
|
+
&:hover {
|
|
89
|
+
border-color: #f2dbdb;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.anticon-question-circle {
|
|
96
|
+
color: var(--zaui-brand, #006aff);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.copy-btn {
|
|
100
|
+
position: absolute;
|
|
101
|
+
width : calc(100% - 64px);
|
|
102
|
+
bottom : 20px;
|
|
103
|
+
left : 32px;
|
|
104
|
+
z-index : 10;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.pro-theme-tools-box {
|
|
108
|
+
display : flex;
|
|
109
|
+
justify-content: space-between;
|
|
110
|
+
flex-wrap : wrap;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.pro-theme-tools-space {
|
|
114
|
+
margin-bottom: 24px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ant-radio-button-wrapper {
|
|
118
|
+
padding: 0 28px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.pro-theme-tools-form {
|
|
122
|
+
.ant-radio-button-wrapper {
|
|
123
|
+
padding: 0 42px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.pro-drawer-close {
|
|
128
|
+
position : absolute;
|
|
129
|
+
top : 6px;
|
|
130
|
+
left : -37px;
|
|
131
|
+
display : flex;
|
|
132
|
+
align-items : center;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
width : 32px;
|
|
135
|
+
height : 38px;
|
|
136
|
+
color : #fff;
|
|
137
|
+
cursor : pointer;
|
|
138
|
+
|
|
139
|
+
.close-icon {
|
|
140
|
+
position : relative;
|
|
141
|
+
left : 4px;
|
|
142
|
+
z-index : 1;
|
|
143
|
+
color : #343434;
|
|
144
|
+
font-size: 16px;
|
|
145
|
+
transform: translateZ(100px);
|
|
146
|
+
|
|
147
|
+
&:hover {
|
|
148
|
+
color: var(--zaui-brand, #006aff);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.pro-drawer-close::after {
|
|
154
|
+
position : absolute;
|
|
155
|
+
top : 0;
|
|
156
|
+
right : 0;
|
|
157
|
+
bottom : 0;
|
|
158
|
+
left : 0;
|
|
159
|
+
background-color: #fff;
|
|
160
|
+
border-radius : 4px 0px 0px 4px;
|
|
161
|
+
transform : perspective(0.15em) rotateY(-2deg);
|
|
162
|
+
content : '';
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "PrdTools", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _PrdTools.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _PrdTools = _interopRequireDefault(require("./PrdTools"));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ProThemeToolsProps } from './propsType';
|
|
3
|
+
declare const ProThemeTools: {
|
|
4
|
+
({ size, className, cacheTime, color, mode, theme, ...props }: ProThemeToolsProps): React.JSX.Element;
|
|
5
|
+
defaultProps: {
|
|
6
|
+
size: number;
|
|
7
|
+
mode: string;
|
|
8
|
+
color: string;
|
|
9
|
+
theme: boolean;
|
|
10
|
+
cacheTime: boolean;
|
|
11
|
+
};
|
|
12
|
+
setThemes: (themes: import("./utils/index").ThemesProps, themeMapping?: import("./utils/index").ThemesProps) => boolean;
|
|
13
|
+
};
|
|
14
|
+
export default ProThemeTools;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
var _icons = require("@ant-design/icons");
|
|
14
|
+
var _antd = require("antd");
|
|
15
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
+
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
17
|
+
var _index = require("./utils/index");
|
|
18
|
+
var _component = require("./component");
|
|
19
|
+
var _excluded = ["size", "className", "cacheTime", "color", "mode", "theme"];
|
|
20
|
+
/* eslint-disable prefer-const */
|
|
21
|
+
var defaultCacheTime = 1; // 配置保存时间为一天
|
|
22
|
+
var ProThemeTools = function ProThemeTools(_ref) {
|
|
23
|
+
var size = _ref.size,
|
|
24
|
+
className = _ref.className,
|
|
25
|
+
cacheTime = _ref.cacheTime,
|
|
26
|
+
color = _ref.color,
|
|
27
|
+
mode = _ref.mode,
|
|
28
|
+
theme = _ref.theme,
|
|
29
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
30
|
+
var _useState = (0, _react.useState)(false),
|
|
31
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
32
|
+
visible = _useState2[0],
|
|
33
|
+
setVisible = _useState2[1];
|
|
34
|
+
var _useState3 = (0, _react.useState)({
|
|
35
|
+
zauiBrand: '#006AFF',
|
|
36
|
+
zauiText: '#343434',
|
|
37
|
+
zauiFontSize: 14,
|
|
38
|
+
zauiFormAlign: 'left',
|
|
39
|
+
zauiFormRequiredBefore: 'none',
|
|
40
|
+
zauiFormRequiredAfter: 'inline',
|
|
41
|
+
zauiSize: 1,
|
|
42
|
+
zauiHeightCard: 32,
|
|
43
|
+
zauiHeightBorder: 12,
|
|
44
|
+
bigText: false,
|
|
45
|
+
zauiBaseFontSize: 0
|
|
46
|
+
}),
|
|
47
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
48
|
+
state = _useState4[0],
|
|
49
|
+
setState = _useState4[1];
|
|
50
|
+
var zauiBrand = state.zauiBrand;
|
|
51
|
+
var showDrawer = function showDrawer() {
|
|
52
|
+
setVisible(true);
|
|
53
|
+
};
|
|
54
|
+
var onClose = function onClose() {
|
|
55
|
+
setVisible(false);
|
|
56
|
+
};
|
|
57
|
+
// 重置
|
|
58
|
+
var onReset = function onReset() {
|
|
59
|
+
setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
60
|
+
zauiBrand: '#006AFF',
|
|
61
|
+
zauiText: '#343434',
|
|
62
|
+
zauiFormAlign: 'left',
|
|
63
|
+
zauiFormRequiredBefore: 'none',
|
|
64
|
+
zauiFormRequiredAfter: 'inline',
|
|
65
|
+
zauiFontSize: 14,
|
|
66
|
+
zauiSize: 1,
|
|
67
|
+
zauiHeightCard: 32,
|
|
68
|
+
zauiHeightBorder: 16,
|
|
69
|
+
zauiBaseFontSize: 0,
|
|
70
|
+
bigText: false
|
|
71
|
+
}));
|
|
72
|
+
(0, _index.setThemes)({
|
|
73
|
+
'zaui-brand': '#006AFF',
|
|
74
|
+
'zaui-text': '#343434',
|
|
75
|
+
'zaui-form-align': 'left',
|
|
76
|
+
'zaui-form-required-after': 'inline',
|
|
77
|
+
'zaui-form-required-before': 'none',
|
|
78
|
+
'zaui-size': 1,
|
|
79
|
+
'zaui-height-card': '32px',
|
|
80
|
+
'zaui-font-size': '14px',
|
|
81
|
+
'zaui-height-border': '16px',
|
|
82
|
+
'zaui-base-font-size': 0
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
// 复制
|
|
86
|
+
var onCopy = function onCopy() {
|
|
87
|
+
var data = JSON.stringify(Object.fromEntries(Object.entries(state).map(function (item) {
|
|
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
|
+
})));
|
|
90
|
+
var input = document.createElement('input');
|
|
91
|
+
document.body.appendChild(input);
|
|
92
|
+
input.setAttribute('value', data);
|
|
93
|
+
input.select();
|
|
94
|
+
if (document.execCommand('copy')) {
|
|
95
|
+
document.execCommand('copy');
|
|
96
|
+
_antd.message.success('复制成功!');
|
|
97
|
+
}
|
|
98
|
+
document.body.removeChild(input);
|
|
99
|
+
};
|
|
100
|
+
// 首次从缓存中读取主题配置
|
|
101
|
+
(0, _react.useEffect)(function () {
|
|
102
|
+
var themeConfig = localStorage.getItem('themeConfig');
|
|
103
|
+
var curThemeConfig = themeConfig ? JSON.parse(themeConfig) : {};
|
|
104
|
+
var startTime = curThemeConfig === null || curThemeConfig === void 0 ? void 0 : curThemeConfig.startTime;
|
|
105
|
+
// 默认时间间隔
|
|
106
|
+
var duration = (typeof cacheTime === 'number' ? cacheTime : defaultCacheTime) * 86400000;
|
|
107
|
+
if (cacheTime && startTime && new Date().getTime() - startTime < duration) {
|
|
108
|
+
var _localThemeConfig;
|
|
109
|
+
var localThemeConfig;
|
|
110
|
+
localThemeConfig = curThemeConfig.data;
|
|
111
|
+
var cssVariables = Object.fromEntries(Object.entries(localThemeConfig).map(function (item) {
|
|
112
|
+
return ["".concat((0, _index.getKebabCase)(item === null || item === void 0 ? void 0 : item[0])), ['zauiSize'].includes(item === null || item === void 0 ? void 0 : item[0]) || typeof (item === null || item === void 0 ? void 0 : item[1]) !== 'number' ? item === null || item === void 0 ? void 0 : item[1] : "".concat(item === null || item === void 0 ? void 0 : item[1], "px") // zauiSize取数字
|
|
113
|
+
];
|
|
114
|
+
}));
|
|
115
|
+
|
|
116
|
+
setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), localThemeConfig));
|
|
117
|
+
(0, _index.setThemes)(cssVariables);
|
|
118
|
+
// antd4以下版本不支持主题色的动态配置
|
|
119
|
+
if (!_antd.ConfigProvider.config) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
_antd.ConfigProvider.config({
|
|
123
|
+
theme: {
|
|
124
|
+
primaryColor: (_localThemeConfig = localThemeConfig) === null || _localThemeConfig === void 0 ? void 0 : _localThemeConfig.zauiBrand
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}, []);
|
|
129
|
+
// 主题色动态切换
|
|
130
|
+
(0, _react.useEffect)(function () {
|
|
131
|
+
if (visible && zauiBrand) {
|
|
132
|
+
// antd4以下版本不支持主题色的动态配置
|
|
133
|
+
if (!_antd.ConfigProvider.config) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
_antd.ConfigProvider.config({
|
|
137
|
+
theme: {
|
|
138
|
+
primaryColor: zauiBrand
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}, [zauiBrand]);
|
|
143
|
+
// 主题配置缓存
|
|
144
|
+
(0, _react.useEffect)(function () {
|
|
145
|
+
if (cacheTime) {
|
|
146
|
+
var newThemeConfig = {
|
|
147
|
+
startTime: new Date().getTime(),
|
|
148
|
+
data: (0, _objectSpread2.default)({}, state)
|
|
149
|
+
};
|
|
150
|
+
localStorage.setItem('themeConfig', JSON.stringify(newThemeConfig));
|
|
151
|
+
}
|
|
152
|
+
}, [state, cacheTime]);
|
|
153
|
+
var cls = (0, _classnames2.default)((0, _defineProperty2.default)({
|
|
154
|
+
'pro-theme-tools': true,
|
|
155
|
+
'pro-theme-tools-follow': theme
|
|
156
|
+
}, className, className));
|
|
157
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _objectSpread2.default)({
|
|
158
|
+
className: cls
|
|
159
|
+
}, props), /*#__PURE__*/_react.default.createElement(_icons.SettingOutlined, {
|
|
160
|
+
style: {
|
|
161
|
+
fontSize: "".concat(size, "px"),
|
|
162
|
+
color: color
|
|
163
|
+
},
|
|
164
|
+
onClick: function onClick() {
|
|
165
|
+
showDrawer();
|
|
166
|
+
}
|
|
167
|
+
}), /*#__PURE__*/_react.default.createElement(_component.PrdTools, {
|
|
168
|
+
onReset: onReset,
|
|
169
|
+
onClose: onClose,
|
|
170
|
+
onCopy: onCopy,
|
|
171
|
+
setState: setState,
|
|
172
|
+
visible: visible,
|
|
173
|
+
state: state
|
|
174
|
+
}));
|
|
175
|
+
};
|
|
176
|
+
ProThemeTools.defaultProps = {
|
|
177
|
+
size: 24,
|
|
178
|
+
mode: 'prd',
|
|
179
|
+
color: '#343434',
|
|
180
|
+
theme: false,
|
|
181
|
+
cacheTime: false
|
|
182
|
+
};
|
|
183
|
+
ProThemeTools.setThemes = _index.setThemes;
|
|
184
|
+
var _default = ProThemeTools;
|
|
185
|
+
exports.default = _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface DevToolsPropsType {
|
|
2
|
+
onReset: () => void;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onCopy?: () => void;
|
|
5
|
+
setState: any;
|
|
6
|
+
visible: boolean;
|
|
7
|
+
state: LocalThemeConfigPropsType;
|
|
8
|
+
}
|
|
9
|
+
export interface ProThemeToolsProps {
|
|
10
|
+
size?: number;
|
|
11
|
+
color?: string;
|
|
12
|
+
mode?: 'dev' | 'prd';
|
|
13
|
+
cacheTime?: number | boolean;
|
|
14
|
+
/** 是否跟随主题色 */
|
|
15
|
+
theme?: boolean;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
export interface LocalThemeConfigPropsType {
|
|
19
|
+
zauiBrand?: string;
|
|
20
|
+
zauiText?: string;
|
|
21
|
+
zauiFontSize?: number;
|
|
22
|
+
zauiFormAlign?: string;
|
|
23
|
+
zauiFormRequiredAfter?: string;
|
|
24
|
+
zauiFormRequiredBefore?: string;
|
|
25
|
+
zauiSize?: number;
|
|
26
|
+
zauiHeightCard?: number;
|
|
27
|
+
zauiHeightBorder?: number;
|
|
28
|
+
bigText?: boolean;
|
|
29
|
+
zauiBaseFontSize?: number;
|
|
30
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@import '../component/PrdTools/style/index.less';
|
|
2
|
+
|
|
3
|
+
.pro-theme-tools {
|
|
4
|
+
display: flex;
|
|
5
|
+
|
|
6
|
+
&.pro-theme-tools-follow {
|
|
7
|
+
svg {
|
|
8
|
+
color: var(--zaui-brand, #006aff);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.anticon {
|
|
13
|
+
color: var(--zaui-brand, #006aff);
|
|
14
|
+
|
|
15
|
+
svg {
|
|
16
|
+
font-size: 24px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pro-theme-tools-drawer {
|
|
22
|
+
.ant-drawer-body {
|
|
23
|
+
padding: 32px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ant-space-vertical {
|
|
27
|
+
gap: var(--zaui-space-size-sm, 8px) !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.anticon-question-circle {
|
|
31
|
+
color: var(--zaui-brand, #006aff);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.copy-btn {
|
|
35
|
+
position: absolute;
|
|
36
|
+
width : calc(100% - 64px);
|
|
37
|
+
bottom : 20px;
|
|
38
|
+
left : 32px;
|
|
39
|
+
z-index : 10;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.pro-theme-tools-box {
|
|
43
|
+
display : flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
flex-wrap : wrap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.pro-theme-tools-space {
|
|
49
|
+
margin-bottom: var(--zaui-space-size-md, 16px);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ant-radio-button-wrapper {
|
|
53
|
+
padding: 0 12px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ThemesProps {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* 取主题配置的mapping值, 返回antd可用的主题配置
|
|
6
|
+
* @param themes
|
|
7
|
+
* @param themeMapping
|
|
8
|
+
*/
|
|
9
|
+
export declare const replaceObject: (themes: ThemesProps, themeMapping: ThemesProps) => ThemesProps;
|
|
10
|
+
/**
|
|
11
|
+
* 设置主题变量
|
|
12
|
+
*/
|
|
13
|
+
export declare const setThemes: (themes: ThemesProps, themeMapping?: ThemesProps) => boolean;
|
|
14
|
+
export declare const getKebabCase: (str: string) => string;
|