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 tips color #1663

Merged
merged 11 commits into from
Sep 14, 2022
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: 1 addition & 1 deletion src/_common
28 changes: 14 additions & 14 deletions src/input-number/__tests__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports[`InputNumber > :props > :defaultValue, default value 6 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -103,7 +103,7 @@ exports[`InputNumber > :props > :disabled, function can not be call 1`] = `
unselectable="off"
>
<div
class="t-input t-is-disabled t-align-center"
class="t-input t-is-disabled t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -177,7 +177,7 @@ exports[`InputNumber > :props > :format, with 6% 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -249,7 +249,7 @@ exports[`InputNumber > :props > :max, value 6 < max 10 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -465,7 +465,7 @@ exports[`InputNumber > :props > :min, value 6 > min 1 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -537,7 +537,7 @@ exports[`InputNumber > :props > :mode, without class t-is-controls-right 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -609,7 +609,7 @@ exports[`InputNumber > :props > :mode:column, with class t-is-controls-right 1`]
unselectable="off"
>
<div
class="t-input"
class="t-input t-is-default"
>
<!---->
<!---->
Expand Down Expand Up @@ -681,7 +681,7 @@ exports[`InputNumber > :props > :mode:row, without class t-is-controls-right 1`]
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -753,7 +753,7 @@ exports[`InputNumber > :props > :size:large, with class t-size-l 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -825,7 +825,7 @@ exports[`InputNumber > :props > :size:medium, with class t-size-m 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -897,7 +897,7 @@ exports[`InputNumber > :props > :size:small, with class t-size-s 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -969,7 +969,7 @@ exports[`InputNumber > :props > :step, 2 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -1041,7 +1041,7 @@ exports[`InputNumber > :props > :value, 6 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down Expand Up @@ -1113,7 +1113,7 @@ exports[`InputNumber > :props > class, with class t-input-number 1`] = `
unselectable="off"
>
<div
class="t-input t-align-center"
class="t-input t-is-default t-align-center"
>
<!---->
<!---->
Expand Down
12 changes: 6 additions & 6 deletions src/input/__tests__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`Input > $attrs > input attrs should pass to input element 1`] = `
maxlength="20"
>
<div
class="t-input t-input--suffix"
class="t-input t-is-default t-input--suffix"
>
<!---->
<!---->
Expand Down Expand Up @@ -51,7 +51,7 @@ exports[`Input > :props > :disabled 1`] = `
class="t-input__wrap"
>
<div
class="t-input t-is-disabled"
class="t-input t-is-disabled t-is-default"
>
<!---->
<!---->
Expand All @@ -75,7 +75,7 @@ exports[`Input > :props > :prefix-icon 1`] = `
class="t-input__wrap"
>
<div
class="t-input t-input--prefix"
class="t-input t-is-default t-input--prefix"
>
<span
class="t-input__prefix t-input__prefix-icon"
Expand Down Expand Up @@ -104,7 +104,7 @@ exports[`Input > :props > :readonly 1`] = `
class="t-input__wrap"
>
<div
class="t-input t-is-readonly"
class="t-input t-is-default t-is-readonly"
>
<!---->
<!---->
Expand All @@ -129,7 +129,7 @@ exports[`Input > :props > :size 1`] = `
class="t-input__wrap"
>
<div
class="t-input t-size-l"
class="t-input t-size-l t-is-default"
>
<!---->
<!---->
Expand All @@ -152,7 +152,7 @@ exports[`Input > :props > :suffix-icon 1`] = `
class="t-input__wrap"
>
<div
class="t-input t-input--suffix"
class="t-input t-is-default t-input--suffix"
>
<!---->
<!---->
Expand Down
4 changes: 1 addition & 3 deletions src/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@ export default defineComponent({
) : null}
</div>
{tips && (
<div class={`${INPUT_TIPS_CLASS.value} ${classPrefix.value}-input__tips--${props.status || 'normal'}`}>
{tips}
</div>
<div class={`${INPUT_TIPS_CLASS.value} ${classPrefix.value}-input__tips--${props.status}`}>{tips}</div>
)}
</div>
);
Expand Down
1 change: 1 addition & 0 deletions src/input/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default {
/** 输入框状态 */
status: {
type: String as PropType<TdInputProps['status']>,
default: 'default' as TdInputProps['status'],
validator(val: TdInputProps['status']): boolean {
if (!val) return true;
return ['default', 'success', 'warning', 'error'].includes(val);
Expand Down
Loading