@zat-design/sisyphus-react 3.4.4 → 3.4.5-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +70 -19
- package/dist/less.esm.css +70 -19
- package/es/ProConfigProvider/index.d.ts +2 -2
- package/es/ProConfigProvider/index.js +0 -3
- package/es/ProEditTable/components/RenderField/index.js +10 -9
- package/es/ProEditTable/index.js +14 -3
- 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/Container/index.js +3 -2
- package/es/ProForm/components/combination/Container/style/index.less +5 -1
- 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/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/{ProAddressBar → ProCascader}/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProCascader/index.js +255 -0
- package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +8 -6
- package/es/ProForm/components/combination/ProCascader/propsType.js +1 -0
- package/es/ProForm/components/combination/ProModalSelect/index.js +25 -22
- package/es/ProForm/components/index.d.ts +1 -2
- package/es/ProForm/components/index.js +1 -3
- package/es/ProForm/components/render/Render.js +3 -3
- package/es/ProForm/components/render/propsType.d.ts +4 -8
- package/es/ProForm/index.js +2 -2
- package/es/ProForm/style/index.less +1 -1
- package/es/ProForm/utils/index.js +1 -1
- package/es/ProIcon/config/index.d.ts +14 -0
- package/es/ProIcon/config/index.js +17 -1
- package/es/ProIcon/index.js +134 -26
- package/es/ProIcon/propsTypes.d.ts +24 -0
- package/es/ProIcon/utils/index.d.ts +6 -0
- package/es/ProIcon/utils/index.js +83 -0
- package/es/ProLayout/components/ProCollapse/index.js +6 -3
- package/es/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/es/ProSelect/index.js +1 -1
- package/es/ProStep/components/Step/index.js +5 -4
- package/es/ProStep/style/index.less +20 -0
- package/es/ProTable/utils.js +6 -3
- package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +30 -4
- 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/ProConfigProvider/index.d.ts +2 -2
- package/lib/ProConfigProvider/index.js +0 -3
- package/lib/ProEditTable/components/RenderField/index.js +9 -8
- package/lib/ProEditTable/index.js +14 -3
- 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/Container/index.js +3 -2
- package/lib/ProForm/components/combination/Container/style/index.less +5 -1
- 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/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/{ProAddressBar → ProCascader}/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProCascader/index.js +255 -0
- package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +8 -6
- package/lib/ProForm/components/combination/ProCascader/propsType.js +5 -0
- package/lib/ProForm/components/combination/ProModalSelect/index.js +26 -23
- package/lib/ProForm/components/index.d.ts +1 -2
- package/lib/ProForm/components/index.js +1 -8
- package/lib/ProForm/components/render/Render.js +3 -3
- package/lib/ProForm/components/render/propsType.d.ts +4 -8
- package/lib/ProForm/index.js +1 -1
- package/lib/ProForm/style/index.less +1 -1
- package/lib/ProForm/utils/index.js +1 -1
- package/lib/ProIcon/config/index.d.ts +14 -0
- package/lib/ProIcon/config/index.js +18 -2
- package/lib/ProIcon/index.js +132 -26
- package/lib/ProIcon/propsTypes.d.ts +24 -0
- package/lib/ProIcon/utils/index.d.ts +6 -0
- package/lib/ProIcon/utils/index.js +90 -0
- package/lib/ProLayout/components/ProCollapse/index.js +6 -3
- package/lib/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/lib/ProSelect/index.js +1 -1
- package/lib/ProStep/components/Step/index.js +5 -4
- package/lib/ProStep/style/index.less +20 -0
- package/lib/ProTable/utils.js +6 -3
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +30 -4
- 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
- package/es/ProForm/components/base/ProCascader/index.d.ts +0 -14
- package/es/ProForm/components/base/ProCascader/index.js +0 -72
- package/es/ProForm/components/combination/ProAddressBar/index.js +0 -437
- package/lib/ProForm/components/base/ProCascader/index.d.ts +0 -14
- package/lib/ProForm/components/base/ProCascader/index.js +0 -78
- package/lib/ProForm/components/combination/ProAddressBar/index.js +0 -437
- /package/es/ProForm/components/combination/{ProAddressBar → GroupCopy}/propsType.js +0 -0
- /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
- /package/lib/ProForm/components/combination/{ProAddressBar → GroupCopy}/propsType.js +0 -0
- /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
|
@@ -16,8 +16,7 @@ import { Props as TimePickerProps } from '../base/TimePicker';
|
|
|
16
16
|
import { Props as SwitchProps } from '../base/Switch';
|
|
17
17
|
import { Props as SwitchCheckboxProps } from '../base/SwitchCheckbox';
|
|
18
18
|
import { Props as TextAreaProps } from '../base/TextArea';
|
|
19
|
-
import {
|
|
20
|
-
import { AddressProps } from '../combination/ProAddressBar/propsType';
|
|
19
|
+
import { ProCascaderProps } from '../combination/ProCascader/propsType';
|
|
21
20
|
import { ProCombinationProps } from '../combination/ProCombination/propsType';
|
|
22
21
|
import { ProModalSelectPropsType as ProModalSelectProps } from '../combination/ProModalSelect/propsType';
|
|
23
22
|
import { ProNumberRangeProps } from '../combination/ProNumberRange/propsType';
|
|
@@ -52,7 +51,7 @@ interface ControlProps {
|
|
|
52
51
|
/**
|
|
53
52
|
* 扩展函数的参数
|
|
54
53
|
*/
|
|
55
|
-
type FunctionArgs<Values, R = any> = (value: any, record: any, { form, index, namePath, option, selectedOptions, dateString, }: {
|
|
54
|
+
export type FunctionArgs<Values, R = any> = (value: any, record: any, { form, index, namePath, option, selectedOptions, dateString, }: {
|
|
56
55
|
form: FormInstance<Values>;
|
|
57
56
|
index?: number;
|
|
58
57
|
namePath?: NamePath;
|
|
@@ -123,8 +122,8 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
|
|
|
123
122
|
type?: 'TextArea';
|
|
124
123
|
fieldProps?: FieldProps<TextAreaProps, Values, T>;
|
|
125
124
|
} | {
|
|
126
|
-
type?: '
|
|
127
|
-
fieldProps?: FieldProps<
|
|
125
|
+
type?: 'ProCascader';
|
|
126
|
+
fieldProps?: FieldProps<ProCascaderProps, Values, T>;
|
|
128
127
|
} | {
|
|
129
128
|
type?: 'ProCombination';
|
|
130
129
|
fieldProps?: FieldProps<ProCombinationProps, Values, T>;
|
|
@@ -155,9 +154,6 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
|
|
|
155
154
|
} | {
|
|
156
155
|
type?: 'ProUpload';
|
|
157
156
|
fieldProps?: FieldProps<ProUploadProps, Values, T>;
|
|
158
|
-
} | {
|
|
159
|
-
type?: 'ProCascader';
|
|
160
|
-
fieldProps?: FieldProps<ProCascaderProps<any, any[], any>, Values, T>;
|
|
161
157
|
} | {
|
|
162
158
|
type?: 'ProTree';
|
|
163
159
|
fieldProps?: FieldProps<ProTreeProps, Values, T>;
|
package/es/ProForm/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { DoubleLeftOutlined } from '@ant-design/icons';
|
|
|
18
18
|
import classnames from 'classnames';
|
|
19
19
|
import React, { forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
20
20
|
import { isObject, isString, merge } from 'lodash';
|
|
21
|
-
import { FormFooter, InputRange, ProAddress,
|
|
21
|
+
import { FormFooter, InputRange, ProAddress, ProCascader, ProCertNo, ProCertValidity, ProCombination, ProModalSelect, ProNumberRange, ProRangeBox, ProTimeLimit, transferAddressInfoToRegion, ProUpload, ProTreeModal, ProTree, EnumSelect } from './components';
|
|
22
22
|
import RenderFields from './components/render/RenderFields';
|
|
23
23
|
import { useProConfig, useContextForms } from '../ProConfigProvider';
|
|
24
24
|
import { getLayout, splitNameStr, useControlled, initialValuesToNames } from './utils/index';
|
|
@@ -313,7 +313,7 @@ ProFormForward.Provider = ProFormProvider; // 包装Provider
|
|
|
313
313
|
ProFormForward.useFieldProps = useFieldProps; // 获取每个字段的其他参数 -otherProps
|
|
314
314
|
ProFormForward.useContextForms = useContextForms; // 获取 ProConfigProvider中的表单实例map
|
|
315
315
|
// 内置组合
|
|
316
|
-
ProFormForward.
|
|
316
|
+
ProFormForward.ProCascader = ProCascader;
|
|
317
317
|
ProFormForward.ProCombination = ProCombination;
|
|
318
318
|
ProFormForward.ProNumberRange = ProNumberRange;
|
|
319
319
|
ProFormForward.ProModalSelect = ProModalSelect;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@import '../components/base/TextArea/index.less';
|
|
5
5
|
@import '../components/combination/FormList/style/index.less';
|
|
6
6
|
@import '../components/combination/ProTimeLimit/style/index.less';
|
|
7
|
-
@import '../components/combination/
|
|
7
|
+
@import '../components/combination/ProCascader/style/index.less';
|
|
8
8
|
@import '../components/combination/ProNumberRange/style/index.less';
|
|
9
9
|
@import '../components/combination/ProModalSelect/style/index.less';
|
|
10
10
|
@import '../components/combination/Group/style/index.less';
|
|
@@ -43,7 +43,7 @@ export var useControlled = function useControlled(props) {
|
|
|
43
43
|
export var isSelect = function isSelect(props) {
|
|
44
44
|
var dataSource = props.dataSource,
|
|
45
45
|
type = props.type;
|
|
46
|
-
return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || ['Select', 'ProSelect', 'ProEnum', 'DatePicker', 'RangePicker', '
|
|
46
|
+
return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || ['Select', 'ProSelect', 'ProEnum', 'DatePicker', 'RangePicker', 'ProCascader', 'ProTimeLimit', 'ProModalSelect', 'ProTreeModal', 'ProUpload', 'TimePicker'].includes(type);
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* Input TextArea 移除前后空格
|
|
@@ -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,28 @@
|
|
|
1
1
|
import "antd/es/button/style";
|
|
2
2
|
import _Button from "antd/es/button";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import "antd/es/tooltip/style";
|
|
5
|
+
import _Tooltip from "antd/es/tooltip";
|
|
3
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
7
|
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"];
|
|
8
|
+
var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList", "src", "actionMap", "tooltip"];
|
|
6
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
10
|
import { useExternal } from 'ahooks';
|
|
8
11
|
import classNames from 'classnames';
|
|
9
12
|
import { uniqBy } from 'lodash';
|
|
13
|
+
import { ReactSVG } from 'react-svg';
|
|
14
|
+
import { useEffect, useMemo } from 'react';
|
|
10
15
|
import { useProConfig } from '../ProConfigProvider';
|
|
11
16
|
import { iconMap } from './config';
|
|
17
|
+
import { onBeforeInjection } from './utils';
|
|
12
18
|
import locale from '../locale';
|
|
13
19
|
var ProIcon = function ProIcon(props) {
|
|
14
|
-
var
|
|
20
|
+
var _window, _window2;
|
|
21
|
+
var _useProConfig = useProConfig(),
|
|
22
|
+
state = _useProConfig.state,
|
|
23
|
+
dispatch = _useProConfig.dispatch;
|
|
24
|
+
var config = state.ProIcon,
|
|
25
|
+
antdTheme = state.theme;
|
|
15
26
|
var _config = _objectSpread(_objectSpread({}, config), props !== null && props !== void 0 ? props : {});
|
|
16
27
|
var _config$type = _config.type,
|
|
17
28
|
type = _config$type === void 0 ? null : _config$type,
|
|
@@ -35,14 +46,24 @@ var ProIcon = function ProIcon(props) {
|
|
|
35
46
|
children = _config.children,
|
|
36
47
|
_config$mapList = _config.mapList,
|
|
37
48
|
mapList = _config$mapList === void 0 ? [] : _config$mapList,
|
|
49
|
+
src = _config.src,
|
|
50
|
+
actionMap = _config.actionMap,
|
|
51
|
+
tooltip = _config.tooltip,
|
|
38
52
|
reset = _objectWithoutProperties(_config, _excluded);
|
|
53
|
+
// 主题色 primaryColor 用于单应用或处于组件库文档内 qiankunPrimaryColor用于主子应用
|
|
54
|
+
var _ref = antdTheme !== null && antdTheme !== void 0 ? antdTheme : {},
|
|
55
|
+
_ref$primaryColor = _ref.primaryColor,
|
|
56
|
+
primaryColor = _ref$primaryColor === void 0 ? '#006AFF' : _ref$primaryColor,
|
|
57
|
+
_ref$qiankunPrimaryCo = _ref.qiankunPrimaryColor,
|
|
58
|
+
qiankunPrimaryColor = _ref$qiankunPrimaryCo === void 0 ? '#006AFF' : _ref$qiankunPrimaryCo;
|
|
59
|
+
// 文档内部就不用判断window.top !== window.self了
|
|
60
|
+
var isQiankun =
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
((_window = window) === null || _window === void 0 ? void 0 : _window.__POWERED_BY_QIANKUN__) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.isMicroApp);
|
|
39
63
|
// 语言
|
|
40
64
|
var language = locale.ProIcon.language;
|
|
41
65
|
// 加载内部icon
|
|
42
|
-
|
|
43
|
-
if (status !== 'ready') {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
66
|
+
useExternal('https://at.alicdn.com/t/c/font_4063056_jmnz9g5uycp.js');
|
|
46
67
|
var rotateStyle = rotate ? {
|
|
47
68
|
msTransform: "rotate(".concat(rotate, "deg)"),
|
|
48
69
|
transform: "rotate(".concat(rotate, "deg)")
|
|
@@ -54,6 +75,8 @@ var ProIcon = function ProIcon(props) {
|
|
|
54
75
|
'pro-icon-btn': disabled
|
|
55
76
|
});
|
|
56
77
|
var _mode = mode || 'icon';
|
|
78
|
+
// 观察者实例
|
|
79
|
+
var observer;
|
|
57
80
|
// 特殊情况,如果指定了type,并且没有接收到组件内的mode,那模式就是icon
|
|
58
81
|
if (type && !props.mode) {
|
|
59
82
|
_mode = 'icon';
|
|
@@ -64,6 +87,8 @@ var ProIcon = function ProIcon(props) {
|
|
|
64
87
|
var mergedMapList = uniqBy(mapList.concat(iconMap), targetTextFill);
|
|
65
88
|
var _type = type;
|
|
66
89
|
var _text = children;
|
|
90
|
+
// svg图标对应文本
|
|
91
|
+
var iconText = tooltip || '';
|
|
67
92
|
var typeIsExistAndIncludeEnglish = _type && /[a-zA-Z]/.test(_type);
|
|
68
93
|
// 模式为icon下,对传入的text进行指定语言-icon 映射
|
|
69
94
|
if (isIconMode && !type) {
|
|
@@ -73,6 +98,7 @@ var ProIcon = function ProIcon(props) {
|
|
|
73
98
|
});
|
|
74
99
|
if (target) {
|
|
75
100
|
_type = target === null || target === void 0 ? void 0 : target.type;
|
|
101
|
+
iconText = target[targetTextFill];
|
|
76
102
|
}
|
|
77
103
|
}
|
|
78
104
|
}
|
|
@@ -87,33 +113,115 @@ var ProIcon = function ProIcon(props) {
|
|
|
87
113
|
}
|
|
88
114
|
}
|
|
89
115
|
}
|
|
116
|
+
var svgProps = {
|
|
117
|
+
className: proIconClassNames,
|
|
118
|
+
fill: 'currentColor',
|
|
119
|
+
style: _objectSpread(_objectSpread({
|
|
120
|
+
width: size,
|
|
121
|
+
height: size
|
|
122
|
+
}, rotateStyle), style)
|
|
123
|
+
};
|
|
90
124
|
var RenderIcon = _jsx("span", _objectSpread(_objectSpread({
|
|
91
125
|
className: "anticon",
|
|
92
126
|
style: {
|
|
93
127
|
color: color
|
|
94
128
|
}
|
|
95
129
|
}, reset), {}, {
|
|
96
|
-
children: _jsx(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
130
|
+
children: _jsx(_Tooltip, {
|
|
131
|
+
title: iconText,
|
|
132
|
+
children: !src ? _jsx("svg", _objectSpread(_objectSpread({}, svgProps), {}, {
|
|
133
|
+
onClick: onClick,
|
|
134
|
+
"aria-hidden": "true",
|
|
135
|
+
children: _jsx("use", {
|
|
136
|
+
xlinkHref: "#icon-".concat(_type)
|
|
137
|
+
})
|
|
138
|
+
})) : _jsx(ReactSVG, _objectSpread(_objectSpread({}, svgProps), {}, {
|
|
139
|
+
// @ts-ignore
|
|
140
|
+
onClick: onClick,
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
src: src,
|
|
143
|
+
beforeInjection: function beforeInjection(svg) {
|
|
144
|
+
onBeforeInjection({
|
|
145
|
+
svg: svg,
|
|
146
|
+
actionMap: actionMap,
|
|
147
|
+
primaryColor: isQiankun ? qiankunPrimaryColor : primaryColor
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}))
|
|
108
151
|
})
|
|
109
152
|
}));
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
153
|
+
var _RenderIcon = useMemo(function () {
|
|
154
|
+
return RenderIcon;
|
|
155
|
+
}, [primaryColor, qiankunPrimaryColor]);
|
|
156
|
+
useEffect(function () {
|
|
157
|
+
// 处于主子应用情况下才会执行下方逻辑,主题色的变更以主框架的为准
|
|
158
|
+
if (actionMap && isQiankun) {
|
|
159
|
+
observer = new MutationObserver(function (mutationsList) {
|
|
160
|
+
var targetEntries = mutationsList[0];
|
|
161
|
+
if (targetEntries) {
|
|
162
|
+
if (targetEntries && targetEntries.target) {
|
|
163
|
+
var _Object$values, _Object$values$find, _Object$values$find$v3, _targetEntries$target, _targetEntries$target2;
|
|
164
|
+
var _Object$values$find$v = // @ts-ignore
|
|
165
|
+
(_Object$values = Object.values((_targetEntries$target = targetEntries === null || targetEntries === void 0 ? void 0 : (_targetEntries$target2 = targetEntries.target) === null || _targetEntries$target2 === void 0 ? void 0 : _targetEntries$target2.attributes) !== null && _targetEntries$target !== void 0 ? _targetEntries$target : {})) === null || _Object$values === void 0 ? void 0 : (_Object$values$find = _Object$values.find(function (item) {
|
|
166
|
+
return item.nodeName === 'style';
|
|
167
|
+
})
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
) === null || _Object$values$find === void 0 ? void 0 : (_Object$values$find$v3 = _Object$values$find.value) === null || _Object$values$find$v3 === void 0 ? void 0 : _Object$values$find$v3.match(/--zaui-brand:(.*?);/),
|
|
170
|
+
_Object$values$find$v2 = _slicedToArray(_Object$values$find$v, 2),
|
|
171
|
+
label = _Object$values$find$v2[0],
|
|
172
|
+
value = _Object$values$find$v2[1];
|
|
173
|
+
if (label && value) {
|
|
174
|
+
if (qiankunPrimaryColor !== value) {
|
|
175
|
+
dispatch({
|
|
176
|
+
type: 'set',
|
|
177
|
+
payload: {
|
|
178
|
+
theme: {
|
|
179
|
+
primaryColor: primaryColor,
|
|
180
|
+
qiankunPrimaryColor: value === null || value === void 0 ? void 0 : value.trim()
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
var zaAccessibilityTarget = document.documentElement;
|
|
190
|
+
if (window.parent === window) {
|
|
191
|
+
// 在最顶层的window环境中,可以直接使用document
|
|
192
|
+
zaAccessibilityTarget = document.documentElement;
|
|
193
|
+
} else {
|
|
194
|
+
// 向上遍历直到找到主应用的window
|
|
195
|
+
var currentWindow = window;
|
|
196
|
+
while (currentWindow.parent !== currentWindow) {
|
|
197
|
+
// @ts-ignore
|
|
198
|
+
currentWindow = currentWindow.parent;
|
|
199
|
+
}
|
|
200
|
+
zaAccessibilityTarget = currentWindow.document.documentElement;
|
|
201
|
+
}
|
|
202
|
+
observer.observe(zaAccessibilityTarget, {
|
|
203
|
+
attributes: true,
|
|
204
|
+
attributeFilter: ['style']
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}, []);
|
|
208
|
+
useEffect(function () {
|
|
209
|
+
return function () {
|
|
210
|
+
if (observer) {
|
|
211
|
+
observer.disconnect();
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
}, []);
|
|
215
|
+
return !isExtendButtonMode ? _RenderIcon : _jsx(_Tooltip, {
|
|
216
|
+
title: tooltip,
|
|
217
|
+
children: _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({
|
|
218
|
+
type: isIconMode ? 'text' : (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type) || 'link',
|
|
219
|
+
className: proIconClassNames,
|
|
220
|
+
disabled: disabled,
|
|
221
|
+
icon: isIconMode ? RenderIcon : null
|
|
222
|
+
}, reset), buttonProps), {}, {
|
|
223
|
+
children: _text
|
|
224
|
+
}))
|
|
225
|
+
});
|
|
118
226
|
};
|
|
119
227
|
export default ProIcon;
|
|
@@ -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 -
|
|
@@ -40,6 +54,11 @@ export interface ProIconProps {
|
|
|
40
54
|
* @default false
|
|
41
55
|
*/
|
|
42
56
|
disabled?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* @description 提示
|
|
59
|
+
* @default -
|
|
60
|
+
*/
|
|
61
|
+
tooltip?: string | React.ReactNode;
|
|
43
62
|
/**
|
|
44
63
|
* @description 是否跟随主题色
|
|
45
64
|
* @default false
|
|
@@ -75,5 +94,10 @@ export interface ProIconProps {
|
|
|
75
94
|
* @default 项目内认默映射
|
|
76
95
|
*/
|
|
77
96
|
mapList?: iconMap[];
|
|
97
|
+
/**
|
|
98
|
+
* @description svg变更操作表 请到 ProThemeTools 主题配置查看示例
|
|
99
|
+
* @default
|
|
100
|
+
*/
|
|
101
|
+
actionMap?: actionMap;
|
|
78
102
|
}
|
|
79
103
|
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { themeMap, themeFillMap } from '../config';
|
|
3
|
+
export var recurseGetNodes = function recurseGetNodes(type, node, queue) {
|
|
4
|
+
switch (type) {
|
|
5
|
+
// 渐变
|
|
6
|
+
case 'gradation':
|
|
7
|
+
if (node.nodeName === 'stop' && node.getAttribute('stop-color')) {
|
|
8
|
+
queue.push(node);
|
|
9
|
+
}
|
|
10
|
+
break;
|
|
11
|
+
// 填充
|
|
12
|
+
case 'fill':
|
|
13
|
+
if (node.getAttribute && node.getAttribute('fill')) {
|
|
14
|
+
queue.push(node);
|
|
15
|
+
}
|
|
16
|
+
break;
|
|
17
|
+
default:
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
if (node.childNodes) {
|
|
21
|
+
for (var i = 0; i < node.childNodes.length; i++) {
|
|
22
|
+
recurseGetNodes(type, node.childNodes[i], queue);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export var onBeforeInjection = function onBeforeInjection(_ref) {
|
|
27
|
+
var svg = _ref.svg,
|
|
28
|
+
actionMap = _ref.actionMap,
|
|
29
|
+
primaryColor = _ref.primaryColor;
|
|
30
|
+
if (actionMap && svg) {
|
|
31
|
+
var _actionMap$themeMap, _actionMap$themeFillM, _actionMap$gradation, _actionMap$fill;
|
|
32
|
+
// 项目内置的四种主题匹配渐变色
|
|
33
|
+
var mergeThemeMap = _objectSpread(_objectSpread({}, themeMap), (_actionMap$themeMap = actionMap.themeMap) !== null && _actionMap$themeMap !== void 0 ? _actionMap$themeMap : {});
|
|
34
|
+
// 项目内置的四种双色匹配fill
|
|
35
|
+
var mergeFillThemeMap = _objectSpread(_objectSpread({}, themeFillMap), (_actionMap$themeFillM = actionMap.themeFillMap) !== null && _actionMap$themeFillM !== void 0 ? _actionMap$themeFillM : {});
|
|
36
|
+
var _gradList = mergeThemeMap[primaryColor];
|
|
37
|
+
var _fillList = mergeFillThemeMap[primaryColor];
|
|
38
|
+
// 渐变操作序列
|
|
39
|
+
var gradList = (_actionMap$gradation = actionMap === null || actionMap === void 0 ? void 0 : actionMap.gradation) !== null && _actionMap$gradation !== void 0 ? _actionMap$gradation : _gradList;
|
|
40
|
+
// 填充操作序列
|
|
41
|
+
var fillList = (_actionMap$fill = actionMap === null || actionMap === void 0 ? void 0 : actionMap.fill) !== null && _actionMap$fill !== void 0 ? _actionMap$fill : _fillList;
|
|
42
|
+
// 节点收集
|
|
43
|
+
var nodeMap = {
|
|
44
|
+
// 渐变色节点收集
|
|
45
|
+
gradation: [],
|
|
46
|
+
// 具有fill属性的节点收集
|
|
47
|
+
fill: []
|
|
48
|
+
};
|
|
49
|
+
// 目前只支持处理渐变及fill填充
|
|
50
|
+
var types = Reflect.ownKeys(nodeMap !== null && nodeMap !== void 0 ? nodeMap : {});
|
|
51
|
+
types.forEach(function (typeKey) {
|
|
52
|
+
recurseGetNodes(typeKey, svg, nodeMap[typeKey]);
|
|
53
|
+
});
|
|
54
|
+
if ((gradList === null || gradList === void 0 ? void 0 : gradList.length) > 0) {
|
|
55
|
+
nodeMap.gradation.forEach(function (item, index) {
|
|
56
|
+
// 下一步准备替换的
|
|
57
|
+
var nextStr = gradList[index];
|
|
58
|
+
// 属性原本的值
|
|
59
|
+
var originStr = item.getAttribute('stop-color');
|
|
60
|
+
if (nextStr && originStr !== nextStr) {
|
|
61
|
+
item.setAttribute('stop-color', nextStr);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if ((fillList === null || fillList === void 0 ? void 0 : fillList.length) > 0) {
|
|
66
|
+
nodeMap.fill.forEach(function (item, index) {
|
|
67
|
+
// 默认接收的
|
|
68
|
+
var receiveStr = fillList[index];
|
|
69
|
+
// 下一步准备替换的
|
|
70
|
+
var nextFillStr = receiveStr === 'theme' ? primaryColor : receiveStr;
|
|
71
|
+
// 属性原本的值
|
|
72
|
+
var originFill = item.getAttribute('fill');
|
|
73
|
+
// 如果包含url(则是内链,不作替换处理
|
|
74
|
+
if (!(originFill && originFill.includes('url(')) && nextFillStr) {
|
|
75
|
+
// 不同才替换
|
|
76
|
+
if (originFill !== nextFillStr) {
|
|
77
|
+
item.setAttribute('fill', nextFillStr);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
@@ -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
|
});
|
package/es/ProSelect/index.js
CHANGED
|
@@ -239,7 +239,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
239
239
|
if (!isObject(value)) {
|
|
240
240
|
return undefined;
|
|
241
241
|
}
|
|
242
|
-
return value === null || value === void 0 ? void 0 : value[code];
|
|
242
|
+
return (value === null || value === void 0 ? void 0 : value[code]) || (value === null || value === void 0 ? void 0 : value.value);
|
|
243
243
|
}
|
|
244
244
|
if (labelInValue && selectProps.mode) {
|
|
245
245
|
// 对传入的值做一些基础判断
|
|
@@ -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);
|
package/es/ProTable/utils.js
CHANGED
|
@@ -269,19 +269,22 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
269
269
|
'varied-cell': originalValue !== undefined,
|
|
270
270
|
'empty-cell': isEmpty
|
|
271
271
|
});
|
|
272
|
-
var renderValue = _jsx(ProForm.
|
|
272
|
+
var renderValue = _jsx(ProForm.ProCascader, {
|
|
273
273
|
isView: true,
|
|
274
|
+
mode: "address",
|
|
274
275
|
code: code,
|
|
275
276
|
value: realValue
|
|
276
277
|
});
|
|
277
|
-
var originalRenderValue = _jsx(ProForm.
|
|
278
|
+
var originalRenderValue = _jsx(ProForm.ProCascader, {
|
|
278
279
|
isView: true,
|
|
280
|
+
mode: "address",
|
|
279
281
|
code: code,
|
|
280
282
|
value: originalRealValue
|
|
281
283
|
});
|
|
282
|
-
return _jsx(ProForm.
|
|
284
|
+
return _jsx(ProForm.ProCascader, {
|
|
283
285
|
className: className,
|
|
284
286
|
isView: true,
|
|
287
|
+
mode: "address",
|
|
285
288
|
code: code,
|
|
286
289
|
value: realValue,
|
|
287
290
|
tooltip: originalValue !== undefined ? _jsxs(_Fragment, {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DevToolsPropsType } from '../../propsType';
|
|
2
|
-
declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe,
|
|
2
|
+
declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => JSX.Element;
|
|
3
3
|
export default PrdTools;
|