@sumaris-net/ngx-components 1.9.0 → 1.9.3

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.
@@ -20823,7 +20823,7 @@
20823
20823
  template: "<app-toolbar [canGoBack]=\"false\"\n visible-xs visible-sm visible-mobile>\n\n <!-- change locale button -->\n <ion-button slot=\"end\" *ngIf=\"currentLocaleCode; let code\"\n [matMenuTriggerFor]=\"localeMenu\">\n <ion-label class=\"ion-text-uppercase\">&nbsp;{{ code }}</ion-label>\n <mat-icon slot=\"end\">arrow_drop_down</mat-icon>\n </ion-button>\n</app-toolbar>\n\n<!-- change locale menu -->\n<mat-menu #localeMenu=\"matMenu\">\n <button *ngFor=\"let item of locales\"\n mat-menu-item\n (click)=\"changeLanguage(item.key)\">\n <ion-label>{{item.value}}</ion-label>\n </button>\n</mat-menu>\n\n<ion-content [ngStyle]=\"contentStyle\" no-padding-xs>\n\n <!-- loading spinner -->\n <div class=\"loading-page\" [class.cdk-visually-hidden]=\"!loading\">\n <div class=\"spinner\" *ngIf=\"loading && showSpinner\">\n <p>Loading...</p>\n <div class=\"sk-cube1 sk-cube\"></div>\n <div class=\"sk-cube2 sk-cube\"></div>\n <div class=\"sk-cube4 sk-cube\"></div>\n <div class=\"sk-cube3 sk-cube\"></div>\n </div>\n </div>\n\n <!-- Desktop: translucent top toolbar -->\n <div hidden-xs hidden-sm hidden-mobile>\n <ion-toolbar translucent>\n <ion-buttons slot=\"start\">\n <ion-menu-toggle>\n <ion-button color=\"light\" fill=\"clear\">\n <ion-icon slot=\"icon-only\" name=\"menu\"></ion-icon>\n </ion-button>\n </ion-menu-toggle>\n </ion-buttons>\n\n <ion-buttons slot=\"end\">\n <!-- change locale button -->\n <ion-button color=\"secondary\" fill=\"solid\"\n *ngIf=\"currentLocaleCode; let code\"\n [matMenuTriggerFor]=\"localeMenu\">\n <ion-label class=\"ion-text-uppercase\">&nbsp;{{ code }}</ion-label>\n <mat-icon slot=\"end\">arrow_drop_down</mat-icon>\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n </div>\n\n <!-- Install (and upgrade) card -->\n <app-install-upgrade-card [isLogin]=\"isLogin\"\n showInstallButton=\"true\">\n </app-install-upgrade-card>\n\n <!-- Welcome card -->\n <ion-card *ngIf=\"!loading\"\n class=\"main welcome ion-padding ion-text-center ion-align-self-center\"\n @fadeInAnimation>\n <ion-card-header>\n <ion-card-title class=\"ion-text-center\">\n <span *ngIf=\"isWeb\" [innerHTML]=\"'HOME.WELCOME_WEB'|translate: {appName: appName}\"></span>\n <span *ngIf=\"!isWeb\" [innerHTML]=\"'HOME.WELCOME_APP'|translate: {appName: appName}\"></span>\n </ion-card-title>\n <ion-card-subtitle [innerHTML]=\"description\">\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content class=\"ion-no-padding\">\n <ion-text color=\"primary\">\n <img class=\"logo\" *ngIf=\"logo\" src=\"{{ logo }}\">\n </ion-text>\n <!-- register help text -->\n <ion-text *ngIf=\"!isLogin && canRegister\">\n <br/>\n <span translate>HOME.REGISTER_HELP</span>\n </ion-text>\n </ion-card-content>\n\n <ion-footer class=\"ion-padding-top\">\n\n <!-- If NOT login -->\n <ng-container *ngIf=\"!isLogin; else loginButtons;\">\n\n <ion-button *ngIf=\"canRegister\" expand=\"block\" color=\"tertiary\" (click)=\"register()\">\n <span translate>HOME.BTN_REGISTER</span>\n </ion-button>\n <ion-button expand=\"block\" color=\"light\" [routerLink]=\"['/']\" (click)=\"login()\">\n <span translate>AUTH.BTN_LOGIN</span>\n </ion-button>\n\n </ng-container>\n\n <!-- If user login -->\n <ng-template #loginButtons>\n\n <!-- Feature buttons -->\n <ng-container *ngIf=\"$filteredButtons | async as buttons\">\n <ng-container *ngFor=\"let item of buttons\">\n <ion-button *ngIf=\"item.path\"\n expand=\"block\" color=\"tertiary\"\n [class]=\"item.cssClass\"\n [routerLink]=\"item.path\"\n routerDirection=\"root\">\n <ion-icon slot=\"start\" class=\"ion-float-start\" *ngIf=\"item.icon\" [name]=\"item.icon\"></ion-icon>\n <mat-icon slot=\"start\" class=\"ion-float-start\" *ngIf=\"item.matIcon\">{{item.matIcon}}</mat-icon>\n <ion-text>{{'HOME.BTN_DATA_ENTRY'|translate: {name: (item.title | translate) } }}</ion-text>\n </ion-button>\n\n <!-- divider -->\n <div *ngIf=\"!item.path && !item.action\" [class]=\"item.cssClass\">\n <ion-label translate>{{item.title}}&nbsp;</ion-label>\n </div>\n </ng-container>\n\n <!--<p *ngIf=\"buttons.length\" class=\"visible-mobile\">&nbsp;</p>-->\n </ng-container>\n\n <ion-button expand=\"block\" color=\"secondary\" [routerLink]=\"['/account']\">\n <ion-icon slot=\"start\" class=\"ion-float-start\" name=\"person-circle\"></ion-icon>\n <ion-text translate>HOME.BTN_MY_ACCOUNT</ion-text>\n </ion-button>\n\n <p hidden-xs hidden-sm hidden-mobile>\n <ion-text [innerHTML]=\"'HOME.NOT_THIS_ACCOUNT_QUESTION' | translate: {displayName: accountName }\"></ion-text>\n <br/>\n <ion-text>\n <a href=\"#\" (click)=\"logout($event)\">\n <span translate>HOME.BTN_DISCONNECT</span>\n </a>\n </ion-text>\n </p>\n\n\n </ng-template>\n\n </ion-footer>\n </ion-card>\n\n <!-- Page history -->\n <ion-grid *ngIf=\"!loading && isLogin && pageHistory.length; else bottomBanner\"\n class=\"history-container ion-align-self-center\">\n <ion-row>\n <ion-col size=\"12\" size-xl=\"\" *ngFor=\"let page of pageHistory; trackBy: getPagePath\"\n class=\"ion-text-center\">\n <ion-card class=\"ion-align-self-start ion-text-start\" @fadeInAnimation>\n <ion-card-header class=\"ion-no-padding\">\n <!-- top bar -->\n <ion-card-subtitle>\n <button type=\"button\" tabindex=\"-1\"\n (click)=\"settings.removePageHistory(page.path)\"\n mat-icon-button class=\"ion-float-start ion-no-margin\">\n <mat-icon>close</mat-icon>\n </button>\n <ion-label [innerHTML]=\"page.subtitle|translate\"></ion-label>\n <ion-text class=\"ion-float-end\" [title]=\"page.time|dateFormat:{time: true}\">\n <small><ion-icon name=\"time-outline\"></ion-icon>&nbsp;{{ page.time|dateFromNow }}</small>&nbsp;\n </ion-text>\n </ion-card-subtitle>\n\n <!-- main page -->\n <ion-card-title class=\"ion-no-margin ion-no-padding\">\n <ion-item detail=\"true\"\n tappable class=\"text-1x\"\n [routerLink]=\"page.path\"\n routerDirection=\"root\" lines=\"none\">\n <!-- page icon-->\n <ion-icon *ngIf=\"page.icon\" slot=\"start\" [name]=\"page.icon\"></ion-icon>\n <mat-icon *ngIf=\"page.matIcon\" slot=\"start\">{{page.matIcon}}</mat-icon>\n\n <ion-label color=\"primary\" [innerHTML]=\"page.title\"></ion-label>\n </ion-item>\n </ion-card-title>\n </ion-card-header>\n\n <!-- children pages -->\n <ion-card-content class=\"ion-no-padding ion-padding-start\" *ngIf=\"page.children?.length\">\n <ion-list class=\"ion-no-padding\">\n <ion-item detail=\"true\"\n *ngFor=\"let childPage of page.children\"\n tappable class=\"text-1x\"\n [routerLink]=\"childPage.path\"\n routerDirection=\"root\">\n <!-- page icon-->\n <ion-icon *ngIf=\"childPage.icon\" slot=\"start\" color=\"dark\" [name]=\"childPage.icon\"></ion-icon>\n <mat-icon *ngIf=\"childPage.matIcon\" slot=\"start\" color=\"dark\">{{childPage.matIcon}}</mat-icon>\n\n <ion-label color=\"dark\" [innerHTML]=\"childPage.title\"></ion-label>\n </ion-item>\n </ion-list>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n <!-- Display configured Departments logos -->\n <ng-template #bottomBanner>\n <div class=\"bottom-banner ion-text-center ion-padding\" *ngIf=\"!loadingBanner\" @fadeInAnimation>\n <a href=\"{{ item.siteUrl }}\" *ngFor=\"let item of $partners | async \">\n <img class=\"logo\" src=\"{{ item.logo }}\" alt=\"{{item.label}}\" [title]=\"item.label\" />\n </a>\n </div>\n </ng-template>\n\n\n</ion-content>\n",
20824
20824
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
20825
20825
  animations: [fadeInAnimation, slideUpDownAnimation],
20826
- styles: ["h1,h2,h3,h4,h5{white-space:normal}.center,ion-content ion-card.welcome img{text-align:center;display:inline-block}ion-content{--background:transparent;background-size:cover;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;display:inline-block;padding:15px}ion-content,ion-content .loading-page{background-color:var(--ion-color-primary)}ion-content .loading-page{display:block;height:100%;width:100%;position:absolute;z-index:5;transition:background .5s linear;-webkit-transition:background 1.5s linear}ion-content .loading-page.hidden{background-color:rgba(var(--ion-color-primary),0)}ion-content ion-card{z-index:9}ion-content ion-card ion-card-header{display:block}ion-content ion-card ion-card-header ion-card-subtitle,ion-content ion-card ion-card-header ion-card-title{display:block;width:100%}ion-content ion-card.main{min-width:240px;max-width:400px;margin-left:auto;margin-right:auto}ion-content ion-card.welcome{background-color:hsla(0,0%,100%,.7)}ion-content ion-card.welcome button{margin-top:16px}ion-content ion-card.welcome img{max-width:250px}ion-content .history-container{margin-left:auto;margin-right:auto}ion-content .history-container ion-card{display:inline-block;box-sizing:border-box;z-index:8;min-width:240px;max-width:400px;width:100%;margin-left:auto;margin-right:auto;background-color:hsla(0,0%,100%,.7)}ion-content .history-container ion-card ion-card-header ion-card-subtitle{height:40px}ion-content .history-container ion-card ion-card-header ion-card-subtitle button[float-start]{z-index:99;margin:0}ion-content .history-container ion-card ion-card-header ion-card-subtitle ion-label{line-height:40px}ion-content .history-container ion-card ion-card-header ion-card-subtitle ion-label[float-end]{padding-right:16px;font-weight:400}ion-content .history-container ion-card ion-card-header ion-card-title ion-item{--ion-item-background:$transparent;--ion-item-icon-color:var(--ion-color-primary);--ion-item-text-color:var(--ion-color-primary)}ion-content .history-container ion-card ion-card-header ion-card-title ion-item ion-icon[slot=start],ion-content .history-container ion-card ion-card-header ion-card-title ion-item mat-icon[slot=start]{margin-right:unset;-webkit-margin-end:16px!important;margin-inline-end:16px!important;color:var(--ion-item-icon-color)!important;fill:currentColor;stroke:currentColor}ion-content .history-container ion-card ion-card-header ion-card-title ion-item ion-label,ion-content .history-container ion-card ion-card-header ion-card-title ion-item ion-text{color:var(--ion-item-text-color)!important;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}ion-content .history-container ion-card ion-card-content ion-list{--ion-item-background:var(--ion-color-transparent)}ion-content .history-container ion-card ion-card-content ion-list ion-item{--ion-item-icon-color:var(--ion-color-dark);--ion-item-text-color:var(--ion-color-dark)}ion-content .history-container ion-card ion-card-content ion-list ion-item ion-icon[slot=start],ion-content .history-container ion-card ion-card-content ion-list ion-item mat-icon[slot=start]{color:var(--ion-item-icon-color)!important;fill:currentColor;stroke:currentColor;margin-right:unset;-webkit-margin-end:16px!important;margin-inline-end:16px!important}ion-content .history-container ion-card ion-card-content ion-list ion-item ion-label,ion-content .history-container ion-card ion-card-content ion-list ion-item ion-text{color:var(--ion-item-text-color)!important}ion-content .bottom-banner{background-color:hsla(0,0%,100%,.7);min-width:240px;z-index:0;position:absolute;left:16px;right:16px;bottom:16px}ion-content .bottom-banner img.logo{max-height:50px;margin-left:8px}ion-content ion-text{text-align:center}@media screen and (max-width:575px){ion-content ion-card{min-width:160px;width:calc(100% - 20px);max-width:100%;margin-left:10px;margin-right:10px}ion-content ion-card h1{margin-top:0;font-size:20px}ion-content ion-card button{margin-top:8px}ion-content .bottom-banner{display:block;position:unset}ion-content .bottom-banner img.logo{max-height:30px}}@media screen and (max-width:767px) and (min-width:576px){ion-content{min-height:555px}ion-content .bottom-banner img.logo{max-height:40px}}@media screen and (min-width:768px){ion-content{min-height:calc(100% - 100px)}}"]
20826
+ styles: ["h1,h2,h3,h4,h5{white-space:normal}.center,ion-content ion-card.welcome img{text-align:center;display:inline-block}ion-content{--background:transparent;background-size:cover;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;display:inline-block;padding:15px}ion-content,ion-content .loading-page{background-color:var(--ion-color-primary)}ion-content .loading-page{display:block;height:100%;width:100%;position:absolute;z-index:5;transition:background .5s linear;-webkit-transition:background 1.5s linear}ion-content .loading-page.hidden{background-color:rgba(var(--ion-color-primary),0)}ion-content ion-card{z-index:9}ion-content ion-card ion-card-header{display:block}ion-content ion-card ion-card-header ion-card-subtitle,ion-content ion-card ion-card-header ion-card-title{display:block;width:100%}ion-content ion-card.main{min-width:240px;max-width:400px;margin-left:auto;margin-right:auto}ion-content ion-card.welcome{background-color:hsla(0,0%,100%,.7)}ion-content ion-card.welcome button{margin-top:16px}ion-content ion-card.welcome img{max-width:250px}ion-content .history-container{margin-left:auto;margin-right:auto}ion-content .history-container ion-card{display:inline-block;box-sizing:border-box;z-index:8;min-width:240px;max-width:400px;width:100%;margin-left:auto;margin-right:auto;background-color:hsla(0,0%,100%,.7)}ion-content .history-container ion-card ion-card-header ion-card-subtitle{height:40px}ion-content .history-container ion-card ion-card-header ion-card-subtitle button[float-start]{z-index:99;margin:0}ion-content .history-container ion-card ion-card-header ion-card-subtitle ion-label{line-height:40px}ion-content .history-container ion-card ion-card-header ion-card-subtitle ion-label[float-end]{padding-right:16px;font-weight:400}ion-content .history-container ion-card ion-card-header ion-card-title ion-item{--ion-item-background:$transparent;--ion-item-icon-color:var(--ion-color-primary);--ion-item-text-color:var(--ion-color-primary)}ion-content .history-container ion-card ion-card-header ion-card-title ion-item ion-icon[slot=start],ion-content .history-container ion-card ion-card-header ion-card-title ion-item mat-icon[slot=start]{margin-right:unset;-webkit-margin-end:16px!important;margin-inline-end:16px!important;color:var(--ion-item-icon-color)!important;fill:currentColor;stroke:currentColor}ion-content .history-container ion-card ion-card-header ion-card-title ion-item ion-label,ion-content .history-container ion-card ion-card-header ion-card-title ion-item ion-text{color:var(--ion-item-text-color)!important;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}ion-content .history-container ion-card ion-card-content ion-list{--ion-item-background:var(--ion-color-transparent)}ion-content .history-container ion-card ion-card-content ion-list ion-item{--ion-item-icon-color:var(--ion-color-dark);--ion-item-text-color:var(--ion-color-dark)}ion-content .history-container ion-card ion-card-content ion-list ion-item ion-icon[slot=start],ion-content .history-container ion-card ion-card-content ion-list ion-item mat-icon[slot=start]{color:var(--ion-item-icon-color)!important;fill:currentColor;stroke:currentColor;margin-right:unset;-webkit-margin-end:16px!important;margin-inline-end:16px!important}ion-content .history-container ion-card ion-card-content ion-list ion-item ion-label,ion-content .history-container ion-card ion-card-content ion-list ion-item ion-text{color:var(--ion-item-text-color)!important}ion-content .bottom-banner{background-color:hsla(0,0%,100%,.7);min-width:240px;z-index:0;position:absolute;left:16px;right:16px;bottom:16px}ion-content .bottom-banner img.logo{max-height:50px;margin-left:8px}ion-content ion-text{text-align:center}@media screen and (max-width:575px){ion-content ion-card{min-width:160px;width:calc(100% - 20px);max-width:100%;margin-left:10px;margin-right:10px}ion-content ion-card h1{margin-top:0;font-size:20px}ion-content ion-card ion-card-content ion-button{margin-top:8px}ion-content .bottom-banner{display:block;position:unset}ion-content .bottom-banner img.logo{max-height:30px}}@media screen and (max-width:767px) and (min-width:576px){ion-content{min-height:555px}ion-content .bottom-banner img.logo{max-height:40px}}@media screen and (min-width:768px){ion-content{min-height:calc(100% - 100px)}}"]
20827
20827
  },] }
20828
20828
  ];
20829
20829
  HomePage.ctorParameters = function () { return [
@@ -20926,7 +20926,7 @@
20926
20926
  { type: i0.Component, args: [{
20927
20927
  selector: 'page-register-confirm',
20928
20928
  template: "<app-toolbar [title]=\"'REGISTER.CONFIRMED.TITLE'|translate\" color=\"primary\">\n</app-toolbar>\n\n\n<ion-content class=\"bg-image-cover center ion-padding\" [ngStyle]=\"contentStyle\">\n\n <p class=\"hidden-xs ion-padding\">&nbsp;<br /><br /></p>\n <p class=\"hidden-xs\">&nbsp;</p>\n\n\n <ion-card>\n <ion-card-content>\n\n <div>\n <ng-container *ngIf=\"loading\">\n <h4 translate>REGISTER.CONFIRMED.LOADING</h4>\n <p><ion-spinner></ion-spinner></p>\n </ng-container>\n\n <!-- error -->\n <ion-item *ngIf=\"!loading && error\">\n <ion-icon color=\"danger\" slot=\"start\" name=\"alert-circle\"></ion-icon>\n <ion-label color=\"danger\" class=\"error\" [innerHTML]=\"error|translate\"></ion-label>\n </ion-item>\n </div>\n\n <div *ngIf=\"!loading && !error\">\n <h3>\n <ion-icon name=\"checkmark\"></ion-icon>\n <b translate>REGISTER.CONFIRMED.SUB_TITLE</b>\n </h3>\n\n <ion-text>\n <p [innerHTML]=\"'REGISTER.CONFIRMED.SUCCESS'|translate: {email: email}\"></p>\n <p *ngIf=\"!isLogin\" [innerHTML]=\"'REGISTER.CONFIRMED.LOGIN_HELP'|translate\"></p>\n </ion-text>\n\n </div>\n\n </ion-card-content>\n\n <ion-footer *ngIf=\"!loading\">\n <ion-button expand=\"full\" color=\"primary\" [routerLink]=\"['/account']\" *ngIf=\"!isLogin\">\n <ion-icon name=\"log-in\" slot=\"start\"></ion-icon>\n <span translate>AUTH.BTN_LOGIN</span>\n </ion-button>\n\n <ion-button expand=\"full\" color=\"secondary\" [routerLink]=\"['/account']\" *ngIf=\"isLogin\">\n <ion-icon name=\"contact\" slot=\"start\"></ion-icon>\n <span translate>HOME.BTN_MY_ACCOUNT</span>\n </ion-button>\n </ion-footer>\n </ion-card>\n\n</ion-content>\n",
20929
- styles: ["h1,h2,h3,h4,h5{white-space:normal}.bottom-banner,.center,ion-card,ion-card img,ion-content,ion-text{text-align:center;display:inline-block}ion-content{--ion-background-color:transparent;background-size:cover;display:inline-block;padding:15px}ion-card{padding:var(--ion-padding);background-color:hsla(0,0%,100%,.7);min-width:240px;max-width:400px;z-index:9}ion-card button{margin-top:16px}ion-card img{max-width:250px}.bottom-banner{padding:var(--ion-padding);background-color:hsla(0,0%,100%,.7);min-width:240px;z-index:0}.bottom-banner img.logo{max-height:50px;margin-left:8px}@media screen and (max-width:575px){ion-content ion-card{min-width:160px;width:auto;max-width:260px}ion-content ion-card img{max-width:100px;margin-left:8px}ion-content ion-card button{margin-top:8px}.bottom-banner img.logo{max-height:30px}}@media screen and (max-width:767px) and (min-width:576px){ion-content{min-height:555px}.bottom-banner img.logo{max-height:40px}}@media screen and (min-width:768px){ion-content{min-height:606px}.main-content{padding-bottom:0}.bottom-banner{position:absolute;bottom:16px;left:16px;right:16px}}"]
20929
+ styles: ["h1,h2,h3,h4,h5{white-space:normal}.bottom-banner,.center,ion-card,ion-card img,ion-content,ion-text{text-align:center;display:inline-block}ion-content{--ion-background-color:transparent;background-size:cover;display:inline-block;padding:15px}ion-card{padding:var(--ion-padding);background-color:hsla(0,0%,100%,.7);min-width:240px;max-width:400px;z-index:9}ion-card button{margin-top:16px}ion-card img{max-width:250px}.bottom-banner{padding:var(--ion-padding);background-color:hsla(0,0%,100%,.7);min-width:240px;z-index:0}.bottom-banner img.logo{max-height:50px;margin-left:8px}@media screen and (max-width:575px){ion-content ion-card{min-width:160px;width:auto;max-width:260px}ion-content ion-card img{max-width:100px;margin-left:8px}ion-content ion-card ion-footer ion-button{margin-top:8px}.bottom-banner img.logo{max-height:30px}}@media screen and (max-width:767px) and (min-width:576px){ion-content{min-height:555px}.bottom-banner img.logo{max-height:40px}}@media screen and (min-width:768px){ion-content{min-height:606px}.main-content{padding-bottom:0}.bottom-banner{position:absolute;bottom:16px;left:16px;right:16px}}"]
20930
20930
  },] }
20931
20931
  ];
20932
20932
  RegisterConfirmPage.ctorParameters = function () { return [
@@ -24616,13 +24616,8 @@
24616
24616
  // @dynamic
24617
24617
  // eslint-disable-next-line @angular-eslint/directive-class-suffix
24618
24618
  var AppTable = /** @class */ (function () {
24619
- function AppTable(route, router, platform, location, modalCtrl, settings, columns, _dataSource, _filter, injector) {
24620
- this.route = route;
24621
- this.router = router;
24622
- this.platform = platform;
24623
- this.location = location;
24624
- this.modalCtrl = modalCtrl;
24625
- this.settings = settings;
24619
+ function AppTable(injector, columns, _dataSource, _filter) {
24620
+ var _this = this;
24626
24621
  this.columns = columns;
24627
24622
  this._dataSource = _dataSource;
24628
24623
  this._filter = _filter;
@@ -24665,13 +24660,19 @@
24665
24660
  this.onDirty = new i0.EventEmitter();
24666
24661
  this.onError = new i0.EventEmitter();
24667
24662
  this._paginator = null;
24668
- this.mobile = this.platform.is('mobile');
24669
- this.translate = injector === null || injector === void 0 ? void 0 : injector.get(i1$2.TranslateService);
24670
- this.formErrorAdapter = injector === null || injector === void 0 ? void 0 : injector.get(FormErrorTranslator);
24671
- this.alertCtrl = injector === null || injector === void 0 ? void 0 : injector.get(i1$5.AlertController);
24672
- this.toastController = injector === null || injector === void 0 ? void 0 : injector.get(i1$5.ToastController);
24663
+ this.route = injector.get(i3.ActivatedRoute);
24664
+ this.router = injector.get(i3.Router);
24665
+ this.location = injector.get(i1$4.Location);
24666
+ this.settings = injector.get(LocalSettingsService);
24667
+ this.translate = injector.get(i1$2.TranslateService);
24668
+ this.modalCtrl = injector.get(i1$5.ModalController);
24669
+ this.alertCtrl = injector.get(i1$5.AlertController);
24670
+ this.toastController = injector.get(i1$5.ToastController);
24671
+ this.formErrorAdapter = injector.get(FormErrorTranslator);
24672
+ this.mobile = this.settings.mobile;
24673
+ // Autocomplete fields
24673
24674
  this._autocompleteConfigHolder = new MatAutocompleteConfigHolder({
24674
- getUserAttributes: function (a, b) { return settings.getFieldDisplayAttributes(a, b); }
24675
+ getUserAttributes: function (a, b) { return _this.settings.getFieldDisplayAttributes(a, b); }
24675
24676
  });
24676
24677
  this.autocompleteFields = this._autocompleteConfigHolder.fields;
24677
24678
  }
@@ -25058,7 +25059,7 @@
25058
25059
  rxjs.merge(
25059
25060
  // Listen sort events
25060
25061
  this.sort && this.sort.sortChange
25061
- .pipe(operators.filter(function () { return !_this.sort.disabled; }), operators.mergeMap(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_d) {
25062
+ .pipe(operators.filter(function () { return !_this.sort.disabled; }), operators.mergeMap(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_e) {
25062
25063
  return [2 /*return*/, this.saveBeforeAction('sort')];
25063
25064
  }); }); }), operators.filter(function (res) { return res === true; }),
25064
25065
  // Save sort in settings
@@ -25069,7 +25070,7 @@
25069
25070
  || rxjs.EMPTY,
25070
25071
  // Listen paginator events
25071
25072
  this.paginator && this.paginator.page
25072
- .pipe(operators.mergeMap(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_d) {
25073
+ .pipe(operators.mergeMap(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_e) {
25073
25074
  return [2 /*return*/, this.saveBeforeAction('sort')];
25074
25075
  }); }); }), operators.filter(function (res) { return res === true; }),
25075
25076
  // Save page size
@@ -25114,7 +25115,7 @@
25114
25115
  };
25115
25116
  AppTable.prototype.updateView = function (res, opts) {
25116
25117
  return __awaiter(this, void 0, void 0, function () {
25117
- return __generator(this, function (_d) {
25118
+ return __generator(this, function (_e) {
25118
25119
  if (!res)
25119
25120
  return [2 /*return*/]; // Skip (e.g error)
25120
25121
  if (res && res.data) {
@@ -25223,8 +25224,8 @@
25223
25224
  AppTable.prototype.editRowById = function (event, id, opts) {
25224
25225
  return __awaiter(this, void 0, void 0, function () {
25225
25226
  var row;
25226
- return __generator(this, function (_d) {
25227
- switch (_d.label) {
25227
+ return __generator(this, function (_e) {
25228
+ switch (_e.label) {
25228
25229
  case 0:
25229
25230
  if (id < 0)
25230
25231
  return [2 /*return*/];
@@ -25234,9 +25235,9 @@
25234
25235
  return [3 /*break*/, 3];
25235
25236
  case 1: return [4 /*yield*/, this.dataSource.getRow(id)];
25236
25237
  case 2:
25237
- row = _d.sent();
25238
+ row = _e.sent();
25238
25239
  this.editRow(event, row, opts);
25239
- _d.label = 3;
25240
+ _e.label = 3;
25240
25241
  case 3: return [2 /*return*/];
25241
25242
  }
25242
25243
  });
@@ -25321,11 +25322,11 @@
25321
25322
  return true;
25322
25323
  };
25323
25324
  AppTable.prototype.save = function (opts) {
25324
- var _a, _b;
25325
+ var _a, _b, _c, _d;
25325
25326
  return __awaiter(this, void 0, void 0, function () {
25326
25327
  var previouslyEditedData, isOK, err_1;
25327
- return __generator(this, function (_d) {
25328
- switch (_d.label) {
25328
+ return __generator(this, function (_e) {
25329
+ switch (_e.label) {
25329
25330
  case 0:
25330
25331
  opts = Object.assign({ keepEditing: this.keepEditedRowOnSave }, opts);
25331
25332
  if (this.readOnly) {
@@ -25333,27 +25334,27 @@
25333
25334
  }
25334
25335
  this.resetError();
25335
25336
  // Keep edited row id (should be done BEFORE confirmEditCreate() )
25336
- this.previouslyEditedRowId = opts.keepEditing && ((_a = this.editedRow) === null || _a === void 0 ? void 0 : _a.editing) ? this.editedRow.id : undefined;
25337
- previouslyEditedData = isNotNil(this.previouslyEditedRowId) && this.editedRow.currentData || ((_b = this.singleSelectedRow) === null || _b === void 0 ? void 0 : _b.currentData);
25337
+ this.previouslyEditedRowId = opts.keepEditing && ((((_a = this.editedRow) === null || _a === void 0 ? void 0 : _a.editing) ? this.editedRow.id : undefined) || ((_b = this.singleSelectedRow) === null || _b === void 0 ? void 0 : _b.id));
25338
+ previouslyEditedData = isNotNil(this.previouslyEditedRowId) && ((_c = this.editedRow) === null || _c === void 0 ? void 0 : _c.currentData) || ((_d = this.singleSelectedRow) === null || _d === void 0 ? void 0 : _d.currentData);
25338
25339
  if (!this.confirmEditCreate()) {
25339
25340
  throw { code: ErrorCodes$2.TABLE_INVALID_ROW_ERROR, message: 'ERROR.TABLE_INVALID_ROW_ERROR' };
25340
25341
  }
25341
25342
  // Mark as saving
25342
25343
  this.markAsSaving();
25343
- _d.label = 1;
25344
+ _e.label = 1;
25344
25345
  case 1:
25345
- _d.trys.push([1, 3, 4, 7]);
25346
+ _e.trys.push([1, 3, 4, 7]);
25346
25347
  // Calling service save()
25347
25348
  if (this.debug)
25348
25349
  console.debug('[table] Calling dataSource.save()...');
25349
25350
  return [4 /*yield*/, this._dataSource.save()];
25350
25351
  case 2:
25351
- isOK = _d.sent();
25352
+ isOK = _e.sent();
25352
25353
  if (isOK)
25353
25354
  this.markAsPristine();
25354
25355
  return [2 /*return*/, isOK];
25355
25356
  case 3:
25356
- err_1 = _d.sent();
25357
+ err_1 = _e.sent();
25357
25358
  this.setError(err_1 && err_1.message || err_1);
25358
25359
  throw err_1;
25359
25360
  case 4:
@@ -25361,8 +25362,8 @@
25361
25362
  if (!isNotNil(this.previouslyEditedRowId)) return [3 /*break*/, 6];
25362
25363
  return [4 /*yield*/, this.selectRowByIdOrData(this.previouslyEditedRowId, previouslyEditedData)];
25363
25364
  case 5:
25364
- _d.sent();
25365
- _d.label = 6;
25365
+ _e.sent();
25366
+ _e.label = 6;
25366
25367
  case 6: return [7 /*endfinally*/];
25367
25368
  case 7: return [2 /*return*/];
25368
25369
  }
@@ -25387,8 +25388,8 @@
25387
25388
  var _a;
25388
25389
  return __awaiter(this, void 0, void 0, function () {
25389
25390
  var newRow, json, newData_1;
25390
- return __generator(this, function (_d) {
25391
- switch (_d.label) {
25391
+ return __generator(this, function (_e) {
25392
+ switch (_e.label) {
25392
25393
  case 0:
25393
25394
  event === null || event === void 0 ? void 0 : event.stopPropagation();
25394
25395
  row = row || this.singleSelectedRow;
@@ -25397,7 +25398,7 @@
25397
25398
  }
25398
25399
  return [4 /*yield*/, this.addRowToTable(row.id + 1)];
25399
25400
  case 1:
25400
- newRow = _d.sent();
25401
+ newRow = _e.sent();
25401
25402
  json = Object.assign(Object.assign({}, row.currentData), { id: null });
25402
25403
  // Reset some properties (e.g. rankOrder, etc)
25403
25404
  if (opts && opts.skipProperties) {
@@ -25436,8 +25437,8 @@
25436
25437
  return __awaiter(this, void 0, void 0, function () {
25437
25438
  var rows;
25438
25439
  var _this = this;
25439
- return __generator(this, function (_d) {
25440
- switch (_d.label) {
25440
+ return __generator(this, function (_e) {
25441
+ switch (_e.label) {
25441
25442
  case 0:
25442
25443
  if (this.loading)
25443
25444
  return [2 /*return*/];
@@ -25446,9 +25447,9 @@
25446
25447
  return [3 /*break*/, 3];
25447
25448
  case 1: return [4 /*yield*/, this._dataSource.getRows()];
25448
25449
  case 2:
25449
- rows = _d.sent();
25450
+ rows = _e.sent();
25450
25451
  rows.forEach(function (row) { return _this.selection.select(row); });
25451
- _d.label = 3;
25452
+ _e.label = 3;
25452
25453
  case 3: return [2 /*return*/];
25453
25454
  }
25454
25455
  });
@@ -25466,11 +25467,11 @@
25466
25467
  AppTable.prototype.deleteRow = function (event, row, opts) {
25467
25468
  return __awaiter(this, void 0, void 0, function () {
25468
25469
  var deleteCount;
25469
- return __generator(this, function (_d) {
25470
- switch (_d.label) {
25470
+ return __generator(this, function (_e) {
25471
+ switch (_e.label) {
25471
25472
  case 0: return [4 /*yield*/, this.deleteRows(event, [row], opts)];
25472
25473
  case 1:
25473
- deleteCount = _d.sent();
25474
+ deleteCount = _e.sent();
25474
25475
  return [2 /*return*/, deleteCount === 1];
25475
25476
  }
25476
25477
  });
@@ -25487,8 +25488,8 @@
25487
25488
  return __awaiter(this, void 0, void 0, function () {
25488
25489
  var confirmed, canDelete, saved, rowsToDelete, deleteCount, err_2;
25489
25490
  var _this = this;
25490
- return __generator(this, function (_d) {
25491
- switch (_d.label) {
25491
+ return __generator(this, function (_e) {
25492
+ switch (_e.label) {
25492
25493
  case 0:
25493
25494
  if (this.readOnly) {
25494
25495
  throw { code: ErrorCodes$2.TABLE_READ_ONLY, message: 'ERROR.TABLE_READ_ONLY' };
@@ -25508,7 +25509,7 @@
25508
25509
  }
25509
25510
  return [4 /*yield*/, this.canDeleteRows(rows, opts)];
25510
25511
  case 1:
25511
- canDelete = _d.sent();
25512
+ canDelete = _e.sent();
25512
25513
  if (!canDelete)
25513
25514
  return [2 /*return*/, 0]; // Cannot delete
25514
25515
  if (!this.saveBeforeDelete) return [3 /*break*/, 3];
@@ -25530,12 +25531,12 @@
25530
25531
  return [2 /*return*/, 0];
25531
25532
  return [4 /*yield*/, this.saveBeforeAction('delete')];
25532
25533
  case 2:
25533
- saved = _d.sent();
25534
+ saved = _e.sent();
25534
25535
  if (!saved) {
25535
25536
  // Stop if save cancelled or save failed
25536
25537
  return [2 /*return*/];
25537
25538
  }
25538
- _d.label = 3;
25539
+ _e.label = 3;
25539
25540
  case 3:
25540
25541
  if (this.debug)
25541
25542
  console.debug('[table] Delete selection...');
@@ -25544,13 +25545,13 @@
25544
25545
  // This is a workaround, need because row.delete() has async execution
25545
25546
  // and index cache is updated with a delay)
25546
25547
  .sort(function (a, b) { return a.id > b.id ? -1 : 1; });
25547
- _d.label = 4;
25548
+ _e.label = 4;
25548
25549
  case 4:
25549
- _d.trys.push([4, 6, , 7]);
25550
+ _e.trys.push([4, 6, , 7]);
25550
25551
  deleteCount = rowsToDelete.length;
25551
25552
  return [4 /*yield*/, this._dataSource.deleteAll(rowsToDelete)];
25552
25553
  case 5:
25553
- _d.sent();
25554
+ _e.sent();
25554
25555
  // DO not update manually, because watchALl().subscribe() will update this count
25555
25556
  //this.totalRowCount -= deleteCount;
25556
25557
  //this.visibleRowCount -= deleteCount;
@@ -25561,7 +25562,7 @@
25561
25562
  this.onAfterDeletedRows.next(rowsToDelete);
25562
25563
  return [2 /*return*/, deleteCount];
25563
25564
  case 6:
25564
- err_2 = _d.sent();
25565
+ err_2 = _e.sent();
25565
25566
  this.setError(err_2 && err_2.message || err_2);
25566
25567
  throw err_2;
25567
25568
  case 7: return [2 /*return*/];
@@ -25572,14 +25573,14 @@
25572
25573
  AppTable.prototype.selectRowById = function (id) {
25573
25574
  return __awaiter(this, void 0, void 0, function () {
25574
25575
  var row;
25575
- return __generator(this, function (_d) {
25576
- switch (_d.label) {
25576
+ return __generator(this, function (_e) {
25577
+ switch (_e.label) {
25577
25578
  case 0:
25578
25579
  if (id === undefined)
25579
25580
  return [2 /*return*/, false];
25580
25581
  return [4 /*yield*/, this.waitIdle()];
25581
25582
  case 1:
25582
- _d.sent();
25583
+ _e.sent();
25583
25584
  row = this.dataSource.getRow(id);
25584
25585
  return [2 /*return*/, this.clickRow(null, row)];
25585
25586
  }
@@ -25594,17 +25595,17 @@
25594
25595
  return __awaiter(this, void 0, void 0, function () {
25595
25596
  var row;
25596
25597
  var _this = this;
25597
- return __generator(this, function (_d) {
25598
- switch (_d.label) {
25598
+ return __generator(this, function (_e) {
25599
+ switch (_e.label) {
25599
25600
  case 0:
25600
25601
  if (data === undefined)
25601
25602
  return [2 /*return*/, Promise.resolve(false)];
25602
25603
  return [4 /*yield*/, this.waitIdle()];
25603
25604
  case 1:
25604
- _d.sent();
25605
+ _e.sent();
25605
25606
  return [4 /*yield*/, this.dataSource.getRows()];
25606
25607
  case 2:
25607
- row = ((_d.sent()) || [])
25608
+ row = ((_e.sent()) || [])
25608
25609
  .find(function (row) { return _this.equals(row.currentData, data); });
25609
25610
  return [2 /*return*/, row && this.clickRow(null, row)];
25610
25611
  }
@@ -25646,11 +25647,11 @@
25646
25647
  };
25647
25648
  AppTable.prototype.ready = function () {
25648
25649
  return __awaiter(this, void 0, void 0, function () {
25649
- return __generator(this, function (_d) {
25650
- switch (_d.label) {
25650
+ return __generator(this, function (_e) {
25651
+ switch (_e.label) {
25651
25652
  case 0: return [4 /*yield*/, firstTruePromise(this.readySubject)];
25652
25653
  case 1:
25653
- _d.sent();
25654
+ _e.sent();
25654
25655
  return [2 /*return*/];
25655
25656
  }
25656
25657
  });
@@ -25658,11 +25659,11 @@
25658
25659
  };
25659
25660
  AppTable.prototype.waitIdle = function (opts) {
25660
25661
  return __awaiter(this, void 0, void 0, function () {
25661
- return __generator(this, function (_d) {
25662
- switch (_d.label) {
25662
+ return __generator(this, function (_e) {
25663
+ switch (_e.label) {
25663
25664
  case 0: return [4 /*yield*/, firstFalsePromise(this.loadingSubject)];
25664
25665
  case 1:
25665
- _d.sent();
25666
+ _e.sent();
25666
25667
  return [2 /*return*/];
25667
25668
  }
25668
25669
  });
@@ -25671,28 +25672,28 @@
25671
25672
  AppTable.prototype.openSelectColumnsModal = function (event) {
25672
25673
  return __awaiter(this, void 0, void 0, function () {
25673
25674
  var columns, hasTopModal, modal, data, userColumns;
25674
- return __generator(this, function (_d) {
25675
- switch (_d.label) {
25675
+ return __generator(this, function (_e) {
25676
+ switch (_e.label) {
25676
25677
  case 0:
25677
25678
  columns = this.getCurrentColumns();
25678
25679
  return [4 /*yield*/, this.modalCtrl.getTop()];
25679
25680
  case 1:
25680
- hasTopModal = !!(_d.sent());
25681
+ hasTopModal = !!(_e.sent());
25681
25682
  return [4 /*yield*/, this.modalCtrl.create({
25682
25683
  component: TableSelectColumnsComponent,
25683
25684
  componentProps: { columns: columns },
25684
25685
  cssClass: hasTopModal && 'stack-modal'
25685
25686
  })];
25686
25687
  case 2:
25687
- modal = _d.sent();
25688
+ modal = _e.sent();
25688
25689
  // Open the modal
25689
25690
  return [4 /*yield*/, modal.present()];
25690
25691
  case 3:
25691
25692
  // Open the modal
25692
- _d.sent();
25693
+ _e.sent();
25693
25694
  return [4 /*yield*/, modal.onDidDismiss()];
25694
25695
  case 4:
25695
- data = (_d.sent()).data;
25696
+ data = (_e.sent()).data;
25696
25697
  if (!data)
25697
25698
  return [2 /*return*/]; // CANCELLED
25698
25699
  userColumns = (data || []).filter(function (c) { return c.canHide === false || c.visible; }).map(function (c) { return c.name; }) || [];
@@ -25702,7 +25703,7 @@
25702
25703
  return [4 /*yield*/, this.settings.savePageSetting(this.settingsId, userColumns, SETTINGS_DISPLAY_COLUMNS)];
25703
25704
  case 5:
25704
25705
  // Update user settings
25705
- _d.sent();
25706
+ _e.sent();
25706
25707
  return [2 /*return*/];
25707
25708
  }
25708
25709
  });
@@ -25717,11 +25718,11 @@
25717
25718
  // When target wait for a complete (e.g. IonRefresher)
25718
25719
  if ((event === null || event === void 0 ? void 0 : event.target) && event.target.complete) {
25719
25720
  setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
25720
- return __generator(this, function (_d) {
25721
- switch (_d.label) {
25721
+ return __generator(this, function (_e) {
25722
+ switch (_e.label) {
25722
25723
  case 0: return [4 /*yield*/, this.waitIdle()];
25723
25724
  case 1:
25724
- _d.sent();
25725
+ _e.sent();
25725
25726
  event.target.complete();
25726
25727
  return [2 /*return*/];
25727
25728
  }
@@ -25806,33 +25807,33 @@
25806
25807
  AppTable.prototype.selectRowByIdOrData = function (id, data) {
25807
25808
  return __awaiter(this, void 0, void 0, function () {
25808
25809
  var done, err_3;
25809
- return __generator(this, function (_d) {
25810
- switch (_d.label) {
25810
+ return __generator(this, function (_e) {
25811
+ switch (_e.label) {
25811
25812
  case 0:
25812
25813
  done = false;
25813
- _d.label = 1;
25814
+ _e.label = 1;
25814
25815
  case 1:
25815
- _d.trys.push([1, 6, , 7]);
25816
+ _e.trys.push([1, 6, , 7]);
25816
25817
  if (!(isNotNil(id) || id !== -1)) return [3 /*break*/, 3];
25817
25818
  return [4 /*yield*/, this.selectRowById(id)];
25818
25819
  case 2:
25819
- done = _d.sent();
25820
+ done = _e.sent();
25820
25821
  if (done)
25821
25822
  return [2 /*return*/, true];
25822
25823
  console.warn('[app-table] Save: Cannot reselect row by row.id: ', id);
25823
- _d.label = 3;
25824
+ _e.label = 3;
25824
25825
  case 3:
25825
25826
  if (!data) return [3 /*break*/, 5];
25826
25827
  return [4 /*yield*/, this.selectRowByData(data)];
25827
25828
  case 4:
25828
- done = _d.sent();
25829
+ done = _e.sent();
25829
25830
  if (done)
25830
25831
  return [2 /*return*/, true];
25831
25832
  console.warn('[app-table] Save: Cannot reselect row by data: ', data);
25832
- _d.label = 5;
25833
+ _e.label = 5;
25833
25834
  case 5: return [2 /*return*/, false];
25834
25835
  case 6:
25835
- err_3 = _d.sent();
25836
+ err_3 = _e.sent();
25836
25837
  // Log, but continue
25837
25838
  console.error(err_3 && err_3.message || err_3);
25838
25839
  return [2 /*return*/, false];
@@ -25855,23 +25856,23 @@
25855
25856
  AppTable.prototype.canDeleteRows = function (rows, opts) {
25856
25857
  return __awaiter(this, void 0, void 0, function () {
25857
25858
  var canDelete, err_4;
25858
- return __generator(this, function (_d) {
25859
- switch (_d.label) {
25859
+ return __generator(this, function (_e) {
25860
+ switch (_e.label) {
25860
25861
  case 0:
25861
25862
  if (!(this.onBeforeDeleteRows.observers.length > 0)) return [3 /*break*/, 4];
25862
- _d.label = 1;
25863
+ _e.label = 1;
25863
25864
  case 1:
25864
- _d.trys.push([1, 3, , 4]);
25865
+ _e.trys.push([1, 3, , 4]);
25865
25866
  return [4 /*yield*/, emitPromiseEvent(this.onBeforeDeleteRows, 'canDelete', {
25866
25867
  detail: { rows: rows }
25867
25868
  })];
25868
25869
  case 2:
25869
- canDelete = _d.sent();
25870
+ canDelete = _e.sent();
25870
25871
  if (!canDelete)
25871
25872
  return [2 /*return*/, false];
25872
25873
  return [3 /*break*/, 4];
25873
25874
  case 3:
25874
- err_4 = _d.sent();
25875
+ err_4 = _e.sent();
25875
25876
  if (err_4 === 'CANCELLED')
25876
25877
  return [2 /*return*/, false]; // User cancel
25877
25878
  console.error('Error while checking if can delete rows', err_4);
@@ -25888,35 +25889,35 @@
25888
25889
  };
25889
25890
  AppTable.prototype.canCancelRows = function (rows, opts) {
25890
25891
  return __awaiter(this, void 0, void 0, function () {
25891
- var _d, isCancel, err_5;
25892
- return __generator(this, function (_e) {
25893
- switch (_e.label) {
25892
+ var _e, isCancel, err_5;
25893
+ return __generator(this, function (_f) {
25894
+ switch (_f.label) {
25894
25895
  case 0:
25895
- _d = rows;
25896
- if (_d) return [3 /*break*/, 2];
25896
+ _e = rows;
25897
+ if (_e) return [3 /*break*/, 2];
25897
25898
  return [4 /*yield*/, this.dataSource.getRows()];
25898
25899
  case 1:
25899
- _d = (_e.sent()).filter(function (row) { var _a; return (_a = row.validator) === null || _a === void 0 ? void 0 : _a.dirty; });
25900
- _e.label = 2;
25900
+ _e = (_f.sent()).filter(function (row) { var _a; return (_a = row.validator) === null || _a === void 0 ? void 0 : _a.dirty; });
25901
+ _f.label = 2;
25901
25902
  case 2:
25902
25903
  // Get dirty rows
25903
- rows = _d;
25904
+ rows = _e;
25904
25905
  if (isEmptyArray(rows))
25905
25906
  return [2 /*return*/, true]; // No dirty: OK
25906
25907
  if (!(this.onBeforeCancelRows.observers.length > 0)) return [3 /*break*/, 6];
25907
- _e.label = 3;
25908
+ _f.label = 3;
25908
25909
  case 3:
25909
- _e.trys.push([3, 5, , 6]);
25910
+ _f.trys.push([3, 5, , 6]);
25910
25911
  return [4 /*yield*/, emitPromiseEvent(this.onBeforeCancelRows, 'canCancel', {
25911
25912
  detail: { rows: rows }
25912
25913
  })];
25913
25914
  case 4:
25914
- isCancel = _e.sent();
25915
+ isCancel = _f.sent();
25915
25916
  if (!isCancel)
25916
25917
  return [2 /*return*/, false];
25917
25918
  return [3 /*break*/, 6];
25918
25919
  case 5:
25919
- err_5 = _e.sent();
25920
+ err_5 = _f.sent();
25920
25921
  if (err_5 === 'CANCELLED')
25921
25922
  return [2 /*return*/, false]; // User cancel
25922
25923
  console.error('Error while checking if can cancel rows', err_5);
@@ -25934,8 +25935,8 @@
25934
25935
  AppTable.prototype.saveBeforeAction = function (saveAction) {
25935
25936
  return __awaiter(this, void 0, void 0, function () {
25936
25937
  var save, confirmed, res, err_6, saved;
25937
- return __generator(this, function (_d) {
25938
- switch (_d.label) {
25938
+ return __generator(this, function (_e) {
25939
+ switch (_e.label) {
25939
25940
  case 0:
25940
25941
  if (!this.dirty) {
25941
25942
  // Continue without save
@@ -25957,19 +25958,19 @@
25957
25958
  confirmed = true;
25958
25959
  if (!save) return [3 /*break*/, 4];
25959
25960
  if (!(this.onBeforeSave.observers.length > 0)) return [3 /*break*/, 4];
25960
- _d.label = 1;
25961
+ _e.label = 1;
25961
25962
  case 1:
25962
- _d.trys.push([1, 3, , 4]);
25963
+ _e.trys.push([1, 3, , 4]);
25963
25964
  return [4 /*yield*/, emitPromiseEvent(this.onBeforeSave, 'beforeSave', {
25964
25965
  detail: { action: saveAction, valid: this.valid }
25965
25966
  })];
25966
25967
  case 2:
25967
- res = _d.sent();
25968
+ res = _e.sent();
25968
25969
  confirmed = res.confirmed;
25969
25970
  save = res.save;
25970
25971
  return [3 /*break*/, 4];
25971
25972
  case 3:
25972
- err_6 = _d.sent();
25973
+ err_6 = _e.sent();
25973
25974
  if (err_6 === 'CANCELLED')
25974
25975
  return [2 /*return*/, false]; // User cancel
25975
25976
  console.error('Error while checking if can delete rows', err_6);
@@ -25979,7 +25980,7 @@
25979
25980
  if (!save) return [3 /*break*/, 6];
25980
25981
  return [4 /*yield*/, this.save()];
25981
25982
  case 5:
25982
- saved = _d.sent();
25983
+ saved = _e.sent();
25983
25984
  this.markAsDirty(); // Restore dirty flag
25984
25985
  return [2 /*return*/, saved];
25985
25986
  case 6: return [2 /*return*/, true]; // No save but continue action
@@ -25997,8 +25998,8 @@
25997
25998
  */
25998
25999
  AppTable.prototype.openRow = function (id, row) {
25999
26000
  return __awaiter(this, void 0, void 0, function () {
26000
- return __generator(this, function (_d) {
26001
- switch (_d.label) {
26001
+ return __generator(this, function (_e) {
26002
+ switch (_e.label) {
26002
26003
  case 0:
26003
26004
  if (!this.allowRowDetail) return [3 /*break*/, 2];
26004
26005
  if (this.debug && this.dirty) {
@@ -26017,7 +26018,7 @@
26017
26018
  relativeTo: this.route,
26018
26019
  queryParams: {}
26019
26020
  })];
26020
- case 1: return [2 /*return*/, _d.sent()];
26021
+ case 1: return [2 /*return*/, _e.sent()];
26021
26022
  case 2: return [2 /*return*/, false];
26022
26023
  }
26023
26024
  });
@@ -26025,8 +26026,8 @@
26025
26026
  };
26026
26027
  AppTable.prototype.openNewRowDetail = function (event) {
26027
26028
  return __awaiter(this, void 0, void 0, function () {
26028
- return __generator(this, function (_d) {
26029
- switch (_d.label) {
26029
+ return __generator(this, function (_e) {
26030
+ switch (_e.label) {
26030
26031
  case 0:
26031
26032
  if (!this.allowRowDetail)
26032
26033
  return [2 /*return*/, false];
@@ -26037,7 +26038,7 @@
26037
26038
  return [4 /*yield*/, this.router.navigate(['new'], {
26038
26039
  relativeTo: this.route
26039
26040
  })];
26040
- case 1: return [2 /*return*/, _d.sent()];
26041
+ case 1: return [2 /*return*/, _e.sent()];
26041
26042
  }
26042
26043
  });
26043
26044
  });
@@ -26109,19 +26110,22 @@
26109
26110
  return (this.i18nColumnPrefix || '') + changeCaseToUnderscore(columnName).toUpperCase();
26110
26111
  };
26111
26112
  AppTable.prototype.generateTableId = function () {
26112
- return this.location.path(true).replace(/[?].*$/g, '').replace(/\/[\d]+/g, '_id') + '_' + this.constructor.name;
26113
+ var id = this.location.path(true)
26114
+ .replace(/[?].*$/g, '')
26115
+ .replace(/\/[\d]+/g, '_id')
26116
+ + '_' + this.constructor.name;
26113
26117
  //if (this.debug) console.debug("[table] id = " + id);
26114
- //return id;
26118
+ return id;
26115
26119
  };
26116
26120
  AppTable.prototype.addRowToTable = function (insertAt) {
26117
26121
  return __awaiter(this, void 0, void 0, function () {
26118
- return __generator(this, function (_d) {
26119
- switch (_d.label) {
26122
+ return __generator(this, function (_e) {
26123
+ switch (_e.label) {
26120
26124
  case 0:
26121
26125
  this.focusFirstColumn = true;
26122
26126
  return [4 /*yield*/, this._dataSource.asyncCreateNew(insertAt)];
26123
26127
  case 1:
26124
- _d.sent();
26128
+ _e.sent();
26125
26129
  this.editedRow = this._dataSource.getRow(-1);
26126
26130
  // Emit start editing event
26127
26131
  this.onStartEditingRow.emit(this.editedRow);
@@ -26185,7 +26189,7 @@
26185
26189
  };
26186
26190
  AppTable.prototype.askDeleteConfirmation = function (event, rows) {
26187
26191
  return __awaiter(this, void 0, void 0, function () {
26188
- return __generator(this, function (_d) {
26192
+ return __generator(this, function (_e) {
26189
26193
  if (this.undoableDeletion) {
26190
26194
  // Special message, for undoable deletion
26191
26195
  return [2 /*return*/, Alerts.askConfirmation((rows === null || rows === void 0 ? void 0 : rows.length) === 1 ? 'CONFIRM.DELETE_ROW' : 'CONFIRM.DELETE_ROWS', this.alertCtrl, this.translate, event)];
@@ -26197,21 +26201,21 @@
26197
26201
  };
26198
26202
  AppTable.prototype.askCancelConfirmation = function (event, rows) {
26199
26203
  return __awaiter(this, void 0, void 0, function () {
26200
- return __generator(this, function (_d) {
26204
+ return __generator(this, function (_e) {
26201
26205
  return [2 /*return*/, Alerts.askConfirmation((rows === null || rows === void 0 ? void 0 : rows.length) === 1 ? 'CONFIRM.CANCEL_ROW' : 'CONFIRM.CANCEL_ROWS', this.alertCtrl, this.translate, event)];
26202
26206
  });
26203
26207
  });
26204
26208
  };
26205
26209
  AppTable.prototype.askRestoreConfirmation = function (event) {
26206
26210
  return __awaiter(this, void 0, void 0, function () {
26207
- return __generator(this, function (_d) {
26211
+ return __generator(this, function (_e) {
26208
26212
  return [2 /*return*/, Alerts.askActionConfirmation(this.alertCtrl, this.translate, false, event)];
26209
26213
  });
26210
26214
  });
26211
26215
  };
26212
26216
  AppTable.prototype.showToast = function (opts) {
26213
26217
  return __awaiter(this, void 0, void 0, function () {
26214
- return __generator(this, function (_d) {
26218
+ return __generator(this, function (_e) {
26215
26219
  if (!this.toastController)
26216
26220
  throw new Error('Missing toastController in component\'s constructor');
26217
26221
  return [2 /*return*/, Toasts.show(this.toastController, this.translate, opts)];
@@ -26306,14 +26310,14 @@
26306
26310
  AppTable.prototype.checkIfPristine = function (opts) {
26307
26311
  return __awaiter(this, void 0, void 0, function () {
26308
26312
  var rows, pristine;
26309
- return __generator(this, function (_d) {
26310
- switch (_d.label) {
26313
+ return __generator(this, function (_e) {
26314
+ switch (_e.label) {
26311
26315
  case 0:
26312
26316
  if (!this.dirty)
26313
26317
  return [2 /*return*/]; // Already pristine
26314
26318
  return [4 /*yield*/, this._dataSource.getRows()];
26315
26319
  case 1:
26316
- rows = _d.sent();
26320
+ rows = _e.sent();
26317
26321
  pristine = (rows || []).findIndex(function (row) { var _a; return (_a = row.validator) === null || _a === void 0 ? void 0 : _a.dirty; }) === -1;
26318
26322
  if (pristine)
26319
26323
  this.markAsPristine(opts);
@@ -26406,16 +26410,10 @@
26406
26410
  { type: i0.Directive }
26407
26411
  ];
26408
26412
  AppTable.ctorParameters = function () { return [
26409
- { type: i3.ActivatedRoute },
26410
- { type: i3.Router },
26411
- { type: undefined },
26412
- { type: i1$4.Location },
26413
- { type: i1$5.ModalController },
26414
- { type: LocalSettingsService },
26413
+ { type: i0.Injector },
26415
26414
  { type: Array },
26416
26415
  { type: EntitiesTableDataSource },
26417
- { type: undefined },
26418
- { type: i0.Injector }
26416
+ { type: undefined }
26419
26417
  ]; };
26420
26418
  AppTable.propDecorators = {
26421
26419
  settingsId: [{ type: i0.Input }],
@@ -27164,7 +27162,6 @@
27164
27162
  _this.dataType = dataType;
27165
27163
  _this.dataService = dataService;
27166
27164
  _this.saving = false;
27167
- _this.hasRemoteListener = false;
27168
27165
  _this.$title = new rxjs.Subject();
27169
27166
  _this.onUpdateView = new i0.EventEmitter();
27170
27167
  options = Object.assign({
@@ -27266,6 +27263,7 @@
27266
27263
  };
27267
27264
  AppEntityEditor.prototype.ngOnDestroy = function () {
27268
27265
  _super.prototype.ngOnDestroy.call(this);
27266
+ this.listenRemoteSubscription = null; // already unsubscribe in the super function
27269
27267
  this.$title.complete();
27270
27268
  this.$title.unsubscribe();
27271
27269
  this.onUpdateView.complete();
@@ -27362,11 +27360,10 @@
27362
27360
  AppEntityEditor.prototype.startListenRemoteChanges = function () {
27363
27361
  var _this = this;
27364
27362
  // Skip if disable, or already listening
27365
- if (this.hasRemoteListener || !this._enableListenChanges || this.isNewData)
27363
+ if (this.listenRemoteSubscription || !this._enableListenChanges || this.isNewData)
27366
27364
  return;
27367
27365
  // Listen for changes on server
27368
- this.hasRemoteListener = true;
27369
- this.registerSubscription(this.dataService.listenChanges(this.data.id)
27366
+ this.listenRemoteSubscription = this.dataService.listenChanges(this.data.id)
27370
27367
  .pipe(operators.filter(isNotNil))
27371
27368
  .subscribe(function (data) {
27372
27369
  if (data.updateDate && data.updateDate.isAfter(_this.data.updateDate)) {
@@ -27380,8 +27377,16 @@
27380
27377
  console.debug("[data-editor] Changes detected on server, at {" + data.updateDate + "}, but page is dirty: skip reloading.");
27381
27378
  }
27382
27379
  }
27383
- })
27384
- .add(function () { return _this.hasRemoteListener = false; }));
27380
+ });
27381
+ this.listenRemoteSubscription.add(function () { return _this.listenRemoteSubscription = null; });
27382
+ this.registerSubscription(this.listenRemoteSubscription);
27383
+ };
27384
+ AppEntityEditor.prototype.stopListenRemoteChanges = function () {
27385
+ if (this.listenRemoteSubscription) {
27386
+ this.unregisterSubscription(this.listenRemoteSubscription);
27387
+ this.listenRemoteSubscription.unsubscribe();
27388
+ this.listenRemoteSubscription = null;
27389
+ }
27385
27390
  };
27386
27391
  AppEntityEditor.prototype.updateView = function (data, opts) {
27387
27392
  return __awaiter(this, void 0, void 0, function () {
@@ -27577,7 +27582,7 @@
27577
27582
  // Update the view (e.g metadata)
27578
27583
  _b.sent();
27579
27584
  // Subscribe to remote changes
27580
- if (!this.hasRemoteListener)
27585
+ if (!this.listenRemoteSubscription)
27581
27586
  this.startListenRemoteChanges();
27582
27587
  this.submitted = false;
27583
27588
  return [2 /*return*/, true];
@@ -27775,6 +27780,7 @@
27775
27780
  AppEntityEditor.prototype.unload = function () {
27776
27781
  return __awaiter(this, void 0, void 0, function () {
27777
27782
  return __generator(this, function (_b) {
27783
+ this.stopListenRemoteChanges();
27778
27784
  this.form.reset();
27779
27785
  this.registerForms();
27780
27786
  this._dirty = false;
@@ -27960,8 +27966,7 @@
27960
27966
  var AppInMemoryTable = /** @class */ (function (_super) {
27961
27967
  __extends(AppInMemoryTable, _super);
27962
27968
  function AppInMemoryTable(injector, columns, dataType, memoryDataService, validatorService, options, filter) {
27963
- var _this = _super.call(this, injector.get(i3.ActivatedRoute), injector.get(i3.Router), injector.get(i1$5.Platform), injector.get(i1$4.Location), injector.get(i1$5.ModalController), injector.get(LocalSettingsService), columns, new EntitiesTableDataSource(dataType, memoryDataService, validatorService, options), filter, injector) || this;
27964
- _this.injector = injector;
27969
+ var _this = _super.call(this, injector, columns, new EntitiesTableDataSource(dataType, memoryDataService, validatorService, options), filter) || this;
27965
27970
  _this.columns = columns;
27966
27971
  _this.dataType = dataType;
27967
27972
  _this.memoryDataService = memoryDataService;
@@ -28470,7 +28475,7 @@
28470
28475
  var UserEventsTable = /** @class */ (function (_super) {
28471
28476
  __extends(UserEventsTable, _super);
28472
28477
  function UserEventsTable(injector, accountService, service, entities, cd, environment) {
28473
- var _this = _super.call(this, injector.get(i3.ActivatedRoute), injector.get(i3.Router), injector.get(i1$5.Platform), injector.get(i1$4.Location), injector.get(i1$5.ModalController), injector.get(LocalSettingsService),
28478
+ var _this = _super.call(this, injector,
28474
28479
  // columns
28475
28480
  RESERVED_START_COLUMNS
28476
28481
  .concat([
@@ -28479,8 +28484,7 @@
28479
28484
  'eventType',
28480
28485
  'message'
28481
28486
  ])
28482
- .concat(RESERVED_END_COLUMNS), null, null, injector) || this;
28483
- _this.injector = injector;
28487
+ .concat(RESERVED_END_COLUMNS), null, null) || this;
28484
28488
  _this.accountService = accountService;
28485
28489
  _this.service = service;
28486
28490
  _this.entities = entities;
@@ -28878,8 +28882,8 @@
28878
28882
 
28879
28883
  var UsersPage = /** @class */ (function (_super) {
28880
28884
  __extends(UsersPage, _super);
28881
- function UsersPage(route, router, platform, location, modalCtrl, accountService, settings, validatorService, configService, dataService, cd, formBuilder, injector, environment) {
28882
- var _this = _super.call(this, route, router, platform, location, modalCtrl, settings, RESERVED_START_COLUMNS
28885
+ function UsersPage(injector, accountService, validatorService, configService, dataService, cd, formBuilder, environment) {
28886
+ var _this = _super.call(this, injector, RESERVED_START_COLUMNS
28883
28887
  .concat([
28884
28888
  'avatar',
28885
28889
  'lastName',
@@ -28898,14 +28902,8 @@
28898
28902
  dataServiceOptions: {
28899
28903
  saveOnlyDirtyRows: true
28900
28904
  }
28901
- }), null, injector) || this;
28902
- _this.route = route;
28903
- _this.router = router;
28904
- _this.platform = platform;
28905
- _this.location = location;
28906
- _this.modalCtrl = modalCtrl;
28905
+ }), null) || this;
28907
28906
  _this.accountService = accountService;
28908
- _this.settings = settings;
28909
28907
  _this.validatorService = validatorService;
28910
28908
  _this.configService = configService;
28911
28909
  _this.dataService = dataService;
@@ -29044,19 +29042,13 @@
29044
29042
  },] }
29045
29043
  ];
29046
29044
  UsersPage.ctorParameters = function () { return [
29047
- { type: i3.ActivatedRoute },
29048
- { type: i3.Router },
29049
- { type: PlatformService },
29050
- { type: i1$4.Location },
29051
- { type: i1$5.ModalController },
29045
+ { type: i0.Injector },
29052
29046
  { type: AccountService },
29053
- { type: LocalSettingsService },
29054
29047
  { type: ngxMaterialTable.ValidatorService },
29055
29048
  { type: ConfigService },
29056
29049
  { type: PersonService },
29057
29050
  { type: i0.ChangeDetectorRef },
29058
29051
  { type: i1.FormBuilder },
29059
- { type: i0.Injector },
29060
29052
  { type: undefined, decorators: [{ type: i0.Inject, args: [ENVIRONMENT,] }] }
29061
29053
  ]; };
29062
29054
  UsersPage.propDecorators = {