@messaia/cdk 18.2.1 → 18.2.2

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,19 +1,22 @@
1
1
  import { ElementRef } from '@angular/core';
2
+ import { NgControl } from '@angular/forms';
2
3
  import * as i0 from "@angular/core";
3
4
  /**
4
- * This directive can be added to input elements to parse decimal values.
5
+ * This directive parses pasted currency strings into decimal values and updates the reactive form control.
5
6
  */
6
7
  export declare class ParseDecimalDirective {
7
8
  private el;
9
+ private control;
8
10
  /**
9
- * Whether the directive is enabled
11
+ * Whether the directive is enabled.
10
12
  */
11
13
  parseDecimalEnabled: boolean;
12
14
  /**
13
- * Constructor to inject ElementRef for accessing the DOM element.
15
+ * Constructor to inject dependencies.
14
16
  * @param el - The ElementRef instance representing the DOM element.
17
+ * @param control - The NgControl instance for accessing the form control.
15
18
  */
16
- constructor(el: ElementRef);
19
+ constructor(el: ElementRef, control: NgControl);
17
20
  /**
18
21
  * Handles the paste event to parse and normalize pasted currency strings into decimals.
19
22
  * @param event - The ClipboardEvent triggered on pasting.
@@ -25,6 +28,11 @@ export declare class ParseDecimalDirective {
25
28
  * @returns The parsed decimal or NaN if invalid.
26
29
  */
27
30
  private parseCurrency;
31
+ /**
32
+ * Updates the reactive form control's value.
33
+ * @param value - The normalized decimal value.
34
+ */
35
+ private updateFormControl;
28
36
  static ɵfac: i0.ɵɵFactoryDeclaration<ParseDecimalDirective, never>;
29
37
  static ɵdir: i0.ɵɵDirectiveDeclaration<ParseDecimalDirective, "[parseDecimal]", never, { "parseDecimalEnabled": { "alias": "parseDecimalEnabled"; "required": false; }; }, {}, never, never, false, never>;
30
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messaia/cdk",
3
- "version": "18.2.1",
3
+ "version": "18.2.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.7",
6
6
  "@angular/core": "^18.2.7"