Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Input): resolved t-class-label invalid #2259

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/input/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Name | Default Value | Description
--td-input-disabled-text-color | @text-color-disabled | -
--td-input-error-text-color | @error-color | -
--td-input-error-tips-color | @error-color | -
--td-input-label-max-width | 5em | -
--td-input-label-min-width | 2em | -
--td-input-label-text-color | @font-gray-1 | -
--td-input-placeholder-text-color | @text-color-placeholder | -
--td-input-prefix-icon-color | @font-gray-1 | -
Expand Down
2 changes: 2 additions & 0 deletions src/input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ t-class-tips | 提示样式类
--td-input-disabled-text-color | @text-color-disabled | -
--td-input-error-text-color | @error-color | -
--td-input-error-tips-color | @error-color | -
--td-input-label-max-width | 5em | -
--td-input-label-min-width | 2em | -
--td-input-label-text-color | @font-gray-1 | -
--td-input-placeholder-text-color | @text-color-placeholder | -
--td-input-prefix-icon-color | @font-gray-1 | -
Expand Down
10 changes: 3 additions & 7 deletions src/input/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ exports[`input props : clearable && label && suffix 1`] = `
/>
<wx-view
ariaHidden="{{true}}"
class="t-input__label"
class="t-input__label t-class-label"
>
<wx-text
class="t-class-label"
>
tdesign
</wx-text>
tdesign
</wx-view>
</wx-view>
<wx-view
Expand Down Expand Up @@ -146,7 +142,7 @@ exports[`input slots : label 1`] = `
/>
<wx-view
ariaHidden="{{true}}"
class="t-input__label"
class="t-input__label t-class-label"
>
<wx-text
slot="label"
Expand Down
6 changes: 4 additions & 2 deletions src/input/input.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
@input-prefix-icon-color: var(--td-input-prefix-icon-color, @font-gray-1); // // 输入框前缀图标颜色
@input-suffix-icon-color: var(--td-input-suffix-icon-color, @font-gray-3); // 输入框后缀图标颜色
@input-label-text-color: var(--td-input-label-text-color, @font-gray-1); // 左侧文本颜色
@input-label-min-width: var(--td-input-label-min-width, 2em);
@input-label-max-width: var(--td-input-label-max-width, 5em);
@input-suffix-text-color: var(--td-input-suffix-text-color, @font-gray-1); // 后置图标前的后置内容文本颜色
@input-disabled-text-color: var(--td-input-disabled-text-color, @text-color-disabled); // 输入框禁用态文本颜色
@input-border-radius: var(--td-input-border-radius, @radius-default); // 边框圆角大小
Expand Down Expand Up @@ -55,8 +57,8 @@
}

&__label:not(:empty) {
min-width: 2em;
max-width: 5em;
min-width: @input-label-min-width;
max-width: @input-label-max-width;
font-size: @font-size-m;
line-height: 48rpx;
color: @input-label-text-color;
Expand Down
4 changes: 2 additions & 2 deletions src/input/input.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
data="{{tClass: prefix + '-class-prefix-icon', ariaHidden: true, ..._prefixIcon}}"
/>
</view>
<view class="{{classPrefix}}__label" aria-hidden>
<view class="{{classPrefix}}__label {{prefix}}-class-label" aria-hidden>
<slot name="label" />
<text wx:if="{{label}}" class="{{prefix}}-class-label">{{label}}</text>
<block wx:if="{{label}}">{{label}}</block>
</view>
</view>

Expand Down
Loading