@zat-design/sisyphus-react 4.5.7-beta.1 → 4.5.7

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
@@ -86,6 +86,12 @@ createRoot(document.getElementById('root')!).render(<App />);
86
86
 
87
87
  ### 本地开发
88
88
 
89
+ 本项目当前依赖链包含旧版 Umi/Dumi 与 React 19 的 peer dependency 冲突,使用 npm 安装时会自动启用 legacy peer 解析:
90
+
91
+ ```bash
92
+ npm install --legacy-peer-deps
93
+ ```
94
+
89
95
  ```bash
90
96
  yarn install
91
97
  yarn start
@@ -98,23 +104,21 @@ yarn test
98
104
  yarn test:coverage # 带覆盖率
99
105
  ```
100
106
 
101
- ### 组件库打包发布
107
+ ### 三包打包发布
102
108
 
103
109
  ```bash
104
- # 1. 构建(生成 es/lib/dist 目录)
105
- yarn build
110
+ # 日常 beta:要求根版本含预发布标识,如 4.5.7-beta.2
111
+ yarn release:beta
106
112
 
107
- # 2. 发布到 npm
108
- yarn release # 正式版
109
- yarn release:beta # beta 版本
110
- ```
111
-
112
- 2. 执行发布(使用域账号登录):
113
+ # 周五正式版:要求根版本不含预发布标识,如 4.5.7
114
+ yarn release
113
115
 
114
- ```bash
115
- npm publish
116
+ # 校验、构建、跑完组件/MCP/Scene 测试并预览 pack,不发布
117
+ yarn release:check
116
118
  ```
117
119
 
120
+ 发布前只需手工修改根 `package.json` 的 `version`。命令会同步 MCP、Scene、文档和契约版本,完成构建、全量测试、校验与打包,再按组件库 → MCP → Scene 发布。安装可继续使用 npmmirror,发布固定走 `https://registry.npmjs.org/`。npm 的浏览器登录/2FA 提示保持原样;中途失败后重跑同一命令,会跳过已经存在的同版本包并继续。
121
+
118
122
  ## 技术栈
119
123
 
120
124
  - React 18.3+ / React 19
@@ -144,7 +144,7 @@ const ProModal = ({
144
144
  title: title,
145
145
  width: width,
146
146
  open: open,
147
- mask: typeof modalMask === 'object' ? {
147
+ mask: typeof modalMask === 'object' && modalMask !== null ? {
148
148
  closable: maskClosable,
149
149
  ...modalMask
150
150
  } : modalMask ?? {
@@ -6,6 +6,7 @@ import _get from "lodash/get";
6
6
  import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
7
7
  import { useLocalStorageState, useSetState } from 'ahooks';
8
8
  import { ConfigProvider, Form, Affix } from 'antd';
9
+ import { ConfigContext } from 'antd/es/config-provider';
9
10
  import classnames from 'classnames';
10
11
  import { transformColumns } from "./utils";
11
12
  import { createErrorStore } from "./utils/validateAll";
@@ -87,7 +88,7 @@ const ProEditTable = ({
87
88
 
88
89
  const {
89
90
  getPrefixCls
90
- } = React.useContext(ConfigProvider.ConfigContext);
91
+ } = React.useContext(ConfigContext);
91
92
  const prefixCls = getPrefixCls();
92
93
  const [themeConfig] = useLocalStorageState('themeConfig');
93
94
  const requiredAlign = useMemo(() => {
@@ -40,7 +40,6 @@ const ToolbarButton = props => {
40
40
  const _toolbarProps = props.toolbarProps?.map(item => {
41
41
  return {
42
42
  ...item,
43
- // @ts-ignore
44
43
  type: item.actionType || item.type
45
44
  };
46
45
  });
@@ -26,6 +26,8 @@ export interface ActionType extends Omit<ButtonProps, 'onClick' | 'type'> {
26
26
  addIndex?: number | ((record: any, option: Pick<Option, 'index' | 'form' | 'namePath' | 'operation'>) => number);
27
27
  }
28
28
  export interface ToolbarActionType extends Omit<ActionType, 'actionType' | 'onHandle' | 'onClick' | 'show' | 'type'> {
29
+ /** @deprecated 使用 type,保留旧配置兼容 */
30
+ actionType?: 'add';
29
31
  type?: 'add';
30
32
  onHandle?: ToolbarCallback;
31
33
  onClick?: ToolbarCallback;
@@ -1,5 +1,5 @@
1
1
  import { InternalNamePath, NamePath } from 'antd/lib/form/interface';
2
- import { FormInstance } from 'antd';
2
+ import { FormInstance, type FormItemProps } from 'antd';
3
3
  import React from 'react';
4
4
  import type { GroupColumnType, SpaceType, FlexibleGroupColumnType } from '../propsType';
5
5
  import type { ProFormColumnType, ReactiveFunction } from '../../../render/propsType';
@@ -62,80 +62,13 @@ interface GroupProps {
62
62
  disabled?: boolean;
63
63
  formDisabled?: boolean;
64
64
  }
65
+ type GroupFormItemProps = FormItemProps & {
66
+ disabled?: boolean;
67
+ };
65
68
  /**
66
69
  * 创建FormItem属性(Hook版本)
67
70
  */
68
- export declare const useFormItemProps: (column: FlexibleGroupColumnType, contextProps: ContextProps, groupProps: GroupProps) => {
69
- rules: any[];
70
- required: boolean;
71
- label: string;
72
- before?: React.ReactNode;
73
- after?: React.ReactNode;
74
- confirm?: boolean | import("antd").ModalFuncProps | import("../../../render/propsType").FunctionArgs<any, boolean | import("antd").ModalFuncProps>;
75
- show?: boolean | ReactiveFunction<any, boolean>;
76
- component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
77
- className?: string;
78
- hidden?: boolean;
79
- id?: string;
80
- style?: React.CSSProperties;
81
- children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
82
- onReset?: () => void;
83
- prefixCls?: string;
84
- isView?: boolean;
85
- desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
86
- rootClassName?: string;
87
- status?: import("antd/es/form/FormItem").ValidateStatus;
88
- vertical?: boolean;
89
- getValueProps?: ((value: any) => Record<string, unknown>) & ((value: import("@rc-component/form/lib/interface").StoreValue) => Record<string, unknown>);
90
- colon?: boolean;
91
- htmlFor?: string;
92
- labelAlign?: import("antd/es/form/interface").FormLabelAlign;
93
- labelCol?: import("antd").ColProps;
94
- getValueFromEvent?: (...args: import("@rc-component/form/lib/interface").EventArgs) => import("@rc-component/form/lib/interface").StoreValue;
95
- normalize?: (value: import("@rc-component/form/lib/interface").StoreValue, prevValue: import("@rc-component/form/lib/interface").StoreValue, allValues: import("@rc-component/form/lib/interface").Store) => import("@rc-component/form/lib/interface").StoreValue;
96
- shouldUpdate?: import("@rc-component/form/lib/Field").ShouldUpdate<any>;
97
- trigger?: string;
98
- validateTrigger?: string | string[] | false;
99
- validateDebounce?: number;
100
- valuePropName?: string;
101
- messageVariables?: Record<string, string>;
102
- initialValue?: any;
103
- onMetaChange?: (meta: import("@rc-component/form/lib/Field").MetaEvent) => void;
104
- preserve?: boolean;
105
- isListField?: boolean;
106
- isList?: boolean;
107
- noStyle?: boolean;
108
- hasFeedback?: boolean | {
109
- icons: import("antd/es/form/FormItem").FeedbackIcons;
110
- };
111
- validateStatus?: import("antd/es/form/FormItem").ValidateStatus;
112
- layout?: import("antd/es/form/Form").FormItemLayout;
113
- wrapperCol?: import("antd").ColProps;
114
- help?: React.ReactNode;
115
- fieldId?: string;
116
- valueType?: import("../../../render/propsType").ProFormValueType;
117
- toISOString?: boolean;
118
- toCSTString?: boolean;
119
- switchValue?: [any, any];
120
- clearNotShow?: boolean;
121
- trim?: boolean;
122
- upperCase?: boolean;
123
- viewRender?: (value: any, record: any, { form, index, namePath, }: {
124
- [key: string]: any;
125
- form: FormInstance<any>;
126
- index?: number | undefined;
127
- }) => React.ReactElement<any, any> | string | undefined | null;
128
- viewType?: import("../../../render/propsType").ViewType;
129
- name: any;
130
- dependencies: any[];
131
- tooltip: string | {
132
- title: string;
133
- icon?: React.ReactNode;
134
- };
135
- extra: React.ReactNode;
136
- validateFirst: boolean | "parallel";
137
- disabled: any;
138
- };
71
+ export declare const useFormItemProps: (column: FlexibleGroupColumnType, contextProps: ContextProps, groupProps: GroupProps) => GroupFormItemProps;
139
72
  /**
140
73
  * 创建组件属性
141
74
  */
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
- import { DefaultOptionType } from '@rc-component/select/es/Select';
2
+ import type { CascaderProps } from 'antd';
3
3
  import { Service, Options } from 'ahooks/lib/useRequest/src/types';
4
+ export type CascaderOptionType = NonNullable<CascaderProps['options']>[number];
4
5
  export interface FieldNamesType {
5
6
  label: string;
6
7
  value: string;
@@ -17,7 +18,7 @@ export interface ProCascaderType {
17
18
  tooltip?: boolean | ReactNode;
18
19
  detailMaxLength?: number;
19
20
  fieldNames?: FieldNamesType;
20
- dataSource?: DefaultOptionType[];
21
+ dataSource?: CascaderOptionType[];
21
22
  useRequest?: {
22
23
  /**
23
24
  * @description 请求服务函数
@@ -42,10 +42,12 @@ export interface ProRule extends Omit<RuleObject, 'type'> {
42
42
  */
43
43
  export type ViewType = 'percent' | 'permillage' | 'amount' | 'thousandth';
44
44
  export type PartialOf<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
45
- interface ControlProps {
46
- value?: unknown;
47
- onChange?: (...args: any[]) => void;
48
- }
45
+ type ControlValue<T> = T extends {
46
+ value?: infer Value;
47
+ } ? Value : unknown;
48
+ type ControlChangeArgs<T> = T extends {
49
+ onChange?: (...args: infer Args) => any;
50
+ } ? Args : any[];
49
51
  /**
50
52
  * 扩展函数的参数
51
53
  */
@@ -55,9 +57,9 @@ export type FunctionArgs<Values, R = any> = (value: any, record: any, { form, in
55
57
  namePath?: NamePath;
56
58
  [key: string]: any;
57
59
  }) => R;
58
- type TransformToFormField<T extends ControlProps, Values> = DistributiveOmit<T, 'onChange' | 'value' | 'role'> & {
59
- value?: T['value'];
60
- onChange?: (value: Parameters<T['onChange']>[0], options: Parameters<T['onChange']>[1], form: FormInstance<Values>) => void;
60
+ type TransformToFormField<T, Values> = DistributiveOmit<T, 'onChange' | 'value' | 'role'> & {
61
+ value?: ControlValue<T>;
62
+ onChange?: (value: ControlChangeArgs<T>[0], options: ControlChangeArgs<T>[1], form: FormInstance<Values>) => void;
61
63
  onFieldChange?: FunctionArgs<Values>;
62
64
  dataSource?: any[];
63
65
  /** ProForm disable时,是否完全受控 */
@@ -66,9 +68,9 @@ type TransformToFormField<T extends ControlProps, Values> = DistributiveOmit<T,
66
68
  type ProEnumFormType<Values> = TransformToFormField<ProEnumType, Values> | TransformToFormField<ProEnumType & PropProSelectsMapType, Values> | TransformToFormField<ProEnumType & PropRadioPropsMapType, Values> | TransformToFormField<ProEnumType & CheckboxPropsMapType, Values>;
67
69
  type ProEnumTableType<Values> = TransformToTableField<ProEnumType, Values> | TransformToTableField<ProEnumType & PropProSelectsMapType, Values> | TransformToTableField<ProEnumType & PropRadioPropsMapType, Values> | TransformToTableField<ProEnumType & CheckboxPropsMapType, Values>;
68
70
  type ProEnumFieldType<Values, TT> = TT extends 'ProForm' ? ProEnumFormType<Values> | ReactiveFunction<Values, ProEnumFormType<Values>> : ProEnumTableType<Values> | ((text: any, values: Values, index: number) => ProEnumTableType<Values>);
69
- type TransformToTableField<T extends ControlProps, Values> = Omit<T, 'onChange' | 'value' | 'onBlur' | 'role'> & {
70
- value?: T['value'];
71
- onChange?: (value: Parameters<T['onChange']>[0], options: Parameters<T['onChange']>[1], record: any, index: number, form: FormInstance<Values>) => void;
71
+ type TransformToTableField<T, Values> = Omit<T, 'onChange' | 'value' | 'onBlur' | 'role'> & {
72
+ value?: ControlValue<T>;
73
+ onChange?: (value: ControlChangeArgs<T>[0], options: ControlChangeArgs<T>[1], record: any, index: number, form: FormInstance<Values>) => void;
72
74
  onFieldChange?: FunctionArgs<Values>;
73
75
  onBlur?: FunctionArgs<Values>;
74
76
  };
@@ -78,7 +80,7 @@ export type ReactiveFunction<Values, R> = (values: Values, { form, index, namePa
78
80
  namePath?: NamePath;
79
81
  [key: string]: any;
80
82
  }) => R;
81
- type FieldType<T extends ControlProps, Values, TT> = TT extends 'ProForm' ? TransformToFormField<T, Values> | ReactiveFunction<Values, TransformToFormField<T, Values>> : TransformToTableField<T, Values> | ((text: any, values: Values, index: number) => TransformToTableField<T, Values>);
83
+ type FieldType<T, Values, TT> = TT extends 'ProForm' ? TransformToFormField<T, Values> | ReactiveFunction<Values, TransformToFormField<T, Values>> : TransformToTableField<T, Values> | ((text: any, values: Values, index: number) => TransformToTableField<T, Values>);
82
84
  /**
83
85
  * 值转换
84
86
  */
@@ -272,7 +274,7 @@ export interface RenderType<Values = any> {
272
274
  export type ProEnumFormProps<Values> = ProEnumFormType<Values>;
273
275
  export type ProEnumTableProps<Values> = ProEnumTableType<Values>;
274
276
  export type ProEnumFieldProps<Values, TT> = ProEnumFieldType<Values, TT>;
275
- export type FieldProps<T extends ControlProps, Values, TT> = FieldType<T, Values, TT>;
277
+ export type FieldProps<T, Values, TT> = FieldType<T, Values, TT>;
276
278
  export type ColumnPropsMap<Values = any, T = 'ProForm'> = ColumnTypeMap<Values, T>;
277
279
  export type ProColumnProps<Values = any> = ProFormColumnType<Values>;
278
280
  export type RenderProps<Values = any> = RenderType<Values>;
Binary file
@@ -1,6 +1,5 @@
1
1
  import _isNumber from "lodash/isNumber";
2
2
  import _omit from "lodash/omit";
3
- import _isObject from "lodash/isObject";
4
3
  import _isFunction from "lodash/isFunction";
5
4
  import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
6
5
  import { message, Select, Space, Tooltip } from 'antd';
@@ -224,7 +223,7 @@ export const ProSelect = (props, ref) => {
224
223
  if (customShowSearch === true || customShowSearch == null) {
225
224
  return defaultConfig;
226
225
  }
227
- if (_isObject(customShowSearch)) {
226
+ if (typeof customShowSearch === 'object' && customShowSearch !== null) {
228
227
  return {
229
228
  ...defaultConfig,
230
229
  ...customShowSearch,
@@ -2,6 +2,11 @@ import { ReactNode } from 'react';
2
2
  import type { SelectProps } from 'antd';
3
3
  import { Service, Options, Result } from 'ahooks/lib/useRequest/src/types';
4
4
  import type { ProFormOtherType } from '../ProForm/propsType';
5
+ export interface ProSelectShowSearchConfig {
6
+ filterOption?: SelectProps['filterOption'];
7
+ optionFilterProp?: SelectProps['optionFilterProp'];
8
+ onSearch?: SelectProps['onSearch'];
9
+ }
5
10
  /**
6
11
  * @description 数据选项类型
7
12
  */
@@ -24,7 +29,8 @@ export interface DataOptionType {
24
29
  /**
25
30
  * @description 选择框属性类型
26
31
  */
27
- export interface PropSelectType extends Omit<SelectProps, 'onSearch'> {
32
+ export interface PropSelectType extends Omit<SelectProps, 'onSearch' | 'showSearch'> {
33
+ showSearch?: boolean | ProSelectShowSearchConfig;
28
34
  /**
29
35
  * @description 是否查看模式
30
36
  * @default false
@@ -710,6 +710,8 @@ export const ProTreeSelect = (props, ref) => {
710
710
  [`${innerClass}`]: true,
711
711
  [`${popupClassName}`]: popupClassName
712
712
  });
713
+ const selectClassNames = selectProps?.classNames;
714
+ const selectStyles = selectProps?.styles;
713
715
  const treeProps = {
714
716
  disabled,
715
717
  showSearch,
@@ -736,22 +738,22 @@ export const ProTreeSelect = (props, ref) => {
736
738
  ...selectProps,
737
739
  // 使用新的 API 替代弃用的 popupClassName 和 dropdownStyle
738
740
  classNames: {
739
- ...selectProps?.classNames,
741
+ ...selectClassNames,
740
742
  popup: {
741
- ...selectProps?.classNames?.popup,
742
- root: [selectProps?.classNames?.popup?.root, dropDownClassName].filter(Boolean).join(' ')
743
+ ...selectClassNames?.popup,
744
+ root: [selectClassNames?.popup?.root, dropDownClassName].filter(Boolean).join(' ')
743
745
  }
744
746
  },
745
747
  styles: {
746
- ...selectProps?.styles,
748
+ ...selectStyles,
747
749
  popup: {
748
- ...selectProps?.styles?.popup,
750
+ ...selectStyles?.popup,
749
751
  root: {
750
752
  maxHeight: 320,
751
753
  paddingTop: '0px',
752
754
  maxWidth: '580px',
753
755
  ...dropdownStyle,
754
- ...selectProps?.styles?.popup?.root
756
+ ...selectStyles?.popup?.root
755
757
  }
756
758
  }
757
759
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { UploadFile } from 'antd/es/upload/interface';
3
- import type { UploadRequestOption } from '@rc-component/upload/es/interface';
2
+ import type { UploadFile, UploadProps } from 'antd';
3
+ type UploadRequestOption = Parameters<NonNullable<UploadProps['customRequest']>>[0];
4
4
  export type UploadType = 'drag' | 'button' | 'image';
5
5
  export interface UploadFileResType {
6
6
  /**
@@ -262,3 +262,4 @@ export interface DraggableUploadListItemType {
262
262
  */
263
263
  children: React.ReactNode;
264
264
  }
265
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { useSetState } from 'ahooks';
2
- import { Button, Image, Modal } from 'antd';
2
+ import { Button, Image as AntdImage, Modal } from 'antd';
3
3
  import React, { useEffect, useRef } from 'react';
4
4
  import locale from "../locale";
5
5
 
@@ -14,6 +14,7 @@ const MIMEType = {
14
14
  word: 'application/msword',
15
15
  excel: 'application/vnd.ms-excel'
16
16
  };
17
+ const Image = AntdImage;
17
18
  const ProViewer = /*#__PURE__*/React.forwardRef(({
18
19
  disabled = false,
19
20
  mode = 'page',
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "4.5.7-beta.1",
3
+ "version": "4.5.7",
4
4
  "license": "MIT",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org/"
8
+ },
5
9
  "files": [
6
10
  "es",
7
- "dist",
11
+ "dist/*.css",
12
+ "dist/*.js",
8
13
  "README.md"
9
14
  ],
10
15
  "main": "es/index.js",
@@ -28,7 +33,6 @@
28
33
  "import": "./es/tokens.js",
29
34
  "default": "./es/tokens.js"
30
35
  },
31
- "./ai-meta/*": "./dist/ai/*",
32
36
  "./es/*": "./es/*",
33
37
  "./dist/*": "./dist/*"
34
38
  },
@@ -78,14 +82,9 @@
78
82
  "lint:style": "stylelint --fix \"src/**/*.less\"",
79
83
  "prepare": "husky && patch-package",
80
84
  "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
81
- "pack:main": "npm pack --dry-run",
82
- "pack:mcp": "npm run build:ai-meta && cd packages/sisyphus-react-mcp && npm pack --dry-run",
83
- "release": "npm run release:ai",
84
- "release:mcp": "npm run release:ai",
85
- "release:scene": "npm run release:ai",
86
- "release:ai:check": "node ./scripts/release-ai.mjs --check",
87
- "release:ai": "node ./scripts/release-ai.mjs --publish",
88
- "release:beta": "npm run release:ai",
85
+ "release": "node ./scripts/release.mjs --stable",
86
+ "release:beta": "node ./scripts/release.mjs --beta",
87
+ "release:check": "node ./scripts/release.mjs --check",
89
88
  "start": "cross-env NODE_OPTIONS=\"--openssl-legacy-provider\" dumi dev",
90
89
  "test": "umi-test",
91
90
  "test:coverage": "umi-test --coverage",
@@ -122,6 +121,7 @@
122
121
  "@dnd-kit/core": "^6.0.8",
123
122
  "@dnd-kit/sortable": "^7.0.2",
124
123
  "@dnd-kit/utilities": "^3.2.1",
124
+ "@rc-component/form": "~1.8.5",
125
125
  "@zat-design/utils": "^4.0.0",
126
126
  "big.js": "^6.2.1",
127
127
  "classnames": "^2.3.1",
@@ -141,6 +141,7 @@
141
141
  "react-router-dom": "^6.0.0"
142
142
  },
143
143
  "devDependencies": {
144
+ "@ant-design/icons": "^6.1.0",
144
145
  "@babel/core": "^7.26.0",
145
146
  "@babel/runtime": "^7.28.4",
146
147
  "@commitlint/cli": "^12.1.1",
@@ -158,8 +159,9 @@
158
159
  "@typescript-eslint/parser": "^7.18.0",
159
160
  "@umijs/fabric": "^2.8.1",
160
161
  "@umijs/test": "^3.0.5",
161
- "@zat-design/sisyphus-login": "4.0.2",
162
+ "@zat-design/sisyphus-login": "4.0.3",
162
163
  "ahooks": "3.9.5",
164
+ "antd": "^6.1.3",
163
165
  "babel-plugin-import": "^1.13.8",
164
166
  "babel-plugin-lodash": "^3.3.4",
165
167
  "cross-env": "^7.0.3",