Skip to content

Commit

Permalink
添加inputNumber组件的全选中文本可配置 (#2642)
Browse files Browse the repository at this point in the history
* feat: 添加全选配置

* feat: select
  • Loading branch information
wangyuan0108 authored Oct 25, 2024
1 parent f272e5a commit 2f71fda
Show file tree
Hide file tree
Showing 8 changed files with 354 additions and 298 deletions.
9 changes: 9 additions & 0 deletions src/packages/inputnumber/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Demo6 from './demos/taro/demo6'
import Demo7 from './demos/taro/demo7'
import Demo8 from './demos/taro/demo8'
import Demo9 from './demos/taro/demo9'
import Demo10 from './demos/taro/demo10'

const InputNumberDemo = () => {
const [translated] = useTranslate({
Expand All @@ -29,6 +30,7 @@ const InputNumberDemo = () => {
'65bafb1d': '支持异步修改',
'7e2394ae': '自定义按钮大小',
'7e2394be': '支持formatter',
'5b7286d1': '支持取消全选中文本',
},
'zh-TW': {
'6333c786': '超出限制事件觸發',
Expand All @@ -43,6 +45,7 @@ const InputNumberDemo = () => {
'65bafb1d': '支持異步修改',
'7e2394ae': '自定義按鈕大小',
'7e2394be': '支持formatter',
'5b7286d1': '支援取消全選中文本',
},
'en-US': {
'6333c786': 'Exceeded limit event triggered',
Expand All @@ -57,6 +60,7 @@ const InputNumberDemo = () => {
'65bafb1d': 'Support for asynchronous modification',
'7e2394ae': 'custom button size',
'7e2394be': 'support formatter',
'5b7286d1': 'support deselect all text',
},
})

Expand Down Expand Up @@ -104,6 +108,11 @@ const InputNumberDemo = () => {

<h2>Formatter</h2>
<Demo9 />

<h2>{translated['5b7286d1']}</h2>
<Cell>
<Demo10 />
</Cell>
</div>
</>
)
Expand Down
9 changes: 9 additions & 0 deletions src/packages/inputnumber/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Demo6 from './demos/h5/demo6'
import Demo7 from './demos/h5/demo7'
import Demo8 from './demos/h5/demo8'
import Demo9 from './demos/h5/demo9'
import Demo10 from './demos/h5/demo10'

const InputNumberDemo = () => {
const [translated] = useTranslate({
Expand All @@ -26,6 +27,7 @@ const InputNumberDemo = () => {
'65bafb1d': '支持异步修改',
'7e2394ae': '自定义按钮大小',
'7e2394be': '支持formatter',
'5b7286d1': '支持取消全选中文本',
},
'zh-TW': {
'6333c786': '超出限制事件觸發',
Expand All @@ -40,6 +42,7 @@ const InputNumberDemo = () => {
'65bafb1d': '支持異步修改',
'7e2394ae': '自定義按鈕大小',
'7e2394be': '支持formatter',
'5b7286d1': '支援取消全選中文本',
},
'en-US': {
'6333c786': 'Exceeded limit event triggered',
Expand All @@ -54,6 +57,7 @@ const InputNumberDemo = () => {
'65bafb1d': 'Support for asynchronous modification',
'7e2394ae': 'custom button size',
'7e2394be': 'support formatter',
'5b7286d1': 'support deselect all text',
},
})

Expand Down Expand Up @@ -100,6 +104,11 @@ const InputNumberDemo = () => {

<h2>Formatter</h2>
<Demo9 />

<h2>{translated['5b7286d1']}</h2>
<Cell>
<Demo10 />
</Cell>
</div>
</>
)
Expand Down
7 changes: 7 additions & 0 deletions src/packages/inputnumber/demos/h5/demo10.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'
import { InputNumber } from '@nutui/nutui-react'

const Demo10 = () => {
return <InputNumber defaultValue={1} allowEmpty select={false} />
}
export default Demo10
7 changes: 7 additions & 0 deletions src/packages/inputnumber/demos/taro/demo10.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'
import { InputNumber } from '@nutui/nutui-react-taro'

const Demo10 = () => {
return <InputNumber defaultValue={1} allowEmpty select={false} />
}
export default Demo10
Loading

0 comments on commit 2f71fda

Please sign in to comment.