numora 2.0.5 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/decimals.d.ts +3 -34
- package/dist/features/formatting/digit-counting.d.ts +3 -3
- package/dist/features/formatting/index.d.ts +1 -0
- package/dist/features/formatting/numeric-formatting-utils.d.ts +24 -0
- package/dist/features/formatting/thousand-grouping.d.ts +1 -1
- package/dist/features/sanitization.d.ts +3 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +739 -503
- package/dist/utils/format-utils.d.ts +8 -8
- package/package.json +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { type FormattingOptions } from '@/types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Formats a value from user input events (onChange, onBlur) by sanitizing, trimming decimals, and applying formatting.
|
|
4
|
+
* The behavior adapts based on formatOn mode - removes separators in 'change' mode since they'll be re-added.
|
|
5
5
|
*
|
|
6
|
-
* @param rawValue - The raw input value
|
|
6
|
+
* @param rawValue - The raw input value from the user event
|
|
7
7
|
* @param decimalMaxLength - Maximum number of decimal places allowed
|
|
8
8
|
* @param formattingOptions - Optional formatting options
|
|
9
9
|
* @param shouldRemoveThousandSeparators - Whether to remove thousand separators during sanitization (default: determined by formatOn)
|
|
10
10
|
* @returns Object with formatted value and raw value (raw value is the value before formatting)
|
|
11
11
|
*/
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function formatInputValue(rawValue: string, decimalMaxLength: number, formattingOptions?: FormattingOptions, shouldRemoveThousandSeparators?: boolean): {
|
|
13
13
|
formatted: string;
|
|
14
14
|
raw: string;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* Formats a value for display
|
|
18
|
-
*
|
|
17
|
+
* Formats a value for display (e.g., initial values, controlled values).
|
|
18
|
+
* Assumes the value might already contain thousand separators, so removes them before processing.
|
|
19
19
|
*
|
|
20
|
-
* @param value - The value to format
|
|
20
|
+
* @param value - The value to format for display
|
|
21
21
|
* @param decimalMaxLength - Maximum number of decimal places allowed
|
|
22
22
|
* @param formattingOptions - Optional formatting options
|
|
23
23
|
* @returns Object with formatted value and raw value
|
|
24
24
|
*/
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function formatValueForDisplay(value: string, decimalMaxLength: number, formattingOptions?: FormattingOptions): {
|
|
26
26
|
formatted: string;
|
|
27
27
|
raw: string;
|
|
28
28
|
};
|