|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
import type { Component, VNodeProps } from 'vue' |
|
|
|
|
|
|
|
|
|
type ColSpanType = number | string |
|
|
|
|
export interface ColEx { |
|
|
|
|
style?: any |
|
|
|
@ -80,43 +82,94 @@ export interface ColEx {
|
|
|
|
|
xxl?: { span: ColSpanType, offset: ColSpanType } | ColSpanType |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export type ComponentType = |
|
|
|
|
| 'Input' |
|
|
|
|
| 'InputGroup' |
|
|
|
|
| 'InputPassword' |
|
|
|
|
| 'InputSearch' |
|
|
|
|
| 'InputTextArea' |
|
|
|
|
| 'InputNumber' |
|
|
|
|
| 'InputCountDown' |
|
|
|
|
| 'Select' |
|
|
|
|
| 'ApiSelect' |
|
|
|
|
| 'TreeSelect' |
|
|
|
|
| 'ApiTree' |
|
|
|
|
| 'ApiTreeSelect' |
|
|
|
|
| 'ApiRadioGroup' |
|
|
|
|
| 'RadioButtonGroup' |
|
|
|
|
| 'RadioGroup' |
|
|
|
|
| 'Checkbox' |
|
|
|
|
| 'CheckboxGroup' |
|
|
|
|
| 'AutoComplete' |
|
|
|
|
| 'ApiCascader' |
|
|
|
|
| 'Cascader' |
|
|
|
|
| 'DatePicker' |
|
|
|
|
| 'MonthPicker' |
|
|
|
|
| 'RangePicker' |
|
|
|
|
| 'WeekPicker' |
|
|
|
|
| 'TimePicker' |
|
|
|
|
| 'TimeRangePicker' |
|
|
|
|
| 'Switch' |
|
|
|
|
| 'StrengthMeter' |
|
|
|
|
| 'Upload' |
|
|
|
|
| 'ImageUpload' |
|
|
|
|
| 'IconPicker' |
|
|
|
|
| 'Render' |
|
|
|
|
| 'Slider' |
|
|
|
|
| 'Rate' |
|
|
|
|
| 'Divider' |
|
|
|
|
| 'ApiTransfer' |
|
|
|
|
| 'Editor' |
|
|
|
|
| 'FileUpload' |
|
|
|
|
| 'CronTab' |
|
|
|
|
export type ComponentType = keyof ComponentProps |
|
|
|
|
|
|
|
|
|
type MethodsNameToCamelCase< |
|
|
|
|
T extends string, |
|
|
|
|
M extends string = '', |
|
|
|
|
> = T extends `${infer F}-${infer N}${infer Tail}` |
|
|
|
|
? MethodsNameToCamelCase<Tail, `${M}${F}${Uppercase<N>}`>
|
|
|
|
|
: `${M}${T}` |
|
|
|
|
|
|
|
|
|
type MethodsNameTransform<T> = { |
|
|
|
|
[K in keyof T as K extends `on${string}` ? MethodsNameToCamelCase<K> : never]: T[K]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
type ExtractPropTypes<T extends Component> = T extends new (...args: any) => any |
|
|
|
|
? Omit<InstanceType<T>['$props'], keyof VNodeProps> |
|
|
|
|
: never |
|
|
|
|
|
|
|
|
|
interface _CustomComponents { |
|
|
|
|
ApiSelect: ExtractPropTypes<(typeof import('../components/ApiSelect.vue'))['default']> |
|
|
|
|
ApiTree: ExtractPropTypes<(typeof import('../components/ApiTree.vue'))['default']> |
|
|
|
|
ApiTreeSelect: ExtractPropTypes<(typeof import('../components/ApiTreeSelect.vue'))['default']> |
|
|
|
|
ApiRadioGroup: ExtractPropTypes<(typeof import('../components/ApiRadioGroup.vue'))['default']> |
|
|
|
|
RadioButtonGroup: ExtractPropTypes< |
|
|
|
|
(typeof import('../components/RadioButtonGroup.vue'))['default'] |
|
|
|
|
> |
|
|
|
|
ApiCascader: ExtractPropTypes<(typeof import('../components/ApiCascader.vue'))['default']> |
|
|
|
|
StrengthMeter: ExtractPropTypes< |
|
|
|
|
(typeof import('@/components/StrengthMeter/src/StrengthMeter.vue'))['default'] |
|
|
|
|
> |
|
|
|
|
Upload: ExtractPropTypes<(typeof import('@/components/Upload/src/BasicUpload.vue'))['default']> |
|
|
|
|
ImageUpload: ExtractPropTypes< |
|
|
|
|
(typeof import('@/components/Upload/src/components/ImageUpload.vue'))['default'] |
|
|
|
|
> |
|
|
|
|
IconPicker: ExtractPropTypes<(typeof import('@/components/Icon/src/IconPicker.vue'))['default']> |
|
|
|
|
ApiTransfer: ExtractPropTypes<(typeof import('../components/ApiTransfer.vue'))['default']> |
|
|
|
|
InputCountDown: ExtractPropTypes< |
|
|
|
|
(typeof import('@/components/CountDown/src/CountdownInput.vue'))['default'] |
|
|
|
|
> |
|
|
|
|
FileUpload: ExtractPropTypes<(typeof import('../components/FileUpload.vue'))['default']> |
|
|
|
|
Editor: ExtractPropTypes<(typeof import('@/components/Tinymce/src/Editor.vue'))['default']> |
|
|
|
|
CronTab: ExtractPropTypes<(typeof import('@/components/CronTab/src/CronTabInput.vue'))['default']> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
type CustomComponents<T = _CustomComponents> = { |
|
|
|
|
[K in keyof T]: T[K] & MethodsNameTransform<T[K]>; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface ComponentProps { |
|
|
|
|
Input: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['default']> |
|
|
|
|
InputGroup: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['InputGroup']> |
|
|
|
|
InputPassword: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['InputPassword']> |
|
|
|
|
InputSearch: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['InputSearch']> |
|
|
|
|
InputTextArea: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['Textarea']> |
|
|
|
|
InputNumber: ExtractPropTypes<(typeof import('ant-design-vue/es/input-number'))['default']> |
|
|
|
|
InputCountDown: CustomComponents['InputCountDown'] & ComponentProps['Input'] |
|
|
|
|
Select: ExtractPropTypes<(typeof import('ant-design-vue/es/select'))['default']> |
|
|
|
|
ApiSelect: CustomComponents['ApiSelect'] & ComponentProps['Select'] |
|
|
|
|
TreeSelect: ExtractPropTypes<(typeof import('ant-design-vue/es/tree-select'))['default']> |
|
|
|
|
ApiTree: CustomComponents['ApiTree'] & |
|
|
|
|
ExtractPropTypes<(typeof import('ant-design-vue/es/tree'))['default']> |
|
|
|
|
ApiTreeSelect: CustomComponents['ApiTreeSelect'] & ComponentProps['TreeSelect'] |
|
|
|
|
ApiRadioGroup: CustomComponents['ApiRadioGroup'] & ComponentProps['RadioGroup'] |
|
|
|
|
RadioButtonGroup: CustomComponents['RadioButtonGroup'] & ComponentProps['RadioGroup'] |
|
|
|
|
RadioGroup: ExtractPropTypes<(typeof import('ant-design-vue/es/radio'))['RadioGroup']> |
|
|
|
|
Checkbox: ExtractPropTypes<(typeof import('ant-design-vue/es/checkbox'))['default']> |
|
|
|
|
CheckboxGroup: ExtractPropTypes<(typeof import('ant-design-vue/es/checkbox'))['CheckboxGroup']> |
|
|
|
|
AutoComplete: ExtractPropTypes<(typeof import('ant-design-vue/es/auto-complete'))['default']> |
|
|
|
|
ApiCascader: CustomComponents['ApiCascader'] & ComponentProps['Cascader'] |
|
|
|
|
Cascader: ExtractPropTypes<(typeof import('ant-design-vue/es/cascader'))['default']> |
|
|
|
|
DatePicker: ExtractPropTypes<(typeof import('ant-design-vue/es/date-picker'))['default']> |
|
|
|
|
MonthPicker: ExtractPropTypes<(typeof import('ant-design-vue/es/date-picker'))['MonthPicker']> |
|
|
|
|
RangePicker: ExtractPropTypes<(typeof import('ant-design-vue/es/date-picker'))['RangePicker']> |
|
|
|
|
WeekPicker: ExtractPropTypes<(typeof import('ant-design-vue/es/date-picker'))['WeekPicker']> |
|
|
|
|
TimePicker: ExtractPropTypes<(typeof import('ant-design-vue/es/time-picker'))['TimePicker']> |
|
|
|
|
TimeRangePicker: ExtractPropTypes< |
|
|
|
|
(typeof import('ant-design-vue/es/time-picker'))['TimeRangePicker'] |
|
|
|
|
> |
|
|
|
|
Switch: ExtractPropTypes<(typeof import('ant-design-vue/es/switch'))['default']> |
|
|
|
|
StrengthMeter: CustomComponents['StrengthMeter'] & ComponentProps['InputPassword'] |
|
|
|
|
Upload: CustomComponents['Upload'] |
|
|
|
|
ImageUpload: CustomComponents['ImageUpload'] |
|
|
|
|
IconPicker: CustomComponents['IconPicker'] |
|
|
|
|
Render: Record<string, any> |
|
|
|
|
Slider: ExtractPropTypes<(typeof import('ant-design-vue/es/slider'))['default']> |
|
|
|
|
Rate: ExtractPropTypes<(typeof import('ant-design-vue/es/rate'))['default']> |
|
|
|
|
Divider: ExtractPropTypes<(typeof import('ant-design-vue/es/divider'))['default']> |
|
|
|
|
ApiTransfer: CustomComponents['ApiTransfer'] & ExtractPropTypes<(typeof import('ant-design-vue/es/transfer'))['default']> |
|
|
|
|
FileUpload: CustomComponents['FileUpload'] & ExtractPropTypes<(typeof import('ant-design-vue/es/upload'))['default']> |
|
|
|
|
Editor: CustomComponents['Editor'] |
|
|
|
|
CronTab: CustomComponents['CronTab'] |
|
|
|
|
} |
|
|
|
|