committed by
allen
29 changed files with 516 additions and 662 deletions
@ -1,95 +0,0 @@ |
|||
import type { |
|||
AutoCompleteProps, |
|||
ButtonProps, |
|||
CascaderProps, |
|||
CheckboxGroupProps, |
|||
CheckboxProps, |
|||
DatePickerProps, |
|||
DividerProps, |
|||
InputNumberProps, |
|||
InputProps, |
|||
MentionsProps, |
|||
RadioGroupProps, |
|||
RadioProps, |
|||
RateProps, |
|||
SelectProps, |
|||
SpaceProps, |
|||
SwitchProps, |
|||
TextAreaProps, |
|||
TimePickerProps, |
|||
TreeSelectProps, |
|||
UploadProps, |
|||
} from 'ant-design-vue'; |
|||
import type { RangePickerProps } from 'ant-design-vue/es/date-picker'; |
|||
|
|||
import type { Component } from 'vue'; |
|||
|
|||
import type { |
|||
ApiComponentSharedProps, |
|||
VbenFormSchema as CoreFormSchema, |
|||
FormActions, |
|||
IconPickerProps, |
|||
} from '@vben/common-ui'; |
|||
|
|||
import type { ComponentType } from './component'; |
|||
|
|||
type ComponentProps<P> = |
|||
| (( |
|||
value: Partial<Record<string, any>>, |
|||
actions: FormActions, |
|||
) => P & Record<string, any>) |
|||
| (P & Record<string, any>); |
|||
|
|||
/** |
|||
* 与 {@link ComponentType} 中注册的组件名一一对应,便于 Schema 上 `component` + `componentProps` 联动提示 |
|||
*/ |
|||
interface ComponentPropsMap { |
|||
ApiCascader: ApiComponentSharedProps & CascaderProps; |
|||
ApiSelect: ApiComponentSharedProps & SelectProps; |
|||
ApiTreeSelect: ApiComponentSharedProps & TreeSelectProps; |
|||
AutoComplete: AutoCompleteProps; |
|||
Cascader: CascaderProps; |
|||
Checkbox: CheckboxProps; |
|||
CheckboxGroup: CheckboxGroupProps; |
|||
DatePicker: DatePickerProps; |
|||
DefaultButton: ButtonProps; |
|||
Divider: DividerProps; |
|||
IconPicker: IconPickerProps; |
|||
Input: InputProps; |
|||
InputNumber: InputNumberProps; |
|||
InputPassword: InputProps; |
|||
Mentions: MentionsProps; |
|||
PrimaryButton: ButtonProps; |
|||
Radio: RadioProps; |
|||
RadioGroup: RadioGroupProps; |
|||
RangePicker: RangePickerProps; |
|||
Rate: RateProps; |
|||
Select: SelectProps; |
|||
Space: SpaceProps; |
|||
Switch: SwitchProps; |
|||
Textarea: TextAreaProps; |
|||
TimePicker: TimePickerProps; |
|||
TreeSelect: TreeSelectProps; |
|||
Upload: UploadProps; |
|||
} |
|||
|
|||
type BaseSchema = Omit< |
|||
CoreFormSchema<ComponentType>, |
|||
'component' | 'componentProps' |
|||
>; |
|||
|
|||
type RegisteredName = keyof ComponentPropsMap; |
|||
|
|||
type DiscriminatedFormSchema = { |
|||
[K in RegisteredName]: BaseSchema & { |
|||
component: K; |
|||
componentProps?: ComponentProps<ComponentPropsMap[K]>; |
|||
}; |
|||
}[RegisteredName]; |
|||
|
|||
type FallbackFormSchema = BaseSchema & { |
|||
component: Component | Exclude<ComponentType, RegisteredName>; |
|||
componentProps?: CoreFormSchema<ComponentType>['componentProps']; |
|||
}; |
|||
|
|||
export type VbenFormSchema = DiscriminatedFormSchema | FallbackFormSchema; |
|||
@ -1,95 +0,0 @@ |
|||
import type { |
|||
AutoCompleteProps, |
|||
ButtonProps, |
|||
CascaderProps, |
|||
CheckboxGroupProps, |
|||
CheckboxProps, |
|||
DatePickerProps, |
|||
DividerProps, |
|||
InputNumberProps, |
|||
InputProps, |
|||
MentionsProps, |
|||
RadioGroupProps, |
|||
RadioProps, |
|||
RangePickerProps, |
|||
RateProps, |
|||
SelectProps, |
|||
SpaceProps, |
|||
SwitchProps, |
|||
TextAreaProps, |
|||
TimePickerProps, |
|||
TreeSelectProps, |
|||
UploadProps, |
|||
} from 'antdv-next'; |
|||
|
|||
import type { Component } from 'vue'; |
|||
|
|||
import type { |
|||
ApiComponentSharedProps, |
|||
VbenFormSchema as CoreFormSchema, |
|||
FormActions, |
|||
IconPickerProps, |
|||
} from '@vben/common-ui'; |
|||
|
|||
import type { ComponentType } from './component'; |
|||
|
|||
type ComponentProps<P> = |
|||
| (( |
|||
value: Partial<Record<string, any>>, |
|||
actions: FormActions, |
|||
) => P & Record<string, any>) |
|||
| (P & Record<string, any>); |
|||
|
|||
/** |
|||
* 与 {@link ComponentType} 中注册的组件名一一对应,便于 Schema 上 `component` + `componentProps` 联动提示 |
|||
*/ |
|||
interface ComponentPropsMap { |
|||
ApiCascader: ApiComponentSharedProps & CascaderProps; |
|||
ApiSelect: ApiComponentSharedProps & SelectProps; |
|||
ApiTreeSelect: ApiComponentSharedProps & TreeSelectProps; |
|||
AutoComplete: AutoCompleteProps; |
|||
Cascader: CascaderProps; |
|||
Checkbox: CheckboxProps; |
|||
CheckboxGroup: CheckboxGroupProps; |
|||
DatePicker: DatePickerProps; |
|||
DefaultButton: ButtonProps; |
|||
Divider: DividerProps; |
|||
IconPicker: IconPickerProps; |
|||
Input: InputProps; |
|||
InputNumber: InputNumberProps; |
|||
InputPassword: InputProps; |
|||
Mentions: MentionsProps; |
|||
PrimaryButton: ButtonProps; |
|||
Radio: RadioProps; |
|||
RadioGroup: RadioGroupProps; |
|||
RangePicker: RangePickerProps; |
|||
Rate: RateProps; |
|||
Select: SelectProps; |
|||
Space: SpaceProps; |
|||
Switch: SwitchProps; |
|||
Textarea: TextAreaProps; |
|||
TimePicker: TimePickerProps; |
|||
TreeSelect: TreeSelectProps; |
|||
Upload: UploadProps; |
|||
} |
|||
|
|||
type BaseSchema = Omit< |
|||
CoreFormSchema<ComponentType>, |
|||
'component' | 'componentProps' |
|||
>; |
|||
|
|||
type RegisteredName = keyof ComponentPropsMap; |
|||
|
|||
type DiscriminatedFormSchema = { |
|||
[K in RegisteredName]: BaseSchema & { |
|||
component: K; |
|||
componentProps?: ComponentProps<ComponentPropsMap[K]>; |
|||
}; |
|||
}[RegisteredName]; |
|||
|
|||
type FallbackFormSchema = BaseSchema & { |
|||
component: Component | Exclude<ComponentType, RegisteredName>; |
|||
componentProps?: CoreFormSchema<ComponentType>['componentProps']; |
|||
}; |
|||
|
|||
export type VbenFormSchema = DiscriminatedFormSchema | FallbackFormSchema; |
|||
@ -1,79 +0,0 @@ |
|||
import type { |
|||
CheckboxGroupProps, |
|||
CheckboxProps, |
|||
DatePickerProps, |
|||
DividerProps, |
|||
ElTimePicker, |
|||
ElTreeSelect, |
|||
InputNumberProps, |
|||
InputProps, |
|||
RadioGroupProps, |
|||
SelectV2Props, |
|||
SpaceProps, |
|||
SwitchProps, |
|||
UploadProps, |
|||
} from 'element-plus'; |
|||
|
|||
import type { Component } from 'vue'; |
|||
|
|||
import type { |
|||
ApiComponentSharedProps, |
|||
VbenFormSchema as CoreFormSchema, |
|||
FormActions, |
|||
IconPickerProps, |
|||
} from '@vben/common-ui'; |
|||
|
|||
import type { ComponentType } from './component'; |
|||
|
|||
type ElTreeSelectSchemaProps = InstanceType<typeof ElTreeSelect>['$props']; |
|||
type ElTimePickerSchemaProps = InstanceType<typeof ElTimePicker>['$props']; |
|||
|
|||
type ComponentProps<P> = |
|||
| (( |
|||
value: Partial<Record<string, any>>, |
|||
actions: FormActions, |
|||
) => P & Record<string, any>) |
|||
| (P & Record<string, any>); |
|||
|
|||
/** |
|||
* 与 {@link ComponentType} 中注册的组件名一一对应,便于 Schema 上 `component` + `componentProps` 联动提示 |
|||
*/ |
|||
interface ComponentPropsMap { |
|||
ApiSelect: ApiComponentSharedProps & SelectV2Props; |
|||
ApiTreeSelect: ApiComponentSharedProps & ElTreeSelectSchemaProps; |
|||
Checkbox: CheckboxProps; |
|||
CheckboxGroup: CheckboxGroupProps; |
|||
DatePicker: DatePickerProps; |
|||
Divider: DividerProps; |
|||
IconPicker: IconPickerProps; |
|||
Input: InputProps; |
|||
InputNumber: InputNumberProps; |
|||
RadioGroup: RadioGroupProps; |
|||
Select: SelectV2Props; |
|||
Space: SpaceProps; |
|||
Switch: SwitchProps; |
|||
TimePicker: ElTimePickerSchemaProps; |
|||
TreeSelect: ElTreeSelectSchemaProps; |
|||
Upload: UploadProps; |
|||
} |
|||
|
|||
type BaseSchema = Omit< |
|||
CoreFormSchema<ComponentType>, |
|||
'component' | 'componentProps' |
|||
>; |
|||
|
|||
type RegisteredName = keyof ComponentPropsMap; |
|||
|
|||
type DiscriminatedFormSchema = { |
|||
[K in RegisteredName]: BaseSchema & { |
|||
component: K; |
|||
componentProps?: ComponentProps<ComponentPropsMap[K]>; |
|||
}; |
|||
}[RegisteredName]; |
|||
|
|||
type FallbackFormSchema = BaseSchema & { |
|||
component: Component | Exclude<ComponentType, RegisteredName>; |
|||
componentProps?: CoreFormSchema<ComponentType>['componentProps']; |
|||
}; |
|||
|
|||
export type VbenFormSchema = DiscriminatedFormSchema | FallbackFormSchema; |
|||
@ -1,76 +0,0 @@ |
|||
import type { |
|||
CheckboxGroupProps, |
|||
CheckboxProps, |
|||
DatePickerProps, |
|||
DividerProps, |
|||
InputNumberProps, |
|||
InputProps, |
|||
RadioGroupProps, |
|||
SelectProps, |
|||
SpaceProps, |
|||
SwitchProps, |
|||
TimePickerProps, |
|||
TreeSelectProps, |
|||
UploadProps, |
|||
} from 'naive-ui'; |
|||
|
|||
import type { Component } from 'vue'; |
|||
|
|||
import type { |
|||
ApiComponentSharedProps, |
|||
VbenFormSchema as CoreFormSchema, |
|||
FormActions, |
|||
IconPickerProps, |
|||
} from '@vben/common-ui'; |
|||
|
|||
import type { ComponentType } from './component'; |
|||
|
|||
type ComponentProps<P> = |
|||
| (( |
|||
value: Partial<Record<string, any>>, |
|||
actions: FormActions, |
|||
) => P & Record<string, any>) |
|||
| (P & Record<string, any>); |
|||
|
|||
/** |
|||
* 与 {@link ComponentType} 中注册的组件名一一对应,便于 Schema 上 `component` + `componentProps` 联动提示 |
|||
*/ |
|||
interface ComponentPropsMap { |
|||
ApiSelect: ApiComponentSharedProps & SelectProps; |
|||
ApiTreeSelect: ApiComponentSharedProps & TreeSelectProps; |
|||
Checkbox: CheckboxProps; |
|||
CheckboxGroup: CheckboxGroupProps; |
|||
DatePicker: DatePickerProps; |
|||
Divider: DividerProps; |
|||
IconPicker: IconPickerProps; |
|||
Input: InputProps; |
|||
InputNumber: InputNumberProps; |
|||
RadioGroup: RadioGroupProps; |
|||
Select: SelectProps; |
|||
Space: SpaceProps; |
|||
Switch: SwitchProps; |
|||
TimePicker: TimePickerProps; |
|||
TreeSelect: TreeSelectProps; |
|||
Upload: UploadProps; |
|||
} |
|||
|
|||
type BaseSchema = Omit< |
|||
CoreFormSchema<ComponentType>, |
|||
'component' | 'componentProps' |
|||
>; |
|||
|
|||
type RegisteredName = keyof ComponentPropsMap; |
|||
|
|||
type DiscriminatedFormSchema = { |
|||
[K in RegisteredName]: BaseSchema & { |
|||
component: K; |
|||
componentProps?: ComponentProps<ComponentPropsMap[K]>; |
|||
}; |
|||
}[RegisteredName]; |
|||
|
|||
type FallbackFormSchema = BaseSchema & { |
|||
component: Component | Exclude<ComponentType, RegisteredName>; |
|||
componentProps?: CoreFormSchema<ComponentType>['componentProps']; |
|||
}; |
|||
|
|||
export type VbenFormSchema = DiscriminatedFormSchema | FallbackFormSchema; |
|||
@ -1,89 +0,0 @@ |
|||
import type { |
|||
AutoCompleteProps, |
|||
ButtonProps, |
|||
CheckboxGroupProps, |
|||
CheckboxProps, |
|||
DatePickerProps, |
|||
DateRangePickerProps, |
|||
DividerProps, |
|||
InputNumberProps, |
|||
InputProps, |
|||
RadioGroupProps, |
|||
RadioProps, |
|||
SelectProps, |
|||
SpaceProps, |
|||
SwitchProps, |
|||
TextareaProps, |
|||
TimePickerProps, |
|||
TreeSelectProps, |
|||
} from 'tdesign-vue-next'; |
|||
import type { TdRateProps } from 'tdesign-vue-next/es/rate/type'; |
|||
import type { UploadProps } from 'tdesign-vue-next/es/upload/types'; |
|||
|
|||
import type { Component } from 'vue'; |
|||
|
|||
import type { |
|||
ApiComponentSharedProps, |
|||
VbenFormSchema as CoreFormSchema, |
|||
FormActions, |
|||
IconPickerProps, |
|||
} from '@vben/common-ui'; |
|||
|
|||
import type { ComponentType } from './component'; |
|||
|
|||
type ComponentProps<P> = |
|||
| (( |
|||
value: Partial<Record<string, any>>, |
|||
actions: FormActions, |
|||
) => P & Record<string, any>) |
|||
| (P & Record<string, any>); |
|||
|
|||
/** |
|||
* 与 {@link ComponentType} 中注册的组件名一一对应,便于 Schema 上 `component` + `componentProps` 联动提示 |
|||
*/ |
|||
interface ComponentPropsMap { |
|||
ApiSelect: ApiComponentSharedProps & SelectProps; |
|||
ApiTreeSelect: ApiComponentSharedProps & TreeSelectProps; |
|||
AutoComplete: AutoCompleteProps; |
|||
Checkbox: CheckboxProps; |
|||
CheckboxGroup: CheckboxGroupProps; |
|||
DatePicker: DatePickerProps; |
|||
DefaultButton: ButtonProps; |
|||
Divider: DividerProps; |
|||
IconPicker: IconPickerProps; |
|||
Input: InputProps; |
|||
InputNumber: InputNumberProps; |
|||
PrimaryButton: ButtonProps; |
|||
Radio: RadioProps; |
|||
RadioGroup: RadioGroupProps; |
|||
RangePicker: DateRangePickerProps; |
|||
Rate: TdRateProps; |
|||
Select: SelectProps; |
|||
Space: SpaceProps; |
|||
Switch: SwitchProps; |
|||
Textarea: TextareaProps; |
|||
TimePicker: TimePickerProps; |
|||
TreeSelect: TreeSelectProps; |
|||
Upload: UploadProps; |
|||
} |
|||
|
|||
type BaseSchema = Omit< |
|||
CoreFormSchema<ComponentType>, |
|||
'component' | 'componentProps' |
|||
>; |
|||
|
|||
type RegisteredName = keyof ComponentPropsMap; |
|||
|
|||
type DiscriminatedFormSchema = { |
|||
[K in RegisteredName]: BaseSchema & { |
|||
component: K; |
|||
componentProps?: ComponentProps<ComponentPropsMap[K]>; |
|||
}; |
|||
}[RegisteredName]; |
|||
|
|||
type FallbackFormSchema = BaseSchema & { |
|||
component: Component | Exclude<ComponentType, RegisteredName>; |
|||
componentProps?: CoreFormSchema<ComponentType>['componentProps']; |
|||
}; |
|||
|
|||
export type VbenFormSchema = DiscriminatedFormSchema | FallbackFormSchema; |
|||
@ -1,95 +0,0 @@ |
|||
import type { |
|||
AutoCompleteProps, |
|||
ButtonProps, |
|||
CascaderProps, |
|||
CheckboxGroupProps, |
|||
CheckboxProps, |
|||
DatePickerProps, |
|||
DividerProps, |
|||
InputNumberProps, |
|||
InputProps, |
|||
MentionsProps, |
|||
RadioGroupProps, |
|||
RadioProps, |
|||
RateProps, |
|||
SelectProps, |
|||
SpaceProps, |
|||
SwitchProps, |
|||
TextAreaProps, |
|||
TimePickerProps, |
|||
TreeSelectProps, |
|||
UploadProps, |
|||
} from 'ant-design-vue'; |
|||
import type { RangePickerProps } from 'ant-design-vue/es/date-picker'; |
|||
|
|||
import type { Component } from 'vue'; |
|||
|
|||
import type { |
|||
ApiComponentSharedProps, |
|||
VbenFormSchema as CoreFormSchema, |
|||
FormActions, |
|||
IconPickerProps, |
|||
} from '@vben/common-ui'; |
|||
|
|||
import type { ComponentType } from './component'; |
|||
|
|||
type ComponentProps<P> = |
|||
| (( |
|||
value: Partial<Record<string, any>>, |
|||
actions: FormActions, |
|||
) => P & Record<string, any>) |
|||
| (P & Record<string, any>); |
|||
|
|||
/** |
|||
* 与 {@link ComponentType} 中注册的组件名一一对应,便于 Schema 上 `component` + `componentProps` 联动提示 |
|||
*/ |
|||
interface ComponentPropsMap { |
|||
ApiCascader: ApiComponentSharedProps & CascaderProps; |
|||
ApiSelect: ApiComponentSharedProps & SelectProps; |
|||
ApiTreeSelect: ApiComponentSharedProps & TreeSelectProps; |
|||
AutoComplete: AutoCompleteProps; |
|||
Cascader: CascaderProps; |
|||
Checkbox: CheckboxProps; |
|||
CheckboxGroup: CheckboxGroupProps; |
|||
DatePicker: DatePickerProps; |
|||
DefaultButton: ButtonProps; |
|||
Divider: DividerProps; |
|||
IconPicker: IconPickerProps; |
|||
Input: InputProps; |
|||
InputNumber: InputNumberProps; |
|||
InputPassword: InputProps; |
|||
Mentions: MentionsProps; |
|||
PrimaryButton: ButtonProps; |
|||
Radio: RadioProps; |
|||
RadioGroup: RadioGroupProps; |
|||
RangePicker: RangePickerProps; |
|||
Rate: RateProps; |
|||
Select: SelectProps; |
|||
Space: SpaceProps; |
|||
Switch: SwitchProps; |
|||
Textarea: TextAreaProps; |
|||
TimePicker: TimePickerProps; |
|||
TreeSelect: TreeSelectProps; |
|||
Upload: UploadProps; |
|||
} |
|||
|
|||
type BaseSchema = Omit< |
|||
CoreFormSchema<ComponentType>, |
|||
'component' | 'componentProps' |
|||
>; |
|||
|
|||
type RegisteredName = keyof ComponentPropsMap; |
|||
|
|||
type DiscriminatedFormSchema = { |
|||
[K in RegisteredName]: BaseSchema & { |
|||
component: K; |
|||
componentProps?: ComponentProps<ComponentPropsMap[K]>; |
|||
}; |
|||
}[RegisteredName]; |
|||
|
|||
type FallbackFormSchema = BaseSchema & { |
|||
component: Component | Exclude<ComponentType, RegisteredName>; |
|||
componentProps?: CoreFormSchema<ComponentType>['componentProps']; |
|||
}; |
|||
|
|||
export type VbenFormSchema = DiscriminatedFormSchema | FallbackFormSchema; |
|||
Loading…
Reference in new issue