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 and xiaoyatong committed Oct 25, 2024
1 parent aa6a87b commit a7bd881
Show file tree
Hide file tree
Showing 8 changed files with 356 additions and 298 deletions.
6 changes: 6 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 All @@ -82,6 +86,8 @@ const InputNumberDemo = () => {
<Demo8 />
<View className="h2">Formatter</View>
<Demo9 />
<View className="h2">{translated['5b7286d1']}</View>
<Demo10 />
</ScrollView>
</>
)
Expand Down
6 changes: 6 additions & 0 deletions src/packages/inputnumber/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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 @@ -25,6 +26,7 @@ const InputNumberDemo = () => {
'65bafb1d': '支持异步修改',
'7e2394ae': '自定义按钮大小',
'7e2394be': '支持formatter',
'5b7286d1': '支持取消全选中文本',
},
'zh-TW': {
'6333c786': '超出限制事件觸發',
Expand All @@ -39,6 +41,7 @@ const InputNumberDemo = () => {
'65bafb1d': '支持異步修改',
'7e2394ae': '自定義按鈕大小',
'7e2394be': '支持formatter',
'5b7286d1': '支援取消全選中文本',
},
'en-US': {
'6333c786': 'Exceeded limit event triggered',
Expand All @@ -53,6 +56,7 @@ const InputNumberDemo = () => {
'65bafb1d': 'Support for asynchronous modification',
'7e2394ae': 'custom button size',
'7e2394be': 'support formatter',
'5b7286d1': 'support deselect all text',
},
})

Expand All @@ -77,6 +81,8 @@ const InputNumberDemo = () => {
<Demo8 />
<h2>Formatter</h2>
<Demo9 />
<h2>{translated['5b7286d1']}</h2>
<Demo10 />
</div>
</>
)
Expand Down
11 changes: 11 additions & 0 deletions src/packages/inputnumber/demos/h5/demo10.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'
import { Cell, InputNumber } from '@nutui/nutui-react'

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

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

0 comments on commit a7bd881

Please sign in to comment.