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.
@@ -1,28 +1,28 @@
1
1
  import { type FormattingOptions } from '@/types';
2
2
  /**
3
- * Processes and formats a numeric input value by sanitizing, trimming decimals, and applying formatting.
4
- * This is a pure function that doesn't require DOM elements or events.
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 to process
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 processAndFormatValue(rawValue: string, decimalMaxLength: number, formattingOptions?: FormattingOptions, shouldRemoveThousandSeparators?: boolean): {
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 using the provided formatting options.
18
- * This is a pure function that can be used without DOM events.
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 formatValue(value: string, decimalMaxLength: number, formattingOptions?: FormattingOptions): {
25
+ export declare function formatValueForDisplay(value: string, decimalMaxLength: number, formattingOptions?: FormattingOptions): {
26
26
  formatted: string;
27
27
  raw: string;
28
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "numora",
3
- "version": "2.0.5",
3
+ "version": "3.0.1",
4
4
  "description": "Precision-first numeric input library for DeFi and financial applications",
5
5
  "homepage": "https://numora.xyz/",
6
6
  "main": "dist/index.js",