Comments (3)
Some thoughts:
- I don't know if it is captured explicitly, but conceptually my mental model of fast foundation is that the components should align well with the browser native elements. I should be able to swap an
input type=number
element with a web component extending NumberField and have it be compatible.- The proposal discussed here wouldn't be compatible (it's edge cases would behave different from a native
input type=number
since it is not based on doubles). I think it would be nice if it was opt-in / a superset of the NumberField api. Maybe a mode / format / numeric-type attribute that could be set to bignumber or a separate BigNumberField implementation.
- The proposal discussed here wouldn't be compatible (it's edge cases would behave different from a native
- It would be nice to not need to depend on an external library if not needed. Could native
BigInt
be used instead? It is widely supported in browsers. If not for some reason could it be optional in some way to have the dependency added to applications? Some ideas:- separate base class
BigNumberField
- the compose method can take an implementation as an optional argument
- separate base class
- We are interested in having a much wider range of numeric representations. U8, U16, U32, U64, U128, I8, I16, I32, I64, I128, F32, F64, F128, FixedPoint, ComplexF32 (i.e. F32 + F32i), ComplexF64 (i.e. F64 + F64i), ComplexF128 (i.e. F128 + F128i). Is it possible to design a base class / method such that custom numeric implementations can be implemented?
- "very large numbers, exponential notation, and localization," we are interested in many different formatting options, i.e. hex views, octal views, binary views, localized units (currency, time), leading zeros, absolute / relative time formats. To a certain extent, essentially all printf style format codes.
from fast.
Addressing your points @rajsite:
- For new components, we define their specs to match parity with existing built-in components and other prior work or patterns (if any). Since
NumberField
already has its own spec, any modifications to the class must be fully compatible with that spec. For the most part, using an alternative number library within the internals of the component shouldn't change any functionality with regard to that spec or its public API. Any externally-facing API changes to a component's spec are considered to be major/breaking changes. - I agree that using built-in JS would be better -
BigInt
could work but would require extra math, which I'm not particularly great at. Considering the maintainers of the TC39 decimal proposal acknowledgebig.js
as a source of inspiration (MikeMcl/big.js#207), we may just need to let that proposal bake for a while. - Custom numeric representations might be beyond the scope of this particular RFC, but can definitely be considered for our
NumberField
. From the HTML Standard:If the user agent provides a user interface for selecting a number, then the value must be set to the best representation of the number representing the user's selection as a floating-point number.
from fast.
Related Issues (20)
- fix: fast-radio elements with the same name should be grouped when validating
- FIX: steps ignore exponential in fast-number-field
- fix: Anchor does not behave like native when in contenteditable element
- fix: code duplication between text-field and search components HOT 1
- rfc: React Native and FAST
- fix: invalid radiogroup value when selected radio removed from DOM HOT 1
- feat: add close watcher where supported in place of escape key handlers HOT 1
- fix: update picker item and picker list roles HOT 9
- feat: Combobox should allow diacritic-insensitive filtering
- fix: FASTSelect not opening/closing when multiple attribute is set HOT 7
- fix: Narrator reads out info about newly focused tab twice HOT 3
- feat: add secure algolia search in documentation HOT 1
- feat: allow Select to more easily support filtering via extension HOT 1
- rfc: make FAST Element a peer dependency of Foundation, Router, and SSR packages HOT 8
- Using @microsoft/fast-react-wrapper with refs & accessing public element members HOT 2
- fix: Module `@microsoft/fast-element` has no exported member `InlineTemplateDirective` HOT 5
- rfc: add Declartive Bindings to fast-element
- fix: browser validation for inputs doesn't work in safari and firefox HOT 1
- feat: make repeat directive optionally accept a key HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast.