carriera-intern-components 0.0.993 → 0.0.995

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.
@@ -10,6 +10,10 @@ export declare class PasswordDirective implements OnInit {
10
10
  * Input property to hide or show the password
11
11
  */
12
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>;
13
17
  /**
14
18
  * Input property to specify how many characters from the end of the
15
19
  * password should be revealed. Defaults to 0 (fully masked).
@@ -90,5 +94,5 @@ export declare class PasswordDirective implements OnInit {
90
94
  */
91
95
  setRealValue(value: string): void;
92
96
  static ɵfac: i0.ɵɵFactoryDeclaration<PasswordDirective, never>;
93
- static ɵdir: i0.ɵɵDirectiveDeclaration<PasswordDirective, "[appPassword]", never, { "appPassword": { "alias": "appPassword"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "reveal": { "alias": "reveal"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
97
+ 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; }; }, {}, never, never, true, never>;
94
98
  }
@@ -1,4 +1,4 @@
1
- import { AfterViewInit, ElementRef } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, OnInit } from '@angular/core';
2
2
  import { ControlValueAccessor, NgControl } from '@angular/forms';
3
3
  import { PasswordDirective } from './directives/password.directive';
4
4
  import { NumberFormatDirective } from './directives/number-format.directive';
@@ -9,7 +9,7 @@ import * as i0 from "@angular/core";
9
9
  /**
10
10
  * This component is a generic input component that can be used to create various types of inputs.
11
11
  */
12
- export declare class InputComponent implements ControlValueAccessor, AfterViewInit {
12
+ export declare class InputComponent implements ControlValueAccessor, AfterViewInit, OnInit {
13
13
  ngControl: NgControl | null;
14
14
  inputRef: ElementRef<HTMLInputElement>;
15
15
  containerRef: ElementRef<HTMLInputElement>;
@@ -46,7 +46,7 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
46
46
  /**
47
47
  * Configuration object for the input's behavior and appearance.
48
48
  * It is provided by the parent component as an Angular `input()` signal.
49
- - `type`: HTML input type (`'text'`, `'password'`, `'number'`).
49
+ - `type`: HTML input type (`'text'`, `'password'`, `'account'`, `'number'`).
50
50
  - `name`: The HTML `name` attribute.
51
51
  - `required`: If `true`, the input is required for form submission.
52
52
  - `alignment`: Text alignment within the input (`'left'` or `'right'`).
@@ -54,7 +54,7 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
54
54
  - `reveal`: For password inputs, the number of characters to reveal from the end.
55
55
  - `icon`: Name of an icon to display (e.g., `'cai-email'`).
56
56
  - `iconColor`: Color of the displayed icon (e.g., `'#FF0000'`).
57
- - `dropdown`: If `true`, the input is associated with a dropdown menu, can also have `'dispatch'`, `'ftl-dispatch'`, `'broker'`, `'contact'`, `'shipper'`, `'dispatcher'`, `'truck'`, `'trailer'`, `'bank'` or `'label'` variants.
57
+ - `dropdown`: If `true`, the input is associated with a dropdown menu, can also have `'dispatch'`, `'ftl-dispatch'`, `'broker'`, `'contact'`, `'shipper'`, `'dispatcher'`, `'truck'`, `'trailer'`, `'bank'`, `'label'`, or `'subcontent'` variants.
58
58
  - `options`: An array of options for the dropdown can be of type `DropdownOption[]` | `LabelOption[]` | `DispatchBoard[]` | `Broker[]` | `DepartmentContactsPair[]` | `Shipper[]` | `Bank[]` | `Dispatcher[]`.
59
59
  - `labelColors`: An array of label colors for the label picker.
60
60
  - `search`: Enables search within the dropdown.
@@ -79,6 +79,8 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
79
79
  - `subContent`: An optional slot for additional content to be displayed next to the content the user is entering. (ex. lbs, months, etc.)
80
80
  - `removable`: If `true`, displays `cai-delete` icon over clear button.
81
81
  - `autofocus`: If `true`, the input will be focused when the component is initialized.
82
+ - `canOpenModal`: If `true`, the input can open a modal for adding new options.
83
+ - `customErrors`: An array of custom error messages to be displayed in the input.
82
84
  */
83
85
  config: import("@angular/core").InputSignal<CaiInputConfig>;
84
86
  /**
@@ -89,6 +91,10 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
89
91
  * Input property to hold the label colors for the label picker.
90
92
  */
91
93
  labelColors: import("@angular/core").InputSignal<LabelColor[] | undefined>;
94
+ /**
95
+ * Preselected dropdown option
96
+ */
97
+ preselectedUnit: import("@angular/core").InputSignal<string | null>;
92
98
  /**
93
99
  * Internal signal to track the disabled state of the input.
94
100
  */
@@ -98,7 +104,7 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
98
104
  */
99
105
  value: import("@angular/core").WritableSignal<string>;
100
106
  /**
101
- * Tracks the visibility state for inputs of `type='password'`.
107
+ * Tracks the visibility state for inputs of `type='password' and 'account'`.
102
108
  */
103
109
  visible: import("@angular/core").WritableSignal<boolean>;
104
110
  /**
@@ -156,6 +162,7 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
156
162
  * @param ngControl - Optional NgControl instance for form integration.
157
163
  */
158
164
  constructor(ngControl: NgControl | null);
165
+ ngOnInit(): void;
159
166
  ngAfterViewInit(): void;
160
167
  /**
161
168
  * Handles the native 'input' event from the HTMLInputElement.
@@ -174,6 +181,12 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
174
181
  onRealValueChange(event: CustomEvent): void;
175
182
  onChange: (_: any) => void;
176
183
  onTouched: () => void;
184
+ /**
185
+ * Dispatches the onChange event with the provided value.
186
+ * This method wraps the onChange call to provide a centralized way to handle value changes.
187
+ * @param value - The value to pass to onChange
188
+ */
189
+ dispatchOnChange(value: any): void;
177
190
  registerOnChange(fn: any): void;
178
191
  registerOnTouched(fn: any): void;
179
192
  setDisabledState(isDisabled: boolean): void;
@@ -238,7 +251,7 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
238
251
  * @param option - The selected option.
239
252
  * @param event - The MouseEvent that initiated the selection action.
240
253
  */
241
- handleOption(option: DropdownOptions): void;
254
+ handleOption(option: DropdownOptions, event?: MouseEvent): void;
242
255
  /**
243
256
  * Adds a new option to the dropdown.
244
257
  * @param option - The option to add.
@@ -267,5 +280,5 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
267
280
  castAsTruckOption(value: unknown): TruckType | null;
268
281
  castAsTrailerOption(value: unknown): TrailerType | null;
269
282
  static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, [{ optional: true; self: true; }]>;
270
- static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "cai-input", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "labelColors": { "alias": "labelColors"; "required": false; "isSignal": true; }; }, { "onOptionAdded": "onOptionAdded"; "onAdd": "onAdd"; "onSelectionChange": "onSelectionChange"; "onClear": "onClear"; }, never, never, true, never>;
283
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "cai-input", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "labelColors": { "alias": "labelColors"; "required": false; "isSignal": true; }; "preselectedUnit": { "alias": "preselectedUnit"; "required": false; "isSignal": true; }; }, { "onOptionAdded": "onOptionAdded"; "onAdd": "onAdd"; "onSelectionChange": "onSelectionChange"; "onClear": "onClear"; }, never, never, true, never>;
271
284
  }
@@ -1,6 +1,6 @@
1
1
  import { Bank, Broker, Contact, DepartmentContactsPair, Dispatch, DispatchBoard, Dispatcher, DropdownOption, LabelOption, Shipper, TrailerOption, TruckOption } from './dropdown.model';
2
2
  export interface CaiInputConfig {
3
- type?: 'text' | 'password' | 'number';
3
+ type?: 'text' | 'password' | 'number' | 'account';
4
4
  name?: string;
5
5
  required?: boolean;
6
6
  alignment?: 'left' | 'right';
@@ -28,12 +28,18 @@ export interface CaiInputConfig {
28
28
  inTable?: boolean;
29
29
  disabled?: boolean;
30
30
  passwordRequirements?: boolean;
31
+ canOpenModal?: boolean;
31
32
  optionValue?: string;
32
33
  optionLabel?: string;
33
34
  removable?: boolean;
34
35
  autofocus?: boolean;
36
+ customErrors?: CustomError[];
35
37
  }
36
- export declare const DropdownTypes: readonly ["dispatch", "ftl-dispatch", "label", "broker", "contact", "shipper", "bank", "dispatcher", "truck", "trailer"];
38
+ export type CustomError = {
39
+ name: string;
40
+ message: string | null;
41
+ };
42
+ export declare const DropdownTypes: readonly ["dispatch", "ftl-dispatch", "label", "broker", "contact", "shipper", "bank", "dispatcher", "truck", "trailer", "subcontent"];
37
43
  export type DropdownType = (typeof DropdownTypes)[number];
38
44
  export type DropdownArrays = DropdownOption[] | LabelOption[] | Broker[] | DispatchBoard[] | DepartmentContactsPair[] | Shipper[] | Dispatch[] | Bank[] | Dispatcher[] | TruckOption[] | TrailerOption[];
39
45
  export type DropdownOptions = DropdownOption | LabelOption | Broker | Contact | Shipper | Dispatch | Bank | Dispatcher | TruckOption | TrailerOption;
@@ -1,10 +1,11 @@
1
1
  import { PipeTransform } from '@angular/core';
2
2
  import { ValidationErrors } from '@angular/forms';
3
- import { NumberFormatPipe } from './number-format.pipe';
3
+ import { NumberFormatPipe } from '../../../pipes/number-format.pipe';
4
+ import { CustomError } from '../models/input.model';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class ErrorMessagePipe implements PipeTransform {
6
7
  numberFormatPipe: NumberFormatPipe;
7
- transform(errors: ValidationErrors | null | undefined): string[];
8
+ transform(errors: ValidationErrors | null | undefined, customErrors?: CustomError[]): string[];
8
9
  static ɵfac: i0.ɵɵFactoryDeclaration<ErrorMessagePipe, never>;
9
10
  static ɵpipe: i0.ɵɵPipeDeclaration<ErrorMessagePipe, "errorMessage", true>;
10
11
  }