Skip to content

Commit

Permalink
feat(Input): add cursorColor props
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Oct 21, 2024
1 parent a283e29 commit f7abdf4
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 0 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ clearable | Boolean / Object | false | show clear icon, clicked to clear input v
confirm-hold | Boolean | false | \- | N
confirm-type | String | done | options: send/search/next/go/done | N
cursor | Number | - | required | Y
cursor-color | String | - | \- | N
cursor-spacing | Number | 0 | \- | N
disabled | Boolean | false | make input to be disabled | N
error-message | String | - | `deprecated` | N
Expand Down
1 change: 1 addition & 0 deletions packages/products/tdesign-miniprogram/src/input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ clearable | Boolean / Object | false | 是否可清空,默认不启动。值
confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起 | N
confirm-type | String | done | 设置键盘右下角按钮的文字,仅在type='text'时生效。<br />具体释义:<br />`send` 右下角按钮为“发送”;<br />`search` 右下角按钮为“搜索”;<br />`next` 右下角按钮为“下一个”;<br />`go` 右下角按钮为“前往”;<br />`done` 右下角按钮为“完成”。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html)。可选项:send/search/next/go/done | N
cursor | Number | - | 必需。指定 focus 时的光标位置 | Y
cursor-color | String | - | 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 | N
cursor-spacing | Number | 0 | 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 | N
disabled | Boolean | false | 是否禁用输入框 | N
error-message | String | - | 已废弃。错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips) | N
Expand Down
5 changes: 5 additions & 0 deletions packages/products/tdesign-miniprogram/src/input/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const props: TdInputProps = {
type: Number,
required: true,
},
/** 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 */
cursorColor: {
type: String,
value: '',
},
/** 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 */
cursorSpacing: {
type: Number,
Expand Down
8 changes: 8 additions & 0 deletions packages/products/tdesign-miniprogram/src/input/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ export interface TdInputProps {
value?: number;
required?: boolean;
};
/**
* 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制
* @default ''
*/
cursorColor?: {
type: StringConstructor;
value?: string;
};
/**
* 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离
* @default 0
Expand Down
37 changes: 37 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -63104,6 +63104,43 @@
"Number"
]
},
{
"id": 1729500769,
"platform_framework": [
"64"
],
"component": "Input",
"field_category": 1,
"field_name": "cursorColor",
"field_type": [
"1"
],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2024-10-21 08:52:49",
"update_time": "2024-10-21 08:52:49",
"event_output": null,
"custom_field_type": null,
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Miniprogram"
],
"field_type_text": [
"String"
]
},
{
"id": 1712026462,
"platform_framework": [
Expand Down

0 comments on commit f7abdf4

Please sign in to comment.