compote-ui
Version:
An opinionated UI component library for Svelte, built on top of [Ark UI](https://ark-ui.com) with additional components and features not available in the core Ark UI library.
11 lines (10 loc) • 664 B
TypeScript
/**
* The string value NumberInput hands to Ark's NumberInput.Root.
*
* An empty value (`null`, `undefined` or NaN) becomes `''`, a controlled empty value. Passing
* `undefined` instead would switch Ark to its internal state, which keeps showing the last
* number — so clearing a bound from outside (e.g. a filter going from [10, 100] to
* [undefined, 100]) would leave the 10 on screen. The one exception: an `undefined` value
* with a `defaultValue` set stays `undefined`, so uncontrolled use keeps working.
*/
export declare function toNumberInputValue(value: number | null | undefined, locale: string, hasDefaultValue?: boolean): string | undefined;