Skip to content

Commit f3ddd5b

Browse files
committed
fix: 合并3.0
2 parents ddc9568 + 301a9e0 commit f3ddd5b

File tree

10 files changed

+68
-31
lines changed

10 files changed

+68
-31
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"dependencies": {
105105
"@babel/runtime": "^7.23.9",
106106
"@nutui/icons-react": "^1.0.5",
107-
"@nutui/icons-react-taro": "^2.0.0-beta.0",
107+
"@nutui/icons-react-taro": "^2.0.0-beta.2",
108108
"@nutui/jdesign-icons-react-taro": "1.0.6-beta.2",
109109
"@nutui/touch-emulator": "^1.0.0",
110110
"@react-spring/web": "~9.6.1",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/packages/input/input.harmony.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@
4343
background: none;
4444
opacity: 1;
4545
-webkit-text-fill-color: #c2c4cc;
46+
}
47+
48+
.nut-input-clear {
49+
flex: 0;
4650
}

src/packages/inputnumber/doc.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ The component provides the following CSS variables, which can be used to customi
147147
| \--nutui-inputnumber-input-border | The border value of the input in the number input box | `0` |
148148
| \--nutui-inputnumber-input-border-radius | The rounded corners of the input in the number input box | `6px` |
149149
| \--nutui-inputnumber-input-margin | The rounded corners of the input in the number input box | `0` |
150-
| \--nutui-inputnumber-button-width | The width of the left and right buttons of the number input box | `16px` |
150+
| \--nutui-inputnumber-button-width | The width of the left and right buttons of the number input box | `14px` |
151151
| \--nutui-inputnumber-button-height | The height of the left and right buttons of the number input box | `16px` |
152152
| \--nutui-inputnumber-button-border-radius | The rounded corners of the left and right buttons of the number input box | `30px` |
153153
| \--nutui-inputnumber-button-background-color | The background color of the left and right buttons of the number input box | `transparent` |

src/packages/inputnumber/doc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ import { InputNumber } from '@nutui/nutui-react'
147147
| \--nutui-inputnumber-input-border | 数字输入框中input的border值 | `0` |
148148
| \--nutui-inputnumber-input-border-radius | 数字输入框中input的圆角 | `6px` |
149149
| \--nutui-inputnumber-input-margin | 数字输入框中input的margin值 | `0` |
150-
| \--nutui-inputnumber-button-width | 数字输入框左右按钮的宽度 | `16px` |
150+
| \--nutui-inputnumber-button-width | 数字输入框左右按钮的宽度 | `14px` |
151151
| \--nutui-inputnumber-button-height | 数字输入框左右按钮的高度 | `16px` |
152152
| \--nutui-inputnumber-button-border-radius | 数字输入框左右按钮的圆角 | `30px` |
153153
| \--nutui-inputnumber-button-background-color | 数字输入框左右按钮的背景色 | `transparent` |

src/packages/inputnumber/doc.taro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ import { InputNumber } from '@nutui/nutui-react-taro'
139139
| \--nutui-inputnumber-input-border | 数字输入框中input的border值 | `0` |
140140
| \--nutui-inputnumber-input-border-radius | 数字输入框中input的圆角 | `6px` |
141141
| \--nutui-inputnumber-input-margin | 数字输入框中input的margin值 | `0` |
142-
| \--nutui-inputnumber-button-width | 数字输入框左右按钮的宽度 | `16px` |
142+
| \--nutui-inputnumber-button-width | 数字输入框左右按钮的宽度 | `14px` |
143143
| \--nutui-inputnumber-button-height | 数字输入框左右按钮的高度 | `16px` |
144144
| \--nutui-inputnumber-button-border-radius | 数字输入框左右按钮的圆角 | `30px` |
145145
| \--nutui-inputnumber-button-background-color | 数字输入框左右按钮的背景色 | `transparent` |

src/packages/inputnumber/doc.zh-TW.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ import { InputNumber } from '@nutui/nutui-react'
138138
| \--nutui-inputnumber-input-border | 數字輸入框中input的border值 | `0` |
139139
| \--nutui-inputnumber-input-border-radius | 數字輸入框中input的圓角 | `6px` |
140140
| \--nutui-inputnumber-input-margin | 數字輸入框中input的margin值 | `0` |
141-
| \--nutui-inputnumber-button-width | 數字輸入框左右按鈕的寬度 | `16px` |
141+
| \--nutui-inputnumber-button-width | 數字輸入框左右按鈕的寬度 | `14px` |
142142
| \--nutui-inputnumber-button-height | 數字輸入框左右按鈕的高度 | `16px` |
143143
| \--nutui-inputnumber-button-border-radius | 數字輸入框左右按鈕的圓角 | `30px` |
144144
| \--nutui-inputnumber-button-background-color | 數字輸入框左右按鈕的背景色 | `transparent` |

src/packages/inputnumber/inputnumber.harmony.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
display: flex;
88
justify-content: center;
99
align-items: center;
10-
width: 16px;
10+
width: 14px;
1111
height: 24px;
1212
background-color: transparent;
1313
border-radius: 16px;
@@ -16,7 +16,7 @@
1616
display: flex;
1717
justify-content: center;
1818
align-items: center;
19-
width: 16px;
19+
width: 14px;
2020
height: 24px;
2121
background-color: transparent;
2222
border-radius: 16px;

src/packages/inputnumber/inputnumber.taro.tsx

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ import {
1111
Input as TaroInput,
1212
InputProps,
1313
View,
14+
Text,
1415
} from '@tarojs/components'
1516
import { Minus, Plus } from '@nutui/icons-react-taro'
1617
import { usePropsValue } from '@/utils/use-props-value'
1718
import { BasicComponent, ComponentDefaults } from '@/utils/typings'
18-
import { harmonyAndRn } from '@/utils/platform-taro'
19+
import { harmony, harmonyAndRn, rn } from '@/utils/platform-taro'
1920

2021
export interface InputNumberProps extends BasicComponent {
2122
value: number | string
@@ -90,6 +91,8 @@ export const InputNumber: FunctionComponent<
9091
...props,
9192
}
9293
const isRnAndHarmony = harmonyAndRn()
94+
const isRn = rn()
95+
const isHarmony = harmony()
9396
const classes = classNames(classPrefix, className)
9497
const [focused, setFocused] = useState(false)
9598
const inputRef = useRef<HTMLInputElement>(null)
@@ -250,16 +253,31 @@ export const InputNumber: FunctionComponent<
250253
return (
251254
<View className={classes} style={style}>
252255
<View className={`${classPrefix}-minus`} onClick={handleReduce}>
253-
<Minus
254-
className={classNames(
255-
`${classPrefix}-icon ${classPrefix}-icon-minus`,
256-
{
257-
[`${classPrefix}-icon-disabled`]: shadowValue === min || disabled,
258-
}
259-
)}
260-
/>
256+
{isRnAndHarmony ? (
257+
<Text
258+
className={classNames(
259+
`${classPrefix}-icon ${classPrefix}-icon-minus`,
260+
{
261+
[`${classPrefix}-icon-disabled`]:
262+
shadowValue === min || disabled,
263+
}
264+
)}
265+
>
266+
-
267+
</Text>
268+
) : (
269+
<Minus
270+
className={classNames(
271+
`${classPrefix}-icon ${classPrefix}-icon-minus`,
272+
{
273+
[`${classPrefix}-icon-disabled`]:
274+
shadowValue === min || disabled,
275+
}
276+
)}
277+
/>
278+
)}
261279
</View>
262-
{isRnAndHarmony ? (
280+
{isRn ? (
263281
<TaroInput
264282
className={classNames(`${classPrefix}-input`, {
265283
[`${classPrefix}-input-disabled`]: disabled,
@@ -290,14 +308,29 @@ export const InputNumber: FunctionComponent<
290308
)}
291309

292310
<View className={`${classPrefix}-add`} onClick={handlePlus}>
293-
<Plus
294-
className={classNames(
295-
`${classPrefix}-icon ${classPrefix}-icon-plus`,
296-
{
297-
[`${classPrefix}-icon-disabled`]: shadowValue === max || disabled,
298-
}
299-
)}
300-
/>
311+
{isRnAndHarmony ? (
312+
<Text
313+
className={classNames(
314+
`${classPrefix}-icon ${classPrefix}-icon-plus`,
315+
{
316+
[`${classPrefix}-icon-disabled`]:
317+
shadowValue === max || disabled,
318+
}
319+
)}
320+
>
321+
+
322+
</Text>
323+
) : (
324+
<Plus
325+
className={classNames(
326+
`${classPrefix}-icon ${classPrefix}-icon-plus`,
327+
{
328+
[`${classPrefix}-icon-disabled`]:
329+
shadowValue === max || disabled,
330+
}
331+
)}
332+
/>
333+
)}
301334
</View>
302335
</View>
303336
)

src/styles/variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ $inputnumber-input-border-radius: var(
629629
6px
630630
) !default;
631631
$inputnumber-input-margin: var(--nutui-inputnumber-input-margin, 0) !default;
632-
$inputnumber-button-width: var(--nutui-inputnumber-button-width, 16px) !default;
632+
$inputnumber-button-width: var(--nutui-inputnumber-button-width, 14px) !default;
633633
$inputnumber-button-height: var(
634634
--nutui-inputnumber-button-height,
635635
24px

0 commit comments

Comments
 (0)