Skip to content

Commit

Permalink
🎉 release: 更新版本至 2.8.5,修复 layout 收起 menu 的文字问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Feb 12, 2025
1 parent 402e25f commit ad90863
Show file tree
Hide file tree
Showing 36 changed files with 265 additions and 298 deletions.
15 changes: 9 additions & 6 deletions .dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ const pkgList = readdirSync(join(__dirname, 'packages')).filter(
(pkg) => pkg.charAt(0) !== '.' && !headPkgList.includes(pkg),
);

const alias = pkgList.reduce((pre, pkg) => {
pre[`@ant-design/pro-${pkg}`] = join(__dirname, 'packages', pkg, 'src');
return {
...pre,
};
}, {} as Record<string, string>);
const alias = pkgList.reduce(
(pre, pkg) => {
pre[`@ant-design/pro-${pkg}`] = join(__dirname, 'packages', pkg, 'src');
return {
...pre,
};
},
{} as Record<string, string>,
);

console.log(`🌼 alias list \n${chalk.blue(Object.keys(alias).join('\n'))}`);

Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.en-US.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## @ant-design/pro-components@2.8.5

`2025-02-12`

- 修复 layout 收起 menu 的文字还存在的问题。

## @ant-design/pro-components@2.8.3

`2025-01-06`
Expand Down
14 changes: 10 additions & 4 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
## @ant-design/pro-components@2.8.5

`2025-02-12`

- 修复 layout 收起 menu 的文字还存在的问题。

## @ant-design/pro-components@2.8.4

`2025-01-18`

- cleanup: replace omit.js & remove some duplicate util (#8965) (2 天前) <𝑾𝒖𝒙𝒉>
- fix: remove Table deadCode (#8966) (2 天前) <chenliandong>
- chore: try fix test (#8974) (4 天前) <𝑾𝒖𝒙𝒉>
- fix: FooterToolbar supports SSR (#8969) (4 天前) <谭真>
- cleanup: replace omit.js & remove some duplicate util (#8965) <𝑾𝒖𝒙𝒉>
- fix: remove Table deadCode (#8966) <chenliandong>
- chore: try fix test (#8974) <𝑾𝒖𝒙𝒉>
- fix: FooterToolbar supports SSR (#8969) <谭真>

## @ant-design/pro-components@2.8.3

Expand Down
12 changes: 6 additions & 6 deletions docs/components/valueType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ export default () => {
],
}
: valueType === 'divider'
? {
style: {
width: '200px',
},
}
: undefined,
? {
style: {
width: '200px',
},
}
: undefined,
formItemProps: {
rules: [
{
Expand Down
7 changes: 1 addition & 6 deletions packages/card/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.9.5](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-02-12)

**Note:** Version bump only for package @ant-design/pro-card





## [2.9.4](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-01-18)

**Note:** Version bump only for package @ant-design/pro-card
Expand Down
7 changes: 1 addition & 6 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.8.5](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-02-12)

**Note:** Version bump only for package @ant-design/pro-components





## [2.8.4](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-01-18)

**Note:** Version bump only for package @ant-design/pro-components
Expand Down
7 changes: 1 addition & 6 deletions packages/descriptions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.6.5](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-02-12)

**Note:** Version bump only for package @ant-design/pro-descriptions





## [2.6.4](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-01-18)

**Note:** Version bump only for package @ant-design/pro-descriptions
Expand Down
7 changes: 1 addition & 6 deletions packages/field/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.0.2](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-02-12)

**Note:** Version bump only for package @ant-design/pro-field





## [3.0.1](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-01-18)

**Note:** Version bump only for package @ant-design/pro-field
Expand Down
6 changes: 3 additions & 3 deletions packages/field/src/components/Switch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const FieldSwitch: ProFieldFC<{ text: boolean; fieldProps?: SwitchProps }> = (
const dom = useMemo(() => {
if (text === undefined || text === null || `${text}`.length < 1) return '-';
return text
? fieldProps?.checkedChildren ?? intl.getMessage('switch.open', '打开')
: fieldProps?.unCheckedChildren ??
intl.getMessage('switch.close', '关闭');
? (fieldProps?.checkedChildren ?? intl.getMessage('switch.open', '打开'))
: (fieldProps?.unCheckedChildren ??
intl.getMessage('switch.close', '关闭'));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [fieldProps?.checkedChildren, fieldProps?.unCheckedChildren, text]);

Expand Down
8 changes: 4 additions & 4 deletions packages/field/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ const ProFieldComponent: React.ForwardRefRenderFunction<

const renderedDom = defaultRenderText(
mode === 'edit'
? fieldProps?.value ?? text ?? ''
: text ?? fieldProps?.value ?? '',
? (fieldProps?.value ?? text ?? '')
: (text ?? fieldProps?.value ?? ''),
valueType || 'text',
omitUndefined({
ref,
Expand All @@ -655,13 +655,13 @@ const ProFieldComponent: React.ForwardRefRenderFunction<
: undefined,
placeholder: renderFormItem
? undefined
: rest?.placeholder ?? fieldProps?.placeholder,
: (rest?.placeholder ?? fieldProps?.placeholder),
fieldProps: pickProProps(
omitUndefined({
...fieldProps,
placeholder: renderFormItem
? undefined
: rest?.placeholder ?? fieldProps?.placeholder,
: (rest?.placeholder ?? fieldProps?.placeholder),
}),
),
}),
Expand Down
7 changes: 1 addition & 6 deletions packages/form/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.31.5](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-02-12)

**Note:** Version bump only for package @ant-design/pro-form





## [2.31.4](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-01-18)

**Note:** Version bump only for package @ant-design/pro-form
Expand Down
26 changes: 9 additions & 17 deletions packages/form/src/BaseForm/BaseForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,16 +452,12 @@ function BaseFormComponents<T = Record<string, any>, U = Record<string, any>>(
}, [props.initialValues]);

// 初始化给一个默认的 form
useImperativeHandle(
propsFormRef,
() => {
return {
...formRef.current,
...formatValues,
};
},
[formatValues, formRef.current],
);
useImperativeHandle(propsFormRef, () => {
return {
...formRef.current,
...formatValues,
};
}, [formatValues, formRef.current]);
useEffect(() => {
const finalValues = transformKey(
formRef.current?.getFieldsValue?.(true),
Expand Down Expand Up @@ -716,13 +712,9 @@ function BaseForm<T = Record<string, any>, U = Record<string, any>>(
});

// 初始化给一个默认的 form
useImperativeHandle(
propsFormRef,
() => {
return formRef.current;
},
[!initialData],
);
useImperativeHandle(propsFormRef, () => {
return formRef.current;
}, [!initialData]);

if (!initialData && props.request) {
return (
Expand Down
4 changes: 2 additions & 2 deletions packages/form/src/BaseForm/createField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ function createField<P extends ProFormFieldItemProps = any>(
width && !WIDTH_SIZE_ENUM[width as 'xs']
? width
: contextValue.grid
? '100%'
: undefined,
? '100%'
: undefined,
...fieldProps?.style,
};

Expand Down
31 changes: 17 additions & 14 deletions packages/form/src/components/FormItemRender/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,23 @@ export function useControlModel<
};
}

return model.reduce((acc, k) => {
const p = getControlConfigProps(k);
const name = p.name || (k as string);
acc[name] = {
[p.valuePropName]: value?.[name],
[p.trigger]: (v: any) => {
onChange?.({
...value,
[name]: v?.target ? v.target[p.valuePropName] : v,
});
},
};
return acc;
}, {} as Record<string, unknown>) as unknown;
return model.reduce(
(acc, k) => {
const p = getControlConfigProps(k);
const name = p.name || (k as string);
acc[name] = {
[p.valuePropName]: value?.[name],
[p.trigger]: (v: any) => {
onChange?.({
...value,
[name]: v?.target ? v.target[p.valuePropName] : v,
});
},
};
return acc;
},
{} as Record<string, unknown>,
) as unknown;
}

export type FormControlFC<P> = (
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/components/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function ProFormList<T>(props: ProFormListProps<T>) {
},
getList: () =>
proFormContext.formRef!.current!.getFieldValue([...name]),
} as any),
}) as any,
[name, proFormContext.formRef],
);

Expand Down
10 changes: 3 additions & 7 deletions packages/form/src/components/SchemaForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,9 @@ function BetaSchemaForm<T, ValueType = 'text'>(
return {};
}, [columns, layoutType]);

useImperativeHandle(
propsFormRef,
() => {
return formRef.current;
},
[formRef.current],
);
useImperativeHandle(propsFormRef, () => {
return formRef.current;
}, [formRef.current]);

return (
<FormRenderComponents
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/layouts/QueryFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ const QueryFilterContent: React.FC<{
): { itemDom: React.ReactNode; hidden: boolean; colSpan: number } => {
// 如果 formItem 自己配置了 hidden,默认使用它自己的
const colSize = React.isValidElement<any>(item)
? item?.props?.colSize ?? 1
? (item?.props?.colSize ?? 1)
: 1;
const colSpan = Math.min(spanSize.span * (colSize || 1), 24);
// 计算总的 totalSpan 长度
Expand Down
10 changes: 3 additions & 7 deletions packages/form/src/layouts/StepsForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,9 @@ function StepsForm<T = Record<string, any>>(
formArrayRef.current,
]);

useImperativeHandle(
formRef,
() => {
return formArrayRef.current[step || 0]?.current;
},
[step, formArrayRef.current],
);
useImperativeHandle(formRef, () => {
return formArrayRef.current[step || 0]?.current;
}, [step, formArrayRef.current]);

/**
* ProForm处理了一下 from 的数据,在其中做了一些操作 如果使用 Provider 自带的,自带的数据处理就无法生效了
Expand Down
7 changes: 1 addition & 6 deletions packages/layout/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [7.22.2](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-02-12)

**Note:** Version bump only for package @ant-design/pro-layout





## [7.22.1](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-01-18)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions packages/layout/src/components/Help/HelpProvide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ type ProHelpDataSourceContentProps<ValueTypeMap, ValueType> =
ValueType extends ProHelpDataSourceChildrenType
? ProHelpDataSourceContentType[ValueType]
: ValueType extends keyof ValueTypeMap
? ValueTypeMap[ValueType]
: ProHelpDataSourceContentType[ProHelpDataSourceChildrenType];
? ValueTypeMap[ValueType]
: ProHelpDataSourceContentType[ProHelpDataSourceChildrenType];

/**
* ProHelp 数据源子项类型。
Expand Down
7 changes: 1 addition & 6 deletions packages/list/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.6.5](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-02-12)

**Note:** Version bump only for package @ant-design/pro-list





## [2.6.4](https://github.com/ant-design/pro-components/compare/@ant-design/[email protected]...@ant-design/[email protected]) (2025-01-18)

**Note:** Version bump only for package @ant-design/pro-list
Expand Down
Loading

0 comments on commit ad90863

Please sign in to comment.