carriera-intern-components 0.0.7 → 0.0.9

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 (48) hide show
  1. package/app/components/document-preview/document-preview.component.d.ts +8 -1
  2. package/app/components/drop-zone/drop-zone.component.d.ts +27 -1
  3. package/app/components/input/directives/mask.directive.d.ts +81 -0
  4. package/app/components/input/input.component.d.ts +43 -12
  5. package/app/components/input/models/index.d.ts +1 -1
  6. package/app/components/input/models/input.model.d.ts +30 -1
  7. package/fesm2022/carriera-intern-components.mjs +549 -42
  8. package/fesm2022/carriera-intern-components.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/public/assets/examplelargeview.png +0 -0
  11. package/public/assets/icons/Thumb.svg +3 -0
  12. package/public/assets/icons/{PrimaryArrowUp.svg → cai-arrow-primary-up.svg} +1 -1
  13. package/public/assets/icons/cai-date.svg +3 -0
  14. package/public/assets/icons/cai-dislike.svg +3 -0
  15. package/public/assets/icons/cai-driver.svg +3 -0
  16. package/public/assets/icons/cai-edit.svg +4 -0
  17. package/public/assets/icons/cai-illustration-dark.svg +4 -0
  18. package/public/assets/icons/cai-illustration-drop-zone-video.svg +41 -0
  19. package/public/assets/icons/cai-illustration.svg +18 -0
  20. package/public/assets/icons/cai-like.svg +3 -0
  21. package/public/assets/icons/cai-money.svg +3 -0
  22. package/public/assets/icons/cai-people.svg +3 -0
  23. package/public/assets/icons/cai-phone.svg +3 -0
  24. package/public/assets/icons/cai-search.svg +3 -0
  25. package/public/assets/icons/cai-share.svg +3 -0
  26. package/public/assets/icons/cai-sort-by.svg +3 -0
  27. package/public/assets/icons/trailers/ic_trailer_bottom-dump.svg +2 -2
  28. package/public/assets/json/icons.json +201 -40
  29. package/public/assets/icons/Driver.svg +0 -3
  30. /package/app/components/input/models/{planner.model.d.ts → dispatch.model.d.ts} +0 -0
  31. /package/public/assets/icons/{ArrowDown.svg → cai-arrow-secondary-down.svg} +0 -0
  32. /package/public/assets/icons/{ArrowLeft.svg → cai-arrow-secondary-left.svg} +0 -0
  33. /package/public/assets/icons/{ArrowRight.svg → cai-arrow-secondary-right.svg} +0 -0
  34. /package/public/assets/icons/{Cancel.svg → cai-cancel.svg} +0 -0
  35. /package/public/assets/icons/{Checkmark.svg → cai-checkmark.svg} +0 -0
  36. /package/public/assets/icons/{Delete.svg → cai-delete.svg} +0 -0
  37. /package/public/assets/icons/{Download.svg → cai-download.svg} +0 -0
  38. /package/public/assets/icons/{Email.svg → cai-email.svg} +0 -0
  39. /package/public/assets/icons/{drop-zone.svg → cai-illustration-drop-zone.svg} +0 -0
  40. /package/public/assets/icons/{Label.svg → cai-label.svg} +0 -0
  41. /package/public/assets/icons/{LTL.svg → cai-ltl-single.svg} +0 -0
  42. /package/public/assets/icons/{Minus.svg → cai-minus.svg} +0 -0
  43. /package/public/assets/icons/{PasswordHidden.svg → cai-password-hidden.svg} +0 -0
  44. /package/public/assets/icons/{PasswordKey.svg → cai-password-key.svg} +0 -0
  45. /package/public/assets/icons/{PasswordShown.svg → cai-password-shown.svg} +0 -0
  46. /package/public/assets/icons/{Plus.svg → cai-plus.svg} +0 -0
  47. /package/public/assets/icons/{Reset.svg → cai-reset.svg} +0 -0
  48. /package/public/assets/icons/{Warning.svg → cai-status-warning.svg} +0 -0
@@ -13,6 +13,12 @@ export declare class DocumentPreviewComponent {
13
13
  * @type {InputSignal<AppFile>}
14
14
  */
15
15
  file: import("@angular/core").InputSignal<AppFile>;
16
+ /**
17
+ * /**
18
+ * The view mode in whic the file is displayed. This is a required input.
19
+ * @type {InputSignal<string>}
20
+ */
21
+ viewMode: import("@angular/core").InputSignal<string>;
16
22
  /**
17
23
  * An output event that emits the file name when the delete action is triggered.
18
24
  * @type {OutputEmitterRef<string>}
@@ -47,6 +53,7 @@ export declare class DocumentPreviewComponent {
47
53
  }>;
48
54
  getTag(newTag: string): void;
49
55
  removeTag(): void;
56
+ handleShare(): void;
50
57
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentPreviewComponent, never>;
51
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentPreviewComponent, "app-document-preview", never, { "file": { "alias": "file"; "required": true; "isSignal": true; }; }, { "onDelete": "onDelete"; "onDownload": "onDownload"; "onTagChange": "onTagChange"; }, never, never, true, never>;
58
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentPreviewComponent, "cai-document-preview", never, { "file": { "alias": "file"; "required": true; "isSignal": true; }; "viewMode": { "alias": "viewMode"; "required": true; "isSignal": true; }; }, { "onDelete": "onDelete"; "onDownload": "onDownload"; "onTagChange": "onTagChange"; }, never, never, true, never>;
52
59
  }
@@ -1,5 +1,7 @@
1
1
  import { ElementRef } from '@angular/core';
2
2
  import { AppFile } from '../../models/appFile.model';
3
+ import { ImageCroppedEvent, LoadedImage, ImageTransform } from 'ngx-image-cropper';
4
+ import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
3
5
  import * as i0 from "@angular/core";
4
6
  /**
5
7
  * A component that provides a user interface for file uploading via
@@ -7,6 +9,24 @@ import * as i0 from "@angular/core";
7
9
  * selected files in a carousel.
8
10
  */
9
11
  export declare class DropZoneComponent {
12
+ private sanitizer;
13
+ zoomValue: import("@angular/core").WritableSignal<number>;
14
+ transform: ImageTransform;
15
+ crop: import("@angular/core").InputSignal<boolean>;
16
+ imageChangedEvent: Event | null;
17
+ croppedImage: SafeUrl | null;
18
+ showCropper: import("@angular/core").WritableSignal<boolean>;
19
+ isCropperReady: import("@angular/core").WritableSignal<boolean>;
20
+ constructor(sanitizer: DomSanitizer);
21
+ updateRangeBackground(input: HTMLInputElement): void;
22
+ onZoomChange(event: Event): void;
23
+ fileChangeEvent(event: Event): void;
24
+ imageCropped(event: ImageCroppedEvent): void;
25
+ imageLoaded(image: LoadedImage): void;
26
+ cropperReady(): void;
27
+ loadImageFailed(): void;
28
+ cancelCrop(): void;
29
+ submitCrop(): void;
10
30
  /**
11
31
  * Injects the DocumentService for file processing tasks like
12
32
  * thumbnail generation and PDF page counting.
@@ -39,6 +59,12 @@ export declare class DropZoneComponent {
39
59
  * that have been selected or dropped by the user.
40
60
  */
41
61
  docs: import("@angular/core").WritableSignal<AppFile[]>;
62
+ /**
63
+ * A signal that holds an array of `AppFile` objects representing the files
64
+ * that have been selected or dropped by the user.
65
+
66
+ */
67
+ variant: import("@angular/core").InputSignal<string>;
42
68
  /**
43
69
  * A signal that acts as a boolean flag. It is set to `true` when the user
44
70
  * attempts to upload a file with an unsupported extension.
@@ -120,5 +146,5 @@ export declare class DropZoneComponent {
120
146
  tag: string;
121
147
  }): void;
122
148
  static ɵfac: i0.ɵɵFactoryDeclaration<DropZoneComponent, never>;
123
- static ɵcmp: i0.ɵɵComponentDeclaration<DropZoneComponent, "app-drop-zone", never, { "excludedFileTypes": { "alias": "excludedFileTypes"; "required": false; "isSignal": true; }; "fileTypes": { "alias": "fileTypes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
149
+ static ɵcmp: i0.ɵɵComponentDeclaration<DropZoneComponent, "app-drop-zone", never, { "crop": { "alias": "crop"; "required": false; "isSignal": true; }; "excludedFileTypes": { "alias": "excludedFileTypes"; "required": false; "isSignal": true; }; "fileTypes": { "alias": "fileTypes"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
124
150
  }
@@ -0,0 +1,81 @@
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
+ /**
15
+ * Stores the unmasked, "real" value of the input, containing only
16
+ * the characters entered by the user that fit the mask placeholders.
17
+ */
18
+ private realValue;
19
+ constructor(el: ElementRef<HTMLInputElement>);
20
+ ngOnInit(): void;
21
+ /**
22
+ * HostListener for the 'input' event. This is the primary handler for
23
+ * formatting the value as the user types or pastes.
24
+ */
25
+ onInput(event: InputEvent): void;
26
+ /**
27
+ * HostListener for the 'paste' event. It intercepts pasted content,
28
+ * cleans it, and integrates it into the masked value.
29
+ */
30
+ onPaste(event: ClipboardEvent): void;
31
+ /**
32
+ * HostListener for the 'copy' event. Ensures that copying a selection
33
+ * from the input copies the unmasked, "real" value.
34
+ */
35
+ onCopy(event: ClipboardEvent): void;
36
+ /**
37
+ * HostListener for the 'cut' event. Ensures cutting a selection removes
38
+ * the corresponding part from the real value and reformats the input.
39
+ */
40
+ onCut(event: ClipboardEvent): void;
41
+ /**
42
+ * HostListener for the 'keydown' event. It validates key presses against
43
+ * the mask pattern, preventing invalid characters from being entered.
44
+ */
45
+ onKeydown(event: KeyboardEvent): void;
46
+ /**
47
+ * The core formatting logic. It takes a value, extracts the valid user
48
+ * input, applies the mask, updates the display, and dispatches the change.
49
+ * @param value The current value from the input field.
50
+ */
51
+ private formatValue;
52
+ /**
53
+ * Applies the mask to a given string of user input.
54
+ * @param realValue The clean user input.
55
+ * @param mask The mask pattern.
56
+ * @returns An object with the formatted value and the final real value.
57
+ */
58
+ private applyMask;
59
+ /**
60
+ * Extracts valid user input characters from a string.
61
+ * @param value The string to clean.
62
+ * @returns A string containing only valid mask characters (digits/letters).
63
+ */
64
+ private extractUserInput;
65
+ private isPlaceholder;
66
+ private charMatchesPlaceholder;
67
+ private setCursorToEnd;
68
+ private dispatchRealValueChange;
69
+ /**
70
+ * Public method to get the current unmasked "real" value.
71
+ * @returns The real value as a string.
72
+ */
73
+ getRealValue(): string;
74
+ /**
75
+ * Public method to set the "real" value from outside the directive.
76
+ * @param value The new value to set.
77
+ */
78
+ setRealValue(value: string): void;
79
+ static ɵfac: i0.ɵɵFactoryDeclaration<MaskDirective, never>;
80
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MaskDirective, "[appMask]", never, { "appMask": { "alias": "appMask"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
81
+ }
@@ -3,8 +3,9 @@ import { ControlValueAccessor, NgControl } from '@angular/forms';
3
3
  import { PasswordDirective } from '../../directives/password.directive';
4
4
  import { NumberFormatDirective } from '../../directives/number-format.directive';
5
5
  import { NgbPopover } from '@ng-bootstrap/ng-bootstrap';
6
- import { CaiInputConfig, DropdownOption } from './models/input.model';
6
+ import { CaiInputConfig, DropdownOption, LabelColor, LabelOption } from './models/input.model';
7
7
  import { Dispatch, DispatchBoard } from './models';
8
+ import { MaskDirective } from './directives/mask.directive';
8
9
  import * as i0 from "@angular/core";
9
10
  /**
10
11
  * A reusable input component that integrates with Angular Forms and supports
@@ -16,17 +17,36 @@ export declare class InputComponent implements ControlValueAccessor {
16
17
  ngControl: NgControl | null;
17
18
  /**
18
19
  * Defines the unique identifier for the input element.
19
- * This ID is crucial for accessibility, linking the `<label>` to the
20
- * native `<input>` via the `for` attribute.
21
20
  * It is provided by the parent component as an Angular `input()` signal.
22
21
  */
23
22
  id: import("@angular/core").InputSignal<string>;
24
23
  /**
25
24
  * Configuration object for the input's behavior and appearance.
26
- * This `input()` signal accepts an `InputConfig` object to customize
27
- * properties like the input type (`text`, `password`, `number`),
28
- * placeholder/label text (`name`), validation (`required`), and other
29
- * special behaviors.
25
+ * It is provided by the parent component as an Angular `input()` signal.
26
+ - `type`: HTML input type (`'text'`, `'password'`, `'number'`).
27
+ - `name`: The HTML `name` attribute.
28
+ - `required`: If `true`, the input is required for form submission.
29
+ - `alignment`: Text alignment within the input (`'left'` or `'right'`).
30
+ - `inverse`: If `true`, renders the input in a dark mode style.
31
+ - `reveal`: For password inputs, the number of characters to reveal from the end.
32
+ - `icon`: Name of an icon to display (e.g., `'cai-email'`).
33
+ - `iconColor`: Color of the displayed icon (e.g., `'#FF0000'`).
34
+ - `dropdown`: If `true`, the input is associated with a dropdown.
35
+ - `search`: Enables search within the dropdown.
36
+ - `add`: Enables 'add new' functionality in the dropdown.
37
+ - `dispatch`: If `true`, shows the dispatch modal as a dropdown.
38
+ - `placeholderBehavior`: Defines placeholder animation (`'dynamic'` , `'fade'`, `'static'`).
39
+ - `label`: An `aria-label` for accessibility.
40
+ - `labelPicker`: If `true`, the input is associated with a label picker.
41
+ - `list`: If `true`, the input is associated with a list.
42
+ - `labels`: An array of label options for the label picker.
43
+ - `labelColors`: An array of label colors for the label picker.
44
+ - `mask`: A pattern string for input masking (e.g., `'(000) 000-0000'`).
45
+ - `min`: Minimum value for number inputs.
46
+ - `max`: Maximum value for number inputs or maximum length for text inputs.
47
+ - `withButtons`: If `true`, adds increment/decrement buttons for number inputs.
48
+ - `autocomplete`: The HTML `autocomplete` attribute.
49
+ - `disabled`: If `true`, the input is disabled (for use without reactive form).
30
50
  */
31
51
  config: import("@angular/core").InputSignal<CaiInputConfig>;
32
52
  /**
@@ -63,6 +83,7 @@ export declare class InputComponent implements ControlValueAccessor {
63
83
  inputRef: ElementRef<HTMLInputElement>;
64
84
  PasswordDirective: PasswordDirective;
65
85
  NumberFormatDirective: NumberFormatDirective;
86
+ MaskDirective: MaskDirective;
66
87
  dropdown: NgbPopover;
67
88
  /**
68
89
  * Constructor for the InputComponent.
@@ -217,12 +238,13 @@ export declare class InputComponent implements ControlValueAccessor {
217
238
  * @param option - The selected option.
218
239
  * @param event - The MouseEvent that initiated the selection action.
219
240
  */
220
- handleOption(option: DropdownOption, event: MouseEvent): void;
241
+ handleOption(option: DropdownOption, event?: MouseEvent): void;
221
242
  /**
222
243
  * An output signal that emits the value of the added option.
223
244
  * @type {Output<string>}
224
245
  */
225
- onConfirm: import("@angular/core").OutputEmitterRef<string>;
246
+ onOptionAdded: import("@angular/core").OutputEmitterRef<DropdownOption>;
247
+ onLabelAdded: import("@angular/core").OutputEmitterRef<LabelOption>;
226
248
  /**
227
249
  * Adds a new option to the dropdown.
228
250
  * @param option - The option to add.
@@ -233,7 +255,7 @@ export declare class InputComponent implements ControlValueAccessor {
233
255
  * It sets the `isAdding` signal to `true`, closes the dropdown, and focuses the input.
234
256
  * @param event - The MouseEvent that initiated the action.
235
257
  */
236
- handleAddOption(event: MouseEvent): void;
258
+ handleAddOption(event?: MouseEvent): void;
237
259
  /**
238
260
  * A signal that indicates whether a new option is being added.
239
261
  * @type {Signal<boolean>}
@@ -247,10 +269,19 @@ export declare class InputComponent implements ControlValueAccessor {
247
269
  dispatches: import("@angular/core").InputSignal<DispatchBoard[] | undefined>;
248
270
  dispatchCount: import("@angular/core").Signal<number>;
249
271
  filteredDispatches: import("@angular/core").Signal<DispatchBoard[]>;
250
- handlePlannerOption(option: Dispatch, event: MouseEvent): void;
272
+ handleDispatchOption(option: Dispatch, event?: MouseEvent): void;
251
273
  selectedDispatch: import("@angular/core").WritableSignal<Dispatch | null>;
252
274
  foldedBoards: import("@angular/core").WritableSignal<number[]>;
253
275
  fold(boardId: number, event: MouseEvent): void;
276
+ labels: import("@angular/core").InputSignal<LabelOption[] | undefined>;
277
+ labelColors: import("@angular/core").InputSignal<LabelColor[] | undefined>;
278
+ localLabels: import("@angular/core").WritableSignal<LabelOption[]>;
279
+ filteredLabels: import("@angular/core").Signal<LabelOption[]>;
280
+ selectedLabel: import("@angular/core").WritableSignal<LabelOption | null>;
281
+ selectedColor: import("@angular/core").WritableSignal<LabelColor>;
282
+ handleLabelOption(option: LabelOption, event?: MouseEvent): void;
283
+ isPickingColor: import("@angular/core").WritableSignal<boolean>;
284
+ handleSelectColor(color: LabelColor, event?: MouseEvent): void;
254
285
  static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, [{ optional: true; self: true; }]>;
255
- static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "cai-input", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "dropdownOptions": { "alias": "dropdownOptions"; "required": false; "isSignal": true; }; "dispatches": { "alias": "dispatches"; "required": false; "isSignal": true; }; }, { "onConfirm": "onConfirm"; }, never, never, true, never>;
286
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "cai-input", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "dropdownOptions": { "alias": "dropdownOptions"; "required": false; "isSignal": true; }; "dispatches": { "alias": "dispatches"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "labelColors": { "alias": "labelColors"; "required": false; "isSignal": true; }; }, { "onOptionAdded": "onOptionAdded"; "onLabelAdded": "onLabelAdded"; }, never, never, true, never>;
256
287
  }
@@ -1,2 +1,2 @@
1
1
  export * from './input.model';
2
- export * from './planner.model';
2
+ export * from './dispatch.model';
@@ -6,12 +6,41 @@ export interface CaiInputConfig {
6
6
  inverse?: boolean;
7
7
  reveal?: number;
8
8
  icon?: string | null;
9
+ iconColor?: string;
9
10
  dropdown?: boolean;
10
11
  search?: boolean;
11
12
  add?: boolean;
12
- planner?: boolean;
13
+ dispatch?: boolean;
14
+ labelPicker?: boolean;
15
+ placeholderBehavior?: 'dynamic' | 'fade' | 'static';
16
+ label?: string;
17
+ mask?: string;
18
+ min?: number;
19
+ max?: number;
20
+ withButtons?: boolean;
21
+ autocomplete?: string;
22
+ list?: boolean;
23
+ disabled?: boolean;
13
24
  }
14
25
  export type DropdownOption = {
15
26
  id: string;
16
27
  label: string;
17
28
  };
29
+ export type LabelOption = {
30
+ id?: number;
31
+ name?: string | null;
32
+ colorId?: number;
33
+ color?: string | null;
34
+ code?: string | null;
35
+ hoverCode?: string | null;
36
+ count?: number;
37
+ createdAt?: string;
38
+ updatedAt?: string;
39
+ };
40
+ export type LabelColor = {
41
+ id?: number;
42
+ name?: string | null;
43
+ code?: string | null;
44
+ hoverCode?: string | null;
45
+ count?: number;
46
+ };