diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 275b986a134f..686aab8f513a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: uses: pnpm/action-setup@v2 with: version: 8.6.7 - - run: pnpm install --no-frozen-lockfile + - run: pnpm install - run: pnpm run build env: PRO_COMPONENTS_CI: CI diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5b12f37ec1c7..ed07ca0253ff 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -18,7 +18,7 @@ jobs: with: version: 8.6.7 - - run: pnpm install --no-frozen-lockfile + - run: pnpm install if: | steps.cache-pnpm-cache.outputs.cache-hit != 'true' || steps.cache-node-modules.outputs.cache-hit != 'true' diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index cbc5bee2bb29..3d0cec3204df 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -20,7 +20,7 @@ jobs: env: TEST_UI: 'preview' run: | - pnpm install --no-frozen-lockfile + pnpm install pnpm run build pnpm run dumi diff --git a/package.json b/package.json index 8c0013ee7595..2d05b390d346 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "start": "npm run version && dumi dev", "sync:tnpm": "node -e 'require(\"./scripts/syncTNPM\")()'", "test": "npm run version && cross-env TZ=UTC vitest", - "test:coverage": "npm run version && cross-env TZ=UTC TEST_LOG=none vitest --threads=false --coverage", + "test:coverage": "npm run version && cross-env TZ=UTC TEST_LOG=none vitest --coverage", "test:update": "pnpm run version && cross-env TZ=UTC vitest -u", "tsc": "tsc --noEmit", "tsc:duplicate": "tsc -p ./tests/tsconfig.duplicate.json", diff --git a/packages/form/src/components/Checkbox/index.tsx b/packages/form/src/components/Checkbox/index.tsx index 77f155e3d28f..a50f82db212c 100644 --- a/packages/form/src/components/Checkbox/index.tsx +++ b/packages/form/src/components/Checkbox/index.tsx @@ -1,5 +1,5 @@ import { runFunction } from '@ant-design/pro-utils'; -import type { CheckboxProps } from 'antd'; +import type { CheckboxProps, CheckboxRef } from 'antd'; import { Checkbox } from 'antd'; import type { CheckboxGroupProps } from 'antd/lib/checkbox'; import React from 'react'; @@ -56,10 +56,7 @@ const CheckboxGroup: React.FC = React.forwardRef( ), ); -export type ProFormCheckboxProps = ProFormFieldItemProps< - CheckboxProps, - HTMLInputElement ->; +export type ProFormCheckboxProps = ProFormFieldItemProps; /** * 多选框的 @@ -67,7 +64,7 @@ export type ProFormCheckboxProps = ProFormFieldItemProps< * @param */ const ProFormCheckboxComponents: React.FC = - React.forwardRef( + React.forwardRef( ({ fieldProps, children }, ref) => { return ( diff --git a/packages/form/src/layouts/DrawerForm/index.tsx b/packages/form/src/layouts/DrawerForm/index.tsx index da612d083f95..89b25de6828a 100644 --- a/packages/form/src/layouts/DrawerForm/index.tsx +++ b/packages/form/src/layouts/DrawerForm/index.tsx @@ -280,7 +280,7 @@ function DrawerForm, U = Record>({ const offsetRight: number | string = ((document.body.offsetWidth || 1000) - (e.clientX - document.body.offsetLeft)) as number | string; - const minWidth = resizeInfo?.minWidth ?? width; + const minWidth = resizeInfo?.minWidth ?? (width || 800); const maxWidth = resizeInfo?.maxWidth ?? window.innerWidth * 0.8; if (offsetRight < minWidth) { diff --git a/packages/layout/src/components/PageContainer/demos/token.tsx b/packages/layout/src/components/PageContainer/demos/token.tsx index 6c0799ee327e..2d61f9792abd 100644 --- a/packages/layout/src/components/PageContainer/demos/token.tsx +++ b/packages/layout/src/components/PageContainer/demos/token.tsx @@ -65,7 +65,7 @@ export default () => ( ], }} > - + ); diff --git a/packages/layout/src/components/PageContainer/index.tsx b/packages/layout/src/components/PageContainer/index.tsx index c7f02f99e443..56d8df84918e 100644 --- a/packages/layout/src/components/PageContainer/index.tsx +++ b/packages/layout/src/components/PageContainer/index.tsx @@ -410,15 +410,14 @@ const PageContainerBase: React.FC = (props) => { <>
{children}
diff --git a/packages/layout/src/components/PageContainer/style/index.ts b/packages/layout/src/components/PageContainer/style/index.ts index b92353b6f610..1ec33196ba58 100644 --- a/packages/layout/src/components/PageContainer/style/index.ts +++ b/packages/layout/src/components/PageContainer/style/index.ts @@ -12,11 +12,16 @@ const genPageContainerStyle: GenerateStyle = (token) => { [token.componentCls]: { position: 'relative', '&-children-container': { + paddingBlockStart: 0, paddingBlockEnd: token.layout?.pageContainer?.paddingBlockPageContainerContent, paddingInline: token.layout?.pageContainer?.paddingInlinePageContainerContent, }, + '&-children-container-no-header': { + paddingBlockStart: + token.layout?.pageContainer?.paddingBlockPageContainerContent, + }, '&-affix': { [`${token.antCls}-affix`]: { [`${token.componentCls}-warp`]: { diff --git a/packages/layout/src/components/SiderMenu/BaseMenu.tsx b/packages/layout/src/components/SiderMenu/BaseMenu.tsx index 44e5e647021c..2d03ceef71dd 100644 --- a/packages/layout/src/components/SiderMenu/BaseMenu.tsx +++ b/packages/layout/src/components/SiderMenu/BaseMenu.tsx @@ -546,7 +546,9 @@ const BaseMenu: React.FC = (props) => { menu?.defaultOpenAll, ); - const [openKeys, setOpenKeys] = useMountMergeState>( + const [openKeys, setOpenKeys] = useMountMergeState< + (string | number)[] | false + >( () => { if (menu?.defaultOpenAll) { return getOpenKeysFromMenuData(menuData) || []; @@ -605,7 +607,7 @@ const BaseMenu: React.FC = (props) => { propsOpenKeys !== false && matchMenuKeys.join('-') !== (openKeys || []).join('-') ) { - let newKeys: React.Key[] = matchMenuKeys; + let newKeys: (string | number)[] | false = matchMenuKeys; // 如果不自动关闭,我需要把 openKeys 放进去 if (menu?.autoClose === false) { newKeys = Array.from( @@ -697,7 +699,7 @@ const BaseMenu: React.FC = (props) => { [`${baseClassName}-collapsed`]: props.collapsed, })} items={menuUtils.getNavMenuItems(finallyData, 0)} - onOpenChange={(_openKeys: React.Key[]) => { + onOpenChange={(_openKeys) => { if (!props.collapsed) { setOpenKeys(_openKeys); } diff --git a/packages/layout/src/components/WaterMark/index.tsx b/packages/layout/src/components/WaterMark/index.tsx index 51bfcf239375..f6b1cecd5638 100644 --- a/packages/layout/src/components/WaterMark/index.tsx +++ b/packages/layout/src/components/WaterMark/index.tsx @@ -85,7 +85,7 @@ export const WaterMark: React.FC = (props) => { rotate = -22, // 默认旋转 -22 度 image, offsetLeft, - offsetTop, + offsetTop: outOffsetTop, fontStyle = 'normal', fontWeight = 'normal', fontColor = token.colorFill, @@ -108,7 +108,7 @@ export const WaterMark: React.FC = (props) => { const canvasWidth = `${(gapX + width) * ratio}px`; const canvasHeight = `${(gapY + height) * ratio}px`; const canvasOffsetLeft = offsetLeft || gapX / 2; - const canvasOffsetTop = offsetTop || gapY / 2; + const canvasOffsetTop = outOffsetTop || gapY / 2; canvas.setAttribute('width', canvasWidth); canvas.setAttribute('height', canvasHeight); @@ -119,6 +119,12 @@ export const WaterMark: React.FC = (props) => { return; } + // 旋转字符 rotate + ctx.translate(canvasOffsetLeft * ratio, canvasOffsetTop * ratio); + ctx.rotate((Math.PI / 180) * Number(rotate)); + const markWidth = width * ratio; + const markHeight = height * ratio; + const writeContent = ( contentText: string | string[], offsetTop: number = 0, @@ -136,12 +142,6 @@ export const WaterMark: React.FC = (props) => { setBase64Url(canvas.toDataURL()); }; - // 旋转字符 rotate - ctx.translate(canvasOffsetLeft * ratio, canvasOffsetTop * ratio); - ctx.rotate((Math.PI / 180) * Number(rotate)); - const markWidth = width * ratio; - const markHeight = height * ratio; - if (image) { const img = new Image(); img.crossOrigin = 'anonymous'; @@ -165,7 +165,7 @@ export const WaterMark: React.FC = (props) => { gapX, gapY, offsetLeft, - offsetTop, + outOffsetTop, rotate, fontStyle, fontWeight, diff --git a/packages/list/src/demos/expand.tsx b/packages/list/src/demos/expand.tsx index c76c10b1653f..f2f94614ba1c 100644 --- a/packages/list/src/demos/expand.tsx +++ b/packages/list/src/demos/expand.tsx @@ -1,6 +1,6 @@ import { ProList } from '@ant-design/pro-components'; import { Button, Progress, Space, Tag } from 'antd'; -import type { ReactText } from 'react'; +import type { Key } from 'react'; import { useState } from 'react'; const dataSource = [ @@ -27,9 +27,7 @@ const dataSource = [ ]; export default () => { - const [expandedRowKeys, setExpandedRowKeys] = useState( - [], - ); + const [expandedRowKeys, setExpandedRowKeys] = useState([]); return ( diff --git a/packages/list/src/demos/selectedRow.tsx b/packages/list/src/demos/selectedRow.tsx index 80f63de48c5d..dbc2faead585 100644 --- a/packages/list/src/demos/selectedRow.tsx +++ b/packages/list/src/demos/selectedRow.tsx @@ -1,6 +1,6 @@ import { ProList } from '@ant-design/pro-components'; import { Button, Progress } from 'antd'; -import type { ReactText } from 'react'; +import type { Key } from 'react'; import { useState } from 'react'; const dataSource = [ @@ -27,10 +27,10 @@ const dataSource = [ ]; export default () => { - const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const [selectedRowKeys, setSelectedRowKeys] = useState([]); const rowSelection = { selectedRowKeys, - onChange: (keys: ReactText[]) => setSelectedRowKeys(keys), + onChange: (keys: Key[]) => setSelectedRowKeys(keys), }; return ( diff --git a/packages/list/src/demos/size.tsx b/packages/list/src/demos/size.tsx index 8d6f877040a6..0c568ab5a786 100644 --- a/packages/list/src/demos/size.tsx +++ b/packages/list/src/demos/size.tsx @@ -1,6 +1,6 @@ import { ProList } from '@ant-design/pro-components'; import { Button, Progress, Select } from 'antd'; -import type { ReactText } from 'react'; +import type { Key } from 'react'; import { useState } from 'react'; const dataSource = [ @@ -27,17 +27,15 @@ const dataSource = [ ]; export default () => { - const [selectedRowKeys, setSelectedRowKeys] = useState([]); - const [expandedRowKeys, setExpandedRowKeys] = useState( - [], - ); + const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const [expandedRowKeys, setExpandedRowKeys] = useState([]); const [size, setSize] = useState<'small' | 'default' | 'large' | undefined>( 'default', ); const [split, setSplit] = useState<0 | 1>(1); const rowSelection = { selectedRowKeys, - onChange: (keys: ReactText[]) => setSelectedRowKeys(keys), + onChange: (keys: Key[]) => setSelectedRowKeys(keys), }; return ( diff --git a/packages/list/src/demos/special.tsx b/packages/list/src/demos/special.tsx index d4d977c95062..6730dd11e8b7 100644 --- a/packages/list/src/demos/special.tsx +++ b/packages/list/src/demos/special.tsx @@ -1,7 +1,7 @@ import { EllipsisOutlined } from '@ant-design/icons'; import { ProList } from '@ant-design/pro-components'; import { Button, Progress, Tag } from 'antd'; -import type { ReactText } from 'react'; +import type { Key } from 'react'; import { useState } from 'react'; const types = ['top', 'inline', 'new']; @@ -51,13 +51,11 @@ const data = [ })); export default () => { - const [expandedRowKeys, setExpandedRowKeys] = useState( - [], - ); - const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const [expandedRowKeys, setExpandedRowKeys] = useState([]); + const [selectedRowKeys, setSelectedRowKeys] = useState([]); const rowSelection = { selectedRowKeys, - onChange: (keys: ReactText[]) => setSelectedRowKeys(keys), + onChange: (keys: Key[]) => setSelectedRowKeys(keys), }; const [dataSource, setDataSource] = useState([...data] as any[]); diff --git a/packages/list/src/demos/testConfigProvider.tsx b/packages/list/src/demos/testConfigProvider.tsx index 27b2642c6721..734834c93523 100644 --- a/packages/list/src/demos/testConfigProvider.tsx +++ b/packages/list/src/demos/testConfigProvider.tsx @@ -1,6 +1,6 @@ import { ProList } from '@ant-design/pro-components'; import { ConfigProvider, Progress } from 'antd'; -import type { ReactText } from 'react'; +import type { Key } from 'react'; import { useState } from 'react'; const dataSource = [ @@ -12,10 +12,10 @@ const dataSource = [ ]; export default () => { - const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const [selectedRowKeys, setSelectedRowKeys] = useState([]); const rowSelection = { selectedRowKeys, - onChange: (keys: ReactText[]) => setSelectedRowKeys(keys), + onChange: (keys: Key[]) => setSelectedRowKeys(keys), }; return ( diff --git a/packages/provider/src/intl.ts b/packages/provider/src/intl.ts index 2b21a412efa1..6ca3cf795bf5 100644 --- a/packages/provider/src/intl.ts +++ b/packages/provider/src/intl.ts @@ -22,10 +22,10 @@ import skSK from './locale/sk_SK'; import srRS from './locale/sr_RS'; import thTH from './locale/th_TH'; import trTR from './locale/tr_TR'; +import ukUA from './locale/uk_UA'; import viVN from './locale/vi_VN'; import zhCN from './locale/zh_CN'; import zhTW from './locale/zh_TW'; -import ukUA from './locale/uk_UA'; /** * 安全的从一个对象中读取相应的值 diff --git a/packages/provider/src/locale/uk_UA.tsx b/packages/provider/src/locale/uk_UA.tsx index 1e68381c441c..e7924c89c57c 100644 --- a/packages/provider/src/locale/uk_UA.tsx +++ b/packages/provider/src/locale/uk_UA.tsx @@ -51,9 +51,9 @@ export default { densitySmall: 'Стислий', }, stepsForm: { - next: 'Наступний', - prev: 'Попередній', - submit: 'Завершити', + next: 'Наступний', + prev: 'Попередній', + submit: 'Завершити', }, loginForm: { submitText: 'Вхіх', diff --git a/packages/table/src/Store/Provide.tsx b/packages/table/src/Store/Provide.tsx index 46e82c8260de..f76ac047f6c6 100644 --- a/packages/table/src/Store/Provide.tsx +++ b/packages/table/src/Store/Provide.tsx @@ -11,7 +11,7 @@ import { } from 'react'; import type { DensitySize } from '../components/ToolBar/DensityIcon'; import type { ProTableProps } from '../index'; -import type { ActionType } from '../typing'; +import type { ActionType, ProColumns } from '../typing'; import { genColumnKey } from '../utils'; export type ColumnsState = { @@ -33,7 +33,7 @@ export type UseContainerProps = { size?: DensitySize; defaultSize?: DensitySize; onSizeChange?: (size: DensitySize) => void; - columns?: ProTableColumn[]; + columns?: ProTableColumn[] | ProColumns[]; columnsState?: ProTableProps['columnsState']; }; diff --git a/packages/table/src/Table.tsx b/packages/table/src/Table.tsx index 683796b4a647..8e4dc25410bf 100644 --- a/packages/table/src/Table.tsx +++ b/packages/table/src/Table.tsx @@ -28,6 +28,7 @@ import type { import classNames from 'classnames'; import type Summary from 'rc-table/lib/Footer/Summary'; import React, { + Key, useCallback, useContext, useEffect, @@ -478,7 +479,7 @@ const ProTable = < /** 单选多选的相关逻辑 */ const [selectedRowKeys, setSelectedRowKeys] = useMountMergeState< - (string | number)[] | undefined + (string | number)[] | Key[] | undefined >( propsRowSelection ? propsRowSelection?.defaultSelectedRowKeys || [] @@ -692,7 +693,7 @@ const ProTable = < setSelectedRowKeys([]); }, [propsRowSelection, setSelectedRowKeys]); - counter.propsRef.current = props; + counter.propsRef.current = props as ProTableProps; /** 可编辑行的相关配置 */ const editableUtils = useEditableArray({ diff --git a/packages/table/src/components/Alert/index.tsx b/packages/table/src/components/Alert/index.tsx index 67383989873d..875a950efda7 100644 --- a/packages/table/src/components/Alert/index.tsx +++ b/packages/table/src/components/Alert/index.tsx @@ -1,20 +1,20 @@ import type { IntlType } from '@ant-design/pro-provider'; import { useIntl } from '@ant-design/pro-provider'; import { ConfigProvider, Space } from 'antd'; -import React, { useContext } from 'react'; +import React, { Key, useContext } from 'react'; import { useStyle } from './style'; export type AlertRenderType = | ((props: { intl: IntlType; - selectedRowKeys: (number | string)[]; + selectedRowKeys: (number | string | Key)[]; selectedRows: T[]; onCleanSelected: () => void; }) => React.ReactNode) | false; export type TableAlertProps = { - selectedRowKeys: (number | string)[]; + selectedRowKeys: (number | string | Key)[]; selectedRows: T[]; alwaysShowAlert?: boolean; alertInfoRender?: AlertRenderType; diff --git a/packages/table/src/components/ColumnSetting/index.tsx b/packages/table/src/components/ColumnSetting/index.tsx index 6fbf33b1f868..af3674584740 100644 --- a/packages/table/src/components/ColumnSetting/index.tsx +++ b/packages/table/src/components/ColumnSetting/index.tsx @@ -224,7 +224,7 @@ const CheckboxList: React.FC<{ if (treeDataConfig.map?.get(key)?.children) { treeDataConfig.map .get(key) - ?.children?.forEach((item) => loopSetShow(item.key)); + ?.children?.forEach((item) => loopSetShow(item.key as string)); } newColumnMap[key] = newSetting; }; @@ -266,7 +266,7 @@ const CheckboxList: React.FC<{ {...node} showListItemOption={showListItemOption} title={runFunction(node.title, node)} - columnKey={node.key} + columnKey={node.key as string} /> ); }} diff --git a/packages/table/src/components/EditableTable/index.tsx b/packages/table/src/components/EditableTable/index.tsx index 665e969432d5..782aea1bd4e7 100644 --- a/packages/table/src/components/EditableTable/index.tsx +++ b/packages/table/src/components/EditableTable/index.tsx @@ -19,7 +19,6 @@ import useMergedState from 'rc-util/lib/hooks/useMergedState'; import get from 'rc-util/lib/utils/get'; import set from 'rc-util/lib/utils/set'; import React, { - useCallback, useContext, useEffect, useImperativeHandle, @@ -201,7 +200,7 @@ function EditableTable< * @param finlayRowKey * @returns string | number */ - const coverRowKey = useCallback( + const coverRowKey = useRefFunction( (finlayRowKey: number | string): string | number => { /** * 如果是 prop.name 的模式,就需要把行号转化成具体的rowKey。 @@ -228,7 +227,6 @@ function EditableTable< } return finlayRowKey; }, - [getRowKey, props.name, value], ); // 设置 editableFormRef @@ -301,14 +299,14 @@ function EditableTable< }, } as EditableFormInstance; }, - [coverRowKey, props.name], + [coverRowKey, props.name, formRef.current], ); useEffect(() => { if (!props.controlled) return; value.forEach((current, index) => { formRef.current?.setFieldsValue({ - [getRowKey(current, index)]: current, + [`${getRowKey(current, index)}`]: current, }); }, {}); // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/packages/table/src/components/ToolBar/index.tsx b/packages/table/src/components/ToolBar/index.tsx index cf7ce82fbfe0..304e346db519 100644 --- a/packages/table/src/components/ToolBar/index.tsx +++ b/packages/table/src/components/ToolBar/index.tsx @@ -283,7 +283,7 @@ export type ToolbarRenderProps = { tableColumn: any[]; tooltip?: string | LabelTooltipType; selectedRows: T[]; - selectedRowKeys: React.Key[]; + selectedRowKeys: React.Key[] | (string | number)[]; headerTitle: React.ReactNode; toolbar: ProTableProps['toolbar']; options: ProTableProps['options']; @@ -400,7 +400,7 @@ class ToolbarRender extends React.Component> { action={actionRef} onSearch={this.onSearch} selectedRows={selectedRows} - selectedRowKeys={selectedRowKeys} + selectedRowKeys={selectedRowKeys as (string | number)[]} toolBarRender={toolBarRender} toolbar={{ filter: searchNode, diff --git a/packages/table/src/utils/cellRenderToFromItem.tsx b/packages/table/src/utils/cellRenderToFromItem.tsx index dd9f34dee17c..8fa32d7ab992 100644 --- a/packages/table/src/utils/cellRenderToFromItem.tsx +++ b/packages/table/src/utils/cellRenderToFromItem.tsx @@ -236,7 +236,7 @@ const CellRenderFromItem = (props: CellRenderFromItemProps) => { noStyle shouldUpdate={(pre, next) => { if (pre === next) return false; - const shouldName = [rowName].flat(1); + const shouldName = [rowName].flat(1) as (string | number | symbol)[]; try { return ( JSON.stringify(get(pre, shouldName)) !== diff --git a/packages/table/src/utils/genProColumnToColumn.tsx b/packages/table/src/utils/genProColumnToColumn.tsx index 3cf0593b472c..b455641c1565 100644 --- a/packages/table/src/utils/genProColumnToColumn.tsx +++ b/packages/table/src/utils/genProColumnToColumn.tsx @@ -114,7 +114,7 @@ export function genProColumnToColumn( return omitBoolean(onFilter); }; - let keyName: React.Key = rowKey as string; + let keyName: string | number | symbol = rowKey as string; const tempColumns = { index: columnsIndex, @@ -142,7 +142,7 @@ export function genProColumnToColumn( : undefined, render: (text: any, rowData: T, index: number) => { if (typeof rowKey === 'function') { - keyName = rowKey(rowData, index); + keyName = rowKey(rowData, index) as string; } let uniqueKey: any; diff --git a/packages/table/src/utils/index.ts b/packages/table/src/utils/index.ts index 0776fbd5858e..1ae2483c0940 100644 --- a/packages/table/src/utils/index.ts +++ b/packages/table/src/utils/index.ts @@ -3,6 +3,7 @@ import type { UseEditableUtilType } from '@ant-design/pro-utils'; import type { TablePaginationConfig } from 'antd'; import type { SortOrder } from 'antd/lib/table/interface'; import type React from 'react'; +import { Key } from 'react'; import type { ActionType, Bordered, @@ -160,7 +161,7 @@ export const isMergeCell = ( * @param index 序列号,理论上唯一 */ export const genColumnKey = ( - key?: string | number, + key?: string | number | Key, index?: number | string, ): string => { if (key) { diff --git a/packages/utils/src/transformKeySubmitValue/index.ts b/packages/utils/src/transformKeySubmitValue/index.ts index d5187882e9c2..3255c8c29529 100644 --- a/packages/utils/src/transformKeySubmitValue/index.ts +++ b/packages/utils/src/transformKeySubmitValue/index.ts @@ -133,7 +133,7 @@ export const transformKeySubmitValue = ( : [entityKey].flat(1); const itemValue = tempValues[entityKey]; - const transformFunction = get(dataFormatMap, key); + const transformFunction = get(dataFormatMap, key as (number | string)[]); const transform = () => { let tempKey, diff --git a/packages/utils/src/useEditableArray/index.tsx b/packages/utils/src/useEditableArray/index.tsx index 11b4250dabfd..982154e84d03 100644 --- a/packages/utils/src/useEditableArray/index.tsx +++ b/packages/utils/src/useEditableArray/index.tsx @@ -333,7 +333,6 @@ export function SaveEditableAction( .filter(Boolean) as string[]; setLoading(true); await form.validateFields(namePath, { - // @ts-expect-error recursive: true, }); @@ -346,7 +345,7 @@ export function SaveEditableAction( const [, ...recordKeyPath] = recordKey; // 将目标值获取出来并设置到 fields 当中 const curValue = get(fields, recordKeyPath as string[]); - set(fields, recordKeyPath, curValue); + set(fields, recordKeyPath as (number | string)[], curValue); } const data = isMapEditor ? set({}, namePath, fields, true) : fields; @@ -489,7 +488,7 @@ const CancelEditableAction: React.FC & { row: any }> = ( await cancelEditable(recordKey); /** 重置为默认值,不然编辑的行会丢掉 */ form.setFieldsValue({ - [recordKey as React.Key]: isMapEditor ? get(row, namePath) : row, + [`${recordKey as React.Key}`]: isMapEditor ? get(row, namePath) : row, }); return res; }} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9ebefd09fe36..083d8b97da41 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -194,7 +194,7 @@ importers: version: 8.49.0 eslint-plugin-jest: specifier: ^27.2.1 - version: 27.2.3(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.49.0)(typescript@4.8.4) + version: 27.2.1(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.49.0)(typescript@4.8.4) eslint-plugin-react: specifier: ^7.33.2 version: 7.33.2(eslint@8.49.0) @@ -344,7 +344,7 @@ importers: version: 4.8.4 umi: specifier: ^4.0.81 - version: 4.0.81(@babel/core@7.22.19)(@types/node@14.18.60)(@types/react@18.0.38)(eslint@8.49.0)(prettier@2.8.8)(react-dom@18.2.0)(react@18.2.0)(sass@1.67.0)(stylelint@13.13.1)(typescript@4.8.4) + version: 4.0.81(@babel/core@7.22.19)(@types/node@14.18.60)(@types/react@18.0.38)(eslint@8.49.0)(prettier@2.8.8)(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0)(stylelint@13.13.1)(typescript@4.8.4) umi-request: specifier: ^1.4.0 version: 1.4.0 @@ -999,7 +999,7 @@ packages: dependencies: '@babel/compat-data': 7.22.20 '@babel/helper-validator-option': 7.22.15 - browserslist: 4.21.10 + browserslist: 4.21.11 lru-cache: 5.1.1 semver: 6.3.1 dev: true @@ -2839,7 +2839,7 @@ packages: resolution: {integrity: sha512-NfsJX4PdzhwSkfJukczyUiZGc7zNNWZcEAyqeISpDnn0PTfzMJR1aR8xAIPskBejIxBJbIgCCMzbaYa9SXepIg==} dependencies: '@esbuild-kit/core-utils': 3.3.2 - get-tsconfig: 4.7.0 + get-tsconfig: 4.7.1 dev: true /@esbuild-kit/core-utils@3.3.2: @@ -2853,7 +2853,7 @@ packages: resolution: {integrity: sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==} dependencies: '@esbuild-kit/core-utils': 3.3.2 - get-tsconfig: 4.7.0 + get-tsconfig: 4.7.1 dev: true /@esbuild/android-arm64@0.17.19: @@ -3270,7 +3270,7 @@ packages: ajv: 6.12.6 debug: 4.3.4 espree: 9.6.1 - globals: 13.21.0 + globals: 13.22.0 ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -5189,15 +5189,15 @@ packages: dependencies: '@babel/runtime': 7.22.15 '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) - '@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) + '@rc-component/trigger': 1.16.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.3.2 rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: true - /@rc-component/trigger@1.15.6(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-Tl19KaGsShf4yzqxumsXVT4c7j0l20Dxe5hgP5S0HmxyhCg3oKen28ntGavRCIPW7cl7wgsGotntqcIokgDHzg==} + /@rc-component/trigger@1.16.1(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-QtRB0L8A3Zik1pG1vQloWCytYMjHWKFuC7DiJ7822oc4K2wlwiyy5yBICE+G6ySKQrlYmlVIOMz/E2MbfU1DyA==} engines: {node: '>=8.x'} peerDependencies: react: '>=16.9.0' @@ -5827,8 +5827,8 @@ packages: '@types/node': 14.18.60 dev: true - /@types/graceful-fs@4.1.6: - resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} + /@types/graceful-fs@4.1.7: + resolution: {integrity: sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw==} dependencies: '@types/node': 14.18.60 dev: true @@ -6332,7 +6332,7 @@ packages: - supports-color dev: true - /@umijs/bundler-vite@4.0.81(@types/node@14.18.60)(sass@1.67.0): + /@umijs/bundler-vite@4.0.81(@types/node@14.18.60)(sass@1.68.0): resolution: {integrity: sha512-gYRI8DxK5sQFWKWCkde+gujUDpoJVlqUR4fQkh2wVxLCs2JJ1aWMuepDTjoCeKzL7iaVqwN6+7IAebCNJL0I3A==} hasBin: true dependencies: @@ -6343,7 +6343,7 @@ packages: less: 4.1.3 postcss-preset-env: 7.5.0(postcss@8.4.30) rollup-plugin-visualizer: 5.9.0 - vite: 4.3.1(@types/node@14.18.60)(less@4.1.3)(sass@1.67.0) + vite: 4.3.1(@types/node@14.18.60)(less@4.1.3)(sass@1.68.0) transitivePeerDependencies: - '@types/node' - postcss @@ -6584,7 +6584,7 @@ packages: eslint: 8.49.0 eslint-config-prettier: 8.10.0(eslint@8.49.0) eslint-formatter-pretty: 4.1.0 - eslint-plugin-jest: 27.4.0(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.49.0)(typescript@4.8.4) + eslint-plugin-jest: 27.2.1(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.49.0)(typescript@4.8.4) eslint-plugin-react: 7.33.2(eslint@8.49.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.49.0) eslint-plugin-unicorn: 47.0.0(eslint@8.49.0) @@ -6661,7 +6661,7 @@ packages: peerDependencies: umi: 3.x dependencies: - umi: 4.0.81(@babel/core@7.22.19)(@types/node@14.18.60)(@types/react@18.0.38)(eslint@8.49.0)(prettier@2.8.8)(react-dom@18.2.0)(react@18.2.0)(sass@1.67.0)(stylelint@13.13.1)(typescript@4.8.4) + umi: 4.0.81(@babel/core@7.22.19)(@types/node@14.18.60)(@types/react@18.0.38)(eslint@8.49.0)(prettier@2.8.8)(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0)(stylelint@13.13.1)(typescript@4.8.4) dev: true /@umijs/plugin-run@4.0.81: @@ -6670,7 +6670,7 @@ packages: tsx: 3.12.10 dev: true - /@umijs/preset-umi@4.0.81(@types/node@14.18.60)(@types/react@18.0.38)(sass@1.67.0)(typescript@4.8.4): + /@umijs/preset-umi@4.0.81(@types/node@14.18.60)(@types/react@18.0.38)(sass@1.68.0)(typescript@4.8.4): resolution: {integrity: sha512-BOoBUAtSKq/+hpyX9B25Yfh5DpMLHTGoUsdj5DBMzgWlzvslcYmurswaTGgcYD5JjTjKfEfn0vspDYgGNV71RA==} dependencies: '@iconify/utils': 2.1.1 @@ -6679,7 +6679,7 @@ packages: '@umijs/babel-preset-umi': 4.0.81 '@umijs/bundler-esbuild': 4.0.81 '@umijs/bundler-utils': 4.0.81 - '@umijs/bundler-vite': 4.0.81(@types/node@14.18.60)(sass@1.67.0) + '@umijs/bundler-vite': 4.0.81(@types/node@14.18.60)(sass@1.68.0) '@umijs/bundler-webpack': 4.0.81(typescript@4.8.4) '@umijs/core': 4.0.81 '@umijs/did-you-know': 1.0.3 @@ -6818,7 +6818,7 @@ packages: umi: ^3.0.0 dependencies: '@testing-library/react': 13.4.0(react-dom@18.2.0)(react@18.2.0) - umi: 4.0.81(@babel/core@7.22.19)(@types/node@14.18.60)(@types/react@18.0.38)(eslint@8.49.0)(prettier@2.8.8)(react-dom@18.2.0)(react@18.2.0)(sass@1.67.0)(stylelint@13.13.1)(typescript@4.8.4) + umi: 4.0.81(@babel/core@7.22.19)(@types/node@14.18.60)(@types/react@18.0.38)(eslint@8.49.0)(prettier@2.8.8)(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0)(stylelint@13.13.1)(typescript@4.8.4) dev: true /@umijs/test@3.5.41(ts-node@10.9.1): @@ -6904,7 +6904,7 @@ packages: '@babel/plugin-transform-react-jsx-self': 7.22.5(@babel/core@7.22.19) '@babel/plugin-transform-react-jsx-source': 7.22.5(@babel/core@7.22.19) react-refresh: 0.14.0 - vite: 4.3.1(@types/node@14.18.60)(less@4.1.3)(sass@1.67.0) + vite: 4.3.1(@types/node@14.18.60)(less@4.1.3)(sass@1.68.0) transitivePeerDependencies: - supports-color dev: true @@ -7252,7 +7252,7 @@ packages: '@rc-component/color-picker': 1.4.1(react-dom@18.2.0)(react@18.2.0) '@rc-component/mutate-observer': 1.1.0(react-dom@18.2.0)(react@18.2.0) '@rc-component/tour': 1.10.0(react-dom@18.2.0)(react@18.2.0) - '@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) + '@rc-component/trigger': 1.16.1(react-dom@18.2.0)(react@18.2.0) '@types/jsdom': 21.1.3 classnames: 2.3.2 copy-to-clipboard: 3.3.3 @@ -7273,7 +7273,7 @@ packages: rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) rc-notification: 5.1.1(react-dom@18.2.0)(react@18.2.0) rc-pagination: 3.6.1(react-dom@18.2.0)(react@18.2.0) - rc-picker: 3.14.2(dayjs@1.11.9)(moment@2.29.4)(react-dom@18.2.0)(react@18.2.0) + rc-picker: 3.14.3(dayjs@1.11.9)(moment@2.29.4)(react-dom@18.2.0)(react@18.2.0) rc-progress: 3.5.1(react-dom@18.2.0)(react@18.2.0) rc-rate: 2.12.0(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0) @@ -7288,7 +7288,7 @@ packages: rc-tooltip: 6.0.1(react-dom@18.2.0)(react@18.2.0) rc-tree: 5.7.12(react-dom@18.2.0)(react@18.2.0) rc-tree-select: 5.12.1(react-dom@18.2.0)(react@18.2.0) - rc-upload: 4.3.4(react-dom@18.2.0)(react@18.2.0) + rc-upload: 4.3.5(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -7641,14 +7641,14 @@ packages: engines: {node: '>=8.0.0'} dev: true - /autoprefixer@10.4.15(postcss@8.4.30): - resolution: {integrity: sha512-KCuPB8ZCIqFdA4HwKXsvz7j6gvSDNhDP7WnUjBleRkKjPdvCmHFuQ77ocavI8FT6NdvlBnE2UFr2H4Mycn8Vew==} + /autoprefixer@10.4.16(postcss@8.4.30): + resolution: {integrity: sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==} engines: {node: ^10 || ^12 || >=14} hasBin: true peerDependencies: postcss: ^8.1.0 dependencies: - browserslist: 4.21.10 + browserslist: 4.21.11 caniuse-lite: 1.0.30001538 fraction.js: 4.3.6 normalize-range: 0.1.2 @@ -7661,7 +7661,7 @@ packages: resolution: {integrity: sha512-eM9d/swFopRt5gdJ7jrpCwgvEMIayITpojhkkSMRsFHYuH5bkSQ4p/9qTEHtmNudUZh22Tehu7I6CxAW0IXTKA==} hasBin: true dependencies: - browserslist: 4.21.10 + browserslist: 4.21.11 caniuse-lite: 1.0.30001538 normalize-range: 0.1.2 num2fraction: 1.2.2 @@ -7680,15 +7680,15 @@ packages: hasBin: true requiresBuild: true dependencies: - aws-sdk: 2.1460.0 + aws-sdk: 2.1462.0 commander: 3.0.2 js-yaml: 3.14.1 watchpack: 2.4.0 dev: true optional: true - /aws-sdk@2.1460.0: - resolution: {integrity: sha512-7K+aTMKtCAyR3cWxyGFd9YP1U4go4IaRsiFO8JLNpy2fSqlGC5XENGyLhmIQQOBwqb2WOwz5e1BftaKycmreWw==} + /aws-sdk@2.1462.0: + resolution: {integrity: sha512-gEcp/YWUp0zrM/LujI3cTLbOTK6XLwGSHWQII57jjRvjsIMacLomnIcd7fGKSfREAIHr5saexISRsnXhfI+Vgw==} engines: {node: '>= 10.0.0'} dependencies: buffer: 4.9.2 @@ -8248,15 +8248,15 @@ packages: pako: 1.0.11 dev: true - /browserslist@4.21.10: - resolution: {integrity: sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==} + /browserslist@4.21.11: + resolution: {integrity: sha512-xn1UXOKUz7DjdGlg9RrUr0GGiWzI97UQJnugHtH0OLDfJB7jMgoIkYvRIEO1l9EeEERVqeqLYOcFBW9ldjypbQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: caniuse-lite: 1.0.30001538 - electron-to-chromium: 1.4.523 + electron-to-chromium: 1.4.527 node-releases: 2.0.13 - update-browserslist-db: 1.0.11(browserslist@4.21.10) + update-browserslist-db: 1.0.13(browserslist@4.21.11) dev: true /bser@2.1.1: @@ -9315,7 +9315,7 @@ packages: /core-js-compat@3.32.2: resolution: {integrity: sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ==} dependencies: - browserslist: 4.21.10 + browserslist: 4.21.11 dev: true /core-js-pure@3.32.2: @@ -10371,9 +10371,9 @@ packages: remark-gfm: 3.0.1 remark-parse: 10.0.2 remark-rehype: 10.1.0 - sass: 1.67.0 + sass: 1.68.0 sitemap: 7.1.1 - umi: 4.0.81(@babel/core@7.22.19)(@types/node@14.18.60)(@types/react@18.0.38)(eslint@8.49.0)(prettier@2.8.8)(react-dom@18.2.0)(react@18.2.0)(sass@1.67.0)(stylelint@13.13.1)(typescript@4.8.4) + umi: 4.0.81(@babel/core@7.22.19)(@types/node@14.18.60)(@types/react@18.0.38)(eslint@8.49.0)(prettier@2.8.8)(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0)(stylelint@13.13.1)(typescript@4.8.4) unified: 10.1.2 unist-util-visit: 4.1.2 unist-util-visit-parents: 5.1.3 @@ -10470,8 +10470,8 @@ packages: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: true - /electron-to-chromium@1.4.523: - resolution: {integrity: sha512-9AreocSUWnzNtvLcbpng6N+GkXnCcBR80IQkxRC9Dfdyg4gaWNUPBujAHUpKkiUkoSoR9UlhA4zD/IgBklmhzg==} + /electron-to-chromium@1.4.527: + resolution: {integrity: sha512-EafxEiEDzk2aLrdbtVczylHflHdHkNrpGNHIgDyA63sUQLQVS2ayj2hPw3RsVB42qkwURH+T2OxV7kGPUuYszA==} dev: true /elegant-spinner@1.0.1: @@ -11076,11 +11076,11 @@ packages: supports-hyperlinks: 2.3.0 dev: true - /eslint-plugin-jest@27.2.3(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.49.0)(typescript@4.8.4): - resolution: {integrity: sha512-sRLlSCpICzWuje66Gl9zvdF6mwD5X86I4u55hJyFBsxYOsBCmT5+kSUjf+fkFWVMMgpzNEupjW8WzUqi83hJAQ==} + /eslint-plugin-jest@27.2.1(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.49.0)(typescript@4.8.4): + resolution: {integrity: sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: - '@typescript-eslint/eslint-plugin': ^5.0.0 || ^6.0.0 + '@typescript-eslint/eslint-plugin': ^5.0.0 eslint: ^7.0.0 || ^8.0.0 jest: '*' peerDependenciesMeta: @@ -11097,8 +11097,8 @@ packages: - typescript dev: true - /eslint-plugin-jest@27.4.0(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.49.0)(typescript@4.8.4): - resolution: {integrity: sha512-ukVeKmMPAUA5SWjHenvyyXnirKfHKMdOsTZdn5tZx5EW05HGVQwBohigjFZGGj3zuv1cV6hc82FvWv6LdIbkgg==} + /eslint-plugin-jest@27.2.3(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.49.0)(typescript@4.8.4): + resolution: {integrity: sha512-sRLlSCpICzWuje66Gl9zvdF6mwD5X86I4u55hJyFBsxYOsBCmT5+kSUjf+fkFWVMMgpzNEupjW8WzUqi83hJAQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@typescript-eslint/eslint-plugin': ^5.0.0 || ^6.0.0 @@ -11239,7 +11239,7 @@ packages: file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.21.0 + globals: 13.22.0 graphemer: 1.4.0 ignore: 5.2.4 imurmurhash: 0.1.4 @@ -12267,8 +12267,8 @@ packages: get-intrinsic: 1.2.1 dev: true - /get-tsconfig@4.7.0: - resolution: {integrity: sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw==} + /get-tsconfig@4.7.1: + resolution: {integrity: sha512-sLtd6Bcwbi9IrAow/raCOTE9pmhvo5ksQo5v2lApUGJMzja64MUYhBp0G6X1S+f7IrBPn1HP+XkS2w2meoGcjg==} dependencies: resolve-pkg-maps: 1.0.0 dev: true @@ -12501,8 +12501,8 @@ packages: engines: {node: '>=4'} dev: true - /globals@13.21.0: - resolution: {integrity: sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==} + /globals@13.22.0: + resolution: {integrity: sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -13077,7 +13077,7 @@ packages: he: 1.2.0 param-case: 3.0.4 relateurl: 0.2.7 - terser: 5.19.4 + terser: 5.20.0 dev: true /html-tags@3.3.1: @@ -14513,7 +14513,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/graceful-fs': 4.1.6 + '@types/graceful-fs': 4.1.7 '@types/node': 14.18.60 anymatch: 3.1.3 fb-watchman: 2.0.2 @@ -14536,7 +14536,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/graceful-fs': 4.1.6 + '@types/graceful-fs': 4.1.7 '@types/node': 14.18.60 anymatch: 3.1.3 fb-watchman: 2.0.2 @@ -15011,7 +15011,7 @@ packages: whatwg-encoding: 2.0.0 whatwg-mimetype: 3.0.0 whatwg-url: 10.0.0 - ws: 8.14.1 + ws: 8.14.2 xml-name-validator: 4.0.0 transitivePeerDependencies: - bufferutil @@ -18680,8 +18680,8 @@ packages: '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.30) '@csstools/postcss-stepped-value-functions': 1.0.1(postcss@8.4.30) '@csstools/postcss-unset-value': 1.0.2(postcss@8.4.30) - autoprefixer: 10.4.15(postcss@8.4.30) - browserslist: 4.21.10 + autoprefixer: 10.4.16(postcss@8.4.30) + browserslist: 4.21.11 css-blank-pseudo: 3.0.3(postcss@8.4.30) css-has-pseudo: 3.0.4(postcss@8.4.30) css-prefers-color-scheme: 6.0.3(postcss@8.4.30) @@ -19418,7 +19418,7 @@ packages: react-dom: '>=16.11.0' dependencies: '@babel/runtime': 7.22.15 - '@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) + '@rc-component/trigger': 1.16.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.3.2 rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 @@ -19502,7 +19502,7 @@ packages: react-dom: '>=16.9.0' dependencies: '@babel/runtime': 7.22.15 - '@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) + '@rc-component/trigger': 1.16.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.3.2 rc-input: 1.1.1(react-dom@18.2.0)(react@18.2.0) rc-menu: 9.12.0(react-dom@18.2.0)(react@18.2.0) @@ -19519,7 +19519,7 @@ packages: react-dom: '>=16.9.0' dependencies: '@babel/runtime': 7.22.15 - '@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) + '@rc-component/trigger': 1.16.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.3.2 rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0) @@ -19583,8 +19583,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /rc-picker@3.14.2(dayjs@1.11.9)(moment@2.29.4)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-+jKWhKydU2z5hgY0yenHQRx2nRLrHiRdPD8f2+Yg5ld6+Ah/mh1tV9ya1OPcEMqbqXCZXnKqqBv4mAEQm1oAyQ==} + /rc-picker@3.14.3(dayjs@1.11.9)(moment@2.29.4)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-41tVGgYnO1eXiVFTmhOkAyXqJSNTbNgmEGYxzsGzrhnH905yug9Z+6P0DYRaBC829xLxPA8GYpeWtGmm3OMQfw==} engines: {node: '>=8.x'} peerDependencies: date-fns: '>= 2.x' @@ -19604,7 +19604,7 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.15 - '@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) + '@rc-component/trigger': 1.16.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.3.2 dayjs: 1.11.9 moment: 2.29.4 @@ -19688,12 +19688,12 @@ packages: react-dom: '*' dependencies: '@babel/runtime': 7.22.15 - '@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) + '@rc-component/trigger': 1.16.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.3.2 rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) - rc-virtual-list: 3.10.8(react-dom@18.2.0)(react@18.2.0) + rc-virtual-list: 3.10.10(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: true @@ -19751,7 +19751,7 @@ packages: classnames: 2.3.2 rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) - rc-virtual-list: 3.10.8(react-dom@18.2.0)(react@18.2.0) + rc-virtual-list: 3.10.10(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: true @@ -19796,7 +19796,7 @@ packages: react-dom: '>=16.9.0' dependencies: '@babel/runtime': 7.22.15 - '@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) + '@rc-component/trigger': 1.16.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.3.2 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -19828,13 +19828,13 @@ packages: classnames: 2.3.2 rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) - rc-virtual-list: 3.10.8(react-dom@18.2.0)(react@18.2.0) + rc-virtual-list: 3.10.10(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: true - /rc-upload@4.3.4(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-uVbtHFGNjHG/RyAfm9fluXB6pvArAGyAx8z7XzXXyorEgVIWj6mOlriuDm0XowDHYz4ycNK0nE0oP3cbFnzxiQ==} + /rc-upload@4.3.5(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-EHlKJbhkgFSQHliTj9v/2K5aEuFwfUQgZARzD7AmAPOneZEPiCNF3n6PEWIuqz9h7oq6FuXgdR67sC5BWFxJbA==} peerDependencies: react: '>=16.9.0' react-dom: '>=16.9.0' @@ -19872,8 +19872,8 @@ packages: react-dom: 18.2.0(react@18.2.0) react-is: 16.13.1 - /rc-virtual-list@3.10.8(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-QUdQ09KVz60KULJaFF51dDA3hpVAMtN9M+qbTDIARKhBb0TPG8s3ifQUuuhbe4I4lQ3G11wB5qJudN1zi8sgkA==} + /rc-virtual-list@3.10.10(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-EqNotqqRLzxFYce9JB/aDtP5fShvgwDVIuEKQeq9qfeNiKmsD4zf/UD+i0LppHtObzDUGtRFSf0HIOfb8FGSPA==} engines: {node: '>=8.x'} peerDependencies: react: '*' @@ -20978,8 +20978,8 @@ packages: - supports-color dev: true - /sass@1.67.0: - resolution: {integrity: sha512-SVrO9ZeX/QQyEGtuZYCVxoeAL5vGlYjJ9p4i4HFuekWl8y/LtJ7tJc10Z+ck1c8xOuoBm2MYzcLfTAffD0pl/A==} + /sass@1.68.0: + resolution: {integrity: sha512-Lmj9lM/fef0nQswm1J2HJcEsBUba4wgNx2fea6yJHODREoMFnwRpZydBnX/RjyXw2REIwdkbqE4hrTo4qfDBUA==} engines: {node: '>=14.0.0'} hasBin: true dependencies: @@ -21482,7 +21482,7 @@ packages: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.14 + spdx-license-ids: 3.0.15 dev: true /spdx-exceptions@2.3.0: @@ -21493,11 +21493,11 @@ packages: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.14 + spdx-license-ids: 3.0.15 dev: true - /spdx-license-ids@3.0.14: - resolution: {integrity: sha512-U0eS5wcpu/O2/QZk6PcAMOA8H3ZuvRe4mFHA3Q+LNl1SRDmfQ+mD3RoD6tItqnvqubJ32m/zV2Z/ikSmxccD1Q==} + /spdx-license-ids@3.0.15: + resolution: {integrity: sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==} dev: true /spdy-transport@3.0.0: @@ -22372,8 +22372,8 @@ packages: supports-hyperlinks: 2.3.0 dev: true - /terser@5.19.4: - resolution: {integrity: sha512-6p1DjHeuluwxDXcuT9VR8p64klWJKo1ILiy19s6C9+0Bh2+NWTX6nD9EPppiER4ICkHDVB1RkVpin/YW2nQn/g==} + /terser@5.20.0: + resolution: {integrity: sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ==} engines: {node: '>=10'} hasBin: true dependencies: @@ -22917,7 +22917,7 @@ packages: qs: 6.11.2 dev: true - /umi@4.0.81(@babel/core@7.22.19)(@types/node@14.18.60)(@types/react@18.0.38)(eslint@8.49.0)(prettier@2.8.8)(react-dom@18.2.0)(react@18.2.0)(sass@1.67.0)(stylelint@13.13.1)(typescript@4.8.4): + /umi@4.0.81(@babel/core@7.22.19)(@types/node@14.18.60)(@types/react@18.0.38)(eslint@8.49.0)(prettier@2.8.8)(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0)(stylelint@13.13.1)(typescript@4.8.4): resolution: {integrity: sha512-YK4gCrywiR3Ra3k2Gi6K3s1z4VgxMehrI6zdCVAHyd/i2DaTRDNImJrHwapYLUeZDHCslaXg3jl1Mrb53aFu/g==} engines: {node: '>=14'} hasBin: true @@ -22927,7 +22927,7 @@ packages: '@umijs/bundler-webpack': 4.0.81(typescript@4.8.4) '@umijs/core': 4.0.81 '@umijs/lint': 4.0.81(eslint@8.49.0)(stylelint@13.13.1)(typescript@4.8.4) - '@umijs/preset-umi': 4.0.81(@types/node@14.18.60)(@types/react@18.0.38)(sass@1.67.0)(typescript@4.8.4) + '@umijs/preset-umi': 4.0.81(@types/node@14.18.60)(@types/react@18.0.38)(sass@1.68.0)(typescript@4.8.4) '@umijs/renderer-react': 4.0.81(react-dom@18.2.0)(react@18.2.0) '@umijs/server': 4.0.81 '@umijs/test': 4.0.81(@babel/core@7.22.19) @@ -23197,13 +23197,13 @@ packages: engines: {node: '>=4'} dev: true - /update-browserslist-db@1.0.11(browserslist@4.21.10): - resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} + /update-browserslist-db@1.0.13(browserslist@4.21.11): + resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.10 + browserslist: 4.21.11 escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -23514,7 +23514,7 @@ packages: - supports-color - terser - /vite@4.3.1(@types/node@14.18.60)(less@4.1.3)(sass@1.67.0): + /vite@4.3.1(@types/node@14.18.60)(less@4.1.3)(sass@1.68.0): resolution: {integrity: sha512-EPmfPLAI79Z/RofuMvkIS0Yr091T2ReUoXQqc5ppBX/sjFRhHKiPPF/R46cTdoci/XgeQpB23diiJxq5w30vdg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -23544,7 +23544,7 @@ packages: less: 4.1.3 postcss: 8.4.30 rollup: 3.29.2 - sass: 1.67.0 + sass: 1.68.0 optionalDependencies: fsevents: 2.3.3 dev: true @@ -24030,8 +24030,8 @@ packages: optional: true dev: true - /ws@8.14.1: - resolution: {integrity: sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A==} + /ws@8.14.2: + resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 diff --git a/tests/__snapshots__/doc.test.ts.snap b/tests/__snapshots__/doc.test.ts.snap index a8c02b01cb0e..08b09d2f6470 100644 --- a/tests/__snapshots__/doc.test.ts.snap +++ b/tests/__snapshots__/doc.test.ts.snap @@ -659,6 +659,683 @@ exports[`docs/components demos > 📸 renders ./docs/components/customization-va `; +exports[`docs/components demos > 📸 renders ./docs/components/customization-value-type.tsx correctly 2`] = ` + +
+ test +
+
+
+
+ SchemaForm +
+
+
+
+ +
+
+ 标签 +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ 路径 +
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + close + +
+
+ + close + +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ + close + + + close + +
+
+
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ ProTable +
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + +
+ 链接 + + 标签 +
+ + TradeCode 1 + + + + close + + + close + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ProDescriptions +
+
+
+
+
+ + + + + + + + + +
+
+ + 链接 + + + + TradeCode 1 + + +
+
+
+ + 标签 + + + + close + + + close + + +
+
+
+
+
+
+
+`; + exports[`docs/components demos > 📸 renders ./docs/components/valueEnum-map.tsx correctly 1`] = `
@@ -672,7 +1349,640 @@ exports[`docs/components demos > 📸 renders ./docs/components/valueEnum-map.ts >
+ +
+
+
+
+
+ +
+
+
+
+
+
+ + + + + 请选择 + +
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + + 请选择 + +
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + + 请选择 + +
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ + +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + +
+
+ + + + + +
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + +
+ 状态(number) + + 状态(number) + + 状态(boolean) +
+
+
+ + + + + + + + + +
+
+ 暂无数据 +
+
+
+
+
+
+
+
+
+
+
+
+
+`; + +exports[`docs/components demos > 📸 renders ./docs/components/valueEnum-map.tsx correctly 2`] = ` + +
+ test +
+
+