Skip to content

Commit

Permalink
fix: 合并3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
irisSong committed Nov 10, 2024
2 parents ddc9568 + 301a9e0 commit f3ddd5b
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"dependencies": {
"@babel/runtime": "^7.23.9",
"@nutui/icons-react": "^1.0.5",
"@nutui/icons-react-taro": "^2.0.0-beta.0",
"@nutui/icons-react-taro": "^2.0.0-beta.2",
"@nutui/jdesign-icons-react-taro": "1.0.6-beta.2",
"@nutui/touch-emulator": "^1.0.0",
"@react-spring/web": "~9.6.1",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/packages/input/input.harmony.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@
background: none;
opacity: 1;
-webkit-text-fill-color: #c2c4cc;
}

.nut-input-clear {
flex: 0;
}
2 changes: 1 addition & 1 deletion src/packages/inputnumber/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ The component provides the following CSS variables, which can be used to customi
| \--nutui-inputnumber-input-border | The border value of the input in the number input box | `0` |
| \--nutui-inputnumber-input-border-radius | The rounded corners of the input in the number input box | `6px` |
| \--nutui-inputnumber-input-margin | The rounded corners of the input in the number input box | `0` |
| \--nutui-inputnumber-button-width | The width of the left and right buttons of the number input box | `16px` |
| \--nutui-inputnumber-button-width | The width of the left and right buttons of the number input box | `14px` |
| \--nutui-inputnumber-button-height | The height of the left and right buttons of the number input box | `16px` |
| \--nutui-inputnumber-button-border-radius | The rounded corners of the left and right buttons of the number input box | `30px` |
| \--nutui-inputnumber-button-background-color | The background color of the left and right buttons of the number input box | `transparent` |
Expand Down
2 changes: 1 addition & 1 deletion src/packages/inputnumber/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ import { InputNumber } from '@nutui/nutui-react'
| \--nutui-inputnumber-input-border | 数字输入框中input的border值 | `0` |
| \--nutui-inputnumber-input-border-radius | 数字输入框中input的圆角 | `6px` |
| \--nutui-inputnumber-input-margin | 数字输入框中input的margin值 | `0` |
| \--nutui-inputnumber-button-width | 数字输入框左右按钮的宽度 | `16px` |
| \--nutui-inputnumber-button-width | 数字输入框左右按钮的宽度 | `14px` |
| \--nutui-inputnumber-button-height | 数字输入框左右按钮的高度 | `16px` |
| \--nutui-inputnumber-button-border-radius | 数字输入框左右按钮的圆角 | `30px` |
| \--nutui-inputnumber-button-background-color | 数字输入框左右按钮的背景色 | `transparent` |
Expand Down
2 changes: 1 addition & 1 deletion src/packages/inputnumber/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ import { InputNumber } from '@nutui/nutui-react-taro'
| \--nutui-inputnumber-input-border | 数字输入框中input的border值 | `0` |
| \--nutui-inputnumber-input-border-radius | 数字输入框中input的圆角 | `6px` |
| \--nutui-inputnumber-input-margin | 数字输入框中input的margin值 | `0` |
| \--nutui-inputnumber-button-width | 数字输入框左右按钮的宽度 | `16px` |
| \--nutui-inputnumber-button-width | 数字输入框左右按钮的宽度 | `14px` |
| \--nutui-inputnumber-button-height | 数字输入框左右按钮的高度 | `16px` |
| \--nutui-inputnumber-button-border-radius | 数字输入框左右按钮的圆角 | `30px` |
| \--nutui-inputnumber-button-background-color | 数字输入框左右按钮的背景色 | `transparent` |
Expand Down
2 changes: 1 addition & 1 deletion src/packages/inputnumber/doc.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ import { InputNumber } from '@nutui/nutui-react'
| \--nutui-inputnumber-input-border | 數字輸入框中input的border值 | `0` |
| \--nutui-inputnumber-input-border-radius | 數字輸入框中input的圓角 | `6px` |
| \--nutui-inputnumber-input-margin | 數字輸入框中input的margin值 | `0` |
| \--nutui-inputnumber-button-width | 數字輸入框左右按鈕的寬度 | `16px` |
| \--nutui-inputnumber-button-width | 數字輸入框左右按鈕的寬度 | `14px` |
| \--nutui-inputnumber-button-height | 數字輸入框左右按鈕的高度 | `16px` |
| \--nutui-inputnumber-button-border-radius | 數字輸入框左右按鈕的圓角 | `30px` |
| \--nutui-inputnumber-button-background-color | 數字輸入框左右按鈕的背景色 | `transparent` |
Expand Down
4 changes: 2 additions & 2 deletions src/packages/inputnumber/inputnumber.harmony.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
display: flex;
justify-content: center;
align-items: center;
width: 16px;
width: 14px;
height: 24px;
background-color: transparent;
border-radius: 16px;
Expand All @@ -16,7 +16,7 @@
display: flex;
justify-content: center;
align-items: center;
width: 16px;
width: 14px;
height: 24px;
background-color: transparent;
border-radius: 16px;
Expand Down
69 changes: 51 additions & 18 deletions src/packages/inputnumber/inputnumber.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import {
Input as TaroInput,
InputProps,
View,
Text,
} from '@tarojs/components'
import { Minus, Plus } from '@nutui/icons-react-taro'
import { usePropsValue } from '@/utils/use-props-value'
import { BasicComponent, ComponentDefaults } from '@/utils/typings'
import { harmonyAndRn } from '@/utils/platform-taro'
import { harmony, harmonyAndRn, rn } from '@/utils/platform-taro'

export interface InputNumberProps extends BasicComponent {
value: number | string
Expand Down Expand Up @@ -90,6 +91,8 @@ export const InputNumber: FunctionComponent<
...props,
}
const isRnAndHarmony = harmonyAndRn()
const isRn = rn()
const isHarmony = harmony()
const classes = classNames(classPrefix, className)
const [focused, setFocused] = useState(false)
const inputRef = useRef<HTMLInputElement>(null)
Expand Down Expand Up @@ -250,16 +253,31 @@ export const InputNumber: FunctionComponent<
return (
<View className={classes} style={style}>
<View className={`${classPrefix}-minus`} onClick={handleReduce}>
<Minus
className={classNames(
`${classPrefix}-icon ${classPrefix}-icon-minus`,
{
[`${classPrefix}-icon-disabled`]: shadowValue === min || disabled,
}
)}
/>
{isRnAndHarmony ? (
<Text
className={classNames(
`${classPrefix}-icon ${classPrefix}-icon-minus`,
{
[`${classPrefix}-icon-disabled`]:
shadowValue === min || disabled,
}
)}
>
-
</Text>
) : (
<Minus
className={classNames(
`${classPrefix}-icon ${classPrefix}-icon-minus`,
{
[`${classPrefix}-icon-disabled`]:
shadowValue === min || disabled,
}
)}
/>
)}
</View>
{isRnAndHarmony ? (
{isRn ? (
<TaroInput
className={classNames(`${classPrefix}-input`, {
[`${classPrefix}-input-disabled`]: disabled,
Expand Down Expand Up @@ -290,14 +308,29 @@ export const InputNumber: FunctionComponent<
)}

<View className={`${classPrefix}-add`} onClick={handlePlus}>
<Plus
className={classNames(
`${classPrefix}-icon ${classPrefix}-icon-plus`,
{
[`${classPrefix}-icon-disabled`]: shadowValue === max || disabled,
}
)}
/>
{isRnAndHarmony ? (
<Text
className={classNames(
`${classPrefix}-icon ${classPrefix}-icon-plus`,
{
[`${classPrefix}-icon-disabled`]:
shadowValue === max || disabled,
}
)}
>
+
</Text>
) : (
<Plus
className={classNames(
`${classPrefix}-icon ${classPrefix}-icon-plus`,
{
[`${classPrefix}-icon-disabled`]:
shadowValue === max || disabled,
}
)}
/>
)}
</View>
</View>
)
Expand Down
2 changes: 1 addition & 1 deletion src/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ $inputnumber-input-border-radius: var(
6px
) !default;
$inputnumber-input-margin: var(--nutui-inputnumber-input-margin, 0) !default;
$inputnumber-button-width: var(--nutui-inputnumber-button-width, 16px) !default;
$inputnumber-button-width: var(--nutui-inputnumber-button-width, 14px) !default;
$inputnumber-button-height: var(
--nutui-inputnumber-button-height,
24px
Expand Down

0 comments on commit f3ddd5b

Please sign in to comment.