diff --git a/apps/web-antd/src/adapter/form-schema.ts b/apps/web-antd/src/adapter/form-schema.ts index a759fe4c0..329525648 100644 --- a/apps/web-antd/src/adapter/form-schema.ts +++ b/apps/web-antd/src/adapter/form-schema.ts @@ -27,26 +27,16 @@ import type { Component } from 'vue'; import type { ApiComponentSharedProps, VbenFormSchema as CoreFormSchema, + FormActions, IconPickerProps, } from '@vben/common-ui'; import type { ComponentType } from './component'; -type ComponentPropsFnArgs = Parameters< - Extract< - NonNullable['componentProps']>, - (...args: any) => any - > ->; - -/** - * 使用适配器里为各 `component` 声明的 Props 类型 `P`; - * 与 `Record` 相交以兼容核心库 `MaybeComponentProps` 的索引签名。 - */ type ComponentProps

= | (( - value: ComponentPropsFnArgs[0], - actions: ComponentPropsFnArgs[1], + value: Partial>, + actions: FormActions, ) => P & Record) | (P & Record); diff --git a/apps/web-antdv-next/src/adapter/form-schema.ts b/apps/web-antdv-next/src/adapter/form-schema.ts index c2adcc2dc..de850d1fb 100644 --- a/apps/web-antdv-next/src/adapter/form-schema.ts +++ b/apps/web-antdv-next/src/adapter/form-schema.ts @@ -27,26 +27,16 @@ import type { Component } from 'vue'; import type { ApiComponentSharedProps, VbenFormSchema as CoreFormSchema, + FormActions, IconPickerProps, } from '@vben/common-ui'; import type { ComponentType } from './component'; -type ComponentPropsFnArgs = Parameters< - Extract< - NonNullable['componentProps']>, - (...args: any) => any - > ->; - -/** - * 使用适配器里为各 `component` 声明的 Props 类型 `P`; - * 与 `Record` 相交以兼容核心库 `MaybeComponentProps` 的索引签名。 - */ type ComponentProps

= | (( - value: ComponentPropsFnArgs[0], - actions: ComponentPropsFnArgs[1], + value: Partial>, + actions: FormActions, ) => P & Record) | (P & Record); diff --git a/apps/web-ele/src/adapter/form-schema.ts b/apps/web-ele/src/adapter/form-schema.ts index 770cc61d0..5c68a64ed 100644 --- a/apps/web-ele/src/adapter/form-schema.ts +++ b/apps/web-ele/src/adapter/form-schema.ts @@ -19,6 +19,7 @@ import type { Component } from 'vue'; import type { ApiComponentSharedProps, VbenFormSchema as CoreFormSchema, + FormActions, IconPickerProps, } from '@vben/common-ui'; @@ -27,21 +28,10 @@ import type { ComponentType } from './component'; type ElTreeSelectSchemaProps = InstanceType['$props']; type ElTimePickerSchemaProps = InstanceType['$props']; -type ComponentPropsFnArgs = Parameters< - Extract< - NonNullable['componentProps']>, - (...args: any) => any - > ->; - -/** - * 使用适配器里为各 `component` 声明的 Props 类型 `P`; - * 与 `Record` 相交以兼容核心库 `MaybeComponentProps` 的索引签名。 - */ type ComponentProps

= | (( - value: ComponentPropsFnArgs[0], - actions: ComponentPropsFnArgs[1], + value: Partial>, + actions: FormActions, ) => P & Record) | (P & Record); diff --git a/apps/web-naive/src/adapter/form-schema.ts b/apps/web-naive/src/adapter/form-schema.ts index f4f062b4a..4e107d253 100644 --- a/apps/web-naive/src/adapter/form-schema.ts +++ b/apps/web-naive/src/adapter/form-schema.ts @@ -19,26 +19,16 @@ import type { Component } from 'vue'; import type { ApiComponentSharedProps, VbenFormSchema as CoreFormSchema, + FormActions, IconPickerProps, } from '@vben/common-ui'; import type { ComponentType } from './component'; -type ComponentPropsFnArgs = Parameters< - Extract< - NonNullable['componentProps']>, - (...args: any) => any - > ->; - -/** - * 使用适配器里为各 `component` 声明的 Props 类型 `P`; - * 与 `Record` 相交以兼容核心库 `MaybeComponentProps` 的索引签名。 - */ type ComponentProps

= | (( - value: ComponentPropsFnArgs[0], - actions: ComponentPropsFnArgs[1], + value: Partial>, + actions: FormActions, ) => P & Record) | (P & Record); diff --git a/apps/web-tdesign/src/adapter/form-schema.ts b/apps/web-tdesign/src/adapter/form-schema.ts index 34d7641d6..7063b6054 100644 --- a/apps/web-tdesign/src/adapter/form-schema.ts +++ b/apps/web-tdesign/src/adapter/form-schema.ts @@ -25,26 +25,16 @@ import type { Component } from 'vue'; import type { ApiComponentSharedProps, VbenFormSchema as CoreFormSchema, + FormActions, IconPickerProps, } from '@vben/common-ui'; import type { ComponentType } from './component'; -type ComponentPropsFnArgs = Parameters< - Extract< - NonNullable['componentProps']>, - (...args: any) => any - > ->; - -/** - * 使用适配器里为各 `component` 声明的 Props 类型 `P`; - * 与 `Record` 相交以兼容核心库 `MaybeComponentProps` 的索引签名。 - */ type ComponentProps

= | (( - value: ComponentPropsFnArgs[0], - actions: ComponentPropsFnArgs[1], + value: Partial>, + actions: FormActions, ) => P & Record) | (P & Record); diff --git a/packages/@core/ui-kit/form-ui/src/index.ts b/packages/@core/ui-kit/form-ui/src/index.ts index 16b8b2319..d3e88ad10 100644 --- a/packages/@core/ui-kit/form-ui/src/index.ts +++ b/packages/@core/ui-kit/form-ui/src/index.ts @@ -3,6 +3,7 @@ export { setupVbenForm } from './config'; export type { BaseFormComponentType, ExtendedFormApi, + FormActions, VbenFormProps, FormSchema as VbenFormSchema, } from './types'; diff --git a/playground/src/adapter/form-schema.ts b/playground/src/adapter/form-schema.ts index a759fe4c0..329525648 100644 --- a/playground/src/adapter/form-schema.ts +++ b/playground/src/adapter/form-schema.ts @@ -27,26 +27,16 @@ import type { Component } from 'vue'; import type { ApiComponentSharedProps, VbenFormSchema as CoreFormSchema, + FormActions, IconPickerProps, } from '@vben/common-ui'; import type { ComponentType } from './component'; -type ComponentPropsFnArgs = Parameters< - Extract< - NonNullable['componentProps']>, - (...args: any) => any - > ->; - -/** - * 使用适配器里为各 `component` 声明的 Props 类型 `P`; - * 与 `Record` 相交以兼容核心库 `MaybeComponentProps` 的索引签名。 - */ type ComponentProps

= | (( - value: ComponentPropsFnArgs[0], - actions: ComponentPropsFnArgs[1], + value: Partial>, + actions: FormActions, ) => P & Record) | (P & Record);