@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.
- package/esm2020/lib/components/data-view/base/data-view-options-provider-binding.mjs +63 -0
- package/esm2020/lib/components/data-view/base/elder-data-view-base.mjs +53 -10
- package/esm2020/lib/components/data-view/base/elder-data-view-options-provider.mjs +44 -0
- package/esm2020/lib/components/data-view/base/elder-data-view-options.mjs +42 -0
- package/esm2020/lib/components/data-view/base/public_api.mjs +5 -0
- package/esm2020/lib/components/data-view/grid/elder-grid/elder-grid.component.mjs +8 -22
- package/esm2020/lib/components/data-view/public_api.mjs +2 -2
- package/esm2020/lib/components/data-view/table/elder-table/elder-table.component.mjs +9 -43
- package/esm2020/lib/components/forms/directives/elder-form-field-label.directive.mjs +31 -18
- package/esm2020/lib/components/i18n/entities/elder-localized-input-table/elder-localized-input-table.component.mjs +1 -1
- package/esm2020/lib/components/iframes/data-view/data-view-iframe/data-view-iframe.component.mjs +119 -0
- package/esm2020/lib/components/iframes/data-view/data-view-iframe-adapter.directive.mjs +137 -0
- package/esm2020/lib/components/iframes/elder-iframe.module.mjs +18 -6
- package/esm2020/lib/components/iframes/iframe-dialog/iframe-dialog.component.mjs +1 -1
- package/esm2020/lib/components/iframes/iframe-host/iframe-host.component.mjs +56 -30
- package/esm2020/lib/components/iframes/iframe-side-content/iframe-side-content.component.mjs +1 -1
- package/esm2020/lib/components/iframes/iframe.service.mjs +2 -2
- package/esm2020/lib/components/iframes/typed-event-message.mjs +42 -0
- package/esm2020/lib/components/select/elder-select.module.mjs +2 -2
- package/esm2020/lib/components/select/popup/selection-model-popup.directive.mjs +21 -39
- package/fesm2015/elderbyte-ngx-starter.mjs +1782 -1350
- package/fesm2015/elderbyte-ngx-starter.mjs.map +1 -1
- package/fesm2020/elderbyte-ngx-starter.mjs +1766 -1336
- package/fesm2020/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/components/data-view/base/data-view-options-provider-binding.d.ts +39 -0
- package/lib/components/data-view/base/elder-data-view-base.d.ts +29 -6
- package/lib/components/data-view/base/elder-data-view-options-provider.d.ts +38 -0
- package/lib/components/data-view/base/elder-data-view-options.d.ts +33 -0
- package/lib/components/data-view/base/public_api.d.ts +4 -0
- package/lib/components/data-view/grid/elder-grid/elder-grid.component.d.ts +4 -6
- package/lib/components/data-view/public_api.d.ts +1 -1
- package/lib/components/data-view/table/elder-table/elder-table.component.d.ts +5 -19
- package/lib/components/forms/directives/elder-form-field-label.directive.d.ts +19 -6
- package/lib/components/iframes/data-view/data-view-iframe/data-view-iframe.component.d.ts +66 -0
- package/lib/components/iframes/data-view/data-view-iframe-adapter.directive.d.ts +62 -0
- package/lib/components/iframes/elder-iframe.module.d.ts +14 -10
- package/lib/components/iframes/iframe-host/iframe-host.component.d.ts +28 -10
- package/lib/components/iframes/iframe.service.d.ts +3 -3
- package/lib/components/iframes/typed-event-message.d.ts +26 -0
- package/lib/components/select/elder-select.module.d.ts +1 -1
- package/lib/components/select/popup/selection-model-popup.directive.d.ts +7 -27
- package/package.json +1 -1
- package/src/lib/components/iframes/data-view/data-view-iframe/data-view-iframe.component.scss +0 -0
- package/esm2020/lib/components/data-view/base/elder-data-view-base.module.mjs +0 -18
- package/esm2020/lib/components/iframes/iframe-message.mjs +0 -2
- package/lib/components/data-view/base/elder-data-view-base.module.d.ts +0 -9
- 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
|
|
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';
|
|
@@ -10970,387 +10970,200 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
10970
10970
|
|
|
10971
10971
|
const ELDER_DATA_VIEW = new InjectionToken('Elder Data View');
|
|
10972
10972
|
|
|
10973
|
-
class
|
|
10974
|
-
}
|
|
10975
|
-
|
|
10976
|
-
class ConfirmDialogConfig extends ElderDialogConfig {
|
|
10977
|
-
}
|
|
10978
|
-
class ElderConfirmDialogComponent {
|
|
10979
|
-
constructor(dialogRef) {
|
|
10980
|
-
this.dialogRef = dialogRef;
|
|
10981
|
-
this.yesNo = false;
|
|
10982
|
-
}
|
|
10983
|
-
}
|
|
10984
|
-
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 });
|
|
10985
|
-
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" }] });
|
|
10986
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderConfirmDialogComponent, decorators: [{
|
|
10987
|
-
type: Component,
|
|
10988
|
-
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" }]
|
|
10989
|
-
}], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }]; } });
|
|
10990
|
-
|
|
10991
|
-
class QuestionDialogConfig extends ElderDialogConfig {
|
|
10992
|
-
}
|
|
10993
|
-
class ElderQuestionDialogComponent {
|
|
10994
|
-
constructor(dialogRef, data) {
|
|
10995
|
-
this.dialogRef = dialogRef;
|
|
10996
|
-
this.data = data;
|
|
10997
|
-
}
|
|
10998
|
-
ngOnInit() {
|
|
10999
|
-
}
|
|
11000
|
-
confirm(event) {
|
|
11001
|
-
this.dialogRef.close(this.answer);
|
|
11002
|
-
}
|
|
11003
|
-
cancel(event) {
|
|
11004
|
-
this.dialogRef.close();
|
|
11005
|
-
}
|
|
11006
|
-
get isValid() {
|
|
11007
|
-
return !!this.answer;
|
|
11008
|
-
}
|
|
11009
|
-
}
|
|
11010
|
-
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 });
|
|
11011
|
-
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" }] });
|
|
11012
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderQuestionDialogComponent, decorators: [{
|
|
11013
|
-
type: Component,
|
|
11014
|
-
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" }]
|
|
11015
|
-
}], ctorParameters: function () {
|
|
11016
|
-
return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
11017
|
-
type: Inject,
|
|
11018
|
-
args: [MAT_DIALOG_DATA]
|
|
11019
|
-
}] }];
|
|
11020
|
-
} });
|
|
11021
|
-
|
|
11022
|
-
class ElderDialogService {
|
|
10973
|
+
class DataViewOptionsProviderBinding {
|
|
11023
10974
|
/***************************************************************************
|
|
11024
10975
|
* *
|
|
11025
10976
|
* Constructor *
|
|
11026
10977
|
* *
|
|
11027
10978
|
**************************************************************************/
|
|
11028
|
-
constructor(
|
|
11029
|
-
this.
|
|
11030
|
-
this.translateService = translateService;
|
|
10979
|
+
constructor(_dataViewBaseComponent) {
|
|
10980
|
+
this._dataViewBaseComponent = _dataViewBaseComponent;
|
|
11031
10981
|
/***************************************************************************
|
|
11032
10982
|
* *
|
|
11033
10983
|
* Fields *
|
|
11034
10984
|
* *
|
|
11035
10985
|
**************************************************************************/
|
|
11036
|
-
this.
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
restoreFocus: true,
|
|
11041
|
-
closeOnNavigation: false
|
|
11042
|
-
};
|
|
10986
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
10987
|
+
if (_dataViewBaseComponent == null) {
|
|
10988
|
+
throw new Error('dataViewBaseComponent must not be null!');
|
|
10989
|
+
}
|
|
11043
10990
|
}
|
|
11044
10991
|
/***************************************************************************
|
|
11045
10992
|
* *
|
|
11046
|
-
*
|
|
10993
|
+
* Static Builder *
|
|
11047
10994
|
* *
|
|
11048
10995
|
**************************************************************************/
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
*
|
|
11052
|
-
* @param title
|
|
11053
|
-
* @param message
|
|
11054
|
-
* @param config
|
|
11055
|
-
*/
|
|
11056
|
-
confirm(title, message, config) {
|
|
11057
|
-
return this.showConfirm({
|
|
11058
|
-
title: title,
|
|
11059
|
-
message: message,
|
|
11060
|
-
config: config || this.defaultDialogConfig
|
|
11061
|
-
});
|
|
10996
|
+
static of(dataViewBaseComponent) {
|
|
10997
|
+
return new DataViewOptionsProviderBinding(dataViewBaseComponent);
|
|
11062
10998
|
}
|
|
11063
|
-
|
|
11064
|
-
*
|
|
11065
|
-
*
|
|
11066
|
-
*
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
if (!
|
|
11070
|
-
throw new Error('
|
|
10999
|
+
/***************************************************************************
|
|
11000
|
+
* *
|
|
11001
|
+
* Public API *
|
|
11002
|
+
* *
|
|
11003
|
+
**************************************************************************/
|
|
11004
|
+
dataViewOptionsProvider(optionsProvider) {
|
|
11005
|
+
if (!optionsProvider) {
|
|
11006
|
+
throw new Error('dataViewSelection must not be null!');
|
|
11071
11007
|
}
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
rawMessages.set('message', config.message);
|
|
11075
|
-
return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
|
|
11076
|
-
const title = messages.get('title');
|
|
11077
|
-
const message = messages.get('message');
|
|
11078
|
-
let dialogRef;
|
|
11079
|
-
dialogRef = this.dialog.open(ElderConfirmDialogComponent, config.config);
|
|
11080
|
-
dialogRef.componentInstance.title = title;
|
|
11081
|
-
dialogRef.componentInstance.message = message;
|
|
11082
|
-
dialogRef.componentInstance.yesNo = config.yesNo;
|
|
11083
|
-
return dialogRef.afterClosed();
|
|
11084
|
-
}));
|
|
11085
|
-
}
|
|
11086
|
-
/**
|
|
11087
|
-
* @deprecated Use showQuestion({...}) instead
|
|
11088
|
-
*
|
|
11089
|
-
* Creates a modal question dialog.
|
|
11090
|
-
*
|
|
11091
|
-
* @param title
|
|
11092
|
-
* @param question
|
|
11093
|
-
* @param config
|
|
11094
|
-
*/
|
|
11095
|
-
question(title, question, config) {
|
|
11096
|
-
return this.showQuestion({
|
|
11097
|
-
title: title,
|
|
11098
|
-
question: question,
|
|
11099
|
-
config: config || this.defaultDialogConfig
|
|
11100
|
-
});
|
|
11008
|
+
this._optionsProvider = optionsProvider;
|
|
11009
|
+
return this;
|
|
11101
11010
|
}
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
* @param config
|
|
11106
|
-
*/
|
|
11107
|
-
showQuestion(config) {
|
|
11108
|
-
if (!config) {
|
|
11109
|
-
throw new Error('Argument must not be null: config');
|
|
11011
|
+
bindUntil(unsubscribe$) {
|
|
11012
|
+
if (!this._optionsProvider) {
|
|
11013
|
+
throw new Error('DataView must be defined to start binding. Use .dataView(dataView)!');
|
|
11110
11014
|
}
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
rawMessages.set('question', config.question);
|
|
11114
|
-
return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
|
|
11115
|
-
const title = messages.get('title');
|
|
11116
|
-
const question = messages.get('question');
|
|
11117
|
-
const dlgConf = config.config || new MatDialogConfig();
|
|
11118
|
-
dlgConf.data = {
|
|
11119
|
-
title: title,
|
|
11120
|
-
question: question
|
|
11121
|
-
};
|
|
11122
|
-
const dialogRef = this.dialog.open(ElderQuestionDialogComponent, dlgConf);
|
|
11123
|
-
return dialogRef.afterClosed()
|
|
11124
|
-
.pipe(filter(response => !!response));
|
|
11125
|
-
}));
|
|
11015
|
+
this._optionsProvider.options$.pipe(takeUntil(unsubscribe$)).subscribe(options => this.applyOptions(options));
|
|
11016
|
+
return this;
|
|
11126
11017
|
}
|
|
11127
11018
|
/***************************************************************************
|
|
11128
11019
|
* *
|
|
11129
|
-
* Private
|
|
11020
|
+
* Private Methods *
|
|
11130
11021
|
* *
|
|
11131
11022
|
**************************************************************************/
|
|
11132
|
-
|
|
11133
|
-
const
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
translated.set(key, translatedValues[rawValue] || rawValue);
|
|
11138
|
-
});
|
|
11139
|
-
return translated;
|
|
11140
|
-
}));
|
|
11141
|
-
}
|
|
11142
|
-
/**
|
|
11143
|
-
* Translates a list of params
|
|
11144
|
-
*
|
|
11145
|
-
* @param interpolateParams
|
|
11146
|
-
*/
|
|
11147
|
-
translateInterpolatedParams(interpolateParams) {
|
|
11148
|
-
if (!interpolateParams) {
|
|
11149
|
-
return of({});
|
|
11023
|
+
applyOptions(options) {
|
|
11024
|
+
const dataCtx = this._dataViewBaseComponent.dataContext;
|
|
11025
|
+
if (dataCtx) {
|
|
11026
|
+
dataCtx.filter.updateFilters(options.filters);
|
|
11027
|
+
dataCtx.sort.updateSorts(options.sorts);
|
|
11150
11028
|
}
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
.filter(value => !!value)
|
|
11154
|
-
.map(value => value + '');
|
|
11155
|
-
return this.translateService.get(values).pipe(map(translated => {
|
|
11156
|
-
Object.getOwnPropertyNames(interpolateParams)
|
|
11157
|
-
.forEach(key => {
|
|
11158
|
-
const value = interpolateParams[key];
|
|
11159
|
-
interpolateParams[key] = translated[value];
|
|
11160
|
-
});
|
|
11161
|
-
return interpolateParams;
|
|
11162
|
-
}));
|
|
11029
|
+
this._dataViewBaseComponent.interactionMode = options.interactionMode;
|
|
11030
|
+
this._dataViewBaseComponent.selectionMultiEnabled = options.selectionMultiEnabled;
|
|
11163
11031
|
}
|
|
11164
11032
|
}
|
|
11165
|
-
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 });
|
|
11166
|
-
ElderDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, providedIn: 'root' });
|
|
11167
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, decorators: [{
|
|
11168
|
-
type: Injectable,
|
|
11169
|
-
args: [{
|
|
11170
|
-
providedIn: 'root'
|
|
11171
|
-
}]
|
|
11172
|
-
}], ctorParameters: function () { return [{ type: i1$7.MatDialog }, { type: i2.TranslateService }]; } });
|
|
11173
11033
|
|
|
11174
|
-
|
|
11034
|
+
/**
|
|
11035
|
+
* Options for supporting data view components.
|
|
11036
|
+
*/
|
|
11037
|
+
class ElderDataViewOptions {
|
|
11038
|
+
/***************************************************************************
|
|
11039
|
+
* *
|
|
11040
|
+
* Fields *
|
|
11041
|
+
* *
|
|
11042
|
+
**************************************************************************/
|
|
11175
11043
|
/***************************************************************************
|
|
11176
11044
|
* *
|
|
11177
11045
|
* Constructor *
|
|
11178
11046
|
* *
|
|
11179
11047
|
**************************************************************************/
|
|
11180
|
-
constructor(
|
|
11181
|
-
this.
|
|
11182
|
-
this.
|
|
11048
|
+
constructor(sorts, filters, selectionMultiEnabled, interactionMode) {
|
|
11049
|
+
this.sorts = sorts;
|
|
11050
|
+
this.filters = filters;
|
|
11051
|
+
this.selectionMultiEnabled = selectionMultiEnabled;
|
|
11052
|
+
this.interactionMode = interactionMode;
|
|
11183
11053
|
}
|
|
11184
|
-
|
|
11054
|
+
static defaultOptions() {
|
|
11055
|
+
return new ElderDataViewOptions([], [], false, 'open');
|
|
11185
11056
|
}
|
|
11186
11057
|
/***************************************************************************
|
|
11187
11058
|
* *
|
|
11188
|
-
*
|
|
11059
|
+
* Properties *
|
|
11189
11060
|
* *
|
|
11190
11061
|
**************************************************************************/
|
|
11191
|
-
|
|
11192
|
-
this.
|
|
11062
|
+
withSorts(sorts) {
|
|
11063
|
+
return new ElderDataViewOptions(sorts, this.filters, this.selectionMultiEnabled, this.interactionMode);
|
|
11193
11064
|
}
|
|
11194
|
-
|
|
11195
|
-
|
|
11065
|
+
withFilters(filters) {
|
|
11066
|
+
return new ElderDataViewOptions(this.sorts, filters, this.selectionMultiEnabled, this.interactionMode);
|
|
11067
|
+
}
|
|
11068
|
+
withSelectionMultiEnabled(selectionMultiEnabled) {
|
|
11069
|
+
return new ElderDataViewOptions(this.sorts, this.filters, selectionMultiEnabled, this.interactionMode);
|
|
11070
|
+
}
|
|
11071
|
+
withInteractionMode(interactionMode) {
|
|
11072
|
+
return new ElderDataViewOptions(this.sorts, this.filters, this.selectionMultiEnabled, interactionMode);
|
|
11196
11073
|
}
|
|
11197
11074
|
}
|
|
11198
|
-
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 });
|
|
11199
|
-
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" }] });
|
|
11200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogComponent, decorators: [{
|
|
11201
|
-
type: Component,
|
|
11202
|
-
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" }]
|
|
11203
|
-
}], ctorParameters: function () {
|
|
11204
|
-
return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
11205
|
-
type: Inject,
|
|
11206
|
-
args: [MAT_DIALOG_DATA]
|
|
11207
|
-
}] }];
|
|
11208
|
-
}, propDecorators: { title: [{
|
|
11209
|
-
type: Input
|
|
11210
|
-
}] } });
|
|
11211
11075
|
|
|
11212
|
-
class
|
|
11076
|
+
class ElderDataViewOptionsProvider {
|
|
11213
11077
|
/***************************************************************************
|
|
11214
11078
|
* *
|
|
11215
11079
|
* Constructor *
|
|
11216
11080
|
* *
|
|
11217
11081
|
**************************************************************************/
|
|
11218
|
-
constructor(
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11082
|
+
constructor() {
|
|
11083
|
+
/***************************************************************************
|
|
11084
|
+
* *
|
|
11085
|
+
* Fields *
|
|
11086
|
+
* *
|
|
11087
|
+
**************************************************************************/
|
|
11088
|
+
this.options$ = new BehaviorSubject(ElderDataViewOptions.defaultOptions());
|
|
11089
|
+
}
|
|
11090
|
+
/***************************************************************************
|
|
11091
|
+
* *
|
|
11092
|
+
* Properties *
|
|
11093
|
+
* *
|
|
11094
|
+
**************************************************************************/
|
|
11095
|
+
get options() {
|
|
11096
|
+
return this.options$.getValue();
|
|
11222
11097
|
}
|
|
11223
11098
|
/***************************************************************************
|
|
11224
11099
|
* *
|
|
11225
11100
|
* Public API *
|
|
11226
11101
|
* *
|
|
11227
11102
|
**************************************************************************/
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11103
|
+
/**
|
|
11104
|
+
* Example usage:
|
|
11105
|
+
*
|
|
11106
|
+
* this.updateOptions(
|
|
11107
|
+
* options => options.withInteractionMode('open')
|
|
11108
|
+
* .withFilters([])
|
|
11109
|
+
* )
|
|
11110
|
+
*
|
|
11111
|
+
* @param optionsFn function modifying the options
|
|
11112
|
+
*/
|
|
11113
|
+
updateOptions(optionsFn) {
|
|
11114
|
+
this.options$.next(optionsFn(this.options$.getValue()));
|
|
11238
11115
|
}
|
|
11239
11116
|
}
|
|
11240
|
-
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 });
|
|
11241
|
-
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 });
|
|
11242
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogDirective, decorators: [{
|
|
11243
|
-
type: Directive,
|
|
11244
|
-
args: [{
|
|
11245
|
-
selector: '[elderDialog]',
|
|
11246
|
-
exportAs: 'elderSelection'
|
|
11247
|
-
}]
|
|
11248
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i1$7.MatDialog }]; }, propDecorators: { selectionModel: [{
|
|
11249
|
-
type: Input
|
|
11250
|
-
}], close: [{
|
|
11251
|
-
type: Output
|
|
11252
|
-
}] } });
|
|
11253
|
-
|
|
11254
|
-
/**
|
|
11255
|
-
* @deprecated Please switch to ElderDialogService
|
|
11256
|
-
*/
|
|
11257
|
-
class EbsCommonDialogService extends ElderDialogService {
|
|
11258
|
-
}
|
|
11259
|
-
EbsCommonDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
11260
|
-
EbsCommonDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService });
|
|
11261
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, decorators: [{
|
|
11262
|
-
type: Injectable
|
|
11263
|
-
}] });
|
|
11264
|
-
class ElderDialogModule {
|
|
11265
|
-
static forRoot() {
|
|
11266
|
-
return {
|
|
11267
|
-
ngModule: ElderDialogModule,
|
|
11268
|
-
providers: [
|
|
11269
|
-
// ElderDialogService,
|
|
11270
|
-
EbsCommonDialogService
|
|
11271
|
-
]
|
|
11272
|
-
};
|
|
11273
|
-
}
|
|
11274
|
-
}
|
|
11275
|
-
ElderDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
11276
|
-
ElderDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, declarations: [ElderConfirmDialogComponent,
|
|
11277
|
-
ElderQuestionDialogComponent,
|
|
11278
|
-
ElderSelectionDialogComponent,
|
|
11279
|
-
ElderSelectionDialogDirective], imports: [CommonModule, FormsModule,
|
|
11280
|
-
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11281
|
-
A11yModule,
|
|
11282
|
-
FlexLayoutModule, TranslateModule], exports: [ElderConfirmDialogComponent,
|
|
11283
|
-
ElderQuestionDialogComponent,
|
|
11284
|
-
ElderSelectionDialogComponent,
|
|
11285
|
-
ElderSelectionDialogDirective] });
|
|
11286
|
-
ElderDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, imports: [CommonModule, FormsModule,
|
|
11287
|
-
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11288
|
-
A11yModule,
|
|
11289
|
-
FlexLayoutModule, TranslateModule] });
|
|
11290
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, decorators: [{
|
|
11291
|
-
type: NgModule,
|
|
11292
|
-
args: [{
|
|
11293
|
-
imports: [
|
|
11294
|
-
CommonModule, FormsModule,
|
|
11295
|
-
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11296
|
-
A11yModule,
|
|
11297
|
-
FlexLayoutModule, TranslateModule
|
|
11298
|
-
],
|
|
11299
|
-
declarations: [
|
|
11300
|
-
ElderConfirmDialogComponent,
|
|
11301
|
-
ElderQuestionDialogComponent,
|
|
11302
|
-
ElderSelectionDialogComponent,
|
|
11303
|
-
ElderSelectionDialogDirective
|
|
11304
|
-
],
|
|
11305
|
-
exports: [
|
|
11306
|
-
ElderConfirmDialogComponent,
|
|
11307
|
-
ElderQuestionDialogComponent,
|
|
11308
|
-
ElderSelectionDialogComponent,
|
|
11309
|
-
ElderSelectionDialogDirective
|
|
11310
|
-
]
|
|
11311
|
-
}]
|
|
11312
|
-
}] });
|
|
11313
11117
|
|
|
11314
|
-
|
|
11315
|
-
* This directive projects content identified by a placeholder id
|
|
11316
|
-
* into the toolbar at the corresponding place.
|
|
11317
|
-
*/
|
|
11318
|
-
class ElderToolbarContentDirective {
|
|
11319
|
-
constructor(templateRef) {
|
|
11320
|
-
this.templateRef = templateRef;
|
|
11321
|
-
}
|
|
11322
|
-
}
|
|
11323
|
-
ElderToolbarContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
11324
|
-
ElderToolbarContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderToolbarContentDirective, selector: "[elderToolbarContent]", inputs: { placeholderId: ["elderToolbarContent", "placeholderId"] }, ngImport: i0 });
|
|
11325
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, decorators: [{
|
|
11326
|
-
type: Directive,
|
|
11327
|
-
args: [{ selector: '[elderToolbarContent]' }]
|
|
11328
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { placeholderId: [{
|
|
11329
|
-
type: Input,
|
|
11330
|
-
args: ['elderToolbarContent']
|
|
11331
|
-
}] } });
|
|
11332
|
-
class ElderDataToolbarComponent {
|
|
11118
|
+
class ElderDataViewBaseComponent {
|
|
11333
11119
|
/***************************************************************************
|
|
11334
11120
|
* *
|
|
11335
11121
|
* Constructor *
|
|
11336
11122
|
* *
|
|
11337
11123
|
**************************************************************************/
|
|
11338
|
-
constructor(selectionModel,
|
|
11339
|
-
this.
|
|
11340
|
-
|
|
11341
|
-
|
|
11342
|
-
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
|
|
11346
|
-
|
|
11347
|
-
|
|
11348
|
-
this.
|
|
11349
|
-
|
|
11350
|
-
|
|
11124
|
+
constructor(selectionModel, dataViewOptionsProvider) {
|
|
11125
|
+
this.dataViewOptionsProvider = dataViewOptionsProvider;
|
|
11126
|
+
/***************************************************************************
|
|
11127
|
+
* *
|
|
11128
|
+
* Fields *
|
|
11129
|
+
* *
|
|
11130
|
+
**************************************************************************/
|
|
11131
|
+
/**
|
|
11132
|
+
* Underlying data context.
|
|
11133
|
+
*/
|
|
11134
|
+
this.dataContext$ = new BehaviorSubject(null);
|
|
11135
|
+
this.interactionMode = 'open';
|
|
11136
|
+
/**
|
|
11137
|
+
* Define if elder-table should clean up the
|
|
11138
|
+
* data-context resources for you.
|
|
11139
|
+
*
|
|
11140
|
+
* In more advanced scenarios where you plan to reuse the same data-context
|
|
11141
|
+
* set this to false and release the resources yourself. (dataContext.close)
|
|
11142
|
+
*/
|
|
11143
|
+
this.cleanUp = true;
|
|
11144
|
+
/**
|
|
11145
|
+
* If true, this table is in dense mode.
|
|
11146
|
+
* Heights are generally reduced.
|
|
11147
|
+
*/
|
|
11148
|
+
this._dense = false;
|
|
11149
|
+
/**
|
|
11150
|
+
* If true, this table is in a floating card mode.
|
|
11151
|
+
* Otherwise, it is flat on the current panel.
|
|
11152
|
+
*/
|
|
11153
|
+
this._float = false;
|
|
11154
|
+
/**
|
|
11155
|
+
* If true, this table is in embedded mode.
|
|
11156
|
+
* No borders / floating visible so that the table can be embedded into another container
|
|
11157
|
+
*/
|
|
11158
|
+
this._embedded = false;
|
|
11159
|
+
this._itemClickSubject = new Subject();
|
|
11160
|
+
this.EntityIdKeyFn = (entity) => entity ? this.getId(entity) : 0;
|
|
11161
|
+
this.destroy$ = new Subject();
|
|
11162
|
+
if (!selectionModel) {
|
|
11163
|
+
this.selectionModel = new SelectionModel(false, [], this.EntityIdKeyFn);
|
|
11351
11164
|
}
|
|
11352
|
-
|
|
11353
|
-
this.selectionModel =
|
|
11165
|
+
else {
|
|
11166
|
+
this.selectionModel = selectionModel;
|
|
11354
11167
|
}
|
|
11355
11168
|
}
|
|
11356
11169
|
/***************************************************************************
|
|
@@ -11358,1242 +11171,1433 @@ class ElderDataToolbarComponent {
|
|
|
11358
11171
|
* Life Cycle *
|
|
11359
11172
|
* *
|
|
11360
11173
|
**************************************************************************/
|
|
11361
|
-
ngOnInit() {
|
|
11174
|
+
ngOnInit() {
|
|
11175
|
+
if (this.dataViewOptionsProvider) {
|
|
11176
|
+
if (this.dataViewOptionsProvider.options.interactionMode === 'selection') {
|
|
11177
|
+
this.selectionVisible = true;
|
|
11178
|
+
this.float = false;
|
|
11179
|
+
}
|
|
11180
|
+
if (this.dataContext) {
|
|
11181
|
+
DataViewOptionsProviderBinding.of(this)
|
|
11182
|
+
.dataViewOptionsProvider(this.dataViewOptionsProvider)
|
|
11183
|
+
.bindUntil(this.destroy$);
|
|
11184
|
+
}
|
|
11185
|
+
}
|
|
11186
|
+
}
|
|
11187
|
+
ngOnDestroy() {
|
|
11188
|
+
this.destroy$.next();
|
|
11189
|
+
this.destroy$.complete();
|
|
11190
|
+
this.autoCleanUp();
|
|
11191
|
+
}
|
|
11362
11192
|
/***************************************************************************
|
|
11363
11193
|
* *
|
|
11364
11194
|
* Properties *
|
|
11365
11195
|
* *
|
|
11366
11196
|
**************************************************************************/
|
|
11367
|
-
|
|
11368
|
-
this.
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
11373
|
-
|
|
11197
|
+
get dataContext() {
|
|
11198
|
+
return this.dataContext$.getValue();
|
|
11199
|
+
}
|
|
11200
|
+
set dataContext(data) {
|
|
11201
|
+
this.dataContext$.next(data);
|
|
11202
|
+
this.onDataContextSet(data);
|
|
11203
|
+
}
|
|
11204
|
+
get dataActivePaged() {
|
|
11205
|
+
return this.dataContext;
|
|
11206
|
+
}
|
|
11207
|
+
get dataContinuable() {
|
|
11208
|
+
return this.dataContext;
|
|
11209
|
+
}
|
|
11210
|
+
get isContinuable() {
|
|
11211
|
+
if (!this.dataContext) {
|
|
11212
|
+
return false;
|
|
11374
11213
|
}
|
|
11214
|
+
return isContinuableDataContext(this.dataContext);
|
|
11375
11215
|
}
|
|
11376
|
-
get
|
|
11377
|
-
|
|
11216
|
+
get isActivePaged() {
|
|
11217
|
+
if (!this.dataContext) {
|
|
11218
|
+
return false;
|
|
11219
|
+
}
|
|
11220
|
+
return isActivePagedDataContext(this.dataContext);
|
|
11378
11221
|
}
|
|
11379
11222
|
/***************************************************************************
|
|
11380
11223
|
* *
|
|
11381
|
-
*
|
|
11224
|
+
* Selection Properties *
|
|
11382
11225
|
* *
|
|
11383
11226
|
**************************************************************************/
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
return null;
|
|
11387
|
-
}
|
|
11388
|
-
const template = this.templates.find((item) => item.placeholderId === placeholderId);
|
|
11389
|
-
return template ? template.templateRef : null;
|
|
11227
|
+
set selectableEvaluatorFn(selectableEvaluatorFn) {
|
|
11228
|
+
this.selectionModel.selectableEvaluatorFn = selectableEvaluatorFn;
|
|
11390
11229
|
}
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
this.dialogService
|
|
11394
|
-
.showConfirm({
|
|
11395
|
-
title: 'dialogs.confirm-deletion.title',
|
|
11396
|
-
message: 'dialogs.confirm-deletion.message',
|
|
11397
|
-
yesNo: true,
|
|
11398
|
-
interpolateParams: { numOfItems: items.length },
|
|
11399
|
-
})
|
|
11400
|
-
.subscribe((confirmed) => {
|
|
11401
|
-
if (confirmed) {
|
|
11402
|
-
this.emitRemove(items);
|
|
11403
|
-
}
|
|
11404
|
-
});
|
|
11405
|
-
}
|
|
11406
|
-
else {
|
|
11407
|
-
this.emitRemove(items);
|
|
11408
|
-
}
|
|
11230
|
+
set selection(selection) {
|
|
11231
|
+
this.selectionModel.replaceSelection(selection);
|
|
11409
11232
|
}
|
|
11410
|
-
|
|
11411
|
-
this.
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
|
|
11233
|
+
get selectionChange() {
|
|
11234
|
+
return this.selectionModel.changed;
|
|
11235
|
+
}
|
|
11236
|
+
get selectionSingleChange() {
|
|
11237
|
+
return this.selectionModel.changed.pipe(map((selection) => {
|
|
11238
|
+
if (selection.length > 0) {
|
|
11239
|
+
return selection[0];
|
|
11416
11240
|
}
|
|
11241
|
+
else {
|
|
11242
|
+
return null;
|
|
11243
|
+
}
|
|
11244
|
+
}));
|
|
11245
|
+
}
|
|
11246
|
+
set selectionMultiEnabled(enableMultiSelection) {
|
|
11247
|
+
if (this.selectionModel) {
|
|
11248
|
+
this.selectionModel.isMultipleSelection = enableMultiSelection;
|
|
11417
11249
|
}
|
|
11418
11250
|
}
|
|
11419
|
-
}
|
|
11420
|
-
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 });
|
|
11421
|
-
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 });
|
|
11422
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataToolbarComponent, decorators: [{
|
|
11423
|
-
type: Component,
|
|
11424
|
-
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" }]
|
|
11425
|
-
}], ctorParameters: function () {
|
|
11426
|
-
return [{ type: SelectionModel, decorators: [{
|
|
11427
|
-
type: Optional
|
|
11428
|
-
}] }, { type: undefined, decorators: [{
|
|
11429
|
-
type: Optional
|
|
11430
|
-
}, {
|
|
11431
|
-
type: Inject,
|
|
11432
|
-
args: [ELDER_DATA_VIEW]
|
|
11433
|
-
}] }, { type: ElderDialogService }];
|
|
11434
|
-
}, propDecorators: { canAdd: [{
|
|
11435
|
-
type: Input
|
|
11436
|
-
}], canRemove: [{
|
|
11437
|
-
type: Input
|
|
11438
|
-
}], canMore: [{
|
|
11439
|
-
type: Input
|
|
11440
|
-
}], confirmRemoval: [{
|
|
11441
|
-
type: Input
|
|
11442
|
-
}], keepSelectionAfterRemoval: [{
|
|
11443
|
-
type: Input
|
|
11444
|
-
}], requestNew: [{
|
|
11445
|
-
type: Output
|
|
11446
|
-
}], requestRemove: [{
|
|
11447
|
-
type: Output
|
|
11448
|
-
}], templates: [{
|
|
11449
|
-
type: ContentChildren,
|
|
11450
|
-
args: [ElderToolbarContentDirective]
|
|
11451
|
-
}], selectionModel: [{
|
|
11452
|
-
type: Input
|
|
11453
|
-
}] } });
|
|
11454
|
-
|
|
11455
|
-
class ElderSingleSortComponent {
|
|
11456
11251
|
/***************************************************************************
|
|
11457
11252
|
* *
|
|
11458
|
-
*
|
|
11253
|
+
* On click properties *
|
|
11459
11254
|
* *
|
|
11460
11255
|
**************************************************************************/
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
* *
|
|
11464
|
-
* Fields *
|
|
11465
|
-
* *
|
|
11466
|
-
**************************************************************************/
|
|
11467
|
-
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
11468
|
-
this.sort$ = new BehaviorSubject(Sort.NONE);
|
|
11469
|
-
this.availableSorts = [];
|
|
11470
|
-
this.sortChange = new EventEmitter();
|
|
11471
|
-
this.translationPrefix = 'documents.sorts.';
|
|
11256
|
+
get itemClick() {
|
|
11257
|
+
return this._itemClickSubject;
|
|
11472
11258
|
}
|
|
11473
11259
|
/***************************************************************************
|
|
11474
11260
|
* *
|
|
11475
|
-
*
|
|
11261
|
+
* Style Properties *
|
|
11476
11262
|
* *
|
|
11477
11263
|
**************************************************************************/
|
|
11478
|
-
|
|
11264
|
+
set dense(value) {
|
|
11265
|
+
this._dense = coerceBooleanProperty(value);
|
|
11266
|
+
}
|
|
11267
|
+
get dense() {
|
|
11268
|
+
return this._dense;
|
|
11269
|
+
}
|
|
11270
|
+
set float(value) {
|
|
11271
|
+
this._float = coerceBooleanProperty(value);
|
|
11272
|
+
}
|
|
11273
|
+
get float() {
|
|
11274
|
+
return this._float;
|
|
11275
|
+
}
|
|
11276
|
+
set embedded(value) {
|
|
11277
|
+
this._embedded = coerceBooleanProperty(value);
|
|
11278
|
+
}
|
|
11279
|
+
get embedded() {
|
|
11280
|
+
return this._embedded;
|
|
11479
11281
|
}
|
|
11480
11282
|
/***************************************************************************
|
|
11481
11283
|
* *
|
|
11482
|
-
*
|
|
11284
|
+
* Event Entry Points *
|
|
11483
11285
|
* *
|
|
11484
11286
|
**************************************************************************/
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11287
|
+
/**
|
|
11288
|
+
* Called after a new DataContext has been set.
|
|
11289
|
+
* Subclasses may add additional behaviour at this stage.
|
|
11290
|
+
* @param data
|
|
11291
|
+
* @protected
|
|
11292
|
+
*/
|
|
11293
|
+
onDataContextSet(data) {
|
|
11294
|
+
}
|
|
11295
|
+
onItemClick(entity) {
|
|
11296
|
+
if (entity) {
|
|
11297
|
+
switch (this.interactionMode) {
|
|
11298
|
+
case 'open':
|
|
11299
|
+
if (this.selectionModel.hasValue) {
|
|
11300
|
+
this.selectionModel.toggle(entity);
|
|
11301
|
+
}
|
|
11302
|
+
else {
|
|
11303
|
+
this._itemClickSubject.next(entity);
|
|
11304
|
+
}
|
|
11305
|
+
break;
|
|
11306
|
+
case 'selection':
|
|
11307
|
+
this.selectionModel.toggle(entity);
|
|
11308
|
+
break;
|
|
11309
|
+
}
|
|
11488
11310
|
}
|
|
11489
|
-
this.sort$.next(sort);
|
|
11490
11311
|
}
|
|
11491
|
-
|
|
11492
|
-
|
|
11312
|
+
onItemDoubleClick(entity) {
|
|
11313
|
+
if (entity) {
|
|
11314
|
+
switch (this.interactionMode) {
|
|
11315
|
+
// double click in open mode not supported
|
|
11316
|
+
case 'open':
|
|
11317
|
+
break;
|
|
11318
|
+
// double click in selection mode triggers normal item click
|
|
11319
|
+
case 'selection':
|
|
11320
|
+
this._itemClickSubject.next(entity);
|
|
11321
|
+
break;
|
|
11322
|
+
}
|
|
11323
|
+
}
|
|
11493
11324
|
}
|
|
11494
11325
|
/***************************************************************************
|
|
11495
11326
|
* *
|
|
11496
|
-
*
|
|
11327
|
+
* Private Methods *
|
|
11497
11328
|
* *
|
|
11498
11329
|
**************************************************************************/
|
|
11499
|
-
|
|
11500
|
-
|
|
11501
|
-
this.
|
|
11330
|
+
getId(entity) {
|
|
11331
|
+
var _a, _b;
|
|
11332
|
+
return ((_b = (_a = this.dataContext) === null || _a === void 0 ? void 0 : _a.dataSource) === null || _b === void 0 ? void 0 : _b.getId(entity)) || entity;
|
|
11502
11333
|
}
|
|
11503
|
-
|
|
11504
|
-
|
|
11505
|
-
|
|
11506
|
-
|
|
11507
|
-
|
|
11508
|
-
|
|
11509
|
-
|
|
11510
|
-
dir = 'asc';
|
|
11334
|
+
/**
|
|
11335
|
+
* Performs clean up of the current data context if auto clean up is enabled.
|
|
11336
|
+
*/
|
|
11337
|
+
autoCleanUp() {
|
|
11338
|
+
if (this.cleanUp && this.dataContext) {
|
|
11339
|
+
//this.logger.debug('Releasing DataContext resources to prevent memory leak. [cleanUp]="true"');
|
|
11340
|
+
this.dataContext.close();
|
|
11511
11341
|
}
|
|
11512
|
-
this.setSort(new Sort(this.sort.prop, dir));
|
|
11513
|
-
}
|
|
11514
|
-
setSort(sort) {
|
|
11515
|
-
this.sort = sort;
|
|
11516
|
-
this.sortChange.emit(sort);
|
|
11517
11342
|
}
|
|
11518
11343
|
}
|
|
11519
|
-
|
|
11520
|
-
|
|
11521
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
11522
|
-
type:
|
|
11523
|
-
|
|
11524
|
-
}], ctorParameters: function () { return []; }, propDecorators: { availableSorts: [{
|
|
11344
|
+
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 });
|
|
11345
|
+
ElderDataViewBaseComponent.ɵdir = 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 });
|
|
11346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseComponent, decorators: [{
|
|
11347
|
+
type: Directive
|
|
11348
|
+
}], ctorParameters: function () { return [{ type: SelectionModel }, { type: ElderDataViewOptionsProvider }]; }, propDecorators: { interactionMode: [{
|
|
11525
11349
|
type: Input
|
|
11526
|
-
}],
|
|
11350
|
+
}], cleanUp: [{
|
|
11351
|
+
type: Input
|
|
11352
|
+
}], selectableEvaluatorFn: [{
|
|
11353
|
+
type: Input
|
|
11354
|
+
}], selection: [{
|
|
11355
|
+
type: Input
|
|
11356
|
+
}], selectionChange: [{
|
|
11527
11357
|
type: Output
|
|
11528
|
-
}],
|
|
11358
|
+
}], selectionSingleChange: [{
|
|
11359
|
+
type: Output
|
|
11360
|
+
}], selectionMultiEnabled: [{
|
|
11529
11361
|
type: Input
|
|
11530
|
-
}],
|
|
11362
|
+
}], itemClick: [{
|
|
11363
|
+
type: Output
|
|
11364
|
+
}], dense: [{
|
|
11365
|
+
type: Input
|
|
11366
|
+
}], float: [{
|
|
11367
|
+
type: Input
|
|
11368
|
+
}], embedded: [{
|
|
11531
11369
|
type: Input
|
|
11532
11370
|
}] } });
|
|
11533
11371
|
|
|
11534
|
-
class
|
|
11535
|
-
|
|
11536
|
-
|
|
11537
|
-
|
|
11538
|
-
|
|
11539
|
-
|
|
11372
|
+
class ElderDialogConfig {
|
|
11373
|
+
}
|
|
11374
|
+
|
|
11375
|
+
class ConfirmDialogConfig extends ElderDialogConfig {
|
|
11376
|
+
}
|
|
11377
|
+
class ElderConfirmDialogComponent {
|
|
11378
|
+
constructor(dialogRef) {
|
|
11379
|
+
this.dialogRef = dialogRef;
|
|
11380
|
+
this.yesNo = false;
|
|
11540
11381
|
}
|
|
11541
11382
|
}
|
|
11383
|
+
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 });
|
|
11384
|
+
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" }] });
|
|
11385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderConfirmDialogComponent, decorators: [{
|
|
11386
|
+
type: Component,
|
|
11387
|
+
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" }]
|
|
11388
|
+
}], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }]; } });
|
|
11542
11389
|
|
|
11543
|
-
class
|
|
11390
|
+
class QuestionDialogConfig extends ElderDialogConfig {
|
|
11391
|
+
}
|
|
11392
|
+
class ElderQuestionDialogComponent {
|
|
11393
|
+
constructor(dialogRef, data) {
|
|
11394
|
+
this.dialogRef = dialogRef;
|
|
11395
|
+
this.data = data;
|
|
11396
|
+
}
|
|
11397
|
+
ngOnInit() {
|
|
11398
|
+
}
|
|
11399
|
+
confirm(event) {
|
|
11400
|
+
this.dialogRef.close(this.answer);
|
|
11401
|
+
}
|
|
11402
|
+
cancel(event) {
|
|
11403
|
+
this.dialogRef.close();
|
|
11404
|
+
}
|
|
11405
|
+
get isValid() {
|
|
11406
|
+
return !!this.answer;
|
|
11407
|
+
}
|
|
11408
|
+
}
|
|
11409
|
+
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 });
|
|
11410
|
+
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" }] });
|
|
11411
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderQuestionDialogComponent, decorators: [{
|
|
11412
|
+
type: Component,
|
|
11413
|
+
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" }]
|
|
11414
|
+
}], ctorParameters: function () {
|
|
11415
|
+
return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
11416
|
+
type: Inject,
|
|
11417
|
+
args: [MAT_DIALOG_DATA]
|
|
11418
|
+
}] }];
|
|
11419
|
+
} });
|
|
11420
|
+
|
|
11421
|
+
class ElderDialogService {
|
|
11544
11422
|
/***************************************************************************
|
|
11545
11423
|
* *
|
|
11546
11424
|
* Constructor *
|
|
11547
11425
|
* *
|
|
11548
11426
|
**************************************************************************/
|
|
11549
|
-
constructor(
|
|
11427
|
+
constructor(dialog, translateService) {
|
|
11428
|
+
this.dialog = dialog;
|
|
11429
|
+
this.translateService = translateService;
|
|
11550
11430
|
/***************************************************************************
|
|
11551
11431
|
* *
|
|
11552
11432
|
* Fields *
|
|
11553
11433
|
* *
|
|
11554
11434
|
**************************************************************************/
|
|
11555
|
-
this.
|
|
11556
|
-
|
|
11557
|
-
|
|
11558
|
-
|
|
11559
|
-
|
|
11560
|
-
|
|
11561
|
-
|
|
11562
|
-
* *
|
|
11563
|
-
* Properties *
|
|
11564
|
-
* *
|
|
11565
|
-
**************************************************************************/
|
|
11566
|
-
set selectionModel(model) {
|
|
11567
|
-
this.selectionModel$.next(model);
|
|
11568
|
-
}
|
|
11569
|
-
get selectionModel() {
|
|
11570
|
-
return this.selectionModel$.getValue();
|
|
11571
|
-
}
|
|
11572
|
-
set dataContext(dataContext) {
|
|
11573
|
-
this.dataContext$.next(dataContext);
|
|
11574
|
-
}
|
|
11575
|
-
/** Whether the number of selected elements matches the totalSnapshot number of selectable rows. */
|
|
11576
|
-
get isAllSelectedSnapshot() {
|
|
11577
|
-
const numSelected = this.selectionModel.selectionSnapshot.length;
|
|
11578
|
-
const context = this.dataContext$.getValue();
|
|
11579
|
-
const numRows = context ? context.snapshot.data.length : 0;
|
|
11580
|
-
const numUnselectable = context ? context.snapshot.data.filter(i => !this.selectionModel.isSelectable(i)).length : 0;
|
|
11581
|
-
return numSelected >= numRows - numUnselectable; // True if all selectable items are selected
|
|
11435
|
+
this.defaultDialogConfig = {
|
|
11436
|
+
role: 'dialog',
|
|
11437
|
+
disableClose: false,
|
|
11438
|
+
autoFocus: true,
|
|
11439
|
+
restoreFocus: true,
|
|
11440
|
+
closeOnNavigation: false
|
|
11441
|
+
};
|
|
11582
11442
|
}
|
|
11583
11443
|
/***************************************************************************
|
|
11584
11444
|
* *
|
|
11585
11445
|
* Public API *
|
|
11586
11446
|
* *
|
|
11587
11447
|
**************************************************************************/
|
|
11588
|
-
/**
|
|
11589
|
-
|
|
11590
|
-
|
|
11591
|
-
|
|
11592
|
-
|
|
11593
|
-
|
|
11594
|
-
|
|
11595
|
-
|
|
11596
|
-
|
|
11597
|
-
|
|
11598
|
-
|
|
11599
|
-
|
|
11600
|
-
|
|
11601
|
-
|
|
11448
|
+
/**
|
|
11449
|
+
* @deprecated Use showConfirm({...}) instead
|
|
11450
|
+
*
|
|
11451
|
+
* @param title
|
|
11452
|
+
* @param message
|
|
11453
|
+
* @param config
|
|
11454
|
+
*/
|
|
11455
|
+
confirm(title, message, config) {
|
|
11456
|
+
return this.showConfirm({
|
|
11457
|
+
title: title,
|
|
11458
|
+
message: message,
|
|
11459
|
+
config: config || this.defaultDialogConfig
|
|
11460
|
+
});
|
|
11461
|
+
}
|
|
11462
|
+
/**
|
|
11463
|
+
* Creates a modal confirmation dialog.
|
|
11464
|
+
*
|
|
11465
|
+
* @param config object for conform dialog
|
|
11466
|
+
*/
|
|
11467
|
+
showConfirm(config) {
|
|
11468
|
+
if (!config) {
|
|
11469
|
+
throw new Error('Argument must not be null: config');
|
|
11470
|
+
}
|
|
11471
|
+
const rawMessages = new Map();
|
|
11472
|
+
rawMessages.set('title', config.title);
|
|
11473
|
+
rawMessages.set('message', config.message);
|
|
11474
|
+
return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
|
|
11475
|
+
const title = messages.get('title');
|
|
11476
|
+
const message = messages.get('message');
|
|
11477
|
+
let dialogRef;
|
|
11478
|
+
dialogRef = this.dialog.open(ElderConfirmDialogComponent, config.config);
|
|
11479
|
+
dialogRef.componentInstance.title = title;
|
|
11480
|
+
dialogRef.componentInstance.message = message;
|
|
11481
|
+
dialogRef.componentInstance.yesNo = config.yesNo;
|
|
11482
|
+
return dialogRef.afterClosed();
|
|
11483
|
+
}));
|
|
11484
|
+
}
|
|
11485
|
+
/**
|
|
11486
|
+
* @deprecated Use showQuestion({...}) instead
|
|
11487
|
+
*
|
|
11488
|
+
* Creates a modal question dialog.
|
|
11489
|
+
*
|
|
11490
|
+
* @param title
|
|
11491
|
+
* @param question
|
|
11492
|
+
* @param config
|
|
11493
|
+
*/
|
|
11494
|
+
question(title, question, config) {
|
|
11495
|
+
return this.showQuestion({
|
|
11496
|
+
title: title,
|
|
11497
|
+
question: question,
|
|
11498
|
+
config: config || this.defaultDialogConfig
|
|
11499
|
+
});
|
|
11500
|
+
}
|
|
11501
|
+
/**
|
|
11502
|
+
* Creates a modal question dialog.
|
|
11503
|
+
*
|
|
11504
|
+
* @param config
|
|
11505
|
+
*/
|
|
11506
|
+
showQuestion(config) {
|
|
11507
|
+
if (!config) {
|
|
11508
|
+
throw new Error('Argument must not be null: config');
|
|
11509
|
+
}
|
|
11510
|
+
const rawMessages = new Map();
|
|
11511
|
+
rawMessages.set('title', config.title);
|
|
11512
|
+
rawMessages.set('question', config.question);
|
|
11513
|
+
return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
|
|
11514
|
+
const title = messages.get('title');
|
|
11515
|
+
const question = messages.get('question');
|
|
11516
|
+
const dlgConf = config.config || new MatDialogConfig();
|
|
11517
|
+
dlgConf.data = {
|
|
11518
|
+
title: title,
|
|
11519
|
+
question: question
|
|
11520
|
+
};
|
|
11521
|
+
const dialogRef = this.dialog.open(ElderQuestionDialogComponent, dlgConf);
|
|
11522
|
+
return dialogRef.afterClosed()
|
|
11523
|
+
.pipe(filter(response => !!response));
|
|
11524
|
+
}));
|
|
11525
|
+
}
|
|
11526
|
+
/***************************************************************************
|
|
11602
11527
|
* *
|
|
11603
11528
|
* Private methods *
|
|
11604
11529
|
* *
|
|
11605
11530
|
**************************************************************************/
|
|
11606
|
-
|
|
11607
|
-
|
|
11531
|
+
resolveTranslatedMap(messages, interpolateParams) {
|
|
11532
|
+
const rawMessages = Array.from(messages.values());
|
|
11533
|
+
return this.translateInterpolatedParams(interpolateParams).pipe(switchMap(translatedParams => this.translateService.get(rawMessages, translatedParams)), map(translatedValues => {
|
|
11534
|
+
const translated = new Map();
|
|
11535
|
+
messages.forEach((rawValue, key) => {
|
|
11536
|
+
translated.set(key, translatedValues[rawValue] || rawValue);
|
|
11537
|
+
});
|
|
11538
|
+
return translated;
|
|
11539
|
+
}));
|
|
11608
11540
|
}
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11541
|
+
/**
|
|
11542
|
+
* Translates a list of params
|
|
11543
|
+
*
|
|
11544
|
+
* @param interpolateParams
|
|
11545
|
+
*/
|
|
11546
|
+
translateInterpolatedParams(interpolateParams) {
|
|
11547
|
+
if (!interpolateParams) {
|
|
11548
|
+
return of({});
|
|
11549
|
+
}
|
|
11550
|
+
const values = Object.getOwnPropertyNames(interpolateParams)
|
|
11551
|
+
.map(key => interpolateParams[key])
|
|
11552
|
+
.filter(value => !!value)
|
|
11553
|
+
.map(value => value + '');
|
|
11554
|
+
return this.translateService.get(values).pipe(map(translated => {
|
|
11555
|
+
Object.getOwnPropertyNames(interpolateParams)
|
|
11556
|
+
.forEach(key => {
|
|
11557
|
+
const value = interpolateParams[key];
|
|
11558
|
+
interpolateParams[key] = translated[value];
|
|
11559
|
+
});
|
|
11560
|
+
return interpolateParams;
|
|
11613
11561
|
}));
|
|
11614
11562
|
}
|
|
11615
11563
|
}
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
11619
|
-
type:
|
|
11564
|
+
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 });
|
|
11565
|
+
ElderDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, providedIn: 'root' });
|
|
11566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, decorators: [{
|
|
11567
|
+
type: Injectable,
|
|
11620
11568
|
args: [{
|
|
11621
|
-
|
|
11622
|
-
exportAs: 'elderDataContextSelection'
|
|
11569
|
+
providedIn: 'root'
|
|
11623
11570
|
}]
|
|
11624
|
-
}], ctorParameters: function () {
|
|
11625
|
-
return [{ type: SelectionModel, decorators: [{
|
|
11626
|
-
type: Optional
|
|
11627
|
-
}] }];
|
|
11628
|
-
}, propDecorators: { selectionModel: [{
|
|
11629
|
-
type: Input,
|
|
11630
|
-
args: ['elderDataContextSelectionModel']
|
|
11631
|
-
}], dataContext: [{
|
|
11632
|
-
type: Input,
|
|
11633
|
-
args: ['elderDataContextSelection']
|
|
11634
|
-
}] } });
|
|
11571
|
+
}], ctorParameters: function () { return [{ type: i1$7.MatDialog }, { type: i2.TranslateService }]; } });
|
|
11635
11572
|
|
|
11636
|
-
class
|
|
11573
|
+
class ElderSelectionDialogComponent {
|
|
11637
11574
|
/***************************************************************************
|
|
11638
11575
|
* *
|
|
11639
11576
|
* Constructor *
|
|
11640
11577
|
* *
|
|
11641
11578
|
**************************************************************************/
|
|
11642
|
-
constructor(
|
|
11643
|
-
this.
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
|
|
11647
|
-
* *
|
|
11648
|
-
**************************************************************************/
|
|
11649
|
-
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
11579
|
+
constructor(dialogRef, data) {
|
|
11580
|
+
this.dialogRef = dialogRef;
|
|
11581
|
+
this.data = data;
|
|
11582
|
+
}
|
|
11583
|
+
ngOnInit() {
|
|
11650
11584
|
}
|
|
11651
11585
|
/***************************************************************************
|
|
11652
11586
|
* *
|
|
11653
|
-
*
|
|
11587
|
+
* Public API *
|
|
11654
11588
|
* *
|
|
11655
11589
|
**************************************************************************/
|
|
11656
|
-
|
|
11590
|
+
confirmSelection() {
|
|
11591
|
+
this.dialogRef.close();
|
|
11592
|
+
}
|
|
11593
|
+
ngAfterViewInit() {
|
|
11594
|
+
// this.dialogRef.updateSize('20vw', '20vh');
|
|
11657
11595
|
}
|
|
11658
11596
|
}
|
|
11659
|
-
|
|
11660
|
-
|
|
11661
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
11597
|
+
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 });
|
|
11598
|
+
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" }] });
|
|
11599
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogComponent, decorators: [{
|
|
11662
11600
|
type: Component,
|
|
11663
|
-
args: [{ selector: 'elder-selection-
|
|
11664
|
-
}], ctorParameters: function () {
|
|
11601
|
+
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" }]
|
|
11602
|
+
}], ctorParameters: function () {
|
|
11603
|
+
return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
11604
|
+
type: Inject,
|
|
11605
|
+
args: [MAT_DIALOG_DATA]
|
|
11606
|
+
}] }];
|
|
11607
|
+
}, propDecorators: { title: [{
|
|
11608
|
+
type: Input
|
|
11609
|
+
}] } });
|
|
11665
11610
|
|
|
11666
|
-
class
|
|
11611
|
+
class ElderSelectionDialogDirective {
|
|
11667
11612
|
/***************************************************************************
|
|
11668
11613
|
* *
|
|
11669
11614
|
* Constructor *
|
|
11670
11615
|
* *
|
|
11671
11616
|
**************************************************************************/
|
|
11672
|
-
constructor() {
|
|
11673
|
-
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
* *
|
|
11677
|
-
**************************************************************************/
|
|
11678
|
-
this.dataContext$ = new BehaviorSubject(null);
|
|
11679
|
-
}
|
|
11680
|
-
/***************************************************************************
|
|
11681
|
-
* *
|
|
11682
|
-
* Life Cycle *
|
|
11683
|
-
* *
|
|
11684
|
-
**************************************************************************/
|
|
11685
|
-
ngOnInit() {
|
|
11617
|
+
constructor(templateRef, dialog) {
|
|
11618
|
+
this.templateRef = templateRef;
|
|
11619
|
+
this.dialog = dialog;
|
|
11620
|
+
this.close = new EventEmitter();
|
|
11686
11621
|
}
|
|
11687
11622
|
/***************************************************************************
|
|
11688
11623
|
* *
|
|
11689
|
-
*
|
|
11624
|
+
* Public API *
|
|
11690
11625
|
* *
|
|
11691
11626
|
**************************************************************************/
|
|
11692
|
-
|
|
11693
|
-
this.
|
|
11627
|
+
open() {
|
|
11628
|
+
const dialogRef = this.dialog.open(ElderSelectionDialogComponent, {
|
|
11629
|
+
data: {
|
|
11630
|
+
template: this.templateRef,
|
|
11631
|
+
selectionModel: this.selectionModel
|
|
11632
|
+
},
|
|
11633
|
+
width: '80vw',
|
|
11634
|
+
height: '80vh'
|
|
11635
|
+
});
|
|
11636
|
+
dialogRef.afterClosed().subscribe(result => this.close.emit(result));
|
|
11694
11637
|
}
|
|
11695
11638
|
}
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
11699
|
-
type:
|
|
11700
|
-
args: [{
|
|
11701
|
-
|
|
11639
|
+
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 });
|
|
11640
|
+
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 });
|
|
11641
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogDirective, decorators: [{
|
|
11642
|
+
type: Directive,
|
|
11643
|
+
args: [{
|
|
11644
|
+
selector: '[elderDialog]',
|
|
11645
|
+
exportAs: 'elderSelection'
|
|
11646
|
+
}]
|
|
11647
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i1$7.MatDialog }]; }, propDecorators: { selectionModel: [{
|
|
11702
11648
|
type: Input
|
|
11649
|
+
}], close: [{
|
|
11650
|
+
type: Output
|
|
11703
11651
|
}] } });
|
|
11704
11652
|
|
|
11705
|
-
|
|
11653
|
+
/**
|
|
11654
|
+
* @deprecated Please switch to ElderDialogService
|
|
11655
|
+
*/
|
|
11656
|
+
class EbsCommonDialogService extends ElderDialogService {
|
|
11706
11657
|
}
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
|
|
11736
|
-
|
|
11658
|
+
EbsCommonDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
11659
|
+
EbsCommonDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService });
|
|
11660
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, decorators: [{
|
|
11661
|
+
type: Injectable
|
|
11662
|
+
}] });
|
|
11663
|
+
class ElderDialogModule {
|
|
11664
|
+
static forRoot() {
|
|
11665
|
+
return {
|
|
11666
|
+
ngModule: ElderDialogModule,
|
|
11667
|
+
providers: [
|
|
11668
|
+
// ElderDialogService,
|
|
11669
|
+
EbsCommonDialogService
|
|
11670
|
+
]
|
|
11671
|
+
};
|
|
11672
|
+
}
|
|
11673
|
+
}
|
|
11674
|
+
ElderDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
11675
|
+
ElderDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, declarations: [ElderConfirmDialogComponent,
|
|
11676
|
+
ElderQuestionDialogComponent,
|
|
11677
|
+
ElderSelectionDialogComponent,
|
|
11678
|
+
ElderSelectionDialogDirective], imports: [CommonModule, FormsModule,
|
|
11679
|
+
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11680
|
+
A11yModule,
|
|
11681
|
+
FlexLayoutModule, TranslateModule], exports: [ElderConfirmDialogComponent,
|
|
11682
|
+
ElderQuestionDialogComponent,
|
|
11683
|
+
ElderSelectionDialogComponent,
|
|
11684
|
+
ElderSelectionDialogDirective] });
|
|
11685
|
+
ElderDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, imports: [CommonModule, FormsModule,
|
|
11686
|
+
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11687
|
+
A11yModule,
|
|
11688
|
+
FlexLayoutModule, TranslateModule] });
|
|
11689
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, decorators: [{
|
|
11737
11690
|
type: NgModule,
|
|
11738
11691
|
args: [{
|
|
11739
11692
|
imports: [
|
|
11740
|
-
CommonModule,
|
|
11741
|
-
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
MatButtonModule, MatIconModule, MatBadgeModule,
|
|
11745
|
-
MatProgressBarModule,
|
|
11746
|
-
MatDialogModule, MatTooltipModule,
|
|
11747
|
-
// translations
|
|
11748
|
-
TranslateModule, FlexLayoutModule,
|
|
11693
|
+
CommonModule, FormsModule,
|
|
11694
|
+
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11695
|
+
A11yModule,
|
|
11696
|
+
FlexLayoutModule, TranslateModule
|
|
11749
11697
|
],
|
|
11750
11698
|
declarations: [
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
11755
|
-
DataContextSelectionDirective,
|
|
11756
|
-
DataContextStateIndicatorComponent
|
|
11699
|
+
ElderConfirmDialogComponent,
|
|
11700
|
+
ElderQuestionDialogComponent,
|
|
11701
|
+
ElderSelectionDialogComponent,
|
|
11702
|
+
ElderSelectionDialogDirective
|
|
11757
11703
|
],
|
|
11758
11704
|
exports: [
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
DataContextStateIndicatorComponent
|
|
11765
|
-
],
|
|
11705
|
+
ElderConfirmDialogComponent,
|
|
11706
|
+
ElderQuestionDialogComponent,
|
|
11707
|
+
ElderSelectionDialogComponent,
|
|
11708
|
+
ElderSelectionDialogDirective
|
|
11709
|
+
]
|
|
11766
11710
|
}]
|
|
11767
11711
|
}] });
|
|
11768
11712
|
|
|
11769
|
-
|
|
11713
|
+
/**
|
|
11714
|
+
* This directive projects content identified by a placeholder id
|
|
11715
|
+
* into the toolbar at the corresponding place.
|
|
11716
|
+
*/
|
|
11717
|
+
class ElderToolbarContentDirective {
|
|
11718
|
+
constructor(templateRef) {
|
|
11719
|
+
this.templateRef = templateRef;
|
|
11720
|
+
}
|
|
11721
|
+
}
|
|
11722
|
+
ElderToolbarContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
11723
|
+
ElderToolbarContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderToolbarContentDirective, selector: "[elderToolbarContent]", inputs: { placeholderId: ["elderToolbarContent", "placeholderId"] }, ngImport: i0 });
|
|
11724
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, decorators: [{
|
|
11725
|
+
type: Directive,
|
|
11726
|
+
args: [{ selector: '[elderToolbarContent]' }]
|
|
11727
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { placeholderId: [{
|
|
11728
|
+
type: Input,
|
|
11729
|
+
args: ['elderToolbarContent']
|
|
11730
|
+
}] } });
|
|
11731
|
+
class ElderDataToolbarComponent {
|
|
11732
|
+
/***************************************************************************
|
|
11733
|
+
* *
|
|
11734
|
+
* Constructor *
|
|
11735
|
+
* *
|
|
11736
|
+
**************************************************************************/
|
|
11737
|
+
constructor(selectionModel, dataView, dialogService) {
|
|
11738
|
+
this.dialogService = dialogService;
|
|
11739
|
+
this.canAdd = true;
|
|
11740
|
+
this.canRemove = true;
|
|
11741
|
+
this.canMore = true;
|
|
11742
|
+
this.confirmRemoval = true;
|
|
11743
|
+
this.keepSelectionAfterRemoval = false;
|
|
11744
|
+
this.requestNew = new Subject();
|
|
11745
|
+
this.requestRemove = new Subject();
|
|
11746
|
+
this.selectionFallback = new BehaviorSubject([]);
|
|
11747
|
+
this.selection$ = this.selectionFallback.asObservable();
|
|
11748
|
+
if (selectionModel) {
|
|
11749
|
+
this.selectionModel = selectionModel;
|
|
11750
|
+
}
|
|
11751
|
+
if (dataView) {
|
|
11752
|
+
this.selectionModel = dataView.selectionModel;
|
|
11753
|
+
}
|
|
11754
|
+
}
|
|
11755
|
+
/***************************************************************************
|
|
11756
|
+
* *
|
|
11757
|
+
* Life Cycle *
|
|
11758
|
+
* *
|
|
11759
|
+
**************************************************************************/
|
|
11760
|
+
ngOnInit() { }
|
|
11761
|
+
/***************************************************************************
|
|
11762
|
+
* *
|
|
11763
|
+
* Properties *
|
|
11764
|
+
* *
|
|
11765
|
+
**************************************************************************/
|
|
11766
|
+
set selectionModel(model) {
|
|
11767
|
+
this._selectionModel = model;
|
|
11768
|
+
if (model) {
|
|
11769
|
+
this.selection$ = model.selection;
|
|
11770
|
+
}
|
|
11771
|
+
else {
|
|
11772
|
+
this.selection$ = this.selectionFallback.asObservable();
|
|
11773
|
+
}
|
|
11774
|
+
}
|
|
11775
|
+
get selectionModel() {
|
|
11776
|
+
return this._selectionModel;
|
|
11777
|
+
}
|
|
11778
|
+
/***************************************************************************
|
|
11779
|
+
* *
|
|
11780
|
+
* Public API *
|
|
11781
|
+
* *
|
|
11782
|
+
**************************************************************************/
|
|
11783
|
+
getTemplate(placeholderId) {
|
|
11784
|
+
if (!this.templates) {
|
|
11785
|
+
return null;
|
|
11786
|
+
}
|
|
11787
|
+
const template = this.templates.find((item) => item.placeholderId === placeholderId);
|
|
11788
|
+
return template ? template.templateRef : null;
|
|
11789
|
+
}
|
|
11790
|
+
requestRemoveItems(items) {
|
|
11791
|
+
if (this.confirmRemoval) {
|
|
11792
|
+
this.dialogService
|
|
11793
|
+
.showConfirm({
|
|
11794
|
+
title: 'dialogs.confirm-deletion.title',
|
|
11795
|
+
message: 'dialogs.confirm-deletion.message',
|
|
11796
|
+
yesNo: true,
|
|
11797
|
+
interpolateParams: { numOfItems: items.length },
|
|
11798
|
+
})
|
|
11799
|
+
.subscribe((confirmed) => {
|
|
11800
|
+
if (confirmed) {
|
|
11801
|
+
this.emitRemove(items);
|
|
11802
|
+
}
|
|
11803
|
+
});
|
|
11804
|
+
}
|
|
11805
|
+
else {
|
|
11806
|
+
this.emitRemove(items);
|
|
11807
|
+
}
|
|
11808
|
+
}
|
|
11809
|
+
emitRemove(items) {
|
|
11810
|
+
this.requestRemove.next(items);
|
|
11811
|
+
if (!this.keepSelectionAfterRemoval) {
|
|
11812
|
+
// Clear the selection after deleting items
|
|
11813
|
+
if (this._selectionModel) {
|
|
11814
|
+
this._selectionModel.deselect(items);
|
|
11815
|
+
}
|
|
11816
|
+
}
|
|
11817
|
+
}
|
|
11818
|
+
}
|
|
11819
|
+
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 });
|
|
11820
|
+
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 });
|
|
11821
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataToolbarComponent, decorators: [{
|
|
11822
|
+
type: Component,
|
|
11823
|
+
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" }]
|
|
11824
|
+
}], ctorParameters: function () {
|
|
11825
|
+
return [{ type: SelectionModel, decorators: [{
|
|
11826
|
+
type: Optional
|
|
11827
|
+
}] }, { type: undefined, decorators: [{
|
|
11828
|
+
type: Optional
|
|
11829
|
+
}, {
|
|
11830
|
+
type: Inject,
|
|
11831
|
+
args: [ELDER_DATA_VIEW]
|
|
11832
|
+
}] }, { type: ElderDialogService }];
|
|
11833
|
+
}, propDecorators: { canAdd: [{
|
|
11834
|
+
type: Input
|
|
11835
|
+
}], canRemove: [{
|
|
11836
|
+
type: Input
|
|
11837
|
+
}], canMore: [{
|
|
11838
|
+
type: Input
|
|
11839
|
+
}], confirmRemoval: [{
|
|
11840
|
+
type: Input
|
|
11841
|
+
}], keepSelectionAfterRemoval: [{
|
|
11842
|
+
type: Input
|
|
11843
|
+
}], requestNew: [{
|
|
11844
|
+
type: Output
|
|
11845
|
+
}], requestRemove: [{
|
|
11846
|
+
type: Output
|
|
11847
|
+
}], templates: [{
|
|
11848
|
+
type: ContentChildren,
|
|
11849
|
+
args: [ElderToolbarContentDirective]
|
|
11850
|
+
}], selectionModel: [{
|
|
11851
|
+
type: Input
|
|
11852
|
+
}] } });
|
|
11853
|
+
|
|
11854
|
+
class ElderSingleSortComponent {
|
|
11770
11855
|
/***************************************************************************
|
|
11771
11856
|
* *
|
|
11772
11857
|
* Constructor *
|
|
11773
11858
|
* *
|
|
11774
11859
|
**************************************************************************/
|
|
11775
|
-
constructor(
|
|
11776
|
-
this.dialogRef = dialogRef;
|
|
11777
|
-
this.data = data;
|
|
11778
|
-
this.selectionModel = selectionModel;
|
|
11860
|
+
constructor() {
|
|
11779
11861
|
/***************************************************************************
|
|
11780
11862
|
* *
|
|
11781
11863
|
* Fields *
|
|
11782
11864
|
* *
|
|
11783
11865
|
**************************************************************************/
|
|
11784
11866
|
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
11867
|
+
this.sort$ = new BehaviorSubject(Sort.NONE);
|
|
11868
|
+
this.availableSorts = [];
|
|
11869
|
+
this.sortChange = new EventEmitter();
|
|
11870
|
+
this.translationPrefix = 'documents.sorts.';
|
|
11785
11871
|
}
|
|
11786
11872
|
/***************************************************************************
|
|
11787
11873
|
* *
|
|
11788
|
-
*
|
|
11874
|
+
* Life Cycle *
|
|
11789
11875
|
* *
|
|
11790
11876
|
**************************************************************************/
|
|
11791
11877
|
ngOnInit() {
|
|
11792
11878
|
}
|
|
11793
|
-
}
|
|
11794
|
-
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 });
|
|
11795
|
-
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 });
|
|
11796
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: TemplatedSelectionDialogComponent, decorators: [{
|
|
11797
|
-
type: Component,
|
|
11798
|
-
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" }]
|
|
11799
|
-
}], ctorParameters: function () {
|
|
11800
|
-
return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
11801
|
-
type: Inject,
|
|
11802
|
-
args: [MAT_DIALOG_DATA]
|
|
11803
|
-
}] }, { type: SelectionModel }];
|
|
11804
|
-
} });
|
|
11805
|
-
|
|
11806
|
-
class ColumnPositionSpec {
|
|
11807
|
-
constructor(position, relativeTo) {
|
|
11808
|
-
this.position = position;
|
|
11809
|
-
this.relativeTo = relativeTo;
|
|
11810
|
-
}
|
|
11811
|
-
static relativeToColumn(col, position) {
|
|
11812
|
-
return new ColumnPositionSpec(position, col);
|
|
11813
|
-
}
|
|
11814
|
-
static relativeToPrevGroup(position) {
|
|
11815
|
-
return new ColumnPositionSpec(position, null);
|
|
11816
|
-
}
|
|
11817
|
-
}
|
|
11818
|
-
class ElderColumnGroup {
|
|
11819
|
-
constructor(groupIndex, columnsPosition, columns) {
|
|
11820
|
-
this.groupIndex = groupIndex;
|
|
11821
|
-
this.columnsPosition = columnsPosition;
|
|
11822
|
-
this.columns = columns;
|
|
11823
|
-
}
|
|
11824
|
-
}
|
|
11825
|
-
class ElderColumnLayout {
|
|
11826
|
-
constructor() {
|
|
11827
|
-
/***************************************************************************
|
|
11828
|
-
* *
|
|
11829
|
-
* Fields *
|
|
11830
|
-
* *
|
|
11831
|
-
**************************************************************************/
|
|
11832
|
-
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
11833
|
-
}
|
|
11834
11879
|
/***************************************************************************
|
|
11835
11880
|
* *
|
|
11836
|
-
*
|
|
11881
|
+
* Properties *
|
|
11837
11882
|
* *
|
|
11838
11883
|
**************************************************************************/
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11884
|
+
set sort(sort) {
|
|
11885
|
+
if (!sort) {
|
|
11886
|
+
sort = Sort.NONE;
|
|
11887
|
+
}
|
|
11888
|
+
this.sort$.next(sort);
|
|
11889
|
+
}
|
|
11890
|
+
get sort() {
|
|
11891
|
+
return this.sort$.getValue();
|
|
11844
11892
|
}
|
|
11845
11893
|
/***************************************************************************
|
|
11846
11894
|
* *
|
|
11847
|
-
*
|
|
11895
|
+
* API *
|
|
11848
11896
|
* *
|
|
11849
11897
|
**************************************************************************/
|
|
11850
|
-
|
|
11851
|
-
const
|
|
11852
|
-
|
|
11853
|
-
// Now we can insert groups in defined order
|
|
11854
|
-
let previousIndex = {
|
|
11855
|
-
startIndex: 0,
|
|
11856
|
-
endIndex: 0
|
|
11857
|
-
};
|
|
11858
|
-
for (const grp of groupHierarchy) {
|
|
11859
|
-
// grp defined position relative to prev group
|
|
11860
|
-
previousIndex = this.insertColumnsAt(sorted, grp.columns, grp.columnsPosition, previousIndex);
|
|
11861
|
-
}
|
|
11862
|
-
return sorted;
|
|
11898
|
+
setSortProp(sortProp) {
|
|
11899
|
+
const sort = new Sort(sortProp, this.sort.dir);
|
|
11900
|
+
this.setSort(sort);
|
|
11863
11901
|
}
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11902
|
+
toggleSortDirection(event) {
|
|
11903
|
+
event.stopPropagation();
|
|
11904
|
+
let dir;
|
|
11905
|
+
if (this.sort.dir === 'asc') {
|
|
11906
|
+
dir = 'desc';
|
|
11868
11907
|
}
|
|
11869
11908
|
else {
|
|
11870
|
-
|
|
11871
|
-
}
|
|
11872
|
-
existingColumns.splice(insertIndex, 0, ...groupItems);
|
|
11873
|
-
return {
|
|
11874
|
-
startIndex: insertIndex,
|
|
11875
|
-
endIndex: insertIndex + groupItems.length
|
|
11876
|
-
};
|
|
11877
|
-
}
|
|
11878
|
-
calcInsertIndexRelativeToColumn(position, relativeToCol, existingColumns) {
|
|
11879
|
-
const relativeIndex = existingColumns
|
|
11880
|
-
.findIndex(c => c.cdkColumn.name === relativeToCol);
|
|
11881
|
-
switch (position) {
|
|
11882
|
-
case 'start':
|
|
11883
|
-
case 'after':
|
|
11884
|
-
// after relative
|
|
11885
|
-
return relativeIndex + 1;
|
|
11886
|
-
case 'before':
|
|
11887
|
-
case 'end':
|
|
11888
|
-
// before relative
|
|
11889
|
-
return relativeIndex;
|
|
11890
|
-
}
|
|
11891
|
-
}
|
|
11892
|
-
calcInsertIndexRelativeToPreviousGroup(position, existingColumns, previousGroup) {
|
|
11893
|
-
switch (position) {
|
|
11894
|
-
case 'start':
|
|
11895
|
-
return 0;
|
|
11896
|
-
case 'end':
|
|
11897
|
-
return existingColumns.length;
|
|
11898
|
-
case 'after':
|
|
11899
|
-
// after relative to previous group
|
|
11900
|
-
return previousGroup.endIndex;
|
|
11901
|
-
case 'before':
|
|
11902
|
-
// before relative to previous group
|
|
11903
|
-
return previousGroup.startIndex;
|
|
11909
|
+
dir = 'asc';
|
|
11904
11910
|
}
|
|
11911
|
+
this.setSort(new Sort(this.sort.prop, dir));
|
|
11905
11912
|
}
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
return naturalValueComparator(a.groupIndex, b.groupIndex);
|
|
11910
|
-
}).reverse();
|
|
11913
|
+
setSort(sort) {
|
|
11914
|
+
this.sort = sort;
|
|
11915
|
+
this.sortChange.emit(sort);
|
|
11911
11916
|
}
|
|
11912
11917
|
}
|
|
11918
|
+
ElderSingleSortComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSingleSortComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11919
|
+
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 });
|
|
11920
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSingleSortComponent, decorators: [{
|
|
11921
|
+
type: Component,
|
|
11922
|
+
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" }]
|
|
11923
|
+
}], ctorParameters: function () { return []; }, propDecorators: { availableSorts: [{
|
|
11924
|
+
type: Input
|
|
11925
|
+
}], sortChange: [{
|
|
11926
|
+
type: Output
|
|
11927
|
+
}], translationPrefix: [{
|
|
11928
|
+
type: Input
|
|
11929
|
+
}], sort: [{
|
|
11930
|
+
type: Input
|
|
11931
|
+
}] } });
|
|
11913
11932
|
|
|
11914
|
-
class
|
|
11915
|
-
constructor(
|
|
11916
|
-
this.
|
|
11917
|
-
this.
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
return ElderTableGroup.of(UuidUtil.weakUuid4(), groupIndex);
|
|
11921
|
-
}
|
|
11922
|
-
static of(id, groupIndex) {
|
|
11923
|
-
return new ElderTableGroup(id, groupIndex);
|
|
11933
|
+
class MasterSelectionState {
|
|
11934
|
+
constructor(count, allSelected, someSelected, anySelected) {
|
|
11935
|
+
this.count = count;
|
|
11936
|
+
this.allSelected = allSelected;
|
|
11937
|
+
this.someSelected = someSelected;
|
|
11938
|
+
this.anySelected = anySelected;
|
|
11924
11939
|
}
|
|
11925
11940
|
}
|
|
11926
|
-
|
|
11941
|
+
|
|
11942
|
+
class DataContextSelectionDirective {
|
|
11927
11943
|
/***************************************************************************
|
|
11928
11944
|
* *
|
|
11929
11945
|
* Constructor *
|
|
11930
11946
|
* *
|
|
11931
11947
|
**************************************************************************/
|
|
11932
|
-
constructor() {
|
|
11948
|
+
constructor(selectionModel) {
|
|
11933
11949
|
/***************************************************************************
|
|
11934
11950
|
* *
|
|
11935
11951
|
* Fields *
|
|
11936
11952
|
* *
|
|
11937
11953
|
**************************************************************************/
|
|
11938
|
-
this.
|
|
11939
|
-
this.
|
|
11940
|
-
this.
|
|
11941
|
-
this.
|
|
11942
|
-
this.
|
|
11943
|
-
this._sortGroups = new ReactiveMap();
|
|
11944
|
-
this.selectionVisible$ = new BehaviorSubject(false);
|
|
11945
|
-
/**
|
|
11946
|
-
* The columns to display explicitly set by the user.
|
|
11947
|
-
* We need to support inserting display columns by index or anchored to existing ones.
|
|
11948
|
-
* before([columns])
|
|
11949
|
-
* after()
|
|
11950
|
-
* start()
|
|
11951
|
-
* end([])
|
|
11952
|
-
* @private
|
|
11953
|
-
*/
|
|
11954
|
-
this.displayedColumns$ = new BehaviorSubject(undefined);
|
|
11955
|
-
this.displayedColumnsInner$ = this.renderDisplayedColumns(this.displayedColumns$, this.columnDefs$, this.selectionVisible$);
|
|
11954
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
11955
|
+
this.selectionModel$ = new BehaviorSubject(null);
|
|
11956
|
+
this.dataContext$ = new BehaviorSubject(null);
|
|
11957
|
+
this.selectionModel$.next(selectionModel);
|
|
11958
|
+
this.selectionState$ = this.buildSelectionState$(this.selectionModel$, this.dataContext$);
|
|
11956
11959
|
}
|
|
11957
11960
|
/***************************************************************************
|
|
11958
11961
|
* *
|
|
11959
11962
|
* Properties *
|
|
11960
11963
|
* *
|
|
11961
11964
|
**************************************************************************/
|
|
11962
|
-
set
|
|
11963
|
-
this.
|
|
11964
|
-
}
|
|
11965
|
-
get selectionVisible() {
|
|
11966
|
-
return this.selectionVisible$.getValue();
|
|
11967
|
-
}
|
|
11968
|
-
set displayedColumns(columns) {
|
|
11969
|
-
this.displayedColumns$.next(columns);
|
|
11970
|
-
}
|
|
11971
|
-
get displayedColumns() {
|
|
11972
|
-
return this.displayedColumns$.getValue();
|
|
11973
|
-
}
|
|
11974
|
-
/***************************************************************************
|
|
11975
|
-
* *
|
|
11976
|
-
* Rendered Properties *
|
|
11977
|
-
* *
|
|
11978
|
-
**************************************************************************/
|
|
11979
|
-
get columnDefs$() {
|
|
11980
|
-
return this._columnGroups.values$.pipe(map(groups => this.elderColumnLayout.layoutColumns(groups)));
|
|
11981
|
-
}
|
|
11982
|
-
get rowDefs$() {
|
|
11983
|
-
return this.sortAndFlatten(this._rowDefGroups);
|
|
11965
|
+
set selectionModel(model) {
|
|
11966
|
+
this.selectionModel$.next(model);
|
|
11984
11967
|
}
|
|
11985
|
-
get
|
|
11986
|
-
return this.
|
|
11968
|
+
get selectionModel() {
|
|
11969
|
+
return this.selectionModel$.getValue();
|
|
11987
11970
|
}
|
|
11988
|
-
|
|
11989
|
-
|
|
11990
|
-
return Array.from(myMap.entries())
|
|
11991
|
-
.sort(([a_key], [b_key]) => {
|
|
11992
|
-
var _a, _b, _c, _d;
|
|
11993
|
-
const grpAIndex = (_b = (_a = groups.get(a_key)) === null || _a === void 0 ? void 0 : _a.index) !== null && _b !== void 0 ? _b : 0;
|
|
11994
|
-
const grpBIndex = (_d = (_c = groups.get(b_key)) === null || _c === void 0 ? void 0 : _c.index) !== null && _d !== void 0 ? _d : 0;
|
|
11995
|
-
return naturalValueComparator(grpAIndex, grpBIndex);
|
|
11996
|
-
}).map(([a_key, a_value]) => a_value);
|
|
11971
|
+
set dataContext(dataContext) {
|
|
11972
|
+
this.dataContext$.next(dataContext);
|
|
11997
11973
|
}
|
|
11998
|
-
|
|
11999
|
-
|
|
11974
|
+
/** Whether the number of selected elements matches the totalSnapshot number of selectable rows. */
|
|
11975
|
+
get isAllSelectedSnapshot() {
|
|
11976
|
+
const numSelected = this.selectionModel.selectionSnapshot.length;
|
|
11977
|
+
const context = this.dataContext$.getValue();
|
|
11978
|
+
const numRows = context ? context.snapshot.data.length : 0;
|
|
11979
|
+
const numUnselectable = context ? context.snapshot.data.filter(i => !this.selectionModel.isSelectable(i)).length : 0;
|
|
11980
|
+
return numSelected >= numRows - numUnselectable; // True if all selectable items are selected
|
|
12000
11981
|
}
|
|
12001
|
-
/*
|
|
12002
|
-
public get sortHeaders$(): Observable<MatSortHeader[]> {
|
|
12003
|
-
return this._sortGroups.values$.pipe(
|
|
12004
|
-
map(groups => this.flattenDefs(groups))
|
|
12005
|
-
);
|
|
12006
|
-
}*/
|
|
12007
11982
|
/***************************************************************************
|
|
12008
11983
|
* *
|
|
12009
11984
|
* Public API *
|
|
12010
11985
|
* *
|
|
12011
11986
|
**************************************************************************/
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
clearColumnDefGroup(group) {
|
|
12025
|
-
this._columnGroups.delete(group.id);
|
|
12026
|
-
}
|
|
12027
|
-
clearRowDefGroup(group) {
|
|
12028
|
-
this._rowDefGroups.delete(group.id);
|
|
12029
|
-
}
|
|
12030
|
-
clearSortGroup(group) {
|
|
12031
|
-
this._sortGroups.delete(group.id);
|
|
12032
|
-
}
|
|
12033
|
-
deRegisterGroup(group) {
|
|
12034
|
-
this.clearColumnDefGroup(group);
|
|
12035
|
-
this.clearRowDefGroup(group);
|
|
12036
|
-
this.clearSortGroup(group);
|
|
12037
|
-
this._groups.delete(group.id);
|
|
11987
|
+
/** Selects all rows if they are not all selected; otherwise clear selection. */
|
|
11988
|
+
masterToggle() {
|
|
11989
|
+
this.log.debug('masterToggle triggered, toggling all!');
|
|
11990
|
+
if (this.isAllSelectedSnapshot) {
|
|
11991
|
+
this.selectionModel.clear();
|
|
11992
|
+
}
|
|
11993
|
+
else {
|
|
11994
|
+
const context = this.dataContext$.getValue();
|
|
11995
|
+
if (context) {
|
|
11996
|
+
this.selectionModel.select(context.snapshot.data);
|
|
11997
|
+
}
|
|
11998
|
+
}
|
|
12038
11999
|
}
|
|
12039
12000
|
/***************************************************************************
|
|
12040
12001
|
* *
|
|
12041
12002
|
* Private methods *
|
|
12042
12003
|
* *
|
|
12043
12004
|
**************************************************************************/
|
|
12044
|
-
|
|
12045
|
-
return combineLatest([
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
if (columnDefs) {
|
|
12052
|
-
columnDefs.forEach(col => {
|
|
12053
|
-
columns.push(col.name);
|
|
12054
|
-
});
|
|
12055
|
-
}
|
|
12056
|
-
}
|
|
12057
|
-
if (this.selectionVisible) {
|
|
12058
|
-
columns = ['select', ...columns];
|
|
12059
|
-
}
|
|
12060
|
-
return columns;
|
|
12005
|
+
buildSelectionState$(selectionModel$, dataContext$) {
|
|
12006
|
+
return combineLatest([selectionModel$, dataContext$]).pipe(filter(([model, dc]) => !!model && !!dc), switchMap(([model, dc]) => this.buildSelectionStateInner$(model, dc)));
|
|
12007
|
+
}
|
|
12008
|
+
buildSelectionStateInner$(model, dc) {
|
|
12009
|
+
return combineLatest([model.selection, dc.data]).pipe(map(([selection, currentData]) => {
|
|
12010
|
+
const unselectable = currentData.filter(i => !model.isSelectable(i));
|
|
12011
|
+
return new MasterSelectionState(selection.length, selection.length >= currentData.length - unselectable.length, selection.length > 0 && selection.length < currentData.length - unselectable.length, selection.length > 0);
|
|
12061
12012
|
}));
|
|
12062
12013
|
}
|
|
12063
12014
|
}
|
|
12064
|
-
|
|
12065
|
-
|
|
12066
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
12067
|
-
type:
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
}
|
|
12073
|
-
|
|
12074
|
-
|
|
12075
|
-
}
|
|
12076
|
-
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12082
|
-
|
|
12083
|
-
provide: ElderTableModel,
|
|
12084
|
-
useFactory: existingOrNewElderTableModel,
|
|
12085
|
-
deps: [[new Optional(), new SkipSelf(), ElderTableModel]]
|
|
12086
|
-
};
|
|
12087
|
-
/**
|
|
12088
|
-
* Creates a new ElderTableModel root and provides it,
|
|
12089
|
-
* even if there is an existing parent table model.
|
|
12090
|
-
*/
|
|
12091
|
-
ElderTableProviders.NewTableModelRoot = {
|
|
12092
|
-
provide: ElderTableModel,
|
|
12093
|
-
useFactory: newElderTableModel
|
|
12094
|
-
};
|
|
12095
|
-
/**
|
|
12096
|
-
* If there is an existing ElderTableModel service provided, clears it.
|
|
12097
|
-
*
|
|
12098
|
-
* Child components will therefore be blocked from accessing any parent TableModel service
|
|
12099
|
-
* and are instead forced to create their own.
|
|
12100
|
-
*
|
|
12101
|
-
* This supports nesting ElderTable without sharing the table model / columns.
|
|
12102
|
-
*/
|
|
12103
|
-
ElderTableProviders.ClearTableModel = {
|
|
12104
|
-
provide: ElderTableModel,
|
|
12105
|
-
useValue: null
|
|
12106
|
-
};
|
|
12015
|
+
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 });
|
|
12016
|
+
DataContextSelectionDirective.ɵdir = 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 });
|
|
12017
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextSelectionDirective, decorators: [{
|
|
12018
|
+
type: Directive,
|
|
12019
|
+
args: [{
|
|
12020
|
+
selector: '[elderDataContextSelection]',
|
|
12021
|
+
exportAs: 'elderDataContextSelection'
|
|
12022
|
+
}]
|
|
12023
|
+
}], ctorParameters: function () {
|
|
12024
|
+
return [{ type: SelectionModel, decorators: [{
|
|
12025
|
+
type: Optional
|
|
12026
|
+
}] }];
|
|
12027
|
+
}, propDecorators: { selectionModel: [{
|
|
12028
|
+
type: Input,
|
|
12029
|
+
args: ['elderDataContextSelectionModel']
|
|
12030
|
+
}], dataContext: [{
|
|
12031
|
+
type: Input,
|
|
12032
|
+
args: ['elderDataContextSelection']
|
|
12033
|
+
}] } });
|
|
12107
12034
|
|
|
12108
|
-
|
|
12109
|
-
* Configures the selection mode on supporting components.
|
|
12110
|
-
*/
|
|
12111
|
-
class ElderDataViewSelectionMode {
|
|
12112
|
-
constructor() {
|
|
12113
|
-
this.sorts = [];
|
|
12114
|
-
this.filters = [];
|
|
12115
|
-
this.multi = false;
|
|
12116
|
-
}
|
|
12117
|
-
}
|
|
12118
|
-
function createSelectionModel() {
|
|
12119
|
-
return new SelectionModel();
|
|
12120
|
-
}
|
|
12121
|
-
function createDataViewSelection() {
|
|
12122
|
-
return new ElderDataViewSelectionMode();
|
|
12123
|
-
}
|
|
12124
|
-
class SelectionModelPopupDirective {
|
|
12035
|
+
class ElderSelectionMasterCheckboxComponent {
|
|
12125
12036
|
/***************************************************************************
|
|
12126
12037
|
* *
|
|
12127
12038
|
* Constructor *
|
|
12128
12039
|
* *
|
|
12129
12040
|
**************************************************************************/
|
|
12130
|
-
constructor(
|
|
12131
|
-
this.
|
|
12132
|
-
this.viewContainer = viewContainer;
|
|
12133
|
-
this.dialog = dialog;
|
|
12134
|
-
this.dataViewSelectionMode = dataViewSelectionMode;
|
|
12135
|
-
this.selectionModel = selectionModel;
|
|
12136
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
12041
|
+
constructor(dataContextSelection) {
|
|
12042
|
+
this.dataContextSelection = dataContextSelection;
|
|
12137
12043
|
/***************************************************************************
|
|
12138
12044
|
* *
|
|
12139
12045
|
* Fields *
|
|
12140
12046
|
* *
|
|
12141
12047
|
**************************************************************************/
|
|
12142
|
-
this.
|
|
12143
|
-
}
|
|
12144
|
-
set elderSelectionModelPopupTransform(fn) {
|
|
12145
|
-
this._transformerFn = fn;
|
|
12048
|
+
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
12146
12049
|
}
|
|
12147
12050
|
/***************************************************************************
|
|
12148
12051
|
* *
|
|
12149
|
-
*
|
|
12052
|
+
* Life Cycle *
|
|
12150
12053
|
* *
|
|
12151
12054
|
**************************************************************************/
|
|
12055
|
+
ngOnInit() {
|
|
12056
|
+
}
|
|
12057
|
+
}
|
|
12058
|
+
ElderSelectionMasterCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionMasterCheckboxComponent, deps: [{ token: DataContextSelectionDirective }], target: i0.ɵɵFactoryTarget.Component });
|
|
12059
|
+
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 });
|
|
12060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionMasterCheckboxComponent, decorators: [{
|
|
12061
|
+
type: Component,
|
|
12062
|
+
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" }]
|
|
12063
|
+
}], ctorParameters: function () { return [{ type: DataContextSelectionDirective }]; } });
|
|
12064
|
+
|
|
12065
|
+
class DataContextStateIndicatorComponent {
|
|
12152
12066
|
/***************************************************************************
|
|
12153
12067
|
* *
|
|
12154
|
-
*
|
|
12068
|
+
* Constructor *
|
|
12155
12069
|
* *
|
|
12156
12070
|
**************************************************************************/
|
|
12157
|
-
|
|
12158
|
-
|
|
12071
|
+
constructor() {
|
|
12072
|
+
/***************************************************************************
|
|
12073
|
+
* *
|
|
12074
|
+
* Fields *
|
|
12075
|
+
* *
|
|
12076
|
+
**************************************************************************/
|
|
12077
|
+
this.dataContext$ = new BehaviorSubject(null);
|
|
12078
|
+
}
|
|
12159
12079
|
/***************************************************************************
|
|
12160
12080
|
* *
|
|
12161
|
-
*
|
|
12081
|
+
* Life Cycle *
|
|
12162
12082
|
* *
|
|
12163
12083
|
**************************************************************************/
|
|
12164
|
-
|
|
12165
|
-
* Let the user choose some entities and return the selection.
|
|
12166
|
-
*/
|
|
12167
|
-
choose(keyGetter, currentSelection, filters, sorts, multi = false) {
|
|
12168
|
-
this.dataViewSelectionMode.filters = filters || [];
|
|
12169
|
-
this.dataViewSelectionMode.sorts = sorts || [];
|
|
12170
|
-
this.dataViewSelectionMode.multi = multi;
|
|
12171
|
-
this.selectionModel.isMultipleSelection = multi;
|
|
12172
|
-
this.selectionModel.keyGetterFn = keyGetter;
|
|
12173
|
-
this.selectionModel.replaceSelection(currentSelection);
|
|
12174
|
-
this.log.info('Replaced selection popup with current ' + currentSelection.length + ' entities:', currentSelection);
|
|
12175
|
-
const dialogRef = this.openSelectDialog();
|
|
12176
|
-
// This fixes dialog rendering when the browser template
|
|
12177
|
-
// view container is outside the invoking control, which
|
|
12178
|
-
// happens when use ng-content projection.
|
|
12179
|
-
this.changeDetectorRef.markForCheck();
|
|
12180
|
-
return dialogRef.afterClosed().pipe(switchMap((chosenEntities) => {
|
|
12181
|
-
if (chosenEntities) {
|
|
12182
|
-
return this._transformerFn
|
|
12183
|
-
? of(chosenEntities.map(value => this._transformerFn(value)))
|
|
12184
|
-
: of(chosenEntities);
|
|
12185
|
-
}
|
|
12186
|
-
else {
|
|
12187
|
-
return EMPTY;
|
|
12188
|
-
}
|
|
12189
|
-
}));
|
|
12084
|
+
ngOnInit() {
|
|
12190
12085
|
}
|
|
12191
12086
|
/***************************************************************************
|
|
12192
12087
|
* *
|
|
12193
|
-
*
|
|
12088
|
+
* Properties *
|
|
12194
12089
|
* *
|
|
12195
12090
|
**************************************************************************/
|
|
12196
|
-
|
|
12197
|
-
|
|
12198
|
-
width: '90vw',
|
|
12199
|
-
height: '90vh',
|
|
12200
|
-
panelClass: 'custom-dialog-container',
|
|
12201
|
-
data: {
|
|
12202
|
-
selectionComponentTemplate: this.templateRef
|
|
12203
|
-
},
|
|
12204
|
-
viewContainerRef: this.viewContainer
|
|
12205
|
-
});
|
|
12091
|
+
set dataContext(dataContext) {
|
|
12092
|
+
this.dataContext$.next(dataContext);
|
|
12206
12093
|
}
|
|
12207
12094
|
}
|
|
12208
|
-
|
|
12209
|
-
|
|
12210
|
-
|
|
12211
|
-
|
|
12212
|
-
|
|
12213
|
-
},
|
|
12214
|
-
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
i0.ɵɵ
|
|
12221
|
-
|
|
12095
|
+
DataContextStateIndicatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextStateIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12096
|
+
DataContextStateIndicatorComponent.ɵcmp = 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 });
|
|
12097
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextStateIndicatorComponent, decorators: [{
|
|
12098
|
+
type: Component,
|
|
12099
|
+
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"] }]
|
|
12100
|
+
}], ctorParameters: function () { return []; }, propDecorators: { dataContext: [{
|
|
12101
|
+
type: Input
|
|
12102
|
+
}] } });
|
|
12103
|
+
|
|
12104
|
+
class ElderDataCommonModule {
|
|
12105
|
+
}
|
|
12106
|
+
ElderDataCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12107
|
+
ElderDataCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, declarations: [ElderDataToolbarComponent,
|
|
12108
|
+
ElderToolbarContentDirective,
|
|
12109
|
+
ElderSingleSortComponent,
|
|
12110
|
+
ElderSelectionMasterCheckboxComponent,
|
|
12111
|
+
DataContextSelectionDirective,
|
|
12112
|
+
DataContextStateIndicatorComponent], imports: [CommonModule, RouterModule,
|
|
12113
|
+
// Material
|
|
12114
|
+
MatDividerModule,
|
|
12115
|
+
MatCheckboxModule, MatMenuModule,
|
|
12116
|
+
MatButtonModule, MatIconModule, MatBadgeModule,
|
|
12117
|
+
MatProgressBarModule,
|
|
12118
|
+
MatDialogModule, MatTooltipModule,
|
|
12119
|
+
// translations
|
|
12120
|
+
TranslateModule, FlexLayoutModule], exports: [ElderDataToolbarComponent,
|
|
12121
|
+
ElderToolbarContentDirective,
|
|
12122
|
+
ElderSingleSortComponent,
|
|
12123
|
+
ElderSelectionMasterCheckboxComponent,
|
|
12124
|
+
DataContextSelectionDirective,
|
|
12125
|
+
DataContextStateIndicatorComponent] });
|
|
12126
|
+
ElderDataCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, imports: [CommonModule, RouterModule,
|
|
12127
|
+
// Material
|
|
12128
|
+
MatDividerModule,
|
|
12129
|
+
MatCheckboxModule, MatMenuModule,
|
|
12130
|
+
MatButtonModule, MatIconModule, MatBadgeModule,
|
|
12131
|
+
MatProgressBarModule,
|
|
12132
|
+
MatDialogModule, MatTooltipModule,
|
|
12133
|
+
// translations
|
|
12134
|
+
TranslateModule, FlexLayoutModule] });
|
|
12135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, decorators: [{
|
|
12136
|
+
type: NgModule,
|
|
12222
12137
|
args: [{
|
|
12223
|
-
|
|
12224
|
-
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
|
|
12228
|
-
|
|
12229
|
-
|
|
12230
|
-
|
|
12231
|
-
|
|
12232
|
-
|
|
12233
|
-
|
|
12234
|
-
|
|
12138
|
+
imports: [
|
|
12139
|
+
CommonModule, RouterModule,
|
|
12140
|
+
// Material
|
|
12141
|
+
MatDividerModule,
|
|
12142
|
+
MatCheckboxModule, MatMenuModule,
|
|
12143
|
+
MatButtonModule, MatIconModule, MatBadgeModule,
|
|
12144
|
+
MatProgressBarModule,
|
|
12145
|
+
MatDialogModule, MatTooltipModule,
|
|
12146
|
+
// translations
|
|
12147
|
+
TranslateModule, FlexLayoutModule,
|
|
12148
|
+
],
|
|
12149
|
+
declarations: [
|
|
12150
|
+
ElderDataToolbarComponent,
|
|
12151
|
+
ElderToolbarContentDirective,
|
|
12152
|
+
ElderSingleSortComponent,
|
|
12153
|
+
ElderSelectionMasterCheckboxComponent,
|
|
12154
|
+
DataContextSelectionDirective,
|
|
12155
|
+
DataContextStateIndicatorComponent
|
|
12156
|
+
],
|
|
12157
|
+
exports: [
|
|
12158
|
+
ElderDataToolbarComponent,
|
|
12159
|
+
ElderToolbarContentDirective,
|
|
12160
|
+
ElderSingleSortComponent,
|
|
12161
|
+
ElderSelectionMasterCheckboxComponent,
|
|
12162
|
+
DataContextSelectionDirective,
|
|
12163
|
+
DataContextStateIndicatorComponent
|
|
12164
|
+
],
|
|
12235
12165
|
}]
|
|
12236
|
-
}]
|
|
12237
|
-
type: Input,
|
|
12238
|
-
args: ['elderSelectionModelPopupTransform']
|
|
12239
|
-
}] } });
|
|
12166
|
+
}] });
|
|
12240
12167
|
|
|
12241
|
-
class
|
|
12168
|
+
class ElderTableRowDirective {
|
|
12242
12169
|
/***************************************************************************
|
|
12243
12170
|
* *
|
|
12244
12171
|
* Constructor *
|
|
12245
12172
|
* *
|
|
12246
12173
|
**************************************************************************/
|
|
12247
|
-
constructor(
|
|
12248
|
-
this.
|
|
12174
|
+
constructor(rowRef, renderer) {
|
|
12175
|
+
this.rowRef = rowRef;
|
|
12176
|
+
this.renderer = renderer;
|
|
12249
12177
|
/***************************************************************************
|
|
12250
12178
|
* *
|
|
12251
12179
|
* Fields *
|
|
12252
12180
|
* *
|
|
12253
12181
|
**************************************************************************/
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
this.dataContext$ = new BehaviorSubject(null);
|
|
12258
|
-
this.interactionMode = 'open';
|
|
12259
|
-
/**
|
|
12260
|
-
* If true, this table is in dense mode.
|
|
12261
|
-
* Heights are generally reduced.
|
|
12262
|
-
*/
|
|
12263
|
-
this._dense = false;
|
|
12264
|
-
/**
|
|
12265
|
-
* If true, this table is in a floating card mode.
|
|
12266
|
-
* Otherwise, it is flat on the current panel.
|
|
12267
|
-
*/
|
|
12268
|
-
this._float = false;
|
|
12269
|
-
/**
|
|
12270
|
-
* If true, this table is in embedded mode.
|
|
12271
|
-
* No borders / floating visible so that the table can be embedded into another container
|
|
12272
|
-
*/
|
|
12273
|
-
this._embedded = false;
|
|
12274
|
-
this._itemClickSubject = new Subject();
|
|
12275
|
-
this.EntityIdKeyFn = (entity) => entity ? this.getId(entity) : 0;
|
|
12276
|
-
if (!selectionModel) {
|
|
12277
|
-
this.selectionModel = new SelectionModel(false, [], this.EntityIdKeyFn);
|
|
12278
|
-
}
|
|
12279
|
-
else {
|
|
12280
|
-
this.selectionModel = selectionModel;
|
|
12281
|
-
}
|
|
12182
|
+
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
12183
|
+
this._activated = false;
|
|
12184
|
+
this.focused$ = new BehaviorSubject(false);
|
|
12282
12185
|
}
|
|
12283
12186
|
/***************************************************************************
|
|
12284
12187
|
* *
|
|
12285
|
-
*
|
|
12188
|
+
* Host Listener *
|
|
12286
12189
|
* *
|
|
12287
12190
|
**************************************************************************/
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
this.onDataContextSet(data);
|
|
12294
|
-
}
|
|
12295
|
-
get dataActivePaged() {
|
|
12296
|
-
return this.dataContext;
|
|
12191
|
+
onFocus(event) {
|
|
12192
|
+
this.focused$.next(true);
|
|
12193
|
+
if (this.tableActivation) {
|
|
12194
|
+
this.tableActivation.activate(this._model);
|
|
12195
|
+
}
|
|
12297
12196
|
}
|
|
12298
|
-
|
|
12299
|
-
|
|
12197
|
+
onBlur(event) {
|
|
12198
|
+
this.focused$.next(false);
|
|
12300
12199
|
}
|
|
12301
|
-
|
|
12302
|
-
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
|
|
12200
|
+
/***************************************************************************
|
|
12201
|
+
* *
|
|
12202
|
+
* Host Bindings *
|
|
12203
|
+
* *
|
|
12204
|
+
**************************************************************************/
|
|
12205
|
+
get activated() {
|
|
12206
|
+
return this._activated;
|
|
12306
12207
|
}
|
|
12307
|
-
|
|
12308
|
-
if (
|
|
12309
|
-
|
|
12208
|
+
set activated(value) {
|
|
12209
|
+
if (this._activated !== value) {
|
|
12210
|
+
this._activated = value;
|
|
12211
|
+
this.activatedClassEnabled(value);
|
|
12310
12212
|
}
|
|
12311
|
-
return isActivePagedDataContext(this.dataContext);
|
|
12312
12213
|
}
|
|
12313
12214
|
/***************************************************************************
|
|
12314
12215
|
* *
|
|
12315
|
-
*
|
|
12216
|
+
* Properties *
|
|
12316
12217
|
* *
|
|
12317
12218
|
**************************************************************************/
|
|
12318
|
-
set
|
|
12319
|
-
this.
|
|
12320
|
-
}
|
|
12321
|
-
set selection(selection) {
|
|
12322
|
-
this.selectionModel.replaceSelection(selection);
|
|
12219
|
+
set model(model) {
|
|
12220
|
+
this._model = model;
|
|
12323
12221
|
}
|
|
12324
|
-
get
|
|
12325
|
-
return this.
|
|
12222
|
+
get model() {
|
|
12223
|
+
return this._model;
|
|
12326
12224
|
}
|
|
12327
|
-
get
|
|
12328
|
-
return this.
|
|
12329
|
-
if (selection.length > 0) {
|
|
12330
|
-
return selection[0];
|
|
12331
|
-
}
|
|
12332
|
-
else {
|
|
12333
|
-
return null;
|
|
12334
|
-
}
|
|
12335
|
-
}));
|
|
12225
|
+
get tableActivation() {
|
|
12226
|
+
return this._tableActivation;
|
|
12336
12227
|
}
|
|
12337
|
-
|
|
12338
|
-
|
|
12339
|
-
this.selectionModel.isMultipleSelection = enableMultiSelection;
|
|
12340
|
-
}
|
|
12228
|
+
get hasFocus() {
|
|
12229
|
+
return this.focused$.getValue();
|
|
12341
12230
|
}
|
|
12342
12231
|
/***************************************************************************
|
|
12343
12232
|
* *
|
|
12344
|
-
*
|
|
12233
|
+
* Public API *
|
|
12345
12234
|
* *
|
|
12346
12235
|
**************************************************************************/
|
|
12347
|
-
|
|
12348
|
-
|
|
12236
|
+
bindTableActivation(activation) {
|
|
12237
|
+
if (this._tableActivation !== activation) {
|
|
12238
|
+
this._tableActivation = activation;
|
|
12239
|
+
this.enableRowFocus(!!this._tableActivation);
|
|
12240
|
+
if (!activation) {
|
|
12241
|
+
this.activated = false;
|
|
12242
|
+
}
|
|
12243
|
+
}
|
|
12244
|
+
}
|
|
12245
|
+
bringToView() {
|
|
12246
|
+
const row = this.rowRef.nativeElement;
|
|
12247
|
+
// scroll-snap-align: start;
|
|
12248
|
+
row.scrollIntoView({
|
|
12249
|
+
block: 'nearest',
|
|
12250
|
+
inline: 'nearest' // horizontal alignment
|
|
12251
|
+
});
|
|
12252
|
+
}
|
|
12253
|
+
foucs() {
|
|
12254
|
+
const row = this.rowRef.nativeElement;
|
|
12255
|
+
row.focus();
|
|
12349
12256
|
}
|
|
12350
12257
|
/***************************************************************************
|
|
12351
12258
|
* *
|
|
12352
|
-
*
|
|
12259
|
+
* Private methods *
|
|
12353
12260
|
* *
|
|
12354
12261
|
**************************************************************************/
|
|
12355
|
-
|
|
12356
|
-
|
|
12262
|
+
enableRowFocus(enable) {
|
|
12263
|
+
// Make the rows focusable on click (but not on tabs)
|
|
12264
|
+
if (enable) {
|
|
12265
|
+
this.renderer.setAttribute(this.rowRef.nativeElement, 'tabIndex', '-1');
|
|
12266
|
+
}
|
|
12267
|
+
else {
|
|
12268
|
+
this.renderer.removeAttribute(this.rowRef.nativeElement, 'tabIndex');
|
|
12269
|
+
}
|
|
12357
12270
|
}
|
|
12358
|
-
|
|
12359
|
-
|
|
12271
|
+
activatedClassEnabled(enabled) {
|
|
12272
|
+
const activatedClass = 'elder-table-row-activated';
|
|
12273
|
+
if (enabled) {
|
|
12274
|
+
this.renderer.addClass(this.rowRef.nativeElement, activatedClass);
|
|
12275
|
+
}
|
|
12276
|
+
else {
|
|
12277
|
+
this.renderer.removeClass(this.rowRef.nativeElement, activatedClass);
|
|
12278
|
+
}
|
|
12360
12279
|
}
|
|
12361
|
-
|
|
12362
|
-
|
|
12280
|
+
}
|
|
12281
|
+
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 });
|
|
12282
|
+
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 });
|
|
12283
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableRowDirective, decorators: [{
|
|
12284
|
+
type: Directive,
|
|
12285
|
+
args: [{
|
|
12286
|
+
selector: 'tr[elderTableRow]',
|
|
12287
|
+
exportAs: 'elderTableRow'
|
|
12288
|
+
}]
|
|
12289
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { onFocus: [{
|
|
12290
|
+
type: HostListener,
|
|
12291
|
+
args: ['focus', ['$event']]
|
|
12292
|
+
}], onBlur: [{
|
|
12293
|
+
type: HostListener,
|
|
12294
|
+
args: ['blur', ['$event']]
|
|
12295
|
+
}], model: [{
|
|
12296
|
+
type: Input,
|
|
12297
|
+
args: ['elderTableRow']
|
|
12298
|
+
}] } });
|
|
12299
|
+
|
|
12300
|
+
class ColumnPositionSpec {
|
|
12301
|
+
constructor(position, relativeTo) {
|
|
12302
|
+
this.position = position;
|
|
12303
|
+
this.relativeTo = relativeTo;
|
|
12363
12304
|
}
|
|
12364
|
-
|
|
12365
|
-
return
|
|
12305
|
+
static relativeToColumn(col, position) {
|
|
12306
|
+
return new ColumnPositionSpec(position, col);
|
|
12366
12307
|
}
|
|
12367
|
-
|
|
12368
|
-
|
|
12308
|
+
static relativeToPrevGroup(position) {
|
|
12309
|
+
return new ColumnPositionSpec(position, null);
|
|
12310
|
+
}
|
|
12311
|
+
}
|
|
12312
|
+
class ElderColumnGroup {
|
|
12313
|
+
constructor(groupIndex, columnsPosition, columns) {
|
|
12314
|
+
this.groupIndex = groupIndex;
|
|
12315
|
+
this.columnsPosition = columnsPosition;
|
|
12316
|
+
this.columns = columns;
|
|
12317
|
+
}
|
|
12318
|
+
}
|
|
12319
|
+
class ElderColumnLayout {
|
|
12320
|
+
constructor() {
|
|
12321
|
+
/***************************************************************************
|
|
12322
|
+
* *
|
|
12323
|
+
* Fields *
|
|
12324
|
+
* *
|
|
12325
|
+
**************************************************************************/
|
|
12326
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
12369
12327
|
}
|
|
12370
|
-
|
|
12371
|
-
|
|
12328
|
+
/***************************************************************************
|
|
12329
|
+
* *
|
|
12330
|
+
* Public API *
|
|
12331
|
+
* *
|
|
12332
|
+
**************************************************************************/
|
|
12333
|
+
layoutColumns(colGroups) {
|
|
12334
|
+
const sortedCols = this.renderColumns(colGroups);
|
|
12335
|
+
// Support absolute column positioning
|
|
12336
|
+
const cdkCols = sortedCols.map(col => col.cdkColumn);
|
|
12337
|
+
return cdkCols;
|
|
12372
12338
|
}
|
|
12373
12339
|
/***************************************************************************
|
|
12374
12340
|
* *
|
|
12375
|
-
*
|
|
12341
|
+
* Private methods *
|
|
12376
12342
|
* *
|
|
12377
12343
|
**************************************************************************/
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12344
|
+
renderColumns(colGroups) {
|
|
12345
|
+
const groupHierarchy = this.sortGroupsByIndex(colGroups);
|
|
12346
|
+
const sorted = [];
|
|
12347
|
+
// Now we can insert groups in defined order
|
|
12348
|
+
let previousIndex = {
|
|
12349
|
+
startIndex: 0,
|
|
12350
|
+
endIndex: 0
|
|
12351
|
+
};
|
|
12352
|
+
for (const grp of groupHierarchy) {
|
|
12353
|
+
// grp defined position relative to prev group
|
|
12354
|
+
previousIndex = this.insertColumnsAt(sorted, grp.columns, grp.columnsPosition, previousIndex);
|
|
12355
|
+
}
|
|
12356
|
+
return sorted;
|
|
12385
12357
|
}
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
else {
|
|
12394
|
-
this._itemClickSubject.next(entity);
|
|
12395
|
-
}
|
|
12396
|
-
break;
|
|
12397
|
-
case 'selection':
|
|
12398
|
-
this.selectionModel.toggle(entity);
|
|
12399
|
-
break;
|
|
12400
|
-
}
|
|
12358
|
+
insertColumnsAt(existingColumns, groupItems, positionSpec, previousGroup) {
|
|
12359
|
+
let insertIndex;
|
|
12360
|
+
if (positionSpec.relativeTo) {
|
|
12361
|
+
insertIndex = this.calcInsertIndexRelativeToColumn(positionSpec.position, positionSpec.relativeTo, existingColumns);
|
|
12362
|
+
}
|
|
12363
|
+
else {
|
|
12364
|
+
insertIndex = this.calcInsertIndexRelativeToPreviousGroup(positionSpec.position, existingColumns, previousGroup);
|
|
12401
12365
|
}
|
|
12366
|
+
existingColumns.splice(insertIndex, 0, ...groupItems);
|
|
12367
|
+
return {
|
|
12368
|
+
startIndex: insertIndex,
|
|
12369
|
+
endIndex: insertIndex + groupItems.length
|
|
12370
|
+
};
|
|
12402
12371
|
}
|
|
12403
|
-
|
|
12404
|
-
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
//
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12372
|
+
calcInsertIndexRelativeToColumn(position, relativeToCol, existingColumns) {
|
|
12373
|
+
const relativeIndex = existingColumns
|
|
12374
|
+
.findIndex(c => c.cdkColumn.name === relativeToCol);
|
|
12375
|
+
switch (position) {
|
|
12376
|
+
case 'start':
|
|
12377
|
+
case 'after':
|
|
12378
|
+
// after relative
|
|
12379
|
+
return relativeIndex + 1;
|
|
12380
|
+
case 'before':
|
|
12381
|
+
case 'end':
|
|
12382
|
+
// before relative
|
|
12383
|
+
return relativeIndex;
|
|
12414
12384
|
}
|
|
12415
12385
|
}
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12423
|
-
|
|
12386
|
+
calcInsertIndexRelativeToPreviousGroup(position, existingColumns, previousGroup) {
|
|
12387
|
+
switch (position) {
|
|
12388
|
+
case 'start':
|
|
12389
|
+
return 0;
|
|
12390
|
+
case 'end':
|
|
12391
|
+
return existingColumns.length;
|
|
12392
|
+
case 'after':
|
|
12393
|
+
// after relative to previous group
|
|
12394
|
+
return previousGroup.endIndex;
|
|
12395
|
+
case 'before':
|
|
12396
|
+
// before relative to previous group
|
|
12397
|
+
return previousGroup.startIndex;
|
|
12398
|
+
}
|
|
12399
|
+
}
|
|
12400
|
+
sortGroupsByIndex(colGroups) {
|
|
12401
|
+
return colGroups
|
|
12402
|
+
.sort((a, b) => {
|
|
12403
|
+
return naturalValueComparator(a.groupIndex, b.groupIndex);
|
|
12404
|
+
}).reverse();
|
|
12424
12405
|
}
|
|
12425
12406
|
}
|
|
12426
|
-
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 });
|
|
12427
|
-
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 });
|
|
12428
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseComponent, decorators: [{
|
|
12429
|
-
type: Component,
|
|
12430
|
-
args: [{ selector: 'elder-data-view-base', template: '' }]
|
|
12431
|
-
}], ctorParameters: function () { return [{ type: SelectionModel }, { type: ElderDataViewSelectionMode }]; }, propDecorators: { interactionMode: [{
|
|
12432
|
-
type: Input
|
|
12433
|
-
}], selectableEvaluatorFn: [{
|
|
12434
|
-
type: Input
|
|
12435
|
-
}], selection: [{
|
|
12436
|
-
type: Input
|
|
12437
|
-
}], selectionChange: [{
|
|
12438
|
-
type: Output
|
|
12439
|
-
}], selectionSingleChange: [{
|
|
12440
|
-
type: Output
|
|
12441
|
-
}], selectionMultiEnabled: [{
|
|
12442
|
-
type: Input
|
|
12443
|
-
}], itemClick: [{
|
|
12444
|
-
type: Output
|
|
12445
|
-
}], dense: [{
|
|
12446
|
-
type: Input
|
|
12447
|
-
}], float: [{
|
|
12448
|
-
type: Input
|
|
12449
|
-
}], embedded: [{
|
|
12450
|
-
type: Input
|
|
12451
|
-
}] } });
|
|
12452
12407
|
|
|
12453
|
-
class
|
|
12408
|
+
class ElderTableGroup {
|
|
12409
|
+
constructor(id, index) {
|
|
12410
|
+
this.id = id;
|
|
12411
|
+
this.index = index;
|
|
12412
|
+
}
|
|
12413
|
+
static create(groupIndex) {
|
|
12414
|
+
return ElderTableGroup.of(UuidUtil.weakUuid4(), groupIndex);
|
|
12415
|
+
}
|
|
12416
|
+
static of(id, groupIndex) {
|
|
12417
|
+
return new ElderTableGroup(id, groupIndex);
|
|
12418
|
+
}
|
|
12454
12419
|
}
|
|
12455
|
-
|
|
12456
|
-
ElderDataViewBaseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseModule, declarations: [ElderDataViewBaseComponent], imports: [CommonModule] });
|
|
12457
|
-
ElderDataViewBaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseModule, imports: [CommonModule] });
|
|
12458
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseModule, decorators: [{
|
|
12459
|
-
type: NgModule,
|
|
12460
|
-
args: [{
|
|
12461
|
-
declarations: [ElderDataViewBaseComponent],
|
|
12462
|
-
imports: [CommonModule],
|
|
12463
|
-
}]
|
|
12464
|
-
}] });
|
|
12465
|
-
|
|
12466
|
-
class ElderTableRowDirective {
|
|
12420
|
+
class ElderTableModel {
|
|
12467
12421
|
/***************************************************************************
|
|
12468
12422
|
* *
|
|
12469
12423
|
* Constructor *
|
|
12470
12424
|
* *
|
|
12471
12425
|
**************************************************************************/
|
|
12472
|
-
constructor(
|
|
12473
|
-
this.rowRef = rowRef;
|
|
12474
|
-
this.renderer = renderer;
|
|
12426
|
+
constructor() {
|
|
12475
12427
|
/***************************************************************************
|
|
12476
12428
|
* *
|
|
12477
12429
|
* Fields *
|
|
12478
12430
|
* *
|
|
12479
12431
|
**************************************************************************/
|
|
12480
12432
|
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
12481
|
-
this.
|
|
12482
|
-
this.
|
|
12433
|
+
this.elderColumnLayout = new ElderColumnLayout();
|
|
12434
|
+
this._groups = new Map();
|
|
12435
|
+
this._columnGroups = new ReactiveMap();
|
|
12436
|
+
this._rowDefGroups = new ReactiveMap();
|
|
12437
|
+
this._sortGroups = new ReactiveMap();
|
|
12438
|
+
this.selectionVisible$ = new BehaviorSubject(false);
|
|
12439
|
+
/**
|
|
12440
|
+
* The columns to display explicitly set by the user.
|
|
12441
|
+
* We need to support inserting display columns by index or anchored to existing ones.
|
|
12442
|
+
* before([columns])
|
|
12443
|
+
* after()
|
|
12444
|
+
* start()
|
|
12445
|
+
* end([])
|
|
12446
|
+
* @private
|
|
12447
|
+
*/
|
|
12448
|
+
this.displayedColumns$ = new BehaviorSubject(undefined);
|
|
12449
|
+
this.displayedColumnsInner$ = this.renderDisplayedColumns(this.displayedColumns$, this.columnDefs$, this.selectionVisible$);
|
|
12483
12450
|
}
|
|
12484
12451
|
/***************************************************************************
|
|
12485
12452
|
* *
|
|
12486
|
-
*
|
|
12453
|
+
* Properties *
|
|
12487
12454
|
* *
|
|
12488
12455
|
**************************************************************************/
|
|
12489
|
-
|
|
12490
|
-
this.
|
|
12491
|
-
if (this.tableActivation) {
|
|
12492
|
-
this.tableActivation.activate(this._model);
|
|
12493
|
-
}
|
|
12456
|
+
set selectionVisible(visible) {
|
|
12457
|
+
this.selectionVisible$.next(visible);
|
|
12494
12458
|
}
|
|
12495
|
-
|
|
12496
|
-
this.
|
|
12459
|
+
get selectionVisible() {
|
|
12460
|
+
return this.selectionVisible$.getValue();
|
|
12461
|
+
}
|
|
12462
|
+
set displayedColumns(columns) {
|
|
12463
|
+
this.displayedColumns$.next(columns);
|
|
12464
|
+
}
|
|
12465
|
+
get displayedColumns() {
|
|
12466
|
+
return this.displayedColumns$.getValue();
|
|
12497
12467
|
}
|
|
12498
12468
|
/***************************************************************************
|
|
12499
12469
|
* *
|
|
12500
|
-
*
|
|
12470
|
+
* Rendered Properties *
|
|
12501
12471
|
* *
|
|
12502
12472
|
**************************************************************************/
|
|
12503
|
-
get
|
|
12504
|
-
return this.
|
|
12473
|
+
get columnDefs$() {
|
|
12474
|
+
return this._columnGroups.values$.pipe(map(groups => this.elderColumnLayout.layoutColumns(groups)));
|
|
12505
12475
|
}
|
|
12506
|
-
|
|
12507
|
-
|
|
12508
|
-
|
|
12509
|
-
|
|
12510
|
-
|
|
12476
|
+
get rowDefs$() {
|
|
12477
|
+
return this.sortAndFlatten(this._rowDefGroups);
|
|
12478
|
+
}
|
|
12479
|
+
get sorts$() {
|
|
12480
|
+
return this._sortGroups.values$;
|
|
12481
|
+
}
|
|
12482
|
+
// ---
|
|
12483
|
+
valuesSortedByGroupIndex(myMap, groups) {
|
|
12484
|
+
return Array.from(myMap.entries())
|
|
12485
|
+
.sort(([a_key], [b_key]) => {
|
|
12486
|
+
var _a, _b, _c, _d;
|
|
12487
|
+
const grpAIndex = (_b = (_a = groups.get(a_key)) === null || _a === void 0 ? void 0 : _a.index) !== null && _b !== void 0 ? _b : 0;
|
|
12488
|
+
const grpBIndex = (_d = (_c = groups.get(b_key)) === null || _c === void 0 ? void 0 : _c.index) !== null && _d !== void 0 ? _d : 0;
|
|
12489
|
+
return naturalValueComparator(grpAIndex, grpBIndex);
|
|
12490
|
+
}).map(([a_key, a_value]) => a_value);
|
|
12491
|
+
}
|
|
12492
|
+
sortAndFlatten(reactMap) {
|
|
12493
|
+
return reactMap.map$.pipe(map(myMap => this.valuesSortedByGroupIndex(myMap, this._groups)), map(columns => CollectionUtil.flatten(columns)));
|
|
12511
12494
|
}
|
|
12495
|
+
/*
|
|
12496
|
+
public get sortHeaders$(): Observable<MatSortHeader[]> {
|
|
12497
|
+
return this._sortGroups.values$.pipe(
|
|
12498
|
+
map(groups => this.flattenDefs(groups))
|
|
12499
|
+
);
|
|
12500
|
+
}*/
|
|
12512
12501
|
/***************************************************************************
|
|
12513
12502
|
* *
|
|
12514
|
-
*
|
|
12503
|
+
* Public API *
|
|
12515
12504
|
* *
|
|
12516
12505
|
**************************************************************************/
|
|
12517
|
-
|
|
12518
|
-
this.
|
|
12506
|
+
registerGroup(group) {
|
|
12507
|
+
this._groups.set(group.id, group);
|
|
12519
12508
|
}
|
|
12520
|
-
|
|
12521
|
-
|
|
12509
|
+
updateColumnGroup(group, columnGroup) {
|
|
12510
|
+
this._columnGroups.set(group.id, columnGroup);
|
|
12522
12511
|
}
|
|
12523
|
-
|
|
12524
|
-
|
|
12512
|
+
updateRowDefs(group, rows) {
|
|
12513
|
+
this._rowDefGroups.set(group.id, rows);
|
|
12525
12514
|
}
|
|
12526
|
-
|
|
12527
|
-
|
|
12515
|
+
updateSortGroup(group, sort) {
|
|
12516
|
+
this._sortGroups.set(group.id, sort);
|
|
12517
|
+
}
|
|
12518
|
+
clearColumnDefGroup(group) {
|
|
12519
|
+
this._columnGroups.delete(group.id);
|
|
12528
12520
|
}
|
|
12529
|
-
|
|
12530
|
-
|
|
12531
|
-
* Public API *
|
|
12532
|
-
* *
|
|
12533
|
-
**************************************************************************/
|
|
12534
|
-
bindTableActivation(activation) {
|
|
12535
|
-
if (this._tableActivation !== activation) {
|
|
12536
|
-
this._tableActivation = activation;
|
|
12537
|
-
this.enableRowFocus(!!this._tableActivation);
|
|
12538
|
-
if (!activation) {
|
|
12539
|
-
this.activated = false;
|
|
12540
|
-
}
|
|
12541
|
-
}
|
|
12521
|
+
clearRowDefGroup(group) {
|
|
12522
|
+
this._rowDefGroups.delete(group.id);
|
|
12542
12523
|
}
|
|
12543
|
-
|
|
12544
|
-
|
|
12545
|
-
// scroll-snap-align: start;
|
|
12546
|
-
row.scrollIntoView({
|
|
12547
|
-
block: 'nearest',
|
|
12548
|
-
inline: 'nearest' // horizontal alignment
|
|
12549
|
-
});
|
|
12524
|
+
clearSortGroup(group) {
|
|
12525
|
+
this._sortGroups.delete(group.id);
|
|
12550
12526
|
}
|
|
12551
|
-
|
|
12552
|
-
|
|
12553
|
-
|
|
12527
|
+
deRegisterGroup(group) {
|
|
12528
|
+
this.clearColumnDefGroup(group);
|
|
12529
|
+
this.clearRowDefGroup(group);
|
|
12530
|
+
this.clearSortGroup(group);
|
|
12531
|
+
this._groups.delete(group.id);
|
|
12554
12532
|
}
|
|
12555
12533
|
/***************************************************************************
|
|
12556
12534
|
* *
|
|
12557
12535
|
* Private methods *
|
|
12558
12536
|
* *
|
|
12559
12537
|
**************************************************************************/
|
|
12560
|
-
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
|
|
12568
|
-
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
12574
|
-
|
|
12575
|
-
|
|
12576
|
-
|
|
12538
|
+
renderDisplayedColumns(userDefinedColumns$, columnDefs$, selectionVisible$) {
|
|
12539
|
+
return combineLatest([userDefinedColumns$, columnDefs$, selectionVisible$]).pipe(map(([displayedColumns, columnDefs, selectionVisible]) => {
|
|
12540
|
+
let columns = displayedColumns;
|
|
12541
|
+
if (!columns) {
|
|
12542
|
+
columns = [];
|
|
12543
|
+
// If the user did not define columns to display
|
|
12544
|
+
// Assume he wants all his own columns in given order
|
|
12545
|
+
if (columnDefs) {
|
|
12546
|
+
columnDefs.forEach(col => {
|
|
12547
|
+
columns.push(col.name);
|
|
12548
|
+
});
|
|
12549
|
+
}
|
|
12550
|
+
}
|
|
12551
|
+
if (this.selectionVisible) {
|
|
12552
|
+
columns = ['select', ...columns];
|
|
12553
|
+
}
|
|
12554
|
+
return columns;
|
|
12555
|
+
}));
|
|
12577
12556
|
}
|
|
12578
12557
|
}
|
|
12579
|
-
|
|
12580
|
-
|
|
12581
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
12582
|
-
type:
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12587
|
-
|
|
12588
|
-
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12558
|
+
ElderTableModel.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
12559
|
+
ElderTableModel.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel });
|
|
12560
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel, decorators: [{
|
|
12561
|
+
type: Injectable
|
|
12562
|
+
}], ctorParameters: function () { return []; } });
|
|
12563
|
+
|
|
12564
|
+
function existingOrNewElderTableModel(modelProvider) {
|
|
12565
|
+
return modelProvider !== null && modelProvider !== void 0 ? modelProvider : newElderTableModel();
|
|
12566
|
+
}
|
|
12567
|
+
function newElderTableModel() {
|
|
12568
|
+
return new ElderTableModel();
|
|
12569
|
+
}
|
|
12570
|
+
class ElderTableProviders {
|
|
12571
|
+
}
|
|
12572
|
+
/**
|
|
12573
|
+
* Uses the existing ElderTableModel from a parent if available.
|
|
12574
|
+
* Otherwise, creates a new ElderTableModel and provides it.
|
|
12575
|
+
*/
|
|
12576
|
+
ElderTableProviders.ExistingOrNewTableModel = {
|
|
12577
|
+
provide: ElderTableModel,
|
|
12578
|
+
useFactory: existingOrNewElderTableModel,
|
|
12579
|
+
deps: [[new Optional(), new SkipSelf(), ElderTableModel]]
|
|
12580
|
+
};
|
|
12581
|
+
/**
|
|
12582
|
+
* Creates a new ElderTableModel root and provides it,
|
|
12583
|
+
* even if there is an existing parent table model.
|
|
12584
|
+
*/
|
|
12585
|
+
ElderTableProviders.NewTableModelRoot = {
|
|
12586
|
+
provide: ElderTableModel,
|
|
12587
|
+
useFactory: newElderTableModel
|
|
12588
|
+
};
|
|
12589
|
+
/**
|
|
12590
|
+
* If there is an existing ElderTableModel service provided, clears it.
|
|
12591
|
+
*
|
|
12592
|
+
* Child components will therefore be blocked from accessing any parent TableModel service
|
|
12593
|
+
* and are instead forced to create their own.
|
|
12594
|
+
*
|
|
12595
|
+
* This supports nesting ElderTable without sharing the table model / columns.
|
|
12596
|
+
*/
|
|
12597
|
+
ElderTableProviders.ClearTableModel = {
|
|
12598
|
+
provide: ElderTableModel,
|
|
12599
|
+
useValue: null
|
|
12600
|
+
};
|
|
12597
12601
|
|
|
12598
12602
|
/**
|
|
12599
12603
|
* Binds the elder table model to the CDK table.
|
|
@@ -13120,9 +13124,9 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13120
13124
|
* Constructor *
|
|
13121
13125
|
* *
|
|
13122
13126
|
**************************************************************************/
|
|
13123
|
-
constructor(tableModel, selectionModel,
|
|
13127
|
+
constructor(tableModel, selectionModel, dataViewOptionsProvider, matSort, parentExtension, cdr, zone) {
|
|
13124
13128
|
var _a;
|
|
13125
|
-
super(selectionModel,
|
|
13129
|
+
super(selectionModel, dataViewOptionsProvider);
|
|
13126
13130
|
this.tableModel = tableModel;
|
|
13127
13131
|
this.parentExtension = parentExtension;
|
|
13128
13132
|
this.cdr = cdr;
|
|
@@ -13133,7 +13137,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13133
13137
|
* *
|
|
13134
13138
|
**************************************************************************/
|
|
13135
13139
|
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
13136
|
-
this.destroy$ = new Subject();
|
|
13137
13140
|
/**
|
|
13138
13141
|
* Load next chunk after current is done
|
|
13139
13142
|
*/
|
|
@@ -13154,14 +13157,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13154
13157
|
*/
|
|
13155
13158
|
this.hiddenField = null;
|
|
13156
13159
|
this.pageSizeOptions = [30, 50, 100, 150, 200];
|
|
13157
|
-
/**
|
|
13158
|
-
* Define if elder-table should clean up the
|
|
13159
|
-
* data-context resources for you.
|
|
13160
|
-
*
|
|
13161
|
-
* In more advanced scenarios where you plan to reuse the same data-context
|
|
13162
|
-
* set this to false and release the resources yourself. (dataContext.close)
|
|
13163
|
-
*/
|
|
13164
|
-
this.cleanUp = true;
|
|
13165
13160
|
this.keepSelection = true;
|
|
13166
13161
|
this.showFooter = false;
|
|
13167
13162
|
this.toolbarRowTemplates$ = new BehaviorSubject([]);
|
|
@@ -13181,16 +13176,7 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13181
13176
|
* *
|
|
13182
13177
|
**************************************************************************/
|
|
13183
13178
|
ngOnInit() {
|
|
13184
|
-
|
|
13185
|
-
this.selectionVisible = true;
|
|
13186
|
-
this.selectionMultiEnabled = this.dataViewSelection.multi;
|
|
13187
|
-
this.interactionMode = 'selection';
|
|
13188
|
-
this.float = false;
|
|
13189
|
-
if (this.dataContext) {
|
|
13190
|
-
this.dataContext.filter.updateFilters(this.dataViewSelection.filters);
|
|
13191
|
-
this.dataContext.sort.updateSorts(this.dataViewSelection.sorts);
|
|
13192
|
-
}
|
|
13193
|
-
}
|
|
13179
|
+
super.ngOnInit();
|
|
13194
13180
|
ElderTableModelCdkTableBinding
|
|
13195
13181
|
.of(this.tableModel)
|
|
13196
13182
|
.table(this.matTable)
|
|
@@ -13220,11 +13206,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13220
13206
|
.updated(rows => this.rows$.next(rows))
|
|
13221
13207
|
.bindUntil(this.destroy$);
|
|
13222
13208
|
}
|
|
13223
|
-
ngOnDestroy() {
|
|
13224
|
-
this.destroy$.next();
|
|
13225
|
-
this.destroy$.complete();
|
|
13226
|
-
this.autoCleanUp();
|
|
13227
|
-
}
|
|
13228
13209
|
/***************************************************************************
|
|
13229
13210
|
* *
|
|
13230
13211
|
* Properties *
|
|
@@ -13348,18 +13329,9 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13348
13329
|
}
|
|
13349
13330
|
});
|
|
13350
13331
|
}
|
|
13351
|
-
/**
|
|
13352
|
-
* Performs clean up of the current data context if auto clean up is enabled.
|
|
13353
|
-
*/
|
|
13354
|
-
autoCleanUp() {
|
|
13355
|
-
if (this.cleanUp && this.dataContext) {
|
|
13356
|
-
this.logger.debug('Releasing DataContext resources to prevent memory leak. [cleanUp]="true"');
|
|
13357
|
-
this.dataContext.close();
|
|
13358
|
-
}
|
|
13359
|
-
}
|
|
13360
13332
|
}
|
|
13361
|
-
ElderTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableComponent, deps: [{ token: ElderTableModel }, { token: SelectionModel, optional: true }, { token:
|
|
13362
|
-
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",
|
|
13333
|
+
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 });
|
|
13334
|
+
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: [
|
|
13363
13335
|
ElderTableProviders.ExistingOrNewTableModel,
|
|
13364
13336
|
{
|
|
13365
13337
|
provide: ELDER_DATA_VIEW,
|
|
@@ -13378,7 +13350,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
13378
13350
|
}], ctorParameters: function () {
|
|
13379
13351
|
return [{ type: ElderTableModel }, { type: SelectionModel, decorators: [{
|
|
13380
13352
|
type: Optional
|
|
13381
|
-
}] }, { type:
|
|
13353
|
+
}] }, { type: ElderDataViewOptionsProvider, decorators: [{
|
|
13382
13354
|
type: Optional
|
|
13383
13355
|
}, {
|
|
13384
13356
|
type: SkipSelf
|
|
@@ -13412,8 +13384,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
13412
13384
|
type: Input
|
|
13413
13385
|
}], pageSizeOptions: [{
|
|
13414
13386
|
type: Input
|
|
13415
|
-
}], cleanUp: [{
|
|
13416
|
-
type: Input
|
|
13417
13387
|
}], keepSelection: [{
|
|
13418
13388
|
type: Input
|
|
13419
13389
|
}], showFooter: [{
|
|
@@ -13704,9 +13674,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
13704
13674
|
*
|
|
13705
13675
|
* Example Usage:
|
|
13706
13676
|
*
|
|
13707
|
-
*
|
|
13708
|
-
*
|
|
13709
|
-
*
|
|
13677
|
+
* <mat-form-field elderFormFieldLabel>
|
|
13678
|
+
* <input matInput placeholder="Readonly Input" readonly="true" value="Some Value">
|
|
13679
|
+
* </mat-form-field>
|
|
13710
13680
|
*
|
|
13711
13681
|
*/
|
|
13712
13682
|
class ElderFormFieldLabelDirective {
|
|
@@ -13718,6 +13688,20 @@ class ElderFormFieldLabelDirective {
|
|
|
13718
13688
|
constructor(_matFormField) {
|
|
13719
13689
|
this._matFormField = _matFormField;
|
|
13720
13690
|
}
|
|
13691
|
+
/***************************************************************************
|
|
13692
|
+
* *
|
|
13693
|
+
* Host Bindings *
|
|
13694
|
+
* *
|
|
13695
|
+
**************************************************************************/
|
|
13696
|
+
get getFormFieldLabelStyle() {
|
|
13697
|
+
return this.isLabelMode();
|
|
13698
|
+
}
|
|
13699
|
+
/***************************************************************************
|
|
13700
|
+
* *
|
|
13701
|
+
* Properties *
|
|
13702
|
+
* *
|
|
13703
|
+
**************************************************************************/
|
|
13704
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
13721
13705
|
set enabled(enabled) {
|
|
13722
13706
|
this._enabled = coerceBooleanProperty(enabled);
|
|
13723
13707
|
}
|
|
@@ -13729,12 +13713,12 @@ class ElderFormFieldLabelDirective {
|
|
|
13729
13713
|
* Public API *
|
|
13730
13714
|
* *
|
|
13731
13715
|
**************************************************************************/
|
|
13732
|
-
|
|
13716
|
+
isControlReadonly() {
|
|
13733
13717
|
const ctrl = this._matFormField._control;
|
|
13734
|
-
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
return
|
|
13718
|
+
return ctrl === null || ctrl === void 0 ? void 0 : ctrl.readonly;
|
|
13719
|
+
}
|
|
13720
|
+
isLabelMode() {
|
|
13721
|
+
return this.enabled && this.isControlReadonly();
|
|
13738
13722
|
}
|
|
13739
13723
|
/***************************************************************************
|
|
13740
13724
|
* *
|
|
@@ -13742,22 +13726,22 @@ class ElderFormFieldLabelDirective {
|
|
|
13742
13726
|
* *
|
|
13743
13727
|
**************************************************************************/
|
|
13744
13728
|
ngAfterViewInit() {
|
|
13745
|
-
if (this.
|
|
13729
|
+
if (this.isLabelMode()) {
|
|
13746
13730
|
this._matFormField.floatLabel = 'always';
|
|
13747
13731
|
}
|
|
13748
13732
|
}
|
|
13749
13733
|
}
|
|
13750
13734
|
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 });
|
|
13751
|
-
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": "
|
|
13735
|
+
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 });
|
|
13752
13736
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderFormFieldLabelDirective, decorators: [{
|
|
13753
13737
|
type: Directive,
|
|
13754
13738
|
args: [{
|
|
13755
|
-
selector: 'mat-form-field[elderFormFieldLabel]'
|
|
13756
|
-
host: {
|
|
13757
|
-
'[class.elder-form-field-label]': 'enabled && isReadonlyInput()'
|
|
13758
|
-
}
|
|
13739
|
+
selector: 'mat-form-field[elderFormFieldLabel]'
|
|
13759
13740
|
}]
|
|
13760
|
-
}], ctorParameters: function () { return [{ type: i4$1.MatFormField }]; }, propDecorators: {
|
|
13741
|
+
}], ctorParameters: function () { return [{ type: i4$1.MatFormField }]; }, propDecorators: { getFormFieldLabelStyle: [{
|
|
13742
|
+
type: HostBinding,
|
|
13743
|
+
args: ['class.elder-form-field-label']
|
|
13744
|
+
}], enabled: [{
|
|
13761
13745
|
type: Input,
|
|
13762
13746
|
args: ['elderFormFieldLabel']
|
|
13763
13747
|
}] } });
|
|
@@ -15278,8 +15262,8 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15278
15262
|
* Constructor *
|
|
15279
15263
|
* *
|
|
15280
15264
|
**************************************************************************/
|
|
15281
|
-
constructor(selectionModel,
|
|
15282
|
-
super(selectionModel,
|
|
15265
|
+
constructor(selectionModel, dataViewOptionsProvider, mediaObserver) {
|
|
15266
|
+
super(selectionModel, dataViewOptionsProvider);
|
|
15283
15267
|
this.mediaObserver = mediaObserver;
|
|
15284
15268
|
/***************************************************************************
|
|
15285
15269
|
* *
|
|
@@ -15312,7 +15296,6 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15312
15296
|
this.idField = 'id';
|
|
15313
15297
|
this.selectionVisible = true;
|
|
15314
15298
|
this.pageSizeOptions = [30, 50, 100, 150, 200];
|
|
15315
|
-
this.destroy$ = new Subject();
|
|
15316
15299
|
}
|
|
15317
15300
|
/***************************************************************************
|
|
15318
15301
|
* *
|
|
@@ -15320,6 +15303,7 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15320
15303
|
* *
|
|
15321
15304
|
**************************************************************************/
|
|
15322
15305
|
ngOnInit() {
|
|
15306
|
+
super.ngOnInit();
|
|
15323
15307
|
const columnCount$ = (this.responsiveColumnCount
|
|
15324
15308
|
? this.responsiveColumn()
|
|
15325
15309
|
: this._columnCount);
|
|
@@ -15327,16 +15311,6 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15327
15311
|
this.dataContext$.pipe(filter(dc => !!dc), switchMap(dc => dc.data)),
|
|
15328
15312
|
columnCount$
|
|
15329
15313
|
]).pipe(debounceTime(50), map(([data, columns]) => this.groupForColumns(data, columns)));
|
|
15330
|
-
if (this.dataViewSelection) {
|
|
15331
|
-
this.selectionVisible = true;
|
|
15332
|
-
this.selectionMultiEnabled = this.dataViewSelection.multi;
|
|
15333
|
-
this.float = false;
|
|
15334
|
-
const dataContext = this.dataContext$.getValue();
|
|
15335
|
-
if (dataContext) {
|
|
15336
|
-
dataContext.filter.updateFilters(this.dataViewSelection.filters);
|
|
15337
|
-
dataContext.sort.updateSorts(this.dataViewSelection.sorts);
|
|
15338
|
-
}
|
|
15339
|
-
}
|
|
15340
15314
|
}
|
|
15341
15315
|
ngAfterViewInit() {
|
|
15342
15316
|
MatTableDataContextBindingBuilder
|
|
@@ -15344,10 +15318,6 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15344
15318
|
.withPaginator(of(this.matPaginator))
|
|
15345
15319
|
.bindUntil(this.destroy$);
|
|
15346
15320
|
}
|
|
15347
|
-
ngOnDestroy() {
|
|
15348
|
-
this.destroy$.next();
|
|
15349
|
-
this.destroy$.complete();
|
|
15350
|
-
}
|
|
15351
15321
|
/***************************************************************************
|
|
15352
15322
|
* *
|
|
15353
15323
|
* Properties *
|
|
@@ -15462,7 +15432,7 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15462
15432
|
return this.mediaObserver.asObservable().pipe(filter(changes => changes.length > 0), map(changes => this.sizeToColumns.get(changes[0].mqAlias)), debounceTime(150), startWith(start));
|
|
15463
15433
|
}
|
|
15464
15434
|
}
|
|
15465
|
-
ElderGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderGridComponent, deps: [{ token: SelectionModel, optional: true }, { token:
|
|
15435
|
+
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 });
|
|
15466
15436
|
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: [
|
|
15467
15437
|
{
|
|
15468
15438
|
provide: ELDER_DATA_VIEW,
|
|
@@ -15480,7 +15450,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
15480
15450
|
}], ctorParameters: function () {
|
|
15481
15451
|
return [{ type: SelectionModel, decorators: [{
|
|
15482
15452
|
type: Optional
|
|
15483
|
-
}] }, { type:
|
|
15453
|
+
}] }, { type: ElderDataViewOptionsProvider, decorators: [{
|
|
15484
15454
|
type: Optional
|
|
15485
15455
|
}, {
|
|
15486
15456
|
type: SkipSelf
|
|
@@ -18806,7 +18776,7 @@ class ElderLocalizedInputTableComponent extends FormFieldBaseComponent {
|
|
|
18806
18776
|
}
|
|
18807
18777
|
}
|
|
18808
18778
|
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 });
|
|
18809
|
-
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", "
|
|
18779
|
+
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 });
|
|
18810
18780
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderLocalizedInputTableComponent, decorators: [{
|
|
18811
18781
|
type: Component,
|
|
18812
18782
|
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" }]
|
|
@@ -21272,12 +21242,162 @@ class ElderSelectValueDirective {
|
|
|
21272
21242
|
this.viewContainer = viewContainer;
|
|
21273
21243
|
}
|
|
21274
21244
|
}
|
|
21275
|
-
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 });
|
|
21276
|
-
ElderSelectValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectValueDirective, selector: "[elderSelectValue]", ngImport: i0 });
|
|
21277
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectValueDirective, decorators: [{
|
|
21245
|
+
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 });
|
|
21246
|
+
ElderSelectValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectValueDirective, selector: "[elderSelectValue]", ngImport: i0 });
|
|
21247
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectValueDirective, decorators: [{
|
|
21248
|
+
type: Directive,
|
|
21249
|
+
args: [{ selector: '[elderSelectValue]' }]
|
|
21250
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
|
|
21251
|
+
|
|
21252
|
+
class TemplatedSelectionDialogComponent {
|
|
21253
|
+
/***************************************************************************
|
|
21254
|
+
* *
|
|
21255
|
+
* Constructor *
|
|
21256
|
+
* *
|
|
21257
|
+
**************************************************************************/
|
|
21258
|
+
constructor(dialogRef, data, selectionModel) {
|
|
21259
|
+
this.dialogRef = dialogRef;
|
|
21260
|
+
this.data = data;
|
|
21261
|
+
this.selectionModel = selectionModel;
|
|
21262
|
+
/***************************************************************************
|
|
21263
|
+
* *
|
|
21264
|
+
* Fields *
|
|
21265
|
+
* *
|
|
21266
|
+
**************************************************************************/
|
|
21267
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
21268
|
+
}
|
|
21269
|
+
/***************************************************************************
|
|
21270
|
+
* *
|
|
21271
|
+
* Component Events *
|
|
21272
|
+
* *
|
|
21273
|
+
**************************************************************************/
|
|
21274
|
+
ngOnInit() {
|
|
21275
|
+
}
|
|
21276
|
+
}
|
|
21277
|
+
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 });
|
|
21278
|
+
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 });
|
|
21279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: TemplatedSelectionDialogComponent, decorators: [{
|
|
21280
|
+
type: Component,
|
|
21281
|
+
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" }]
|
|
21282
|
+
}], ctorParameters: function () {
|
|
21283
|
+
return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
21284
|
+
type: Inject,
|
|
21285
|
+
args: [MAT_DIALOG_DATA]
|
|
21286
|
+
}] }, { type: SelectionModel }];
|
|
21287
|
+
} });
|
|
21288
|
+
|
|
21289
|
+
function createSelectionModel$1() {
|
|
21290
|
+
return new SelectionModel();
|
|
21291
|
+
}
|
|
21292
|
+
function createDataViewOptionsProvider() {
|
|
21293
|
+
return new ElderDataViewOptionsProvider();
|
|
21294
|
+
}
|
|
21295
|
+
class SelectionModelPopupDirective {
|
|
21296
|
+
/***************************************************************************
|
|
21297
|
+
* *
|
|
21298
|
+
* Constructor *
|
|
21299
|
+
* *
|
|
21300
|
+
**************************************************************************/
|
|
21301
|
+
constructor(templateRef, viewContainer, dialog, dataViewOptionsProvider, selectionModel, changeDetectorRef) {
|
|
21302
|
+
this.templateRef = templateRef;
|
|
21303
|
+
this.viewContainer = viewContainer;
|
|
21304
|
+
this.dialog = dialog;
|
|
21305
|
+
this.dataViewOptionsProvider = dataViewOptionsProvider;
|
|
21306
|
+
this.selectionModel = selectionModel;
|
|
21307
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
21308
|
+
/***************************************************************************
|
|
21309
|
+
* *
|
|
21310
|
+
* Fields *
|
|
21311
|
+
* *
|
|
21312
|
+
**************************************************************************/
|
|
21313
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
21314
|
+
}
|
|
21315
|
+
set elderSelectionModelPopupTransform(fn) {
|
|
21316
|
+
this._transformerFn = fn;
|
|
21317
|
+
}
|
|
21318
|
+
/***************************************************************************
|
|
21319
|
+
* *
|
|
21320
|
+
* Public API *
|
|
21321
|
+
* *
|
|
21322
|
+
**************************************************************************/
|
|
21323
|
+
/**
|
|
21324
|
+
* Let the user choose some entities and return the selection.
|
|
21325
|
+
*/
|
|
21326
|
+
choose(keyGetter, currentSelection, filters, sorts, multi = false) {
|
|
21327
|
+
this.dataViewOptionsProvider.updateOptions(options => options
|
|
21328
|
+
.withFilters(filters || [])
|
|
21329
|
+
.withSorts(sorts || [])
|
|
21330
|
+
.withSelectionMultiEnabled(multi));
|
|
21331
|
+
this.selectionModel.isMultipleSelection = multi;
|
|
21332
|
+
this.selectionModel.keyGetterFn = keyGetter;
|
|
21333
|
+
this.selectionModel.replaceSelection(currentSelection);
|
|
21334
|
+
this.log.info('Replaced selection popup with current ' + currentSelection.length + ' entities:', currentSelection);
|
|
21335
|
+
const dialogRef = this.openSelectDialog();
|
|
21336
|
+
// This fixes dialog rendering when the browser template
|
|
21337
|
+
// view container is outside the invoking control, which
|
|
21338
|
+
// happens when using ng-content projection.
|
|
21339
|
+
this.changeDetectorRef.markForCheck();
|
|
21340
|
+
return dialogRef.afterClosed().pipe(switchMap((chosenEntities) => {
|
|
21341
|
+
if (chosenEntities) {
|
|
21342
|
+
return this._transformerFn
|
|
21343
|
+
? of(chosenEntities.map(value => this._transformerFn(value)))
|
|
21344
|
+
: of(chosenEntities);
|
|
21345
|
+
}
|
|
21346
|
+
else {
|
|
21347
|
+
return EMPTY;
|
|
21348
|
+
}
|
|
21349
|
+
}));
|
|
21350
|
+
}
|
|
21351
|
+
/***************************************************************************
|
|
21352
|
+
* *
|
|
21353
|
+
* Private methods *
|
|
21354
|
+
* *
|
|
21355
|
+
**************************************************************************/
|
|
21356
|
+
openSelectDialog() {
|
|
21357
|
+
return this.dialog.open(TemplatedSelectionDialogComponent, {
|
|
21358
|
+
width: '90vw',
|
|
21359
|
+
height: '90vh',
|
|
21360
|
+
panelClass: 'custom-dialog-container',
|
|
21361
|
+
data: {
|
|
21362
|
+
selectionComponentTemplate: this.templateRef
|
|
21363
|
+
},
|
|
21364
|
+
viewContainerRef: this.viewContainer
|
|
21365
|
+
});
|
|
21366
|
+
}
|
|
21367
|
+
}
|
|
21368
|
+
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 });
|
|
21369
|
+
SelectionModelPopupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: SelectionModelPopupDirective, selector: "[elderSelectionModelPopup]", inputs: { elderSelectionModelPopupTransform: "elderSelectionModelPopupTransform" }, providers: [
|
|
21370
|
+
{
|
|
21371
|
+
provide: SelectionModel,
|
|
21372
|
+
useFactory: createSelectionModel$1
|
|
21373
|
+
},
|
|
21374
|
+
{
|
|
21375
|
+
provide: ElderDataViewOptionsProvider,
|
|
21376
|
+
useFactory: createDataViewOptionsProvider
|
|
21377
|
+
},
|
|
21378
|
+
ElderTableProviders.ClearTableModel // Since this popup is frequently used inside an elder-table search box
|
|
21379
|
+
], exportAs: ["elderSelectionModelPopup"], ngImport: i0 });
|
|
21380
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SelectionModelPopupDirective, decorators: [{
|
|
21278
21381
|
type: Directive,
|
|
21279
|
-
args: [{
|
|
21280
|
-
|
|
21382
|
+
args: [{
|
|
21383
|
+
selector: '[elderSelectionModelPopup]',
|
|
21384
|
+
exportAs: 'elderSelectionModelPopup',
|
|
21385
|
+
providers: [
|
|
21386
|
+
{
|
|
21387
|
+
provide: SelectionModel,
|
|
21388
|
+
useFactory: createSelectionModel$1
|
|
21389
|
+
},
|
|
21390
|
+
{
|
|
21391
|
+
provide: ElderDataViewOptionsProvider,
|
|
21392
|
+
useFactory: createDataViewOptionsProvider
|
|
21393
|
+
},
|
|
21394
|
+
ElderTableProviders.ClearTableModel // Since this popup is frequently used inside an elder-table search box
|
|
21395
|
+
]
|
|
21396
|
+
}]
|
|
21397
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i1$7.MatDialog }, { type: ElderDataViewOptionsProvider }, { type: SelectionModel }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { elderSelectionModelPopupTransform: [{
|
|
21398
|
+
type: Input,
|
|
21399
|
+
args: ['elderSelectionModelPopupTransform']
|
|
21400
|
+
}] } });
|
|
21281
21401
|
|
|
21282
21402
|
class ElderSelectComponentState {
|
|
21283
21403
|
constructor(idle, loading, error) {
|
|
@@ -25188,13 +25308,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
25188
25308
|
}]
|
|
25189
25309
|
}] });
|
|
25190
25310
|
|
|
25311
|
+
class TypedEventMessage {
|
|
25312
|
+
constructor(type, data) {
|
|
25313
|
+
this.type = type;
|
|
25314
|
+
this.data = data;
|
|
25315
|
+
}
|
|
25316
|
+
// type predicate to check weather an object is a DataViewMessage type
|
|
25317
|
+
static isOfType(obj) {
|
|
25318
|
+
return obj.type !== undefined
|
|
25319
|
+
&& obj.data !== undefined;
|
|
25320
|
+
}
|
|
25321
|
+
}
|
|
25322
|
+
class DataViewSelectionInit {
|
|
25323
|
+
constructor(options, initialSelection = [], idField = 'id') {
|
|
25324
|
+
this.options = options;
|
|
25325
|
+
this.initialSelection = initialSelection;
|
|
25326
|
+
this.idField = idField;
|
|
25327
|
+
}
|
|
25328
|
+
}
|
|
25329
|
+
class DataViewSelection {
|
|
25330
|
+
constructor(selection) {
|
|
25331
|
+
this.selection = selection;
|
|
25332
|
+
}
|
|
25333
|
+
}
|
|
25334
|
+
class DataViewMessage extends TypedEventMessage {
|
|
25335
|
+
constructor(type, data) {
|
|
25336
|
+
super(type, data);
|
|
25337
|
+
this.type = type;
|
|
25338
|
+
this.data = data;
|
|
25339
|
+
}
|
|
25340
|
+
static initialSelection(init) {
|
|
25341
|
+
return new DataViewMessage('SELECTION_INIT', init);
|
|
25342
|
+
}
|
|
25343
|
+
static selection(selection) {
|
|
25344
|
+
return new DataViewMessage('SELECTION_SELECTED', selection);
|
|
25345
|
+
}
|
|
25346
|
+
// type predicate to check weather an object is a DataViewMessage type
|
|
25347
|
+
static isOfType(obj) {
|
|
25348
|
+
return obj.type !== undefined
|
|
25349
|
+
&& obj.data !== undefined;
|
|
25350
|
+
}
|
|
25351
|
+
}
|
|
25352
|
+
|
|
25191
25353
|
class IFrameState {
|
|
25192
|
-
constructor(
|
|
25193
|
-
this.
|
|
25354
|
+
constructor(type, message = null) {
|
|
25355
|
+
this.type = type;
|
|
25194
25356
|
this.message = message;
|
|
25195
25357
|
}
|
|
25358
|
+
get isLoading() {
|
|
25359
|
+
return this.type === 'LOADING';
|
|
25360
|
+
}
|
|
25361
|
+
get hasLoaded() {
|
|
25362
|
+
return this.type == 'LOADED';
|
|
25363
|
+
}
|
|
25196
25364
|
get hasError() {
|
|
25197
|
-
return this.
|
|
25365
|
+
return this.type === 'ERROR';
|
|
25198
25366
|
}
|
|
25199
25367
|
}
|
|
25200
25368
|
class IframeHostComponent {
|
|
@@ -25209,24 +25377,37 @@ class IframeHostComponent {
|
|
|
25209
25377
|
* Fields *
|
|
25210
25378
|
* *
|
|
25211
25379
|
**************************************************************************/
|
|
25212
|
-
this.
|
|
25380
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
25213
25381
|
this.iframeParams$ = new BehaviorSubject(null);
|
|
25214
|
-
this.iframeState$ = new BehaviorSubject(new IFrameState('
|
|
25215
|
-
this.
|
|
25382
|
+
this.iframeState$ = new BehaviorSubject(new IFrameState('LOADING'));
|
|
25383
|
+
this.message = new EventEmitter();
|
|
25216
25384
|
this.close = new EventEmitter();
|
|
25217
25385
|
}
|
|
25218
25386
|
/***************************************************************************
|
|
25219
25387
|
* *
|
|
25220
|
-
*
|
|
25388
|
+
* Listeners *
|
|
25221
25389
|
* *
|
|
25222
25390
|
**************************************************************************/
|
|
25223
|
-
|
|
25224
|
-
|
|
25225
|
-
|
|
25226
|
-
|
|
25227
|
-
|
|
25391
|
+
/**
|
|
25392
|
+
* Listens for messages from window.
|
|
25393
|
+
* Makes it possible to react upon messages from iframe child window.
|
|
25394
|
+
*
|
|
25395
|
+
* @param event message from child window
|
|
25396
|
+
*/
|
|
25397
|
+
onWindowMessage(event) {
|
|
25398
|
+
this.log.debug('Received message from child:', event);
|
|
25399
|
+
if (event) {
|
|
25400
|
+
if (TypedEventMessage.isOfType(event.data))
|
|
25401
|
+
this.handleMessageFromChild(event.data);
|
|
25402
|
+
}
|
|
25228
25403
|
return true;
|
|
25229
25404
|
}
|
|
25405
|
+
/***************************************************************************
|
|
25406
|
+
* *
|
|
25407
|
+
* Lifecycle *
|
|
25408
|
+
* *
|
|
25409
|
+
**************************************************************************/
|
|
25410
|
+
ngOnInit() { }
|
|
25230
25411
|
/***************************************************************************
|
|
25231
25412
|
* *
|
|
25232
25413
|
* Properties *
|
|
@@ -25240,9 +25421,17 @@ class IframeHostComponent {
|
|
|
25240
25421
|
* Public API *
|
|
25241
25422
|
* *
|
|
25242
25423
|
**************************************************************************/
|
|
25243
|
-
|
|
25244
|
-
this.
|
|
25245
|
-
this.iframeState$.next(new IFrameState('
|
|
25424
|
+
onIframeLoadEvent(event) {
|
|
25425
|
+
this.log.debug('Finished loading iframe', event);
|
|
25426
|
+
this.iframeState$.next(new IFrameState('LOADED'));
|
|
25427
|
+
}
|
|
25428
|
+
onIframeErrorEvent(err) {
|
|
25429
|
+
this.log.warn('Failed to load iframe', err);
|
|
25430
|
+
this.iframeState$.next(new IFrameState('ERROR', err + ''));
|
|
25431
|
+
}
|
|
25432
|
+
sendMessageToChild(msg) {
|
|
25433
|
+
this.log.debug('Sending message to iframe child:', msg);
|
|
25434
|
+
this.iframe.nativeElement.contentWindow.postMessage(msg, "*");
|
|
25246
25435
|
}
|
|
25247
25436
|
doClose(event) {
|
|
25248
25437
|
this.close.emit();
|
|
@@ -25252,28 +25441,26 @@ class IframeHostComponent {
|
|
|
25252
25441
|
* Private methods *
|
|
25253
25442
|
* *
|
|
25254
25443
|
**************************************************************************/
|
|
25255
|
-
|
|
25256
|
-
this.
|
|
25257
|
-
|
|
25258
|
-
|
|
25259
|
-
this.post.emit(message.data);
|
|
25260
|
-
break;
|
|
25261
|
-
case 'CLOSE':
|
|
25262
|
-
this.close.emit(message.data);
|
|
25263
|
-
break;
|
|
25444
|
+
handleMessageFromChild(message) {
|
|
25445
|
+
this.message.next(message);
|
|
25446
|
+
if (message.type === 'CLOSE') {
|
|
25447
|
+
this.close.emit(message.data);
|
|
25264
25448
|
}
|
|
25265
25449
|
}
|
|
25266
25450
|
}
|
|
25267
25451
|
IframeHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25268
|
-
IframeHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: { iframeParams: "iframeParams" }, outputs: {
|
|
25452
|
+
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 });
|
|
25269
25453
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeHostComponent, decorators: [{
|
|
25270
25454
|
type: Component,
|
|
25271
|
-
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)=\"
|
|
25272
|
-
}], ctorParameters: function () { return []; }, propDecorators: {
|
|
25455
|
+
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"] }]
|
|
25456
|
+
}], ctorParameters: function () { return []; }, propDecorators: { iframe: [{
|
|
25457
|
+
type: ViewChild,
|
|
25458
|
+
args: ['iframe']
|
|
25459
|
+
}], message: [{
|
|
25273
25460
|
type: Output
|
|
25274
25461
|
}], close: [{
|
|
25275
25462
|
type: Output
|
|
25276
|
-
}],
|
|
25463
|
+
}], onWindowMessage: [{
|
|
25277
25464
|
type: HostListener,
|
|
25278
25465
|
args: ['window:message', ['$event']]
|
|
25279
25466
|
}], iframeParams: [{
|
|
@@ -25314,7 +25501,7 @@ class IframeDialogComponent {
|
|
|
25314
25501
|
}
|
|
25315
25502
|
}
|
|
25316
25503
|
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 });
|
|
25317
|
-
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: ["
|
|
25504
|
+
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 });
|
|
25318
25505
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeDialogComponent, decorators: [{
|
|
25319
25506
|
type: Component,
|
|
25320
25507
|
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" }]
|
|
@@ -25388,7 +25575,7 @@ class IframeSideContentComponent {
|
|
|
25388
25575
|
IframeSideContentComponent.QUERY_PARAM_SRC_URL = 'srcUrl';
|
|
25389
25576
|
IframeSideContentComponent.QUERY_PARAM_WIDTH = 'width';
|
|
25390
25577
|
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 });
|
|
25391
|
-
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: ["
|
|
25578
|
+
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 });
|
|
25392
25579
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeSideContentComponent, decorators: [{
|
|
25393
25580
|
type: Component,
|
|
25394
25581
|
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" }]
|
|
@@ -25423,7 +25610,7 @@ class IframeService {
|
|
|
25423
25610
|
}
|
|
25424
25611
|
postCloseMessage(data) {
|
|
25425
25612
|
IframeService.postToParent({
|
|
25426
|
-
|
|
25613
|
+
type: 'CLOSE',
|
|
25427
25614
|
data: data
|
|
25428
25615
|
});
|
|
25429
25616
|
}
|
|
@@ -25477,13 +25664,252 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
25477
25664
|
['$event']]
|
|
25478
25665
|
}] } });
|
|
25479
25666
|
|
|
25667
|
+
/**
|
|
25668
|
+
* Container for displaying a remote data view in an iframe.
|
|
25669
|
+
* Provides capabilities to communicate between remote data view (child)
|
|
25670
|
+
* and iframe parent.
|
|
25671
|
+
*/
|
|
25672
|
+
class DataViewIframeComponent {
|
|
25673
|
+
/***************************************************************************
|
|
25674
|
+
* *
|
|
25675
|
+
* Constructor *
|
|
25676
|
+
* *
|
|
25677
|
+
**************************************************************************/
|
|
25678
|
+
constructor(selectionModel) {
|
|
25679
|
+
this.selectionModel = selectionModel;
|
|
25680
|
+
/***************************************************************************
|
|
25681
|
+
* *
|
|
25682
|
+
* Fields *
|
|
25683
|
+
* *
|
|
25684
|
+
**************************************************************************/
|
|
25685
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
25686
|
+
this._dataViewOptions$ = new BehaviorSubject(null);
|
|
25687
|
+
this._destroy$ = new Subject();
|
|
25688
|
+
}
|
|
25689
|
+
/***************************************************************************
|
|
25690
|
+
* *
|
|
25691
|
+
* Life Cycle *
|
|
25692
|
+
* *
|
|
25693
|
+
**************************************************************************/
|
|
25694
|
+
ngOnInit() {
|
|
25695
|
+
}
|
|
25696
|
+
ngAfterViewInit() {
|
|
25697
|
+
// iframe is only available after view init
|
|
25698
|
+
this.setupDataViewOptionsBridge(this.iframeHost);
|
|
25699
|
+
}
|
|
25700
|
+
ngOnDestroy() {
|
|
25701
|
+
this._destroy$.next();
|
|
25702
|
+
this._destroy$.complete();
|
|
25703
|
+
}
|
|
25704
|
+
/***************************************************************************
|
|
25705
|
+
* *
|
|
25706
|
+
* Properties *
|
|
25707
|
+
* *
|
|
25708
|
+
**************************************************************************/
|
|
25709
|
+
get dataViewOptions() {
|
|
25710
|
+
return this._dataViewOptions$.getValue();
|
|
25711
|
+
}
|
|
25712
|
+
set dataViewOptions(options) {
|
|
25713
|
+
this._dataViewOptions$.next(options);
|
|
25714
|
+
}
|
|
25715
|
+
get dataViewOptions$() {
|
|
25716
|
+
return this._dataViewOptions$.asObservable();
|
|
25717
|
+
}
|
|
25718
|
+
/***************************************************************************
|
|
25719
|
+
* *
|
|
25720
|
+
* Public API *
|
|
25721
|
+
* *
|
|
25722
|
+
**************************************************************************/
|
|
25723
|
+
onMessageFromChild(message) {
|
|
25724
|
+
if (DataViewMessage.isOfType(message)) {
|
|
25725
|
+
switch (message.type) {
|
|
25726
|
+
case 'SELECTION_SELECTED':
|
|
25727
|
+
this.handleSelectionMessage(message.data);
|
|
25728
|
+
break;
|
|
25729
|
+
}
|
|
25730
|
+
}
|
|
25731
|
+
}
|
|
25732
|
+
sendMessageToChild(message) {
|
|
25733
|
+
this.log.debug("Sending message to iframe child:", message);
|
|
25734
|
+
this.iframeHost.sendMessageToChild(message);
|
|
25735
|
+
}
|
|
25736
|
+
/***************************************************************************
|
|
25737
|
+
* *
|
|
25738
|
+
* Private Methods *
|
|
25739
|
+
* *
|
|
25740
|
+
**************************************************************************/
|
|
25741
|
+
handleSelectionMessage(dataViewSelection) {
|
|
25742
|
+
if (this.selectionModel) {
|
|
25743
|
+
this.selectionModel.replaceSelection(dataViewSelection.selection);
|
|
25744
|
+
}
|
|
25745
|
+
}
|
|
25746
|
+
setupDataViewOptionsBridge(iframeHost) {
|
|
25747
|
+
combineLatest([
|
|
25748
|
+
this._dataViewOptions$,
|
|
25749
|
+
iframeHost.iframeState$
|
|
25750
|
+
]).pipe(takeUntil(this._destroy$), filter(([options, state]) => !!options && state.hasLoaded)).subscribe(([options, state]) => this.sendMessageToChild(this.buildDataViewInitMessage(options, this.initialSelection)));
|
|
25751
|
+
}
|
|
25752
|
+
buildDataViewInitMessage(options, initialSelection) {
|
|
25753
|
+
return DataViewMessage.initialSelection(new DataViewSelectionInit(options, initialSelection, this.idField));
|
|
25754
|
+
}
|
|
25755
|
+
}
|
|
25756
|
+
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 });
|
|
25757
|
+
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 });
|
|
25758
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataViewIframeComponent, decorators: [{
|
|
25759
|
+
type: Component,
|
|
25760
|
+
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" }]
|
|
25761
|
+
}], ctorParameters: function () {
|
|
25762
|
+
return [{ type: SelectionModel, decorators: [{
|
|
25763
|
+
type: Optional
|
|
25764
|
+
}] }];
|
|
25765
|
+
}, propDecorators: { srcUrl: [{
|
|
25766
|
+
type: Input
|
|
25767
|
+
}], idField: [{
|
|
25768
|
+
type: Input
|
|
25769
|
+
}], initialSelection: [{
|
|
25770
|
+
type: Input
|
|
25771
|
+
}], iframeHost: [{
|
|
25772
|
+
type: ViewChild,
|
|
25773
|
+
args: [IframeHostComponent]
|
|
25774
|
+
}], dataViewOptions: [{
|
|
25775
|
+
type: Input
|
|
25776
|
+
}] } });
|
|
25777
|
+
|
|
25778
|
+
function createSelectionModel() {
|
|
25779
|
+
return new SelectionModel();
|
|
25780
|
+
}
|
|
25781
|
+
function createDataOptionsProvider() {
|
|
25782
|
+
return new ElderDataViewOptionsProvider();
|
|
25783
|
+
}
|
|
25784
|
+
/**
|
|
25785
|
+
* An adapter bridging communication between
|
|
25786
|
+
* a data view displayed in an iframe and its parent.
|
|
25787
|
+
*
|
|
25788
|
+
* For example propagates selection model changes
|
|
25789
|
+
* to the iframe parent.
|
|
25790
|
+
*/
|
|
25791
|
+
class DataViewIframeAdapterDirective {
|
|
25792
|
+
/***************************************************************************
|
|
25793
|
+
* *
|
|
25794
|
+
* Constructor *
|
|
25795
|
+
* *
|
|
25796
|
+
**************************************************************************/
|
|
25797
|
+
constructor(iframeService, selectionModel, dataViewOptionsProvider) {
|
|
25798
|
+
this.iframeService = iframeService;
|
|
25799
|
+
this.selectionModel = selectionModel;
|
|
25800
|
+
this.dataViewOptionsProvider = dataViewOptionsProvider;
|
|
25801
|
+
/***************************************************************************
|
|
25802
|
+
* *
|
|
25803
|
+
* Fields *
|
|
25804
|
+
* *
|
|
25805
|
+
**************************************************************************/
|
|
25806
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
25807
|
+
this._destroy$ = new Subject();
|
|
25808
|
+
selectionModel.selection.pipe(takeUntil(this._destroy$)).subscribe(selection => this.propagateSelectionToParent(selection));
|
|
25809
|
+
}
|
|
25810
|
+
/***************************************************************************
|
|
25811
|
+
* *
|
|
25812
|
+
* Listeners *
|
|
25813
|
+
* *
|
|
25814
|
+
**************************************************************************/
|
|
25815
|
+
/**
|
|
25816
|
+
* Listens for messages from parent window.
|
|
25817
|
+
* Makes it possible to react upon messages from iframe parent.
|
|
25818
|
+
*
|
|
25819
|
+
* @param event message from parent window
|
|
25820
|
+
*/
|
|
25821
|
+
onWindowsMessage(event) {
|
|
25822
|
+
this.log.debug('Received message event from parent:', event);
|
|
25823
|
+
if (event) {
|
|
25824
|
+
if (DataViewMessage.isOfType(event.data)) {
|
|
25825
|
+
this.log.debug('Received data view message from parent:', event);
|
|
25826
|
+
this.handleMessageFromParent(event.data);
|
|
25827
|
+
}
|
|
25828
|
+
}
|
|
25829
|
+
return true;
|
|
25830
|
+
}
|
|
25831
|
+
/***************************************************************************
|
|
25832
|
+
* *
|
|
25833
|
+
* Life Cycle *
|
|
25834
|
+
* *
|
|
25835
|
+
**************************************************************************/
|
|
25836
|
+
ngOnInit() {
|
|
25837
|
+
}
|
|
25838
|
+
ngOnDestroy() {
|
|
25839
|
+
this._destroy$.next();
|
|
25840
|
+
this._destroy$.complete();
|
|
25841
|
+
}
|
|
25842
|
+
/***************************************************************************
|
|
25843
|
+
* *
|
|
25844
|
+
* Private Methods *
|
|
25845
|
+
* *
|
|
25846
|
+
**************************************************************************/
|
|
25847
|
+
handleMessageFromParent(message) {
|
|
25848
|
+
switch (message.type) {
|
|
25849
|
+
case 'SELECTION_INIT':
|
|
25850
|
+
this.initializeDataView(message.data);
|
|
25851
|
+
break;
|
|
25852
|
+
}
|
|
25853
|
+
}
|
|
25854
|
+
initializeDataView(init) {
|
|
25855
|
+
this.dataViewOptionsProvider.updateOptions(options => options
|
|
25856
|
+
.withSorts(init.options.sorts)
|
|
25857
|
+
.withFilters(init.options.filters));
|
|
25858
|
+
this.selectionModel.keyGetterFn = (entity) => entity[init.idField];
|
|
25859
|
+
this.selectionModel.isMultipleSelection = init.options.selectionMultiEnabled;
|
|
25860
|
+
if (init.initialSelection) {
|
|
25861
|
+
this.selectionModel.replaceSelection(init.initialSelection);
|
|
25862
|
+
}
|
|
25863
|
+
}
|
|
25864
|
+
propagateSelectionToParent(selection) {
|
|
25865
|
+
this.log.debug('Propagating selection to iframe parent:', selection);
|
|
25866
|
+
const message = this.buildSelectionMessage(selection);
|
|
25867
|
+
this.iframeService.postDataMessage(message);
|
|
25868
|
+
}
|
|
25869
|
+
buildSelectionMessage(selection) {
|
|
25870
|
+
return DataViewMessage.selection(new DataViewSelection(selection));
|
|
25871
|
+
}
|
|
25872
|
+
}
|
|
25873
|
+
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 });
|
|
25874
|
+
DataViewIframeAdapterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: DataViewIframeAdapterDirective, selector: "[elderDataViewIframeAdapter]", host: { listeners: { "window:message": "onWindowsMessage($event)" } }, providers: [
|
|
25875
|
+
{
|
|
25876
|
+
provide: SelectionModel,
|
|
25877
|
+
useFactory: createSelectionModel
|
|
25878
|
+
},
|
|
25879
|
+
{
|
|
25880
|
+
provide: ElderDataViewOptionsProvider,
|
|
25881
|
+
useFactory: createDataOptionsProvider
|
|
25882
|
+
}
|
|
25883
|
+
], ngImport: i0 });
|
|
25884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataViewIframeAdapterDirective, decorators: [{
|
|
25885
|
+
type: Directive,
|
|
25886
|
+
args: [{
|
|
25887
|
+
selector: '[elderDataViewIframeAdapter]',
|
|
25888
|
+
providers: [
|
|
25889
|
+
{
|
|
25890
|
+
provide: SelectionModel,
|
|
25891
|
+
useFactory: createSelectionModel
|
|
25892
|
+
},
|
|
25893
|
+
{
|
|
25894
|
+
provide: ElderDataViewOptionsProvider,
|
|
25895
|
+
useFactory: createDataOptionsProvider
|
|
25896
|
+
}
|
|
25897
|
+
]
|
|
25898
|
+
}]
|
|
25899
|
+
}], ctorParameters: function () { return [{ type: IframeService }, { type: SelectionModel }, { type: ElderDataViewOptionsProvider }]; }, propDecorators: { onWindowsMessage: [{
|
|
25900
|
+
type: HostListener,
|
|
25901
|
+
args: ['window:message', ['$event']]
|
|
25902
|
+
}] } });
|
|
25903
|
+
|
|
25480
25904
|
class ElderIFrameModule {
|
|
25481
25905
|
}
|
|
25482
25906
|
ElderIFrameModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderIFrameModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
25483
25907
|
ElderIFrameModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderIFrameModule, declarations: [IframeHostComponent,
|
|
25484
25908
|
IframeDialogComponent,
|
|
25485
25909
|
IframeSideContentComponent,
|
|
25486
|
-
IframeCloseDirective
|
|
25910
|
+
IframeCloseDirective,
|
|
25911
|
+
DataViewIframeComponent,
|
|
25912
|
+
DataViewIframeAdapterDirective], imports: [
|
|
25487
25913
|
// Angular
|
|
25488
25914
|
CommonModule,
|
|
25489
25915
|
RouterModule,
|
|
@@ -25499,7 +25925,9 @@ ElderIFrameModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versi
|
|
|
25499
25925
|
], exports: [IframeHostComponent,
|
|
25500
25926
|
IframeDialogComponent,
|
|
25501
25927
|
IframeSideContentComponent,
|
|
25502
|
-
IframeCloseDirective
|
|
25928
|
+
IframeCloseDirective,
|
|
25929
|
+
DataViewIframeComponent,
|
|
25930
|
+
DataViewIframeAdapterDirective] });
|
|
25503
25931
|
ElderIFrameModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderIFrameModule, imports: [
|
|
25504
25932
|
// Angular
|
|
25505
25933
|
CommonModule,
|
|
@@ -25535,13 +25963,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
25535
25963
|
IframeHostComponent,
|
|
25536
25964
|
IframeDialogComponent,
|
|
25537
25965
|
IframeSideContentComponent,
|
|
25538
|
-
IframeCloseDirective
|
|
25966
|
+
IframeCloseDirective,
|
|
25967
|
+
DataViewIframeComponent,
|
|
25968
|
+
DataViewIframeAdapterDirective
|
|
25539
25969
|
],
|
|
25540
25970
|
exports: [
|
|
25541
25971
|
IframeHostComponent,
|
|
25542
25972
|
IframeDialogComponent,
|
|
25543
25973
|
IframeSideContentComponent,
|
|
25544
|
-
IframeCloseDirective
|
|
25974
|
+
IframeCloseDirective,
|
|
25975
|
+
DataViewIframeComponent,
|
|
25976
|
+
DataViewIframeAdapterDirective
|
|
25545
25977
|
]
|
|
25546
25978
|
}]
|
|
25547
25979
|
}] });
|
|
@@ -26680,5 +27112,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
26680
27112
|
* Generated bundle index. Do not edit.
|
|
26681
27113
|
*/
|
|
26682
27114
|
|
|
26683
|
-
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,
|
|
27115
|
+
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 };
|
|
26684
27116
|
//# sourceMappingURL=elderbyte-ngx-starter.mjs.map
|