@elderbyte/ngx-starter 14.4.0-beta.18 → 14.4.0-beta.20

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.
Files changed (47) hide show
  1. package/esm2020/lib/components/data-view/base/data-view-options-provider-binding.mjs +63 -0
  2. package/esm2020/lib/components/data-view/base/elder-data-view-base.mjs +53 -10
  3. package/esm2020/lib/components/data-view/base/elder-data-view-options-provider.mjs +44 -0
  4. package/esm2020/lib/components/data-view/base/elder-data-view-options.mjs +42 -0
  5. package/esm2020/lib/components/data-view/base/public_api.mjs +5 -0
  6. package/esm2020/lib/components/data-view/grid/elder-grid/elder-grid.component.mjs +8 -22
  7. package/esm2020/lib/components/data-view/public_api.mjs +2 -2
  8. package/esm2020/lib/components/data-view/table/elder-table/elder-table.component.mjs +9 -43
  9. package/esm2020/lib/components/forms/directives/elder-form-field-label.directive.mjs +31 -18
  10. package/esm2020/lib/components/i18n/entities/elder-localized-input-table/elder-localized-input-table.component.mjs +1 -1
  11. package/esm2020/lib/components/iframes/data-view/data-view-iframe/data-view-iframe.component.mjs +119 -0
  12. package/esm2020/lib/components/iframes/data-view/data-view-iframe-adapter.directive.mjs +137 -0
  13. package/esm2020/lib/components/iframes/elder-iframe.module.mjs +18 -6
  14. package/esm2020/lib/components/iframes/iframe-dialog/iframe-dialog.component.mjs +1 -1
  15. package/esm2020/lib/components/iframes/iframe-host/iframe-host.component.mjs +56 -30
  16. package/esm2020/lib/components/iframes/iframe-side-content/iframe-side-content.component.mjs +1 -1
  17. package/esm2020/lib/components/iframes/iframe.service.mjs +2 -2
  18. package/esm2020/lib/components/iframes/typed-event-message.mjs +42 -0
  19. package/esm2020/lib/components/select/elder-select.module.mjs +2 -2
  20. package/esm2020/lib/components/select/popup/selection-model-popup.directive.mjs +21 -39
  21. package/fesm2015/elderbyte-ngx-starter.mjs +1782 -1350
  22. package/fesm2015/elderbyte-ngx-starter.mjs.map +1 -1
  23. package/fesm2020/elderbyte-ngx-starter.mjs +1766 -1336
  24. package/fesm2020/elderbyte-ngx-starter.mjs.map +1 -1
  25. package/lib/components/data-view/base/data-view-options-provider-binding.d.ts +39 -0
  26. package/lib/components/data-view/base/elder-data-view-base.d.ts +29 -6
  27. package/lib/components/data-view/base/elder-data-view-options-provider.d.ts +38 -0
  28. package/lib/components/data-view/base/elder-data-view-options.d.ts +33 -0
  29. package/lib/components/data-view/base/public_api.d.ts +4 -0
  30. package/lib/components/data-view/grid/elder-grid/elder-grid.component.d.ts +4 -6
  31. package/lib/components/data-view/public_api.d.ts +1 -1
  32. package/lib/components/data-view/table/elder-table/elder-table.component.d.ts +5 -19
  33. package/lib/components/forms/directives/elder-form-field-label.directive.d.ts +19 -6
  34. package/lib/components/iframes/data-view/data-view-iframe/data-view-iframe.component.d.ts +66 -0
  35. package/lib/components/iframes/data-view/data-view-iframe-adapter.directive.d.ts +62 -0
  36. package/lib/components/iframes/elder-iframe.module.d.ts +14 -10
  37. package/lib/components/iframes/iframe-host/iframe-host.component.d.ts +28 -10
  38. package/lib/components/iframes/iframe.service.d.ts +3 -3
  39. package/lib/components/iframes/typed-event-message.d.ts +26 -0
  40. package/lib/components/select/elder-select.module.d.ts +1 -1
  41. package/lib/components/select/popup/selection-model-popup.directive.d.ts +7 -27
  42. package/package.json +1 -1
  43. package/src/lib/components/iframes/data-view/data-view-iframe/data-view-iframe.component.scss +0 -0
  44. package/esm2020/lib/components/data-view/base/elder-data-view-base.module.mjs +0 -18
  45. package/esm2020/lib/components/iframes/iframe-message.mjs +0 -2
  46. package/lib/components/data-view/base/elder-data-view-base.module.d.ts +0 -9
  47. package/lib/components/iframes/iframe-message.d.ts +0 -5
@@ -37,7 +37,7 @@ import { FlexLayoutModule, FlexModule } from '@angular/flex-layout';
37
37
  import * as i5 from '@angular/material/button';
38
38
  import { MatButtonModule } from '@angular/material/button';
39
39
  import * as i5$1 from '@angular/material/input';
40
- import { MatInputModule, MatInput } from '@angular/material/input';
40
+ import { MatInputModule } from '@angular/material/input';
41
41
  import * as i1$5 from '@angular/material/autocomplete';
42
42
  import { MatAutocompleteModule } from '@angular/material/autocomplete';
43
43
  import * as i6 from '@angular/material/core';
@@ -10949,383 +10949,200 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
10949
10949
 
10950
10950
  const ELDER_DATA_VIEW = new InjectionToken('Elder Data View');
10951
10951
 
10952
- class ElderDialogConfig {
10953
- }
10954
-
10955
- class ConfirmDialogConfig extends ElderDialogConfig {
10956
- }
10957
- class ElderConfirmDialogComponent {
10958
- constructor(dialogRef) {
10959
- this.dialogRef = dialogRef;
10960
- this.yesNo = false;
10961
- }
10962
- }
10963
- ElderConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderConfirmDialogComponent, deps: [{ token: i1$7.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
10964
- ElderConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderConfirmDialogComponent, selector: "elder-confirm-dialog", ngImport: i0, template: "\n<h2 matDialogTitle translate>{{ title }}</h2>\n\n\n<mat-dialog-content>\n <p translate>{{ message }}</p>\n</mat-dialog-content>\n\n\n<mat-dialog-actions fxLayoutAlign=\"end center\" cdkTrapFocus>\n\n <button type=\"button\" mat-button\n (click)=\"dialogRef.close(false)\">\n {{ (yesNo ? \"actions.no\" : \"actions.cancel\") | translate}}\n </button>\n\n <button type=\"submit\" mat-raised-button cdkFocusInitial\n (click)=\"dialogRef.close(true)\">\n {{ (yesNo ? \"actions.yes\" : \"actions.ok\") | translate}}\n </button>\n\n</mat-dialog-actions>\n\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$7.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$7.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
10965
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderConfirmDialogComponent, decorators: [{
10966
- type: Component,
10967
- args: [{ selector: 'elder-confirm-dialog', template: "\n<h2 matDialogTitle translate>{{ title }}</h2>\n\n\n<mat-dialog-content>\n <p translate>{{ message }}</p>\n</mat-dialog-content>\n\n\n<mat-dialog-actions fxLayoutAlign=\"end center\" cdkTrapFocus>\n\n <button type=\"button\" mat-button\n (click)=\"dialogRef.close(false)\">\n {{ (yesNo ? \"actions.no\" : \"actions.cancel\") | translate}}\n </button>\n\n <button type=\"submit\" mat-raised-button cdkFocusInitial\n (click)=\"dialogRef.close(true)\">\n {{ (yesNo ? \"actions.yes\" : \"actions.ok\") | translate}}\n </button>\n\n</mat-dialog-actions>\n\n" }]
10968
- }], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }]; } });
10969
-
10970
- class QuestionDialogConfig extends ElderDialogConfig {
10971
- }
10972
- class ElderQuestionDialogComponent {
10973
- constructor(dialogRef, data) {
10974
- this.dialogRef = dialogRef;
10975
- this.data = data;
10976
- }
10977
- ngOnInit() {
10978
- }
10979
- confirm(event) {
10980
- this.dialogRef.close(this.answer);
10981
- }
10982
- cancel(event) {
10983
- this.dialogRef.close();
10984
- }
10985
- get isValid() {
10986
- return !!this.answer;
10987
- }
10988
- }
10989
- ElderQuestionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderQuestionDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
10990
- ElderQuestionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderQuestionDialogComponent, selector: "elder-question-dialog", ngImport: i0, template: "<h2 matDialogTitle translate>{{ data.title }}</h2>\n\n<form #f=\"ngForm\" fxLayout=\"column\" (ngSubmit)=\"confirm($event)\" cdkTrapFocus>\n\n <mat-dialog-content>\n <p>{{data.question}}</p>\n\n <mat-form-field class=\"full-width\">\n <input matInput type=\"text\" name=\"name\" [(ngModel)]=\"answer\" cdkFocusInitial\n placeholder=\"{{'context.name' | translate}}\" required>\n </mat-form-field>\n </mat-dialog-content>\n\n <mat-dialog-actions fxLayoutAlign=\"end center\" >\n\n <button mat-button type=\"button\"\n (click)=\"cancel($event)\">\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-button type=\"submit\" color=\"primary\"\n [disabled]=\"!isValid\">\n {{'actions.ok' | translate}}\n </button>\n\n </mat-dialog-actions>\n\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$7.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$7.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
10991
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderQuestionDialogComponent, decorators: [{
10992
- type: Component,
10993
- args: [{ selector: 'elder-question-dialog', template: "<h2 matDialogTitle translate>{{ data.title }}</h2>\n\n<form #f=\"ngForm\" fxLayout=\"column\" (ngSubmit)=\"confirm($event)\" cdkTrapFocus>\n\n <mat-dialog-content>\n <p>{{data.question}}</p>\n\n <mat-form-field class=\"full-width\">\n <input matInput type=\"text\" name=\"name\" [(ngModel)]=\"answer\" cdkFocusInitial\n placeholder=\"{{'context.name' | translate}}\" required>\n </mat-form-field>\n </mat-dialog-content>\n\n <mat-dialog-actions fxLayoutAlign=\"end center\" >\n\n <button mat-button type=\"button\"\n (click)=\"cancel($event)\">\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-button type=\"submit\" color=\"primary\"\n [disabled]=\"!isValid\">\n {{'actions.ok' | translate}}\n </button>\n\n </mat-dialog-actions>\n\n</form>\n" }]
10994
- }], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
10995
- type: Inject,
10996
- args: [MAT_DIALOG_DATA]
10997
- }] }]; } });
10998
-
10999
- class ElderDialogService {
10952
+ class DataViewOptionsProviderBinding {
11000
10953
  /***************************************************************************
11001
10954
  * *
11002
10955
  * Constructor *
11003
10956
  * *
11004
10957
  **************************************************************************/
11005
- constructor(dialog, translateService) {
11006
- this.dialog = dialog;
11007
- this.translateService = translateService;
10958
+ constructor(_dataViewBaseComponent) {
10959
+ this._dataViewBaseComponent = _dataViewBaseComponent;
11008
10960
  /***************************************************************************
11009
10961
  * *
11010
10962
  * Fields *
11011
10963
  * *
11012
10964
  **************************************************************************/
11013
- this.defaultDialogConfig = {
11014
- role: 'dialog',
11015
- disableClose: false,
11016
- autoFocus: true,
11017
- restoreFocus: true,
11018
- closeOnNavigation: false
11019
- };
10965
+ this.log = LoggerFactory.getLogger(this.constructor.name);
10966
+ if (_dataViewBaseComponent == null) {
10967
+ throw new Error('dataViewBaseComponent must not be null!');
10968
+ }
11020
10969
  }
11021
10970
  /***************************************************************************
11022
10971
  * *
11023
- * Public API *
10972
+ * Static Builder *
11024
10973
  * *
11025
10974
  **************************************************************************/
11026
- /**
11027
- * @deprecated Use showConfirm({...}) instead
11028
- *
11029
- * @param title
11030
- * @param message
11031
- * @param config
11032
- */
11033
- confirm(title, message, config) {
11034
- return this.showConfirm({
11035
- title: title,
11036
- message: message,
11037
- config: config || this.defaultDialogConfig
11038
- });
10975
+ static of(dataViewBaseComponent) {
10976
+ return new DataViewOptionsProviderBinding(dataViewBaseComponent);
11039
10977
  }
11040
- /**
11041
- * Creates a modal confirmation dialog.
11042
- *
11043
- * @param config object for conform dialog
11044
- */
11045
- showConfirm(config) {
11046
- if (!config) {
11047
- throw new Error('Argument must not be null: config');
10978
+ /***************************************************************************
10979
+ * *
10980
+ * Public API *
10981
+ * *
10982
+ **************************************************************************/
10983
+ dataViewOptionsProvider(optionsProvider) {
10984
+ if (!optionsProvider) {
10985
+ throw new Error('dataViewSelection must not be null!');
11048
10986
  }
11049
- const rawMessages = new Map();
11050
- rawMessages.set('title', config.title);
11051
- rawMessages.set('message', config.message);
11052
- return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
11053
- const title = messages.get('title');
11054
- const message = messages.get('message');
11055
- let dialogRef;
11056
- dialogRef = this.dialog.open(ElderConfirmDialogComponent, config.config);
11057
- dialogRef.componentInstance.title = title;
11058
- dialogRef.componentInstance.message = message;
11059
- dialogRef.componentInstance.yesNo = config.yesNo;
11060
- return dialogRef.afterClosed();
11061
- }));
11062
- }
11063
- /**
11064
- * @deprecated Use showQuestion({...}) instead
11065
- *
11066
- * Creates a modal question dialog.
11067
- *
11068
- * @param title
11069
- * @param question
11070
- * @param config
11071
- */
11072
- question(title, question, config) {
11073
- return this.showQuestion({
11074
- title: title,
11075
- question: question,
11076
- config: config || this.defaultDialogConfig
11077
- });
10987
+ this._optionsProvider = optionsProvider;
10988
+ return this;
11078
10989
  }
11079
- /**
11080
- * Creates a modal question dialog.
11081
- *
11082
- * @param config
11083
- */
11084
- showQuestion(config) {
11085
- if (!config) {
11086
- throw new Error('Argument must not be null: config');
10990
+ bindUntil(unsubscribe$) {
10991
+ if (!this._optionsProvider) {
10992
+ throw new Error('DataView must be defined to start binding. Use .dataView(dataView)!');
11087
10993
  }
11088
- const rawMessages = new Map();
11089
- rawMessages.set('title', config.title);
11090
- rawMessages.set('question', config.question);
11091
- return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
11092
- const title = messages.get('title');
11093
- const question = messages.get('question');
11094
- const dlgConf = config.config || new MatDialogConfig();
11095
- dlgConf.data = {
11096
- title: title,
11097
- question: question
11098
- };
11099
- const dialogRef = this.dialog.open(ElderQuestionDialogComponent, dlgConf);
11100
- return dialogRef.afterClosed()
11101
- .pipe(filter(response => !!response));
11102
- }));
10994
+ this._optionsProvider.options$.pipe(takeUntil(unsubscribe$)).subscribe(options => this.applyOptions(options));
10995
+ return this;
11103
10996
  }
11104
10997
  /***************************************************************************
11105
10998
  * *
11106
- * Private methods *
10999
+ * Private Methods *
11107
11000
  * *
11108
11001
  **************************************************************************/
11109
- resolveTranslatedMap(messages, interpolateParams) {
11110
- const rawMessages = Array.from(messages.values());
11111
- return this.translateInterpolatedParams(interpolateParams).pipe(switchMap(translatedParams => this.translateService.get(rawMessages, translatedParams)), map(translatedValues => {
11112
- const translated = new Map();
11113
- messages.forEach((rawValue, key) => {
11114
- translated.set(key, translatedValues[rawValue] || rawValue);
11115
- });
11116
- return translated;
11117
- }));
11118
- }
11119
- /**
11120
- * Translates a list of params
11121
- *
11122
- * @param interpolateParams
11123
- */
11124
- translateInterpolatedParams(interpolateParams) {
11125
- if (!interpolateParams) {
11126
- return of({});
11002
+ applyOptions(options) {
11003
+ const dataCtx = this._dataViewBaseComponent.dataContext;
11004
+ if (dataCtx) {
11005
+ dataCtx.filter.updateFilters(options.filters);
11006
+ dataCtx.sort.updateSorts(options.sorts);
11127
11007
  }
11128
- const values = Object.getOwnPropertyNames(interpolateParams)
11129
- .map(key => interpolateParams[key])
11130
- .filter(value => !!value)
11131
- .map(value => value + '');
11132
- return this.translateService.get(values).pipe(map(translated => {
11133
- Object.getOwnPropertyNames(interpolateParams)
11134
- .forEach(key => {
11135
- const value = interpolateParams[key];
11136
- interpolateParams[key] = translated[value];
11137
- });
11138
- return interpolateParams;
11139
- }));
11008
+ this._dataViewBaseComponent.interactionMode = options.interactionMode;
11009
+ this._dataViewBaseComponent.selectionMultiEnabled = options.selectionMultiEnabled;
11140
11010
  }
11141
11011
  }
11142
- ElderDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, deps: [{ token: i1$7.MatDialog }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
11143
- ElderDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, providedIn: 'root' });
11144
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, decorators: [{
11145
- type: Injectable,
11146
- args: [{
11147
- providedIn: 'root'
11148
- }]
11149
- }], ctorParameters: function () { return [{ type: i1$7.MatDialog }, { type: i2.TranslateService }]; } });
11150
11012
 
11151
- class ElderSelectionDialogComponent {
11013
+ /**
11014
+ * Options for supporting data view components.
11015
+ */
11016
+ class ElderDataViewOptions {
11017
+ /***************************************************************************
11018
+ * *
11019
+ * Fields *
11020
+ * *
11021
+ **************************************************************************/
11152
11022
  /***************************************************************************
11153
11023
  * *
11154
11024
  * Constructor *
11155
11025
  * *
11156
11026
  **************************************************************************/
11157
- constructor(dialogRef, data) {
11158
- this.dialogRef = dialogRef;
11159
- this.data = data;
11027
+ constructor(sorts, filters, selectionMultiEnabled, interactionMode) {
11028
+ this.sorts = sorts;
11029
+ this.filters = filters;
11030
+ this.selectionMultiEnabled = selectionMultiEnabled;
11031
+ this.interactionMode = interactionMode;
11160
11032
  }
11161
- ngOnInit() {
11033
+ static defaultOptions() {
11034
+ return new ElderDataViewOptions([], [], false, 'open');
11162
11035
  }
11163
11036
  /***************************************************************************
11164
11037
  * *
11165
- * Public API *
11038
+ * Properties *
11166
11039
  * *
11167
11040
  **************************************************************************/
11168
- confirmSelection() {
11169
- this.dialogRef.close();
11041
+ withSorts(sorts) {
11042
+ return new ElderDataViewOptions(sorts, this.filters, this.selectionMultiEnabled, this.interactionMode);
11170
11043
  }
11171
- ngAfterViewInit() {
11172
- // this.dialogRef.updateSize('20vw', '20vh');
11044
+ withFilters(filters) {
11045
+ return new ElderDataViewOptions(this.sorts, filters, this.selectionMultiEnabled, this.interactionMode);
11046
+ }
11047
+ withSelectionMultiEnabled(selectionMultiEnabled) {
11048
+ return new ElderDataViewOptions(this.sorts, this.filters, selectionMultiEnabled, this.interactionMode);
11049
+ }
11050
+ withInteractionMode(interactionMode) {
11051
+ return new ElderDataViewOptions(this.sorts, this.filters, this.selectionMultiEnabled, interactionMode);
11173
11052
  }
11174
11053
  }
11175
- ElderSelectionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
11176
- ElderSelectionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionDialogComponent, selector: "elder-selection-dialog", inputs: { title: "title" }, ngImport: i0, template: "\n\n<div fxLayout=\"column\" fxFill>\n\n <div fxLayout=\"column\">\n <h2 *ngIf=\"title\">{{title | translate}}</h2>\n </div>\n\n <div fxLayout=\"column\" fxFlex>\n\n <ng-template [ngTemplateOutlet]=\"data.template\"></ng-template>\n\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n\n <button mat-button type=\"button\" mat-dialog-close>\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-raised-button type=\"button\"\n [disabled]=\"data.selectionModel.isEmpty()\"\n (click)=\"confirmSelection()\">\n {{'actions.select' | translate}}\n </button>\n\n </div>\n\n\n</div>\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
11177
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogComponent, decorators: [{
11178
- type: Component,
11179
- args: [{ selector: 'elder-selection-dialog', template: "\n\n<div fxLayout=\"column\" fxFill>\n\n <div fxLayout=\"column\">\n <h2 *ngIf=\"title\">{{title | translate}}</h2>\n </div>\n\n <div fxLayout=\"column\" fxFlex>\n\n <ng-template [ngTemplateOutlet]=\"data.template\"></ng-template>\n\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n\n <button mat-button type=\"button\" mat-dialog-close>\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-raised-button type=\"button\"\n [disabled]=\"data.selectionModel.isEmpty()\"\n (click)=\"confirmSelection()\">\n {{'actions.select' | translate}}\n </button>\n\n </div>\n\n\n</div>\n\n" }]
11180
- }], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
11181
- type: Inject,
11182
- args: [MAT_DIALOG_DATA]
11183
- }] }]; }, propDecorators: { title: [{
11184
- type: Input
11185
- }] } });
11186
11054
 
11187
- class ElderSelectionDialogDirective {
11055
+ class ElderDataViewOptionsProvider {
11188
11056
  /***************************************************************************
11189
11057
  * *
11190
11058
  * Constructor *
11191
11059
  * *
11192
11060
  **************************************************************************/
11193
- constructor(templateRef, dialog) {
11194
- this.templateRef = templateRef;
11195
- this.dialog = dialog;
11196
- this.close = new EventEmitter();
11061
+ constructor() {
11062
+ /***************************************************************************
11063
+ * *
11064
+ * Fields *
11065
+ * *
11066
+ **************************************************************************/
11067
+ this.options$ = new BehaviorSubject(ElderDataViewOptions.defaultOptions());
11068
+ }
11069
+ /***************************************************************************
11070
+ * *
11071
+ * Properties *
11072
+ * *
11073
+ **************************************************************************/
11074
+ get options() {
11075
+ return this.options$.getValue();
11197
11076
  }
11198
11077
  /***************************************************************************
11199
11078
  * *
11200
11079
  * Public API *
11201
11080
  * *
11202
11081
  **************************************************************************/
11203
- open() {
11204
- const dialogRef = this.dialog.open(ElderSelectionDialogComponent, {
11205
- data: {
11206
- template: this.templateRef,
11207
- selectionModel: this.selectionModel
11208
- },
11209
- width: '80vw',
11210
- height: '80vh'
11211
- });
11212
- dialogRef.afterClosed().subscribe(result => this.close.emit(result));
11082
+ /**
11083
+ * Example usage:
11084
+ *
11085
+ * this.updateOptions(
11086
+ * options => options.withInteractionMode('open')
11087
+ * .withFilters([])
11088
+ * )
11089
+ *
11090
+ * @param optionsFn function modifying the options
11091
+ */
11092
+ updateOptions(optionsFn) {
11093
+ this.options$.next(optionsFn(this.options$.getValue()));
11213
11094
  }
11214
11095
  }
11215
- ElderSelectionDialogDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogDirective, deps: [{ token: i0.TemplateRef }, { token: i1$7.MatDialog }], target: i0.ɵɵFactoryTarget.Directive });
11216
- ElderSelectionDialogDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionDialogDirective, selector: "[elderDialog]", inputs: { selectionModel: "selectionModel" }, outputs: { close: "close" }, exportAs: ["elderSelection"], ngImport: i0 });
11217
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogDirective, decorators: [{
11218
- type: Directive,
11219
- args: [{
11220
- selector: '[elderDialog]',
11221
- exportAs: 'elderSelection'
11222
- }]
11223
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i1$7.MatDialog }]; }, propDecorators: { selectionModel: [{
11224
- type: Input
11225
- }], close: [{
11226
- type: Output
11227
- }] } });
11228
-
11229
- /**
11230
- * @deprecated Please switch to ElderDialogService
11231
- */
11232
- class EbsCommonDialogService extends ElderDialogService {
11233
- }
11234
- EbsCommonDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
11235
- EbsCommonDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService });
11236
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, decorators: [{
11237
- type: Injectable
11238
- }] });
11239
- class ElderDialogModule {
11240
- static forRoot() {
11241
- return {
11242
- ngModule: ElderDialogModule,
11243
- providers: [
11244
- // ElderDialogService,
11245
- EbsCommonDialogService
11246
- ]
11247
- };
11248
- }
11249
- }
11250
- ElderDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
11251
- ElderDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, declarations: [ElderConfirmDialogComponent,
11252
- ElderQuestionDialogComponent,
11253
- ElderSelectionDialogComponent,
11254
- ElderSelectionDialogDirective], imports: [CommonModule, FormsModule,
11255
- MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
11256
- A11yModule,
11257
- FlexLayoutModule, TranslateModule], exports: [ElderConfirmDialogComponent,
11258
- ElderQuestionDialogComponent,
11259
- ElderSelectionDialogComponent,
11260
- ElderSelectionDialogDirective] });
11261
- ElderDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, imports: [CommonModule, FormsModule,
11262
- MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
11263
- A11yModule,
11264
- FlexLayoutModule, TranslateModule] });
11265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, decorators: [{
11266
- type: NgModule,
11267
- args: [{
11268
- imports: [
11269
- CommonModule, FormsModule,
11270
- MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
11271
- A11yModule,
11272
- FlexLayoutModule, TranslateModule
11273
- ],
11274
- declarations: [
11275
- ElderConfirmDialogComponent,
11276
- ElderQuestionDialogComponent,
11277
- ElderSelectionDialogComponent,
11278
- ElderSelectionDialogDirective
11279
- ],
11280
- exports: [
11281
- ElderConfirmDialogComponent,
11282
- ElderQuestionDialogComponent,
11283
- ElderSelectionDialogComponent,
11284
- ElderSelectionDialogDirective
11285
- ]
11286
- }]
11287
- }] });
11288
11096
 
11289
- /**
11290
- * This directive projects content identified by a placeholder id
11291
- * into the toolbar at the corresponding place.
11292
- */
11293
- class ElderToolbarContentDirective {
11294
- constructor(templateRef) {
11295
- this.templateRef = templateRef;
11296
- }
11297
- }
11298
- ElderToolbarContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
11299
- ElderToolbarContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderToolbarContentDirective, selector: "[elderToolbarContent]", inputs: { placeholderId: ["elderToolbarContent", "placeholderId"] }, ngImport: i0 });
11300
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, decorators: [{
11301
- type: Directive,
11302
- args: [{ selector: '[elderToolbarContent]' }]
11303
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { placeholderId: [{
11304
- type: Input,
11305
- args: ['elderToolbarContent']
11306
- }] } });
11307
- class ElderDataToolbarComponent {
11097
+ class ElderDataViewBaseComponent {
11308
11098
  /***************************************************************************
11309
11099
  * *
11310
11100
  * Constructor *
11311
11101
  * *
11312
11102
  **************************************************************************/
11313
- constructor(selectionModel, dataView, dialogService) {
11314
- this.dialogService = dialogService;
11315
- this.canAdd = true;
11316
- this.canRemove = true;
11317
- this.canMore = true;
11318
- this.confirmRemoval = true;
11319
- this.keepSelectionAfterRemoval = false;
11320
- this.requestNew = new Subject();
11321
- this.requestRemove = new Subject();
11322
- this.selectionFallback = new BehaviorSubject([]);
11323
- this.selection$ = this.selectionFallback.asObservable();
11324
- if (selectionModel) {
11325
- this.selectionModel = selectionModel;
11103
+ constructor(selectionModel, dataViewOptionsProvider) {
11104
+ this.dataViewOptionsProvider = dataViewOptionsProvider;
11105
+ /***************************************************************************
11106
+ * *
11107
+ * Fields *
11108
+ * *
11109
+ **************************************************************************/
11110
+ /**
11111
+ * Underlying data context.
11112
+ */
11113
+ this.dataContext$ = new BehaviorSubject(null);
11114
+ this.interactionMode = 'open';
11115
+ /**
11116
+ * Define if elder-table should clean up the
11117
+ * data-context resources for you.
11118
+ *
11119
+ * In more advanced scenarios where you plan to reuse the same data-context
11120
+ * set this to false and release the resources yourself. (dataContext.close)
11121
+ */
11122
+ this.cleanUp = true;
11123
+ /**
11124
+ * If true, this table is in dense mode.
11125
+ * Heights are generally reduced.
11126
+ */
11127
+ this._dense = false;
11128
+ /**
11129
+ * If true, this table is in a floating card mode.
11130
+ * Otherwise, it is flat on the current panel.
11131
+ */
11132
+ this._float = false;
11133
+ /**
11134
+ * If true, this table is in embedded mode.
11135
+ * No borders / floating visible so that the table can be embedded into another container
11136
+ */
11137
+ this._embedded = false;
11138
+ this._itemClickSubject = new Subject();
11139
+ this.EntityIdKeyFn = (entity) => entity ? this.getId(entity) : 0;
11140
+ this.destroy$ = new Subject();
11141
+ if (!selectionModel) {
11142
+ this.selectionModel = new SelectionModel(false, [], this.EntityIdKeyFn);
11326
11143
  }
11327
- if (dataView) {
11328
- this.selectionModel = dataView.selectionModel;
11144
+ else {
11145
+ this.selectionModel = selectionModel;
11329
11146
  }
11330
11147
  }
11331
11148
  /***************************************************************************
@@ -11333,1234 +11150,1423 @@ class ElderDataToolbarComponent {
11333
11150
  * Life Cycle *
11334
11151
  * *
11335
11152
  **************************************************************************/
11336
- ngOnInit() { }
11153
+ ngOnInit() {
11154
+ if (this.dataViewOptionsProvider) {
11155
+ if (this.dataViewOptionsProvider.options.interactionMode === 'selection') {
11156
+ this.selectionVisible = true;
11157
+ this.float = false;
11158
+ }
11159
+ if (this.dataContext) {
11160
+ DataViewOptionsProviderBinding.of(this)
11161
+ .dataViewOptionsProvider(this.dataViewOptionsProvider)
11162
+ .bindUntil(this.destroy$);
11163
+ }
11164
+ }
11165
+ }
11166
+ ngOnDestroy() {
11167
+ this.destroy$.next();
11168
+ this.destroy$.complete();
11169
+ this.autoCleanUp();
11170
+ }
11337
11171
  /***************************************************************************
11338
11172
  * *
11339
11173
  * Properties *
11340
11174
  * *
11341
11175
  **************************************************************************/
11342
- set selectionModel(model) {
11343
- this._selectionModel = model;
11344
- if (model) {
11345
- this.selection$ = model.selection;
11346
- }
11347
- else {
11348
- this.selection$ = this.selectionFallback.asObservable();
11176
+ get dataContext() {
11177
+ return this.dataContext$.getValue();
11178
+ }
11179
+ set dataContext(data) {
11180
+ this.dataContext$.next(data);
11181
+ this.onDataContextSet(data);
11182
+ }
11183
+ get dataActivePaged() {
11184
+ return this.dataContext;
11185
+ }
11186
+ get dataContinuable() {
11187
+ return this.dataContext;
11188
+ }
11189
+ get isContinuable() {
11190
+ if (!this.dataContext) {
11191
+ return false;
11349
11192
  }
11193
+ return isContinuableDataContext(this.dataContext);
11350
11194
  }
11351
- get selectionModel() {
11352
- return this._selectionModel;
11195
+ get isActivePaged() {
11196
+ if (!this.dataContext) {
11197
+ return false;
11198
+ }
11199
+ return isActivePagedDataContext(this.dataContext);
11353
11200
  }
11354
11201
  /***************************************************************************
11355
11202
  * *
11356
- * Public API *
11203
+ * Selection Properties *
11357
11204
  * *
11358
11205
  **************************************************************************/
11359
- getTemplate(placeholderId) {
11360
- if (!this.templates) {
11361
- return null;
11362
- }
11363
- const template = this.templates.find((item) => item.placeholderId === placeholderId);
11364
- return template ? template.templateRef : null;
11206
+ set selectableEvaluatorFn(selectableEvaluatorFn) {
11207
+ this.selectionModel.selectableEvaluatorFn = selectableEvaluatorFn;
11365
11208
  }
11366
- requestRemoveItems(items) {
11367
- if (this.confirmRemoval) {
11368
- this.dialogService
11369
- .showConfirm({
11370
- title: 'dialogs.confirm-deletion.title',
11371
- message: 'dialogs.confirm-deletion.message',
11372
- yesNo: true,
11373
- interpolateParams: { numOfItems: items.length },
11374
- })
11375
- .subscribe((confirmed) => {
11376
- if (confirmed) {
11377
- this.emitRemove(items);
11378
- }
11379
- });
11380
- }
11381
- else {
11382
- this.emitRemove(items);
11383
- }
11209
+ set selection(selection) {
11210
+ this.selectionModel.replaceSelection(selection);
11384
11211
  }
11385
- emitRemove(items) {
11386
- this.requestRemove.next(items);
11387
- if (!this.keepSelectionAfterRemoval) {
11388
- // Clear the selection after deleting items
11389
- if (this._selectionModel) {
11390
- this._selectionModel.deselect(items);
11212
+ get selectionChange() {
11213
+ return this.selectionModel.changed;
11214
+ }
11215
+ get selectionSingleChange() {
11216
+ return this.selectionModel.changed.pipe(map((selection) => {
11217
+ if (selection.length > 0) {
11218
+ return selection[0];
11391
11219
  }
11220
+ else {
11221
+ return null;
11222
+ }
11223
+ }));
11224
+ }
11225
+ set selectionMultiEnabled(enableMultiSelection) {
11226
+ if (this.selectionModel) {
11227
+ this.selectionModel.isMultipleSelection = enableMultiSelection;
11392
11228
  }
11393
11229
  }
11394
- }
11395
- ElderDataToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataToolbarComponent, deps: [{ token: SelectionModel, optional: true }, { token: ELDER_DATA_VIEW, optional: true }, { token: ElderDialogService }], target: i0.ɵɵFactoryTarget.Component });
11396
- ElderDataToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderDataToolbarComponent, selector: "elder-data-toolbar", inputs: { canAdd: "canAdd", canRemove: "canRemove", canMore: "canMore", confirmRemoval: "confirmRemoval", keepSelectionAfterRemoval: "keepSelectionAfterRemoval", selectionModel: "selectionModel" }, outputs: { requestNew: "requestNew", requestRemove: "requestRemove" }, queries: [{ propertyName: "templates", predicate: ElderToolbarContentDirective }], ngImport: i0, template: "<!-- Table Toolbar -->\n<div\n fxLayout=\"row\"\n fxLayoutAlign=\"space-between center\"\n fxLayoutGap=\"10px\"\n style=\"padding: 4px 8px 0 8px\"\n *ngIf=\"selection$ | async as selection\"\n>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('main') || defaultContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n</div>\n\n<!-- Default Templates -->\n\n<!-- Default Main Content -->\n<ng-template #defaultContent let-selection>\n <!-- Left column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left') || defaultLeftContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('center') || defaultCenterContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <!-- Right column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right') || defaultRightContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n</ng-template>\n\n<!-- Default Left Content -->\n<ng-template #defaultLeftContent let-selection>\n <!-- Add Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canAdd\"\n (click)=\"requestNew.next($event)\"\n >\n <mat-icon>add</mat-icon>\n </button>\n\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n</ng-template>\n\n<!-- Default Center Content -->\n<ng-template #defaultCenterContent let-selection> </ng-template>\n\n<!-- Default Right Content -->\n<ng-template #defaultRightContent let-selection>\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n\n <!-- Delete Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canRemove\"\n [disabled]=\"!selection?.length\"\n (click)=\"requestRemoveItems(selection)\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n\n <!-- More Menu -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n [matMenuTriggerFor]=\"elderTableMenu\"\n [disabled]=\"!canMore\"\n >\n <mat-icon>more_vert</mat-icon>\n <mat-menu #elderTableMenu=\"matMenu\">\n <ng-content select=\"[mat-menu-item]\"></ng-content>\n <!-- Placeholder for mat menu items-->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.menu');\n context: { $implicit: selection }\n \"\n ></ng-container>\n </mat-menu>\n </button>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11397
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataToolbarComponent, decorators: [{
11398
- type: Component,
11399
- args: [{ selector: 'elder-data-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Table Toolbar -->\n<div\n fxLayout=\"row\"\n fxLayoutAlign=\"space-between center\"\n fxLayoutGap=\"10px\"\n style=\"padding: 4px 8px 0 8px\"\n *ngIf=\"selection$ | async as selection\"\n>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('main') || defaultContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n</div>\n\n<!-- Default Templates -->\n\n<!-- Default Main Content -->\n<ng-template #defaultContent let-selection>\n <!-- Left column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left') || defaultLeftContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('center') || defaultCenterContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <!-- Right column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right') || defaultRightContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n</ng-template>\n\n<!-- Default Left Content -->\n<ng-template #defaultLeftContent let-selection>\n <!-- Add Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canAdd\"\n (click)=\"requestNew.next($event)\"\n >\n <mat-icon>add</mat-icon>\n </button>\n\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n</ng-template>\n\n<!-- Default Center Content -->\n<ng-template #defaultCenterContent let-selection> </ng-template>\n\n<!-- Default Right Content -->\n<ng-template #defaultRightContent let-selection>\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n\n <!-- Delete Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canRemove\"\n [disabled]=\"!selection?.length\"\n (click)=\"requestRemoveItems(selection)\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n\n <!-- More Menu -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n [matMenuTriggerFor]=\"elderTableMenu\"\n [disabled]=\"!canMore\"\n >\n <mat-icon>more_vert</mat-icon>\n <mat-menu #elderTableMenu=\"matMenu\">\n <ng-content select=\"[mat-menu-item]\"></ng-content>\n <!-- Placeholder for mat menu items-->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.menu');\n context: { $implicit: selection }\n \"\n ></ng-container>\n </mat-menu>\n </button>\n</ng-template>\n" }]
11400
- }], ctorParameters: function () { return [{ type: SelectionModel, decorators: [{
11401
- type: Optional
11402
- }] }, { type: undefined, decorators: [{
11403
- type: Optional
11404
- }, {
11405
- type: Inject,
11406
- args: [ELDER_DATA_VIEW]
11407
- }] }, { type: ElderDialogService }]; }, propDecorators: { canAdd: [{
11408
- type: Input
11409
- }], canRemove: [{
11410
- type: Input
11411
- }], canMore: [{
11412
- type: Input
11413
- }], confirmRemoval: [{
11414
- type: Input
11415
- }], keepSelectionAfterRemoval: [{
11416
- type: Input
11417
- }], requestNew: [{
11418
- type: Output
11419
- }], requestRemove: [{
11420
- type: Output
11421
- }], templates: [{
11422
- type: ContentChildren,
11423
- args: [ElderToolbarContentDirective]
11424
- }], selectionModel: [{
11425
- type: Input
11426
- }] } });
11427
-
11428
- class ElderSingleSortComponent {
11429
11230
  /***************************************************************************
11430
11231
  * *
11431
- * Constructor *
11232
+ * On click properties *
11432
11233
  * *
11433
11234
  **************************************************************************/
11434
- constructor() {
11435
- /***************************************************************************
11436
- * *
11437
- * Fields *
11438
- * *
11439
- **************************************************************************/
11440
- this.log = LoggerFactory.getLogger(this.constructor.name);
11441
- this.sort$ = new BehaviorSubject(Sort.NONE);
11442
- this.availableSorts = [];
11443
- this.sortChange = new EventEmitter();
11444
- this.translationPrefix = 'documents.sorts.';
11235
+ get itemClick() {
11236
+ return this._itemClickSubject;
11445
11237
  }
11446
11238
  /***************************************************************************
11447
11239
  * *
11448
- * Life Cycle *
11240
+ * Style Properties *
11449
11241
  * *
11450
11242
  **************************************************************************/
11451
- ngOnInit() {
11243
+ set dense(value) {
11244
+ this._dense = coerceBooleanProperty(value);
11245
+ }
11246
+ get dense() {
11247
+ return this._dense;
11248
+ }
11249
+ set float(value) {
11250
+ this._float = coerceBooleanProperty(value);
11251
+ }
11252
+ get float() {
11253
+ return this._float;
11254
+ }
11255
+ set embedded(value) {
11256
+ this._embedded = coerceBooleanProperty(value);
11257
+ }
11258
+ get embedded() {
11259
+ return this._embedded;
11452
11260
  }
11453
11261
  /***************************************************************************
11454
11262
  * *
11455
- * Properties *
11263
+ * Event Entry Points *
11456
11264
  * *
11457
11265
  **************************************************************************/
11458
- set sort(sort) {
11459
- if (!sort) {
11460
- sort = Sort.NONE;
11266
+ /**
11267
+ * Called after a new DataContext has been set.
11268
+ * Subclasses may add additional behaviour at this stage.
11269
+ * @param data
11270
+ * @protected
11271
+ */
11272
+ onDataContextSet(data) {
11273
+ }
11274
+ onItemClick(entity) {
11275
+ if (entity) {
11276
+ switch (this.interactionMode) {
11277
+ case 'open':
11278
+ if (this.selectionModel.hasValue) {
11279
+ this.selectionModel.toggle(entity);
11280
+ }
11281
+ else {
11282
+ this._itemClickSubject.next(entity);
11283
+ }
11284
+ break;
11285
+ case 'selection':
11286
+ this.selectionModel.toggle(entity);
11287
+ break;
11288
+ }
11461
11289
  }
11462
- this.sort$.next(sort);
11463
11290
  }
11464
- get sort() {
11465
- return this.sort$.getValue();
11291
+ onItemDoubleClick(entity) {
11292
+ if (entity) {
11293
+ switch (this.interactionMode) {
11294
+ // double click in open mode not supported
11295
+ case 'open':
11296
+ break;
11297
+ // double click in selection mode triggers normal item click
11298
+ case 'selection':
11299
+ this._itemClickSubject.next(entity);
11300
+ break;
11301
+ }
11302
+ }
11466
11303
  }
11467
11304
  /***************************************************************************
11468
11305
  * *
11469
- * API *
11306
+ * Private Methods *
11470
11307
  * *
11471
11308
  **************************************************************************/
11472
- setSortProp(sortProp) {
11473
- const sort = new Sort(sortProp, this.sort.dir);
11474
- this.setSort(sort);
11309
+ getId(entity) {
11310
+ return this.dataContext?.dataSource?.getId(entity) || entity;
11475
11311
  }
11476
- toggleSortDirection(event) {
11477
- event.stopPropagation();
11478
- let dir;
11479
- if (this.sort.dir === 'asc') {
11480
- dir = 'desc';
11481
- }
11482
- else {
11483
- dir = 'asc';
11312
+ /**
11313
+ * Performs clean up of the current data context if auto clean up is enabled.
11314
+ */
11315
+ autoCleanUp() {
11316
+ if (this.cleanUp && this.dataContext) {
11317
+ //this.logger.debug('Releasing DataContext resources to prevent memory leak. [cleanUp]="true"');
11318
+ this.dataContext.close();
11484
11319
  }
11485
- this.setSort(new Sort(this.sort.prop, dir));
11486
- }
11487
- setSort(sort) {
11488
- this.sort = sort;
11489
- this.sortChange.emit(sort);
11490
11320
  }
11491
11321
  }
11492
- ElderSingleSortComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSingleSortComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
11493
- ElderSingleSortComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSingleSortComponent, selector: "elder-single-sort", inputs: { availableSorts: "availableSorts", translationPrefix: "translationPrefix", sort: "sort" }, outputs: { sortChange: "sortChange" }, ngImport: i0, template: "<div *ngIf=\"(sort$ | async) as sort\" fxLayout=\"row\" fxFlex=\"none\">\n\n <button mat-button type=\"button\" [matMenuTriggerFor]=\"menu\">\n\n {{ translationPrefix + sort.prop | translate}}\n\n <mat-icon style=\"font-size: 22px\">sort</mat-icon>\n\n <mat-menu #menu=\"matMenu\">\n <button mat-menu-item type=\"button\"\n *ngFor=\"let mysort of availableSorts\"\n (click)=\"setSortProp(mysort)\"\n >\n <mat-icon>sort</mat-icon>\n <span [class.mat-body-strong]=\"sort.prop == mysort\">{{translationPrefix + mysort | translate}}</span>\n </button>\n </mat-menu>\n\n </button>\n\n <button mat-icon-button type=\"button\" (click)=\"toggleSortDirection($event)\">\n <mat-icon style=\"font-size: 22px\">{{sort.dir === 'asc' ? 'arrow_downward' : 'arrow_upward'}}</mat-icon>\n </button>\n\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11494
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSingleSortComponent, decorators: [{
11495
- type: Component,
11496
- args: [{ selector: 'elder-single-sort', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"(sort$ | async) as sort\" fxLayout=\"row\" fxFlex=\"none\">\n\n <button mat-button type=\"button\" [matMenuTriggerFor]=\"menu\">\n\n {{ translationPrefix + sort.prop | translate}}\n\n <mat-icon style=\"font-size: 22px\">sort</mat-icon>\n\n <mat-menu #menu=\"matMenu\">\n <button mat-menu-item type=\"button\"\n *ngFor=\"let mysort of availableSorts\"\n (click)=\"setSortProp(mysort)\"\n >\n <mat-icon>sort</mat-icon>\n <span [class.mat-body-strong]=\"sort.prop == mysort\">{{translationPrefix + mysort | translate}}</span>\n </button>\n </mat-menu>\n\n </button>\n\n <button mat-icon-button type=\"button\" (click)=\"toggleSortDirection($event)\">\n <mat-icon style=\"font-size: 22px\">{{sort.dir === 'asc' ? 'arrow_downward' : 'arrow_upward'}}</mat-icon>\n </button>\n\n</div>\n" }]
11497
- }], ctorParameters: function () { return []; }, propDecorators: { availableSorts: [{
11322
+ ElderDataViewBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseComponent, deps: [{ token: SelectionModel }, { token: ElderDataViewOptionsProvider }], target: i0.ɵɵFactoryTarget.Directive });
11323
+ ElderDataViewBaseComponentdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderDataViewBaseComponent, inputs: { interactionMode: "interactionMode", cleanUp: "cleanUp", selectableEvaluatorFn: "selectableEvaluatorFn", selection: "selection", selectionMultiEnabled: "selectionMultiEnabled", dense: "dense", float: "float", embedded: "embedded" }, outputs: { selectionChange: "selectionChange", selectionSingleChange: "selectionSingleChange", itemClick: "itemClick" }, ngImport: i0 });
11324
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseComponent, decorators: [{
11325
+ type: Directive
11326
+ }], ctorParameters: function () { return [{ type: SelectionModel }, { type: ElderDataViewOptionsProvider }]; }, propDecorators: { interactionMode: [{
11498
11327
  type: Input
11499
- }], sortChange: [{
11328
+ }], cleanUp: [{
11329
+ type: Input
11330
+ }], selectableEvaluatorFn: [{
11331
+ type: Input
11332
+ }], selection: [{
11333
+ type: Input
11334
+ }], selectionChange: [{
11500
11335
  type: Output
11501
- }], translationPrefix: [{
11336
+ }], selectionSingleChange: [{
11337
+ type: Output
11338
+ }], selectionMultiEnabled: [{
11502
11339
  type: Input
11503
- }], sort: [{
11340
+ }], itemClick: [{
11341
+ type: Output
11342
+ }], dense: [{
11343
+ type: Input
11344
+ }], float: [{
11345
+ type: Input
11346
+ }], embedded: [{
11504
11347
  type: Input
11505
11348
  }] } });
11506
11349
 
11507
- class MasterSelectionState {
11508
- constructor(count, allSelected, someSelected, anySelected) {
11509
- this.count = count;
11510
- this.allSelected = allSelected;
11511
- this.someSelected = someSelected;
11512
- this.anySelected = anySelected;
11350
+ class ElderDialogConfig {
11351
+ }
11352
+
11353
+ class ConfirmDialogConfig extends ElderDialogConfig {
11354
+ }
11355
+ class ElderConfirmDialogComponent {
11356
+ constructor(dialogRef) {
11357
+ this.dialogRef = dialogRef;
11358
+ this.yesNo = false;
11513
11359
  }
11514
11360
  }
11361
+ ElderConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderConfirmDialogComponent, deps: [{ token: i1$7.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
11362
+ ElderConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderConfirmDialogComponent, selector: "elder-confirm-dialog", ngImport: i0, template: "\n<h2 matDialogTitle translate>{{ title }}</h2>\n\n\n<mat-dialog-content>\n <p translate>{{ message }}</p>\n</mat-dialog-content>\n\n\n<mat-dialog-actions fxLayoutAlign=\"end center\" cdkTrapFocus>\n\n <button type=\"button\" mat-button\n (click)=\"dialogRef.close(false)\">\n {{ (yesNo ? \"actions.no\" : \"actions.cancel\") | translate}}\n </button>\n\n <button type=\"submit\" mat-raised-button cdkFocusInitial\n (click)=\"dialogRef.close(true)\">\n {{ (yesNo ? \"actions.yes\" : \"actions.ok\") | translate}}\n </button>\n\n</mat-dialog-actions>\n\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$7.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$7.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
11363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderConfirmDialogComponent, decorators: [{
11364
+ type: Component,
11365
+ args: [{ selector: 'elder-confirm-dialog', template: "\n<h2 matDialogTitle translate>{{ title }}</h2>\n\n\n<mat-dialog-content>\n <p translate>{{ message }}</p>\n</mat-dialog-content>\n\n\n<mat-dialog-actions fxLayoutAlign=\"end center\" cdkTrapFocus>\n\n <button type=\"button\" mat-button\n (click)=\"dialogRef.close(false)\">\n {{ (yesNo ? \"actions.no\" : \"actions.cancel\") | translate}}\n </button>\n\n <button type=\"submit\" mat-raised-button cdkFocusInitial\n (click)=\"dialogRef.close(true)\">\n {{ (yesNo ? \"actions.yes\" : \"actions.ok\") | translate}}\n </button>\n\n</mat-dialog-actions>\n\n" }]
11366
+ }], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }]; } });
11515
11367
 
11516
- class DataContextSelectionDirective {
11368
+ class QuestionDialogConfig extends ElderDialogConfig {
11369
+ }
11370
+ class ElderQuestionDialogComponent {
11371
+ constructor(dialogRef, data) {
11372
+ this.dialogRef = dialogRef;
11373
+ this.data = data;
11374
+ }
11375
+ ngOnInit() {
11376
+ }
11377
+ confirm(event) {
11378
+ this.dialogRef.close(this.answer);
11379
+ }
11380
+ cancel(event) {
11381
+ this.dialogRef.close();
11382
+ }
11383
+ get isValid() {
11384
+ return !!this.answer;
11385
+ }
11386
+ }
11387
+ ElderQuestionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderQuestionDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
11388
+ ElderQuestionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderQuestionDialogComponent, selector: "elder-question-dialog", ngImport: i0, template: "<h2 matDialogTitle translate>{{ data.title }}</h2>\n\n<form #f=\"ngForm\" fxLayout=\"column\" (ngSubmit)=\"confirm($event)\" cdkTrapFocus>\n\n <mat-dialog-content>\n <p>{{data.question}}</p>\n\n <mat-form-field class=\"full-width\">\n <input matInput type=\"text\" name=\"name\" [(ngModel)]=\"answer\" cdkFocusInitial\n placeholder=\"{{'context.name' | translate}}\" required>\n </mat-form-field>\n </mat-dialog-content>\n\n <mat-dialog-actions fxLayoutAlign=\"end center\" >\n\n <button mat-button type=\"button\"\n (click)=\"cancel($event)\">\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-button type=\"submit\" color=\"primary\"\n [disabled]=\"!isValid\">\n {{'actions.ok' | translate}}\n </button>\n\n </mat-dialog-actions>\n\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$7.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$7.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
11389
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderQuestionDialogComponent, decorators: [{
11390
+ type: Component,
11391
+ args: [{ selector: 'elder-question-dialog', template: "<h2 matDialogTitle translate>{{ data.title }}</h2>\n\n<form #f=\"ngForm\" fxLayout=\"column\" (ngSubmit)=\"confirm($event)\" cdkTrapFocus>\n\n <mat-dialog-content>\n <p>{{data.question}}</p>\n\n <mat-form-field class=\"full-width\">\n <input matInput type=\"text\" name=\"name\" [(ngModel)]=\"answer\" cdkFocusInitial\n placeholder=\"{{'context.name' | translate}}\" required>\n </mat-form-field>\n </mat-dialog-content>\n\n <mat-dialog-actions fxLayoutAlign=\"end center\" >\n\n <button mat-button type=\"button\"\n (click)=\"cancel($event)\">\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-button type=\"submit\" color=\"primary\"\n [disabled]=\"!isValid\">\n {{'actions.ok' | translate}}\n </button>\n\n </mat-dialog-actions>\n\n</form>\n" }]
11392
+ }], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
11393
+ type: Inject,
11394
+ args: [MAT_DIALOG_DATA]
11395
+ }] }]; } });
11396
+
11397
+ class ElderDialogService {
11517
11398
  /***************************************************************************
11518
11399
  * *
11519
11400
  * Constructor *
11520
11401
  * *
11521
11402
  **************************************************************************/
11522
- constructor(selectionModel) {
11403
+ constructor(dialog, translateService) {
11404
+ this.dialog = dialog;
11405
+ this.translateService = translateService;
11523
11406
  /***************************************************************************
11524
11407
  * *
11525
11408
  * Fields *
11526
11409
  * *
11527
11410
  **************************************************************************/
11528
- this.log = LoggerFactory.getLogger(this.constructor.name);
11529
- this.selectionModel$ = new BehaviorSubject(null);
11530
- this.dataContext$ = new BehaviorSubject(null);
11531
- this.selectionModel$.next(selectionModel);
11532
- this.selectionState$ = this.buildSelectionState$(this.selectionModel$, this.dataContext$);
11411
+ this.defaultDialogConfig = {
11412
+ role: 'dialog',
11413
+ disableClose: false,
11414
+ autoFocus: true,
11415
+ restoreFocus: true,
11416
+ closeOnNavigation: false
11417
+ };
11533
11418
  }
11534
11419
  /***************************************************************************
11535
11420
  * *
11536
- * Properties *
11421
+ * Public API *
11537
11422
  * *
11538
11423
  **************************************************************************/
11539
- set selectionModel(model) {
11540
- this.selectionModel$.next(model);
11541
- }
11542
- get selectionModel() {
11543
- return this.selectionModel$.getValue();
11424
+ /**
11425
+ * @deprecated Use showConfirm({...}) instead
11426
+ *
11427
+ * @param title
11428
+ * @param message
11429
+ * @param config
11430
+ */
11431
+ confirm(title, message, config) {
11432
+ return this.showConfirm({
11433
+ title: title,
11434
+ message: message,
11435
+ config: config || this.defaultDialogConfig
11436
+ });
11544
11437
  }
11545
- set dataContext(dataContext) {
11546
- this.dataContext$.next(dataContext);
11438
+ /**
11439
+ * Creates a modal confirmation dialog.
11440
+ *
11441
+ * @param config object for conform dialog
11442
+ */
11443
+ showConfirm(config) {
11444
+ if (!config) {
11445
+ throw new Error('Argument must not be null: config');
11446
+ }
11447
+ const rawMessages = new Map();
11448
+ rawMessages.set('title', config.title);
11449
+ rawMessages.set('message', config.message);
11450
+ return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
11451
+ const title = messages.get('title');
11452
+ const message = messages.get('message');
11453
+ let dialogRef;
11454
+ dialogRef = this.dialog.open(ElderConfirmDialogComponent, config.config);
11455
+ dialogRef.componentInstance.title = title;
11456
+ dialogRef.componentInstance.message = message;
11457
+ dialogRef.componentInstance.yesNo = config.yesNo;
11458
+ return dialogRef.afterClosed();
11459
+ }));
11547
11460
  }
11548
- /** Whether the number of selected elements matches the totalSnapshot number of selectable rows. */
11549
- get isAllSelectedSnapshot() {
11550
- const numSelected = this.selectionModel.selectionSnapshot.length;
11551
- const context = this.dataContext$.getValue();
11552
- const numRows = context ? context.snapshot.data.length : 0;
11553
- const numUnselectable = context ? context.snapshot.data.filter(i => !this.selectionModel.isSelectable(i)).length : 0;
11554
- return numSelected >= numRows - numUnselectable; // True if all selectable items are selected
11461
+ /**
11462
+ * @deprecated Use showQuestion({...}) instead
11463
+ *
11464
+ * Creates a modal question dialog.
11465
+ *
11466
+ * @param title
11467
+ * @param question
11468
+ * @param config
11469
+ */
11470
+ question(title, question, config) {
11471
+ return this.showQuestion({
11472
+ title: title,
11473
+ question: question,
11474
+ config: config || this.defaultDialogConfig
11475
+ });
11555
11476
  }
11556
- /***************************************************************************
11557
- * *
11558
- * Public API *
11559
- * *
11560
- **************************************************************************/
11561
- /** Selects all rows if they are not all selected; otherwise clear selection. */
11562
- masterToggle() {
11563
- this.log.debug('masterToggle triggered, toggling all!');
11564
- if (this.isAllSelectedSnapshot) {
11565
- this.selectionModel.clear();
11566
- }
11567
- else {
11568
- const context = this.dataContext$.getValue();
11569
- if (context) {
11570
- this.selectionModel.select(context.snapshot.data);
11571
- }
11477
+ /**
11478
+ * Creates a modal question dialog.
11479
+ *
11480
+ * @param config
11481
+ */
11482
+ showQuestion(config) {
11483
+ if (!config) {
11484
+ throw new Error('Argument must not be null: config');
11572
11485
  }
11486
+ const rawMessages = new Map();
11487
+ rawMessages.set('title', config.title);
11488
+ rawMessages.set('question', config.question);
11489
+ return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
11490
+ const title = messages.get('title');
11491
+ const question = messages.get('question');
11492
+ const dlgConf = config.config || new MatDialogConfig();
11493
+ dlgConf.data = {
11494
+ title: title,
11495
+ question: question
11496
+ };
11497
+ const dialogRef = this.dialog.open(ElderQuestionDialogComponent, dlgConf);
11498
+ return dialogRef.afterClosed()
11499
+ .pipe(filter(response => !!response));
11500
+ }));
11573
11501
  }
11574
11502
  /***************************************************************************
11575
11503
  * *
11576
11504
  * Private methods *
11577
11505
  * *
11578
11506
  **************************************************************************/
11579
- buildSelectionState$(selectionModel$, dataContext$) {
11580
- return combineLatest([selectionModel$, dataContext$]).pipe(filter(([model, dc]) => !!model && !!dc), switchMap(([model, dc]) => this.buildSelectionStateInner$(model, dc)));
11507
+ resolveTranslatedMap(messages, interpolateParams) {
11508
+ const rawMessages = Array.from(messages.values());
11509
+ return this.translateInterpolatedParams(interpolateParams).pipe(switchMap(translatedParams => this.translateService.get(rawMessages, translatedParams)), map(translatedValues => {
11510
+ const translated = new Map();
11511
+ messages.forEach((rawValue, key) => {
11512
+ translated.set(key, translatedValues[rawValue] || rawValue);
11513
+ });
11514
+ return translated;
11515
+ }));
11581
11516
  }
11582
- buildSelectionStateInner$(model, dc) {
11583
- return combineLatest([model.selection, dc.data]).pipe(map(([selection, currentData]) => {
11584
- const unselectable = currentData.filter(i => !model.isSelectable(i));
11585
- return new MasterSelectionState(selection.length, selection.length >= currentData.length - unselectable.length, selection.length > 0 && selection.length < currentData.length - unselectable.length, selection.length > 0);
11517
+ /**
11518
+ * Translates a list of params
11519
+ *
11520
+ * @param interpolateParams
11521
+ */
11522
+ translateInterpolatedParams(interpolateParams) {
11523
+ if (!interpolateParams) {
11524
+ return of({});
11525
+ }
11526
+ const values = Object.getOwnPropertyNames(interpolateParams)
11527
+ .map(key => interpolateParams[key])
11528
+ .filter(value => !!value)
11529
+ .map(value => value + '');
11530
+ return this.translateService.get(values).pipe(map(translated => {
11531
+ Object.getOwnPropertyNames(interpolateParams)
11532
+ .forEach(key => {
11533
+ const value = interpolateParams[key];
11534
+ interpolateParams[key] = translated[value];
11535
+ });
11536
+ return interpolateParams;
11586
11537
  }));
11587
11538
  }
11588
11539
  }
11589
- DataContextSelectionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextSelectionDirective, deps: [{ token: SelectionModel, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
11590
- DataContextSelectionDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: DataContextSelectionDirective, selector: "[elderDataContextSelection]", inputs: { selectionModel: ["elderDataContextSelectionModel", "selectionModel"], dataContext: ["elderDataContextSelection", "dataContext"] }, exportAs: ["elderDataContextSelection"], ngImport: i0 });
11591
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextSelectionDirective, decorators: [{
11592
- type: Directive,
11540
+ ElderDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, deps: [{ token: i1$7.MatDialog }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
11541
+ ElderDialogServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, providedIn: 'root' });
11542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, decorators: [{
11543
+ type: Injectable,
11593
11544
  args: [{
11594
- selector: '[elderDataContextSelection]',
11595
- exportAs: 'elderDataContextSelection'
11545
+ providedIn: 'root'
11596
11546
  }]
11597
- }], ctorParameters: function () { return [{ type: SelectionModel, decorators: [{
11598
- type: Optional
11599
- }] }]; }, propDecorators: { selectionModel: [{
11600
- type: Input,
11601
- args: ['elderDataContextSelectionModel']
11602
- }], dataContext: [{
11603
- type: Input,
11604
- args: ['elderDataContextSelection']
11605
- }] } });
11547
+ }], ctorParameters: function () { return [{ type: i1$7.MatDialog }, { type: i2.TranslateService }]; } });
11606
11548
 
11607
- class ElderSelectionMasterCheckboxComponent {
11549
+ class ElderSelectionDialogComponent {
11608
11550
  /***************************************************************************
11609
11551
  * *
11610
11552
  * Constructor *
11611
11553
  * *
11612
11554
  **************************************************************************/
11613
- constructor(dataContextSelection) {
11614
- this.dataContextSelection = dataContextSelection;
11615
- /***************************************************************************
11616
- * *
11617
- * Fields *
11618
- * *
11619
- **************************************************************************/
11620
- this.logger = LoggerFactory.getLogger(this.constructor.name);
11555
+ constructor(dialogRef, data) {
11556
+ this.dialogRef = dialogRef;
11557
+ this.data = data;
11558
+ }
11559
+ ngOnInit() {
11621
11560
  }
11622
11561
  /***************************************************************************
11623
11562
  * *
11624
- * Life Cycle *
11563
+ * Public API *
11625
11564
  * *
11626
11565
  **************************************************************************/
11627
- ngOnInit() {
11566
+ confirmSelection() {
11567
+ this.dialogRef.close();
11568
+ }
11569
+ ngAfterViewInit() {
11570
+ // this.dialogRef.updateSize('20vw', '20vh');
11628
11571
  }
11629
11572
  }
11630
- ElderSelectionMasterCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionMasterCheckboxComponent, deps: [{ token: DataContextSelectionDirective }], target: i0.ɵɵFactoryTarget.Component });
11631
- ElderSelectionMasterCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionMasterCheckboxComponent, selector: "elder-selection-master-checkbox", ngImport: i0, template: "<div\n *ngIf=\"\n dataContextSelection.selectionModel.isMultipleSelection\n && dataContextSelection?.selectionState$ | async as selectionState\"\n\n fxLayout=\"column\" fxFlex=\"none\"\n\n [matBadgeHidden]=\"selectionState.count === 0\"\n [matBadge]=\"selectionState.count + ''\"\n [matBadgePosition]=\"'above before'\"\n [matBadgeOverlap]=\"false\"\n [matBadgeSize]=\"'small'\"\n>\n <mat-checkbox fxFlex=\"none\"\n (change)=\"$event ? dataContextSelection.masterToggle() : null\"\n [checked]=\"selectionState.allSelected\"\n [indeterminate]=\"selectionState.someSelected\"\n >\n </mat-checkbox>\n</div>\n\n<!-- -->\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$8.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i4$3.MatBadge, selector: "[matBadge]", inputs: ["matBadgeDisabled", "matBadgeColor", "matBadgeOverlap", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11632
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionMasterCheckboxComponent, decorators: [{
11573
+ ElderSelectionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
11574
+ ElderSelectionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionDialogComponent, selector: "elder-selection-dialog", inputs: { title: "title" }, ngImport: i0, template: "\n\n<div fxLayout=\"column\" fxFill>\n\n <div fxLayout=\"column\">\n <h2 *ngIf=\"title\">{{title | translate}}</h2>\n </div>\n\n <div fxLayout=\"column\" fxFlex>\n\n <ng-template [ngTemplateOutlet]=\"data.template\"></ng-template>\n\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n\n <button mat-button type=\"button\" mat-dialog-close>\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-raised-button type=\"button\"\n [disabled]=\"data.selectionModel.isEmpty()\"\n (click)=\"confirmSelection()\">\n {{'actions.select' | translate}}\n </button>\n\n </div>\n\n\n</div>\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
11575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogComponent, decorators: [{
11633
11576
  type: Component,
11634
- args: [{ selector: 'elder-selection-master-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"\n dataContextSelection.selectionModel.isMultipleSelection\n && dataContextSelection?.selectionState$ | async as selectionState\"\n\n fxLayout=\"column\" fxFlex=\"none\"\n\n [matBadgeHidden]=\"selectionState.count === 0\"\n [matBadge]=\"selectionState.count + ''\"\n [matBadgePosition]=\"'above before'\"\n [matBadgeOverlap]=\"false\"\n [matBadgeSize]=\"'small'\"\n>\n <mat-checkbox fxFlex=\"none\"\n (change)=\"$event ? dataContextSelection.masterToggle() : null\"\n [checked]=\"selectionState.allSelected\"\n [indeterminate]=\"selectionState.someSelected\"\n >\n </mat-checkbox>\n</div>\n\n<!-- -->\n" }]
11635
- }], ctorParameters: function () { return [{ type: DataContextSelectionDirective }]; } });
11577
+ args: [{ selector: 'elder-selection-dialog', template: "\n\n<div fxLayout=\"column\" fxFill>\n\n <div fxLayout=\"column\">\n <h2 *ngIf=\"title\">{{title | translate}}</h2>\n </div>\n\n <div fxLayout=\"column\" fxFlex>\n\n <ng-template [ngTemplateOutlet]=\"data.template\"></ng-template>\n\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n\n <button mat-button type=\"button\" mat-dialog-close>\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-raised-button type=\"button\"\n [disabled]=\"data.selectionModel.isEmpty()\"\n (click)=\"confirmSelection()\">\n {{'actions.select' | translate}}\n </button>\n\n </div>\n\n\n</div>\n\n" }]
11578
+ }], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
11579
+ type: Inject,
11580
+ args: [MAT_DIALOG_DATA]
11581
+ }] }]; }, propDecorators: { title: [{
11582
+ type: Input
11583
+ }] } });
11636
11584
 
11637
- class DataContextStateIndicatorComponent {
11585
+ class ElderSelectionDialogDirective {
11638
11586
  /***************************************************************************
11639
11587
  * *
11640
11588
  * Constructor *
11641
11589
  * *
11642
11590
  **************************************************************************/
11643
- constructor() {
11644
- /***************************************************************************
11645
- * *
11646
- * Fields *
11647
- * *
11648
- **************************************************************************/
11649
- this.dataContext$ = new BehaviorSubject(null);
11650
- }
11651
- /***************************************************************************
11652
- * *
11653
- * Life Cycle *
11654
- * *
11655
- **************************************************************************/
11656
- ngOnInit() {
11591
+ constructor(templateRef, dialog) {
11592
+ this.templateRef = templateRef;
11593
+ this.dialog = dialog;
11594
+ this.close = new EventEmitter();
11657
11595
  }
11658
11596
  /***************************************************************************
11659
11597
  * *
11660
- * Properties *
11598
+ * Public API *
11661
11599
  * *
11662
11600
  **************************************************************************/
11663
- set dataContext(dataContext) {
11664
- this.dataContext$.next(dataContext);
11601
+ open() {
11602
+ const dialogRef = this.dialog.open(ElderSelectionDialogComponent, {
11603
+ data: {
11604
+ template: this.templateRef,
11605
+ selectionModel: this.selectionModel
11606
+ },
11607
+ width: '80vw',
11608
+ height: '80vh'
11609
+ });
11610
+ dialogRef.afterClosed().subscribe(result => this.close.emit(result));
11665
11611
  }
11666
11612
  }
11667
- DataContextStateIndicatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextStateIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
11668
- DataContextStateIndicatorComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: DataContextStateIndicatorComponent, selector: "elder-data-context-state-indicator", inputs: { dataContext: "dataContext" }, ngImport: i0, template: "<ng-container *ngIf=\"dataContext$ | async as dataContext\">\n\n <ng-container *ngIf=\"dataContext else noDataContext\">\n\n <ng-container *ngIf=\"(dataContext.isStarted$ | async) else dataContextNotStarted\">\n\n <ng-container *ngIf=\"!(dataContext?.status | async)?.hasError else dataContextHasError\">\n\n <ng-container *ngIf=\"(dataContext?.data | async)?.length === 0\">\n <ng-template [ngTemplateOutlet]=\"dataContextNoData\"></ng-template>\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n</ng-container>\n\n<ng-template #noDataContext>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'No data context'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNotStarted>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'Data context not started'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextHasError>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', iconColor: 'warn', text: 'Error while loading data'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNoData>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'info', text: 'No data available'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #indicator let-icon=\"icon\" let-iconColor=\"iconColor\" let-text=\"text\">\n\n <div fxFill\n fxLayout=\"column\"\n fxLayoutAlign=\"center center\"\n class=\"elder-dc-indicator-container mat-body-1\"\n >\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"16px\">\n <mat-icon [color]=\"iconColor\">{{icon}}</mat-icon>\n <span class=\"hint mat-body-1\">{{text | translate}}</span>\n </div>\n\n </div>\n\n</ng-template>\n", styles: [".elder-dc-indicator-container{color:gray;padding-top:96px;padding-bottom:96px}\n"], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11669
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextStateIndicatorComponent, decorators: [{
11670
- type: Component,
11671
- args: [{ selector: 'elder-data-context-state-indicator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"dataContext$ | async as dataContext\">\n\n <ng-container *ngIf=\"dataContext else noDataContext\">\n\n <ng-container *ngIf=\"(dataContext.isStarted$ | async) else dataContextNotStarted\">\n\n <ng-container *ngIf=\"!(dataContext?.status | async)?.hasError else dataContextHasError\">\n\n <ng-container *ngIf=\"(dataContext?.data | async)?.length === 0\">\n <ng-template [ngTemplateOutlet]=\"dataContextNoData\"></ng-template>\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n</ng-container>\n\n<ng-template #noDataContext>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'No data context'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNotStarted>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'Data context not started'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextHasError>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', iconColor: 'warn', text: 'Error while loading data'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNoData>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'info', text: 'No data available'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #indicator let-icon=\"icon\" let-iconColor=\"iconColor\" let-text=\"text\">\n\n <div fxFill\n fxLayout=\"column\"\n fxLayoutAlign=\"center center\"\n class=\"elder-dc-indicator-container mat-body-1\"\n >\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"16px\">\n <mat-icon [color]=\"iconColor\">{{icon}}</mat-icon>\n <span class=\"hint mat-body-1\">{{text | translate}}</span>\n </div>\n\n </div>\n\n</ng-template>\n", styles: [".elder-dc-indicator-container{color:gray;padding-top:96px;padding-bottom:96px}\n"] }]
11672
- }], ctorParameters: function () { return []; }, propDecorators: { dataContext: [{
11613
+ ElderSelectionDialogDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogDirective, deps: [{ token: i0.TemplateRef }, { token: i1$7.MatDialog }], target: i0.ɵɵFactoryTarget.Directive });
11614
+ ElderSelectionDialogDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionDialogDirective, selector: "[elderDialog]", inputs: { selectionModel: "selectionModel" }, outputs: { close: "close" }, exportAs: ["elderSelection"], ngImport: i0 });
11615
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogDirective, decorators: [{
11616
+ type: Directive,
11617
+ args: [{
11618
+ selector: '[elderDialog]',
11619
+ exportAs: 'elderSelection'
11620
+ }]
11621
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i1$7.MatDialog }]; }, propDecorators: { selectionModel: [{
11673
11622
  type: Input
11623
+ }], close: [{
11624
+ type: Output
11674
11625
  }] } });
11675
11626
 
11676
- class ElderDataCommonModule {
11627
+ /**
11628
+ * @deprecated Please switch to ElderDialogService
11629
+ */
11630
+ class EbsCommonDialogService extends ElderDialogService {
11677
11631
  }
11678
- ElderDataCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
11679
- ElderDataCommonModulemod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, declarations: [ElderDataToolbarComponent,
11680
- ElderToolbarContentDirective,
11681
- ElderSingleSortComponent,
11682
- ElderSelectionMasterCheckboxComponent,
11683
- DataContextSelectionDirective,
11684
- DataContextStateIndicatorComponent], imports: [CommonModule, RouterModule,
11685
- // Material
11686
- MatDividerModule,
11687
- MatCheckboxModule, MatMenuModule,
11688
- MatButtonModule, MatIconModule, MatBadgeModule,
11689
- MatProgressBarModule,
11690
- MatDialogModule, MatTooltipModule,
11691
- // translations
11692
- TranslateModule, FlexLayoutModule], exports: [ElderDataToolbarComponent,
11693
- ElderToolbarContentDirective,
11694
- ElderSingleSortComponent,
11695
- ElderSelectionMasterCheckboxComponent,
11696
- DataContextSelectionDirective,
11697
- DataContextStateIndicatorComponent] });
11698
- ElderDataCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, imports: [CommonModule, RouterModule,
11699
- // Material
11700
- MatDividerModule,
11701
- MatCheckboxModule, MatMenuModule,
11702
- MatButtonModule, MatIconModule, MatBadgeModule,
11703
- MatProgressBarModule,
11704
- MatDialogModule, MatTooltipModule,
11705
- // translations
11706
- TranslateModule, FlexLayoutModule] });
11707
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, decorators: [{
11632
+ EbsCommonDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
11633
+ EbsCommonDialogServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService });
11634
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, decorators: [{
11635
+ type: Injectable
11636
+ }] });
11637
+ class ElderDialogModule {
11638
+ static forRoot() {
11639
+ return {
11640
+ ngModule: ElderDialogModule,
11641
+ providers: [
11642
+ // ElderDialogService,
11643
+ EbsCommonDialogService
11644
+ ]
11645
+ };
11646
+ }
11647
+ }
11648
+ ElderDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
11649
+ ElderDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, declarations: [ElderConfirmDialogComponent,
11650
+ ElderQuestionDialogComponent,
11651
+ ElderSelectionDialogComponent,
11652
+ ElderSelectionDialogDirective], imports: [CommonModule, FormsModule,
11653
+ MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
11654
+ A11yModule,
11655
+ FlexLayoutModule, TranslateModule], exports: [ElderConfirmDialogComponent,
11656
+ ElderQuestionDialogComponent,
11657
+ ElderSelectionDialogComponent,
11658
+ ElderSelectionDialogDirective] });
11659
+ ElderDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, imports: [CommonModule, FormsModule,
11660
+ MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
11661
+ A11yModule,
11662
+ FlexLayoutModule, TranslateModule] });
11663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, decorators: [{
11708
11664
  type: NgModule,
11709
11665
  args: [{
11710
11666
  imports: [
11711
- CommonModule, RouterModule,
11712
- // Material
11713
- MatDividerModule,
11714
- MatCheckboxModule, MatMenuModule,
11715
- MatButtonModule, MatIconModule, MatBadgeModule,
11716
- MatProgressBarModule,
11717
- MatDialogModule, MatTooltipModule,
11718
- // translations
11719
- TranslateModule, FlexLayoutModule,
11667
+ CommonModule, FormsModule,
11668
+ MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
11669
+ A11yModule,
11670
+ FlexLayoutModule, TranslateModule
11720
11671
  ],
11721
11672
  declarations: [
11722
- ElderDataToolbarComponent,
11723
- ElderToolbarContentDirective,
11724
- ElderSingleSortComponent,
11725
- ElderSelectionMasterCheckboxComponent,
11726
- DataContextSelectionDirective,
11727
- DataContextStateIndicatorComponent
11673
+ ElderConfirmDialogComponent,
11674
+ ElderQuestionDialogComponent,
11675
+ ElderSelectionDialogComponent,
11676
+ ElderSelectionDialogDirective
11728
11677
  ],
11729
11678
  exports: [
11730
- ElderDataToolbarComponent,
11731
- ElderToolbarContentDirective,
11732
- ElderSingleSortComponent,
11733
- ElderSelectionMasterCheckboxComponent,
11734
- DataContextSelectionDirective,
11735
- DataContextStateIndicatorComponent
11736
- ],
11679
+ ElderConfirmDialogComponent,
11680
+ ElderQuestionDialogComponent,
11681
+ ElderSelectionDialogComponent,
11682
+ ElderSelectionDialogDirective
11683
+ ]
11737
11684
  }]
11738
11685
  }] });
11739
11686
 
11740
- class TemplatedSelectionDialogComponent {
11687
+ /**
11688
+ * This directive projects content identified by a placeholder id
11689
+ * into the toolbar at the corresponding place.
11690
+ */
11691
+ class ElderToolbarContentDirective {
11692
+ constructor(templateRef) {
11693
+ this.templateRef = templateRef;
11694
+ }
11695
+ }
11696
+ ElderToolbarContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
11697
+ ElderToolbarContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderToolbarContentDirective, selector: "[elderToolbarContent]", inputs: { placeholderId: ["elderToolbarContent", "placeholderId"] }, ngImport: i0 });
11698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, decorators: [{
11699
+ type: Directive,
11700
+ args: [{ selector: '[elderToolbarContent]' }]
11701
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { placeholderId: [{
11702
+ type: Input,
11703
+ args: ['elderToolbarContent']
11704
+ }] } });
11705
+ class ElderDataToolbarComponent {
11706
+ /***************************************************************************
11707
+ * *
11708
+ * Constructor *
11709
+ * *
11710
+ **************************************************************************/
11711
+ constructor(selectionModel, dataView, dialogService) {
11712
+ this.dialogService = dialogService;
11713
+ this.canAdd = true;
11714
+ this.canRemove = true;
11715
+ this.canMore = true;
11716
+ this.confirmRemoval = true;
11717
+ this.keepSelectionAfterRemoval = false;
11718
+ this.requestNew = new Subject();
11719
+ this.requestRemove = new Subject();
11720
+ this.selectionFallback = new BehaviorSubject([]);
11721
+ this.selection$ = this.selectionFallback.asObservable();
11722
+ if (selectionModel) {
11723
+ this.selectionModel = selectionModel;
11724
+ }
11725
+ if (dataView) {
11726
+ this.selectionModel = dataView.selectionModel;
11727
+ }
11728
+ }
11729
+ /***************************************************************************
11730
+ * *
11731
+ * Life Cycle *
11732
+ * *
11733
+ **************************************************************************/
11734
+ ngOnInit() { }
11735
+ /***************************************************************************
11736
+ * *
11737
+ * Properties *
11738
+ * *
11739
+ **************************************************************************/
11740
+ set selectionModel(model) {
11741
+ this._selectionModel = model;
11742
+ if (model) {
11743
+ this.selection$ = model.selection;
11744
+ }
11745
+ else {
11746
+ this.selection$ = this.selectionFallback.asObservable();
11747
+ }
11748
+ }
11749
+ get selectionModel() {
11750
+ return this._selectionModel;
11751
+ }
11752
+ /***************************************************************************
11753
+ * *
11754
+ * Public API *
11755
+ * *
11756
+ **************************************************************************/
11757
+ getTemplate(placeholderId) {
11758
+ if (!this.templates) {
11759
+ return null;
11760
+ }
11761
+ const template = this.templates.find((item) => item.placeholderId === placeholderId);
11762
+ return template ? template.templateRef : null;
11763
+ }
11764
+ requestRemoveItems(items) {
11765
+ if (this.confirmRemoval) {
11766
+ this.dialogService
11767
+ .showConfirm({
11768
+ title: 'dialogs.confirm-deletion.title',
11769
+ message: 'dialogs.confirm-deletion.message',
11770
+ yesNo: true,
11771
+ interpolateParams: { numOfItems: items.length },
11772
+ })
11773
+ .subscribe((confirmed) => {
11774
+ if (confirmed) {
11775
+ this.emitRemove(items);
11776
+ }
11777
+ });
11778
+ }
11779
+ else {
11780
+ this.emitRemove(items);
11781
+ }
11782
+ }
11783
+ emitRemove(items) {
11784
+ this.requestRemove.next(items);
11785
+ if (!this.keepSelectionAfterRemoval) {
11786
+ // Clear the selection after deleting items
11787
+ if (this._selectionModel) {
11788
+ this._selectionModel.deselect(items);
11789
+ }
11790
+ }
11791
+ }
11792
+ }
11793
+ ElderDataToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataToolbarComponent, deps: [{ token: SelectionModel, optional: true }, { token: ELDER_DATA_VIEW, optional: true }, { token: ElderDialogService }], target: i0.ɵɵFactoryTarget.Component });
11794
+ ElderDataToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderDataToolbarComponent, selector: "elder-data-toolbar", inputs: { canAdd: "canAdd", canRemove: "canRemove", canMore: "canMore", confirmRemoval: "confirmRemoval", keepSelectionAfterRemoval: "keepSelectionAfterRemoval", selectionModel: "selectionModel" }, outputs: { requestNew: "requestNew", requestRemove: "requestRemove" }, queries: [{ propertyName: "templates", predicate: ElderToolbarContentDirective }], ngImport: i0, template: "<!-- Table Toolbar -->\n<div\n fxLayout=\"row\"\n fxLayoutAlign=\"space-between center\"\n fxLayoutGap=\"10px\"\n style=\"padding: 4px 8px 0 8px\"\n *ngIf=\"selection$ | async as selection\"\n>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('main') || defaultContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n</div>\n\n<!-- Default Templates -->\n\n<!-- Default Main Content -->\n<ng-template #defaultContent let-selection>\n <!-- Left column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left') || defaultLeftContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('center') || defaultCenterContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <!-- Right column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right') || defaultRightContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n</ng-template>\n\n<!-- Default Left Content -->\n<ng-template #defaultLeftContent let-selection>\n <!-- Add Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canAdd\"\n (click)=\"requestNew.next($event)\"\n >\n <mat-icon>add</mat-icon>\n </button>\n\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n</ng-template>\n\n<!-- Default Center Content -->\n<ng-template #defaultCenterContent let-selection> </ng-template>\n\n<!-- Default Right Content -->\n<ng-template #defaultRightContent let-selection>\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n\n <!-- Delete Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canRemove\"\n [disabled]=\"!selection?.length\"\n (click)=\"requestRemoveItems(selection)\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n\n <!-- More Menu -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n [matMenuTriggerFor]=\"elderTableMenu\"\n [disabled]=\"!canMore\"\n >\n <mat-icon>more_vert</mat-icon>\n <mat-menu #elderTableMenu=\"matMenu\">\n <ng-content select=\"[mat-menu-item]\"></ng-content>\n <!-- Placeholder for mat menu items-->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.menu');\n context: { $implicit: selection }\n \"\n ></ng-container>\n </mat-menu>\n </button>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11795
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataToolbarComponent, decorators: [{
11796
+ type: Component,
11797
+ args: [{ selector: 'elder-data-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Table Toolbar -->\n<div\n fxLayout=\"row\"\n fxLayoutAlign=\"space-between center\"\n fxLayoutGap=\"10px\"\n style=\"padding: 4px 8px 0 8px\"\n *ngIf=\"selection$ | async as selection\"\n>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('main') || defaultContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n</div>\n\n<!-- Default Templates -->\n\n<!-- Default Main Content -->\n<ng-template #defaultContent let-selection>\n <!-- Left column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left') || defaultLeftContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('center') || defaultCenterContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <!-- Right column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right') || defaultRightContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n</ng-template>\n\n<!-- Default Left Content -->\n<ng-template #defaultLeftContent let-selection>\n <!-- Add Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canAdd\"\n (click)=\"requestNew.next($event)\"\n >\n <mat-icon>add</mat-icon>\n </button>\n\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n</ng-template>\n\n<!-- Default Center Content -->\n<ng-template #defaultCenterContent let-selection> </ng-template>\n\n<!-- Default Right Content -->\n<ng-template #defaultRightContent let-selection>\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n\n <!-- Delete Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canRemove\"\n [disabled]=\"!selection?.length\"\n (click)=\"requestRemoveItems(selection)\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n\n <!-- More Menu -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n [matMenuTriggerFor]=\"elderTableMenu\"\n [disabled]=\"!canMore\"\n >\n <mat-icon>more_vert</mat-icon>\n <mat-menu #elderTableMenu=\"matMenu\">\n <ng-content select=\"[mat-menu-item]\"></ng-content>\n <!-- Placeholder for mat menu items-->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.menu');\n context: { $implicit: selection }\n \"\n ></ng-container>\n </mat-menu>\n </button>\n</ng-template>\n" }]
11798
+ }], ctorParameters: function () { return [{ type: SelectionModel, decorators: [{
11799
+ type: Optional
11800
+ }] }, { type: undefined, decorators: [{
11801
+ type: Optional
11802
+ }, {
11803
+ type: Inject,
11804
+ args: [ELDER_DATA_VIEW]
11805
+ }] }, { type: ElderDialogService }]; }, propDecorators: { canAdd: [{
11806
+ type: Input
11807
+ }], canRemove: [{
11808
+ type: Input
11809
+ }], canMore: [{
11810
+ type: Input
11811
+ }], confirmRemoval: [{
11812
+ type: Input
11813
+ }], keepSelectionAfterRemoval: [{
11814
+ type: Input
11815
+ }], requestNew: [{
11816
+ type: Output
11817
+ }], requestRemove: [{
11818
+ type: Output
11819
+ }], templates: [{
11820
+ type: ContentChildren,
11821
+ args: [ElderToolbarContentDirective]
11822
+ }], selectionModel: [{
11823
+ type: Input
11824
+ }] } });
11825
+
11826
+ class ElderSingleSortComponent {
11741
11827
  /***************************************************************************
11742
11828
  * *
11743
11829
  * Constructor *
11744
11830
  * *
11745
11831
  **************************************************************************/
11746
- constructor(dialogRef, data, selectionModel) {
11747
- this.dialogRef = dialogRef;
11748
- this.data = data;
11749
- this.selectionModel = selectionModel;
11832
+ constructor() {
11750
11833
  /***************************************************************************
11751
11834
  * *
11752
11835
  * Fields *
11753
11836
  * *
11754
11837
  **************************************************************************/
11755
11838
  this.log = LoggerFactory.getLogger(this.constructor.name);
11839
+ this.sort$ = new BehaviorSubject(Sort.NONE);
11840
+ this.availableSorts = [];
11841
+ this.sortChange = new EventEmitter();
11842
+ this.translationPrefix = 'documents.sorts.';
11756
11843
  }
11757
11844
  /***************************************************************************
11758
11845
  * *
11759
- * Component Events *
11846
+ * Life Cycle *
11760
11847
  * *
11761
11848
  **************************************************************************/
11762
11849
  ngOnInit() {
11763
11850
  }
11764
- }
11765
- TemplatedSelectionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: TemplatedSelectionDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: SelectionModel }], target: i0.ɵɵFactoryTarget.Component });
11766
- TemplatedSelectionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: TemplatedSelectionDialogComponent, selector: "elder-templated-selection-dialog", ngImport: i0, template: "<div fxLayout=\"column\" fxFill>\n <mat-toolbar elderTheme fxFlex=\"none\">\n <button mat-icon-button type=\"button\" matDialogClose=\"\">\n <mat-icon>close</mat-icon>\n </button>\n <span fxFlex></span>\n <button mat-stroked-button type=\"submit\" color=\"accent\"\n *ngIf=\"selectionModel.selection | async as selection\"\n [disabled]=\"!selection || selection.length === 0\"\n [mat-dialog-close]=\"selection\"\n >\n {{'actions.select' | translate}}\n </button>\n </mat-toolbar>\n <div fxLayout=\"column\" fxFlex style=\"overflow: hidden\">\n <ng-container *ngTemplateOutlet=\"data.selectionComponentTemplate\"></ng-container>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i1$7.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: ElderThemeDirective, selector: "[elderTheme]" }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11767
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: TemplatedSelectionDialogComponent, decorators: [{
11768
- type: Component,
11769
- args: [{ selector: 'elder-templated-selection-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div fxLayout=\"column\" fxFill>\n <mat-toolbar elderTheme fxFlex=\"none\">\n <button mat-icon-button type=\"button\" matDialogClose=\"\">\n <mat-icon>close</mat-icon>\n </button>\n <span fxFlex></span>\n <button mat-stroked-button type=\"submit\" color=\"accent\"\n *ngIf=\"selectionModel.selection | async as selection\"\n [disabled]=\"!selection || selection.length === 0\"\n [mat-dialog-close]=\"selection\"\n >\n {{'actions.select' | translate}}\n </button>\n </mat-toolbar>\n <div fxLayout=\"column\" fxFlex style=\"overflow: hidden\">\n <ng-container *ngTemplateOutlet=\"data.selectionComponentTemplate\"></ng-container>\n </div>\n</div>\n" }]
11770
- }], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
11771
- type: Inject,
11772
- args: [MAT_DIALOG_DATA]
11773
- }] }, { type: SelectionModel }]; } });
11774
-
11775
- class ColumnPositionSpec {
11776
- constructor(position, relativeTo) {
11777
- this.position = position;
11778
- this.relativeTo = relativeTo;
11779
- }
11780
- static relativeToColumn(col, position) {
11781
- return new ColumnPositionSpec(position, col);
11782
- }
11783
- static relativeToPrevGroup(position) {
11784
- return new ColumnPositionSpec(position, null);
11785
- }
11786
- }
11787
- class ElderColumnGroup {
11788
- constructor(groupIndex, columnsPosition, columns) {
11789
- this.groupIndex = groupIndex;
11790
- this.columnsPosition = columnsPosition;
11791
- this.columns = columns;
11792
- }
11793
- }
11794
- class ElderColumnLayout {
11795
- constructor() {
11796
- /***************************************************************************
11797
- * *
11798
- * Fields *
11799
- * *
11800
- **************************************************************************/
11801
- this.log = LoggerFactory.getLogger(this.constructor.name);
11802
- }
11803
11851
  /***************************************************************************
11804
11852
  * *
11805
- * Public API *
11853
+ * Properties *
11806
11854
  * *
11807
11855
  **************************************************************************/
11808
- layoutColumns(colGroups) {
11809
- const sortedCols = this.renderColumns(colGroups);
11810
- // Support absolute column positioning
11811
- const cdkCols = sortedCols.map(col => col.cdkColumn);
11812
- return cdkCols;
11856
+ set sort(sort) {
11857
+ if (!sort) {
11858
+ sort = Sort.NONE;
11859
+ }
11860
+ this.sort$.next(sort);
11861
+ }
11862
+ get sort() {
11863
+ return this.sort$.getValue();
11813
11864
  }
11814
11865
  /***************************************************************************
11815
11866
  * *
11816
- * Private methods *
11867
+ * API *
11817
11868
  * *
11818
11869
  **************************************************************************/
11819
- renderColumns(colGroups) {
11820
- const groupHierarchy = this.sortGroupsByIndex(colGroups);
11821
- const sorted = [];
11822
- // Now we can insert groups in defined order
11823
- let previousIndex = {
11824
- startIndex: 0,
11825
- endIndex: 0
11826
- };
11827
- for (const grp of groupHierarchy) {
11828
- // grp defined position relative to prev group
11829
- previousIndex = this.insertColumnsAt(sorted, grp.columns, grp.columnsPosition, previousIndex);
11830
- }
11831
- return sorted;
11870
+ setSortProp(sortProp) {
11871
+ const sort = new Sort(sortProp, this.sort.dir);
11872
+ this.setSort(sort);
11832
11873
  }
11833
- insertColumnsAt(existingColumns, groupItems, positionSpec, previousGroup) {
11834
- let insertIndex;
11835
- if (positionSpec.relativeTo) {
11836
- insertIndex = this.calcInsertIndexRelativeToColumn(positionSpec.position, positionSpec.relativeTo, existingColumns);
11874
+ toggleSortDirection(event) {
11875
+ event.stopPropagation();
11876
+ let dir;
11877
+ if (this.sort.dir === 'asc') {
11878
+ dir = 'desc';
11837
11879
  }
11838
11880
  else {
11839
- insertIndex = this.calcInsertIndexRelativeToPreviousGroup(positionSpec.position, existingColumns, previousGroup);
11840
- }
11841
- existingColumns.splice(insertIndex, 0, ...groupItems);
11842
- return {
11843
- startIndex: insertIndex,
11844
- endIndex: insertIndex + groupItems.length
11845
- };
11846
- }
11847
- calcInsertIndexRelativeToColumn(position, relativeToCol, existingColumns) {
11848
- const relativeIndex = existingColumns
11849
- .findIndex(c => c.cdkColumn.name === relativeToCol);
11850
- switch (position) {
11851
- case 'start':
11852
- case 'after':
11853
- // after relative
11854
- return relativeIndex + 1;
11855
- case 'before':
11856
- case 'end':
11857
- // before relative
11858
- return relativeIndex;
11859
- }
11860
- }
11861
- calcInsertIndexRelativeToPreviousGroup(position, existingColumns, previousGroup) {
11862
- switch (position) {
11863
- case 'start':
11864
- return 0;
11865
- case 'end':
11866
- return existingColumns.length;
11867
- case 'after':
11868
- // after relative to previous group
11869
- return previousGroup.endIndex;
11870
- case 'before':
11871
- // before relative to previous group
11872
- return previousGroup.startIndex;
11881
+ dir = 'asc';
11873
11882
  }
11883
+ this.setSort(new Sort(this.sort.prop, dir));
11874
11884
  }
11875
- sortGroupsByIndex(colGroups) {
11876
- return colGroups
11877
- .sort((a, b) => {
11878
- return naturalValueComparator(a.groupIndex, b.groupIndex);
11879
- }).reverse();
11885
+ setSort(sort) {
11886
+ this.sort = sort;
11887
+ this.sortChange.emit(sort);
11880
11888
  }
11881
11889
  }
11890
+ ElderSingleSortComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSingleSortComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
11891
+ ElderSingleSortComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSingleSortComponent, selector: "elder-single-sort", inputs: { availableSorts: "availableSorts", translationPrefix: "translationPrefix", sort: "sort" }, outputs: { sortChange: "sortChange" }, ngImport: i0, template: "<div *ngIf=\"(sort$ | async) as sort\" fxLayout=\"row\" fxFlex=\"none\">\n\n <button mat-button type=\"button\" [matMenuTriggerFor]=\"menu\">\n\n {{ translationPrefix + sort.prop | translate}}\n\n <mat-icon style=\"font-size: 22px\">sort</mat-icon>\n\n <mat-menu #menu=\"matMenu\">\n <button mat-menu-item type=\"button\"\n *ngFor=\"let mysort of availableSorts\"\n (click)=\"setSortProp(mysort)\"\n >\n <mat-icon>sort</mat-icon>\n <span [class.mat-body-strong]=\"sort.prop == mysort\">{{translationPrefix + mysort | translate}}</span>\n </button>\n </mat-menu>\n\n </button>\n\n <button mat-icon-button type=\"button\" (click)=\"toggleSortDirection($event)\">\n <mat-icon style=\"font-size: 22px\">{{sort.dir === 'asc' ? 'arrow_downward' : 'arrow_upward'}}</mat-icon>\n </button>\n\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11892
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSingleSortComponent, decorators: [{
11893
+ type: Component,
11894
+ args: [{ selector: 'elder-single-sort', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"(sort$ | async) as sort\" fxLayout=\"row\" fxFlex=\"none\">\n\n <button mat-button type=\"button\" [matMenuTriggerFor]=\"menu\">\n\n {{ translationPrefix + sort.prop | translate}}\n\n <mat-icon style=\"font-size: 22px\">sort</mat-icon>\n\n <mat-menu #menu=\"matMenu\">\n <button mat-menu-item type=\"button\"\n *ngFor=\"let mysort of availableSorts\"\n (click)=\"setSortProp(mysort)\"\n >\n <mat-icon>sort</mat-icon>\n <span [class.mat-body-strong]=\"sort.prop == mysort\">{{translationPrefix + mysort | translate}}</span>\n </button>\n </mat-menu>\n\n </button>\n\n <button mat-icon-button type=\"button\" (click)=\"toggleSortDirection($event)\">\n <mat-icon style=\"font-size: 22px\">{{sort.dir === 'asc' ? 'arrow_downward' : 'arrow_upward'}}</mat-icon>\n </button>\n\n</div>\n" }]
11895
+ }], ctorParameters: function () { return []; }, propDecorators: { availableSorts: [{
11896
+ type: Input
11897
+ }], sortChange: [{
11898
+ type: Output
11899
+ }], translationPrefix: [{
11900
+ type: Input
11901
+ }], sort: [{
11902
+ type: Input
11903
+ }] } });
11882
11904
 
11883
- class ElderTableGroup {
11884
- constructor(id, index) {
11885
- this.id = id;
11886
- this.index = index;
11887
- }
11888
- static create(groupIndex) {
11889
- return ElderTableGroup.of(UuidUtil.weakUuid4(), groupIndex);
11890
- }
11891
- static of(id, groupIndex) {
11892
- return new ElderTableGroup(id, groupIndex);
11905
+ class MasterSelectionState {
11906
+ constructor(count, allSelected, someSelected, anySelected) {
11907
+ this.count = count;
11908
+ this.allSelected = allSelected;
11909
+ this.someSelected = someSelected;
11910
+ this.anySelected = anySelected;
11893
11911
  }
11894
11912
  }
11895
- class ElderTableModel {
11913
+
11914
+ class DataContextSelectionDirective {
11896
11915
  /***************************************************************************
11897
11916
  * *
11898
11917
  * Constructor *
11899
11918
  * *
11900
11919
  **************************************************************************/
11901
- constructor() {
11920
+ constructor(selectionModel) {
11902
11921
  /***************************************************************************
11903
11922
  * *
11904
11923
  * Fields *
11905
11924
  * *
11906
11925
  **************************************************************************/
11907
- this.logger = LoggerFactory.getLogger(this.constructor.name);
11908
- this.elderColumnLayout = new ElderColumnLayout();
11909
- this._groups = new Map();
11910
- this._columnGroups = new ReactiveMap();
11911
- this._rowDefGroups = new ReactiveMap();
11912
- this._sortGroups = new ReactiveMap();
11913
- this.selectionVisible$ = new BehaviorSubject(false);
11914
- /**
11915
- * The columns to display explicitly set by the user.
11916
- * We need to support inserting display columns by index or anchored to existing ones.
11917
- * before([columns])
11918
- * after()
11919
- * start()
11920
- * end([])
11921
- * @private
11922
- */
11923
- this.displayedColumns$ = new BehaviorSubject(undefined);
11924
- this.displayedColumnsInner$ = this.renderDisplayedColumns(this.displayedColumns$, this.columnDefs$, this.selectionVisible$);
11926
+ this.log = LoggerFactory.getLogger(this.constructor.name);
11927
+ this.selectionModel$ = new BehaviorSubject(null);
11928
+ this.dataContext$ = new BehaviorSubject(null);
11929
+ this.selectionModel$.next(selectionModel);
11930
+ this.selectionState$ = this.buildSelectionState$(this.selectionModel$, this.dataContext$);
11925
11931
  }
11926
11932
  /***************************************************************************
11927
11933
  * *
11928
11934
  * Properties *
11929
11935
  * *
11930
11936
  **************************************************************************/
11931
- set selectionVisible(visible) {
11932
- this.selectionVisible$.next(visible);
11933
- }
11934
- get selectionVisible() {
11935
- return this.selectionVisible$.getValue();
11936
- }
11937
- set displayedColumns(columns) {
11938
- this.displayedColumns$.next(columns);
11939
- }
11940
- get displayedColumns() {
11941
- return this.displayedColumns$.getValue();
11942
- }
11943
- /***************************************************************************
11944
- * *
11945
- * Rendered Properties *
11946
- * *
11947
- **************************************************************************/
11948
- get columnDefs$() {
11949
- return this._columnGroups.values$.pipe(map(groups => this.elderColumnLayout.layoutColumns(groups)));
11950
- }
11951
- get rowDefs$() {
11952
- return this.sortAndFlatten(this._rowDefGroups);
11937
+ set selectionModel(model) {
11938
+ this.selectionModel$.next(model);
11953
11939
  }
11954
- get sorts$() {
11955
- return this._sortGroups.values$;
11940
+ get selectionModel() {
11941
+ return this.selectionModel$.getValue();
11956
11942
  }
11957
- // ---
11958
- valuesSortedByGroupIndex(myMap, groups) {
11959
- return Array.from(myMap.entries())
11960
- .sort(([a_key], [b_key]) => {
11961
- const grpAIndex = groups.get(a_key)?.index ?? 0;
11962
- const grpBIndex = groups.get(b_key)?.index ?? 0;
11963
- return naturalValueComparator(grpAIndex, grpBIndex);
11964
- }).map(([a_key, a_value]) => a_value);
11943
+ set dataContext(dataContext) {
11944
+ this.dataContext$.next(dataContext);
11965
11945
  }
11966
- sortAndFlatten(reactMap) {
11967
- return reactMap.map$.pipe(map(myMap => this.valuesSortedByGroupIndex(myMap, this._groups)), map(columns => CollectionUtil.flatten(columns)));
11946
+ /** Whether the number of selected elements matches the totalSnapshot number of selectable rows. */
11947
+ get isAllSelectedSnapshot() {
11948
+ const numSelected = this.selectionModel.selectionSnapshot.length;
11949
+ const context = this.dataContext$.getValue();
11950
+ const numRows = context ? context.snapshot.data.length : 0;
11951
+ const numUnselectable = context ? context.snapshot.data.filter(i => !this.selectionModel.isSelectable(i)).length : 0;
11952
+ return numSelected >= numRows - numUnselectable; // True if all selectable items are selected
11968
11953
  }
11969
- /*
11970
- public get sortHeaders$(): Observable<MatSortHeader[]> {
11971
- return this._sortGroups.values$.pipe(
11972
- map(groups => this.flattenDefs(groups))
11973
- );
11974
- }*/
11975
11954
  /***************************************************************************
11976
11955
  * *
11977
11956
  * Public API *
11978
11957
  * *
11979
11958
  **************************************************************************/
11980
- registerGroup(group) {
11981
- this._groups.set(group.id, group);
11982
- }
11983
- updateColumnGroup(group, columnGroup) {
11984
- this._columnGroups.set(group.id, columnGroup);
11985
- }
11986
- updateRowDefs(group, rows) {
11987
- this._rowDefGroups.set(group.id, rows);
11988
- }
11989
- updateSortGroup(group, sort) {
11990
- this._sortGroups.set(group.id, sort);
11991
- }
11992
- clearColumnDefGroup(group) {
11993
- this._columnGroups.delete(group.id);
11994
- }
11995
- clearRowDefGroup(group) {
11996
- this._rowDefGroups.delete(group.id);
11997
- }
11998
- clearSortGroup(group) {
11999
- this._sortGroups.delete(group.id);
12000
- }
12001
- deRegisterGroup(group) {
12002
- this.clearColumnDefGroup(group);
12003
- this.clearRowDefGroup(group);
12004
- this.clearSortGroup(group);
12005
- this._groups.delete(group.id);
11959
+ /** Selects all rows if they are not all selected; otherwise clear selection. */
11960
+ masterToggle() {
11961
+ this.log.debug('masterToggle triggered, toggling all!');
11962
+ if (this.isAllSelectedSnapshot) {
11963
+ this.selectionModel.clear();
11964
+ }
11965
+ else {
11966
+ const context = this.dataContext$.getValue();
11967
+ if (context) {
11968
+ this.selectionModel.select(context.snapshot.data);
11969
+ }
11970
+ }
12006
11971
  }
12007
11972
  /***************************************************************************
12008
11973
  * *
12009
11974
  * Private methods *
12010
11975
  * *
12011
11976
  **************************************************************************/
12012
- renderDisplayedColumns(userDefinedColumns$, columnDefs$, selectionVisible$) {
12013
- return combineLatest([userDefinedColumns$, columnDefs$, selectionVisible$]).pipe(map(([displayedColumns, columnDefs, selectionVisible]) => {
12014
- let columns = displayedColumns;
12015
- if (!columns) {
12016
- columns = [];
12017
- // If the user did not define columns to display
12018
- // Assume he wants all his own columns in given order
12019
- if (columnDefs) {
12020
- columnDefs.forEach(col => {
12021
- columns.push(col.name);
12022
- });
12023
- }
12024
- }
12025
- if (this.selectionVisible) {
12026
- columns = ['select', ...columns];
12027
- }
12028
- return columns;
11977
+ buildSelectionState$(selectionModel$, dataContext$) {
11978
+ return combineLatest([selectionModel$, dataContext$]).pipe(filter(([model, dc]) => !!model && !!dc), switchMap(([model, dc]) => this.buildSelectionStateInner$(model, dc)));
11979
+ }
11980
+ buildSelectionStateInner$(model, dc) {
11981
+ return combineLatest([model.selection, dc.data]).pipe(map(([selection, currentData]) => {
11982
+ const unselectable = currentData.filter(i => !model.isSelectable(i));
11983
+ return new MasterSelectionState(selection.length, selection.length >= currentData.length - unselectable.length, selection.length > 0 && selection.length < currentData.length - unselectable.length, selection.length > 0);
12029
11984
  }));
12030
11985
  }
12031
11986
  }
12032
- ElderTableModel.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12033
- ElderTableModelprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel });
12034
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel, decorators: [{
12035
- type: Injectable
12036
- }], ctorParameters: function () { return []; } });
12037
-
12038
- function existingOrNewElderTableModel(modelProvider) {
12039
- return modelProvider ?? newElderTableModel();
12040
- }
12041
- function newElderTableModel() {
12042
- return new ElderTableModel();
12043
- }
12044
- class ElderTableProviders {
12045
- }
12046
- /**
12047
- * Uses the existing ElderTableModel from a parent if available.
12048
- * Otherwise, creates a new ElderTableModel and provides it.
12049
- */
12050
- ElderTableProviders.ExistingOrNewTableModel = {
12051
- provide: ElderTableModel,
12052
- useFactory: existingOrNewElderTableModel,
12053
- deps: [[new Optional(), new SkipSelf(), ElderTableModel]]
12054
- };
12055
- /**
12056
- * Creates a new ElderTableModel root and provides it,
12057
- * even if there is an existing parent table model.
12058
- */
12059
- ElderTableProviders.NewTableModelRoot = {
12060
- provide: ElderTableModel,
12061
- useFactory: newElderTableModel
12062
- };
12063
- /**
12064
- * If there is an existing ElderTableModel service provided, clears it.
12065
- *
12066
- * Child components will therefore be blocked from accessing any parent TableModel service
12067
- * and are instead forced to create their own.
12068
- *
12069
- * This supports nesting ElderTable without sharing the table model / columns.
12070
- */
12071
- ElderTableProviders.ClearTableModel = {
12072
- provide: ElderTableModel,
12073
- useValue: null
12074
- };
11987
+ DataContextSelectionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextSelectionDirective, deps: [{ token: SelectionModel, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
11988
+ DataContextSelectionDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: DataContextSelectionDirective, selector: "[elderDataContextSelection]", inputs: { selectionModel: ["elderDataContextSelectionModel", "selectionModel"], dataContext: ["elderDataContextSelection", "dataContext"] }, exportAs: ["elderDataContextSelection"], ngImport: i0 });
11989
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextSelectionDirective, decorators: [{
11990
+ type: Directive,
11991
+ args: [{
11992
+ selector: '[elderDataContextSelection]',
11993
+ exportAs: 'elderDataContextSelection'
11994
+ }]
11995
+ }], ctorParameters: function () { return [{ type: SelectionModel, decorators: [{
11996
+ type: Optional
11997
+ }] }]; }, propDecorators: { selectionModel: [{
11998
+ type: Input,
11999
+ args: ['elderDataContextSelectionModel']
12000
+ }], dataContext: [{
12001
+ type: Input,
12002
+ args: ['elderDataContextSelection']
12003
+ }] } });
12075
12004
 
12076
- /**
12077
- * Configures the selection mode on supporting components.
12078
- */
12079
- class ElderDataViewSelectionMode {
12080
- constructor() {
12081
- this.sorts = [];
12082
- this.filters = [];
12083
- this.multi = false;
12084
- }
12085
- }
12086
- function createSelectionModel() {
12087
- return new SelectionModel();
12088
- }
12089
- function createDataViewSelection() {
12090
- return new ElderDataViewSelectionMode();
12091
- }
12092
- class SelectionModelPopupDirective {
12005
+ class ElderSelectionMasterCheckboxComponent {
12093
12006
  /***************************************************************************
12094
12007
  * *
12095
12008
  * Constructor *
12096
12009
  * *
12097
12010
  **************************************************************************/
12098
- constructor(templateRef, viewContainer, dialog, dataViewSelectionMode, selectionModel, changeDetectorRef) {
12099
- this.templateRef = templateRef;
12100
- this.viewContainer = viewContainer;
12101
- this.dialog = dialog;
12102
- this.dataViewSelectionMode = dataViewSelectionMode;
12103
- this.selectionModel = selectionModel;
12104
- this.changeDetectorRef = changeDetectorRef;
12011
+ constructor(dataContextSelection) {
12012
+ this.dataContextSelection = dataContextSelection;
12105
12013
  /***************************************************************************
12106
12014
  * *
12107
12015
  * Fields *
12108
12016
  * *
12109
12017
  **************************************************************************/
12110
- this.log = LoggerFactory.getLogger(this.constructor.name);
12111
- }
12112
- set elderSelectionModelPopupTransform(fn) {
12113
- this._transformerFn = fn;
12018
+ this.logger = LoggerFactory.getLogger(this.constructor.name);
12114
12019
  }
12115
12020
  /***************************************************************************
12116
12021
  * *
12117
- * Host Listeners *
12022
+ * Life Cycle *
12118
12023
  * *
12119
12024
  **************************************************************************/
12025
+ ngOnInit() {
12026
+ }
12027
+ }
12028
+ ElderSelectionMasterCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionMasterCheckboxComponent, deps: [{ token: DataContextSelectionDirective }], target: i0.ɵɵFactoryTarget.Component });
12029
+ ElderSelectionMasterCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionMasterCheckboxComponent, selector: "elder-selection-master-checkbox", ngImport: i0, template: "<div\n *ngIf=\"\n dataContextSelection.selectionModel.isMultipleSelection\n && dataContextSelection?.selectionState$ | async as selectionState\"\n\n fxLayout=\"column\" fxFlex=\"none\"\n\n [matBadgeHidden]=\"selectionState.count === 0\"\n [matBadge]=\"selectionState.count + ''\"\n [matBadgePosition]=\"'above before'\"\n [matBadgeOverlap]=\"false\"\n [matBadgeSize]=\"'small'\"\n>\n <mat-checkbox fxFlex=\"none\"\n (change)=\"$event ? dataContextSelection.masterToggle() : null\"\n [checked]=\"selectionState.allSelected\"\n [indeterminate]=\"selectionState.someSelected\"\n >\n </mat-checkbox>\n</div>\n\n<!-- -->\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$8.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i4$3.MatBadge, selector: "[matBadge]", inputs: ["matBadgeDisabled", "matBadgeColor", "matBadgeOverlap", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
12030
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionMasterCheckboxComponent, decorators: [{
12031
+ type: Component,
12032
+ args: [{ selector: 'elder-selection-master-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"\n dataContextSelection.selectionModel.isMultipleSelection\n && dataContextSelection?.selectionState$ | async as selectionState\"\n\n fxLayout=\"column\" fxFlex=\"none\"\n\n [matBadgeHidden]=\"selectionState.count === 0\"\n [matBadge]=\"selectionState.count + ''\"\n [matBadgePosition]=\"'above before'\"\n [matBadgeOverlap]=\"false\"\n [matBadgeSize]=\"'small'\"\n>\n <mat-checkbox fxFlex=\"none\"\n (change)=\"$event ? dataContextSelection.masterToggle() : null\"\n [checked]=\"selectionState.allSelected\"\n [indeterminate]=\"selectionState.someSelected\"\n >\n </mat-checkbox>\n</div>\n\n<!-- -->\n" }]
12033
+ }], ctorParameters: function () { return [{ type: DataContextSelectionDirective }]; } });
12034
+
12035
+ class DataContextStateIndicatorComponent {
12120
12036
  /***************************************************************************
12121
12037
  * *
12122
- * Life Cycle *
12038
+ * Constructor *
12123
12039
  * *
12124
12040
  **************************************************************************/
12125
- ngOnInit() { }
12126
- ngOnDestroy() { }
12041
+ constructor() {
12042
+ /***************************************************************************
12043
+ * *
12044
+ * Fields *
12045
+ * *
12046
+ **************************************************************************/
12047
+ this.dataContext$ = new BehaviorSubject(null);
12048
+ }
12127
12049
  /***************************************************************************
12128
12050
  * *
12129
- * Public API *
12051
+ * Life Cycle *
12130
12052
  * *
12131
12053
  **************************************************************************/
12132
- /**
12133
- * Let the user choose some entities and return the selection.
12134
- */
12135
- choose(keyGetter, currentSelection, filters, sorts, multi = false) {
12136
- this.dataViewSelectionMode.filters = filters || [];
12137
- this.dataViewSelectionMode.sorts = sorts || [];
12138
- this.dataViewSelectionMode.multi = multi;
12139
- this.selectionModel.isMultipleSelection = multi;
12140
- this.selectionModel.keyGetterFn = keyGetter;
12141
- this.selectionModel.replaceSelection(currentSelection);
12142
- this.log.info('Replaced selection popup with current ' + currentSelection.length + ' entities:', currentSelection);
12143
- const dialogRef = this.openSelectDialog();
12144
- // This fixes dialog rendering when the browser template
12145
- // view container is outside the invoking control, which
12146
- // happens when use ng-content projection.
12147
- this.changeDetectorRef.markForCheck();
12148
- return dialogRef.afterClosed().pipe(switchMap((chosenEntities) => {
12149
- if (chosenEntities) {
12150
- return this._transformerFn
12151
- ? of(chosenEntities.map(value => this._transformerFn(value)))
12152
- : of(chosenEntities);
12153
- }
12154
- else {
12155
- return EMPTY;
12156
- }
12157
- }));
12054
+ ngOnInit() {
12158
12055
  }
12159
12056
  /***************************************************************************
12160
12057
  * *
12161
- * Private methods *
12058
+ * Properties *
12162
12059
  * *
12163
12060
  **************************************************************************/
12164
- openSelectDialog() {
12165
- return this.dialog.open(TemplatedSelectionDialogComponent, {
12166
- width: '90vw',
12167
- height: '90vh',
12168
- panelClass: 'custom-dialog-container',
12169
- data: {
12170
- selectionComponentTemplate: this.templateRef
12171
- },
12172
- viewContainerRef: this.viewContainer
12173
- });
12061
+ set dataContext(dataContext) {
12062
+ this.dataContext$.next(dataContext);
12174
12063
  }
12175
12064
  }
12176
- SelectionModelPopupDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SelectionModelPopupDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i1$7.MatDialog }, { token: ElderDataViewSelectionMode }, { token: SelectionModel }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
12177
- SelectionModelPopupDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: SelectionModelPopupDirective, selector: "[elderSelectionModelPopup]", inputs: { elderSelectionModelPopupTransform: "elderSelectionModelPopupTransform" }, providers: [
12178
- {
12179
- provide: SelectionModel,
12180
- useFactory: createSelectionModel
12181
- },
12182
- {
12183
- provide: ElderDataViewSelectionMode,
12184
- useFactory: createDataViewSelection
12185
- },
12186
- ElderTableProviders.ClearTableModel // Since this popup is frequently used inside an elder-table search box
12187
- ], ngImport: i0 });
12188
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SelectionModelPopupDirective, decorators: [{
12189
- type: Directive,
12065
+ DataContextStateIndicatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextStateIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12066
+ DataContextStateIndicatorComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: DataContextStateIndicatorComponent, selector: "elder-data-context-state-indicator", inputs: { dataContext: "dataContext" }, ngImport: i0, template: "<ng-container *ngIf=\"dataContext$ | async as dataContext\">\n\n <ng-container *ngIf=\"dataContext else noDataContext\">\n\n <ng-container *ngIf=\"(dataContext.isStarted$ | async) else dataContextNotStarted\">\n\n <ng-container *ngIf=\"!(dataContext?.status | async)?.hasError else dataContextHasError\">\n\n <ng-container *ngIf=\"(dataContext?.data | async)?.length === 0\">\n <ng-template [ngTemplateOutlet]=\"dataContextNoData\"></ng-template>\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n</ng-container>\n\n<ng-template #noDataContext>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'No data context'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNotStarted>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'Data context not started'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextHasError>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', iconColor: 'warn', text: 'Error while loading data'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNoData>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'info', text: 'No data available'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #indicator let-icon=\"icon\" let-iconColor=\"iconColor\" let-text=\"text\">\n\n <div fxFill\n fxLayout=\"column\"\n fxLayoutAlign=\"center center\"\n class=\"elder-dc-indicator-container mat-body-1\"\n >\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"16px\">\n <mat-icon [color]=\"iconColor\">{{icon}}</mat-icon>\n <span class=\"hint mat-body-1\">{{text | translate}}</span>\n </div>\n\n </div>\n\n</ng-template>\n", styles: [".elder-dc-indicator-container{color:gray;padding-top:96px;padding-bottom:96px}\n"], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
12067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextStateIndicatorComponent, decorators: [{
12068
+ type: Component,
12069
+ args: [{ selector: 'elder-data-context-state-indicator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"dataContext$ | async as dataContext\">\n\n <ng-container *ngIf=\"dataContext else noDataContext\">\n\n <ng-container *ngIf=\"(dataContext.isStarted$ | async) else dataContextNotStarted\">\n\n <ng-container *ngIf=\"!(dataContext?.status | async)?.hasError else dataContextHasError\">\n\n <ng-container *ngIf=\"(dataContext?.data | async)?.length === 0\">\n <ng-template [ngTemplateOutlet]=\"dataContextNoData\"></ng-template>\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n</ng-container>\n\n<ng-template #noDataContext>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'No data context'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNotStarted>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'Data context not started'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextHasError>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', iconColor: 'warn', text: 'Error while loading data'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNoData>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'info', text: 'No data available'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #indicator let-icon=\"icon\" let-iconColor=\"iconColor\" let-text=\"text\">\n\n <div fxFill\n fxLayout=\"column\"\n fxLayoutAlign=\"center center\"\n class=\"elder-dc-indicator-container mat-body-1\"\n >\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"16px\">\n <mat-icon [color]=\"iconColor\">{{icon}}</mat-icon>\n <span class=\"hint mat-body-1\">{{text | translate}}</span>\n </div>\n\n </div>\n\n</ng-template>\n", styles: [".elder-dc-indicator-container{color:gray;padding-top:96px;padding-bottom:96px}\n"] }]
12070
+ }], ctorParameters: function () { return []; }, propDecorators: { dataContext: [{
12071
+ type: Input
12072
+ }] } });
12073
+
12074
+ class ElderDataCommonModule {
12075
+ }
12076
+ ElderDataCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12077
+ ElderDataCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, declarations: [ElderDataToolbarComponent,
12078
+ ElderToolbarContentDirective,
12079
+ ElderSingleSortComponent,
12080
+ ElderSelectionMasterCheckboxComponent,
12081
+ DataContextSelectionDirective,
12082
+ DataContextStateIndicatorComponent], imports: [CommonModule, RouterModule,
12083
+ // Material
12084
+ MatDividerModule,
12085
+ MatCheckboxModule, MatMenuModule,
12086
+ MatButtonModule, MatIconModule, MatBadgeModule,
12087
+ MatProgressBarModule,
12088
+ MatDialogModule, MatTooltipModule,
12089
+ // translations
12090
+ TranslateModule, FlexLayoutModule], exports: [ElderDataToolbarComponent,
12091
+ ElderToolbarContentDirective,
12092
+ ElderSingleSortComponent,
12093
+ ElderSelectionMasterCheckboxComponent,
12094
+ DataContextSelectionDirective,
12095
+ DataContextStateIndicatorComponent] });
12096
+ ElderDataCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, imports: [CommonModule, RouterModule,
12097
+ // Material
12098
+ MatDividerModule,
12099
+ MatCheckboxModule, MatMenuModule,
12100
+ MatButtonModule, MatIconModule, MatBadgeModule,
12101
+ MatProgressBarModule,
12102
+ MatDialogModule, MatTooltipModule,
12103
+ // translations
12104
+ TranslateModule, FlexLayoutModule] });
12105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, decorators: [{
12106
+ type: NgModule,
12190
12107
  args: [{
12191
- selector: '[elderSelectionModelPopup]',
12192
- providers: [
12193
- {
12194
- provide: SelectionModel,
12195
- useFactory: createSelectionModel
12196
- },
12197
- {
12198
- provide: ElderDataViewSelectionMode,
12199
- useFactory: createDataViewSelection
12200
- },
12201
- ElderTableProviders.ClearTableModel // Since this popup is frequently used inside an elder-table search box
12202
- ]
12108
+ imports: [
12109
+ CommonModule, RouterModule,
12110
+ // Material
12111
+ MatDividerModule,
12112
+ MatCheckboxModule, MatMenuModule,
12113
+ MatButtonModule, MatIconModule, MatBadgeModule,
12114
+ MatProgressBarModule,
12115
+ MatDialogModule, MatTooltipModule,
12116
+ // translations
12117
+ TranslateModule, FlexLayoutModule,
12118
+ ],
12119
+ declarations: [
12120
+ ElderDataToolbarComponent,
12121
+ ElderToolbarContentDirective,
12122
+ ElderSingleSortComponent,
12123
+ ElderSelectionMasterCheckboxComponent,
12124
+ DataContextSelectionDirective,
12125
+ DataContextStateIndicatorComponent
12126
+ ],
12127
+ exports: [
12128
+ ElderDataToolbarComponent,
12129
+ ElderToolbarContentDirective,
12130
+ ElderSingleSortComponent,
12131
+ ElderSelectionMasterCheckboxComponent,
12132
+ DataContextSelectionDirective,
12133
+ DataContextStateIndicatorComponent
12134
+ ],
12203
12135
  }]
12204
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i1$7.MatDialog }, { type: ElderDataViewSelectionMode }, { type: SelectionModel }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { elderSelectionModelPopupTransform: [{
12205
- type: Input,
12206
- args: ['elderSelectionModelPopupTransform']
12207
- }] } });
12136
+ }] });
12208
12137
 
12209
- class ElderDataViewBaseComponent {
12138
+ class ElderTableRowDirective {
12210
12139
  /***************************************************************************
12211
12140
  * *
12212
12141
  * Constructor *
12213
12142
  * *
12214
12143
  **************************************************************************/
12215
- constructor(selectionModel, dataViewSelection) {
12216
- this.dataViewSelection = dataViewSelection;
12144
+ constructor(rowRef, renderer) {
12145
+ this.rowRef = rowRef;
12146
+ this.renderer = renderer;
12217
12147
  /***************************************************************************
12218
12148
  * *
12219
12149
  * Fields *
12220
12150
  * *
12221
12151
  **************************************************************************/
12222
- /**
12223
- * Underlying data context.
12224
- */
12225
- this.dataContext$ = new BehaviorSubject(null);
12226
- this.interactionMode = 'open';
12227
- /**
12228
- * If true, this table is in dense mode.
12229
- * Heights are generally reduced.
12230
- */
12231
- this._dense = false;
12232
- /**
12233
- * If true, this table is in a floating card mode.
12234
- * Otherwise, it is flat on the current panel.
12235
- */
12236
- this._float = false;
12237
- /**
12238
- * If true, this table is in embedded mode.
12239
- * No borders / floating visible so that the table can be embedded into another container
12240
- */
12241
- this._embedded = false;
12242
- this._itemClickSubject = new Subject();
12243
- this.EntityIdKeyFn = (entity) => entity ? this.getId(entity) : 0;
12244
- if (!selectionModel) {
12245
- this.selectionModel = new SelectionModel(false, [], this.EntityIdKeyFn);
12246
- }
12247
- else {
12248
- this.selectionModel = selectionModel;
12249
- }
12152
+ this.logger = LoggerFactory.getLogger(this.constructor.name);
12153
+ this._activated = false;
12154
+ this.focused$ = new BehaviorSubject(false);
12250
12155
  }
12251
12156
  /***************************************************************************
12252
12157
  * *
12253
- * Properties *
12158
+ * Host Listener *
12254
12159
  * *
12255
12160
  **************************************************************************/
12256
- get dataContext() {
12257
- return this.dataContext$.getValue();
12258
- }
12259
- set dataContext(data) {
12260
- this.dataContext$.next(data);
12261
- this.onDataContextSet(data);
12262
- }
12263
- get dataActivePaged() {
12264
- return this.dataContext;
12161
+ onFocus(event) {
12162
+ this.focused$.next(true);
12163
+ if (this.tableActivation) {
12164
+ this.tableActivation.activate(this._model);
12165
+ }
12265
12166
  }
12266
- get dataContinuable() {
12267
- return this.dataContext;
12167
+ onBlur(event) {
12168
+ this.focused$.next(false);
12268
12169
  }
12269
- get isContinuable() {
12270
- if (!this.dataContext) {
12271
- return false;
12272
- }
12273
- return isContinuableDataContext(this.dataContext);
12170
+ /***************************************************************************
12171
+ * *
12172
+ * Host Bindings *
12173
+ * *
12174
+ **************************************************************************/
12175
+ get activated() {
12176
+ return this._activated;
12274
12177
  }
12275
- get isActivePaged() {
12276
- if (!this.dataContext) {
12277
- return false;
12178
+ set activated(value) {
12179
+ if (this._activated !== value) {
12180
+ this._activated = value;
12181
+ this.activatedClassEnabled(value);
12278
12182
  }
12279
- return isActivePagedDataContext(this.dataContext);
12280
12183
  }
12281
12184
  /***************************************************************************
12282
12185
  * *
12283
- * Selection Properties *
12186
+ * Properties *
12284
12187
  * *
12285
12188
  **************************************************************************/
12286
- set selectableEvaluatorFn(selectableEvaluatorFn) {
12287
- this.selectionModel.selectableEvaluatorFn = selectableEvaluatorFn;
12189
+ set model(model) {
12190
+ this._model = model;
12288
12191
  }
12289
- set selection(selection) {
12290
- this.selectionModel.replaceSelection(selection);
12192
+ get model() {
12193
+ return this._model;
12291
12194
  }
12292
- get selectionChange() {
12293
- return this.selectionModel.changed;
12195
+ get tableActivation() {
12196
+ return this._tableActivation;
12294
12197
  }
12295
- get selectionSingleChange() {
12296
- return this.selectionModel.changed.pipe(map((selection) => {
12297
- if (selection.length > 0) {
12298
- return selection[0];
12299
- }
12300
- else {
12301
- return null;
12302
- }
12303
- }));
12198
+ get hasFocus() {
12199
+ return this.focused$.getValue();
12304
12200
  }
12305
- set selectionMultiEnabled(enableMultiSelection) {
12306
- if (this.selectionModel) {
12307
- this.selectionModel.isMultipleSelection = enableMultiSelection;
12201
+ /***************************************************************************
12202
+ * *
12203
+ * Public API *
12204
+ * *
12205
+ **************************************************************************/
12206
+ bindTableActivation(activation) {
12207
+ if (this._tableActivation !== activation) {
12208
+ this._tableActivation = activation;
12209
+ this.enableRowFocus(!!this._tableActivation);
12210
+ if (!activation) {
12211
+ this.activated = false;
12212
+ }
12308
12213
  }
12309
12214
  }
12215
+ bringToView() {
12216
+ const row = this.rowRef.nativeElement;
12217
+ // scroll-snap-align: start;
12218
+ row.scrollIntoView({
12219
+ block: 'nearest',
12220
+ inline: 'nearest' // horizontal alignment
12221
+ });
12222
+ }
12223
+ foucs() {
12224
+ const row = this.rowRef.nativeElement;
12225
+ row.focus();
12226
+ }
12310
12227
  /***************************************************************************
12311
12228
  * *
12312
- * On click properties *
12229
+ * Private methods *
12313
12230
  * *
12314
12231
  **************************************************************************/
12315
- get itemClick() {
12316
- return this._itemClickSubject;
12232
+ enableRowFocus(enable) {
12233
+ // Make the rows focusable on click (but not on tabs)
12234
+ if (enable) {
12235
+ this.renderer.setAttribute(this.rowRef.nativeElement, 'tabIndex', '-1');
12236
+ }
12237
+ else {
12238
+ this.renderer.removeAttribute(this.rowRef.nativeElement, 'tabIndex');
12239
+ }
12240
+ }
12241
+ activatedClassEnabled(enabled) {
12242
+ const activatedClass = 'elder-table-row-activated';
12243
+ if (enabled) {
12244
+ this.renderer.addClass(this.rowRef.nativeElement, activatedClass);
12245
+ }
12246
+ else {
12247
+ this.renderer.removeClass(this.rowRef.nativeElement, activatedClass);
12248
+ }
12249
+ }
12250
+ }
12251
+ ElderTableRowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableRowDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
12252
+ ElderTableRowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderTableRowDirective, selector: "tr[elderTableRow]", inputs: { model: ["elderTableRow", "model"] }, host: { listeners: { "focus": "onFocus($event)", "blur": "onBlur($event)" } }, exportAs: ["elderTableRow"], ngImport: i0 });
12253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableRowDirective, decorators: [{
12254
+ type: Directive,
12255
+ args: [{
12256
+ selector: 'tr[elderTableRow]',
12257
+ exportAs: 'elderTableRow'
12258
+ }]
12259
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { onFocus: [{
12260
+ type: HostListener,
12261
+ args: ['focus', ['$event']]
12262
+ }], onBlur: [{
12263
+ type: HostListener,
12264
+ args: ['blur', ['$event']]
12265
+ }], model: [{
12266
+ type: Input,
12267
+ args: ['elderTableRow']
12268
+ }] } });
12269
+
12270
+ class ColumnPositionSpec {
12271
+ constructor(position, relativeTo) {
12272
+ this.position = position;
12273
+ this.relativeTo = relativeTo;
12274
+ }
12275
+ static relativeToColumn(col, position) {
12276
+ return new ColumnPositionSpec(position, col);
12277
+ }
12278
+ static relativeToPrevGroup(position) {
12279
+ return new ColumnPositionSpec(position, null);
12280
+ }
12281
+ }
12282
+ class ElderColumnGroup {
12283
+ constructor(groupIndex, columnsPosition, columns) {
12284
+ this.groupIndex = groupIndex;
12285
+ this.columnsPosition = columnsPosition;
12286
+ this.columns = columns;
12287
+ }
12288
+ }
12289
+ class ElderColumnLayout {
12290
+ constructor() {
12291
+ /***************************************************************************
12292
+ * *
12293
+ * Fields *
12294
+ * *
12295
+ **************************************************************************/
12296
+ this.log = LoggerFactory.getLogger(this.constructor.name);
12317
12297
  }
12318
12298
  /***************************************************************************
12319
12299
  * *
12320
- * Style Properties *
12300
+ * Public API *
12321
12301
  * *
12322
12302
  **************************************************************************/
12323
- set dense(value) {
12324
- this._dense = coerceBooleanProperty(value);
12325
- }
12326
- get dense() {
12327
- return this._dense;
12328
- }
12329
- set float(value) {
12330
- this._float = coerceBooleanProperty(value);
12331
- }
12332
- get float() {
12333
- return this._float;
12334
- }
12335
- set embedded(value) {
12336
- this._embedded = coerceBooleanProperty(value);
12337
- }
12338
- get embedded() {
12339
- return this._embedded;
12303
+ layoutColumns(colGroups) {
12304
+ const sortedCols = this.renderColumns(colGroups);
12305
+ // Support absolute column positioning
12306
+ const cdkCols = sortedCols.map(col => col.cdkColumn);
12307
+ return cdkCols;
12340
12308
  }
12341
12309
  /***************************************************************************
12342
12310
  * *
12343
- * Event Entry Points *
12311
+ * Private methods *
12344
12312
  * *
12345
12313
  **************************************************************************/
12346
- /**
12347
- * Called after a new DataContext has been set.
12348
- * Subclasses may add additional behaviour at this stage.
12349
- * @param data
12350
- * @protected
12351
- */
12352
- onDataContextSet(data) {
12314
+ renderColumns(colGroups) {
12315
+ const groupHierarchy = this.sortGroupsByIndex(colGroups);
12316
+ const sorted = [];
12317
+ // Now we can insert groups in defined order
12318
+ let previousIndex = {
12319
+ startIndex: 0,
12320
+ endIndex: 0
12321
+ };
12322
+ for (const grp of groupHierarchy) {
12323
+ // grp defined position relative to prev group
12324
+ previousIndex = this.insertColumnsAt(sorted, grp.columns, grp.columnsPosition, previousIndex);
12325
+ }
12326
+ return sorted;
12353
12327
  }
12354
- onItemClick(entity) {
12355
- if (entity) {
12356
- switch (this.interactionMode) {
12357
- case 'open':
12358
- if (this.selectionModel.hasValue) {
12359
- this.selectionModel.toggle(entity);
12360
- }
12361
- else {
12362
- this._itemClickSubject.next(entity);
12363
- }
12364
- break;
12365
- case 'selection':
12366
- this.selectionModel.toggle(entity);
12367
- break;
12368
- }
12328
+ insertColumnsAt(existingColumns, groupItems, positionSpec, previousGroup) {
12329
+ let insertIndex;
12330
+ if (positionSpec.relativeTo) {
12331
+ insertIndex = this.calcInsertIndexRelativeToColumn(positionSpec.position, positionSpec.relativeTo, existingColumns);
12332
+ }
12333
+ else {
12334
+ insertIndex = this.calcInsertIndexRelativeToPreviousGroup(positionSpec.position, existingColumns, previousGroup);
12369
12335
  }
12336
+ existingColumns.splice(insertIndex, 0, ...groupItems);
12337
+ return {
12338
+ startIndex: insertIndex,
12339
+ endIndex: insertIndex + groupItems.length
12340
+ };
12370
12341
  }
12371
- onItemDoubleClick(entity) {
12372
- if (entity) {
12373
- switch (this.interactionMode) {
12374
- // double click in open mode not supported
12375
- case 'open':
12376
- break;
12377
- // double click in selection mode triggers normal item click
12378
- case 'selection':
12379
- this._itemClickSubject.next(entity);
12380
- break;
12381
- }
12342
+ calcInsertIndexRelativeToColumn(position, relativeToCol, existingColumns) {
12343
+ const relativeIndex = existingColumns
12344
+ .findIndex(c => c.cdkColumn.name === relativeToCol);
12345
+ switch (position) {
12346
+ case 'start':
12347
+ case 'after':
12348
+ // after relative
12349
+ return relativeIndex + 1;
12350
+ case 'before':
12351
+ case 'end':
12352
+ // before relative
12353
+ return relativeIndex;
12382
12354
  }
12383
12355
  }
12384
- /***************************************************************************
12385
- * *
12386
- * Private Methods *
12387
- * *
12388
- **************************************************************************/
12389
- getId(entity) {
12390
- return this.dataContext?.dataSource?.getId(entity) || entity;
12356
+ calcInsertIndexRelativeToPreviousGroup(position, existingColumns, previousGroup) {
12357
+ switch (position) {
12358
+ case 'start':
12359
+ return 0;
12360
+ case 'end':
12361
+ return existingColumns.length;
12362
+ case 'after':
12363
+ // after relative to previous group
12364
+ return previousGroup.endIndex;
12365
+ case 'before':
12366
+ // before relative to previous group
12367
+ return previousGroup.startIndex;
12368
+ }
12369
+ }
12370
+ sortGroupsByIndex(colGroups) {
12371
+ return colGroups
12372
+ .sort((a, b) => {
12373
+ return naturalValueComparator(a.groupIndex, b.groupIndex);
12374
+ }).reverse();
12391
12375
  }
12392
12376
  }
12393
- ElderDataViewBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseComponent, deps: [{ token: SelectionModel }, { token: ElderDataViewSelectionMode }], target: i0.ɵɵFactoryTarget.Component });
12394
- ElderDataViewBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderDataViewBaseComponent, selector: "elder-data-view-base", inputs: { interactionMode: "interactionMode", selectableEvaluatorFn: "selectableEvaluatorFn", selection: "selection", selectionMultiEnabled: "selectionMultiEnabled", dense: "dense", float: "float", embedded: "embedded" }, outputs: { selectionChange: "selectionChange", selectionSingleChange: "selectionSingleChange", itemClick: "itemClick" }, ngImport: i0, template: '', isInline: true });
12395
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseComponent, decorators: [{
12396
- type: Component,
12397
- args: [{ selector: 'elder-data-view-base', template: '' }]
12398
- }], ctorParameters: function () { return [{ type: SelectionModel }, { type: ElderDataViewSelectionMode }]; }, propDecorators: { interactionMode: [{
12399
- type: Input
12400
- }], selectableEvaluatorFn: [{
12401
- type: Input
12402
- }], selection: [{
12403
- type: Input
12404
- }], selectionChange: [{
12405
- type: Output
12406
- }], selectionSingleChange: [{
12407
- type: Output
12408
- }], selectionMultiEnabled: [{
12409
- type: Input
12410
- }], itemClick: [{
12411
- type: Output
12412
- }], dense: [{
12413
- type: Input
12414
- }], float: [{
12415
- type: Input
12416
- }], embedded: [{
12417
- type: Input
12418
- }] } });
12419
12377
 
12420
- class ElderDataViewBaseModule {
12378
+ class ElderTableGroup {
12379
+ constructor(id, index) {
12380
+ this.id = id;
12381
+ this.index = index;
12382
+ }
12383
+ static create(groupIndex) {
12384
+ return ElderTableGroup.of(UuidUtil.weakUuid4(), groupIndex);
12385
+ }
12386
+ static of(id, groupIndex) {
12387
+ return new ElderTableGroup(id, groupIndex);
12388
+ }
12421
12389
  }
12422
- ElderDataViewBaseModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12423
- ElderDataViewBaseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseModule, declarations: [ElderDataViewBaseComponent], imports: [CommonModule] });
12424
- ElderDataViewBaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseModule, imports: [CommonModule] });
12425
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseModule, decorators: [{
12426
- type: NgModule,
12427
- args: [{
12428
- declarations: [ElderDataViewBaseComponent],
12429
- imports: [CommonModule],
12430
- }]
12431
- }] });
12432
-
12433
- class ElderTableRowDirective {
12390
+ class ElderTableModel {
12434
12391
  /***************************************************************************
12435
12392
  * *
12436
12393
  * Constructor *
12437
12394
  * *
12438
12395
  **************************************************************************/
12439
- constructor(rowRef, renderer) {
12440
- this.rowRef = rowRef;
12441
- this.renderer = renderer;
12396
+ constructor() {
12442
12397
  /***************************************************************************
12443
12398
  * *
12444
12399
  * Fields *
12445
12400
  * *
12446
12401
  **************************************************************************/
12447
12402
  this.logger = LoggerFactory.getLogger(this.constructor.name);
12448
- this._activated = false;
12449
- this.focused$ = new BehaviorSubject(false);
12403
+ this.elderColumnLayout = new ElderColumnLayout();
12404
+ this._groups = new Map();
12405
+ this._columnGroups = new ReactiveMap();
12406
+ this._rowDefGroups = new ReactiveMap();
12407
+ this._sortGroups = new ReactiveMap();
12408
+ this.selectionVisible$ = new BehaviorSubject(false);
12409
+ /**
12410
+ * The columns to display explicitly set by the user.
12411
+ * We need to support inserting display columns by index or anchored to existing ones.
12412
+ * before([columns])
12413
+ * after()
12414
+ * start()
12415
+ * end([])
12416
+ * @private
12417
+ */
12418
+ this.displayedColumns$ = new BehaviorSubject(undefined);
12419
+ this.displayedColumnsInner$ = this.renderDisplayedColumns(this.displayedColumns$, this.columnDefs$, this.selectionVisible$);
12450
12420
  }
12451
12421
  /***************************************************************************
12452
12422
  * *
12453
- * Host Listener *
12423
+ * Properties *
12454
12424
  * *
12455
12425
  **************************************************************************/
12456
- onFocus(event) {
12457
- this.focused$.next(true);
12458
- if (this.tableActivation) {
12459
- this.tableActivation.activate(this._model);
12460
- }
12426
+ set selectionVisible(visible) {
12427
+ this.selectionVisible$.next(visible);
12461
12428
  }
12462
- onBlur(event) {
12463
- this.focused$.next(false);
12429
+ get selectionVisible() {
12430
+ return this.selectionVisible$.getValue();
12431
+ }
12432
+ set displayedColumns(columns) {
12433
+ this.displayedColumns$.next(columns);
12434
+ }
12435
+ get displayedColumns() {
12436
+ return this.displayedColumns$.getValue();
12464
12437
  }
12465
12438
  /***************************************************************************
12466
12439
  * *
12467
- * Host Bindings *
12440
+ * Rendered Properties *
12468
12441
  * *
12469
12442
  **************************************************************************/
12470
- get activated() {
12471
- return this._activated;
12443
+ get columnDefs$() {
12444
+ return this._columnGroups.values$.pipe(map(groups => this.elderColumnLayout.layoutColumns(groups)));
12472
12445
  }
12473
- set activated(value) {
12474
- if (this._activated !== value) {
12475
- this._activated = value;
12476
- this.activatedClassEnabled(value);
12477
- }
12446
+ get rowDefs$() {
12447
+ return this.sortAndFlatten(this._rowDefGroups);
12448
+ }
12449
+ get sorts$() {
12450
+ return this._sortGroups.values$;
12451
+ }
12452
+ // ---
12453
+ valuesSortedByGroupIndex(myMap, groups) {
12454
+ return Array.from(myMap.entries())
12455
+ .sort(([a_key], [b_key]) => {
12456
+ const grpAIndex = groups.get(a_key)?.index ?? 0;
12457
+ const grpBIndex = groups.get(b_key)?.index ?? 0;
12458
+ return naturalValueComparator(grpAIndex, grpBIndex);
12459
+ }).map(([a_key, a_value]) => a_value);
12460
+ }
12461
+ sortAndFlatten(reactMap) {
12462
+ return reactMap.map$.pipe(map(myMap => this.valuesSortedByGroupIndex(myMap, this._groups)), map(columns => CollectionUtil.flatten(columns)));
12478
12463
  }
12464
+ /*
12465
+ public get sortHeaders$(): Observable<MatSortHeader[]> {
12466
+ return this._sortGroups.values$.pipe(
12467
+ map(groups => this.flattenDefs(groups))
12468
+ );
12469
+ }*/
12479
12470
  /***************************************************************************
12480
12471
  * *
12481
- * Properties *
12472
+ * Public API *
12482
12473
  * *
12483
12474
  **************************************************************************/
12484
- set model(model) {
12485
- this._model = model;
12475
+ registerGroup(group) {
12476
+ this._groups.set(group.id, group);
12486
12477
  }
12487
- get model() {
12488
- return this._model;
12478
+ updateColumnGroup(group, columnGroup) {
12479
+ this._columnGroups.set(group.id, columnGroup);
12489
12480
  }
12490
- get tableActivation() {
12491
- return this._tableActivation;
12481
+ updateRowDefs(group, rows) {
12482
+ this._rowDefGroups.set(group.id, rows);
12483
+ }
12484
+ updateSortGroup(group, sort) {
12485
+ this._sortGroups.set(group.id, sort);
12492
12486
  }
12493
- get hasFocus() {
12494
- return this.focused$.getValue();
12487
+ clearColumnDefGroup(group) {
12488
+ this._columnGroups.delete(group.id);
12495
12489
  }
12496
- /***************************************************************************
12497
- * *
12498
- * Public API *
12499
- * *
12500
- **************************************************************************/
12501
- bindTableActivation(activation) {
12502
- if (this._tableActivation !== activation) {
12503
- this._tableActivation = activation;
12504
- this.enableRowFocus(!!this._tableActivation);
12505
- if (!activation) {
12506
- this.activated = false;
12507
- }
12508
- }
12490
+ clearRowDefGroup(group) {
12491
+ this._rowDefGroups.delete(group.id);
12509
12492
  }
12510
- bringToView() {
12511
- const row = this.rowRef.nativeElement;
12512
- // scroll-snap-align: start;
12513
- row.scrollIntoView({
12514
- block: 'nearest',
12515
- inline: 'nearest' // horizontal alignment
12516
- });
12493
+ clearSortGroup(group) {
12494
+ this._sortGroups.delete(group.id);
12517
12495
  }
12518
- foucs() {
12519
- const row = this.rowRef.nativeElement;
12520
- row.focus();
12496
+ deRegisterGroup(group) {
12497
+ this.clearColumnDefGroup(group);
12498
+ this.clearRowDefGroup(group);
12499
+ this.clearSortGroup(group);
12500
+ this._groups.delete(group.id);
12521
12501
  }
12522
12502
  /***************************************************************************
12523
12503
  * *
12524
12504
  * Private methods *
12525
12505
  * *
12526
12506
  **************************************************************************/
12527
- enableRowFocus(enable) {
12528
- // Make the rows focusable on click (but not on tabs)
12529
- if (enable) {
12530
- this.renderer.setAttribute(this.rowRef.nativeElement, 'tabIndex', '-1');
12531
- }
12532
- else {
12533
- this.renderer.removeAttribute(this.rowRef.nativeElement, 'tabIndex');
12534
- }
12535
- }
12536
- activatedClassEnabled(enabled) {
12537
- const activatedClass = 'elder-table-row-activated';
12538
- if (enabled) {
12539
- this.renderer.addClass(this.rowRef.nativeElement, activatedClass);
12540
- }
12541
- else {
12542
- this.renderer.removeClass(this.rowRef.nativeElement, activatedClass);
12543
- }
12507
+ renderDisplayedColumns(userDefinedColumns$, columnDefs$, selectionVisible$) {
12508
+ return combineLatest([userDefinedColumns$, columnDefs$, selectionVisible$]).pipe(map(([displayedColumns, columnDefs, selectionVisible]) => {
12509
+ let columns = displayedColumns;
12510
+ if (!columns) {
12511
+ columns = [];
12512
+ // If the user did not define columns to display
12513
+ // Assume he wants all his own columns in given order
12514
+ if (columnDefs) {
12515
+ columnDefs.forEach(col => {
12516
+ columns.push(col.name);
12517
+ });
12518
+ }
12519
+ }
12520
+ if (this.selectionVisible) {
12521
+ columns = ['select', ...columns];
12522
+ }
12523
+ return columns;
12524
+ }));
12544
12525
  }
12545
12526
  }
12546
- ElderTableRowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableRowDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
12547
- ElderTableRowDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderTableRowDirective, selector: "tr[elderTableRow]", inputs: { model: ["elderTableRow", "model"] }, host: { listeners: { "focus": "onFocus($event)", "blur": "onBlur($event)" } }, exportAs: ["elderTableRow"], ngImport: i0 });
12548
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableRowDirective, decorators: [{
12549
- type: Directive,
12550
- args: [{
12551
- selector: 'tr[elderTableRow]',
12552
- exportAs: 'elderTableRow'
12553
- }]
12554
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { onFocus: [{
12555
- type: HostListener,
12556
- args: ['focus', ['$event']]
12557
- }], onBlur: [{
12558
- type: HostListener,
12559
- args: ['blur', ['$event']]
12560
- }], model: [{
12561
- type: Input,
12562
- args: ['elderTableRow']
12563
- }] } });
12527
+ ElderTableModel.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12528
+ ElderTableModelprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel });
12529
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel, decorators: [{
12530
+ type: Injectable
12531
+ }], ctorParameters: function () { return []; } });
12532
+
12533
+ function existingOrNewElderTableModel(modelProvider) {
12534
+ return modelProvider ?? newElderTableModel();
12535
+ }
12536
+ function newElderTableModel() {
12537
+ return new ElderTableModel();
12538
+ }
12539
+ class ElderTableProviders {
12540
+ }
12541
+ /**
12542
+ * Uses the existing ElderTableModel from a parent if available.
12543
+ * Otherwise, creates a new ElderTableModel and provides it.
12544
+ */
12545
+ ElderTableProviders.ExistingOrNewTableModel = {
12546
+ provide: ElderTableModel,
12547
+ useFactory: existingOrNewElderTableModel,
12548
+ deps: [[new Optional(), new SkipSelf(), ElderTableModel]]
12549
+ };
12550
+ /**
12551
+ * Creates a new ElderTableModel root and provides it,
12552
+ * even if there is an existing parent table model.
12553
+ */
12554
+ ElderTableProviders.NewTableModelRoot = {
12555
+ provide: ElderTableModel,
12556
+ useFactory: newElderTableModel
12557
+ };
12558
+ /**
12559
+ * If there is an existing ElderTableModel service provided, clears it.
12560
+ *
12561
+ * Child components will therefore be blocked from accessing any parent TableModel service
12562
+ * and are instead forced to create their own.
12563
+ *
12564
+ * This supports nesting ElderTable without sharing the table model / columns.
12565
+ */
12566
+ ElderTableProviders.ClearTableModel = {
12567
+ provide: ElderTableModel,
12568
+ useValue: null
12569
+ };
12564
12570
 
12565
12571
  /**
12566
12572
  * Binds the elder table model to the CDK table.
@@ -13082,8 +13088,8 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
13082
13088
  * Constructor *
13083
13089
  * *
13084
13090
  **************************************************************************/
13085
- constructor(tableModel, selectionModel, dataViewSelection, matSort, parentExtension, cdr, zone) {
13086
- super(selectionModel, dataViewSelection);
13091
+ constructor(tableModel, selectionModel, dataViewOptionsProvider, matSort, parentExtension, cdr, zone) {
13092
+ super(selectionModel, dataViewOptionsProvider);
13087
13093
  this.tableModel = tableModel;
13088
13094
  this.parentExtension = parentExtension;
13089
13095
  this.cdr = cdr;
@@ -13094,7 +13100,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
13094
13100
  * *
13095
13101
  **************************************************************************/
13096
13102
  this.logger = LoggerFactory.getLogger(this.constructor.name);
13097
- this.destroy$ = new Subject();
13098
13103
  /**
13099
13104
  * Load next chunk after current is done
13100
13105
  */
@@ -13115,14 +13120,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
13115
13120
  */
13116
13121
  this.hiddenField = null;
13117
13122
  this.pageSizeOptions = [30, 50, 100, 150, 200];
13118
- /**
13119
- * Define if elder-table should clean up the
13120
- * data-context resources for you.
13121
- *
13122
- * In more advanced scenarios where you plan to reuse the same data-context
13123
- * set this to false and release the resources yourself. (dataContext.close)
13124
- */
13125
- this.cleanUp = true;
13126
13123
  this.keepSelection = true;
13127
13124
  this.showFooter = false;
13128
13125
  this.toolbarRowTemplates$ = new BehaviorSubject([]);
@@ -13142,16 +13139,7 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
13142
13139
  * *
13143
13140
  **************************************************************************/
13144
13141
  ngOnInit() {
13145
- if (this.dataViewSelection) {
13146
- this.selectionVisible = true;
13147
- this.selectionMultiEnabled = this.dataViewSelection.multi;
13148
- this.interactionMode = 'selection';
13149
- this.float = false;
13150
- if (this.dataContext) {
13151
- this.dataContext.filter.updateFilters(this.dataViewSelection.filters);
13152
- this.dataContext.sort.updateSorts(this.dataViewSelection.sorts);
13153
- }
13154
- }
13142
+ super.ngOnInit();
13155
13143
  ElderTableModelCdkTableBinding
13156
13144
  .of(this.tableModel)
13157
13145
  .table(this.matTable)
@@ -13181,11 +13169,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
13181
13169
  .updated(rows => this.rows$.next(rows))
13182
13170
  .bindUntil(this.destroy$);
13183
13171
  }
13184
- ngOnDestroy() {
13185
- this.destroy$.next();
13186
- this.destroy$.complete();
13187
- this.autoCleanUp();
13188
- }
13189
13172
  /***************************************************************************
13190
13173
  * *
13191
13174
  * Properties *
@@ -13309,18 +13292,9 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
13309
13292
  }
13310
13293
  });
13311
13294
  }
13312
- /**
13313
- * Performs clean up of the current data context if auto clean up is enabled.
13314
- */
13315
- autoCleanUp() {
13316
- if (this.cleanUp && this.dataContext) {
13317
- this.logger.debug('Releasing DataContext resources to prevent memory leak. [cleanUp]="true"');
13318
- this.dataContext.close();
13319
- }
13320
- }
13321
13295
  }
13322
- ElderTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableComponent, deps: [{ token: ElderTableModel }, { token: SelectionModel, optional: true }, { token: ElderDataViewSelectionMode, optional: true, skipSelf: true }, { token: i2$4.MatSort, optional: true }, { token: ElderTableExtensionDirective, optional: true, skipSelf: true }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
13323
- ElderTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderTableComponent, selector: "elder-table, ebs-table", inputs: { idField: "idField", removingField: "removingField", hiddenField: "hiddenField", pageSizeOptions: "pageSizeOptions", cleanUp: "cleanUp", keepSelection: "keepSelection", showFooter: "showFooter", toolbarTemplate: "toolbarTemplate", data: "data", displayedColumns: "displayedColumns", selectionVisible: "selectionVisible" }, providers: [
13296
+ ElderTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableComponent, deps: [{ token: ElderTableModel }, { token: SelectionModel, optional: true }, { token: ElderDataViewOptionsProvider, optional: true, skipSelf: true }, { token: i2$4.MatSort, optional: true }, { token: ElderTableExtensionDirective, optional: true, skipSelf: true }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
13297
+ ElderTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderTableComponent, selector: "elder-table, ebs-table", inputs: { idField: "idField", removingField: "removingField", hiddenField: "hiddenField", pageSizeOptions: "pageSizeOptions", keepSelection: "keepSelection", showFooter: "showFooter", toolbarTemplate: "toolbarTemplate", data: "data", displayedColumns: "displayedColumns", selectionVisible: "selectionVisible" }, providers: [
13324
13298
  ElderTableProviders.ExistingOrNewTableModel,
13325
13299
  {
13326
13300
  provide: ELDER_DATA_VIEW,
@@ -13338,7 +13312,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
13338
13312
  ], template: "\n<div fxLayout=\"column\" fxFlex\n class=\"elder-table\"\n [class.elder-mat-table-container]=\"!embedded\"\n [class.mat-elevation-z5]=\"float\"\n [class.elder-mat-table-flat]=\"!embedded && !float\"\n>\n\n <!-- Toolbar Rows -->\n <ng-container *ngFor=\"let toolbarRowTemplate of toolbarRowTemplates$ | async\">\n <ng-template *ngTemplateOutlet=\"toolbarRowTemplate; context: {$implicit: this}\">\n </ng-template>\n </ng-container>\n\n <!-- Scrollable Table -->\n <div fxLayout=\"column\" class=\"scrollable elder-table-scroll\"\n infiniteScroll\n [eventThrottle]=\"150\"\n [offsetFactor]=\"2\"\n [ignoreScrollEvent]=\"!isContinuable || !(canLoadMore$ | async)\"\n (closeToEnd)=\"requestMoreDataZoned($event)\"\n >\n <table\n mat-table\n class=\"elder-mat-inner-table\"\n [trackBy]=\"trackByFn\"\n [dataSource]=\"$any(dataContext$ | async)\"\n [elderDataContextSelection]=\"dataContext$ | async\" #dataSelection=\"elderDataContextSelection\"\n [elderDataContextSelectionModel]=\"selectionModel\"\n >\n\n <!-- selection Column -->\n <ng-container matColumnDef=\"select\">\n <th mat-header-cell *matHeaderCellDef>\n <elder-selection-master-checkbox></elder-selection-master-checkbox>\n </th>\n <td mat-cell *matCellDef=\"let entity\">\n <mat-checkbox (click)=\"$event.stopPropagation()\"\n (change)=\"$event ? selectionModel.toggle(entity) : null\"\n [checked]=\"selectionModel.observeSelection(entity) | async\"\n [disabled]=\"!selectionModel.isSelectable(entity)\"\n class=\"elder-table-checkbox\"\n [class.elder-table-checkbox-visible]=\"(dataSelection.selectionState$ | async).anySelected\"\n >\n </mat-checkbox>\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container *ngIf=\"(tableModel.displayedColumnsInner$ | async) as displayedColumnsInner\">\n <tr mat-header-row *matHeaderRowDef=\"displayedColumnsInner; sticky: true\"></tr>\n <tr mat-row class=\"elder-table-row\"\n *matRowDef=\"let entity; columns: displayedColumnsInner;\"\n [elderTableRow]=\"entity\"\n [class.dense]=\"dense\"\n [class.elder-row-hidden]=\"hiddenField && entity[hiddenField]\"\n [class.elder-row-removing]=\"removingField && entity[removingField]\"\n [class.elder-table-row-selected]=\"interactionMode === 'selection' && selectionModel.observeSelection(entity) | async\"\n (click)=\"onItemClick(entity)\"\n (dblclick)=\"onItemDoubleClick(entity)\"\n >\n </tr>\n <ng-container *ngIf=\"showFooter\">\n <tr mat-footer-row *matFooterRowDef=\"displayedColumnsInner; sticky: true\"></tr>\n </ng-container>\n </ng-container>\n </table>\n </div>\n\n <elder-data-context-state-indicator fxFlex=\"none\" [dataContext]=\"dataContext\">\n </elder-data-context-state-indicator>\n\n <mat-progress-bar fxFlex=\"none\"\n [mode]=\"(dataContext?.loading | async) ? 'indeterminate' : 'determinate'\"\n [color]=\"((dataContext?.status | async)?.hasError) ? 'warn' : 'primary'\">\n </mat-progress-bar>\n\n <!-- Optional Paginator Toolbar -->\n <mat-paginator #matPaginator *ngIf=\"isActivePaged && (dataActivePaged.page | async) as page\"\n fxFlex=\"none\"\n [length]=\"dataContext?.total | async\"\n [pageIndex]=\"page?.index\"\n [pageSize]=\"page?.size\"\n [pageSizeOptions]=\"pageSizeOptions\">\n </mat-paginator>\n\n <!-- Optional Continuation Footer -->\n <div *ngIf=\"isContinuable\" class=\"elder-table-footer\"\n fxLayout=\"row\" fxFlex=\"none\" fxLayoutAlign=\"end center\" fxLayoutGap=\"10px\"\n style=\"padding-right: 10px\" >\n\n <span class=\"mat-caption noselect\" style=\"color: gray\">\n {{(dataContext?.data | async)?.length}} / {{total$ | async}}\n </span>\n\n <button mat-icon-button type=\"button\" color=\"primary\"\n [disabled]=\"!(canLoadMore$ | async)\"\n (click)=\"dataContinuable.loadMore()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </div>\n\n</div>\n", styles: [".elder-table-scroll{height:100%}.elder-mat-inner-table{width:100%}.elder-table-row.dense{height:42px!important}.elder-mat-table-container{border-radius:4px;overflow:hidden}.mat-column-select{overflow:initial;max-width:42px;width:42px}.elder-row-removing{text-decoration:line-through}.elder-row-hidden{display:none}.elder-table-row{cursor:pointer}:host{min-width:0;min-height:0}.elder-table-hint{color:gray}.elder-table-footer{height:44px}.elder-table-checkbox{opacity:.25;transition:opacity .5s ease-in-out}.elder-table-row:hover .elder-table-checkbox{opacity:.9}.elder-table-checkbox-visible{opacity:1}.mat-table .mat-header-cell{padding-left:8px;padding-right:12px;overflow-wrap:normal;word-wrap:normal;word-break:normal;white-space:inherit;-webkit-hyphens:auto;hyphens:auto}.mat-table .mat-header-cell:first-of-type{padding-left:20px}.mat-table .mat-header-cell:last-of-type{padding-right:8px}.mat-table .mat-header-cell:last-of-type[mat-sort-header]:not([arrowposition=before]){padding-right:8px}.mat-table .mat-header-cell[mat-sort-header][arrowposition=before]{padding-left:0}.mat-table .mat-header-cell[mat-sort-header]:not([arrowposition=before]){padding-right:12px}.mat-table .mat-header-cell>.mat-sort-header-container{display:inline-flex}.mat-table .mat-cell{padding-left:8px;padding-right:12px;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;white-space:inherit;-webkit-hyphens:auto;hyphens:auto}.mat-table .mat-cell:first-of-type{padding-left:20px}.mat-table .mat-cell:last-of-type{padding-right:8px}.mat-table .mat-footer-cell{padding-left:8px;padding-right:12px;font-weight:700}.mat-table .mat-footer-cell:first-of-type{padding-left:20px}.mat-table .mat-footer-cell:last-of-type{padding-right:8px}.mat-table .mat-footer-cell .mat-paginator{margin-left:-8px;margin-right:-8px}\n"] }]
13339
13313
  }], ctorParameters: function () { return [{ type: ElderTableModel }, { type: SelectionModel, decorators: [{
13340
13314
  type: Optional
13341
- }] }, { type: ElderDataViewSelectionMode, decorators: [{
13315
+ }] }, { type: ElderDataViewOptionsProvider, decorators: [{
13342
13316
  type: Optional
13343
13317
  }, {
13344
13318
  type: SkipSelf
@@ -13371,8 +13345,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
13371
13345
  type: Input
13372
13346
  }], pageSizeOptions: [{
13373
13347
  type: Input
13374
- }], cleanUp: [{
13375
- type: Input
13376
13348
  }], keepSelection: [{
13377
13349
  type: Input
13378
13350
  }], showFooter: [{
@@ -13663,9 +13635,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
13663
13635
  *
13664
13636
  * Example Usage:
13665
13637
  *
13666
- * <mat-form-field elderFormFieldLabel>
13667
- * <input matInput placeholder="Readonly Input" readonly="true" value="Some Value">
13668
- * </mat-form-field>
13638
+ * <mat-form-field elderFormFieldLabel>
13639
+ * <input matInput placeholder="Readonly Input" readonly="true" value="Some Value">
13640
+ * </mat-form-field>
13669
13641
  *
13670
13642
  */
13671
13643
  class ElderFormFieldLabelDirective {
@@ -13677,6 +13649,20 @@ class ElderFormFieldLabelDirective {
13677
13649
  constructor(_matFormField) {
13678
13650
  this._matFormField = _matFormField;
13679
13651
  }
13652
+ /***************************************************************************
13653
+ * *
13654
+ * Host Bindings *
13655
+ * *
13656
+ **************************************************************************/
13657
+ get getFormFieldLabelStyle() {
13658
+ return this.isLabelMode();
13659
+ }
13660
+ /***************************************************************************
13661
+ * *
13662
+ * Properties *
13663
+ * *
13664
+ **************************************************************************/
13665
+ // eslint-disable-next-line @angular-eslint/no-input-rename
13680
13666
  set enabled(enabled) {
13681
13667
  this._enabled = coerceBooleanProperty(enabled);
13682
13668
  }
@@ -13688,12 +13674,12 @@ class ElderFormFieldLabelDirective {
13688
13674
  * Public API *
13689
13675
  * *
13690
13676
  **************************************************************************/
13691
- isReadonlyInput() {
13677
+ isControlReadonly() {
13692
13678
  const ctrl = this._matFormField._control;
13693
- if (ctrl instanceof MatInput) {
13694
- return ctrl.readonly;
13695
- }
13696
- return false;
13679
+ return ctrl?.readonly;
13680
+ }
13681
+ isLabelMode() {
13682
+ return this.enabled && this.isControlReadonly();
13697
13683
  }
13698
13684
  /***************************************************************************
13699
13685
  * *
@@ -13701,22 +13687,22 @@ class ElderFormFieldLabelDirective {
13701
13687
  * *
13702
13688
  **************************************************************************/
13703
13689
  ngAfterViewInit() {
13704
- if (this.isReadonlyInput()) {
13690
+ if (this.isLabelMode()) {
13705
13691
  this._matFormField.floatLabel = 'always';
13706
13692
  }
13707
13693
  }
13708
13694
  }
13709
13695
  ElderFormFieldLabelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderFormFieldLabelDirective, deps: [{ token: i4$1.MatFormField }], target: i0.ɵɵFactoryTarget.Directive });
13710
- ElderFormFieldLabelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderFormFieldLabelDirective, selector: "mat-form-field[elderFormFieldLabel]", inputs: { enabled: ["elderFormFieldLabel", "enabled"] }, host: { properties: { "class.elder-form-field-label": "enabled && isReadonlyInput()" } }, ngImport: i0 });
13696
+ ElderFormFieldLabelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderFormFieldLabelDirective, selector: "mat-form-field[elderFormFieldLabel]", inputs: { enabled: ["elderFormFieldLabel", "enabled"] }, host: { properties: { "class.elder-form-field-label": "this.getFormFieldLabelStyle" } }, ngImport: i0 });
13711
13697
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderFormFieldLabelDirective, decorators: [{
13712
13698
  type: Directive,
13713
13699
  args: [{
13714
- selector: 'mat-form-field[elderFormFieldLabel]',
13715
- host: {
13716
- '[class.elder-form-field-label]': 'enabled && isReadonlyInput()'
13717
- }
13700
+ selector: 'mat-form-field[elderFormFieldLabel]'
13718
13701
  }]
13719
- }], ctorParameters: function () { return [{ type: i4$1.MatFormField }]; }, propDecorators: { enabled: [{
13702
+ }], ctorParameters: function () { return [{ type: i4$1.MatFormField }]; }, propDecorators: { getFormFieldLabelStyle: [{
13703
+ type: HostBinding,
13704
+ args: ['class.elder-form-field-label']
13705
+ }], enabled: [{
13720
13706
  type: Input,
13721
13707
  args: ['elderFormFieldLabel']
13722
13708
  }] } });
@@ -15230,8 +15216,8 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
15230
15216
  * Constructor *
15231
15217
  * *
15232
15218
  **************************************************************************/
15233
- constructor(selectionModel, dataViewSelection, mediaObserver) {
15234
- super(selectionModel, dataViewSelection);
15219
+ constructor(selectionModel, dataViewOptionsProvider, mediaObserver) {
15220
+ super(selectionModel, dataViewOptionsProvider);
15235
15221
  this.mediaObserver = mediaObserver;
15236
15222
  /***************************************************************************
15237
15223
  * *
@@ -15264,7 +15250,6 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
15264
15250
  this.idField = 'id';
15265
15251
  this.selectionVisible = true;
15266
15252
  this.pageSizeOptions = [30, 50, 100, 150, 200];
15267
- this.destroy$ = new Subject();
15268
15253
  }
15269
15254
  /***************************************************************************
15270
15255
  * *
@@ -15272,6 +15257,7 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
15272
15257
  * *
15273
15258
  **************************************************************************/
15274
15259
  ngOnInit() {
15260
+ super.ngOnInit();
15275
15261
  const columnCount$ = (this.responsiveColumnCount
15276
15262
  ? this.responsiveColumn()
15277
15263
  : this._columnCount);
@@ -15279,16 +15265,6 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
15279
15265
  this.dataContext$.pipe(filter(dc => !!dc), switchMap(dc => dc.data)),
15280
15266
  columnCount$
15281
15267
  ]).pipe(debounceTime(50), map(([data, columns]) => this.groupForColumns(data, columns)));
15282
- if (this.dataViewSelection) {
15283
- this.selectionVisible = true;
15284
- this.selectionMultiEnabled = this.dataViewSelection.multi;
15285
- this.float = false;
15286
- const dataContext = this.dataContext$.getValue();
15287
- if (dataContext) {
15288
- dataContext.filter.updateFilters(this.dataViewSelection.filters);
15289
- dataContext.sort.updateSorts(this.dataViewSelection.sorts);
15290
- }
15291
- }
15292
15268
  }
15293
15269
  ngAfterViewInit() {
15294
15270
  MatTableDataContextBindingBuilder
@@ -15296,10 +15272,6 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
15296
15272
  .withPaginator(of(this.matPaginator))
15297
15273
  .bindUntil(this.destroy$);
15298
15274
  }
15299
- ngOnDestroy() {
15300
- this.destroy$.next();
15301
- this.destroy$.complete();
15302
- }
15303
15275
  /***************************************************************************
15304
15276
  * *
15305
15277
  * Properties *
@@ -15414,7 +15386,7 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
15414
15386
  return this.mediaObserver.asObservable().pipe(filter(changes => changes.length > 0), map(changes => this.sizeToColumns.get(changes[0].mqAlias)), debounceTime(150), startWith(start));
15415
15387
  }
15416
15388
  }
15417
- ElderGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderGridComponent, deps: [{ token: SelectionModel, optional: true }, { token: ElderDataViewSelectionMode, optional: true, skipSelf: true }, { token: i3$5.MediaObserver }], target: i0.ɵɵFactoryTarget.Component });
15389
+ ElderGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderGridComponent, deps: [{ token: SelectionModel, optional: true }, { token: ElderDataViewOptionsProvider, optional: true, skipSelf: true }, { token: i3$5.MediaObserver }], target: i0.ɵɵFactoryTarget.Component });
15418
15390
  ElderGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderGridComponent, selector: "elder-grid", inputs: { toolbarVisible: "toolbarVisible", footerVisible: "footerVisible", itemHeight: "itemHeight", responsiveColumnCount: "responsiveColumnCount", availableSorts: "availableSorts", sortTranslationPrefix: "sortTranslationPrefix", hiddenField: "hiddenField", idField: "idField", selectionVisible: "selectionVisible", pageSizeOptions: "pageSizeOptions", tileTemplate: "tileTemplate", toolbarTemplate: "toolbarTemplate", data: "data", columnCount: "columnCount" }, providers: [
15419
15391
  {
15420
15392
  provide: ELDER_DATA_VIEW,
@@ -15431,7 +15403,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
15431
15403
  ], template: "<div fxLayout=\"column\" class=\"scroll-fix\" fxFill>\n\n <!-- Grid Browser -->\n <div fxLayout=\"column\" fxFlex\n class=\"scroll-fix elder-grid-container\"\n *ngIf=\"dataContext$ | async as data\"\n [class.elder-mat-table-container]=\"!embedded\"\n [class.mat-elevation-z5]=\"float\"\n [class.elder-mat-table-flat]=\"!embedded && !float\"\n\n [elderDataContextSelection]=\"data\" #dataSelection=\"elderDataContextSelection\"\n [elderDataContextSelectionModel]=\"selectionModel\"\n >\n\n <!-- Toolbar Row -->\n <div *ngIf=\"toolbarVisible\"\n fxLayout=\"row\" fxLayoutAlign=\"start center\" fxFlex=\"none\" class=\"elder-grid-toolbar\">\n\n <div fxLayout=\"column\" fxFlex=\"none\" style=\"padding-left: 8px; padding-right: 8px\" *ngIf=\"selectionVisible\">\n <elder-selection-master-checkbox fxFlex=\"none\" style=\"padding-left: 12px\"></elder-selection-master-checkbox>\n </div>\n\n <!-- Toolbar -->\n <ng-container *ngIf=\"toolbarTemplate\">\n <ng-template *ngTemplateOutlet=\"toolbarTemplate; context: {$implicit: this}\"></ng-template>\n </ng-container>\n\n <elder-single-sort *ngIf=\"availableSorts && availableSorts.length > 0 && data.sort.sorts | async as sorts\"\n fxFlex=\"none\"\n [availableSorts]=\"availableSorts\"\n [translationPrefix]=\"sortTranslationPrefix\"\n [sort]=\"sorts[0]\"\n (sortChange)=\"updateSort($event)\">\n </elder-single-sort>\n\n </div>\n\n <mat-divider *ngIf=\"toolbarVisible\"></mat-divider>\n\n <elder-data-context-state-indicator fxFlex=\"none\" [dataContext]=\"data\">\n </elder-data-context-state-indicator>\n\n <!-- [cdkDropListSortingDisabled]=\"true\" -->\n <!-- cdkDropList -->\n <cdk-virtual-scroll-viewport\n class=\"elder-grid-browser\" fxLayout=\"column\" fxFlex\n id=\"documents-container\"\n [itemSize]=\"itemHeight\"\n [minBufferPx]=\"itemHeight * 2\"\n [maxBufferPx]=\"itemHeight * 3\"\n #virtualScrollViewPort\n infiniteScroll\n [eventThrottle]=\"200\"\n [offsetFactor]=\"2\"\n [ignoreScrollEvent]=\"data.loading | async\"\n [containerId]=\"'documents-container'\" [listenToHost]=\"false\"\n (closeToEnd)=\"requestMoreDataZoned($event)\">\n\n <!-- (scrolling)=\"onScrolling($event)\" -->\n\n <div\n *cdkVirtualFor=\"let row of dataRows$; trackBy: trackByIndex; templateCacheSize: 50\"\n class=\"elder-grid-tile-row\"\n [style.height]=\"itemHeight + 'px'\">\n\n <ng-container *ngFor=\"let tile of row; trackBy: trackByFn\">\n\n <!-- Tile Cell -->\n <div *ngIf=\"showTile(tile)\" class=\"elder-grid-tile\">\n <!-- cdkDrag [cdkDragDisabled]=\"true\" [cdkDragData]=\"tile\" -->\n <!-- <div class=\"tile-placeholder\" *cdkDragPlaceholder></div> -->\n <div class=\"elder-grid-tile-content\"\n (click)=\"onItemClick(tile)\"\n (dblclick)=\"onItemDoubleClick(tile)\">\n <ng-container\n *ngTemplateOutlet=\"tileTemplate || simpleTileTemplate; context: {$implicit: tile}\">\n </ng-container>\n\n <!-- Overlay (Selection) -->\n <ng-container *ngIf=\"selectionVisible\">\n <div *ngIf=\"selectionModel.selection | async as selection\"\n class=\"elder-grid-tile-overlay\"\n [class.elder-grid-tile-overlay-hidden]=\"!inSelectionMode(selection)\"\n [class.elder-grid-tile-overlay-visible]=\"inSelectionMode(selection)\"\n [class.elder-click-through]=\"true\"\n >\n <button mat-icon-button type=\"button\"\n (click)=\"selectionModel.toggle(tile)\" elderStopEventPropagation\n class=\"elder-grid-tile-check\">\n <mat-icon\n [class.elder-selected]=\"(selectionModel.observeSelection(tile) | async)\"\n >\n {{(selectionModel.observeSelection(tile) | async) ? 'check_circle' : 'radio_button_unchecked'}}\n </mat-icon>\n </button>\n </div>\n </ng-container>\n\n </div>\n </div>\n\n <div *ngIf=\"!showTile(tile)\" class=\"elder-grid-tile-hidden\"></div>\n </ng-container>\n\n </div>\n\n </cdk-virtual-scroll-viewport>\n\n\n <mat-progress-bar fxFlex=\"none\"\n [mode]=\"(data?.loading | async) ? 'indeterminate' : 'determinate'\"\n [color]=\"(data && (data.status | async)?.hasError) ? 'warn' : 'primary'\">\n </mat-progress-bar>\n\n <!-- Footer -->\n <div class=\"elder-grid-footer\" *ngIf=\"footerVisible\"\n fxLayout=\"row\" fxFlex=\"none\" fxLayoutAlign=\"end center\" fxLayoutGap=\"10px\"\n style=\"padding-right: 10px\">\n\n <!-- Continuable -->\n <ng-container *ngIf=\"isContinuable\">\n <span class=\"mat-caption noselect\" style=\"color: gray\">\n {{(dataSnapshot?.data | async)?.length}} / {{total$ | async}}\n </span>\n\n <button mat-icon-button type=\"button\"\n color=\"primary\"\n [disabled]=\"!(canLoadMore$ | async)\"\n (click)=\"dataSnapshot.loadMore()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </ng-container>\n\n <!-- Paged -->\n <mat-paginator #matPaginator *ngIf=\"isActivePaged && (dataActivePaged.page | async) as page\"\n fxFlex=\"none\"\n [length]=\"dataContext?.total | async\"\n [pageIndex]=\"page?.index\"\n [pageSize]=\"page?.size\"\n [pageSizeOptions]=\"pageSizeOptions\">\n </mat-paginator>\n\n <!-- Local Source -->\n <ng-container *ngIf=\"!isActivePaged && !isContinuable\">\n <span class=\"mat-caption noselect\" style=\"color: gray\">\n {{(dataSnapshot?.data | async)?.length}}\n </span>\n </ng-container>\n\n </div>\n\n\n </div>\n</div>\n\n<ng-template #simpleTileTemplate let-tile>\n <div *ngIf=\"tile\" fxLayout=\"column\" fxFlex fxLayoutAlign=\"center center\" style=\"background-color: lightblue\">\n <p class=\"noselect\">Tile: {{tile}}</p>\n </div>\n</ng-template>\n", styles: [":host{min-width:0;min-height:0}.scroll-fix{min-width:0;min-height:0}.elder-grid-tile-row{display:flex;flex-direction:row;padding:5px;margin:0 -5px}.elder-grid-tile-hidden{flex:0 1 100%;margin:5px;width:100%;height:100%}.elder-grid-tile-content{position:relative;width:100%;height:100%;overflow:hidden}.cdk-drag-preview{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{flex:0 1 100%;background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}.elder-grid-tile-overlay{position:absolute;left:0;top:0;right:0;bottom:0;transition:background-color .2s ease-in,opacity .2s ease-in}.elder-grid-tile-overlay-visible{opacity:1}.elder-grid-tile-overlay-hidden{opacity:0}.elder-grid-tile-content:hover .elder-grid-tile-overlay{opacity:1;transition:background-color .2s ease-in,opacity .2s ease-in}.elder-click-through{pointer-events:none}\n"] }]
15432
15404
  }], ctorParameters: function () { return [{ type: SelectionModel, decorators: [{
15433
15405
  type: Optional
15434
- }] }, { type: ElderDataViewSelectionMode, decorators: [{
15406
+ }] }, { type: ElderDataViewOptionsProvider, decorators: [{
15435
15407
  type: Optional
15436
15408
  }, {
15437
15409
  type: SkipSelf
@@ -18745,7 +18717,7 @@ class ElderLocalizedInputTableComponent extends FormFieldBaseComponent {
18745
18717
  }
18746
18718
  }
18747
18719
  ElderLocalizedInputTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderLocalizedInputTableComponent, deps: [{ token: ElderToastService }, { token: ElderLanguageService }], target: i0.ɵɵFactoryTarget.Component });
18748
- ElderLocalizedInputTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderLocalizedInputTableComponent, selector: "elder-localized-input-table", inputs: { dense: "dense", float: "float", embedded: "embedded", textColumns: "textColumns", defaultLanguageTags: "defaultLanguageTags" }, providers: buildFormIntegrationProviders(ElderLocalizedInputTableComponent), queries: [{ propertyName: "textColumnsQuery", predicate: ElderLocalizedTextColumnDirective }], usesInheritance: true, ngImport: i0, template: "<div fxLayout=\"column\" fxFill>\n <elder-table matSort fxFlex\n [data]=\"data\"\n [selectionVisible]=\"true\"\n [selectionMultiEnabled]=\"true\"\n [dense]=\"dense\"\n [float]=\"float\"\n [embedded]=\"embedded\"\n >\n\n <elder-data-toolbar\n *elderTableToolbar\n [canAdd]=\"!isLocked\"\n [canRemove]=\"!isLocked\"\n [canMore]=\"false\"\n (requestNew)=\"onNewRequested()\"\n (requestRemove)=\"onRemoveRequested($event)\"\n >\n\n <ng-template elderToolbarContent=\"left.actions\">\n <div fxLayout=\"column\" fxLayoutAlign=\"start center\">\n <h4 elderCardSubtitle style=\"margin: 0\">{{label ?? placeholder}}</h4>\n </div>\n </ng-template>\n\n </elder-data-toolbar>\n\n <ng-container matColumnDef=\"locale\">\n <th mat-header-cell *matHeaderCellDef style=\"width: 100px\" mat-sort-header>Locale</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-chip-list><mat-chip>{{localized.locale}}</mat-chip></mat-chip-list>\n </td>\n </ng-container>\n\n <ng-container *ngFor=\"let textColumn of textColumns$ | async\" matColumnDef=\"{{textColumn.name}}\">\n <th mat-header-cell *matHeaderCellDef>{{textColumn.title | translate}}</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-form-field class=\"full-width\">\n <input\n matInput\n type=\"text\"\n name=\"i18n-{{localized.locale}}-{{textColumn.name}}\"\n [ngModel]=\"localized[textColumn.name]\" [ngModelOptions]=\"{updateOn: 'blur'}\"\n (ngModelChange)=\"onColumnTextUpdated(localized, textColumn, $event)\"\n [required]=\"required && textColumn.required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n />\n <mat-hint>{{textColumn.title | translate}} ({{localized.locale}})</mat-hint>\n <mat-error>Required</mat-error>\n </mat-form-field>\n </td>\n </ng-container>\n\n </elder-table>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i11.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i11.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2$4.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i2$4.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i5$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ElderTableComponent, selector: "elder-table, ebs-table", inputs: ["idField", "removingField", "hiddenField", "pageSizeOptions", "cleanUp", "keepSelection", "showFooter", "toolbarTemplate", "data", "displayedColumns", "selectionVisible"] }, { kind: "directive", type: ElderTableToolbarDirective, selector: "[elderTableToolbar]" }, { kind: "component", type: ElderDataToolbarComponent, selector: "elder-data-toolbar", inputs: ["canAdd", "canRemove", "canMore", "confirmRemoval", "keepSelectionAfterRemoval", "selectionModel"], outputs: ["requestNew", "requestRemove"] }, { kind: "directive", type: ElderToolbarContentDirective, selector: "[elderToolbarContent]", inputs: ["elderToolbarContent"] }, { kind: "component", type: i6$1.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i6$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: ElderCardSubtitleDirective, selector: "elder-card-subtitle, [elder-card-subtitle], [elderCardSubtitle]" }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
18720
+ ElderLocalizedInputTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderLocalizedInputTableComponent, selector: "elder-localized-input-table", inputs: { dense: "dense", float: "float", embedded: "embedded", textColumns: "textColumns", defaultLanguageTags: "defaultLanguageTags" }, providers: buildFormIntegrationProviders(ElderLocalizedInputTableComponent), queries: [{ propertyName: "textColumnsQuery", predicate: ElderLocalizedTextColumnDirective }], usesInheritance: true, ngImport: i0, template: "<div fxLayout=\"column\" fxFill>\n <elder-table matSort fxFlex\n [data]=\"data\"\n [selectionVisible]=\"true\"\n [selectionMultiEnabled]=\"true\"\n [dense]=\"dense\"\n [float]=\"float\"\n [embedded]=\"embedded\"\n >\n\n <elder-data-toolbar\n *elderTableToolbar\n [canAdd]=\"!isLocked\"\n [canRemove]=\"!isLocked\"\n [canMore]=\"false\"\n (requestNew)=\"onNewRequested()\"\n (requestRemove)=\"onRemoveRequested($event)\"\n >\n\n <ng-template elderToolbarContent=\"left.actions\">\n <div fxLayout=\"column\" fxLayoutAlign=\"start center\">\n <h4 elderCardSubtitle style=\"margin: 0\">{{label ?? placeholder}}</h4>\n </div>\n </ng-template>\n\n </elder-data-toolbar>\n\n <ng-container matColumnDef=\"locale\">\n <th mat-header-cell *matHeaderCellDef style=\"width: 100px\" mat-sort-header>Locale</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-chip-list><mat-chip>{{localized.locale}}</mat-chip></mat-chip-list>\n </td>\n </ng-container>\n\n <ng-container *ngFor=\"let textColumn of textColumns$ | async\" matColumnDef=\"{{textColumn.name}}\">\n <th mat-header-cell *matHeaderCellDef>{{textColumn.title | translate}}</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-form-field class=\"full-width\">\n <input\n matInput\n type=\"text\"\n name=\"i18n-{{localized.locale}}-{{textColumn.name}}\"\n [ngModel]=\"localized[textColumn.name]\" [ngModelOptions]=\"{updateOn: 'blur'}\"\n (ngModelChange)=\"onColumnTextUpdated(localized, textColumn, $event)\"\n [required]=\"required && textColumn.required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n />\n <mat-hint>{{textColumn.title | translate}} ({{localized.locale}})</mat-hint>\n <mat-error>Required</mat-error>\n </mat-form-field>\n </td>\n </ng-container>\n\n </elder-table>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i11.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i11.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2$4.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i2$4.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i5$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ElderTableComponent, selector: "elder-table, ebs-table", inputs: ["idField", "removingField", "hiddenField", "pageSizeOptions", "keepSelection", "showFooter", "toolbarTemplate", "data", "displayedColumns", "selectionVisible"] }, { kind: "directive", type: ElderTableToolbarDirective, selector: "[elderTableToolbar]" }, { kind: "component", type: ElderDataToolbarComponent, selector: "elder-data-toolbar", inputs: ["canAdd", "canRemove", "canMore", "confirmRemoval", "keepSelectionAfterRemoval", "selectionModel"], outputs: ["requestNew", "requestRemove"] }, { kind: "directive", type: ElderToolbarContentDirective, selector: "[elderToolbarContent]", inputs: ["elderToolbarContent"] }, { kind: "component", type: i6$1.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i6$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: ElderCardSubtitleDirective, selector: "elder-card-subtitle, [elder-card-subtitle], [elderCardSubtitle]" }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
18749
18721
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderLocalizedInputTableComponent, decorators: [{
18750
18722
  type: Component,
18751
18723
  args: [{ selector: 'elder-localized-input-table', changeDetection: ChangeDetectionStrategy.OnPush, providers: buildFormIntegrationProviders(ElderLocalizedInputTableComponent), template: "<div fxLayout=\"column\" fxFill>\n <elder-table matSort fxFlex\n [data]=\"data\"\n [selectionVisible]=\"true\"\n [selectionMultiEnabled]=\"true\"\n [dense]=\"dense\"\n [float]=\"float\"\n [embedded]=\"embedded\"\n >\n\n <elder-data-toolbar\n *elderTableToolbar\n [canAdd]=\"!isLocked\"\n [canRemove]=\"!isLocked\"\n [canMore]=\"false\"\n (requestNew)=\"onNewRequested()\"\n (requestRemove)=\"onRemoveRequested($event)\"\n >\n\n <ng-template elderToolbarContent=\"left.actions\">\n <div fxLayout=\"column\" fxLayoutAlign=\"start center\">\n <h4 elderCardSubtitle style=\"margin: 0\">{{label ?? placeholder}}</h4>\n </div>\n </ng-template>\n\n </elder-data-toolbar>\n\n <ng-container matColumnDef=\"locale\">\n <th mat-header-cell *matHeaderCellDef style=\"width: 100px\" mat-sort-header>Locale</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-chip-list><mat-chip>{{localized.locale}}</mat-chip></mat-chip-list>\n </td>\n </ng-container>\n\n <ng-container *ngFor=\"let textColumn of textColumns$ | async\" matColumnDef=\"{{textColumn.name}}\">\n <th mat-header-cell *matHeaderCellDef>{{textColumn.title | translate}}</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-form-field class=\"full-width\">\n <input\n matInput\n type=\"text\"\n name=\"i18n-{{localized.locale}}-{{textColumn.name}}\"\n [ngModel]=\"localized[textColumn.name]\" [ngModelOptions]=\"{updateOn: 'blur'}\"\n (ngModelChange)=\"onColumnTextUpdated(localized, textColumn, $event)\"\n [required]=\"required && textColumn.required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n />\n <mat-hint>{{textColumn.title | translate}} ({{localized.locale}})</mat-hint>\n <mat-error>Required</mat-error>\n </mat-form-field>\n </td>\n </ng-container>\n\n </elder-table>\n</div>\n" }]
@@ -21197,12 +21169,160 @@ class ElderSelectValueDirective {
21197
21169
  this.viewContainer = viewContainer;
21198
21170
  }
21199
21171
  }
21200
- ElderSelectValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectValueDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
21201
- ElderSelectValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectValueDirective, selector: "[elderSelectValue]", ngImport: i0 });
21202
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectValueDirective, decorators: [{
21172
+ ElderSelectValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectValueDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
21173
+ ElderSelectValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectValueDirective, selector: "[elderSelectValue]", ngImport: i0 });
21174
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectValueDirective, decorators: [{
21175
+ type: Directive,
21176
+ args: [{ selector: '[elderSelectValue]' }]
21177
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
21178
+
21179
+ class TemplatedSelectionDialogComponent {
21180
+ /***************************************************************************
21181
+ * *
21182
+ * Constructor *
21183
+ * *
21184
+ **************************************************************************/
21185
+ constructor(dialogRef, data, selectionModel) {
21186
+ this.dialogRef = dialogRef;
21187
+ this.data = data;
21188
+ this.selectionModel = selectionModel;
21189
+ /***************************************************************************
21190
+ * *
21191
+ * Fields *
21192
+ * *
21193
+ **************************************************************************/
21194
+ this.log = LoggerFactory.getLogger(this.constructor.name);
21195
+ }
21196
+ /***************************************************************************
21197
+ * *
21198
+ * Component Events *
21199
+ * *
21200
+ **************************************************************************/
21201
+ ngOnInit() {
21202
+ }
21203
+ }
21204
+ TemplatedSelectionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: TemplatedSelectionDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: SelectionModel }], target: i0.ɵɵFactoryTarget.Component });
21205
+ TemplatedSelectionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: TemplatedSelectionDialogComponent, selector: "elder-templated-selection-dialog", ngImport: i0, template: "<div fxLayout=\"column\" fxFill>\n <mat-toolbar elderTheme fxFlex=\"none\">\n <button mat-icon-button type=\"button\" matDialogClose=\"\">\n <mat-icon>close</mat-icon>\n </button>\n <span fxFlex></span>\n <button mat-stroked-button type=\"submit\" color=\"accent\"\n *ngIf=\"selectionModel.selection | async as selection\"\n [disabled]=\"!selection || selection.length === 0\"\n [mat-dialog-close]=\"selection\"\n >\n {{'actions.select' | translate}}\n </button>\n </mat-toolbar>\n <div fxLayout=\"column\" fxFlex style=\"overflow: hidden\">\n <ng-container *ngTemplateOutlet=\"data.selectionComponentTemplate\"></ng-container>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i1$7.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: ElderThemeDirective, selector: "[elderTheme]" }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
21206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: TemplatedSelectionDialogComponent, decorators: [{
21207
+ type: Component,
21208
+ args: [{ selector: 'elder-templated-selection-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div fxLayout=\"column\" fxFill>\n <mat-toolbar elderTheme fxFlex=\"none\">\n <button mat-icon-button type=\"button\" matDialogClose=\"\">\n <mat-icon>close</mat-icon>\n </button>\n <span fxFlex></span>\n <button mat-stroked-button type=\"submit\" color=\"accent\"\n *ngIf=\"selectionModel.selection | async as selection\"\n [disabled]=\"!selection || selection.length === 0\"\n [mat-dialog-close]=\"selection\"\n >\n {{'actions.select' | translate}}\n </button>\n </mat-toolbar>\n <div fxLayout=\"column\" fxFlex style=\"overflow: hidden\">\n <ng-container *ngTemplateOutlet=\"data.selectionComponentTemplate\"></ng-container>\n </div>\n</div>\n" }]
21209
+ }], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
21210
+ type: Inject,
21211
+ args: [MAT_DIALOG_DATA]
21212
+ }] }, { type: SelectionModel }]; } });
21213
+
21214
+ function createSelectionModel$1() {
21215
+ return new SelectionModel();
21216
+ }
21217
+ function createDataViewOptionsProvider() {
21218
+ return new ElderDataViewOptionsProvider();
21219
+ }
21220
+ class SelectionModelPopupDirective {
21221
+ /***************************************************************************
21222
+ * *
21223
+ * Constructor *
21224
+ * *
21225
+ **************************************************************************/
21226
+ constructor(templateRef, viewContainer, dialog, dataViewOptionsProvider, selectionModel, changeDetectorRef) {
21227
+ this.templateRef = templateRef;
21228
+ this.viewContainer = viewContainer;
21229
+ this.dialog = dialog;
21230
+ this.dataViewOptionsProvider = dataViewOptionsProvider;
21231
+ this.selectionModel = selectionModel;
21232
+ this.changeDetectorRef = changeDetectorRef;
21233
+ /***************************************************************************
21234
+ * *
21235
+ * Fields *
21236
+ * *
21237
+ **************************************************************************/
21238
+ this.log = LoggerFactory.getLogger(this.constructor.name);
21239
+ }
21240
+ set elderSelectionModelPopupTransform(fn) {
21241
+ this._transformerFn = fn;
21242
+ }
21243
+ /***************************************************************************
21244
+ * *
21245
+ * Public API *
21246
+ * *
21247
+ **************************************************************************/
21248
+ /**
21249
+ * Let the user choose some entities and return the selection.
21250
+ */
21251
+ choose(keyGetter, currentSelection, filters, sorts, multi = false) {
21252
+ this.dataViewOptionsProvider.updateOptions(options => options
21253
+ .withFilters(filters || [])
21254
+ .withSorts(sorts || [])
21255
+ .withSelectionMultiEnabled(multi));
21256
+ this.selectionModel.isMultipleSelection = multi;
21257
+ this.selectionModel.keyGetterFn = keyGetter;
21258
+ this.selectionModel.replaceSelection(currentSelection);
21259
+ this.log.info('Replaced selection popup with current ' + currentSelection.length + ' entities:', currentSelection);
21260
+ const dialogRef = this.openSelectDialog();
21261
+ // This fixes dialog rendering when the browser template
21262
+ // view container is outside the invoking control, which
21263
+ // happens when using ng-content projection.
21264
+ this.changeDetectorRef.markForCheck();
21265
+ return dialogRef.afterClosed().pipe(switchMap((chosenEntities) => {
21266
+ if (chosenEntities) {
21267
+ return this._transformerFn
21268
+ ? of(chosenEntities.map(value => this._transformerFn(value)))
21269
+ : of(chosenEntities);
21270
+ }
21271
+ else {
21272
+ return EMPTY;
21273
+ }
21274
+ }));
21275
+ }
21276
+ /***************************************************************************
21277
+ * *
21278
+ * Private methods *
21279
+ * *
21280
+ **************************************************************************/
21281
+ openSelectDialog() {
21282
+ return this.dialog.open(TemplatedSelectionDialogComponent, {
21283
+ width: '90vw',
21284
+ height: '90vh',
21285
+ panelClass: 'custom-dialog-container',
21286
+ data: {
21287
+ selectionComponentTemplate: this.templateRef
21288
+ },
21289
+ viewContainerRef: this.viewContainer
21290
+ });
21291
+ }
21292
+ }
21293
+ SelectionModelPopupDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SelectionModelPopupDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i1$7.MatDialog }, { token: ElderDataViewOptionsProvider }, { token: SelectionModel }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
21294
+ SelectionModelPopupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: SelectionModelPopupDirective, selector: "[elderSelectionModelPopup]", inputs: { elderSelectionModelPopupTransform: "elderSelectionModelPopupTransform" }, providers: [
21295
+ {
21296
+ provide: SelectionModel,
21297
+ useFactory: createSelectionModel$1
21298
+ },
21299
+ {
21300
+ provide: ElderDataViewOptionsProvider,
21301
+ useFactory: createDataViewOptionsProvider
21302
+ },
21303
+ ElderTableProviders.ClearTableModel // Since this popup is frequently used inside an elder-table search box
21304
+ ], exportAs: ["elderSelectionModelPopup"], ngImport: i0 });
21305
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SelectionModelPopupDirective, decorators: [{
21203
21306
  type: Directive,
21204
- args: [{ selector: '[elderSelectValue]' }]
21205
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
21307
+ args: [{
21308
+ selector: '[elderSelectionModelPopup]',
21309
+ exportAs: 'elderSelectionModelPopup',
21310
+ providers: [
21311
+ {
21312
+ provide: SelectionModel,
21313
+ useFactory: createSelectionModel$1
21314
+ },
21315
+ {
21316
+ provide: ElderDataViewOptionsProvider,
21317
+ useFactory: createDataViewOptionsProvider
21318
+ },
21319
+ ElderTableProviders.ClearTableModel // Since this popup is frequently used inside an elder-table search box
21320
+ ]
21321
+ }]
21322
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i1$7.MatDialog }, { type: ElderDataViewOptionsProvider }, { type: SelectionModel }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { elderSelectionModelPopupTransform: [{
21323
+ type: Input,
21324
+ args: ['elderSelectionModelPopupTransform']
21325
+ }] } });
21206
21326
 
21207
21327
  class ElderSelectComponentState {
21208
21328
  constructor(idle, loading, error) {
@@ -25088,13 +25208,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
25088
25208
  }]
25089
25209
  }] });
25090
25210
 
25211
+ class TypedEventMessage {
25212
+ constructor(type, data) {
25213
+ this.type = type;
25214
+ this.data = data;
25215
+ }
25216
+ // type predicate to check weather an object is a DataViewMessage type
25217
+ static isOfType(obj) {
25218
+ return obj.type !== undefined
25219
+ && obj.data !== undefined;
25220
+ }
25221
+ }
25222
+ class DataViewSelectionInit {
25223
+ constructor(options, initialSelection = [], idField = 'id') {
25224
+ this.options = options;
25225
+ this.initialSelection = initialSelection;
25226
+ this.idField = idField;
25227
+ }
25228
+ }
25229
+ class DataViewSelection {
25230
+ constructor(selection) {
25231
+ this.selection = selection;
25232
+ }
25233
+ }
25234
+ class DataViewMessage extends TypedEventMessage {
25235
+ constructor(type, data) {
25236
+ super(type, data);
25237
+ this.type = type;
25238
+ this.data = data;
25239
+ }
25240
+ static initialSelection(init) {
25241
+ return new DataViewMessage('SELECTION_INIT', init);
25242
+ }
25243
+ static selection(selection) {
25244
+ return new DataViewMessage('SELECTION_SELECTED', selection);
25245
+ }
25246
+ // type predicate to check weather an object is a DataViewMessage type
25247
+ static isOfType(obj) {
25248
+ return obj.type !== undefined
25249
+ && obj.data !== undefined;
25250
+ }
25251
+ }
25252
+
25091
25253
  class IFrameState {
25092
- constructor(state, message = null) {
25093
- this.state = state;
25254
+ constructor(type, message = null) {
25255
+ this.type = type;
25094
25256
  this.message = message;
25095
25257
  }
25258
+ get isLoading() {
25259
+ return this.type === 'LOADING';
25260
+ }
25261
+ get hasLoaded() {
25262
+ return this.type == 'LOADED';
25263
+ }
25096
25264
  get hasError() {
25097
- return this.state === 'error';
25265
+ return this.type === 'ERROR';
25098
25266
  }
25099
25267
  }
25100
25268
  class IframeHostComponent {
@@ -25109,24 +25277,37 @@ class IframeHostComponent {
25109
25277
  * Fields *
25110
25278
  * *
25111
25279
  **************************************************************************/
25112
- this.logger = LoggerFactory.getLogger(this.constructor.name);
25280
+ this.log = LoggerFactory.getLogger(this.constructor.name);
25113
25281
  this.iframeParams$ = new BehaviorSubject(null);
25114
- this.iframeState$ = new BehaviorSubject(new IFrameState('loading'));
25115
- this.post = new EventEmitter();
25282
+ this.iframeState$ = new BehaviorSubject(new IFrameState('LOADING'));
25283
+ this.message = new EventEmitter();
25116
25284
  this.close = new EventEmitter();
25117
25285
  }
25118
25286
  /***************************************************************************
25119
25287
  * *
25120
- * Lifecycle *
25288
+ * Listeners *
25121
25289
  * *
25122
25290
  **************************************************************************/
25123
- ngOnInit() { }
25124
- onMessage(e) {
25125
- const key = e.message ? 'message' : 'data';
25126
- const data = e[key];
25127
- this.onChildMessage(data);
25291
+ /**
25292
+ * Listens for messages from window.
25293
+ * Makes it possible to react upon messages from iframe child window.
25294
+ *
25295
+ * @param event message from child window
25296
+ */
25297
+ onWindowMessage(event) {
25298
+ this.log.debug('Received message from child:', event);
25299
+ if (event) {
25300
+ if (TypedEventMessage.isOfType(event.data))
25301
+ this.handleMessageFromChild(event.data);
25302
+ }
25128
25303
  return true;
25129
25304
  }
25305
+ /***************************************************************************
25306
+ * *
25307
+ * Lifecycle *
25308
+ * *
25309
+ **************************************************************************/
25310
+ ngOnInit() { }
25130
25311
  /***************************************************************************
25131
25312
  * *
25132
25313
  * Properties *
@@ -25140,9 +25321,17 @@ class IframeHostComponent {
25140
25321
  * Public API *
25141
25322
  * *
25142
25323
  **************************************************************************/
25143
- onIframeLoadError(err) {
25144
- this.logger.warn('Failed to load iframe', err);
25145
- this.iframeState$.next(new IFrameState('loading', err + ''));
25324
+ onIframeLoadEvent(event) {
25325
+ this.log.debug('Finished loading iframe', event);
25326
+ this.iframeState$.next(new IFrameState('LOADED'));
25327
+ }
25328
+ onIframeErrorEvent(err) {
25329
+ this.log.warn('Failed to load iframe', err);
25330
+ this.iframeState$.next(new IFrameState('ERROR', err + ''));
25331
+ }
25332
+ sendMessageToChild(msg) {
25333
+ this.log.debug('Sending message to iframe child:', msg);
25334
+ this.iframe.nativeElement.contentWindow.postMessage(msg, "*");
25146
25335
  }
25147
25336
  doClose(event) {
25148
25337
  this.close.emit();
@@ -25152,28 +25341,26 @@ class IframeHostComponent {
25152
25341
  * Private methods *
25153
25342
  * *
25154
25343
  **************************************************************************/
25155
- onChildMessage(message) {
25156
- this.logger.debug('Received message from child:', message);
25157
- switch (message.action) {
25158
- case 'POST':
25159
- this.post.emit(message.data);
25160
- break;
25161
- case 'CLOSE':
25162
- this.close.emit(message.data);
25163
- break;
25344
+ handleMessageFromChild(message) {
25345
+ this.message.next(message);
25346
+ if (message.type === 'CLOSE') {
25347
+ this.close.emit(message.data);
25164
25348
  }
25165
25349
  }
25166
25350
  }
25167
25351
  IframeHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
25168
- IframeHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: { iframeParams: "iframeParams" }, outputs: { post: "post", close: "close" }, host: { listeners: { "window:message": "onMessage($event)" } }, ngImport: i0, template: "<ng-container *ngIf=\"{state: iframeState$ | async, params: iframeParams$ | async} as ctx\">\n\n <div fxLayout=\"column\" fxFill>\n\n <!-- In Case of Error -->\n <div *ngIf=\"ctx.state.hasError\"\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n fxFlex\n >\n <span>Failed to load Iframe: {{ctx.state.message}}</span>\n </div>\n\n <!-- IFrame -->\n <iframe fxFlex\n *ngIf=\"!ctx.state.hasError\"\n (error)=\"onIframeLoadError($event)\"\n [src]=\"ctx.params.srcUrl | elderSafeUrl\"\n class=\"iframe\"\n allow=\"clipboard *;clipboard-read *;clipboard-write *;\"\n ></iframe>\n\n <!-- Bottom Toolbar -->\n <div *ngIf=\"!ctx.params.hideActionBar\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" fxFlex=\"none\" class=\"toolbar\">\n\n <a mat-icon-button (click)=\"doClose($event)\" class=\"dense-button\">\n <mat-icon class=\"small-icon\">close</mat-icon>\n </a>\n\n <a mat-icon-button class=\"dense-button\"\n [href]=\"ctx.params.srcUrl | elderSafeUrl\" target=\"_blank\">\n <mat-icon class=\"small-icon\">open_in_new</mat-icon>\n </a>\n\n </div>\n\n </div>\n\n</ng-container>\n\n\n\n", styles: [".iframe{margin:0;border:0;height:100%;background-color:#fff}\n"], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: ElderSafeUrlPipe, name: "elderSafeUrl" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
25352
+ IframeHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: { iframeParams: "iframeParams" }, outputs: { message: "message", close: "close" }, host: { listeners: { "window:message": "onWindowMessage($event)" } }, viewQueries: [{ propertyName: "iframe", first: true, predicate: ["iframe"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"{state: iframeState$ | async, params: iframeParams$ | async} as ctx\">\n\n <div fxLayout=\"column\" fxFill>\n\n <!-- In Case of Error -->\n <div *ngIf=\"ctx.state.hasError\"\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n fxFlex\n >\n <span>Failed to load Iframe: {{ctx.state.message}}</span>\n </div>\n\n <!-- IFrame -->\n <iframe fxFlex #iframe\n *ngIf=\"!ctx.state.hasError\"\n (load)=\"onIframeLoadEvent($event)\"\n (error)=\"onIframeErrorEvent($event)\"\n [src]=\"ctx.params.srcUrl | elderSafeUrl\"\n class=\"iframe\"\n allow=\"clipboard *;clipboard-read *;clipboard-write *;\"\n ></iframe>\n\n <!-- Bottom Toolbar -->\n <div *ngIf=\"!ctx.params.hideActionBar\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" fxFlex=\"none\" class=\"toolbar\">\n\n <a mat-icon-button (click)=\"doClose($event)\" class=\"dense-button\">\n <mat-icon class=\"small-icon\">close</mat-icon>\n </a>\n\n <a mat-icon-button class=\"dense-button\"\n [href]=\"ctx.params.srcUrl | elderSafeUrl\" target=\"_blank\">\n <mat-icon class=\"small-icon\">open_in_new</mat-icon>\n </a>\n\n </div>\n\n </div>\n\n</ng-container>\n\n\n\n", styles: [".iframe{margin:0;border:0;height:100%;background-color:#fff}\n"], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: ElderSafeUrlPipe, name: "elderSafeUrl" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
25169
25353
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeHostComponent, decorators: [{
25170
25354
  type: Component,
25171
- args: [{ selector: 'elder-i-frame-host', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{state: iframeState$ | async, params: iframeParams$ | async} as ctx\">\n\n <div fxLayout=\"column\" fxFill>\n\n <!-- In Case of Error -->\n <div *ngIf=\"ctx.state.hasError\"\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n fxFlex\n >\n <span>Failed to load Iframe: {{ctx.state.message}}</span>\n </div>\n\n <!-- IFrame -->\n <iframe fxFlex\n *ngIf=\"!ctx.state.hasError\"\n (error)=\"onIframeLoadError($event)\"\n [src]=\"ctx.params.srcUrl | elderSafeUrl\"\n class=\"iframe\"\n allow=\"clipboard *;clipboard-read *;clipboard-write *;\"\n ></iframe>\n\n <!-- Bottom Toolbar -->\n <div *ngIf=\"!ctx.params.hideActionBar\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" fxFlex=\"none\" class=\"toolbar\">\n\n <a mat-icon-button (click)=\"doClose($event)\" class=\"dense-button\">\n <mat-icon class=\"small-icon\">close</mat-icon>\n </a>\n\n <a mat-icon-button class=\"dense-button\"\n [href]=\"ctx.params.srcUrl | elderSafeUrl\" target=\"_blank\">\n <mat-icon class=\"small-icon\">open_in_new</mat-icon>\n </a>\n\n </div>\n\n </div>\n\n</ng-container>\n\n\n\n", styles: [".iframe{margin:0;border:0;height:100%;background-color:#fff}\n"] }]
25172
- }], ctorParameters: function () { return []; }, propDecorators: { post: [{
25355
+ args: [{ selector: 'elder-i-frame-host', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{state: iframeState$ | async, params: iframeParams$ | async} as ctx\">\n\n <div fxLayout=\"column\" fxFill>\n\n <!-- In Case of Error -->\n <div *ngIf=\"ctx.state.hasError\"\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n fxFlex\n >\n <span>Failed to load Iframe: {{ctx.state.message}}</span>\n </div>\n\n <!-- IFrame -->\n <iframe fxFlex #iframe\n *ngIf=\"!ctx.state.hasError\"\n (load)=\"onIframeLoadEvent($event)\"\n (error)=\"onIframeErrorEvent($event)\"\n [src]=\"ctx.params.srcUrl | elderSafeUrl\"\n class=\"iframe\"\n allow=\"clipboard *;clipboard-read *;clipboard-write *;\"\n ></iframe>\n\n <!-- Bottom Toolbar -->\n <div *ngIf=\"!ctx.params.hideActionBar\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" fxFlex=\"none\" class=\"toolbar\">\n\n <a mat-icon-button (click)=\"doClose($event)\" class=\"dense-button\">\n <mat-icon class=\"small-icon\">close</mat-icon>\n </a>\n\n <a mat-icon-button class=\"dense-button\"\n [href]=\"ctx.params.srcUrl | elderSafeUrl\" target=\"_blank\">\n <mat-icon class=\"small-icon\">open_in_new</mat-icon>\n </a>\n\n </div>\n\n </div>\n\n</ng-container>\n\n\n\n", styles: [".iframe{margin:0;border:0;height:100%;background-color:#fff}\n"] }]
25356
+ }], ctorParameters: function () { return []; }, propDecorators: { iframe: [{
25357
+ type: ViewChild,
25358
+ args: ['iframe']
25359
+ }], message: [{
25173
25360
  type: Output
25174
25361
  }], close: [{
25175
25362
  type: Output
25176
- }], onMessage: [{
25363
+ }], onWindowMessage: [{
25177
25364
  type: HostListener,
25178
25365
  args: ['window:message', ['$event']]
25179
25366
  }], iframeParams: [{
@@ -25214,7 +25401,7 @@ class IframeDialogComponent {
25214
25401
  }
25215
25402
  }
25216
25403
  IframeDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
25217
- IframeDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeDialogComponent, selector: "elder-i-frame-dialog", ngImport: i0, template: "<div *ngIf=\"iframeParams$ | async as iFrameParams\" fxFill>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: ["iframeParams"], outputs: ["post", "close"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
25404
+ IframeDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeDialogComponent, selector: "elder-i-frame-dialog", ngImport: i0, template: "<div *ngIf=\"iframeParams$ | async as iFrameParams\" fxFill>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: ["iframeParams"], outputs: ["message", "close"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
25218
25405
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeDialogComponent, decorators: [{
25219
25406
  type: Component,
25220
25407
  args: [{ selector: 'elder-i-frame-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"iframeParams$ | async as iFrameParams\" fxFill>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n" }]
@@ -25286,7 +25473,7 @@ class IframeSideContentComponent {
25286
25473
  IframeSideContentComponent.QUERY_PARAM_SRC_URL = 'srcUrl';
25287
25474
  IframeSideContentComponent.QUERY_PARAM_WIDTH = 'width';
25288
25475
  IframeSideContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeSideContentComponent, deps: [{ token: i1$3.Router }, { token: i1$3.ActivatedRoute }, { token: ElderShellService }], target: i0.ɵɵFactoryTarget.Component });
25289
- IframeSideContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeSideContentComponent, selector: "elder-i-frame-side-host", ngImport: i0, template: "\n<div *ngIf=\"iframeParams$ | async as iFrameParams\"\n [style.width]=\"iFrameParams.width\" fxFill\n>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: ["iframeParams"], outputs: ["post", "close"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
25476
+ IframeSideContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeSideContentComponent, selector: "elder-i-frame-side-host", ngImport: i0, template: "\n<div *ngIf=\"iframeParams$ | async as iFrameParams\"\n [style.width]=\"iFrameParams.width\" fxFill\n>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: ["iframeParams"], outputs: ["message", "close"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
25290
25477
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeSideContentComponent, decorators: [{
25291
25478
  type: Component,
25292
25479
  args: [{ selector: 'elder-i-frame-side-host', changeDetection: ChangeDetectionStrategy.OnPush, template: "\n<div *ngIf=\"iframeParams$ | async as iFrameParams\"\n [style.width]=\"iFrameParams.width\" fxFill\n>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n" }]
@@ -25321,7 +25508,7 @@ class IframeService {
25321
25508
  }
25322
25509
  postCloseMessage(data) {
25323
25510
  IframeService.postToParent({
25324
- action: 'CLOSE',
25511
+ type: 'CLOSE',
25325
25512
  data: data
25326
25513
  });
25327
25514
  }
@@ -25375,13 +25562,250 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
25375
25562
  ['$event']]
25376
25563
  }] } });
25377
25564
 
25565
+ /**
25566
+ * Container for displaying a remote data view in an iframe.
25567
+ * Provides capabilities to communicate between remote data view (child)
25568
+ * and iframe parent.
25569
+ */
25570
+ class DataViewIframeComponent {
25571
+ /***************************************************************************
25572
+ * *
25573
+ * Constructor *
25574
+ * *
25575
+ **************************************************************************/
25576
+ constructor(selectionModel) {
25577
+ this.selectionModel = selectionModel;
25578
+ /***************************************************************************
25579
+ * *
25580
+ * Fields *
25581
+ * *
25582
+ **************************************************************************/
25583
+ this.log = LoggerFactory.getLogger(this.constructor.name);
25584
+ this._dataViewOptions$ = new BehaviorSubject(null);
25585
+ this._destroy$ = new Subject();
25586
+ }
25587
+ /***************************************************************************
25588
+ * *
25589
+ * Life Cycle *
25590
+ * *
25591
+ **************************************************************************/
25592
+ ngOnInit() {
25593
+ }
25594
+ ngAfterViewInit() {
25595
+ // iframe is only available after view init
25596
+ this.setupDataViewOptionsBridge(this.iframeHost);
25597
+ }
25598
+ ngOnDestroy() {
25599
+ this._destroy$.next();
25600
+ this._destroy$.complete();
25601
+ }
25602
+ /***************************************************************************
25603
+ * *
25604
+ * Properties *
25605
+ * *
25606
+ **************************************************************************/
25607
+ get dataViewOptions() {
25608
+ return this._dataViewOptions$.getValue();
25609
+ }
25610
+ set dataViewOptions(options) {
25611
+ this._dataViewOptions$.next(options);
25612
+ }
25613
+ get dataViewOptions$() {
25614
+ return this._dataViewOptions$.asObservable();
25615
+ }
25616
+ /***************************************************************************
25617
+ * *
25618
+ * Public API *
25619
+ * *
25620
+ **************************************************************************/
25621
+ onMessageFromChild(message) {
25622
+ if (DataViewMessage.isOfType(message)) {
25623
+ switch (message.type) {
25624
+ case 'SELECTION_SELECTED':
25625
+ this.handleSelectionMessage(message.data);
25626
+ break;
25627
+ }
25628
+ }
25629
+ }
25630
+ sendMessageToChild(message) {
25631
+ this.log.debug("Sending message to iframe child:", message);
25632
+ this.iframeHost.sendMessageToChild(message);
25633
+ }
25634
+ /***************************************************************************
25635
+ * *
25636
+ * Private Methods *
25637
+ * *
25638
+ **************************************************************************/
25639
+ handleSelectionMessage(dataViewSelection) {
25640
+ if (this.selectionModel) {
25641
+ this.selectionModel.replaceSelection(dataViewSelection.selection);
25642
+ }
25643
+ }
25644
+ setupDataViewOptionsBridge(iframeHost) {
25645
+ combineLatest([
25646
+ this._dataViewOptions$,
25647
+ iframeHost.iframeState$
25648
+ ]).pipe(takeUntil(this._destroy$), filter(([options, state]) => !!options && state.hasLoaded)).subscribe(([options, state]) => this.sendMessageToChild(this.buildDataViewInitMessage(options, this.initialSelection)));
25649
+ }
25650
+ buildDataViewInitMessage(options, initialSelection) {
25651
+ return DataViewMessage.initialSelection(new DataViewSelectionInit(options, initialSelection, this.idField));
25652
+ }
25653
+ }
25654
+ DataViewIframeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataViewIframeComponent, deps: [{ token: SelectionModel, optional: true }], target: i0.ɵɵFactoryTarget.Component });
25655
+ DataViewIframeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: DataViewIframeComponent, selector: "elder-data-view-iframe", inputs: { srcUrl: "srcUrl", idField: "idField", initialSelection: "initialSelection", dataViewOptions: "dataViewOptions" }, viewQueries: [{ propertyName: "iframeHost", first: true, predicate: IframeHostComponent, descendants: true }], ngImport: i0, template: "<div fxLayout=\"column\" fxFill>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"{srcUrl: srcUrl, hideActionBar: true}\"\n (message)=\"onMessageFromChild($event)\">\n </elder-i-frame-host>\n\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: ["iframeParams"], outputs: ["message", "close"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
25656
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataViewIframeComponent, decorators: [{
25657
+ type: Component,
25658
+ args: [{ selector: 'elder-data-view-iframe', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div fxLayout=\"column\" fxFill>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"{srcUrl: srcUrl, hideActionBar: true}\"\n (message)=\"onMessageFromChild($event)\">\n </elder-i-frame-host>\n\n</div>\n" }]
25659
+ }], ctorParameters: function () { return [{ type: SelectionModel, decorators: [{
25660
+ type: Optional
25661
+ }] }]; }, propDecorators: { srcUrl: [{
25662
+ type: Input
25663
+ }], idField: [{
25664
+ type: Input
25665
+ }], initialSelection: [{
25666
+ type: Input
25667
+ }], iframeHost: [{
25668
+ type: ViewChild,
25669
+ args: [IframeHostComponent]
25670
+ }], dataViewOptions: [{
25671
+ type: Input
25672
+ }] } });
25673
+
25674
+ function createSelectionModel() {
25675
+ return new SelectionModel();
25676
+ }
25677
+ function createDataOptionsProvider() {
25678
+ return new ElderDataViewOptionsProvider();
25679
+ }
25680
+ /**
25681
+ * An adapter bridging communication between
25682
+ * a data view displayed in an iframe and its parent.
25683
+ *
25684
+ * For example propagates selection model changes
25685
+ * to the iframe parent.
25686
+ */
25687
+ class DataViewIframeAdapterDirective {
25688
+ /***************************************************************************
25689
+ * *
25690
+ * Constructor *
25691
+ * *
25692
+ **************************************************************************/
25693
+ constructor(iframeService, selectionModel, dataViewOptionsProvider) {
25694
+ this.iframeService = iframeService;
25695
+ this.selectionModel = selectionModel;
25696
+ this.dataViewOptionsProvider = dataViewOptionsProvider;
25697
+ /***************************************************************************
25698
+ * *
25699
+ * Fields *
25700
+ * *
25701
+ **************************************************************************/
25702
+ this.log = LoggerFactory.getLogger(this.constructor.name);
25703
+ this._destroy$ = new Subject();
25704
+ selectionModel.selection.pipe(takeUntil(this._destroy$)).subscribe(selection => this.propagateSelectionToParent(selection));
25705
+ }
25706
+ /***************************************************************************
25707
+ * *
25708
+ * Listeners *
25709
+ * *
25710
+ **************************************************************************/
25711
+ /**
25712
+ * Listens for messages from parent window.
25713
+ * Makes it possible to react upon messages from iframe parent.
25714
+ *
25715
+ * @param event message from parent window
25716
+ */
25717
+ onWindowsMessage(event) {
25718
+ this.log.debug('Received message event from parent:', event);
25719
+ if (event) {
25720
+ if (DataViewMessage.isOfType(event.data)) {
25721
+ this.log.debug('Received data view message from parent:', event);
25722
+ this.handleMessageFromParent(event.data);
25723
+ }
25724
+ }
25725
+ return true;
25726
+ }
25727
+ /***************************************************************************
25728
+ * *
25729
+ * Life Cycle *
25730
+ * *
25731
+ **************************************************************************/
25732
+ ngOnInit() {
25733
+ }
25734
+ ngOnDestroy() {
25735
+ this._destroy$.next();
25736
+ this._destroy$.complete();
25737
+ }
25738
+ /***************************************************************************
25739
+ * *
25740
+ * Private Methods *
25741
+ * *
25742
+ **************************************************************************/
25743
+ handleMessageFromParent(message) {
25744
+ switch (message.type) {
25745
+ case 'SELECTION_INIT':
25746
+ this.initializeDataView(message.data);
25747
+ break;
25748
+ }
25749
+ }
25750
+ initializeDataView(init) {
25751
+ this.dataViewOptionsProvider.updateOptions(options => options
25752
+ .withSorts(init.options.sorts)
25753
+ .withFilters(init.options.filters));
25754
+ this.selectionModel.keyGetterFn = (entity) => entity[init.idField];
25755
+ this.selectionModel.isMultipleSelection = init.options.selectionMultiEnabled;
25756
+ if (init.initialSelection) {
25757
+ this.selectionModel.replaceSelection(init.initialSelection);
25758
+ }
25759
+ }
25760
+ propagateSelectionToParent(selection) {
25761
+ this.log.debug('Propagating selection to iframe parent:', selection);
25762
+ const message = this.buildSelectionMessage(selection);
25763
+ this.iframeService.postDataMessage(message);
25764
+ }
25765
+ buildSelectionMessage(selection) {
25766
+ return DataViewMessage.selection(new DataViewSelection(selection));
25767
+ }
25768
+ }
25769
+ DataViewIframeAdapterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataViewIframeAdapterDirective, deps: [{ token: IframeService }, { token: SelectionModel }, { token: ElderDataViewOptionsProvider }], target: i0.ɵɵFactoryTarget.Directive });
25770
+ DataViewIframeAdapterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: DataViewIframeAdapterDirective, selector: "[elderDataViewIframeAdapter]", host: { listeners: { "window:message": "onWindowsMessage($event)" } }, providers: [
25771
+ {
25772
+ provide: SelectionModel,
25773
+ useFactory: createSelectionModel
25774
+ },
25775
+ {
25776
+ provide: ElderDataViewOptionsProvider,
25777
+ useFactory: createDataOptionsProvider
25778
+ }
25779
+ ], ngImport: i0 });
25780
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataViewIframeAdapterDirective, decorators: [{
25781
+ type: Directive,
25782
+ args: [{
25783
+ selector: '[elderDataViewIframeAdapter]',
25784
+ providers: [
25785
+ {
25786
+ provide: SelectionModel,
25787
+ useFactory: createSelectionModel
25788
+ },
25789
+ {
25790
+ provide: ElderDataViewOptionsProvider,
25791
+ useFactory: createDataOptionsProvider
25792
+ }
25793
+ ]
25794
+ }]
25795
+ }], ctorParameters: function () { return [{ type: IframeService }, { type: SelectionModel }, { type: ElderDataViewOptionsProvider }]; }, propDecorators: { onWindowsMessage: [{
25796
+ type: HostListener,
25797
+ args: ['window:message', ['$event']]
25798
+ }] } });
25799
+
25378
25800
  class ElderIFrameModule {
25379
25801
  }
25380
25802
  ElderIFrameModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderIFrameModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
25381
25803
  ElderIFrameModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderIFrameModule, declarations: [IframeHostComponent,
25382
25804
  IframeDialogComponent,
25383
25805
  IframeSideContentComponent,
25384
- IframeCloseDirective], imports: [
25806
+ IframeCloseDirective,
25807
+ DataViewIframeComponent,
25808
+ DataViewIframeAdapterDirective], imports: [
25385
25809
  // Angular
25386
25810
  CommonModule,
25387
25811
  RouterModule,
@@ -25396,7 +25820,9 @@ ElderIFrameModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versi
25396
25820
  ElderPipesModule], exports: [IframeHostComponent,
25397
25821
  IframeDialogComponent,
25398
25822
  IframeSideContentComponent,
25399
- IframeCloseDirective] });
25823
+ IframeCloseDirective,
25824
+ DataViewIframeComponent,
25825
+ DataViewIframeAdapterDirective] });
25400
25826
  ElderIFrameModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderIFrameModule, imports: [
25401
25827
  // Angular
25402
25828
  CommonModule,
@@ -25431,13 +25857,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
25431
25857
  IframeHostComponent,
25432
25858
  IframeDialogComponent,
25433
25859
  IframeSideContentComponent,
25434
- IframeCloseDirective
25860
+ IframeCloseDirective,
25861
+ DataViewIframeComponent,
25862
+ DataViewIframeAdapterDirective
25435
25863
  ],
25436
25864
  exports: [
25437
25865
  IframeHostComponent,
25438
25866
  IframeDialogComponent,
25439
25867
  IframeSideContentComponent,
25440
- IframeCloseDirective
25868
+ IframeCloseDirective,
25869
+ DataViewIframeComponent,
25870
+ DataViewIframeAdapterDirective
25441
25871
  ]
25442
25872
  }]
25443
25873
  }] });
@@ -26572,5 +27002,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
26572
27002
  * Generated bundle index. Do not edit.
26573
27003
  */
26574
27004
 
26575
- export { AuditedEntity, AutoStartSpec, BlobUrl, BytesFormat, BytesPerSecondFormat, BytesPipe, CardDropEvent, CardOrganizerData, CardStack, CollectionUtil, ComparatorBuilder, ConfirmDialogConfig, ContinuableListing, CsvColumnSpec, CsvSerializer, CsvSpec, CsvStreamExporter, CsvStreamExporterBuilder, CsvStreamExporterBuilderService, Currency, CurrencyCode, CurrencyUnit, CurrencyUnitRegistry, CustomDateAdapter, DataContextActivePage, DataContextAutoStarter, DataContextBase, DataContextBuilder, DataContextContinuableBase, DataContextContinuablePaged, DataContextContinuableToken, DataContextLifeCycleBinding, DataContextSelectionDirective, DataContextSimple, DataContextSnapshot, DataContextSourceAutoReloader, DataContextStateIndicatorComponent, DataContextStatus, DataSourceAdapter, DataSourceProcessor, DataTransferFactory, DataTransferProgress, DataTransferProgressAggregate, DataTransferState, DataTransferStatus, DateUtil, DelegateContinuableDataSource, DelegateDataSource, DelegateListDataSource, DelegatePagedDataSource, Dimensions, DrawerOutletBinding, DurationBucket, DurationFormat, ELDER_SELECT_BASE, EbsCommonDialogService, EbsToastService, ElderAccessDeniedComponent, ElderAccessDeniedModule, ElderAppHeaderComponent, ElderAuditModule, ElderAuditedEntityComponent, ElderAutoSelectFirstDirective, ElderAutocompleteComponent, ElderAutocompleteDirective, ElderAutocompleteModule, ElderBlobViewerComponent, ElderBreadCrumbsComponent, ElderBreadCrumbsModule, ElderButtonGroupComponent, ElderButtonGroupModule, ElderCardComponent, ElderCardContentDirective, ElderCardHeaderActionsDirective, ElderCardHeaderComponent, ElderCardModule, ElderCardOrganizerComponent, ElderCardOrganizerModule, ElderCardPanelComponent, ElderCardStackComponent, ElderCardSubtitleDirective, ElderCardTitleDirective, ElderCheckboxState, ElderChipListSelectComponent, ElderChipListSelectModule, ElderClearSelectDirective, ElderClipboardPutDirective, ElderClipboardService, ElderConfirmDialogComponent, ElderConnectivityModule, ElderConnectivityService, ElderContainersModule, ElderCsvExportBtnComponent, ElderCsvModule, ElderCurrencyModule, ElderCurrencyPipe, ElderDataCommonModule, ElderDataToolbarComponent, ElderDataTransferModule, ElderDataTransferService, ElderDataViewBaseComponent, ElderDataViewBaseModule, ElderDataViewSelectionMode, ElderDateSwitcherComponent, ElderDateTimeInputComponent, ElderDatesModule, ElderDelayedFocusDirective, ElderDialogConfig, ElderDialogModule, ElderDialogService, ElderDimensionsInputComponent, ElderDurationInputComponent, ElderEntityValueAccessorUtil, ElderEnumTranslationService, ElderErrorModule, ElderEventSourceService, ElderExceptionDetailComponent, ElderExpandToggleButtonComponent, ElderExpandToggleButtonModule, ElderFileDropZoneDirective, ElderFileModule, ElderFileSelectComponent, ElderFileSelectDirective, ElderFileUploadComponent, ElderFormFieldControlBase, ElderFormFieldDenseDirective, ElderFormFieldLabelDirective, ElderFormFieldNoHintDirective, ElderFormFieldNoSpinnerDirective, ElderFormsDirectivesModule, ElderFormsModule, ElderFromFieldBase, ElderFromFieldEntityBase, ElderFromFieldMultiEntityBase, ElderGlobalSearchComponent, ElderGlobalSearchModule, ElderGlobalSearchService, ElderGridComponent, ElderGridModule, ElderGridTileDirective, ElderGridToolbarDirective, ElderHeaderComponent, ElderHeaderModule, ElderHttpClient, ElderI18nEntitiesModule, ElderIFrameModule, ElderInfiniteAutocompleteDirective, ElderInfiniteScrollDirective, ElderInfiniteScrollLegacyDirective, ElderInfiniteScrollModule, ElderInputPatternDirective, ElderIntervalInputComponent, ElderKeyEventDirective, ElderLabelInputComponent, ElderLabelsModule, ElderLanguageConfig, ElderLanguageInterceptor, ElderLanguageModule, ElderLanguageService, ElderLanguageSwitcherComponent, ElderLocalDateInputComponent, ElderLocalTimeInputComponent, ElderLocalesDeChModule, ElderLocalizedInputComponent, ElderLocalizedInputDialogComponent, ElderLocalizedInputDialogService, ElderLocalizedInputTableComponent, ElderLocalizedTextColumnDirective, ElderLocalizedTextsDirective, ElderMaxDirective, ElderMeasuresModule, ElderMinDirective, ElderMultiAutoCompleteModule, ElderMultiAutocompleteComponent, ElderMultiEntityValueAccessorUtil, ElderMultiSelectBase, ElderMultiSelectChipsComponent, ElderMultiSelectFormField, ElderMultipleOfValidator, ElderNavGroupComponent, ElderNavLinkComponent, ElderNavListComponent, ElderNavModule, ElderNextFocusableDirective, ElderNumberCellDirective, ElderOfflineIndicatorComponent, ElderOverlayComponent, ElderOverlayModule, ElderOverlayOriginDirective, ElderOverlayTriggerDirective, ElderPaddingDirective, ElderPanelComponent, ElderPanelModule, ElderPeriodInputComponent, ElderPipesModule, ElderPlugParentFormDirective, ElderPlugParentFormDirectiveLegacy, ElderProgressBarComponent, ElderProgressBarModule, ElderQuantityInputComponent, ElderQuantityModule, ElderQuantityPipe, ElderQuantityService, ElderQuantityTransformPipe, ElderQuestionDialogComponent, ElderRepeatPipe, ElderRepeatPipeLegacy, ElderRequiredIgnoreZeroValidator, ElderRoundPipe, ElderRouteOutletDrawerService, ElderRouterOutletService, ElderSafeUrlPipe, ElderScrollContainerComponent, ElderSearchBoxComponent, ElderSearchContextDirective, ElderSearchInputDirective, ElderSearchModule, ElderSearchPanelComponent, ElderSelectBase, ElderSelectChipAvatarDirective, ElderSelectChipDirective, ElderSelectComponent, ElderSelectComponentState, ElderSelectCustomInputDirective, ElderSelectFormField, ElderSelectListComponent, ElderSelectListItemComponent, ElderSelectListModule, ElderSelectModule, ElderSelectOnTabDirective, ElderSelectValueDirective, ElderSelectionDialogComponent, ElderSelectionDialogDirective, ElderSelectionMasterCheckboxComponent, ElderShellCenterDirective, ElderShellComponent, ElderShellModule, ElderShellNavigationToggleComponent, ElderShellService, ElderShellSideLeftDirective, ElderShellSideRightDirective, ElderShellSlotDirective, ElderSimpleSelectionViewComponent, ElderSimpleSelectionViewModule, ElderSingleSortComponent, ElderStackCardDirective, ElderStopEventPropagationDirective, ElderStopEventPropagationDirectiveLegacy, ElderSvgViewerComponent, ElderTabDirective, ElderTabFocusTrapDirective, ElderTabGroupRoutingDirective, ElderTabModule, ElderTableActivationDirective, ElderTableComponent, ElderTableExtensionDirective, ElderTableGroup, ElderTableModel, ElderTableModelCdkTableBinding, ElderTableModelQueryGroup, ElderTableModule, ElderTableProviders, ElderTableRootDirective, ElderTableSortDirective, ElderTableToolbarDirective, ElderThemeApplierDirective, ElderThemeDirective, ElderThemeModule, ElderThemePreferenceService, ElderThemeService, ElderThemeToggleComponent, ElderTimeModule, ElderToastModule, ElderToastService, ElderToolbarColumnDirective, ElderToolbarComponent, ElderToolbarContentDirective, ElderToolbarModule, ElderToolbarService, ElderToolbarTitleComponent, ElderToolbarTitleService, ElderTouchedDirective, ElderTouchedDirectiveLegacy, ElderTrimPipe, ElderTripleStateCheckboxDirective, ElderTruncatePipe, ElderUnitSelectDirective, ElderUnitService, ElderUrlFragment, ElderUrlFragmentModule, ElderUrlFragmentParamsService, ElderUrlFragmentSwitcherComponent, ElderViewersModule, EntitySetPatch, ErrorUtil, ExceptionDetailCtx, FileUploadClient, Filter, FilterContext, FilterUtil, FormFieldBaseComponent, HttpClientBuilder, HttpClientPristine, HttpDataTransfer, HttpDataTransferAggregateComponent, HttpDataTransferComponent, HttpDataTransferIndicatorComponent, HttpDataTransferOverviewComponent, HttpParamsBuilder, I18nBase, I18nPickAsyncPipe, I18nPickPipe, I18nText, IFrameState, IframeCloseDirective, IframeDialogComponent, IframeHostComponent, IframeService, IframeSideContentComponent, InternalRestClientConfig, Interval, IsoDurationPipe, IsoIntervalParsePipe, IsoIntervalPipe, JsonMapUtil, KafentConfig, KafentEvent, KafentEventService, KafentEventStream, KafentEventStreamDisabled, KafentEventStreamSse, KafentEventTransport, KafentModule, KafentSseEventChannel, KafentTokenProvider, KafentTokenProviderSessionStorage, KafentTopicSse, KnownElderThemes, KnownLocaleType, LocalListDataSource, LocalPagedDataSource, LocalisationPickerService, MasterSelectionState, MatTableDataContextBinding, MatTableDataContextBindingBuilder, MultiModelBaseComponent, NextNumberUtil, Objects, OnlineStatus, Page, PageRequest, Pageable, ParseUtil, Path, PathNode, PeriodBucket, PeriodDuration, PeriodFormat, ProcessIterationContext, ProcessState, PropertyPathUtil, Quantity, QueryListBinding, QuestionDialogConfig, ReactiveEventSource, ReactiveMap, RefreshingEntity, ReplacementResult, RestClient, RestClientConfig, RestClientContinuable, RestClientList, RestClientPaged, SearchQuery, SelectionModel, SelectionModelPopupDirective, Sets, SimpleLocalisationPicker, Sort, SortOption, SortUtil, SubBar, SuggestionProvider, TemplateCompositeControl, TemplatedSelectionDialogComponent, TextRange, ThemeSpec, TimeAgoPipe, TimeDurationPipe, TimeUtil, ToastService, ToastType, TokenChunkRequest, ToolbarHeader, TranslatedEnumValue, Unit, UnitDimension, UnitDimensionInfo, UnitInfo, UnitRegistry, UrlBuilder, UrlQueryParams, UuidUtil, ValueAccessorBase, ValueWrapper, ViewProviders, WeightPipe, WordPositionFinder, alphaNumStringComparator, buildFormIntegrationProviders, existingOrNewElderTableModel, isActivePagedDataContext, isContinuableDataContext, isContinuableDataSource, isDataContext, isDataSource, isElderEntityValueAccessor, isElderMultiEntityValueAccessor, isListDataSource, isPagedDataSource, naturalValueComparator, newElderTableModel, proxyControlContainer, registerLocale, runInZone, themeInit };
27005
+ export { AuditedEntity, AutoStartSpec, BlobUrl, BytesFormat, BytesPerSecondFormat, BytesPipe, CardDropEvent, CardOrganizerData, CardStack, CollectionUtil, ComparatorBuilder, ConfirmDialogConfig, ContinuableListing, CsvColumnSpec, CsvSerializer, CsvSpec, CsvStreamExporter, CsvStreamExporterBuilder, CsvStreamExporterBuilderService, Currency, CurrencyCode, CurrencyUnit, CurrencyUnitRegistry, CustomDateAdapter, DataContextActivePage, DataContextAutoStarter, DataContextBase, DataContextBuilder, DataContextContinuableBase, DataContextContinuablePaged, DataContextContinuableToken, DataContextLifeCycleBinding, DataContextSelectionDirective, DataContextSimple, DataContextSnapshot, DataContextSourceAutoReloader, DataContextStateIndicatorComponent, DataContextStatus, DataSourceAdapter, DataSourceProcessor, DataTransferFactory, DataTransferProgress, DataTransferProgressAggregate, DataTransferState, DataTransferStatus, DataViewIframeAdapterDirective, DataViewIframeComponent, DataViewMessage, DataViewOptionsProviderBinding, DataViewSelection, DataViewSelectionInit, DateUtil, DelegateContinuableDataSource, DelegateDataSource, DelegateListDataSource, DelegatePagedDataSource, Dimensions, DrawerOutletBinding, DurationBucket, DurationFormat, ELDER_DATA_VIEW, ELDER_SELECT_BASE, EbsCommonDialogService, EbsToastService, ElderAccessDeniedComponent, ElderAccessDeniedModule, ElderAppHeaderComponent, ElderAuditModule, ElderAuditedEntityComponent, ElderAutoSelectFirstDirective, ElderAutocompleteComponent, ElderAutocompleteDirective, ElderAutocompleteModule, ElderBlobViewerComponent, ElderBreadCrumbsComponent, ElderBreadCrumbsModule, ElderButtonGroupComponent, ElderButtonGroupModule, ElderCardComponent, ElderCardContentDirective, ElderCardHeaderActionsDirective, ElderCardHeaderComponent, ElderCardModule, ElderCardOrganizerComponent, ElderCardOrganizerModule, ElderCardPanelComponent, ElderCardStackComponent, ElderCardSubtitleDirective, ElderCardTitleDirective, ElderCheckboxState, ElderChipListSelectComponent, ElderChipListSelectModule, ElderClearSelectDirective, ElderClipboardPutDirective, ElderClipboardService, ElderConfirmDialogComponent, ElderConnectivityModule, ElderConnectivityService, ElderContainersModule, ElderCsvExportBtnComponent, ElderCsvModule, ElderCurrencyModule, ElderCurrencyPipe, ElderDataCommonModule, ElderDataToolbarComponent, ElderDataTransferModule, ElderDataTransferService, ElderDataViewBaseComponent, ElderDataViewOptionsProvider, ElderDateSwitcherComponent, ElderDateTimeInputComponent, ElderDatesModule, ElderDelayedFocusDirective, ElderDialogConfig, ElderDialogModule, ElderDialogService, ElderDimensionsInputComponent, ElderDurationInputComponent, ElderEntityValueAccessorUtil, ElderEnumTranslationService, ElderErrorModule, ElderEventSourceService, ElderExceptionDetailComponent, ElderExpandToggleButtonComponent, ElderExpandToggleButtonModule, ElderFileDropZoneDirective, ElderFileModule, ElderFileSelectComponent, ElderFileSelectDirective, ElderFileUploadComponent, ElderFormFieldControlBase, ElderFormFieldDenseDirective, ElderFormFieldLabelDirective, ElderFormFieldNoHintDirective, ElderFormFieldNoSpinnerDirective, ElderFormsDirectivesModule, ElderFormsModule, ElderFromFieldBase, ElderFromFieldEntityBase, ElderFromFieldMultiEntityBase, ElderGlobalSearchComponent, ElderGlobalSearchModule, ElderGlobalSearchService, ElderGridComponent, ElderGridModule, ElderGridTileDirective, ElderGridToolbarDirective, ElderHeaderComponent, ElderHeaderModule, ElderHttpClient, ElderI18nEntitiesModule, ElderIFrameModule, ElderInfiniteAutocompleteDirective, ElderInfiniteScrollDirective, ElderInfiniteScrollLegacyDirective, ElderInfiniteScrollModule, ElderInputPatternDirective, ElderIntervalInputComponent, ElderKeyEventDirective, ElderLabelInputComponent, ElderLabelsModule, ElderLanguageConfig, ElderLanguageInterceptor, ElderLanguageModule, ElderLanguageService, ElderLanguageSwitcherComponent, ElderLocalDateInputComponent, ElderLocalTimeInputComponent, ElderLocalesDeChModule, ElderLocalizedInputComponent, ElderLocalizedInputDialogComponent, ElderLocalizedInputDialogService, ElderLocalizedInputTableComponent, ElderLocalizedTextColumnDirective, ElderLocalizedTextsDirective, ElderMaxDirective, ElderMeasuresModule, ElderMinDirective, ElderMultiAutoCompleteModule, ElderMultiAutocompleteComponent, ElderMultiEntityValueAccessorUtil, ElderMultiSelectBase, ElderMultiSelectChipsComponent, ElderMultiSelectFormField, ElderMultipleOfValidator, ElderNavGroupComponent, ElderNavLinkComponent, ElderNavListComponent, ElderNavModule, ElderNextFocusableDirective, ElderNumberCellDirective, ElderOfflineIndicatorComponent, ElderOverlayComponent, ElderOverlayModule, ElderOverlayOriginDirective, ElderOverlayTriggerDirective, ElderPaddingDirective, ElderPanelComponent, ElderPanelModule, ElderPeriodInputComponent, ElderPipesModule, ElderPlugParentFormDirective, ElderPlugParentFormDirectiveLegacy, ElderProgressBarComponent, ElderProgressBarModule, ElderQuantityInputComponent, ElderQuantityModule, ElderQuantityPipe, ElderQuantityService, ElderQuantityTransformPipe, ElderQuestionDialogComponent, ElderRepeatPipe, ElderRepeatPipeLegacy, ElderRequiredIgnoreZeroValidator, ElderRoundPipe, ElderRouteOutletDrawerService, ElderRouterOutletService, ElderSafeUrlPipe, ElderScrollContainerComponent, ElderSearchBoxComponent, ElderSearchContextDirective, ElderSearchInputDirective, ElderSearchModule, ElderSearchPanelComponent, ElderSelectBase, ElderSelectChipAvatarDirective, ElderSelectChipDirective, ElderSelectComponent, ElderSelectComponentState, ElderSelectCustomInputDirective, ElderSelectFormField, ElderSelectListComponent, ElderSelectListItemComponent, ElderSelectListModule, ElderSelectModule, ElderSelectOnTabDirective, ElderSelectValueDirective, ElderSelectionDialogComponent, ElderSelectionDialogDirective, ElderSelectionMasterCheckboxComponent, ElderShellCenterDirective, ElderShellComponent, ElderShellModule, ElderShellNavigationToggleComponent, ElderShellService, ElderShellSideLeftDirective, ElderShellSideRightDirective, ElderShellSlotDirective, ElderSimpleSelectionViewComponent, ElderSimpleSelectionViewModule, ElderSingleSortComponent, ElderStackCardDirective, ElderStopEventPropagationDirective, ElderStopEventPropagationDirectiveLegacy, ElderSvgViewerComponent, ElderTabDirective, ElderTabFocusTrapDirective, ElderTabGroupRoutingDirective, ElderTabModule, ElderTableActivationDirective, ElderTableComponent, ElderTableExtensionDirective, ElderTableGroup, ElderTableModel, ElderTableModelCdkTableBinding, ElderTableModelQueryGroup, ElderTableModule, ElderTableProviders, ElderTableRootDirective, ElderTableSortDirective, ElderTableToolbarDirective, ElderThemeApplierDirective, ElderThemeDirective, ElderThemeModule, ElderThemePreferenceService, ElderThemeService, ElderThemeToggleComponent, ElderTimeModule, ElderToastModule, ElderToastService, ElderToolbarColumnDirective, ElderToolbarComponent, ElderToolbarContentDirective, ElderToolbarModule, ElderToolbarService, ElderToolbarTitleComponent, ElderToolbarTitleService, ElderTouchedDirective, ElderTouchedDirectiveLegacy, ElderTrimPipe, ElderTripleStateCheckboxDirective, ElderTruncatePipe, ElderUnitSelectDirective, ElderUnitService, ElderUrlFragment, ElderUrlFragmentModule, ElderUrlFragmentParamsService, ElderUrlFragmentSwitcherComponent, ElderViewersModule, EntitySetPatch, ErrorUtil, ExceptionDetailCtx, FileUploadClient, Filter, FilterContext, FilterUtil, FormFieldBaseComponent, HttpClientBuilder, HttpClientPristine, HttpDataTransfer, HttpDataTransferAggregateComponent, HttpDataTransferComponent, HttpDataTransferIndicatorComponent, HttpDataTransferOverviewComponent, HttpParamsBuilder, I18nBase, I18nPickAsyncPipe, I18nPickPipe, I18nText, IFrameState, IframeCloseDirective, IframeDialogComponent, IframeHostComponent, IframeService, IframeSideContentComponent, InternalRestClientConfig, Interval, IsoDurationPipe, IsoIntervalParsePipe, IsoIntervalPipe, JsonMapUtil, KafentConfig, KafentEvent, KafentEventService, KafentEventStream, KafentEventStreamDisabled, KafentEventStreamSse, KafentEventTransport, KafentModule, KafentSseEventChannel, KafentTokenProvider, KafentTokenProviderSessionStorage, KafentTopicSse, KnownElderThemes, KnownLocaleType, LocalListDataSource, LocalPagedDataSource, LocalisationPickerService, MasterSelectionState, MatTableDataContextBinding, MatTableDataContextBindingBuilder, MultiModelBaseComponent, NextNumberUtil, Objects, OnlineStatus, Page, PageRequest, Pageable, ParseUtil, Path, PathNode, PeriodBucket, PeriodDuration, PeriodFormat, ProcessIterationContext, ProcessState, PropertyPathUtil, Quantity, QueryListBinding, QuestionDialogConfig, ReactiveEventSource, ReactiveMap, RefreshingEntity, ReplacementResult, RestClient, RestClientConfig, RestClientContinuable, RestClientList, RestClientPaged, SearchQuery, SelectionModel, SelectionModelPopupDirective, Sets, SimpleLocalisationPicker, Sort, SortOption, SortUtil, SubBar, SuggestionProvider, TemplateCompositeControl, TemplatedSelectionDialogComponent, TextRange, ThemeSpec, TimeAgoPipe, TimeDurationPipe, TimeUtil, ToastService, ToastType, TokenChunkRequest, ToolbarHeader, TranslatedEnumValue, TypedEventMessage, Unit, UnitDimension, UnitDimensionInfo, UnitInfo, UnitRegistry, UrlBuilder, UrlQueryParams, UuidUtil, ValueAccessorBase, ValueWrapper, ViewProviders, WeightPipe, WordPositionFinder, alphaNumStringComparator, buildFormIntegrationProviders, createDataOptionsProvider, createSelectionModel, existingOrNewElderTableModel, isActivePagedDataContext, isContinuableDataContext, isContinuableDataSource, isDataContext, isDataSource, isElderEntityValueAccessor, isElderMultiEntityValueAccessor, isListDataSource, isPagedDataSource, naturalValueComparator, newElderTableModel, proxyControlContainer, registerLocale, runInZone, themeInit };
26576
27006
  //# sourceMappingURL=elderbyte-ngx-starter.mjs.map