Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[comp: inputNumber]feature inputNumber component #31

Closed
1 task
calvinchan22 opened this issue Dec 18, 2020 · 6 comments · Fixed by #584
Closed
1 task

[comp: inputNumber]feature inputNumber component #31

calvinchan22 opened this issue Dec 18, 2020 · 6 comments · Fixed by #584
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@calvinchan22
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

What does the proposed API look like?

@calvinchan22 calvinchan22 added the enhancement New feature or request label Dec 18, 2020
@danranVm
Copy link
Member

表单组件下周我会出一个统一的设计方案,到时候需要一起沟通下。

@danranVm
Copy link
Member

@Usualminds @danranVm 负责此组件的 review, API 设计完成后请 @ 他们

@danranVm danranVm added this to the v1.0.0 milestone Dec 25, 2020
@danranVm
Copy link
Member

danranVm commented Feb 3, 2021

re #153

@danranVm danranVm assigned LaamGinghong and unassigned Usualminds Mar 11, 2021
@calvinchan22
Copy link
Author

calvinchan22 commented Apr 15, 2021

What problem does this feature solve?

通过鼠标或键盘,输入范围内的数值

What does the proposed API look like?

  • 提供三种不同大小 large|medium|small
  • 支持禁用
  • 支持设置最大值、最小值
  • 支持小数点
  • 支持

何时使用

输入框限制输入数值的时候

API

名称 说明 类型 默认值
v-model:value 当前值 number -
disabled 是否禁用 boolean false
formatter 指定输入框展示值的格式 function -
max 最大值 number Infinity
min 最小值 number -Infinity
parser 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用 function -
precision 数值精度 number -
decimalSeparator 小数点 string -
size 最小值 string
step 每次改变步数,可以为小数 string/number 1

Events

事件名称 说明 回调参数
change 变化回调
pressEnter 按下回车的回调

事件

名称 描述
blur() 移除焦点
focus() 获取焦点

@danranVm
Copy link
Member

  • pressEnter 这个事件不需要提供吧,跟 inputNumber 组件没什么特别的关系。
  • decimalSeparator 的使用场景是什么?

@imguolao
Copy link
Contributor

imguolao commented Dec 7, 2021

api of input-number component

名称 说明 类型 默认值 全局配置 备注
v-model:value 控件值 number - - -
control 控件控制器 string | number | AbstractControl - - 配合 @idux/cdk/forms 使用, 参考 Form
disabled 禁用 boolean false - -
keyboard 启用键盘行为 boolean true -
max 最大值 number Infinity - -
min 最小值 number -Infinity - -
placeholder 提示信息 string - - -
precision 数值精度 number - - -
readonly 只读 boolean false - -
size 设置大小 'sm' | 'md' | 'lg' 'md' -
step 步进 number 1 - -
onChange 值发生改变时触发的回调 (value: number | null, oldValue: number | null | undefined) => void - - -
onFocus 获取焦点时触发的回调 (evt: FocusEvent) => void - - -
onBlur 失去焦点时触发的回调 (evt: FocusEvent) => void - - -

imguolao added a commit to imguolao/idux that referenced this issue Dec 7, 2021
imguolao added a commit to imguolao/idux that referenced this issue Dec 7, 2021
imguolao added a commit to imguolao/idux that referenced this issue Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants