-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
267 additions
and
107 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
packages/products/tdesign-miniprogram/src/checkbox-group/type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { KeysType } from '../common/common'; | ||
|
||
export interface TdCheckboxGroupProps<T = CheckboxGroupValue> { | ||
/** | ||
* 是否开启无边框模式 | ||
* @default false | ||
*/ | ||
borderless?: { | ||
type: BooleanConstructor; | ||
value?: boolean; | ||
}; | ||
/** | ||
* 用来定义 value / label 在 `options` 中对应的字段别名 | ||
*/ | ||
keys?: { | ||
type: ObjectConstructor; | ||
value?: KeysType; | ||
}; | ||
/** | ||
* 支持最多选中的数量 | ||
*/ | ||
max?: { | ||
type: NumberConstructor; | ||
value?: number; | ||
}; | ||
/** | ||
* 统一设置内部复选框 HTML 属性 | ||
* @default '' | ||
*/ | ||
name?: { | ||
type: StringConstructor; | ||
value?: string; | ||
}; | ||
/** | ||
* 以配置形式设置子元素。示例1:`['北京', '上海']` ,示例2: `[{ label: '全选', checkAll: true }, { label: '上海', value: 'shanghai' }]`。checkAll 值为 true 表示当前选项为「全选选项」 | ||
* @default [] | ||
*/ | ||
options?: { | ||
type: ArrayConstructor; | ||
value?: Array<CheckboxOption>; | ||
}; | ||
/** | ||
* 选中值 | ||
* @default [] | ||
*/ | ||
value?: { | ||
type: ArrayConstructor; | ||
value?: T; | ||
}; | ||
/** | ||
* 选中值,非受控属性 | ||
* @default [] | ||
*/ | ||
defaultValue?: { | ||
type: ArrayConstructor; | ||
value?: T; | ||
}; | ||
} | ||
|
||
export type CheckboxOption = string | number | CheckboxOptionObj; | ||
|
||
export interface CheckboxOptionObj { | ||
label?: string; | ||
value?: string | number; | ||
disabled?: boolean; | ||
checkAll?: true; | ||
} | ||
|
||
export type CheckboxGroupValue = Array<string | number | boolean>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.