@zat-design/sisyphus-react 4.0.8 → 4.0.9
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 +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProForm/components/combination/Group/style/index.less +4 -2
- package/es/ProForm/components/combination/Group/utils/index.d.ts +17 -17
- package/es/ProIcon/index.js +183 -167
- package/es/ProLayout/components/ProFooter/index.js +1 -1
- package/es/ProLayout/index.js +1 -2
- package/es/ProStep/components/Step/index.js +1 -1
- package/es/ProStep/style/index.less +4 -2
- package/es/ProThemeTools/component/ProTools/index.js +108 -89
- package/es/ProThemeTools/context/ThemeContext.d.ts +10 -0
- package/es/ProThemeTools/context/ThemeContext.js +28 -0
- package/es/ProThemeTools/index.js +37 -12
- package/es/ProThemeTools/utils/index.d.ts +9 -1
- package/es/ProThemeTools/utils/index.js +84 -5
- package/lib/ProForm/components/combination/Group/style/index.less +4 -2
- package/lib/ProForm/components/combination/Group/utils/index.d.ts +13 -13
- package/lib/ProIcon/index.js +182 -168
- package/lib/ProLayout/components/ProFooter/index.js +1 -1
- package/lib/ProLayout/index.js +1 -2
- package/lib/ProStep/components/Step/index.js +1 -1
- package/lib/ProStep/style/index.less +4 -2
- package/lib/ProThemeTools/component/ProTools/index.js +108 -90
- package/lib/ProThemeTools/context/ThemeContext.d.ts +10 -0
- package/lib/ProThemeTools/context/ThemeContext.js +31 -2
- package/lib/ProThemeTools/index.js +35 -10
- package/lib/ProThemeTools/utils/index.d.ts +9 -1
- package/lib/ProThemeTools/utils/index.js +86 -6
- package/package.json +1 -1
|
@@ -75,33 +75,37 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
75
75
|
confirm?: boolean | import("antd").ModalFuncProps | import("../../../render/propsType").FunctionArgs<any, boolean | import("antd").ModalFuncProps>;
|
|
76
76
|
show?: boolean | ReactiveFunction<any, boolean>;
|
|
77
77
|
component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
|
|
78
|
-
id?: string;
|
|
79
|
-
className?: string;
|
|
80
|
-
hidden?: boolean;
|
|
81
78
|
style?: React.CSSProperties;
|
|
79
|
+
trim?: boolean;
|
|
80
|
+
normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
|
|
82
81
|
children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
|
|
83
|
-
|
|
82
|
+
className?: string;
|
|
83
|
+
hidden?: boolean;
|
|
84
|
+
layout?: import("antd/es/form/Form").FormItemLayout;
|
|
85
|
+
help?: React.ReactNode;
|
|
86
|
+
vertical?: boolean;
|
|
87
|
+
preserve?: boolean;
|
|
84
88
|
prefixCls?: string;
|
|
89
|
+
onReset?: () => void;
|
|
85
90
|
status?: "" | "warning" | "error" | "success" | "validating";
|
|
91
|
+
id?: string;
|
|
86
92
|
rootClassName?: string;
|
|
87
93
|
isView?: boolean;
|
|
88
|
-
|
|
94
|
+
getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
|
|
95
|
+
desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
|
|
89
96
|
htmlFor?: string;
|
|
97
|
+
colon?: boolean;
|
|
90
98
|
labelAlign?: import("antd/es/form/interface").FormLabelAlign;
|
|
91
99
|
labelCol?: import("antd").ColProps;
|
|
92
|
-
vertical?: boolean;
|
|
93
100
|
getValueFromEvent?: (...args: import("@rc-component/form/lib/interface").EventArgs) => any;
|
|
94
|
-
normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
|
|
95
101
|
shouldUpdate?: import("@rc-component/form/lib/Field").ShouldUpdate<any>;
|
|
96
102
|
trigger?: string;
|
|
97
103
|
validateTrigger?: string | false | string[];
|
|
98
104
|
validateDebounce?: number;
|
|
99
105
|
valuePropName?: string;
|
|
100
|
-
getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
|
|
101
106
|
messageVariables?: Record<string, string>;
|
|
102
107
|
initialValue?: any;
|
|
103
108
|
onMetaChange?: (meta: import("@rc-component/form/lib/Field").MetaEvent) => void;
|
|
104
|
-
preserve?: boolean;
|
|
105
109
|
isListField?: boolean;
|
|
106
110
|
isList?: boolean;
|
|
107
111
|
noStyle?: boolean;
|
|
@@ -109,9 +113,7 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
109
113
|
icons: import("antd/es/form/FormItem").FeedbackIcons;
|
|
110
114
|
};
|
|
111
115
|
validateStatus?: "" | "warning" | "error" | "success" | "validating";
|
|
112
|
-
layout?: import("antd/es/form/Form").FormItemLayout;
|
|
113
116
|
wrapperCol?: import("antd").ColProps;
|
|
114
|
-
help?: React.ReactNode;
|
|
115
117
|
fieldId?: string;
|
|
116
118
|
valueType?: import("../../../render/propsType").ProFormValueType;
|
|
117
119
|
switchValue?: [any, any];
|
|
@@ -121,12 +123,10 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
121
123
|
index?: number;
|
|
122
124
|
}) => string | React.ReactElement<any, any>;
|
|
123
125
|
viewType?: import("../../../render/propsType").ViewType;
|
|
124
|
-
trim?: boolean;
|
|
125
126
|
upperCase?: boolean;
|
|
126
127
|
toISOString?: boolean;
|
|
127
128
|
toCSTString?: boolean;
|
|
128
129
|
clearNotShow?: boolean;
|
|
129
|
-
desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
|
|
130
130
|
name: any;
|
|
131
131
|
dependencies: any[];
|
|
132
132
|
tooltip: string | {
|
package/lib/ProIcon/index.js
CHANGED
|
@@ -32,7 +32,50 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
32
32
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
33
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
34
34
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
35
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
35
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // 提取主题色相关辅助函数
|
|
36
|
+
var extractThemeColor = target => {
|
|
37
|
+
var _target$attributes, _styleAttr$value, _match$;
|
|
38
|
+
if (!target) return null;
|
|
39
|
+
var styleAttr = Object.values((_target$attributes = target.attributes) !== null && _target$attributes !== void 0 ? _target$attributes : {})
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
.find(item => item.nodeName === 'style');
|
|
42
|
+
if (!styleAttr) return null;
|
|
43
|
+
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
var match = (_styleAttr$value = styleAttr.value) === null || _styleAttr$value === void 0 ? void 0 : _styleAttr$value.match(/--zaui-brand:(.*?);/);
|
|
46
|
+
return (match === null || match === void 0 || (_match$ = match[1]) === null || _match$ === void 0 ? void 0 : _match$.trim()) || null;
|
|
47
|
+
};
|
|
48
|
+
var updateThemeColor = (newColor, dispatch, primaryColor) => {
|
|
49
|
+
if (!newColor) return;
|
|
50
|
+
dispatch({
|
|
51
|
+
type: 'set',
|
|
52
|
+
payload: {
|
|
53
|
+
theme: {
|
|
54
|
+
primaryColor,
|
|
55
|
+
qiankunPrimaryColor: newColor
|
|
56
|
+
},
|
|
57
|
+
forms: {}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
var getMainAppWindow = () => {
|
|
62
|
+
if (window.parent === window) {
|
|
63
|
+
return window;
|
|
64
|
+
}
|
|
65
|
+
var currentWindow = window;
|
|
66
|
+
while (currentWindow.parent !== currentWindow) {
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
currentWindow = currentWindow.parent;
|
|
69
|
+
}
|
|
70
|
+
return currentWindow;
|
|
71
|
+
};
|
|
72
|
+
var handleMutation = (mutationsList, dispatch, primaryColor, qiankunPrimaryColor) => {
|
|
73
|
+
var targetEntries = mutationsList[0];
|
|
74
|
+
if (!(targetEntries !== null && targetEntries !== void 0 && targetEntries.target)) return;
|
|
75
|
+
var newColor = extractThemeColor(targetEntries.target);
|
|
76
|
+
if (!newColor || qiankunPrimaryColor === newColor) return;
|
|
77
|
+
updateThemeColor(newColor, dispatch, primaryColor);
|
|
78
|
+
};
|
|
36
79
|
var ProIcon = props => {
|
|
37
80
|
var _window, _window2;
|
|
38
81
|
var _useProConfig = (0, _ProConfigProvider.useProConfig)(),
|
|
@@ -124,27 +167,36 @@ var ProIcon = props => {
|
|
|
124
167
|
var _text = children;
|
|
125
168
|
// svg图标对应文本
|
|
126
169
|
var iconText = tooltip || '';
|
|
127
|
-
var typeIsExistAndIncludeEnglish = _type && /[a-zA-Z]/.test(_type);
|
|
128
170
|
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
var target = mergedMapList.find(item => item['text-cn'] ===
|
|
171
|
+
// 文本和类型映射处理函数
|
|
172
|
+
var resolveIconMapping = (isIconMode, type, text, mergedMapList, targetTextFill) => {
|
|
173
|
+
if (isIconMode && !type && text) {
|
|
174
|
+
var target = mergedMapList.find(item => item['text-cn'] === text || item['text-en'] === text);
|
|
133
175
|
if (target) {
|
|
134
|
-
|
|
135
|
-
|
|
176
|
+
return {
|
|
177
|
+
type: target.type,
|
|
178
|
+
text: target[targetTextFill]
|
|
179
|
+
};
|
|
136
180
|
}
|
|
137
181
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// 模式为button下,对传入的type进行icon-指定语言 映射
|
|
141
|
-
if (!isIconMode) {
|
|
142
|
-
if (typeIsExistAndIncludeEnglish) {
|
|
143
|
-
var _target = mergedMapList.find(item => item.type === _type);
|
|
182
|
+
if (!isIconMode && type && /[a-zA-Z]/.test(type)) {
|
|
183
|
+
var _target = mergedMapList.find(item => item.type === type);
|
|
144
184
|
if (_target) {
|
|
145
|
-
|
|
185
|
+
return {
|
|
186
|
+
text: _target[targetTextFill]
|
|
187
|
+
};
|
|
146
188
|
}
|
|
147
189
|
}
|
|
190
|
+
return null;
|
|
191
|
+
};
|
|
192
|
+
var mappingResult = resolveIconMapping(isIconMode, type, _text, mergedMapList, targetTextFill);
|
|
193
|
+
if (mappingResult) {
|
|
194
|
+
if (mappingResult.type) {
|
|
195
|
+
_type = mappingResult.type;
|
|
196
|
+
iconText = mappingResult.text || '';
|
|
197
|
+
} else if (mappingResult.text) {
|
|
198
|
+
_text = mappingResult.text;
|
|
199
|
+
}
|
|
148
200
|
}
|
|
149
201
|
var svgProps = {
|
|
150
202
|
className: proIconClassNames,
|
|
@@ -155,105 +207,112 @@ var ProIcon = props => {
|
|
|
155
207
|
}, rotateStyle), style)
|
|
156
208
|
};
|
|
157
209
|
|
|
210
|
+
// 应用颜色到 SVG 路径元素
|
|
211
|
+
var applyColorToPaths = (svg, color) => {
|
|
212
|
+
var paths = svg.querySelectorAll('path, circle, rect, polygon, ellipse');
|
|
213
|
+
paths.forEach(path => {
|
|
214
|
+
var currentFill = path.getAttribute('fill');
|
|
215
|
+
if (!currentFill || currentFill === 'currentColor') {
|
|
216
|
+
path.setAttribute('fill', color);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
// 应用颜色到 SVG
|
|
222
|
+
var applyColorToSvg = function applyColorToSvg(svg, color) {
|
|
223
|
+
var isComponentString = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
224
|
+
if (!color) {
|
|
225
|
+
svg.style.color = 'currentColor';
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
svg.setAttribute('fill', color);
|
|
229
|
+
svg.style.color = color;
|
|
230
|
+
|
|
231
|
+
// 组件字符串类型需要遍历所有路径元素设置 fill
|
|
232
|
+
if (isComponentString) {
|
|
233
|
+
applyColorToPaths(svg, color);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// 创建 SVG beforeInjection 处理函数
|
|
238
|
+
var createSvgBeforeInjection = function createSvgBeforeInjection() {
|
|
239
|
+
var isComponentString = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
240
|
+
return svg => {
|
|
241
|
+
// 设置 SVG 的宽高和属性
|
|
242
|
+
svg.setAttribute('width', String(size));
|
|
243
|
+
svg.setAttribute('height', String(size));
|
|
244
|
+
svg.setAttribute('aria-hidden', 'true');
|
|
245
|
+
|
|
246
|
+
// 应用旋转
|
|
247
|
+
if (rotate) {
|
|
248
|
+
var transform = svg.getAttribute('transform') || '';
|
|
249
|
+
svg.setAttribute('transform', `${transform} rotate(${rotate})`);
|
|
250
|
+
svg.style.transform = `rotate(${rotate}deg)`;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// 应用颜色
|
|
254
|
+
applyColorToSvg(svg, color, isComponentString);
|
|
255
|
+
|
|
256
|
+
// 应用自定义样式
|
|
257
|
+
if (style) {
|
|
258
|
+
Object.keys(style).forEach(key => {
|
|
259
|
+
svg.style[key] = style[key];
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// 应用 actionMap 的主题配置
|
|
264
|
+
(0, _utils.onBeforeInjection)({
|
|
265
|
+
svg,
|
|
266
|
+
actionMap,
|
|
267
|
+
primaryColor: isQiankun ? qiankunPrimaryColor : primaryColor
|
|
268
|
+
});
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
// 渲染自定义组件 icon
|
|
273
|
+
var renderComponentIcon = (component, svgProps, color, onClick) => {
|
|
274
|
+
var componentProps = _objectSpread(_objectSpread({}, svgProps), {}, {
|
|
275
|
+
style: _objectSpread({
|
|
276
|
+
color
|
|
277
|
+
}, svgProps === null || svgProps === void 0 ? void 0 : svgProps.style),
|
|
278
|
+
onClick,
|
|
279
|
+
'aria-hidden': 'true'
|
|
280
|
+
});
|
|
281
|
+
return /*#__PURE__*/_react.default.isValidElement(component) ? /*#__PURE__*/_react.default.cloneElement(component, componentProps) : /*#__PURE__*/_react.default.createElement(component, componentProps);
|
|
282
|
+
};
|
|
283
|
+
|
|
158
284
|
// 渲染 icon 的优先级:component > src > type
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
// 字符串类型:当作 SVG 文件路径处理,使用 ReactSVG 加载
|
|
164
|
-
icon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
285
|
+
var renderIcon = () => {
|
|
286
|
+
// component 字符串类型:当作 SVG 文件路径处理
|
|
287
|
+
if (component && typeof component === 'string') {
|
|
288
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
165
289
|
className: proIconClassNames
|
|
166
290
|
// @ts-ignore
|
|
167
291
|
,
|
|
168
292
|
onClick: onClick,
|
|
169
293
|
src: component,
|
|
170
|
-
beforeInjection:
|
|
171
|
-
// 设置 SVG 的宽高
|
|
172
|
-
svg.setAttribute('width', String(size));
|
|
173
|
-
svg.setAttribute('height', String(size));
|
|
174
|
-
svg.setAttribute('aria-hidden', 'true');
|
|
175
|
-
|
|
176
|
-
// 应用旋转
|
|
177
|
-
if (rotate) {
|
|
178
|
-
var transform = svg.getAttribute('transform') || '';
|
|
179
|
-
svg.setAttribute('transform', `${transform} rotate(${rotate})`);
|
|
180
|
-
svg.style.transform = `rotate(${rotate}deg)`;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// 应用颜色 - 设置 fill 和 currentColor
|
|
184
|
-
if (color) {
|
|
185
|
-
svg.setAttribute('fill', color);
|
|
186
|
-
svg.style.color = color;
|
|
187
|
-
// 遍历所有路径元素,设置 fill
|
|
188
|
-
var paths = svg.querySelectorAll('path, circle, rect, polygon, ellipse');
|
|
189
|
-
paths.forEach(path => {
|
|
190
|
-
var currentFill = path.getAttribute('fill');
|
|
191
|
-
// 只修改使用 currentColor 或没有设置 fill 的元素
|
|
192
|
-
if (!currentFill || currentFill === 'currentColor') {
|
|
193
|
-
path.setAttribute('fill', color);
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
} else {
|
|
197
|
-
// 没有指定颜色时,使用 currentColor
|
|
198
|
-
svg.style.color = 'currentColor';
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// 应用自定义样式
|
|
202
|
-
if (style) {
|
|
203
|
-
Object.keys(style).forEach(key => {
|
|
204
|
-
svg.style[key] = style[key];
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// 应用 actionMap 的主题配置
|
|
209
|
-
(0, _utils.onBeforeInjection)({
|
|
210
|
-
svg,
|
|
211
|
-
actionMap,
|
|
212
|
-
primaryColor: isQiankun ? qiankunPrimaryColor : primaryColor
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
} else {
|
|
217
|
-
// 处理自定义组件
|
|
218
|
-
var componentProps = _objectSpread(_objectSpread({}, svgProps), {}, {
|
|
219
|
-
style: _objectSpread({
|
|
220
|
-
color
|
|
221
|
-
}, svgProps === null || svgProps === void 0 ? void 0 : svgProps.style),
|
|
222
|
-
onClick,
|
|
223
|
-
'aria-hidden': 'true'
|
|
294
|
+
beforeInjection: createSvgBeforeInjection(true)
|
|
224
295
|
});
|
|
296
|
+
}
|
|
225
297
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
icon = /*#__PURE__*/_react.default.cloneElement(component, componentProps);
|
|
230
|
-
} else {
|
|
231
|
-
// 组件类型:直接渲染
|
|
232
|
-
var ComponentType = component;
|
|
233
|
-
icon = /*#__PURE__*/(0, _jsxRuntime.jsx)(ComponentType, _objectSpread({}, componentProps));
|
|
234
|
-
}
|
|
298
|
+
// component 组件类型或实例(排除字符串类型)
|
|
299
|
+
if (component && typeof component !== 'string') {
|
|
300
|
+
return renderComponentIcon(component, svgProps, color, onClick);
|
|
235
301
|
}
|
|
236
|
-
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
(
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
svg.setAttribute('fill', color);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}));
|
|
254
|
-
} else {
|
|
255
|
-
// 使用 symbol icon
|
|
256
|
-
icon = /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", _objectSpread(_objectSpread({}, svgProps), {}, {
|
|
302
|
+
|
|
303
|
+
// src 类型:使用 ReactSVG 加载外部 SVG
|
|
304
|
+
if (src) {
|
|
305
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, _objectSpread(_objectSpread({}, svgProps), {}, {
|
|
306
|
+
// @ts-ignore
|
|
307
|
+
onClick: onClick,
|
|
308
|
+
"aria-hidden": "true",
|
|
309
|
+
src: src,
|
|
310
|
+
beforeInjection: createSvgBeforeInjection()
|
|
311
|
+
}));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// symbol icon
|
|
315
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", _objectSpread(_objectSpread({}, svgProps), {}, {
|
|
257
316
|
style: _objectSpread({
|
|
258
317
|
color
|
|
259
318
|
}, svgProps === null || svgProps === void 0 ? void 0 : svgProps.style),
|
|
@@ -263,7 +322,8 @@ var ProIcon = props => {
|
|
|
263
322
|
xlinkHref: `#icon-${_type}`
|
|
264
323
|
})
|
|
265
324
|
}));
|
|
266
|
-
}
|
|
325
|
+
};
|
|
326
|
+
var icon = renderIcon();
|
|
267
327
|
|
|
268
328
|
// 判断 RenderIcon 是否会被外层 Button 包裹
|
|
269
329
|
// 如果会被包裹(isExtendButtonMode && isIconMode),则内部不使用 Button,避免 button 嵌套
|
|
@@ -300,69 +360,23 @@ var ProIcon = props => {
|
|
|
300
360
|
})
|
|
301
361
|
}));
|
|
302
362
|
(0, _react.useEffect)(() => {
|
|
363
|
+
var _themeConfig$data;
|
|
303
364
|
// 处于主子应用情况下才会执行下方逻辑,主题色的变更以主框架的为准
|
|
304
|
-
if (actionMap
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (qiankunPrimaryColor !== value) {
|
|
320
|
-
dispatch({
|
|
321
|
-
type: 'set',
|
|
322
|
-
payload: {
|
|
323
|
-
theme: {
|
|
324
|
-
primaryColor,
|
|
325
|
-
qiankunPrimaryColor: value === null || value === void 0 ? void 0 : value.trim()
|
|
326
|
-
},
|
|
327
|
-
forms: {}
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
var zaAccessibilityTarget = document.documentElement;
|
|
336
|
-
if (window.parent === window) {
|
|
337
|
-
// 在最顶层的window环境中,可以直接使用document
|
|
338
|
-
zaAccessibilityTarget = document.documentElement;
|
|
339
|
-
} else {
|
|
340
|
-
// 向上遍历直到找到主应用的window
|
|
341
|
-
var currentWindow = window;
|
|
342
|
-
while (currentWindow.parent !== currentWindow) {
|
|
343
|
-
// @ts-ignore
|
|
344
|
-
currentWindow = currentWindow.parent;
|
|
345
|
-
}
|
|
346
|
-
zaAccessibilityTarget = currentWindow.document.documentElement;
|
|
347
|
-
}
|
|
348
|
-
observer.observe(zaAccessibilityTarget, {
|
|
349
|
-
attributes: true,
|
|
350
|
-
attributeFilter: ['style']
|
|
351
|
-
});
|
|
352
|
-
// 未变更时及初始化时
|
|
353
|
-
var extendFromMainColor = themeConfig === null || themeConfig === void 0 || (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiBrand;
|
|
354
|
-
if (extendFromMainColor && qiankunPrimaryColor !== extendFromMainColor) {
|
|
355
|
-
dispatch({
|
|
356
|
-
type: 'set',
|
|
357
|
-
payload: {
|
|
358
|
-
theme: {
|
|
359
|
-
primaryColor,
|
|
360
|
-
qiankunPrimaryColor: extendFromMainColor
|
|
361
|
-
},
|
|
362
|
-
forms: {}
|
|
363
|
-
}
|
|
364
|
-
});
|
|
365
|
-
}
|
|
365
|
+
if (!actionMap || !isQiankun) return;
|
|
366
|
+
observer = new MutationObserver(mutationsList => {
|
|
367
|
+
handleMutation(mutationsList, dispatch, primaryColor, qiankunPrimaryColor);
|
|
368
|
+
});
|
|
369
|
+
var mainWindow = getMainAppWindow();
|
|
370
|
+
var zaAccessibilityTarget = mainWindow.document.documentElement;
|
|
371
|
+
observer.observe(zaAccessibilityTarget, {
|
|
372
|
+
attributes: true,
|
|
373
|
+
attributeFilter: ['style']
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
// 未变更时及初始化时
|
|
377
|
+
var extendFromMainColor = themeConfig === null || themeConfig === void 0 || (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiBrand;
|
|
378
|
+
if (extendFromMainColor && qiankunPrimaryColor !== extendFromMainColor) {
|
|
379
|
+
updateThemeColor(extendFromMainColor, dispatch, primaryColor);
|
|
366
380
|
}
|
|
367
381
|
}, []);
|
|
368
382
|
(0, _react.useEffect)(() => {
|
|
@@ -21,7 +21,7 @@ var ProFooter = props => {
|
|
|
21
21
|
className = props.className,
|
|
22
22
|
children = props.children,
|
|
23
23
|
_props$zIndex = props.zIndex,
|
|
24
|
-
zIndex = _props$zIndex === void 0 ?
|
|
24
|
+
zIndex = _props$zIndex === void 0 ? 98 : _props$zIndex,
|
|
25
25
|
_props$sideDom = props.sideDom,
|
|
26
26
|
sideDom = _props$sideDom === void 0 ? '.pro-layout-sider-nav' : _props$sideDom,
|
|
27
27
|
_props$contentDom = props.contentDom,
|
package/lib/ProLayout/index.js
CHANGED
|
@@ -16,7 +16,6 @@ Object.defineProperty(exports, "useProLayoutTabs", {
|
|
|
16
16
|
return _useProLayoutTabs.useProLayoutTabs;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
var _antd = require("antd");
|
|
20
19
|
var _react = require("react");
|
|
21
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
22
21
|
var _ahooks = require("ahooks");
|
|
@@ -106,7 +105,7 @@ var ProLayout = props => {
|
|
|
106
105
|
}, [props.collapsed]);
|
|
107
106
|
(0, _ahooks.useDeepCompareEffect)(() => {
|
|
108
107
|
if (Array.isArray(dataSource) && !dataSource.length) {
|
|
109
|
-
return
|
|
108
|
+
return;
|
|
110
109
|
}
|
|
111
110
|
var userData = (0, _utils.transformMenus)(dataSource, pathPrefix);
|
|
112
111
|
// 确保 menus 始终是一个数组
|
|
@@ -67,7 +67,7 @@ var Step = _ref => {
|
|
|
67
67
|
setOnOff(false);
|
|
68
68
|
};
|
|
69
69
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
70
|
-
className: `pro-step ${onOff ? 'open' : 'closed'}`,
|
|
70
|
+
className: `pro-step ${onOff ? 'pro-step-open' : 'pro-step-closed'}`,
|
|
71
71
|
style: _objectSpread({
|
|
72
72
|
top: fixedTop !== null && fixedTop !== void 0 ? fixedTop : 0,
|
|
73
73
|
maxHeight: `calc(100vh - ${fixedTop}px)`
|
|
@@ -115,6 +115,7 @@
|
|
|
115
115
|
align-items: center;
|
|
116
116
|
justify-content: center;
|
|
117
117
|
width: 48px;
|
|
118
|
+
min-width: 48px;
|
|
118
119
|
height: 100%;
|
|
119
120
|
|
|
120
121
|
> svg {
|
|
@@ -168,6 +169,7 @@
|
|
|
168
169
|
|
|
169
170
|
> .pro-step-menu-name {
|
|
170
171
|
color: #0a0a0a;
|
|
172
|
+
text-align: left;
|
|
171
173
|
|
|
172
174
|
&.disabled {
|
|
173
175
|
color: #626366;
|
|
@@ -208,11 +210,11 @@
|
|
|
208
210
|
}
|
|
209
211
|
}
|
|
210
212
|
|
|
211
|
-
&.open {
|
|
213
|
+
&.pro-step-open {
|
|
212
214
|
width: 200px;
|
|
213
215
|
}
|
|
214
216
|
|
|
215
|
-
&.closed {
|
|
217
|
+
&.pro-step-closed {
|
|
216
218
|
width: 48px;
|
|
217
219
|
}
|
|
218
220
|
}
|