@ajf/material 18.0.7 → 18.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import * as i2 from '@ajf/core/reports';
2
2
  import { AjfBaseWidgetComponent, widgetToWidgetInstance, AjfWidgetType, AjfWidgetService as AjfWidgetService$1, AjfReportWidget as AjfReportWidget$1, AjfReportRenderer as AjfReportRenderer$1, AjfReportsModule as AjfReportsModule$1 } from '@ajf/core/reports';
3
3
  import * as i0 from '@angular/core';
4
- import { ViewEncapsulation, ChangeDetectionStrategy, Component, Output, Injectable, TemplateRef, ViewChild, NgModule } from '@angular/core';
4
+ import { ViewEncapsulation, ChangeDetectionStrategy, Component, EventEmitter, Output, Injectable, TemplateRef, ViewChild, NgModule } from '@angular/core';
5
5
  import * as i1 from '@ajf/core/chart';
6
6
  import { AjfChartModule } from '@ajf/core/chart';
7
7
  import * as i1$1 from '@angular/common';
@@ -99,27 +99,29 @@ class AjfFilterWidgetComponent extends AjfBaseWidgetComponent {
99
99
  super(cdr, el);
100
100
  this._ts = _ts;
101
101
  this._formRenderer = _formRenderer;
102
- this.filteredInstance = this._formRenderer.formGroup.pipe(filter(fg => this.instance != null && this.instance.filter != null && fg != null), switchMap(formGroup => formGroup.valueChanges), distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)), map(a => {
102
+ this.filterWidgetChange = new EventEmitter();
103
+ this.filteredInstance = this._formRenderer.formGroup.pipe(filter(fg => this.instance != null && this.instance.filter != null && fg != null), switchMap(formGroup => formGroup.valueChanges), distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)), map(filterContext => {
103
104
  const instance = this.instance;
104
105
  const filter = instance.filter;
105
- const newConst = { ...(filter.context || {}), ...a };
106
- if (filter.variables != null) {
107
- (filter.variables || []).forEach(variable => {
108
- newConst[variable.name] = evaluateExpression(variable.formula.formula, newConst);
109
- });
106
+ const newContext = { ...(filter.context || {}), ...filterContext };
107
+ for (const variable of filter.variables || []) {
108
+ newContext[variable.name] = evaluateExpression(variable.formula.formula, newContext);
110
109
  }
111
- this.instance = widgetToWidgetInstance(instance.widget, newConst, this._ts, filter.variables);
110
+ this.instance = widgetToWidgetInstance(instance.widget, newContext, this._ts, filter.variables);
111
+ this.filterWidgetChange.emit({ context: filterContext, widget: this.instance });
112
112
  return this.instance;
113
113
  }));
114
114
  }
115
115
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfFilterWidgetComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1$2.TranslocoService }, { token: i2$1.AjfFormRendererService }], target: i0.ɵɵFactoryTarget.Component }); }
116
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfFilterWidgetComponent, selector: "ajf-filter-widget", outputs: { filteredInstance: "filteredInstance" }, providers: [AjfFormRendererService], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"instance\">\n <div *ngIf=\"instance.filter as filter\" class=\"ajf-filter-container\">\n <ajf-form\n [form]=\"filter.form\"\n [hasStartMessage]=\"false\"\n [hasEndMessage]=\"false\"\n [hideTopToolbar]=\"true\"\n [hideBottomToolbar]=\"true\"\n [hideNavigationButtons]=\"true\"\n ></ajf-form>\n </div>\n</ng-container>\n", styles: ["ajf-filter-widget .ajf-filter-container ajf-page-slider-item{flex:auto!important}ajf-filter-widget .ajf-filter-container ajf-page-slider-item .ajf-page-slider-item-content{position:relative}ajf-filter-widget .ajf-filter-container .ajf-form-container{position:relative}ajf-filter-widget .ajf-filter-container .ajf-form-container .mat-mdc-card-header{display:none}ajf-filter-widget .ajf-field-entry{width:unset!important;min-width:200px}ajf-filter-widget mat-card{min-height:50px!important}ajf-filter-widget mat-card-content{padding:15px 15px 0!important}ajf-filter-widget mat-card-actions{display:none!important}ajf-filter-widget .mat-mdc-select-value{box-shadow:0 5px 5px -5px #0003}\n"], dependencies: [{ kind: "component", type: i3.AjfFormRenderer, selector: "ajf-form", inputs: ["topBar", "centeredFieldsContent", "maxColumns"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
116
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfFilterWidgetComponent, selector: "ajf-filter-widget", outputs: { filteredInstance: "filteredInstance", filterWidgetChange: "filterWidgetChange" }, providers: [AjfFormRendererService], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"instance\">\n <div *ngIf=\"instance.filter as filter\" class=\"ajf-filter-container\">\n <ajf-form\n [form]=\"filter.form\"\n [hasStartMessage]=\"false\"\n [hasEndMessage]=\"false\"\n [hideTopToolbar]=\"true\"\n [hideBottomToolbar]=\"true\"\n [hideNavigationButtons]=\"true\"\n ></ajf-form>\n </div>\n</ng-container>\n", styles: ["ajf-filter-widget .ajf-filter-container ajf-page-slider-item{flex:auto!important}ajf-filter-widget .ajf-filter-container ajf-page-slider-item .ajf-page-slider-item-content{position:relative}ajf-filter-widget .ajf-filter-container .ajf-form-container{position:relative}ajf-filter-widget .ajf-filter-container .ajf-form-container .mat-mdc-card-header{display:none}ajf-filter-widget .ajf-field-entry{width:unset!important;min-width:200px}ajf-filter-widget mat-card{min-height:50px!important}ajf-filter-widget mat-card-content{padding:15px 15px 0!important}ajf-filter-widget mat-card-actions{display:none!important}ajf-filter-widget .mat-mdc-select-value{box-shadow:0 5px 5px -5px #0003}\n"], dependencies: [{ kind: "component", type: i3.AjfFormRenderer, selector: "ajf-form", inputs: ["topBar", "centeredFieldsContent", "maxColumns"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
117
117
  }
118
118
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfFilterWidgetComponent, decorators: [{
119
119
  type: Component,
120
120
  args: [{ selector: 'ajf-filter-widget', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [AjfFormRendererService], template: "<ng-container *ngIf=\"instance\">\n <div *ngIf=\"instance.filter as filter\" class=\"ajf-filter-container\">\n <ajf-form\n [form]=\"filter.form\"\n [hasStartMessage]=\"false\"\n [hasEndMessage]=\"false\"\n [hideTopToolbar]=\"true\"\n [hideBottomToolbar]=\"true\"\n [hideNavigationButtons]=\"true\"\n ></ajf-form>\n </div>\n</ng-container>\n", styles: ["ajf-filter-widget .ajf-filter-container ajf-page-slider-item{flex:auto!important}ajf-filter-widget .ajf-filter-container ajf-page-slider-item .ajf-page-slider-item-content{position:relative}ajf-filter-widget .ajf-filter-container .ajf-form-container{position:relative}ajf-filter-widget .ajf-filter-container .ajf-form-container .mat-mdc-card-header{display:none}ajf-filter-widget .ajf-field-entry{width:unset!important;min-width:200px}ajf-filter-widget mat-card{min-height:50px!important}ajf-filter-widget mat-card-content{padding:15px 15px 0!important}ajf-filter-widget mat-card-actions{display:none!important}ajf-filter-widget .mat-mdc-select-value{box-shadow:0 5px 5px -5px #0003}\n"] }]
121
121
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1$2.TranslocoService }, { type: i2$1.AjfFormRendererService }], propDecorators: { filteredInstance: [{
122
122
  type: Output
123
+ }], filterWidgetChange: [{
124
+ type: Output
123
125
  }] } });
124
126
 
125
127
  /**
@@ -475,21 +477,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
475
477
  class AjfReportWidget extends AjfReportWidget$1 {
476
478
  constructor(renderer, widgetService) {
477
479
  super(renderer);
480
+ this.filterWidgetChange = new EventEmitter();
478
481
  this.widgetsMap = widgetService.componentsMap;
479
482
  }
483
+ filterWidgetChanged(changes) {
484
+ this.filterWidgetChange.emit(changes);
485
+ }
480
486
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfReportWidget, deps: [{ token: i0.Renderer2 }, { token: AjfWidgetService }], target: i0.ɵɵFactoryTarget.Component }); }
481
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfReportWidget, selector: "ajf-widget", usesInheritance: true, ngImport: i0, template: "<ajf-filter-widget\n *ngIf=\"instance && instance.filter\"\n [instance]=\"instance\"\n (filteredInstance)=\"instance = $event\"\n>\n</ajf-filter-widget>\n<ng-template ajf-widget-host></ng-template>\n", styles: ["ajf-widget{display:flex;flex:1 1 auto;box-sizing:border-box;flex-direction:column}ajf-widget>ng-component{flex:1 1 auto;display:flex;align-items:center;box-sizing:border-box;background-color:transparent}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.AjfWidgetHost, selector: "[ajf-widget-host]" }, { kind: "component", type: AjfFilterWidgetComponent, selector: "ajf-filter-widget", outputs: ["filteredInstance"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
487
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfReportWidget, selector: "ajf-widget", outputs: { filterWidgetChange: "filterWidgetChange" }, usesInheritance: true, ngImport: i0, template: "<ajf-filter-widget\n *ngIf=\"instance && instance.filter\"\n [instance]=\"instance\"\n (filteredInstance)=\"instance = $event\"\n (filterWidgetChange)=\"filterWidgetChanged($event)\"\n>\n</ajf-filter-widget>\n<ng-template ajf-widget-host></ng-template>\n", styles: ["ajf-widget{display:flex;flex:1 1 auto;box-sizing:border-box;flex-direction:column}ajf-widget>ng-component{flex:1 1 auto;display:flex;align-items:center;box-sizing:border-box;background-color:transparent}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.AjfWidgetHost, selector: "[ajf-widget-host]" }, { kind: "component", type: AjfFilterWidgetComponent, selector: "ajf-filter-widget", outputs: ["filteredInstance", "filterWidgetChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
482
488
  }
483
489
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfReportWidget, decorators: [{
484
490
  type: Component,
485
- args: [{ selector: 'ajf-widget', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ajf-filter-widget\n *ngIf=\"instance && instance.filter\"\n [instance]=\"instance\"\n (filteredInstance)=\"instance = $event\"\n>\n</ajf-filter-widget>\n<ng-template ajf-widget-host></ng-template>\n", styles: ["ajf-widget{display:flex;flex:1 1 auto;box-sizing:border-box;flex-direction:column}ajf-widget>ng-component{flex:1 1 auto;display:flex;align-items:center;box-sizing:border-box;background-color:transparent}\n"] }]
486
- }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: AjfWidgetService }] });
491
+ args: [{ selector: 'ajf-widget', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ajf-filter-widget\n *ngIf=\"instance && instance.filter\"\n [instance]=\"instance\"\n (filteredInstance)=\"instance = $event\"\n (filterWidgetChange)=\"filterWidgetChanged($event)\"\n>\n</ajf-filter-widget>\n<ng-template ajf-widget-host></ng-template>\n", styles: ["ajf-widget{display:flex;flex:1 1 auto;box-sizing:border-box;flex-direction:column}ajf-widget>ng-component{flex:1 1 auto;display:flex;align-items:center;box-sizing:border-box;background-color:transparent}\n"] }]
492
+ }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: AjfWidgetService }], propDecorators: { filterWidgetChange: [{
493
+ type: Output
494
+ }] } });
487
495
  class AjfColumnWidgetComponent extends AjfBaseWidgetComponent {
488
496
  constructor(cdr, el) {
489
497
  super(cdr, el);
490
498
  }
491
499
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfColumnWidgetComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
492
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfColumnWidgetComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"instance\" class=\"ajf-column-container\">\n <ng-container *ngFor=\"let w of instance.content\">\n <ajf-widget [instance]=\"w\">\n </ajf-widget>\n </ng-container>\n</div>\n", styles: [".ajf-column-container{width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AjfReportWidget, selector: "ajf-widget" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
500
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfColumnWidgetComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"instance\" class=\"ajf-column-container\">\n <ng-container *ngFor=\"let w of instance.content\">\n <ajf-widget [instance]=\"w\">\n </ajf-widget>\n </ng-container>\n</div>\n", styles: [".ajf-column-container{width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AjfReportWidget, selector: "ajf-widget", outputs: ["filterWidgetChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
493
501
  }
494
502
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfColumnWidgetComponent, decorators: [{
495
503
  type: Component,
@@ -506,7 +514,7 @@ class AjfLayoutWidgetComponent extends AjfBaseWidgetComponent {
506
514
  this._allcolumnsRendered$.next(true);
507
515
  }
508
516
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfLayoutWidgetComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
509
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfLayoutWidgetComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"instance\" class=\"ajf-columns\">\n <div\n *ngFor=\"let column of instance.widget.columns; let idx = index\"\n [ngStyle]=\"{'flex-grow': column > -1 ? 1 : null, 'flex-basis' : column > -1 ? (column * 100) + '%' : null}\"\n class=\"ajf-column\"\n >\n <ng-container *ngIf=\"allcolumnsRendered$|async\">\n <ajf-widget *ngIf=\"(instance|ajfGetColumnContent:idx) as cc\" [instance]=\"cc!\">\n </ajf-widget>\n </ng-container>\n </div>\n</div>\n", styles: [".ajf-columns{flex:1 1 auto;display:flex;align-items:inherit;box-sizing:border-box}.ajf-columns>.ajf-column{box-sizing:border-box;display:flex;align-items:inherit;flex-shrink:1}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: AjfReportWidget, selector: "ajf-widget" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AjfGetColumnContentPipe, name: "ajfGetColumnContent" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
517
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfLayoutWidgetComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"instance\" class=\"ajf-columns\">\n <div\n *ngFor=\"let column of instance.widget.columns; let idx = index\"\n [ngStyle]=\"{'flex-grow': column > -1 ? 1 : null, 'flex-basis' : column > -1 ? (column * 100) + '%' : null}\"\n class=\"ajf-column\"\n >\n <ng-container *ngIf=\"allcolumnsRendered$|async\">\n <ajf-widget *ngIf=\"(instance|ajfGetColumnContent:idx) as cc\" [instance]=\"cc!\">\n </ajf-widget>\n </ng-container>\n </div>\n</div>\n", styles: [".ajf-columns{flex:1 1 auto;display:flex;align-items:inherit;box-sizing:border-box}.ajf-columns>.ajf-column{box-sizing:border-box;display:flex;align-items:inherit;flex-shrink:1}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: AjfReportWidget, selector: "ajf-widget", outputs: ["filterWidgetChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AjfGetColumnContentPipe, name: "ajfGetColumnContent" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
510
518
  }
511
519
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfLayoutWidgetComponent, decorators: [{
512
520
  type: Component,
@@ -521,7 +529,7 @@ class AjfDialogWidgetComponent extends AjfBaseWidgetComponent {
521
529
  this._dialog.open(this.dialogContent);
522
530
  }
523
531
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfDialogWidgetComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i4.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
524
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfDialogWidgetComponent, selector: "ng-component", viewQueries: [{ propertyName: "dialogContent", first: true, predicate: ["dialogContent"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<a *ngIf=\"instance\" class=\"ajf-dialog-toggle\" (click)=\"openDialog()\">\n <ajf-widget [instance]=\"instance.toggle\"></ajf-widget>\n</a>\n<ng-template #dialogContent>\n <ng-container *ngIf=\"instance\">\n <ng-container *ngFor=\"let item of instance.content\">\n <ajf-widget [instance]=\"item\"></ajf-widget>\n </ng-container>\n </ng-container>\n</ng-template>\n", styles: [".ajf-dialog-toggle{display:block;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AjfReportWidget, selector: "ajf-widget" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
532
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfDialogWidgetComponent, selector: "ng-component", viewQueries: [{ propertyName: "dialogContent", first: true, predicate: ["dialogContent"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<a *ngIf=\"instance\" class=\"ajf-dialog-toggle\" (click)=\"openDialog()\">\n <ajf-widget [instance]=\"instance.toggle\"></ajf-widget>\n</a>\n<ng-template #dialogContent>\n <ng-container *ngIf=\"instance\">\n <ng-container *ngFor=\"let item of instance.content\">\n <ajf-widget [instance]=\"item\"></ajf-widget>\n </ng-container>\n </ng-container>\n</ng-template>\n", styles: [".ajf-dialog-toggle{display:block;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AjfReportWidget, selector: "ajf-widget", outputs: ["filterWidgetChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
525
533
  }
526
534
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfDialogWidgetComponent, decorators: [{
527
535
  type: Component,
@@ -600,7 +608,7 @@ class AjfPaginatedListWidgetComponent extends AjfBaseWidgetComponent {
600
608
  this._cdr.markForCheck();
601
609
  }
602
610
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfPaginatedListWidgetComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
603
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfPaginatedListWidgetComponent, selector: "ng-component", usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"ajf-paginated-list\" *ngIf=\"instance && pages > 0\">\n <div class=\"ajf-paginated-list-title-container\">\n <div class=\"ajf-paginated-list-title\">{{ instance.widget.title }}</div>\n <div class=\"ajf-spacer\"></div>\n <div class=\"ajf-paginated-list-paginator\">\n <a (click)=\"goToPage('previous')\" class=\"ajf-paginated-list-btn ajf-paginated-list-back-btn\"\n [class.ajf-paginated-list-btn-disabled]=\"canGoBackward === false\"></a>\n <div class=\"ajf-paginated-list-paginator-page\">{{ currentPage }}</div>\n <div class=\"ajf-paginated-list-paginator-separator\"></div>\n <div class=\"ajf-paginated-list-paginator-pages\">{{ pages }}</div>\n <a (click)=\"goToPage('next')\" class=\"ajf-paginated-list-btn ajf-paginated-list-forward-btn\"\n [class.ajf-paginated-list-btn-disabled]=\"canGoForward === false\"></a>\n </div>\n </div>\n <div class=\"ajf-paginated-list-item\" *ngFor=\"let item of currentContent\">\n <ajf-widget [instance]=\"item\"></ajf-widget>\n </div>\n</div>\n", styles: [".ajf-paginated-list-title-container{display:flex;align-items:center}.ajf-spacer{flex:1 0 auto}.ajf-paginated-list-btn{cursor:pointer;display:block;width:32px;height:32px;position:relative}.ajf-paginated-list-btn:after{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.ajf-paginated-list-paginator-separator{width:16px;height:32px;position:relative}.ajf-paginated-list-paginator-separator:after{width:100%;height:100%;display:flex;justify-content:center;align-items:center;content:\"/\"}.ajf-paginated-list-btn-disabled{opacity:.5;cursor:default}.ajf-paginated-list-back-btn:after{content:\"<\"}.ajf-paginated-list-forward-btn:after{content:\">\"}.ajf-paginated-list-paginator{display:flex;align-items:center}.ajf-paginated-list-paginator>*{margin:0 .5em}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AjfReportWidget, selector: "ajf-widget" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
611
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfPaginatedListWidgetComponent, selector: "ng-component", usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"ajf-paginated-list\" *ngIf=\"instance && pages > 0\">\n <div class=\"ajf-paginated-list-title-container\">\n <div class=\"ajf-paginated-list-title\">{{ instance.widget.title }}</div>\n <div class=\"ajf-spacer\"></div>\n <div class=\"ajf-paginated-list-paginator\">\n <a (click)=\"goToPage('previous')\" class=\"ajf-paginated-list-btn ajf-paginated-list-back-btn\"\n [class.ajf-paginated-list-btn-disabled]=\"canGoBackward === false\"></a>\n <div class=\"ajf-paginated-list-paginator-page\">{{ currentPage }}</div>\n <div class=\"ajf-paginated-list-paginator-separator\"></div>\n <div class=\"ajf-paginated-list-paginator-pages\">{{ pages }}</div>\n <a (click)=\"goToPage('next')\" class=\"ajf-paginated-list-btn ajf-paginated-list-forward-btn\"\n [class.ajf-paginated-list-btn-disabled]=\"canGoForward === false\"></a>\n </div>\n </div>\n <div class=\"ajf-paginated-list-item\" *ngFor=\"let item of currentContent\">\n <ajf-widget [instance]=\"item\"></ajf-widget>\n </div>\n</div>\n", styles: [".ajf-paginated-list-title-container{display:flex;align-items:center}.ajf-spacer{flex:1 0 auto}.ajf-paginated-list-btn{cursor:pointer;display:block;width:32px;height:32px;position:relative}.ajf-paginated-list-btn:after{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.ajf-paginated-list-paginator-separator{width:16px;height:32px;position:relative}.ajf-paginated-list-paginator-separator:after{width:100%;height:100%;display:flex;justify-content:center;align-items:center;content:\"/\"}.ajf-paginated-list-btn-disabled{opacity:.5;cursor:default}.ajf-paginated-list-back-btn:after{content:\"<\"}.ajf-paginated-list-forward-btn:after{content:\">\"}.ajf-paginated-list-paginator{display:flex;align-items:center}.ajf-paginated-list-paginator>*{margin:0 .5em}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AjfReportWidget, selector: "ajf-widget", outputs: ["filterWidgetChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
604
612
  }
605
613
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfPaginatedListWidgetComponent, decorators: [{
606
614
  type: Component,
@@ -768,38 +776,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
768
776
  args: [{ changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"ajf-paginated-table\" *ngIf=\"instance\">\n <div class=\"ajf-paginated-table-title-container\" *ngIf=\"pages > 0\">\n <div class=\"ajf-paginated-table-page-selector\">\n <mat-label class=\"ajf-paginated-table-page-selector-label\"\n >{{'Items per page:'|transloco}}</mat-label\n >\n <mat-select\n [value]=\"paginatorConfig.pageSize\"\n (selectionChange)=\"onPageSizeChange($event.value)\"\n >\n <mat-option\n [value]=\"pageSizeOpt\"\n *ngFor=\"let pageSizeOpt of paginatorConfig.pageSizeOptions\"\n >\n {{ pageSizeOpt }}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"ajf-spacer\"></div>\n <div class=\"ajf-paginated-table-paginator\">\n <a\n (click)=\"goToPage('previous')\"\n class=\"ajf-paginated-table-btn ajf-paginated-table-back-btn\"\n [class.ajf-paginated-table-btn-disabled]=\"canGoBackward === false\"\n ></a>\n <div class=\"ajf-paginated-table-paginator-page\">{{ currentPage }}</div>\n <div class=\"ajf-paginated-table-paginator-separator\"></div>\n <div class=\"ajf-paginated-table-paginator-pages\">{{ pages }}</div>\n <a\n (click)=\"goToPage('next')\"\n class=\"ajf-paginated-table-btn ajf-paginated-table-forward-btn\"\n [class.ajf-paginated-table-btn-disabled]=\"canGoForward === false\"\n ></a>\n </div>\n </div>\n <div class=\"ajf-paginated-table-item\">\n <ajf-widget-export\n *ngIf=\"instance\"\n [widgetType]=\"instance.widgetType\"\n [data]=\"exportableContent()\"\n [enable]=\"instance.exportable\"\n >\n <ajf-table [data]=\"currentContent\" (sortSelected)=\"sortPaginatedData($event)\"></ajf-table>\n </ajf-widget-export>\n </div>\n</div>\n", styles: ["table{border-spacing:0}table td{padding:10px}.ajf-paginated-table{width:100%;overflow-x:auto}.ajf-paginated-table table{min-width:100%}.ajf-paginated-table-page-selector{display:flex;align-items:baseline}.ajf-paginated-table-page-selector .ajf-paginated-table-page-selector-label{white-space:nowrap;margin-right:4px;font-size:.9em}.ajf-paginated-table-page-selector .mat-mdc-select{width:70px;font-size:.9em}.ajf-paginated-table-title-container{display:flex;align-items:center}.ajf-spacer{flex:1 0 auto}.ajf-paginated-table-btn{cursor:pointer;display:block;width:32px;height:32px;position:relative}.ajf-paginated-table-btn:after{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.ajf-paginated-table-paginator-separator{width:16px;height:32px;position:relative}.ajf-paginated-table-paginator-separator:after{width:100%;height:100%;display:flex;justify-content:center;align-items:center;content:\"/\"}.ajf-paginated-table-btn-disabled{opacity:.5;cursor:default}.ajf-paginated-table-back-btn:after{content:\"<\"}.ajf-paginated-table-forward-btn:after{content:\">\"}.ajf-paginated-table-paginator{display:flex;align-items:center;font-size:.9em}.ajf-paginated-table-paginator>*{margin:0 .5em}\n"] }]
769
777
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }] });
770
778
 
771
- /**
772
- * @license
773
- * Copyright (C) Gnucoop soc. coop.
774
- *
775
- * This file is part of the Advanced JSON forms (ajf).
776
- *
777
- * Advanced JSON forms (ajf) is free software: you can redistribute it and/or
778
- * modify it under the terms of the GNU Affero General Public License as
779
- * published by the Free Software Foundation, either version 3 of the License,
780
- * or (at your option) any later version.
781
- *
782
- * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
783
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
784
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
785
- * General Public License for more details.
786
- *
787
- * You should have received a copy of the GNU Affero General Public License
788
- * along with Advanced JSON forms (ajf).
789
- * If not, see http://www.gnu.org/licenses/.
790
- *
791
- */
792
779
  class AjfReportRenderer extends AjfReportRenderer$1 {
793
780
  constructor(cdr) {
794
781
  super(cdr);
782
+ this.filterWidgetChange = new EventEmitter();
783
+ }
784
+ filterWidgetChanged(changes) {
785
+ const report = this.instance;
786
+ if (report.content.content.length === 1) {
787
+ // Report likely has 1 global layout widget with a filter,
788
+ // create a copy of the report with the updated layout widget
789
+ const layout = changes.widget;
790
+ const contentContent = [layout];
791
+ const content = { ...report.content, content: contentContent };
792
+ const newReport = { ...report, content };
793
+ this.filterWidgetChange.emit({ context: changes.context, report: newReport });
794
+ }
795
+ else {
796
+ this.filterWidgetChange.emit({ context: changes.context });
797
+ }
795
798
  }
796
799
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfReportRenderer, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
797
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfReportRenderer, selector: "ajf-report", usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"instance\">\n <div *ngIf=\"instance.header\" @.disabled [applyStyles]=\"instance.header.styles\" class=\"ajf-report-header\">\n <ng-template ngFor let-instance [ngForOf]=\"instance.header.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"></ajf-widget>\n </ng-template>\n </div>\n <div *ngIf=\"instance.content\" @.disabled [applyStyles]=\"instance.content.styles\" class=\"ajf-report-content\">\n <ajf-widget-export *ngIf=\"enableExportAll\"\n [overlay]=\"false\"\n [widgets]=\"instance.content.content\"\n [enable]=\"true\"></ajf-widget-export>\n <ng-template ngFor let-instance [ngForOf]=\"instance.content.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"></ajf-widget>\n </ng-template>\n </div>\n <div *ngIf=\"instance.footer\" @.disabled [applyStyles]=\"instance.footer.styles\" class=\"ajf-report-footer\">\n <ng-template ngFor let-instance [ngForOf]=\"instance.footer.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"></ajf-widget>\n </ng-template>\n </div>\n</ng-template>", styles: ["ajf-report{display:flex;flex-direction:column;align-items:stretch;box-sizing:border-box;position:relative;width:100%}ajf-report h1,ajf-report h2,ajf-report h3,ajf-report h4,ajf-report h5,ajf-report h6,ajf-report p{padding:0;margin:0}ajf-report .ajf-loading{position:absolute;inset:0;min-height:300px;padding:100px;text-align:center;background-color:#f0f0f066;display:flex;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i1$5.ApplyStylesDirective, selector: "[applyStyles]", inputs: ["applyStyles"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.AjfWidgetExport, selector: "ajf-widget-export", inputs: ["widgetType", "data", "widgets", "overlay", "enable"] }, { kind: "component", type: AjfReportWidget, selector: "ajf-widget" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
800
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfReportRenderer, selector: "ajf-report", outputs: { filterWidgetChange: "filterWidgetChange" }, usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"instance\">\n <div *ngIf=\"instance.header\" @.disabled [applyStyles]=\"instance.header.styles\" class=\"ajf-report-header\">\n <ng-template ngFor let-instance [ngForOf]=\"instance.header.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"></ajf-widget>\n </ng-template>\n </div>\n <div *ngIf=\"instance.content\" @.disabled [applyStyles]=\"instance.content.styles\" class=\"ajf-report-content\">\n <ajf-widget-export *ngIf=\"enableExportAll\"\n [overlay]=\"false\"\n [widgets]=\"instance.content.content\"\n [enable]=\"true\"></ajf-widget-export>\n <ng-template ngFor let-instance [ngForOf]=\"instance.content.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"\n (filterWidgetChange)=\"filterWidgetChanged($event)\">\n </ajf-widget>\n </ng-template>\n </div>\n <div *ngIf=\"instance.footer\" @.disabled [applyStyles]=\"instance.footer.styles\" class=\"ajf-report-footer\">\n <ng-template ngFor let-instance [ngForOf]=\"instance.footer.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"></ajf-widget>\n </ng-template>\n </div>\n</ng-template>\n", styles: ["ajf-report{display:flex;flex-direction:column;align-items:stretch;box-sizing:border-box;position:relative;width:100%}ajf-report h1,ajf-report h2,ajf-report h3,ajf-report h4,ajf-report h5,ajf-report h6,ajf-report p{padding:0;margin:0}ajf-report .ajf-loading{position:absolute;inset:0;min-height:300px;padding:100px;text-align:center;background-color:#f0f0f066;display:flex;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i1$5.ApplyStylesDirective, selector: "[applyStyles]", inputs: ["applyStyles"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.AjfWidgetExport, selector: "ajf-widget-export", inputs: ["widgetType", "data", "widgets", "overlay", "enable"] }, { kind: "component", type: AjfReportWidget, selector: "ajf-widget", outputs: ["filterWidgetChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
798
801
  }
799
802
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfReportRenderer, decorators: [{
800
803
  type: Component,
801
- args: [{ selector: 'ajf-report', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template [ngIf]=\"instance\">\n <div *ngIf=\"instance.header\" @.disabled [applyStyles]=\"instance.header.styles\" class=\"ajf-report-header\">\n <ng-template ngFor let-instance [ngForOf]=\"instance.header.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"></ajf-widget>\n </ng-template>\n </div>\n <div *ngIf=\"instance.content\" @.disabled [applyStyles]=\"instance.content.styles\" class=\"ajf-report-content\">\n <ajf-widget-export *ngIf=\"enableExportAll\"\n [overlay]=\"false\"\n [widgets]=\"instance.content.content\"\n [enable]=\"true\"></ajf-widget-export>\n <ng-template ngFor let-instance [ngForOf]=\"instance.content.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"></ajf-widget>\n </ng-template>\n </div>\n <div *ngIf=\"instance.footer\" @.disabled [applyStyles]=\"instance.footer.styles\" class=\"ajf-report-footer\">\n <ng-template ngFor let-instance [ngForOf]=\"instance.footer.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"></ajf-widget>\n </ng-template>\n </div>\n</ng-template>", styles: ["ajf-report{display:flex;flex-direction:column;align-items:stretch;box-sizing:border-box;position:relative;width:100%}ajf-report h1,ajf-report h2,ajf-report h3,ajf-report h4,ajf-report h5,ajf-report h6,ajf-report p{padding:0;margin:0}ajf-report .ajf-loading{position:absolute;inset:0;min-height:300px;padding:100px;text-align:center;background-color:#f0f0f066;display:flex;justify-content:center}\n"] }]
802
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
804
+ args: [{ selector: 'ajf-report', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template [ngIf]=\"instance\">\n <div *ngIf=\"instance.header\" @.disabled [applyStyles]=\"instance.header.styles\" class=\"ajf-report-header\">\n <ng-template ngFor let-instance [ngForOf]=\"instance.header.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"></ajf-widget>\n </ng-template>\n </div>\n <div *ngIf=\"instance.content\" @.disabled [applyStyles]=\"instance.content.styles\" class=\"ajf-report-content\">\n <ajf-widget-export *ngIf=\"enableExportAll\"\n [overlay]=\"false\"\n [widgets]=\"instance.content.content\"\n [enable]=\"true\"></ajf-widget-export>\n <ng-template ngFor let-instance [ngForOf]=\"instance.content.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"\n (filterWidgetChange)=\"filterWidgetChanged($event)\">\n </ajf-widget>\n </ng-template>\n </div>\n <div *ngIf=\"instance.footer\" @.disabled [applyStyles]=\"instance.footer.styles\" class=\"ajf-report-footer\">\n <ng-template ngFor let-instance [ngForOf]=\"instance.footer.content\">\n <ajf-widget *ngIf=\"instance.visible\" [instance]=\"instance\"></ajf-widget>\n </ng-template>\n </div>\n</ng-template>\n", styles: ["ajf-report{display:flex;flex-direction:column;align-items:stretch;box-sizing:border-box;position:relative;width:100%}ajf-report h1,ajf-report h2,ajf-report h3,ajf-report h4,ajf-report h5,ajf-report h6,ajf-report p{padding:0;margin:0}ajf-report .ajf-loading{position:absolute;inset:0;min-height:300px;padding:100px;text-align:center;background-color:#f0f0f066;display:flex;justify-content:center}\n"] }]
805
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { filterWidgetChange: [{
806
+ type: Output
807
+ }] } });
803
808
 
804
809
  /**
805
810
  * @license