@pongrass/utils 1.1.5-v20 → 1.1.7-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.
- package/fesm2022/pongrass-utils.mjs +1195 -37
- package/fesm2022/pongrass-utils.mjs.map +1 -1
- package/index.d.ts +181 -6
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, Injectable, Component, ViewChild, inject, EventEmitter, Input, Output, ElementRef, HostListener, Directive, Renderer2, forwardRef, NgModule, effect, input, output } from '@angular/core';
|
|
2
|
+
import { signal, Injectable, Component, ViewChild, inject, EventEmitter, Input, Output, ElementRef, HostListener, Directive, Renderer2, forwardRef, NgModule, effect, input, output, ChangeDetectorRef, NgZone, untracked, ViewContainerRef, ApplicationRef, EnvironmentInjector, Injector, createComponent } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule, NgClass } from '@angular/common';
|
|
5
5
|
import * as i3 from '@angular/forms';
|
|
6
6
|
import { FormsModule, NgControl, NG_VALUE_ACCESSOR, FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
-
import * as
|
|
8
|
-
import { FormModule, ButtonModule, MultiSelectModule, MultiSelectComponent, InputGroupComponent, DatePickerModule, ModalModule, TooltipModule, AutocompleteModule, FormCheckInputDirective, OffcanvasModule, SpinnerModule, FormPasswordDirective, AlertModule } from '@coreui/angular-pro';
|
|
7
|
+
import * as i1 from '@coreui/angular-pro';
|
|
8
|
+
import { FormModule, ButtonModule, CalendarModule, MultiSelectModule, BadgeModule, MultiSelectComponent, InputGroupComponent, DatePickerModule, ModalModule, TooltipModule, AutocompleteModule, FormCheckInputDirective, TimePickerModule, OffcanvasModule, SpinnerModule, FormPasswordDirective, AlertModule } from '@coreui/angular-pro';
|
|
9
9
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
10
10
|
import { BehaviorSubject, map, lastValueFrom, Subject } from 'rxjs';
|
|
11
|
-
import * as
|
|
11
|
+
import * as i1$1 from '@coreui/icons-angular';
|
|
12
12
|
import { IconModule } from '@coreui/icons-angular';
|
|
13
13
|
import * as i8 from 'ngx-bootstrap/datepicker';
|
|
14
14
|
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
|
|
@@ -16,7 +16,7 @@ import Swal from 'sweetalert2';
|
|
|
16
16
|
import { Tooltip } from '@coreui/coreui-pro';
|
|
17
17
|
import { ToastrService } from 'ngx-toastr';
|
|
18
18
|
import { auditTime, takeUntil } from 'rxjs/operators';
|
|
19
|
-
import * as i1 from '@ag-grid-community/angular';
|
|
19
|
+
import * as i1$2 from '@ag-grid-community/angular';
|
|
20
20
|
import { AgGridModule } from '@ag-grid-community/angular';
|
|
21
21
|
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
|
|
22
22
|
import { ModuleRegistry, _EditCoreModule } from '@ag-grid-community/core';
|
|
@@ -120,9 +120,36 @@ class CustomSelectFilterComponent {
|
|
|
120
120
|
getUniqueValues() {
|
|
121
121
|
const values = new Set();
|
|
122
122
|
this.params.api.forEachNode(node => {
|
|
123
|
-
|
|
123
|
+
const value = node.data[this.params.colDef.field];
|
|
124
|
+
const formattedValue = this.getFormattedValue(node, value);
|
|
125
|
+
values.add(formattedValue);
|
|
124
126
|
});
|
|
125
|
-
return Array.from(values).sort()
|
|
127
|
+
return Array.from(values).sort((a, b) => {
|
|
128
|
+
if (a === 'BLANK')
|
|
129
|
+
return -1;
|
|
130
|
+
if (b === 'BLANK')
|
|
131
|
+
return 1;
|
|
132
|
+
return a.toLowerCase().localeCompare(b.toLowerCase());
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
getFormattedValue(node, value) {
|
|
136
|
+
const formatter = this.params.colDef.valueFormatter;
|
|
137
|
+
let formattedValue = value;
|
|
138
|
+
if (formatter && typeof formatter === 'function') {
|
|
139
|
+
formattedValue = formatter({
|
|
140
|
+
value,
|
|
141
|
+
data: node.data,
|
|
142
|
+
node,
|
|
143
|
+
colDef: this.params.colDef,
|
|
144
|
+
column: this.params.column,
|
|
145
|
+
api: this.params.api,
|
|
146
|
+
context: this.params.context
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (formattedValue === null || formattedValue === undefined || formattedValue === '') {
|
|
150
|
+
return 'BLANK';
|
|
151
|
+
}
|
|
152
|
+
return String(formattedValue);
|
|
126
153
|
}
|
|
127
154
|
isValueSelected(value) {
|
|
128
155
|
return this.selectedValues.has(value);
|
|
@@ -168,7 +195,8 @@ class CustomSelectFilterComponent {
|
|
|
168
195
|
}
|
|
169
196
|
doesFilterPass(params) {
|
|
170
197
|
const value = params.data[this.params.colDef.field];
|
|
171
|
-
|
|
198
|
+
const formattedValue = this.getFormattedValue(params.node, value);
|
|
199
|
+
return this.selectedValues.has(formattedValue);
|
|
172
200
|
}
|
|
173
201
|
isFilterActive() {
|
|
174
202
|
return this.selectedValues.size !== this.uniqueValues.length;
|
|
@@ -185,6 +213,13 @@ class CustomSelectFilterComponent {
|
|
|
185
213
|
}
|
|
186
214
|
this.filteredValues = [...this.uniqueValues];
|
|
187
215
|
}
|
|
216
|
+
onReset() {
|
|
217
|
+
this.searchText = '';
|
|
218
|
+
this.selectedValues = new Set(this.uniqueValues);
|
|
219
|
+
this.filteredValues = [...this.uniqueValues];
|
|
220
|
+
this.isIndeterminate = false;
|
|
221
|
+
this.params.filterChangedCallback();
|
|
222
|
+
}
|
|
188
223
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CustomSelectFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
189
224
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: CustomSelectFilterComponent, isStandalone: true, selector: "prg-ws-custom-set-filter", viewQueries: [{ propertyName: "searchInputRef", first: true, predicate: ["searchInput"], descendants: true }], ngImport: i0, template: `
|
|
190
225
|
<div class="select-filter-container">
|
|
@@ -210,12 +245,15 @@ class CustomSelectFilterComponent {
|
|
|
210
245
|
</label>
|
|
211
246
|
}
|
|
212
247
|
</div>
|
|
248
|
+
<div class="filter-actions">
|
|
249
|
+
<button cButton color="primary" size="sm" variant="outline" (click)="onReset()">Reset</button>
|
|
250
|
+
</div>
|
|
213
251
|
</div>
|
|
214
|
-
`, 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: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: FormModule }, { kind: "directive", type:
|
|
252
|
+
`, 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}.filter-actions{display:flex;justify-content:flex-end;margin-top:8px;border-top:1px solid #e0e0e0;padding-top:8px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: FormModule }, { kind: "directive", type: i1.FormCheckInputDirective, selector: "input[cFormCheckInput]", inputs: ["type", "indeterminate", "valid"] }, { kind: "directive", type: i1.FormControlDirective, selector: "input[cFormControl], textarea[cFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }] });
|
|
215
253
|
}
|
|
216
254
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CustomSelectFilterComponent, decorators: [{
|
|
217
255
|
type: Component,
|
|
218
|
-
args: [{ selector: 'prg-ws-custom-set-filter', standalone: true, imports: [FormsModule, FormModule], template: `
|
|
256
|
+
args: [{ selector: 'prg-ws-custom-set-filter', standalone: true, imports: [FormsModule, FormModule, ButtonModule], template: `
|
|
219
257
|
<div class="select-filter-container">
|
|
220
258
|
<input type="text" #searchInput cFormControl [(ngModel)]="searchText" (input)="onSearchChange()" placeholder="Search..." class="search-box" />
|
|
221
259
|
@if (filteredValues.length > 0) {
|
|
@@ -239,13 +277,382 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
239
277
|
</label>
|
|
240
278
|
}
|
|
241
279
|
</div>
|
|
280
|
+
<div class="filter-actions">
|
|
281
|
+
<button cButton color="primary" size="sm" variant="outline" (click)="onReset()">Reset</button>
|
|
282
|
+
</div>
|
|
242
283
|
</div>
|
|
243
|
-
`, 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"] }]
|
|
284
|
+
`, 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}.filter-actions{display:flex;justify-content:flex-end;margin-top:8px;border-top:1px solid #e0e0e0;padding-top:8px}\n"] }]
|
|
244
285
|
}], propDecorators: { searchInputRef: [{
|
|
245
286
|
type: ViewChild,
|
|
246
287
|
args: ['searchInput']
|
|
247
288
|
}] } });
|
|
248
289
|
|
|
290
|
+
class AgDateRangeFilterComponent {
|
|
291
|
+
cdr;
|
|
292
|
+
params;
|
|
293
|
+
startDate = null;
|
|
294
|
+
endDate = null;
|
|
295
|
+
viewDate = new Date();
|
|
296
|
+
selectedPresetLabel = null;
|
|
297
|
+
presets = [
|
|
298
|
+
{
|
|
299
|
+
label: 'Today',
|
|
300
|
+
isSelected: false,
|
|
301
|
+
calculate: () => {
|
|
302
|
+
const now = new Date();
|
|
303
|
+
now.setHours(0, 0, 0, 0);
|
|
304
|
+
return { start: now, end: now };
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
label: 'Yesterday',
|
|
309
|
+
isSelected: false,
|
|
310
|
+
calculate: () => {
|
|
311
|
+
const today = new Date();
|
|
312
|
+
today.setHours(0, 0, 0, 0);
|
|
313
|
+
const yesterday = new Date(today);
|
|
314
|
+
yesterday.setDate(today.getDate() - 1);
|
|
315
|
+
return { start: yesterday, end: yesterday };
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
label: 'This Week',
|
|
320
|
+
isSelected: false,
|
|
321
|
+
calculate: () => {
|
|
322
|
+
const today = new Date();
|
|
323
|
+
today.setHours(0, 0, 0, 0);
|
|
324
|
+
const day = today.getDay() || 7;
|
|
325
|
+
const start = new Date(today);
|
|
326
|
+
if (day !== 1)
|
|
327
|
+
start.setDate(today.getDate() - (day - 1));
|
|
328
|
+
const end = new Date(start);
|
|
329
|
+
end.setDate(start.getDate() + 6);
|
|
330
|
+
return { start, end };
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
label: 'This Month',
|
|
335
|
+
isSelected: false,
|
|
336
|
+
calculate: () => {
|
|
337
|
+
const today = new Date();
|
|
338
|
+
today.setHours(0, 0, 0, 0);
|
|
339
|
+
const start = new Date(today.getFullYear(), today.getMonth(), 1);
|
|
340
|
+
const end = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
|
341
|
+
return { start, end };
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
label: 'This Quarter',
|
|
346
|
+
isSelected: false,
|
|
347
|
+
calculate: () => {
|
|
348
|
+
const today = new Date();
|
|
349
|
+
today.setHours(0, 0, 0, 0);
|
|
350
|
+
const currQuarter = Math.floor(today.getMonth() / 3);
|
|
351
|
+
const start = new Date(today.getFullYear(), currQuarter * 3, 1);
|
|
352
|
+
const end = new Date(today.getFullYear(), start.getMonth() + 3, 0);
|
|
353
|
+
return { start, end };
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
label: 'Last Week',
|
|
358
|
+
isSelected: false,
|
|
359
|
+
calculate: () => {
|
|
360
|
+
const today = new Date();
|
|
361
|
+
today.setHours(0, 0, 0, 0);
|
|
362
|
+
const start = new Date(today);
|
|
363
|
+
const day = start.getDay() || 7;
|
|
364
|
+
start.setDate(today.getDate() - day - 6);
|
|
365
|
+
const end = new Date(start);
|
|
366
|
+
end.setDate(start.getDate() + 6);
|
|
367
|
+
return { start, end };
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
label: 'Last Month',
|
|
372
|
+
isSelected: false,
|
|
373
|
+
calculate: () => {
|
|
374
|
+
const today = new Date();
|
|
375
|
+
today.setHours(0, 0, 0, 0);
|
|
376
|
+
const start = new Date(today.getFullYear(), today.getMonth() - 1, 1);
|
|
377
|
+
const end = new Date(today.getFullYear(), today.getMonth(), 0);
|
|
378
|
+
return { start, end };
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
label: 'Last Quarter',
|
|
383
|
+
isSelected: false,
|
|
384
|
+
calculate: () => {
|
|
385
|
+
const today = new Date();
|
|
386
|
+
today.setHours(0, 0, 0, 0);
|
|
387
|
+
const lastQuarter = Math.floor(today.getMonth() / 3) - 1;
|
|
388
|
+
const start = new Date(today.getFullYear(), lastQuarter * 3, 1);
|
|
389
|
+
const end = new Date(today.getFullYear(), start.getMonth() + 3, 0);
|
|
390
|
+
return { start, end };
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
label: 'Past 7 days',
|
|
395
|
+
isSelected: false,
|
|
396
|
+
calculate: () => this.calculatePastDays(7)
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
label: 'Past 30 days',
|
|
400
|
+
isSelected: false,
|
|
401
|
+
calculate: () => this.calculatePastDays(30)
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
label: 'Past 90 days',
|
|
405
|
+
isSelected: false,
|
|
406
|
+
calculate: () => this.calculatePastDays(90)
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
label: 'Past 180 days',
|
|
410
|
+
isSelected: false,
|
|
411
|
+
calculate: () => this.calculatePastDays(180)
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
label: 'Past 365 days',
|
|
415
|
+
isSelected: false,
|
|
416
|
+
calculate: () => this.calculatePastDays(365)
|
|
417
|
+
}
|
|
418
|
+
];
|
|
419
|
+
constructor(cdr) {
|
|
420
|
+
this.cdr = cdr;
|
|
421
|
+
}
|
|
422
|
+
agInit(params) {
|
|
423
|
+
this.params = params;
|
|
424
|
+
}
|
|
425
|
+
ngAfterViewInit() {
|
|
426
|
+
// Attempt to match preset after view initialization
|
|
427
|
+
if (this.startDate && this.endDate) {
|
|
428
|
+
this.matchAndSelectPreset();
|
|
429
|
+
this.cdr.detectChanges();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
onStartDateChange(date) {
|
|
433
|
+
this.startDate = date;
|
|
434
|
+
this.selectedPresetLabel = null;
|
|
435
|
+
this.clearPresetSelection();
|
|
436
|
+
// Check if both dates are now set and try to match a preset
|
|
437
|
+
if (this.startDate && this.endDate) {
|
|
438
|
+
this.matchAndSelectPreset();
|
|
439
|
+
}
|
|
440
|
+
this.params.filterChangedCallback();
|
|
441
|
+
}
|
|
442
|
+
onEndDateChange(date) {
|
|
443
|
+
this.endDate = date;
|
|
444
|
+
this.selectedPresetLabel = null;
|
|
445
|
+
this.clearPresetSelection();
|
|
446
|
+
// Check if both dates are now set and try to match a preset
|
|
447
|
+
if (this.startDate && this.endDate) {
|
|
448
|
+
this.matchAndSelectPreset();
|
|
449
|
+
}
|
|
450
|
+
this.params.filterChangedCallback();
|
|
451
|
+
}
|
|
452
|
+
clearPresetSelection() {
|
|
453
|
+
this.presets.forEach(p => p.isSelected = false);
|
|
454
|
+
}
|
|
455
|
+
calculatePastDays(days) {
|
|
456
|
+
const today = new Date();
|
|
457
|
+
today.setHours(0, 0, 0, 0);
|
|
458
|
+
const start = new Date(today);
|
|
459
|
+
start.setDate(today.getDate() - days);
|
|
460
|
+
return { start, end: today };
|
|
461
|
+
}
|
|
462
|
+
normalizeDate(date) {
|
|
463
|
+
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
|
|
464
|
+
}
|
|
465
|
+
areDatesEqual(date1, date2) {
|
|
466
|
+
if (!date1 && !date2)
|
|
467
|
+
return true;
|
|
468
|
+
if (!date1 || !date2)
|
|
469
|
+
return false;
|
|
470
|
+
return this.normalizeDate(date1) === this.normalizeDate(date2);
|
|
471
|
+
}
|
|
472
|
+
matchAndSelectPreset() {
|
|
473
|
+
if (!this.startDate || !this.endDate) {
|
|
474
|
+
this.clearPresetSelection();
|
|
475
|
+
this.selectedPresetLabel = null;
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
for (const preset of this.presets) {
|
|
479
|
+
if (preset.calculate) {
|
|
480
|
+
try {
|
|
481
|
+
const { start, end } = preset.calculate();
|
|
482
|
+
if (this.areDatesEqual(this.startDate, start) &&
|
|
483
|
+
this.areDatesEqual(this.endDate, end)) {
|
|
484
|
+
this.clearPresetSelection();
|
|
485
|
+
preset.isSelected = true;
|
|
486
|
+
this.selectedPresetLabel = preset.label;
|
|
487
|
+
console.log('Matched preset:', preset.label);
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
catch (error) {
|
|
492
|
+
console.error('Error calculating preset:', preset.label, error);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
this.clearPresetSelection();
|
|
497
|
+
this.selectedPresetLabel = null;
|
|
498
|
+
}
|
|
499
|
+
onPresetClick(preset) {
|
|
500
|
+
if (preset.calculate) {
|
|
501
|
+
const { start, end } = preset.calculate();
|
|
502
|
+
this.clearPresetSelection();
|
|
503
|
+
preset.isSelected = true;
|
|
504
|
+
this.selectedPresetLabel = preset.label;
|
|
505
|
+
this.startDate = start;
|
|
506
|
+
this.endDate = end;
|
|
507
|
+
this.viewDate = new Date(start);
|
|
508
|
+
this.cdr.detectChanges();
|
|
509
|
+
setTimeout(() => {
|
|
510
|
+
this.params.filterChangedCallback();
|
|
511
|
+
}, 0);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
isFilterActive() {
|
|
515
|
+
return !!this.startDate || !!this.endDate;
|
|
516
|
+
}
|
|
517
|
+
doesFilterPass(params) {
|
|
518
|
+
const field = this.params.colDef.field;
|
|
519
|
+
if (!field)
|
|
520
|
+
return false;
|
|
521
|
+
const value = params.data[field];
|
|
522
|
+
if (!value)
|
|
523
|
+
return false;
|
|
524
|
+
const rowDate = new Date(value);
|
|
525
|
+
const rowTime = new Date(rowDate.getFullYear(), rowDate.getMonth(), rowDate.getDate()).getTime();
|
|
526
|
+
let startLimit = -Infinity;
|
|
527
|
+
if (this.startDate) {
|
|
528
|
+
startLimit = new Date(this.startDate.getFullYear(), this.startDate.getMonth(), this.startDate.getDate()).getTime();
|
|
529
|
+
}
|
|
530
|
+
let endLimit = Infinity;
|
|
531
|
+
if (this.endDate) {
|
|
532
|
+
endLimit = new Date(this.endDate.getFullYear(), this.endDate.getMonth(), this.endDate.getDate()).getTime();
|
|
533
|
+
}
|
|
534
|
+
return rowTime >= startLimit && rowTime <= endLimit;
|
|
535
|
+
}
|
|
536
|
+
getModel() {
|
|
537
|
+
return {
|
|
538
|
+
startDate: this.startDate,
|
|
539
|
+
endDate: this.endDate,
|
|
540
|
+
selectedPreset: this.selectedPresetLabel
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
setModel(model) {
|
|
544
|
+
console.log('setModel called with:', model);
|
|
545
|
+
if (model) {
|
|
546
|
+
// Parse dates from model
|
|
547
|
+
this.startDate = model.startDate ? new Date(model.startDate) : null;
|
|
548
|
+
this.endDate = model.endDate ? new Date(model.endDate) : null;
|
|
549
|
+
this.selectedPresetLabel = model.selectedPreset || null;
|
|
550
|
+
// Set view date
|
|
551
|
+
if (this.startDate) {
|
|
552
|
+
this.viewDate = new Date(this.startDate);
|
|
553
|
+
}
|
|
554
|
+
else {
|
|
555
|
+
this.viewDate = new Date();
|
|
556
|
+
}
|
|
557
|
+
// Clear all selections first
|
|
558
|
+
this.clearPresetSelection();
|
|
559
|
+
// If we have a saved preset label, try to select it directly
|
|
560
|
+
if (this.selectedPresetLabel) {
|
|
561
|
+
const preset = this.presets.find(p => p.label === this.selectedPresetLabel);
|
|
562
|
+
if (preset) {
|
|
563
|
+
preset.isSelected = true;
|
|
564
|
+
console.log('Restored preset selection:', this.selectedPresetLabel);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
else if (this.startDate && this.endDate) {
|
|
568
|
+
// Otherwise try to match dates to a preset
|
|
569
|
+
this.matchAndSelectPreset();
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
else {
|
|
573
|
+
this.startDate = null;
|
|
574
|
+
this.endDate = null;
|
|
575
|
+
this.selectedPresetLabel = null;
|
|
576
|
+
this.clearPresetSelection();
|
|
577
|
+
this.viewDate = new Date();
|
|
578
|
+
}
|
|
579
|
+
this.cdr.detectChanges();
|
|
580
|
+
}
|
|
581
|
+
onReset() {
|
|
582
|
+
this.startDate = null;
|
|
583
|
+
this.endDate = null;
|
|
584
|
+
this.selectedPresetLabel = null;
|
|
585
|
+
this.clearPresetSelection();
|
|
586
|
+
this.viewDate = new Date();
|
|
587
|
+
this.cdr.detectChanges();
|
|
588
|
+
this.params.filterChangedCallback();
|
|
589
|
+
}
|
|
590
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AgDateRangeFilterComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
591
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: AgDateRangeFilterComponent, isStandalone: true, selector: "prg-ws-ag-date-range-filter", ngImport: i0, template: `
|
|
592
|
+
<div class="date-range-filter-container">
|
|
593
|
+
<div class="filter-body">
|
|
594
|
+
<div class="calendar-wrapper">
|
|
595
|
+
<c-calendar
|
|
596
|
+
[range]="true"
|
|
597
|
+
[calendars]="2"
|
|
598
|
+
[startDate]="startDate"
|
|
599
|
+
[endDate]="endDate"
|
|
600
|
+
[calendarDate]="viewDate"
|
|
601
|
+
(startDateChange)="onStartDateChange($event)"
|
|
602
|
+
(endDateChange)="onEndDateChange($event)"
|
|
603
|
+
locale="en-US">
|
|
604
|
+
</c-calendar>
|
|
605
|
+
</div>
|
|
606
|
+
<div class="presets-list">
|
|
607
|
+
@for (preset of presets; track preset.label) {
|
|
608
|
+
<div class="preset-item"
|
|
609
|
+
[class.active]="preset.isSelected"
|
|
610
|
+
(click)="onPresetClick(preset)">
|
|
611
|
+
{{ preset.label }}
|
|
612
|
+
</div>
|
|
613
|
+
}
|
|
614
|
+
</div>
|
|
615
|
+
</div>
|
|
616
|
+
<div class="filter-actions d-flex justify-content-end mt-2 pt-2 border-top">
|
|
617
|
+
<button cButton color="primary" size="sm" variant="outline" (click)="onReset()">Reset</button>
|
|
618
|
+
</div>
|
|
619
|
+
</div>
|
|
620
|
+
`, isInline: true, styles: [".date-range-filter-container{padding:10px;min-width:600px}.filter-body{display:flex;gap:10px}.calendar-wrapper{flex:1;border:1px solid #e0e0e0;border-radius:4px}.presets-list{width:150px;border-left:1px solid #e0e0e0;padding-left:10px;display:flex;flex-direction:column;gap:4px}.preset-item{padding:6px 10px;cursor:pointer;border-radius:4px;font-size:.9em;transition:background-color .2s,color .2s}.preset-item:hover{background-color:#f0f0f0}.preset-item.active{background-color:var(--cui-primary, #321fdb);color:#fff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: FormModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }, { kind: "ngmodule", type: CalendarModule }, { kind: "component", type: i1.CalendarComponent, selector: "c-calendar", inputs: ["calendarDate", "calendars", "dayFormat", "disabledDates", "startDate", "endDate", "firstDayOfWeek", "locale", "maxDate", "minDate", "navigation", "navYearFirst", "range", "view", "weekdayFormat", "dateFilter", "selectAdjacentDays", "showAdjacentDays", "selectionType", "showWeekNumber", "weekNumbersLabel", "ariaNextMonthLabel", "ariaNextYearLabel", "ariaPrevMonthLabel", "ariaPrevYearLabel"], outputs: ["calendarDateChange", "endDateChange", "startDateChange", "viewChange", "calendarCellHover"], exportAs: ["cCalendar"] }] });
|
|
621
|
+
}
|
|
622
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AgDateRangeFilterComponent, decorators: [{
|
|
623
|
+
type: Component,
|
|
624
|
+
args: [{ selector: 'prg-ws-ag-date-range-filter', standalone: true, imports: [CommonModule, FormsModule, FormModule, ButtonModule, CalendarModule], template: `
|
|
625
|
+
<div class="date-range-filter-container">
|
|
626
|
+
<div class="filter-body">
|
|
627
|
+
<div class="calendar-wrapper">
|
|
628
|
+
<c-calendar
|
|
629
|
+
[range]="true"
|
|
630
|
+
[calendars]="2"
|
|
631
|
+
[startDate]="startDate"
|
|
632
|
+
[endDate]="endDate"
|
|
633
|
+
[calendarDate]="viewDate"
|
|
634
|
+
(startDateChange)="onStartDateChange($event)"
|
|
635
|
+
(endDateChange)="onEndDateChange($event)"
|
|
636
|
+
locale="en-US">
|
|
637
|
+
</c-calendar>
|
|
638
|
+
</div>
|
|
639
|
+
<div class="presets-list">
|
|
640
|
+
@for (preset of presets; track preset.label) {
|
|
641
|
+
<div class="preset-item"
|
|
642
|
+
[class.active]="preset.isSelected"
|
|
643
|
+
(click)="onPresetClick(preset)">
|
|
644
|
+
{{ preset.label }}
|
|
645
|
+
</div>
|
|
646
|
+
}
|
|
647
|
+
</div>
|
|
648
|
+
</div>
|
|
649
|
+
<div class="filter-actions d-flex justify-content-end mt-2 pt-2 border-top">
|
|
650
|
+
<button cButton color="primary" size="sm" variant="outline" (click)="onReset()">Reset</button>
|
|
651
|
+
</div>
|
|
652
|
+
</div>
|
|
653
|
+
`, styles: [".date-range-filter-container{padding:10px;min-width:600px}.filter-body{display:flex;gap:10px}.calendar-wrapper{flex:1;border:1px solid #e0e0e0;border-radius:4px}.presets-list{width:150px;border-left:1px solid #e0e0e0;padding-left:10px;display:flex;flex-direction:column;gap:4px}.preset-item{padding:6px 10px;cursor:pointer;border-radius:4px;font-size:.9em;transition:background-color .2s,color .2s}.preset-item:hover{background-color:#f0f0f0}.preset-item.active{background-color:var(--cui-primary, #321fdb);color:#fff}\n"] }]
|
|
654
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
655
|
+
|
|
249
656
|
class CheckboxCellRendererComponent {
|
|
250
657
|
value;
|
|
251
658
|
params;
|
|
@@ -277,7 +684,7 @@ class CheckboxCellRendererComponent {
|
|
|
277
684
|
[checked]="value"
|
|
278
685
|
(change)="onChangeCheckBox($event)"
|
|
279
686
|
[disabled]="ischeckboxDisabled" />
|
|
280
|
-
</div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormModule }, { kind: "directive", type:
|
|
687
|
+
</div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormModule }, { kind: "directive", type: i1.FormCheckInputDirective, selector: "input[cFormCheckInput]", inputs: ["type", "indeterminate", "valid"] }] });
|
|
281
688
|
}
|
|
282
689
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CheckboxCellRendererComponent, decorators: [{
|
|
283
690
|
type: Component,
|
|
@@ -317,7 +724,7 @@ class CommentsButtonCellRendererComponent {
|
|
|
317
724
|
Comments
|
|
318
725
|
</button>
|
|
319
726
|
</div>
|
|
320
|
-
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type:
|
|
727
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }] });
|
|
321
728
|
}
|
|
322
729
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: CommentsButtonCellRendererComponent, decorators: [{
|
|
323
730
|
type: Component,
|
|
@@ -607,7 +1014,7 @@ class EditionListGroupedComponent {
|
|
|
607
1014
|
});
|
|
608
1015
|
}
|
|
609
1016
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: EditionListGroupedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
610
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: EditionListGroupedComponent, isStandalone: true, selector: "prg-ws-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:
|
|
1017
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: EditionListGroupedComponent, isStandalone: true, selector: "prg-ws-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: i1.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: i1.MultiSelectOptionComponent, selector: "c-multi-select-option", inputs: ["optionsStyle", "label", "text", "visible", "disabled", "selected", "value", "active", "role"], outputs: ["selectedChange", "focusChange"], exportAs: ["cMultiSelectOption"] }, { kind: "component", type: i1.MultiSelectOptgroupComponent, selector: "c-multi-select-optgroup", inputs: ["label", "disabled"] }, { kind: "component", type: i1.MultiSelectOptgroupLabelComponent, selector: "c-multi-select-optgroup-label" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
611
1018
|
}
|
|
612
1019
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: EditionListGroupedComponent, decorators: [{
|
|
613
1020
|
type: Component,
|
|
@@ -680,7 +1087,7 @@ class PageStatusCellRendererComponent {
|
|
|
680
1087
|
return selectedStatus && selectedStatus.html_color ? selectedStatus.html_color : '#C5B4E3';
|
|
681
1088
|
}
|
|
682
1089
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: PageStatusCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
683
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: PageStatusCellRendererComponent, isStandalone: true, selector: "prg-ws-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: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.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:
|
|
1090
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: PageStatusCellRendererComponent, isStandalone: true, selector: "prg-ws-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: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.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: i1.FormSelectDirective, selector: "select[cSelect]", inputs: ["sizing", "valid"] }] });
|
|
684
1091
|
}
|
|
685
1092
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: PageStatusCellRendererComponent, decorators: [{
|
|
686
1093
|
type: Component,
|
|
@@ -712,22 +1119,262 @@ class StatusSelectCellRendererComponent {
|
|
|
712
1119
|
return selectedStatus && selectedStatus.html_color ? selectedStatus.html_color : '#C5B4E3';
|
|
713
1120
|
}
|
|
714
1121
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: StatusSelectCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
715
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: StatusSelectCellRendererComponent, isStandalone: true, selector: "prg-ws-status-select-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]=\"this.fileStatus!.it_prodstatusid\"\n (ngModelChange)=\"updatePageStatus($event)\"\n [ngStyle]=\"{ '--select-background': getStatusColor() }\">\n @for (status of prodStatusList; track $index) {\n <option [value]=\"status.statusid\">\n {{ status.statusdesc }}\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: FormModule }, { kind: "directive", type:
|
|
1122
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: StatusSelectCellRendererComponent, isStandalone: true, selector: "prg-ws-status-select-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]=\"this.fileStatus!.it_prodstatusid\"\n (ngModelChange)=\"updatePageStatus($event)\"\n [ngStyle]=\"{ '--select-background': getStatusColor() }\">\n @for (status of prodStatusList; track $index) {\n <option [value]=\"status.statusid\">\n {{ status.statusdesc }}\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: FormModule }, { kind: "directive", type: i1.FormSelectDirective, selector: "select[cSelect]", inputs: ["sizing", "valid"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
716
1123
|
}
|
|
717
1124
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: StatusSelectCellRendererComponent, decorators: [{
|
|
718
1125
|
type: Component,
|
|
719
1126
|
args: [{ standalone: true, imports: [FormModule, CommonModule, FormsModule], selector: 'prg-ws-status-select-cell-renderer', 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]=\"this.fileStatus!.it_prodstatusid\"\n (ngModelChange)=\"updatePageStatus($event)\"\n [ngStyle]=\"{ '--select-background': getStatusColor() }\">\n @for (status of prodStatusList; track $index) {\n <option [value]=\"status.statusid\">\n {{ status.statusdesc }}\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"] }]
|
|
720
1127
|
}] });
|
|
721
1128
|
|
|
1129
|
+
class BadgeCellRendererComponent {
|
|
1130
|
+
displayValue = '';
|
|
1131
|
+
badgeColor = 'secondary';
|
|
1132
|
+
textColor = 'black';
|
|
1133
|
+
customStyles = {};
|
|
1134
|
+
agInit(params) {
|
|
1135
|
+
this.updateValue(params);
|
|
1136
|
+
}
|
|
1137
|
+
refresh(params) {
|
|
1138
|
+
this.updateValue(params);
|
|
1139
|
+
return true;
|
|
1140
|
+
}
|
|
1141
|
+
updateValue(params) {
|
|
1142
|
+
// Determine the value to display
|
|
1143
|
+
this.displayValue = params.valueFormatted || params.value;
|
|
1144
|
+
const rendererParams = params.colDef?.cellRendererParams;
|
|
1145
|
+
// reset defaults
|
|
1146
|
+
this.badgeColor = 'secondary';
|
|
1147
|
+
this.textColor = 'black';
|
|
1148
|
+
this.customStyles = {};
|
|
1149
|
+
if (rendererParams) {
|
|
1150
|
+
if (rendererParams.textColor) {
|
|
1151
|
+
this.textColor = rendererParams.textColor;
|
|
1152
|
+
}
|
|
1153
|
+
// 1. Check for static color
|
|
1154
|
+
if (rendererParams.color) {
|
|
1155
|
+
this.applyColor(rendererParams.color);
|
|
1156
|
+
}
|
|
1157
|
+
// 2. Check for dynamic color map
|
|
1158
|
+
if (rendererParams.colorMap) {
|
|
1159
|
+
// value could be anything, assume string key
|
|
1160
|
+
const key = params.value;
|
|
1161
|
+
if (rendererParams.colorMap[key]) {
|
|
1162
|
+
this.applyColor(rendererParams.colorMap[key]);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
// 3. Check if color depends on another field in the row
|
|
1166
|
+
if (rendererParams.colorField && params.data) {
|
|
1167
|
+
const colorValue = params.data[rendererParams.colorField];
|
|
1168
|
+
if (colorValue) {
|
|
1169
|
+
this.applyColor(colorValue);
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
applyColor(color) {
|
|
1175
|
+
if (!color)
|
|
1176
|
+
return;
|
|
1177
|
+
const themeColors = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark'];
|
|
1178
|
+
if (themeColors.includes(color.toLowerCase())) {
|
|
1179
|
+
this.badgeColor = color;
|
|
1180
|
+
delete this.customStyles['background-color'];
|
|
1181
|
+
}
|
|
1182
|
+
else {
|
|
1183
|
+
// Assume it's a custom CSS color (hex, rgb, named color, etc.)
|
|
1184
|
+
this.badgeColor = ''; // Remove utility class color
|
|
1185
|
+
this.customStyles['background-color'] = color;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: BadgeCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1189
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: BadgeCellRendererComponent, isStandalone: true, selector: "prg-ws-badge-cell-renderer", ngImport: i0, template: `
|
|
1190
|
+
@if (displayValue) {
|
|
1191
|
+
<c-badge
|
|
1192
|
+
[color]="badgeColor"
|
|
1193
|
+
[ngStyle]="customStyles"
|
|
1194
|
+
[textColor]="textColor"
|
|
1195
|
+
class="text-wrap"
|
|
1196
|
+
>
|
|
1197
|
+
{{ displayValue }}
|
|
1198
|
+
</c-badge>
|
|
1199
|
+
}
|
|
1200
|
+
`, isInline: true, styles: ["c-badge{font-size:.875rem;font-weight:500}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: BadgeModule }, { kind: "component", type: i1.BadgeComponent, selector: "c-badge", inputs: ["color", "position", "shape", "size", "textColor", "textBgColor"] }] });
|
|
1201
|
+
}
|
|
1202
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: BadgeCellRendererComponent, decorators: [{
|
|
1203
|
+
type: Component,
|
|
1204
|
+
args: [{ selector: 'prg-ws-badge-cell-renderer', standalone: true, imports: [CommonModule, BadgeModule], template: `
|
|
1205
|
+
@if (displayValue) {
|
|
1206
|
+
<c-badge
|
|
1207
|
+
[color]="badgeColor"
|
|
1208
|
+
[ngStyle]="customStyles"
|
|
1209
|
+
[textColor]="textColor"
|
|
1210
|
+
class="text-wrap"
|
|
1211
|
+
>
|
|
1212
|
+
{{ displayValue }}
|
|
1213
|
+
</c-badge>
|
|
1214
|
+
}
|
|
1215
|
+
`, styles: ["c-badge{font-size:.875rem;font-weight:500}\n"] }]
|
|
1216
|
+
}] });
|
|
1217
|
+
|
|
1218
|
+
class IconTextCellRendererComponent {
|
|
1219
|
+
displayValue = '';
|
|
1220
|
+
iconName = '';
|
|
1221
|
+
iconPosition = 'start';
|
|
1222
|
+
isRed = false;
|
|
1223
|
+
agInit(params) {
|
|
1224
|
+
this.updateValue(params);
|
|
1225
|
+
}
|
|
1226
|
+
refresh(params) {
|
|
1227
|
+
this.updateValue(params);
|
|
1228
|
+
return true;
|
|
1229
|
+
}
|
|
1230
|
+
updateValue(params) {
|
|
1231
|
+
this.displayValue = params.valueFormatted || params.value;
|
|
1232
|
+
const rendererParams = params.colDef?.cellRendererParams;
|
|
1233
|
+
if (rendererParams) {
|
|
1234
|
+
// Icon Logic
|
|
1235
|
+
if (typeof rendererParams.iconName === 'function') {
|
|
1236
|
+
this.iconName = rendererParams.iconName(params);
|
|
1237
|
+
}
|
|
1238
|
+
else {
|
|
1239
|
+
this.iconName = rendererParams.iconName || '';
|
|
1240
|
+
}
|
|
1241
|
+
this.iconPosition = rendererParams.iconPosition || 'start';
|
|
1242
|
+
// Red Condition Logic
|
|
1243
|
+
if (rendererParams.isRedCondition && typeof rendererParams.isRedCondition === 'function') {
|
|
1244
|
+
this.isRed = rendererParams.isRedCondition(params);
|
|
1245
|
+
}
|
|
1246
|
+
else {
|
|
1247
|
+
this.isRed = false;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: IconTextCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1252
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: IconTextCellRendererComponent, isStandalone: true, selector: "prg-ws-icon-text-cell-renderer", ngImport: i0, template: `
|
|
1253
|
+
<div class="d-flex align-items-center" [style.color]="isRed ? 'red' : 'inherit'">
|
|
1254
|
+
@if (iconName && iconPosition === 'start') {
|
|
1255
|
+
<c-icon [name]="iconName" [size]="'sm'" class="me-2"></c-icon>
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
<span class="text-truncate">{{ displayValue }}</span>
|
|
1259
|
+
|
|
1260
|
+
@if (iconName && iconPosition === 'end') {
|
|
1261
|
+
<c-icon [name]="iconName" [size]="'sm'" class="ms-2"></c-icon>
|
|
1262
|
+
}
|
|
1263
|
+
</div>
|
|
1264
|
+
`, isInline: true, styles: [":host{display:block;width:100%;overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: IconModule }, { kind: "component", type: i1$1.IconComponent, selector: "c-icon", inputs: ["content", "attributes", "customClasses", "size", "title", "use", "height", "width", "name", "viewBox"], exportAs: ["cIconComponent"] }] });
|
|
1265
|
+
}
|
|
1266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: IconTextCellRendererComponent, decorators: [{
|
|
1267
|
+
type: Component,
|
|
1268
|
+
args: [{ selector: 'prg-ws-icon-text-cell-renderer', standalone: true, imports: [CommonModule, IconModule], template: `
|
|
1269
|
+
<div class="d-flex align-items-center" [style.color]="isRed ? 'red' : 'inherit'">
|
|
1270
|
+
@if (iconName && iconPosition === 'start') {
|
|
1271
|
+
<c-icon [name]="iconName" [size]="'sm'" class="me-2"></c-icon>
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
<span class="text-truncate">{{ displayValue }}</span>
|
|
1275
|
+
|
|
1276
|
+
@if (iconName && iconPosition === 'end') {
|
|
1277
|
+
<c-icon [name]="iconName" [size]="'sm'" class="ms-2"></c-icon>
|
|
1278
|
+
}
|
|
1279
|
+
</div>
|
|
1280
|
+
`, styles: [":host{display:block;width:100%;overflow:hidden}\n"] }]
|
|
1281
|
+
}] });
|
|
1282
|
+
|
|
1283
|
+
class HyperlinkCellRendererComponent {
|
|
1284
|
+
displayValue = '';
|
|
1285
|
+
href = '';
|
|
1286
|
+
target = '_blank';
|
|
1287
|
+
isLink = false;
|
|
1288
|
+
agInit(params) {
|
|
1289
|
+
this.updateValue(params);
|
|
1290
|
+
}
|
|
1291
|
+
refresh(params) {
|
|
1292
|
+
this.updateValue(params);
|
|
1293
|
+
return true;
|
|
1294
|
+
}
|
|
1295
|
+
updateValue(params) {
|
|
1296
|
+
this.displayValue = params.valueFormatted || params.value;
|
|
1297
|
+
const value = params.value;
|
|
1298
|
+
if (!value) {
|
|
1299
|
+
this.isLink = false;
|
|
1300
|
+
return;
|
|
1301
|
+
}
|
|
1302
|
+
const rendererParams = params.colDef?.cellRendererParams || {};
|
|
1303
|
+
const type = rendererParams.type || 'auto'; // 'link', 'email', 'auto'
|
|
1304
|
+
if (type === 'email') {
|
|
1305
|
+
this.setAsEmail(value);
|
|
1306
|
+
}
|
|
1307
|
+
else if (type === 'link') {
|
|
1308
|
+
this.setAsLink(value, rendererParams.target);
|
|
1309
|
+
}
|
|
1310
|
+
else {
|
|
1311
|
+
// Auto detection
|
|
1312
|
+
if (typeof value === 'string' && value.includes('@') && !value.includes(' ')) { // Simple email check
|
|
1313
|
+
this.setAsEmail(value);
|
|
1314
|
+
}
|
|
1315
|
+
else if (typeof value === 'string' && (value.startsWith('http') || value.startsWith('www.'))) {
|
|
1316
|
+
this.setAsLink(value, rendererParams.target);
|
|
1317
|
+
}
|
|
1318
|
+
else {
|
|
1319
|
+
this.isLink = false;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
setAsEmail(value) {
|
|
1324
|
+
this.isLink = true;
|
|
1325
|
+
this.href = `mailto:${value}`;
|
|
1326
|
+
this.target = '_self';
|
|
1327
|
+
}
|
|
1328
|
+
setAsLink(value, targetParam) {
|
|
1329
|
+
this.isLink = true;
|
|
1330
|
+
let url = value;
|
|
1331
|
+
// If it starts with www. but no protocol, add https://
|
|
1332
|
+
if (url.startsWith('www.')) {
|
|
1333
|
+
url = `https://${url}`;
|
|
1334
|
+
}
|
|
1335
|
+
else if (!url.startsWith('http') && !url.startsWith('//')) {
|
|
1336
|
+
// If forced as link but no protocol, keep as is or assume https?
|
|
1337
|
+
// Usually browsers handle "google.com" as relative if in href, so prepending https is safer for external links.
|
|
1338
|
+
// However, if it's a relative link intended, we shouldn't touch it.
|
|
1339
|
+
// Given "display link or email", it's likely external or at least absolute.
|
|
1340
|
+
// But to be safe, if strictly 'link' type and no protocol, I might leave it or prepend.
|
|
1341
|
+
// Let's prepend https:// if it looks like a domain (contains dot).
|
|
1342
|
+
if (url.includes('.')) {
|
|
1343
|
+
url = `https://${url}`;
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
this.href = url;
|
|
1347
|
+
this.target = targetParam || '_blank';
|
|
1348
|
+
}
|
|
1349
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: HyperlinkCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1350
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: HyperlinkCellRendererComponent, isStandalone: true, selector: "prg-ws-hyperlink-cell-renderer", ngImport: i0, template: `
|
|
1351
|
+
@if (isLink) {
|
|
1352
|
+
<a [href]="href" [target]="target" (click)="$event.stopPropagation()">{{ displayValue }}</a>
|
|
1353
|
+
} @else {
|
|
1354
|
+
<span>{{ displayValue }}</span>
|
|
1355
|
+
}
|
|
1356
|
+
`, isInline: true, styles: [":host{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}a{text-decoration:underline;cursor:pointer}a:hover{text-decoration:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
1357
|
+
}
|
|
1358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: HyperlinkCellRendererComponent, decorators: [{
|
|
1359
|
+
type: Component,
|
|
1360
|
+
args: [{ selector: 'prg-ws-hyperlink-cell-renderer', standalone: true, imports: [CommonModule], template: `
|
|
1361
|
+
@if (isLink) {
|
|
1362
|
+
<a [href]="href" [target]="target" (click)="$event.stopPropagation()">{{ displayValue }}</a>
|
|
1363
|
+
} @else {
|
|
1364
|
+
<span>{{ displayValue }}</span>
|
|
1365
|
+
}
|
|
1366
|
+
`, styles: [":host{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}a{text-decoration:underline;cursor:pointer}a:hover{text-decoration:none}\n"] }]
|
|
1367
|
+
}] });
|
|
1368
|
+
|
|
722
1369
|
var FormFieldType;
|
|
723
1370
|
(function (FormFieldType) {
|
|
724
1371
|
FormFieldType["Text"] = "text";
|
|
725
1372
|
FormFieldType["Email"] = "email";
|
|
726
1373
|
FormFieldType["Number"] = "number";
|
|
727
1374
|
FormFieldType["Select"] = "select";
|
|
728
|
-
FormFieldType["Autosuggest"] = "autosuggest";
|
|
729
1375
|
FormFieldType["Textarea"] = "textarea";
|
|
730
1376
|
FormFieldType["Date"] = "date";
|
|
1377
|
+
FormFieldType["NewDate"] = "new-date";
|
|
731
1378
|
FormFieldType["Datetime"] = "datetime";
|
|
732
1379
|
FormFieldType["Switch"] = "switch";
|
|
733
1380
|
FormFieldType["Checkbox"] = "checkbox";
|
|
@@ -738,6 +1385,7 @@ var FormFieldType;
|
|
|
738
1385
|
FormFieldType["Password"] = "password";
|
|
739
1386
|
FormFieldType["Url"] = "url";
|
|
740
1387
|
FormFieldType["Tel"] = "tel";
|
|
1388
|
+
FormFieldType["Timepicker"] = "time";
|
|
741
1389
|
})(FormFieldType || (FormFieldType = {}));
|
|
742
1390
|
|
|
743
1391
|
const ColorsCodes = [
|
|
@@ -1314,6 +1962,14 @@ function generateTimeOptions() {
|
|
|
1314
1962
|
}
|
|
1315
1963
|
return times;
|
|
1316
1964
|
}
|
|
1965
|
+
// Output: '"20:33:00"'
|
|
1966
|
+
function getTimeValueFromDateTime(isoString) {
|
|
1967
|
+
const d = new Date(isoString); // "2025-12-16T20:33:00.000Z"
|
|
1968
|
+
const h = d.getHours().toString().padStart(2, '0');
|
|
1969
|
+
const m = d.getMinutes().toString().padStart(2, '0');
|
|
1970
|
+
const s = d.getSeconds().toString().padStart(2, '0');
|
|
1971
|
+
return `${h}:${m}:${s}`;
|
|
1972
|
+
}
|
|
1317
1973
|
|
|
1318
1974
|
class DateTimePickerComponent {
|
|
1319
1975
|
date = null;
|
|
@@ -1331,7 +1987,7 @@ class DateTimePickerComponent {
|
|
|
1331
1987
|
}
|
|
1332
1988
|
const inputDate = value instanceof Date ? value : new Date(value);
|
|
1333
1989
|
// ********** FIX FOR COREUI DATE PICKER (LOCAL TIME REPRESENTATION) **********
|
|
1334
|
-
// Get Y, M, D from the UTC value to ensure the correct day is selected,
|
|
1990
|
+
// Get Y, M, D from the UTC value to ensure the correct day is selected,
|
|
1335
1991
|
// then create a new Date object for the start of that day in the LOCAL time zone.
|
|
1336
1992
|
const year = inputDate.getUTCFullYear();
|
|
1337
1993
|
const month = inputDate.getUTCMonth();
|
|
@@ -1377,7 +2033,7 @@ class DateTimePickerComponent {
|
|
|
1377
2033
|
}
|
|
1378
2034
|
const [h, m] = this.timeValue.split(',').map(Number);
|
|
1379
2035
|
// Create a new Date object based on the selected date (which is a local midnight)
|
|
1380
|
-
// The key here is to use the UTC setters to apply the time portion
|
|
2036
|
+
// The key here is to use the UTC setters to apply the time portion
|
|
1381
2037
|
// so the final output is a UTC timestamp as expected by the parent form.
|
|
1382
2038
|
const combined = new Date(this.date);
|
|
1383
2039
|
combined.setUTCHours(h, m, 0, 0);
|
|
@@ -1385,13 +2041,13 @@ class DateTimePickerComponent {
|
|
|
1385
2041
|
this.onTouched();
|
|
1386
2042
|
}
|
|
1387
2043
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: DateTimePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1388
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2044
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: DateTimePickerComponent, isStandalone: false, selector: "app-date-time-picker", providers: [
|
|
1389
2045
|
{
|
|
1390
2046
|
provide: NG_VALUE_ACCESSOR,
|
|
1391
2047
|
useExisting: forwardRef(() => DateTimePickerComponent),
|
|
1392
2048
|
multi: true
|
|
1393
2049
|
}
|
|
1394
|
-
], ngImport: i0, template: "<div class=\"row g-3 align-items-end\">\r\n
|
|
2050
|
+
], ngImport: i0, template: "<div class=\"row g-3 align-items-end\">\r\n <div class=\"col-12 col-md-6\">\r\n <c-date-picker\r\n [date]=\"date\"\r\n [disabled]=\"disabled\"\r\n (valueChange)=\"onDateChange($event)\"\r\n inputReadOnly=\"true\"\r\n [showAdjacentDays]=\"false\"\r\n [value]=\"date\"\r\n [calendarDate]=\"date\"\r\n locale=\"en-US\">\r\n </c-date-picker>\r\n </div>\r\n\r\n <div class=\"col-12 col-md-6\">\r\n <select cSelect class=\"form-select\" [value]=\"timeValue\" [disabled]=\"disabled\" (change)=\"onTimeChange($any($event.target).value)\">\r\n @if (!date) {\r\n <option value=\"\">Select time</option>\r\n }\r\n @for (time of timeDropdwons; track time.value) {\r\n <option [value]=\"time.value\">\r\n {{ time.label }}\r\n </option>\r\n }\r\n </select>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.FormSelectDirective, selector: "select[cSelect]", inputs: ["sizing", "valid"] }, { kind: "component", type: i1.DatePickerComponent, selector: "c-date-picker", inputs: ["calendars", "placeholder", "date"], outputs: ["dateChange"], exportAs: ["cDatePicker"] }] });
|
|
1395
2051
|
}
|
|
1396
2052
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: DateTimePickerComponent, decorators: [{
|
|
1397
2053
|
type: Component,
|
|
@@ -1401,7 +2057,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
1401
2057
|
useExisting: forwardRef(() => DateTimePickerComponent),
|
|
1402
2058
|
multi: true
|
|
1403
2059
|
}
|
|
1404
|
-
], template: "<div class=\"row g-3 align-items-end\">\r\n
|
|
2060
|
+
], template: "<div class=\"row g-3 align-items-end\">\r\n <div class=\"col-12 col-md-6\">\r\n <c-date-picker\r\n [date]=\"date\"\r\n [disabled]=\"disabled\"\r\n (valueChange)=\"onDateChange($event)\"\r\n inputReadOnly=\"true\"\r\n [showAdjacentDays]=\"false\"\r\n [value]=\"date\"\r\n [calendarDate]=\"date\"\r\n locale=\"en-US\">\r\n </c-date-picker>\r\n </div>\r\n\r\n <div class=\"col-12 col-md-6\">\r\n <select cSelect class=\"form-select\" [value]=\"timeValue\" [disabled]=\"disabled\" (change)=\"onTimeChange($any($event.target).value)\">\r\n @if (!date) {\r\n <option value=\"\">Select time</option>\r\n }\r\n @for (time of timeDropdwons; track time.value) {\r\n <option [value]=\"time.value\">\r\n {{ time.label }}\r\n </option>\r\n }\r\n </select>\r\n </div>\r\n</div>\r\n" }]
|
|
1405
2061
|
}] });
|
|
1406
2062
|
|
|
1407
2063
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -1427,6 +2083,7 @@ class MultiFormComponent {
|
|
|
1427
2083
|
};
|
|
1428
2084
|
colorCodes$ = ColorsCodes;
|
|
1429
2085
|
FormFieldType = FormFieldType;
|
|
2086
|
+
today = new Date();
|
|
1430
2087
|
constructor() {
|
|
1431
2088
|
this.multiForm = this.formBuilder.group({});
|
|
1432
2089
|
this.isFormSubmitted = false;
|
|
@@ -1508,7 +2165,7 @@ class MultiFormComponent {
|
|
|
1508
2165
|
if (field.type === FormFieldType.Checkbox) {
|
|
1509
2166
|
initialValue = this.getTruthyOrFalsy(field.value) || false;
|
|
1510
2167
|
}
|
|
1511
|
-
else if (field.type === FormFieldType.Date) {
|
|
2168
|
+
else if (field.type === FormFieldType.Date || field.type === FormFieldType.NewDate) {
|
|
1512
2169
|
initialValue = field?.value ? new Date(field.value) : this.setDefaultAdvanceDate(new Date(), field?.validations?.defaultAdvance || '');
|
|
1513
2170
|
}
|
|
1514
2171
|
else {
|
|
@@ -1523,7 +2180,7 @@ class MultiFormComponent {
|
|
|
1523
2180
|
if (field.type === FormFieldType.Checkbox) {
|
|
1524
2181
|
control.setValue(this.getTruthyOrFalsy(field.value) || false, { emitEvent: false });
|
|
1525
2182
|
}
|
|
1526
|
-
else if (field.type === FormFieldType.Date) {
|
|
2183
|
+
else if (field.type === FormFieldType.Date || field.type === FormFieldType.NewDate) {
|
|
1527
2184
|
control.setValue(field?.value ? new Date(field.value) : '', { emitEvent: false });
|
|
1528
2185
|
}
|
|
1529
2186
|
else {
|
|
@@ -1612,6 +2269,16 @@ class MultiFormComponent {
|
|
|
1612
2269
|
}
|
|
1613
2270
|
}
|
|
1614
2271
|
}
|
|
2272
|
+
// public onDateChange(event: any, controlName: string): void {
|
|
2273
|
+
// const control = this.multiForm.get(controlName);
|
|
2274
|
+
// if (control && event && event.toString() !== control.value?.toString()) {
|
|
2275
|
+
// // Use setTimeout to avoid NG0600 signal error if this is called during a signal update cycle
|
|
2276
|
+
// setTimeout(() => {
|
|
2277
|
+
// control.setValue(event);
|
|
2278
|
+
// this.onDateValueChange(event, controlName);
|
|
2279
|
+
// });
|
|
2280
|
+
// }
|
|
2281
|
+
// }
|
|
1615
2282
|
onEditionChange(event) {
|
|
1616
2283
|
const controlNameWithAt = '@edname';
|
|
1617
2284
|
const controlNameWithoutAt = 'edname';
|
|
@@ -1626,10 +2293,9 @@ class MultiFormComponent {
|
|
|
1626
2293
|
}
|
|
1627
2294
|
}
|
|
1628
2295
|
handleSearch(field, keyword) {
|
|
1629
|
-
let param = { keyword, userid: 'luke' };
|
|
1630
2296
|
const fieldConfig = field.config;
|
|
1631
|
-
this.jsonrpcService.postJsonRpcRequest(fieldConfig.method,
|
|
1632
|
-
|
|
2297
|
+
this.jsonrpcService.postJsonRpcRequest(fieldConfig.method, { keyword }).subscribe((response) => {
|
|
2298
|
+
field.options = response?.result || [];
|
|
1633
2299
|
});
|
|
1634
2300
|
}
|
|
1635
2301
|
setDefaultAdvanceDate(currentDate, defaultAdvance) {
|
|
@@ -1684,11 +2350,11 @@ class MultiFormComponent {
|
|
|
1684
2350
|
return null;
|
|
1685
2351
|
}
|
|
1686
2352
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1687
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: MultiFormComponent, isStandalone: false, selector: "prg-ws-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\" wsCircularFocus>\r\n @for (row of config?.rows; track $index; let isLast = $last) {\r\n <div class=\"row gx-3 multiform-inner\" [id]=\"formId\" [ngClass]=\"config?.rows?.length > 1 && !isLast ? 'border-bottom mb-3' : ''\">\r\n @for (field of row; track $index) {\r\n @if (field?.type !== FormFieldType.Separator && field?.type !== FormFieldType.FormHeader) {\r\n <div class=\"mb-3\" [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\" [attr.data-id]=\"field.controlName\">\r\n @if (multiForm.controls[field.controlName]) {\r\n <!-- Label -->\r\n @if (field.label && field.type !== FormFieldType.Checkbox) {\r\n <label\r\n [wsShowTooltipIfTruncated]=\"field.label\"\r\n cLabel\r\n class=\"mb-1 label-multiform single-line-label\"\r\n [for]=\"field.controlName\"\r\n [ngClass]=\"{ 'text-danger': isFormSubmitted && multiForm.controls[field.controlName]?.errors }\"\r\n [ngStyle]=\"field.styles?.label\"\r\n >{{ field.label }}\r\n @if (field?.validations?.required || false) {\r\n <strong class=\"text-danger\">*</strong>\r\n }\r\n </label>\r\n }\r\n\r\n <!-- Text, Email, Number Inputs -->\r\n @if (\r\n field.type === FormFieldType.Text ||\r\n field.type === FormFieldType.Email ||\r\n field.type === FormFieldType.Number ||\r\n field.type === FormFieldType.Password ||\r\n field.type === FormFieldType.Url ||\r\n field.type === FormFieldType.Tel\r\n ) {\r\n <div class=\"position-relative w-100\">\r\n <input\r\n [type]=\"field.type\"\r\n cFormControl\r\n [formControlName]=\"field.controlName\"\r\n [id]=\"field.controlName\"\r\n [placeholder]=\"field.placeholder || ''\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors,\r\n 'no-label-margin': !field.label\r\n }\"\r\n [min]=\"field.validations?.min\"\r\n [max]=\"field.validations?.max\"\r\n [ngStyle]=\"field.styles?.field\" />\r\n\r\n @if (field.actionButton) {\r\n <button\r\n type=\"button\"\r\n [cTooltip]=\"field.actionButton?.tooltip\"\r\n tooltipPlacement=\"top\"\r\n cButton\r\n color=\"primary\"\r\n variant=\"outline\"\r\n aria-label=\"action\"\r\n class=\"d-flex position-absolute top-50 end-0 translate-middle-y me-2 btn p-0 border-0 bg-transparent\"\r\n (click)=\"onClickFieldAction($event, field)\">\r\n <svg cIcon class=\"text-primary\" [name]=\"field.actionButton.icon\" size=\"xl\"></svg>\r\n </button>\r\n }\r\n @if (multiForm.controls[field.controlName]?.touched || isFormSubmitted) {\r\n @if (multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Select Inputs -->\r\n @else if (field.type === FormFieldType.Select || field.type === inputType?.colorSelect) {\r\n <ng-container>\r\n <c-multi-select\r\n [multiple]=\"field?.multiple || false\"\r\n [allowCreateOptions]=\"field?.allowCreateOptions || false\"\r\n [search]=\"field?.allowCreateOptions || field?.allowSearch || false\"\r\n [clearSearchOnSelect]=\"true\"\r\n [selectionType]=\"field?.selectionType || 'tags'\"\r\n [cleaner]=\"field?.allowCleaner === false ? false : true\"\r\n [formControlName]=\"field.controlName\"\r\n [placeholder]=\"field.placeholder || 'Select'\"\r\n [wsMultiSelectStyler]=\"field.type === inputType?.colorSelect\"\r\n [options]=\"colorCodes$\"\r\n [optionsMaxHeight]=\"400\"\r\n [ngClass]=\"{\r\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n (valueChange)=\"onValueChange($event, field.controlName)\"\r\n [ngStyle]=\"field.styles?.field\">\r\n @if (field.type === inputType?.colorSelect) {\r\n @for (option of colorCodes$; track $index) {\r\n <c-multi-select-option [value]=\"option?.label\">\r\n <label class=\"d-flex gap-2\">\r\n <span class=\"color-box\" [style.background-color]=\"option?.value\"></span>\r\n {{ option.label }}\r\n </label>\r\n </c-multi-select-option>\r\n }\r\n } @else {\r\n @for (option of field.options; track $index) {\r\n <c-multi-select-option [value]=\"option?.value\">\r\n {{ option.label }}\r\n </c-multi-select-option>\r\n }\r\n }\r\n </c-multi-select>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n\r\n <!-- Autosuggest Inputs -->\r\n @else if (field.type === FormFieldType.Autosuggest) {\r\n <ng-container>\r\n <input\r\n cAutocomplete\r\n [options]=\"field.options\"\r\n [searchNoResultsLabel]=\"'No results found'\"\r\n cleaner highlightOptionsOnSearch indicator\r\n [formControlName]=\"field.controlName\"\r\n [placeholder]=\"field.placeholder || 'Type and search...'\"\r\n (inputChange)=\"handleSearch(field, $event)\"\r\n [search]=\"{ external: true, global: true }\"\r\n />\r\n </ng-container>\r\n }\r\n\r\n <!-- Date input -->\r\n @else if (field.type === FormFieldType.Date) {\r\n <ng-container>\r\n <input\r\n type=\"text\"\r\n [placeholder]=\"field?.label || 'Select Date'\"\r\n class=\"form-control\"\r\n [ngClass]=\"{\r\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n (bsValueChange)=\"onDateValueChange($event, field.controlName)\"\r\n [formControlName]=\"field.controlName\"\r\n [dateInputFormat]=\"configurationService?.allConfigValues()?.defaultDateFormat || 'MM/DD/YYYY'\"\r\n [bsConfig]=\"{\r\n containerClass: 'pongrass-red-datepicker',\r\n showWeekNumbers: false,\r\n adaptivePosition: true,\r\n useUtc: false\r\n }\"\r\n bsDatepicker\r\n [ngStyle]=\"field.styles?.field\" />\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n\r\n <!-- Date input -->\r\n @else if (field.type === FormFieldType.Datetime) {\r\n <app-date-time-picker [formControlName]=\"field.controlName\"></app-date-time-picker>\r\n }\r\n\r\n <!-- Textarea -->\r\n @else if (field.type === FormFieldType.Textarea) {\r\n <ng-container>\r\n <textarea\r\n cFormControl\r\n [id]=\"field.controlName\"\r\n [rows]=\"field?.textareaRows || 4\"\r\n [columns]=\"field?.textareaColumns || 4\"\r\n [placeholder]=\"field.placeholder || ''\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n [formControlName]=\"field.controlName\"\r\n [ngStyle]=\"field.styles?.field\"></textarea>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n <!-- Checkbox -->\r\n @else if (field.type === FormFieldType.Checkbox) {\r\n <div class=\"no-label-margin\">\r\n <input cFormCheckInput [id]=\"field.controlName\" type=\"checkbox\" [formControlName]=\"field.controlName\" [ngStyle]=\"field.styles?.field\" />\r\n <label cFormCheckLabel [for]=\"field.controlName\" class=\"ms-2\" [ngStyle]=\"field.styles?.label\">{{ field.label }}</label>\r\n </div>\r\n }\r\n\r\n @else if (field.type === FormFieldType.Switch) {\r\n <c-form-check sizing=\"lg\" [switch]=\"true\">\r\n <input cFormCheckInput [id]=\"field.controlName\" type=\"checkbox\" [formControlName]=\"field.controlName\" [ngStyle]=\"field.styles?.field\" />\r\n <label cFormCheckLabel [for]=\"field.controlName\" class=\"ms-2\" [ngStyle]=\"field.styles?.label\">{{ field.info }}</label>\r\n </c-form-check>\r\n }\r\n <!-- Decimal input -->\r\n @else if (field.type === FormFieldType.Float) {\r\n <ng-container>\r\n <input\r\n cFormControl\r\n [id]=\"field.controlName\"\r\n type=\"number\"\r\n class=\"me-2\"\r\n [formControlName]=\"field.controlName\"\r\n [wsDecimalInput]=\"field.validations?.precision || 2\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n [min]=\"field.validations?.min\"\r\n [max]=\"field.validations?.max\"\r\n [ngStyle]=\"field.styles?.field\" />\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n </ng-container>\r\n } @else if (field.type === FormFieldType.Edition) {\r\n <ng-container>\r\n <prg-ws-edition-list-grouped\r\n (selectedEditionsChange)=\"onEditionChange($event)\"\r\n [multiple]=\"field?.multiple === false ? false : true\"\r\n [hasFormError]=\"isFormSubmitted && multiForm.controls[field.controlName]?.errors\">\r\n </prg-ws-edition-list-grouped>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (field?.type === FormFieldType.Separator) {\r\n <div [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\"></div>\r\n }\r\n @if (field?.type === FormFieldType.FormHeader) {\r\n <div [class]=\"'fs-6 fw-bold my-2 field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\">{{ field?.label }}</div>\r\n }\r\n }\r\n </div>\r\n }\r\n</form>\r\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}::ng-deep [data-coreui-theme=dark] .bs-datepicker{background:#212631;box-shadow:0 0 10px #323a49}::ng-deep [data-coreui-theme=dark] .bs-datepicker .bs-datepicker-body{border:1px solid #323a49}::ng-deep .pongrass-red-datepicker .bs-datepicker-head{background-color:#ff4d5c}::ng-deep .pongrass-red-datepicker .bs-datepicker-body table td span.selected,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td.selected span,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td span[class*=select-]:after,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td[class*=select-] span:after{background-color:#ff4d5c}::ng-deep .pongrass-red-datepicker .bs-datepicker-body table td.week span{color:#ff4d5c}\n"], dependencies: [{ kind: "directive", type: CircularFocusDirective, selector: "[wsCircularFocus]", 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: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.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: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i3.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.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: "component", type: i4.FormCheckComponent, selector: "c-form-check", inputs: ["inline", "reverse", "sizing", "switch"], exportAs: ["cFormCheck"] }, { 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: "[wsDecimalInput]", inputs: ["wsDecimalInput"] }, { kind: "directive", type: ShowTooltipIfTruncatedDirective, selector: "[wsShowTooltipIfTruncated]", inputs: ["wsShowTooltipIfTruncated"] }, { 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: "directive", type: i4.AutocompleteDirective, selector: "input[cAutocomplete]", inputs: ["popperOptionsInput", "allowOnlyDefinedOptions", "cleaner", "clearSearchOnSelect", "delay", "disabled", "highlightOptionsOnSearch", "id", "indicator", "itemSize", "loading", "options", "optionsMaxHeight", "optionTemplate", "optionGroupTemplate", "placeholder", "readOnly", "resetSelectionOnOptionsChange", "search", "searchNoResultsLabel", "showHints", "sizing", "valid", "value", "virtualScroller", "visible", "visibleItems"], outputs: ["inputChange", "optionChange", "valueChange", "visibleChange"], exportAs: ["cAutocomplete"] }, { kind: "component", type: EditionListGroupedComponent, selector: "prg-ws-edition-list-grouped", inputs: ["label", "multiple", "hasFormError"], outputs: ["selectedEditionsChange"] }, { kind: "directive", type: MultiSelectStylerDirective, selector: "[wsMultiSelectStyler]", inputs: ["wsMultiSelectStyler", "options"] }, { kind: "component", type: DateTimePickerComponent, selector: "app-date-time-picker" }] });
|
|
2353
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: MultiFormComponent, isStandalone: false, selector: "prg-ws-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\" wsCircularFocus>\r\n @for (row of config?.rows; track $index; let isLast = $last) {\r\n <div class=\"row gx-3 multiform-inner\" [id]=\"formId\" [ngClass]=\"config?.rows?.length > 1 && !isLast ? 'border-bottom mb-3' : ''\">\r\n @for (field of row; track $index) {\r\n @if (field?.type !== FormFieldType.Separator && field?.type !== FormFieldType.FormHeader) {\r\n <div class=\"mb-3\" [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\" [attr.data-id]=\"field.controlName\">\r\n @if (multiForm.controls[field.controlName]) {\r\n <!-- Label -->\r\n @if (field.label && field.type !== FormFieldType.Checkbox) {\r\n <label\r\n [wsShowTooltipIfTruncated]=\"field.label\"\r\n cLabel\r\n class=\"mb-1 label-multiform single-line-label\"\r\n [for]=\"field.controlName\"\r\n [ngClass]=\"{ 'text-danger': isFormSubmitted && multiForm.controls[field.controlName]?.errors }\"\r\n [ngStyle]=\"field.styles?.label\"\r\n >{{ field.label }}\r\n @if (field?.validations?.required || false) {\r\n <strong class=\"text-danger\">*</strong>\r\n }\r\n </label>\r\n }\r\n\r\n <!-- Text, Email, Number Inputs -->\r\n @if (\r\n field.type === FormFieldType.Text ||\r\n field.type === FormFieldType.Email ||\r\n field.type === FormFieldType.Number ||\r\n field.type === FormFieldType.Password ||\r\n field.type === FormFieldType.Url ||\r\n field.type === FormFieldType.Tel\r\n ) {\r\n <div class=\"position-relative w-100\">\r\n <input\r\n [type]=\"field.type\"\r\n cFormControl\r\n [formControlName]=\"field.controlName\"\r\n [id]=\"field.controlName\"\r\n [placeholder]=\"field.placeholder || ''\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors,\r\n 'no-label-margin': !field.label\r\n }\"\r\n [min]=\"field.validations?.min\"\r\n [max]=\"field.validations?.max\"\r\n [ngStyle]=\"field.styles?.field\" />\r\n\r\n @if (field.actionButton) {\r\n <button\r\n type=\"button\"\r\n [cTooltip]=\"field.actionButton?.tooltip\"\r\n tooltipPlacement=\"top\"\r\n cButton\r\n color=\"primary\"\r\n variant=\"outline\"\r\n aria-label=\"action\"\r\n class=\"d-flex position-absolute top-50 end-0 translate-middle-y me-2 btn p-0 border-0 bg-transparent\"\r\n (click)=\"onClickFieldAction($event, field)\">\r\n <svg cIcon class=\"text-primary\" [name]=\"field.actionButton.icon\" size=\"xl\"></svg>\r\n </button>\r\n }\r\n @if (multiForm.controls[field.controlName]?.touched || isFormSubmitted) {\r\n @if (multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Select Inputs -->\r\n @else if (field.type === FormFieldType.Select || field.type === inputType?.colorSelect) {\r\n <ng-container>\r\n <c-multi-select\r\n [multiple]=\"field?.multiple || false\"\r\n [allowCreateOptions]=\"field?.allowCreateOptions || false\"\r\n [search]=\"field?.allowCreateOptions || field?.allowSearch || field?.search || false\"\r\n [searchNoResultsLabel]=\"field?.searchNoResultsLabel || 'No results found'\"\r\n [clearSearchOnSelect]=\"true\"\r\n [selectionType]=\"field?.selectionType || 'tags'\"\r\n [cleaner]=\"field?.allowCleaner === false ? false : true\"\r\n [formControlName]=\"field.controlName\"\r\n [placeholder]=\"field.placeholder || 'Select'\"\r\n [wsMultiSelectStyler]=\"field.type === inputType?.colorSelect\"\r\n [options]=\"colorCodes$\"\r\n [optionsMaxHeight]=\"400\"\r\n [ngClass]=\"{\r\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n (searchValueChange)=\"handleSearch(field, $event)\"\r\n (valueChange)=\"onValueChange($event, field.controlName)\"\r\n [ngStyle]=\"field.styles?.field\">\r\n @if (field.type === inputType?.colorSelect) {\r\n @for (option of colorCodes$; track $index) {\r\n <c-multi-select-option [value]=\"option?.label\">\r\n <label class=\"d-flex gap-2\">\r\n <span class=\"color-box\" [style.background-color]=\"option?.value\"></span>\r\n {{ option.label }}\r\n </label>\r\n </c-multi-select-option>\r\n }\r\n } @else {\r\n @for (option of field.options; track $index) {\r\n <c-multi-select-option [value]=\"option?.value\">\r\n {{ option.label }}\r\n </c-multi-select-option>\r\n }\r\n }\r\n </c-multi-select>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n\r\n <!-- Date input -->\r\n @else if (field.type === FormFieldType.Date) {\r\n <ng-container>\r\n <input\r\n type=\"text\"\r\n [placeholder]=\"field?.label || 'Select Date'\"\r\n class=\"form-control\"\r\n [ngClass]=\"{\r\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n (bsValueChange)=\"onDateValueChange($event, field.controlName)\"\r\n [formControlName]=\"field.controlName\"\r\n [dateInputFormat]=\"configurationService?.allConfigValues()?.defaultDateFormat || 'MM/DD/YYYY'\"\r\n [bsConfig]=\"{\r\n containerClass: 'pongrass-red-datepicker',\r\n showWeekNumbers: false,\r\n adaptivePosition: true,\r\n useUtc: false\r\n }\"\r\n bsDatepicker\r\n [ngStyle]=\"field.styles?.field\" />\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n\r\n @else if (field.type === FormFieldType.NewDate) {\r\n <ng-container>\r\n <c-date-picker\r\n [formControlName]=\"field.controlName\"\r\n [calendarDate]=\"multiForm.controls[field.controlName]?.value\"\r\n inputReadOnly=\"true\"\r\n [showAdjacentDays]=\"false\"\r\n locale=\"en-US\">\r\n </c-date-picker>\r\n </ng-container>\r\n }\r\n\r\n <!-- Date Time input -->\r\n @else if (field.type === FormFieldType.Datetime) {\r\n <app-date-time-picker [formControlName]=\"field.controlName\"></app-date-time-picker>\r\n }\r\n\r\n <!-- Textarea -->\r\n @else if (field.type === FormFieldType.Textarea) {\r\n <ng-container>\r\n <textarea\r\n cFormControl\r\n [id]=\"field.controlName\"\r\n [rows]=\"field?.textareaRows || 4\"\r\n [columns]=\"field?.textareaColumns || 4\"\r\n [placeholder]=\"field.placeholder || ''\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n [formControlName]=\"field.controlName\"\r\n [ngStyle]=\"field.styles?.field\"></textarea>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n <!-- Checkbox -->\r\n @else if (field.type === FormFieldType.Checkbox) {\r\n <div class=\"no-label-margin\">\r\n <input cFormCheckInput [id]=\"field.controlName\" type=\"checkbox\" [formControlName]=\"field.controlName\" [ngStyle]=\"field.styles?.field\" />\r\n <label cFormCheckLabel [for]=\"field.controlName\" class=\"ms-2\" [ngStyle]=\"field.styles?.label\">{{ field.label }}</label>\r\n </div>\r\n }\r\n\r\n @else if (field.type === FormFieldType.Switch) {\r\n <c-form-check sizing=\"lg\" [switch]=\"true\">\r\n <input cFormCheckInput [id]=\"field.controlName\" type=\"checkbox\" [formControlName]=\"field.controlName\" [ngStyle]=\"field.styles?.field\" />\r\n <label cFormCheckLabel [for]=\"field.controlName\" class=\"ms-2\" [ngStyle]=\"field.styles?.label\">{{ field.info }}</label>\r\n </c-form-check>\r\n }\r\n <!-- Decimal input -->\r\n @else if (field.type === FormFieldType.Float) {\r\n <ng-container>\r\n <input\r\n cFormControl\r\n [id]=\"field.controlName\"\r\n type=\"number\"\r\n class=\"me-2\"\r\n [formControlName]=\"field.controlName\"\r\n [wsDecimalInput]=\"field.validations?.precision || 2\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n [min]=\"field.validations?.min\"\r\n [max]=\"field.validations?.max\"\r\n [ngStyle]=\"field.styles?.field\" />\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n </ng-container>\r\n } @else if (field.type === FormFieldType.Edition) {\r\n <ng-container>\r\n <prg-ws-edition-list-grouped\r\n (selectedEditionsChange)=\"onEditionChange($event)\"\r\n [multiple]=\"field?.multiple === false ? false : true\"\r\n [hasFormError]=\"isFormSubmitted && multiForm.controls[field.controlName]?.errors\">\r\n </prg-ws-edition-list-grouped>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n } @else if (field.type === FormFieldType.Timepicker) {\r\n <c-time-picker [formControlName]=\"field.controlName\" seconds />\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (field?.type === FormFieldType.Separator) {\r\n <div [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\"></div>\r\n }\r\n @if (field?.type === FormFieldType.FormHeader) {\r\n <div [class]=\"'fs-6 fw-bold my-2 field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\">{{ field?.label }}</div>\r\n }\r\n }\r\n </div>\r\n }\r\n</form>\r\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}::ng-deep [data-coreui-theme=dark] .bs-datepicker{background:#212631;box-shadow:0 0 10px #323a49}::ng-deep [data-coreui-theme=dark] .bs-datepicker .bs-datepicker-body{border:1px solid #323a49}::ng-deep .pongrass-red-datepicker .bs-datepicker-head{background-color:#ff4d5c}::ng-deep .pongrass-red-datepicker .bs-datepicker-body table td span.selected,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td.selected span,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td span[class*=select-]:after,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td[class*=select-] span:after{background-color:#ff4d5c}::ng-deep .pongrass-red-datepicker .bs-datepicker-body table td.week span{color:#ff4d5c}\n"], dependencies: [{ kind: "directive", type: CircularFocusDirective, selector: "[wsCircularFocus]", 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: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.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: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i3.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1.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: i1.MultiSelectOptionComponent, selector: "c-multi-select-option", inputs: ["optionsStyle", "label", "text", "visible", "disabled", "selected", "value", "active", "role"], outputs: ["selectedChange", "focusChange"], exportAs: ["cMultiSelectOption"] }, { kind: "directive", type: i1.FormDirective, selector: "form[cForm]", inputs: ["validated"] }, { kind: "component", type: i1.FormCheckComponent, selector: "c-form-check", inputs: ["inline", "reverse", "sizing", "switch"], exportAs: ["cFormCheck"] }, { kind: "directive", type: i1.FormCheckLabelDirective, selector: "label[cFormCheckLabel]" }, { kind: "directive", type: i1.FormCheckInputDirective, selector: "input[cFormCheckInput]", inputs: ["type", "indeterminate", "valid"] }, { kind: "directive", type: i1.FormControlDirective, selector: "input[cFormControl], textarea[cFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }, { kind: "directive", type: i1.FormLabelDirective, selector: "[cLabel]", inputs: ["cLabel", "sizing"] }, { kind: "directive", type: i1$1.IconDirective, selector: "svg[cIcon]", inputs: ["cIcon", "customClasses", "size", "title", "height", "width", "name", "viewBox", "xmlns", "pointer-events", "role"], exportAs: ["cIcon"] }, { kind: "component", type: i1.DatePickerComponent, selector: "c-date-picker", inputs: ["calendars", "placeholder", "date"], outputs: ["dateChange"], exportAs: ["cDatePicker"] }, { kind: "directive", type: DecimalInputDirective, selector: "[wsDecimalInput]", inputs: ["wsDecimalInput"] }, { kind: "directive", type: ShowTooltipIfTruncatedDirective, selector: "[wsShowTooltipIfTruncated]", inputs: ["wsShowTooltipIfTruncated"] }, { kind: "directive", type: i1.TooltipDirective, selector: "[cTooltip]", inputs: ["cTooltip", "cTooltipOptions", "cTooltipPlacement", "cTooltipRef", "cTooltipTrigger", "cTooltipVisible"], outputs: ["cTooltipVisibleChange"], exportAs: ["cTooltip"] }, { kind: "directive", type: i1.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: "prg-ws-edition-list-grouped", inputs: ["label", "multiple", "hasFormError"], outputs: ["selectedEditionsChange"] }, { kind: "directive", type: MultiSelectStylerDirective, selector: "[wsMultiSelectStyler]", inputs: ["wsMultiSelectStyler", "options"] }, { kind: "component", type: i1.TimePickerComponent, selector: "c-time-picker", inputs: ["cleaner", "dateTimeFormatOptions", "disabled", "filterHours", "filterMinutes", "filterSeconds", "indicator", "inputReadOnly", "locale", "placeholder", "seconds", "size", "time", "variant", "valid", "visible"], outputs: ["timeChange"], exportAs: ["cTimePicker"] }, { kind: "component", type: DateTimePickerComponent, selector: "app-date-time-picker" }] });
|
|
1688
2354
|
}
|
|
1689
2355
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiFormComponent, decorators: [{
|
|
1690
2356
|
type: Component,
|
|
1691
|
-
args: [{ selector: 'prg-ws-multi-form', standalone: false, template: "<form [formGroup]=\"multiForm\" cForm class=\"multiform-wrapper\" wsCircularFocus>\r\n @for (row of config?.rows; track $index; let isLast = $last) {\r\n <div class=\"row gx-3 multiform-inner\" [id]=\"formId\" [ngClass]=\"config?.rows?.length > 1 && !isLast ? 'border-bottom mb-3' : ''\">\r\n @for (field of row; track $index) {\r\n @if (field?.type !== FormFieldType.Separator && field?.type !== FormFieldType.FormHeader) {\r\n <div class=\"mb-3\" [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\" [attr.data-id]=\"field.controlName\">\r\n @if (multiForm.controls[field.controlName]) {\r\n <!-- Label -->\r\n @if (field.label && field.type !== FormFieldType.Checkbox) {\r\n <label\r\n [wsShowTooltipIfTruncated]=\"field.label\"\r\n cLabel\r\n class=\"mb-1 label-multiform single-line-label\"\r\n [for]=\"field.controlName\"\r\n [ngClass]=\"{ 'text-danger': isFormSubmitted && multiForm.controls[field.controlName]?.errors }\"\r\n [ngStyle]=\"field.styles?.label\"\r\n >{{ field.label }}\r\n @if (field?.validations?.required || false) {\r\n <strong class=\"text-danger\">*</strong>\r\n }\r\n </label>\r\n }\r\n\r\n <!-- Text, Email, Number Inputs -->\r\n @if (\r\n field.type === FormFieldType.Text ||\r\n field.type === FormFieldType.Email ||\r\n field.type === FormFieldType.Number ||\r\n field.type === FormFieldType.Password ||\r\n field.type === FormFieldType.Url ||\r\n field.type === FormFieldType.Tel\r\n ) {\r\n <div class=\"position-relative w-100\">\r\n <input\r\n [type]=\"field.type\"\r\n cFormControl\r\n [formControlName]=\"field.controlName\"\r\n [id]=\"field.controlName\"\r\n [placeholder]=\"field.placeholder || ''\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors,\r\n 'no-label-margin': !field.label\r\n }\"\r\n [min]=\"field.validations?.min\"\r\n [max]=\"field.validations?.max\"\r\n [ngStyle]=\"field.styles?.field\" />\r\n\r\n @if (field.actionButton) {\r\n <button\r\n type=\"button\"\r\n [cTooltip]=\"field.actionButton?.tooltip\"\r\n tooltipPlacement=\"top\"\r\n cButton\r\n color=\"primary\"\r\n variant=\"outline\"\r\n aria-label=\"action\"\r\n class=\"d-flex position-absolute top-50 end-0 translate-middle-y me-2 btn p-0 border-0 bg-transparent\"\r\n (click)=\"onClickFieldAction($event, field)\">\r\n <svg cIcon class=\"text-primary\" [name]=\"field.actionButton.icon\" size=\"xl\"></svg>\r\n </button>\r\n }\r\n @if (multiForm.controls[field.controlName]?.touched || isFormSubmitted) {\r\n @if (multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Select Inputs -->\r\n @else if (field.type === FormFieldType.Select || field.type === inputType?.colorSelect) {\r\n <ng-container>\r\n <c-multi-select\r\n [multiple]=\"field?.multiple || false\"\r\n [allowCreateOptions]=\"field?.allowCreateOptions || false\"\r\n [search]=\"field?.allowCreateOptions || field?.allowSearch || false\"\r\n [clearSearchOnSelect]=\"true\"\r\n [selectionType]=\"field?.selectionType || 'tags'\"\r\n [cleaner]=\"field?.allowCleaner === false ? false : true\"\r\n [formControlName]=\"field.controlName\"\r\n [placeholder]=\"field.placeholder || 'Select'\"\r\n [wsMultiSelectStyler]=\"field.type === inputType?.colorSelect\"\r\n [options]=\"colorCodes$\"\r\n [optionsMaxHeight]=\"400\"\r\n [ngClass]=\"{\r\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n (valueChange)=\"onValueChange($event, field.controlName)\"\r\n [ngStyle]=\"field.styles?.field\">\r\n @if (field.type === inputType?.colorSelect) {\r\n @for (option of colorCodes$; track $index) {\r\n <c-multi-select-option [value]=\"option?.label\">\r\n <label class=\"d-flex gap-2\">\r\n <span class=\"color-box\" [style.background-color]=\"option?.value\"></span>\r\n {{ option.label }}\r\n </label>\r\n </c-multi-select-option>\r\n }\r\n } @else {\r\n @for (option of field.options; track $index) {\r\n <c-multi-select-option [value]=\"option?.value\">\r\n {{ option.label }}\r\n </c-multi-select-option>\r\n }\r\n }\r\n </c-multi-select>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n\r\n <!-- Autosuggest Inputs -->\r\n @else if (field.type === FormFieldType.Autosuggest) {\r\n <ng-container>\r\n <input\r\n cAutocomplete\r\n [options]=\"field.options\"\r\n [searchNoResultsLabel]=\"'No results found'\"\r\n cleaner highlightOptionsOnSearch indicator\r\n [formControlName]=\"field.controlName\"\r\n [placeholder]=\"field.placeholder || 'Type and search...'\"\r\n (inputChange)=\"handleSearch(field, $event)\"\r\n [search]=\"{ external: true, global: true }\"\r\n />\r\n </ng-container>\r\n }\r\n\r\n <!-- Date input -->\r\n @else if (field.type === FormFieldType.Date) {\r\n <ng-container>\r\n <input\r\n type=\"text\"\r\n [placeholder]=\"field?.label || 'Select Date'\"\r\n class=\"form-control\"\r\n [ngClass]=\"{\r\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n (bsValueChange)=\"onDateValueChange($event, field.controlName)\"\r\n [formControlName]=\"field.controlName\"\r\n [dateInputFormat]=\"configurationService?.allConfigValues()?.defaultDateFormat || 'MM/DD/YYYY'\"\r\n [bsConfig]=\"{\r\n containerClass: 'pongrass-red-datepicker',\r\n showWeekNumbers: false,\r\n adaptivePosition: true,\r\n useUtc: false\r\n }\"\r\n bsDatepicker\r\n [ngStyle]=\"field.styles?.field\" />\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n\r\n <!-- Date input -->\r\n @else if (field.type === FormFieldType.Datetime) {\r\n <app-date-time-picker [formControlName]=\"field.controlName\"></app-date-time-picker>\r\n }\r\n\r\n <!-- Textarea -->\r\n @else if (field.type === FormFieldType.Textarea) {\r\n <ng-container>\r\n <textarea\r\n cFormControl\r\n [id]=\"field.controlName\"\r\n [rows]=\"field?.textareaRows || 4\"\r\n [columns]=\"field?.textareaColumns || 4\"\r\n [placeholder]=\"field.placeholder || ''\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n [formControlName]=\"field.controlName\"\r\n [ngStyle]=\"field.styles?.field\"></textarea>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n <!-- Checkbox -->\r\n @else if (field.type === FormFieldType.Checkbox) {\r\n <div class=\"no-label-margin\">\r\n <input cFormCheckInput [id]=\"field.controlName\" type=\"checkbox\" [formControlName]=\"field.controlName\" [ngStyle]=\"field.styles?.field\" />\r\n <label cFormCheckLabel [for]=\"field.controlName\" class=\"ms-2\" [ngStyle]=\"field.styles?.label\">{{ field.label }}</label>\r\n </div>\r\n }\r\n\r\n @else if (field.type === FormFieldType.Switch) {\r\n <c-form-check sizing=\"lg\" [switch]=\"true\">\r\n <input cFormCheckInput [id]=\"field.controlName\" type=\"checkbox\" [formControlName]=\"field.controlName\" [ngStyle]=\"field.styles?.field\" />\r\n <label cFormCheckLabel [for]=\"field.controlName\" class=\"ms-2\" [ngStyle]=\"field.styles?.label\">{{ field.info }}</label>\r\n </c-form-check>\r\n }\r\n <!-- Decimal input -->\r\n @else if (field.type === FormFieldType.Float) {\r\n <ng-container>\r\n <input\r\n cFormControl\r\n [id]=\"field.controlName\"\r\n type=\"number\"\r\n class=\"me-2\"\r\n [formControlName]=\"field.controlName\"\r\n [wsDecimalInput]=\"field.validations?.precision || 2\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n [min]=\"field.validations?.min\"\r\n [max]=\"field.validations?.max\"\r\n [ngStyle]=\"field.styles?.field\" />\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n </ng-container>\r\n } @else if (field.type === FormFieldType.Edition) {\r\n <ng-container>\r\n <prg-ws-edition-list-grouped\r\n (selectedEditionsChange)=\"onEditionChange($event)\"\r\n [multiple]=\"field?.multiple === false ? false : true\"\r\n [hasFormError]=\"isFormSubmitted && multiForm.controls[field.controlName]?.errors\">\r\n </prg-ws-edition-list-grouped>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (field?.type === FormFieldType.Separator) {\r\n <div [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\"></div>\r\n }\r\n @if (field?.type === FormFieldType.FormHeader) {\r\n <div [class]=\"'fs-6 fw-bold my-2 field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\">{{ field?.label }}</div>\r\n }\r\n }\r\n </div>\r\n }\r\n</form>\r\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}::ng-deep [data-coreui-theme=dark] .bs-datepicker{background:#212631;box-shadow:0 0 10px #323a49}::ng-deep [data-coreui-theme=dark] .bs-datepicker .bs-datepicker-body{border:1px solid #323a49}::ng-deep .pongrass-red-datepicker .bs-datepicker-head{background-color:#ff4d5c}::ng-deep .pongrass-red-datepicker .bs-datepicker-body table td span.selected,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td.selected span,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td span[class*=select-]:after,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td[class*=select-] span:after{background-color:#ff4d5c}::ng-deep .pongrass-red-datepicker .bs-datepicker-body table td.week span{color:#ff4d5c}\n"] }]
|
|
2357
|
+
args: [{ selector: 'prg-ws-multi-form', standalone: false, template: "<form [formGroup]=\"multiForm\" cForm class=\"multiform-wrapper\" wsCircularFocus>\r\n @for (row of config?.rows; track $index; let isLast = $last) {\r\n <div class=\"row gx-3 multiform-inner\" [id]=\"formId\" [ngClass]=\"config?.rows?.length > 1 && !isLast ? 'border-bottom mb-3' : ''\">\r\n @for (field of row; track $index) {\r\n @if (field?.type !== FormFieldType.Separator && field?.type !== FormFieldType.FormHeader) {\r\n <div class=\"mb-3\" [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\" [attr.data-id]=\"field.controlName\">\r\n @if (multiForm.controls[field.controlName]) {\r\n <!-- Label -->\r\n @if (field.label && field.type !== FormFieldType.Checkbox) {\r\n <label\r\n [wsShowTooltipIfTruncated]=\"field.label\"\r\n cLabel\r\n class=\"mb-1 label-multiform single-line-label\"\r\n [for]=\"field.controlName\"\r\n [ngClass]=\"{ 'text-danger': isFormSubmitted && multiForm.controls[field.controlName]?.errors }\"\r\n [ngStyle]=\"field.styles?.label\"\r\n >{{ field.label }}\r\n @if (field?.validations?.required || false) {\r\n <strong class=\"text-danger\">*</strong>\r\n }\r\n </label>\r\n }\r\n\r\n <!-- Text, Email, Number Inputs -->\r\n @if (\r\n field.type === FormFieldType.Text ||\r\n field.type === FormFieldType.Email ||\r\n field.type === FormFieldType.Number ||\r\n field.type === FormFieldType.Password ||\r\n field.type === FormFieldType.Url ||\r\n field.type === FormFieldType.Tel\r\n ) {\r\n <div class=\"position-relative w-100\">\r\n <input\r\n [type]=\"field.type\"\r\n cFormControl\r\n [formControlName]=\"field.controlName\"\r\n [id]=\"field.controlName\"\r\n [placeholder]=\"field.placeholder || ''\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors,\r\n 'no-label-margin': !field.label\r\n }\"\r\n [min]=\"field.validations?.min\"\r\n [max]=\"field.validations?.max\"\r\n [ngStyle]=\"field.styles?.field\" />\r\n\r\n @if (field.actionButton) {\r\n <button\r\n type=\"button\"\r\n [cTooltip]=\"field.actionButton?.tooltip\"\r\n tooltipPlacement=\"top\"\r\n cButton\r\n color=\"primary\"\r\n variant=\"outline\"\r\n aria-label=\"action\"\r\n class=\"d-flex position-absolute top-50 end-0 translate-middle-y me-2 btn p-0 border-0 bg-transparent\"\r\n (click)=\"onClickFieldAction($event, field)\">\r\n <svg cIcon class=\"text-primary\" [name]=\"field.actionButton.icon\" size=\"xl\"></svg>\r\n </button>\r\n }\r\n @if (multiForm.controls[field.controlName]?.touched || isFormSubmitted) {\r\n @if (multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Select Inputs -->\r\n @else if (field.type === FormFieldType.Select || field.type === inputType?.colorSelect) {\r\n <ng-container>\r\n <c-multi-select\r\n [multiple]=\"field?.multiple || false\"\r\n [allowCreateOptions]=\"field?.allowCreateOptions || false\"\r\n [search]=\"field?.allowCreateOptions || field?.allowSearch || field?.search || false\"\r\n [searchNoResultsLabel]=\"field?.searchNoResultsLabel || 'No results found'\"\r\n [clearSearchOnSelect]=\"true\"\r\n [selectionType]=\"field?.selectionType || 'tags'\"\r\n [cleaner]=\"field?.allowCleaner === false ? false : true\"\r\n [formControlName]=\"field.controlName\"\r\n [placeholder]=\"field.placeholder || 'Select'\"\r\n [wsMultiSelectStyler]=\"field.type === inputType?.colorSelect\"\r\n [options]=\"colorCodes$\"\r\n [optionsMaxHeight]=\"400\"\r\n [ngClass]=\"{\r\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n (searchValueChange)=\"handleSearch(field, $event)\"\r\n (valueChange)=\"onValueChange($event, field.controlName)\"\r\n [ngStyle]=\"field.styles?.field\">\r\n @if (field.type === inputType?.colorSelect) {\r\n @for (option of colorCodes$; track $index) {\r\n <c-multi-select-option [value]=\"option?.label\">\r\n <label class=\"d-flex gap-2\">\r\n <span class=\"color-box\" [style.background-color]=\"option?.value\"></span>\r\n {{ option.label }}\r\n </label>\r\n </c-multi-select-option>\r\n }\r\n } @else {\r\n @for (option of field.options; track $index) {\r\n <c-multi-select-option [value]=\"option?.value\">\r\n {{ option.label }}\r\n </c-multi-select-option>\r\n }\r\n }\r\n </c-multi-select>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n\r\n <!-- Date input -->\r\n @else if (field.type === FormFieldType.Date) {\r\n <ng-container>\r\n <input\r\n type=\"text\"\r\n [placeholder]=\"field?.label || 'Select Date'\"\r\n class=\"form-control\"\r\n [ngClass]=\"{\r\n 'form-invalid': (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n (bsValueChange)=\"onDateValueChange($event, field.controlName)\"\r\n [formControlName]=\"field.controlName\"\r\n [dateInputFormat]=\"configurationService?.allConfigValues()?.defaultDateFormat || 'MM/DD/YYYY'\"\r\n [bsConfig]=\"{\r\n containerClass: 'pongrass-red-datepicker',\r\n showWeekNumbers: false,\r\n adaptivePosition: true,\r\n useUtc: false\r\n }\"\r\n bsDatepicker\r\n [ngStyle]=\"field.styles?.field\" />\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n\r\n @else if (field.type === FormFieldType.NewDate) {\r\n <ng-container>\r\n <c-date-picker\r\n [formControlName]=\"field.controlName\"\r\n [calendarDate]=\"multiForm.controls[field.controlName]?.value\"\r\n inputReadOnly=\"true\"\r\n [showAdjacentDays]=\"false\"\r\n locale=\"en-US\">\r\n </c-date-picker>\r\n </ng-container>\r\n }\r\n\r\n <!-- Date Time input -->\r\n @else if (field.type === FormFieldType.Datetime) {\r\n <app-date-time-picker [formControlName]=\"field.controlName\"></app-date-time-picker>\r\n }\r\n\r\n <!-- Textarea -->\r\n @else if (field.type === FormFieldType.Textarea) {\r\n <ng-container>\r\n <textarea\r\n cFormControl\r\n [id]=\"field.controlName\"\r\n [rows]=\"field?.textareaRows || 4\"\r\n [columns]=\"field?.textareaColumns || 4\"\r\n [placeholder]=\"field.placeholder || ''\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n [formControlName]=\"field.controlName\"\r\n [ngStyle]=\"field.styles?.field\"></textarea>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n </ng-container>\r\n }\r\n <!-- Checkbox -->\r\n @else if (field.type === FormFieldType.Checkbox) {\r\n <div class=\"no-label-margin\">\r\n <input cFormCheckInput [id]=\"field.controlName\" type=\"checkbox\" [formControlName]=\"field.controlName\" [ngStyle]=\"field.styles?.field\" />\r\n <label cFormCheckLabel [for]=\"field.controlName\" class=\"ms-2\" [ngStyle]=\"field.styles?.label\">{{ field.label }}</label>\r\n </div>\r\n }\r\n\r\n @else if (field.type === FormFieldType.Switch) {\r\n <c-form-check sizing=\"lg\" [switch]=\"true\">\r\n <input cFormCheckInput [id]=\"field.controlName\" type=\"checkbox\" [formControlName]=\"field.controlName\" [ngStyle]=\"field.styles?.field\" />\r\n <label cFormCheckLabel [for]=\"field.controlName\" class=\"ms-2\" [ngStyle]=\"field.styles?.label\">{{ field.info }}</label>\r\n </c-form-check>\r\n }\r\n <!-- Decimal input -->\r\n @else if (field.type === FormFieldType.Float) {\r\n <ng-container>\r\n <input\r\n cFormControl\r\n [id]=\"field.controlName\"\r\n type=\"number\"\r\n class=\"me-2\"\r\n [formControlName]=\"field.controlName\"\r\n [wsDecimalInput]=\"field.validations?.precision || 2\"\r\n [ngClass]=\"{\r\n 'form-invalid border-danger border border-2':\r\n (multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors\r\n }\"\r\n [min]=\"field.validations?.min\"\r\n [max]=\"field.validations?.max\"\r\n [ngStyle]=\"field.styles?.field\" />\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['pattern']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is invalid</small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['minlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Minimum length {{ field?.validations?.minLength }} characters is required\r\n </small>\r\n } @else if (multiForm.controls[field.controlName]?.errors?.['maxlength']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">\r\n Maximum length {{ field?.validations?.maxLength }} characters is allowed\r\n </small>\r\n }\r\n }\r\n </ng-container>\r\n } @else if (field.type === FormFieldType.Edition) {\r\n <ng-container>\r\n <prg-ws-edition-list-grouped\r\n (selectedEditionsChange)=\"onEditionChange($event)\"\r\n [multiple]=\"field?.multiple === false ? false : true\"\r\n [hasFormError]=\"isFormSubmitted && multiForm.controls[field.controlName]?.errors\">\r\n </prg-ws-edition-list-grouped>\r\n @if ((multiForm.controls[field.controlName]?.touched || isFormSubmitted) && multiForm.controls[field.controlName]?.errors) {\r\n @if (multiForm.controls[field.controlName]?.errors?.['required']) {\r\n <small class=\"text-danger fst-italic form-invalid-label\">{{ field?.label }} is required</small>\r\n }\r\n }\r\n </ng-container>\r\n } @else if (field.type === FormFieldType.Timepicker) {\r\n <c-time-picker [formControlName]=\"field.controlName\" seconds />\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (field?.type === FormFieldType.Separator) {\r\n <div [class]=\"'field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\"></div>\r\n }\r\n @if (field?.type === FormFieldType.FormHeader) {\r\n <div [class]=\"'fs-6 fw-bold my-2 field-' + field.type\" [ngClass]=\"field.colspan ? 'col-md-' + field.colspan : 'col'\">{{ field?.label }}</div>\r\n }\r\n }\r\n </div>\r\n }\r\n</form>\r\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}::ng-deep [data-coreui-theme=dark] .bs-datepicker{background:#212631;box-shadow:0 0 10px #323a49}::ng-deep [data-coreui-theme=dark] .bs-datepicker .bs-datepicker-body{border:1px solid #323a49}::ng-deep .pongrass-red-datepicker .bs-datepicker-head{background-color:#ff4d5c}::ng-deep .pongrass-red-datepicker .bs-datepicker-body table td span.selected,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td.selected span,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td span[class*=select-]:after,::ng-deep .pongrass-red-datepicker .theme-red .bs-datepicker-body table td[class*=select-] span:after{background-color:#ff4d5c}::ng-deep .pongrass-red-datepicker .bs-datepicker-body table td.week span{color:#ff4d5c}\n"] }]
|
|
1692
2358
|
}], ctorParameters: () => [], propDecorators: { config: [{
|
|
1693
2359
|
type: Input
|
|
1694
2360
|
}], showUnsavedFlags: [{
|
|
@@ -1724,7 +2390,8 @@ class MultiFormModule {
|
|
|
1724
2390
|
AutocompleteModule,
|
|
1725
2391
|
FormCheckInputDirective,
|
|
1726
2392
|
EditionListGroupedComponent,
|
|
1727
|
-
MultiSelectStylerDirective
|
|
2393
|
+
MultiSelectStylerDirective,
|
|
2394
|
+
TimePickerModule], exports: [MultiFormComponent, DateTimePickerComponent] });
|
|
1728
2395
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiFormModule, imports: [CommonModule,
|
|
1729
2396
|
ReactiveFormsModule,
|
|
1730
2397
|
MultiSelectModule,
|
|
@@ -1737,7 +2404,8 @@ class MultiFormModule {
|
|
|
1737
2404
|
ButtonModule,
|
|
1738
2405
|
BsDatepickerModule,
|
|
1739
2406
|
AutocompleteModule,
|
|
1740
|
-
EditionListGroupedComponent
|
|
2407
|
+
EditionListGroupedComponent,
|
|
2408
|
+
TimePickerModule] });
|
|
1741
2409
|
}
|
|
1742
2410
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: MultiFormModule, decorators: [{
|
|
1743
2411
|
type: NgModule,
|
|
@@ -1761,7 +2429,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
1761
2429
|
AutocompleteModule,
|
|
1762
2430
|
FormCheckInputDirective,
|
|
1763
2431
|
EditionListGroupedComponent,
|
|
1764
|
-
MultiSelectStylerDirective
|
|
2432
|
+
MultiSelectStylerDirective,
|
|
2433
|
+
TimePickerModule
|
|
1765
2434
|
],
|
|
1766
2435
|
exports: [MultiFormComponent, DateTimePickerComponent]
|
|
1767
2436
|
}]
|
|
@@ -1815,7 +2484,7 @@ class GenericFilterModelComponent {
|
|
|
1815
2484
|
this.configurationService.openFilterModal.set(false);
|
|
1816
2485
|
}
|
|
1817
2486
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: GenericFilterModelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1818
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: GenericFilterModelComponent, isStandalone: true, selector: "prg-ws-generic-filter-model", inputs: { filterFormConfiguration: "filterFormConfiguration", tableName: "tableName" }, outputs: { sendFilteredData: "sendFilteredData" }, viewQueries: [{ propertyName: "filterFormComponent", first: true, predicate: ["filterFormComponent"], descendants: true }], ngImport: i0, template: "<!-- Filter Modal -->\n<c-modal id=\"generic-filter-modal\" [visible]=\"isFilterModalActive\" (visibleChange)=\"handleFilterModal($event)\" size=\"md\" alignment=\"center\" scrollable>\n <c-modal-header>\n <h5 cModalTitle>Advanced Search</h5>\n <!-- <button (click)=\"commonService.openFilterModal.set(false)\" cButtonClose></button> -->\n </c-modal-header>\n <c-modal-body>\n @if (filterFormConfiguration) {\n <app-multi-form [config]=\"filterFormConfiguration\" #filterFormComponent></app-multi-form>\n }\n </c-modal-body>\n <c-modal-footer>\n <button (click)=\"close()\" cButton color=\"secondary\">Close</button>\n <button (click)=\"resetFilter()\" cButton color=\"primary\">Reset</button>\n <button cButton color=\"primary\" (click)=\"onFilter()\">Search</button>\n </c-modal-footer>\n</c-modal>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MultiFormModule }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type:
|
|
2487
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: GenericFilterModelComponent, isStandalone: true, selector: "prg-ws-generic-filter-model", inputs: { filterFormConfiguration: "filterFormConfiguration", tableName: "tableName" }, outputs: { sendFilteredData: "sendFilteredData" }, viewQueries: [{ propertyName: "filterFormComponent", first: true, predicate: ["filterFormComponent"], descendants: true }], ngImport: i0, template: "<!-- Filter Modal -->\n<c-modal id=\"generic-filter-modal\" [visible]=\"isFilterModalActive\" (visibleChange)=\"handleFilterModal($event)\" size=\"md\" alignment=\"center\" scrollable>\n <c-modal-header>\n <h5 cModalTitle>Advanced Search</h5>\n <!-- <button (click)=\"commonService.openFilterModal.set(false)\" cButtonClose></button> -->\n </c-modal-header>\n <c-modal-body>\n @if (filterFormConfiguration) {\n <app-multi-form [config]=\"filterFormConfiguration\" #filterFormComponent></app-multi-form>\n }\n </c-modal-body>\n <c-modal-footer>\n <button (click)=\"close()\" cButton color=\"secondary\">Close</button>\n <button (click)=\"resetFilter()\" cButton color=\"primary\">Reset</button>\n <button cButton color=\"primary\" (click)=\"onFilter()\">Search</button>\n </c-modal-footer>\n</c-modal>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MultiFormModule }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i1.ModalBodyComponent, selector: "c-modal-body" }, { kind: "component", type: i1.ModalComponent, selector: "c-modal", inputs: ["alignment", "backdrop", "fullscreen", "keyboard", "id", "size", "transition", "role", "ariaModal", "scrollable", "visible"], outputs: ["visibleChange"], exportAs: ["cModal"] }, { kind: "component", type: i1.ModalFooterComponent, selector: "c-modal-footer" }, { kind: "component", type: i1.ModalHeaderComponent, selector: "c-modal-header" }, { kind: "directive", type: i1.ModalTitleDirective, selector: "[cModalTitle]" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }] });
|
|
1819
2488
|
}
|
|
1820
2489
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: GenericFilterModelComponent, decorators: [{
|
|
1821
2490
|
type: Component,
|
|
@@ -1837,6 +2506,7 @@ var FilterType;
|
|
|
1837
2506
|
FilterType["TEXT"] = "TEXT_FILTER";
|
|
1838
2507
|
FilterType["NUMBER"] = "NUMBER_FILTER";
|
|
1839
2508
|
FilterType["DATE"] = "DATE_FILTER";
|
|
2509
|
+
FilterType["DATE_RANGE"] = "DATE_RANGE_FILTER";
|
|
1840
2510
|
})(FilterType || (FilterType = {}));
|
|
1841
2511
|
// Built-in AG Grid filters
|
|
1842
2512
|
const AgGridFilters = {
|
|
@@ -1846,7 +2516,8 @@ const AgGridFilters = {
|
|
|
1846
2516
|
};
|
|
1847
2517
|
// Custom filters that can be used in the table grid
|
|
1848
2518
|
const TABLE_GRID_FILTER_COMPONENTS = {
|
|
1849
|
-
[FilterType.SELECT]: CustomSelectFilterComponent
|
|
2519
|
+
[FilterType.SELECT]: CustomSelectFilterComponent,
|
|
2520
|
+
[FilterType.DATE_RANGE]: AgDateRangeFilterComponent,
|
|
1850
2521
|
// Add others as needed
|
|
1851
2522
|
};
|
|
1852
2523
|
|
|
@@ -2251,7 +2922,7 @@ class TableGridComponent {
|
|
|
2251
2922
|
this.subscribeUntil$.complete();
|
|
2252
2923
|
}
|
|
2253
2924
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: TableGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2254
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: TableGridComponent, isStandalone: false, selector: "prg-ws-table-grid", inputs: { tableConfiguration: "tableConfiguration", columnToolVisible: "columnToolVisible", initialPageNumber: "initialPageNumber" }, outputs: { tableGridReady: "tableGridReady", tableRowSelection: "tableRowSelection", tableRowSelectionChanged: "tableRowSelectionChanged", tableRowClicked: "tableRowClicked", columnStateEvent: "columnStateEvent", pageChange: "pageChange", filterChanged: "filterChanged", cellValueChanged: "cellValueChanged" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"row\">\r\n <div class=\"col-12 d-md-flex\">\r\n <div class=\"table-list-wrapper flex-fill\">\r\n <!-- style=\"width: 100%; height: 567px\" -->\r\n <ag-grid-angular\r\n style=\"width: 100%\"\r\n [rowData]=\"tableConfiguration.rows\"\r\n [columnDefs]=\"tableConfiguration.columnDefs\"\r\n [defaultColDef]=\"tableConfiguration.defaultColDef\"\r\n [rowSelection]=\"tableConfiguration.rowSelectionOption\"\r\n [pagination]=\"tableConfiguration.pagination.enabled\"\r\n [paginationPageSize]=\"tableConfiguration.pagination.paginationPageSize\"\r\n [paginationPageSizeSelector]=\"tableConfiguration.pagination.paginationPageSizeSelector\"\r\n [class]=\"[tableConfiguration.tableClasses, tableConfiguration.tableTheme]\"\r\n [selectionColumnDef]=\"tableConfiguration.selectionColumnDef\"\r\n (gridReady)=\"onGridReady($event)\"\r\n (rowSelected)=\"onRowSelected($event)\"\r\n (rowClicked)=\"onRowClicked($event)\"\r\n (columnResized)=\"onColumnResized($event)\"\r\n (columnMoved)=\"onColumnMoved($event)\"\r\n (sortChanged)=\"onSortChanged($event)\"\r\n (paginationChanged)=\"onPaginationChanged($event)\"\r\n (firstDataRendered)=\"onFirstDataRendered($event)\"\r\n (filterChanged)=\"onFilterChanged($event)\"\r\n (cellValueChanged)=\"onCellValueChanged($event)\"\r\n (selectionChanged)=\"onRowSelectionChanged($event)\" \r\n [masterDetail]=\"tableConfiguration.masterDetail\"\r\n [detailCellRendererParams]=\"tableConfiguration.detailCellRendererParams\"\r\n [detailCellRenderer]=\"tableConfiguration.detailCellRenderer\"\r\n [enableCellTextSelection]=\"true\"\r\n [gridOptions]=\"gridOptions\"\r\n [ensureDomOrder]=\"true\"\r\n [tooltipShowDelay]=\"tableConfiguration.tooltipShowDelay\" />\r\n </div>\r\n\r\n @if (columnToolVisible && columnsListselectionForm) {\r\n <div class=\"columns-list ms-3 p-3 d-md-flex flex-column h-100 d-none border border-1 rounded hide columns-tool\" [id]=\"tableConfiguration.tablename\">\r\n <div class=\"d-flex justify-content-between align-items-center mb-3 gap-2 columns-heading\">\r\n <span\r\n class=\"cursor-pointer text-primary\"\r\n tooltipPlacement=\"top\"\r\n cTooltip=\"Column Preference\"\r\n [cOffcanvasToggle]=\"tableConfiguration.tablename + 'config-columns'\">\r\n <svg cIcon name=\"cilColumns\" size=\"xl\"></svg>\r\n </span>\r\n\r\n <span class=\"cursor-pointer text-primary\" tooltipPlacement=\"top\" cTooltip=\"Auto Resize Columns\" (click)=\"autoSizeAll()\">\r\n <svg cIcon name=\"cilResizeWidth\" size=\"xl\"></svg>\r\n </span>\r\n </div>\r\n </div>\r\n\r\n <c-offcanvas placement=\"end\" [id]=\"tableConfiguration.tablename + 'config-columns'\" width=\"550\">\r\n <c-offcanvas-header>\r\n <h5 cOffcanvasTitle>Table Column Preference</h5>\r\n <button\r\n cButtonClose\r\n size=\"sm\"\r\n class=\"text-reset ms-auto\"\r\n [cOffcanvasToggle]=\"tableConfiguration.tablename + 'config-columns'\"\r\n aria-label=\"Close\"></button>\r\n </c-offcanvas-header>\r\n <c-offcanvas-body>\r\n <div class=\"columns-wrapper mb-2\" [formGroup]=\"columnsListselectionForm\">\r\n @for (item of this.tableGridState; track $index) {\r\n <div class=\"checkbox-item px-1\">\r\n <c-form-check>\r\n <input\r\n (change)=\"getCheckboxStatus($event, item.key)\"\r\n [checked]=\"columnsListselectionForm.get(item.key)?.value\"\r\n cFormCheckInput\r\n [id]=\"'cb_' + item.key\"\r\n type=\"checkbox\"\r\n [formControl]=\"columnsListselectionForm.controls[item.key]\" />\r\n <label class=\"truncate-preference-label\" cFormCheckLabel [for]=\"'cb_' + item.key\" [title]=\"item?.headerName || item?.label\">\r\n {{ item?.headerName || item?.label }}</label\r\n >\r\n </c-form-check>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"align d-flex gap-3 justify-content-end\">\r\n <button\r\n cButton\r\n [disabled]=\"tableConfiguration.tablePreference.disableRemovecolumn\"\r\n color=\"primary\"\r\n class=\"px-2 mt-auto\"\r\n variant=\"outline\"\r\n (click)=\"resetTablePreferenceV2()\">\r\n Clear\r\n </button>\r\n <button\r\n cButton\r\n [disabled]=\"tableConfiguration.tablePreference.disableResetPreference\"\r\n color=\"primary\"\r\n class=\"px-2 mt-auto\"\r\n variant=\"outline\"\r\n (click)=\"resetTablePreference()\">\r\n Reset\r\n </button>\r\n <button\r\n cButton\r\n [disabled]=\"tableConfiguration.tablePreference.disableUpdatePreference\"\r\n color=\"primary\"\r\n class=\"px-2 mt-auto\"\r\n variant=\"outline\"\r\n (click)=\"updatetablePreference()\">\r\n Update\r\n </button>\r\n </div>\r\n </c-offcanvas-body>\r\n </c-offcanvas>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".offcanvas.offcanvas-end{--cui-offcanvas-width: 350px}.border{--cui-border-color: color-mix(in srgb, transparent, #181d1f 15%)}.columns-list{width:210px;transition:width .2s ease-in,padding .2s ease-in;overflow:hidden;display:flex;flex-direction:column;max-height:calc(100vh - 210px)}.default-ag-layout{height:calc(100vh - 210px)}.small-table-container{max-height:calc(100vh - 210px)}.columns-wrapper{flex-grow:1;overflow-y:auto;overflow-x:hidden;transition:opacity .2s ease-in,height .2s ease-in;opacity:1;height:calc(92vh - 93px);overflow:auto}.columns-tool.hide{width:32px;transition:width .2s ease-in,padding .2s ease-in}.columns-tool.hide button,.columns-tool.hide .columns-wrapper{opacity:0;height:0;pointer-events:none}.columns-tool.hide .columns-heading{flex-direction:column}.columns-tool.hide .columns-heading p{margin:50px 0 0;writing-mode:vertical-rl;text-orientation:mixed;letter-spacing:4px;font-size:.8rem;transition:margin .2s ease-in,font-size .2s ease-in}.columns-tool button{transform:scale(1);opacity:1;transition:opacity .2s ease-in,transform .1s ease-in;will-change:opacity,transform;height:40px}.columns-tool.hide button{opacity:0;transform:scale(.95)}.columns-heading{display:flex;justify-content:space-between;align-items:center;transition:flex-direction .2s ease-in}.columns-heading p{margin:0;font-size:1rem;text-align:center;letter-spacing:normal}.truncate-preference-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "component", type: i1.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "columnMenu", "suppressMenuHide", "enableBrowserTooltips", "tooltipTrigger", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "tooltipShowMode", "tooltipInteraction", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "suppressCutToClipboard", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "dataTypeDefinitions", "maintainColumnOrder", "enableStrictPivotColumnOrder", "suppressFieldDotNotation", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressMoveWhenColumnDragging", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "autoSizeStrategy", "components", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterNavigatesVertically", "enterNavigatesVerticallyAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "quickFilterText", "cacheQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "applyQuickFilterBeforePivotOrAgg", "excludeChildrenWhenTreeDataFiltering", "enableAdvancedFilter", "advancedFilterModel", "includeHiddenColumnsInAdvancedFilter", "advancedFilterParent", "advancedFilterBuilderParams", "suppressAdvancedFilterEval", "suppressSetFilterByDefault", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "chartToolPanelsDef", "chartMenuItems", "loadingCellRenderer", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "dragAndDropImageComponent", "dragAndDropImageComponentParams", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "loading", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationPageSizeSelector", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotMaxGeneratedColumns", "pivotDefaultExpanded", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "alwaysAggregateAtRootLevel", "aggregateOnlyChangedColumns", "suppressAggFilteredOnly", "removePivotHeaderRowWhenSingleValueColumn", "animateRows", "enableCellChangeFlash", "cellFlashDuration", "cellFlashDelay", "cellFadeDuration", "cellFadeDelay", "allowShowChangeAfterFilter", "domLayout", "ensureDomOrder", "enableRtl", "suppressColumnVirtualisation", "suppressMaxRenderedRowRestriction", "suppressRowVirtualisation", "rowDragManaged", "suppressRowDrag", "suppressMoveWhenRowDragging", "rowDragEntireRow", "rowDragMultiRow", "rowDragText", "fullWidthCellRenderer", "fullWidthCellRendererParams", "embedFullWidthRows", "suppressGroupMaintainValueType", "groupDisplayType", "groupDefaultExpanded", "autoGroupColumnDef", "groupMaintainOrder", "groupSelectsChildren", "groupLockGroupColumns", "groupAggFiltering", "groupIncludeFooter", "groupIncludeTotalFooter", "groupTotalRow", "grandTotalRow", "suppressStickyTotalRow", "groupSuppressBlankHeader", "groupSelectsFiltered", "showOpenedGroup", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupHideOpenParents", "groupAllowUnbalanced", "rowGroupPanelShow", "groupRowRenderer", "groupRowRendererParams", "suppressMakeColumnVisibleAfterUnGroup", "treeData", "rowGroupPanelSuppressSort", "suppressGroupRowsSticky", "pinnedTopRowData", "pinnedBottomRowData", "rowModelType", "rowData", "asyncTransactionWaitMillis", "suppressModelUpdateAfterUpdateTransaction", "datasource", "cacheOverflowSize", "infiniteInitialRowCount", "serverSideInitialRowCount", "suppressServerSideInfiniteScroll", "suppressServerSideFullWidthLoadingRow", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideEnableClientSideSort", "serverSideOnlyRefreshFilteredGroups", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSidePivotResultFieldSeparator", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "cellSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellFocus", "suppressHeaderFocus", "selectionColumnDef", "suppressMultiRangeSelection", "enableCellTextSelection", "enableRangeSelection", "enableRangeHandle", "enableFillHandle", "fillHandleDirection", "suppressClearOnFillReduction", "sortingOrder", "accentedSort", "unSortIcon", "suppressMultiSort", "alwaysMultiSort", "multiSortKey", "suppressMaintainUnsortedOrder", "icons", "rowHeight", "rowStyle", "rowClass", "rowClassRules", "suppressRowHoverHighlight", "suppressRowTransform", "columnHoverHighlight", "gridId", "deltaSort", "treeDataDisplayType", "enableGroupEdit", "initialState", "theme", "loadThemeGoogleFonts", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processUnpinnedColumns", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "focusGridInnerElement", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "getLocaleText", "getDocument", "paginationNumberFormatter", "getGroupRowAgg", "isGroupOpenByDefault", "initialGroupOrderComparator", "processPivotResultColDef", "processPivotResultColGroupDef", "getDataPath", "getChildCount", "getServerSideGroupLevelParams", "isServerSideGroupOpenByDefault", "isApplyServerSideTransaction", "isServerSideGroup", "getServerSideGroupKey", "getBusinessKeyForNode", "getRowId", "resetRowDataOnUpdate", "processRowPostCreate", "isRowSelectable", "isRowMaster", "fillOperation", "postSortRows", "getRowStyle", "getRowClass", "getRowHeight", "isFullWidthRow"], outputs: ["toolPanelVisibleChanged", "toolPanelSizeChanged", "columnMenuVisibleChanged", "contextMenuVisibleChanged", "cutStart", "cutEnd", "pasteStart", "pasteEnd", "columnVisible", "columnPinned", "columnResized", "columnMoved", "columnValueChanged", "columnPivotModeChanged", "columnPivotChanged", "columnGroupOpened", "newColumnsLoaded", "gridColumnsChanged", "displayedColumnsChanged", "virtualColumnsChanged", "columnEverythingChanged", "columnHeaderMouseOver", "columnHeaderMouseLeave", "columnHeaderClicked", "columnHeaderContextMenu", "componentStateChanged", "cellValueChanged", "cellEditRequest", "rowValueChanged", "cellEditingStarted", "cellEditingStopped", "rowEditingStarted", "rowEditingStopped", "undoStarted", "undoEnded", "redoStarted", "redoEnded", "cellSelectionDeleteStart", "cellSelectionDeleteEnd", "rangeDeleteStart", "rangeDeleteEnd", "fillStart", "fillEnd", "filterOpened", "filterChanged", "filterModified", "advancedFilterBuilderVisibleChanged", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "gridReady", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "dragCancelled", "stateUpdated", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "rowDragCancel", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pivotMaxColumnsExceeded", "pinnedRowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "storeRefreshed", "headerFocused", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "cellSelectionChanged", "tooltipShow", "tooltipHide", "sortChanged"] }, { kind: "component", type: i4.FormCheckComponent, selector: "c-form-check", inputs: ["inline", "reverse", "sizing", "switch"], exportAs: ["cFormCheck"] }, { kind: "directive", type: i4.FormCheckLabelDirective, selector: "label[cFormCheckLabel]" }, { kind: "directive", type: i4.FormCheckInputDirective, selector: "input[cFormCheckInput]", inputs: ["type", "indeterminate", "valid"] }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }, { kind: "directive", type: i4.ButtonCloseDirective, selector: "[cButtonClose]", inputs: ["white"] }, { kind: "component", type: i4.OffcanvasBodyComponent, selector: "c-offcanvas-body" }, { kind: "component", type: i4.OffcanvasComponent, selector: "c-offcanvas", inputs: ["backdrop", "keyboard", "placement", "responsive", "id", "role", "ariaModal", "scroll", "visible"], outputs: ["visibleChange"], exportAs: ["cOffcanvas"] }, { kind: "component", type: i4.OffcanvasHeaderComponent, selector: "c-offcanvas-header" }, { kind: "directive", type: i4.OffcanvasTitleDirective, selector: "[cOffcanvasTitle]" }, { kind: "directive", type: i4.OffcanvasToggleDirective, selector: "[cOffcanvasToggle]", inputs: ["cOffcanvasToggle"] }, { kind: "directive", type: i4.TooltipDirective, selector: "[cTooltip]", inputs: ["cTooltip", "cTooltipOptions", "cTooltipPlacement", "cTooltipRef", "cTooltipTrigger", "cTooltipVisible"], outputs: ["cTooltipVisibleChange"], exportAs: ["cTooltip"] }, { kind: "directive", type: i5.IconDirective, selector: "svg[cIcon]", inputs: ["cIcon", "customClasses", "size", "title", "height", "width", "name", "viewBox", "xmlns", "pointer-events", "role"], exportAs: ["cIcon"] }] });
|
|
2925
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: TableGridComponent, isStandalone: false, selector: "prg-ws-table-grid", inputs: { tableConfiguration: "tableConfiguration", columnToolVisible: "columnToolVisible", initialPageNumber: "initialPageNumber" }, outputs: { tableGridReady: "tableGridReady", tableRowSelection: "tableRowSelection", tableRowSelectionChanged: "tableRowSelectionChanged", tableRowClicked: "tableRowClicked", columnStateEvent: "columnStateEvent", pageChange: "pageChange", filterChanged: "filterChanged", cellValueChanged: "cellValueChanged" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"row\">\r\n <div class=\"col-12 d-md-flex\">\r\n <div class=\"table-list-wrapper flex-fill\">\r\n <!-- style=\"width: 100%; height: 567px\" -->\r\n <ag-grid-angular\r\n style=\"width: 100%\"\r\n [rowData]=\"tableConfiguration.rows\"\r\n [columnDefs]=\"tableConfiguration.columnDefs\"\r\n [defaultColDef]=\"tableConfiguration.defaultColDef\"\r\n [rowSelection]=\"tableConfiguration.rowSelectionOption\"\r\n [pagination]=\"tableConfiguration.pagination.enabled\"\r\n [paginationPageSize]=\"tableConfiguration.pagination.paginationPageSize\"\r\n [paginationPageSizeSelector]=\"tableConfiguration.pagination.paginationPageSizeSelector\"\r\n [class]=\"[tableConfiguration.tableClasses, tableConfiguration.tableTheme]\"\r\n [selectionColumnDef]=\"tableConfiguration.selectionColumnDef\"\r\n (gridReady)=\"onGridReady($event)\"\r\n (rowSelected)=\"onRowSelected($event)\"\r\n (rowClicked)=\"onRowClicked($event)\"\r\n (columnResized)=\"onColumnResized($event)\"\r\n (columnMoved)=\"onColumnMoved($event)\"\r\n (sortChanged)=\"onSortChanged($event)\"\r\n (paginationChanged)=\"onPaginationChanged($event)\"\r\n (firstDataRendered)=\"onFirstDataRendered($event)\"\r\n (filterChanged)=\"onFilterChanged($event)\"\r\n (cellValueChanged)=\"onCellValueChanged($event)\"\r\n (selectionChanged)=\"onRowSelectionChanged($event)\" \r\n [masterDetail]=\"tableConfiguration.masterDetail\"\r\n [detailCellRendererParams]=\"tableConfiguration.detailCellRendererParams\"\r\n [detailCellRenderer]=\"tableConfiguration.detailCellRenderer\"\r\n [enableCellTextSelection]=\"true\"\r\n [gridOptions]=\"gridOptions\"\r\n [ensureDomOrder]=\"true\"\r\n [tooltipShowDelay]=\"tableConfiguration.tooltipShowDelay\" />\r\n </div>\r\n\r\n @if (columnToolVisible && columnsListselectionForm) {\r\n <div class=\"columns-list ms-3 p-3 d-md-flex flex-column h-100 d-none border border-1 rounded hide columns-tool\" [id]=\"tableConfiguration.tablename\">\r\n <div class=\"d-flex justify-content-between align-items-center mb-3 gap-2 columns-heading\">\r\n <span\r\n class=\"cursor-pointer text-primary\"\r\n tooltipPlacement=\"top\"\r\n cTooltip=\"Column Preference\"\r\n [cOffcanvasToggle]=\"tableConfiguration.tablename + 'config-columns'\">\r\n <svg cIcon name=\"cilColumns\" size=\"xl\"></svg>\r\n </span>\r\n\r\n <span class=\"cursor-pointer text-primary\" tooltipPlacement=\"top\" cTooltip=\"Auto Resize Columns\" (click)=\"autoSizeAll()\">\r\n <svg cIcon name=\"cilResizeWidth\" size=\"xl\"></svg>\r\n </span>\r\n </div>\r\n </div>\r\n\r\n <c-offcanvas placement=\"end\" [id]=\"tableConfiguration.tablename + 'config-columns'\" width=\"550\">\r\n <c-offcanvas-header>\r\n <h5 cOffcanvasTitle>Table Column Preference</h5>\r\n <button\r\n cButtonClose\r\n size=\"sm\"\r\n class=\"text-reset ms-auto\"\r\n [cOffcanvasToggle]=\"tableConfiguration.tablename + 'config-columns'\"\r\n aria-label=\"Close\"></button>\r\n </c-offcanvas-header>\r\n <c-offcanvas-body>\r\n <div class=\"columns-wrapper mb-2\" [formGroup]=\"columnsListselectionForm\">\r\n @for (item of this.tableGridState; track $index) {\r\n <div class=\"checkbox-item px-1\">\r\n <c-form-check>\r\n <input\r\n (change)=\"getCheckboxStatus($event, item.key)\"\r\n [checked]=\"columnsListselectionForm.get(item.key)?.value\"\r\n cFormCheckInput\r\n [id]=\"'cb_' + item.key\"\r\n type=\"checkbox\"\r\n [formControl]=\"columnsListselectionForm.controls[item.key]\" />\r\n <label class=\"truncate-preference-label\" cFormCheckLabel [for]=\"'cb_' + item.key\" [title]=\"item?.headerName || item?.label\">\r\n {{ item?.headerName || item?.label }}</label\r\n >\r\n </c-form-check>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"align d-flex gap-3 justify-content-end\">\r\n <button\r\n cButton\r\n [disabled]=\"tableConfiguration.tablePreference.disableRemovecolumn\"\r\n color=\"primary\"\r\n class=\"px-2 mt-auto\"\r\n variant=\"outline\"\r\n (click)=\"resetTablePreferenceV2()\">\r\n Clear\r\n </button>\r\n <button\r\n cButton\r\n [disabled]=\"tableConfiguration.tablePreference.disableResetPreference\"\r\n color=\"primary\"\r\n class=\"px-2 mt-auto\"\r\n variant=\"outline\"\r\n (click)=\"resetTablePreference()\">\r\n Reset\r\n </button>\r\n <button\r\n cButton\r\n [disabled]=\"tableConfiguration.tablePreference.disableUpdatePreference\"\r\n color=\"primary\"\r\n class=\"px-2 mt-auto\"\r\n variant=\"outline\"\r\n (click)=\"updatetablePreference()\">\r\n Update\r\n </button>\r\n </div>\r\n </c-offcanvas-body>\r\n </c-offcanvas>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".offcanvas.offcanvas-end{--cui-offcanvas-width: 350px}.border{--cui-border-color: color-mix(in srgb, transparent, #181d1f 15%)}.columns-list{width:210px;transition:width .2s ease-in,padding .2s ease-in;overflow:hidden;display:flex;flex-direction:column;max-height:calc(100vh - 210px)}.default-ag-layout{height:calc(100vh - 210px)}.small-table-container{max-height:calc(100vh - 210px)}.columns-wrapper{flex-grow:1;overflow-y:auto;overflow-x:hidden;transition:opacity .2s ease-in,height .2s ease-in;opacity:1;height:calc(92vh - 93px);overflow:auto}.columns-tool.hide{width:32px;transition:width .2s ease-in,padding .2s ease-in}.columns-tool.hide button,.columns-tool.hide .columns-wrapper{opacity:0;height:0;pointer-events:none}.columns-tool.hide .columns-heading{flex-direction:column}.columns-tool.hide .columns-heading p{margin:50px 0 0;writing-mode:vertical-rl;text-orientation:mixed;letter-spacing:4px;font-size:.8rem;transition:margin .2s ease-in,font-size .2s ease-in}.columns-tool button{transform:scale(1);opacity:1;transition:opacity .2s ease-in,transform .1s ease-in;will-change:opacity,transform;height:40px}.columns-tool.hide button{opacity:0;transform:scale(.95)}.columns-heading{display:flex;justify-content:space-between;align-items:center;transition:flex-direction .2s ease-in}.columns-heading p{margin:0;font-size:1rem;text-align:center;letter-spacing:normal}.truncate-preference-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "component", type: i1$2.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "columnMenu", "suppressMenuHide", "enableBrowserTooltips", "tooltipTrigger", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "tooltipShowMode", "tooltipInteraction", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "suppressCutToClipboard", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "dataTypeDefinitions", "maintainColumnOrder", "enableStrictPivotColumnOrder", "suppressFieldDotNotation", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressMoveWhenColumnDragging", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "autoSizeStrategy", "components", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterNavigatesVertically", "enterNavigatesVerticallyAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "quickFilterText", "cacheQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "applyQuickFilterBeforePivotOrAgg", "excludeChildrenWhenTreeDataFiltering", "enableAdvancedFilter", "advancedFilterModel", "includeHiddenColumnsInAdvancedFilter", "advancedFilterParent", "advancedFilterBuilderParams", "suppressAdvancedFilterEval", "suppressSetFilterByDefault", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "chartToolPanelsDef", "chartMenuItems", "loadingCellRenderer", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "dragAndDropImageComponent", "dragAndDropImageComponentParams", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "loading", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationPageSizeSelector", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotMaxGeneratedColumns", "pivotDefaultExpanded", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "alwaysAggregateAtRootLevel", "aggregateOnlyChangedColumns", "suppressAggFilteredOnly", "removePivotHeaderRowWhenSingleValueColumn", "animateRows", "enableCellChangeFlash", "cellFlashDuration", "cellFlashDelay", "cellFadeDuration", "cellFadeDelay", "allowShowChangeAfterFilter", "domLayout", "ensureDomOrder", "enableRtl", "suppressColumnVirtualisation", "suppressMaxRenderedRowRestriction", "suppressRowVirtualisation", "rowDragManaged", "suppressRowDrag", "suppressMoveWhenRowDragging", "rowDragEntireRow", "rowDragMultiRow", "rowDragText", "fullWidthCellRenderer", "fullWidthCellRendererParams", "embedFullWidthRows", "suppressGroupMaintainValueType", "groupDisplayType", "groupDefaultExpanded", "autoGroupColumnDef", "groupMaintainOrder", "groupSelectsChildren", "groupLockGroupColumns", "groupAggFiltering", "groupIncludeFooter", "groupIncludeTotalFooter", "groupTotalRow", "grandTotalRow", "suppressStickyTotalRow", "groupSuppressBlankHeader", "groupSelectsFiltered", "showOpenedGroup", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupHideOpenParents", "groupAllowUnbalanced", "rowGroupPanelShow", "groupRowRenderer", "groupRowRendererParams", "suppressMakeColumnVisibleAfterUnGroup", "treeData", "rowGroupPanelSuppressSort", "suppressGroupRowsSticky", "pinnedTopRowData", "pinnedBottomRowData", "rowModelType", "rowData", "asyncTransactionWaitMillis", "suppressModelUpdateAfterUpdateTransaction", "datasource", "cacheOverflowSize", "infiniteInitialRowCount", "serverSideInitialRowCount", "suppressServerSideInfiniteScroll", "suppressServerSideFullWidthLoadingRow", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideEnableClientSideSort", "serverSideOnlyRefreshFilteredGroups", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSidePivotResultFieldSeparator", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "cellSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellFocus", "suppressHeaderFocus", "selectionColumnDef", "suppressMultiRangeSelection", "enableCellTextSelection", "enableRangeSelection", "enableRangeHandle", "enableFillHandle", "fillHandleDirection", "suppressClearOnFillReduction", "sortingOrder", "accentedSort", "unSortIcon", "suppressMultiSort", "alwaysMultiSort", "multiSortKey", "suppressMaintainUnsortedOrder", "icons", "rowHeight", "rowStyle", "rowClass", "rowClassRules", "suppressRowHoverHighlight", "suppressRowTransform", "columnHoverHighlight", "gridId", "deltaSort", "treeDataDisplayType", "enableGroupEdit", "initialState", "theme", "loadThemeGoogleFonts", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processUnpinnedColumns", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "focusGridInnerElement", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "getLocaleText", "getDocument", "paginationNumberFormatter", "getGroupRowAgg", "isGroupOpenByDefault", "initialGroupOrderComparator", "processPivotResultColDef", "processPivotResultColGroupDef", "getDataPath", "getChildCount", "getServerSideGroupLevelParams", "isServerSideGroupOpenByDefault", "isApplyServerSideTransaction", "isServerSideGroup", "getServerSideGroupKey", "getBusinessKeyForNode", "getRowId", "resetRowDataOnUpdate", "processRowPostCreate", "isRowSelectable", "isRowMaster", "fillOperation", "postSortRows", "getRowStyle", "getRowClass", "getRowHeight", "isFullWidthRow"], outputs: ["toolPanelVisibleChanged", "toolPanelSizeChanged", "columnMenuVisibleChanged", "contextMenuVisibleChanged", "cutStart", "cutEnd", "pasteStart", "pasteEnd", "columnVisible", "columnPinned", "columnResized", "columnMoved", "columnValueChanged", "columnPivotModeChanged", "columnPivotChanged", "columnGroupOpened", "newColumnsLoaded", "gridColumnsChanged", "displayedColumnsChanged", "virtualColumnsChanged", "columnEverythingChanged", "columnHeaderMouseOver", "columnHeaderMouseLeave", "columnHeaderClicked", "columnHeaderContextMenu", "componentStateChanged", "cellValueChanged", "cellEditRequest", "rowValueChanged", "cellEditingStarted", "cellEditingStopped", "rowEditingStarted", "rowEditingStopped", "undoStarted", "undoEnded", "redoStarted", "redoEnded", "cellSelectionDeleteStart", "cellSelectionDeleteEnd", "rangeDeleteStart", "rangeDeleteEnd", "fillStart", "fillEnd", "filterOpened", "filterChanged", "filterModified", "advancedFilterBuilderVisibleChanged", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "gridReady", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "dragCancelled", "stateUpdated", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "rowDragCancel", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pivotMaxColumnsExceeded", "pinnedRowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "storeRefreshed", "headerFocused", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "cellSelectionChanged", "tooltipShow", "tooltipHide", "sortChanged"] }, { kind: "component", type: i1.FormCheckComponent, selector: "c-form-check", inputs: ["inline", "reverse", "sizing", "switch"], exportAs: ["cFormCheck"] }, { kind: "directive", type: i1.FormCheckLabelDirective, selector: "label[cFormCheckLabel]" }, { kind: "directive", type: i1.FormCheckInputDirective, selector: "input[cFormCheckInput]", inputs: ["type", "indeterminate", "valid"] }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }, { kind: "directive", type: i1.ButtonCloseDirective, selector: "[cButtonClose]", inputs: ["white"] }, { kind: "component", type: i1.OffcanvasBodyComponent, selector: "c-offcanvas-body" }, { kind: "component", type: i1.OffcanvasComponent, selector: "c-offcanvas", inputs: ["backdrop", "keyboard", "placement", "responsive", "id", "role", "ariaModal", "scroll", "visible"], outputs: ["visibleChange"], exportAs: ["cOffcanvas"] }, { kind: "component", type: i1.OffcanvasHeaderComponent, selector: "c-offcanvas-header" }, { kind: "directive", type: i1.OffcanvasTitleDirective, selector: "[cOffcanvasTitle]" }, { kind: "directive", type: i1.OffcanvasToggleDirective, selector: "[cOffcanvasToggle]", inputs: ["cOffcanvasToggle"] }, { kind: "directive", type: i1.TooltipDirective, selector: "[cTooltip]", inputs: ["cTooltip", "cTooltipOptions", "cTooltipPlacement", "cTooltipRef", "cTooltipTrigger", "cTooltipVisible"], outputs: ["cTooltipVisibleChange"], exportAs: ["cTooltip"] }, { kind: "directive", type: i1$1.IconDirective, selector: "svg[cIcon]", inputs: ["cIcon", "customClasses", "size", "title", "height", "width", "name", "viewBox", "xmlns", "pointer-events", "role"], exportAs: ["cIcon"] }] });
|
|
2255
2926
|
}
|
|
2256
2927
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: TableGridComponent, decorators: [{
|
|
2257
2928
|
type: Component,
|
|
@@ -2717,7 +3388,7 @@ class LoginComponent {
|
|
|
2717
3388
|
// }
|
|
2718
3389
|
}
|
|
2719
3390
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: LoginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2720
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: LoginComponent, isStandalone: false, selector: "prg-ws-login", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, showInactivityLogoutMessage: { classPropertyName: "showInactivityLogoutMessage", publicName: "showInactivityLogoutMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action" }, ngImport: i0, template: "<div\r\n class=\"container-fluid login-wrapper\"\r\n wsBackgroundImage\r\n [random]=\"config()?.backgroundDirective?.random\"\r\n [backgroundImage]=\"config()?.backgroundDirective?.backgroundImages\">\r\n <div class=\"row align-items-center justify-content-center vh-100\">\r\n <div class=\"col-xxl-3 col-xl-4 col-lg-6 col-12 login-fields glass-card\">\r\n <div class=\"logo-wrapper max-w-300 text-center mt-4 mx-5\">\r\n <img [src]=\"config()?.logoUrl\" alt=\"pongrass-logo\" class=\"img-fluid max-w-320\" />\r\n <p class=\"fs-19 login-card-title mb-4 \">{{ config()?.title }}</p>\r\n </div>\r\n <div class=\"mb-4 d-flex align-items-center justify-content-center flex-column\">\r\n @if (showInactivityLogoutMessage()) {\r\n <c-alert ngClass=\"mb-4\" color=\"danger\" class=\"text-center\">You have been logged out due to inactivity!</c-alert>\r\n }\r\n <form cForm [formGroup]=\"loginForm\" class=\"needs-validation max-w-300\" [validated]=\"isFormSubmitted()\" noValidate (ngSubmit)=\"onSubmit()\">\r\n <div class=\"mb-4\">\r\n <c-input-group class=\"mb-3\">\r\n <span cInputGroupText id=\"group-username-login\" class=\"transparent-input\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\" style=\"width: 15px\">\r\n <path\r\n d=\"M224 248a120 120 0 1 0 0-240 120 120 0 1 0 0 240zm-29.7 56C95.8 304 16 383.8 16 482.3 16 498.7 29.3 512 45.7 512l356.6 0c16.4 0 29.7-13.3 29.7-29.7 0-98.5-79.8-178.3-178.3-178.3l-59.4 0z\" />\r\n </svg>\r\n </span>\r\n\r\n <input\r\n cFormControl\r\n id=\"txt-auth-username\"\r\n type=\"text\"\r\n sizing=\"lg\"\r\n formControlName=\"uid\"\r\n required\r\n autocomplete=\"username\"\r\n class=\"transparent-input text-white\"\r\n [placeholder]=\"config()?.usernamePlaceholder\" />\r\n <c-form-feedback [valid]=\"false\">User Name is required.</c-form-feedback>\r\n </c-input-group>\r\n </div>\r\n <div class=\"mb-4\">\r\n <c-input-group class=\"mb-3\">\r\n <span cInputGroupText id=\"group-password-login\" class=\"transparent-input\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\" style=\"width: 15px\">\r\n <path\r\n d=\"M128 96l0 64 128 0 0-64c0-35.3-28.7-64-64-64s-64 28.7-64 64zM64 160l0-64C64 25.3 121.3-32 192-32S320 25.3 320 96l0 64c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64z\" />\r\n </svg>\r\n </span>\r\n <input \r\n cFormControl\r\n id=\"txt-auth-password\"\r\n type=\"password\"\r\n sizing=\"lg\"\r\n formControlName=\"pwd\"\r\n required\r\n autocomplete=\"current-password\"\r\n class=\"transparent-input text-white\"\r\n [placeholder]=\"config()?.passwordPlaceholder\" />\r\n\r\n <c-form-feedback [valid]=\"false\">Password is required.</c-form-feedback>\r\n </c-input-group>\r\n </div>\r\n\r\n <div class=\"submit-form mt-4\">\r\n <button type=\"submit\" cButton color=\"dark\" size=\"lg\" class=\"w-100 btn text-white fw-semibold\">\r\n {{ config()?.submitButtonText }}\r\n </button>\r\n </div>\r\n @if (config()?.version) {\r\n @if (config()?.version?.currentVersion) {\r\n <div class=\"mt-4 text-center pt-8\">{{ 'v' + config()?.version?.currentVersion || '' }}</div>\r\n }\r\n @if (config()?.version?.copyrightYear) {\r\n <div class=\"mt-2 text-center copyright-text pt-8\">\r\n {{ '©' + config()?.version?.copyrightYear + ' ' + config()?.version?.brandName }}\r\n </div>\r\n }\r\n } @else {\r\n @if (configService.allConfigValues()?.project?.currentVersion) {\r\n <div class=\"mt-4 text-center pt-8\">{{ 'v' + configService.allConfigValues()?.project?.currentVersion || '' }}</div>\r\n }\r\n @if (configService.allConfigValues()?.project?.copyrightYear) {\r\n <div class=\"mt-2 text-center copyright-text pt-8\">\r\n {{ '©' + configService.allConfigValues()?.project?.copyrightYear + ' ' + configService.allConfigValues()?.project?.brandName }}\r\n </div>\r\n }\r\n }\r\n </form>\r\n\r\n @if (contactSupportValue) {\r\n <div class=\"mt-4 fs-5\">\r\n Don't have an account?\r\n <span class=\"cursor-pointer\">\r\n <a [href]=\"contactSupportValue\" class=\"text-decoration-none primary-text\" id=\"contact-us\">Contact Support</a>\r\n </span>\r\n </div>\r\n }\r\n\r\n <!-- <div class=\"mt-4 fs-5 text-center\">\r\n <span class=\"cursor-pointer\">\r\n <a [href]=\"forgetPasswordValue\" class=\"text-decoration-none primary-text\" id=\"forget-password\">Forget Password?</a>\r\n <a class=\"text-decoration-none text-white\" id=\"forget-password\" (click)=\"goToForgetPassword()\">Forget Password?</a>\r\n </span>\r\n </div> -->\r\n\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["#txt-auth-password,#txt-auth-username{border-bottom-right-radius:4px;border-top-right-radius:4px}.max-w-300{width:300px}.pt-8{font-size:10.66px}.login-card-title{color:#fff;font-size:24px}.form-invalid .form-multi-select-input-group,.form-invalid .date-picker-input-group{border:2px solid #e55353}.glass-card{color:#fff;background:#32241980;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);border-radius:var(--cui-border-radius-lg);position:relative;overflow:hidden;max-width:400px;display:flex;align-items:center;flex-direction:column}.glass-card:before{content:\"\";position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.8),transparent)}.glass-card:after{content:\"\";position:absolute;top:0;left:0;width:1px;height:100%;background:linear-gradient(180deg,rgba(255,255,255,.8),transparent,rgba(255,255,255,.3))}.transparent-input{background-color:transparent;border:1px solid #8a9db2;outline:none}.transparent-input:focus{background-color:transparent}.transparent-input::placeholder{color:#8a9db2;font-size:16px}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active,input:-internal-autofill-selected{-webkit-box-shadow:0 0 0 1000px transparent inset!important;box-shadow:0 0 0 1000px transparent inset!important;background-color:transparent!important;background-image:none!important;-webkit-text-fill-color:#fff!important;transition:background-color 5000s ease-in-out 0s!important}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: BackgroundImageDirective, selector: "[wsBackgroundImage]", inputs: ["random", "backgroundImage"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.FormDirective, selector: "form[cForm]", inputs: ["validated"] }, { kind: "directive", type: i4.FormControlDirective, selector: "input[cFormControl], textarea[cFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }, { kind: "component", type: i4.FormFeedbackComponent, selector: "c-form-feedback", inputs: ["tooltip", "valid"] }, { kind: "component", type: i4.InputGroupComponent, selector: "c-input-group", inputs: ["sizing"] }, { kind: "directive", type: i4.InputGroupTextDirective, selector: "[cInputGroupText]" }, { kind: "directive", type: i4.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }, { kind: "component", type: i4.AlertComponent, selector: "c-alert", inputs: ["color", "role", "variant", "dismissible", "fade", "visible"], outputs: ["visibleChange"], exportAs: ["cAlert"] }] });
|
|
3391
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: LoginComponent, isStandalone: false, selector: "prg-ws-login", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, showInactivityLogoutMessage: { classPropertyName: "showInactivityLogoutMessage", publicName: "showInactivityLogoutMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action" }, ngImport: i0, template: "<div\r\n class=\"container-fluid login-wrapper\"\r\n wsBackgroundImage\r\n [random]=\"config()?.backgroundDirective?.random\"\r\n [backgroundImage]=\"config()?.backgroundDirective?.backgroundImages\">\r\n <div class=\"row align-items-center justify-content-center vh-100\">\r\n <div class=\"col-xxl-3 col-xl-4 col-lg-6 col-12 login-fields glass-card\">\r\n <div class=\"logo-wrapper max-w-300 text-center mt-4 mx-5\">\r\n <img [src]=\"config()?.logoUrl\" alt=\"pongrass-logo\" class=\"img-fluid max-w-320\" />\r\n <p class=\"fs-19 login-card-title mb-4 \">{{ config()?.title }}</p>\r\n </div>\r\n <div class=\"mb-4 d-flex align-items-center justify-content-center flex-column\">\r\n @if (showInactivityLogoutMessage()) {\r\n <c-alert ngClass=\"mb-4\" color=\"danger\" class=\"text-center\">You have been logged out due to inactivity!</c-alert>\r\n }\r\n <form cForm [formGroup]=\"loginForm\" class=\"needs-validation max-w-300\" [validated]=\"isFormSubmitted()\" noValidate (ngSubmit)=\"onSubmit()\">\r\n <div class=\"mb-4\">\r\n <c-input-group class=\"mb-3\">\r\n <span cInputGroupText id=\"group-username-login\" class=\"transparent-input\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\" style=\"width: 15px\">\r\n <path\r\n d=\"M224 248a120 120 0 1 0 0-240 120 120 0 1 0 0 240zm-29.7 56C95.8 304 16 383.8 16 482.3 16 498.7 29.3 512 45.7 512l356.6 0c16.4 0 29.7-13.3 29.7-29.7 0-98.5-79.8-178.3-178.3-178.3l-59.4 0z\" />\r\n </svg>\r\n </span>\r\n\r\n <input\r\n cFormControl\r\n id=\"txt-auth-username\"\r\n type=\"text\"\r\n sizing=\"lg\"\r\n formControlName=\"uid\"\r\n required\r\n autocomplete=\"username\"\r\n class=\"transparent-input text-white\"\r\n [placeholder]=\"config()?.usernamePlaceholder\" />\r\n <c-form-feedback [valid]=\"false\">User Name is required.</c-form-feedback>\r\n </c-input-group>\r\n </div>\r\n <div class=\"mb-4\">\r\n <c-input-group class=\"mb-3\">\r\n <span cInputGroupText id=\"group-password-login\" class=\"transparent-input\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\" style=\"width: 15px\">\r\n <path\r\n d=\"M128 96l0 64 128 0 0-64c0-35.3-28.7-64-64-64s-64 28.7-64 64zM64 160l0-64C64 25.3 121.3-32 192-32S320 25.3 320 96l0 64c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64z\" />\r\n </svg>\r\n </span>\r\n <input \r\n cFormControl\r\n id=\"txt-auth-password\"\r\n type=\"password\"\r\n sizing=\"lg\"\r\n formControlName=\"pwd\"\r\n required\r\n autocomplete=\"current-password\"\r\n class=\"transparent-input text-white\"\r\n [placeholder]=\"config()?.passwordPlaceholder\" />\r\n\r\n <c-form-feedback [valid]=\"false\">Password is required.</c-form-feedback>\r\n </c-input-group>\r\n </div>\r\n\r\n <div class=\"submit-form mt-4\">\r\n <button type=\"submit\" cButton color=\"dark\" size=\"lg\" class=\"w-100 btn text-white fw-semibold\">\r\n {{ config()?.submitButtonText }}\r\n </button>\r\n </div>\r\n @if (config()?.version) {\r\n @if (config()?.version?.currentVersion) {\r\n <div class=\"mt-4 text-center pt-8\">{{ 'v' + config()?.version?.currentVersion || '' }}</div>\r\n }\r\n @if (config()?.version?.copyrightYear) {\r\n <div class=\"mt-2 text-center copyright-text pt-8\">\r\n {{ '©' + config()?.version?.copyrightYear + ' ' + config()?.version?.brandName }}\r\n </div>\r\n }\r\n } @else {\r\n @if (configService.allConfigValues()?.project?.currentVersion) {\r\n <div class=\"mt-4 text-center pt-8\">{{ 'v' + configService.allConfigValues()?.project?.currentVersion || '' }}</div>\r\n }\r\n @if (configService.allConfigValues()?.project?.copyrightYear) {\r\n <div class=\"mt-2 text-center copyright-text pt-8\">\r\n {{ '©' + configService.allConfigValues()?.project?.copyrightYear + ' ' + configService.allConfigValues()?.project?.brandName }}\r\n </div>\r\n }\r\n }\r\n </form>\r\n\r\n @if (contactSupportValue) {\r\n <div class=\"mt-4 fs-5\">\r\n Don't have an account?\r\n <span class=\"cursor-pointer\">\r\n <a [href]=\"contactSupportValue\" class=\"text-decoration-none primary-text\" id=\"contact-us\">Contact Support</a>\r\n </span>\r\n </div>\r\n }\r\n\r\n <!-- <div class=\"mt-4 fs-5 text-center\">\r\n <span class=\"cursor-pointer\">\r\n <a [href]=\"forgetPasswordValue\" class=\"text-decoration-none primary-text\" id=\"forget-password\">Forget Password?</a>\r\n <a class=\"text-decoration-none text-white\" id=\"forget-password\" (click)=\"goToForgetPassword()\">Forget Password?</a>\r\n </span>\r\n </div> -->\r\n\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["#txt-auth-password,#txt-auth-username{border-bottom-right-radius:4px;border-top-right-radius:4px}.max-w-300{width:300px}.pt-8{font-size:10.66px}.login-card-title{color:#fff;font-size:24px}.form-invalid .form-multi-select-input-group,.form-invalid .date-picker-input-group{border:2px solid #e55353}.glass-card{color:#fff;background:#32241980;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);border-radius:var(--cui-border-radius-lg);position:relative;overflow:hidden;max-width:400px;display:flex;align-items:center;flex-direction:column}.glass-card:before{content:\"\";position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.8),transparent)}.glass-card:after{content:\"\";position:absolute;top:0;left:0;width:1px;height:100%;background:linear-gradient(180deg,rgba(255,255,255,.8),transparent,rgba(255,255,255,.3))}.transparent-input{background-color:transparent;border:1px solid #8a9db2;outline:none}.transparent-input:focus{background-color:transparent}.transparent-input::placeholder{color:#8a9db2;font-size:16px}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active,input:-internal-autofill-selected{-webkit-box-shadow:0 0 0 1000px transparent inset!important;box-shadow:0 0 0 1000px transparent inset!important;background-color:transparent!important;background-image:none!important;-webkit-text-fill-color:#fff!important;transition:background-color 5000s ease-in-out 0s!important}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: BackgroundImageDirective, selector: "[wsBackgroundImage]", inputs: ["random", "backgroundImage"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormDirective, selector: "form[cForm]", inputs: ["validated"] }, { kind: "directive", type: i1.FormControlDirective, selector: "input[cFormControl], textarea[cFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }, { kind: "component", type: i1.FormFeedbackComponent, selector: "c-form-feedback", inputs: ["tooltip", "valid"] }, { kind: "component", type: i1.InputGroupComponent, selector: "c-input-group", inputs: ["sizing"] }, { kind: "directive", type: i1.InputGroupTextDirective, selector: "[cInputGroupText]" }, { kind: "directive", type: i1.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }, { kind: "component", type: i1.AlertComponent, selector: "c-alert", inputs: ["color", "role", "variant", "dismissible", "fade", "visible"], outputs: ["visibleChange"], exportAs: ["cAlert"] }] });
|
|
2721
3392
|
}
|
|
2722
3393
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: LoginComponent, decorators: [{
|
|
2723
3394
|
type: Component,
|
|
@@ -2765,6 +3436,493 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
2765
3436
|
}]
|
|
2766
3437
|
}] });
|
|
2767
3438
|
|
|
3439
|
+
class DialogRef {
|
|
3440
|
+
closeFn;
|
|
3441
|
+
_result = new Subject();
|
|
3442
|
+
/** Observable that emits when any button is clicked in the wrapper */
|
|
3443
|
+
buttonClick$ = new Subject();
|
|
3444
|
+
/** Observable that emits when the dialog is closed */
|
|
3445
|
+
afterClosed() {
|
|
3446
|
+
return this._result.asObservable();
|
|
3447
|
+
}
|
|
3448
|
+
constructor(closeFn) {
|
|
3449
|
+
this.closeFn = closeFn;
|
|
3450
|
+
}
|
|
3451
|
+
setCloseFn(fn) {
|
|
3452
|
+
this.closeFn = fn;
|
|
3453
|
+
}
|
|
3454
|
+
close(result) {
|
|
3455
|
+
if (this.closeFn) {
|
|
3456
|
+
this.closeFn(result);
|
|
3457
|
+
}
|
|
3458
|
+
if (!this._result.closed) {
|
|
3459
|
+
this._result.next(result);
|
|
3460
|
+
this._result.complete();
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
}
|
|
3464
|
+
|
|
3465
|
+
class DynamicModalWrapperComponent {
|
|
3466
|
+
title = '';
|
|
3467
|
+
message = '';
|
|
3468
|
+
size = 'lg';
|
|
3469
|
+
buttons = [];
|
|
3470
|
+
scrollable = true;
|
|
3471
|
+
alignment = 'top';
|
|
3472
|
+
childInjector;
|
|
3473
|
+
backdropIndex = 1;
|
|
3474
|
+
customClose = false;
|
|
3475
|
+
_result;
|
|
3476
|
+
// New Signal-based inputs for child component
|
|
3477
|
+
_childComponentType = signal(null, ...(ngDevMode ? [{ debugName: "_childComponentType" }] : []));
|
|
3478
|
+
set childComponentType(value) {
|
|
3479
|
+
this._childComponentType.set(value);
|
|
3480
|
+
}
|
|
3481
|
+
_childComponentData = signal(null, ...(ngDevMode ? [{ debugName: "_childComponentData" }] : []));
|
|
3482
|
+
set childComponentData(value) {
|
|
3483
|
+
this._childComponentData.set(value);
|
|
3484
|
+
}
|
|
3485
|
+
contentHost;
|
|
3486
|
+
modalElement;
|
|
3487
|
+
visibleSignal = signal(false, ...(ngDevMode ? [{ debugName: "visibleSignal" }] : []));
|
|
3488
|
+
componentRef;
|
|
3489
|
+
closeCallback = () => { };
|
|
3490
|
+
cdr = inject(ChangeDetectorRef);
|
|
3491
|
+
zone = inject(NgZone);
|
|
3492
|
+
dialogRef = inject(DialogRef, { optional: true });
|
|
3493
|
+
isDestroyed = false;
|
|
3494
|
+
isViewInit = false;
|
|
3495
|
+
constructor() {
|
|
3496
|
+
// React to child component type changes
|
|
3497
|
+
effect(() => {
|
|
3498
|
+
const type = this._childComponentType();
|
|
3499
|
+
if (type && this.isViewInit) {
|
|
3500
|
+
untracked(() => this.loadComponent());
|
|
3501
|
+
}
|
|
3502
|
+
});
|
|
3503
|
+
// React to data changes
|
|
3504
|
+
effect(() => {
|
|
3505
|
+
const data = this._childComponentData();
|
|
3506
|
+
if (data && this.componentRef && this.isViewInit) {
|
|
3507
|
+
untracked(() => this.applyData(data));
|
|
3508
|
+
}
|
|
3509
|
+
});
|
|
3510
|
+
}
|
|
3511
|
+
ngAfterViewInit() {
|
|
3512
|
+
this.isViewInit = true;
|
|
3513
|
+
// Load component immediately once view is ready
|
|
3514
|
+
this.loadComponent();
|
|
3515
|
+
// Small delay before showing modal to avoid CD/Signal race conditions
|
|
3516
|
+
this.zone.run(() => {
|
|
3517
|
+
setTimeout(() => {
|
|
3518
|
+
if (!this.isDestroyed) {
|
|
3519
|
+
this.visibleSignal.set(true);
|
|
3520
|
+
this.cdr.detectChanges();
|
|
3521
|
+
// Add backdrop class after modal is visible
|
|
3522
|
+
this.addBackdropClass();
|
|
3523
|
+
}
|
|
3524
|
+
}, 50);
|
|
3525
|
+
});
|
|
3526
|
+
}
|
|
3527
|
+
ngOnDestroy() {
|
|
3528
|
+
this.isDestroyed = true;
|
|
3529
|
+
if (this.componentRef) {
|
|
3530
|
+
this.componentRef.destroy();
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
loadComponent() {
|
|
3534
|
+
if (!this._childComponentType() || !this.contentHost)
|
|
3535
|
+
return;
|
|
3536
|
+
this.contentHost.clear();
|
|
3537
|
+
this.componentRef = this.contentHost.createComponent(this._childComponentType(), {
|
|
3538
|
+
injector: this.childInjector || this.contentHost.injector
|
|
3539
|
+
});
|
|
3540
|
+
const data = this._childComponentData();
|
|
3541
|
+
if (data) {
|
|
3542
|
+
this.applyData(data);
|
|
3543
|
+
}
|
|
3544
|
+
this.cdr.detectChanges();
|
|
3545
|
+
}
|
|
3546
|
+
applyData(data) {
|
|
3547
|
+
if (!this.componentRef)
|
|
3548
|
+
return;
|
|
3549
|
+
if (this.componentRef.instance.setData) {
|
|
3550
|
+
this.componentRef.instance.setData(data);
|
|
3551
|
+
}
|
|
3552
|
+
else {
|
|
3553
|
+
Object.assign(this.componentRef.instance, data);
|
|
3554
|
+
}
|
|
3555
|
+
this.cdr.detectChanges();
|
|
3556
|
+
}
|
|
3557
|
+
onButtonClick(btn) {
|
|
3558
|
+
// Notify the child component that a button was clicked
|
|
3559
|
+
if (this.dialogRef) {
|
|
3560
|
+
this.dialogRef.buttonClick$.next(btn);
|
|
3561
|
+
}
|
|
3562
|
+
if (btn.type === 'close') {
|
|
3563
|
+
if (!this.customClose) {
|
|
3564
|
+
this.close();
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
if (btn.onClick) {
|
|
3568
|
+
btn.onClick(this.componentRef?.instance);
|
|
3569
|
+
}
|
|
3570
|
+
}
|
|
3571
|
+
topClose() {
|
|
3572
|
+
this.dialogRef?.buttonClick$.next({
|
|
3573
|
+
type: 'close',
|
|
3574
|
+
label: 'T-Close',
|
|
3575
|
+
});
|
|
3576
|
+
if (!this.customClose) {
|
|
3577
|
+
this.close();
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
close(result) {
|
|
3581
|
+
this._result = result;
|
|
3582
|
+
this.visibleSignal.set(false);
|
|
3583
|
+
this.cdr.detectChanges();
|
|
3584
|
+
}
|
|
3585
|
+
onVisibleChange(event) {
|
|
3586
|
+
if (this.visibleSignal() === event)
|
|
3587
|
+
return;
|
|
3588
|
+
this.visibleSignal.set(event);
|
|
3589
|
+
if (!event) {
|
|
3590
|
+
// Cleanup delay to prevent view[EFFECTS] error
|
|
3591
|
+
this.zone.runOutsideAngular(() => {
|
|
3592
|
+
setTimeout(() => {
|
|
3593
|
+
this.zone.run(() => {
|
|
3594
|
+
if (!this.isDestroyed) {
|
|
3595
|
+
this.closeCallback(this._result);
|
|
3596
|
+
}
|
|
3597
|
+
});
|
|
3598
|
+
}, 400);
|
|
3599
|
+
});
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
addBackdropClass() {
|
|
3603
|
+
// Wait a bit for the backdrop to be rendered by CoreUI
|
|
3604
|
+
this.zone.runOutsideAngular(() => {
|
|
3605
|
+
setTimeout(() => {
|
|
3606
|
+
// Set modal z-index
|
|
3607
|
+
if (this.modalElement) {
|
|
3608
|
+
const modalEl = this.modalElement.nativeElement;
|
|
3609
|
+
const baseModalZIndex = 1055;
|
|
3610
|
+
const modalZIndex = baseModalZIndex + ((this.backdropIndex - 1) * 10);
|
|
3611
|
+
modalEl.style.setProperty('--cui-modal-zindex', modalZIndex.toString());
|
|
3612
|
+
}
|
|
3613
|
+
// Find all backdrops
|
|
3614
|
+
const backdrops = document.querySelectorAll('.modal-backdrop.show');
|
|
3615
|
+
if (backdrops.length > 0) {
|
|
3616
|
+
// Get the most recently added backdrop (last one)
|
|
3617
|
+
const latestBackdrop = backdrops[backdrops.length - 1];
|
|
3618
|
+
// Set the backdrop z-index dynamically
|
|
3619
|
+
const baseBackdropZIndex = 1050;
|
|
3620
|
+
const backdropZIndex = baseBackdropZIndex + ((this.backdropIndex - 1) * 10);
|
|
3621
|
+
latestBackdrop.style.zIndex = backdropZIndex.toString();
|
|
3622
|
+
}
|
|
3623
|
+
}, 100);
|
|
3624
|
+
});
|
|
3625
|
+
}
|
|
3626
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: DynamicModalWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3627
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: DynamicModalWrapperComponent, isStandalone: true, selector: "prg-ws-dynamic-modal-wrapper", inputs: { title: "title", message: "message", size: "size", buttons: "buttons", scrollable: "scrollable", alignment: "alignment", childInjector: "childInjector", backdropIndex: "backdropIndex", customClose: "customClose", childComponentType: "childComponentType", childComponentData: "childComponentData" }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef }, { propertyName: "modalElement", first: true, predicate: ["modalElement"], descendants: true, read: ElementRef }], ngImport: i0, template: `
|
|
3628
|
+
<c-modal
|
|
3629
|
+
#modalElement
|
|
3630
|
+
[visible]="visibleSignal()"
|
|
3631
|
+
[size]="size"
|
|
3632
|
+
[alignment]="alignment"
|
|
3633
|
+
[scrollable]="scrollable"
|
|
3634
|
+
backdrop="static"
|
|
3635
|
+
(visibleChange)="onVisibleChange($event)"
|
|
3636
|
+
>
|
|
3637
|
+
<c-modal-header>
|
|
3638
|
+
<h5 cModalTitle>{{ title }}</h5>
|
|
3639
|
+
<button (click)="topClose()" cButtonClose></button>
|
|
3640
|
+
</c-modal-header>
|
|
3641
|
+
<c-modal-body>
|
|
3642
|
+
@if (message) {
|
|
3643
|
+
<div [innerHTML]="message" class="mb-3"></div>
|
|
3644
|
+
}
|
|
3645
|
+
<ng-template #contentHost></ng-template>
|
|
3646
|
+
</c-modal-body>
|
|
3647
|
+
@if (buttons?.length) {
|
|
3648
|
+
<c-modal-footer>
|
|
3649
|
+
@for (btn of buttons; track btn) {
|
|
3650
|
+
<button
|
|
3651
|
+
cButton
|
|
3652
|
+
[color]="btn.color || 'primary'"
|
|
3653
|
+
[variant]="btn.variant"
|
|
3654
|
+
[className]="btn.class || ''"
|
|
3655
|
+
(click)="onButtonClick(btn)"
|
|
3656
|
+
>
|
|
3657
|
+
{{ btn.label }}
|
|
3658
|
+
</button>
|
|
3659
|
+
}
|
|
3660
|
+
</c-modal-footer>
|
|
3661
|
+
}
|
|
3662
|
+
</c-modal>
|
|
3663
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i1.ModalBodyComponent, selector: "c-modal-body" }, { kind: "component", type: i1.ModalComponent, selector: "c-modal", inputs: ["alignment", "backdrop", "fullscreen", "keyboard", "id", "size", "transition", "role", "ariaModal", "scrollable", "visible"], outputs: ["visibleChange"], exportAs: ["cModal"] }, { kind: "component", type: i1.ModalFooterComponent, selector: "c-modal-footer" }, { kind: "component", type: i1.ModalHeaderComponent, selector: "c-modal-header" }, { kind: "directive", type: i1.ModalTitleDirective, selector: "[cModalTitle]" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "tabindex", "type", "variant"], exportAs: ["cButton"] }, { kind: "directive", type: i1.ButtonCloseDirective, selector: "[cButtonClose]", inputs: ["white"] }] });
|
|
3664
|
+
}
|
|
3665
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: DynamicModalWrapperComponent, decorators: [{
|
|
3666
|
+
type: Component,
|
|
3667
|
+
args: [{
|
|
3668
|
+
selector: 'prg-ws-dynamic-modal-wrapper',
|
|
3669
|
+
standalone: true,
|
|
3670
|
+
imports: [CommonModule, ModalModule, ButtonModule],
|
|
3671
|
+
template: `
|
|
3672
|
+
<c-modal
|
|
3673
|
+
#modalElement
|
|
3674
|
+
[visible]="visibleSignal()"
|
|
3675
|
+
[size]="size"
|
|
3676
|
+
[alignment]="alignment"
|
|
3677
|
+
[scrollable]="scrollable"
|
|
3678
|
+
backdrop="static"
|
|
3679
|
+
(visibleChange)="onVisibleChange($event)"
|
|
3680
|
+
>
|
|
3681
|
+
<c-modal-header>
|
|
3682
|
+
<h5 cModalTitle>{{ title }}</h5>
|
|
3683
|
+
<button (click)="topClose()" cButtonClose></button>
|
|
3684
|
+
</c-modal-header>
|
|
3685
|
+
<c-modal-body>
|
|
3686
|
+
@if (message) {
|
|
3687
|
+
<div [innerHTML]="message" class="mb-3"></div>
|
|
3688
|
+
}
|
|
3689
|
+
<ng-template #contentHost></ng-template>
|
|
3690
|
+
</c-modal-body>
|
|
3691
|
+
@if (buttons?.length) {
|
|
3692
|
+
<c-modal-footer>
|
|
3693
|
+
@for (btn of buttons; track btn) {
|
|
3694
|
+
<button
|
|
3695
|
+
cButton
|
|
3696
|
+
[color]="btn.color || 'primary'"
|
|
3697
|
+
[variant]="btn.variant"
|
|
3698
|
+
[className]="btn.class || ''"
|
|
3699
|
+
(click)="onButtonClick(btn)"
|
|
3700
|
+
>
|
|
3701
|
+
{{ btn.label }}
|
|
3702
|
+
</button>
|
|
3703
|
+
}
|
|
3704
|
+
</c-modal-footer>
|
|
3705
|
+
}
|
|
3706
|
+
</c-modal>
|
|
3707
|
+
`
|
|
3708
|
+
}]
|
|
3709
|
+
}], ctorParameters: () => [], propDecorators: { title: [{
|
|
3710
|
+
type: Input
|
|
3711
|
+
}], message: [{
|
|
3712
|
+
type: Input
|
|
3713
|
+
}], size: [{
|
|
3714
|
+
type: Input
|
|
3715
|
+
}], buttons: [{
|
|
3716
|
+
type: Input
|
|
3717
|
+
}], scrollable: [{
|
|
3718
|
+
type: Input
|
|
3719
|
+
}], alignment: [{
|
|
3720
|
+
type: Input
|
|
3721
|
+
}], childInjector: [{
|
|
3722
|
+
type: Input
|
|
3723
|
+
}], backdropIndex: [{
|
|
3724
|
+
type: Input
|
|
3725
|
+
}], customClose: [{
|
|
3726
|
+
type: Input
|
|
3727
|
+
}], childComponentType: [{
|
|
3728
|
+
type: Input
|
|
3729
|
+
}], childComponentData: [{
|
|
3730
|
+
type: Input
|
|
3731
|
+
}], contentHost: [{
|
|
3732
|
+
type: ViewChild,
|
|
3733
|
+
args: ['contentHost', { read: ViewContainerRef }]
|
|
3734
|
+
}], modalElement: [{
|
|
3735
|
+
type: ViewChild,
|
|
3736
|
+
args: ['modalElement', { read: ElementRef }]
|
|
3737
|
+
}] } });
|
|
3738
|
+
|
|
3739
|
+
class PgDialogService {
|
|
3740
|
+
appRef = inject(ApplicationRef);
|
|
3741
|
+
injector = inject(EnvironmentInjector);
|
|
3742
|
+
viewContainerRef;
|
|
3743
|
+
openDialogs = new Set();
|
|
3744
|
+
registerViewContainerRef(vcr) {
|
|
3745
|
+
this.viewContainerRef = vcr;
|
|
3746
|
+
}
|
|
3747
|
+
add(config) {
|
|
3748
|
+
const subject = new Subject();
|
|
3749
|
+
const component = config.component || null;
|
|
3750
|
+
const dialogRef = this.open(component, config);
|
|
3751
|
+
// Inject result handling into buttons if they don't have onClick
|
|
3752
|
+
if (config.buttons) {
|
|
3753
|
+
config.buttons.forEach(btn => {
|
|
3754
|
+
const originalOnClick = btn.onClick;
|
|
3755
|
+
btn.onClick = (context) => {
|
|
3756
|
+
if (originalOnClick) {
|
|
3757
|
+
originalOnClick(context);
|
|
3758
|
+
}
|
|
3759
|
+
subject.next(btn.label); // Or we could pass btn itself
|
|
3760
|
+
if (btn.type !== 'submit') {
|
|
3761
|
+
dialogRef.close(btn.label);
|
|
3762
|
+
}
|
|
3763
|
+
};
|
|
3764
|
+
});
|
|
3765
|
+
}
|
|
3766
|
+
// Subscribe to afterClosed to finish the subject
|
|
3767
|
+
dialogRef.afterClosed().subscribe(result => {
|
|
3768
|
+
if (!subject.closed) {
|
|
3769
|
+
subject.next(result || 'close');
|
|
3770
|
+
subject.complete();
|
|
3771
|
+
}
|
|
3772
|
+
});
|
|
3773
|
+
return subject.asObservable();
|
|
3774
|
+
}
|
|
3775
|
+
alert(message, title = 'Alert') {
|
|
3776
|
+
const subject = new Subject();
|
|
3777
|
+
this.add({
|
|
3778
|
+
title,
|
|
3779
|
+
message,
|
|
3780
|
+
size: 'md',
|
|
3781
|
+
alignment: 'center',
|
|
3782
|
+
buttons: [
|
|
3783
|
+
{
|
|
3784
|
+
label: 'OK',
|
|
3785
|
+
color: 'primary',
|
|
3786
|
+
onClick: () => {
|
|
3787
|
+
subject.next();
|
|
3788
|
+
subject.complete();
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
]
|
|
3792
|
+
});
|
|
3793
|
+
return subject.asObservable();
|
|
3794
|
+
}
|
|
3795
|
+
confirm(message, title = 'Confirm') {
|
|
3796
|
+
const subject = new Subject();
|
|
3797
|
+
this.add({
|
|
3798
|
+
title,
|
|
3799
|
+
message,
|
|
3800
|
+
alignment: 'center',
|
|
3801
|
+
size: 'md',
|
|
3802
|
+
buttons: [
|
|
3803
|
+
{
|
|
3804
|
+
label: 'Cancel',
|
|
3805
|
+
variant: 'outline',
|
|
3806
|
+
color: 'secondary',
|
|
3807
|
+
onClick: () => {
|
|
3808
|
+
subject.next(false);
|
|
3809
|
+
subject.complete();
|
|
3810
|
+
}
|
|
3811
|
+
},
|
|
3812
|
+
{
|
|
3813
|
+
label: 'Confirm',
|
|
3814
|
+
color: 'primary',
|
|
3815
|
+
onClick: () => {
|
|
3816
|
+
subject.next(true);
|
|
3817
|
+
subject.complete();
|
|
3818
|
+
}
|
|
3819
|
+
}
|
|
3820
|
+
]
|
|
3821
|
+
});
|
|
3822
|
+
return subject.asObservable();
|
|
3823
|
+
}
|
|
3824
|
+
open(component, config = {}) {
|
|
3825
|
+
if (!this.viewContainerRef) {
|
|
3826
|
+
console.error('PgDialogService: ViewContainerRef not registered. Please register it in AppComponent.');
|
|
3827
|
+
// Fallback (might fail with EFFECTS error but better than crashing immediately)
|
|
3828
|
+
return this.openManual(component, config);
|
|
3829
|
+
}
|
|
3830
|
+
const dialogRef = new DialogRef();
|
|
3831
|
+
const childInjector = Injector.create({
|
|
3832
|
+
providers: [{
|
|
3833
|
+
provide: DialogRef,
|
|
3834
|
+
useValue: dialogRef
|
|
3835
|
+
}],
|
|
3836
|
+
parent: this.injector
|
|
3837
|
+
});
|
|
3838
|
+
// Create the wrapper component using VCR
|
|
3839
|
+
const wrapperRef = this.viewContainerRef.createComponent(DynamicModalWrapperComponent, {
|
|
3840
|
+
injector: childInjector // Give the wrapper access to DialogRef too
|
|
3841
|
+
});
|
|
3842
|
+
// Now initialize the DialogRef with the actual wrapper instance
|
|
3843
|
+
dialogRef.setCloseFn((res) => wrapperRef.instance.close(res));
|
|
3844
|
+
wrapperRef.instance.childInjector = childInjector;
|
|
3845
|
+
this.configureWrapper(wrapperRef, component, config);
|
|
3846
|
+
// Handle close cleanup
|
|
3847
|
+
wrapperRef.instance.closeCallback = () => {
|
|
3848
|
+
this.removeDialog(dialogRef);
|
|
3849
|
+
wrapperRef.destroy();
|
|
3850
|
+
};
|
|
3851
|
+
this.openDialogs.add(dialogRef);
|
|
3852
|
+
return dialogRef;
|
|
3853
|
+
}
|
|
3854
|
+
// Fallback implementation (old manual way)
|
|
3855
|
+
openManual(component, config = {}) {
|
|
3856
|
+
const wrapperRef = createComponent(DynamicModalWrapperComponent, {
|
|
3857
|
+
environmentInjector: this.injector
|
|
3858
|
+
});
|
|
3859
|
+
const dialogRef = new DialogRef();
|
|
3860
|
+
const childInjector = Injector.create({
|
|
3861
|
+
providers: [{
|
|
3862
|
+
provide: DialogRef,
|
|
3863
|
+
useValue: dialogRef
|
|
3864
|
+
}],
|
|
3865
|
+
parent: this.injector
|
|
3866
|
+
});
|
|
3867
|
+
wrapperRef.instance.childInjector = childInjector;
|
|
3868
|
+
dialogRef.setCloseFn((res) => wrapperRef.instance.close(res));
|
|
3869
|
+
this.configureWrapper(wrapperRef, component, config);
|
|
3870
|
+
// Attach to the view
|
|
3871
|
+
this.appRef.attachView(wrapperRef.hostView);
|
|
3872
|
+
const domElem = wrapperRef.hostView.rootNodes[0];
|
|
3873
|
+
document.body.appendChild(domElem);
|
|
3874
|
+
// Trigger change detection to ensure inputs are applied
|
|
3875
|
+
wrapperRef.changeDetectorRef.detectChanges();
|
|
3876
|
+
// Handle close cleanup
|
|
3877
|
+
wrapperRef.instance.closeCallback = (result) => {
|
|
3878
|
+
this.removeDialog(dialogRef);
|
|
3879
|
+
this.appRef.detachView(wrapperRef.hostView);
|
|
3880
|
+
wrapperRef.destroy();
|
|
3881
|
+
domElem.remove();
|
|
3882
|
+
};
|
|
3883
|
+
this.openDialogs.add(dialogRef);
|
|
3884
|
+
return dialogRef;
|
|
3885
|
+
}
|
|
3886
|
+
configureWrapper(wrapperRef, component, config) {
|
|
3887
|
+
wrapperRef.instance.title = config.title || '';
|
|
3888
|
+
wrapperRef.instance.message = config.message || '';
|
|
3889
|
+
wrapperRef.instance.size = config.size || 'lg';
|
|
3890
|
+
wrapperRef.instance.childComponentType = component;
|
|
3891
|
+
wrapperRef.instance.childComponentData = config.data;
|
|
3892
|
+
// Set backdrop index based on current dialog count (1-based index)
|
|
3893
|
+
wrapperRef.instance.backdropIndex = this.openDialogs.size + 1;
|
|
3894
|
+
if (config.buttons) {
|
|
3895
|
+
wrapperRef.instance.buttons = config.buttons;
|
|
3896
|
+
}
|
|
3897
|
+
if (config.scrollable !== undefined) {
|
|
3898
|
+
wrapperRef.instance.scrollable = config.scrollable;
|
|
3899
|
+
}
|
|
3900
|
+
if (config.alignment) {
|
|
3901
|
+
wrapperRef.instance.alignment = config.alignment;
|
|
3902
|
+
}
|
|
3903
|
+
if (config.customClose) {
|
|
3904
|
+
wrapperRef.instance.customClose = config.customClose;
|
|
3905
|
+
}
|
|
3906
|
+
}
|
|
3907
|
+
removeDialog(dialogRef) {
|
|
3908
|
+
this.openDialogs.delete(dialogRef);
|
|
3909
|
+
}
|
|
3910
|
+
closeAll() {
|
|
3911
|
+
// Clone to array to safely iterate as items might be deleted during iteration
|
|
3912
|
+
const dialogs = Array.from(this.openDialogs);
|
|
3913
|
+
dialogs.forEach(dialog => dialog.close());
|
|
3914
|
+
this.openDialogs.clear();
|
|
3915
|
+
}
|
|
3916
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: PgDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3917
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: PgDialogService, providedIn: 'root' });
|
|
3918
|
+
}
|
|
3919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: PgDialogService, decorators: [{
|
|
3920
|
+
type: Injectable,
|
|
3921
|
+
args: [{
|
|
3922
|
+
providedIn: 'root'
|
|
3923
|
+
}]
|
|
3924
|
+
}] });
|
|
3925
|
+
|
|
2768
3926
|
/*
|
|
2769
3927
|
* Public API Surface of utils
|
|
2770
3928
|
*/
|
|
@@ -2773,5 +3931,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
2773
3931
|
* Generated bundle index. Do not edit.
|
|
2774
3932
|
*/
|
|
2775
3933
|
|
|
2776
|
-
export { BackgroundImageDirective, CheckboxCellRendererComponent, CircularFocusDirective, ColorCellRendererComponent, CommentsButtonCellRendererComponent, ConfigurationServiceLib, CustomSelectFilterComponent, DateTimePickerComponent, DecimalInputDirective, EditionListGroupedComponent, ExcelType, ExportToExcelNames, FormFieldType, GenericFilterModelComponent, ILOGIN_ACTION, ITableGridConfiguration, ITableGridPagination, IndustryUpdateListboxCellRendererComponent, JsonrpcServiceLib, LoginComponent, LoginModule, MultiFormComponent, MultiFormModule, MultiSelectStylerDirective, PageStatusCellRendererComponent, ShowTooltipIfTruncatedDirective, StatusSelectCellRendererComponent, TableGridComponent, TableGridModule, UtilsService, convertDateShort, convertIsoToFormat, convertToISOnString, generateTimeOptions, regionalDateFormat };
|
|
3934
|
+
export { AgDateRangeFilterComponent, BackgroundImageDirective, BadgeCellRendererComponent, CheckboxCellRendererComponent, CircularFocusDirective, ColorCellRendererComponent, CommentsButtonCellRendererComponent, ConfigurationServiceLib, CustomSelectFilterComponent, DateTimePickerComponent, DecimalInputDirective, DialogRef, DynamicModalWrapperComponent, EditionListGroupedComponent, ExcelType, ExportToExcelNames, FormFieldType, GenericFilterModelComponent, HyperlinkCellRendererComponent, ILOGIN_ACTION, ITableGridConfiguration, ITableGridPagination, IconTextCellRendererComponent, IndustryUpdateListboxCellRendererComponent, JsonrpcServiceLib, LoginComponent, LoginModule, MultiFormComponent, MultiFormModule, MultiSelectStylerDirective, PageStatusCellRendererComponent, PgDialogService, ShowTooltipIfTruncatedDirective, StatusSelectCellRendererComponent, TableGridComponent, TableGridModule, UtilsService, convertDateShort, convertIsoToFormat, convertToISOnString, generateTimeOptions, getTimeValueFromDateTime, regionalDateFormat };
|
|
2777
3935
|
//# sourceMappingURL=pongrass-utils.mjs.map
|