@sumaris-net/ngx-components 2.7.2-rc5 → 2.7.2-rc7

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.
@@ -37838,6 +37838,7 @@ const JobProgressionSubscription = {
37838
37838
  class JobProgressionService extends BaseGraphqlService {
37839
37839
  graphql;
37840
37840
  environment;
37841
+ jobsSubject = new BehaviorSubject([]);
37841
37842
  constructor(graphql, environment) {
37842
37843
  super(graphql, environment);
37843
37844
  this.graphql = graphql;
@@ -37846,14 +37847,23 @@ class JobProgressionService extends BaseGraphqlService {
37846
37847
  // For DEV only
37847
37848
  this._debug = environment && !environment.production;
37848
37849
  }
37849
- watchAll(options) {
37850
- return of([]); // TODO
37850
+ watchAll() {
37851
+ return this.jobsSubject.asObservable();
37851
37852
  }
37852
37853
  addJob(id, job) {
37853
- throw new Error('no implemented');
37854
+ const exists = this.jobsSubject.value.some(j => j.id === id);
37855
+ if (!exists) {
37856
+ job = job || new JobProgression(id);
37857
+ this.jobsSubject.next([...this.jobsSubject.value, job]);
37858
+ }
37854
37859
  }
37855
37860
  removeJob(id) {
37856
- throw new Error('no implemented');
37861
+ const jobs = this.jobsSubject.value;
37862
+ const index = jobs.findIndex(j => j.id === id);
37863
+ if (index !== -1) {
37864
+ jobs.splice(index, 1);
37865
+ this.jobsSubject.next(jobs);
37866
+ }
37857
37867
  }
37858
37868
  listenChanges(id, options) {
37859
37869
  if (isNil(id))
@@ -37920,6 +37930,8 @@ class JobProgressionList {
37920
37930
  constructor(popoverController) {
37921
37931
  this.popoverController = popoverController;
37922
37932
  }
37933
+ ngOnInit() {
37934
+ }
37923
37935
  async executeAction(event, action) {
37924
37936
  if (event?.defaultPrevented)
37925
37937
  return; // Skip if prevented
@@ -37938,11 +37950,11 @@ class JobProgressionList {
37938
37950
  }
37939
37951
  }
37940
37952
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: JobProgressionList, deps: [{ token: i2$1.PopoverController }], target: i0.ɵɵFactoryTarget.Component });
37941
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: JobProgressionList, selector: "app-job-progression-list", inputs: { titleI18n: "titleI18n", headerActions: "headerActions", jobProgressions: "jobProgressions" }, ngImport: i0, template: "<ion-list class=\"ion-list-popover\">\n\n <ion-row class=\"ion-list-header column\">\n <ion-col>\n <ion-label>{{titleI18n | translate}}</ion-label>\n </ion-col>\n <ion-col size=\"auto\" class=\"header-action\">\n <ion-text *ngFor=\"let action of headerActions\">\n <a (click)=\"executeAction($event, action)\" [title]=\"(action.title || action.name) |translate\">{{ action.name | translate }}</a>\n </ion-text>\n </ion-col>\n </ion-row>\n\n <ng-container>\n <ion-item *ngIf=\"jobProgressions | async | isEmptyArray\">\n {{'SOCIAL.JOB.PROGRESSION.EMPTY' | translate}}\n </ion-item>\n <app-job-progression-component\n *ngFor=\"let item$ of jobProgressions | async\"\n [jobProgression$]=\"item$\">\n </app-job-progression-component>\n </ng-container>\n\n</ion-list>\n", styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;user-select:none}.header-action{text-align:end;margin-right:8px}.header-action a{cursor:pointer;color:var(--ion-color-contrast)}.header-action a:hover{text-decoration:underline}\n"], dependencies: [{ kind: "directive", type: i2$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { kind: "component", type: i2$1.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i2$1.IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: i2$1.IonRow, selector: "ion-row" }, { kind: "component", type: i2$1.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: JobProgressionComponent, selector: "app-job-progression-component", inputs: ["showName", "jobProgression$"] }, { kind: "pipe", type: i2$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: EmptyArrayPipe, name: "isEmptyArray" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
37953
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: JobProgressionList, selector: "app-job-progression-list", inputs: { titleI18n: "titleI18n", headerActions: "headerActions", jobProgressions: "jobProgressions" }, ngImport: i0, template: "<ion-list class=\"ion-list-popover\">\n\n <ion-row class=\"ion-list-header column\">\n <ion-col>\n <ion-label>{{titleI18n | translate}}</ion-label>\n </ion-col>\n <ion-col size=\"auto\" class=\"header-action\">\n <ion-text *ngFor=\"let action of headerActions\">\n <a (click)=\"executeAction($event, action)\" [title]=\"(action.title || action.name) |translate\">{{ action.name | translate }}</a>\n </ion-text>\n </ion-col>\n </ion-row>\n\n <ng-container>\n <ion-item *rxIf=\"jobProgressions | async | isEmptyArray\">\n {{'SOCIAL.JOB.PROGRESSION.EMPTY' | translate}}\n </ion-item>\n <app-job-progression-component\n *rxFor=\"let item$ of jobProgressions\"\n [jobProgression$]=\"item$\">\n </app-job-progression-component>\n </ng-container>\n\n</ion-list>\n", styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;user-select:none}.header-action{text-align:end;margin-right:8px}.header-action a{cursor:pointer;color:var(--ion-color-contrast)}.header-action a:hover{text-decoration:underline}\n"], dependencies: [{ kind: "directive", type: i2$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2$1.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { kind: "component", type: i2$1.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i2$1.IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: i2$1.IonRow, selector: "ion-row" }, { kind: "component", type: i2$1.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "directive", type: i5$2.RxFor, selector: "[rxFor][rxForOf]", inputs: ["rxForOf", "rxForTemplate", "rxForStrategy", "rxForParent", "rxForPatchZone", "rxForTrackBy", "rxForRenderCallback"] }, { kind: "directive", type: i9.RxIf, selector: "[rxIf]", inputs: ["rxIf", "rxIfStrategy", "rxIfElse", "rxIfThen", "rxIfSuspense", "rxIfComplete", "rxIfError", "rxIfContextTrigger", "rxIfNextTrigger", "rxIfSuspenseTrigger", "rxIfErrorTrigger", "rxIfCompleteTrigger", "rxIfParent", "rxIfPatchZone", "rxIfRenderCallback"] }, { kind: "component", type: JobProgressionComponent, selector: "app-job-progression-component", inputs: ["showName", "jobProgression$"] }, { kind: "pipe", type: i2$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: EmptyArrayPipe, name: "isEmptyArray" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
37942
37954
  }
37943
37955
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: JobProgressionList, decorators: [{
37944
37956
  type: Component,
37945
- args: [{ selector: 'app-job-progression-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-list class=\"ion-list-popover\">\n\n <ion-row class=\"ion-list-header column\">\n <ion-col>\n <ion-label>{{titleI18n | translate}}</ion-label>\n </ion-col>\n <ion-col size=\"auto\" class=\"header-action\">\n <ion-text *ngFor=\"let action of headerActions\">\n <a (click)=\"executeAction($event, action)\" [title]=\"(action.title || action.name) |translate\">{{ action.name | translate }}</a>\n </ion-text>\n </ion-col>\n </ion-row>\n\n <ng-container>\n <ion-item *ngIf=\"jobProgressions | async | isEmptyArray\">\n {{'SOCIAL.JOB.PROGRESSION.EMPTY' | translate}}\n </ion-item>\n <app-job-progression-component\n *ngFor=\"let item$ of jobProgressions | async\"\n [jobProgression$]=\"item$\">\n </app-job-progression-component>\n </ng-container>\n\n</ion-list>\n", styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;user-select:none}.header-action{text-align:end;margin-right:8px}.header-action a{cursor:pointer;color:var(--ion-color-contrast)}.header-action a:hover{text-decoration:underline}\n"] }]
37957
+ args: [{ selector: 'app-job-progression-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-list class=\"ion-list-popover\">\n\n <ion-row class=\"ion-list-header column\">\n <ion-col>\n <ion-label>{{titleI18n | translate}}</ion-label>\n </ion-col>\n <ion-col size=\"auto\" class=\"header-action\">\n <ion-text *ngFor=\"let action of headerActions\">\n <a (click)=\"executeAction($event, action)\" [title]=\"(action.title || action.name) |translate\">{{ action.name | translate }}</a>\n </ion-text>\n </ion-col>\n </ion-row>\n\n <ng-container>\n <ion-item *rxIf=\"jobProgressions | async | isEmptyArray\">\n {{'SOCIAL.JOB.PROGRESSION.EMPTY' | translate}}\n </ion-item>\n <app-job-progression-component\n *rxFor=\"let item$ of jobProgressions\"\n [jobProgression$]=\"item$\">\n </app-job-progression-component>\n </ng-container>\n\n</ion-list>\n", styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;user-select:none}.header-action{text-align:end;margin-right:8px}.header-action a{cursor:pointer;color:var(--ion-color-contrast)}.header-action a:hover{text-decoration:underline}\n"] }]
37946
37958
  }], ctorParameters: () => [{ type: i2$1.PopoverController }], propDecorators: { titleI18n: [{
37947
37959
  type: Input
37948
37960
  }], headerActions: [{
@@ -37981,9 +37993,6 @@ class JobProgressionIcon extends RxState {
37981
37993
  this.popoverController = popoverController;
37982
37994
  this.cd = cd;
37983
37995
  }
37984
- set jobProgressions(jobProgressions) {
37985
- this.set('jobProgressions', () => jobProgressions);
37986
- }
37987
37996
  get jobProgressions() {
37988
37997
  return this.get('jobProgressions');
37989
37998
  }
@@ -38002,22 +38011,23 @@ class JobProgressionIcon extends RxState {
38002
38011
  const existingJobIds = state.jobProgressions?.map(job => job.value.id) || [];
38003
38012
  const result = (items || []).map(item => {
38004
38013
  remove(existingJobIds, id => id === item.id);
38005
- return this.addJob(item.id, item);
38014
+ // Add job to listen
38015
+ return this.startListenJob(item.id, item);
38006
38016
  });
38007
- // REMOVE old jobs
38017
+ // Remove old jobs
38008
38018
  if (existingJobIds.length > 0) {
38009
- existingJobIds.forEach(id => this.removeJob(id, { emitEvent: false }));
38019
+ existingJobIds.forEach(id => this.stopListenJob(id, { emitEvent: false }));
38010
38020
  }
38011
38021
  return result;
38012
38022
  });
38013
38023
  }
38014
- this._subscriptions.add(this.jobProgressions$.subscribe(value => this.set({ jobCount: value?.length || 0 })));
38015
- this._subscriptions.add(this.jobCount$.pipe(mergeMap$1((count) => iif(() => count > 0, of(true), of(false).pipe(filter(() => this.autoHide), delay(this.autoHideDelay), tap(() => {
38024
+ this.connect('jobCount', this.jobProgressions$, (s, jobs) => s.jobCount = jobs?.length || 0);
38025
+ this.connect('visible', this.jobCount$.pipe(mergeMap$1((count) => iif(() => count > 0, of(true), of(false).pipe(filter(() => this.autoHide), delay(this.autoHideDelay), tap(() => {
38016
38026
  if (this._listPopover)
38017
38027
  this._listPopover.dismiss();
38018
- }))))).subscribe(visible => this.set({ visible })));
38028
+ }))))));
38019
38029
  }
38020
- addJob(id, job) {
38030
+ startListenJob(id, job) {
38021
38031
  if (isNil(this.jobProgressionService)) {
38022
38032
  console.warn(`${this._logPrefix}No service injected. Can't add a job`);
38023
38033
  return;
@@ -38060,20 +38070,16 @@ class JobProgressionIcon extends RxState {
38060
38070
  this.jobFinished.emit(progression.id);
38061
38071
  if (this.autoRemove) {
38062
38072
  setTimeout(() => {
38063
- this.removeJob(progression.id);
38073
+ this.stopListenJob(progression.id);
38064
38074
  }, this.autoRemoveDelay);
38065
38075
  }
38066
38076
  }
38067
38077
  });
38068
38078
  this._subscriptionsById[id] = sub;
38069
38079
  this._subscriptions.add(sub);
38070
- // Add to progression
38071
- const jobProgressions = this.jobProgressions;
38072
- jobProgressions.push(result);
38073
- this.jobProgressions = jobProgressions;
38074
38080
  return result;
38075
38081
  }
38076
- removeJob(id, opts) {
38082
+ stopListenJob(id, opts) {
38077
38083
  if (this.debug) {
38078
38084
  console.debug(`${this._logPrefix}Remove job id=${id}`);
38079
38085
  }
@@ -38082,13 +38088,9 @@ class JobProgressionIcon extends RxState {
38082
38088
  this._subscriptions.remove(sub);
38083
38089
  sub.unsubscribe();
38084
38090
  }
38091
+ // Remove job from service
38092
+ this.jobProgressionService.removeJob(id);
38085
38093
  if (!opts?.emitEvent !== false) {
38086
- const progression = this.getProgression(id);
38087
- if (progression) {
38088
- const jobProgressions = this.jobProgressions;
38089
- jobProgressions.splice(jobProgressions.indexOf(progression), 1);
38090
- this.jobProgressions = jobProgressions;
38091
- }
38092
38094
  this.updateValue();
38093
38095
  }
38094
38096
  }
@@ -38145,11 +38147,11 @@ class JobProgressionIcon extends RxState {
38145
38147
  this._subscriptions.unsubscribe();
38146
38148
  }
38147
38149
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: JobProgressionIcon, deps: [{ token: APP_JOB_PROGRESSION_SERVICE, optional: true }, { token: i2$1.PopoverController }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
38148
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: JobProgressionIcon, selector: "app-job-progression-icon", inputs: { debug: "debug", titleI18n: "titleI18n", options: "options", autoHide: "autoHide", headerActions: "headerActions" }, outputs: { jobFinished: "jobFinished" }, providers: [RxState], usesInheritance: true, ngImport: i0, template: "<button\n #button\n mat-icon-button\n [title]=\"titleI18n | translate\"\n [disabled]=\"disabled\"\n *rxIf=\"visible$ | push\"\n (click)=\"showList($event)\"\n>\n <mat-icon *rxLet=\"jobCount$ | push; let jobCount\"\n [matBadge]=\"jobCount\"\n [matBadgeHidden]=\"!jobCount\"\n matBadgeColor=\"accent\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n aria-hidden=\"false\"\n >{{ disabled || jobCount ? 'schedule' : 'task_alt' }}\n </mat-icon>\n <mat-spinner\n #spinner\n *rxIf=\"jobCount$ | push\"\n class=\"floating-spinner\"\n [color]=\"color\"\n [mode]=\"mode$ | push\"\n [value]=\"value$ | push\"\n diameter=\"30\"\n strokeWidth=\"3\"\n ></mat-spinner>\n</button>\n\n", styles: [".floating-spinner{position:absolute;height:24px!important;width:24px!important;top:12px;left:12px}\n"], dependencies: [{ kind: "directive", type: i9.RxIf, selector: "[rxIf]", inputs: ["rxIf", "rxIfStrategy", "rxIfElse", "rxIfThen", "rxIfSuspense", "rxIfComplete", "rxIfError", "rxIfContextTrigger", "rxIfNextTrigger", "rxIfSuspenseTrigger", "rxIfErrorTrigger", "rxIfCompleteTrigger", "rxIfParent", "rxIfPatchZone", "rxIfRenderCallback"] }, { kind: "directive", type: i10$1.RxLet, selector: "[rxLet]", inputs: ["rxLet", "rxLetStrategy", "rxLetComplete", "rxLetError", "rxLetSuspense", "rxLetContextTrigger", "rxLetCompleteTrigger", "rxLetErrorTrigger", "rxLetSuspenseTrigger", "rxLetNextTrigger", "rxLetRenderCallback", "rxLetParent", "rxLetPatchZone"], outputs: ["rendered"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i9$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i6$6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i7$4.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: i3$1.RxPush, name: "push" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
38150
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: JobProgressionIcon, selector: "app-job-progression-icon", inputs: { debug: "debug", titleI18n: "titleI18n", options: "options", autoHide: "autoHide", headerActions: "headerActions" }, outputs: { jobFinished: "jobFinished" }, usesInheritance: true, ngImport: i0, template: "<button\n #button\n mat-icon-button\n [title]=\"titleI18n | translate\"\n [disabled]=\"disabled\"\n *rxIf=\"visible$\"\n (click)=\"showList($event)\"\n>\n <mat-icon *rxLet=\"jobCount$; let jobCount\"\n [matBadge]=\"jobCount\"\n [matBadgeHidden]=\"!jobCount\"\n matBadgeColor=\"accent\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n aria-hidden=\"false\"\n >{{ disabled || jobCount ? 'schedule' : 'task_alt' }}\n </mat-icon>\n <mat-spinner\n #spinner\n *rxIf=\"jobCount$\"\n class=\"floating-spinner\"\n [color]=\"color\"\n [mode]=\"mode$ | push\"\n [value]=\"value$ | push\"\n diameter=\"30\"\n strokeWidth=\"3\"\n ></mat-spinner>\n</button>\n\n", styles: [".floating-spinner{position:absolute;height:24px!important;width:24px!important;top:12px;left:12px}\n"], dependencies: [{ kind: "directive", type: i9.RxIf, selector: "[rxIf]", inputs: ["rxIf", "rxIfStrategy", "rxIfElse", "rxIfThen", "rxIfSuspense", "rxIfComplete", "rxIfError", "rxIfContextTrigger", "rxIfNextTrigger", "rxIfSuspenseTrigger", "rxIfErrorTrigger", "rxIfCompleteTrigger", "rxIfParent", "rxIfPatchZone", "rxIfRenderCallback"] }, { kind: "directive", type: i10$1.RxLet, selector: "[rxLet]", inputs: ["rxLet", "rxLetStrategy", "rxLetComplete", "rxLetError", "rxLetSuspense", "rxLetContextTrigger", "rxLetCompleteTrigger", "rxLetErrorTrigger", "rxLetSuspenseTrigger", "rxLetNextTrigger", "rxLetRenderCallback", "rxLetParent", "rxLetPatchZone"], outputs: ["rendered"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i9$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i6$6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i7$4.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: i3$1.RxPush, name: "push" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
38149
38151
  }
38150
38152
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: JobProgressionIcon, decorators: [{
38151
38153
  type: Component,
38152
- args: [{ selector: 'app-job-progression-icon', providers: [RxState], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n #button\n mat-icon-button\n [title]=\"titleI18n | translate\"\n [disabled]=\"disabled\"\n *rxIf=\"visible$ | push\"\n (click)=\"showList($event)\"\n>\n <mat-icon *rxLet=\"jobCount$ | push; let jobCount\"\n [matBadge]=\"jobCount\"\n [matBadgeHidden]=\"!jobCount\"\n matBadgeColor=\"accent\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n aria-hidden=\"false\"\n >{{ disabled || jobCount ? 'schedule' : 'task_alt' }}\n </mat-icon>\n <mat-spinner\n #spinner\n *rxIf=\"jobCount$ | push\"\n class=\"floating-spinner\"\n [color]=\"color\"\n [mode]=\"mode$ | push\"\n [value]=\"value$ | push\"\n diameter=\"30\"\n strokeWidth=\"3\"\n ></mat-spinner>\n</button>\n\n", styles: [".floating-spinner{position:absolute;height:24px!important;width:24px!important;top:12px;left:12px}\n"] }]
38154
+ args: [{ selector: 'app-job-progression-icon', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n #button\n mat-icon-button\n [title]=\"titleI18n | translate\"\n [disabled]=\"disabled\"\n *rxIf=\"visible$\"\n (click)=\"showList($event)\"\n>\n <mat-icon *rxLet=\"jobCount$; let jobCount\"\n [matBadge]=\"jobCount\"\n [matBadgeHidden]=\"!jobCount\"\n matBadgeColor=\"accent\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n aria-hidden=\"false\"\n >{{ disabled || jobCount ? 'schedule' : 'task_alt' }}\n </mat-icon>\n <mat-spinner\n #spinner\n *rxIf=\"jobCount$\"\n class=\"floating-spinner\"\n [color]=\"color\"\n [mode]=\"mode$ | push\"\n [value]=\"value$ | push\"\n diameter=\"30\"\n strokeWidth=\"3\"\n ></mat-spinner>\n</button>\n\n", styles: [".floating-spinner{position:absolute;height:24px!important;width:24px!important;top:12px;left:12px}\n"] }]
38153
38155
  }], ctorParameters: () => [{ type: undefined, decorators: [{
38154
38156
  type: Optional
38155
38157
  }, {
@@ -41843,17 +41845,12 @@ class JobProgressionTestingPage {
41843
41845
  job.total = 100;
41844
41846
  this.jobProgressionService.addJob(job.id, job);
41845
41847
  }
41846
- jobFinished(id) {
41847
- // setTimeout(() => {
41848
- this.jobProgressionService.removeJob(id);
41849
- // }, 5000);
41850
- }
41851
41848
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: JobProgressionTestingPage, deps: [{ token: APP_JOB_PROGRESSION_SERVICE }], target: i0.ɵɵFactoryTarget.Component });
41852
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: JobProgressionTestingPage, selector: "job-progression-testing", viewQueries: [{ propertyName: "jobProgressionIcon", first: true, predicate: ["icon"], descendants: true }], ngImport: i0, template: "<ion-toolbar color=\"primary\">\n <ion-title>Job progression</ion-title>\n</ion-toolbar>\n\n<ion-content class=\"ion-padding\">\n <p>\n <ion-button (click)=\"createJob()\">Add Job</ion-button>\n </p>\n\n <app-job-progression-icon #icon [debug]=\"true\" [options]=\"options\" (jobFinished)=\"jobFinished($event)\"></app-job-progression-icon>\n</ion-content>\n", dependencies: [{ kind: "component", type: i2$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2$1.IonContent, selector: "ion-content", inputs: ["color", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i2$1.IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: i2$1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: JobProgressionIcon, selector: "app-job-progression-icon", inputs: ["debug", "titleI18n", "options", "autoHide", "headerActions"], outputs: ["jobFinished"] }] });
41849
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: JobProgressionTestingPage, selector: "job-progression-testing", viewQueries: [{ propertyName: "jobProgressionIcon", first: true, predicate: ["icon"], descendants: true }], ngImport: i0, template: "<ion-toolbar color=\"primary\">\n <ion-title>Job progression</ion-title>\n</ion-toolbar>\n\n<ion-content class=\"ion-padding\">\n <p>\n <ion-button (click)=\"createJob()\">Add Job</ion-button>\n </p>\n\n <app-job-progression-icon #icon [debug]=\"true\" [options]=\"options\"></app-job-progression-icon>\n</ion-content>\n", dependencies: [{ kind: "component", type: i2$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2$1.IonContent, selector: "ion-content", inputs: ["color", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i2$1.IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: i2$1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: JobProgressionIcon, selector: "app-job-progression-icon", inputs: ["debug", "titleI18n", "options", "autoHide", "headerActions"], outputs: ["jobFinished"] }] });
41853
41850
  }
41854
41851
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: JobProgressionTestingPage, decorators: [{
41855
41852
  type: Component,
41856
- args: [{ selector: 'job-progression-testing', template: "<ion-toolbar color=\"primary\">\n <ion-title>Job progression</ion-title>\n</ion-toolbar>\n\n<ion-content class=\"ion-padding\">\n <p>\n <ion-button (click)=\"createJob()\">Add Job</ion-button>\n </p>\n\n <app-job-progression-icon #icon [debug]=\"true\" [options]=\"options\" (jobFinished)=\"jobFinished($event)\"></app-job-progression-icon>\n</ion-content>\n" }]
41853
+ args: [{ selector: 'job-progression-testing', template: "<ion-toolbar color=\"primary\">\n <ion-title>Job progression</ion-title>\n</ion-toolbar>\n\n<ion-content class=\"ion-padding\">\n <p>\n <ion-button (click)=\"createJob()\">Add Job</ion-button>\n </p>\n\n <app-job-progression-icon #icon [debug]=\"true\" [options]=\"options\"></app-job-progression-icon>\n</ion-content>\n" }]
41857
41854
  }], ctorParameters: () => [{ type: undefined, decorators: [{
41858
41855
  type: Inject,
41859
41856
  args: [APP_JOB_PROGRESSION_SERVICE]
@@ -42399,27 +42396,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImpor
42399
42396
  }]
42400
42397
  }] });
42401
42398
 
42402
- class JobProgressionTestService {
42403
- jobsSubject = new BehaviorSubject([]);
42404
- addJob(id, job) {
42405
- const exists = this.jobsSubject.value.some(j => j.id === id);
42406
- if (!exists) {
42407
- job = job || new JobProgression(id);
42408
- this.jobsSubject.next([...this.jobsSubject.value, job]);
42409
- }
42410
- }
42411
- removeJob(id) {
42412
- const jobs = this.jobsSubject.value;
42413
- const index = jobs.findIndex(j => j.id === id);
42414
- if (index !== -1) {
42415
- jobs.splice(index, 1);
42416
- this.jobsSubject.next(jobs);
42417
- }
42418
- }
42419
- watchAll() {
42420
- return this.jobsSubject.asObservable();
42421
- }
42422
- listenChanges(id, options) {
42399
+ class JobProgressionTestService extends JobProgressionService {
42400
+ listenChanges(id) {
42423
42401
  return interval(100).pipe(take(111), map(value => {
42424
42402
  if (value <= 10) {
42425
42403
  return {
@@ -42440,7 +42418,7 @@ class JobProgressionTestService {
42440
42418
  };
42441
42419
  }));
42442
42420
  }
42443
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: JobProgressionTestService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
42421
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: JobProgressionTestService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
42444
42422
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: JobProgressionTestService });
42445
42423
  }
42446
42424
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: JobProgressionTestService, decorators: [{