carriera-intern-components 0.0.998 → 1.1.0

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 (92) hide show
  1. package/app/components/input/directives/number-format.directive.d.ts +6 -1
  2. package/app/components/input/input.component.d.ts +39 -6
  3. package/app/components/input/models/dropdown.model.d.ts +30 -0
  4. package/app/components/input/models/input.model.d.ts +6 -5
  5. package/app/utils/autofill-validators.d.ts +10 -0
  6. package/app/utils/index.d.ts +1 -0
  7. package/fesm2022/carriera-intern-components.mjs +289 -23
  8. package/fesm2022/carriera-intern-components.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/public/assets/icons/cai-gps.svg +3 -0
  11. package/public/assets/icons/general/cai-address.svg +3 -0
  12. package/public/assets/icons/hazardous/ic_corrosive_8.svg +6 -0
  13. package/public/assets/icons/hazardous/ic_dangerous_when_wet_4.svg +4 -0
  14. package/public/assets/icons/hazardous/ic_explosives_1_1.svg +6 -0
  15. package/public/assets/icons/hazardous/ic_explosives_1_2.svg +6 -0
  16. package/public/assets/icons/hazardous/ic_explosives_1_3.svg +6 -0
  17. package/public/assets/icons/hazardous/ic_explosives_1_4.svg +6 -0
  18. package/public/assets/icons/hazardous/ic_explosives_1_5.svg +6 -0
  19. package/public/assets/icons/hazardous/ic_explosives_1_6.svg +6 -0
  20. package/public/assets/icons/hazardous/ic_flammable_3.svg +4 -0
  21. package/public/assets/icons/hazardous/ic_flammable_gas_2.svg +4 -0
  22. package/public/assets/icons/hazardous/ic_flammable_solid_4.svg +5 -0
  23. package/public/assets/icons/hazardous/ic_inhalation_hazzard_2.svg +5 -0
  24. package/public/assets/icons/hazardous/ic_inhalation_hazzard_6.svg +5 -0
  25. package/public/assets/icons/hazardous/ic_organic_peroxide_5_2.svg +7 -0
  26. package/public/assets/icons/hazardous/ic_oxidizer_5_1.svg +6 -0
  27. package/public/assets/icons/hazardous/ic_oxygen_non_flam_gas_2.svg +6 -0
  28. package/public/assets/icons/hazardous/ic_radioactive_7.svg +5 -0
  29. package/public/assets/icons/hazardous/ic_spontaneously_combustible_4.svg +5 -0
  30. package/public/assets/icons/states/ca/cai-ca-ab.svg +3 -0
  31. package/public/assets/icons/states/ca/cai-ca-bc.svg +35 -0
  32. package/public/assets/icons/states/ca/cai-ca-mb.svg +3 -0
  33. package/public/assets/icons/states/ca/cai-ca-nb.svg +7 -0
  34. package/public/assets/icons/states/ca/cai-ca-nl.svg +4 -0
  35. package/public/assets/icons/states/ca/cai-ca-ns.svg +6 -0
  36. package/public/assets/icons/states/ca/cai-ca-on.svg +7 -0
  37. package/public/assets/icons/states/ca/cai-ca-pe.svg +3 -0
  38. package/public/assets/icons/states/ca/cai-ca-qc.svg +4 -0
  39. package/public/assets/icons/states/ca/cai-ca-sk.svg +3 -0
  40. package/public/assets/icons/states/ca/cai-ca-yt.svg +3 -0
  41. package/public/assets/icons/states/us/cai-us-ak.svg +14 -0
  42. package/public/assets/icons/states/us/cai-us-al.svg +3 -0
  43. package/public/assets/icons/states/us/cai-us-ar.svg +3 -0
  44. package/public/assets/icons/states/us/cai-us-az.svg +3 -0
  45. package/public/assets/icons/states/us/cai-us-ca.svg +3 -0
  46. package/public/assets/icons/states/us/cai-us-co.svg +3 -0
  47. package/public/assets/icons/states/us/cai-us-ct.svg +3 -0
  48. package/public/assets/icons/states/us/cai-us-de.svg +3 -0
  49. package/public/assets/icons/states/us/cai-us-fl.svg +3 -0
  50. package/public/assets/icons/states/us/cai-us-ga.svg +3 -0
  51. package/public/assets/icons/states/us/cai-us-hi.svg +10 -0
  52. package/public/assets/icons/states/us/cai-us-ia.svg +3 -0
  53. package/public/assets/icons/states/us/cai-us-id.svg +3 -0
  54. package/public/assets/icons/states/us/cai-us-il.svg +3 -0
  55. package/public/assets/icons/states/us/cai-us-in.svg +3 -0
  56. package/public/assets/icons/states/us/cai-us-ks.svg +3 -0
  57. package/public/assets/icons/states/us/cai-us-ky.svg +3 -0
  58. package/public/assets/icons/states/us/cai-us-la.svg +4 -0
  59. package/public/assets/icons/states/us/cai-us-ma.svg +7 -0
  60. package/public/assets/icons/states/us/cai-us-md.svg +7 -0
  61. package/public/assets/icons/states/us/cai-us-me.svg +9 -0
  62. package/public/assets/icons/states/us/cai-us-mi.svg +11 -0
  63. package/public/assets/icons/states/us/cai-us-mn.svg +4 -0
  64. package/public/assets/icons/states/us/cai-us-mo.svg +3 -0
  65. package/public/assets/icons/states/us/cai-us-ms.svg +3 -0
  66. package/public/assets/icons/states/us/cai-us-mt.svg +3 -0
  67. package/public/assets/icons/states/us/cai-us-nc.svg +3 -0
  68. package/public/assets/icons/states/us/cai-us-nd.svg +3 -0
  69. package/public/assets/icons/states/us/cai-us-ne.svg +3 -0
  70. package/public/assets/icons/states/us/cai-us-nh.svg +3 -0
  71. package/public/assets/icons/states/us/cai-us-nj.svg +5 -0
  72. package/public/assets/icons/states/us/cai-us-nm.svg +3 -0
  73. package/public/assets/icons/states/us/cai-us-nv.svg +3 -0
  74. package/public/assets/icons/states/us/cai-us-ny.svg +4 -0
  75. package/public/assets/icons/states/us/cai-us-oh.svg +4 -0
  76. package/public/assets/icons/states/us/cai-us-ok.svg +3 -0
  77. package/public/assets/icons/states/us/cai-us-or.svg +3 -0
  78. package/public/assets/icons/states/us/cai-us-pa.svg +3 -0
  79. package/public/assets/icons/states/us/cai-us-ri.svg +8 -0
  80. package/public/assets/icons/states/us/cai-us-sc.svg +3 -0
  81. package/public/assets/icons/states/us/cai-us-sd.svg +3 -0
  82. package/public/assets/icons/states/us/cai-us-tn.svg +3 -0
  83. package/public/assets/icons/states/us/cai-us-tx.svg +3 -0
  84. package/public/assets/icons/states/us/cai-us-ut.svg +3 -0
  85. package/public/assets/icons/states/us/cai-us-va.svg +4 -0
  86. package/public/assets/icons/states/us/cai-us-vt.svg +7 -0
  87. package/public/assets/icons/states/us/cai-us-wa.svg +15 -0
  88. package/public/assets/icons/states/us/cai-us-wi.svg +4 -0
  89. package/public/assets/icons/states/us/cai-us-wv.svg +3 -0
  90. package/public/assets/icons/states/us/cai-us-wy.svg +3 -0
  91. package/public/assets/json/icons.json +337 -13
  92. package/public-api.d.ts +1 -0
@@ -11,6 +11,11 @@ export declare class NumberFormatDirective implements OnInit {
11
11
  *
12
12
  */
13
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>;
14
19
  prefix: import("@angular/core").InputSignal<string>;
15
20
  /**
16
21
  * Stores the unformatted, "real" numeric value of the input.
@@ -106,5 +111,5 @@ export declare class NumberFormatDirective implements OnInit {
106
111
  */
107
112
  setRealValue(value: string): void;
108
113
  static ɵfac: i0.ɵɵFactoryDeclaration<NumberFormatDirective, never>;
109
- static ɵdir: i0.ɵɵDirectiveDeclaration<NumberFormatDirective, "[appNumberFormat]", never, { "appNumberFormat": { "alias": "appNumberFormat"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "prefix": { "alias": "prefix"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
114
+ 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; }; "prefix": { "alias": "prefix"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
110
115
  }
@@ -1,16 +1,17 @@
1
- import { AfterViewInit, ElementRef, OnInit } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, OnInit, ChangeDetectorRef } 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';
5
5
  import { MaskDirective } from './directives/mask.directive';
6
6
  import { NgbPopover } from '@ng-bootstrap/ng-bootstrap';
7
- import { Bank, Broker, CaiInputConfig, Contact, Dispatcher, DropdownOption, LabelColor, LabelOption, Shipper, Dispatch, DropdownArrays, DropdownOptions, TruckType, TrailerType } from './models';
7
+ import { Bank, Broker, CaiInputConfig, Contact, Dispatcher, DropdownOption, LabelColor, LabelOption, Shipper, Dispatch, DropdownArrays, DropdownOptions, TruckType, TrailerType, Hazardous, State, Owner, FuelCard } from './models';
8
8
  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
12
  export declare class InputComponent implements ControlValueAccessor, AfterViewInit, OnInit {
13
13
  ngControl: NgControl | null;
14
+ private cdr;
14
15
  inputRef: ElementRef<HTMLInputElement>;
15
16
  containerRef: ElementRef<HTMLInputElement>;
16
17
  dropdown: NgbPopover;
@@ -18,6 +19,7 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
18
19
  PasswordDirective: PasswordDirective;
19
20
  NumberFormatDirective: NumberFormatDirective;
20
21
  MaskDirective: MaskDirective;
22
+ hazardousRef: any;
21
23
  dropdownOptionsRef: any;
22
24
  dispatchesRef: any;
23
25
  ftlDispatchRef: any;
@@ -29,6 +31,11 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
29
31
  dispatcherRef: any;
30
32
  truckRef: any;
31
33
  trailerRef: any;
34
+ stateRef: any;
35
+ ownerRef: any;
36
+ fuelcardRef: any;
37
+ selectedOwnerRef: any;
38
+ selectedHazardousRef: any;
32
39
  selectedDispatchRef: any;
33
40
  selectedLabelRef: any;
34
41
  selectedBrokerRef: any;
@@ -38,6 +45,8 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
38
45
  selectedDispatcherRef: any;
39
46
  selectedTruckRef: any;
40
47
  selectedTrailerRef: any;
48
+ selectedStateRef: any;
49
+ selectedFuelcardRef: any;
41
50
  /**
42
51
  * Defines the unique identifier for the input element.
43
52
  * It is provided by the parent component as an Angular `input()` signal.
@@ -54,8 +63,8 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
54
63
  - `reveal`: For password inputs, the number of characters to reveal from the end.
55
64
  - `icon`: Name of an icon to display (e.g., `'cai-email'`).
56
65
  - `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'`, `'label'`, or `'subcontent'` variants.
58
- - `options`: An array of options for the dropdown can be of type `DropdownOption[]` | `LabelOption[]` | `DispatchBoard[]` | `Broker[]` | `DepartmentContactsPair[]` | `Shipper[]` | `Bank[]` | `Dispatcher[]`.
66
+ - `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'`, `'state'`, `'owner'`, `'fuelcard'`, or `'subcontent'` variants.
67
+ - `options`: An array of options for the dropdown can be of type `DropdownOption[]` | `LabelOption[]` | `DispatchBoard[]` | `Broker[]` | `DepartmentContactsPair[]` | `Shipper[]` | `Bank[]` | `Dispatcher[]` | `TruckOption[]` | `TrailerOption[]` | `Hazardous[]` | `State[]` | `Owner[]` | `FuelCard[]`.
59
68
  - `labelColors`: An array of label colors for the label picker.
60
69
  - `search`: Enables search within the dropdown.
61
70
  - `add`: Enables 'add new' functionality in the dropdown.
@@ -81,6 +90,7 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
81
90
  - `autofocus`: If `true`, the input will be focused when the component is initialized.
82
91
  - `canOpenModal`: If `true`, the input can open a modal for adding new options.
83
92
  - `customErrors`: An array of custom error messages to be displayed in the input.
93
+ - `isNumberFormattingDisabled`: If `true`, the input will not be formatted as a number.
84
94
  */
85
95
  config: import("@angular/core").InputSignal<CaiInputConfig>;
86
96
  /**
@@ -119,6 +129,10 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
119
129
  * A signal that indicates whether a new option is being added.
120
130
  */
121
131
  isAdding: import("@angular/core").WritableSignal<boolean>;
132
+ /**
133
+ * A signal that tracks whether the field has been autofilled.
134
+ */
135
+ isAutofilled: import("@angular/core").WritableSignal<boolean>;
122
136
  /**
123
137
  * A signal that holds the currently selected color from the label picker.
124
138
  */
@@ -160,10 +174,25 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
160
174
  * If NgControl is present, it sets this component as the value accessor
161
175
  * for the form control.
162
176
  * @param ngControl - Optional NgControl instance for form integration.
177
+ * @param cdr - ChangeDetectorRef for manual change detection.
178
+ */
179
+ constructor(ngControl: NgControl | null, cdr: ChangeDetectorRef);
180
+ /**
181
+ * Handles autofill detection from Chrome's autofill animation.
182
+ * Marks the control as autofilled and updates validity.
163
183
  */
164
- constructor(ngControl: NgControl | null);
184
+ onAutofill(): void;
185
+ /**
186
+ * Clears the autofill flag when user manually edits the field.
187
+ * Re-enables normal validation.
188
+ */
189
+ clearAutofillFlag(): void;
165
190
  ngOnInit(): void;
166
191
  ngAfterViewInit(): void;
192
+ /**
193
+ * Sets up autofill detection by checking for Chrome's -webkit-autofill CSS pseudo-class
194
+ */
195
+ private setupAutofillDetection;
167
196
  /**
168
197
  * Handles the native 'input' event from the HTMLInputElement.
169
198
  * Updates the component's internal value and notifies Angular forms
@@ -279,6 +308,10 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
279
308
  castAsDropdownOption(value: unknown): DropdownOption | null;
280
309
  castAsTruckOption(value: unknown): TruckType | null;
281
310
  castAsTrailerOption(value: unknown): TrailerType | null;
282
- static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, [{ optional: true; self: true; }]>;
311
+ castAsHazardous(value: unknown): Hazardous | null;
312
+ castAsState(value: unknown): State | null;
313
+ castAsOwner(value: unknown): Owner | null;
314
+ castAsFuelCard(value: unknown): FuelCard | null;
315
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, [{ optional: true; self: true; }, null]>;
283
316
  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>;
284
317
  }
@@ -192,3 +192,33 @@ export type TrailerOption = {
192
192
  logoName: string;
193
193
  hasVolume?: boolean | null;
194
194
  };
195
+ export type Hazardous = {
196
+ id?: number;
197
+ class?: number;
198
+ division?: number;
199
+ group?: string;
200
+ description?: string;
201
+ notes?: string;
202
+ logoName?: string;
203
+ };
204
+ export type State = {
205
+ id?: number;
206
+ countryType?: {
207
+ name: string;
208
+ id: number;
209
+ };
210
+ stateShortName?: string;
211
+ stateName?: string;
212
+ counter?: number | null;
213
+ };
214
+ export type Owner = {
215
+ id?: number;
216
+ name?: string | null;
217
+ ein?: string | null;
218
+ };
219
+ export type FuelCard = {
220
+ id?: number;
221
+ number?: string | null;
222
+ brand?: string | null;
223
+ account?: string | null;
224
+ };
@@ -1,4 +1,4 @@
1
- import { Bank, Broker, Contact, DepartmentContactsPair, Dispatch, DispatchBoard, Dispatcher, DropdownOption, LabelOption, Shipper, TrailerOption, TruckOption } from './dropdown.model';
1
+ import { Bank, Broker, Contact, DepartmentContactsPair, Dispatch, DispatchBoard, Dispatcher, DropdownOption, LabelOption, Shipper, TrailerOption, TruckOption, Hazardous, State, Owner, FuelCard } from './dropdown.model';
2
2
  export interface CaiInputConfig {
3
3
  type?: 'text' | 'password' | 'number' | 'account';
4
4
  name?: string;
@@ -13,6 +13,7 @@ export interface CaiInputConfig {
13
13
  add?: boolean;
14
14
  subcontent?: string;
15
15
  textTransform?: 'capitalize' | 'uppercase' | 'lowercase';
16
+ isNumberFormattingDisabled?: boolean;
16
17
  textColor?: 'positive';
17
18
  placeholderBehavior?: 'dynamic' | 'fade' | 'static';
18
19
  errorBehavior?: 'dynamic' | 'static' | 'floating';
@@ -39,8 +40,8 @@ export type CustomError = {
39
40
  name: string;
40
41
  message: string | null;
41
42
  };
42
- export declare const DropdownTypes: readonly ["dispatch", "ftl-dispatch", "label", "broker", "contact", "shipper", "bank", "dispatcher", "truck", "trailer", "subcontent"];
43
+ export declare const DropdownTypes: readonly ["dispatch", "ftl-dispatch", "label", "broker", "contact", "shipper", "bank", "dispatcher", "truck", "trailer", "subcontent", "hazardous", "state", "owner", "fuelcard"];
43
44
  export type DropdownType = (typeof DropdownTypes)[number];
44
- export type DropdownArrays = DropdownOption[] | LabelOption[] | Broker[] | DispatchBoard[] | DepartmentContactsPair[] | Shipper[] | Dispatch[] | Bank[] | Dispatcher[] | TruckOption[] | TrailerOption[];
45
- export type DropdownOptions = DropdownOption | LabelOption | Broker | Contact | Shipper | Dispatch | Bank | Dispatcher | TruckOption | TrailerOption;
46
- export type DropdownKeys = DropdownOption[keyof DropdownOption] | LabelOption[keyof LabelOption] | Dispatch[keyof Dispatch] | Broker[keyof Broker] | Contact[keyof Contact] | Shipper[keyof Shipper] | Bank[keyof Bank] | Dispatcher[keyof Dispatcher] | TruckOption[keyof TruckOption] | TrailerOption[keyof TrailerOption];
45
+ export type DropdownArrays = DropdownOption[] | LabelOption[] | Broker[] | DispatchBoard[] | DepartmentContactsPair[] | Shipper[] | Dispatch[] | Bank[] | Dispatcher[] | TruckOption[] | TrailerOption[] | Hazardous[] | State[] | Owner[] | FuelCard[];
46
+ export type DropdownOptions = DropdownOption | LabelOption | Broker | Contact | Shipper | Dispatch | Bank | Dispatcher | TruckOption | TrailerOption | Hazardous | State | Owner | FuelCard;
47
+ export type DropdownKeys = DropdownOption[keyof DropdownOption] | LabelOption[keyof LabelOption] | Dispatch[keyof Dispatch] | Broker[keyof Broker] | Contact[keyof Contact] | Shipper[keyof Shipper] | Bank[keyof Bank] | Dispatcher[keyof Dispatcher] | TruckOption[keyof TruckOption] | TrailerOption[keyof TrailerOption] | Hazardous[keyof Hazardous] | State[keyof State] | Owner[keyof Owner] | FuelCard[keyof FuelCard];
@@ -0,0 +1,10 @@
1
+ import { ValidatorFn, ValidationErrors } from '@angular/forms';
2
+ type FlexibleValidatorFn = (control: any) => ValidationErrors | null;
3
+ /**
4
+ * Creates a validator that ignores validation rules when the control is autofilled.
5
+ * This can be used by components to create form controls with autofill support.
6
+ * @param validators - Array of validators to apply when not autofilled
7
+ * @returns A validator function that bypasses validation for autofilled controls
8
+ */
9
+ export declare function ignoreWhenAutofilled(...validators: FlexibleValidatorFn[]): ValidatorFn;
10
+ export {};
@@ -0,0 +1 @@
1
+ export * from './autofill-validators';