@sumaris-net/ngx-components 1.9.1 → 1.9.4

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.
@@ -14385,7 +14385,9 @@
14385
14385
  _this.cryptoService = cryptoService;
14386
14386
  _this.environment = environment;
14387
14387
  _this.typePolicies = typePolicies;
14388
- _this.connectionParams = {};
14388
+ _this.connectionParams = {
14389
+ reconnect: true
14390
+ };
14389
14391
  _this.onNetworkError = new rxjs.Subject();
14390
14392
  _this.customErrors = {};
14391
14393
  _this._debug = !environment.production;
@@ -20823,7 +20825,7 @@
20823
20825
  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
20826
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
20825
20827
  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)}}"]
20828
+ 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
20829
  },] }
20828
20830
  ];
20829
20831
  HomePage.ctorParameters = function () { return [
@@ -20926,7 +20928,7 @@
20926
20928
  { type: i0.Component, args: [{
20927
20929
  selector: 'page-register-confirm',
20928
20930
  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}}"]
20931
+ 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
20932
  },] }
20931
20933
  ];
20932
20934
  RegisterConfirmPage.ctorParameters = function () { return [
@@ -25059,7 +25061,7 @@
25059
25061
  rxjs.merge(
25060
25062
  // Listen sort events
25061
25063
  this.sort && this.sort.sortChange
25062
- .pipe(operators.filter(function () { return !_this.sort.disabled; }), operators.mergeMap(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_d) {
25064
+ .pipe(operators.filter(function () { return !_this.sort.disabled; }), operators.mergeMap(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_e) {
25063
25065
  return [2 /*return*/, this.saveBeforeAction('sort')];
25064
25066
  }); }); }), operators.filter(function (res) { return res === true; }),
25065
25067
  // Save sort in settings
@@ -25070,7 +25072,7 @@
25070
25072
  || rxjs.EMPTY,
25071
25073
  // Listen paginator events
25072
25074
  this.paginator && this.paginator.page
25073
- .pipe(operators.mergeMap(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_d) {
25075
+ .pipe(operators.mergeMap(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_e) {
25074
25076
  return [2 /*return*/, this.saveBeforeAction('sort')];
25075
25077
  }); }); }), operators.filter(function (res) { return res === true; }),
25076
25078
  // Save page size
@@ -25115,7 +25117,7 @@
25115
25117
  };
25116
25118
  AppTable.prototype.updateView = function (res, opts) {
25117
25119
  return __awaiter(this, void 0, void 0, function () {
25118
- return __generator(this, function (_d) {
25120
+ return __generator(this, function (_e) {
25119
25121
  if (!res)
25120
25122
  return [2 /*return*/]; // Skip (e.g error)
25121
25123
  if (res && res.data) {
@@ -25224,8 +25226,8 @@
25224
25226
  AppTable.prototype.editRowById = function (event, id, opts) {
25225
25227
  return __awaiter(this, void 0, void 0, function () {
25226
25228
  var row;
25227
- return __generator(this, function (_d) {
25228
- switch (_d.label) {
25229
+ return __generator(this, function (_e) {
25230
+ switch (_e.label) {
25229
25231
  case 0:
25230
25232
  if (id < 0)
25231
25233
  return [2 /*return*/];
@@ -25235,9 +25237,9 @@
25235
25237
  return [3 /*break*/, 3];
25236
25238
  case 1: return [4 /*yield*/, this.dataSource.getRow(id)];
25237
25239
  case 2:
25238
- row = _d.sent();
25240
+ row = _e.sent();
25239
25241
  this.editRow(event, row, opts);
25240
- _d.label = 3;
25242
+ _e.label = 3;
25241
25243
  case 3: return [2 /*return*/];
25242
25244
  }
25243
25245
  });
@@ -25322,11 +25324,11 @@
25322
25324
  return true;
25323
25325
  };
25324
25326
  AppTable.prototype.save = function (opts) {
25325
- var _a, _b;
25327
+ var _a, _b, _c, _d;
25326
25328
  return __awaiter(this, void 0, void 0, function () {
25327
25329
  var previouslyEditedData, isOK, err_1;
25328
- return __generator(this, function (_d) {
25329
- switch (_d.label) {
25330
+ return __generator(this, function (_e) {
25331
+ switch (_e.label) {
25330
25332
  case 0:
25331
25333
  opts = Object.assign({ keepEditing: this.keepEditedRowOnSave }, opts);
25332
25334
  if (this.readOnly) {
@@ -25334,27 +25336,27 @@
25334
25336
  }
25335
25337
  this.resetError();
25336
25338
  // Keep edited row id (should be done BEFORE confirmEditCreate() )
25337
- this.previouslyEditedRowId = opts.keepEditing && ((_a = this.editedRow) === null || _a === void 0 ? void 0 : _a.editing) ? this.editedRow.id : undefined;
25338
- previouslyEditedData = isNotNil(this.previouslyEditedRowId) && this.editedRow.currentData || ((_b = this.singleSelectedRow) === null || _b === void 0 ? void 0 : _b.currentData);
25339
+ 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));
25340
+ 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);
25339
25341
  if (!this.confirmEditCreate()) {
25340
25342
  throw { code: ErrorCodes$2.TABLE_INVALID_ROW_ERROR, message: 'ERROR.TABLE_INVALID_ROW_ERROR' };
25341
25343
  }
25342
25344
  // Mark as saving
25343
25345
  this.markAsSaving();
25344
- _d.label = 1;
25346
+ _e.label = 1;
25345
25347
  case 1:
25346
- _d.trys.push([1, 3, 4, 7]);
25348
+ _e.trys.push([1, 3, 4, 7]);
25347
25349
  // Calling service save()
25348
25350
  if (this.debug)
25349
25351
  console.debug('[table] Calling dataSource.save()...');
25350
25352
  return [4 /*yield*/, this._dataSource.save()];
25351
25353
  case 2:
25352
- isOK = _d.sent();
25354
+ isOK = _e.sent();
25353
25355
  if (isOK)
25354
25356
  this.markAsPristine();
25355
25357
  return [2 /*return*/, isOK];
25356
25358
  case 3:
25357
- err_1 = _d.sent();
25359
+ err_1 = _e.sent();
25358
25360
  this.setError(err_1 && err_1.message || err_1);
25359
25361
  throw err_1;
25360
25362
  case 4:
@@ -25362,8 +25364,8 @@
25362
25364
  if (!isNotNil(this.previouslyEditedRowId)) return [3 /*break*/, 6];
25363
25365
  return [4 /*yield*/, this.selectRowByIdOrData(this.previouslyEditedRowId, previouslyEditedData)];
25364
25366
  case 5:
25365
- _d.sent();
25366
- _d.label = 6;
25367
+ _e.sent();
25368
+ _e.label = 6;
25367
25369
  case 6: return [7 /*endfinally*/];
25368
25370
  case 7: return [2 /*return*/];
25369
25371
  }
@@ -25388,8 +25390,8 @@
25388
25390
  var _a;
25389
25391
  return __awaiter(this, void 0, void 0, function () {
25390
25392
  var newRow, json, newData_1;
25391
- return __generator(this, function (_d) {
25392
- switch (_d.label) {
25393
+ return __generator(this, function (_e) {
25394
+ switch (_e.label) {
25393
25395
  case 0:
25394
25396
  event === null || event === void 0 ? void 0 : event.stopPropagation();
25395
25397
  row = row || this.singleSelectedRow;
@@ -25398,7 +25400,7 @@
25398
25400
  }
25399
25401
  return [4 /*yield*/, this.addRowToTable(row.id + 1)];
25400
25402
  case 1:
25401
- newRow = _d.sent();
25403
+ newRow = _e.sent();
25402
25404
  json = Object.assign(Object.assign({}, row.currentData), { id: null });
25403
25405
  // Reset some properties (e.g. rankOrder, etc)
25404
25406
  if (opts && opts.skipProperties) {
@@ -25437,8 +25439,8 @@
25437
25439
  return __awaiter(this, void 0, void 0, function () {
25438
25440
  var rows;
25439
25441
  var _this = this;
25440
- return __generator(this, function (_d) {
25441
- switch (_d.label) {
25442
+ return __generator(this, function (_e) {
25443
+ switch (_e.label) {
25442
25444
  case 0:
25443
25445
  if (this.loading)
25444
25446
  return [2 /*return*/];
@@ -25447,9 +25449,9 @@
25447
25449
  return [3 /*break*/, 3];
25448
25450
  case 1: return [4 /*yield*/, this._dataSource.getRows()];
25449
25451
  case 2:
25450
- rows = _d.sent();
25452
+ rows = _e.sent();
25451
25453
  rows.forEach(function (row) { return _this.selection.select(row); });
25452
- _d.label = 3;
25454
+ _e.label = 3;
25453
25455
  case 3: return [2 /*return*/];
25454
25456
  }
25455
25457
  });
@@ -25467,11 +25469,11 @@
25467
25469
  AppTable.prototype.deleteRow = function (event, row, opts) {
25468
25470
  return __awaiter(this, void 0, void 0, function () {
25469
25471
  var deleteCount;
25470
- return __generator(this, function (_d) {
25471
- switch (_d.label) {
25472
+ return __generator(this, function (_e) {
25473
+ switch (_e.label) {
25472
25474
  case 0: return [4 /*yield*/, this.deleteRows(event, [row], opts)];
25473
25475
  case 1:
25474
- deleteCount = _d.sent();
25476
+ deleteCount = _e.sent();
25475
25477
  return [2 /*return*/, deleteCount === 1];
25476
25478
  }
25477
25479
  });
@@ -25488,8 +25490,8 @@
25488
25490
  return __awaiter(this, void 0, void 0, function () {
25489
25491
  var confirmed, canDelete, saved, rowsToDelete, deleteCount, err_2;
25490
25492
  var _this = this;
25491
- return __generator(this, function (_d) {
25492
- switch (_d.label) {
25493
+ return __generator(this, function (_e) {
25494
+ switch (_e.label) {
25493
25495
  case 0:
25494
25496
  if (this.readOnly) {
25495
25497
  throw { code: ErrorCodes$2.TABLE_READ_ONLY, message: 'ERROR.TABLE_READ_ONLY' };
@@ -25509,7 +25511,7 @@
25509
25511
  }
25510
25512
  return [4 /*yield*/, this.canDeleteRows(rows, opts)];
25511
25513
  case 1:
25512
- canDelete = _d.sent();
25514
+ canDelete = _e.sent();
25513
25515
  if (!canDelete)
25514
25516
  return [2 /*return*/, 0]; // Cannot delete
25515
25517
  if (!this.saveBeforeDelete) return [3 /*break*/, 3];
@@ -25531,12 +25533,12 @@
25531
25533
  return [2 /*return*/, 0];
25532
25534
  return [4 /*yield*/, this.saveBeforeAction('delete')];
25533
25535
  case 2:
25534
- saved = _d.sent();
25536
+ saved = _e.sent();
25535
25537
  if (!saved) {
25536
25538
  // Stop if save cancelled or save failed
25537
25539
  return [2 /*return*/];
25538
25540
  }
25539
- _d.label = 3;
25541
+ _e.label = 3;
25540
25542
  case 3:
25541
25543
  if (this.debug)
25542
25544
  console.debug('[table] Delete selection...');
@@ -25545,13 +25547,13 @@
25545
25547
  // This is a workaround, need because row.delete() has async execution
25546
25548
  // and index cache is updated with a delay)
25547
25549
  .sort(function (a, b) { return a.id > b.id ? -1 : 1; });
25548
- _d.label = 4;
25550
+ _e.label = 4;
25549
25551
  case 4:
25550
- _d.trys.push([4, 6, , 7]);
25552
+ _e.trys.push([4, 6, , 7]);
25551
25553
  deleteCount = rowsToDelete.length;
25552
25554
  return [4 /*yield*/, this._dataSource.deleteAll(rowsToDelete)];
25553
25555
  case 5:
25554
- _d.sent();
25556
+ _e.sent();
25555
25557
  // DO not update manually, because watchALl().subscribe() will update this count
25556
25558
  //this.totalRowCount -= deleteCount;
25557
25559
  //this.visibleRowCount -= deleteCount;
@@ -25562,7 +25564,7 @@
25562
25564
  this.onAfterDeletedRows.next(rowsToDelete);
25563
25565
  return [2 /*return*/, deleteCount];
25564
25566
  case 6:
25565
- err_2 = _d.sent();
25567
+ err_2 = _e.sent();
25566
25568
  this.setError(err_2 && err_2.message || err_2);
25567
25569
  throw err_2;
25568
25570
  case 7: return [2 /*return*/];
@@ -25573,14 +25575,14 @@
25573
25575
  AppTable.prototype.selectRowById = function (id) {
25574
25576
  return __awaiter(this, void 0, void 0, function () {
25575
25577
  var row;
25576
- return __generator(this, function (_d) {
25577
- switch (_d.label) {
25578
+ return __generator(this, function (_e) {
25579
+ switch (_e.label) {
25578
25580
  case 0:
25579
25581
  if (id === undefined)
25580
25582
  return [2 /*return*/, false];
25581
25583
  return [4 /*yield*/, this.waitIdle()];
25582
25584
  case 1:
25583
- _d.sent();
25585
+ _e.sent();
25584
25586
  row = this.dataSource.getRow(id);
25585
25587
  return [2 /*return*/, this.clickRow(null, row)];
25586
25588
  }
@@ -25595,17 +25597,17 @@
25595
25597
  return __awaiter(this, void 0, void 0, function () {
25596
25598
  var row;
25597
25599
  var _this = this;
25598
- return __generator(this, function (_d) {
25599
- switch (_d.label) {
25600
+ return __generator(this, function (_e) {
25601
+ switch (_e.label) {
25600
25602
  case 0:
25601
25603
  if (data === undefined)
25602
25604
  return [2 /*return*/, Promise.resolve(false)];
25603
25605
  return [4 /*yield*/, this.waitIdle()];
25604
25606
  case 1:
25605
- _d.sent();
25607
+ _e.sent();
25606
25608
  return [4 /*yield*/, this.dataSource.getRows()];
25607
25609
  case 2:
25608
- row = ((_d.sent()) || [])
25610
+ row = ((_e.sent()) || [])
25609
25611
  .find(function (row) { return _this.equals(row.currentData, data); });
25610
25612
  return [2 /*return*/, row && this.clickRow(null, row)];
25611
25613
  }
@@ -25647,11 +25649,11 @@
25647
25649
  };
25648
25650
  AppTable.prototype.ready = function () {
25649
25651
  return __awaiter(this, void 0, void 0, function () {
25650
- return __generator(this, function (_d) {
25651
- switch (_d.label) {
25652
+ return __generator(this, function (_e) {
25653
+ switch (_e.label) {
25652
25654
  case 0: return [4 /*yield*/, firstTruePromise(this.readySubject)];
25653
25655
  case 1:
25654
- _d.sent();
25656
+ _e.sent();
25655
25657
  return [2 /*return*/];
25656
25658
  }
25657
25659
  });
@@ -25659,11 +25661,11 @@
25659
25661
  };
25660
25662
  AppTable.prototype.waitIdle = function (opts) {
25661
25663
  return __awaiter(this, void 0, void 0, function () {
25662
- return __generator(this, function (_d) {
25663
- switch (_d.label) {
25664
+ return __generator(this, function (_e) {
25665
+ switch (_e.label) {
25664
25666
  case 0: return [4 /*yield*/, firstFalsePromise(this.loadingSubject)];
25665
25667
  case 1:
25666
- _d.sent();
25668
+ _e.sent();
25667
25669
  return [2 /*return*/];
25668
25670
  }
25669
25671
  });
@@ -25672,28 +25674,28 @@
25672
25674
  AppTable.prototype.openSelectColumnsModal = function (event) {
25673
25675
  return __awaiter(this, void 0, void 0, function () {
25674
25676
  var columns, hasTopModal, modal, data, userColumns;
25675
- return __generator(this, function (_d) {
25676
- switch (_d.label) {
25677
+ return __generator(this, function (_e) {
25678
+ switch (_e.label) {
25677
25679
  case 0:
25678
25680
  columns = this.getCurrentColumns();
25679
25681
  return [4 /*yield*/, this.modalCtrl.getTop()];
25680
25682
  case 1:
25681
- hasTopModal = !!(_d.sent());
25683
+ hasTopModal = !!(_e.sent());
25682
25684
  return [4 /*yield*/, this.modalCtrl.create({
25683
25685
  component: TableSelectColumnsComponent,
25684
25686
  componentProps: { columns: columns },
25685
25687
  cssClass: hasTopModal && 'stack-modal'
25686
25688
  })];
25687
25689
  case 2:
25688
- modal = _d.sent();
25690
+ modal = _e.sent();
25689
25691
  // Open the modal
25690
25692
  return [4 /*yield*/, modal.present()];
25691
25693
  case 3:
25692
25694
  // Open the modal
25693
- _d.sent();
25695
+ _e.sent();
25694
25696
  return [4 /*yield*/, modal.onDidDismiss()];
25695
25697
  case 4:
25696
- data = (_d.sent()).data;
25698
+ data = (_e.sent()).data;
25697
25699
  if (!data)
25698
25700
  return [2 /*return*/]; // CANCELLED
25699
25701
  userColumns = (data || []).filter(function (c) { return c.canHide === false || c.visible; }).map(function (c) { return c.name; }) || [];
@@ -25703,7 +25705,7 @@
25703
25705
  return [4 /*yield*/, this.settings.savePageSetting(this.settingsId, userColumns, SETTINGS_DISPLAY_COLUMNS)];
25704
25706
  case 5:
25705
25707
  // Update user settings
25706
- _d.sent();
25708
+ _e.sent();
25707
25709
  return [2 /*return*/];
25708
25710
  }
25709
25711
  });
@@ -25718,11 +25720,11 @@
25718
25720
  // When target wait for a complete (e.g. IonRefresher)
25719
25721
  if ((event === null || event === void 0 ? void 0 : event.target) && event.target.complete) {
25720
25722
  setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
25721
- return __generator(this, function (_d) {
25722
- switch (_d.label) {
25723
+ return __generator(this, function (_e) {
25724
+ switch (_e.label) {
25723
25725
  case 0: return [4 /*yield*/, this.waitIdle()];
25724
25726
  case 1:
25725
- _d.sent();
25727
+ _e.sent();
25726
25728
  event.target.complete();
25727
25729
  return [2 /*return*/];
25728
25730
  }
@@ -25807,33 +25809,33 @@
25807
25809
  AppTable.prototype.selectRowByIdOrData = function (id, data) {
25808
25810
  return __awaiter(this, void 0, void 0, function () {
25809
25811
  var done, err_3;
25810
- return __generator(this, function (_d) {
25811
- switch (_d.label) {
25812
+ return __generator(this, function (_e) {
25813
+ switch (_e.label) {
25812
25814
  case 0:
25813
25815
  done = false;
25814
- _d.label = 1;
25816
+ _e.label = 1;
25815
25817
  case 1:
25816
- _d.trys.push([1, 6, , 7]);
25818
+ _e.trys.push([1, 6, , 7]);
25817
25819
  if (!(isNotNil(id) || id !== -1)) return [3 /*break*/, 3];
25818
25820
  return [4 /*yield*/, this.selectRowById(id)];
25819
25821
  case 2:
25820
- done = _d.sent();
25822
+ done = _e.sent();
25821
25823
  if (done)
25822
25824
  return [2 /*return*/, true];
25823
25825
  console.warn('[app-table] Save: Cannot reselect row by row.id: ', id);
25824
- _d.label = 3;
25826
+ _e.label = 3;
25825
25827
  case 3:
25826
25828
  if (!data) return [3 /*break*/, 5];
25827
25829
  return [4 /*yield*/, this.selectRowByData(data)];
25828
25830
  case 4:
25829
- done = _d.sent();
25831
+ done = _e.sent();
25830
25832
  if (done)
25831
25833
  return [2 /*return*/, true];
25832
25834
  console.warn('[app-table] Save: Cannot reselect row by data: ', data);
25833
- _d.label = 5;
25835
+ _e.label = 5;
25834
25836
  case 5: return [2 /*return*/, false];
25835
25837
  case 6:
25836
- err_3 = _d.sent();
25838
+ err_3 = _e.sent();
25837
25839
  // Log, but continue
25838
25840
  console.error(err_3 && err_3.message || err_3);
25839
25841
  return [2 /*return*/, false];
@@ -25856,23 +25858,23 @@
25856
25858
  AppTable.prototype.canDeleteRows = function (rows, opts) {
25857
25859
  return __awaiter(this, void 0, void 0, function () {
25858
25860
  var canDelete, err_4;
25859
- return __generator(this, function (_d) {
25860
- switch (_d.label) {
25861
+ return __generator(this, function (_e) {
25862
+ switch (_e.label) {
25861
25863
  case 0:
25862
25864
  if (!(this.onBeforeDeleteRows.observers.length > 0)) return [3 /*break*/, 4];
25863
- _d.label = 1;
25865
+ _e.label = 1;
25864
25866
  case 1:
25865
- _d.trys.push([1, 3, , 4]);
25867
+ _e.trys.push([1, 3, , 4]);
25866
25868
  return [4 /*yield*/, emitPromiseEvent(this.onBeforeDeleteRows, 'canDelete', {
25867
25869
  detail: { rows: rows }
25868
25870
  })];
25869
25871
  case 2:
25870
- canDelete = _d.sent();
25872
+ canDelete = _e.sent();
25871
25873
  if (!canDelete)
25872
25874
  return [2 /*return*/, false];
25873
25875
  return [3 /*break*/, 4];
25874
25876
  case 3:
25875
- err_4 = _d.sent();
25877
+ err_4 = _e.sent();
25876
25878
  if (err_4 === 'CANCELLED')
25877
25879
  return [2 /*return*/, false]; // User cancel
25878
25880
  console.error('Error while checking if can delete rows', err_4);
@@ -25889,35 +25891,35 @@
25889
25891
  };
25890
25892
  AppTable.prototype.canCancelRows = function (rows, opts) {
25891
25893
  return __awaiter(this, void 0, void 0, function () {
25892
- var _d, isCancel, err_5;
25893
- return __generator(this, function (_e) {
25894
- switch (_e.label) {
25894
+ var _e, isCancel, err_5;
25895
+ return __generator(this, function (_f) {
25896
+ switch (_f.label) {
25895
25897
  case 0:
25896
- _d = rows;
25897
- if (_d) return [3 /*break*/, 2];
25898
+ _e = rows;
25899
+ if (_e) return [3 /*break*/, 2];
25898
25900
  return [4 /*yield*/, this.dataSource.getRows()];
25899
25901
  case 1:
25900
- _d = (_e.sent()).filter(function (row) { var _a; return (_a = row.validator) === null || _a === void 0 ? void 0 : _a.dirty; });
25901
- _e.label = 2;
25902
+ _e = (_f.sent()).filter(function (row) { var _a; return (_a = row.validator) === null || _a === void 0 ? void 0 : _a.dirty; });
25903
+ _f.label = 2;
25902
25904
  case 2:
25903
25905
  // Get dirty rows
25904
- rows = _d;
25906
+ rows = _e;
25905
25907
  if (isEmptyArray(rows))
25906
25908
  return [2 /*return*/, true]; // No dirty: OK
25907
25909
  if (!(this.onBeforeCancelRows.observers.length > 0)) return [3 /*break*/, 6];
25908
- _e.label = 3;
25910
+ _f.label = 3;
25909
25911
  case 3:
25910
- _e.trys.push([3, 5, , 6]);
25912
+ _f.trys.push([3, 5, , 6]);
25911
25913
  return [4 /*yield*/, emitPromiseEvent(this.onBeforeCancelRows, 'canCancel', {
25912
25914
  detail: { rows: rows }
25913
25915
  })];
25914
25916
  case 4:
25915
- isCancel = _e.sent();
25917
+ isCancel = _f.sent();
25916
25918
  if (!isCancel)
25917
25919
  return [2 /*return*/, false];
25918
25920
  return [3 /*break*/, 6];
25919
25921
  case 5:
25920
- err_5 = _e.sent();
25922
+ err_5 = _f.sent();
25921
25923
  if (err_5 === 'CANCELLED')
25922
25924
  return [2 /*return*/, false]; // User cancel
25923
25925
  console.error('Error while checking if can cancel rows', err_5);
@@ -25935,8 +25937,8 @@
25935
25937
  AppTable.prototype.saveBeforeAction = function (saveAction) {
25936
25938
  return __awaiter(this, void 0, void 0, function () {
25937
25939
  var save, confirmed, res, err_6, saved;
25938
- return __generator(this, function (_d) {
25939
- switch (_d.label) {
25940
+ return __generator(this, function (_e) {
25941
+ switch (_e.label) {
25940
25942
  case 0:
25941
25943
  if (!this.dirty) {
25942
25944
  // Continue without save
@@ -25958,19 +25960,19 @@
25958
25960
  confirmed = true;
25959
25961
  if (!save) return [3 /*break*/, 4];
25960
25962
  if (!(this.onBeforeSave.observers.length > 0)) return [3 /*break*/, 4];
25961
- _d.label = 1;
25963
+ _e.label = 1;
25962
25964
  case 1:
25963
- _d.trys.push([1, 3, , 4]);
25965
+ _e.trys.push([1, 3, , 4]);
25964
25966
  return [4 /*yield*/, emitPromiseEvent(this.onBeforeSave, 'beforeSave', {
25965
25967
  detail: { action: saveAction, valid: this.valid }
25966
25968
  })];
25967
25969
  case 2:
25968
- res = _d.sent();
25970
+ res = _e.sent();
25969
25971
  confirmed = res.confirmed;
25970
25972
  save = res.save;
25971
25973
  return [3 /*break*/, 4];
25972
25974
  case 3:
25973
- err_6 = _d.sent();
25975
+ err_6 = _e.sent();
25974
25976
  if (err_6 === 'CANCELLED')
25975
25977
  return [2 /*return*/, false]; // User cancel
25976
25978
  console.error('Error while checking if can delete rows', err_6);
@@ -25980,7 +25982,7 @@
25980
25982
  if (!save) return [3 /*break*/, 6];
25981
25983
  return [4 /*yield*/, this.save()];
25982
25984
  case 5:
25983
- saved = _d.sent();
25985
+ saved = _e.sent();
25984
25986
  this.markAsDirty(); // Restore dirty flag
25985
25987
  return [2 /*return*/, saved];
25986
25988
  case 6: return [2 /*return*/, true]; // No save but continue action
@@ -25998,8 +26000,8 @@
25998
26000
  */
25999
26001
  AppTable.prototype.openRow = function (id, row) {
26000
26002
  return __awaiter(this, void 0, void 0, function () {
26001
- return __generator(this, function (_d) {
26002
- switch (_d.label) {
26003
+ return __generator(this, function (_e) {
26004
+ switch (_e.label) {
26003
26005
  case 0:
26004
26006
  if (!this.allowRowDetail) return [3 /*break*/, 2];
26005
26007
  if (this.debug && this.dirty) {
@@ -26018,7 +26020,7 @@
26018
26020
  relativeTo: this.route,
26019
26021
  queryParams: {}
26020
26022
  })];
26021
- case 1: return [2 /*return*/, _d.sent()];
26023
+ case 1: return [2 /*return*/, _e.sent()];
26022
26024
  case 2: return [2 /*return*/, false];
26023
26025
  }
26024
26026
  });
@@ -26026,8 +26028,8 @@
26026
26028
  };
26027
26029
  AppTable.prototype.openNewRowDetail = function (event) {
26028
26030
  return __awaiter(this, void 0, void 0, function () {
26029
- return __generator(this, function (_d) {
26030
- switch (_d.label) {
26031
+ return __generator(this, function (_e) {
26032
+ switch (_e.label) {
26031
26033
  case 0:
26032
26034
  if (!this.allowRowDetail)
26033
26035
  return [2 /*return*/, false];
@@ -26038,7 +26040,7 @@
26038
26040
  return [4 /*yield*/, this.router.navigate(['new'], {
26039
26041
  relativeTo: this.route
26040
26042
  })];
26041
- case 1: return [2 /*return*/, _d.sent()];
26043
+ case 1: return [2 /*return*/, _e.sent()];
26042
26044
  }
26043
26045
  });
26044
26046
  });
@@ -26119,13 +26121,13 @@
26119
26121
  };
26120
26122
  AppTable.prototype.addRowToTable = function (insertAt) {
26121
26123
  return __awaiter(this, void 0, void 0, function () {
26122
- return __generator(this, function (_d) {
26123
- switch (_d.label) {
26124
+ return __generator(this, function (_e) {
26125
+ switch (_e.label) {
26124
26126
  case 0:
26125
26127
  this.focusFirstColumn = true;
26126
26128
  return [4 /*yield*/, this._dataSource.asyncCreateNew(insertAt)];
26127
26129
  case 1:
26128
- _d.sent();
26130
+ _e.sent();
26129
26131
  this.editedRow = this._dataSource.getRow(-1);
26130
26132
  // Emit start editing event
26131
26133
  this.onStartEditingRow.emit(this.editedRow);
@@ -26189,7 +26191,7 @@
26189
26191
  };
26190
26192
  AppTable.prototype.askDeleteConfirmation = function (event, rows) {
26191
26193
  return __awaiter(this, void 0, void 0, function () {
26192
- return __generator(this, function (_d) {
26194
+ return __generator(this, function (_e) {
26193
26195
  if (this.undoableDeletion) {
26194
26196
  // Special message, for undoable deletion
26195
26197
  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)];
@@ -26201,21 +26203,21 @@
26201
26203
  };
26202
26204
  AppTable.prototype.askCancelConfirmation = function (event, rows) {
26203
26205
  return __awaiter(this, void 0, void 0, function () {
26204
- return __generator(this, function (_d) {
26206
+ return __generator(this, function (_e) {
26205
26207
  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)];
26206
26208
  });
26207
26209
  });
26208
26210
  };
26209
26211
  AppTable.prototype.askRestoreConfirmation = function (event) {
26210
26212
  return __awaiter(this, void 0, void 0, function () {
26211
- return __generator(this, function (_d) {
26213
+ return __generator(this, function (_e) {
26212
26214
  return [2 /*return*/, Alerts.askActionConfirmation(this.alertCtrl, this.translate, false, event)];
26213
26215
  });
26214
26216
  });
26215
26217
  };
26216
26218
  AppTable.prototype.showToast = function (opts) {
26217
26219
  return __awaiter(this, void 0, void 0, function () {
26218
- return __generator(this, function (_d) {
26220
+ return __generator(this, function (_e) {
26219
26221
  if (!this.toastController)
26220
26222
  throw new Error('Missing toastController in component\'s constructor');
26221
26223
  return [2 /*return*/, Toasts.show(this.toastController, this.translate, opts)];
@@ -26310,14 +26312,14 @@
26310
26312
  AppTable.prototype.checkIfPristine = function (opts) {
26311
26313
  return __awaiter(this, void 0, void 0, function () {
26312
26314
  var rows, pristine;
26313
- return __generator(this, function (_d) {
26314
- switch (_d.label) {
26315
+ return __generator(this, function (_e) {
26316
+ switch (_e.label) {
26315
26317
  case 0:
26316
26318
  if (!this.dirty)
26317
26319
  return [2 /*return*/]; // Already pristine
26318
26320
  return [4 /*yield*/, this._dataSource.getRows()];
26319
26321
  case 1:
26320
- rows = _d.sent();
26322
+ rows = _e.sent();
26321
26323
  pristine = (rows || []).findIndex(function (row) { var _a; return (_a = row.validator) === null || _a === void 0 ? void 0 : _a.dirty; }) === -1;
26322
26324
  if (pristine)
26323
26325
  this.markAsPristine(opts);
@@ -27162,7 +27164,6 @@
27162
27164
  _this.dataType = dataType;
27163
27165
  _this.dataService = dataService;
27164
27166
  _this.saving = false;
27165
- _this.hasRemoteListener = false;
27166
27167
  _this.$title = new rxjs.Subject();
27167
27168
  _this.onUpdateView = new i0.EventEmitter();
27168
27169
  options = Object.assign({
@@ -27264,6 +27265,7 @@
27264
27265
  };
27265
27266
  AppEntityEditor.prototype.ngOnDestroy = function () {
27266
27267
  _super.prototype.ngOnDestroy.call(this);
27268
+ this.listenRemoteSubscription = null; // already unsubscribe in the super function
27267
27269
  this.$title.complete();
27268
27270
  this.$title.unsubscribe();
27269
27271
  this.onUpdateView.complete();
@@ -27360,11 +27362,10 @@
27360
27362
  AppEntityEditor.prototype.startListenRemoteChanges = function () {
27361
27363
  var _this = this;
27362
27364
  // Skip if disable, or already listening
27363
- if (this.hasRemoteListener || !this._enableListenChanges || this.isNewData)
27365
+ if (this.listenRemoteSubscription || !this._enableListenChanges || this.isNewData)
27364
27366
  return;
27365
27367
  // Listen for changes on server
27366
- this.hasRemoteListener = true;
27367
- this.registerSubscription(this.dataService.listenChanges(this.data.id)
27368
+ this.listenRemoteSubscription = this.dataService.listenChanges(this.data.id)
27368
27369
  .pipe(operators.filter(isNotNil))
27369
27370
  .subscribe(function (data) {
27370
27371
  if (data.updateDate && data.updateDate.isAfter(_this.data.updateDate)) {
@@ -27378,8 +27379,16 @@
27378
27379
  console.debug("[data-editor] Changes detected on server, at {" + data.updateDate + "}, but page is dirty: skip reloading.");
27379
27380
  }
27380
27381
  }
27381
- })
27382
- .add(function () { return _this.hasRemoteListener = false; }));
27382
+ });
27383
+ this.listenRemoteSubscription.add(function () { return _this.listenRemoteSubscription = null; });
27384
+ this.registerSubscription(this.listenRemoteSubscription);
27385
+ };
27386
+ AppEntityEditor.prototype.stopListenRemoteChanges = function () {
27387
+ if (this.listenRemoteSubscription) {
27388
+ this.unregisterSubscription(this.listenRemoteSubscription);
27389
+ this.listenRemoteSubscription.unsubscribe();
27390
+ this.listenRemoteSubscription = null;
27391
+ }
27383
27392
  };
27384
27393
  AppEntityEditor.prototype.updateView = function (data, opts) {
27385
27394
  return __awaiter(this, void 0, void 0, function () {
@@ -27575,7 +27584,7 @@
27575
27584
  // Update the view (e.g metadata)
27576
27585
  _b.sent();
27577
27586
  // Subscribe to remote changes
27578
- if (!this.hasRemoteListener)
27587
+ if (!this.listenRemoteSubscription)
27579
27588
  this.startListenRemoteChanges();
27580
27589
  this.submitted = false;
27581
27590
  return [2 /*return*/, true];
@@ -27773,6 +27782,7 @@
27773
27782
  AppEntityEditor.prototype.unload = function () {
27774
27783
  return __awaiter(this, void 0, void 0, function () {
27775
27784
  return __generator(this, function (_b) {
27785
+ this.stopListenRemoteChanges();
27776
27786
  this.form.reset();
27777
27787
  this.registerForms();
27778
27788
  this._dirty = false;