@unipin/angular-applet 17.3.1 → 17.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,9 +12,9 @@ import * as i1$1 from 'apollo-angular';
12
12
  import { gql } from 'apollo-angular';
13
13
  import * as i3 from 'angular-split';
14
14
  import { AngularSplitModule } from 'angular-split';
15
- import * as i1$3 from '@angular/forms';
15
+ import * as i3$1 from '@angular/forms';
16
16
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule, FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
17
- import * as i3$1 from '@ng-select/ng-select';
17
+ import * as i3$2 from '@ng-select/ng-select';
18
18
  import { NgSelectModule } from '@ng-select/ng-select';
19
19
  import { ModuleRegistry } from '@ag-grid-community/core';
20
20
  export { GridApi } from '@ag-grid-community/core';
@@ -89,7 +89,7 @@ class ButtonGroupComponent {
89
89
  this.popoverCtrl.dismiss();
90
90
  }
91
91
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ButtonGroupComponent, deps: [{ token: 'id', attribute: true }, { token: i1.PopoverController }], target: i0.ɵɵFactoryTarget.Component }); }
92
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ButtonGroupComponent, isStandalone: true, selector: "up-btn-group", inputs: { config: "config" }, host: { properties: { "class.d-none": "this.isHidden" } }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"config.length > 0\">\n <up-btn-loading class=\"flex-grow-1\" [type]=\"config[activeIndex].type\" [disabled]=\"config[activeIndex].disabled\" [form]=\"config[activeIndex].form\" [color]=\"config[activeIndex].color\" (onClick)=\"clickBtn($event);\">\n <ion-icon class=\"me-2\" name=\"{{ config[activeIndex].icon }}\" *ngIf=\"config[activeIndex].icon\" />\n {{ config[activeIndex].label }}\n </up-btn-loading>\n\n <ion-button class=\"flex-shrink-0\" id=\"btn-{{ id }}\" [color]=\"config[activeIndex].color\" [disabled]=\"config.length < 2\">\n <ion-icon name=\"caret-down-outline\" />\n </ion-button>\n\n <ion-popover trigger=\"btn-{{ id }}\" triggerAction=\"click\">\n <ng-template>\n <div class=\"item px-2 py-3 cursor-pointer border-bottom d-flex gap-2\" *ngFor=\"let c of config; let i = index\" (click)=\"change(i);\">\n <div class=\"icon flex-shrink-0\">\n <ion-icon name=\"checkmark\" *ngIf=\"i === activeIndex\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"fw-medium\">{{ c.label }}</div>\n <div class=\"f12 pt-1\" *ngIf=\"c.description\">\n {{ c.description }}\n </div>\n </div>\n </div>\n </ng-template>\n </ion-popover>\n</ng-container>\n", styles: [":host{display:flex}up-btn-loading ::ng-deep ion-button{--border-radius: 4px 0 0 4px}ion-button::part(native){border-radius:0 4px 4px 0;border-left:1px solid rgba(255,255,255,.3)}.item:hover{color:#ed6b26;background:#fef3ee}.item ion-icon{--ionicon-stroke-width: 64px}.item .icon{width:14px}.item .f12{color:#616161}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonPopover, selector: "ion-popover" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonLoadingComponent, selector: "up-btn-loading", inputs: ["disabled", "form", "type", "fill", "color"], outputs: ["onClick"] }] }); }
92
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ButtonGroupComponent, isStandalone: true, selector: "up-btn-group", inputs: { config: "config" }, host: { properties: { "class.d-none": "this.isHidden" } }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"config.length > 0\">\n <up-btn-loading class=\"flex-grow-1\" [class.multi]=\"config.length > 1\" [type]=\"config[activeIndex].type\" [disabled]=\"config[activeIndex].disabled\" [form]=\"config[activeIndex].form\" [color]=\"config[activeIndex].color\" (onClick)=\"clickBtn($event);\">\n <ion-icon class=\"me-2\" name=\"{{ config[activeIndex].icon }}\" *ngIf=\"config[activeIndex].icon\" />\n {{ config[activeIndex].label }}\n </up-btn-loading>\n\n <ng-container *ngIf=\"config.length > 1\" >\n <ion-button class=\"flex-shrink-0\" id=\"btn-{{ id }}\" [color]=\"config[activeIndex].color\">\n <ion-icon name=\"caret-down-outline\" />\n </ion-button>\n \n <ion-popover trigger=\"btn-{{ id }}\" triggerAction=\"click\">\n <ng-template>\n <div class=\"item px-2 py-3 cursor-pointer border-bottom d-flex gap-2\" *ngFor=\"let c of config; let i = index\" (click)=\"change(i);\">\n <div class=\"icon flex-shrink-0\">\n <ion-icon name=\"checkmark\" *ngIf=\"i === activeIndex\" />\n </div>\n \n <div class=\"flex-grow-1\">\n <div class=\"fw-medium\">{{ c.label }}</div>\n <div class=\"f12 pt-1\" *ngIf=\"c.description\">\n {{ c.description }}\n </div>\n </div>\n </div>\n </ng-template>\n </ion-popover>\n </ng-container>\n</ng-container>\n", styles: [":host{display:flex}up-btn-loading.multi ::ng-deep ion-button{--border-radius: 4px 0 0 4px}ion-button::part(native){border-radius:0 4px 4px 0;border-left:1px solid rgba(255,255,255,.3)}.item:hover{color:#ed6b26;background:#fef3ee}.item ion-icon{--ionicon-stroke-width: 64px}.item .icon{width:14px}.item .f12{color:#616161}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonPopover, selector: "ion-popover" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonLoadingComponent, selector: "up-btn-loading", inputs: ["disabled", "form", "type", "fill", "color"], outputs: ["onClick"] }] }); }
93
93
  }
94
94
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ButtonGroupComponent, decorators: [{
95
95
  type: Component,
@@ -97,7 +97,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
97
97
  IonicModule,
98
98
  CommonModule,
99
99
  ButtonLoadingComponent
100
- ], template: "<ng-container *ngIf=\"config.length > 0\">\n <up-btn-loading class=\"flex-grow-1\" [type]=\"config[activeIndex].type\" [disabled]=\"config[activeIndex].disabled\" [form]=\"config[activeIndex].form\" [color]=\"config[activeIndex].color\" (onClick)=\"clickBtn($event);\">\n <ion-icon class=\"me-2\" name=\"{{ config[activeIndex].icon }}\" *ngIf=\"config[activeIndex].icon\" />\n {{ config[activeIndex].label }}\n </up-btn-loading>\n\n <ion-button class=\"flex-shrink-0\" id=\"btn-{{ id }}\" [color]=\"config[activeIndex].color\" [disabled]=\"config.length < 2\">\n <ion-icon name=\"caret-down-outline\" />\n </ion-button>\n\n <ion-popover trigger=\"btn-{{ id }}\" triggerAction=\"click\">\n <ng-template>\n <div class=\"item px-2 py-3 cursor-pointer border-bottom d-flex gap-2\" *ngFor=\"let c of config; let i = index\" (click)=\"change(i);\">\n <div class=\"icon flex-shrink-0\">\n <ion-icon name=\"checkmark\" *ngIf=\"i === activeIndex\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"fw-medium\">{{ c.label }}</div>\n <div class=\"f12 pt-1\" *ngIf=\"c.description\">\n {{ c.description }}\n </div>\n </div>\n </div>\n </ng-template>\n </ion-popover>\n</ng-container>\n", styles: [":host{display:flex}up-btn-loading ::ng-deep ion-button{--border-radius: 4px 0 0 4px}ion-button::part(native){border-radius:0 4px 4px 0;border-left:1px solid rgba(255,255,255,.3)}.item:hover{color:#ed6b26;background:#fef3ee}.item ion-icon{--ionicon-stroke-width: 64px}.item .icon{width:14px}.item .f12{color:#616161}\n"] }]
100
+ ], template: "<ng-container *ngIf=\"config.length > 0\">\n <up-btn-loading class=\"flex-grow-1\" [class.multi]=\"config.length > 1\" [type]=\"config[activeIndex].type\" [disabled]=\"config[activeIndex].disabled\" [form]=\"config[activeIndex].form\" [color]=\"config[activeIndex].color\" (onClick)=\"clickBtn($event);\">\n <ion-icon class=\"me-2\" name=\"{{ config[activeIndex].icon }}\" *ngIf=\"config[activeIndex].icon\" />\n {{ config[activeIndex].label }}\n </up-btn-loading>\n\n <ng-container *ngIf=\"config.length > 1\" >\n <ion-button class=\"flex-shrink-0\" id=\"btn-{{ id }}\" [color]=\"config[activeIndex].color\">\n <ion-icon name=\"caret-down-outline\" />\n </ion-button>\n \n <ion-popover trigger=\"btn-{{ id }}\" triggerAction=\"click\">\n <ng-template>\n <div class=\"item px-2 py-3 cursor-pointer border-bottom d-flex gap-2\" *ngFor=\"let c of config; let i = index\" (click)=\"change(i);\">\n <div class=\"icon flex-shrink-0\">\n <ion-icon name=\"checkmark\" *ngIf=\"i === activeIndex\" />\n </div>\n \n <div class=\"flex-grow-1\">\n <div class=\"fw-medium\">{{ c.label }}</div>\n <div class=\"f12 pt-1\" *ngIf=\"c.description\">\n {{ c.description }}\n </div>\n </div>\n </div>\n </ng-template>\n </ion-popover>\n </ng-container>\n</ng-container>\n", styles: [":host{display:flex}up-btn-loading.multi ::ng-deep ion-button{--border-radius: 4px 0 0 4px}ion-button::part(native){border-radius:0 4px 4px 0;border-left:1px solid rgba(255,255,255,.3)}.item:hover{color:#ed6b26;background:#fef3ee}.item ion-icon{--ionicon-stroke-width: 64px}.item .icon{width:14px}.item .f12{color:#616161}\n"] }]
101
101
  }], ctorParameters: () => [{ type: undefined, decorators: [{
102
102
  type: Attribute,
103
103
  args: ['id']
@@ -634,7 +634,7 @@ class FormDateComponent {
634
634
  provide: NG_VALIDATORS,
635
635
  useExisting: FormDateComponent
636
636
  }
637
- ], ngImport: i0, template: "<label class=\"form-label d-flex align-items-center\">\n <ng-content select=\"[icon]\" />\n <span>{{ label }}</span>\n</label>\n\n<input readonly type=\"text\" id=\"{{ name }}-date\" placeholder=\"{{ placeholder }}\" class=\"form-control cursor-pointer\" [disabled]=\"disabled\" [required]=\"required\" [value]=\"value | date:dateFormat \">\n<ion-icon name=\"calendar\" class=\"position-absolute fs-4 cursor-pointer\" />\n\n<ion-modal trigger=\"{{ name }}-date\">\n <ng-template>\n <ion-datetime mode=\"md\" [presentation]=\"presentation\" value=\"{{ localValue }}\" [showDefaultButtons]=\"true\" (ionChange)=\"changeDate($event)\" />\n </ng-template>\n</ion-modal>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: ["ion-datetime{--background: white}ion-modal{--width: 290px;--height: auto}ion-icon{top:32px;right:16px;color:#616161}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonDatetime, selector: "ion-datetime", inputs: ["cancelText", "clearText", "color", "dayValues", "disabled", "doneText", "firstDayOfWeek", "formatOptions", "highlightedDates", "hourCycle", "hourValues", "isDateEnabled", "locale", "max", "min", "minuteValues", "mode", "monthValues", "multiple", "name", "preferWheel", "presentation", "readonly", "showClearButton", "showDefaultButtons", "showDefaultTimeLabel", "showDefaultTitle", "size", "titleSelectedDatesFormatter", "value", "yearValues"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonModal, selector: "ion-modal" }, { kind: "directive", type: i1.SelectValueAccessor, selector: "ion-select, ion-radio-group, ion-segment, ion-datetime" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
637
+ ], ngImport: i0, template: "<label class=\"form-label d-flex align-items-center\">\n <ng-content select=\"[icon]\" />\n <span>{{ label }}</span>\n</label>\n\n<input readonly type=\"text\" id=\"{{ name }}-date\" placeholder=\"{{ placeholder }}\" class=\"form-control cursor-pointer\" [disabled]=\"disabled\" [required]=\"required\" [value]=\"value | date:dateFormat \">\n<ion-icon name=\"calendar\" class=\"position-absolute fs-4 cursor-pointer\" />\n\n<ion-modal trigger=\"{{ name }}-date\">\n <ng-template>\n <ion-datetime mode=\"md\" hourCycle=\"h23\" [presentation]=\"presentation\" value=\"{{ localValue }}\" [showDefaultButtons]=\"true\" (ionChange)=\"changeDate($event)\" />\n </ng-template>\n</ion-modal>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: ["ion-datetime{--background: white}ion-modal{--width: 290px;--height: auto}ion-icon{top:32px;right:16px;color:#616161}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonDatetime, selector: "ion-datetime", inputs: ["cancelText", "clearText", "color", "dayValues", "disabled", "doneText", "firstDayOfWeek", "formatOptions", "highlightedDates", "hourCycle", "hourValues", "isDateEnabled", "locale", "max", "min", "minuteValues", "mode", "monthValues", "multiple", "name", "preferWheel", "presentation", "readonly", "showClearButton", "showDefaultButtons", "showDefaultTimeLabel", "showDefaultTitle", "size", "titleSelectedDatesFormatter", "value", "yearValues"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonModal, selector: "ion-modal" }, { kind: "directive", type: i1.SelectValueAccessor, selector: "ion-select, ion-radio-group, ion-segment, ion-datetime" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
638
638
  }
639
639
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormDateComponent, decorators: [{
640
640
  type: Component,
@@ -654,7 +654,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
654
654
  provide: NG_VALIDATORS,
655
655
  useExisting: FormDateComponent
656
656
  }
657
- ], template: "<label class=\"form-label d-flex align-items-center\">\n <ng-content select=\"[icon]\" />\n <span>{{ label }}</span>\n</label>\n\n<input readonly type=\"text\" id=\"{{ name }}-date\" placeholder=\"{{ placeholder }}\" class=\"form-control cursor-pointer\" [disabled]=\"disabled\" [required]=\"required\" [value]=\"value | date:dateFormat \">\n<ion-icon name=\"calendar\" class=\"position-absolute fs-4 cursor-pointer\" />\n\n<ion-modal trigger=\"{{ name }}-date\">\n <ng-template>\n <ion-datetime mode=\"md\" [presentation]=\"presentation\" value=\"{{ localValue }}\" [showDefaultButtons]=\"true\" (ionChange)=\"changeDate($event)\" />\n </ng-template>\n</ion-modal>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: ["ion-datetime{--background: white}ion-modal{--width: 290px;--height: auto}ion-icon{top:32px;right:16px;color:#616161}\n"] }]
657
+ ], template: "<label class=\"form-label d-flex align-items-center\">\n <ng-content select=\"[icon]\" />\n <span>{{ label }}</span>\n</label>\n\n<input readonly type=\"text\" id=\"{{ name }}-date\" placeholder=\"{{ placeholder }}\" class=\"form-control cursor-pointer\" [disabled]=\"disabled\" [required]=\"required\" [value]=\"value | date:dateFormat \">\n<ion-icon name=\"calendar\" class=\"position-absolute fs-4 cursor-pointer\" />\n\n<ion-modal trigger=\"{{ name }}-date\">\n <ng-template>\n <ion-datetime mode=\"md\" hourCycle=\"h23\" [presentation]=\"presentation\" value=\"{{ localValue }}\" [showDefaultButtons]=\"true\" (ionChange)=\"changeDate($event)\" />\n </ng-template>\n</ion-modal>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: ["ion-datetime{--background: white}ion-modal{--width: 290px;--height: auto}ion-icon{top:32px;right:16px;color:#616161}\n"] }]
658
658
  }], ctorParameters: () => [{ type: undefined, decorators: [{
659
659
  type: Attribute,
660
660
  args: ['name']
@@ -1044,7 +1044,7 @@ class FormSearchableSelectComponent {
1044
1044
  provide: NG_VALIDATORS,
1045
1045
  useExisting: FormSearchableSelectComponent
1046
1046
  }
1047
- ], usesOnChanges: true, ngImport: i0, template: "<label class=\"form-label d-flex align-items-center\" [class.required]=\"required\">\n <ng-content select=\"[icon]\" />\n <span>{{ label }}</span>\n</label>\n\n<ng-select \n appendTo=\"body\"\n typeToSearchText=\"Please enter 3 or more characters\"\n bindLabel=\"{{ bindLabel }}\"\n bindValue=\"{{ bindValue }}\"\n placeholder=\"{{ placeholder }}\" \n [minTermLength]=\"3\"\n [virtualScroll]=\"true\"\n [editableSearchTerm]=\"true\"\n [ngModel]=\"value\" \n [addTag]=\"addTag\"\n [multiple]=\"multiple\"\n [readonly]=\"disabled\" \n [loading]=\"isLoading\"\n [clearable]=\"clearable\"\n [typeahead]=\"typeahead\"\n [items]=\"items$ | async\"\n (change)=\"change($event);\"\n/>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3$1.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1047
+ ], usesOnChanges: true, ngImport: i0, template: "<label class=\"form-label d-flex align-items-center\" [class.required]=\"required\">\n <ng-content select=\"[icon]\" />\n <span>{{ label }}</span>\n</label>\n\n<ng-select \n appendTo=\"body\"\n typeToSearchText=\"Please enter 3 or more characters\"\n bindLabel=\"{{ bindLabel }}\"\n bindValue=\"{{ bindValue }}\"\n placeholder=\"{{ placeholder }}\" \n [minTermLength]=\"3\"\n [virtualScroll]=\"true\"\n [editableSearchTerm]=\"true\"\n [ngModel]=\"value\" \n [addTag]=\"addTag\"\n [multiple]=\"multiple\"\n [readonly]=\"disabled\" \n [loading]=\"isLoading\"\n [clearable]=\"clearable\"\n [typeahead]=\"typeahead\"\n [items]=\"items$ | async\"\n (change)=\"change($event);\"\n/>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3$2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1048
1048
  }
1049
1049
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormSearchableSelectComponent, decorators: [{
1050
1050
  type: Component,
@@ -1153,7 +1153,7 @@ class FormSelectComponent {
1153
1153
  provide: NG_VALIDATORS,
1154
1154
  useExisting: FormSelectComponent
1155
1155
  }
1156
- ], ngImport: i0, template: "<label class=\"form-label d-flex align-items-center\" [class.required]=\"required\">\n <ng-content select=\"[icon]\"/>\n <span>{{ label }}</span>\n</label>\n\n<ng-select\n appendTo=\"body\"\n bindLabel=\"{{ bindLabel }}\"\n bindValue=\"{{ bindValue }}\"\n placeholder=\"{{ placeholder }}\"\n [virtualScroll]=\"true\"\n [items]=\"items\"\n [ngModel]=\"value\"\n [addTag]=\"addTag\"\n [multiple]=\"multiple\"\n [readonly]=\"disabled\"\n [clearable]=\"clearable\"\n [searchable]=\"searchable\"\n (change)=\"change($event);\"\n/>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: [".ng-select.ng-select-opened>.ng-select-container{background:#fff}.ng-select.ng-select-opened>.ng-select-container:hover{box-shadow:none}.ng-select.ng-select-opened>.ng-select-container .ng-arrow{top:-2px;border-color:transparent transparent #616161;border-width:0 5px 5px}.ng-select.ng-select-disabled>.ng-select-container{background-color:#e9ecef}.ng-select .ng-has-value .ng-placeholder{display:none}.ng-select .ng-select-container{color:#424242;background-color:#fff;border-radius:4px;border:2px solid #e0e0e0;min-height:36px;align-items:center}.ng-select .ng-select-container:hover{box-shadow:0 1px #0000000f}.ng-select .ng-select-container .ng-value-container{align-items:center;padding-left:10px}.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:#a8a8a8}.ng-select.ng-select-single .ng-select-container{height:36px}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{left:0;padding-left:10px;padding-right:50px}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input input{color:#424242}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value{background-color:#e9ecef;border:1px solid #fafafa}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-label{padding:0 5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{padding-top:5px;padding-left:7px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{font-size:.9em;margin-bottom:5px;color:#ed6b26;background-color:#fef3ee;border-radius:2px;margin-right:5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled{background-color:#e9ecef}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-label{padding-left:5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-label,.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:inline-block;padding:1px 5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon:hover{background-color:#fde2d6}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right:1px solid #fbd1be}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.right{border-left:1px solid #fbd1be}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{padding:0 0 3px 3px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input>input{color:#424242}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{padding-bottom:5px;padding-left:3px}.ng-select .ng-clear-wrapper{color:#adadad}.ng-select .ng-clear-wrapper:hover .ng-clear{color:#ff3b30}.ng-select .ng-spinner-zone{padding:5px 5px 0 0}.ng-select .ng-arrow-wrapper{width:25px;padding-right:5px}.ng-select .ng-arrow-wrapper .ng-arrow{border-color:#616161 transparent transparent;border-style:solid;border-width:5px 5px 2.5px}.ng-dropdown-panel{background-color:#fff;border:2px solid #e0e0e0;box-shadow:0 1px #0000000f;left:0;z-index:20100!important;border-radius:4px}.ng-dropdown-panel.ng-select-top{bottom:100%;margin-bottom:2px}.ng-dropdown-panel.ng-select-bottom{top:100%;margin-top:2px}.ng-dropdown-panel .ng-dropdown-header{border-bottom:1px solid #e0e0e0;padding:5px 7px}.ng-dropdown-panel .ng-dropdown-footer{border-top:1px solid #e0e0e0;padding:5px 7px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{-webkit-user-select:none;user-select:none;padding:8px 10px;font-weight:500;color:#0000008a;cursor:pointer}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-disabled{cursor:default}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-marked{background-color:#fef3ee}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-selected,.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-selected.ng-option-marked{color:#0000008a;background-color:#fef3ee;font-weight:600}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{background-color:#fff;color:#000000de;padding:8px 10px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected,.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked{color:#ed6b26;background-color:#fef3ee}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected .ng-option-label,.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked .ng-option-label{font-weight:600}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked{background-color:#fef3ee;color:#424242}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-disabled{color:#888}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-child{padding-left:22px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-tag-label{font-size:80%;font-weight:400;padding-right:5px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3$1.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1156
+ ], ngImport: i0, template: "<label class=\"form-label d-flex align-items-center\" [class.required]=\"required\">\n <ng-content select=\"[icon]\"/>\n <span>{{ label }}</span>\n</label>\n\n<ng-select\n appendTo=\"body\"\n bindLabel=\"{{ bindLabel }}\"\n bindValue=\"{{ bindValue }}\"\n placeholder=\"{{ placeholder }}\"\n [virtualScroll]=\"true\"\n [items]=\"items\"\n [ngModel]=\"value\"\n [addTag]=\"addTag\"\n [multiple]=\"multiple\"\n [readonly]=\"disabled\"\n [clearable]=\"clearable\"\n [searchable]=\"searchable\"\n (change)=\"change($event);\"\n/>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: [".ng-select.ng-select-opened>.ng-select-container{background:#fff}.ng-select.ng-select-opened>.ng-select-container:hover{box-shadow:none}.ng-select.ng-select-opened>.ng-select-container .ng-arrow{top:-2px;border-color:transparent transparent #616161;border-width:0 5px 5px}.ng-select.ng-select-disabled>.ng-select-container{background-color:#e9ecef}.ng-select .ng-has-value .ng-placeholder{display:none}.ng-select .ng-select-container{color:#424242;background-color:#fff;border-radius:4px;border:2px solid #e0e0e0;min-height:38px;align-items:center}.ng-select .ng-select-container:hover{box-shadow:0 1px #0000000f}.ng-select .ng-select-container .ng-value-container{align-items:center;padding-left:10px}.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:#a8a8a8}.ng-select.ng-select-single .ng-select-container{height:38px}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{left:0;padding-left:10px;padding-right:50px}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input input{color:#424242}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value{background-color:#e9ecef;border:1px solid #fafafa}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-label{padding:0 5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{padding-top:5px;padding-left:7px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{font-size:.9em;margin-bottom:5px;color:#ed6b26;background-color:#fef3ee;border-radius:2px;margin-right:5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled{background-color:#e9ecef}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-label{padding-left:5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-label,.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:inline-block;padding:1px 5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon:hover{background-color:#fde2d6}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right:1px solid #fbd1be}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.right{border-left:1px solid #fbd1be}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{padding:0 0 3px 3px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input>input{color:#424242}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{padding-bottom:5px;padding-left:3px}.ng-select .ng-clear-wrapper{color:#adadad}.ng-select .ng-clear-wrapper:hover .ng-clear{color:#ff3b30}.ng-select .ng-spinner-zone{padding:5px 5px 0 0}.ng-select .ng-arrow-wrapper{width:25px;padding-right:5px}.ng-select .ng-arrow-wrapper .ng-arrow{border-color:#616161 transparent transparent;border-style:solid;border-width:5px 5px 2.5px}.ng-dropdown-panel{background-color:#fff;border:2px solid #e0e0e0;box-shadow:0 1px #0000000f;left:0;z-index:20100!important;border-radius:4px}.ng-dropdown-panel.ng-select-top{bottom:100%;margin-bottom:2px}.ng-dropdown-panel.ng-select-bottom{top:100%;margin-top:2px}.ng-dropdown-panel .ng-dropdown-header{border-bottom:1px solid #e0e0e0;padding:5px 7px}.ng-dropdown-panel .ng-dropdown-footer{border-top:1px solid #e0e0e0;padding:5px 7px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{-webkit-user-select:none;user-select:none;padding:8px 10px;font-weight:500;color:#0000008a;cursor:pointer}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-disabled{cursor:default}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-marked{background-color:#fef3ee}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-selected,.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-selected.ng-option-marked{color:#0000008a;background-color:#fef3ee;font-weight:600}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{background-color:#fff;color:#000000de;padding:8px 10px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected,.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked{color:#ed6b26;background-color:#fef3ee}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected .ng-option-label,.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked .ng-option-label{font-weight:600}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked{background-color:#fef3ee;color:#424242}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-disabled{color:#888}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-child{padding-left:22px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-tag-label{font-size:80%;font-weight:400;padding-right:5px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3$2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1157
1157
  }
1158
1158
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormSelectComponent, decorators: [{
1159
1159
  type: Component,
@@ -1174,7 +1174,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
1174
1174
  provide: NG_VALIDATORS,
1175
1175
  useExisting: FormSelectComponent
1176
1176
  }
1177
- ], template: "<label class=\"form-label d-flex align-items-center\" [class.required]=\"required\">\n <ng-content select=\"[icon]\"/>\n <span>{{ label }}</span>\n</label>\n\n<ng-select\n appendTo=\"body\"\n bindLabel=\"{{ bindLabel }}\"\n bindValue=\"{{ bindValue }}\"\n placeholder=\"{{ placeholder }}\"\n [virtualScroll]=\"true\"\n [items]=\"items\"\n [ngModel]=\"value\"\n [addTag]=\"addTag\"\n [multiple]=\"multiple\"\n [readonly]=\"disabled\"\n [clearable]=\"clearable\"\n [searchable]=\"searchable\"\n (change)=\"change($event);\"\n/>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: [".ng-select.ng-select-opened>.ng-select-container{background:#fff}.ng-select.ng-select-opened>.ng-select-container:hover{box-shadow:none}.ng-select.ng-select-opened>.ng-select-container .ng-arrow{top:-2px;border-color:transparent transparent #616161;border-width:0 5px 5px}.ng-select.ng-select-disabled>.ng-select-container{background-color:#e9ecef}.ng-select .ng-has-value .ng-placeholder{display:none}.ng-select .ng-select-container{color:#424242;background-color:#fff;border-radius:4px;border:2px solid #e0e0e0;min-height:36px;align-items:center}.ng-select .ng-select-container:hover{box-shadow:0 1px #0000000f}.ng-select .ng-select-container .ng-value-container{align-items:center;padding-left:10px}.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:#a8a8a8}.ng-select.ng-select-single .ng-select-container{height:36px}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{left:0;padding-left:10px;padding-right:50px}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input input{color:#424242}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value{background-color:#e9ecef;border:1px solid #fafafa}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-label{padding:0 5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{padding-top:5px;padding-left:7px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{font-size:.9em;margin-bottom:5px;color:#ed6b26;background-color:#fef3ee;border-radius:2px;margin-right:5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled{background-color:#e9ecef}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-label{padding-left:5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-label,.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:inline-block;padding:1px 5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon:hover{background-color:#fde2d6}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right:1px solid #fbd1be}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.right{border-left:1px solid #fbd1be}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{padding:0 0 3px 3px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input>input{color:#424242}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{padding-bottom:5px;padding-left:3px}.ng-select .ng-clear-wrapper{color:#adadad}.ng-select .ng-clear-wrapper:hover .ng-clear{color:#ff3b30}.ng-select .ng-spinner-zone{padding:5px 5px 0 0}.ng-select .ng-arrow-wrapper{width:25px;padding-right:5px}.ng-select .ng-arrow-wrapper .ng-arrow{border-color:#616161 transparent transparent;border-style:solid;border-width:5px 5px 2.5px}.ng-dropdown-panel{background-color:#fff;border:2px solid #e0e0e0;box-shadow:0 1px #0000000f;left:0;z-index:20100!important;border-radius:4px}.ng-dropdown-panel.ng-select-top{bottom:100%;margin-bottom:2px}.ng-dropdown-panel.ng-select-bottom{top:100%;margin-top:2px}.ng-dropdown-panel .ng-dropdown-header{border-bottom:1px solid #e0e0e0;padding:5px 7px}.ng-dropdown-panel .ng-dropdown-footer{border-top:1px solid #e0e0e0;padding:5px 7px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{-webkit-user-select:none;user-select:none;padding:8px 10px;font-weight:500;color:#0000008a;cursor:pointer}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-disabled{cursor:default}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-marked{background-color:#fef3ee}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-selected,.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-selected.ng-option-marked{color:#0000008a;background-color:#fef3ee;font-weight:600}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{background-color:#fff;color:#000000de;padding:8px 10px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected,.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked{color:#ed6b26;background-color:#fef3ee}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected .ng-option-label,.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked .ng-option-label{font-weight:600}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked{background-color:#fef3ee;color:#424242}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-disabled{color:#888}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-child{padding-left:22px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-tag-label{font-size:80%;font-weight:400;padding-right:5px}\n"] }]
1177
+ ], template: "<label class=\"form-label d-flex align-items-center\" [class.required]=\"required\">\n <ng-content select=\"[icon]\"/>\n <span>{{ label }}</span>\n</label>\n\n<ng-select\n appendTo=\"body\"\n bindLabel=\"{{ bindLabel }}\"\n bindValue=\"{{ bindValue }}\"\n placeholder=\"{{ placeholder }}\"\n [virtualScroll]=\"true\"\n [items]=\"items\"\n [ngModel]=\"value\"\n [addTag]=\"addTag\"\n [multiple]=\"multiple\"\n [readonly]=\"disabled\"\n [clearable]=\"clearable\"\n [searchable]=\"searchable\"\n (change)=\"change($event);\"\n/>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: [".ng-select.ng-select-opened>.ng-select-container{background:#fff}.ng-select.ng-select-opened>.ng-select-container:hover{box-shadow:none}.ng-select.ng-select-opened>.ng-select-container .ng-arrow{top:-2px;border-color:transparent transparent #616161;border-width:0 5px 5px}.ng-select.ng-select-disabled>.ng-select-container{background-color:#e9ecef}.ng-select .ng-has-value .ng-placeholder{display:none}.ng-select .ng-select-container{color:#424242;background-color:#fff;border-radius:4px;border:2px solid #e0e0e0;min-height:38px;align-items:center}.ng-select .ng-select-container:hover{box-shadow:0 1px #0000000f}.ng-select .ng-select-container .ng-value-container{align-items:center;padding-left:10px}.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:#a8a8a8}.ng-select.ng-select-single .ng-select-container{height:38px}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{left:0;padding-left:10px;padding-right:50px}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input input{color:#424242}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value{background-color:#e9ecef;border:1px solid #fafafa}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-label{padding:0 5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{padding-top:5px;padding-left:7px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{font-size:.9em;margin-bottom:5px;color:#ed6b26;background-color:#fef3ee;border-radius:2px;margin-right:5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled{background-color:#e9ecef}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-label{padding-left:5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-label,.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:inline-block;padding:1px 5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon:hover{background-color:#fde2d6}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right:1px solid #fbd1be}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.right{border-left:1px solid #fbd1be}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{padding:0 0 3px 3px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input>input{color:#424242}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{padding-bottom:5px;padding-left:3px}.ng-select .ng-clear-wrapper{color:#adadad}.ng-select .ng-clear-wrapper:hover .ng-clear{color:#ff3b30}.ng-select .ng-spinner-zone{padding:5px 5px 0 0}.ng-select .ng-arrow-wrapper{width:25px;padding-right:5px}.ng-select .ng-arrow-wrapper .ng-arrow{border-color:#616161 transparent transparent;border-style:solid;border-width:5px 5px 2.5px}.ng-dropdown-panel{background-color:#fff;border:2px solid #e0e0e0;box-shadow:0 1px #0000000f;left:0;z-index:20100!important;border-radius:4px}.ng-dropdown-panel.ng-select-top{bottom:100%;margin-bottom:2px}.ng-dropdown-panel.ng-select-bottom{top:100%;margin-top:2px}.ng-dropdown-panel .ng-dropdown-header{border-bottom:1px solid #e0e0e0;padding:5px 7px}.ng-dropdown-panel .ng-dropdown-footer{border-top:1px solid #e0e0e0;padding:5px 7px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{-webkit-user-select:none;user-select:none;padding:8px 10px;font-weight:500;color:#0000008a;cursor:pointer}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-disabled{cursor:default}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-marked{background-color:#fef3ee}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-selected,.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-selected.ng-option-marked{color:#0000008a;background-color:#fef3ee;font-weight:600}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{background-color:#fff;color:#000000de;padding:8px 10px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected,.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked{color:#ed6b26;background-color:#fef3ee}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected .ng-option-label,.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked .ng-option-label{font-weight:600}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked{background-color:#fef3ee;color:#424242}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-disabled{color:#888}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-child{padding-left:22px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-tag-label{font-size:80%;font-weight:400;padding-right:5px}\n"] }]
1178
1178
  }], ctorParameters: () => [{ type: undefined, decorators: [{
1179
1179
  type: Attribute,
1180
1180
  args: ['placeholder']
@@ -1393,765 +1393,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
1393
1393
  type: Output
1394
1394
  }] } });
1395
1395
 
1396
- class FilterComponent {
1397
- constructor(placeholder, ch, popoverCtrl) {
1398
- this.placeholder = placeholder;
1399
- this.ch = ch;
1400
- this.popoverCtrl = popoverCtrl;
1401
- this.onSearch = new EventEmitter();
1402
- this.form = new FormGroup({});
1403
- this.activeFilter = [];
1404
- }
1405
- ngOnInit() {
1406
- this.config.fields.forEach(({ key, initialValue }) => {
1407
- if (typeof key === 'string')
1408
- this.createFormControl(key, initialValue);
1409
- else {
1410
- key.forEach((k, i) => this.createFormControl(k, initialValue?.at(i)));
1411
- }
1412
- });
1413
- }
1414
- close() { this.popoverCtrl.dismiss(); }
1415
- clear() {
1416
- this.resetValue();
1417
- this.form.reset();
1418
- this.onSearch.emit({ mode: this.config.mode, data: null });
1419
- }
1420
- removeFilter(i) {
1421
- this.form.controls[this.activeFilter[i].key].setValue('');
1422
- this.activeFilter.splice(i, 1);
1423
- this.emitValue();
1424
- }
1425
- search() {
1426
- this.resetValue();
1427
- this.emitValue((k, v) => this.activeFilter.push({ key: k, value: v, label: `${k}:${k.includes('date') ? formatDate(v, 'dd MMM yyyy', 'en-US') : v}` }));
1428
- this.close();
1429
- }
1430
- add() {
1431
- const { key, value } = this.getValue(this.searchBox.nativeElement.value);
1432
- if (this.config.fields.findIndex(({ key: k }) => k === key) === -1) {
1433
- this.searchBox.nativeElement.value = '';
1434
- return;
1435
- }
1436
- const i = this.activeFilter.findIndex(({ key: k }) => k === key);
1437
- if (i === -1)
1438
- this.activeFilter.push({ label: `${key}:${value}`, key, value });
1439
- else {
1440
- this.activeFilter[i].key = key;
1441
- this.activeFilter[i].value = value;
1442
- this.activeFilter[i].label = `${key}:${value}`;
1443
- }
1444
- this.form.patchValue({ [key]: value });
1445
- this.searchBox.nativeElement.value = '';
1446
- this.emitValue();
1447
- }
1448
- resetValue() {
1449
- this.activeFilter.length = 0;
1450
- this.searchBox.nativeElement.value = '';
1451
- }
1452
- getValue(value) {
1453
- const values = value.split(':');
1454
- if (values.length === 1)
1455
- return { key: this.config.fields[0].key, value: values[0] };
1456
- return { key: values[0], value: values[1] };
1457
- }
1458
- emitValue(extraAction) {
1459
- let flag = false;
1460
- const f = this.form.getRawValue();
1461
- const data = {};
1462
- Object.keys(f).forEach((k) => {
1463
- if (!f[k])
1464
- return;
1465
- flag = true;
1466
- data[k] = f[k];
1467
- extraAction?.(k, f[k]);
1468
- });
1469
- this.onSearch.emit({ mode: this.config.mode, data: flag ? data : null });
1470
- }
1471
- createFormControl(key, val) {
1472
- this.form.addControl(key, new FormControl(''));
1473
- if (val) {
1474
- this.form.controls[key].setValue(val);
1475
- this.activeFilter.push({ label: `${key}:${val}`, key, value: val });
1476
- }
1477
- }
1478
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FilterComponent, deps: [{ token: 'placeholder', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i1.PopoverController }], target: i0.ɵɵFactoryTarget.Component }); }
1479
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: FilterComponent, isStandalone: true, selector: "up-filter", inputs: { id: "id", config: "config" }, outputs: { onSearch: "onSearch" }, host: { classAttribute: "d-block position-relative" }, viewQueries: [{ propertyName: "searchBox", first: true, predicate: ["searchBox"], descendants: true }], ngImport: i0, template: "<ion-icon name=\"search\" class=\"fs-4 position-absolute\" />\n\n<div class=\"d-flex align-items-center form-control ps-5 py-0 pe-0 gap-3\">\n <div *ngIf=\"activeFilter.length > 0\" class=\"d-flex flex-grow-1 flex-shrink-0 tag-container gap-2 text-nowrap overflow-auto\">\n <div class=\"tag-item p-1 rounded d-flex align-items-center user-select-none\" *ngFor=\"let item of activeFilter; index as i\">\n <ion-icon name=\"close\" class=\"pe-1 me-1 cursor-pointer text-primary\" (click)=\"removeFilter(i);\" />\n {{ item.label }}\n </div>\n </div>\n\n <input #searchBox type=\"search\" placeholder=\"{{ placeholder }}\" class=\"flex-shrink-1 border-0 form-control ps-0 py-2\" [class.adv]=\"config.mode === 'advanced'\" (keyup.enter)=\"add();\" />\n</div>\n\n<ng-container *ngIf=\"config.mode === 'advanced'\">\n <ion-icon name=\"filter\" class=\"position-absolute fs-4 cursor-pointer\" id=\"filter-{{ id }}\" />\n <ion-icon name=\"close\" class=\"position-absolute fs-4 cursor-pointer\" (click)=\"clear();\" />\n\n <ion-popover trigger=\"filter-{{ id }}\" triggerAction=\"click\">\n <ng-template>\n <div class=\"d-flex flex-column filter\">\n <div class=\"flex-shrink-0 border-bottom p-1 pe-4 d-flex align-items-center\">\n <ion-buttons>\n <ion-button size=\"small\" (click)=\"close()\">\n <ion-icon slot=\"icon-only\" name=\"close\" />\n </ion-button>\n </ion-buttons>\n \n <div class=\"fs-5 fw-medium\">Advanced Filter</div>\n </div>\n \n <form class=\"flex-grow-1 overflow-auto px-4\" [formGroup]=\"form\">\n <ng-container *ngFor=\"let c of config.fields\">\n <ng-container [ngSwitch]=\"c.type\">\n <up-input type=\"number\" autocomplete=\"off\" class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" *ngSwitchCase=\"'number'\" />\n \n <div class=\"my-4\" *ngSwitchCase=\"'checkbox'\">\n <ion-checkbox labelPlacement=\"end\" formControlName=\"{{ c.key }}\">{{ c.label }}</ion-checkbox>\n </div>\n \n <div class=\"d-flex gap-3 my-4\" *ngSwitchCase=\"'date-range'\">\n <up-date class=\"flex-grow-1\" name=\"filter-from\" label=\"{{ c.label[0] }}\" formControlName=\"{{ c.key[0] }}\" />\n <up-date class=\"flex-grow-1\" name=\"filter-to\" label=\"{{ c.label[1] }}\" formControlName=\"{{ c.key[1] }}\" />\n </div>\n \n <up-select class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" [items]=\"c.options!\" *ngSwitchCase=\"'select'\" />\n <up-searchable-select class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" [queryFunc]=\"c.getOptions!\" [initialItems]=\"c.options!\" *ngSwitchCase=\"'searchable-select'\" />\n \n <up-input type=\"text\" autocomplete=\"off\" class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" *ngSwitchDefault />\n </ng-container>\n </ng-container>\n </form>\n \n <div class=\"flex-shrink-0 py-3 px-4 border-top d-flex gap-3\">\n <ion-button class=\"flex-grow-1\" color=\"secondary\" (click)=\"form.reset();\">Reset</ion-button>\n <ion-button class=\"flex-grow-1\" color=\"primary\" (click)=\"search();\">Search</ion-button>\n </div>\n </div>\n </ng-template>\n </ion-popover> \n</ng-container>\n", styles: ["ion-icon{top:7px}ion-icon[name=close]{right:16px}ion-icon[name=search]{left:14px}ion-icon[name=filter]{right:48px}ion-popover{--width: 80%;--max-width: 450px}.adv{padding-right:60px}.fs-5,ion-icon{color:#616161}.tag-container{max-width:47%}.tag-container::-webkit-scrollbar{height:0px}.tag-item{color:#ed6b26;background-color:#fef3ee}.tag-item ion-icon{border-right:1px solid #fbd1be}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i1.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i1.IonCheckbox, selector: "ion-checkbox", inputs: ["alignment", "checked", "color", "disabled", "indeterminate", "justify", "labelPlacement", "legacy", "mode", "name", "value"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonPopover, selector: "ion-popover" }, { kind: "directive", type: i1.BooleanValueAccessor, selector: "ion-checkbox,ion-toggle" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: FormDateComponent, selector: "up-date", inputs: ["label", "required", "disabled", "presentation"] }, { kind: "component", type: FormInputComponent, selector: "up-input", inputs: ["label", "value", "required", "disabled"], outputs: ["onInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FormSelectComponent, selector: "up-select", inputs: ["items", "clearable", "label", "multiple", "required", "addTag", "disabled", "searchable", "bindLabel", "bindValue"] }, { kind: "component", type: FormSearchableSelectComponent, selector: "up-searchable-select", inputs: ["queryFunc", "clearable", "label", "initialItems", "required", "addTag", "disabled", "multiple", "bindLabel", "bindValue"], outputs: ["onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1480
- }
1481
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FilterComponent, decorators: [{
1482
- type: Component,
1483
- args: [{ standalone: true, selector: 'up-filter', changeDetection: ChangeDetectionStrategy.OnPush, host: {
1484
- class: 'd-block position-relative'
1485
- }, imports: [
1486
- IonicModule,
1487
- CommonModule,
1488
- FormDateComponent,
1489
- FormInputComponent,
1490
- ReactiveFormsModule,
1491
- FormSelectComponent,
1492
- FormSearchableSelectComponent
1493
- ], template: "<ion-icon name=\"search\" class=\"fs-4 position-absolute\" />\n\n<div class=\"d-flex align-items-center form-control ps-5 py-0 pe-0 gap-3\">\n <div *ngIf=\"activeFilter.length > 0\" class=\"d-flex flex-grow-1 flex-shrink-0 tag-container gap-2 text-nowrap overflow-auto\">\n <div class=\"tag-item p-1 rounded d-flex align-items-center user-select-none\" *ngFor=\"let item of activeFilter; index as i\">\n <ion-icon name=\"close\" class=\"pe-1 me-1 cursor-pointer text-primary\" (click)=\"removeFilter(i);\" />\n {{ item.label }}\n </div>\n </div>\n\n <input #searchBox type=\"search\" placeholder=\"{{ placeholder }}\" class=\"flex-shrink-1 border-0 form-control ps-0 py-2\" [class.adv]=\"config.mode === 'advanced'\" (keyup.enter)=\"add();\" />\n</div>\n\n<ng-container *ngIf=\"config.mode === 'advanced'\">\n <ion-icon name=\"filter\" class=\"position-absolute fs-4 cursor-pointer\" id=\"filter-{{ id }}\" />\n <ion-icon name=\"close\" class=\"position-absolute fs-4 cursor-pointer\" (click)=\"clear();\" />\n\n <ion-popover trigger=\"filter-{{ id }}\" triggerAction=\"click\">\n <ng-template>\n <div class=\"d-flex flex-column filter\">\n <div class=\"flex-shrink-0 border-bottom p-1 pe-4 d-flex align-items-center\">\n <ion-buttons>\n <ion-button size=\"small\" (click)=\"close()\">\n <ion-icon slot=\"icon-only\" name=\"close\" />\n </ion-button>\n </ion-buttons>\n \n <div class=\"fs-5 fw-medium\">Advanced Filter</div>\n </div>\n \n <form class=\"flex-grow-1 overflow-auto px-4\" [formGroup]=\"form\">\n <ng-container *ngFor=\"let c of config.fields\">\n <ng-container [ngSwitch]=\"c.type\">\n <up-input type=\"number\" autocomplete=\"off\" class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" *ngSwitchCase=\"'number'\" />\n \n <div class=\"my-4\" *ngSwitchCase=\"'checkbox'\">\n <ion-checkbox labelPlacement=\"end\" formControlName=\"{{ c.key }}\">{{ c.label }}</ion-checkbox>\n </div>\n \n <div class=\"d-flex gap-3 my-4\" *ngSwitchCase=\"'date-range'\">\n <up-date class=\"flex-grow-1\" name=\"filter-from\" label=\"{{ c.label[0] }}\" formControlName=\"{{ c.key[0] }}\" />\n <up-date class=\"flex-grow-1\" name=\"filter-to\" label=\"{{ c.label[1] }}\" formControlName=\"{{ c.key[1] }}\" />\n </div>\n \n <up-select class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" [items]=\"c.options!\" *ngSwitchCase=\"'select'\" />\n <up-searchable-select class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" [queryFunc]=\"c.getOptions!\" [initialItems]=\"c.options!\" *ngSwitchCase=\"'searchable-select'\" />\n \n <up-input type=\"text\" autocomplete=\"off\" class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" *ngSwitchDefault />\n </ng-container>\n </ng-container>\n </form>\n \n <div class=\"flex-shrink-0 py-3 px-4 border-top d-flex gap-3\">\n <ion-button class=\"flex-grow-1\" color=\"secondary\" (click)=\"form.reset();\">Reset</ion-button>\n <ion-button class=\"flex-grow-1\" color=\"primary\" (click)=\"search();\">Search</ion-button>\n </div>\n </div>\n </ng-template>\n </ion-popover> \n</ng-container>\n", styles: ["ion-icon{top:7px}ion-icon[name=close]{right:16px}ion-icon[name=search]{left:14px}ion-icon[name=filter]{right:48px}ion-popover{--width: 80%;--max-width: 450px}.adv{padding-right:60px}.fs-5,ion-icon{color:#616161}.tag-container{max-width:47%}.tag-container::-webkit-scrollbar{height:0px}.tag-item{color:#ed6b26;background-color:#fef3ee}.tag-item ion-icon{border-right:1px solid #fbd1be}\n"] }]
1494
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1495
- type: Attribute,
1496
- args: ['placeholder']
1497
- }] }, { type: i0.ChangeDetectorRef }, { type: i1.PopoverController }], propDecorators: { id: [{
1498
- type: Input,
1499
- args: [{ required: true }]
1500
- }], config: [{
1501
- type: Input,
1502
- args: [{ required: true }]
1503
- }], onSearch: [{
1504
- type: Output
1505
- }], searchBox: [{
1506
- type: ViewChild,
1507
- args: ['searchBox']
1508
- }] } });
1509
-
1510
- class GridService {
1511
- constructor() {
1512
- this.apis = {};
1513
- }
1514
- getApi(id) { return this.apis[id]; }
1515
- setApi(id, api) { this.apis[id] = api; }
1516
- refreshGridCache(id) {
1517
- this.apis[id].refreshInfiniteCache();
1518
- }
1519
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1520
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridService, providedIn: 'root' }); }
1521
- }
1522
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridService, decorators: [{
1523
- type: Injectable,
1524
- args: [{
1525
- providedIn: 'root'
1526
- }]
1527
- }] });
1528
-
1529
- class GridSnapshotComponent {
1530
- constructor(service) {
1531
- this.service = service;
1532
- this.id = 'grid-s';
1533
- this.rowSelection = 'single';
1534
- this.onRowClick = new EventEmitter();
1535
- this.onGridReady = new EventEmitter();
1536
- this.onSelectionChanged = new EventEmitter();
1537
- this.defaultColDef = { minWidth: 200, flex: 1, sortable: true, resizable: true, sortingOrder: ['asc', 'desc'], cellStyle: { textAlign: 'left' } };
1538
- this.sort = { order: '', orderBy: '' };
1539
- ModuleRegistry.register(InfiniteRowModelModule);
1540
- }
1541
- ngOnInit() {
1542
- if (!this.config.rowPerPage)
1543
- this.config.rowPerPage = 50;
1544
- this.config.noRowText = `<span class="f20">${this.config.noRowText ?? 'Data not found'}</span>`;
1545
- }
1546
- ngOnDestroy() { this.subs?.unsubscribe(); }
1547
- clickRow(data) { this.onRowClick.emit(data.node); }
1548
- dragColumn({ api }) { localStorage.setItem(this.id, JSON.stringify(api.getColumnState())); }
1549
- changeSelected(data) { this.onSelectionChanged.emit(data); }
1550
- changePagination(ev) {
1551
- if (ev.newPageSize)
1552
- this.config.rowPerPage = this.gridApi.paginationGetPageSize();
1553
- }
1554
- setDatasource(ev) {
1555
- this.gridApi = ev.api;
1556
- this.onGridReady.emit(ev);
1557
- this.service.setApi(this.id, this.gridApi);
1558
- const state = JSON.parse(localStorage.getItem(this.id));
1559
- if (state)
1560
- ev.api.applyColumnState({ state, applyOrder: true });
1561
- this.reset();
1562
- }
1563
- reset() {
1564
- const datasource = {
1565
- getRows: ({ sortModel: [{ colId, sort }], successCallback, failCallback }) => {
1566
- this.gridApi.showLoadingOverlay();
1567
- if (colId !== this.sort.orderBy || sort !== this.sort.order) {
1568
- this.sort.order = sort;
1569
- this.sort.orderBy = colId;
1570
- this.gridApi.paginationGoToFirstPage();
1571
- }
1572
- const page = this.gridApi.paginationGetCurrentPage();
1573
- if (page === 0)
1574
- this.after = null;
1575
- this.subs = this.config.getDataSnapshot(this.config.rowPerPage, colId, sort, this.after).subscribe({
1576
- next: ({ data, totalRecord }) => {
1577
- this.gridApi.hideOverlay();
1578
- const { edges, pageInfo } = data;
1579
- if (edges.length > 0)
1580
- this.after = pageInfo.endCursor;
1581
- if (page === 0) {
1582
- if (edges.length === 0)
1583
- this.gridApi.showNoRowsOverlay();
1584
- this.count = totalRecord;
1585
- }
1586
- if (!this.config.useTotalRecord && !pageInfo.hasNextPage) {
1587
- this.count = (page * this.config.rowPerPage) + edges.length;
1588
- }
1589
- successCallback(edges, this.count);
1590
- },
1591
- error: () => {
1592
- this.gridApi.hideOverlay();
1593
- this.gridApi.showNoRowsOverlay();
1594
- failCallback();
1595
- }
1596
- });
1597
- }
1598
- };
1599
- this.gridApi.setGridOption('datasource', datasource);
1600
- }
1601
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridSnapshotComponent, deps: [{ token: GridService }], target: i0.ɵɵFactoryTarget.Component }); }
1602
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: GridSnapshotComponent, isStandalone: true, selector: "up-snapshot-grid", inputs: { id: "id", config: "config", rowSelection: "rowSelection" }, outputs: { onRowClick: "onRowClick", onGridReady: "onGridReady", onSelectionChanged: "onSelectionChanged" }, host: { classAttribute: "d-block h-100 w-100" }, ngImport: i0, template: "<ag-grid-angular class=\"ag-theme-balham h-100\"\n rowModelType=\"infinite\"\n [pagination]=\"true\"\n [animateRows]=\"true\"\n [rowSelection]=\"rowSelection\"\n [columnDefs]=\"config.colDefs\"\n [defaultColDef]=\"defaultColDef\"\n [cacheBlockSize]=\"config.rowPerPage\"\n [paginationPageSize]=\"config.rowPerPage\"\n [overlayNoRowsTemplate]=\"config.noRowText\"\n (dragStopped)=\"dragColumn($event)\"\n (gridReady)=\"setDatasource($event)\"\n (rowClicked)=\"clickRow($event.data)\"\n (selectionChanged)=\"changeSelected($event)\"\n (paginationChanged)=\"changePagination($event)\"\n/>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AgGridModule }, { kind: "component", type: i2$1.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "columnMenu", "suppressMenuHide", "enableBrowserTooltips", "tooltipTrigger", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "tooltipInteraction", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "suppressCutToClipboard", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "dataTypeDefinitions", "maintainColumnOrder", "suppressFieldDotNotation", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "autoSizeStrategy", "components", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterMovesDown", "enterMovesDownAfterEdit", "enterNavigatesVertically", "enterNavigatesVerticallyAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "quickFilterText", "cacheQuickFilter", "excludeHiddenColumnsFromQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "excludeChildrenWhenTreeDataFiltering", "enableAdvancedFilter", "advancedFilterModel", "includeHiddenColumnsInAdvancedFilter", "advancedFilterParent", "advancedFilterBuilderParams", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "enableChartToolPanelsButton", "suppressChartToolPanelsButton", "chartToolPanelsDef", "loadingCellRenderer", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressParentsInRowNodes", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationPageSizeSelector", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotDefaultExpanded", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "alwaysAggregateAtRootLevel", "suppressAggAtRootLevel", "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", "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", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideEnableClientSideSort", "serverSideOnlyRefreshFilteredGroups", "serverSideFilterAllLevels", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSidePivotResultFieldSeparator", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellFocus", "suppressHeaderFocus", "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", "functionsPassive", "enableGroupEdit", "initialState", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processUnpinnedColumns", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "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", "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", "rangeDeleteStart", "rangeDeleteEnd", "filterOpened", "filterChanged", "filterModified", "advancedFilterBuilderVisibleChanged", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "gridReady", "gridPreDestroyed", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "stateUpdated", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pinnedRowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "storeRefreshed", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "tooltipShow", "tooltipHide", "sortChanged", "columnRowGroupChangeRequest", "columnPivotChangeRequest", "columnValueChangeRequest", "columnAggFuncChangeRequest"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1603
- }
1604
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridSnapshotComponent, decorators: [{
1605
- type: Component,
1606
- args: [{ standalone: true, selector: 'up-snapshot-grid', changeDetection: ChangeDetectionStrategy.OnPush, host: {
1607
- class: 'd-block h-100 w-100'
1608
- }, imports: [
1609
- AgGridModule
1610
- ], template: "<ag-grid-angular class=\"ag-theme-balham h-100\"\n rowModelType=\"infinite\"\n [pagination]=\"true\"\n [animateRows]=\"true\"\n [rowSelection]=\"rowSelection\"\n [columnDefs]=\"config.colDefs\"\n [defaultColDef]=\"defaultColDef\"\n [cacheBlockSize]=\"config.rowPerPage\"\n [paginationPageSize]=\"config.rowPerPage\"\n [overlayNoRowsTemplate]=\"config.noRowText\"\n (dragStopped)=\"dragColumn($event)\"\n (gridReady)=\"setDatasource($event)\"\n (rowClicked)=\"clickRow($event.data)\"\n (selectionChanged)=\"changeSelected($event)\"\n (paginationChanged)=\"changePagination($event)\"\n/>\n" }]
1611
- }], ctorParameters: () => [{ type: GridService }], propDecorators: { id: [{
1612
- type: Input
1613
- }], config: [{
1614
- type: Input,
1615
- args: [{ required: true }]
1616
- }], rowSelection: [{
1617
- type: Input
1618
- }], onRowClick: [{
1619
- type: Output
1620
- }], onGridReady: [{
1621
- type: Output
1622
- }], onSelectionChanged: [{
1623
- type: Output
1624
- }] } });
1625
-
1626
- class GridPaginationComponent {
1627
- constructor(service) {
1628
- this.service = service;
1629
- this.rowData = [];
1630
- this.id = 'grid-p';
1631
- this.rowModelType = 'infinite';
1632
- this.rowSelection = 'single';
1633
- this.onRowClick = new EventEmitter();
1634
- this.onGridReady = new EventEmitter();
1635
- this.onSelectionChanged = new EventEmitter();
1636
- this.defaultColDef = { minWidth: 200, flex: 1, sortable: true, resizable: true, sortingOrder: ['asc', 'desc'], cellStyle: { textAlign: 'left' } };
1637
- }
1638
- ngOnInit() {
1639
- ModuleRegistry.register(this.rowModelType === 'infinite' ? InfiniteRowModelModule : ClientSideRowModelModule);
1640
- if (!this.config.rowPerPage)
1641
- this.config.rowPerPage = 50;
1642
- this.config.noRowText = `<span class="f20">${this.config.noRowText ?? 'Data not found'}</span>`;
1643
- }
1644
- ngOnDestroy() { this.subs?.unsubscribe(); }
1645
- clickRow(data) { this.onRowClick.emit(data); }
1646
- dragColumn({ api }) { localStorage.setItem(this.id, JSON.stringify(api.getColumnState())); }
1647
- changeSelected(data) { this.onSelectionChanged.emit(data); }
1648
- changePagination(ev) {
1649
- if (ev.newPageSize)
1650
- this.config.rowPerPage = this.gridApi.paginationGetPageSize();
1651
- }
1652
- setDatasource(ev) {
1653
- this.gridApi = ev.api;
1654
- this.onGridReady.emit(ev);
1655
- this.service.setApi(this.id, this.gridApi);
1656
- const state = JSON.parse(localStorage.getItem(this.id));
1657
- if (state)
1658
- ev.api.applyColumnState({ state, applyOrder: true });
1659
- if (this.rowModelType === 'clientSide')
1660
- this.gridApi.setGridOption('rowData', this.rowData);
1661
- if (this.rowModelType !== 'infinite')
1662
- return;
1663
- this.reset();
1664
- }
1665
- reset() {
1666
- if (!this.gridApi)
1667
- return;
1668
- const datasource = {
1669
- getRows: ({ sortModel: [{ colId, sort }], successCallback, failCallback }) => {
1670
- this.gridApi.showLoadingOverlay();
1671
- const offset = this.gridApi.paginationGetCurrentPage();
1672
- this.subs = this.config.getData(offset, this.config.rowPerPage, colId, sort).subscribe({
1673
- next: ({ data, totalRecord }) => {
1674
- this.gridApi.hideOverlay();
1675
- if (offset === 0) {
1676
- if (data.length === 0)
1677
- this.gridApi.showNoRowsOverlay();
1678
- this.count = totalRecord;
1679
- }
1680
- if (!this.config.useTotalRecord && data.length < this.config.rowPerPage) {
1681
- this.count = (offset * this.config.rowPerPage) + data.length;
1682
- }
1683
- successCallback(data, this.count);
1684
- },
1685
- error: () => {
1686
- this.gridApi.hideOverlay();
1687
- this.gridApi.showNoRowsOverlay();
1688
- failCallback();
1689
- }
1690
- });
1691
- }
1692
- };
1693
- this.gridApi?.setGridOption('datasource', datasource);
1694
- }
1695
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridPaginationComponent, deps: [{ token: GridService }], target: i0.ɵɵFactoryTarget.Component }); }
1696
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: GridPaginationComponent, isStandalone: true, selector: "up-pagination-grid", inputs: { config: "config", rowData: "rowData", id: "id", rowModelType: "rowModelType", rowSelection: "rowSelection" }, outputs: { onRowClick: "onRowClick", onGridReady: "onGridReady", onSelectionChanged: "onSelectionChanged" }, host: { classAttribute: "d-block h-100 w-100" }, ngImport: i0, template: "<ag-grid-angular class=\"ag-theme-balham h-100\"\n [pagination]=\"true\"\n [animateRows]=\"true\"\n [rowModelType]=\"rowModelType\"\n [rowSelection]=\"rowSelection\"\n [columnDefs]=\"config.colDefs\"\n [defaultColDef]=\"defaultColDef\"\n [cacheBlockSize]=\"config.rowPerPage\"\n [paginationPageSize]=\"config.rowPerPage\"\n [overlayNoRowsTemplate]=\"config.noRowText\"\n (dragStopped)=\"dragColumn($event)\"\n (gridReady)=\"setDatasource($event)\"\n (rowClicked)=\"clickRow($event.data)\"\n (selectionChanged)=\"changeSelected($event)\"\n (paginationChanged)=\"changePagination($event)\"\n/>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AgGridModule }, { kind: "component", type: i2$1.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "columnMenu", "suppressMenuHide", "enableBrowserTooltips", "tooltipTrigger", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "tooltipInteraction", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "suppressCutToClipboard", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "dataTypeDefinitions", "maintainColumnOrder", "suppressFieldDotNotation", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "autoSizeStrategy", "components", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterMovesDown", "enterMovesDownAfterEdit", "enterNavigatesVertically", "enterNavigatesVerticallyAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "quickFilterText", "cacheQuickFilter", "excludeHiddenColumnsFromQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "excludeChildrenWhenTreeDataFiltering", "enableAdvancedFilter", "advancedFilterModel", "includeHiddenColumnsInAdvancedFilter", "advancedFilterParent", "advancedFilterBuilderParams", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "enableChartToolPanelsButton", "suppressChartToolPanelsButton", "chartToolPanelsDef", "loadingCellRenderer", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressParentsInRowNodes", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationPageSizeSelector", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotDefaultExpanded", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "alwaysAggregateAtRootLevel", "suppressAggAtRootLevel", "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", "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", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideEnableClientSideSort", "serverSideOnlyRefreshFilteredGroups", "serverSideFilterAllLevels", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSidePivotResultFieldSeparator", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellFocus", "suppressHeaderFocus", "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", "functionsPassive", "enableGroupEdit", "initialState", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processUnpinnedColumns", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "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", "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", "rangeDeleteStart", "rangeDeleteEnd", "filterOpened", "filterChanged", "filterModified", "advancedFilterBuilderVisibleChanged", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "gridReady", "gridPreDestroyed", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "stateUpdated", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pinnedRowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "storeRefreshed", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "tooltipShow", "tooltipHide", "sortChanged", "columnRowGroupChangeRequest", "columnPivotChangeRequest", "columnValueChangeRequest", "columnAggFuncChangeRequest"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1697
- }
1698
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridPaginationComponent, decorators: [{
1699
- type: Component,
1700
- args: [{ standalone: true, selector: 'up-pagination-grid', changeDetection: ChangeDetectionStrategy.OnPush, host: {
1701
- class: 'd-block h-100 w-100'
1702
- }, imports: [
1703
- AgGridModule
1704
- ], template: "<ag-grid-angular class=\"ag-theme-balham h-100\"\n [pagination]=\"true\"\n [animateRows]=\"true\"\n [rowModelType]=\"rowModelType\"\n [rowSelection]=\"rowSelection\"\n [columnDefs]=\"config.colDefs\"\n [defaultColDef]=\"defaultColDef\"\n [cacheBlockSize]=\"config.rowPerPage\"\n [paginationPageSize]=\"config.rowPerPage\"\n [overlayNoRowsTemplate]=\"config.noRowText\"\n (dragStopped)=\"dragColumn($event)\"\n (gridReady)=\"setDatasource($event)\"\n (rowClicked)=\"clickRow($event.data)\"\n (selectionChanged)=\"changeSelected($event)\"\n (paginationChanged)=\"changePagination($event)\"\n/>\n" }]
1705
- }], ctorParameters: () => [{ type: GridService }], propDecorators: { config: [{
1706
- type: Input,
1707
- args: [{ required: true }]
1708
- }], rowData: [{
1709
- type: Input
1710
- }], id: [{
1711
- type: Input
1712
- }], rowModelType: [{
1713
- type: Input
1714
- }], rowSelection: [{
1715
- type: Input
1716
- }], onRowClick: [{
1717
- type: Output
1718
- }], onGridReady: [{
1719
- type: Output
1720
- }], onSelectionChanged: [{
1721
- type: Output
1722
- }] } });
1723
-
1724
- class ListPaginationContainerComponent {
1725
- constructor(id, router) {
1726
- this.id = id;
1727
- this.router = router;
1728
- this.onRowClick = new EventEmitter();
1729
- this.onGridReady = new EventEmitter();
1730
- this.onSearch = new EventEmitter();
1731
- this.gridId = `grid-${this.id ?? 'p'}`;
1732
- }
1733
- openDetail(data) {
1734
- this.onRowClick.emit(data);
1735
- this.router.navigate([`${this.config.baseUrl}${data.guid}`], { preserveFragment: true });
1736
- }
1737
- setGridApi(ev) {
1738
- this.gridApi = ev.api;
1739
- this.onGridReady.emit(ev);
1740
- }
1741
- search(k) {
1742
- this.onSearch.emit(k);
1743
- this.gridApi.refreshInfiniteCache();
1744
- }
1745
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ListPaginationContainerComponent, deps: [{ token: 'id', attribute: true }, { token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
1746
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ListPaginationContainerComponent, isStandalone: true, selector: "up-list-pagination-container", inputs: { header: "header", config: "config" }, outputs: { onRowClick: "onRowClick", onGridReady: "onGridReady", onSearch: "onSearch" }, host: { classAttribute: "d-flex flex-column h-100 w-100" }, ngImport: i0, template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">{{ header }}</h3>\n\n <ion-button routerLink=\"{{ config.baseUrl }}create\" *ngIf=\"config.permissions.canCreate\">\n <ion-icon name=\"add\" slot=\"start\" />\n Create\n </ion-button>\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\" *ngIf=\"config.filterConfig\">\n <up-filter placeholder=\"Type to search\" id=\"filter-{{ id }}\" [config]=\"config.filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-pagination-grid [config]=\"config.gridConfig\" [id]=\"gridId\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" />\n</div>\n", styles: ["up-filter{min-width:300px}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "directive", type: i1.RouterLinkDelegate, selector: ":not(a):not(area)[routerLink]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: FilterComponent, selector: "up-filter", inputs: ["id", "config"], outputs: ["onSearch"] }, { kind: "component", type: GridPaginationComponent, selector: "up-pagination-grid", inputs: ["config", "rowData", "id", "rowModelType", "rowSelection"], outputs: ["onRowClick", "onGridReady", "onSelectionChanged"] }] }); }
1747
- }
1748
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ListPaginationContainerComponent, decorators: [{
1749
- type: Component,
1750
- args: [{ standalone: true, selector: 'up-list-pagination-container', host: {
1751
- class: 'd-flex flex-column h-100 w-100'
1752
- }, imports: [
1753
- IonicModule,
1754
- CommonModule,
1755
- RouterModule,
1756
- FilterComponent,
1757
- GridPaginationComponent
1758
- ], template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">{{ header }}</h3>\n\n <ion-button routerLink=\"{{ config.baseUrl }}create\" *ngIf=\"config.permissions.canCreate\">\n <ion-icon name=\"add\" slot=\"start\" />\n Create\n </ion-button>\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\" *ngIf=\"config.filterConfig\">\n <up-filter placeholder=\"Type to search\" id=\"filter-{{ id }}\" [config]=\"config.filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-pagination-grid [config]=\"config.gridConfig\" [id]=\"gridId\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" />\n</div>\n", styles: ["up-filter{min-width:300px}\n"] }]
1759
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1760
- type: Attribute,
1761
- args: ['id']
1762
- }] }, { type: i1$2.Router }], propDecorators: { header: [{
1763
- type: Input,
1764
- args: [{ required: true }]
1765
- }], config: [{
1766
- type: Input,
1767
- args: [{ required: true }]
1768
- }], onRowClick: [{
1769
- type: Output
1770
- }], onGridReady: [{
1771
- type: Output
1772
- }], onSearch: [{
1773
- type: Output
1774
- }] } });
1775
-
1776
- class ListSnapshotContainerComponent {
1777
- constructor(id, router) {
1778
- this.id = id;
1779
- this.router = router;
1780
- this.onRowClick = new EventEmitter();
1781
- this.onGridReady = new EventEmitter();
1782
- this.onSearch = new EventEmitter();
1783
- this.gridId = `grid-${this.id ?? 'p'}`;
1784
- }
1785
- openDetail(data) {
1786
- this.onRowClick.emit(data);
1787
- this.router.navigate([`${this.config.baseUrl}${data.guid}`], { preserveFragment: true });
1788
- }
1789
- setGridApi(ev) {
1790
- this.gridApi = ev.api;
1791
- this.onGridReady.emit(ev);
1792
- }
1793
- search(k) {
1794
- this.onSearch.emit(k);
1795
- this.gridApi.paginationGoToFirstPage();
1796
- this.gridApi.purgeInfiniteCache();
1797
- }
1798
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ListSnapshotContainerComponent, deps: [{ token: 'id', attribute: true }, { token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
1799
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ListSnapshotContainerComponent, isStandalone: true, selector: "up-list-snapshot-container", inputs: { header: "header", config: "config" }, outputs: { onRowClick: "onRowClick", onGridReady: "onGridReady", onSearch: "onSearch" }, host: { classAttribute: "d-flex flex-column h-100 w-100" }, ngImport: i0, template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">{{ header }}</h3>\n\n <ion-button routerLink=\"{{ config.baseUrl }}create\" *ngIf=\"config.permissions.canCreate\">\n <ion-icon name=\"add\" slot=\"start\" />\n Create\n </ion-button>\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\" *ngIf=\"config.filterConfig\">\n <up-filter placeholder=\"Type to search\" id=\"filter-{{ id }}\" [config]=\"config.filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-snapshot-grid [config]=\"config.gridConfig\" [id]=\"gridId\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" />\n</div>\n", styles: ["up-filter{min-width:300px}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "directive", type: i1.RouterLinkDelegate, selector: ":not(a):not(area)[routerLink]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: FilterComponent, selector: "up-filter", inputs: ["id", "config"], outputs: ["onSearch"] }, { kind: "component", type: GridSnapshotComponent, selector: "up-snapshot-grid", inputs: ["id", "config", "rowSelection"], outputs: ["onRowClick", "onGridReady", "onSelectionChanged"] }] }); }
1800
- }
1801
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ListSnapshotContainerComponent, decorators: [{
1802
- type: Component,
1803
- args: [{ standalone: true, selector: 'up-list-snapshot-container', host: {
1804
- class: 'd-flex flex-column h-100 w-100'
1805
- }, imports: [
1806
- IonicModule,
1807
- CommonModule,
1808
- RouterModule,
1809
- FilterComponent,
1810
- GridSnapshotComponent
1811
- ], template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">{{ header }}</h3>\n\n <ion-button routerLink=\"{{ config.baseUrl }}create\" *ngIf=\"config.permissions.canCreate\">\n <ion-icon name=\"add\" slot=\"start\" />\n Create\n </ion-button>\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\" *ngIf=\"config.filterConfig\">\n <up-filter placeholder=\"Type to search\" id=\"filter-{{ id }}\" [config]=\"config.filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-snapshot-grid [config]=\"config.gridConfig\" [id]=\"gridId\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" />\n</div>\n", styles: ["up-filter{min-width:300px}\n"] }]
1812
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1813
- type: Attribute,
1814
- args: ['id']
1815
- }] }, { type: i1$2.Router }], propDecorators: { header: [{
1816
- type: Input,
1817
- args: [{ required: true }]
1818
- }], config: [{
1819
- type: Input,
1820
- args: [{ required: true }]
1821
- }], onRowClick: [{
1822
- type: Output
1823
- }], onGridReady: [{
1824
- type: Output
1825
- }], onSearch: [{
1826
- type: Output
1827
- }] } });
1828
-
1829
- class TabContentComponent {
1830
- constructor(fragment, ch) {
1831
- this.fragment = fragment;
1832
- this.ch = ch;
1833
- this.isActive = false;
1834
- }
1835
- toggleVisibility(s = true) {
1836
- this.isActive = s;
1837
- this.ch.markForCheck();
1838
- }
1839
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabContentComponent, deps: [{ token: 'fragment', attribute: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1840
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: TabContentComponent, selector: "up-tab-content", inputs: { header: "header" }, host: { properties: { "class.flex-grow-1": "this.isActive" }, classAttribute: "overflow-auto" }, ngImport: i0, template: "<div [hidden]=\"!isActive\" class=\"h-100\">\n <ng-content />\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1841
- }
1842
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabContentComponent, decorators: [{
1843
- type: Component,
1844
- args: [{ selector: 'up-tab-content', changeDetection: ChangeDetectionStrategy.OnPush, host: {
1845
- class: 'overflow-auto'
1846
- }, template: "<div [hidden]=\"!isActive\" class=\"h-100\">\n <ng-content />\n</div>\n" }]
1847
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1848
- type: Attribute,
1849
- args: ['fragment']
1850
- }] }, { type: i0.ChangeDetectorRef }], propDecorators: { isActive: [{
1851
- type: HostBinding,
1852
- args: ['class.flex-grow-1']
1853
- }], header: [{
1854
- type: Input,
1855
- args: [{ required: true }]
1856
- }] } });
1857
-
1858
- class TabGroupComponent {
1859
- constructor(router, activeRoute) {
1860
- this.router = router;
1861
- this.activeRoute = activeRoute;
1862
- this.onChange = new EventEmitter();
1863
- this.tabs = [];
1864
- }
1865
- ngAfterContentInit() {
1866
- this.content.forEach(({ header, fragment }) => this.tabs.push({ fragment, label: header }));
1867
- this.changeTab(this.activeRoute.snapshot.fragment);
1868
- }
1869
- changeTab(f) {
1870
- this.onChange.emit(f);
1871
- this.router.navigate([], { relativeTo: this.activeRoute, fragment: f || undefined, replaceUrl: true });
1872
- let found = false;
1873
- this.content.forEach((tab) => {
1874
- if (tab.fragment !== f)
1875
- tab.toggleVisibility(false);
1876
- else {
1877
- found = true;
1878
- this.activeFragment = f;
1879
- tab.toggleVisibility(true);
1880
- }
1881
- });
1882
- if (!found) {
1883
- this.content.get(0).toggleVisibility(true);
1884
- this.activeFragment = this.content.get(0).fragment;
1885
- }
1886
- }
1887
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabGroupComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
1888
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: TabGroupComponent, selector: "up-tab-group", outputs: { onChange: "onChange" }, host: { classAttribute: "d-flex flex-column" }, queries: [{ propertyName: "content", predicate: TabContentComponent, descendants: true }], ngImport: i0, template: "<ion-segment [scrollable]=\"true\" [value]=\"activeFragment\" class=\"d-flex pb-4 flex-shrink-0\">\n <ion-segment-button *ngFor=\"let t of tabs\" class=\"rounded\" [value]=\"t.fragment\" (click)=\"changeTab(t.fragment)\">\n {{ t.label }}\n </ion-segment-button>\n</ion-segment>\n\n<ng-content />\n", styles: ["ion-segment::-webkit-scrollbar{height:0}ion-segment-button{--color: #9E9E9E;--color-checked: #424242;--indicator-color: #ED6B26;border:none;height:34px;font-weight:400;min-width:100px;min-height:34px;width:fit-content;text-transform:none;letter-spacing:normal}ion-segment-button.segment-button-checked{font-weight:500}ion-segment-button::part(native){border-radius:4px}ion-segment-button::part(indicator-background){margin:auto;max-width:25%;border-radius:8px}\n"], dependencies: [{ kind: "component", type: i1.IonSegment, selector: "ion-segment", inputs: ["color", "disabled", "mode", "scrollable", "selectOnFocus", "swipeGesture", "value"] }, { kind: "component", type: i1.IonSegmentButton, selector: "ion-segment-button", inputs: ["disabled", "layout", "mode", "type", "value"] }, { kind: "directive", type: i1.SelectValueAccessor, selector: "ion-select, ion-radio-group, ion-segment, ion-datetime" }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1889
- }
1890
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabGroupComponent, decorators: [{
1891
- type: Component,
1892
- args: [{ selector: 'up-tab-group', changeDetection: ChangeDetectionStrategy.OnPush, host: {
1893
- class: 'd-flex flex-column'
1894
- }, template: "<ion-segment [scrollable]=\"true\" [value]=\"activeFragment\" class=\"d-flex pb-4 flex-shrink-0\">\n <ion-segment-button *ngFor=\"let t of tabs\" class=\"rounded\" [value]=\"t.fragment\" (click)=\"changeTab(t.fragment)\">\n {{ t.label }}\n </ion-segment-button>\n</ion-segment>\n\n<ng-content />\n", styles: ["ion-segment::-webkit-scrollbar{height:0}ion-segment-button{--color: #9E9E9E;--color-checked: #424242;--indicator-color: #ED6B26;border:none;height:34px;font-weight:400;min-width:100px;min-height:34px;width:fit-content;text-transform:none;letter-spacing:normal}ion-segment-button.segment-button-checked{font-weight:500}ion-segment-button::part(native){border-radius:4px}ion-segment-button::part(indicator-background){margin:auto;max-width:25%;border-radius:8px}\n"] }]
1895
- }], ctorParameters: () => [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }], propDecorators: { onChange: [{
1896
- type: Output
1897
- }], content: [{
1898
- type: ContentChildren,
1899
- args: [TabContentComponent, { descendants: true }]
1900
- }] } });
1901
-
1902
- class TabsComponentModule {
1903
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabsComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1904
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: TabsComponentModule, declarations: [TabGroupComponent,
1905
- TabContentComponent], imports: [IonicModule,
1906
- CommonModule], exports: [TabGroupComponent,
1907
- TabContentComponent] }); }
1908
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabsComponentModule, imports: [IonicModule,
1909
- CommonModule] }); }
1910
- }
1911
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabsComponentModule, decorators: [{
1912
- type: NgModule,
1913
- args: [{
1914
- imports: [
1915
- IonicModule,
1916
- CommonModule,
1917
- ],
1918
- declarations: [
1919
- TabGroupComponent,
1920
- TabContentComponent
1921
- ],
1922
- exports: [
1923
- TabGroupComponent,
1924
- TabContentComponent
1925
- ]
1926
- }]
1927
- }] });
1928
-
1929
- class AuditService {
1930
- constructor(apollo) {
1931
- this.apollo = apollo;
1932
- this.baseAttr = `
1933
- action
1934
- createdAt
1935
- description
1936
- function
1937
- guid
1938
- msSource
1939
- sourceIp
1940
- user {
1941
- name
1942
- sourcePlatform
1943
- status
1944
- appLoginPrincipal {
1945
- principalType
1946
- principalId
1947
- }
1948
- }
1949
- `;
1950
- }
1951
- query(input, extraAttr = '') {
1952
- return this.apollo.query({
1953
- variables: { input },
1954
- query: gql `
1955
- query QueryAudit($input: AuditTrailCriteria!) {
1956
- auditMsAuditTrail(input: $input) {
1957
- ${this.baseAttr}
1958
- ${extraAttr}
1959
- }
1960
- }
1961
- `
1962
- });
1963
- }
1964
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
1965
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditService, providedIn: 'root' }); }
1966
- }
1967
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditService, decorators: [{
1968
- type: Injectable,
1969
- args: [{
1970
- providedIn: 'root'
1971
- }]
1972
- }], ctorParameters: () => [{ type: i1$1.Apollo }] });
1973
-
1974
- class AuditListComponent {
1975
- constructor(id, url, router, service) {
1976
- this.id = id;
1977
- this.url = url;
1978
- this.router = router;
1979
- this.service = service;
1980
- this.filterConfig = { mode: 'simple', fields: [{ key: 'description', label: '', type: 'text' }] };
1981
- this.gridConfig = {
1982
- useTotalRecord: false,
1983
- noRowText: 'Audit not found',
1984
- colDefs: [
1985
- { headerName: 'User', field: 'user.name', sortable: false },
1986
- { headerName: 'Description', field: 'description', minWidth: 350, sortable: false },
1987
- { headerName: 'Created Date', field: 'createdAt', sort: 'desc', valueFormatter: ({ value }) => value ? formatDate(value, 'dd MMM yyyy HH:mm', 'en-US') : '' }
1988
- ],
1989
- getData: (page, pageSize, sortBy, dir) => {
1990
- if (!this.criteria.tagValues)
1991
- return of({ data: [] });
1992
- this.criteria.page = page;
1993
- this.criteria.sortBy = sortBy;
1994
- this.criteria.pageSize = pageSize;
1995
- this.criteria.sortDirection = dir;
1996
- return this.service.query(this.criteria).pipe(map(({ data: { auditMsAuditTrail: data } }) => ({ data })));
1997
- },
1998
- };
1999
- this.criteria = { sortBy: 'createdAt', sortDirection: 'desc', page: 0, pageSize: 50 };
2000
- }
2001
- ngOnChanges(e) {
2002
- if (e['tagKeys'])
2003
- this.criteria.tagKeys = this.tagKeys;
2004
- if (e['relatedEntities'])
2005
- this.criteria.relatedEntities = this.relatedEntities;
2006
- }
2007
- setGridApi({ api }) { this.gridApi = api; }
2008
- rowClicked({ guid }) {
2009
- this.router.navigate([`${this.url}/${this.criteria.tagValues[0]}/audit/${guid}`], { preserveFragment: true });
2010
- }
2011
- search({ data }) {
2012
- this.criteria.description = data?.description;
2013
- this.gridComponent.reset();
2014
- }
2015
- setGuid(guid) {
2016
- this.criteria.description = null;
2017
- this.criteria.tagValues = [guid];
2018
- this.gridComponent.reset();
2019
- }
2020
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditListComponent, deps: [{ token: 'id', attribute: true }, { token: 'mainUrl', attribute: true }, { token: i1$2.Router }, { token: AuditService }], target: i0.ɵɵFactoryTarget.Component }); }
2021
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: AuditListComponent, isStandalone: true, selector: "up-audit-list", inputs: { relatedEntities: "relatedEntities", tagKeys: "tagKeys" }, host: { classAttribute: "d-flex flex-column h-100" }, viewQueries: [{ propertyName: "gridComponent", first: true, predicate: GridPaginationComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"d-flex justify-content-end px-4 pb-4 flex-shrink-0\">\n <up-filter class=\"w-100\" id=\"audit-filter\" placeholder=\"Type to search\" [config]=\"filterConfig\" (onSearch)=\"search($event);\" />\n</div>\n \n<up-pagination-grid id=\"grid-audit\" class=\"flex-grow-1\" [config]=\"gridConfig\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"rowClicked($event)\" />\n", styles: [""], dependencies: [{ kind: "component", type: FilterComponent, selector: "up-filter", inputs: ["id", "config"], outputs: ["onSearch"] }, { kind: "component", type: GridPaginationComponent, selector: "up-pagination-grid", inputs: ["config", "rowData", "id", "rowModelType", "rowSelection"], outputs: ["onRowClick", "onGridReady", "onSelectionChanged"] }] }); }
2022
- }
2023
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditListComponent, decorators: [{
2024
- type: Component,
2025
- args: [{ standalone: true, selector: 'up-audit-list', host: {
2026
- class: 'd-flex flex-column h-100'
2027
- }, imports: [
2028
- FilterComponent,
2029
- GridPaginationComponent
2030
- ], template: "<div class=\"d-flex justify-content-end px-4 pb-4 flex-shrink-0\">\n <up-filter class=\"w-100\" id=\"audit-filter\" placeholder=\"Type to search\" [config]=\"filterConfig\" (onSearch)=\"search($event);\" />\n</div>\n \n<up-pagination-grid id=\"grid-audit\" class=\"flex-grow-1\" [config]=\"gridConfig\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"rowClicked($event)\" />\n" }]
2031
- }], ctorParameters: () => [{ type: undefined, decorators: [{
2032
- type: Attribute,
2033
- args: ['id']
2034
- }] }, { type: undefined, decorators: [{
2035
- type: Attribute,
2036
- args: ['mainUrl']
2037
- }] }, { type: i1$2.Router }, { type: AuditService }], propDecorators: { relatedEntities: [{
2038
- type: Input,
2039
- args: [{ required: true }]
2040
- }], tagKeys: [{
2041
- type: Input
2042
- }], gridComponent: [{
2043
- type: ViewChild,
2044
- args: [GridPaginationComponent]
2045
- }] } });
2046
-
2047
- class AuditDetailComponent {
2048
- constructor(fb, service, route, navCtrl) {
2049
- this.fb = fb;
2050
- this.service = service;
2051
- this.route = route;
2052
- this.navCtrl = navCtrl;
2053
- this.gridConfig = {
2054
- useTotalRecord: false,
2055
- colDefs: [
2056
- { headerName: 'Attribute Name', field: 'attribute', sort: 'asc' },
2057
- { headerName: 'Old Value', field: 'oldData' },
2058
- { headerName: 'New Value', field: 'newData' }
2059
- ]
2060
- };
2061
- this.form = this.fb.group({
2062
- guid: new FormControl({ value: null, disabled: true }),
2063
- action: new FormControl({ value: null, disabled: true }),
2064
- description: new FormControl({ value: null, disabled: true }),
2065
- userName: new FormControl({ value: null, disabled: true }),
2066
- sourceIp: new FormControl({ value: null, disabled: true }),
2067
- createdAt: new FormControl({ value: null, disabled: true }),
2068
- msSource: new FormControl({ value: null, disabled: true }),
2069
- sourcePlatform: new FormControl({ value: null, disabled: true }),
2070
- function: new FormControl({ value: null, disabled: true }),
2071
- });
2072
- this.isLoading = true;
2073
- this.guid = '';
2074
- }
2075
- ngOnDestroy() { this.sub?.unsubscribe(); }
2076
- setGridApi({ api }) {
2077
- this.gridApi = api;
2078
- this.getData();
2079
- }
2080
- isIsoDateString(str) {
2081
- const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?Z$/;
2082
- return regex.test(str);
2083
- }
2084
- formatData(value) {
2085
- if (value === null)
2086
- return value;
2087
- if (typeof value === 'object')
2088
- return JSON.stringify(value);
2089
- if (this.isIsoDateString(value))
2090
- return formatDate(value, 'dd MMM yyyy HH:mm', 'en-US');
2091
- return value;
2092
- }
2093
- getData() {
2094
- const newGuid = this.route.children[0].snapshot.params['audit'];
2095
- if (!newGuid || this.guid === newGuid)
2096
- return;
2097
- this.sub?.unsubscribe();
2098
- this.gridApi?.showLoadingOverlay();
2099
- this.guid = newGuid;
2100
- this.isLoading = true;
2101
- this.sub = this.service.query({ guid: this.guid }, 'data tags { tagKey tagValue }').subscribe({
2102
- next: ({ data: { auditMsAuditTrail: data } }) => {
2103
- this.gridApi?.hideOverlay();
2104
- if (data.length !== 1) {
2105
- this.navCtrl.back();
2106
- return;
2107
- }
2108
- const { guid, action, description, function: func, msSource, sourceIp, createdAt } = data[0];
2109
- this.form.patchValue({
2110
- guid,
2111
- function: func,
2112
- msSource, sourceIp,
2113
- action, description,
2114
- userName: data[0].user?.name,
2115
- sourcePlatform: data[0].user?.sourcePlatform,
2116
- createdAt: formatDate(createdAt, 'dd MMM yyyy HH:mm', 'en-US'),
2117
- });
2118
- this.isLoading = false;
2119
- this.getChangedData(data[0].data);
2120
- },
2121
- error: () => this.navCtrl.back()
2122
- });
2123
- }
2124
- getChangedData({ oldData, newData }) {
2125
- if (!newData || Array.isArray(JSON.parse(newData))) {
2126
- this.gridApi.setGridOption('rowData', []);
2127
- return;
2128
- }
2129
- const objNewData = JSON.parse(newData);
2130
- const changedData = Object.entries(oldData ? JSON.parse(oldData) : JSON.parse(newData))
2131
- .filter(([key, oldVal]) => JSON.stringify(oldData ? oldVal : null) !== JSON.stringify(objNewData[key]) && !key.match(/update|created/))
2132
- .map(([key, oldVal]) => ({
2133
- attribute: key,
2134
- oldData: oldData ? this.formatData(oldVal) : null,
2135
- newData: this.formatData(objNewData[key])
2136
- }));
2137
- this.gridApi.setGridOption('rowData', changedData);
2138
- }
2139
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditDetailComponent, deps: [{ token: i1$3.FormBuilder }, { token: AuditService }, { token: i1$2.ActivatedRoute }, { token: i1.NavController }], target: i0.ɵɵFactoryTarget.Component }); }
2140
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: AuditDetailComponent, isStandalone: true, selector: "up-audit-detail", ngImport: i0, template: "<up-tab-group class=\"h-100\">\n <up-tab-content header=\"Detail\" fragment=\"detail\">\n <form [formGroup]=\"form\" class=\"px-4 pb-4\" *ngIf=\"!isLoading; else loading\">\n <div class=\"d-flex align-items-center gap-2 pb-3\">\n <ion-icon name=\"information-circle\" />\n <h5 class=\"m-0\">Information</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-lg-4\" label=\"Action\" formControlName=\"action\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Source IP\" formControlName=\"sourceIp\" />\n </div>\n </div>\n \n <up-input class=\"mb-4\" label=\"User Name\" formControlName=\"userName\" />\n <up-textarea class=\"mb-4\" label=\"Description\" formControlName=\"description\" />\n\n <div class=\"d-flex align-items-center gap-2 pb-3 pt-2\">\n <ion-icon name=\"laptop\" />\n <h5 class=\"m-0\">System Information</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Action Date\" formControlName=\"createdAt\" />\n <up-input class=\"mb-lg-4\" label=\"Source Platform\" formControlName=\"sourcePlatform\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"MS Source\" formControlName=\"msSource\" />\n <up-input class=\"mb-4\" label=\"Function\" formControlName=\"function\" />\n </div>\n </div>\n </form>\n\n <ng-template #loading>\n <ion-skeleton-text class=\"sk-input mx-4 mb-4\" *ngFor=\"let i of [0,1,2,3,4,5,6]\" />\n </ng-template> \n </up-tab-content>\n\n <up-tab-content header=\"Attributes\" fragment=\"attributes\">\n <up-pagination-grid id=\"grid-audit-detail\" rowModelType=\"clientSide\" [config]=\"gridConfig\" (onGridReady)=\"setGridApi($event)\" />\n </up-tab-content>\n</up-tab-group>\n", styles: ["ion-icon{font-size:24px;margin-right:5px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonSkeletonText, selector: "ion-skeleton-text", inputs: ["animated"] }, { kind: "component", type: GridPaginationComponent, selector: "up-pagination-grid", inputs: ["config", "rowData", "id", "rowModelType", "rowSelection"], outputs: ["onRowClick", "onGridReady", "onSelectionChanged"] }, { kind: "ngmodule", type: TabsComponentModule }, { kind: "component", type: TabGroupComponent, selector: "up-tab-group", outputs: ["onChange"] }, { kind: "component", type: TabContentComponent, selector: "up-tab-content", inputs: ["header"] }, { kind: "component", type: FormInputComponent, selector: "up-input", inputs: ["label", "value", "required", "disabled"], outputs: ["onInput"] }, { kind: "component", type: FormTextareaComponent, selector: "up-textarea", inputs: ["value", "required", "disabled"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
2141
- }
2142
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditDetailComponent, decorators: [{
2143
- type: Component,
2144
- args: [{ standalone: true, selector: 'up-audit-detail', imports: [
2145
- CommonModule,
2146
- IonicModule,
2147
- GridPaginationComponent,
2148
- TabsComponentModule,
2149
- FormInputComponent,
2150
- FormTextareaComponent,
2151
- ReactiveFormsModule
2152
- ], template: "<up-tab-group class=\"h-100\">\n <up-tab-content header=\"Detail\" fragment=\"detail\">\n <form [formGroup]=\"form\" class=\"px-4 pb-4\" *ngIf=\"!isLoading; else loading\">\n <div class=\"d-flex align-items-center gap-2 pb-3\">\n <ion-icon name=\"information-circle\" />\n <h5 class=\"m-0\">Information</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-lg-4\" label=\"Action\" formControlName=\"action\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Source IP\" formControlName=\"sourceIp\" />\n </div>\n </div>\n \n <up-input class=\"mb-4\" label=\"User Name\" formControlName=\"userName\" />\n <up-textarea class=\"mb-4\" label=\"Description\" formControlName=\"description\" />\n\n <div class=\"d-flex align-items-center gap-2 pb-3 pt-2\">\n <ion-icon name=\"laptop\" />\n <h5 class=\"m-0\">System Information</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Action Date\" formControlName=\"createdAt\" />\n <up-input class=\"mb-lg-4\" label=\"Source Platform\" formControlName=\"sourcePlatform\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"MS Source\" formControlName=\"msSource\" />\n <up-input class=\"mb-4\" label=\"Function\" formControlName=\"function\" />\n </div>\n </div>\n </form>\n\n <ng-template #loading>\n <ion-skeleton-text class=\"sk-input mx-4 mb-4\" *ngFor=\"let i of [0,1,2,3,4,5,6]\" />\n </ng-template> \n </up-tab-content>\n\n <up-tab-content header=\"Attributes\" fragment=\"attributes\">\n <up-pagination-grid id=\"grid-audit-detail\" rowModelType=\"clientSide\" [config]=\"gridConfig\" (onGridReady)=\"setGridApi($event)\" />\n </up-tab-content>\n</up-tab-group>\n", styles: ["ion-icon{font-size:24px;margin-right:5px}\n"] }]
2153
- }], ctorParameters: () => [{ type: i1$3.FormBuilder }, { type: AuditService }, { type: i1$2.ActivatedRoute }, { type: i1.NavController }] });
2154
-
2155
1396
  var AlertTypeEnum;
2156
1397
  (function (AlertTypeEnum) {
2157
1398
  AlertTypeEnum["PasswordReset"] = "PASSWORD_RESET";
@@ -2413,573 +1654,1472 @@ var VoucherGroupType;
2413
1654
  VoucherGroupType["Import"] = "IMPORT";
2414
1655
  })(VoucherGroupType || (VoucherGroupType = {}));
2415
1656
 
2416
- class ApprovalService {
1657
+ class ProfileService {
1658
+ constructor(apollo) {
1659
+ this.apollo = apollo;
1660
+ }
1661
+ getMyProfile(fetchPolicy) {
1662
+ return this.apollo.query({
1663
+ fetchPolicy,
1664
+ errorPolicy: 'all',
1665
+ query: gql `
1666
+ query getMyProfile {
1667
+ authMsMyProfile {
1668
+ appLoginPrincipal {
1669
+ principalId
1670
+ principalType
1671
+ }
1672
+ appLoginExt {
1673
+ paramCode
1674
+ paramType
1675
+ file {
1676
+ publicUrl
1677
+ }
1678
+ }
1679
+ birthday
1680
+ category
1681
+ company {
1682
+ code
1683
+ guid
1684
+ isInternal
1685
+ name
1686
+ status
1687
+ }
1688
+ gender
1689
+ guid
1690
+ merchants {
1691
+ guid
1692
+ name
1693
+ status
1694
+ }
1695
+ name
1696
+ status
1697
+ }
1698
+ }
1699
+ `,
1700
+ }).pipe(map(({ data: { authMsMyProfile } }) => {
1701
+ if (!authMsMyProfile)
1702
+ return null;
1703
+ return authMsMyProfile;
1704
+ }));
1705
+ }
1706
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProfileService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
1707
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProfileService, providedIn: 'root' }); }
1708
+ }
1709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProfileService, decorators: [{
1710
+ type: Injectable,
1711
+ args: [{
1712
+ providedIn: 'root'
1713
+ }]
1714
+ }], ctorParameters: () => [{ type: i1$1.Apollo }] });
1715
+
1716
+ class AuthService {
1717
+ static { this.authToken = ''; }
1718
+ static { this.refreshToken = ''; }
1719
+ constructor(apollo, profileService) {
1720
+ this.apollo = apollo;
1721
+ this.profileService = profileService;
1722
+ }
1723
+ login(input) {
1724
+ return this.apollo.mutate({
1725
+ variables: { input },
1726
+ mutation: gql `
1727
+ mutation Login($input: LoginRq!) {
1728
+ authMsLogin(input: $input) {
1729
+ accessToken
1730
+ refreshToken
1731
+ suggestedAction
1732
+ user {
1733
+ birthday
1734
+ category
1735
+ email
1736
+ gender
1737
+ guid
1738
+ mobileNumber
1739
+ name
1740
+ status
1741
+ }
1742
+ }
1743
+ }
1744
+ `
1745
+ }).pipe(tap(({ data }) => {
1746
+ if (data?.authMsLogin) {
1747
+ const { accessToken, user, refreshToken } = data.authMsLogin;
1748
+ this.user = user;
1749
+ this.user.photo = '/assets/imgs/profile.svg';
1750
+ AuthService.authToken = accessToken ?? '';
1751
+ AuthService.refreshToken = refreshToken ?? '';
1752
+ localStorage.setItem('userGuid', this.user.guid);
1753
+ localStorage.setItem('authToken', AuthService.authToken);
1754
+ localStorage.setItem('refreshToken', AuthService.refreshToken);
1755
+ }
1756
+ }));
1757
+ }
1758
+ refreshToken(variables) {
1759
+ return this.apollo.mutate({
1760
+ context: {
1761
+ headers: {
1762
+ 'operation-type': 'Mutation',
1763
+ 'operation-name': 'RefreshToken'
1764
+ }
1765
+ },
1766
+ variables,
1767
+ mutation: gql `
1768
+ mutation RefreshToken($refreshToken: String!) {
1769
+ authMsRefreshAccessToken(refreshToken: $refreshToken) {
1770
+ accessToken
1771
+ refreshToken
1772
+ }
1773
+ }
1774
+ `
1775
+ });
1776
+ }
1777
+ getProfile(fetchPolicy) {
1778
+ return this.profileService.getMyProfile(fetchPolicy).pipe(tap((user) => {
1779
+ if (!user)
1780
+ return;
1781
+ this.user = { ...user, photo: '/assets/imgs/profile.svg' };
1782
+ user.appLoginExt?.forEach(({ paramCode, file: { publicUrl } }) => {
1783
+ if (paramCode === 'USER_PROFILE_PHOTO')
1784
+ this.user.photo = publicUrl;
1785
+ });
1786
+ user.appLoginPrincipal?.forEach(({ principalId, principalType }) => {
1787
+ if (principalType === 'EMAIL_USERNAME')
1788
+ this.user.email = principalId;
1789
+ });
1790
+ }));
1791
+ }
1792
+ initForgotPassword(email) {
1793
+ return this.apollo.mutate({
1794
+ variables: {
1795
+ input: {
1796
+ email,
1797
+ sourcePlatform: SourcePlatform.Admin
1798
+ }
1799
+ },
1800
+ mutation: gql `
1801
+ mutation InitForgotPassword($input: ForgotPassOtpRq!) {
1802
+ authMsForgotPasswordOtp(input: $input)
1803
+ }
1804
+ `
1805
+ });
1806
+ }
1807
+ createNewPassword({ newPassword, principalId, sourcePlatform, verifCode }) {
1808
+ return this.apollo.mutate({
1809
+ mutation: gql `
1810
+ mutation SubmitForgotPassword($input: ForgotPassRq!) {
1811
+ authMsForgotPassword(input: $input)
1812
+ }
1813
+ `,
1814
+ variables: {
1815
+ input: {
1816
+ newPassword,
1817
+ principalId,
1818
+ sourcePlatform,
1819
+ verifCode
1820
+ }
1821
+ }
1822
+ });
1823
+ }
1824
+ updatePassword(input) {
1825
+ return this.apollo.mutate({
1826
+ mutation: gql `
1827
+ mutation ChangePassword($input: ChangePassRq!) {
1828
+ authMsChangePassword(input: $input)
1829
+ }
1830
+ `,
1831
+ variables: { input }
1832
+ });
1833
+ }
1834
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuthService, deps: [{ token: i1$1.Apollo }, { token: ProfileService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1835
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuthService, providedIn: 'root' }); }
1836
+ }
1837
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuthService, decorators: [{
1838
+ type: Injectable,
1839
+ args: [{
1840
+ providedIn: 'root'
1841
+ }]
1842
+ }], ctorParameters: () => [{ type: i1$1.Apollo }, { type: ProfileService }] });
1843
+
1844
+ class CurrencyService {
1845
+ constructor(apollo) {
1846
+ this.apollo = apollo;
1847
+ }
1848
+ query(keyword = '') {
1849
+ const input = { page: 0, pageSize: 300, sortBy: 'name', sortDirection: 'asc' };
1850
+ if (keyword !== '')
1851
+ input.name = keyword;
1852
+ return this.apollo.query({
1853
+ errorPolicy: 'all',
1854
+ variables: { input },
1855
+ query: gql `
1856
+ query QueryCurrency($input: CurrencyQueryCriteria!) {
1857
+ webConfigMsCurrency(input: $input) {
1858
+ data {
1859
+ code
1860
+ guid
1861
+ magnifyValue
1862
+ name
1863
+ status
1864
+ }
1865
+ }
1866
+ }
1867
+ `,
1868
+ });
1869
+ }
1870
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CurrencyService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
1871
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CurrencyService, providedIn: 'root' }); }
1872
+ }
1873
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CurrencyService, decorators: [{
1874
+ type: Injectable,
1875
+ args: [{
1876
+ providedIn: 'root'
1877
+ }]
1878
+ }], ctorParameters: () => [{ type: i1$1.Apollo }] });
1879
+
1880
+ class CountryService {
1881
+ constructor(apollo) {
1882
+ this.apollo = apollo;
1883
+ }
1884
+ query() {
1885
+ return this.apollo.query({
1886
+ errorPolicy: 'all',
1887
+ variables: {
1888
+ input: {
1889
+ page: 0,
1890
+ pageSize: 300,
1891
+ sortBy: 'name',
1892
+ sortDirection: 'asc'
1893
+ }
1894
+ },
1895
+ query: gql `
1896
+ query QueryCountry($input: CountryQueryCriteria!) {
1897
+ webConfigMsCountry(input: $input) {
1898
+ data {
1899
+ code
1900
+ defaultLangCode
1901
+ guid
1902
+ langCodes {
1903
+ code
1904
+ guid
1905
+ }
1906
+ name
1907
+ phoneCodes {
1908
+ code
1909
+ }
1910
+ }
1911
+ }
1912
+ }
1913
+ `,
1914
+ });
1915
+ }
1916
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CountryService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
1917
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CountryService, providedIn: 'root' }); }
1918
+ }
1919
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CountryService, decorators: [{
1920
+ type: Injectable,
1921
+ args: [{
1922
+ providedIn: 'root'
1923
+ }]
1924
+ }], ctorParameters: () => [{ type: i1$1.Apollo }] });
1925
+
1926
+ class FormCurrencyInputComponent {
1927
+ constructor(numberPlaceholder, ch, currencyService) {
1928
+ this.numberPlaceholder = numberPlaceholder;
1929
+ this.ch = ch;
1930
+ this.currencyService = currencyService;
1931
+ this.clearable = true;
1932
+ this.isInputNumber = false;
1933
+ this.initialItems = [];
1934
+ this.numberValue = null;
1935
+ this.isNumberDisabled = false;
1936
+ this.required = false;
1937
+ this.disabled = false;
1938
+ this.bindLabel = 'label';
1939
+ this.bindValue = 'value';
1940
+ this.onChange = new EventEmitter();
1941
+ this.typeahead = new Subject();
1942
+ this.query$ = this.typeahead.pipe(distinctUntilChanged(), debounceTime(300), tap(() => this.isLoading = true), switchMap((k) => this.queryFunc(k).pipe(map((result) => result.length === 0 ? this.initialItems : result), catchError(() => of(this.initialItems)))), tap(() => this.isLoading = false));
1943
+ this.items$ = this.query$;
1944
+ this.isLoading = false;
1945
+ this.isTouched = false;
1946
+ this.value = null;
1947
+ this.decimalLimiter = 0;
1948
+ this.changed = (_val) => { };
1949
+ this.onTouched = () => { };
1950
+ }
1951
+ ngOnChanges(changes) {
1952
+ if (changes['initialItems']) {
1953
+ this.items$ = concat(of(this.initialItems), this.query$);
1954
+ this.decimalLimiter = this.initialItems[0]?.magnifyValue === 1 ? 0 : Math.floor(Math.log10(this.initialItems[0]?.magnifyValue ?? 1));
1955
+ this.numberValue = this.numberValue / this.initialItems[0]?.magnifyValue;
1956
+ }
1957
+ if (this.isInputNumber)
1958
+ this.bindLabel = 'value';
1959
+ }
1960
+ registerOnChange(fn) { this.changed = fn; }
1961
+ registerOnTouched(fn) { this.onTouched = fn; }
1962
+ writeValue(val) {
1963
+ this.value = val;
1964
+ this.ch.markForCheck();
1965
+ }
1966
+ setDisabledState(d) {
1967
+ this.disabled = d;
1968
+ this.ch.markForCheck();
1969
+ }
1970
+ validate(control) {
1971
+ this.formControl = control;
1972
+ return null;
1973
+ }
1974
+ change(e) {
1975
+ if (this.isInputNumber)
1976
+ this.numberValue = null;
1977
+ this.onChange.emit({ ccy: e, number: this.numberValue });
1978
+ this.initialItems = e;
1979
+ if (!this.isTouched) {
1980
+ this.onTouched();
1981
+ this.isTouched = true;
1982
+ }
1983
+ if (!this.disabled) {
1984
+ if (!e)
1985
+ this.value = null;
1986
+ else
1987
+ this.value = e[this.bindValue];
1988
+ this.changed(this.value);
1989
+ this.errorMsg = getFormErrorMessage(this.formControl.errors, 'Currency');
1990
+ }
1991
+ if (e?.magnifyValue === 1)
1992
+ this.decimalLimiter = 0;
1993
+ else
1994
+ this.decimalLimiter = Math.floor(Math.log10(e?.magnifyValue));
1995
+ }
1996
+ numberInput({ value }) {
1997
+ this.numberValue = value;
1998
+ this.onChange.emit({ ccy: this.initialItems, number: value });
1999
+ }
2000
+ limitDecimal({ charCode, preventDefault, target: { value } }) {
2001
+ const reg = this.decimalLimiter > 0 ? new RegExp(`^\\d*(\\.\\d{0,${this.decimalLimiter}})?$`) : /^\d+$/;
2002
+ if (!reg.test(value + String.fromCharCode(charCode)))
2003
+ preventDefault();
2004
+ }
2005
+ queryFunc(keyword) {
2006
+ return this.currencyService.query(keyword).pipe(map(({ data: { webConfigMsCurrency: { data } } }) => data.map(({ code, name, magnifyValue }) => ({ label: `[${code}] ${name}`, value: code, magnifyValue }))));
2007
+ }
2008
+ ;
2009
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormCurrencyInputComponent, deps: [{ token: 'numberPlaceholder', attribute: true }, { token: i0.ChangeDetectorRef }, { token: CurrencyService }], target: i0.ɵɵFactoryTarget.Component }); }
2010
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: FormCurrencyInputComponent, isStandalone: true, selector: "up-currency-input", inputs: { clearable: "clearable", isInputNumber: "isInputNumber", initialItems: "initialItems", numberValue: "numberValue", isNumberDisabled: "isNumberDisabled", required: "required", disabled: "disabled", bindLabel: "bindLabel", bindValue: "bindValue" }, outputs: { onChange: "onChange" }, host: { classAttribute: "d-block" }, providers: [
2011
+ {
2012
+ multi: true,
2013
+ provide: NG_VALUE_ACCESSOR,
2014
+ useExisting: FormCurrencyInputComponent
2015
+ },
2016
+ {
2017
+ multi: true,
2018
+ provide: NG_VALIDATORS,
2019
+ useExisting: FormCurrencyInputComponent
2020
+ }
2021
+ ], usesOnChanges: true, ngImport: i0, template: "<label class=\"form-label\" [class.required]=\"required\">Currency</label>\n\n<ng-template #selectForm>\n <ng-select \n class=\"flex-shrink-0\"\n [class.number]=\"isInputNumber\"\n appendTo=\"body\"\n typeToSearchText=\"Please enter 3 or more characters\"\n placeholder=\"Currency\"\n [bindLabel]=\"bindLabel\"\n [bindValue]=\"bindValue\"\n [minTermLength]=\"3\"\n [virtualScroll]=\"true\"\n [editableSearchTerm]=\"true\"\n [ngModel]=\"value\"\n [readonly]=\"disabled\" \n [loading]=\"isLoading\"\n [clearable]=\"clearable\"\n [typeahead]=\"typeahead\"\n [items]=\"items$ | async\"\n (change)=\"change($event);\"\n >\n <ng-template ng-option-tmp let-i=\"item\">\n <span>{{ isInputNumber? i.value : i.label }}</span>\n </ng-template>\n </ng-select>\n</ng-template>\n\n<ng-template #inputNumber>\n <div class=\"d-flex justify-content-between gap-1 align-items-center\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n\n <input type=\"number\" [placeholder]=\"numberPlaceholder\" class=\"form-control flex-grow-1\" [disabled]=\"isNumberDisabled\" [value]=\"numberValue\" (keypress)=\"limitDecimal($event)\" (input)=\"numberInput($event.target)\">\n </div>\n</ng-template>\n\n<ng-container *ngIf=\"!isInputNumber else inputNumber\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n</ng-container>\n\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: ["ng-select.number{min-width:105px;max-width:105px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3$2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3$2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2022
+ }
2023
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormCurrencyInputComponent, decorators: [{
2024
+ type: Component,
2025
+ args: [{ standalone: true, selector: 'up-currency-input', changeDetection: ChangeDetectionStrategy.OnPush, host: {
2026
+ class: 'd-block'
2027
+ }, imports: [
2028
+ CommonModule,
2029
+ FormsModule,
2030
+ NgSelectModule
2031
+ ], providers: [
2032
+ {
2033
+ multi: true,
2034
+ provide: NG_VALUE_ACCESSOR,
2035
+ useExisting: FormCurrencyInputComponent
2036
+ },
2037
+ {
2038
+ multi: true,
2039
+ provide: NG_VALIDATORS,
2040
+ useExisting: FormCurrencyInputComponent
2041
+ }
2042
+ ], template: "<label class=\"form-label\" [class.required]=\"required\">Currency</label>\n\n<ng-template #selectForm>\n <ng-select \n class=\"flex-shrink-0\"\n [class.number]=\"isInputNumber\"\n appendTo=\"body\"\n typeToSearchText=\"Please enter 3 or more characters\"\n placeholder=\"Currency\"\n [bindLabel]=\"bindLabel\"\n [bindValue]=\"bindValue\"\n [minTermLength]=\"3\"\n [virtualScroll]=\"true\"\n [editableSearchTerm]=\"true\"\n [ngModel]=\"value\"\n [readonly]=\"disabled\" \n [loading]=\"isLoading\"\n [clearable]=\"clearable\"\n [typeahead]=\"typeahead\"\n [items]=\"items$ | async\"\n (change)=\"change($event);\"\n >\n <ng-template ng-option-tmp let-i=\"item\">\n <span>{{ isInputNumber? i.value : i.label }}</span>\n </ng-template>\n </ng-select>\n</ng-template>\n\n<ng-template #inputNumber>\n <div class=\"d-flex justify-content-between gap-1 align-items-center\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n\n <input type=\"number\" [placeholder]=\"numberPlaceholder\" class=\"form-control flex-grow-1\" [disabled]=\"isNumberDisabled\" [value]=\"numberValue\" (keypress)=\"limitDecimal($event)\" (input)=\"numberInput($event.target)\">\n </div>\n</ng-template>\n\n<ng-container *ngIf=\"!isInputNumber else inputNumber\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n</ng-container>\n\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: ["ng-select.number{min-width:105px;max-width:105px}\n"] }]
2043
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2044
+ type: Attribute,
2045
+ args: ['numberPlaceholder']
2046
+ }] }, { type: i0.ChangeDetectorRef }, { type: CurrencyService }], propDecorators: { clearable: [{
2047
+ type: Input
2048
+ }], isInputNumber: [{
2049
+ type: Input
2050
+ }], initialItems: [{
2051
+ type: Input
2052
+ }], numberValue: [{
2053
+ type: Input
2054
+ }], isNumberDisabled: [{
2055
+ type: Input
2056
+ }], required: [{
2057
+ type: Input
2058
+ }], disabled: [{
2059
+ type: Input
2060
+ }], bindLabel: [{
2061
+ type: Input
2062
+ }], bindValue: [{
2063
+ type: Input
2064
+ }], onChange: [{
2065
+ type: Output
2066
+ }] } });
2067
+
2068
+ class FilterComponent {
2069
+ constructor(placeholder, ch, popoverCtrl) {
2070
+ this.placeholder = placeholder;
2071
+ this.ch = ch;
2072
+ this.popoverCtrl = popoverCtrl;
2073
+ this.onSearch = new EventEmitter();
2074
+ this.form = new FormGroup({});
2075
+ this.activeFilter = [];
2076
+ }
2077
+ ngOnInit() {
2078
+ this.config.fields.forEach(({ key, initialValue }) => {
2079
+ if (typeof key === 'string')
2080
+ this.createFormControl(key, initialValue);
2081
+ else {
2082
+ key.forEach((k, i) => this.createFormControl(k, initialValue?.at(i)));
2083
+ }
2084
+ });
2085
+ }
2086
+ close() { this.popoverCtrl.dismiss(); }
2087
+ clear() {
2088
+ this.resetValue();
2089
+ this.form.reset();
2090
+ this.onSearch.emit({ mode: this.config.mode, data: null });
2091
+ }
2092
+ removeFilter(i) {
2093
+ this.form.controls[this.activeFilter[i].key].setValue('');
2094
+ this.activeFilter.splice(i, 1);
2095
+ this.emitValue();
2096
+ }
2097
+ search() {
2098
+ this.resetValue();
2099
+ this.emitValue((k, v) => this.activeFilter.push({ key: k, value: v, label: `${k}:${k.includes('date') ? formatDate(v, 'dd MMM yyyy', 'en-US') : v}` }));
2100
+ this.close();
2101
+ }
2102
+ add() {
2103
+ const { key, value } = this.getValue(this.searchBox.nativeElement.value);
2104
+ if (this.config.fields.findIndex(({ key: k }) => k === key) === -1) {
2105
+ this.searchBox.nativeElement.value = '';
2106
+ return;
2107
+ }
2108
+ const i = this.activeFilter.findIndex(({ key: k }) => k === key);
2109
+ if (i === -1)
2110
+ this.activeFilter.push({ label: `${key}:${value}`, key, value });
2111
+ else {
2112
+ this.activeFilter[i].key = key;
2113
+ this.activeFilter[i].value = value;
2114
+ this.activeFilter[i].label = `${key}:${value}`;
2115
+ }
2116
+ this.form.patchValue({ [key]: value });
2117
+ this.searchBox.nativeElement.value = '';
2118
+ this.emitValue();
2119
+ }
2120
+ resetValue() {
2121
+ this.activeFilter.length = 0;
2122
+ this.searchBox.nativeElement.value = '';
2123
+ }
2124
+ getValue(value) {
2125
+ const values = value.split(':');
2126
+ if (values.length === 1)
2127
+ return { key: this.config.fields[0].key, value: values[0] };
2128
+ return { key: values[0], value: values[1] };
2129
+ }
2130
+ emitValue(extraAction) {
2131
+ let flag = false;
2132
+ const f = this.form.getRawValue();
2133
+ const data = {};
2134
+ Object.keys(f).forEach((k) => {
2135
+ if (!f[k])
2136
+ return;
2137
+ flag = true;
2138
+ data[k] = f[k];
2139
+ extraAction?.(k, f[k]);
2140
+ });
2141
+ this.onSearch.emit({ mode: this.config.mode, data: flag ? data : null });
2142
+ }
2143
+ createFormControl(key, val) {
2144
+ this.form.addControl(key, new FormControl(''));
2145
+ if (val) {
2146
+ this.form.controls[key].setValue(val);
2147
+ this.activeFilter.push({ label: `${key}:${val}`, key, value: val });
2148
+ }
2149
+ }
2150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FilterComponent, deps: [{ token: 'placeholder', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i1.PopoverController }], target: i0.ɵɵFactoryTarget.Component }); }
2151
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: FilterComponent, isStandalone: true, selector: "up-filter", inputs: { id: "id", config: "config" }, outputs: { onSearch: "onSearch" }, host: { classAttribute: "d-block position-relative" }, viewQueries: [{ propertyName: "searchBox", first: true, predicate: ["searchBox"], descendants: true }], ngImport: i0, template: "<ion-icon name=\"search\" class=\"fs-4 position-absolute\" />\n\n<div class=\"d-flex align-items-center form-control ps-5 py-0 pe-0 gap-3\">\n <div *ngIf=\"activeFilter.length > 0\" class=\"d-flex flex-grow-1 flex-shrink-0 tag-container gap-2 text-nowrap overflow-auto\">\n <div class=\"tag-item p-1 rounded d-flex align-items-center user-select-none\" *ngFor=\"let item of activeFilter; index as i\">\n <ion-icon name=\"close\" class=\"pe-1 me-1 cursor-pointer text-primary\" (click)=\"removeFilter(i);\" />\n {{ item.label }}\n </div>\n </div>\n\n <input #searchBox type=\"search\" placeholder=\"{{ placeholder }}\" class=\"flex-shrink-1 border-0 form-control ps-0 py-2\" [class.adv]=\"config.mode === 'advanced'\" (keyup.enter)=\"add();\" />\n</div>\n\n<ng-container *ngIf=\"config.mode === 'advanced'\">\n <ion-icon name=\"filter\" class=\"position-absolute fs-4 cursor-pointer\" id=\"filter-{{ id }}\" />\n <ion-icon name=\"close\" class=\"position-absolute fs-4 cursor-pointer\" (click)=\"clear();\" />\n\n <ion-popover trigger=\"filter-{{ id }}\" triggerAction=\"click\">\n <ng-template>\n <div class=\"d-flex flex-column filter\">\n <div class=\"flex-shrink-0 border-bottom p-1 pe-4 d-flex align-items-center\">\n <ion-buttons>\n <ion-button size=\"small\" (click)=\"close()\">\n <ion-icon slot=\"icon-only\" name=\"close\" />\n </ion-button>\n </ion-buttons>\n \n <div class=\"fs-5 fw-medium\">Advanced Filter</div>\n </div>\n \n <form class=\"flex-grow-1 overflow-auto px-4\" [formGroup]=\"form\">\n <ng-container *ngFor=\"let c of config.fields\">\n <ng-container [ngSwitch]=\"c.type\">\n <up-input type=\"number\" autocomplete=\"off\" class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" *ngSwitchCase=\"'number'\" />\n \n <div class=\"my-4\" *ngSwitchCase=\"'checkbox'\">\n <ion-checkbox labelPlacement=\"end\" formControlName=\"{{ c.key }}\">{{ c.label }}</ion-checkbox>\n </div>\n \n <div class=\"d-flex gap-3 my-4\" *ngSwitchCase=\"'date-range'\">\n <up-date class=\"flex-grow-1\" name=\"filter-from\" label=\"{{ c.label[0] }}\" formControlName=\"{{ c.key[0] }}\" />\n <up-date class=\"flex-grow-1\" name=\"filter-to\" label=\"{{ c.label[1] }}\" formControlName=\"{{ c.key[1] }}\" />\n </div>\n \n <up-select class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" [items]=\"c.options!\" *ngSwitchCase=\"'select'\" />\n <up-searchable-select class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" [queryFunc]=\"c.getOptions!\" [initialItems]=\"c.options!\" *ngSwitchCase=\"'searchable-select'\" />\n \n <up-input type=\"text\" autocomplete=\"off\" class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" *ngSwitchDefault />\n </ng-container>\n </ng-container>\n </form>\n \n <div class=\"flex-shrink-0 py-3 px-4 border-top d-flex gap-3\">\n <ion-button class=\"flex-grow-1\" color=\"secondary\" (click)=\"form.reset();\">Reset</ion-button>\n <ion-button class=\"flex-grow-1\" color=\"primary\" (click)=\"search();\">Search</ion-button>\n </div>\n </div>\n </ng-template>\n </ion-popover> \n</ng-container>\n", styles: ["ion-icon{top:7px}ion-icon[name=close]{right:16px}ion-icon[name=search]{left:14px}ion-icon[name=filter]{right:48px}ion-popover{--width: 80%;--max-width: 450px}.adv{padding-right:60px}.fs-5,ion-icon{color:#616161}.tag-container{max-width:47%}.tag-container::-webkit-scrollbar{height:0px}.tag-item{color:#ed6b26;background-color:#fef3ee}.tag-item ion-icon{border-right:1px solid #fbd1be}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i1.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i1.IonCheckbox, selector: "ion-checkbox", inputs: ["alignment", "checked", "color", "disabled", "indeterminate", "justify", "labelPlacement", "legacy", "mode", "name", "value"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonPopover, selector: "ion-popover" }, { kind: "directive", type: i1.BooleanValueAccessor, selector: "ion-checkbox,ion-toggle" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: FormDateComponent, selector: "up-date", inputs: ["label", "required", "disabled", "presentation"] }, { kind: "component", type: FormInputComponent, selector: "up-input", inputs: ["label", "value", "required", "disabled"], outputs: ["onInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FormSelectComponent, selector: "up-select", inputs: ["items", "clearable", "label", "multiple", "required", "addTag", "disabled", "searchable", "bindLabel", "bindValue"] }, { kind: "component", type: FormSearchableSelectComponent, selector: "up-searchable-select", inputs: ["queryFunc", "clearable", "label", "initialItems", "required", "addTag", "disabled", "multiple", "bindLabel", "bindValue"], outputs: ["onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2152
+ }
2153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FilterComponent, decorators: [{
2154
+ type: Component,
2155
+ args: [{ standalone: true, selector: 'up-filter', changeDetection: ChangeDetectionStrategy.OnPush, host: {
2156
+ class: 'd-block position-relative'
2157
+ }, imports: [
2158
+ IonicModule,
2159
+ CommonModule,
2160
+ FormDateComponent,
2161
+ FormInputComponent,
2162
+ ReactiveFormsModule,
2163
+ FormSelectComponent,
2164
+ FormSearchableSelectComponent
2165
+ ], template: "<ion-icon name=\"search\" class=\"fs-4 position-absolute\" />\n\n<div class=\"d-flex align-items-center form-control ps-5 py-0 pe-0 gap-3\">\n <div *ngIf=\"activeFilter.length > 0\" class=\"d-flex flex-grow-1 flex-shrink-0 tag-container gap-2 text-nowrap overflow-auto\">\n <div class=\"tag-item p-1 rounded d-flex align-items-center user-select-none\" *ngFor=\"let item of activeFilter; index as i\">\n <ion-icon name=\"close\" class=\"pe-1 me-1 cursor-pointer text-primary\" (click)=\"removeFilter(i);\" />\n {{ item.label }}\n </div>\n </div>\n\n <input #searchBox type=\"search\" placeholder=\"{{ placeholder }}\" class=\"flex-shrink-1 border-0 form-control ps-0 py-2\" [class.adv]=\"config.mode === 'advanced'\" (keyup.enter)=\"add();\" />\n</div>\n\n<ng-container *ngIf=\"config.mode === 'advanced'\">\n <ion-icon name=\"filter\" class=\"position-absolute fs-4 cursor-pointer\" id=\"filter-{{ id }}\" />\n <ion-icon name=\"close\" class=\"position-absolute fs-4 cursor-pointer\" (click)=\"clear();\" />\n\n <ion-popover trigger=\"filter-{{ id }}\" triggerAction=\"click\">\n <ng-template>\n <div class=\"d-flex flex-column filter\">\n <div class=\"flex-shrink-0 border-bottom p-1 pe-4 d-flex align-items-center\">\n <ion-buttons>\n <ion-button size=\"small\" (click)=\"close()\">\n <ion-icon slot=\"icon-only\" name=\"close\" />\n </ion-button>\n </ion-buttons>\n \n <div class=\"fs-5 fw-medium\">Advanced Filter</div>\n </div>\n \n <form class=\"flex-grow-1 overflow-auto px-4\" [formGroup]=\"form\">\n <ng-container *ngFor=\"let c of config.fields\">\n <ng-container [ngSwitch]=\"c.type\">\n <up-input type=\"number\" autocomplete=\"off\" class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" *ngSwitchCase=\"'number'\" />\n \n <div class=\"my-4\" *ngSwitchCase=\"'checkbox'\">\n <ion-checkbox labelPlacement=\"end\" formControlName=\"{{ c.key }}\">{{ c.label }}</ion-checkbox>\n </div>\n \n <div class=\"d-flex gap-3 my-4\" *ngSwitchCase=\"'date-range'\">\n <up-date class=\"flex-grow-1\" name=\"filter-from\" label=\"{{ c.label[0] }}\" formControlName=\"{{ c.key[0] }}\" />\n <up-date class=\"flex-grow-1\" name=\"filter-to\" label=\"{{ c.label[1] }}\" formControlName=\"{{ c.key[1] }}\" />\n </div>\n \n <up-select class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" [items]=\"c.options!\" *ngSwitchCase=\"'select'\" />\n <up-searchable-select class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" [queryFunc]=\"c.getOptions!\" [initialItems]=\"c.options!\" *ngSwitchCase=\"'searchable-select'\" />\n \n <up-input type=\"text\" autocomplete=\"off\" class=\"my-4\" label=\"{{ c.label }}\" formControlName=\"{{ c.key }}\" *ngSwitchDefault />\n </ng-container>\n </ng-container>\n </form>\n \n <div class=\"flex-shrink-0 py-3 px-4 border-top d-flex gap-3\">\n <ion-button class=\"flex-grow-1\" color=\"secondary\" (click)=\"form.reset();\">Reset</ion-button>\n <ion-button class=\"flex-grow-1\" color=\"primary\" (click)=\"search();\">Search</ion-button>\n </div>\n </div>\n </ng-template>\n </ion-popover> \n</ng-container>\n", styles: ["ion-icon{top:7px}ion-icon[name=close]{right:16px}ion-icon[name=search]{left:14px}ion-icon[name=filter]{right:48px}ion-popover{--width: 80%;--max-width: 450px}.adv{padding-right:60px}.fs-5,ion-icon{color:#616161}.tag-container{max-width:47%}.tag-container::-webkit-scrollbar{height:0px}.tag-item{color:#ed6b26;background-color:#fef3ee}.tag-item ion-icon{border-right:1px solid #fbd1be}\n"] }]
2166
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2167
+ type: Attribute,
2168
+ args: ['placeholder']
2169
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1.PopoverController }], propDecorators: { id: [{
2170
+ type: Input,
2171
+ args: [{ required: true }]
2172
+ }], config: [{
2173
+ type: Input,
2174
+ args: [{ required: true }]
2175
+ }], onSearch: [{
2176
+ type: Output
2177
+ }], searchBox: [{
2178
+ type: ViewChild,
2179
+ args: ['searchBox']
2180
+ }] } });
2181
+
2182
+ class GridService {
2183
+ constructor() {
2184
+ this.apis = {};
2185
+ }
2186
+ getApi(id) { return this.apis[id]; }
2187
+ setApi(id, api) { this.apis[id] = api; }
2188
+ refreshGridCache(id) {
2189
+ this.apis[id].refreshInfiniteCache();
2190
+ }
2191
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2192
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridService, providedIn: 'root' }); }
2193
+ }
2194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridService, decorators: [{
2195
+ type: Injectable,
2196
+ args: [{
2197
+ providedIn: 'root'
2198
+ }]
2199
+ }] });
2200
+
2201
+ class GridSnapshotComponent {
2202
+ constructor(service) {
2203
+ this.service = service;
2204
+ this.id = 'grid-s';
2205
+ this.rowSelection = 'single';
2206
+ this.onRowClick = new EventEmitter();
2207
+ this.onGridReady = new EventEmitter();
2208
+ this.onSelectionChanged = new EventEmitter();
2209
+ this.defaultColDef = { minWidth: 200, flex: 1, sortable: true, resizable: true, sortingOrder: ['asc', 'desc'], cellStyle: { textAlign: 'left' } };
2210
+ this.sort = { order: '', orderBy: '' };
2211
+ ModuleRegistry.register(InfiniteRowModelModule);
2212
+ }
2213
+ ngOnInit() {
2214
+ if (!this.config.rowPerPage)
2215
+ this.config.rowPerPage = 50;
2216
+ this.config.noRowText = `<span class="f20">${this.config.noRowText ?? 'Data not found'}</span>`;
2217
+ }
2218
+ ngOnDestroy() { this.subs?.unsubscribe(); }
2219
+ clickRow(data) { this.onRowClick.emit(data.node); }
2220
+ dragColumn({ api }) { localStorage.setItem(this.id, JSON.stringify(api.getColumnState())); }
2221
+ changeSelected(data) { this.onSelectionChanged.emit(data); }
2222
+ changePagination(ev) {
2223
+ if (ev.newPageSize)
2224
+ this.config.rowPerPage = this.gridApi.paginationGetPageSize();
2225
+ }
2226
+ setDatasource(ev) {
2227
+ this.gridApi = ev.api;
2228
+ this.onGridReady.emit(ev);
2229
+ this.service.setApi(this.id, this.gridApi);
2230
+ const state = JSON.parse(localStorage.getItem(this.id));
2231
+ if (state)
2232
+ ev.api.applyColumnState({ state, applyOrder: true });
2233
+ this.reset();
2234
+ }
2235
+ reset() {
2236
+ const datasource = {
2237
+ getRows: ({ sortModel: [{ colId, sort }], successCallback, failCallback }) => {
2238
+ this.gridApi.showLoadingOverlay();
2239
+ if (colId !== this.sort.orderBy || sort !== this.sort.order) {
2240
+ this.sort.order = sort;
2241
+ this.sort.orderBy = colId;
2242
+ this.gridApi.paginationGoToFirstPage();
2243
+ }
2244
+ const page = this.gridApi.paginationGetCurrentPage();
2245
+ if (page === 0)
2246
+ this.after = null;
2247
+ this.subs = this.config.getDataSnapshot(this.config.rowPerPage, colId, sort, this.after).subscribe({
2248
+ next: ({ data, totalRecord }) => {
2249
+ this.gridApi.hideOverlay();
2250
+ const { edges, pageInfo } = data;
2251
+ if (edges.length > 0)
2252
+ this.after = pageInfo.endCursor;
2253
+ if (page === 0) {
2254
+ if (edges.length === 0)
2255
+ this.gridApi.showNoRowsOverlay();
2256
+ this.count = totalRecord;
2257
+ }
2258
+ if (!this.config.useTotalRecord && !pageInfo.hasNextPage) {
2259
+ this.count = (page * this.config.rowPerPage) + edges.length;
2260
+ }
2261
+ successCallback(edges, this.count);
2262
+ },
2263
+ error: () => {
2264
+ this.gridApi.hideOverlay();
2265
+ this.gridApi.showNoRowsOverlay();
2266
+ failCallback();
2267
+ }
2268
+ });
2269
+ }
2270
+ };
2271
+ this.gridApi.setGridOption('datasource', datasource);
2272
+ }
2273
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridSnapshotComponent, deps: [{ token: GridService }], target: i0.ɵɵFactoryTarget.Component }); }
2274
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: GridSnapshotComponent, isStandalone: true, selector: "up-snapshot-grid", inputs: { id: "id", config: "config", rowSelection: "rowSelection" }, outputs: { onRowClick: "onRowClick", onGridReady: "onGridReady", onSelectionChanged: "onSelectionChanged" }, host: { classAttribute: "d-block h-100 w-100" }, ngImport: i0, template: "<ag-grid-angular class=\"ag-theme-balham h-100\"\n rowModelType=\"infinite\"\n [pagination]=\"true\"\n [animateRows]=\"true\"\n [rowSelection]=\"rowSelection\"\n [columnDefs]=\"config.colDefs\"\n [defaultColDef]=\"defaultColDef\"\n [cacheBlockSize]=\"config.rowPerPage\"\n [paginationPageSize]=\"config.rowPerPage\"\n [overlayNoRowsTemplate]=\"config.noRowText\"\n (dragStopped)=\"dragColumn($event)\"\n (gridReady)=\"setDatasource($event)\"\n (rowClicked)=\"clickRow($event.data)\"\n (selectionChanged)=\"changeSelected($event)\"\n (paginationChanged)=\"changePagination($event)\"\n/>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AgGridModule }, { kind: "component", type: i2$1.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "columnMenu", "suppressMenuHide", "enableBrowserTooltips", "tooltipTrigger", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "tooltipInteraction", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "suppressCutToClipboard", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "dataTypeDefinitions", "maintainColumnOrder", "suppressFieldDotNotation", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "autoSizeStrategy", "components", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterMovesDown", "enterMovesDownAfterEdit", "enterNavigatesVertically", "enterNavigatesVerticallyAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "quickFilterText", "cacheQuickFilter", "excludeHiddenColumnsFromQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "excludeChildrenWhenTreeDataFiltering", "enableAdvancedFilter", "advancedFilterModel", "includeHiddenColumnsInAdvancedFilter", "advancedFilterParent", "advancedFilterBuilderParams", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "enableChartToolPanelsButton", "suppressChartToolPanelsButton", "chartToolPanelsDef", "loadingCellRenderer", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressParentsInRowNodes", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationPageSizeSelector", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotDefaultExpanded", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "alwaysAggregateAtRootLevel", "suppressAggAtRootLevel", "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", "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", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideEnableClientSideSort", "serverSideOnlyRefreshFilteredGroups", "serverSideFilterAllLevels", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSidePivotResultFieldSeparator", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellFocus", "suppressHeaderFocus", "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", "functionsPassive", "enableGroupEdit", "initialState", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processUnpinnedColumns", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "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", "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", "rangeDeleteStart", "rangeDeleteEnd", "filterOpened", "filterChanged", "filterModified", "advancedFilterBuilderVisibleChanged", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "gridReady", "gridPreDestroyed", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "stateUpdated", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pinnedRowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "storeRefreshed", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "tooltipShow", "tooltipHide", "sortChanged", "columnRowGroupChangeRequest", "columnPivotChangeRequest", "columnValueChangeRequest", "columnAggFuncChangeRequest"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2275
+ }
2276
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridSnapshotComponent, decorators: [{
2277
+ type: Component,
2278
+ args: [{ standalone: true, selector: 'up-snapshot-grid', changeDetection: ChangeDetectionStrategy.OnPush, host: {
2279
+ class: 'd-block h-100 w-100'
2280
+ }, imports: [
2281
+ AgGridModule
2282
+ ], template: "<ag-grid-angular class=\"ag-theme-balham h-100\"\n rowModelType=\"infinite\"\n [pagination]=\"true\"\n [animateRows]=\"true\"\n [rowSelection]=\"rowSelection\"\n [columnDefs]=\"config.colDefs\"\n [defaultColDef]=\"defaultColDef\"\n [cacheBlockSize]=\"config.rowPerPage\"\n [paginationPageSize]=\"config.rowPerPage\"\n [overlayNoRowsTemplate]=\"config.noRowText\"\n (dragStopped)=\"dragColumn($event)\"\n (gridReady)=\"setDatasource($event)\"\n (rowClicked)=\"clickRow($event.data)\"\n (selectionChanged)=\"changeSelected($event)\"\n (paginationChanged)=\"changePagination($event)\"\n/>\n" }]
2283
+ }], ctorParameters: () => [{ type: GridService }], propDecorators: { id: [{
2284
+ type: Input
2285
+ }], config: [{
2286
+ type: Input,
2287
+ args: [{ required: true }]
2288
+ }], rowSelection: [{
2289
+ type: Input
2290
+ }], onRowClick: [{
2291
+ type: Output
2292
+ }], onGridReady: [{
2293
+ type: Output
2294
+ }], onSelectionChanged: [{
2295
+ type: Output
2296
+ }] } });
2297
+
2298
+ class GridPaginationComponent {
2299
+ constructor(service) {
2300
+ this.service = service;
2301
+ this.rowData = [];
2302
+ this.id = 'grid-p';
2303
+ this.rowModelType = 'infinite';
2304
+ this.rowSelection = 'single';
2305
+ this.onRowClick = new EventEmitter();
2306
+ this.onGridReady = new EventEmitter();
2307
+ this.onSelectionChanged = new EventEmitter();
2308
+ this.defaultColDef = { minWidth: 200, flex: 1, sortable: true, resizable: true, sortingOrder: ['asc', 'desc'], cellStyle: { textAlign: 'left' } };
2309
+ }
2310
+ ngOnInit() {
2311
+ ModuleRegistry.register(this.rowModelType === 'infinite' ? InfiniteRowModelModule : ClientSideRowModelModule);
2312
+ if (!this.config.rowPerPage)
2313
+ this.config.rowPerPage = 50;
2314
+ this.config.noRowText = `<span class="f20">${this.config.noRowText ?? 'Data not found'}</span>`;
2315
+ }
2316
+ ngOnDestroy() { this.subs?.unsubscribe(); }
2317
+ clickRow(data) { this.onRowClick.emit(data); }
2318
+ dragColumn({ api }) { localStorage.setItem(this.id, JSON.stringify(api.getColumnState())); }
2319
+ changeSelected(data) { this.onSelectionChanged.emit(data); }
2320
+ changePagination(ev) {
2321
+ if (ev.newPageSize)
2322
+ this.config.rowPerPage = this.gridApi.paginationGetPageSize();
2323
+ }
2324
+ setDatasource(ev) {
2325
+ this.gridApi = ev.api;
2326
+ this.onGridReady.emit(ev);
2327
+ this.service.setApi(this.id, this.gridApi);
2328
+ const state = JSON.parse(localStorage.getItem(this.id));
2329
+ if (state)
2330
+ ev.api.applyColumnState({ state, applyOrder: true });
2331
+ if (this.rowModelType === 'clientSide')
2332
+ this.gridApi.setGridOption('rowData', this.rowData);
2333
+ if (this.rowModelType !== 'infinite')
2334
+ return;
2335
+ this.reset();
2336
+ }
2337
+ reset() {
2338
+ if (!this.gridApi)
2339
+ return;
2340
+ const datasource = {
2341
+ getRows: ({ sortModel: [{ colId, sort }], successCallback, failCallback }) => {
2342
+ this.gridApi.showLoadingOverlay();
2343
+ const offset = this.gridApi.paginationGetCurrentPage();
2344
+ this.subs = this.config.getData(offset, this.config.rowPerPage, colId, sort).subscribe({
2345
+ next: ({ data, totalRecord }) => {
2346
+ this.gridApi.hideOverlay();
2347
+ if (offset === 0) {
2348
+ if (data.length === 0)
2349
+ this.gridApi.showNoRowsOverlay();
2350
+ this.count = totalRecord;
2351
+ }
2352
+ if (!this.config.useTotalRecord && data.length < this.config.rowPerPage) {
2353
+ this.count = (offset * this.config.rowPerPage) + data.length;
2354
+ }
2355
+ successCallback(data, this.count);
2356
+ },
2357
+ error: () => {
2358
+ this.gridApi.hideOverlay();
2359
+ this.gridApi.showNoRowsOverlay();
2360
+ failCallback();
2361
+ }
2362
+ });
2363
+ }
2364
+ };
2365
+ this.gridApi?.setGridOption('datasource', datasource);
2366
+ }
2367
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridPaginationComponent, deps: [{ token: GridService }], target: i0.ɵɵFactoryTarget.Component }); }
2368
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: GridPaginationComponent, isStandalone: true, selector: "up-pagination-grid", inputs: { config: "config", rowData: "rowData", id: "id", rowModelType: "rowModelType", rowSelection: "rowSelection" }, outputs: { onRowClick: "onRowClick", onGridReady: "onGridReady", onSelectionChanged: "onSelectionChanged" }, host: { classAttribute: "d-block h-100 w-100" }, ngImport: i0, template: "<ag-grid-angular class=\"ag-theme-balham h-100\"\n [pagination]=\"true\"\n [animateRows]=\"true\"\n [rowModelType]=\"rowModelType\"\n [rowSelection]=\"rowSelection\"\n [columnDefs]=\"config.colDefs\"\n [defaultColDef]=\"defaultColDef\"\n [cacheBlockSize]=\"config.rowPerPage\"\n [paginationPageSize]=\"config.rowPerPage\"\n [overlayNoRowsTemplate]=\"config.noRowText\"\n (dragStopped)=\"dragColumn($event)\"\n (gridReady)=\"setDatasource($event)\"\n (rowClicked)=\"clickRow($event.data)\"\n (selectionChanged)=\"changeSelected($event)\"\n (paginationChanged)=\"changePagination($event)\"\n/>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AgGridModule }, { kind: "component", type: i2$1.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "columnMenu", "suppressMenuHide", "enableBrowserTooltips", "tooltipTrigger", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "tooltipInteraction", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "suppressCutToClipboard", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "dataTypeDefinitions", "maintainColumnOrder", "suppressFieldDotNotation", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "autoSizeStrategy", "components", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterMovesDown", "enterMovesDownAfterEdit", "enterNavigatesVertically", "enterNavigatesVerticallyAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "quickFilterText", "cacheQuickFilter", "excludeHiddenColumnsFromQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "excludeChildrenWhenTreeDataFiltering", "enableAdvancedFilter", "advancedFilterModel", "includeHiddenColumnsInAdvancedFilter", "advancedFilterParent", "advancedFilterBuilderParams", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "enableChartToolPanelsButton", "suppressChartToolPanelsButton", "chartToolPanelsDef", "loadingCellRenderer", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressParentsInRowNodes", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationPageSizeSelector", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotDefaultExpanded", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "alwaysAggregateAtRootLevel", "suppressAggAtRootLevel", "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", "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", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideEnableClientSideSort", "serverSideOnlyRefreshFilteredGroups", "serverSideFilterAllLevels", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSidePivotResultFieldSeparator", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellFocus", "suppressHeaderFocus", "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", "functionsPassive", "enableGroupEdit", "initialState", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processUnpinnedColumns", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "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", "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", "rangeDeleteStart", "rangeDeleteEnd", "filterOpened", "filterChanged", "filterModified", "advancedFilterBuilderVisibleChanged", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "gridReady", "gridPreDestroyed", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "stateUpdated", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pinnedRowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "storeRefreshed", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "tooltipShow", "tooltipHide", "sortChanged", "columnRowGroupChangeRequest", "columnPivotChangeRequest", "columnValueChangeRequest", "columnAggFuncChangeRequest"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2369
+ }
2370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GridPaginationComponent, decorators: [{
2371
+ type: Component,
2372
+ args: [{ standalone: true, selector: 'up-pagination-grid', changeDetection: ChangeDetectionStrategy.OnPush, host: {
2373
+ class: 'd-block h-100 w-100'
2374
+ }, imports: [
2375
+ AgGridModule
2376
+ ], template: "<ag-grid-angular class=\"ag-theme-balham h-100\"\n [pagination]=\"true\"\n [animateRows]=\"true\"\n [rowModelType]=\"rowModelType\"\n [rowSelection]=\"rowSelection\"\n [columnDefs]=\"config.colDefs\"\n [defaultColDef]=\"defaultColDef\"\n [cacheBlockSize]=\"config.rowPerPage\"\n [paginationPageSize]=\"config.rowPerPage\"\n [overlayNoRowsTemplate]=\"config.noRowText\"\n (dragStopped)=\"dragColumn($event)\"\n (gridReady)=\"setDatasource($event)\"\n (rowClicked)=\"clickRow($event.data)\"\n (selectionChanged)=\"changeSelected($event)\"\n (paginationChanged)=\"changePagination($event)\"\n/>\n" }]
2377
+ }], ctorParameters: () => [{ type: GridService }], propDecorators: { config: [{
2378
+ type: Input,
2379
+ args: [{ required: true }]
2380
+ }], rowData: [{
2381
+ type: Input
2382
+ }], id: [{
2383
+ type: Input
2384
+ }], rowModelType: [{
2385
+ type: Input
2386
+ }], rowSelection: [{
2387
+ type: Input
2388
+ }], onRowClick: [{
2389
+ type: Output
2390
+ }], onGridReady: [{
2391
+ type: Output
2392
+ }], onSelectionChanged: [{
2393
+ type: Output
2394
+ }] } });
2395
+
2396
+ class ListPaginationContainerComponent {
2397
+ constructor(id, router) {
2398
+ this.id = id;
2399
+ this.router = router;
2400
+ this.onRowClick = new EventEmitter();
2401
+ this.onGridReady = new EventEmitter();
2402
+ this.onSearch = new EventEmitter();
2403
+ this.gridId = `grid-${this.id ?? 'p'}`;
2404
+ }
2405
+ openDetail(data) {
2406
+ this.onRowClick.emit(data);
2407
+ this.router.navigate([`${this.config.baseUrl}${data.guid}`], { preserveFragment: true });
2408
+ }
2409
+ setGridApi(ev) {
2410
+ this.gridApi = ev.api;
2411
+ this.onGridReady.emit(ev);
2412
+ }
2413
+ search(k) {
2414
+ this.onSearch.emit(k);
2415
+ this.gridApi.refreshInfiniteCache();
2416
+ }
2417
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ListPaginationContainerComponent, deps: [{ token: 'id', attribute: true }, { token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
2418
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ListPaginationContainerComponent, isStandalone: true, selector: "up-list-pagination-container", inputs: { header: "header", config: "config" }, outputs: { onRowClick: "onRowClick", onGridReady: "onGridReady", onSearch: "onSearch" }, host: { classAttribute: "d-flex flex-column h-100 w-100" }, ngImport: i0, template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">{{ header }}</h3>\n\n <up-btn-group *ngIf=\"config.buttons && config.buttons.length > 0\" id=\"btn-list-snapshot-container\" [config]=\"config.buttons\" />\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\" *ngIf=\"config.filterConfig\">\n <up-filter placeholder=\"Type to search\" id=\"filter-{{ id }}\" [config]=\"config.filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-pagination-grid [config]=\"config.gridConfig\" [id]=\"gridId\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" />\n</div>\n", styles: ["up-filter{min-width:300px}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type: FilterComponent, selector: "up-filter", inputs: ["id", "config"], outputs: ["onSearch"] }, { kind: "component", type: ButtonGroupComponent, selector: "up-btn-group", inputs: ["config"] }, { kind: "component", type: GridPaginationComponent, selector: "up-pagination-grid", inputs: ["config", "rowData", "id", "rowModelType", "rowSelection"], outputs: ["onRowClick", "onGridReady", "onSelectionChanged"] }] }); }
2419
+ }
2420
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ListPaginationContainerComponent, decorators: [{
2421
+ type: Component,
2422
+ args: [{ standalone: true, selector: 'up-list-pagination-container', host: {
2423
+ class: 'd-flex flex-column h-100 w-100'
2424
+ }, imports: [
2425
+ IonicModule,
2426
+ CommonModule,
2427
+ RouterModule,
2428
+ FilterComponent,
2429
+ ButtonGroupComponent,
2430
+ GridPaginationComponent
2431
+ ], template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">{{ header }}</h3>\n\n <up-btn-group *ngIf=\"config.buttons && config.buttons.length > 0\" id=\"btn-list-snapshot-container\" [config]=\"config.buttons\" />\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\" *ngIf=\"config.filterConfig\">\n <up-filter placeholder=\"Type to search\" id=\"filter-{{ id }}\" [config]=\"config.filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-pagination-grid [config]=\"config.gridConfig\" [id]=\"gridId\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" />\n</div>\n", styles: ["up-filter{min-width:300px}\n"] }]
2432
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2433
+ type: Attribute,
2434
+ args: ['id']
2435
+ }] }, { type: i1$2.Router }], propDecorators: { header: [{
2436
+ type: Input,
2437
+ args: [{ required: true }]
2438
+ }], config: [{
2439
+ type: Input,
2440
+ args: [{ required: true }]
2441
+ }], onRowClick: [{
2442
+ type: Output
2443
+ }], onGridReady: [{
2444
+ type: Output
2445
+ }], onSearch: [{
2446
+ type: Output
2447
+ }] } });
2448
+
2449
+ class ListSnapshotContainerComponent {
2450
+ constructor(id, router) {
2451
+ this.id = id;
2452
+ this.router = router;
2453
+ this.onRowClick = new EventEmitter();
2454
+ this.onGridReady = new EventEmitter();
2455
+ this.onSearch = new EventEmitter();
2456
+ this.gridId = `grid-${this.id ?? 'p'}`;
2457
+ }
2458
+ openDetail(data) {
2459
+ this.onRowClick.emit(data);
2460
+ this.router.navigate([`${this.config.baseUrl}${data.guid}`], { preserveFragment: true });
2461
+ }
2462
+ setGridApi(ev) {
2463
+ this.gridApi = ev.api;
2464
+ this.onGridReady.emit(ev);
2465
+ }
2466
+ search(k) {
2467
+ this.onSearch.emit(k);
2468
+ this.gridApi.paginationGoToFirstPage();
2469
+ this.gridApi.purgeInfiniteCache();
2470
+ }
2471
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ListSnapshotContainerComponent, deps: [{ token: 'id', attribute: true }, { token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
2472
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ListSnapshotContainerComponent, isStandalone: true, selector: "up-list-snapshot-container", inputs: { header: "header", config: "config" }, outputs: { onRowClick: "onRowClick", onGridReady: "onGridReady", onSearch: "onSearch" }, host: { classAttribute: "d-flex flex-column h-100 w-100" }, ngImport: i0, template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">{{ header }}</h3>\n\n <up-btn-group *ngIf=\"config.buttons && config.buttons.length > 0\" id=\"btn-list-snapshot-container\" [config]=\"config.buttons\" />\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\" *ngIf=\"config.filterConfig\">\n <up-filter placeholder=\"Type to search\" id=\"filter-{{ id }}\" [config]=\"config.filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-snapshot-grid [config]=\"config.gridConfig\" [id]=\"gridId\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" />\n</div>\n", styles: ["up-filter{min-width:300px}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type: FilterComponent, selector: "up-filter", inputs: ["id", "config"], outputs: ["onSearch"] }, { kind: "component", type: ButtonGroupComponent, selector: "up-btn-group", inputs: ["config"] }, { kind: "component", type: GridSnapshotComponent, selector: "up-snapshot-grid", inputs: ["id", "config", "rowSelection"], outputs: ["onRowClick", "onGridReady", "onSelectionChanged"] }] }); }
2473
+ }
2474
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ListSnapshotContainerComponent, decorators: [{
2475
+ type: Component,
2476
+ args: [{ standalone: true, selector: 'up-list-snapshot-container', host: {
2477
+ class: 'd-flex flex-column h-100 w-100'
2478
+ }, imports: [
2479
+ IonicModule,
2480
+ CommonModule,
2481
+ RouterModule,
2482
+ FilterComponent,
2483
+ ButtonGroupComponent,
2484
+ GridSnapshotComponent
2485
+ ], template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">{{ header }}</h3>\n\n <up-btn-group *ngIf=\"config.buttons && config.buttons.length > 0\" id=\"btn-list-snapshot-container\" [config]=\"config.buttons\" />\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\" *ngIf=\"config.filterConfig\">\n <up-filter placeholder=\"Type to search\" id=\"filter-{{ id }}\" [config]=\"config.filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-snapshot-grid [config]=\"config.gridConfig\" [id]=\"gridId\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" />\n</div>\n", styles: ["up-filter{min-width:300px}\n"] }]
2486
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2487
+ type: Attribute,
2488
+ args: ['id']
2489
+ }] }, { type: i1$2.Router }], propDecorators: { header: [{
2490
+ type: Input,
2491
+ args: [{ required: true }]
2492
+ }], config: [{
2493
+ type: Input,
2494
+ args: [{ required: true }]
2495
+ }], onRowClick: [{
2496
+ type: Output
2497
+ }], onGridReady: [{
2498
+ type: Output
2499
+ }], onSearch: [{
2500
+ type: Output
2501
+ }] } });
2502
+
2503
+ class TabContentComponent {
2504
+ constructor(fragment, ch) {
2505
+ this.fragment = fragment;
2506
+ this.ch = ch;
2507
+ this.isActive = false;
2508
+ }
2509
+ toggleVisibility(s = true) {
2510
+ this.isActive = s;
2511
+ this.ch.markForCheck();
2512
+ }
2513
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabContentComponent, deps: [{ token: 'fragment', attribute: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
2514
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: TabContentComponent, selector: "up-tab-content", inputs: { header: "header" }, host: { properties: { "class.flex-grow-1": "this.isActive" }, classAttribute: "overflow-auto" }, ngImport: i0, template: "<div [hidden]=\"!isActive\" class=\"h-100\">\n <ng-content />\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2515
+ }
2516
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabContentComponent, decorators: [{
2517
+ type: Component,
2518
+ args: [{ selector: 'up-tab-content', changeDetection: ChangeDetectionStrategy.OnPush, host: {
2519
+ class: 'overflow-auto'
2520
+ }, template: "<div [hidden]=\"!isActive\" class=\"h-100\">\n <ng-content />\n</div>\n" }]
2521
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2522
+ type: Attribute,
2523
+ args: ['fragment']
2524
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { isActive: [{
2525
+ type: HostBinding,
2526
+ args: ['class.flex-grow-1']
2527
+ }], header: [{
2528
+ type: Input,
2529
+ args: [{ required: true }]
2530
+ }] } });
2531
+
2532
+ class TabGroupComponent {
2533
+ constructor(router, activeRoute) {
2534
+ this.router = router;
2535
+ this.activeRoute = activeRoute;
2536
+ this.onChange = new EventEmitter();
2537
+ this.tabs = [];
2538
+ }
2539
+ ngAfterContentInit() {
2540
+ this.content.forEach(({ header, fragment }) => this.tabs.push({ fragment, label: header }));
2541
+ this.changeTab(this.activeRoute.snapshot.fragment);
2542
+ }
2543
+ changeTab(f) {
2544
+ this.onChange.emit(f);
2545
+ this.router.navigate([], { relativeTo: this.activeRoute, fragment: f || undefined, replaceUrl: true });
2546
+ let found = false;
2547
+ this.content.forEach((tab) => {
2548
+ if (tab.fragment !== f)
2549
+ tab.toggleVisibility(false);
2550
+ else {
2551
+ found = true;
2552
+ this.activeFragment = f;
2553
+ tab.toggleVisibility(true);
2554
+ }
2555
+ });
2556
+ if (!found) {
2557
+ this.content.get(0).toggleVisibility(true);
2558
+ this.activeFragment = this.content.get(0).fragment;
2559
+ }
2560
+ }
2561
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabGroupComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
2562
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: TabGroupComponent, selector: "up-tab-group", outputs: { onChange: "onChange" }, host: { classAttribute: "d-flex flex-column" }, queries: [{ propertyName: "content", predicate: TabContentComponent, descendants: true }], ngImport: i0, template: "<ion-segment [scrollable]=\"true\" [value]=\"activeFragment\" class=\"d-flex pb-4 flex-shrink-0\">\n <ion-segment-button *ngFor=\"let t of tabs\" class=\"rounded\" [value]=\"t.fragment\" (click)=\"changeTab(t.fragment)\">\n {{ t.label }}\n </ion-segment-button>\n</ion-segment>\n\n<ng-content />\n", styles: ["ion-segment::-webkit-scrollbar{height:0}ion-segment-button{--color: #9E9E9E;--color-checked: #424242;--indicator-color: #ED6B26;border:none;height:34px;font-weight:400;min-width:100px;min-height:34px;width:fit-content;text-transform:none;letter-spacing:normal}ion-segment-button.segment-button-checked{font-weight:500}ion-segment-button::part(native){border-radius:4px}ion-segment-button::part(indicator-background){margin:auto;max-width:25%;border-radius:8px}\n"], dependencies: [{ kind: "component", type: i1.IonSegment, selector: "ion-segment", inputs: ["color", "disabled", "mode", "scrollable", "selectOnFocus", "swipeGesture", "value"] }, { kind: "component", type: i1.IonSegmentButton, selector: "ion-segment-button", inputs: ["disabled", "layout", "mode", "type", "value"] }, { kind: "directive", type: i1.SelectValueAccessor, selector: "ion-select, ion-radio-group, ion-segment, ion-datetime" }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2563
+ }
2564
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabGroupComponent, decorators: [{
2565
+ type: Component,
2566
+ args: [{ selector: 'up-tab-group', changeDetection: ChangeDetectionStrategy.OnPush, host: {
2567
+ class: 'd-flex flex-column'
2568
+ }, template: "<ion-segment [scrollable]=\"true\" [value]=\"activeFragment\" class=\"d-flex pb-4 flex-shrink-0\">\n <ion-segment-button *ngFor=\"let t of tabs\" class=\"rounded\" [value]=\"t.fragment\" (click)=\"changeTab(t.fragment)\">\n {{ t.label }}\n </ion-segment-button>\n</ion-segment>\n\n<ng-content />\n", styles: ["ion-segment::-webkit-scrollbar{height:0}ion-segment-button{--color: #9E9E9E;--color-checked: #424242;--indicator-color: #ED6B26;border:none;height:34px;font-weight:400;min-width:100px;min-height:34px;width:fit-content;text-transform:none;letter-spacing:normal}ion-segment-button.segment-button-checked{font-weight:500}ion-segment-button::part(native){border-radius:4px}ion-segment-button::part(indicator-background){margin:auto;max-width:25%;border-radius:8px}\n"] }]
2569
+ }], ctorParameters: () => [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }], propDecorators: { onChange: [{
2570
+ type: Output
2571
+ }], content: [{
2572
+ type: ContentChildren,
2573
+ args: [TabContentComponent, { descendants: true }]
2574
+ }] } });
2575
+
2576
+ class TabsComponentModule {
2577
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabsComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2578
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: TabsComponentModule, declarations: [TabGroupComponent,
2579
+ TabContentComponent], imports: [IonicModule,
2580
+ CommonModule], exports: [TabGroupComponent,
2581
+ TabContentComponent] }); }
2582
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabsComponentModule, imports: [IonicModule,
2583
+ CommonModule] }); }
2584
+ }
2585
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TabsComponentModule, decorators: [{
2586
+ type: NgModule,
2587
+ args: [{
2588
+ imports: [
2589
+ IonicModule,
2590
+ CommonModule,
2591
+ ],
2592
+ declarations: [
2593
+ TabGroupComponent,
2594
+ TabContentComponent
2595
+ ],
2596
+ exports: [
2597
+ TabGroupComponent,
2598
+ TabContentComponent
2599
+ ]
2600
+ }]
2601
+ }] });
2602
+
2603
+ class AuditService {
2417
2604
  constructor(apollo) {
2418
2605
  this.apollo = apollo;
2419
- this.baseAttr = `guid createdAt entity remark sourcePlatform status type`;
2606
+ this.baseAttr = `
2607
+ action
2608
+ createdAt
2609
+ description
2610
+ function
2611
+ guid
2612
+ msSource
2613
+ sourceIp
2614
+ user {
2615
+ name
2616
+ sourcePlatform
2617
+ status
2618
+ appLoginPrincipal {
2619
+ principalType
2620
+ principalId
2621
+ }
2420
2622
  }
2421
- query(input, extraAttr = '', fetchPolicy) {
2623
+ `;
2624
+ }
2625
+ query(input, extraAttr = '') {
2422
2626
  return this.apollo.query({
2423
- fetchPolicy,
2424
2627
  variables: { input },
2425
2628
  query: gql `
2426
- query QueryApproval($input: ApprovalCriteria) {
2427
- approvalMsApprovals(input: $input) {
2428
- data {
2429
- ${this.baseAttr}
2430
- ${extraAttr}
2431
- }
2432
- ${input.page === 0 ? 'totalRecord' : ''}
2629
+ query QueryAudit($input: AuditTrailCriteria!) {
2630
+ auditMsAuditTrail(input: $input) {
2631
+ ${this.baseAttr}
2632
+ ${extraAttr}
2433
2633
  }
2434
2634
  }
2435
2635
  `
2436
2636
  });
2437
2637
  }
2438
- request(variables) {
2439
- return this.apollo.mutate({
2440
- variables,
2441
- mutation: gql `
2442
- mutation ${variables.isApprove ? 'ApproveApproval' : 'DeclineApproval'}($approvalGroupGuid: String, $guid: String, $isApprove: Boolean, $reason: String) {
2443
- approvalMsApproveOrDeclineRequest(approvalGroupGuid: $approvalGroupGuid, guid: $guid, isApprove: $isApprove, reason: $reason)
2444
- }
2445
- `
2446
- });
2447
- }
2448
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
2449
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalService, providedIn: 'root' }); }
2638
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
2639
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditService, providedIn: 'root' }); }
2450
2640
  }
2451
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalService, decorators: [{
2641
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditService, decorators: [{
2452
2642
  type: Injectable,
2453
2643
  args: [{
2454
2644
  providedIn: 'root'
2455
2645
  }]
2456
2646
  }], ctorParameters: () => [{ type: i1$1.Apollo }] });
2457
2647
 
2458
- class ApprovalListComponent {
2459
- constructor(entities, router, route, service, alertCtrl) {
2460
- this.entities = entities;
2648
+ class AuditListComponent {
2649
+ constructor(id, url, router, service) {
2650
+ this.id = id;
2651
+ this.url = url;
2461
2652
  this.router = router;
2462
- this.route = route;
2463
2653
  this.service = service;
2464
- this.alertCtrl = alertCtrl;
2654
+ this.filterConfig = { mode: 'simple', fields: [{ key: 'description', label: '', type: 'text' }] };
2465
2655
  this.gridConfig = {
2466
- noRowText: 'Approval not found',
2656
+ useTotalRecord: false,
2657
+ noRowText: 'Audit not found',
2467
2658
  colDefs: [
2468
- { headerName: 'Entity', field: 'entity', checkboxSelection: true },
2469
- { headerName: 'Remark', field: 'remark' },
2470
- { headerName: 'Source Platform', field: 'sourcePlatform' },
2471
- { headerName: 'Status', field: 'status', maxWidth: 100, cellRenderer: ({ value }) => value ? `<div class="badge m-auto bg-${value === ApprovalStatusEnum.Pending ? 'warning' : value === ApprovalStatusEnum.Approved ? 'success' : 'danger'}">${value}</div>` : '' },
2472
- { headerName: 'Type', field: 'type', maxWidth: 100 },
2659
+ { headerName: 'User', field: 'user.name', sortable: false },
2660
+ { headerName: 'Description', field: 'description', minWidth: 350, sortable: false },
2473
2661
  { headerName: 'Created Date', field: 'createdAt', sort: 'desc', valueFormatter: ({ value }) => value ? formatDate(value, 'dd MMM yyyy HH:mm', 'en-US') : '' }
2474
2662
  ],
2475
2663
  getData: (page, pageSize, sortBy, dir) => {
2476
- const policy = this.input.page === page ? 'no-cache' : undefined;
2477
- this.input.page = page;
2478
- this.input.sortBy = sortBy;
2479
- this.input.pageSize = pageSize;
2480
- this.input.sortDirection = dir;
2481
- return this.service.query(this.input, '', policy).pipe(map(({ data: { approvalMsApprovals: { data, totalRecord: t } } }) => ({ data, totalRecord: t })));
2482
- }
2483
- };
2484
- this.filterConfig = {
2485
- mode: 'advanced',
2486
- fields: [
2487
- { key: 'status', label: 'Status', type: 'select', options: [
2488
- { label: 'Approved', value: ['APPROVED'] },
2489
- { label: 'Declined', value: ['DECLINED'] },
2490
- { label: 'Pending', value: ['PENDING'] }
2491
- ] },
2492
- { key: 'type', label: 'Type', type: 'select', options: [
2493
- { label: 'Creation', value: ['CREATION'] },
2494
- { label: 'Deletion', value: ['DELETION'] },
2495
- { label: 'Linkage', value: ['LINKAGE'] },
2496
- { label: 'Unlink', value: ['UNLINK'] },
2497
- { label: 'Update', value: ['UPDATE'] }
2498
- ] }
2499
- ]
2664
+ if (!this.criteria.tagValues)
2665
+ return of({ data: [] });
2666
+ this.criteria.page = page;
2667
+ this.criteria.sortBy = sortBy;
2668
+ this.criteria.pageSize = pageSize;
2669
+ this.criteria.sortDirection = dir;
2670
+ return this.service.query(this.criteria).pipe(map(({ data: { auditMsAuditTrail: data } }) => ({ data })));
2671
+ },
2500
2672
  };
2501
- this.btnConfig = [
2502
- { label: 'Approve', icon: 'checkmark', description: 'Approve the approvals', disabled: true, onClick: this.multipleApproval.bind(this) },
2503
- { label: 'Decline', icon: 'close', description: 'Decline the approvals', color: 'danger', disabled: true, onClick: this.multipleApproval.bind(this) }
2504
- ];
2505
- this.input = { page: 0, pageSize: 50, entity: this.entities };
2673
+ this.criteria = { sortBy: 'createdAt', sortDirection: 'desc', page: 0, pageSize: 50 };
2506
2674
  }
2507
- setGridApi({ api }) { this.gridApi = api; }
2508
- openDetail({ guid }) { this.router.navigate([`/approval/${guid}`], { preserveFragment: true }); }
2509
- selectApprovals() { this.btnConfig[0].disabled = this.btnConfig[1].disabled = this.gridApi.getSelectedRows().length <= 1; }
2510
- search({ data }) {
2511
- this.input.type = data?.type;
2512
- this.input.status = data?.status;
2513
- this.gridApi.getSelectedNodes().forEach((e) => e.setSelected(false));
2514
- this.gridApi.refreshInfiniteCache();
2675
+ ngOnChanges(e) {
2676
+ if (e['tagKeys'])
2677
+ this.criteria.tagKeys = this.tagKeys;
2678
+ if (e['relatedEntities'])
2679
+ this.criteria.relatedEntities = this.relatedEntities;
2515
2680
  }
2516
- multipleApproval(btn) {
2517
- btn.toggleLoading();
2518
- this.router.navigate([`/approval/approval-group`], {
2519
- preserveFragment: true,
2520
- queryParams: {
2521
- isApprove: btn.color !== 'danger',
2522
- guids: this.gridApi.getSelectedRows().map(({ guid }) => guid),
2523
- }
2524
- });
2681
+ setGridApi({ api }) { this.gridApi = api; }
2682
+ rowClicked({ guid }) {
2683
+ this.router.navigate([`${this.url}/${this.criteria.tagValues[0]}/audit/${guid}`], { preserveFragment: true });
2525
2684
  }
2526
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalListComponent, deps: [{ token: 'ENTITIES' }, { token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: ApprovalService }, { token: i1.AlertController }], target: i0.ɵɵFactoryTarget.Component }); }
2527
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ApprovalListComponent, isStandalone: true, selector: "up-approval-list", host: { classAttribute: "d-flex flex-column h-100 w-100" }, ngImport: i0, template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">Approval</h3>\n\n <up-btn-group id=\"approval-list\" [config]=\"btnConfig\" />\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\">\n <up-filter placeholder=\"Type to search\" id=\"filter-approval-list\" [config]=\"filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-pagination-grid [config]=\"gridConfig\" id=\"grid-approval-list\" rowSelection=\"multiple\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" (onSelectionChanged)=\"selectApprovals()\" />\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: FilterComponent, selector: "up-filter", inputs: ["id", "config"], outputs: ["onSearch"] }, { kind: "component", type: ButtonGroupComponent, selector: "up-btn-group", inputs: ["config"] }, { kind: "component", type: GridPaginationComponent, selector: "up-pagination-grid", inputs: ["config", "rowData", "id", "rowModelType", "rowSelection"], outputs: ["onRowClick", "onGridReady", "onSelectionChanged"] }] }); }
2685
+ search({ data }) {
2686
+ this.criteria.description = data?.description;
2687
+ this.gridComponent.reset();
2688
+ }
2689
+ setGuid(guid) {
2690
+ this.criteria.description = null;
2691
+ this.criteria.tagValues = [guid];
2692
+ this.gridComponent.reset();
2693
+ }
2694
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditListComponent, deps: [{ token: 'id', attribute: true }, { token: 'mainUrl', attribute: true }, { token: i1$2.Router }, { token: AuditService }], target: i0.ɵɵFactoryTarget.Component }); }
2695
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: AuditListComponent, isStandalone: true, selector: "up-audit-list", inputs: { relatedEntities: "relatedEntities", tagKeys: "tagKeys" }, host: { classAttribute: "d-flex flex-column h-100" }, viewQueries: [{ propertyName: "gridComponent", first: true, predicate: GridPaginationComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"d-flex justify-content-end px-4 pb-4 flex-shrink-0\">\n <up-filter class=\"w-100\" id=\"audit-filter\" placeholder=\"Type to search\" [config]=\"filterConfig\" (onSearch)=\"search($event);\" />\n</div>\n \n<up-pagination-grid id=\"grid-audit\" class=\"flex-grow-1\" [config]=\"gridConfig\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"rowClicked($event)\" />\n", styles: [""], dependencies: [{ kind: "component", type: FilterComponent, selector: "up-filter", inputs: ["id", "config"], outputs: ["onSearch"] }, { kind: "component", type: GridPaginationComponent, selector: "up-pagination-grid", inputs: ["config", "rowData", "id", "rowModelType", "rowSelection"], outputs: ["onRowClick", "onGridReady", "onSelectionChanged"] }] }); }
2528
2696
  }
2529
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalListComponent, decorators: [{
2697
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditListComponent, decorators: [{
2530
2698
  type: Component,
2531
- args: [{ standalone: true, selector: 'up-approval-list', host: {
2532
- class: 'd-flex flex-column h-100 w-100'
2699
+ args: [{ standalone: true, selector: 'up-audit-list', host: {
2700
+ class: 'd-flex flex-column h-100'
2533
2701
  }, imports: [
2534
2702
  FilterComponent,
2535
- ButtonGroupComponent,
2536
2703
  GridPaginationComponent
2537
- ], template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">Approval</h3>\n\n <up-btn-group id=\"approval-list\" [config]=\"btnConfig\" />\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\">\n <up-filter placeholder=\"Type to search\" id=\"filter-approval-list\" [config]=\"filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-pagination-grid [config]=\"gridConfig\" id=\"grid-approval-list\" rowSelection=\"multiple\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" (onSelectionChanged)=\"selectApprovals()\" />\n</div>\n" }]
2704
+ ], template: "<div class=\"d-flex justify-content-end px-4 pb-4 flex-shrink-0\">\n <up-filter class=\"w-100\" id=\"audit-filter\" placeholder=\"Type to search\" [config]=\"filterConfig\" (onSearch)=\"search($event);\" />\n</div>\n \n<up-pagination-grid id=\"grid-audit\" class=\"flex-grow-1\" [config]=\"gridConfig\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"rowClicked($event)\" />\n" }]
2538
2705
  }], ctorParameters: () => [{ type: undefined, decorators: [{
2539
- type: Inject,
2540
- args: ['ENTITIES']
2541
- }] }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: ApprovalService }, { type: i1.AlertController }] });
2706
+ type: Attribute,
2707
+ args: ['id']
2708
+ }] }, { type: undefined, decorators: [{
2709
+ type: Attribute,
2710
+ args: ['mainUrl']
2711
+ }] }, { type: i1$2.Router }, { type: AuditService }], propDecorators: { relatedEntities: [{
2712
+ type: Input,
2713
+ args: [{ required: true }]
2714
+ }], tagKeys: [{
2715
+ type: Input
2716
+ }], gridComponent: [{
2717
+ type: ViewChild,
2718
+ args: [GridPaginationComponent]
2719
+ }] } });
2542
2720
 
2543
- class ApprovalFormComponent {
2544
- constructor(router, ch, service, gridService, alertCtrl, permService) {
2545
- this.router = router;
2546
- this.ch = ch;
2721
+ class AuditDetailComponent {
2722
+ constructor(fb, service, route, navCtrl) {
2723
+ this.fb = fb;
2547
2724
  this.service = service;
2548
- this.gridService = gridService;
2549
- this.alertCtrl = alertCtrl;
2550
- this.permService = permService;
2725
+ this.route = route;
2726
+ this.navCtrl = navCtrl;
2727
+ this.gridConfig = {
2728
+ useTotalRecord: false,
2729
+ colDefs: [
2730
+ { headerName: 'Attribute Name', field: 'attribute', sort: 'asc' },
2731
+ { headerName: 'Old Value', field: 'oldData' },
2732
+ { headerName: 'New Value', field: 'newData' }
2733
+ ]
2734
+ };
2735
+ this.form = this.fb.group({
2736
+ guid: new FormControl({ value: null, disabled: true }),
2737
+ action: new FormControl({ value: null, disabled: true }),
2738
+ description: new FormControl({ value: null, disabled: true }),
2739
+ userName: new FormControl({ value: null, disabled: true }),
2740
+ sourceIp: new FormControl({ value: null, disabled: true }),
2741
+ createdAt: new FormControl({ value: null, disabled: true }),
2742
+ msSource: new FormControl({ value: null, disabled: true }),
2743
+ sourcePlatform: new FormControl({ value: null, disabled: true }),
2744
+ function: new FormControl({ value: null, disabled: true }),
2745
+ });
2551
2746
  this.isLoading = true;
2552
- this.btnConfig = [];
2553
- this.data = [];
2747
+ this.guid = '';
2554
2748
  }
2555
2749
  ngOnDestroy() { this.sub?.unsubscribe(); }
2556
- setGuid(guids, isApprove) {
2557
- if (guids.length === 1)
2558
- this.guid = guids[0];
2559
- this.btnConfig.length = 0;
2560
- this.setLoading(true);
2561
- this.sub = this.service.query({ guids, status: [ApprovalStatusEnum.Approved, ApprovalStatusEnum.Declined, ApprovalStatusEnum.Pending] }, 'permission reason').subscribe({
2562
- next: ({ data: { approvalMsApprovals: { data } } }) => {
2563
- if (!data || data.length === 0) {
2564
- this.router.navigateByUrl('approval');
2565
- return;
2566
- }
2567
- this.data = data;
2568
- if (data.length > 1) {
2569
- let dataCount = 0;
2570
- data.map(({ permission, status }) => {
2571
- if (status === ApprovalStatusEnum.Pending) {
2572
- const perm = permission.split('.');
2573
- if (this.permService.checkPermission(perm[0], perm[1], perm[2]))
2574
- dataCount++;
2575
- if (dataCount === data.length)
2576
- isApprove ? this.btnConfig.push({ label: 'Approve', icon: 'checkmark', description: 'Approve the approval(s)', disabled: false, onClick: this.request.bind(this) }) : this.btnConfig.push({ label: 'Decline', icon: 'close', description: 'Decline the approval', color: 'danger', disabled: false, onClick: this.request.bind(this) });
2577
- }
2578
- });
2579
- }
2580
- else {
2581
- const { status, permission } = data[0];
2582
- if (status === ApprovalStatusEnum.Pending) {
2583
- const perm = permission.split('.');
2584
- if (this.permService.checkPermission(perm[0], perm[1], perm[2])) {
2585
- this.btnConfig.push({ label: 'Approve', icon: 'checkmark', description: 'Approve the approval', disabled: false, onClick: this.request.bind(this) }, { label: 'Decline', icon: 'close', description: 'Decline the approval', color: 'danger', disabled: false, onClick: this.request.bind(this) });
2586
- }
2587
- }
2588
- }
2589
- this.setLoading(false);
2590
- },
2591
- error: ({ message }) => {
2592
- this.showAlert('Error', message);
2593
- this.router.navigateByUrl('approval');
2594
- }
2595
- });
2596
- }
2597
- request(btn) {
2598
- const isApprove = btn.color !== 'danger';
2599
- this.showAlert('Confirm', `Are you sure want to ${isApprove ? 'approve the approval?' : 'decline the approval? Please input the reason if you want to decline.'}`, [
2600
- { text: 'Cancel', handler: () => btn.toggleLoading() },
2601
- {
2602
- text: `${isApprove ? 'Approve' : 'Decline'}`,
2603
- handler: ({ reason }) => {
2604
- this.sub?.unsubscribe();
2605
- const variables = {
2606
- ...(this.guid ? { guid: this.guid } : { approvalGroupGuid: '' }),
2607
- isApprove,
2608
- reason
2609
- };
2610
- this.sub = this.service.request(variables).subscribe({
2611
- next: () => {
2612
- this.showAlert('Success', `Approval ${isApprove ? 'approved' : 'declined'}`);
2613
- this.router.navigateByUrl('approval');
2614
- this.gridService.refreshGridCache('grid-approval-list');
2615
- },
2616
- error: ({ message }) => {
2617
- btn.toggleLoading();
2618
- this.showAlert('Error', message);
2619
- }
2620
- });
2621
- }
2622
- }
2623
- ], [{ name: 'reason', type: 'textarea', placeholder: 'Reason' }]);
2624
- }
2625
- setLoading(b) {
2626
- this.isLoading = b;
2627
- this.ch.markForCheck();
2750
+ setGridApi({ api }) {
2751
+ this.gridApi = api;
2752
+ this.getData();
2628
2753
  }
2629
- async showAlert(header, message, buttons = ['OK'], inputs = []) { (await this.alertCtrl.create({ header, message, buttons, inputs })).present(); }
2630
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalFormComponent, deps: [{ token: i1$2.Router }, { token: i0.ChangeDetectorRef }, { token: ApprovalService }, { token: GridService }, { token: i1.AlertController }, { token: PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
2631
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ApprovalFormComponent, isStandalone: true, selector: "up-approval-form", inputs: { isLoading: "isLoading" }, host: { classAttribute: "px-4 d-block" }, ngImport: i0, template: "<ng-container *ngIf=\"!isLoading; else loading\">\n <div *ngFor=\"let d of data, let i = index\">\n <div class=\"d-flex align-items-center gap-2 pb-3 pt-2\" *ngIf=\"data.length > 1\">\n <ion-icon name=\"document\" />\n <h5 class=\"m-0\">Approval {{ i + 1 }}</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Entity\" [disabled]=\"true\" [value]=\"d.entity\" />\n <up-input class=\"mb-4\" label=\"Remark\" [disabled]=\"true\" [value]=\"d.remark\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Created At\" [disabled]=\"true\" [value]=\"d.createdAt | date:'dd MMM yyyy HH:mm'\" />\n <up-input class=\"mb-4\" label=\"Status\" [disabled]=\"true\" [value]=\"d.status\" />\n </div>\n </div>\n\n <up-textarea class=\"mb-4\" label=\"Reason\" [disabled]=\"true\" [value]=\"d.reason\" *ngIf=\"d.status !== 'PENDING'\" />\n </div>\n</ng-container>\n\n<ng-template #loading>\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n </div>\n </div>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonSkeletonText, selector: "ion-skeleton-text", inputs: ["animated"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "component", type: FormInputComponent, selector: "up-input", inputs: ["label", "value", "required", "disabled"], outputs: ["onInput"] }, { kind: "component", type: FormTextareaComponent, selector: "up-textarea", inputs: ["value", "required", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2632
- }
2633
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalFormComponent, decorators: [{
2634
- type: Component,
2635
- args: [{ standalone: true, selector: 'up-approval-form', changeDetection: ChangeDetectionStrategy.OnPush, host: {
2636
- class: 'px-4 d-block'
2637
- }, imports: [
2638
- IonicModule,
2639
- CommonModule,
2640
- FormInputComponent,
2641
- FormTextareaComponent
2642
- ], template: "<ng-container *ngIf=\"!isLoading; else loading\">\n <div *ngFor=\"let d of data, let i = index\">\n <div class=\"d-flex align-items-center gap-2 pb-3 pt-2\" *ngIf=\"data.length > 1\">\n <ion-icon name=\"document\" />\n <h5 class=\"m-0\">Approval {{ i + 1 }}</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Entity\" [disabled]=\"true\" [value]=\"d.entity\" />\n <up-input class=\"mb-4\" label=\"Remark\" [disabled]=\"true\" [value]=\"d.remark\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Created At\" [disabled]=\"true\" [value]=\"d.createdAt | date:'dd MMM yyyy HH:mm'\" />\n <up-input class=\"mb-4\" label=\"Status\" [disabled]=\"true\" [value]=\"d.status\" />\n </div>\n </div>\n\n <up-textarea class=\"mb-4\" label=\"Reason\" [disabled]=\"true\" [value]=\"d.reason\" *ngIf=\"d.status !== 'PENDING'\" />\n </div>\n</ng-container>\n\n<ng-template #loading>\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n </div>\n </div>\n</ng-template>\n" }]
2643
- }], ctorParameters: () => [{ type: i1$2.Router }, { type: i0.ChangeDetectorRef }, { type: ApprovalService }, { type: GridService }, { type: i1.AlertController }, { type: PermissionService }], propDecorators: { isLoading: [{
2644
- type: Input
2645
- }] } });
2646
-
2647
- class ApprovalDetailComponent {
2648
- constructor(router, activatedRoute) {
2649
- this.router = router;
2650
- this.activatedRoute = activatedRoute;
2651
- this.btnConfig = [];
2652
- this.guid = '';
2754
+ isIsoDateString(str) {
2755
+ const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?Z$/;
2756
+ return regex.test(str);
2653
2757
  }
2654
- ngOnInit() {
2655
- this.sub = this.activatedRoute.queryParams.subscribe((params) => {
2656
- if (params) {
2657
- this.guids = params['guids'];
2658
- this.isApprove = params['isApprove'] === 'true';
2659
- }
2660
- });
2758
+ formatData(value) {
2759
+ if (value === null)
2760
+ return value;
2761
+ if (typeof value === 'object')
2762
+ return JSON.stringify(value);
2763
+ if (this.isIsoDateString(value))
2764
+ return formatDate(value, 'dd MMM yyyy HH:mm', 'en-US');
2765
+ return value;
2661
2766
  }
2662
- ngAfterViewInit() {
2663
- if (this.guids) {
2664
- this.setChildGuid('');
2665
- this.changeTab(this.activatedRoute.snapshot.fragment);
2666
- }
2667
- else {
2668
- this.setChildGuid(this.activatedRoute.children[0].snapshot.params['guid']);
2669
- this.changeTab(this.activatedRoute.snapshot.fragment);
2670
- this.sub = this.router.events.pipe(filter((e) => e instanceof NavigationEnd)).subscribe({
2671
- next: () => {
2672
- const newGuid = this.activatedRoute.children[0].snapshot.params['guid'];
2673
- if (this.guid !== newGuid) {
2674
- this.guid = newGuid;
2675
- this.setChildGuid(this.guid);
2676
- }
2767
+ getData() {
2768
+ const newGuid = this.route.children[0].snapshot.params['audit'];
2769
+ if (!newGuid || this.guid === newGuid)
2770
+ return;
2771
+ this.sub?.unsubscribe();
2772
+ this.gridApi?.showLoadingOverlay();
2773
+ this.guid = newGuid;
2774
+ this.isLoading = true;
2775
+ this.sub = this.service.query({ guid: this.guid }, 'data tags { tagKey tagValue }').subscribe({
2776
+ next: ({ data: { auditMsAuditTrail: data } }) => {
2777
+ this.gridApi?.hideOverlay();
2778
+ if (data.length !== 1) {
2779
+ this.navCtrl.back();
2780
+ return;
2677
2781
  }
2678
- });
2679
- }
2782
+ const { guid, action, description, function: func, msSource, sourceIp, createdAt } = data[0];
2783
+ this.form.patchValue({
2784
+ guid,
2785
+ function: func,
2786
+ msSource, sourceIp,
2787
+ action, description,
2788
+ userName: data[0].user?.name,
2789
+ sourcePlatform: data[0].user?.sourcePlatform,
2790
+ createdAt: formatDate(createdAt, 'dd MMM yyyy HH:mm', 'en-US'),
2791
+ });
2792
+ this.isLoading = false;
2793
+ this.getChangedData(data[0].data);
2794
+ },
2795
+ error: () => this.navCtrl.back()
2796
+ });
2680
2797
  }
2681
- ngOnDestroy() { this.sub.unsubscribe(); }
2682
- changeTab(f) {
2683
- switch (f) {
2684
- default:
2685
- this.btnConfig = this.formComponent?.btnConfig ?? [];
2798
+ getChangedData({ oldData, newData }) {
2799
+ if (!newData || Array.isArray(JSON.parse(newData))) {
2800
+ this.gridApi.setGridOption('rowData', []);
2801
+ return;
2686
2802
  }
2803
+ const objNewData = JSON.parse(newData);
2804
+ const changedData = Object.entries(oldData ? JSON.parse(oldData) : JSON.parse(newData))
2805
+ .filter(([key, oldVal]) => JSON.stringify(oldData ? oldVal : null) !== JSON.stringify(objNewData[key]) && !key.match(/update|created/))
2806
+ .map(([key, oldVal]) => ({
2807
+ attribute: key,
2808
+ oldData: oldData ? this.formatData(oldVal) : null,
2809
+ newData: this.formatData(objNewData[key])
2810
+ }));
2811
+ this.gridApi.setGridOption('rowData', changedData);
2687
2812
  }
2688
- setChildGuid(guid) {
2689
- this.formComponent?.setGuid(this.guids ?? [guid], this.isApprove);
2690
- }
2691
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalDetailComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
2692
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ApprovalDetailComponent, isStandalone: true, selector: "up-approval-detail", host: { classAttribute: "d-block h-100" }, viewQueries: [{ propertyName: "formComponent", first: true, predicate: ApprovalFormComponent, descendants: true }], ngImport: i0, template: "<up-column-header-container header=\"Approval Detail\" prevUrl=\"/approval\" class=\"bg-white\">\n <up-btn-group id=\"button\" *ngIf=\"!formComponent?.isLoading; else loading\" [config]=\"btnConfig\" />\n\n <ng-template #loading>\n <ion-skeleton-text id=\"button\" class=\"m-0 sk-btn\" />\n </ng-template>\n\n <up-tab-group class=\"h-100\" (onChange)=\"changeTab($event)\">\n <up-tab-content header=\"Detail\" fragment=\"detail\">\n <up-approval-form />\n </up-tab-content>\n </up-tab-group>\n</up-column-header-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonSkeletonText, selector: "ion-skeleton-text", inputs: ["animated"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TabsComponentModule }, { kind: "component", type: TabGroupComponent, selector: "up-tab-group", outputs: ["onChange"] }, { kind: "component", type: TabContentComponent, selector: "up-tab-content", inputs: ["header"] }, { kind: "component", type: ButtonGroupComponent, selector: "up-btn-group", inputs: ["config"] }, { kind: "component", type: ColumnHeaderContainerComponent, selector: "up-column-header-container", inputs: ["header", "prevUrl"] }, { kind: "component", type: ApprovalFormComponent, selector: "up-approval-form", inputs: ["isLoading"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2813
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditDetailComponent, deps: [{ token: i3$1.FormBuilder }, { token: AuditService }, { token: i1$2.ActivatedRoute }, { token: i1.NavController }], target: i0.ɵɵFactoryTarget.Component }); }
2814
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: AuditDetailComponent, isStandalone: true, selector: "up-audit-detail", ngImport: i0, template: "<up-tab-group class=\"h-100\">\n <up-tab-content header=\"Detail\" fragment=\"detail\">\n <form [formGroup]=\"form\" class=\"px-4 pb-4\" *ngIf=\"!isLoading; else loading\">\n <div class=\"d-flex align-items-center gap-2 pb-3\">\n <ion-icon name=\"information-circle\" />\n <h5 class=\"m-0\">Information</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-lg-4\" label=\"Action\" formControlName=\"action\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Source IP\" formControlName=\"sourceIp\" />\n </div>\n </div>\n \n <up-input class=\"mb-4\" label=\"User Name\" formControlName=\"userName\" />\n <up-textarea class=\"mb-4\" label=\"Description\" formControlName=\"description\" />\n\n <div class=\"d-flex align-items-center gap-2 pb-3 pt-2\">\n <ion-icon name=\"laptop\" />\n <h5 class=\"m-0\">System Information</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Action Date\" formControlName=\"createdAt\" />\n <up-input class=\"mb-lg-4\" label=\"Source Platform\" formControlName=\"sourcePlatform\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"MS Source\" formControlName=\"msSource\" />\n <up-input class=\"mb-4\" label=\"Function\" formControlName=\"function\" />\n </div>\n </div>\n </form>\n\n <ng-template #loading>\n <ion-skeleton-text class=\"sk-input mx-4 mb-4\" *ngFor=\"let i of [0,1,2,3,4,5,6]\" />\n </ng-template> \n </up-tab-content>\n\n <up-tab-content header=\"Attributes\" fragment=\"attributes\">\n <up-pagination-grid id=\"grid-audit-detail\" rowModelType=\"clientSide\" [config]=\"gridConfig\" (onGridReady)=\"setGridApi($event)\" />\n </up-tab-content>\n</up-tab-group>\n", styles: ["ion-icon{font-size:24px;margin-right:5px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonSkeletonText, selector: "ion-skeleton-text", inputs: ["animated"] }, { kind: "component", type: GridPaginationComponent, selector: "up-pagination-grid", inputs: ["config", "rowData", "id", "rowModelType", "rowSelection"], outputs: ["onRowClick", "onGridReady", "onSelectionChanged"] }, { kind: "ngmodule", type: TabsComponentModule }, { kind: "component", type: TabGroupComponent, selector: "up-tab-group", outputs: ["onChange"] }, { kind: "component", type: TabContentComponent, selector: "up-tab-content", inputs: ["header"] }, { kind: "component", type: FormInputComponent, selector: "up-input", inputs: ["label", "value", "required", "disabled"], outputs: ["onInput"] }, { kind: "component", type: FormTextareaComponent, selector: "up-textarea", inputs: ["value", "required", "disabled"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
2693
2815
  }
2694
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalDetailComponent, decorators: [{
2816
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuditDetailComponent, decorators: [{
2695
2817
  type: Component,
2696
- args: [{ standalone: true, selector: 'up-approval-detail', changeDetection: ChangeDetectionStrategy.OnPush, host: {
2697
- class: 'd-block h-100'
2698
- }, imports: [
2699
- IonicModule,
2818
+ args: [{ standalone: true, selector: 'up-audit-detail', imports: [
2700
2819
  CommonModule,
2820
+ IonicModule,
2821
+ GridPaginationComponent,
2701
2822
  TabsComponentModule,
2702
- ButtonGroupComponent,
2703
- ColumnHeaderContainerComponent,
2704
- ApprovalFormComponent
2705
- ], template: "<up-column-header-container header=\"Approval Detail\" prevUrl=\"/approval\" class=\"bg-white\">\n <up-btn-group id=\"button\" *ngIf=\"!formComponent?.isLoading; else loading\" [config]=\"btnConfig\" />\n\n <ng-template #loading>\n <ion-skeleton-text id=\"button\" class=\"m-0 sk-btn\" />\n </ng-template>\n\n <up-tab-group class=\"h-100\" (onChange)=\"changeTab($event)\">\n <up-tab-content header=\"Detail\" fragment=\"detail\">\n <up-approval-form />\n </up-tab-content>\n </up-tab-group>\n</up-column-header-container>\n" }]
2706
- }], ctorParameters: () => [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }], propDecorators: { formComponent: [{
2707
- type: ViewChild,
2708
- args: [ApprovalFormComponent]
2709
- }] } });
2823
+ FormInputComponent,
2824
+ FormTextareaComponent,
2825
+ ReactiveFormsModule
2826
+ ], template: "<up-tab-group class=\"h-100\">\n <up-tab-content header=\"Detail\" fragment=\"detail\">\n <form [formGroup]=\"form\" class=\"px-4 pb-4\" *ngIf=\"!isLoading; else loading\">\n <div class=\"d-flex align-items-center gap-2 pb-3\">\n <ion-icon name=\"information-circle\" />\n <h5 class=\"m-0\">Information</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-lg-4\" label=\"Action\" formControlName=\"action\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Source IP\" formControlName=\"sourceIp\" />\n </div>\n </div>\n \n <up-input class=\"mb-4\" label=\"User Name\" formControlName=\"userName\" />\n <up-textarea class=\"mb-4\" label=\"Description\" formControlName=\"description\" />\n\n <div class=\"d-flex align-items-center gap-2 pb-3 pt-2\">\n <ion-icon name=\"laptop\" />\n <h5 class=\"m-0\">System Information</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Action Date\" formControlName=\"createdAt\" />\n <up-input class=\"mb-lg-4\" label=\"Source Platform\" formControlName=\"sourcePlatform\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"MS Source\" formControlName=\"msSource\" />\n <up-input class=\"mb-4\" label=\"Function\" formControlName=\"function\" />\n </div>\n </div>\n </form>\n\n <ng-template #loading>\n <ion-skeleton-text class=\"sk-input mx-4 mb-4\" *ngFor=\"let i of [0,1,2,3,4,5,6]\" />\n </ng-template> \n </up-tab-content>\n\n <up-tab-content header=\"Attributes\" fragment=\"attributes\">\n <up-pagination-grid id=\"grid-audit-detail\" rowModelType=\"clientSide\" [config]=\"gridConfig\" (onGridReady)=\"setGridApi($event)\" />\n </up-tab-content>\n</up-tab-group>\n", styles: ["ion-icon{font-size:24px;margin-right:5px}\n"] }]
2827
+ }], ctorParameters: () => [{ type: i3$1.FormBuilder }, { type: AuditService }, { type: i1$2.ActivatedRoute }, { type: i1.NavController }] });
2710
2828
 
2711
- class ProfileService {
2829
+ class ApprovalService {
2712
2830
  constructor(apollo) {
2713
2831
  this.apollo = apollo;
2832
+ this.baseAttr = `guid createdAt entity remark sourcePlatform status type`;
2714
2833
  }
2715
- getMyProfile(fetchPolicy) {
2834
+ query(input, extraAttr = '', fetchPolicy) {
2716
2835
  return this.apollo.query({
2717
2836
  fetchPolicy,
2718
- errorPolicy: 'all',
2837
+ variables: { input },
2719
2838
  query: gql `
2720
- query getMyProfile {
2721
- authMsMyProfile {
2722
- appLoginPrincipal {
2723
- principalId
2724
- principalType
2725
- }
2726
- appLoginExt {
2727
- paramCode
2728
- paramType
2729
- file {
2730
- publicUrl
2731
- }
2732
- }
2733
- birthday
2734
- category
2735
- company {
2736
- code
2737
- guid
2738
- isInternal
2739
- name
2740
- status
2741
- }
2742
- gender
2743
- guid
2744
- merchants {
2745
- guid
2746
- name
2747
- status
2839
+ query QueryApproval($input: ApprovalCriteria) {
2840
+ approvalMsApprovals(input: $input) {
2841
+ data {
2842
+ ${this.baseAttr}
2843
+ ${extraAttr}
2748
2844
  }
2749
- name
2750
- status
2845
+ ${input.page === 0 ? 'totalRecord' : ''}
2751
2846
  }
2752
2847
  }
2753
- `,
2754
- }).pipe(map(({ data: { authMsMyProfile } }) => {
2755
- if (!authMsMyProfile)
2756
- return null;
2757
- return authMsMyProfile;
2758
- }));
2848
+ `
2849
+ });
2759
2850
  }
2760
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProfileService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
2761
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProfileService, providedIn: 'root' }); }
2851
+ request(variables) {
2852
+ return this.apollo.mutate({
2853
+ variables,
2854
+ mutation: gql `
2855
+ mutation ${variables.isApprove ? 'ApproveApproval' : 'DeclineApproval'}($approvalGroupGuid: String, $guid: String, $isApprove: Boolean, $reason: String) {
2856
+ approvalMsApproveOrDeclineRequest(approvalGroupGuid: $approvalGroupGuid, guid: $guid, isApprove: $isApprove, reason: $reason)
2857
+ }
2858
+ `
2859
+ });
2860
+ }
2861
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
2862
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalService, providedIn: 'root' }); }
2762
2863
  }
2763
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProfileService, decorators: [{
2864
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalService, decorators: [{
2764
2865
  type: Injectable,
2765
2866
  args: [{
2766
2867
  providedIn: 'root'
2767
2868
  }]
2768
2869
  }], ctorParameters: () => [{ type: i1$1.Apollo }] });
2769
2870
 
2770
- class AuthService {
2771
- static { this.authToken = ''; }
2772
- static { this.refreshToken = ''; }
2773
- constructor(apollo, profileService) {
2774
- this.apollo = apollo;
2775
- this.profileService = profileService;
2776
- }
2777
- login(input) {
2778
- return this.apollo.mutate({
2779
- variables: { input },
2780
- mutation: gql `
2781
- mutation Login($input: LoginRq!) {
2782
- authMsLogin(input: $input) {
2783
- accessToken
2784
- refreshToken
2785
- suggestedAction
2786
- user {
2787
- birthday
2788
- category
2789
- email
2790
- gender
2791
- guid
2792
- mobileNumber
2793
- name
2794
- status
2795
- }
2796
- }
2797
- }
2798
- `
2799
- }).pipe(tap(({ data }) => {
2800
- if (data?.authMsLogin) {
2801
- const { accessToken, user, refreshToken } = data.authMsLogin;
2802
- this.user = user;
2803
- this.user.photo = '/assets/imgs/profile.svg';
2804
- AuthService.authToken = accessToken ?? '';
2805
- AuthService.refreshToken = refreshToken ?? '';
2806
- localStorage.setItem('userGuid', this.user.guid);
2807
- localStorage.setItem('authToken', AuthService.authToken);
2808
- localStorage.setItem('refreshToken', AuthService.refreshToken);
2871
+ class ApprovalListComponent {
2872
+ constructor(entities, router, route, service, alertCtrl) {
2873
+ this.entities = entities;
2874
+ this.router = router;
2875
+ this.route = route;
2876
+ this.service = service;
2877
+ this.alertCtrl = alertCtrl;
2878
+ this.gridConfig = {
2879
+ noRowText: 'Approval not found',
2880
+ colDefs: [
2881
+ { headerName: 'Entity', field: 'entity', checkboxSelection: true },
2882
+ { headerName: 'Remark', field: 'remark' },
2883
+ { headerName: 'Source Platform', field: 'sourcePlatform' },
2884
+ { headerName: 'Status', field: 'status', maxWidth: 100, cellRenderer: ({ value }) => value ? `<div class="badge m-auto bg-${value === ApprovalStatusEnum.Pending ? 'warning' : value === ApprovalStatusEnum.Approved ? 'success' : 'danger'}">${value}</div>` : '' },
2885
+ { headerName: 'Type', field: 'type', maxWidth: 100 },
2886
+ { headerName: 'Created Date', field: 'createdAt', sort: 'desc', valueFormatter: ({ value }) => value ? formatDate(value, 'dd MMM yyyy HH:mm', 'en-US') : '' }
2887
+ ],
2888
+ getData: (page, pageSize, sortBy, dir) => {
2889
+ const policy = this.input.page === page ? 'no-cache' : undefined;
2890
+ this.input.page = page;
2891
+ this.input.sortBy = sortBy;
2892
+ this.input.pageSize = pageSize;
2893
+ this.input.sortDirection = dir;
2894
+ return this.service.query(this.input, '', policy).pipe(map(({ data: { approvalMsApprovals: { data, totalRecord: t } } }) => ({ data, totalRecord: t })));
2809
2895
  }
2810
- }));
2896
+ };
2897
+ this.filterConfig = {
2898
+ mode: 'advanced',
2899
+ fields: [
2900
+ { key: 'status', label: 'Status', type: 'select', options: [
2901
+ { label: 'Approved', value: ['APPROVED'] },
2902
+ { label: 'Declined', value: ['DECLINED'] },
2903
+ { label: 'Pending', value: ['PENDING'] }
2904
+ ] },
2905
+ { key: 'type', label: 'Type', type: 'select', options: [
2906
+ { label: 'Creation', value: ['CREATION'] },
2907
+ { label: 'Deletion', value: ['DELETION'] },
2908
+ { label: 'Linkage', value: ['LINKAGE'] },
2909
+ { label: 'Unlink', value: ['UNLINK'] },
2910
+ { label: 'Update', value: ['UPDATE'] }
2911
+ ] }
2912
+ ]
2913
+ };
2914
+ this.btnConfig = [
2915
+ { label: 'Approve', icon: 'checkmark', description: 'Approve the approvals', disabled: true, onClick: this.multipleApproval.bind(this) },
2916
+ { label: 'Decline', icon: 'close', description: 'Decline the approvals', color: 'danger', disabled: true, onClick: this.multipleApproval.bind(this) }
2917
+ ];
2918
+ this.input = { page: 0, pageSize: 50, entity: this.entities };
2811
2919
  }
2812
- refreshToken(variables) {
2813
- return this.apollo.mutate({
2814
- context: {
2815
- headers: {
2816
- 'operation-type': 'Mutation',
2817
- 'operation-name': 'RefreshToken'
2818
- }
2819
- },
2820
- variables,
2821
- mutation: gql `
2822
- mutation RefreshToken($refreshToken: String!) {
2823
- authMsRefreshAccessToken(refreshToken: $refreshToken) {
2824
- accessToken
2825
- refreshToken
2826
- }
2827
- }
2828
- `
2920
+ setGridApi({ api }) { this.gridApi = api; }
2921
+ openDetail({ guid }) { this.router.navigate([`/approval/${guid}`], { preserveFragment: true }); }
2922
+ selectApprovals() { this.btnConfig[0].disabled = this.btnConfig[1].disabled = this.gridApi.getSelectedRows().length <= 1; }
2923
+ search({ data }) {
2924
+ this.input.type = data?.type;
2925
+ this.input.status = data?.status;
2926
+ this.gridApi.getSelectedNodes().forEach((e) => e.setSelected(false));
2927
+ this.gridApi.refreshInfiniteCache();
2928
+ }
2929
+ multipleApproval(btn) {
2930
+ btn.toggleLoading();
2931
+ this.router.navigate([`/approval/approval-group`], {
2932
+ preserveFragment: true,
2933
+ queryParams: {
2934
+ isApprove: btn.color !== 'danger',
2935
+ guids: this.gridApi.getSelectedRows().map(({ guid }) => guid),
2936
+ }
2829
2937
  });
2830
2938
  }
2831
- getProfile(fetchPolicy) {
2832
- return this.profileService.getMyProfile(fetchPolicy).pipe(tap((user) => {
2833
- if (!user)
2834
- return;
2835
- this.user = { ...user, photo: '/assets/imgs/profile.svg' };
2836
- user.appLoginExt?.forEach(({ paramCode, file: { publicUrl } }) => {
2837
- if (paramCode === 'USER_PROFILE_PHOTO')
2838
- this.user.photo = publicUrl;
2839
- });
2840
- user.appLoginPrincipal?.forEach(({ principalId, principalType }) => {
2841
- if (principalType === 'EMAIL_USERNAME')
2842
- this.user.email = principalId;
2843
- });
2844
- }));
2939
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalListComponent, deps: [{ token: 'ENTITIES' }, { token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: ApprovalService }, { token: i1.AlertController }], target: i0.ɵɵFactoryTarget.Component }); }
2940
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ApprovalListComponent, isStandalone: true, selector: "up-approval-list", host: { classAttribute: "d-flex flex-column h-100 w-100" }, ngImport: i0, template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">Approval</h3>\n\n <up-btn-group id=\"approval-list\" [config]=\"btnConfig\" />\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\">\n <up-filter placeholder=\"Type to search\" id=\"filter-approval-list\" [config]=\"filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-pagination-grid [config]=\"gridConfig\" id=\"grid-approval-list\" rowSelection=\"multiple\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" (onSelectionChanged)=\"selectApprovals()\" />\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: FilterComponent, selector: "up-filter", inputs: ["id", "config"], outputs: ["onSearch"] }, { kind: "component", type: ButtonGroupComponent, selector: "up-btn-group", inputs: ["config"] }, { kind: "component", type: GridPaginationComponent, selector: "up-pagination-grid", inputs: ["config", "rowData", "id", "rowModelType", "rowSelection"], outputs: ["onRowClick", "onGridReady", "onSelectionChanged"] }] }); }
2941
+ }
2942
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalListComponent, decorators: [{
2943
+ type: Component,
2944
+ args: [{ standalone: true, selector: 'up-approval-list', host: {
2945
+ class: 'd-flex flex-column h-100 w-100'
2946
+ }, imports: [
2947
+ FilterComponent,
2948
+ ButtonGroupComponent,
2949
+ GridPaginationComponent
2950
+ ], template: "<div class=\"d-flex align-items-center justify-content-between gap-4 p-4 flex-shrink-0 flex-wrap\">\n <div class=\"flex-grow-1 d-flex align-items-center gap-3\">\n <h3 class=\"m-0\">Approval</h3>\n\n <up-btn-group id=\"approval-list\" [config]=\"btnConfig\" />\n </div>\n\n <div class=\"flex-shrink-0 flex-grow-1\">\n <up-filter placeholder=\"Type to search\" id=\"filter-approval-list\" [config]=\"filterConfig\" (onSearch)=\"search($event)\" />\n </div>\n</div>\n\n<div class=\"flex-grow-1 px-1 pb-1\">\n <up-pagination-grid [config]=\"gridConfig\" id=\"grid-approval-list\" rowSelection=\"multiple\" (onGridReady)=\"setGridApi($event)\" (onRowClick)=\"openDetail($event)\" (onSelectionChanged)=\"selectApprovals()\" />\n</div>\n" }]
2951
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2952
+ type: Inject,
2953
+ args: ['ENTITIES']
2954
+ }] }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: ApprovalService }, { type: i1.AlertController }] });
2955
+
2956
+ class ApprovalFormComponent {
2957
+ constructor(router, ch, service, gridService, alertCtrl, permService) {
2958
+ this.router = router;
2959
+ this.ch = ch;
2960
+ this.service = service;
2961
+ this.gridService = gridService;
2962
+ this.alertCtrl = alertCtrl;
2963
+ this.permService = permService;
2964
+ this.isLoading = true;
2965
+ this.btnConfig = [];
2966
+ this.data = [];
2845
2967
  }
2846
- initForgotPassword(email) {
2847
- return this.apollo.mutate({
2848
- variables: {
2849
- input: {
2850
- email,
2851
- sourcePlatform: SourcePlatform.Admin
2968
+ ngOnDestroy() { this.sub?.unsubscribe(); }
2969
+ setGuid(guids, isApprove) {
2970
+ if (guids.length === 1)
2971
+ this.guid = guids[0];
2972
+ this.btnConfig.length = 0;
2973
+ this.setLoading(true);
2974
+ this.sub = this.service.query({ guids, status: [ApprovalStatusEnum.Approved, ApprovalStatusEnum.Declined, ApprovalStatusEnum.Pending] }, 'permission reason').subscribe({
2975
+ next: ({ data: { approvalMsApprovals: { data } } }) => {
2976
+ if (!data || data.length === 0) {
2977
+ this.router.navigateByUrl('approval');
2978
+ return;
2979
+ }
2980
+ this.data = data;
2981
+ if (data.length > 1) {
2982
+ let dataCount = 0;
2983
+ data.map(({ permission, status }) => {
2984
+ if (status === ApprovalStatusEnum.Pending) {
2985
+ const perm = permission.split('.');
2986
+ if (this.permService.checkPermission(perm[0], perm[1], perm[2]))
2987
+ dataCount++;
2988
+ if (dataCount === data.length)
2989
+ isApprove ? this.btnConfig.push({ label: 'Approve', icon: 'checkmark', description: 'Approve the approval(s)', disabled: false, onClick: this.request.bind(this) }) : this.btnConfig.push({ label: 'Decline', icon: 'close', description: 'Decline the approval', color: 'danger', disabled: false, onClick: this.request.bind(this) });
2990
+ }
2991
+ });
2992
+ }
2993
+ else {
2994
+ const { status, permission } = data[0];
2995
+ if (status === ApprovalStatusEnum.Pending) {
2996
+ const perm = permission.split('.');
2997
+ if (this.permService.checkPermission(perm[0], perm[1], perm[2])) {
2998
+ this.btnConfig.push({ label: 'Approve', icon: 'checkmark', description: 'Approve the approval', disabled: false, onClick: this.request.bind(this) }, { label: 'Decline', icon: 'close', description: 'Decline the approval', color: 'danger', disabled: false, onClick: this.request.bind(this) });
2999
+ }
3000
+ }
2852
3001
  }
3002
+ this.setLoading(false);
2853
3003
  },
2854
- mutation: gql `
2855
- mutation InitForgotPassword($input: ForgotPassOtpRq!) {
2856
- authMsForgotPasswordOtp(input: $input)
2857
- }
2858
- `
3004
+ error: ({ message }) => {
3005
+ this.showAlert('Error', message);
3006
+ this.router.navigateByUrl('approval');
3007
+ }
2859
3008
  });
2860
3009
  }
2861
- createNewPassword({ newPassword, principalId, sourcePlatform, verifCode }) {
2862
- return this.apollo.mutate({
2863
- mutation: gql `
2864
- mutation SubmitForgotPassword($input: ForgotPassRq!) {
2865
- authMsForgotPassword(input: $input)
2866
- }
2867
- `,
2868
- variables: {
2869
- input: {
2870
- newPassword,
2871
- principalId,
2872
- sourcePlatform,
2873
- verifCode
3010
+ request(btn) {
3011
+ const isApprove = btn.color !== 'danger';
3012
+ this.showAlert('Confirm', `Are you sure want to ${isApprove ? 'approve the approval?' : 'decline the approval? Please input the reason if you want to decline.'}`, [
3013
+ { text: 'Cancel', handler: () => btn.toggleLoading() },
3014
+ {
3015
+ text: `${isApprove ? 'Approve' : 'Decline'}`,
3016
+ handler: ({ reason }) => {
3017
+ this.sub?.unsubscribe();
3018
+ const variables = {
3019
+ ...(this.guid ? { guid: this.guid } : { approvalGroupGuid: '' }),
3020
+ isApprove,
3021
+ reason
3022
+ };
3023
+ this.sub = this.service.request(variables).subscribe({
3024
+ next: () => {
3025
+ this.showAlert('Success', `Approval ${isApprove ? 'approved' : 'declined'}`);
3026
+ this.router.navigateByUrl('approval');
3027
+ this.gridService.refreshGridCache('grid-approval-list');
3028
+ },
3029
+ error: ({ message }) => {
3030
+ btn.toggleLoading();
3031
+ this.showAlert('Error', message);
3032
+ }
3033
+ });
2874
3034
  }
2875
3035
  }
2876
- });
3036
+ ], [{ name: 'reason', type: 'textarea', placeholder: 'Reason' }]);
2877
3037
  }
2878
- updatePassword(input) {
2879
- return this.apollo.mutate({
2880
- mutation: gql `
2881
- mutation ChangePassword($input: ChangePassRq!) {
2882
- authMsChangePassword(input: $input)
2883
- }
2884
- `,
2885
- variables: { input }
2886
- });
3038
+ setLoading(b) {
3039
+ this.isLoading = b;
3040
+ this.ch.markForCheck();
2887
3041
  }
2888
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuthService, deps: [{ token: i1$1.Apollo }, { token: ProfileService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2889
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuthService, providedIn: 'root' }); }
3042
+ async showAlert(header, message, buttons = ['OK'], inputs = []) { (await this.alertCtrl.create({ header, message, buttons, inputs })).present(); }
3043
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalFormComponent, deps: [{ token: i1$2.Router }, { token: i0.ChangeDetectorRef }, { token: ApprovalService }, { token: GridService }, { token: i1.AlertController }, { token: PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
3044
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ApprovalFormComponent, isStandalone: true, selector: "up-approval-form", inputs: { isLoading: "isLoading" }, host: { classAttribute: "px-4 d-block" }, ngImport: i0, template: "<ng-container *ngIf=\"!isLoading; else loading\">\n <div *ngFor=\"let d of data, let i = index\">\n <div class=\"d-flex align-items-center gap-2 pb-3 pt-2\" *ngIf=\"data.length > 1\">\n <ion-icon name=\"document\" />\n <h5 class=\"m-0\">Approval {{ i + 1 }}</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Entity\" [disabled]=\"true\" [value]=\"d.entity\" />\n <up-input class=\"mb-4\" label=\"Remark\" [disabled]=\"true\" [value]=\"d.remark\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Created At\" [disabled]=\"true\" [value]=\"d.createdAt | date:'dd MMM yyyy HH:mm'\" />\n <up-input class=\"mb-4\" label=\"Status\" [disabled]=\"true\" [value]=\"d.status\" />\n </div>\n </div>\n\n <up-textarea class=\"mb-4\" label=\"Reason\" [disabled]=\"true\" [value]=\"d.reason\" *ngIf=\"d.status !== 'PENDING'\" />\n </div>\n</ng-container>\n\n<ng-template #loading>\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n </div>\n </div>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonSkeletonText, selector: "ion-skeleton-text", inputs: ["animated"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "component", type: FormInputComponent, selector: "up-input", inputs: ["label", "value", "required", "disabled"], outputs: ["onInput"] }, { kind: "component", type: FormTextareaComponent, selector: "up-textarea", inputs: ["value", "required", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2890
3045
  }
2891
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AuthService, decorators: [{
2892
- type: Injectable,
2893
- args: [{
2894
- providedIn: 'root'
2895
- }]
2896
- }], ctorParameters: () => [{ type: i1$1.Apollo }, { type: ProfileService }] });
3046
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalFormComponent, decorators: [{
3047
+ type: Component,
3048
+ args: [{ standalone: true, selector: 'up-approval-form', changeDetection: ChangeDetectionStrategy.OnPush, host: {
3049
+ class: 'px-4 d-block'
3050
+ }, imports: [
3051
+ IonicModule,
3052
+ CommonModule,
3053
+ FormInputComponent,
3054
+ FormTextareaComponent
3055
+ ], template: "<ng-container *ngIf=\"!isLoading; else loading\">\n <div *ngFor=\"let d of data, let i = index\">\n <div class=\"d-flex align-items-center gap-2 pb-3 pt-2\" *ngIf=\"data.length > 1\">\n <ion-icon name=\"document\" />\n <h5 class=\"m-0\">Approval {{ i + 1 }}</h5>\n </div>\n\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Entity\" [disabled]=\"true\" [value]=\"d.entity\" />\n <up-input class=\"mb-4\" label=\"Remark\" [disabled]=\"true\" [value]=\"d.remark\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <up-input class=\"mb-4\" label=\"Created At\" [disabled]=\"true\" [value]=\"d.createdAt | date:'dd MMM yyyy HH:mm'\" />\n <up-input class=\"mb-4\" label=\"Status\" [disabled]=\"true\" [value]=\"d.status\" />\n </div>\n </div>\n\n <up-textarea class=\"mb-4\" label=\"Reason\" [disabled]=\"true\" [value]=\"d.reason\" *ngIf=\"d.status !== 'PENDING'\" />\n </div>\n</ng-container>\n\n<ng-template #loading>\n <div class=\"d-flex flex-column flex-lg-row gap-4\">\n <div class=\"flex-grow-1\">\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n </div>\n\n <div class=\"flex-grow-1\">\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n <ion-skeleton-text class=\"m-0 mb-4 sk-input\" />\n </div>\n </div>\n</ng-template>\n" }]
3056
+ }], ctorParameters: () => [{ type: i1$2.Router }, { type: i0.ChangeDetectorRef }, { type: ApprovalService }, { type: GridService }, { type: i1.AlertController }, { type: PermissionService }], propDecorators: { isLoading: [{
3057
+ type: Input
3058
+ }] } });
2897
3059
 
2898
- class CurrencyService {
2899
- constructor(apollo) {
2900
- this.apollo = apollo;
3060
+ class ApprovalDetailComponent {
3061
+ constructor(router, activatedRoute) {
3062
+ this.router = router;
3063
+ this.activatedRoute = activatedRoute;
3064
+ this.btnConfig = [];
3065
+ this.guid = '';
2901
3066
  }
2902
- query() {
2903
- return this.apollo.query({
2904
- errorPolicy: 'all',
2905
- variables: {
2906
- input: {
2907
- page: 0,
2908
- pageSize: 300,
2909
- sortBy: 'name',
2910
- sortDirection: 'asc'
2911
- }
2912
- },
2913
- query: gql `
2914
- query QueryCurrency($input: CurrencyQueryCriteria!) {
2915
- webConfigMsCurrency(input: $input) {
2916
- data {
2917
- code
2918
- guid
2919
- magnifyValue
2920
- name
2921
- status
3067
+ ngOnInit() {
3068
+ this.sub = this.activatedRoute.queryParams.subscribe((params) => {
3069
+ if (params) {
3070
+ this.guids = params['guids'];
3071
+ this.isApprove = params['isApprove'] === 'true';
2922
3072
  }
2923
- }
2924
- }
2925
- `,
2926
3073
  });
2927
3074
  }
2928
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CurrencyService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
2929
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CurrencyService, providedIn: 'root' }); }
2930
- }
2931
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CurrencyService, decorators: [{
2932
- type: Injectable,
2933
- args: [{
2934
- providedIn: 'root'
2935
- }]
2936
- }], ctorParameters: () => [{ type: i1$1.Apollo }] });
2937
-
2938
- class CountryService {
2939
- constructor(apollo) {
2940
- this.apollo = apollo;
2941
- }
2942
- query() {
2943
- return this.apollo.query({
2944
- errorPolicy: 'all',
2945
- variables: {
2946
- input: {
2947
- page: 0,
2948
- pageSize: 300,
2949
- sortBy: 'name',
2950
- sortDirection: 'asc'
3075
+ ngAfterViewInit() {
3076
+ if (this.guids) {
3077
+ this.setChildGuid('');
3078
+ this.changeTab(this.activatedRoute.snapshot.fragment);
3079
+ }
3080
+ else {
3081
+ this.setChildGuid(this.activatedRoute.children[0].snapshot.params['guid']);
3082
+ this.changeTab(this.activatedRoute.snapshot.fragment);
3083
+ this.sub = this.router.events.pipe(filter((e) => e instanceof NavigationEnd)).subscribe({
3084
+ next: () => {
3085
+ const newGuid = this.activatedRoute.children[0].snapshot.params['guid'];
3086
+ if (this.guid !== newGuid) {
3087
+ this.guid = newGuid;
3088
+ this.setChildGuid(this.guid);
3089
+ }
2951
3090
  }
2952
- },
2953
- query: gql `
2954
- query QueryCountry($input: CountryQueryCriteria!) {
2955
- webConfigMsCountry(input: $input) {
2956
- data {
2957
- code
2958
- defaultLangCode
2959
- guid
2960
- langCodes {
2961
- code
2962
- guid
2963
- }
2964
- name
2965
- phoneCodes {
2966
- code
2967
- }
2968
- }
2969
- }
3091
+ });
2970
3092
  }
2971
- `,
2972
- });
2973
3093
  }
2974
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CountryService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
2975
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CountryService, providedIn: 'root' }); }
3094
+ ngOnDestroy() { this.sub.unsubscribe(); }
3095
+ changeTab(f) {
3096
+ switch (f) {
3097
+ default:
3098
+ this.btnConfig = this.formComponent?.btnConfig ?? [];
3099
+ }
3100
+ }
3101
+ setChildGuid(guid) {
3102
+ this.formComponent?.setGuid(this.guids ?? [guid], this.isApprove);
3103
+ }
3104
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalDetailComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
3105
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ApprovalDetailComponent, isStandalone: true, selector: "up-approval-detail", host: { classAttribute: "d-block h-100" }, viewQueries: [{ propertyName: "formComponent", first: true, predicate: ApprovalFormComponent, descendants: true }], ngImport: i0, template: "<up-column-header-container header=\"Approval Detail\" prevUrl=\"/approval\" class=\"bg-white\">\n <up-btn-group id=\"button\" *ngIf=\"!formComponent?.isLoading; else loading\" [config]=\"btnConfig\" />\n\n <ng-template #loading>\n <ion-skeleton-text id=\"button\" class=\"m-0 sk-btn\" />\n </ng-template>\n\n <up-tab-group class=\"h-100\" (onChange)=\"changeTab($event)\">\n <up-tab-content header=\"Detail\" fragment=\"detail\">\n <up-approval-form />\n </up-tab-content>\n </up-tab-group>\n</up-column-header-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonSkeletonText, selector: "ion-skeleton-text", inputs: ["animated"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TabsComponentModule }, { kind: "component", type: TabGroupComponent, selector: "up-tab-group", outputs: ["onChange"] }, { kind: "component", type: TabContentComponent, selector: "up-tab-content", inputs: ["header"] }, { kind: "component", type: ButtonGroupComponent, selector: "up-btn-group", inputs: ["config"] }, { kind: "component", type: ColumnHeaderContainerComponent, selector: "up-column-header-container", inputs: ["header", "prevUrl"] }, { kind: "component", type: ApprovalFormComponent, selector: "up-approval-form", inputs: ["isLoading"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2976
3106
  }
2977
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CountryService, decorators: [{
2978
- type: Injectable,
2979
- args: [{
2980
- providedIn: 'root'
2981
- }]
2982
- }], ctorParameters: () => [{ type: i1$1.Apollo }] });
3107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ApprovalDetailComponent, decorators: [{
3108
+ type: Component,
3109
+ args: [{ standalone: true, selector: 'up-approval-detail', changeDetection: ChangeDetectionStrategy.OnPush, host: {
3110
+ class: 'd-block h-100'
3111
+ }, imports: [
3112
+ IonicModule,
3113
+ CommonModule,
3114
+ TabsComponentModule,
3115
+ ButtonGroupComponent,
3116
+ ColumnHeaderContainerComponent,
3117
+ ApprovalFormComponent
3118
+ ], template: "<up-column-header-container header=\"Approval Detail\" prevUrl=\"/approval\" class=\"bg-white\">\n <up-btn-group id=\"button\" *ngIf=\"!formComponent?.isLoading; else loading\" [config]=\"btnConfig\" />\n\n <ng-template #loading>\n <ion-skeleton-text id=\"button\" class=\"m-0 sk-btn\" />\n </ng-template>\n\n <up-tab-group class=\"h-100\" (onChange)=\"changeTab($event)\">\n <up-tab-content header=\"Detail\" fragment=\"detail\">\n <up-approval-form />\n </up-tab-content>\n </up-tab-group>\n</up-column-header-container>\n" }]
3119
+ }], ctorParameters: () => [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }], propDecorators: { formComponent: [{
3120
+ type: ViewChild,
3121
+ args: [ApprovalFormComponent]
3122
+ }] } });
2983
3123
 
2984
3124
  class AuthResolver {
2985
3125
  isUserLoggedIn() {
@@ -3128,5 +3268,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
3128
3268
  type: Injectable
3129
3269
  }], ctorParameters: () => [{ type: i1$2.Router }, { type: AuthService }] });
3130
3270
 
3131
- export { AppletContainerComponent, ApprovalDetailComponent, ApprovalListComponent, AuditDetailComponent, AuditListComponent, AuthGuard, AuthResolver, AuthService, ButtonGroupComponent, ButtonLoadingComponent, ColumnContainerComponent, ColumnHeaderContainerComponent, CountryService, CurrencyService, FilterComponent, FormDateComponent, FormImagePickerComponent, FormInputComponent, FormNumberComponent, FormPasswordComponent, FormSearchableSelectComponent, FormSelectComponent, FormTextareaComponent, GridPaginationComponent, GridService, GridSnapshotComponent, HeaderInterceptor, ListPaginationContainerComponent, ListSnapshotContainerComponent, LoadingPage, ModalContainerComponent, PermissionDirective, PermissionGuard, PermissionModule, PermissionService, ProfileService, RefreshTokenInterceptor, TabContentComponent, TabGroupComponent, TabsComponentModule, UnauthorizedPage, bootstrap, getFormErrorMessage };
3271
+ export { AppletContainerComponent, ApprovalDetailComponent, ApprovalListComponent, AuditDetailComponent, AuditListComponent, AuthGuard, AuthResolver, AuthService, ButtonGroupComponent, ButtonLoadingComponent, ColumnContainerComponent, ColumnHeaderContainerComponent, CountryService, CurrencyService, FilterComponent, FormCurrencyInputComponent, FormDateComponent, FormImagePickerComponent, FormInputComponent, FormNumberComponent, FormPasswordComponent, FormSearchableSelectComponent, FormSelectComponent, FormTextareaComponent, GridPaginationComponent, GridService, GridSnapshotComponent, HeaderInterceptor, ListPaginationContainerComponent, ListSnapshotContainerComponent, LoadingPage, ModalContainerComponent, PermissionDirective, PermissionGuard, PermissionModule, PermissionService, ProfileService, RefreshTokenInterceptor, TabContentComponent, TabGroupComponent, TabsComponentModule, UnauthorizedPage, bootstrap, getFormErrorMessage };
3132
3272
  //# sourceMappingURL=unipin-angular-applet.mjs.map