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

feat: add fast-number-field component for data applications #4204

Merged
merged 13 commits into from
Jan 8, 2021

Conversation

robarbms
Copy link
Contributor

Description

Adds a fast-number-field component which takes numerical values that can be incremented and decremented in user defined stepped values.

Motivation & context

Provides a text entry for numerical values requested by community.
#3857

Issue type checklist

  • Chore: A change that does not impact distributed packages.
  • Bug fix: A change that fixes an issue, link to the issue above.
  • New feature: A change that adds functionality.

Is this a breaking change?

  • This change causes current functionality to break.

Adding or modifying component(s) in @microsoft/fast-components checklist

Process & policy checklist

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

@ghost
Copy link

ghost commented Dec 18, 2020

CLA assistant check
All CLA requirements met.

@robarbms robarbms linked an issue Dec 18, 2020 that may be closed by this pull request
Copy link
Contributor

@EisenbergEffect EisenbergEffect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In sites/website/sidebars.js we need to add this component to the list. Very excited to get this in!

required: false,
},
],
slots: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are start and end slots as well yes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added start and end slots.

@robarbms robarbms self-assigned this Jan 1, 2021
?required="${x => x.required}"
size="${x => x.size}"
:value="${x => x.value}"
type="text"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robarbms Are there any potential implications with having this be articulated as text semantically and via AT but having it behave strictly as a number?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used text type rather than number to avoid limitations of number. You can not use float values unless your steps are set to a float value(not 1.0, it needs to be a fractional like 0.1). I do number validation on the component side rather than using the in built validation of type number.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Given that shift, I wonder if we should add support for inputmode as an attribute here with only numeric types? Research on that here for input with type text for numbers similar to the choice we're making: https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the inputmode. I left off pattern because I already had validation being handled on the valueChanged method using parseFloat. Their pattern seemed incomplete for data statistics and trying to maintain a pattern could be potentially problematic.

@chrisdholt chrisdholt merged commit 7196215 into master Jan 8, 2021
@chrisdholt chrisdholt deleted the users/robarb/number-field branch January 8, 2021 21:02
@EisenbergEffect EisenbergEffect added this to the Release 2021-01 milestone Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please add a fast-number-field component for data applications
5 participants