Skip to content

Commit 8f95370

Browse files
authored
feat(Textarea): support cursorColor prop (#3832)
* feat(Textarea): support cursorColor prop * test: update snapshots
1 parent dfe8e5e commit 8f95370

File tree

6 files changed

+20
-3
lines changed

6 files changed

+20
-3
lines changed

src/textarea/README.en-US.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ bordered | Boolean | false | \- | N
1616
confirm-hold | Boolean | false | \- | N
1717
confirm-type | String | return | options: return/send/search/next/go/done。Typescript:`'return' \| 'send' \| 'search' \| 'next' \| 'go' \| 'done'` | N
1818
cursor | Number | -1 | \- | N
19+
cursor-color | String | #0052d9 | \- | N
1920
cursor-spacing | Number | 0 | \- | N
2021
disable-default-padding | Boolean | false | \- | N
2122
disabled | Boolean | undefined | \- | N
@@ -68,4 +69,4 @@ Name | Default Value | Description
6869
--td-textarea-indicator-text-color | @text-color-placeholder | -
6970
--td-textarea-label-color | @text-color-primary | -
7071
--td-textarea-placeholder-color | @text-color-placeholder | -
71-
--td-textarea-text-color | @text-color-primary | -
72+
--td-textarea-text-color | @text-color-primary | -

src/textarea/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,14 @@ isComponent: true
7272
style | Object | - | 样式 | N
7373
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
7474
adjust-position | Boolean | true | 键盘弹起时,是否自动上推页面 | N
75-
allow-input-over-max | Boolean | false | `1.8.6` 超出maxlength或maxcharacter之后是否还允许输入 | N
75+
allow-input-over-max | Boolean | false | `1.8.6`。超出maxlength或maxcharacter之后是否还允许输入 | N
7676
autofocus | Boolean | false | 自动聚焦,拉起键盘 | N
7777
autosize | Boolean / Object | false | 是否自动增高,值为 true 时,style.height 不生效。支持传入对象,如 { maxHeight: 120, minHeight: 20 }。TS 类型:`boolean \| { maxHeight?: number, minHeight?: number }` | N
7878
bordered | Boolean | false | 是否显示外边框 | N
7979
confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起点 | N
8080
confirm-type | String | return | 设置键盘右下角按钮的文字,仅在 type='text'时生效。可选项:return/send/search/next/go/done。TS 类型:`'return' \| 'send' \| 'search' \| 'next' \| 'go' \| 'done'` | N
8181
cursor | Number | -1 | 指定 focus 时的光标位置 | N
82+
cursor-color | String | #0052d9 | 【试验性】光标颜色,仅在 Skyline 下有效 | N
8283
cursor-spacing | Number | 0 | 指定光标与键盘的距离。取textarea距离底部的距离和cursor-spacing指定的距离的最小值作为光标与键盘的距离 | N
8384
disable-default-padding | Boolean | false | 是否去掉 iOS 下的默认内边距 | N
8485
disabled | Boolean | undefined | 是否禁用文本框 | N
@@ -131,4 +132,4 @@ t-class-textarea | 多行文本框样式类
131132
--td-textarea-indicator-text-color | @text-color-placeholder | -
132133
--td-textarea-label-color | @text-color-primary | -
133134
--td-textarea-placeholder-color | @text-color-placeholder | -
134-
--td-textarea-text-color | @text-color-primary | -
135+
--td-textarea-text-color | @text-color-primary | -

src/textarea/__test__/__snapshots__/index.test.js.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ exports[`textarea slots : label 1`] = `
2828
confirmHold="{{false}}"
2929
confirmType="return"
3030
cursor="{{-1}}"
31+
cursorColor="#0052d9"
3132
cursorSpacing="{{0}}"
3233
disabled="{{null}}"
3334
disableDefaultPadding="{{false}}"

src/textarea/props.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ const props: TdTextareaProps = {
4646
type: Number,
4747
value: -1,
4848
},
49+
/** 【试验性】光标颜色,仅在 Skyline 下有效 */
50+
cursorColor: {
51+
type: String,
52+
value: '#0052d9',
53+
},
4954
/** 指定光标与键盘的距离。取textarea距离底部的距离和cursor-spacing指定的距离的最小值作为光标与键盘的距离 */
5055
cursorSpacing: {
5156
type: Number,

src/textarea/textarea.wxml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
focus="{{focus}}"
2626
cursor="{{cursor}}"
2727
cursor-spacing="{{cursorSpacing}}"
28+
cursor-color="{{cursorColor}}"
2829
adjust-position="{{adjustPosition}}"
2930
confirm-type="{{confirmType}}"
3031
confirm-hold="{{confirmHold}}"

src/textarea/type.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ export interface TdTextareaProps {
6969
type: NumberConstructor;
7070
value?: number;
7171
};
72+
/**
73+
* 【试验性】光标颜色,仅在 Skyline 下有效
74+
* @default #0052d9
75+
*/
76+
cursorColor?: {
77+
type: StringConstructor;
78+
value?: string;
79+
};
7280
/**
7381
* 指定光标与键盘的距离。取textarea距离底部的距离和cursor-spacing指定的距离的最小值作为光标与键盘的距离
7482
* @default 0

0 commit comments

Comments
 (0)