carriera-intern-components 0.0.998 → 0.0.999

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 (31) hide show
  1. package/app/components/input/directives/number-format.directive.d.ts +6 -1
  2. package/app/components/input/input.component.d.ts +28 -4
  3. package/app/components/input/models/dropdown.model.d.ts +9 -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 +166 -21
  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/json/icons.json +93 -13
  31. 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 } 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,7 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
29
31
  dispatcherRef: any;
30
32
  truckRef: any;
31
33
  trailerRef: any;
34
+ selectedHazardousRef: any;
32
35
  selectedDispatchRef: any;
33
36
  selectedLabelRef: any;
34
37
  selectedBrokerRef: any;
@@ -81,6 +84,7 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
81
84
  - `autofocus`: If `true`, the input will be focused when the component is initialized.
82
85
  - `canOpenModal`: If `true`, the input can open a modal for adding new options.
83
86
  - `customErrors`: An array of custom error messages to be displayed in the input.
87
+ - `isNumberFormattingDisabled`: If `true`, the input will not be formatted as a number.
84
88
  */
85
89
  config: import("@angular/core").InputSignal<CaiInputConfig>;
86
90
  /**
@@ -119,6 +123,10 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
119
123
  * A signal that indicates whether a new option is being added.
120
124
  */
121
125
  isAdding: import("@angular/core").WritableSignal<boolean>;
126
+ /**
127
+ * A signal that tracks whether the field has been autofilled.
128
+ */
129
+ isAutofilled: import("@angular/core").WritableSignal<boolean>;
122
130
  /**
123
131
  * A signal that holds the currently selected color from the label picker.
124
132
  */
@@ -160,10 +168,25 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
160
168
  * If NgControl is present, it sets this component as the value accessor
161
169
  * for the form control.
162
170
  * @param ngControl - Optional NgControl instance for form integration.
171
+ * @param cdr - ChangeDetectorRef for manual change detection.
172
+ */
173
+ constructor(ngControl: NgControl | null, cdr: ChangeDetectorRef);
174
+ /**
175
+ * Handles autofill detection from Chrome's autofill animation.
176
+ * Marks the control as autofilled and updates validity.
163
177
  */
164
- constructor(ngControl: NgControl | null);
178
+ onAutofill(): void;
179
+ /**
180
+ * Clears the autofill flag when user manually edits the field.
181
+ * Re-enables normal validation.
182
+ */
183
+ clearAutofillFlag(): void;
165
184
  ngOnInit(): void;
166
185
  ngAfterViewInit(): void;
186
+ /**
187
+ * Sets up autofill detection by checking for Chrome's -webkit-autofill CSS pseudo-class
188
+ */
189
+ private setupAutofillDetection;
167
190
  /**
168
191
  * Handles the native 'input' event from the HTMLInputElement.
169
192
  * Updates the component's internal value and notifies Angular forms
@@ -279,6 +302,7 @@ export declare class InputComponent implements ControlValueAccessor, AfterViewIn
279
302
  castAsDropdownOption(value: unknown): DropdownOption | null;
280
303
  castAsTruckOption(value: unknown): TruckType | null;
281
304
  castAsTrailerOption(value: unknown): TrailerType | null;
282
- static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, [{ optional: true; self: true; }]>;
305
+ castAsHazardous(value: unknown): Hazardous | null;
306
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, [{ optional: true; self: true; }, null]>;
283
307
  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
308
  }
@@ -192,3 +192,12 @@ 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
+ };
@@ -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 } 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"];
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[];
46
+ export type DropdownOptions = DropdownOption | LabelOption | Broker | Contact | Shipper | Dispatch | Bank | Dispatcher | TruckOption | TrailerOption | Hazardous;
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];
@@ -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';