@zat-design/sisyphus-react 3.4.4 → 3.4.5-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/babel.config.js +3 -0
- package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
- package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
- package/coverage/lcov-report/src/.umi/core/index.html +206 -0
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
- package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
- package/coverage/lcov-report/src/.umi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
- package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
- package/dist/index.esm.css +63 -18
- package/dist/less.esm.css +63 -18
- package/es/ProEditTable/components/RenderField/index.js +3 -2
- package/es/ProEditTable/index.js +13 -2
- package/es/ProEditTable/propsType.d.ts +1 -0
- package/es/ProEditTable/utils/index.js +7 -1
- package/es/ProEnum/components/Group.js +7 -1
- package/es/ProEnum/style/index.less +3 -2
- package/es/ProForm/components/combination/FormList/index.js +5 -5
- package/es/ProForm/components/combination/GroupCopy/component/ComRender.d.ts +14 -0
- package/es/ProForm/components/combination/GroupCopy/component/ComRender.js +36 -0
- package/es/ProForm/components/combination/GroupCopy/index.d.ts +10 -0
- package/es/ProForm/components/combination/GroupCopy/index.js +84 -0
- package/es/ProForm/components/combination/GroupCopy/propsType.d.ts +47 -0
- package/es/ProForm/components/combination/GroupCopy/propsType.js +1 -0
- package/es/ProForm/components/combination/GroupCopy/style/index.less +131 -0
- package/es/ProForm/components/combination/GroupCopy/utils.d.ts +53 -0
- package/es/ProForm/components/combination/GroupCopy/utils.js +180 -0
- package/es/ProForm/components/combination/ProModalSelect/index.js +22 -18
- package/es/ProForm/components/index.js +1 -0
- package/es/ProForm/components/render/Render.js +2 -2
- package/es/ProForm/components/render/propsType.d.ts +1 -1
- package/es/ProIcon/config/index.d.ts +14 -0
- package/es/ProIcon/config/index.js +17 -1
- package/es/ProIcon/index.js +102 -20
- package/es/ProIcon/propsTypes.d.ts +19 -0
- package/es/ProIcon/utils/index.d.ts +1 -0
- package/es/ProIcon/utils/index.js +23 -0
- package/es/ProLayout/components/ProCollapse/index.js +6 -3
- package/es/ProStep/components/Step/index.js +5 -4
- package/es/ProStep/style/index.less +20 -0
- package/es/ProThemeTools/component/PrdTools/index.js +20 -0
- package/es/ProThemeTools/component/PrdTools/style/index.less +56 -48
- package/es/ProTreeModal/index.js +11 -15
- package/es/ProWaterMark/__snapshots__/index.test.tsx.snap +7 -0
- package/es/global.less +38 -2
- package/jest.config.js +8 -0
- package/lib/ProEditTable/components/RenderField/index.js +3 -2
- package/lib/ProEditTable/index.js +13 -2
- package/lib/ProEditTable/propsType.d.ts +1 -0
- package/lib/ProEditTable/utils/index.js +7 -1
- package/lib/ProEnum/components/Group.js +6 -0
- package/lib/ProEnum/style/index.less +3 -2
- package/lib/ProForm/components/combination/FormList/index.js +5 -5
- package/lib/ProForm/components/combination/GroupCopy/component/ComRender.d.ts +14 -0
- package/lib/ProForm/components/combination/GroupCopy/component/ComRender.js +44 -0
- package/lib/ProForm/components/combination/GroupCopy/index.d.ts +10 -0
- package/lib/ProForm/components/combination/GroupCopy/index.js +91 -0
- package/lib/ProForm/components/combination/GroupCopy/propsType.d.ts +47 -0
- package/lib/ProForm/components/combination/GroupCopy/propsType.js +5 -0
- package/lib/ProForm/components/combination/GroupCopy/style/index.less +131 -0
- package/lib/ProForm/components/combination/GroupCopy/utils.d.ts +53 -0
- package/lib/ProForm/components/combination/GroupCopy/utils.js +187 -0
- package/lib/ProForm/components/combination/ProModalSelect/index.js +23 -19
- package/lib/ProForm/components/render/Render.js +2 -2
- package/lib/ProForm/components/render/propsType.d.ts +1 -1
- package/lib/ProIcon/config/index.d.ts +14 -0
- package/lib/ProIcon/config/index.js +18 -2
- package/lib/ProIcon/index.js +99 -19
- package/lib/ProIcon/propsTypes.d.ts +19 -0
- package/lib/ProIcon/utils/index.d.ts +1 -0
- package/lib/ProIcon/utils/index.js +29 -0
- package/lib/ProLayout/components/ProCollapse/index.js +6 -3
- package/lib/ProStep/components/Step/index.js +5 -4
- package/lib/ProStep/style/index.less +20 -0
- package/lib/ProThemeTools/component/PrdTools/index.js +20 -0
- package/lib/ProThemeTools/component/PrdTools/style/index.less +56 -48
- package/lib/ProTreeModal/index.js +11 -15
- package/lib/ProWaterMark/__snapshots__/index.test.tsx.snap +7 -0
- package/lib/global.less +38 -2
- package/package.json +6 -2
- package/test/__mocks__/fileMock.js +0 -0
- package/test/__mocks__/styleMock.js +0 -0
|
@@ -22,7 +22,6 @@ var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames",
|
|
|
22
22
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
23
23
|
import { SearchOutlined } from '@ant-design/icons';
|
|
24
24
|
import { useMount, useSetState } from 'ahooks';
|
|
25
|
-
import { useRequest as useUmiRequest } from 'umi';
|
|
26
25
|
import { cloneDeep, debounce, isArray, isEqual, isFunction, omit } from 'lodash';
|
|
27
26
|
import { ReactSVG } from 'react-svg';
|
|
28
27
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo } from 'react';
|
|
@@ -127,17 +126,22 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
127
126
|
form = _Form$useForm2[0];
|
|
128
127
|
var selectedRows = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || _selectedRows;
|
|
129
128
|
var selectedRowKeys = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || _selectedRowKeys;
|
|
130
|
-
var
|
|
129
|
+
var _useRequestList = useRequestList(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
|
130
|
+
withPagination: withPagination,
|
|
131
|
+
transformParams: transformParams,
|
|
132
|
+
transformResponse: transformResponse
|
|
133
|
+
}, _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
131
134
|
manual: true,
|
|
132
|
-
onSuccess: function onSuccess(
|
|
133
|
-
var
|
|
135
|
+
onSuccess: function onSuccess(res) {
|
|
136
|
+
var _res$data;
|
|
137
|
+
var list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list : res === null || res === void 0 ? void 0 : res.data;
|
|
134
138
|
setState({
|
|
135
139
|
options: list
|
|
136
140
|
});
|
|
137
141
|
}
|
|
138
142
|
})),
|
|
139
|
-
run =
|
|
140
|
-
var
|
|
143
|
+
run = _useRequestList.run;
|
|
144
|
+
var _useRequestList2 = useRequestList(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
|
141
145
|
withPagination: withPagination,
|
|
142
146
|
transformParams: transformParams,
|
|
143
147
|
transformResponse: transformResponse
|
|
@@ -145,13 +149,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
145
149
|
manual: true,
|
|
146
150
|
ready: ((useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || defaultOne) && !readOnly || visible
|
|
147
151
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
|
148
|
-
data =
|
|
149
|
-
loading =
|
|
150
|
-
pagination =
|
|
151
|
-
onSearch =
|
|
152
|
-
onReset =
|
|
153
|
-
runAsync =
|
|
154
|
-
mutate =
|
|
152
|
+
data = _useRequestList2.data,
|
|
153
|
+
loading = _useRequestList2.loading,
|
|
154
|
+
pagination = _useRequestList2.pagination,
|
|
155
|
+
onSearch = _useRequestList2.onSearch,
|
|
156
|
+
onReset = _useRequestList2.onReset,
|
|
157
|
+
runAsync = _useRequestList2.runAsync,
|
|
158
|
+
mutate = _useRequestList2.mutate;
|
|
155
159
|
var defaultOptionRender = function defaultOptionRender(rowData) {
|
|
156
160
|
return rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
|
|
157
161
|
};
|
|
@@ -423,7 +427,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
423
427
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
424
428
|
var getInitValues = /*#__PURE__*/function () {
|
|
425
429
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
426
|
-
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$
|
|
430
|
+
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data2, _data2, nextSelectRowKeys;
|
|
427
431
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
428
432
|
while (1) switch (_context4.prev = _context4.next) {
|
|
429
433
|
case 0:
|
|
@@ -452,7 +456,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
452
456
|
if (transformResponse) {
|
|
453
457
|
list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
|
|
454
458
|
} else {
|
|
455
|
-
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$
|
|
459
|
+
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list : res === null || res === void 0 ? void 0 : res.data;
|
|
456
460
|
}
|
|
457
461
|
_data2 = isMultiple ? list : (_list = list) === null || _list === void 0 ? void 0 : _list[0];
|
|
458
462
|
if (_data2) {
|
|
@@ -489,7 +493,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
489
493
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
|
490
494
|
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
491
495
|
var _useRequest$options4, _useRequest$options5;
|
|
492
|
-
var queryBean, page, params, res, _list2, list, _res$
|
|
496
|
+
var queryBean, page, params, res, _list2, list, _res$data3, _data3, nextSelectRowKeys;
|
|
493
497
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
494
498
|
while (1) switch (_context5.prev = _context5.next) {
|
|
495
499
|
case 0:
|
|
@@ -511,7 +515,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
511
515
|
if (transformResponse) {
|
|
512
516
|
list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
|
|
513
517
|
} else {
|
|
514
|
-
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$
|
|
518
|
+
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list : res === null || res === void 0 ? void 0 : res.data;
|
|
515
519
|
}
|
|
516
520
|
_data3 = isMultiple ? list : (_list2 = list) === null || _list2 === void 0 ? void 0 : _list2[0];
|
|
517
521
|
nextSelectRowKeys = isMultiple ? value : [value];
|
|
@@ -670,7 +674,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
670
674
|
// 没有值的时候,初始化点击默认查询前五十条
|
|
671
675
|
if (!value && isInit || !(options === null || options === void 0 ? void 0 : options.length)) {
|
|
672
676
|
var _useRequest$options9;
|
|
673
|
-
var queryBean = useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options9 = useRequest.options) === null || _useRequest$options9 === void 0 ? void 0 : _useRequest$options9.defaultParams;
|
|
677
|
+
var queryBean = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options9 = useRequest.options) === null || _useRequest$options9 === void 0 ? void 0 : _useRequest$options9.defaultParams) || {};
|
|
674
678
|
var params = withPagination ? {
|
|
675
679
|
pageNum: 1,
|
|
676
680
|
pageSize: 50,
|
|
@@ -21,6 +21,7 @@ export { default as ProModalSelect } from './combination/ProModalSelect';
|
|
|
21
21
|
export { default as ProTimeLimit } from './combination/ProTimeLimit';
|
|
22
22
|
export { default as ProRangeLimit } from './combination/ProRangeLimit';
|
|
23
23
|
export { default as Group } from './combination/Group';
|
|
24
|
+
// export { default as GroupCopy } from './combination/GroupCopy';
|
|
24
25
|
export { default as ProCollapse } from './combination/Container';
|
|
25
26
|
export { default as Container } from './combination/Container';
|
|
26
27
|
export { default as ProEnum } from '../../ProEnum';
|
|
@@ -155,9 +155,9 @@ var Render = function Render(props) {
|
|
|
155
155
|
Object.assign(otherFormItemProps, transforms, {
|
|
156
156
|
names: otherProps.names
|
|
157
157
|
}, internalRule, {
|
|
158
|
-
required: typeof labelRequired === 'boolean' ? labelRequired : _required || (rules === null || rules === void 0 ? void 0 : rules.some(function (item) {
|
|
158
|
+
required: typeof labelRequired === 'boolean' ? labelRequired : _required || Array.isArray(rules) && (rules === null || rules === void 0 ? void 0 : rules.some(function (item) {
|
|
159
159
|
return item === null || item === void 0 ? void 0 : item.required;
|
|
160
|
-
}))
|
|
160
|
+
})) || false
|
|
161
161
|
}, otherProps.isView && !requiredOnView ? {
|
|
162
162
|
required: false
|
|
163
163
|
} : null, _objectSpread({}, isTrim(type, trim, useProConfig())), // 优先取传进来的,其次取ProConfigProvider配置的
|
|
@@ -52,7 +52,7 @@ interface ControlProps {
|
|
|
52
52
|
/**
|
|
53
53
|
* 扩展函数的参数
|
|
54
54
|
*/
|
|
55
|
-
type FunctionArgs<Values, R = any> = (value: any, record: any, { form, index, namePath, option, selectedOptions, dateString, }: {
|
|
55
|
+
export type FunctionArgs<Values, R = any> = (value: any, record: any, { form, index, namePath, option, selectedOptions, dateString, }: {
|
|
56
56
|
form: FormInstance<Values>;
|
|
57
57
|
index?: number;
|
|
58
58
|
namePath?: NamePath;
|
|
@@ -3,3 +3,17 @@ export declare const iconMap: {
|
|
|
3
3
|
'text-cn': string;
|
|
4
4
|
'text-en': string;
|
|
5
5
|
}[];
|
|
6
|
+
export declare const themeMap: {
|
|
7
|
+
'#006AFF': string[];
|
|
8
|
+
'#00BC70': string[];
|
|
9
|
+
'#FF8C16': string[];
|
|
10
|
+
'#A00F20': string[];
|
|
11
|
+
'#31AF96': string[];
|
|
12
|
+
};
|
|
13
|
+
export declare const themeFillMap: {
|
|
14
|
+
'#006AFF': string[];
|
|
15
|
+
'#00BC70': string[];
|
|
16
|
+
'#FF8C16': string[];
|
|
17
|
+
'#A00F20': string[];
|
|
18
|
+
'#31AF96': string[];
|
|
19
|
+
};
|
|
@@ -254,4 +254,20 @@ export var iconMap = [{
|
|
|
254
254
|
type: 'tiaozhengxuhao',
|
|
255
255
|
'text-cn': '调整序号',
|
|
256
256
|
'text-en': 'adjust order'
|
|
257
|
-
}];
|
|
257
|
+
}];
|
|
258
|
+
// 渐变色icon预设
|
|
259
|
+
export var themeMap = {
|
|
260
|
+
'#006AFF': ['#ADDDFF', '#5FB3D8', '#4181FF'],
|
|
261
|
+
'#00BC70': ['#FFFFFF', '#54DFA7', '#00BC70'],
|
|
262
|
+
'#FF8C16': ['#FFFFFF', '#FFA74E', '#FF8C17'],
|
|
263
|
+
'#A00F20': ['#FFFFFF', '#E47B7B', '#A00E20'],
|
|
264
|
+
'#31AF96': ['#5FD8C7', '#5FD8C7', '#31AF96']
|
|
265
|
+
};
|
|
266
|
+
// 双色icon预设
|
|
267
|
+
export var themeFillMap = {
|
|
268
|
+
'#006AFF': ['none', '#87F1FC', 'black', '#4181FF'],
|
|
269
|
+
'#00BC70': ['none', '#05FFEC', 'black', '#00BC70'],
|
|
270
|
+
'#FF8C16': ['none', '#FED736', 'black', '#FF8C17'],
|
|
271
|
+
'#A00F20': ['none', '#FD8357', 'black', '#A00E20'],
|
|
272
|
+
'#31AF96': ['none', '#BBF392', 'black', '#31AF96']
|
|
273
|
+
};
|
package/es/ProIcon/index.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import "antd/es/button/style";
|
|
2
2
|
import _Button from "antd/es/button";
|
|
3
|
+
import "antd/es/tooltip/style";
|
|
4
|
+
import _Tooltip from "antd/es/tooltip";
|
|
3
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
|
-
var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList"];
|
|
7
|
+
var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList", "src", "actionMap"];
|
|
6
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
9
|
import { useExternal } from 'ahooks';
|
|
8
10
|
import classNames from 'classnames';
|
|
9
11
|
import { uniqBy } from 'lodash';
|
|
12
|
+
import { ReactSVG } from 'react-svg';
|
|
13
|
+
import { useMemo } from 'react';
|
|
10
14
|
import { useProConfig } from '../ProConfigProvider';
|
|
11
|
-
import { iconMap } from './config';
|
|
15
|
+
import { iconMap, themeMap, themeFillMap } from './config';
|
|
16
|
+
import { recurseGetNodes } from './utils';
|
|
12
17
|
import locale from '../locale';
|
|
13
18
|
var ProIcon = function ProIcon(props) {
|
|
14
|
-
var
|
|
19
|
+
var _useProConfig = useProConfig(),
|
|
20
|
+
state = _useProConfig.state;
|
|
21
|
+
var config = state.ProIcon,
|
|
22
|
+
antdTheme = state.theme;
|
|
15
23
|
var _config = _objectSpread(_objectSpread({}, config), props !== null && props !== void 0 ? props : {});
|
|
16
24
|
var _config$type = _config.type,
|
|
17
25
|
type = _config$type === void 0 ? null : _config$type,
|
|
@@ -35,14 +43,17 @@ var ProIcon = function ProIcon(props) {
|
|
|
35
43
|
children = _config.children,
|
|
36
44
|
_config$mapList = _config.mapList,
|
|
37
45
|
mapList = _config$mapList === void 0 ? [] : _config$mapList,
|
|
46
|
+
src = _config.src,
|
|
47
|
+
actionMap = _config.actionMap,
|
|
38
48
|
reset = _objectWithoutProperties(_config, _excluded);
|
|
49
|
+
// 主题色
|
|
50
|
+
var _ref = antdTheme !== null && antdTheme !== void 0 ? antdTheme : {},
|
|
51
|
+
_ref$primaryColor = _ref.primaryColor,
|
|
52
|
+
primaryColor = _ref$primaryColor === void 0 ? '#006AFF' : _ref$primaryColor;
|
|
39
53
|
// 语言
|
|
40
54
|
var language = locale.ProIcon.language;
|
|
41
55
|
// 加载内部icon
|
|
42
|
-
|
|
43
|
-
if (status !== 'ready') {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
56
|
+
useExternal('https://at.alicdn.com/t/c/font_4063056_jmnz9g5uycp.js');
|
|
46
57
|
var rotateStyle = rotate ? {
|
|
47
58
|
msTransform: "rotate(".concat(rotate, "deg)"),
|
|
48
59
|
transform: "rotate(".concat(rotate, "deg)")
|
|
@@ -64,6 +75,8 @@ var ProIcon = function ProIcon(props) {
|
|
|
64
75
|
var mergedMapList = uniqBy(mapList.concat(iconMap), targetTextFill);
|
|
65
76
|
var _type = type;
|
|
66
77
|
var _text = children;
|
|
78
|
+
// svg图标对应文本
|
|
79
|
+
var iconText = '';
|
|
67
80
|
var typeIsExistAndIncludeEnglish = _type && /[a-zA-Z]/.test(_type);
|
|
68
81
|
// 模式为icon下,对传入的text进行指定语言-icon 映射
|
|
69
82
|
if (isIconMode && !type) {
|
|
@@ -73,6 +86,7 @@ var ProIcon = function ProIcon(props) {
|
|
|
73
86
|
});
|
|
74
87
|
if (target) {
|
|
75
88
|
_type = target === null || target === void 0 ? void 0 : target.type;
|
|
89
|
+
iconText = target[targetTextFill];
|
|
76
90
|
}
|
|
77
91
|
}
|
|
78
92
|
}
|
|
@@ -87,27 +101,95 @@ var ProIcon = function ProIcon(props) {
|
|
|
87
101
|
}
|
|
88
102
|
}
|
|
89
103
|
}
|
|
104
|
+
var svgProps = {
|
|
105
|
+
className: proIconClassNames,
|
|
106
|
+
fill: 'currentColor',
|
|
107
|
+
style: _objectSpread(_objectSpread({
|
|
108
|
+
width: size,
|
|
109
|
+
height: size
|
|
110
|
+
}, rotateStyle), style)
|
|
111
|
+
};
|
|
90
112
|
var RenderIcon = _jsx("span", _objectSpread(_objectSpread({
|
|
91
113
|
className: "anticon",
|
|
92
114
|
style: {
|
|
93
115
|
color: color
|
|
94
116
|
}
|
|
95
117
|
}, reset), {}, {
|
|
96
|
-
children: _jsx(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
118
|
+
children: _jsx(_Tooltip, {
|
|
119
|
+
title: iconText,
|
|
120
|
+
children: !src ? _jsx("svg", _objectSpread(_objectSpread({}, svgProps), {}, {
|
|
121
|
+
onClick: onClick,
|
|
122
|
+
"aria-hidden": "true",
|
|
123
|
+
children: _jsx("use", {
|
|
124
|
+
xlinkHref: "#icon-".concat(_type)
|
|
125
|
+
})
|
|
126
|
+
})) : _jsx(ReactSVG, _objectSpread(_objectSpread({}, svgProps), {}, {
|
|
127
|
+
// @ts-ignore
|
|
128
|
+
onClick: onClick,
|
|
129
|
+
"aria-hidden": "true",
|
|
130
|
+
src: src,
|
|
131
|
+
beforeInjection: function beforeInjection(svg) {
|
|
132
|
+
if (actionMap && svg) {
|
|
133
|
+
var _actionMap$themeMap, _actionMap$themeFillM, _actionMap$gradation, _actionMap$fill;
|
|
134
|
+
// 项目内置的四种主题匹配渐变色
|
|
135
|
+
var mergeThemeMap = _objectSpread(_objectSpread({}, themeMap), (_actionMap$themeMap = actionMap.themeMap) !== null && _actionMap$themeMap !== void 0 ? _actionMap$themeMap : {});
|
|
136
|
+
// 项目内置的四种双色匹配fill
|
|
137
|
+
var mergeFillThemeMap = _objectSpread(_objectSpread({}, themeFillMap), (_actionMap$themeFillM = actionMap.themeFillMap) !== null && _actionMap$themeFillM !== void 0 ? _actionMap$themeFillM : {});
|
|
138
|
+
var _gradList = mergeThemeMap[primaryColor];
|
|
139
|
+
var _fillList = mergeFillThemeMap[primaryColor];
|
|
140
|
+
// 渐变操作序列
|
|
141
|
+
var gradList = (_actionMap$gradation = actionMap === null || actionMap === void 0 ? void 0 : actionMap.gradation) !== null && _actionMap$gradation !== void 0 ? _actionMap$gradation : _gradList;
|
|
142
|
+
// 填充操作序列
|
|
143
|
+
var fillList = (_actionMap$fill = actionMap === null || actionMap === void 0 ? void 0 : actionMap.fill) !== null && _actionMap$fill !== void 0 ? _actionMap$fill : _fillList;
|
|
144
|
+
// 节点收集
|
|
145
|
+
var nodeMap = {
|
|
146
|
+
// 渐变色节点收集
|
|
147
|
+
gradation: [],
|
|
148
|
+
// 具有fill属性的节点收集
|
|
149
|
+
fill: []
|
|
150
|
+
};
|
|
151
|
+
// 目前只支持处理渐变及fill填充
|
|
152
|
+
var types = Reflect.ownKeys(nodeMap !== null && nodeMap !== void 0 ? nodeMap : {});
|
|
153
|
+
types.forEach(function (typeKey) {
|
|
154
|
+
recurseGetNodes(typeKey, svg, nodeMap[typeKey]);
|
|
155
|
+
});
|
|
156
|
+
if ((gradList === null || gradList === void 0 ? void 0 : gradList.length) > 0) {
|
|
157
|
+
nodeMap.gradation.forEach(function (item, index) {
|
|
158
|
+
// 下一步准备替换的
|
|
159
|
+
var nextStr = gradList[index];
|
|
160
|
+
// 属性原本的值
|
|
161
|
+
var originStr = item.getAttribute('stop-color');
|
|
162
|
+
if (nextStr && originStr !== nextStr) {
|
|
163
|
+
item.setAttribute('stop-color', nextStr);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
if ((fillList === null || fillList === void 0 ? void 0 : fillList.length) > 0) {
|
|
168
|
+
nodeMap.fill.forEach(function (item, index) {
|
|
169
|
+
// 默认接收的
|
|
170
|
+
var receiveStr = fillList[index];
|
|
171
|
+
// 下一步准备替换的
|
|
172
|
+
var nextFillStr = receiveStr === 'theme' ? primaryColor : receiveStr;
|
|
173
|
+
// 属性原本的值
|
|
174
|
+
var originFill = item.getAttribute('fill');
|
|
175
|
+
// 如果包含url(则是内链,不作替换处理
|
|
176
|
+
if (!(originFill && originFill.includes('url(')) && nextFillStr) {
|
|
177
|
+
// 不同才替换
|
|
178
|
+
if (originFill !== nextFillStr) {
|
|
179
|
+
item.setAttribute('fill', nextFillStr);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}))
|
|
108
187
|
})
|
|
109
188
|
}));
|
|
110
|
-
|
|
189
|
+
var _RenderIcon = useMemo(function () {
|
|
190
|
+
return RenderIcon;
|
|
191
|
+
}, [primaryColor]);
|
|
192
|
+
return !isExtendButtonMode ? _RenderIcon : _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({
|
|
111
193
|
type: isIconMode ? 'text' : (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type) || 'link',
|
|
112
194
|
className: proIconClassNames,
|
|
113
195
|
disabled: disabled,
|
|
@@ -6,7 +6,21 @@ interface iconMap {
|
|
|
6
6
|
'text-cn'?: string;
|
|
7
7
|
'text-en'?: string;
|
|
8
8
|
}
|
|
9
|
+
interface themeMap {
|
|
10
|
+
[key: string]: string[];
|
|
11
|
+
}
|
|
12
|
+
interface actionMap {
|
|
13
|
+
themeMap?: themeMap;
|
|
14
|
+
themeFillMap?: themeMap;
|
|
15
|
+
gradation?: string[];
|
|
16
|
+
fill?: string[];
|
|
17
|
+
}
|
|
9
18
|
export interface ProIconProps {
|
|
19
|
+
/**
|
|
20
|
+
* @description 本地import引入
|
|
21
|
+
* @default ""
|
|
22
|
+
*/
|
|
23
|
+
src?: string;
|
|
10
24
|
/**
|
|
11
25
|
* @description 图标的名称
|
|
12
26
|
* @default -
|
|
@@ -75,5 +89,10 @@ export interface ProIconProps {
|
|
|
75
89
|
* @default 项目内认默映射
|
|
76
90
|
*/
|
|
77
91
|
mapList?: iconMap[];
|
|
92
|
+
/**
|
|
93
|
+
* @description svg变更操作表 请到 ProThemeTools 主题配置查看示例
|
|
94
|
+
* @default
|
|
95
|
+
*/
|
|
96
|
+
actionMap?: actionMap;
|
|
78
97
|
}
|
|
79
98
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const recurseGetNodes: (type: any, node: any, queue: any) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export var recurseGetNodes = function recurseGetNodes(type, node, queue) {
|
|
2
|
+
switch (type) {
|
|
3
|
+
// 渐变
|
|
4
|
+
case 'gradation':
|
|
5
|
+
if (node.nodeName === 'stop' && node.getAttribute('stop-color')) {
|
|
6
|
+
queue.push(node);
|
|
7
|
+
}
|
|
8
|
+
break;
|
|
9
|
+
// 填充
|
|
10
|
+
case 'fill':
|
|
11
|
+
if (node.getAttribute && node.getAttribute('fill')) {
|
|
12
|
+
queue.push(node);
|
|
13
|
+
}
|
|
14
|
+
break;
|
|
15
|
+
default:
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
if (node.childNodes) {
|
|
19
|
+
for (var i = 0; i < node.childNodes.length; i++) {
|
|
20
|
+
recurseGetNodes(type, node.childNodes[i], queue);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -10,9 +10,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
import { useLayoutEffect } from 'react';
|
|
11
11
|
import { CaretRightOutlined } from '@ant-design/icons';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
|
-
import { ReactSVG } from 'react-svg';
|
|
14
13
|
import { isBoolean } from 'lodash';
|
|
15
14
|
import foldSvg from '../../../assets/fold.svg';
|
|
15
|
+
import ProIcon from '../../../ProIcon/index';
|
|
16
16
|
var Panel = _Collapse.Panel;
|
|
17
17
|
var ProCollapse = function ProCollapse(props) {
|
|
18
18
|
var title = props.title,
|
|
@@ -77,8 +77,11 @@ var ProCollapse = function ProCollapse(props) {
|
|
|
77
77
|
align: "center",
|
|
78
78
|
children: [_jsx("div", {
|
|
79
79
|
className: "pro-collapse-icon",
|
|
80
|
-
children: isBoolean(icon) ? _jsx(
|
|
81
|
-
src: foldSvg
|
|
80
|
+
children: isBoolean(icon) ? _jsx(ProIcon, {
|
|
81
|
+
src: foldSvg,
|
|
82
|
+
actionMap: {
|
|
83
|
+
fill: []
|
|
84
|
+
}
|
|
82
85
|
}) : icon
|
|
83
86
|
}), title]
|
|
84
87
|
});
|
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import React, { useMemo, useState } from 'react';
|
|
5
5
|
import { cloneDeep } from 'lodash';
|
|
6
|
-
import
|
|
6
|
+
import ProIcon from '../../../ProIcon/index';
|
|
7
7
|
import catalogSvg from '../../../assets/catalog.svg';
|
|
8
8
|
import Anchor from '../Anchor';
|
|
9
9
|
import locale from '../../../locale';
|
|
@@ -59,10 +59,11 @@ export var Step = function Step(_ref) {
|
|
|
59
59
|
onMouseLeave: handleMouseLeave,
|
|
60
60
|
children: [_jsxs("div", {
|
|
61
61
|
className: "step-menu",
|
|
62
|
-
children: [_jsx(
|
|
62
|
+
children: [_jsx(ProIcon, {
|
|
63
|
+
src: catalogSvg,
|
|
63
64
|
className: "menu-icon",
|
|
64
|
-
|
|
65
|
-
}),
|
|
65
|
+
actionMap: {}
|
|
66
|
+
}), true && _jsx("div", {
|
|
66
67
|
children: locale === null || locale === void 0 ? void 0 : (_locale$ProStep = locale.ProStep) === null || _locale$ProStep === void 0 ? void 0 : _locale$ProStep.catalogue
|
|
67
68
|
})]
|
|
68
69
|
}), options.map(function (item) {
|
|
@@ -27,6 +27,26 @@
|
|
|
27
27
|
height: 48px;
|
|
28
28
|
font-size: var(--zaui-font-size-lg, 16px);
|
|
29
29
|
border-bottom: 1px solid var(--zaui-line, #dddddd);
|
|
30
|
+
> .anticon {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
width: 48px;
|
|
35
|
+
height: 24px;
|
|
36
|
+
> .menu-icon {
|
|
37
|
+
width: auto !important;
|
|
38
|
+
height: auto !important;
|
|
39
|
+
font-size: var(--zaui-font-size-lg-title, 24px);
|
|
40
|
+
fill: var(--zaui-brand, #006aff);
|
|
41
|
+
> div {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
width: 48px;
|
|
46
|
+
height: 24px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
30
50
|
|
|
31
51
|
> .menu-icon {
|
|
32
52
|
font-size: var(--zaui-font-size-lg-title, 24px);
|
|
@@ -46,6 +46,9 @@ var PrdTools = function PrdTools(_ref) {
|
|
|
46
46
|
}, {
|
|
47
47
|
color: '#A00F20',
|
|
48
48
|
active: false
|
|
49
|
+
}, {
|
|
50
|
+
color: '#31AF96',
|
|
51
|
+
active: false
|
|
49
52
|
}]),
|
|
50
53
|
_useState2 = _slicedToArray(_useState, 2),
|
|
51
54
|
active = _useState2[0],
|
|
@@ -65,8 +68,17 @@ var PrdTools = function PrdTools(_ref) {
|
|
|
65
68
|
};
|
|
66
69
|
});
|
|
67
70
|
setActive(newArray);
|
|
71
|
+
dispatch({
|
|
72
|
+
type: 'set',
|
|
73
|
+
payload: {
|
|
74
|
+
theme: {
|
|
75
|
+
primaryColor: zauiBrand
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
68
79
|
}
|
|
69
80
|
}, []);
|
|
81
|
+
console.log('我看看zg', active);
|
|
70
82
|
return _jsxs(NewDrawer, {
|
|
71
83
|
className: "pro-theme-prd-tools-drawer",
|
|
72
84
|
width: 400,
|
|
@@ -105,6 +117,14 @@ var PrdTools = function PrdTools(_ref) {
|
|
|
105
117
|
setThemes({
|
|
106
118
|
'zaui-brand': item.color
|
|
107
119
|
});
|
|
120
|
+
dispatch({
|
|
121
|
+
type: 'set',
|
|
122
|
+
payload: {
|
|
123
|
+
theme: {
|
|
124
|
+
primaryColor: item.color
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
108
128
|
},
|
|
109
129
|
children: item.active ? _jsx(CheckOutlined, {}) : null
|
|
110
130
|
}, item.color);
|