@pongrass/utils 0.0.1-v20

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.
@@ -0,0 +1,1434 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, Injectable, Component, ViewChild, inject, EventEmitter, Input, Output, ElementRef, HostListener, Directive, Renderer2, NgModule } from '@angular/core';
3
+ import * as i2 from '@angular/common';
4
+ import { CommonModule, NgClass } from '@angular/common';
5
+ import * as i1 from '@angular/forms';
6
+ import { FormsModule, NgControl, FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
7
+ import * as i4 from '@coreui/angular-pro';
8
+ import { FormModule, ButtonModule, MultiSelectModule, MultiSelectComponent, InputGroupComponent, DatePickerModule, ModalModule, TooltipModule } from '@coreui/angular-pro';
9
+ import { HttpClient, HttpHeaders } from '@angular/common/http';
10
+ import { lastValueFrom } from 'rxjs';
11
+ import * as i5 from '@coreui/icons-angular';
12
+ import { IconModule } from '@coreui/icons-angular';
13
+ import * as i8 from 'ngx-bootstrap/datepicker';
14
+ import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
15
+ import Swal from 'sweetalert2';
16
+ import { Tooltip } from '@coreui/coreui-pro';
17
+
18
+ class ConfigurationServiceLib {
19
+ currentTablePreference;
20
+ allConfigValues;
21
+ constructor() {
22
+ this.currentTablePreference = signal({}, ...(ngDevMode ? [{ debugName: "currentTablePreference" }] : []));
23
+ this.allConfigValues = signal(null, ...(ngDevMode ? [{ debugName: "allConfigValues" }] : []));
24
+ }
25
+ /* Generate Unique ID as String */
26
+ generateUniqueId() {
27
+ return `${Math.floor(Date.now() / 1000)}`;
28
+ }
29
+ setTablePreference(tableName, preference) {
30
+ const allTablePreference = this.currentTablePreference();
31
+ allTablePreference[tableName] = preference;
32
+ this.currentTablePreference.set(allTablePreference);
33
+ }
34
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ConfigurationServiceLib, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
35
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ConfigurationServiceLib, providedIn: 'root' });
36
+ }
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ConfigurationServiceLib, decorators: [{
38
+ type: Injectable,
39
+ args: [{
40
+ providedIn: 'root'
41
+ }]
42
+ }], ctorParameters: () => [] });
43
+
44
+ class ColorCellRendererComponent {
45
+ params;
46
+ colorsList = [];
47
+ colorCode = '';
48
+ agInit(params) {
49
+ this.params = params;
50
+ this.colorsList = params.colDef?.cellRendererParams?.colorsList ?? [];
51
+ this.setColorCode(this.params?.value);
52
+ this.refresh(params);
53
+ }
54
+ // Return Cell Value
55
+ refresh(params) {
56
+ return true;
57
+ }
58
+ setColorCode(colorKey) {
59
+ if (this.colorsList && this.colorsList.length > 0 && colorKey) {
60
+ const selectedColor = this.colorsList.find(color => color.color_name === colorKey);
61
+ if (selectedColor) {
62
+ this.colorCode = selectedColor.value;
63
+ }
64
+ else {
65
+ this.colorCode = ''; // Default color if not found
66
+ }
67
+ }
68
+ }
69
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ColorCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.9", type: ColorCellRendererComponent, isStandalone: true, selector: "app-color-cell-renderer", ngImport: i0, template: `
71
+ <div class="cell-wrapper align-items-center d-inline-flex gap-2">
72
+ <span class="color-box" [ngStyle]="{ 'background-color': colorCode }"></span>
73
+ <span class="text-truncate">
74
+ {{ params.value }}
75
+ </span>
76
+ </div>
77
+ `, isInline: true, styles: [".color-box{height:1.5rem}.cell-wrapper{display:flex;align-items:center;gap:.5rem;width:100%;overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
78
+ }
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ColorCellRendererComponent, decorators: [{
80
+ type: Component,
81
+ args: [{ standalone: true, imports: [CommonModule], selector: 'app-color-cell-renderer', template: `
82
+ <div class="cell-wrapper align-items-center d-inline-flex gap-2">
83
+ <span class="color-box" [ngStyle]="{ 'background-color': colorCode }"></span>
84
+ <span class="text-truncate">
85
+ {{ params.value }}
86
+ </span>
87
+ </div>
88
+ `, styles: [".color-box{height:1.5rem}.cell-wrapper{display:flex;align-items:center;gap:.5rem;width:100%;overflow:hidden}\n"] }]
89
+ }] });
90
+
91
+ class CustomSelectFilterComponent {
92
+ params;
93
+ uniqueValues = [];
94
+ filteredValues = [];
95
+ selectedValues = new Set();
96
+ searchText = '';
97
+ isIndeterminate = false;
98
+ agInit(params) {
99
+ this.params = params;
100
+ this.uniqueValues = this.getUniqueValues();
101
+ this.filteredValues = [...this.uniqueValues];
102
+ this.uniqueValues.forEach(val => this.selectedValues.add(val));
103
+ }
104
+ searchInputRef;
105
+ afterGuiAttached() {
106
+ this.searchInputRef?.nativeElement?.focus();
107
+ }
108
+ getUniqueValues() {
109
+ const values = new Set();
110
+ this.params.api.forEachNode(node => {
111
+ values.add(node.data[this.params.colDef.field]);
112
+ });
113
+ return Array.from(values).sort();
114
+ }
115
+ isValueSelected(value) {
116
+ return this.selectedValues.has(value);
117
+ }
118
+ isAllSelected() {
119
+ return this.filteredValues.length > 0 && this.filteredValues.every(val => this.selectedValues.has(val));
120
+ }
121
+ onSelectAllChanged(event) {
122
+ const checked = event.target.checked;
123
+ if (checked) {
124
+ this.filteredValues.forEach(val => this.selectedValues.add(val));
125
+ }
126
+ else {
127
+ this.filteredValues.forEach(val => this.selectedValues.delete(val));
128
+ }
129
+ this.updateIndeterminate();
130
+ this.params.filterChangedCallback();
131
+ }
132
+ onValueChanged(value, event) {
133
+ const checked = event.target.checked;
134
+ if (checked) {
135
+ this.selectedValues.add(value);
136
+ }
137
+ else {
138
+ this.selectedValues.delete(value);
139
+ }
140
+ this.updateIndeterminate();
141
+ // If all are now selected, ensure isIndeterminate is false
142
+ if (this.isAllSelected()) {
143
+ this.isIndeterminate = false;
144
+ }
145
+ this.params.filterChangedCallback();
146
+ }
147
+ updateIndeterminate() {
148
+ // isIndeterminate is true if at least one but not all filteredValues are selected
149
+ const selectedCount = this.filteredValues.filter(val => this.selectedValues.has(val)).length;
150
+ this.isIndeterminate = selectedCount > 0 && selectedCount < this.filteredValues.length;
151
+ }
152
+ onSearchChange() {
153
+ const lower = this.searchText.toLowerCase();
154
+ this.filteredValues = this.uniqueValues.filter(val => val?.toString().toLowerCase().includes(lower));
155
+ this.updateIndeterminate();
156
+ }
157
+ doesFilterPass(params) {
158
+ const value = params.data[this.params.colDef.field];
159
+ return this.selectedValues.has(value);
160
+ }
161
+ isFilterActive() {
162
+ return this.selectedValues.size !== this.uniqueValues.length;
163
+ }
164
+ getModel() {
165
+ return { values: Array.from(this.selectedValues) };
166
+ }
167
+ setModel(model) {
168
+ if (model?.values) {
169
+ this.selectedValues = new Set(model.values);
170
+ }
171
+ else {
172
+ this.selectedValues = new Set(this.uniqueValues);
173
+ }
174
+ this.filteredValues = [...this.uniqueValues];
175
+ }
176
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CustomSelectFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
177
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: CustomSelectFilterComponent, isStandalone: true, selector: "app-custom-set-filter", viewQueries: [{ propertyName: "searchInputRef", first: true, predicate: ["searchInput"], descendants: true }], ngImport: i0, template: `
178
+ <div class="select-filter-container">
179
+ <input type="text" #searchInput cFormControl [(ngModel)]="searchText" (input)="onSearchChange()" placeholder="Search..." class="search-box" />
180
+ @if (filteredValues.length > 0) {
181
+ <div>
182
+ <label class="checkbox-item">
183
+ <input cFormCheckInput [indeterminate]="isIndeterminate" type="checkbox" [checked]="isAllSelected()" (change)="onSelectAllChanged($event)" />
184
+ (Select All)
185
+ </label>
186
+ </div>
187
+ } @else {
188
+ <div>
189
+ <label> No matches </label>
190
+ </div>
191
+ }
192
+
193
+ <div class="checkbox-list">
194
+ @for (value of filteredValues; track value) {
195
+ <label [attr.aria-label]="'Select ' + value" class="checkbox-item">
196
+ <input cFormCheckInput type="checkbox" [value]="value" [checked]="isValueSelected(value)" (change)="onValueChanged(value, $event)" />
197
+ {{ value }}
198
+ </label>
199
+ }
200
+ </div>
201
+ </div>
202
+ `, isInline: true, styles: [".select-filter-container{padding:10px}.select-filter-container label{display:flex;gap:5px}.search-box{width:100%;margin-bottom:5px;padding:4px}.checkbox-list{max-height:200px;overflow-y:auto}.checkbox-item{padding:4px 6px;cursor:pointer;border-radius:4px}.checkbox-item:hover{background-color:#f0f0f0}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: FormModule }, { kind: "directive", type: i4.FormCheckInputDirective, selector: "input[cFormCheckInput]", inputs: ["type", "indeterminate", "valid"] }, { kind: "directive", type: i4.FormControlDirective, selector: "input[cFormControl], textarea[cFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }] });
203
+ }
204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CustomSelectFilterComponent, decorators: [{
205
+ type: Component,
206
+ args: [{ selector: 'app-custom-set-filter', standalone: true, imports: [FormsModule, FormModule], template: `
207
+ <div class="select-filter-container">
208
+ <input type="text" #searchInput cFormControl [(ngModel)]="searchText" (input)="onSearchChange()" placeholder="Search..." class="search-box" />
209
+ @if (filteredValues.length > 0) {
210
+ <div>
211
+ <label class="checkbox-item">
212
+ <input cFormCheckInput [indeterminate]="isIndeterminate" type="checkbox" [checked]="isAllSelected()" (change)="onSelectAllChanged($event)" />
213
+ (Select All)
214
+ </label>
215
+ </div>
216
+ } @else {
217
+ <div>
218
+ <label> No matches </label>
219
+ </div>
220
+ }
221
+
222
+ <div class="checkbox-list">
223
+ @for (value of filteredValues; track value) {
224
+ <label [attr.aria-label]="'Select ' + value" class="checkbox-item">
225
+ <input cFormCheckInput type="checkbox" [value]="value" [checked]="isValueSelected(value)" (change)="onValueChanged(value, $event)" />
226
+ {{ value }}
227
+ </label>
228
+ }
229
+ </div>
230
+ </div>
231
+ `, styles: [".select-filter-container{padding:10px}.select-filter-container label{display:flex;gap:5px}.search-box{width:100%;margin-bottom:5px;padding:4px}.checkbox-list{max-height:200px;overflow-y:auto}.checkbox-item{padding:4px 6px;cursor:pointer;border-radius:4px}.checkbox-item:hover{background-color:#f0f0f0}\n"] }]
232
+ }], propDecorators: { searchInputRef: [{
233
+ type: ViewChild,
234
+ args: ['searchInput']
235
+ }] } });
236
+
237
+ class CheckboxCellRendererComponent {
238
+ value;
239
+ params;
240
+ ischeckboxDisabled = true;
241
+ agInit(params) {
242
+ this.params = params;
243
+ this.ischeckboxDisabled = params.colDef?.cellRendererParams?.data?.disabled ?? true;
244
+ this.refresh(params);
245
+ }
246
+ // Return Cell Value
247
+ refresh(params) {
248
+ this.value = params.value === '1' ? true : false;
249
+ return true;
250
+ }
251
+ onChangeCheckBox(event) {
252
+ const checked = event.target.checked;
253
+ this.value = checked;
254
+ // Emit the change event to the parent via a callback
255
+ if (this.params.colDef?.cellRendererParams?.onCheckboxChange) {
256
+ this.params.colDef.cellRendererParams.onCheckboxChange(this.params.data, checked, this.params.colDef?.field);
257
+ }
258
+ }
259
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CheckboxCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
260
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.9", type: CheckboxCellRendererComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: ` <div class="d-flex justify-content-start align-items-center h-100 mt-2">
261
+ <input
262
+ cFormCheckInput
263
+ type="checkbox"
264
+ class="me-2 cell-renderer-checkbox"
265
+ [checked]="value"
266
+ (change)="onChangeCheckBox($event)"
267
+ [disabled]="ischeckboxDisabled" />
268
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormModule }, { kind: "directive", type: i4.FormCheckInputDirective, selector: "input[cFormCheckInput]", inputs: ["type", "indeterminate", "valid"] }] });
269
+ }
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CheckboxCellRendererComponent, decorators: [{
271
+ type: Component,
272
+ args: [{
273
+ standalone: true,
274
+ imports: [FormModule],
275
+ template: ` <div class="d-flex justify-content-start align-items-center h-100 mt-2">
276
+ <input
277
+ cFormCheckInput
278
+ type="checkbox"
279
+ class="me-2 cell-renderer-checkbox"
280
+ [checked]="value"
281
+ (change)="onChangeCheckBox($event)"
282
+ [disabled]="ischeckboxDisabled" />
283
+ </div>`
284
+ }]
285
+ }] });
286
+
287
+ class CommentsButtonCellRendererComponent {
288
+ params;
289
+ agInit(params) {
290
+ this.params = params;
291
+ }
292
+ refresh(params) {
293
+ this.params = params;
294
+ return true;
295
+ }
296
+ onCommentClick() {
297
+ if (this.params?.colDef?.cellRendererParams?.onCommentClick) {
298
+ this.params.colDef.cellRendererParams.onCommentClick(this.params.data);
299
+ }
300
+ }
301
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CommentsButtonCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
302
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.9", type: CommentsButtonCellRendererComponent, isStandalone: true, selector: "app-comments-button-cell-renderer", ngImport: i0, template: `
303
+ <div>
304
+ <button cButton [color]="params.data?.orders_notes ? 'primary' : 'secondary'" size="sm" data-action="comment-action" (click)="onCommentClick()">
305
+ Comments
306
+ </button>
307
+ </div>
308
+ `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }] });
309
+ }
310
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CommentsButtonCellRendererComponent, decorators: [{
311
+ type: Component,
312
+ args: [{ standalone: true, selector: 'app-comments-button-cell-renderer', imports: [ButtonModule], template: `
313
+ <div>
314
+ <button cButton [color]="params.data?.orders_notes ? 'primary' : 'secondary'" size="sm" data-action="comment-action" (click)="onCommentClick()">
315
+ Comments
316
+ </button>
317
+ </div>
318
+ ` }]
319
+ }] });
320
+
321
+ var BrowserConstantsEnum;
322
+ (function (BrowserConstantsEnum) {
323
+ BrowserConstantsEnum["sessionid"] = "sessionId";
324
+ BrowserConstantsEnum["loginUid"] = "uid";
325
+ BrowserConstantsEnum["tablePreference"] = "table_preference";
326
+ })(BrowserConstantsEnum || (BrowserConstantsEnum = {}));
327
+
328
+ var JSONRPCMethods;
329
+ (function (JSONRPCMethods) {
330
+ JSONRPCMethods["getFormsConfig"] = "get_form";
331
+ JSONRPCMethods["tableSearch"] = "table_search";
332
+ JSONRPCMethods["tableUpdate"] = "table_update";
333
+ JSONRPCMethods["tableList"] = "table_list";
334
+ JSONRPCMethods["generateAccountId"] = "generate_accountid";
335
+ JSONRPCMethods["updateTablePreference"] = "update_form_preference";
336
+ JSONRPCMethods["listPhotoQueue"] = "photo_queue";
337
+ JSONRPCMethods["updateFileStatus"] = "update_photo_status";
338
+ JSONRPCMethods["report"] = "report";
339
+ JSONRPCMethods["adStatusList"] = "list_adstatus";
340
+ JSONRPCMethods["adApprovedList"] = "get_approval_adlist";
341
+ JSONRPCMethods["updateApprovedList"] = "update_approve_adlist";
342
+ JSONRPCMethods["getEditionPublicationList"] = "get_edition";
343
+ JSONRPCMethods["nationaROPReport"] = "national_rop_report";
344
+ JSONRPCMethods["nationaInserts"] = "national_inserts";
345
+ JSONRPCMethods["prodStatusList"] = "list_prodstatus";
346
+ JSONRPCMethods["updateAdStatus"] = "update_ad_status";
347
+ JSONRPCMethods["ordersNotes"] = "orders_notes";
348
+ JSONRPCMethods["getPageStatus"] = "get_page_status";
349
+ JSONRPCMethods["listPageStatus"] = "list_pagestatus";
350
+ JSONRPCMethods["updatePageStatus"] = "update_page_status";
351
+ JSONRPCMethods["markads"] = "markads";
352
+ JSONRPCMethods["updateReport"] = "update_report";
353
+ JSONRPCMethods["listFileStatus"] = "list_filestatus";
354
+ JSONRPCMethods["getIndustryList"] = "get_industry";
355
+ })(JSONRPCMethods || (JSONRPCMethods = {}));
356
+
357
+ class UtilsService {
358
+ httpService = inject(HttpClient);
359
+ configurationServiceLib = inject(ConfigurationServiceLib);
360
+ allConfigValues = this.configurationServiceLib.allConfigValues() || {};
361
+ constructor() { }
362
+ // JSONRPC POST Request With promise
363
+ async postJsonRpcRequestPromiseLib(method, params) {
364
+ const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
365
+ const body = {
366
+ jsonrpc: '2.0',
367
+ method: method,
368
+ params: params,
369
+ id: this.configurationServiceLib.generateUniqueId()
370
+ };
371
+ const request$ = this.httpService.post(this.allConfigValues.apiBaseURLWebMaint, body, { headers });
372
+ const response = await lastValueFrom(request$);
373
+ return { ...response, timestamp: new Date().toISOString() };
374
+ }
375
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
376
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: UtilsService, providedIn: 'root' });
377
+ }
378
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: UtilsService, decorators: [{
379
+ type: Injectable,
380
+ args: [{
381
+ providedIn: 'root'
382
+ }]
383
+ }], ctorParameters: () => [] });
384
+
385
+ /* eslint-disable @typescript-eslint/no-explicit-any */
386
+ class EditionListGroupedComponent {
387
+ utilsService = inject(UtilsService);
388
+ isActive;
389
+ editionPublicationList;
390
+ selectedRegions;
391
+ selectedEditions;
392
+ selectedEditionsChange = new EventEmitter();
393
+ label;
394
+ multiple;
395
+ hasFormError;
396
+ constructor() {
397
+ this.isActive = true;
398
+ this.editionPublicationList = [];
399
+ this.selectedEditions = [];
400
+ this.selectedRegions = [];
401
+ this.label = '';
402
+ this.hasFormError = false;
403
+ this.multiple = true;
404
+ }
405
+ ngOnInit() {
406
+ this.getEditionPublicationList();
407
+ }
408
+ ngOnDestroy() {
409
+ this.isActive = false;
410
+ }
411
+ async getEditionPublicationList() {
412
+ const params = {
413
+ uid: +localStorage.getItem(BrowserConstantsEnum.loginUid),
414
+ for_approval: true
415
+ };
416
+ await this.utilsService
417
+ .postJsonRpcRequestPromiseLib(JSONRPCMethods.getEditionPublicationList, params)
418
+ .then((response) => {
419
+ if (response.result) {
420
+ const result = response.result;
421
+ result.forEach(ed => {
422
+ ed['selected'] = false;
423
+ });
424
+ const groupedByRegion = result.reduce((acc, current) => {
425
+ const region = current.region;
426
+ if (region) {
427
+ if (!acc[region]) {
428
+ acc[region] = {
429
+ region: region,
430
+ values: []
431
+ };
432
+ }
433
+ acc[region].values.push(current);
434
+ }
435
+ return acc;
436
+ }, {});
437
+ this.editionPublicationList = Object.values(groupedByRegion);
438
+ }
439
+ });
440
+ }
441
+ onEditionSelection(option) {
442
+ this.selectedEditions = [];
443
+ if (Array.isArray(option)) {
444
+ if (option.length > 0) {
445
+ option.forEach(editionData => {
446
+ this.selectedEditions.push(editionData.edname);
447
+ });
448
+ }
449
+ }
450
+ else {
451
+ if (option && option.edname) {
452
+ this.selectedEditions.push(option.edname);
453
+ }
454
+ }
455
+ this.selectedEditionsChange.emit(this.selectedEditions);
456
+ }
457
+ onSelectEditionGroup(region, index) {
458
+ const isSelected = this.selectedRegions.includes(region);
459
+ if (isSelected) {
460
+ this.selectedRegions.splice(index, 1);
461
+ }
462
+ else {
463
+ this.selectedRegions.push(region);
464
+ }
465
+ this.editionPublicationList.forEach(element => {
466
+ if (element.region === region) {
467
+ element.values.forEach(regionValues => {
468
+ regionValues.selected = !isSelected;
469
+ });
470
+ }
471
+ });
472
+ }
473
+ onVisibleChange(isActive) {
474
+ const elements = document.getElementsByClassName('form-multi-select-cleaner');
475
+ Array.from(elements).forEach((element) => {
476
+ element.style.display = isActive ? 'inline-block' : 'none';
477
+ });
478
+ }
479
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: EditionListGroupedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
480
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: EditionListGroupedComponent, isStandalone: true, selector: "app-edition-list-grouped", inputs: { label: "label", multiple: "multiple", hasFormError: "hasFormError" }, outputs: { selectedEditionsChange: "selectedEditionsChange" }, ngImport: i0, template: "<div class=\"row\">\n <div class=\"col-12\">\n @if (label) {\n <label for=\"sel-group-edition\">{{ label }}</label>\n }\n <c-multi-select\n [cleaner]=\"true\"\n [selectionType]=\"multiple ? 'counter' : 'text'\"\n [multiple]=\"multiple\"\n clearSearchOnSelect\n [ngClass]=\"{ 'form-invalid': hasFormError }\"\n placeholder=\"All Editions\"\n visibleItems=\"8\"\n (valueChange)=\"onEditionSelection($event)\"\n (visibleChange)=\"onVisibleChange($event)\">\n @for (option of editionPublicationList; track $index + '_' + option.region) {\n <c-multi-select-optgroup>\n <c-multi-select-optgroup-label (click)=\"onSelectEditionGroup(option.region, $index)\" class=\"region-selector cursor-pointer\">{{\n option?.region\n }}</c-multi-select-optgroup-label>\n @for (item of option.values; track item?.description) {\n <c-multi-select-option [value]=\"item\" [selected]=\"item.selected\">{{ '[' + item?.edname + ']' }} {{ item?.description }}</c-multi-select-option>\n }\n </c-multi-select-optgroup>\n }\n </c-multi-select>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i4.MultiSelectComponent, selector: "c-multi-select", inputs: ["allowCreateOptions", "cleaner", "clearSearchOnSelect", "disabled", "loading", "multiple", "options", "optionsMaxHeight", "optionsStyle", "placeholder", "resetSelectionOnOptionsChange", "search", "searchNoResultsLabel", "searchValue", "selectAll", "selectAllLabel", "selectionType", "selectionTypeCounterText", "selectionTypeCounterTextPluralMap", "size", "value", "valid", "virtualScroller", "visibleItems", "itemSize", "itemMinWidth", "visible", "popperOptions"], outputs: ["searchValueChange", "valueChange", "visibleChange"], exportAs: ["cMultiSelect"] }, { kind: "component", type: i4.MultiSelectOptionComponent, selector: "c-multi-select-option", inputs: ["optionsStyle", "label", "text", "visible", "disabled", "selected", "value", "active", "role"], outputs: ["selectedChange", "focusChange"], exportAs: ["cMultiSelectOption"] }, { kind: "component", type: i4.MultiSelectOptgroupComponent, selector: "c-multi-select-optgroup", inputs: ["label", "disabled"] }, { kind: "component", type: i4.MultiSelectOptgroupLabelComponent, selector: "c-multi-select-optgroup-label" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
481
+ }
482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: EditionListGroupedComponent, decorators: [{
483
+ type: Component,
484
+ args: [{ selector: 'app-edition-list-grouped', imports: [MultiSelectModule, FormsModule, NgClass], standalone: true, template: "<div class=\"row\">\n <div class=\"col-12\">\n @if (label) {\n <label for=\"sel-group-edition\">{{ label }}</label>\n }\n <c-multi-select\n [cleaner]=\"true\"\n [selectionType]=\"multiple ? 'counter' : 'text'\"\n [multiple]=\"multiple\"\n clearSearchOnSelect\n [ngClass]=\"{ 'form-invalid': hasFormError }\"\n placeholder=\"All Editions\"\n visibleItems=\"8\"\n (valueChange)=\"onEditionSelection($event)\"\n (visibleChange)=\"onVisibleChange($event)\">\n @for (option of editionPublicationList; track $index + '_' + option.region) {\n <c-multi-select-optgroup>\n <c-multi-select-optgroup-label (click)=\"onSelectEditionGroup(option.region, $index)\" class=\"region-selector cursor-pointer\">{{\n option?.region\n }}</c-multi-select-optgroup-label>\n @for (item of option.values; track item?.description) {\n <c-multi-select-option [value]=\"item\" [selected]=\"item.selected\">{{ '[' + item?.edname + ']' }} {{ item?.description }}</c-multi-select-option>\n }\n </c-multi-select-optgroup>\n }\n </c-multi-select>\n </div>\n</div>\n" }]
485
+ }], ctorParameters: () => [], propDecorators: { selectedEditionsChange: [{
486
+ type: Output
487
+ }], label: [{
488
+ type: Input
489
+ }], multiple: [{
490
+ type: Input
491
+ }], hasFormError: [{
492
+ type: Input
493
+ }] } });
494
+
495
+ class IndustryUpdateListboxCellRendererComponent {
496
+ industryList = [];
497
+ selectedIndustry;
498
+ params;
499
+ agInit(params) {
500
+ this.params = params;
501
+ this.industryList = params.colDef?.cellRendererParams?.data?.industryList ?? [];
502
+ this.selectedIndustry = params.data?.industry;
503
+ if (!this.selectedIndustry) {
504
+ this.selectedIndustry = 'select-industry';
505
+ }
506
+ }
507
+ refresh(params) {
508
+ this.selectedIndustry = params.data?.industry;
509
+ if (!this.selectedIndustry) {
510
+ this.selectedIndustry = 'select-industry';
511
+ }
512
+ return true;
513
+ }
514
+ onIndustryChange(event) {
515
+ const value = event.target.value;
516
+ if (this.params.colDef?.cellRendererParams?.onUpdateIndustry) {
517
+ this.params.colDef.cellRendererParams.onUpdateIndustry(this.params.data, value);
518
+ }
519
+ }
520
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: IndustryUpdateListboxCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
521
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: IndustryUpdateListboxCellRendererComponent, isStandalone: true, selector: "app-industry-update-listbox-cell-renderer", ngImport: i0, template: "<select\n class=\"form-select select-industry\"\n [ngClass]=\"{ 'select-industry-red': selectedIndustry === 'select-industry' }\"\n [(ngModel)]=\"selectedIndustry\"\n (change)=\"onIndustryChange($event)\"\n id=\"sel-industry\"\n name=\"sel-industry\">\n <option value=\"select-industry\" disabled class=\"select-industry-opt\">Select Industry</option>\n @for (industry of industryList; track industry.industry) {\n <option [value]=\"industry?.industry\" class=\"select-industry-opt\">\n {{ industry?.description }}\n </option>\n }\n</select>\n", styles: [".form-select.select-industry{color:#000}.form-select.select-industry.select-industry-red{color:#666666b3}.form-select.select-industry option{color:#000}.form-select.select-industry option[value=select-industry]{color:gray}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
522
+ }
523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: IndustryUpdateListboxCellRendererComponent, decorators: [{
524
+ type: Component,
525
+ args: [{ selector: 'app-industry-update-listbox-cell-renderer', imports: [FormsModule, NgClass], standalone: true, template: "<select\n class=\"form-select select-industry\"\n [ngClass]=\"{ 'select-industry-red': selectedIndustry === 'select-industry' }\"\n [(ngModel)]=\"selectedIndustry\"\n (change)=\"onIndustryChange($event)\"\n id=\"sel-industry\"\n name=\"sel-industry\">\n <option value=\"select-industry\" disabled class=\"select-industry-opt\">Select Industry</option>\n @for (industry of industryList; track industry.industry) {\n <option [value]=\"industry?.industry\" class=\"select-industry-opt\">\n {{ industry?.description }}\n </option>\n }\n</select>\n", styles: [".form-select.select-industry{color:#000}.form-select.select-industry.select-industry-red{color:#666666b3}.form-select.select-industry option{color:#000}.form-select.select-industry option[value=select-industry]{color:gray}\n"] }]
526
+ }] });
527
+
528
+ class PageStatusCellRendererComponent {
529
+ pageStatusList = [];
530
+ params;
531
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
532
+ pageStatus = undefined;
533
+ agInit(params) {
534
+ this.params = params;
535
+ this.pageStatusList = params.colDef?.cellRendererParams?.data?.pageStatusList ?? [];
536
+ this.refresh(params);
537
+ }
538
+ // Return Cell Value
539
+ refresh(params) {
540
+ this.pageStatus = params.data;
541
+ return true;
542
+ }
543
+ updatePageStatus(value) {
544
+ if (this.params.colDef?.cellRendererParams?.onUpdatePageStatus) {
545
+ this.params.colDef.cellRendererParams.onUpdatePageStatus(this.params.data, value);
546
+ }
547
+ }
548
+ getStatusColor() {
549
+ const selectedStatus = this.pageStatusList.find(status => status.page_status_name === this.pageStatus.page_status_name);
550
+ return selectedStatus && selectedStatus.html_color ? selectedStatus.html_color : '#C5B4E3';
551
+ }
552
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: PageStatusCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
553
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: PageStatusCellRendererComponent, isStandalone: true, selector: "app-page-status-cell-renderer", ngImport: i0, template: "<div class=\"wrapper-production-status-select\">\n <select\n class=\"status-dropdown\"\n aria-label=\"status-dropdown\"\n cSelect\n sizing=\"sm\"\n (click)=\"$event.stopPropagation()\"\n [ngModel]=\"pageStatus!.page_status_name\"\n (ngModelChange)=\"updatePageStatus($event)\"\n [ngStyle]=\"{ '--select-background': getStatusColor() }\">\n @for (status of pageStatusList; track $index) {\n <option [value]=\"status.page_status_name\">\n {{ status.page_status_name }}\n </option>\n }\n </select>\n</div>\n", styles: [".status-dropdown:not(.options){background-color:var(--select-background)}.status-dropdown option{background-color:#fff;color:#000}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormModule }, { kind: "directive", type: i4.FormSelectDirective, selector: "select[cSelect]", inputs: ["sizing", "valid"] }] });
554
+ }
555
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: PageStatusCellRendererComponent, decorators: [{
556
+ type: Component,
557
+ args: [{ selector: 'app-page-status-cell-renderer', imports: [FormsModule, CommonModule, FormModule], standalone: true, template: "<div class=\"wrapper-production-status-select\">\n <select\n class=\"status-dropdown\"\n aria-label=\"status-dropdown\"\n cSelect\n sizing=\"sm\"\n (click)=\"$event.stopPropagation()\"\n [ngModel]=\"pageStatus!.page_status_name\"\n (ngModelChange)=\"updatePageStatus($event)\"\n [ngStyle]=\"{ '--select-background': getStatusColor() }\">\n @for (status of pageStatusList; track $index) {\n <option [value]=\"status.page_status_name\">\n {{ status.page_status_name }}\n </option>\n }\n </select>\n</div>\n", styles: [".status-dropdown:not(.options){background-color:var(--select-background)}.status-dropdown option{background-color:#fff;color:#000}\n"] }]
558
+ }] });
559
+
560
+ var FormFieldType;
561
+ (function (FormFieldType) {
562
+ FormFieldType["Text"] = "text";
563
+ FormFieldType["Email"] = "email";
564
+ FormFieldType["Number"] = "number";
565
+ FormFieldType["Select"] = "select";
566
+ FormFieldType["Textarea"] = "textarea";
567
+ FormFieldType["Date"] = "date";
568
+ FormFieldType["Checkbox"] = "checkbox";
569
+ FormFieldType["Float"] = "float";
570
+ FormFieldType["Edition"] = "edition";
571
+ FormFieldType["Separator"] = "seperator";
572
+ FormFieldType["FormHeader"] = "form-header";
573
+ FormFieldType["Password"] = "password";
574
+ FormFieldType["Url"] = "url";
575
+ FormFieldType["Tel"] = "tel";
576
+ })(FormFieldType || (FormFieldType = {}));
577
+
578
+ const ColorsCodes = [
579
+ {
580
+ color_name: 'AliceBlue',
581
+ color_code: '#F0F8FF'
582
+ },
583
+ {
584
+ color_name: 'Aqua',
585
+ color_code: '#00FFFF'
586
+ },
587
+ {
588
+ color_name: 'Aquamarine',
589
+ color_code: '#7FFFD4'
590
+ },
591
+ {
592
+ color_name: 'Beige',
593
+ color_code: '#F5F5DC'
594
+ },
595
+ {
596
+ color_name: 'Black',
597
+ color_code: '#000000'
598
+ },
599
+ {
600
+ color_name: 'Blue',
601
+ color_code: '#0000FF'
602
+ },
603
+ {
604
+ color_name: 'Chartreuse',
605
+ color_code: '#7FFF00'
606
+ },
607
+ {
608
+ color_name: 'Coral',
609
+ color_code: '#FF7F50'
610
+ },
611
+ {
612
+ color_name: 'DarkGray',
613
+ color_code: '#A9A9A9'
614
+ },
615
+ {
616
+ color_name: 'DarkGrey',
617
+ color_code: '#A9A9A9'
618
+ },
619
+ {
620
+ color_name: 'DarkGreen',
621
+ color_code: '#006400'
622
+ },
623
+ {
624
+ color_name: 'DarkOrange',
625
+ color_code: '#FF8C00'
626
+ },
627
+ {
628
+ color_name: 'Fuchsia',
629
+ color_code: '#FF00FF'
630
+ },
631
+ {
632
+ color_name: 'GoldenRod',
633
+ color_code: '#DAA520'
634
+ },
635
+ {
636
+ color_name: 'Gray',
637
+ color_code: '#808080'
638
+ },
639
+ {
640
+ color_name: 'Grey',
641
+ color_code: '#808080'
642
+ },
643
+ {
644
+ color_name: 'Green',
645
+ color_code: '#008000'
646
+ },
647
+ {
648
+ color_name: 'GreenYellow',
649
+ color_code: '#ADFF2F'
650
+ },
651
+ {
652
+ color_name: 'Khaki',
653
+ color_code: '#F0E68C'
654
+ },
655
+ {
656
+ color_name: 'Lavender',
657
+ color_code: '#E6E6FA'
658
+ },
659
+ {
660
+ color_name: 'LightGray',
661
+ color_code: '#D3D3D3'
662
+ },
663
+ {
664
+ color_name: 'LightGrey',
665
+ color_code: '#D3D3D3'
666
+ },
667
+ {
668
+ color_name: 'LightGreen',
669
+ color_code: '#90EE90'
670
+ },
671
+ {
672
+ color_name: 'LightSalmon',
673
+ color_code: '#FFA07A'
674
+ },
675
+ {
676
+ color_name: 'LightSkyBlue',
677
+ color_code: '#87CEFA'
678
+ },
679
+ {
680
+ color_name: 'Lime',
681
+ color_code: '#00FF00'
682
+ },
683
+ {
684
+ color_name: 'LimeGreen',
685
+ color_code: '#32CD32'
686
+ },
687
+ {
688
+ color_name: 'Magenta',
689
+ color_code: '#FF00FF'
690
+ },
691
+ {
692
+ color_name: 'Maroon',
693
+ color_code: '#800000'
694
+ },
695
+ {
696
+ color_name: 'MediumSpringGreen',
697
+ color_code: '#00FA9A'
698
+ },
699
+ {
700
+ color_name: 'Navy',
701
+ color_code: '#000080'
702
+ },
703
+ {
704
+ color_name: 'Olive',
705
+ color_code: '#808000'
706
+ },
707
+ {
708
+ color_name: 'Orange',
709
+ color_code: '#FFA500'
710
+ },
711
+ {
712
+ color_name: 'OrangeRed',
713
+ color_code: '#FF4500'
714
+ },
715
+ {
716
+ color_name: 'Orchid',
717
+ color_code: '#DA70D6'
718
+ },
719
+ {
720
+ color_name: 'PaleGreen',
721
+ color_code: '#98FB98'
722
+ },
723
+ {
724
+ color_name: 'PaleTurquoise',
725
+ color_code: '#AFEEEE'
726
+ },
727
+ {
728
+ color_name: 'Plum',
729
+ color_code: '#DDA0DD'
730
+ },
731
+ {
732
+ color_name: 'Purple',
733
+ color_code: '#800080'
734
+ },
735
+ {
736
+ color_name: 'Red',
737
+ color_code: '#FF0000'
738
+ },
739
+ {
740
+ color_name: 'Salmon',
741
+ color_code: '#FA8072'
742
+ },
743
+ {
744
+ color_name: 'SandyBrown',
745
+ color_code: '#F4A460'
746
+ },
747
+ {
748
+ color_name: 'Silver',
749
+ color_code: '#C0C0C0'
750
+ },
751
+ {
752
+ color_name: 'SkyBlue',
753
+ color_code: '#87CEEB'
754
+ },
755
+ {
756
+ color_name: 'Teal',
757
+ color_code: '#008080'
758
+ },
759
+ {
760
+ color_name: 'Tomato',
761
+ color_code: '#FF6347'
762
+ },
763
+ {
764
+ color_name: 'Violet',
765
+ color_code: '#EE82EE'
766
+ },
767
+ {
768
+ color_name: 'Wheat',
769
+ color_code: '#F5DEB3'
770
+ },
771
+ {
772
+ color_name: 'White',
773
+ color_code: '#FFFFFF'
774
+ },
775
+ {
776
+ color_name: 'Yellow',
777
+ color_code: '#FFFF00'
778
+ }
779
+ ];
780
+
781
+ class CircularFocusDirective {
782
+ el = inject(ElementRef);
783
+ formId = '';
784
+ formGroup = null;
785
+ focusableElements = [];
786
+ formSubscription = null;
787
+ ngAfterViewInit() {
788
+ setTimeout(() => {
789
+ this.collectFocusableElements();
790
+ // Subscribe to form value changes if formGroup is provided
791
+ if (this.formGroup) {
792
+ this.formSubscription = this.formGroup.valueChanges.subscribe(() => {
793
+ // Wait for DOM to update after form changes
794
+ setTimeout(() => {
795
+ this.collectFocusableElements();
796
+ }, 0);
797
+ });
798
+ }
799
+ }, 0);
800
+ }
801
+ ngOnDestroy() {
802
+ // Clean up subscription when directive is destroyed
803
+ if (this.formSubscription) {
804
+ this.formSubscription.unsubscribe();
805
+ }
806
+ }
807
+ collectFocusableElements() {
808
+ if (!this.formId) {
809
+ // If no formId is provided, use the current element
810
+ this.focusableElements = this.getFocusableElements(this.el.nativeElement);
811
+ }
812
+ else {
813
+ const formElement = document.getElementById(this.formId);
814
+ if (formElement) {
815
+ this.focusableElements = this.getFocusableElements(formElement);
816
+ }
817
+ }
818
+ }
819
+ getFocusableElements(element) {
820
+ return Array.from(element.querySelectorAll('input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [contenteditable]:not([disabled]), c-multi-select:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])')).filter(el => {
821
+ // Filter out hidden elements
822
+ const element = el;
823
+ return element.offsetParent !== null; // Check if element is visible
824
+ });
825
+ }
826
+ onKeyDown(event) {
827
+ // ToDo: Plan to escape the circular navigation when Escape is pressed
828
+ // if (event.key === 'Escape') {}
829
+ // Only handle Tab key events
830
+ if (event.key !== 'Tab')
831
+ return;
832
+ // If no focusable elements, do nothing
833
+ if (this.focusableElements.length === 0)
834
+ return;
835
+ const currentElement = document.activeElement;
836
+ const currentIndex = this.focusableElements.indexOf(currentElement);
837
+ // If current element is not in our list, do nothing
838
+ if (currentIndex === -1)
839
+ return;
840
+ // Handle circular navigation
841
+ if (event.shiftKey) {
842
+ // Going backward with Shift+Tab
843
+ if (currentIndex === 0) {
844
+ event.preventDefault();
845
+ const lastElement = this.focusableElements[this.focusableElements.length - 1];
846
+ lastElement.focus();
847
+ }
848
+ }
849
+ else {
850
+ // Going forward with Tab
851
+ if (currentIndex === this.focusableElements.length - 1) {
852
+ event.preventDefault();
853
+ const firstElement = this.focusableElements[0];
854
+ firstElement.focus();
855
+ }
856
+ }
857
+ }
858
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CircularFocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
859
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.9", type: CircularFocusDirective, isStandalone: true, selector: "[appCircularFocus]", inputs: { formId: "formId", formGroup: "formGroup" }, host: { listeners: { "keydown": "onKeyDown($event)" } }, ngImport: i0 });
860
+ }
861
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CircularFocusDirective, decorators: [{
862
+ type: Directive,
863
+ args: [{
864
+ selector: '[appCircularFocus]',
865
+ standalone: true
866
+ }]
867
+ }], propDecorators: { formId: [{
868
+ type: Input
869
+ }], formGroup: [{
870
+ type: Input
871
+ }], onKeyDown: [{
872
+ type: HostListener,
873
+ args: ['keydown', ['$event']]
874
+ }] } });
875
+
876
+ /* eslint-disable @typescript-eslint/no-explicit-any */
877
+ class DecimalInputDirective {
878
+ el = inject((ElementRef));
879
+ control = inject(NgControl);
880
+ sub;
881
+ appDecimalInput = 4;
882
+ specialKeys = ['Backspace', 'Tab', 'End', 'Home', 'ArrowLeft', 'ArrowRight', 'Delete'];
883
+ ngOnInit() {
884
+ // Only format when value comes from patchValue / setValue (not typing)
885
+ this.sub = this.control.valueChanges?.subscribe(value => {
886
+ const inputEl = this.el.nativeElement;
887
+ // Skip if input element is focused (user typing)
888
+ if (document.activeElement === inputEl)
889
+ return;
890
+ this.formatValue(value);
891
+ });
892
+ }
893
+ ngOnDestroy() {
894
+ this.sub?.unsubscribe();
895
+ }
896
+ onKeyDown(event) {
897
+ const input = this.el.nativeElement;
898
+ const value = input.value;
899
+ if (this.specialKeys.includes(event.key))
900
+ return;
901
+ if (event.key === '.' && value.includes('.')) {
902
+ event.preventDefault();
903
+ return;
904
+ }
905
+ const cursorPos = input.selectionStart ?? value.length;
906
+ const nextValue = this.getNextValue(value, event.key, cursorPos);
907
+ if (!this.isValidInput(nextValue)) {
908
+ event.preventDefault();
909
+ }
910
+ }
911
+ onBlur() {
912
+ this.formatValue(this.el.nativeElement.value);
913
+ }
914
+ formatValue(value) {
915
+ if (value === null || value === undefined || value === '')
916
+ return;
917
+ if (isNaN(Number(value)))
918
+ return;
919
+ const [integerPart, decimalPart = ''] = value.toString().split('.');
920
+ let formatted = integerPart + '.' + decimalPart.padEnd(this.appDecimalInput, '0');
921
+ if (decimalPart.length > this.appDecimalInput) {
922
+ formatted = integerPart + '.' + decimalPart.slice(0, this.appDecimalInput);
923
+ }
924
+ this.control.control?.setValue(formatted, { emitEvent: false });
925
+ this.el.nativeElement.value = formatted;
926
+ }
927
+ isValidInput(value) {
928
+ const regex = new RegExp(`^\\d*\\.?\\d{0,${this.appDecimalInput}}$`);
929
+ return regex.test(value);
930
+ }
931
+ getNextValue(currentValue, key, cursorPos) {
932
+ return currentValue.slice(0, cursorPos) + key + currentValue.slice(cursorPos);
933
+ }
934
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: DecimalInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
935
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.9", type: DecimalInputDirective, isStandalone: true, selector: "[appDecimalInput]", inputs: { appDecimalInput: "appDecimalInput" }, host: { listeners: { "keydown": "onKeyDown($event)", "blur": "onBlur()" } }, ngImport: i0 });
936
+ }
937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: DecimalInputDirective, decorators: [{
938
+ type: Directive,
939
+ args: [{
940
+ selector: '[appDecimalInput]',
941
+ standalone: true
942
+ }]
943
+ }], propDecorators: { appDecimalInput: [{
944
+ type: Input
945
+ }], onKeyDown: [{
946
+ type: HostListener,
947
+ args: ['keydown', ['$event']]
948
+ }], onBlur: [{
949
+ type: HostListener,
950
+ args: ['blur']
951
+ }] } });
952
+
953
+ /// <reference path="../types/coreui-pro.d.ts" />
954
+ class ShowTooltipIfTruncatedDirective {
955
+ tooltipText = '';
956
+ el = inject(ElementRef);
957
+ constructor() { }
958
+ onMouseEnter() {
959
+ if (!this.isTextTruncated()) {
960
+ return;
961
+ }
962
+ Tooltip.getOrCreateInstance(this.el.nativeElement, {
963
+ trigger: 'manual',
964
+ title: this.tooltipText
965
+ }).show();
966
+ }
967
+ onMouseLeave() {
968
+ Tooltip.getOrCreateInstance(this.el.nativeElement)?.hide();
969
+ }
970
+ isTextTruncated() {
971
+ const el = this.el.nativeElement;
972
+ return el.scrollWidth > el.clientWidth;
973
+ }
974
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ShowTooltipIfTruncatedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
975
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.9", type: ShowTooltipIfTruncatedDirective, isStandalone: true, selector: "[appShowTooltipIfTruncated]", inputs: { tooltipText: ["appShowTooltipIfTruncated", "tooltipText"] }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0 });
976
+ }
977
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ShowTooltipIfTruncatedDirective, decorators: [{
978
+ type: Directive,
979
+ args: [{ selector: '[appShowTooltipIfTruncated]', standalone: true }]
980
+ }], ctorParameters: () => [], propDecorators: { tooltipText: [{
981
+ type: Input,
982
+ args: ['appShowTooltipIfTruncated']
983
+ }], onMouseEnter: [{
984
+ type: HostListener,
985
+ args: ['mouseenter']
986
+ }], onMouseLeave: [{
987
+ type: HostListener,
988
+ args: ['mouseleave']
989
+ }] } });
990
+
991
+ class MultiSelectStylerDirective {
992
+ ngControl = inject(NgControl, { optional: true });
993
+ renderer = inject(Renderer2);
994
+ el = inject(ElementRef);
995
+ mutationObserver;
996
+ appMultiSelectStyler = true;
997
+ options = [];
998
+ multiSelect = inject(MultiSelectComponent, { optional: true });
999
+ ngOnInit() {
1000
+ if (!this.appMultiSelectStyler)
1001
+ return;
1002
+ if (!this.ngControl) {
1003
+ return;
1004
+ }
1005
+ // Initial update
1006
+ setTimeout(() => this.updateSelectedItem(), 0);
1007
+ // Watch for control value changes
1008
+ this.ngControl.valueChanges?.subscribe(() => {
1009
+ setTimeout(() => this.updateSelectedItem(), 0);
1010
+ });
1011
+ this.setupMutationObserver();
1012
+ }
1013
+ setupMutationObserver() {
1014
+ const container = this.getSelectionContainer();
1015
+ if (!container)
1016
+ return;
1017
+ this.mutationObserver = new MutationObserver(() => {
1018
+ this.updateSelectedItem();
1019
+ });
1020
+ this.mutationObserver.observe(container, {
1021
+ childList: true,
1022
+ subtree: true
1023
+ });
1024
+ }
1025
+ getSelectionContainer() {
1026
+ return this.el.nativeElement.querySelector('.form-multi-select-selection');
1027
+ }
1028
+ updateSelectedItem() {
1029
+ const container = this.getSelectionContainer();
1030
+ if (!container)
1031
+ return;
1032
+ // Clear existing custom element
1033
+ const existingItem = container.querySelector('.color-box');
1034
+ if (existingItem) {
1035
+ existingItem.remove();
1036
+ }
1037
+ const selectedValue = this.ngControl?.value;
1038
+ if (!selectedValue)
1039
+ return;
1040
+ const textElement = container.querySelector('.form-multi-select-text');
1041
+ if (!textElement)
1042
+ return;
1043
+ const option = this.options.find(opt => opt.label === selectedValue);
1044
+ if (!option) {
1045
+ return;
1046
+ }
1047
+ // const option = { color: 'red'};
1048
+ this.renderer.setStyle(container, 'flex-wrap', 'unset');
1049
+ this.renderer.addClass(container, 'gap-2');
1050
+ // Create and insert color box
1051
+ const colorBox = this.renderer.createElement('span');
1052
+ this.renderer.addClass(colorBox, 'color-box');
1053
+ this.renderer.setStyle(colorBox, 'background-color', option.value);
1054
+ this.renderer.insertBefore(textElement.parentNode, colorBox, textElement);
1055
+ }
1056
+ ngOnDestroy() {
1057
+ this.mutationObserver?.disconnect();
1058
+ }
1059
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiSelectStylerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1060
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.9", type: MultiSelectStylerDirective, isStandalone: true, selector: "[appMultiSelectStyler]", inputs: { appMultiSelectStyler: "appMultiSelectStyler", options: "options" }, ngImport: i0 });
1061
+ }
1062
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiSelectStylerDirective, decorators: [{
1063
+ type: Directive,
1064
+ args: [{
1065
+ selector: '[appMultiSelectStyler]',
1066
+ standalone: true
1067
+ }]
1068
+ }], propDecorators: { appMultiSelectStyler: [{
1069
+ type: Input
1070
+ }], options: [{
1071
+ type: Input
1072
+ }] } });
1073
+
1074
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1075
+ class MultiFormComponent {
1076
+ formBuilder = inject(FormBuilder);
1077
+ configurationService = inject(ConfigurationServiceLib);
1078
+ config;
1079
+ showUnsavedFlags;
1080
+ currentTableGridsSelectedIndex;
1081
+ formId;
1082
+ fieldAction = new EventEmitter();
1083
+ formSavedUnsavedListen = new EventEmitter();
1084
+ selectionChangeEvent = new EventEmitter();
1085
+ multiForm;
1086
+ isFormSubmitted;
1087
+ initialFormValues;
1088
+ isFormSaved = false;
1089
+ isFormSavedModalActive = false;
1090
+ isSelectionChange = false;
1091
+ inputType = {
1092
+ colorSelect: 'color-select'
1093
+ };
1094
+ colorCodes$ = ColorsCodes;
1095
+ FormFieldType = FormFieldType;
1096
+ constructor() {
1097
+ this.multiForm = this.formBuilder.group({});
1098
+ this.isFormSubmitted = false;
1099
+ this.showUnsavedFlags = false;
1100
+ this.formId = '';
1101
+ }
1102
+ ngOnInit() {
1103
+ this.buildFormControls();
1104
+ this.saveInitialFormValues();
1105
+ console.log('config ->>>', this.configurationService);
1106
+ }
1107
+ ngOnChanges(changes) {
1108
+ if (changes['config'] && !changes['config'].isFirstChange()) {
1109
+ if (this.showUnsavedFlags) {
1110
+ if (this.hasUnsavedChanges() && !this.isFormSaved && !this.isSelectionChange) {
1111
+ Swal.fire({
1112
+ icon: 'warning',
1113
+ title: 'Do you want to save the changes?',
1114
+ showDenyButton: true,
1115
+ confirmButtonText: 'Save',
1116
+ denyButtonText: `Don't save`
1117
+ }).then((result) => {
1118
+ if (result.isConfirmed) {
1119
+ this.proceedToSaveUnsavedForm();
1120
+ }
1121
+ else if (result.isDenied) {
1122
+ this.proceedWithoutSavingForm();
1123
+ }
1124
+ });
1125
+ return;
1126
+ }
1127
+ this.updateFormControls();
1128
+ }
1129
+ else {
1130
+ this.updateFormControls();
1131
+ }
1132
+ }
1133
+ }
1134
+ buildFormControls() {
1135
+ if (this.config?.rows?.length) {
1136
+ this.config.rows.forEach(row => {
1137
+ row.forEach(field => {
1138
+ if (field?.type === FormFieldType.Separator || field?.type === FormFieldType.FormHeader)
1139
+ return;
1140
+ const validators = this.getValidators(field.validations);
1141
+ if (field.type === FormFieldType.Checkbox) {
1142
+ this.multiForm.addControl(field.controlName, this.formBuilder.control({ value: this.getTruthyOrFalsy(field.value) || false, disabled: field.validations?.readonly || false }, validators));
1143
+ }
1144
+ else if (field.type === FormFieldType.Date) {
1145
+ // If field value is "", dont set the default advance date
1146
+ this.multiForm.addControl(field.controlName, this.formBuilder.control({
1147
+ value: field?.value !== '' ? this.setDefaultAdvanceDate(new Date(), field?.validations?.defaultAdvance || '') : '',
1148
+ disabled: field.validations?.readonly || false
1149
+ }, validators));
1150
+ }
1151
+ else {
1152
+ this.multiForm.addControl(field.controlName, this.formBuilder.control({ value: field?.value || '', disabled: field.validations?.readonly || false }, validators));
1153
+ }
1154
+ });
1155
+ });
1156
+ }
1157
+ }
1158
+ /** Reload the field action */
1159
+ onClickFieldAction(action, field) {
1160
+ this.fieldAction.emit({ action: 'reload', field });
1161
+ }
1162
+ updateFormControls() {
1163
+ if (!this.config?.rows?.length)
1164
+ return;
1165
+ this.config.rows.forEach(row => {
1166
+ row.forEach(field => {
1167
+ if (field?.type === FormFieldType.Separator || field?.type === FormFieldType.FormHeader)
1168
+ return;
1169
+ const isReadOnly = !!field.validations?.readonly;
1170
+ const validators = this.getValidators(field.validations);
1171
+ let control = this.multiForm.get(field.controlName);
1172
+ // If control does not exist, add it as enabled
1173
+ if (!control) {
1174
+ let initialValue = '';
1175
+ if (field.type === FormFieldType.Checkbox) {
1176
+ initialValue = this.getTruthyOrFalsy(field.value) || false;
1177
+ }
1178
+ else if (field.type === FormFieldType.Date) {
1179
+ initialValue = field?.value ? new Date(field.value) : this.setDefaultAdvanceDate(new Date(), field?.validations?.defaultAdvance || '');
1180
+ }
1181
+ else {
1182
+ initialValue = field.value || '';
1183
+ }
1184
+ control = this.formBuilder.control(initialValue, { validators, nonNullable: true });
1185
+ this.multiForm.addControl(field.controlName, control);
1186
+ }
1187
+ // Always enable before setting value
1188
+ control.enable({ emitEvent: false });
1189
+ // Set value
1190
+ if (field.type === FormFieldType.Checkbox) {
1191
+ control.setValue(this.getTruthyOrFalsy(field.value) || false, { emitEvent: false });
1192
+ }
1193
+ else if (field.type === FormFieldType.Date) {
1194
+ control.setValue(field?.value ? new Date(field.value) : '', { emitEvent: false });
1195
+ }
1196
+ else {
1197
+ control.setValue(field.value || '', { emitEvent: false });
1198
+ }
1199
+ // Disable if readonly
1200
+ if (isReadOnly) {
1201
+ control.disable({ emitEvent: false });
1202
+ }
1203
+ });
1204
+ });
1205
+ this.saveInitialFormValues();
1206
+ this.isFormSaved = false;
1207
+ this.multiForm.markAsPristine();
1208
+ }
1209
+ getTruthyOrFalsy(value) {
1210
+ return value === '1' ? true : false;
1211
+ }
1212
+ getValidators(validations) {
1213
+ const validators = [];
1214
+ if (validations) {
1215
+ if (validations.required) {
1216
+ validators.push(Validators.required);
1217
+ }
1218
+ if (validations.minLength) {
1219
+ validators.push(Validators.minLength(validations.minLength));
1220
+ }
1221
+ if (validations.maxLength) {
1222
+ validators.push(Validators.maxLength(validations.maxLength));
1223
+ }
1224
+ if (validations.pattern) {
1225
+ validators.push(Validators.pattern(validations.pattern));
1226
+ }
1227
+ }
1228
+ return validators;
1229
+ }
1230
+ /** Get the form values */
1231
+ getFormValues() {
1232
+ this.isFormSubmitted = true;
1233
+ this.isFormSaved = true;
1234
+ const formSubmissionEmit = { isValid: this.multiForm.valid, values: this.multiForm.getRawValue(), controls: this.multiForm.controls };
1235
+ return formSubmissionEmit;
1236
+ }
1237
+ /** Reset the form */
1238
+ resetForm() {
1239
+ this.multiForm.reset();
1240
+ this.isFormSubmitted = false;
1241
+ }
1242
+ /**Set Value to form */
1243
+ setValue(control, value) {
1244
+ this.multiForm.controls[control].setValue(value);
1245
+ }
1246
+ /**Get Value from form */
1247
+ getValue(control) {
1248
+ return this.multiForm.controls[control].value;
1249
+ }
1250
+ /**Get Form Control */
1251
+ getFormControl(control) {
1252
+ return this.multiForm.controls[control];
1253
+ }
1254
+ hasUnsavedChanges() {
1255
+ return JSON.stringify(this.multiForm.getRawValue()) !== JSON.stringify(this.initialFormValues);
1256
+ }
1257
+ saveInitialFormValues() {
1258
+ this.initialFormValues = this.multiForm.getRawValue();
1259
+ }
1260
+ proceedToSaveUnsavedForm() {
1261
+ this.formSavedUnsavedListen.emit({ isValid: this.multiForm.valid, values: this.multiForm.getRawValue(), controls: this.multiForm.controls });
1262
+ }
1263
+ proceedWithoutSavingForm() {
1264
+ this.formSavedUnsavedListen.emit(null);
1265
+ this.updateFormControls();
1266
+ }
1267
+ onValueChange(event, control) {
1268
+ this.selectionChangeEvent.emit({ control, value: event });
1269
+ this.isSelectionChange = true;
1270
+ }
1271
+ onDateValueChange(value, control) {
1272
+ const stopControl = this.findStopControl();
1273
+ if (stopControl) {
1274
+ if (control === '@start' && value && stopControl?.validations?.defaultAdvance) {
1275
+ const startDate = new Date(value);
1276
+ if (this.multiForm.contains('@stop')) {
1277
+ this.multiForm.controls['@stop'].setValue(this.setDefaultAdvanceDate(startDate, stopControl?.validations?.defaultAdvance));
1278
+ }
1279
+ }
1280
+ }
1281
+ }
1282
+ onEditionChange(event) {
1283
+ const controlNameWithAt = '@edname';
1284
+ const controlNameWithoutAt = 'edname';
1285
+ if (this.multiForm.contains(controlNameWithAt)) {
1286
+ this.multiForm.controls[controlNameWithAt].setValue(event);
1287
+ }
1288
+ else if (this.multiForm.contains(controlNameWithoutAt)) {
1289
+ this.multiForm.controls[controlNameWithoutAt].setValue(event);
1290
+ }
1291
+ else {
1292
+ this.multiForm.addControl(controlNameWithAt, this.formBuilder.control(event));
1293
+ }
1294
+ }
1295
+ setDefaultAdvanceDate(currentDate, defaultAdvance) {
1296
+ if (defaultAdvance === 'weekly') {
1297
+ return this.advanceDate(currentDate, 6);
1298
+ }
1299
+ else if (defaultAdvance === 'monthly') {
1300
+ const month = currentDate.getMonth();
1301
+ const year = currentDate.getFullYear();
1302
+ // Get days in current month
1303
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
1304
+ let daysToAdd = 30;
1305
+ if (daysInMonth === 31) {
1306
+ daysToAdd = 30;
1307
+ }
1308
+ else if (daysInMonth === 30) {
1309
+ daysToAdd = 29;
1310
+ }
1311
+ else if (month === 1) {
1312
+ const isLeap = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
1313
+ daysToAdd = isLeap ? 28 : 27;
1314
+ }
1315
+ return this.advanceDate(currentDate, daysToAdd);
1316
+ }
1317
+ else if (defaultAdvance === 'quarterly') {
1318
+ return this.advanceDate(currentDate, 90);
1319
+ }
1320
+ else if (defaultAdvance === 'halfyearly') {
1321
+ return this.advanceDate(currentDate, 180);
1322
+ }
1323
+ else if (defaultAdvance === 'yearly') {
1324
+ return this.advanceDate(currentDate, 365);
1325
+ }
1326
+ else {
1327
+ return this.advanceDate(currentDate, 0);
1328
+ }
1329
+ }
1330
+ advanceDate(currentDate, advancedBy) {
1331
+ if (advancedBy || advancedBy === 0) {
1332
+ const advanceDate = new Date(currentDate.setDate(currentDate.getDate() + advancedBy));
1333
+ return advanceDate;
1334
+ }
1335
+ }
1336
+ findStopControl() {
1337
+ for (const row of this.config.rows) {
1338
+ for (const field of row) {
1339
+ if (field.controlName === '@stop') {
1340
+ return field;
1341
+ }
1342
+ }
1343
+ }
1344
+ return null;
1345
+ }
1346
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1347
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: MultiFormComponent, isStandalone: false, selector: "app-multi-form", inputs: { config: "config", showUnsavedFlags: "showUnsavedFlags", currentTableGridsSelectedIndex: "currentTableGridsSelectedIndex", formId: "formId" }, outputs: { fieldAction: "fieldAction", formSavedUnsavedListen: "formSavedUnsavedListen", selectionChangeEvent: "selectionChangeEvent" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"multiForm\" cForm class=\"multiform-wrapper\" appCircularFocus>\n @for (row of config?.rows; track $index; let isLast = $last) {\n <div class=\"row gx-3 multiform-inner\" [id]=\"formId\" [ngClass]=\"config?.rows?.length > 1 && !isLast ? 'border-bottom mb-3' : ''\">\n @for (field of row; track $index) {\n @if (field?.type !== FormFieldType.Separator && field?.type !== FormFieldType.FormHeader) {\n <div class=\"mb-3\" [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\" [attr.data-id]=\"field.controlName\">\n @if (multiForm.controls[field.controlName]) {\n <!-- Label -->\n @if (field.label && field.type !== FormFieldType.Checkbox) {\n <label\n [appShowTooltipIfTruncated]=\"field.label\"\n cLabel\n class=\"mb-1 label-multiform single-line-label\"\n [for]=\"field.controlName\"\n [ngClass]=\"{ 'text-danger': isFormSubmitted && multiForm.controls[field.controlName]?.errors }\"\n [ngStyle]=\"field.styles?.label\"\n >{{ field.label }}\n @if (field?.validations?.required || false) {\n <strong class=\"text-danger\">*</strong>\n }\n </label>\n }\n\n <!-- Text, Email, Number Inputs -->\n @if (\n field.type === FormFieldType.Text ||\n field.type === FormFieldType.Email ||\n field.type === FormFieldType.Number ||\n field.type === FormFieldType.Password ||\n field.type === FormFieldType.Url ||\n field.type === FormFieldType.Tel\n ) {\n <div class=\"position-relative w-100\">\n <input\n [type]=\"field.type\"\n cFormControl\n [formControlName]=\"field.controlName\"\n [id]=\"field.controlName\"\n [placeholder]=\"field.placeholder || ''\"\n [ngClass]=\"{\n 'form-invalid border-danger border border-2':\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors,\n 'no-label-margin': !field.label\n }\"\n [min]=\"field.validations?.min\"\n [max]=\"field.validations?.max\"\n [ngStyle]=\"field.styles?.field\" />\n\n @if (field.actionButton) {\n <button\n type=\"button\"\n [cTooltip]=\"field.actionButton?.tooltip\"\n tooltipPlacement=\"top\"\n cButton\n color=\"primary\"\n variant=\"outline\"\n aria-label=\"action\"\n class=\"d-flex position-absolute top-50 end-0 translate-middle-y me-2 btn p-0 border-0 bg-transparent\"\n (click)=\"onClickFieldAction($event, field)\">\n <svg cIcon class=\"text-primary\" [name]=\"field.actionButton.icon\" size=\"xl\"></svg>\n </button>\n }\n @if (multiForm.controls[field.controlName]?.touched || isFormSubmitted) {\n @if (multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Minimum length {{ field?.validations?.minLength }} characters is required\n </small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\n </small>\n }\n }\n }\n </div>\n }\n\n <!-- Select Inputs -->\n @else if (field.type === FormFieldType.Select || field.type === inputType?.colorSelect) {\n <ng-container>\n <c-multi-select\n [multiple]=\"field?.multiple || false\"\n [allowCreateOptions]=\"field?.allowCreateOptions || false\"\n [search]=\"field?.allowCreateOptions || field?.allowSearch || false\"\n [clearSearchOnSelect]=\"true\"\n [selectionType]=\"field?.selectionType || 'tags'\"\n [cleaner]=\"field?.allowCleaner || true\"\n [formControlName]=\"field.controlName\"\n [placeholder]=\"field.placeholder || 'Select'\"\n [appMultiSelectStyler]=\"field.type === inputType?.colorSelect\"\n [options]=\"colorCodes$\"\n [optionsMaxHeight]=\"400\"\n [ngClass]=\"{\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\n }\"\n (valueChange)=\"onValueChange($event, field.controlName)\"\n [ngStyle]=\"field.styles?.field\">\n @if (field.type === inputType?.colorSelect) {\n @for (option of colorCodes$; track $index) {\n <c-multi-select-option [value]=\"option?.label\">\n <label class=\"d-flex gap-2\">\n <span class=\"color-box\" [style.background-color]=\"option?.value\"></span>\n {{ option.label }}\n </label>\n </c-multi-select-option>\n }\n } @else {\n @for (option of field.options; track $index) {\n <c-multi-select-option [value]=\"option?.value\">\n {{ option.label }}\n </c-multi-select-option>\n }\n }\n </c-multi-select>\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n }\n }\n </ng-container>\n }\n\n <!-- Date input -->\n @else if (field.type === FormFieldType.Date) {\n <ng-container>\n <input\n type=\"text\"\n [placeholder]=\"field?.label || 'Select Date'\"\n class=\"form-control\"\n [ngClass]=\"{\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\n }\"\n (bsValueChange)=\"onDateValueChange($event, field.controlName)\"\n [formControlName]=\"field.controlName\"\n [dateInputFormat]=\"configurationService?.allConfigValues()?.defaultDateFormat || 'MM/DD/YYYY'\"\n [bsConfig]=\"{\n containerClass: 'pongrass-red-datepicker',\n showWeekNumbers: false,\n adaptivePosition: true,\n useUtc: false\n }\"\n bsDatepicker\n [ngStyle]=\"field.styles?.field\" />\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n }\n }\n </ng-container>\n }\n <!-- Textarea -->\n @else if (field.type === FormFieldType.Textarea) {\n <ng-container>\n <textarea\n cFormControl\n [id]=\"field.controlName\"\n [rows]=\"field?.textareaRows || 4\"\n [columns]=\"field?.textareaColumns || 4\"\n [placeholder]=\"field.placeholder || ''\"\n [ngClass]=\"{\n 'form-invalid border-danger border border-2':\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\n }\"\n [formControlName]=\"field.controlName\"\n [ngStyle]=\"field.styles?.field\"></textarea>\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Minimum length {{ field?.validations?.minLength }} characters is required\n </small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\n </small>\n }\n }\n </ng-container>\n }\n <!-- Checkbox -->\n @else if (field.type === FormFieldType.Checkbox) {\n <div class=\"no-label-margin\">\n <input cFormCheckInput [id]=\"field.controlName\" type=\"checkbox\" [formControlName]=\"field.controlName\" [ngStyle]=\"field.styles?.field\" />\n <label cFormCheckLabel [for]=\"field.controlName\" class=\"ms-2\" [ngStyle]=\"field.styles?.label\">{{ field.label }}</label>\n </div>\n }\n <!-- Decimal input -->\n @else if (field.type === FormFieldType.Float) {\n <ng-container>\n <input\n cFormControl\n [id]=\"field.controlName\"\n type=\"number\"\n class=\"me-2\"\n [formControlName]=\"field.controlName\"\n [appDecimalInput]=\"field.validations?.precision || 2\"\n [ngClass]=\"{\n 'form-invalid border-danger border border-2':\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\n }\"\n [min]=\"field.validations?.min\"\n [max]=\"field.validations?.max\"\n [ngStyle]=\"field.styles?.field\" />\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Minimum length {{ field?.validations?.minLength }} characters is required\n </small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\n </small>\n }\n }\n </ng-container>\n } @else if (field.type === FormFieldType.Edition) {\n <ng-container>\n <app-edition-list-grouped\n (selectedEditionsChange)=\"onEditionChange($event)\"\n [multiple]=\"field?.multiple || true\"\n [hasFormError]=\"isFormSubmitted && multiForm.controls[field.controlName]?.errors\">\n </app-edition-list-grouped>\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n }\n }\n </ng-container>\n }\n }\n </div>\n }\n\n @if (field?.type === FormFieldType.Separator) {\n <div [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\"></div>\n }\n @if (field?.type === FormFieldType.FormHeader) {\n <div [class]=\"'fs-6 fw-bold my-2 field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\">{{ field?.label }}</div>\n }\n }\n </div>\n }\n</form>\n", styles: [".no-label-margin{margin-top:1.6rem}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.h-135{height:135px}.single-line-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;display:block}.label-multiform{font-size:16px;font-weight:400}.field-checkbox{display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: CircularFocusDirective, selector: "[appCircularFocus]", inputs: ["formId", "formGroup"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.MultiSelectComponent, selector: "c-multi-select", inputs: ["allowCreateOptions", "cleaner", "clearSearchOnSelect", "disabled", "loading", "multiple", "options", "optionsMaxHeight", "optionsStyle", "placeholder", "resetSelectionOnOptionsChange", "search", "searchNoResultsLabel", "searchValue", "selectAll", "selectAllLabel", "selectionType", "selectionTypeCounterText", "selectionTypeCounterTextPluralMap", "size", "value", "valid", "virtualScroller", "visibleItems", "itemSize", "itemMinWidth", "visible", "popperOptions"], outputs: ["searchValueChange", "valueChange", "visibleChange"], exportAs: ["cMultiSelect"] }, { kind: "component", type: i4.MultiSelectOptionComponent, selector: "c-multi-select-option", inputs: ["optionsStyle", "label", "text", "visible", "disabled", "selected", "value", "active", "role"], outputs: ["selectedChange", "focusChange"], exportAs: ["cMultiSelectOption"] }, { kind: "directive", type: i4.FormDirective, selector: "form[cForm]", inputs: ["validated"] }, { kind: "directive", type: i4.FormCheckLabelDirective, selector: "label[cFormCheckLabel]" }, { kind: "directive", type: i4.FormCheckInputDirective, selector: "input[cFormCheckInput]", inputs: ["type", "indeterminate", "valid"] }, { kind: "directive", type: i4.FormControlDirective, selector: "input[cFormControl], textarea[cFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }, { kind: "directive", type: i4.FormLabelDirective, selector: "[cLabel]", inputs: ["cLabel", "sizing"] }, { kind: "directive", type: i5.IconDirective, selector: "svg[cIcon]", inputs: ["cIcon", "customClasses", "size", "title", "height", "width", "name", "viewBox", "xmlns", "pointer-events", "role"], exportAs: ["cIcon"] }, { kind: "directive", type: DecimalInputDirective, selector: "[appDecimalInput]", inputs: ["appDecimalInput"] }, { kind: "directive", type: ShowTooltipIfTruncatedDirective, selector: "[appShowTooltipIfTruncated]", inputs: ["appShowTooltipIfTruncated"] }, { kind: "directive", type: i4.TooltipDirective, selector: "[cTooltip]", inputs: ["cTooltip", "cTooltipOptions", "cTooltipPlacement", "cTooltipRef", "cTooltipTrigger", "cTooltipVisible"], outputs: ["cTooltipVisibleChange"], exportAs: ["cTooltip"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }, { kind: "directive", type: i8.BsDatepickerDirective, selector: "[bsDatepicker]", inputs: ["placement", "triggers", "outsideClick", "container", "outsideEsc", "isDisabled", "minDate", "maxDate", "ignoreMinMaxErrors", "minMode", "daysDisabled", "datesDisabled", "datesEnabled", "dateCustomClasses", "dateTooltipTexts", "isOpen", "bsValue", "bsConfig"], outputs: ["onShown", "onHidden", "bsValueChange"], exportAs: ["bsDatepicker"] }, { kind: "directive", type: i8.BsDatepickerInputDirective, selector: "input[bsDatepicker]" }, { kind: "component", type: EditionListGroupedComponent, selector: "app-edition-list-grouped", inputs: ["label", "multiple", "hasFormError"], outputs: ["selectedEditionsChange"] }, { kind: "directive", type: MultiSelectStylerDirective, selector: "[appMultiSelectStyler]", inputs: ["appMultiSelectStyler", "options"] }] });
1348
+ }
1349
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiFormComponent, decorators: [{
1350
+ type: Component,
1351
+ args: [{ selector: 'app-multi-form', standalone: false, template: "<form [formGroup]=\"multiForm\" cForm class=\"multiform-wrapper\" appCircularFocus>\n @for (row of config?.rows; track $index; let isLast = $last) {\n <div class=\"row gx-3 multiform-inner\" [id]=\"formId\" [ngClass]=\"config?.rows?.length > 1 && !isLast ? 'border-bottom mb-3' : ''\">\n @for (field of row; track $index) {\n @if (field?.type !== FormFieldType.Separator && field?.type !== FormFieldType.FormHeader) {\n <div class=\"mb-3\" [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\" [attr.data-id]=\"field.controlName\">\n @if (multiForm.controls[field.controlName]) {\n <!-- Label -->\n @if (field.label && field.type !== FormFieldType.Checkbox) {\n <label\n [appShowTooltipIfTruncated]=\"field.label\"\n cLabel\n class=\"mb-1 label-multiform single-line-label\"\n [for]=\"field.controlName\"\n [ngClass]=\"{ 'text-danger': isFormSubmitted && multiForm.controls[field.controlName]?.errors }\"\n [ngStyle]=\"field.styles?.label\"\n >{{ field.label }}\n @if (field?.validations?.required || false) {\n <strong class=\"text-danger\">*</strong>\n }\n </label>\n }\n\n <!-- Text, Email, Number Inputs -->\n @if (\n field.type === FormFieldType.Text ||\n field.type === FormFieldType.Email ||\n field.type === FormFieldType.Number ||\n field.type === FormFieldType.Password ||\n field.type === FormFieldType.Url ||\n field.type === FormFieldType.Tel\n ) {\n <div class=\"position-relative w-100\">\n <input\n [type]=\"field.type\"\n cFormControl\n [formControlName]=\"field.controlName\"\n [id]=\"field.controlName\"\n [placeholder]=\"field.placeholder || ''\"\n [ngClass]=\"{\n 'form-invalid border-danger border border-2':\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors,\n 'no-label-margin': !field.label\n }\"\n [min]=\"field.validations?.min\"\n [max]=\"field.validations?.max\"\n [ngStyle]=\"field.styles?.field\" />\n\n @if (field.actionButton) {\n <button\n type=\"button\"\n [cTooltip]=\"field.actionButton?.tooltip\"\n tooltipPlacement=\"top\"\n cButton\n color=\"primary\"\n variant=\"outline\"\n aria-label=\"action\"\n class=\"d-flex position-absolute top-50 end-0 translate-middle-y me-2 btn p-0 border-0 bg-transparent\"\n (click)=\"onClickFieldAction($event, field)\">\n <svg cIcon class=\"text-primary\" [name]=\"field.actionButton.icon\" size=\"xl\"></svg>\n </button>\n }\n @if (multiForm.controls[field.controlName]?.touched || isFormSubmitted) {\n @if (multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Minimum length {{ field?.validations?.minLength }} characters is required\n </small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\n </small>\n }\n }\n }\n </div>\n }\n\n <!-- Select Inputs -->\n @else if (field.type === FormFieldType.Select || field.type === inputType?.colorSelect) {\n <ng-container>\n <c-multi-select\n [multiple]=\"field?.multiple || false\"\n [allowCreateOptions]=\"field?.allowCreateOptions || false\"\n [search]=\"field?.allowCreateOptions || field?.allowSearch || false\"\n [clearSearchOnSelect]=\"true\"\n [selectionType]=\"field?.selectionType || 'tags'\"\n [cleaner]=\"field?.allowCleaner || true\"\n [formControlName]=\"field.controlName\"\n [placeholder]=\"field.placeholder || 'Select'\"\n [appMultiSelectStyler]=\"field.type === inputType?.colorSelect\"\n [options]=\"colorCodes$\"\n [optionsMaxHeight]=\"400\"\n [ngClass]=\"{\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\n }\"\n (valueChange)=\"onValueChange($event, field.controlName)\"\n [ngStyle]=\"field.styles?.field\">\n @if (field.type === inputType?.colorSelect) {\n @for (option of colorCodes$; track $index) {\n <c-multi-select-option [value]=\"option?.label\">\n <label class=\"d-flex gap-2\">\n <span class=\"color-box\" [style.background-color]=\"option?.value\"></span>\n {{ option.label }}\n </label>\n </c-multi-select-option>\n }\n } @else {\n @for (option of field.options; track $index) {\n <c-multi-select-option [value]=\"option?.value\">\n {{ option.label }}\n </c-multi-select-option>\n }\n }\n </c-multi-select>\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n }\n }\n </ng-container>\n }\n\n <!-- Date input -->\n @else if (field.type === FormFieldType.Date) {\n <ng-container>\n <input\n type=\"text\"\n [placeholder]=\"field?.label || 'Select Date'\"\n class=\"form-control\"\n [ngClass]=\"{\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\n }\"\n (bsValueChange)=\"onDateValueChange($event, field.controlName)\"\n [formControlName]=\"field.controlName\"\n [dateInputFormat]=\"configurationService?.allConfigValues()?.defaultDateFormat || 'MM/DD/YYYY'\"\n [bsConfig]=\"{\n containerClass: 'pongrass-red-datepicker',\n showWeekNumbers: false,\n adaptivePosition: true,\n useUtc: false\n }\"\n bsDatepicker\n [ngStyle]=\"field.styles?.field\" />\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n }\n }\n </ng-container>\n }\n <!-- Textarea -->\n @else if (field.type === FormFieldType.Textarea) {\n <ng-container>\n <textarea\n cFormControl\n [id]=\"field.controlName\"\n [rows]=\"field?.textareaRows || 4\"\n [columns]=\"field?.textareaColumns || 4\"\n [placeholder]=\"field.placeholder || ''\"\n [ngClass]=\"{\n 'form-invalid border-danger border border-2':\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\n }\"\n [formControlName]=\"field.controlName\"\n [ngStyle]=\"field.styles?.field\"></textarea>\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Minimum length {{ field?.validations?.minLength }} characters is required\n </small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\n </small>\n }\n }\n </ng-container>\n }\n <!-- Checkbox -->\n @else if (field.type === FormFieldType.Checkbox) {\n <div class=\"no-label-margin\">\n <input cFormCheckInput [id]=\"field.controlName\" type=\"checkbox\" [formControlName]=\"field.controlName\" [ngStyle]=\"field.styles?.field\" />\n <label cFormCheckLabel [for]=\"field.controlName\" class=\"ms-2\" [ngStyle]=\"field.styles?.label\">{{ field.label }}</label>\n </div>\n }\n <!-- Decimal input -->\n @else if (field.type === FormFieldType.Float) {\n <ng-container>\n <input\n cFormControl\n [id]=\"field.controlName\"\n type=\"number\"\n class=\"me-2\"\n [formControlName]=\"field.controlName\"\n [appDecimalInput]=\"field.validations?.precision || 2\"\n [ngClass]=\"{\n 'form-invalid border-danger border border-2':\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\n }\"\n [min]=\"field.validations?.min\"\n [max]=\"field.validations?.max\"\n [ngStyle]=\"field.styles?.field\" />\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Minimum length {{ field?.validations?.minLength }} characters is required\n </small>\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\n <small class=\"text-danger fst-italic form-invalid-label\">\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\n </small>\n }\n }\n </ng-container>\n } @else if (field.type === FormFieldType.Edition) {\n <ng-container>\n <app-edition-list-grouped\n (selectedEditionsChange)=\"onEditionChange($event)\"\n [multiple]=\"field?.multiple || true\"\n [hasFormError]=\"isFormSubmitted && multiForm.controls[field.controlName]?.errors\">\n </app-edition-list-grouped>\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\n }\n }\n </ng-container>\n }\n }\n </div>\n }\n\n @if (field?.type === FormFieldType.Separator) {\n <div [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\"></div>\n }\n @if (field?.type === FormFieldType.FormHeader) {\n <div [class]=\"'fs-6 fw-bold my-2 field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\">{{ field?.label }}</div>\n }\n }\n </div>\n }\n</form>\n", styles: [".no-label-margin{margin-top:1.6rem}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.h-135{height:135px}.single-line-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;display:block}.label-multiform{font-size:16px;font-weight:400}.field-checkbox{display:flex;align-items:center}\n"] }]
1352
+ }], ctorParameters: () => [], propDecorators: { config: [{
1353
+ type: Input
1354
+ }], showUnsavedFlags: [{
1355
+ type: Input
1356
+ }], currentTableGridsSelectedIndex: [{
1357
+ type: Input
1358
+ }], formId: [{
1359
+ type: Input
1360
+ }], fieldAction: [{
1361
+ type: Output
1362
+ }], formSavedUnsavedListen: [{
1363
+ type: Output
1364
+ }], selectionChangeEvent: [{
1365
+ type: Output
1366
+ }] } });
1367
+
1368
+ class MultiFormModule {
1369
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1370
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.9", ngImport: i0, type: MultiFormModule, declarations: [MultiFormComponent], imports: [CircularFocusDirective,
1371
+ CommonModule,
1372
+ ReactiveFormsModule,
1373
+ MultiSelectModule,
1374
+ FormModule,
1375
+ IconModule,
1376
+ InputGroupComponent,
1377
+ DatePickerModule,
1378
+ DecimalInputDirective,
1379
+ ShowTooltipIfTruncatedDirective,
1380
+ ModalModule,
1381
+ TooltipModule,
1382
+ ButtonModule,
1383
+ BsDatepickerModule,
1384
+ EditionListGroupedComponent,
1385
+ MultiSelectStylerDirective], exports: [MultiFormComponent] });
1386
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiFormModule, imports: [CommonModule,
1387
+ ReactiveFormsModule,
1388
+ MultiSelectModule,
1389
+ FormModule,
1390
+ IconModule,
1391
+ InputGroupComponent,
1392
+ DatePickerModule,
1393
+ ModalModule,
1394
+ TooltipModule,
1395
+ ButtonModule,
1396
+ BsDatepickerModule,
1397
+ EditionListGroupedComponent] });
1398
+ }
1399
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiFormModule, decorators: [{
1400
+ type: NgModule,
1401
+ args: [{
1402
+ declarations: [MultiFormComponent],
1403
+ imports: [
1404
+ CircularFocusDirective,
1405
+ CommonModule,
1406
+ ReactiveFormsModule,
1407
+ MultiSelectModule,
1408
+ FormModule,
1409
+ IconModule,
1410
+ InputGroupComponent,
1411
+ DatePickerModule,
1412
+ DecimalInputDirective,
1413
+ ShowTooltipIfTruncatedDirective,
1414
+ ModalModule,
1415
+ TooltipModule,
1416
+ ButtonModule,
1417
+ BsDatepickerModule,
1418
+ EditionListGroupedComponent,
1419
+ MultiSelectStylerDirective
1420
+ ],
1421
+ exports: [MultiFormComponent]
1422
+ }]
1423
+ }] });
1424
+
1425
+ /*
1426
+ * Public API Surface of utils
1427
+ */
1428
+
1429
+ /**
1430
+ * Generated bundle index. Do not edit.
1431
+ */
1432
+
1433
+ export { CheckboxCellRendererComponent, ColorCellRendererComponent, CommentsButtonCellRendererComponent, ConfigurationServiceLib, CustomSelectFilterComponent, EditionListGroupedComponent, FormFieldType, IndustryUpdateListboxCellRendererComponent, MultiFormComponent, MultiFormModule, PageStatusCellRendererComponent };
1434
+ //# sourceMappingURL=pongrass-utils.mjs.map