carriera-intern-components 0.0.96 → 0.0.97

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.
@@ -4,8 +4,7 @@ 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, DepartmentContactsPair, DropdownOption, LabelColor, LabelOption, Shipper } from './models/input.model';
8
- import { Dispatch, DispatchBoard } from './models';
7
+ import { Bank, Broker, CaiInputConfig, Contact, Dispatcher, DropdownOption, LabelColor, LabelOption, Shipper, Dispatch, DropdownArrays, DropdownOptions, TruckType, TrailerType } from './models';
9
8
  import * as i0 from "@angular/core";
10
9
  /**
11
10
  * This component is a generic input component that can be used to create various types of inputs.
@@ -28,8 +27,8 @@ export declare class InputComponent implements ControlValueAccessor {
28
27
  - `reveal`: For password inputs, the number of characters to reveal from the end.
29
28
  - `icon`: Name of an icon to display (e.g., `'cai-email'`).
30
29
  - `iconColor`: Color of the displayed icon (e.g., `'#FF0000'`).
31
- - `dropdown`: If `true`, the input is associated with a dropdown menu, can also have `'dispatch'`, `'ftl-dispatch'`, `'broker'`, `'contact'`, `'shipper'` or `'label'` variants.
32
- - `options`: An array of options for the dropdown can be of type `DropdownOption[]` | `LabelOption[]` | `DispatchBoard[]` | `Broker[]` | `DepartmentContactsPair[]` | `Shipper[]` | `Bank[]`.
30
+ - `dropdown`: If `true`, the input is associated with a dropdown menu, can also have `'dispatch'`, `'ftl-dispatch'`, `'broker'`, `'contact'`, `'shipper'`, `'dispatcher'` or `'label'` variants.
31
+ - `options`: An array of options for the dropdown can be of type `DropdownOption[]` | `LabelOption[]` | `DispatchBoard[]` | `Broker[]` | `DepartmentContactsPair[]` | `Shipper[]` | `Bank[]` | `Dispatcher[]`.
33
32
  - `labelColors`: An array of label colors for the label picker.
34
33
  - `search`: Enables search within the dropdown.
35
34
  - `add`: Enables 'add new' functionality in the dropdown.
@@ -52,7 +51,7 @@ export declare class InputComponent implements ControlValueAccessor {
52
51
  /**
53
52
  * Input property to hold the dropdown options.
54
53
  */
55
- options: import("@angular/core").InputSignal<DropdownOption[] | LabelOption[] | Broker[] | DispatchBoard[] | DepartmentContactsPair[] | Shipper[] | Dispatch[] | Bank[]>;
54
+ options: import("@angular/core").InputSignal<DropdownArrays>;
56
55
  /**
57
56
  * Input property to hold the label colors for the label picker.
58
57
  */
@@ -72,19 +71,15 @@ export declare class InputComponent implements ControlValueAccessor {
72
71
  /**
73
72
  * A signal that holds the locally added options.
74
73
  */
75
- localOptions: import("@angular/core").WritableSignal<DropdownOption[] | LabelOption[] | Broker[] | DispatchBoard[] | DepartmentContactsPair[] | Shipper[] | Dispatch[] | Bank[]>;
74
+ localOptions: import("@angular/core").WritableSignal<DropdownArrays>;
76
75
  /**
77
76
  * A signal that holds the currently selected option from the dropdown.
78
77
  */
79
- selectedOption: import("@angular/core").WritableSignal<DropdownOption | null>;
78
+ selectedOption: import("@angular/core").WritableSignal<DropdownOptions | null>;
80
79
  /**
81
80
  * A signal that indicates whether a new option is being added.
82
81
  */
83
82
  isAdding: import("@angular/core").WritableSignal<boolean>;
84
- /**
85
- * A signal that holds the currently selected label from the label picker.
86
- */
87
- selectedLabel: import("@angular/core").WritableSignal<LabelOption | null>;
88
83
  /**
89
84
  * A signal that holds the currently selected color from the label picker.
90
85
  */
@@ -93,24 +88,7 @@ export declare class InputComponent implements ControlValueAccessor {
93
88
  /**
94
89
  * A signal that holds the currently selected dispatch board from the dispatch board picker.
95
90
  */
96
- selectedDispatch: import("@angular/core").WritableSignal<Dispatch | null>;
97
91
  foldedBoards: import("@angular/core").WritableSignal<number[]>;
98
- /**
99
- * A signal that holds the currently selected broker from the broker picker.
100
- */
101
- selectedBroker: import("@angular/core").WritableSignal<Broker | null>;
102
- /**
103
- * A signal that holds the currently selected contact from the contact picker.
104
- */
105
- selectedContact: import("@angular/core").WritableSignal<Contact | null>;
106
- /**
107
- * A signal that holds the currently selected shipper from the shipper picker.
108
- */
109
- selectedShipper: import("@angular/core").WritableSignal<Shipper | null>;
110
- /**
111
- * A signal that holds the currently selected bank from the bank picker.
112
- */
113
- selectedBank: import("@angular/core").WritableSignal<Bank | null>;
114
92
  /**
115
93
  * A computed signal that indicates whether the placeholder selected option should be shown.
116
94
  */
@@ -119,7 +97,7 @@ export declare class InputComponent implements ControlValueAccessor {
119
97
  * A computed signal that dynamically calculates the step value for number inputs.
120
98
  */
121
99
  step: import("@angular/core").Signal<number>;
122
- combinedOptions: import("@angular/core").Signal<DropdownOption[] | LabelOption[] | Broker[] | DispatchBoard[] | DepartmentContactsPair[] | Shipper[] | Dispatch[] | Bank[]>;
100
+ combinedOptions: import("@angular/core").Signal<DropdownArrays>;
123
101
  dispatchCount: import("@angular/core").Signal<number>;
124
102
  /**
125
103
  * An output signal that emits the value of the added option.
@@ -146,12 +124,18 @@ export declare class InputComponent implements ControlValueAccessor {
146
124
  contactRef: any;
147
125
  shipperRef: any;
148
126
  bankRef: any;
127
+ dispatcherRef: any;
128
+ truckRef: any;
129
+ trailerRef: any;
149
130
  selectedDispatchRef: any;
150
131
  selectedLabelRef: any;
151
132
  selectedBrokerRef: any;
152
133
  selectedContactRef: any;
153
134
  selectedShipperRef: any;
154
135
  selectedBankRef: any;
136
+ selectedDispatcherRef: any;
137
+ selectedTruckRef: any;
138
+ selectedTrailerRef: any;
155
139
  /**
156
140
  * Constructor for the InputComponent.
157
141
  * It injects NgControl to integrate with Angular's forms API.
@@ -241,7 +225,7 @@ export declare class InputComponent implements ControlValueAccessor {
241
225
  * @param option - The selected option.
242
226
  * @param event - The MouseEvent that initiated the selection action.
243
227
  */
244
- handleOption(option: DropdownOption | LabelOption | Dispatch | Broker | Contact | Bank | Shipper): void;
228
+ handleOption(option: DropdownOptions): void;
245
229
  /**
246
230
  * Adds a new option to the dropdown.
247
231
  * @param option - The option to add.
@@ -259,6 +243,16 @@ export declare class InputComponent implements ControlValueAccessor {
259
243
  activePercentageOfPaid: number;
260
244
  status: string | null;
261
245
  };
246
+ castAsDispatch(value: unknown): Dispatch | null;
247
+ castAsLabelOption(value: unknown): LabelOption | null;
248
+ castAsBroker(value: unknown): Broker | null;
249
+ castAsContact(value: unknown): Contact | null;
250
+ castAsShipper(value: unknown): Shipper | null;
251
+ castAsBank(value: unknown): Bank | null;
252
+ castAsDispatcher(value: unknown): Dispatcher | null;
253
+ castAsDropdownOption(value: unknown): DropdownOption | null;
254
+ castAsTruckOption(value: unknown): TruckType | null;
255
+ castAsTrailerOption(value: unknown): TrailerType | null;
262
256
  static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, [{ optional: true; self: true; }]>;
263
257
  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"; }, never, never, true, never>;
264
258
  }
@@ -0,0 +1,194 @@
1
+ import { AvatarColor, AvatarFile } from '../../avatar/models';
2
+ export type DropdownOption = {
3
+ id?: number;
4
+ [key: string]: any;
5
+ };
6
+ export type Dispatch = {
7
+ id: number;
8
+ dispatchBoardId: number;
9
+ dispatcherId: number;
10
+ truck: Truck;
11
+ trailer?: Trailer | null;
12
+ driver: Driver;
13
+ coDriver?: Driver | null;
14
+ payType: string;
15
+ status?: Status | null;
16
+ currentLocationCoordinates?: {
17
+ latitude: number;
18
+ longitude: number;
19
+ };
20
+ };
21
+ export type DispatchBoard = {
22
+ teamBoard: boolean;
23
+ id: number;
24
+ dispatcher: string | null;
25
+ count: number;
26
+ dispatches: Dispatch[];
27
+ };
28
+ export type Driver = {
29
+ id: number;
30
+ firstName: string;
31
+ lastName: string;
32
+ owner?: boolean | null;
33
+ avatarFile?: AvatarFile | null;
34
+ colorFlag?: AvatarColor | null;
35
+ status?: number;
36
+ address: string | null;
37
+ payType: {
38
+ name: string;
39
+ id: number;
40
+ };
41
+ [key: string]: any;
42
+ };
43
+ export type Truck = {
44
+ id: number;
45
+ truckNumber: string;
46
+ status: number;
47
+ owner: string;
48
+ color: TruckColor;
49
+ truckType: TruckType;
50
+ truckMakeName?: string | null;
51
+ model?: string | null;
52
+ year: number;
53
+ };
54
+ export type TruckColor = {
55
+ id: number;
56
+ companyId?: number | null;
57
+ name: string;
58
+ code: string;
59
+ };
60
+ export type TruckType = {
61
+ id: number;
62
+ companyId?: number | null;
63
+ name: string;
64
+ logoName: string;
65
+ };
66
+ export type Trailer = {
67
+ id: number;
68
+ trailerNumber: string;
69
+ status: number;
70
+ owner: string | null;
71
+ trailerType: TrailerType;
72
+ trailerMakeName?: string | null;
73
+ model?: string | null;
74
+ year: number;
75
+ };
76
+ export type TrailerType = {
77
+ id: number;
78
+ companyId?: number | null;
79
+ name: string;
80
+ logoName: string;
81
+ hasVolume?: boolean | null;
82
+ };
83
+ export type Status = {
84
+ statusValue: {
85
+ name: string;
86
+ id: number;
87
+ };
88
+ statusString: string;
89
+ statusCheckInNumber: string;
90
+ };
91
+ export type LabelOption = {
92
+ id?: number;
93
+ name?: string | null;
94
+ colorId?: number;
95
+ color?: string | null;
96
+ code?: string | null;
97
+ hoverCode?: string | null;
98
+ count?: number;
99
+ createdAt?: string;
100
+ updatedAt?: string;
101
+ };
102
+ export type LabelColor = {
103
+ id?: number;
104
+ name?: string | null;
105
+ code?: string | null;
106
+ hoverCode?: string | null;
107
+ count?: number;
108
+ };
109
+ export type Broker = {
110
+ id?: number;
111
+ businessName?: string | null;
112
+ availableCredit?: number | null;
113
+ creditLimit?: number | null;
114
+ availableCreditType?: any | null;
115
+ payTerm?: any | null;
116
+ dnu?: boolean;
117
+ ban?: boolean;
118
+ status?: number;
119
+ loadsCount?: number;
120
+ revenue?: number | null;
121
+ };
122
+ export type DepartmentContactsPair = {
123
+ department?: Department;
124
+ contacts?: Contact[];
125
+ };
126
+ export type Department = {
127
+ id?: number;
128
+ name?: string | null;
129
+ count?: number;
130
+ companyUsers?: any | null;
131
+ };
132
+ export type Contact = {
133
+ id?: number;
134
+ brokerId?: number;
135
+ shipperId?: number;
136
+ phone?: string | null;
137
+ contactName?: string | null;
138
+ extensionPhone?: string | null;
139
+ };
140
+ export type Shipper = {
141
+ id?: number;
142
+ businessName?: string | null;
143
+ status?: number | null;
144
+ address?: Address | null;
145
+ longitude?: number | null;
146
+ latitude?: number | null;
147
+ receivingFrom?: string | null;
148
+ receivingTo?: string | null;
149
+ shippingFrom?: string | null;
150
+ shippingTo?: string | null;
151
+ receivingOpenTwentyFourHours?: boolean;
152
+ shippingOpenTwentyFourHours?: boolean;
153
+ pickupCount?: number;
154
+ deliveryCount?: number;
155
+ };
156
+ export type Address = {
157
+ city?: string | null;
158
+ state?: string | null;
159
+ county?: string | null;
160
+ address?: string | null;
161
+ street?: string | null;
162
+ streetNumber?: string | null;
163
+ country?: string | null;
164
+ zipCode?: string | null;
165
+ stateShortName?: string | null;
166
+ addressUnit?: string | null;
167
+ };
168
+ export type Bank = {
169
+ id?: number;
170
+ name?: string | null;
171
+ logoName?: string | null;
172
+ createdAt?: string;
173
+ updatedAt?: string;
174
+ };
175
+ export type Dispatcher = {
176
+ id: number;
177
+ userId: number | null;
178
+ fullName: string;
179
+ avatarFile: AvatarFile | null;
180
+ departmentId: number | null;
181
+ };
182
+ export type TruckOption = {
183
+ id: number;
184
+ companyId?: number | null;
185
+ name: string;
186
+ logoName: string;
187
+ };
188
+ export type TrailerOption = {
189
+ id: number;
190
+ companyId?: number | null;
191
+ name: string;
192
+ logoName: string;
193
+ hasVolume?: boolean | null;
194
+ };
@@ -1,2 +1,2 @@
1
1
  export * from './input.model';
2
- export * from './dispatch.model';
2
+ export * from './dropdown.model';
@@ -1,3 +1,4 @@
1
+ import { Bank, Broker, Contact, DepartmentContactsPair, Dispatch, DispatchBoard, Dispatcher, DropdownOption, LabelOption, Shipper, TrailerOption, TruckOption } from './dropdown.model';
1
2
  export interface CaiInputConfig {
2
3
  type?: 'text' | 'password' | 'number';
3
4
  name?: string;
@@ -7,7 +8,7 @@ export interface CaiInputConfig {
7
8
  reveal?: number;
8
9
  icon?: string | null;
9
10
  iconColor?: string;
10
- dropdown?: boolean | 'dispatch' | 'ftl-dispatch' | 'label' | 'broker' | 'contact' | 'shipper' | 'bank';
11
+ dropdown?: boolean | DropdownType;
11
12
  search?: boolean;
12
13
  add?: boolean;
13
14
  subcontent?: string;
@@ -25,91 +26,8 @@ export interface CaiInputConfig {
25
26
  optionValue?: string;
26
27
  optionLabel?: string;
27
28
  }
28
- export type DropdownOption = {
29
- id?: number;
30
- [key: string]: any;
31
- };
32
- export type LabelOption = {
33
- id?: number;
34
- name?: string | null;
35
- colorId?: number;
36
- color?: string | null;
37
- code?: string | null;
38
- hoverCode?: string | null;
39
- count?: number;
40
- createdAt?: string;
41
- updatedAt?: string;
42
- };
43
- export type LabelColor = {
44
- id?: number;
45
- name?: string | null;
46
- code?: string | null;
47
- hoverCode?: string | null;
48
- count?: number;
49
- };
50
- export type Broker = {
51
- id?: number;
52
- businessName?: string | null;
53
- availableCredit?: number | null;
54
- creditLimit?: number | null;
55
- availableCreditType?: any | null;
56
- payTerm?: any | null;
57
- dnu?: boolean;
58
- ban?: boolean;
59
- status?: number;
60
- loadsCount?: number;
61
- revenue?: number | null;
62
- };
63
- export type DepartmentContactsPair = {
64
- department?: Department;
65
- contacts?: Contact[];
66
- };
67
- export type Department = {
68
- id?: number;
69
- name?: string | null;
70
- count?: number;
71
- companyUsers?: any | null;
72
- };
73
- export type Contact = {
74
- id?: number;
75
- brokerId?: number;
76
- shipperId?: number;
77
- phone?: string | null;
78
- contactName?: string | null;
79
- extensionPhone?: string | null;
80
- };
81
- export type Shipper = {
82
- id?: number;
83
- businessName?: string | null;
84
- status?: number | null;
85
- address?: Address | null;
86
- longitude?: number | null;
87
- latitude?: number | null;
88
- receivingFrom?: string | null;
89
- receivingTo?: string | null;
90
- shippingFrom?: string | null;
91
- shippingTo?: string | null;
92
- receivingOpenTwentyFourHours?: boolean;
93
- shippingOpenTwentyFourHours?: boolean;
94
- pickupCount?: number;
95
- deliveryCount?: number;
96
- };
97
- export type Address = {
98
- city?: string | null;
99
- state?: string | null;
100
- county?: string | null;
101
- address?: string | null;
102
- street?: string | null;
103
- streetNumber?: string | null;
104
- country?: string | null;
105
- zipCode?: string | null;
106
- stateShortName?: string | null;
107
- addressUnit?: string | null;
108
- };
109
- export type Bank = {
110
- id?: number;
111
- name?: string | null;
112
- logoName?: string | null;
113
- createdAt?: string;
114
- updatedAt?: string;
115
- };
29
+ export declare const DropdownTypes: readonly ["dispatch", "ftl-dispatch", "label", "broker", "contact", "shipper", "bank", "dispatcher", "truck", "trailer"];
30
+ export type DropdownType = (typeof DropdownTypes)[number];
31
+ export type DropdownArrays = DropdownOption[] | LabelOption[] | Broker[] | DispatchBoard[] | DepartmentContactsPair[] | Shipper[] | Dispatch[] | Bank[] | Dispatcher[] | TruckOption[] | TrailerOption[];
32
+ export type DropdownOptions = DropdownOption | LabelOption | Broker | Contact | Shipper | Dispatch | Bank | Dispatcher | TruckOption | TrailerOption;
33
+ 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];
@@ -1,9 +1,9 @@
1
1
  import { PipeTransform } from '@angular/core';
2
- import { Bank, Broker, CaiInputConfig, Contact, DepartmentContactsPair, Dispatch, DispatchBoard, DropdownOption, LabelOption, Shipper } from '../models';
2
+ import { CaiInputConfig, DropdownArrays } from '../models';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class FilterBySearchPipe implements PipeTransform {
5
5
  hasProperty<T extends object>(obj: T, prop: PropertyKey): prop is keyof T;
6
- transform(options: DispatchBoard[] | Dispatch[] | LabelOption[] | Broker[] | Contact[] | DropdownOption[] | DepartmentContactsPair[] | Shipper[] | Bank[], value: string | undefined | null, type: CaiInputConfig['dropdown'], shouldSearch?: boolean, foldedBoards?: number[], label?: string): any[];
6
+ transform(options: DropdownArrays, value: string | undefined | null, type: CaiInputConfig['dropdown'], shouldSearch?: boolean, foldedBoards?: number[], label?: string): any[];
7
7
  static ɵfac: i0.ɵɵFactoryDeclaration<FilterBySearchPipe, never>;
8
8
  static ɵpipe: i0.ɵɵPipeDeclaration<FilterBySearchPipe, "filterBySearch", true>;
9
9
  }