From 5730473eddf1547dfe4e22119f5f0bfa72344297 Mon Sep 17 00:00:00 2001 From: anotherso1a <1181581742@qq.com> Date: Wed, 20 Nov 2024 15:23:46 +0800 Subject: [PATCH] fix: adjust NumberInput styles & docs, fix Postscript maxLength's problem --- compiled/alipay/src/NumberInput/index.less | 9 --------- compiled/alipay/src/NumberInput/index.md | 15 +++++++-------- compiled/alipay/src/NumberInput/variable.less | 5 +---- compiled/alipay/src/Postscript/index.axml | 3 ++- compiled/alipay/src/Postscript/index.ts | 13 ++++++------- compiled/alipay/src/style/themes/theme-black.less | 1 - compiled/alipay/src/style/themes/theme-mode.less | 4 +--- compiled/alipay/src/style/variables.less | 3 +-- compiled/wechat/src/style/themes/theme-black.wxss | 3 +-- compiled/wechat/src/style/themes/theme-mode.wxss | 6 ++---- compiled/wechat/src/style/variables.wxss | 3 +-- src/NumberInput/index.less | 9 --------- src/NumberInput/index.md | 15 +++++++-------- src/NumberInput/variable.less | 5 +---- src/Postscript/index.axml | 3 ++- src/Postscript/index.ts | 13 ++++++------- src/style/themes/theme-black.less | 1 - src/style/themes/theme-mode.less | 4 +--- src/style/variables.less | 3 +-- 19 files changed, 40 insertions(+), 78 deletions(-) diff --git a/compiled/alipay/src/NumberInput/index.less b/compiled/alipay/src/NumberInput/index.less index 90d145619..fb099e0ab 100644 --- a/compiled/alipay/src/NumberInput/index.less +++ b/compiled/alipay/src/NumberInput/index.less @@ -59,7 +59,6 @@ .ant-input-content { height: 125rpx; font-size: @sizeFont14; - font-family: AlibabaSans102Ver2-Medium; line-height: 74rpx; caret-color: @number-input-caret-color; } @@ -88,13 +87,5 @@ } } } - - &-remaining { - display: flex; - align-items: baseline; - font-size: @sizeFont5; - gap: @h-spacing-standard; - color: @number-input-remaining-color; - } } diff --git a/compiled/alipay/src/NumberInput/index.md b/compiled/alipay/src/NumberInput/index.md index af2be11a4..1c02c0739 100644 --- a/compiled/alipay/src/NumberInput/index.md +++ b/compiled/alipay/src/NumberInput/index.md @@ -61,11 +61,10 @@ toc: 'content' | ------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------- | | --number-input-background-color |
#ffffff
|
#1a1a1a
| 背景颜色 | | --number-input-title-color |
#333333
|
#c5cad1
| 标题颜色 | -| --number-input-link-color |
#4b6b99
|
#3f5980
| 链接颜色 | -| --number-input-unit-color |
#999999
|
#616161
| 单位颜色 | -| --number-input-border-color |
#eeeeee
|
#2b2b2b
| 边框颜色 | -| --number-input-prefix-color |
#999999
|
#c5cad1
| 前缀颜色 | -| --number-input-caret-color |
#1677ff
|
#3086ff
| 插入符颜色 | -| --number-input-quick-text-color |
#1677ff
|
#3086ff
| 快捷文本颜色 | -| --number-input-quick-border-color|
#1677ff
|
#3086ff
| 快捷边框颜色 | -| --number-input-remaining-color |
#666666
|
#808080
| 剩余颜色 | +| --number-input-link-color |
#4b6b99
|
#3f5980
| 右上角链接颜色 | +| --number-input-unit-color |
#999999
|
#616161
| 输入框上方单位颜色 | +| --number-input-border-color |
#eeeeee
|
#2b2b2b
| 分割线颜色 | +| --number-input-prefix-color |
#333333
|
#c5cad1
| 羊角符颜色 | +| --number-input-caret-color |
#1677ff
|
#3086ff
| 光标颜色 | +| --number-input-quick-text-color |
#1677ff
|
#3086ff
| 快捷输入文本颜色 | +| --number-input-quick-border-color|
#1677ff
|
#3086ff
| 快捷输入边框颜色 | diff --git a/compiled/alipay/src/NumberInput/variable.less b/compiled/alipay/src/NumberInput/variable.less index 592be0cce..9bb4a6327 100644 --- a/compiled/alipay/src/NumberInput/variable.less +++ b/compiled/alipay/src/NumberInput/variable.less @@ -13,7 +13,7 @@ // 单位文字颜色 @number-input-unit-color: var(--number-input-unit-color, @COLOR_TEXT_ASSIST); -// 边框颜色 +// 分割线 @number-input-border-color: var(--number-input-border-color, @COLOR_BORDER); // 前缀文字颜色 @@ -27,6 +27,3 @@ // 快捷金额按钮边框颜色 @number-input-quick-border-color: var(--number-input-quick-border-color, @COLOR_BRAND1); - -// 剩余额度文字颜色 -@number-input-remaining-color: var(--number-input-remaining-color, @COLOR_TEXT_SECONDARY); diff --git a/compiled/alipay/src/Postscript/index.axml b/compiled/alipay/src/Postscript/index.axml index 4ed027f62..209a2a959 100644 --- a/compiled/alipay/src/Postscript/index.axml +++ b/compiled/alipay/src/Postscript/index.axml @@ -12,7 +12,8 @@ maxLength) { return value.slice(0, maxLength); } return value; }, handleInput(value) { - const result = this.checkMaxLength(value); - this.setData({ value: result }); - triggerEvent(this, 'change', result); + this.setData({ content: value }); + triggerEvent(this, 'change', value); }, handleQuickInput(e) { const { value } = e.currentTarget.dataset; const combineSymbol = getValueFromProps(this, 'combineSymbol'); const result = this.checkMaxLength(combineSymbol - ? `${this.data.value? `${this.data.value}${combineSymbol}` : ''}${value}` + ? `${this.data.content? `${this.data.content}${combineSymbol}` : ''}${value}` : value); - this.setData({ value: result }); + this.setData({ content: result }); triggerEvent(this, 'change', result); } }, { - value: '' + content: '' } ); diff --git a/compiled/alipay/src/style/themes/theme-black.less b/compiled/alipay/src/style/themes/theme-black.less index f563c6b14..9bd857167 100644 --- a/compiled/alipay/src/style/themes/theme-black.less +++ b/compiled/alipay/src/style/themes/theme-black.less @@ -492,7 +492,6 @@ page { --number-input-caret-color: #3086ff; --number-input-quick-text-color: #3086ff; --number-input-quick-border-color: #3086ff; - --number-input-remaining-color: #808080; // postScript --postscript-background-color: #1a1a1a; --postscript-title-color: #c5cad1; diff --git a/compiled/alipay/src/style/themes/theme-mode.less b/compiled/alipay/src/style/themes/theme-mode.less index 59c4c127b..2eb0fff64 100644 --- a/compiled/alipay/src/style/themes/theme-mode.less +++ b/compiled/alipay/src/style/themes/theme-mode.less @@ -510,11 +510,10 @@ --number-input-link-color:#4b6b99; --number-input-unit-color: #999999; --number-input-border-color: #eeeeee; - --number-input-prefix-color: #999999; + --number-input-prefix-color: #333333; --number-input-caret-color: #1677ff; --number-input-quick-text-color: #1677ff; --number-input-quick-border-color: #1677ff; - --number-input-remaining-color: #666666; // postScript --postscript-background-color: #ffffff; @@ -1026,7 +1025,6 @@ --number-input-caret-color: #3086ff; --number-input-quick-text-color: #3086ff; --number-input-quick-border-color: #3086ff; - --number-input-remaining-color: #808080; // postScript --postscript-background-color: #1a1a1a; diff --git a/compiled/alipay/src/style/variables.less b/compiled/alipay/src/style/variables.less index 59a06a6cd..f6b550957 100644 --- a/compiled/alipay/src/style/variables.less +++ b/compiled/alipay/src/style/variables.less @@ -516,11 +516,10 @@ page { --number-input-link-color:#4b6b99; --number-input-unit-color: #999999; --number-input-border-color: #eeeeee; - --number-input-prefix-color: #999999; + --number-input-prefix-color: #333333; --number-input-caret-color: #1677ff; --number-input-quick-text-color: #1677ff; --number-input-quick-border-color: #1677ff; - --number-input-remaining-color: #666666; // postScript --postscript-background-color: #ffffff; diff --git a/compiled/wechat/src/style/themes/theme-black.wxss b/compiled/wechat/src/style/themes/theme-black.wxss index 3e5d64aed..6c94dcaa2 100644 --- a/compiled/wechat/src/style/themes/theme-black.wxss +++ b/compiled/wechat/src/style/themes/theme-black.wxss @@ -129,7 +129,7 @@ page { --collapse-border-color: #2b2b2b; --collapse-node-text-color: #616161; --collapse-container-background-color: #1a1a1a; - --container-header-color: #2b2b2b; + --container-header-color: #c5cad1; --container-color-text-assist: #616161; --container-background-color: #1a1a1a; --divider-text-color: #c5cad1; @@ -366,7 +366,6 @@ page { --number-input-caret-color: #3086ff; --number-input-quick-text-color: #3086ff; --number-input-quick-border-color: #3086ff; - --number-input-remaining-color: #808080; --postscript-background-color: #1a1a1a; --postscript-title-color: #c5cad1; --postscript-input-color: #c5cad1; diff --git a/compiled/wechat/src/style/themes/theme-mode.wxss b/compiled/wechat/src/style/themes/theme-mode.wxss index 32c8de570..6f70f9145 100644 --- a/compiled/wechat/src/style/themes/theme-mode.wxss +++ b/compiled/wechat/src/style/themes/theme-mode.wxss @@ -388,11 +388,10 @@ --number-input-link-color: #4b6b99; --number-input-unit-color: #999999; --number-input-border-color: #eeeeee; - --number-input-prefix-color: #999999; + --number-input-prefix-color: #333333; --number-input-caret-color: #1677ff; --number-input-quick-text-color: #1677ff; --number-input-quick-border-color: #1677ff; - --number-input-remaining-color: #666666; --postscript-background-color: #ffffff; --postscript-title-color: #333; --postscript-input-color: #333; @@ -537,7 +536,7 @@ --collapse-border-color: #2b2b2b; --collapse-node-text-color: #616161; --collapse-container-background-color: #1a1a1a; - --container-header-color: #2b2b2b; + --container-header-color: #c5cad1; --container-color-text-assist: #616161; --container-background-color: #1a1a1a; --divider-text-color: #c5cad1; @@ -779,7 +778,6 @@ --number-input-caret-color: #3086ff; --number-input-quick-text-color: #3086ff; --number-input-quick-border-color: #3086ff; - --number-input-remaining-color: #808080; --postscript-background-color: #1a1a1a; --postscript-title-color: #c5cad1; --postscript-input-color: #c5cad1; diff --git a/compiled/wechat/src/style/variables.wxss b/compiled/wechat/src/style/variables.wxss index 47534e05d..ab1f72d63 100644 --- a/compiled/wechat/src/style/variables.wxss +++ b/compiled/wechat/src/style/variables.wxss @@ -386,11 +386,10 @@ page { --number-input-link-color: #4b6b99; --number-input-unit-color: #999999; --number-input-border-color: #eeeeee; - --number-input-prefix-color: #999999; + --number-input-prefix-color: #333333; --number-input-caret-color: #1677ff; --number-input-quick-text-color: #1677ff; --number-input-quick-border-color: #1677ff; - --number-input-remaining-color: #666666; --postscript-background-color: #ffffff; --postscript-title-color: #333; --postscript-input-color: #333; diff --git a/src/NumberInput/index.less b/src/NumberInput/index.less index 90d145619..fb099e0ab 100644 --- a/src/NumberInput/index.less +++ b/src/NumberInput/index.less @@ -59,7 +59,6 @@ .ant-input-content { height: 125rpx; font-size: @sizeFont14; - font-family: AlibabaSans102Ver2-Medium; line-height: 74rpx; caret-color: @number-input-caret-color; } @@ -88,13 +87,5 @@ } } } - - &-remaining { - display: flex; - align-items: baseline; - font-size: @sizeFont5; - gap: @h-spacing-standard; - color: @number-input-remaining-color; - } } diff --git a/src/NumberInput/index.md b/src/NumberInput/index.md index e57ccaf1b..e383f63f6 100644 --- a/src/NumberInput/index.md +++ b/src/NumberInput/index.md @@ -61,11 +61,10 @@ toc: 'content' | ------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------- | | --number-input-background-color |
#ffffff
|
#1a1a1a
| 背景颜色 | | --number-input-title-color |
#333333
|
#c5cad1
| 标题颜色 | -| --number-input-link-color |
#4b6b99
|
#3f5980
| 链接颜色 | -| --number-input-unit-color |
#999999
|
#616161
| 单位颜色 | -| --number-input-border-color |
#eeeeee
|
#2b2b2b
| 边框颜色 | -| --number-input-prefix-color |
#999999
|
#c5cad1
| 前缀颜色 | -| --number-input-caret-color |
#1677ff
|
#3086ff
| 插入符颜色 | -| --number-input-quick-text-color |
#1677ff
|
#3086ff
| 快捷文本颜色 | -| --number-input-quick-border-color|
#1677ff
|
#3086ff
| 快捷边框颜色 | -| --number-input-remaining-color |
#666666
|
#808080
| 剩余颜色 | +| --number-input-link-color |
#4b6b99
|
#3f5980
| 右上角链接颜色 | +| --number-input-unit-color |
#999999
|
#616161
| 输入框上方单位颜色 | +| --number-input-border-color |
#eeeeee
|
#2b2b2b
| 分割线颜色 | +| --number-input-prefix-color |
#333333
|
#c5cad1
| 羊角符颜色 | +| --number-input-caret-color |
#1677ff
|
#3086ff
| 光标颜色 | +| --number-input-quick-text-color |
#1677ff
|
#3086ff
| 快捷输入文本颜色 | +| --number-input-quick-border-color|
#1677ff
|
#3086ff
| 快捷输入边框颜色 | diff --git a/src/NumberInput/variable.less b/src/NumberInput/variable.less index 592be0cce..9bb4a6327 100644 --- a/src/NumberInput/variable.less +++ b/src/NumberInput/variable.less @@ -13,7 +13,7 @@ // 单位文字颜色 @number-input-unit-color: var(--number-input-unit-color, @COLOR_TEXT_ASSIST); -// 边框颜色 +// 分割线 @number-input-border-color: var(--number-input-border-color, @COLOR_BORDER); // 前缀文字颜色 @@ -27,6 +27,3 @@ // 快捷金额按钮边框颜色 @number-input-quick-border-color: var(--number-input-quick-border-color, @COLOR_BRAND1); - -// 剩余额度文字颜色 -@number-input-remaining-color: var(--number-input-remaining-color, @COLOR_TEXT_SECONDARY); diff --git a/src/Postscript/index.axml b/src/Postscript/index.axml index e6e5eb24d..22773ca0f 100644 --- a/src/Postscript/index.axml +++ b/src/Postscript/index.axml @@ -7,7 +7,8 @@ maxLength) { return value.slice(0, maxLength); } return value; }, handleInput(value) { - const result = this.checkMaxLength(value); - this.setData({ value: result }); - triggerEvent(this, 'change', result); + this.setData({ content: value }); + triggerEvent(this, 'change', value); }, handleQuickInput(e) { const { value } = e.currentTarget.dataset; const combineSymbol = getValueFromProps(this, 'combineSymbol'); const result = this.checkMaxLength(combineSymbol - ? `${this.data.value? `${this.data.value}${combineSymbol}` : ''}${value}` + ? `${this.data.content? `${this.data.content}${combineSymbol}` : ''}${value}` : value); - this.setData({ value: result }); + this.setData({ content: result }); triggerEvent(this, 'change', result); } }, { - value: '' + content: '' } ); diff --git a/src/style/themes/theme-black.less b/src/style/themes/theme-black.less index f563c6b14..9bd857167 100644 --- a/src/style/themes/theme-black.less +++ b/src/style/themes/theme-black.less @@ -492,7 +492,6 @@ page { --number-input-caret-color: #3086ff; --number-input-quick-text-color: #3086ff; --number-input-quick-border-color: #3086ff; - --number-input-remaining-color: #808080; // postScript --postscript-background-color: #1a1a1a; --postscript-title-color: #c5cad1; diff --git a/src/style/themes/theme-mode.less b/src/style/themes/theme-mode.less index 59c4c127b..2eb0fff64 100644 --- a/src/style/themes/theme-mode.less +++ b/src/style/themes/theme-mode.less @@ -510,11 +510,10 @@ --number-input-link-color:#4b6b99; --number-input-unit-color: #999999; --number-input-border-color: #eeeeee; - --number-input-prefix-color: #999999; + --number-input-prefix-color: #333333; --number-input-caret-color: #1677ff; --number-input-quick-text-color: #1677ff; --number-input-quick-border-color: #1677ff; - --number-input-remaining-color: #666666; // postScript --postscript-background-color: #ffffff; @@ -1026,7 +1025,6 @@ --number-input-caret-color: #3086ff; --number-input-quick-text-color: #3086ff; --number-input-quick-border-color: #3086ff; - --number-input-remaining-color: #808080; // postScript --postscript-background-color: #1a1a1a; diff --git a/src/style/variables.less b/src/style/variables.less index 59a06a6cd..f6b550957 100644 --- a/src/style/variables.less +++ b/src/style/variables.less @@ -516,11 +516,10 @@ page { --number-input-link-color:#4b6b99; --number-input-unit-color: #999999; --number-input-border-color: #eeeeee; - --number-input-prefix-color: #999999; + --number-input-prefix-color: #333333; --number-input-caret-color: #1677ff; --number-input-quick-text-color: #1677ff; --number-input-quick-border-color: #1677ff; - --number-input-remaining-color: #666666; // postScript --postscript-background-color: #ffffff;