From f73deaf6724e02673590648e98f19e6e917ccc46 Mon Sep 17 00:00:00 2001 From: janrywang Date: Mon, 28 Jun 2021 13:16:56 +0800 Subject: [PATCH] fix(designable-antd): fix typings --- designable/antd/src/schemas/ArrayTable.ts | 2 +- designable/antd/src/schemas/Card.ts | 2 +- designable/antd/src/schemas/Checkbox.ts | 13 ++++++++----- designable/antd/src/schemas/DatePicker.ts | 2 +- designable/antd/src/schemas/FormTab.ts | 2 +- designable/antd/src/schemas/Input.ts | 2 +- designable/antd/src/schemas/Radio.ts | 13 ++++++++----- designable/antd/src/schemas/TimePicker.ts | 2 +- 8 files changed, 22 insertions(+), 16 deletions(-) diff --git a/designable/antd/src/schemas/ArrayTable.ts b/designable/antd/src/schemas/ArrayTable.ts index d0662a997c4..329589cdb57 100644 --- a/designable/antd/src/schemas/ArrayTable.ts +++ b/designable/antd/src/schemas/ArrayTable.ts @@ -1,6 +1,6 @@ import { ISchema } from '@formily/react' -export const ArrayTable: ISchema = { +export const ArrayTable: ISchema & { Addition?: ISchema } = { type: 'object', properties: { bordered: { diff --git a/designable/antd/src/schemas/Card.ts b/designable/antd/src/schemas/Card.ts index 025f4d03fb4..22ef2b083ba 100644 --- a/designable/antd/src/schemas/Card.ts +++ b/designable/antd/src/schemas/Card.ts @@ -1,7 +1,7 @@ import { GlobalRegistry } from '@designable/core' import { ISchema } from '@formily/react' -export const Card: ISchema = { +export const Card: ISchema & { Addition?: ISchema } = { type: 'object', properties: { title: { diff --git a/designable/antd/src/schemas/Checkbox.ts b/designable/antd/src/schemas/Checkbox.ts index 4ea6e06a050..9c152bbdb92 100644 --- a/designable/antd/src/schemas/Checkbox.ts +++ b/designable/antd/src/schemas/Checkbox.ts @@ -1,9 +1,12 @@ import { ISchema } from '@formily/react' -export const Checkbox: ISchema = { - autoFocus: { - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch', +export const Checkbox: ISchema & { Group?: ISchema } = { + type: 'object', + properties: { + autoFocus: { + type: 'boolean', + 'x-decorator': 'FormItem', + 'x-component': 'Switch', + }, }, } diff --git a/designable/antd/src/schemas/DatePicker.ts b/designable/antd/src/schemas/DatePicker.ts index 32b3e51f9f1..5b72fcf4710 100644 --- a/designable/antd/src/schemas/DatePicker.ts +++ b/designable/antd/src/schemas/DatePicker.ts @@ -65,7 +65,7 @@ const CommonDatePickerAPI = { }, } -export const DatePicker: ISchema = { +export const DatePicker: ISchema & { RangePicker?: ISchema } = { type: 'object', properties: { picker: { diff --git a/designable/antd/src/schemas/FormTab.ts b/designable/antd/src/schemas/FormTab.ts index c3ed37cb1f0..5074ca66159 100644 --- a/designable/antd/src/schemas/FormTab.ts +++ b/designable/antd/src/schemas/FormTab.ts @@ -1,7 +1,7 @@ import { GlobalRegistry } from '@designable/core' import { ISchema } from '@formily/react' -export const FormTab: ISchema = { +export const FormTab: ISchema & { TabPane?: ISchema } = { type: 'object', properties: { animated: { diff --git a/designable/antd/src/schemas/Input.ts b/designable/antd/src/schemas/Input.ts index 76a0aeafb5e..641033ee824 100644 --- a/designable/antd/src/schemas/Input.ts +++ b/designable/antd/src/schemas/Input.ts @@ -1,6 +1,6 @@ import { ISchema } from '@formily/react' -export const Input: ISchema = { +export const Input: ISchema & { TextArea?: ISchema } = { type: 'object', properties: { addonBefore: { diff --git a/designable/antd/src/schemas/Radio.ts b/designable/antd/src/schemas/Radio.ts index d02bb225092..7101ab5051e 100644 --- a/designable/antd/src/schemas/Radio.ts +++ b/designable/antd/src/schemas/Radio.ts @@ -1,10 +1,13 @@ import { ISchema } from '@formily/react' -export const Radio: ISchema = { - autoFocus: { - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch', +export const Radio: ISchema & { Group?: ISchema } = { + type: 'object', + properties: { + autoFocus: { + type: 'boolean', + 'x-decorator': 'FormItem', + 'x-component': 'Switch', + }, }, } diff --git a/designable/antd/src/schemas/TimePicker.ts b/designable/antd/src/schemas/TimePicker.ts index 7d6af1375cc..8bb9a28f9f6 100644 --- a/designable/antd/src/schemas/TimePicker.ts +++ b/designable/antd/src/schemas/TimePicker.ts @@ -113,7 +113,7 @@ export const CommonTimePickerAPI = { }, } -export const TimePicker: ISchema = { +export const TimePicker: ISchema & { RangePicker?: ISchema } = { type: 'object', properties: CommonTimePickerAPI, }