@zat-design/sisyphus-react 4.0.0 → 4.0.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## 快速上手
4
4
 
5
- 西西弗基于 antd@4 版本开发
5
+ 西西弗4 基于 antd@6 版本开发
6
6
 
7
7
  ### 安装
8
8
 
@@ -9,7 +9,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
9
9
  import React, { useMemo } from 'react';
10
10
  import { Space, Tooltip } from 'antd';
11
11
  import classnames from 'classnames';
12
- import { get } from 'lodash';
12
+ import { get, omit } from 'lodash';
13
13
  import { diffOriginal } from "../../utils/diffOriginal";
14
14
  import { useProConfig } from "../../../ProConfigProvider";
15
15
  import { isEmpty } from "../../../utils";
@@ -174,7 +174,9 @@ var ListChangedWrapper = props => {
174
174
  })) : undefined;
175
175
  }, [originalValue, children]);
176
176
  if (!isWatch || noChange) {
177
- return /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest));
177
+ // 过滤掉 disabled,避免传递到 div 等不支持 disabled 的元素
178
+ var filteredRest = omit(rest, ['disabled']);
179
+ return /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), filteredRest));
178
180
  }
179
181
 
180
182
  // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -206,7 +208,7 @@ var ListChangedWrapper = props => {
206
208
  placement: "topLeft",
207
209
  autoAdjustOverflow: false,
208
210
  title: /*#__PURE__*/_jsxs(Space, {
209
- direction: "vertical",
211
+ orientation: "vertical",
210
212
  className: "changed-tooltip",
211
213
  children: [/*#__PURE__*/_jsxs(Space, {
212
214
  align: "start",
@@ -214,14 +216,16 @@ var ListChangedWrapper = props => {
214
216
  children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
215
217
  }), _showEllipse && /*#__PURE__*/_jsxs(Space, {
216
218
  className: "current-value-container",
217
- children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
219
+ children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), omit(rest, ['disabled'])), {}, {
220
+ // 过滤掉 disabled,避免传递到不支持 disabled 的元素
218
221
  isView: true
219
222
  })) : undefined]
220
223
  })]
221
224
  }),
222
225
  children: /*#__PURE__*/_jsx("div", {
223
226
  className: diffClassName,
224
- children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
227
+ children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), omit(rest, ['disabled'])), {}, {
228
+ // 过滤掉 disabled,避免传递到不支持 disabled 的元素
225
229
  otherProps: _objectSpread(_objectSpread({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
226
230
  isDiffChange: isChanged
227
231
  })
@@ -487,10 +487,5 @@ var ProEditTable = (_ref, ref) => {
487
487
  };
488
488
  var ForwardProEditTable = /*#__PURE__*/forwardRef(ProEditTable);
489
489
 
490
- // 删除输入就卡顿,需要研究
491
- ForwardProEditTable.defaultProps = {
492
- actionProps: [],
493
- toolbarProps: []
494
- };
495
490
  // 导出组件
496
491
  export default ForwardProEditTable;
@@ -169,7 +169,7 @@ var getActionColumn = config => {
169
169
  }
170
170
  return /*#__PURE__*/_jsx(Space, {
171
171
  size: "small",
172
- direction: actionDirection,
172
+ orientation: actionDirection,
173
173
  children: actionBtns.map(btnConfig => {
174
174
  return /*#__PURE__*/_jsx(React.Fragment, {
175
175
  children: /*#__PURE__*/_jsx(ActionButton, {
@@ -75,31 +75,34 @@ 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
- trim?: boolean;
79
- normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
80
78
  children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
81
- vertical?: boolean;
79
+ style?: React.CSSProperties;
80
+ normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
81
+ getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
82
+ valuePropName?: string;
83
+ viewRender?: (value: any, record: any, { form, index, namePath, }: {
84
+ [key: string]: any;
85
+ form: FormInstance<any>;
86
+ index?: number;
87
+ }) => string | React.ReactElement<any, any>;
88
+ isView?: boolean;
89
+ trim?: boolean;
90
+ prefixCls?: string;
91
+ trigger?: string;
82
92
  id?: string;
93
+ vertical?: boolean;
83
94
  className?: string;
84
95
  hidden?: boolean;
85
- style?: React.CSSProperties;
96
+ htmlFor?: string;
86
97
  onReset?: () => void;
87
- prefixCls?: string;
88
98
  rootClassName?: string;
89
- status?: "" | "success" | "error" | "warning" | "validating";
90
- trigger?: string;
99
+ validateTrigger?: string | false | string[];
91
100
  colon?: boolean;
92
- isView?: boolean;
93
- desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
94
- getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
95
- htmlFor?: string;
96
101
  labelAlign?: import("antd/es/form/interface").FormLabelAlign;
97
102
  labelCol?: import("antd").ColProps;
98
103
  getValueFromEvent?: (...args: import("@rc-component/form/lib/interface").EventArgs) => any;
99
104
  shouldUpdate?: import("@rc-component/form/lib/Field").ShouldUpdate<any>;
100
- validateTrigger?: string | false | string[];
101
105
  validateDebounce?: number;
102
- valuePropName?: string;
103
106
  messageVariables?: Record<string, string>;
104
107
  initialValue?: any;
105
108
  onMetaChange?: (meta: import("@rc-component/form/lib/Field").MetaEvent) => void;
@@ -110,23 +113,20 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
110
113
  hasFeedback?: boolean | {
111
114
  icons: import("antd/es/form/FormItem").FeedbackIcons;
112
115
  };
113
- validateStatus?: "" | "success" | "error" | "warning" | "validating";
116
+ validateStatus?: "" | "error" | "warning" | "success" | "validating";
114
117
  layout?: import("antd/es/form/Form").FormItemLayout;
115
118
  wrapperCol?: import("antd").ColProps;
119
+ status?: "" | "error" | "warning" | "success" | "validating";
116
120
  help?: React.ReactNode;
117
121
  fieldId?: string;
122
+ clearNotShow?: boolean;
118
123
  valueType?: import("../../../render/propsType").ProFormValueType;
119
124
  switchValue?: [any, any];
120
- viewRender?: (value: any, record: any, { form, index, namePath, }: {
121
- [key: string]: any;
122
- form: FormInstance<any>;
123
- index?: number;
124
- }) => string | React.ReactElement<any, any>;
125
125
  viewType?: import("../../../render/propsType").ViewType;
126
126
  upperCase?: boolean;
127
127
  toISOString?: boolean;
128
128
  toCSTString?: boolean;
129
- clearNotShow?: boolean;
129
+ desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
130
130
  name: any;
131
131
  dependencies: any[];
132
132
  tooltip: string | {
@@ -141,7 +141,7 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
141
141
  * 创建组件属性
142
142
  */
143
143
  export declare const createComponentProps: (column: FlexibleGroupColumnType, formItemProps: any) => {
144
- componentProps: import("lodash").Omit<any, "format" | "valueType" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "clearNotShow" | "precision">;
144
+ componentProps: import("lodash").Omit<any, "clearNotShow" | "format" | "valueType" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "precision">;
145
145
  formItemTransform: {
146
146
  getValueProps: any;
147
147
  normalize: any;
@@ -233,6 +233,9 @@ var ProForm = (props, ref) => {
233
233
  otherProps.layout = otherProps.layout || 'vertical';
234
234
  }
235
235
  }
236
+
237
+ // 过滤掉自定义 props,避免传递到 DOM 元素
238
+ var filteredOtherProps = omit(otherProps, ['desensitizationKey']);
236
239
  return /*#__PURE__*/_jsxs(Form, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
237
240
  onKeyPress: event => {
238
241
  if (!submitOnEnter) return;
@@ -242,7 +245,7 @@ var ProForm = (props, ref) => {
242
245
  },
243
246
  className: cls,
244
247
  form: form
245
- }, formProps), omit(config, ['isDiffAll'])), otherProps), {}, {
248
+ }, formProps), omit(config, ['isDiffAll'])), filteredOtherProps), {}, {
246
249
  labelAlign: (_ref3 = labelAlign !== null && labelAlign !== void 0 ? labelAlign : config.labelAlign) !== null && _ref3 !== void 0 ? _ref3 : 'left',
247
250
  onValuesChange: handleValuesChange,
248
251
  onFinish: handleFinish,
@@ -41,7 +41,7 @@ var FoldMenu = props => {
41
41
  children: /*#__PURE__*/_jsx("ul", {
42
42
  className: "pro-layout-menu-fold-list",
43
43
  style: _objectSpread({}, style),
44
- children: menus.map((item, index) => {
44
+ children: menus.filter(item => !item.hideInMenu).map((item, index) => {
45
45
  var _url$split;
46
46
  var id = item.id,
47
47
  url = item.url,
@@ -49,14 +49,8 @@ var FoldMenu = props => {
49
49
  icon = item.icon,
50
50
  imgUrl = item.imgUrl,
51
51
  imgActiveUrl = item.imgActiveUrl,
52
- hideInMenu = item.hideInMenu,
53
52
  children = item.children;
54
53
  var toPath = item.redirectUrl || item.url;
55
-
56
- // 隐藏菜单
57
- if (hideInMenu) {
58
- return null;
59
- }
60
54
  var selectedMenu = getUrlParams('activeMenu');
61
55
  var pathToMatch = selectedPath || selectedMenu || window.location.pathname;
62
56
 
@@ -88,7 +82,7 @@ var FoldMenu = props => {
88
82
  children: name
89
83
  })]
90
84
  })
91
- }, `${id}-${name}`);
85
+ });
92
86
  return hasChildrenMenu ? /*#__PURE__*/_jsx(Popover, {
93
87
  mouseEnterDelay: 0,
94
88
  content: /*#__PURE__*/_jsx(SideMenu, {
@@ -98,10 +92,14 @@ var FoldMenu = props => {
98
92
  onMenuClick: onMenuClick
99
93
  }),
100
94
  color: "#fff",
101
- overlayClassName: noticeCls,
102
- overlayInnerStyle: {
103
- marginTop: headerHeight - 48,
104
- height: `calc(100vh - ${headerHeight + (notice ? 32 : 0)}px)`
95
+ classNames: {
96
+ root: noticeCls
97
+ },
98
+ styles: {
99
+ content: {
100
+ marginTop: headerHeight - 48,
101
+ height: `calc(100vh - ${headerHeight + (notice ? 32 : 0)}px)`
102
+ }
105
103
  },
106
104
  placement: "rightTop",
107
105
  children: /*#__PURE__*/_jsx("span", {
@@ -145,9 +143,9 @@ var FoldMenu = props => {
145
143
  children: /*#__PURE__*/_jsx(Link, {
146
144
  to: toPath,
147
145
  children: LiNode
148
- }, toPath)
146
+ })
149
147
  })
150
- }, toPath) : /*#__PURE__*/_jsx("span", {
148
+ }, `${id}-${name}`) : /*#__PURE__*/_jsx("span", {
151
149
  onClick: () => {
152
150
  // 查找完整的菜单项数据
153
151
  var menuItem = findMenuItemByKey(menus, String(id));
@@ -165,8 +163,8 @@ var FoldMenu = props => {
165
163
  children: /*#__PURE__*/_jsx(Link, {
166
164
  to: toPath,
167
165
  children: LiNode
168
- }, toPath)
169
- });
166
+ })
167
+ }, `${id}-${name}`);
170
168
  })
171
169
  })
172
170
  });
@@ -10,17 +10,6 @@ interface LayoutContextValue {
10
10
  export declare const LayoutContext: import("react").Context<LayoutContextValue>;
11
11
  declare const ProLayout: {
12
12
  (props: ProLayoutType): import("react/jsx-runtime").JSX.Element;
13
- defaultProps: {
14
- menus: any[];
15
- iconfontUrl: string;
16
- title: string;
17
- collapsed: boolean;
18
- routerMatch: string;
19
- pure: boolean;
20
- theme: string;
21
- headerHeight: number;
22
- contentStyle: {};
23
- };
24
13
  ProCollapse: (props: import("./components/ProCollapse/PropTypes").ProCollapseType) => import("react/jsx-runtime").JSX.Element;
25
14
  ProFooter: import("react").MemoExoticComponent<(props: import("./components/ProFooter/PropTypes").ProFooterType) => import("react/jsx-runtime").JSX.Element>;
26
15
  ProHeader: import("react").MemoExoticComponent<(props: import("./components/ProHeader/PropTypes").ProHeaderType) => import("react/jsx-runtime").JSX.Element>;
@@ -57,9 +57,11 @@ var ProLayout = props => {
57
57
  headerTitleRender = props.headerTitleRender,
58
58
  headerContentRender = props.headerContentRender,
59
59
  rightContentRender = props.rightContentRender,
60
- title = props.title,
60
+ _props$title = props.title,
61
+ title = _props$title === void 0 ? '' : _props$title,
61
62
  logo = props.logo,
62
- iconfontUrl = props.iconfontUrl,
63
+ _props$iconfontUrl = props.iconfontUrl,
64
+ iconfontUrl = _props$iconfontUrl === void 0 ? '' : _props$iconfontUrl,
63
65
  sideMenuFooterRender = props.sideMenuFooterRender,
64
66
  sideMenuHeaderRender = props.sideMenuHeaderRender,
65
67
  _props$mode = props.mode,
@@ -242,17 +244,6 @@ var ProLayout = props => {
242
244
  }))
243
245
  });
244
246
  };
245
- ProLayout.defaultProps = {
246
- menus: [],
247
- iconfontUrl: '',
248
- title: '',
249
- collapsed: false,
250
- routerMatch: 'id',
251
- pure: false,
252
- theme: 'dark',
253
- headerHeight: 48,
254
- contentStyle: {}
255
- };
256
247
  ProLayout.ProCollapse = ProCollapse;
257
248
  ProLayout.ProFooter = ProFooter;
258
249
  ProLayout.ProHeader = ProHeader;
@@ -31,7 +31,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
31
31
  import { jsxs as _jsxs } from "react/jsx-runtime";
32
32
  var SHOW_PARENT = TreeSelect.SHOW_PARENT;
33
33
  export var ProTreeSelect = (props, ref) => {
34
- var _useRequest$options, _selectProps$classNam, _selectProps$classNam2, _selectProps$styles, _selectProps$styles2;
34
+ var _useRequest$options, _useRequest$options3, _selectProps$classNam, _selectProps$classNam2, _selectProps$styles, _selectProps$styles2;
35
35
  // 全局属性配置在ConfigProvider
36
36
  var _ref = useProConfig('ProTreeSelect') || {},
37
37
  _ref$fieldNames = _ref.fieldNames,
@@ -234,7 +234,8 @@ export var ProTreeSelect = (props, ref) => {
234
234
  defaultOnSuccessFun(fetchFunction.data);
235
235
  }
236
236
  }
237
- }, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data, transformFieldNames]);
237
+ // eslint-disable-next-line react-hooks/exhaustive-deps
238
+ }, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data, useRequest === null || useRequest === void 0 || (_useRequest$options3 = useRequest.options) === null || _useRequest$options3 === void 0 ? void 0 : _useRequest$options3.cacheKey]);
238
239
  useDeepCompareEffect(() => {
239
240
  if (enumCode) {
240
241
  var dictEnum = dics[enumCode] || [];
@@ -256,7 +257,8 @@ export var ProTreeSelect = (props, ref) => {
256
257
  origDataSource: _resultData
257
258
  });
258
259
  }
259
- }, [enumCode, dataSource, transformFieldNames]);
260
+ // eslint-disable-next-line react-hooks/exhaustive-deps
261
+ }, [enumCode, dataSource, showCodeName]);
260
262
  useDeepCompareEffect(() => {
261
263
  // code存在huo dataSource存在,不执行接口请求
262
264
  if (enumCode || dataSource) {
@@ -182,7 +182,9 @@ var ListChangedWrapper = props => {
182
182
  })) : undefined;
183
183
  }, [originalValue, children]);
184
184
  if (!isWatch || noChange) {
185
- return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest));
185
+ // 过滤掉 disabled,避免传递到 div 等不支持 disabled 的元素
186
+ var filteredRest = (0, _lodash.omit)(rest, ['disabled']);
187
+ return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, _objectSpread(_objectSpread({}, children.props), filteredRest));
186
188
  }
187
189
 
188
190
  // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -214,7 +216,7 @@ var ListChangedWrapper = props => {
214
216
  placement: "topLeft",
215
217
  autoAdjustOverflow: false,
216
218
  title: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
217
- direction: "vertical",
219
+ orientation: "vertical",
218
220
  className: "changed-tooltip",
219
221
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
220
222
  align: "start",
@@ -222,14 +224,16 @@ var ListChangedWrapper = props => {
222
224
  children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
223
225
  }), _showEllipse && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
224
226
  className: "current-value-container",
225
- children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
227
+ children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), (0, _lodash.omit)(rest, ['disabled'])), {}, {
228
+ // 过滤掉 disabled,避免传递到不支持 disabled 的元素
226
229
  isView: true
227
230
  })) : undefined]
228
231
  })]
229
232
  }),
230
233
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
231
234
  className: diffClassName,
232
- children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
235
+ children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), (0, _lodash.omit)(rest, ['disabled'])), {}, {
236
+ // 过滤掉 disabled,避免传递到不支持 disabled 的元素
233
237
  otherProps: _objectSpread(_objectSpread({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
234
238
  isDiffChange: isChanged
235
239
  })
@@ -494,10 +494,5 @@ var ProEditTable = (_ref, ref) => {
494
494
  };
495
495
  var ForwardProEditTable = /*#__PURE__*/(0, _react.forwardRef)(ProEditTable);
496
496
 
497
- // 删除输入就卡顿,需要研究
498
- ForwardProEditTable.defaultProps = {
499
- actionProps: [],
500
- toolbarProps: []
501
- };
502
497
  // 导出组件
503
498
  var _default = exports.default = ForwardProEditTable;
@@ -173,7 +173,7 @@ var getActionColumn = config => {
173
173
  }
174
174
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
175
175
  size: "small",
176
- direction: actionDirection,
176
+ orientation: actionDirection,
177
177
  children: actionBtns.map(btnConfig => {
178
178
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
179
179
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ActionButton, {
@@ -75,31 +75,34 @@ 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
- trim?: boolean;
79
- normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
80
78
  children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
81
- vertical?: boolean;
79
+ style?: React.CSSProperties;
80
+ normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
81
+ getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
82
+ valuePropName?: string;
83
+ viewRender?: (value: any, record: any, { form, index, namePath, }: {
84
+ [key: string]: any;
85
+ form: FormInstance<any>;
86
+ index?: number;
87
+ }) => string | React.ReactElement<any, any>;
88
+ isView?: boolean;
89
+ trim?: boolean;
90
+ prefixCls?: string;
91
+ trigger?: string;
82
92
  id?: string;
93
+ vertical?: boolean;
83
94
  className?: string;
84
95
  hidden?: boolean;
85
- style?: React.CSSProperties;
96
+ htmlFor?: string;
86
97
  onReset?: () => void;
87
- prefixCls?: string;
88
98
  rootClassName?: string;
89
- status?: "" | "success" | "error" | "warning" | "validating";
90
- trigger?: string;
99
+ validateTrigger?: string | false | string[];
91
100
  colon?: boolean;
92
- isView?: boolean;
93
- desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
94
- getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
95
- htmlFor?: string;
96
101
  labelAlign?: import("antd/es/form/interface").FormLabelAlign;
97
102
  labelCol?: import("antd").ColProps;
98
103
  getValueFromEvent?: (...args: import("@rc-component/form/lib/interface").EventArgs) => any;
99
104
  shouldUpdate?: import("@rc-component/form/lib/Field").ShouldUpdate<any>;
100
- validateTrigger?: string | false | string[];
101
105
  validateDebounce?: number;
102
- valuePropName?: string;
103
106
  messageVariables?: Record<string, string>;
104
107
  initialValue?: any;
105
108
  onMetaChange?: (meta: import("@rc-component/form/lib/Field").MetaEvent) => void;
@@ -110,23 +113,20 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
110
113
  hasFeedback?: boolean | {
111
114
  icons: import("antd/es/form/FormItem").FeedbackIcons;
112
115
  };
113
- validateStatus?: "" | "success" | "error" | "warning" | "validating";
116
+ validateStatus?: "" | "error" | "warning" | "success" | "validating";
114
117
  layout?: import("antd/es/form/Form").FormItemLayout;
115
118
  wrapperCol?: import("antd").ColProps;
119
+ status?: "" | "error" | "warning" | "success" | "validating";
116
120
  help?: React.ReactNode;
117
121
  fieldId?: string;
122
+ clearNotShow?: boolean;
118
123
  valueType?: import("../../../render/propsType").ProFormValueType;
119
124
  switchValue?: [any, any];
120
- viewRender?: (value: any, record: any, { form, index, namePath, }: {
121
- [key: string]: any;
122
- form: FormInstance<any>;
123
- index?: number;
124
- }) => string | React.ReactElement<any, any>;
125
125
  viewType?: import("../../../render/propsType").ViewType;
126
126
  upperCase?: boolean;
127
127
  toISOString?: boolean;
128
128
  toCSTString?: boolean;
129
- clearNotShow?: boolean;
129
+ desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
130
130
  name: any;
131
131
  dependencies: any[];
132
132
  tooltip: string | {
@@ -141,7 +141,7 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
141
141
  * 创建组件属性
142
142
  */
143
143
  export declare const createComponentProps: (column: FlexibleGroupColumnType, formItemProps: any) => {
144
- componentProps: import("lodash").Omit<any, "format" | "valueType" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "clearNotShow" | "precision">;
144
+ componentProps: import("lodash").Omit<any, "clearNotShow" | "format" | "valueType" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "precision">;
145
145
  formItemTransform: {
146
146
  getValueProps: any;
147
147
  normalize: any;
@@ -241,6 +241,9 @@ var ProForm = (props, ref) => {
241
241
  otherProps.layout = otherProps.layout || 'vertical';
242
242
  }
243
243
  }
244
+
245
+ // 过滤掉自定义 props,避免传递到 DOM 元素
246
+ var filteredOtherProps = (0, _lodash.omit)(otherProps, ['desensitizationKey']);
244
247
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Form, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
245
248
  onKeyPress: event => {
246
249
  if (!submitOnEnter) return;
@@ -250,7 +253,7 @@ var ProForm = (props, ref) => {
250
253
  },
251
254
  className: cls,
252
255
  form: form
253
- }, formProps), (0, _lodash.omit)(config, ['isDiffAll'])), otherProps), {}, {
256
+ }, formProps), (0, _lodash.omit)(config, ['isDiffAll'])), filteredOtherProps), {}, {
254
257
  labelAlign: (_ref3 = labelAlign !== null && labelAlign !== void 0 ? labelAlign : config.labelAlign) !== null && _ref3 !== void 0 ? _ref3 : 'left',
255
258
  onValuesChange: handleValuesChange,
256
259
  onFinish: handleFinish,
@@ -47,7 +47,7 @@ var FoldMenu = props => {
47
47
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
48
48
  className: "pro-layout-menu-fold-list",
49
49
  style: _objectSpread({}, style),
50
- children: menus.map((item, index) => {
50
+ children: menus.filter(item => !item.hideInMenu).map((item, index) => {
51
51
  var _url$split;
52
52
  var id = item.id,
53
53
  url = item.url,
@@ -55,14 +55,8 @@ var FoldMenu = props => {
55
55
  icon = item.icon,
56
56
  imgUrl = item.imgUrl,
57
57
  imgActiveUrl = item.imgActiveUrl,
58
- hideInMenu = item.hideInMenu,
59
58
  children = item.children;
60
59
  var toPath = item.redirectUrl || item.url;
61
-
62
- // 隐藏菜单
63
- if (hideInMenu) {
64
- return null;
65
- }
66
60
  var selectedMenu = (0, _utils.getUrlParams)('activeMenu');
67
61
  var pathToMatch = selectedPath || selectedMenu || window.location.pathname;
68
62
 
@@ -94,7 +88,7 @@ var FoldMenu = props => {
94
88
  children: name
95
89
  })]
96
90
  })
97
- }, `${id}-${name}`);
91
+ });
98
92
  return hasChildrenMenu ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Popover, {
99
93
  mouseEnterDelay: 0,
100
94
  content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SideMenu.default, {
@@ -104,10 +98,14 @@ var FoldMenu = props => {
104
98
  onMenuClick: onMenuClick
105
99
  }),
106
100
  color: "#fff",
107
- overlayClassName: noticeCls,
108
- overlayInnerStyle: {
109
- marginTop: headerHeight - 48,
110
- height: `calc(100vh - ${headerHeight + (notice ? 32 : 0)}px)`
101
+ classNames: {
102
+ root: noticeCls
103
+ },
104
+ styles: {
105
+ content: {
106
+ marginTop: headerHeight - 48,
107
+ height: `calc(100vh - ${headerHeight + (notice ? 32 : 0)}px)`
108
+ }
111
109
  },
112
110
  placement: "rightTop",
113
111
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
@@ -151,9 +149,9 @@ var FoldMenu = props => {
151
149
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Link, {
152
150
  to: toPath,
153
151
  children: LiNode
154
- }, toPath)
152
+ })
155
153
  })
156
- }, toPath) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
154
+ }, `${id}-${name}`) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
157
155
  onClick: () => {
158
156
  // 查找完整的菜单项数据
159
157
  var menuItem = (0, _utils.findMenuItemByKey)(menus, String(id));
@@ -171,8 +169,8 @@ var FoldMenu = props => {
171
169
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Link, {
172
170
  to: toPath,
173
171
  children: LiNode
174
- }, toPath)
175
- });
172
+ })
173
+ }, `${id}-${name}`);
176
174
  })
177
175
  })
178
176
  });
@@ -10,17 +10,6 @@ interface LayoutContextValue {
10
10
  export declare const LayoutContext: import("react").Context<LayoutContextValue>;
11
11
  declare const ProLayout: {
12
12
  (props: ProLayoutType): import("react/jsx-runtime").JSX.Element;
13
- defaultProps: {
14
- menus: any[];
15
- iconfontUrl: string;
16
- title: string;
17
- collapsed: boolean;
18
- routerMatch: string;
19
- pure: boolean;
20
- theme: string;
21
- headerHeight: number;
22
- contentStyle: {};
23
- };
24
13
  ProCollapse: (props: import("./components/ProCollapse/PropTypes").ProCollapseType) => import("react/jsx-runtime").JSX.Element;
25
14
  ProFooter: import("react").MemoExoticComponent<(props: import("./components/ProFooter/PropTypes").ProFooterType) => import("react/jsx-runtime").JSX.Element>;
26
15
  ProHeader: import("react").MemoExoticComponent<(props: import("./components/ProHeader/PropTypes").ProHeaderType) => import("react/jsx-runtime").JSX.Element>;
@@ -71,9 +71,11 @@ var ProLayout = props => {
71
71
  headerTitleRender = props.headerTitleRender,
72
72
  headerContentRender = props.headerContentRender,
73
73
  rightContentRender = props.rightContentRender,
74
- title = props.title,
74
+ _props$title = props.title,
75
+ title = _props$title === void 0 ? '' : _props$title,
75
76
  logo = props.logo,
76
- iconfontUrl = props.iconfontUrl,
77
+ _props$iconfontUrl = props.iconfontUrl,
78
+ iconfontUrl = _props$iconfontUrl === void 0 ? '' : _props$iconfontUrl,
77
79
  sideMenuFooterRender = props.sideMenuFooterRender,
78
80
  sideMenuHeaderRender = props.sideMenuHeaderRender,
79
81
  _props$mode = props.mode,
@@ -256,17 +258,6 @@ var ProLayout = props => {
256
258
  }))
257
259
  });
258
260
  };
259
- ProLayout.defaultProps = {
260
- menus: [],
261
- iconfontUrl: '',
262
- title: '',
263
- collapsed: false,
264
- routerMatch: 'id',
265
- pure: false,
266
- theme: 'dark',
267
- headerHeight: 48,
268
- contentStyle: {}
269
- };
270
261
  ProLayout.ProCollapse = _components.ProCollapse;
271
262
  ProLayout.ProFooter = _components.ProFooter;
272
263
  ProLayout.ProHeader = _components.ProHeader;
@@ -39,7 +39,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
39
39
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
40
40
  var SHOW_PARENT = _antd.TreeSelect.SHOW_PARENT;
41
41
  var ProTreeSelect = (props, ref) => {
42
- var _useRequest$options, _selectProps$classNam, _selectProps$classNam2, _selectProps$styles, _selectProps$styles2;
42
+ var _useRequest$options, _useRequest$options3, _selectProps$classNam, _selectProps$classNam2, _selectProps$styles, _selectProps$styles2;
43
43
  // 全局属性配置在ConfigProvider
44
44
  var _ref = (0, _ProConfigProvider.useProConfig)('ProTreeSelect') || {},
45
45
  _ref$fieldNames = _ref.fieldNames,
@@ -242,7 +242,8 @@ var ProTreeSelect = (props, ref) => {
242
242
  defaultOnSuccessFun(fetchFunction.data);
243
243
  }
244
244
  }
245
- }, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data, transformFieldNames]);
245
+ // eslint-disable-next-line react-hooks/exhaustive-deps
246
+ }, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data, useRequest === null || useRequest === void 0 || (_useRequest$options3 = useRequest.options) === null || _useRequest$options3 === void 0 ? void 0 : _useRequest$options3.cacheKey]);
246
247
  (0, _ahooks.useDeepCompareEffect)(() => {
247
248
  if (enumCode) {
248
249
  var dictEnum = dics[enumCode] || [];
@@ -264,7 +265,8 @@ var ProTreeSelect = (props, ref) => {
264
265
  origDataSource: _resultData
265
266
  });
266
267
  }
267
- }, [enumCode, dataSource, transformFieldNames]);
268
+ // eslint-disable-next-line react-hooks/exhaustive-deps
269
+ }, [enumCode, dataSource, showCodeName]);
268
270
  (0, _ahooks.useDeepCompareEffect)(() => {
269
271
  // code存在huo dataSource存在,不执行接口请求
270
272
  if (enumCode || dataSource) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -1,13 +0,0 @@
1
- module.exports = {
2
- presets: [
3
- ['@babel/preset-env', { loose: true }],
4
- ['@babel/preset-react', { runtime: 'automatic' }],
5
- '@babel/preset-typescript',
6
- ],
7
- plugins: [
8
- ['@babel/plugin-proposal-decorators', { legacy: true }],
9
- ['@babel/plugin-proposal-class-properties', { loose: true }],
10
- ['@babel/plugin-transform-private-methods', { loose: true }],
11
- ['@babel/plugin-transform-private-property-in-object', { loose: true }],
12
- ],
13
- };
@@ -1,159 +0,0 @@
1
- {
2
- "name": "@zat-design/sisyphus-react",
3
- "version": "4.0.0-ant6",
4
- "license": "MIT",
5
- "main": "lib/index.js",
6
- "module": "es/index.js",
7
- "typings": "lib/index.d.ts",
8
- "homepage": "https://procomponents.zhongan.tech",
9
- "keywords": [
10
- "components",
11
- "design",
12
- "framework",
13
- "frontend",
14
- "react",
15
- "react-component",
16
- "ui",
17
- "zat-design",
18
- "sisyphus",
19
- "react-sisyphus",
20
- "pro-components"
21
- ],
22
- "scripts": {
23
- "analyze": "ANALYZE=1 dumi build",
24
- "build": "father build && mv dist/index.min.css dist/index.esm.css && mv dist/less.min.css dist/less.esm.css",
25
- "build-es": "father build --format esm",
26
- "build-lib": "father build --format cjs",
27
- "build-dist": "father build --format umd",
28
- "docs": "cross-env NODE_OPTIONS=\"--openssl-legacy-provider\" dumi build",
29
- "docs:deploy": "gh-pages -d docs-dist",
30
- "lint": "npm run lint:js && npm run lint:style && npm run lint:prettier",
31
- "lint-staged": "lint-staged",
32
- "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx --ignore-pattern '**/__tests__/**' --ignore-pattern '**/*.test.*' --ignore-pattern '**/*.spec.*'",
33
- "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
34
- "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
35
- "lint:prettier": "prettier --check \"**/*\" --end-of-line auto",
36
- "lint:report": "eslint --ext .jsx,.js src -f checkstyle -o report_zacc_eslint_js.xml & exit 0; stylelint --custom-formatter node_modules/stylelint-checkstyle-formatter src/**/*.{css,scss,less} > report_zacc_stylelint_css.xml & exit 0",
37
- "lint:style": "stylelint --fix \"src/**/*.less\" --syntax less",
38
- "precommit": "lint-staged",
39
- "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
40
- "postpublish": "git clean -fd",
41
- "release": "yarn build && npm publish",
42
- "release:beta": "yarn build && npm publish --tag=beta",
43
- "start": "cross-env NODE_OPTIONS=\"--openssl-legacy-provider\" dumi dev",
44
- "test": "umi-test",
45
- "test:coverage": "umi-test --coverage",
46
- "tsc": "tsc --noEmit"
47
- },
48
- "husky": {
49
- "hooks": {
50
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
51
- "pre-commit": "npm run lint-staged"
52
- }
53
- },
54
- "lint-staged": {
55
- "src/**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js"
56
- },
57
- "browserslist": [
58
- "last 2 versions",
59
- "Firefox ESR",
60
- "> 1%",
61
- "ie >= 11",
62
- "iOS >= 7",
63
- "Android >= 4"
64
- ],
65
- "overrides": {
66
- "react-resizable": {
67
- "react-draggable": "<4.5.0"
68
- }
69
- },
70
- "resolutions": {
71
- "mockjs/commander": "9.2.0",
72
- "react-draggable": "<4.5.0"
73
- },
74
- "dependencies": {
75
- "@ant-design/icons": "^5.6.1",
76
- "@babel/runtime": "^7.18.0",
77
- "@dnd-kit/core": "^6.0.8",
78
- "@dnd-kit/sortable": "^7.0.2",
79
- "@dnd-kit/utilities": "^3.2.1",
80
- "@zat-design/utils": "4.0.0-beta.5",
81
- "ahooks": "3.9.5",
82
- "antd": "^5.28.1",
83
- "big.js": "^6.2.1",
84
- "classnames": "^2.3.1",
85
- "dayjs": "^1.11.13",
86
- "lodash": "^4.17.21",
87
- "rc-resize-observer": "^1.4.0",
88
- "react-lazyload": "^3.2.1",
89
- "react-resizable": "^3.0.5",
90
- "react-svg": "^15.1.7"
91
- },
92
- "peerDependencies": {
93
- "antd": "^5.26.4",
94
- "react": "^18",
95
- "react-dom": "^18",
96
- "react-router-dom": "^6.0.0"
97
- },
98
- "devDependencies": {
99
- "@commitlint/cli": "^12.1.1",
100
- "@commitlint/config-conventional": "^12.1.1",
101
- "@testing-library/jest-dom": "^6.0.0",
102
- "@testing-library/react": "^14.0.0",
103
- "@types/classnames": "^2.3.1",
104
- "@types/jest": "^29.5.11",
105
- "@types/lodash": "^4.14.171",
106
- "@types/react": "^18.2.0",
107
- "@types/react-dom": "^18.2.0",
108
- "@types/react-lazyload": "^3.2.3",
109
- "@types/react-resizable": "^3.0.8",
110
- "@typescript-eslint/eslint-plugin": "4.0.1",
111
- "@typescript-eslint/parser": "4.0.1",
112
- "@umijs/fabric": "^2.8.1",
113
- "@umijs/preset-react": "^1.8.22",
114
- "@umijs/test": "^3.0.5",
115
- "@zat-design/login-react": "1.0.25",
116
- "babel-eslint": "10.0.3",
117
- "babel-plugin-import": "^1.13.8",
118
- "babel-plugin-lodash": "^3.3.4",
119
- "commander": "9.2.0",
120
- "cross-env": "^7.0.3",
121
- "dumi": "^1.0.9",
122
- "eslint": "7.10.0",
123
- "eslint-config-za": "2.1.0",
124
- "eslint-plugin-babel": "5.3.0",
125
- "eslint-plugin-complexity": "^1.0.2",
126
- "eslint-plugin-import": "^2.22.1",
127
- "eslint-plugin-jsx-a11y": "6.2.3",
128
- "eslint-plugin-react": "7.16.0",
129
- "eslint-plugin-react-hooks": "2.2.0",
130
- "eslint-plugin-unused-imports": "^3.0.0",
131
- "father": "^4.6.1",
132
- "gh-pages": "^3.0.0",
133
- "husky": "^4.0.7",
134
- "jest-canvas-mock": "^2.5.2",
135
- "lint-staged": "^10.0.0",
136
- "mini-css-extract-plugin": "^2.9.4",
137
- "minimatch": "^10.1.1",
138
- "mockjs": "^1.0.0",
139
- "prettier": "^2.5.0",
140
- "pretty-quick": "^3.1.3",
141
- "react": "^18.2.0",
142
- "react-dom": "^18.2.0",
143
- "react-json-view": "^1.21.3",
144
- "slash2": "^2.0.0",
145
- "stylelint": "13.0.0",
146
- "stylelint-checkstyle-formatter": "0.1.2",
147
- "typescript": "^4.9.5",
148
- "webpack-deadcode-plugin": "^0.1.17",
149
- "yorkie": "^2.0.0"
150
- },
151
- "checkFiles": [
152
- "src/**/*.js*",
153
- "src/**/*.ts*",
154
- "src/**/*.tsx*",
155
- "src/**/*.less",
156
- "config/**/*.js*",
157
- "scripts/**/*.js"
158
- ]
159
- }