Skip to content

Commit 4ce76fa

Browse files
committed
feat(Textarea): support placeholderClass props
1 parent d104db4 commit 4ce76fa

File tree

10 files changed

+25
-10
lines changed

10 files changed

+25
-10
lines changed

src/input/README.en-US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ clearable | Boolean / Object | false | show clear icon, clicked to clear input v
1818
confirm-hold | Boolean | false | \- | N
1919
confirm-type | String | done | options: send/search/next/go/done | N
2020
cursor | Number | - | required | Y
21-
cursor-color | String | - | \- | N
21+
cursor-color | String | #0052d9 | \- | N
2222
cursor-spacing | Number | 0 | \- | N
2323
disabled | Boolean | undefined | make input to be disabled | N
2424
error-message | String | - | `deprecated` | N
@@ -107,4 +107,4 @@ Name | Default Value | Description
107107
--td-input-suffix-text-color | @text-color-primary | -
108108
--td-input-vertical-padding | 32rpx | -
109109
--td-input-warning-text-color | @warning-color | -
110-
--td-input-warning-tips-color | @warning-color | -
110+
--td-input-warning-tips-color | @warning-color | -

src/input/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ validate | `(detail: { error?: 'exceed-maximum' \| 'below-minimum' })` | 字数
151151
-- | --
152152
t-class | 根节点样式类
153153
t-class-clearable | 清空按钮样式类
154-
t-class-input | 标题样式类
154+
t-class-input | 输入框样式类
155155
t-class-label | 标签样式类
156156
t-class-prefix-icon | 前置图标样式类
157157
t-class-suffix | 后置样式类
@@ -186,4 +186,4 @@ t-class-tips | 提示样式类
186186
--td-input-suffix-text-color | @text-color-primary | -
187187
--td-input-vertical-padding | 32rpx | -
188188
--td-input-warning-text-color | @warning-color | -
189-
--td-input-warning-tips-color | @warning-color | -
189+
--td-input-warning-tips-color | @warning-color | -

src/input/props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const props: TdInputProps = {
3636
type: String,
3737
value: 'always',
3838
},
39-
/** 是否可清空,默认不启动。值为 `true` 表示使用默认清除空按钮,值为 `Object` 表示透传至 `icon` */
39+
/** 是否可清空,默认不启动。值为 `true` 表示使用默认清空按钮,值为 `Object` 表示透传至 `icon` */
4040
clearable: {
4141
type: null,
4242
value: false,

src/input/type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export interface TdInputProps {
5454
value?: 'always' | 'focus';
5555
};
5656
/**
57-
* 是否可清空,默认不启动。值为 `true` 表示使用默认清除空按钮,值为 `Object` 表示透传至 `icon`
57+
* 是否可清空,默认不启动。值为 `true` 表示使用默认清空按钮,值为 `Object` 表示透传至 `icon`
5858
* @default false
5959
*/
6060
clearable?: {
@@ -87,7 +87,7 @@ export interface TdInputProps {
8787
};
8888
/**
8989
* 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制
90-
* @default ''
90+
* @default #0052d9
9191
*/
9292
cursorColor?: {
9393
type: StringConstructor;

src/textarea/README.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ label | String / Slot | - | [see more ts definition](https://github.com/Tencent/
2626
maxcharacter | Number | - | \- | N
2727
maxlength | Number | -1 | \- | N
2828
placeholder | String | undefined | \- | N
29+
placeholder-class | String | textarea-placeholder | \- | N
2930
placeholder-style | String | - | \- | N
3031
selection-end | Number | -1 | \- | N
3132
selection-start | Number | -1 | \- | N

src/textarea/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ label | String / Slot | - | 左侧文本。[通用类型定义](https://github.c
8989
maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度 | N
9090
maxlength | Number | -1 | 用户最多可以输入的字符个数,值为 -1 的时候不限制最大长度 | N
9191
placeholder | String | undefined | 占位符 | N
92+
placeholder-class | String | textarea-placeholder | 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight | N
9293
placeholder-style | String | - | 指定 placeholder 的样式,目前仅支持 color ,font-size和font-weight | N
9394
selection-end | Number | -1 | 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 | N
9495
selection-start | Number | -1 | 光标起始位置,自动聚集时有效,需与 selection-end 搭配使用 | N
@@ -114,7 +115,7 @@ line-change | `(value: TextareaValue)` | 行高发生变化时触发
114115
t-class | 根节点样式类
115116
t-class-indicator | 计数器样式类
116117
t-class-label | 左侧文本样式类
117-
t-class-textarea | 占位符样式类
118+
t-class-textarea | 多行文本框样式类
118119

119120
### CSS Variables
120121

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ exports[`textarea slots : label 1`] = `
3636
holdKeyboard="{{false}}"
3737
maxlength="{{-1}}"
3838
placeholder=""
39-
placeholderClass="t-textarea__placeholder"
39+
placeholderClass="t-textarea__placeholder textarea-placeholder"
4040
placeholderStyle=""
4141
selectionEnd="{{-1}}"
4242
selectionStart="{{-1}}"

src/textarea/props.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ const props: TdTextareaProps = {
9494
type: String,
9595
value: undefined,
9696
},
97+
/** 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight */
98+
placeholderClass: {
99+
type: String,
100+
value: 'textarea-placeholder',
101+
},
97102
/** 指定 placeholder 的样式,目前仅支持 color ,font-size和font-weight */
98103
placeholderStyle: {
99104
type: String,

src/textarea/textarea.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
maxlength="{{maxlength}}"
1717
disabled="{{disabled}}"
1818
placeholder="{{placeholder}}"
19-
placeholder-class="{{classPrefix}}__placeholder"
19+
placeholder-class="{{classPrefix}}__placeholder {{placeholderClass}}"
2020
placeholder-style="{{placeholderStyle}}"
2121
value="{{value}}"
2222
auto-height="{{!!autosize}}"

src/textarea/type.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ export interface TdTextareaProps {
145145
type: StringConstructor;
146146
value?: string;
147147
};
148+
/**
149+
* 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight
150+
* @default textarea-placeholder
151+
*/
152+
placeholderClass?: {
153+
type: StringConstructor;
154+
value?: string;
155+
};
148156
/**
149157
* 指定 placeholder 的样式,目前仅支持 color ,font-size和font-weight
150158
* @default ''

0 commit comments

Comments
 (0)