carriera-intern-components 1.1.199 → 1.1.721

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.
Files changed (111) hide show
  1. package/fesm2022/carriera-intern-components.mjs +9119 -5402
  2. package/fesm2022/carriera-intern-components.mjs.map +1 -1
  3. package/index.d.ts +2550 -3
  4. package/package.json +1 -1
  5. package/public/assets/animations/animation-document-update.json +1 -0
  6. package/public/assets/animations/animation-image.json +1 -0
  7. package/public/assets/animations/animation-logo.json +1 -0
  8. package/public/assets/animations/animation-media.json +1 -0
  9. package/public/assets/cdl.png +0 -0
  10. package/public/assets/icons/Thumb-active.svg +3 -0
  11. package/public/assets/icons/cai-drop-zone-focus.svg +48 -0
  12. package/public/assets/icons/fuel-contact/cai-contact.svg +3 -0
  13. package/public/assets/icons/general/cai-date.svg +1 -1
  14. package/public/assets/icons/general/cai-sort-descending.svg +4 -0
  15. package/public/assets/icons/interaction/cai-dislike.svg +2 -2
  16. package/public/assets/icons/interaction/cai-drag.svg +3 -0
  17. package/public/assets/icons/interaction/cai-like.svg +2 -2
  18. package/public/assets/icons/interaction/cai_time.svg +1 -1
  19. package/public/assets/icons/load/cai-parking.svg +3 -0
  20. package/public/assets/invexample.png +0 -0
  21. package/public/assets/invoice.png +0 -0
  22. package/public/assets/json/icons.json +20 -0
  23. package/src/styles/README.md +7 -5
  24. package/src/styles/_variables.scss +27 -14
  25. package/src/styles/cropper.scss +14 -8
  26. package/src/styles/custompickers.scss +704 -693
  27. package/src/styles/popover.scss +210 -4
  28. package/src/styles/review_variables.scss +5 -0
  29. package/src/styles/tooltip.scss +37 -3
  30. package/src/styles.scss +18 -6
  31. package/app/components/avatar/avatar.component.d.ts +0 -30
  32. package/app/components/avatar/models/avatar.model.d.ts +0 -28
  33. package/app/components/avatar/models/index.d.ts +0 -1
  34. package/app/components/avatar/pipes/initials.pipe.d.ts +0 -11
  35. package/app/components/copy/copy.component.d.ts +0 -23
  36. package/app/components/document-preview/document-preview.component.d.ts +0 -107
  37. package/app/components/document-preview/interfaces/document-tag.interface.d.ts +0 -4
  38. package/app/components/document-preview/interfaces/index.d.ts +0 -1
  39. package/app/components/drop-zone/drop-zone.component.d.ts +0 -192
  40. package/app/components/drop-zone/models/file.response.d.ts +0 -10
  41. package/app/components/input/directives/helpers/index.d.ts +0 -1
  42. package/app/components/input/directives/helpers/mask.helper.d.ts +0 -15
  43. package/app/components/input/directives/mask.directive.d.ts +0 -67
  44. package/app/components/input/directives/number-format.directive.d.ts +0 -120
  45. package/app/components/input/directives/password.directive.d.ts +0 -100
  46. package/app/components/input/input.component.d.ts +0 -394
  47. package/app/components/input/models/dropdown.model.d.ts +0 -272
  48. package/app/components/input/models/index.d.ts +0 -2
  49. package/app/components/input/models/input.model.d.ts +0 -62
  50. package/app/components/input/pipes/error-message.pipe.d.ts +0 -11
  51. package/app/components/input/pipes/filter-by-search.pipe.d.ts +0 -9
  52. package/app/components/input/pipes/highlight-search.d.ts +0 -13
  53. package/app/components/input/pipes/remap-pm-icons.pipe.d.ts +0 -7
  54. package/app/components/input-address/enums/input-address-layers-string.enum.d.ts +0 -4
  55. package/app/components/input-address/enums/input-address-type-string.enum.d.ts +0 -5
  56. package/app/components/input-address/input-address.component.d.ts +0 -67
  57. package/app/components/input-address/models/address-data.model.d.ts +0 -19
  58. package/app/components/input-address/models/address-list.model.d.ts +0 -6
  59. package/app/components/input-address/models/long-lat.model.d.ts +0 -4
  60. package/app/components/input-address/models/sent-address-data.model.d.ts +0 -22
  61. package/app/components/input-datetime-picker/cai-input-datetime-picker.component.d.ts +0 -103
  62. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/cai-custom-datetime-pickers.component.d.ts +0 -58
  63. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-dates-main/cai-custom-datetime-pickers-calendar-dates-main.component.d.ts +0 -41
  64. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-days/cai-custom-datetime-pickers-calendar-days.component.d.ts +0 -26
  65. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-calendar-left/cai-custom-datetime-pickers-calendar-left.component.d.ts +0 -30
  66. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/components/cai-custom-datetime-pickers-date-calendars/cai-custom-datetime-pickers-date-calendars.component.d.ts +0 -38
  67. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/config/cai-input.config.d.ts +0 -169
  68. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/config/index.d.ts +0 -1
  69. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-left-string.enum.d.ts +0 -5
  70. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-list-preview-string.enum.d.ts +0 -4
  71. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-main-string.enum.d.ts +0 -5
  72. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-scroll-type-string.enum.d.ts +0 -4
  73. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-string.enum.d.ts +0 -6
  74. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/calendar-type-string.enum.d.ts +0 -3
  75. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/enums/config.enum.d.ts +0 -7
  76. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/models/scroll-change.model.d.ts +0 -6
  77. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/models/scroll-type.model.d.ts +0 -8
  78. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/pipes/calendar-months.pipe.d.ts +0 -9
  79. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/services/calendar-datetime-picker.service.d.ts +0 -19
  80. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/strategy/calendar-strategy.d.ts +0 -30
  81. package/app/components/input-datetime-picker/components/cai-custom-datetime-pickers/utils/constants/custom-datetime-pickers.constants.d.ts +0 -19
  82. package/app/components/input-datetime-picker/enums/input-config-name-string.enum.d.ts +0 -7
  83. package/app/components/input-datetime-picker/pipes/input-clear-class.pipe.d.ts +0 -14
  84. package/app/components/input-datetime-picker/pipes/input-date-time-container-class.pipe.d.ts +0 -11
  85. package/app/components/input-datetime-picker/pipes/input-dropdown-arrow-class.pipe.d.ts +0 -11
  86. package/app/components/input-datetime-picker/pipes/input-placeholder-icon.class.pipe.d.ts +0 -11
  87. package/app/components/input-datetime-picker/pipes/show-clear.pipe.d.ts +0 -8
  88. package/app/components/pm/pm.component.d.ts +0 -76
  89. package/app/components/selected-location-field/interfaces/index.d.ts +0 -1
  90. package/app/components/selected-location-field/interfaces/selected-business-field.interface.d.ts +0 -11
  91. package/app/components/selected-location-field/selected-business-field.component.d.ts +0 -12
  92. package/app/directives/hover-svg-directives.d.ts +0 -15
  93. package/app/directives/index.d.ts +0 -3
  94. package/app/directives/infinite-scroll.directive.d.ts +0 -16
  95. package/app/directives/intersection-observer.directive.d.ts +0 -15
  96. package/app/enums/alignment.enum.d.ts +0 -4
  97. package/app/enums/general-actions.enum.d.ts +0 -58
  98. package/app/enums/index.d.ts +0 -3
  99. package/app/enums/string-placeholder.enum.d.ts +0 -3
  100. package/app/models/appFile.model.d.ts +0 -14
  101. package/app/models/pm.model.d.ts +0 -10
  102. package/app/pipes/bytes-to-human-readable.pipe.d.ts +0 -7
  103. package/app/pipes/currency.pipe.d.ts +0 -28
  104. package/app/pipes/number-format.pipe.d.ts +0 -7
  105. package/app/services/document.service.d.ts +0 -22
  106. package/app/utils/autofill-validators.d.ts +0 -10
  107. package/app/utils/constants/index.d.ts +0 -1
  108. package/app/utils/constants/input-character-sets.constants.d.ts +0 -18
  109. package/app/utils/index.d.ts +0 -2
  110. package/public/pdfjs/pdf.worker.min.mjs +0 -30
  111. package/public-api.d.ts +0 -11
@@ -1,192 +0,0 @@
1
- import { ElementRef, EventEmitter } from '@angular/core';
2
- import { AppFile } from '../../models/appFile.model';
3
- import { ImageCroppedEvent, LoadedImage, ImageTransform } from 'ngx-image-cropper';
4
- import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
5
- import { Driver } from '../avatar/models';
6
- import { FileResponse } from './models/file.response';
7
- import { FormGroup } from '@angular/forms';
8
- import { DocumentTag } from '../document-preview/interfaces';
9
- import * as i0 from "@angular/core";
10
- /**
11
- * A component that provides a user interface for file uploading via
12
- * drag-and-drop or a file input dialog. It displays previews of the
13
- * selected files in a carousel.
14
- */
15
- export declare class DropZoneComponent {
16
- private sanitizer;
17
- zoomValue: import("@angular/core").WritableSignal<number>;
18
- smallView: import("@angular/core").WritableSignal<boolean>;
19
- cropHeight: import("@angular/core").WritableSignal<number>;
20
- cropWidth: import("@angular/core").WritableSignal<number>;
21
- private initialFilesProcessed;
22
- driver: import("@angular/core").WritableSignal<Driver>;
23
- transform: ImageTransform;
24
- imageChangedEvent: Event | null;
25
- croppedImage: SafeUrl | null;
26
- showCropper: import("@angular/core").WritableSignal<boolean>;
27
- isCropperReady: import("@angular/core").WritableSignal<boolean>;
28
- originalImageWidth: number;
29
- originalImageHeight: number;
30
- base64Image: string;
31
- deletedDocs: import("@angular/core").WritableSignal<number[]>;
32
- crop: import("@angular/core").InputSignal<boolean>;
33
- size: import("@angular/core").InputSignal<string | undefined>;
34
- rounded: import("@angular/core").InputSignal<boolean>;
35
- files: import("@angular/core").InputSignal<FileResponse[]>;
36
- deletedFileIds: import("@angular/core").InputSignal<number[]>;
37
- maxCountFiles: import("@angular/core").InputSignal<number>;
38
- /**
39
- * A input that holds an FormGroup object that is used to update the form validity when the crop mode is closed.
40
- */
41
- parentForm: import("@angular/core").InputSignal<FormGroup<any> | null>;
42
- /**
43
- * A signal that holds an array of `AppFile` objects representing the files
44
- * that have been selected or dropped by the user.
45
-
46
- */
47
- variant: import("@angular/core").InputSignal<string>;
48
- /**
49
- * Input that holds an array of `DocumentTag` objects representing the tags for the documents.
50
- */
51
- documentTags: import("@angular/core").InputSignal<DocumentTag[]>;
52
- /**
53
- * Injects the DocumentService for file processing tasks like
54
- * thumbnail generation and PDF page counting.
55
- * @private
56
- */
57
- private documentService;
58
- /**
59
- * An array of file extensions that should be excluded from the supported list.
60
- * @defaultValue `[]` (an empty array)
61
- * @type {FileExtension[]}
62
- */
63
- excludedFileTypes: import("@angular/core").InputSignal<("mp4" | "mov" | "avi" | "pdf" | "jpg" | "jpeg" | "png" | "gif")[]>;
64
- /**
65
- * The base array of all file extensions that are generally allowed.
66
- * Supported file types will be derived from this list, after excluding
67
- * any types specified in `excludedFileTypes`.
68
- *
69
- * @defaultValue `['avi', 'mov', 'mp4', 'pdf', 'gif', 'png', 'jpg', 'jpeg']`
70
- * @type {FileExtension[]}
71
- */
72
- fileTypes: import("@angular/core").InputSignal<("mp4" | "mov" | "avi" | "pdf" | "jpg" | "jpeg" | "png" | "gif")[]>;
73
- coverUrl: string;
74
- profileUrl: string;
75
- logoUrl: string;
76
- onDeletedFileIds: EventEmitter<number[]>;
77
- docsChange: EventEmitter<AppFile[]>;
78
- inputRange: ElementRef<HTMLInputElement>;
79
- constructor(sanitizer: DomSanitizer);
80
- ngOnInit(): void;
81
- ngAfterViewInit(): void;
82
- emitDocs(): void;
83
- populateDocs(currentFiles: FileResponse[]): Promise<void>;
84
- fetchFileAsFile(fileResponse: FileResponse): Promise<File | null>;
85
- updateRangeBackground(input: HTMLInputElement): void;
86
- cropDimensions(): void;
87
- ratioHelper(): number;
88
- onZoomChange(event: Event): void;
89
- fileChangeEvent(event: Event): void;
90
- imageCropped(event: ImageCroppedEvent): void;
91
- imageLoaded(image: LoadedImage): void;
92
- cropperReady(): void;
93
- loadImageFailed(): void;
94
- onTransformChange(event: ImageTransform): void;
95
- cancelCrop(): void;
96
- submitCrop(initial?: boolean): void;
97
- /**
98
- * A computed signal that derives the list of currently supported file extensions.
99
- * It filters the base `fileTypes` array, removing any extensions present
100
- * in the `excludedFileTypes` input.
101
- */
102
- supportedFileTypes: import("@angular/core").Signal<("mp4" | "mov" | "avi" | "pdf" | "jpg" | "jpeg" | "png" | "gif")[]>;
103
- /**
104
- * A signal that holds an array of `AppFile` objects representing the files
105
- * that have been selected or dropped by the user.
106
- */
107
- docs: import("@angular/core").WritableSignal<AppFile[]>;
108
- /**
109
- * A signal that acts as a boolean flag. It is set to `true` when the user
110
- * attempts to upload a file with an unsupported extension.
111
- */
112
- unsupported: import("@angular/core").WritableSignal<boolean>;
113
- /**
114
- * Handles the 'change' event from the hidden file input. It extracts the
115
- * selected files and passes them to the `processFiles` method.
116
- * @param event The `Event` object from the file input element.
117
- */
118
- onInput(event: Event): void;
119
- /**
120
- * Handles the 'drop' event on the component. It prevents the browser's
121
- * default file handling, extracts the dropped files, and passes them to
122
- * the `processFiles` method.
123
- * @param event The `DragEvent` object containing the dropped files.
124
- */
125
- onDrop(event: DragEvent): void;
126
- /**
127
- * Asynchronously processes a list of files. For each file, it validates
128
- * the extension against `supportedFileTypes`. If valid, it generates a
129
- * thumbnail, counts pages for PDFs, creates an `AppFile` object, and adds
130
- * it to the `docs` signal. If any file is unsupported, the `unsupported`
131
- * flag is set.
132
- * @param files The `FileList` object to be processed.
133
- */
134
- processFiles(files: FileList): Promise<void>;
135
- /**
136
- * Handles the download action for a specific file.
137
- * Note: This is a placeholder and currently only logs the file name.
138
- * @param fileName The name of the file to be downloaded.
139
- */
140
- handleDownload(fileName: string): void;
141
- /**
142
- * A ViewChild reference to the native `<input type='file'>` element.
143
- * Used to programmatically trigger the file selection dialog.
144
- */
145
- inputRef: ElementRef<HTMLInputElement>;
146
- /**
147
- * Resets the component's state after an unsupported file type error
148
- * by setting the `unsupported` signal to `false`.
149
- */
150
- cancel(): void;
151
- /**
152
- * Programmatically triggers a click on the hidden file input element,
153
- * which opens the system's file selection dialog.
154
- */
155
- handleClickToAdd(): void;
156
- /**
157
- * Deletes a file from the preview list. It filters the `docs` array to
158
- * remove the specified file and adjusts the carousel position.
159
- * @param fileName The name of the file to be deleted.
160
- */
161
- handleDelete(fileName: string): void;
162
- /**
163
- * A signal that stores the current index for the file preview carousel.
164
- * This determines which part of the carousel is visible.
165
- */
166
- carouselIndex: import("@angular/core").WritableSignal<number>;
167
- /**
168
- * A computed signal that calculates the CSS `translateX` value for the
169
- * carousel container. This creates the sliding effect based on the
170
- * `carouselIndex`.
171
- */
172
- carouselTransform: import("@angular/core").Signal<string>;
173
- /**
174
- * Navigates the carousel one step to the left by decrementing the
175
- * `carouselIndex`. The index will not go below 0.
176
- */
177
- carouselLeft(): void;
178
- /**
179
- * Navigates the carousel one step to the right by incrementing the
180
- * `carouselIndex`. The index will not exceed the maximum possible value
181
- * based on the number of documents.
182
- */
183
- carouselRight(): void;
184
- handleTagChange(event: {
185
- fileName: string;
186
- tag: string;
187
- }): void;
188
- setInvalid(): void;
189
- clearInvalid(): void;
190
- static ɵfac: i0.ɵɵFactoryDeclaration<DropZoneComponent, never>;
191
- static ɵcmp: i0.ɵɵComponentDeclaration<DropZoneComponent, "cai-drop-zone", never, { "crop": { "alias": "crop"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "files": { "alias": "files"; "required": false; "isSignal": true; }; "deletedFileIds": { "alias": "deletedFileIds"; "required": false; "isSignal": true; }; "maxCountFiles": { "alias": "maxCountFiles"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "documentTags": { "alias": "documentTags"; "required": false; "isSignal": true; }; "excludedFileTypes": { "alias": "excludedFileTypes"; "required": false; "isSignal": true; }; "fileTypes": { "alias": "fileTypes"; "required": false; "isSignal": true; }; }, { "onDeletedFileIds": "onDeletedFileIds"; "docsChange": "docsChange"; }, never, never, true, never>;
192
- }
@@ -1,10 +0,0 @@
1
- export interface FileResponse {
2
- fileId?: number;
3
- fileName?: string | null;
4
- url?: string | null;
5
- fileSize?: number | null;
6
- tags?: Array<string> | null;
7
- tagGeneratedByUser?: boolean;
8
- updatedAt?: string | null;
9
- companyUserId?: number | null;
10
- }
@@ -1 +0,0 @@
1
- export * from './mask.helper';
@@ -1,15 +0,0 @@
1
- export declare class MaskHelper {
2
- static extractUserInput(value: string): string;
3
- static isPlaceholder(char: string): boolean;
4
- static charMatchesPlaceholder(char: string, placeholder: string): boolean;
5
- /**
6
- * Applies the mask to a given string of user input.
7
- * @param realValue The clean user input.
8
- * @param mask The mask pattern.
9
- * @returns An object with the formatted value and the final real value.
10
- */
11
- static applyMask(realValue: string, mask: string): {
12
- formattedValue: string;
13
- finalRealValue: string;
14
- };
15
- }
@@ -1,67 +0,0 @@
1
- import { ElementRef, OnInit } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class MaskDirective implements OnInit {
4
- private el;
5
- /**
6
- * The mask pattern to apply.
7
- * Placeholders:
8
- * '0' - Digit (0-9)
9
- * 'a' - Letter (a-z, A-Z)
10
- * '*' - Alphanumeric (0-9, a-z, A-Z)
11
- * @example '(000) 000-0000' for a phone number.
12
- */
13
- appMask: import("@angular/core").InputSignal<string>;
14
- reveal: import("@angular/core").InputSignal<number>;
15
- /**
16
- * Stores the unmasked, "real" value of the input, containing only
17
- * the characters entered by the user that fit the mask placeholders.
18
- */
19
- private realValue;
20
- constructor(el: ElementRef<HTMLInputElement>);
21
- ngOnInit(): void;
22
- /**
23
- * HostListener for the 'input' event. This is the primary handler for
24
- * formatting the value as the user types or pastes.
25
- */
26
- onInput(event: InputEvent): void;
27
- /**
28
- * HostListener for the 'paste' event. It intercepts pasted content,
29
- * cleans it, and integrates it into the masked value.
30
- */
31
- onPaste(event: ClipboardEvent): void;
32
- /**
33
- * HostListener for the 'copy' event. Ensures that copying a selection
34
- * from the input copies the unmasked, "real" value.
35
- */
36
- onCopy(event: ClipboardEvent): void;
37
- /**
38
- * HostListener for the 'cut' event. Ensures cutting a selection removes
39
- * the corresponding part from the real value and reformats the input.
40
- */
41
- onCut(event: ClipboardEvent): void;
42
- /**
43
- * HostListener for the 'keydown' event. It validates key presses against
44
- * the mask pattern, preventing invalid characters from being entered.
45
- */
46
- onKeydown(event: KeyboardEvent): void;
47
- /**
48
- * The core formatting logic. It takes a value, extracts the valid user
49
- * input, applies the mask, updates the display, and dispatches the change.
50
- * @param value The current value from the input field.
51
- */
52
- private formatValue;
53
- private setCursorToEnd;
54
- private dispatchRealValueChange;
55
- /**
56
- * Public method to get the current unmasked "real" value.
57
- * @returns The real value as a string.
58
- */
59
- getRealValue(): string;
60
- /**
61
- * Public method to set the "real" value from outside the directive.
62
- * @param value The new value to set.
63
- */
64
- setRealValue(value: string): void;
65
- static ɵfac: i0.ɵɵFactoryDeclaration<MaskDirective, never>;
66
- static ɵdir: i0.ɵɵDirectiveDeclaration<MaskDirective, "[appMask]", never, { "appMask": { "alias": "appMask"; "required": false; "isSignal": true; }; "reveal": { "alias": "reveal"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
67
- }
@@ -1,120 +0,0 @@
1
- import { ElementRef, OnInit } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class NumberFormatDirective implements OnInit {
4
- private el;
5
- /**
6
- * Input property to enable or disable the number formatting.
7
- * Defaults to true, meaning formatting is active by default.
8
- */
9
- appNumberFormat: import("@angular/core").InputSignal<boolean>;
10
- /**
11
- *
12
- */
13
- max: import("@angular/core").InputSignal<number | undefined>;
14
- /**
15
- * Input property to enable or disable the number formatting.
16
- * Defaults to true, meaning formatting is active by default.
17
- */
18
- isNumberFormattingDisabled: import("@angular/core").InputSignal<boolean>;
19
- /**
20
- * Input property to enable or disable the number formatting.
21
- * Defaults to true, meaning formatting is active by default.
22
- */
23
- disableDecimals: import("@angular/core").InputSignal<boolean>;
24
- prefix: import("@angular/core").InputSignal<string>;
25
- /**
26
- * Stores the unformatted, "real" numeric value of the input.
27
- * This is the value that should be used for calculations or form submissions,
28
- * as opposed to the formatted display value.
29
- */
30
- private realValue;
31
- constructor(el: ElementRef<HTMLInputElement>);
32
- /**
33
- * Lifecycle hook that is called after Angular has initialized all data-bound
34
- * properties of a directive.
35
- * If number formatting is enabled, it sets up the initial formatting.
36
- */
37
- ngOnInit(): void;
38
- /**
39
- * Initializes the number formatting on the input element.
40
- * It extracts the initial numeric value from the input's current value
41
- * and then updates the display with the formatted version.
42
- */
43
- private setupNumberFormatting;
44
- /**
45
- * HostListener for the 'input' event on the host element.
46
- * This triggers whenever the user types or pastes content into the input.
47
- * It extracts the numeric value from the current input, updates the
48
- * display with the formatted number, moves the cursor to the end,
49
- * and dispatches a 'realValueChange' event with the unformatted numeric value.
50
- * @param event - The InputEvent object.
51
- */
52
- onInput(event: InputEvent): void;
53
- /**
54
- * HostListener for the 'cut' event.
55
- * Prevents the default cut behavior to manually handle the value change.
56
- * It reconstructs the value after the cut, extracts the numeric part,
57
- * updates the display, sets the cursor, and dispatches the real value.
58
- * @param event - The ClipboardEvent object.
59
- */
60
- onCut(event: ClipboardEvent): void;
61
- /**
62
- * HostListener for the 'copy' event.
63
- * Prevents the default copy behavior if there's a selection to ensure
64
- * that the copied text is the unformatted numeric value of the selection,
65
- * rather than the potentially formatted display text.
66
- * @param event - The ClipboardEvent object.
67
- */
68
- onCopy(event: ClipboardEvent): void;
69
- /**
70
- * HostListener for the 'keydown' event.
71
- * Filters key presses to allow only digits, a single decimal point,
72
- * and control keys (Backspace, Arrows, Tab, etc.).
73
- * This helps maintain a valid numeric input format before the 'input' event fires.
74
- * @param event - The KeyboardEvent object.
75
- */
76
- onKeydown(event: KeyboardEvent): void;
77
- /**
78
- * Extracts a clean numeric string from a given value.
79
- * It removes any non-digit characters except for a single decimal point.
80
- * It also ensures that there's only one decimal point and limits
81
- * the decimal part to two digits.
82
- * @param value - The string value to clean.
83
- * @returns A string representing the extracted numeric value.
84
- */
85
- private extractNumericValue;
86
- /**
87
- * Updates the input element's display value with the formatted version
88
- * of the current `realValue`.
89
- * It uses the `NumberFormatPipe` for formatting.
90
- */
91
- private updateDisplayValue;
92
- /**
93
- * Sets the cursor position to the end of the input field.
94
- * This is typically called after the input value is reformatted to prevent
95
- * the cursor from jumping to an unexpected position.
96
- * Uses `setTimeout` to ensure the operation occurs after Angular's view update.
97
- */
98
- private setCursorToEnd;
99
- /**
100
- * Dispatches a custom event named 'realValueChange' from the host element.
101
- * The event's `detail` property contains the unformatted `realValue`.
102
- * This allows parent components or other directives to listen for changes
103
- * to the underlying numeric value.
104
- */
105
- private dispatchRealValueChange;
106
- /**
107
- * Public method to get the current unformatted "real" numeric value.
108
- * @returns The real numeric value as a string.
109
- */
110
- getRealValue(): string;
111
- /**
112
- * Public method to set the "real" numeric value from outside the directive.
113
- * It extracts the numeric part from the provided value and updates the
114
- * input's display with the formatted version.
115
- * @param value - The new value to set (can be formatted or unformatted).
116
- */
117
- setRealValue(value: string): void;
118
- static ɵfac: i0.ɵɵFactoryDeclaration<NumberFormatDirective, never>;
119
- static ɵdir: i0.ɵɵDirectiveDeclaration<NumberFormatDirective, "[appNumberFormat]", never, { "appNumberFormat": { "alias": "appNumberFormat"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "isNumberFormattingDisabled": { "alias": "isNumberFormattingDisabled"; "required": false; "isSignal": true; }; "disableDecimals": { "alias": "disableDecimals"; "required": false; "isSignal": true; }; "prefix": { "alias": "prefix"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
120
- }
@@ -1,100 +0,0 @@
1
- import { ElementRef, OnInit } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class PasswordDirective implements OnInit {
4
- private el;
5
- /**
6
- * Input property to enable or disable the password masking behavior.
7
- */
8
- appPassword: import("@angular/core").InputSignal<boolean>;
9
- /**
10
- * Input property to hide or show the password
11
- */
12
- visible: import("@angular/core").InputSignal<boolean>;
13
- /**
14
- * Input property to specify the type of the password
15
- */
16
- account: import("@angular/core").InputSignal<boolean>;
17
- /**
18
- * Input property to specify how many characters from the end of the
19
- * password should be revealed. Defaults to 0 (fully masked).
20
- */
21
- reveal: import("@angular/core").InputSignal<number>;
22
- appMask: import("@angular/core").InputSignal<string>;
23
- max: import("@angular/core").InputSignal<number | undefined>;
24
- /**
25
- * Stores the actual, unmasked password value,
26
- * while the input element displays a masked version.
27
- */
28
- private realValue;
29
- constructor(el: ElementRef<HTMLInputElement>);
30
- /**
31
- * Lifecycle hook called after Angular initializes the directive's data-bound properties.
32
- * If password masking is enabled, it sets up the initial masking.
33
- */
34
- ngOnInit(): void;
35
- /**
36
- * Sets up the initial state for password masking.
37
- * It reads the initial value from the input (if any) as the `realValue`
38
- * and then updates the input's display to show the masked version.
39
- */
40
- private setupPasswordMasking;
41
- /**
42
- * HostListener for the 'input' event on the host element.
43
- * This is the core logic for synchronizing `realValue` with user input
44
- * on the masked field. It infers changes to `realValue`
45
- * based on `event.data`, cursor position, and the difference in length
46
- * between the input's current display value and the previous `realValue`.
47
- * @param event - The InputEvent object.
48
- */
49
- onInput(event: InputEvent): void;
50
- /**
51
- * HostListener for the 'cut' event.
52
- * Prevents default cut behavior to operate on `realValue`.
53
- * It copies the corresponding part of `realValue` to the clipboard
54
- * and updates `realValue` and the display.
55
- * @param event - The ClipboardEvent object.
56
- */
57
- onCut(event: ClipboardEvent): void;
58
- /**
59
- * HostListener for the 'copy' event.
60
- * Prevents default copy behavior to ensure the unmasked `realValue` segment is copied.
61
- * @param event - The ClipboardEvent object.
62
- */
63
- onCopy(event: ClipboardEvent): void;
64
- /**
65
- * Updates the input element's display value with a masked version of `realValue`.
66
- * Uses '•' for masked characters. Respects the `reveal` input to show
67
- * a specified number of characters from the end of the password.
68
- * This method is responsible for creating the visual masking.
69
- */
70
- private updateDisplayValue;
71
- /**
72
- * Sets the cursor position within the input field.
73
- * This is crucial after `updateDisplayValue` changes the entire input value,
74
- * to maintain a natural cursor behavior for the user.
75
- * Uses `setTimeout` to ensure the operation occurs after Angular's view update.
76
- * @param position - The desired cursor position.
77
- */
78
- private setCursorPosition;
79
- /**
80
- * Dispatches a custom event named 'realValueChange' from the host element.
81
- * The event's `detail` property contains the unmasked `realValue`.
82
- * This allows parent components (like your `InputComponent`) to listen for
83
- * changes to the actual password.
84
- */
85
- private dispatchRealValueChange;
86
- /**
87
- * Public method to get the current unmasked "real" password value.
88
- * @returns The real password value as a string.
89
- */
90
- getRealValue(): string;
91
- /**
92
- * Public method to set the "real" password value from outside the directive
93
- * (e.g., when the parent form control's value is changed programmatically).
94
- * It updates the internal `realValue` and then refreshes the masked display.
95
- * @param value - The new real password value to set.
96
- */
97
- setRealValue(value: string): void;
98
- static ɵfac: i0.ɵɵFactoryDeclaration<PasswordDirective, never>;
99
- static ɵdir: i0.ɵɵDirectiveDeclaration<PasswordDirective, "[appPassword]", never, { "appPassword": { "alias": "appPassword"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "account": { "alias": "account"; "required": false; "isSignal": true; }; "reveal": { "alias": "reveal"; "required": false; "isSignal": true; }; "appMask": { "alias": "appMask"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
100
- }