@elderbyte/ngx-starter 14.4.0-beta.18 → 14.4.0-beta.19
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/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 +1764 -1346
- package/fesm2015/elderbyte-ngx-starter.mjs.map +1 -1
- package/fesm2020/elderbyte-ngx-starter.mjs +1784 -1368
- 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/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
|
@@ -10949,383 +10949,200 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
10949
10949
|
|
|
10950
10950
|
const ELDER_DATA_VIEW = new InjectionToken('Elder Data View');
|
|
10951
10951
|
|
|
10952
|
-
class
|
|
10953
|
-
}
|
|
10954
|
-
|
|
10955
|
-
class ConfirmDialogConfig extends ElderDialogConfig {
|
|
10956
|
-
}
|
|
10957
|
-
class ElderConfirmDialogComponent {
|
|
10958
|
-
constructor(dialogRef) {
|
|
10959
|
-
this.dialogRef = dialogRef;
|
|
10960
|
-
this.yesNo = false;
|
|
10961
|
-
}
|
|
10962
|
-
}
|
|
10963
|
-
ElderConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderConfirmDialogComponent, deps: [{ token: i1$7.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
10964
|
-
ElderConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderConfirmDialogComponent, selector: "elder-confirm-dialog", ngImport: i0, template: "\n<h2 matDialogTitle translate>{{ title }}</h2>\n\n\n<mat-dialog-content>\n <p translate>{{ message }}</p>\n</mat-dialog-content>\n\n\n<mat-dialog-actions fxLayoutAlign=\"end center\" cdkTrapFocus>\n\n <button type=\"button\" mat-button\n (click)=\"dialogRef.close(false)\">\n {{ (yesNo ? \"actions.no\" : \"actions.cancel\") | translate}}\n </button>\n\n <button type=\"submit\" mat-raised-button cdkFocusInitial\n (click)=\"dialogRef.close(true)\">\n {{ (yesNo ? \"actions.yes\" : \"actions.ok\") | translate}}\n </button>\n\n</mat-dialog-actions>\n\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$7.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$7.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
|
10965
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderConfirmDialogComponent, decorators: [{
|
|
10966
|
-
type: Component,
|
|
10967
|
-
args: [{ selector: 'elder-confirm-dialog', template: "\n<h2 matDialogTitle translate>{{ title }}</h2>\n\n\n<mat-dialog-content>\n <p translate>{{ message }}</p>\n</mat-dialog-content>\n\n\n<mat-dialog-actions fxLayoutAlign=\"end center\" cdkTrapFocus>\n\n <button type=\"button\" mat-button\n (click)=\"dialogRef.close(false)\">\n {{ (yesNo ? \"actions.no\" : \"actions.cancel\") | translate}}\n </button>\n\n <button type=\"submit\" mat-raised-button cdkFocusInitial\n (click)=\"dialogRef.close(true)\">\n {{ (yesNo ? \"actions.yes\" : \"actions.ok\") | translate}}\n </button>\n\n</mat-dialog-actions>\n\n" }]
|
|
10968
|
-
}], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }]; } });
|
|
10969
|
-
|
|
10970
|
-
class QuestionDialogConfig extends ElderDialogConfig {
|
|
10971
|
-
}
|
|
10972
|
-
class ElderQuestionDialogComponent {
|
|
10973
|
-
constructor(dialogRef, data) {
|
|
10974
|
-
this.dialogRef = dialogRef;
|
|
10975
|
-
this.data = data;
|
|
10976
|
-
}
|
|
10977
|
-
ngOnInit() {
|
|
10978
|
-
}
|
|
10979
|
-
confirm(event) {
|
|
10980
|
-
this.dialogRef.close(this.answer);
|
|
10981
|
-
}
|
|
10982
|
-
cancel(event) {
|
|
10983
|
-
this.dialogRef.close();
|
|
10984
|
-
}
|
|
10985
|
-
get isValid() {
|
|
10986
|
-
return !!this.answer;
|
|
10987
|
-
}
|
|
10988
|
-
}
|
|
10989
|
-
ElderQuestionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderQuestionDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
10990
|
-
ElderQuestionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderQuestionDialogComponent, selector: "elder-question-dialog", ngImport: i0, template: "<h2 matDialogTitle translate>{{ data.title }}</h2>\n\n<form #f=\"ngForm\" fxLayout=\"column\" (ngSubmit)=\"confirm($event)\" cdkTrapFocus>\n\n <mat-dialog-content>\n <p>{{data.question}}</p>\n\n <mat-form-field class=\"full-width\">\n <input matInput type=\"text\" name=\"name\" [(ngModel)]=\"answer\" cdkFocusInitial\n placeholder=\"{{'context.name' | translate}}\" required>\n </mat-form-field>\n </mat-dialog-content>\n\n <mat-dialog-actions fxLayoutAlign=\"end center\" >\n\n <button mat-button type=\"button\"\n (click)=\"cancel($event)\">\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-button type=\"submit\" color=\"primary\"\n [disabled]=\"!isValid\">\n {{'actions.ok' | translate}}\n </button>\n\n </mat-dialog-actions>\n\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$7.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$7.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
|
10991
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderQuestionDialogComponent, decorators: [{
|
|
10992
|
-
type: Component,
|
|
10993
|
-
args: [{ selector: 'elder-question-dialog', template: "<h2 matDialogTitle translate>{{ data.title }}</h2>\n\n<form #f=\"ngForm\" fxLayout=\"column\" (ngSubmit)=\"confirm($event)\" cdkTrapFocus>\n\n <mat-dialog-content>\n <p>{{data.question}}</p>\n\n <mat-form-field class=\"full-width\">\n <input matInput type=\"text\" name=\"name\" [(ngModel)]=\"answer\" cdkFocusInitial\n placeholder=\"{{'context.name' | translate}}\" required>\n </mat-form-field>\n </mat-dialog-content>\n\n <mat-dialog-actions fxLayoutAlign=\"end center\" >\n\n <button mat-button type=\"button\"\n (click)=\"cancel($event)\">\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-button type=\"submit\" color=\"primary\"\n [disabled]=\"!isValid\">\n {{'actions.ok' | translate}}\n </button>\n\n </mat-dialog-actions>\n\n</form>\n" }]
|
|
10994
|
-
}], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
10995
|
-
type: Inject,
|
|
10996
|
-
args: [MAT_DIALOG_DATA]
|
|
10997
|
-
}] }]; } });
|
|
10998
|
-
|
|
10999
|
-
class ElderDialogService {
|
|
10952
|
+
class DataViewOptionsProviderBinding {
|
|
11000
10953
|
/***************************************************************************
|
|
11001
10954
|
* *
|
|
11002
10955
|
* Constructor *
|
|
11003
10956
|
* *
|
|
11004
10957
|
**************************************************************************/
|
|
11005
|
-
constructor(
|
|
11006
|
-
this.
|
|
11007
|
-
this.translateService = translateService;
|
|
10958
|
+
constructor(_dataViewBaseComponent) {
|
|
10959
|
+
this._dataViewBaseComponent = _dataViewBaseComponent;
|
|
11008
10960
|
/***************************************************************************
|
|
11009
10961
|
* *
|
|
11010
10962
|
* Fields *
|
|
11011
10963
|
* *
|
|
11012
10964
|
**************************************************************************/
|
|
11013
|
-
this.
|
|
11014
|
-
|
|
11015
|
-
|
|
11016
|
-
|
|
11017
|
-
restoreFocus: true,
|
|
11018
|
-
closeOnNavigation: false
|
|
11019
|
-
};
|
|
10965
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
10966
|
+
if (_dataViewBaseComponent == null) {
|
|
10967
|
+
throw new Error('dataViewBaseComponent must not be null!');
|
|
10968
|
+
}
|
|
11020
10969
|
}
|
|
11021
10970
|
/***************************************************************************
|
|
11022
10971
|
* *
|
|
11023
|
-
*
|
|
10972
|
+
* Static Builder *
|
|
11024
10973
|
* *
|
|
11025
10974
|
**************************************************************************/
|
|
11026
|
-
|
|
11027
|
-
|
|
11028
|
-
*
|
|
11029
|
-
* @param title
|
|
11030
|
-
* @param message
|
|
11031
|
-
* @param config
|
|
11032
|
-
*/
|
|
11033
|
-
confirm(title, message, config) {
|
|
11034
|
-
return this.showConfirm({
|
|
11035
|
-
title: title,
|
|
11036
|
-
message: message,
|
|
11037
|
-
config: config || this.defaultDialogConfig
|
|
11038
|
-
});
|
|
10975
|
+
static of(dataViewBaseComponent) {
|
|
10976
|
+
return new DataViewOptionsProviderBinding(dataViewBaseComponent);
|
|
11039
10977
|
}
|
|
11040
|
-
|
|
11041
|
-
*
|
|
11042
|
-
*
|
|
11043
|
-
*
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
if (!
|
|
11047
|
-
throw new Error('
|
|
10978
|
+
/***************************************************************************
|
|
10979
|
+
* *
|
|
10980
|
+
* Public API *
|
|
10981
|
+
* *
|
|
10982
|
+
**************************************************************************/
|
|
10983
|
+
dataViewOptionsProvider(optionsProvider) {
|
|
10984
|
+
if (!optionsProvider) {
|
|
10985
|
+
throw new Error('dataViewSelection must not be null!');
|
|
11048
10986
|
}
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
rawMessages.set('message', config.message);
|
|
11052
|
-
return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
|
|
11053
|
-
const title = messages.get('title');
|
|
11054
|
-
const message = messages.get('message');
|
|
11055
|
-
let dialogRef;
|
|
11056
|
-
dialogRef = this.dialog.open(ElderConfirmDialogComponent, config.config);
|
|
11057
|
-
dialogRef.componentInstance.title = title;
|
|
11058
|
-
dialogRef.componentInstance.message = message;
|
|
11059
|
-
dialogRef.componentInstance.yesNo = config.yesNo;
|
|
11060
|
-
return dialogRef.afterClosed();
|
|
11061
|
-
}));
|
|
11062
|
-
}
|
|
11063
|
-
/**
|
|
11064
|
-
* @deprecated Use showQuestion({...}) instead
|
|
11065
|
-
*
|
|
11066
|
-
* Creates a modal question dialog.
|
|
11067
|
-
*
|
|
11068
|
-
* @param title
|
|
11069
|
-
* @param question
|
|
11070
|
-
* @param config
|
|
11071
|
-
*/
|
|
11072
|
-
question(title, question, config) {
|
|
11073
|
-
return this.showQuestion({
|
|
11074
|
-
title: title,
|
|
11075
|
-
question: question,
|
|
11076
|
-
config: config || this.defaultDialogConfig
|
|
11077
|
-
});
|
|
10987
|
+
this._optionsProvider = optionsProvider;
|
|
10988
|
+
return this;
|
|
11078
10989
|
}
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
* @param config
|
|
11083
|
-
*/
|
|
11084
|
-
showQuestion(config) {
|
|
11085
|
-
if (!config) {
|
|
11086
|
-
throw new Error('Argument must not be null: config');
|
|
10990
|
+
bindUntil(unsubscribe$) {
|
|
10991
|
+
if (!this._optionsProvider) {
|
|
10992
|
+
throw new Error('DataView must be defined to start binding. Use .dataView(dataView)!');
|
|
11087
10993
|
}
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
rawMessages.set('question', config.question);
|
|
11091
|
-
return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
|
|
11092
|
-
const title = messages.get('title');
|
|
11093
|
-
const question = messages.get('question');
|
|
11094
|
-
const dlgConf = config.config || new MatDialogConfig();
|
|
11095
|
-
dlgConf.data = {
|
|
11096
|
-
title: title,
|
|
11097
|
-
question: question
|
|
11098
|
-
};
|
|
11099
|
-
const dialogRef = this.dialog.open(ElderQuestionDialogComponent, dlgConf);
|
|
11100
|
-
return dialogRef.afterClosed()
|
|
11101
|
-
.pipe(filter(response => !!response));
|
|
11102
|
-
}));
|
|
10994
|
+
this._optionsProvider.options$.pipe(takeUntil(unsubscribe$)).subscribe(options => this.applyOptions(options));
|
|
10995
|
+
return this;
|
|
11103
10996
|
}
|
|
11104
10997
|
/***************************************************************************
|
|
11105
10998
|
* *
|
|
11106
|
-
* Private
|
|
10999
|
+
* Private Methods *
|
|
11107
11000
|
* *
|
|
11108
11001
|
**************************************************************************/
|
|
11109
|
-
|
|
11110
|
-
const
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
translated.set(key, translatedValues[rawValue] || rawValue);
|
|
11115
|
-
});
|
|
11116
|
-
return translated;
|
|
11117
|
-
}));
|
|
11118
|
-
}
|
|
11119
|
-
/**
|
|
11120
|
-
* Translates a list of params
|
|
11121
|
-
*
|
|
11122
|
-
* @param interpolateParams
|
|
11123
|
-
*/
|
|
11124
|
-
translateInterpolatedParams(interpolateParams) {
|
|
11125
|
-
if (!interpolateParams) {
|
|
11126
|
-
return of({});
|
|
11002
|
+
applyOptions(options) {
|
|
11003
|
+
const dataCtx = this._dataViewBaseComponent.dataContext;
|
|
11004
|
+
if (dataCtx) {
|
|
11005
|
+
dataCtx.filter.updateFilters(options.filters);
|
|
11006
|
+
dataCtx.sort.updateSorts(options.sorts);
|
|
11127
11007
|
}
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
.filter(value => !!value)
|
|
11131
|
-
.map(value => value + '');
|
|
11132
|
-
return this.translateService.get(values).pipe(map(translated => {
|
|
11133
|
-
Object.getOwnPropertyNames(interpolateParams)
|
|
11134
|
-
.forEach(key => {
|
|
11135
|
-
const value = interpolateParams[key];
|
|
11136
|
-
interpolateParams[key] = translated[value];
|
|
11137
|
-
});
|
|
11138
|
-
return interpolateParams;
|
|
11139
|
-
}));
|
|
11008
|
+
this._dataViewBaseComponent.interactionMode = options.interactionMode;
|
|
11009
|
+
this._dataViewBaseComponent.selectionMultiEnabled = options.selectionMultiEnabled;
|
|
11140
11010
|
}
|
|
11141
11011
|
}
|
|
11142
|
-
ElderDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, deps: [{ token: i1$7.MatDialog }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
11143
|
-
ElderDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, providedIn: 'root' });
|
|
11144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, decorators: [{
|
|
11145
|
-
type: Injectable,
|
|
11146
|
-
args: [{
|
|
11147
|
-
providedIn: 'root'
|
|
11148
|
-
}]
|
|
11149
|
-
}], ctorParameters: function () { return [{ type: i1$7.MatDialog }, { type: i2.TranslateService }]; } });
|
|
11150
11012
|
|
|
11151
|
-
|
|
11013
|
+
/**
|
|
11014
|
+
* Options for supporting data view components.
|
|
11015
|
+
*/
|
|
11016
|
+
class ElderDataViewOptions {
|
|
11017
|
+
/***************************************************************************
|
|
11018
|
+
* *
|
|
11019
|
+
* Fields *
|
|
11020
|
+
* *
|
|
11021
|
+
**************************************************************************/
|
|
11152
11022
|
/***************************************************************************
|
|
11153
11023
|
* *
|
|
11154
11024
|
* Constructor *
|
|
11155
11025
|
* *
|
|
11156
11026
|
**************************************************************************/
|
|
11157
|
-
constructor(
|
|
11158
|
-
this.
|
|
11159
|
-
this.
|
|
11027
|
+
constructor(sorts, filters, selectionMultiEnabled, interactionMode) {
|
|
11028
|
+
this.sorts = sorts;
|
|
11029
|
+
this.filters = filters;
|
|
11030
|
+
this.selectionMultiEnabled = selectionMultiEnabled;
|
|
11031
|
+
this.interactionMode = interactionMode;
|
|
11160
11032
|
}
|
|
11161
|
-
|
|
11033
|
+
static defaultOptions() {
|
|
11034
|
+
return new ElderDataViewOptions([], [], false, 'open');
|
|
11162
11035
|
}
|
|
11163
11036
|
/***************************************************************************
|
|
11164
11037
|
* *
|
|
11165
|
-
*
|
|
11038
|
+
* Properties *
|
|
11166
11039
|
* *
|
|
11167
11040
|
**************************************************************************/
|
|
11168
|
-
|
|
11169
|
-
this.
|
|
11041
|
+
withSorts(sorts) {
|
|
11042
|
+
return new ElderDataViewOptions(sorts, this.filters, this.selectionMultiEnabled, this.interactionMode);
|
|
11170
11043
|
}
|
|
11171
|
-
|
|
11172
|
-
|
|
11044
|
+
withFilters(filters) {
|
|
11045
|
+
return new ElderDataViewOptions(this.sorts, filters, this.selectionMultiEnabled, this.interactionMode);
|
|
11046
|
+
}
|
|
11047
|
+
withSelectionMultiEnabled(selectionMultiEnabled) {
|
|
11048
|
+
return new ElderDataViewOptions(this.sorts, this.filters, selectionMultiEnabled, this.interactionMode);
|
|
11049
|
+
}
|
|
11050
|
+
withInteractionMode(interactionMode) {
|
|
11051
|
+
return new ElderDataViewOptions(this.sorts, this.filters, this.selectionMultiEnabled, interactionMode);
|
|
11173
11052
|
}
|
|
11174
11053
|
}
|
|
11175
|
-
ElderSelectionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
11176
|
-
ElderSelectionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionDialogComponent, selector: "elder-selection-dialog", inputs: { title: "title" }, ngImport: i0, template: "\n\n<div fxLayout=\"column\" fxFill>\n\n <div fxLayout=\"column\">\n <h2 *ngIf=\"title\">{{title | translate}}</h2>\n </div>\n\n <div fxLayout=\"column\" fxFlex>\n\n <ng-template [ngTemplateOutlet]=\"data.template\"></ng-template>\n\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n\n <button mat-button type=\"button\" mat-dialog-close>\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-raised-button type=\"button\"\n [disabled]=\"data.selectionModel.isEmpty()\"\n (click)=\"confirmSelection()\">\n {{'actions.select' | translate}}\n </button>\n\n </div>\n\n\n</div>\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
|
11177
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogComponent, decorators: [{
|
|
11178
|
-
type: Component,
|
|
11179
|
-
args: [{ selector: 'elder-selection-dialog', template: "\n\n<div fxLayout=\"column\" fxFill>\n\n <div fxLayout=\"column\">\n <h2 *ngIf=\"title\">{{title | translate}}</h2>\n </div>\n\n <div fxLayout=\"column\" fxFlex>\n\n <ng-template [ngTemplateOutlet]=\"data.template\"></ng-template>\n\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n\n <button mat-button type=\"button\" mat-dialog-close>\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-raised-button type=\"button\"\n [disabled]=\"data.selectionModel.isEmpty()\"\n (click)=\"confirmSelection()\">\n {{'actions.select' | translate}}\n </button>\n\n </div>\n\n\n</div>\n\n" }]
|
|
11180
|
-
}], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
11181
|
-
type: Inject,
|
|
11182
|
-
args: [MAT_DIALOG_DATA]
|
|
11183
|
-
}] }]; }, propDecorators: { title: [{
|
|
11184
|
-
type: Input
|
|
11185
|
-
}] } });
|
|
11186
11054
|
|
|
11187
|
-
class
|
|
11055
|
+
class ElderDataViewOptionsProvider {
|
|
11188
11056
|
/***************************************************************************
|
|
11189
11057
|
* *
|
|
11190
11058
|
* Constructor *
|
|
11191
11059
|
* *
|
|
11192
11060
|
**************************************************************************/
|
|
11193
|
-
constructor(
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11061
|
+
constructor() {
|
|
11062
|
+
/***************************************************************************
|
|
11063
|
+
* *
|
|
11064
|
+
* Fields *
|
|
11065
|
+
* *
|
|
11066
|
+
**************************************************************************/
|
|
11067
|
+
this.options$ = new BehaviorSubject(ElderDataViewOptions.defaultOptions());
|
|
11068
|
+
}
|
|
11069
|
+
/***************************************************************************
|
|
11070
|
+
* *
|
|
11071
|
+
* Properties *
|
|
11072
|
+
* *
|
|
11073
|
+
**************************************************************************/
|
|
11074
|
+
get options() {
|
|
11075
|
+
return this.options$.getValue();
|
|
11197
11076
|
}
|
|
11198
11077
|
/***************************************************************************
|
|
11199
11078
|
* *
|
|
11200
11079
|
* Public API *
|
|
11201
11080
|
* *
|
|
11202
11081
|
**************************************************************************/
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11082
|
+
/**
|
|
11083
|
+
* Example usage:
|
|
11084
|
+
*
|
|
11085
|
+
* this.updateOptions(
|
|
11086
|
+
* options => options.withInteractionMode('open')
|
|
11087
|
+
* .withFilters([])
|
|
11088
|
+
* )
|
|
11089
|
+
*
|
|
11090
|
+
* @param optionsFn function modifying the options
|
|
11091
|
+
*/
|
|
11092
|
+
updateOptions(optionsFn) {
|
|
11093
|
+
this.options$.next(optionsFn(this.options$.getValue()));
|
|
11213
11094
|
}
|
|
11214
11095
|
}
|
|
11215
|
-
ElderSelectionDialogDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogDirective, deps: [{ token: i0.TemplateRef }, { token: i1$7.MatDialog }], target: i0.ɵɵFactoryTarget.Directive });
|
|
11216
|
-
ElderSelectionDialogDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionDialogDirective, selector: "[elderDialog]", inputs: { selectionModel: "selectionModel" }, outputs: { close: "close" }, exportAs: ["elderSelection"], ngImport: i0 });
|
|
11217
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogDirective, decorators: [{
|
|
11218
|
-
type: Directive,
|
|
11219
|
-
args: [{
|
|
11220
|
-
selector: '[elderDialog]',
|
|
11221
|
-
exportAs: 'elderSelection'
|
|
11222
|
-
}]
|
|
11223
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i1$7.MatDialog }]; }, propDecorators: { selectionModel: [{
|
|
11224
|
-
type: Input
|
|
11225
|
-
}], close: [{
|
|
11226
|
-
type: Output
|
|
11227
|
-
}] } });
|
|
11228
|
-
|
|
11229
|
-
/**
|
|
11230
|
-
* @deprecated Please switch to ElderDialogService
|
|
11231
|
-
*/
|
|
11232
|
-
class EbsCommonDialogService extends ElderDialogService {
|
|
11233
|
-
}
|
|
11234
|
-
EbsCommonDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
11235
|
-
EbsCommonDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService });
|
|
11236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, decorators: [{
|
|
11237
|
-
type: Injectable
|
|
11238
|
-
}] });
|
|
11239
|
-
class ElderDialogModule {
|
|
11240
|
-
static forRoot() {
|
|
11241
|
-
return {
|
|
11242
|
-
ngModule: ElderDialogModule,
|
|
11243
|
-
providers: [
|
|
11244
|
-
// ElderDialogService,
|
|
11245
|
-
EbsCommonDialogService
|
|
11246
|
-
]
|
|
11247
|
-
};
|
|
11248
|
-
}
|
|
11249
|
-
}
|
|
11250
|
-
ElderDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
11251
|
-
ElderDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, declarations: [ElderConfirmDialogComponent,
|
|
11252
|
-
ElderQuestionDialogComponent,
|
|
11253
|
-
ElderSelectionDialogComponent,
|
|
11254
|
-
ElderSelectionDialogDirective], imports: [CommonModule, FormsModule,
|
|
11255
|
-
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11256
|
-
A11yModule,
|
|
11257
|
-
FlexLayoutModule, TranslateModule], exports: [ElderConfirmDialogComponent,
|
|
11258
|
-
ElderQuestionDialogComponent,
|
|
11259
|
-
ElderSelectionDialogComponent,
|
|
11260
|
-
ElderSelectionDialogDirective] });
|
|
11261
|
-
ElderDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, imports: [CommonModule, FormsModule,
|
|
11262
|
-
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11263
|
-
A11yModule,
|
|
11264
|
-
FlexLayoutModule, TranslateModule] });
|
|
11265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, decorators: [{
|
|
11266
|
-
type: NgModule,
|
|
11267
|
-
args: [{
|
|
11268
|
-
imports: [
|
|
11269
|
-
CommonModule, FormsModule,
|
|
11270
|
-
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11271
|
-
A11yModule,
|
|
11272
|
-
FlexLayoutModule, TranslateModule
|
|
11273
|
-
],
|
|
11274
|
-
declarations: [
|
|
11275
|
-
ElderConfirmDialogComponent,
|
|
11276
|
-
ElderQuestionDialogComponent,
|
|
11277
|
-
ElderSelectionDialogComponent,
|
|
11278
|
-
ElderSelectionDialogDirective
|
|
11279
|
-
],
|
|
11280
|
-
exports: [
|
|
11281
|
-
ElderConfirmDialogComponent,
|
|
11282
|
-
ElderQuestionDialogComponent,
|
|
11283
|
-
ElderSelectionDialogComponent,
|
|
11284
|
-
ElderSelectionDialogDirective
|
|
11285
|
-
]
|
|
11286
|
-
}]
|
|
11287
|
-
}] });
|
|
11288
11096
|
|
|
11289
|
-
|
|
11290
|
-
* This directive projects content identified by a placeholder id
|
|
11291
|
-
* into the toolbar at the corresponding place.
|
|
11292
|
-
*/
|
|
11293
|
-
class ElderToolbarContentDirective {
|
|
11294
|
-
constructor(templateRef) {
|
|
11295
|
-
this.templateRef = templateRef;
|
|
11296
|
-
}
|
|
11297
|
-
}
|
|
11298
|
-
ElderToolbarContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
11299
|
-
ElderToolbarContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderToolbarContentDirective, selector: "[elderToolbarContent]", inputs: { placeholderId: ["elderToolbarContent", "placeholderId"] }, ngImport: i0 });
|
|
11300
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, decorators: [{
|
|
11301
|
-
type: Directive,
|
|
11302
|
-
args: [{ selector: '[elderToolbarContent]' }]
|
|
11303
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { placeholderId: [{
|
|
11304
|
-
type: Input,
|
|
11305
|
-
args: ['elderToolbarContent']
|
|
11306
|
-
}] } });
|
|
11307
|
-
class ElderDataToolbarComponent {
|
|
11097
|
+
class ElderDataViewBaseComponent {
|
|
11308
11098
|
/***************************************************************************
|
|
11309
11099
|
* *
|
|
11310
11100
|
* Constructor *
|
|
11311
11101
|
* *
|
|
11312
11102
|
**************************************************************************/
|
|
11313
|
-
constructor(selectionModel,
|
|
11314
|
-
this.
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
this.
|
|
11324
|
-
|
|
11325
|
-
|
|
11103
|
+
constructor(selectionModel, dataViewOptionsProvider) {
|
|
11104
|
+
this.dataViewOptionsProvider = dataViewOptionsProvider;
|
|
11105
|
+
/***************************************************************************
|
|
11106
|
+
* *
|
|
11107
|
+
* Fields *
|
|
11108
|
+
* *
|
|
11109
|
+
**************************************************************************/
|
|
11110
|
+
/**
|
|
11111
|
+
* Underlying data context.
|
|
11112
|
+
*/
|
|
11113
|
+
this.dataContext$ = new BehaviorSubject(null);
|
|
11114
|
+
this.interactionMode = 'open';
|
|
11115
|
+
/**
|
|
11116
|
+
* Define if elder-table should clean up the
|
|
11117
|
+
* data-context resources for you.
|
|
11118
|
+
*
|
|
11119
|
+
* In more advanced scenarios where you plan to reuse the same data-context
|
|
11120
|
+
* set this to false and release the resources yourself. (dataContext.close)
|
|
11121
|
+
*/
|
|
11122
|
+
this.cleanUp = true;
|
|
11123
|
+
/**
|
|
11124
|
+
* If true, this table is in dense mode.
|
|
11125
|
+
* Heights are generally reduced.
|
|
11126
|
+
*/
|
|
11127
|
+
this._dense = false;
|
|
11128
|
+
/**
|
|
11129
|
+
* If true, this table is in a floating card mode.
|
|
11130
|
+
* Otherwise, it is flat on the current panel.
|
|
11131
|
+
*/
|
|
11132
|
+
this._float = false;
|
|
11133
|
+
/**
|
|
11134
|
+
* If true, this table is in embedded mode.
|
|
11135
|
+
* No borders / floating visible so that the table can be embedded into another container
|
|
11136
|
+
*/
|
|
11137
|
+
this._embedded = false;
|
|
11138
|
+
this._itemClickSubject = new Subject();
|
|
11139
|
+
this.EntityIdKeyFn = (entity) => entity ? this.getId(entity) : 0;
|
|
11140
|
+
this.destroy$ = new Subject();
|
|
11141
|
+
if (!selectionModel) {
|
|
11142
|
+
this.selectionModel = new SelectionModel(false, [], this.EntityIdKeyFn);
|
|
11326
11143
|
}
|
|
11327
|
-
|
|
11328
|
-
this.selectionModel =
|
|
11144
|
+
else {
|
|
11145
|
+
this.selectionModel = selectionModel;
|
|
11329
11146
|
}
|
|
11330
11147
|
}
|
|
11331
11148
|
/***************************************************************************
|
|
@@ -11333,1234 +11150,1423 @@ class ElderDataToolbarComponent {
|
|
|
11333
11150
|
* Life Cycle *
|
|
11334
11151
|
* *
|
|
11335
11152
|
**************************************************************************/
|
|
11336
|
-
ngOnInit() {
|
|
11153
|
+
ngOnInit() {
|
|
11154
|
+
if (this.dataViewOptionsProvider) {
|
|
11155
|
+
if (this.dataViewOptionsProvider.options.interactionMode === 'selection') {
|
|
11156
|
+
this.selectionVisible = true;
|
|
11157
|
+
this.float = false;
|
|
11158
|
+
}
|
|
11159
|
+
if (this.dataContext) {
|
|
11160
|
+
DataViewOptionsProviderBinding.of(this)
|
|
11161
|
+
.dataViewOptionsProvider(this.dataViewOptionsProvider)
|
|
11162
|
+
.bindUntil(this.destroy$);
|
|
11163
|
+
}
|
|
11164
|
+
}
|
|
11165
|
+
}
|
|
11166
|
+
ngOnDestroy() {
|
|
11167
|
+
this.destroy$.next();
|
|
11168
|
+
this.destroy$.complete();
|
|
11169
|
+
this.autoCleanUp();
|
|
11170
|
+
}
|
|
11337
11171
|
/***************************************************************************
|
|
11338
11172
|
* *
|
|
11339
11173
|
* Properties *
|
|
11340
11174
|
* *
|
|
11341
11175
|
**************************************************************************/
|
|
11342
|
-
|
|
11343
|
-
this.
|
|
11344
|
-
|
|
11345
|
-
|
|
11176
|
+
get dataContext() {
|
|
11177
|
+
return this.dataContext$.getValue();
|
|
11178
|
+
}
|
|
11179
|
+
set dataContext(data) {
|
|
11180
|
+
this.dataContext$.next(data);
|
|
11181
|
+
this.onDataContextSet(data);
|
|
11182
|
+
}
|
|
11183
|
+
get dataActivePaged() {
|
|
11184
|
+
return this.dataContext;
|
|
11185
|
+
}
|
|
11186
|
+
get dataContinuable() {
|
|
11187
|
+
return this.dataContext;
|
|
11188
|
+
}
|
|
11189
|
+
get isContinuable() {
|
|
11190
|
+
if (!this.dataContext) {
|
|
11191
|
+
return false;
|
|
11346
11192
|
}
|
|
11347
|
-
|
|
11348
|
-
|
|
11193
|
+
return isContinuableDataContext(this.dataContext);
|
|
11194
|
+
}
|
|
11195
|
+
get isActivePaged() {
|
|
11196
|
+
if (!this.dataContext) {
|
|
11197
|
+
return false;
|
|
11349
11198
|
}
|
|
11199
|
+
return isActivePagedDataContext(this.dataContext);
|
|
11350
11200
|
}
|
|
11351
|
-
|
|
11352
|
-
|
|
11201
|
+
/***************************************************************************
|
|
11202
|
+
* *
|
|
11203
|
+
* Selection Properties *
|
|
11204
|
+
* *
|
|
11205
|
+
**************************************************************************/
|
|
11206
|
+
set selectableEvaluatorFn(selectableEvaluatorFn) {
|
|
11207
|
+
this.selectionModel.selectableEvaluatorFn = selectableEvaluatorFn;
|
|
11208
|
+
}
|
|
11209
|
+
set selection(selection) {
|
|
11210
|
+
this.selectionModel.replaceSelection(selection);
|
|
11211
|
+
}
|
|
11212
|
+
get selectionChange() {
|
|
11213
|
+
return this.selectionModel.changed;
|
|
11214
|
+
}
|
|
11215
|
+
get selectionSingleChange() {
|
|
11216
|
+
return this.selectionModel.changed.pipe(map((selection) => {
|
|
11217
|
+
if (selection.length > 0) {
|
|
11218
|
+
return selection[0];
|
|
11219
|
+
}
|
|
11220
|
+
else {
|
|
11221
|
+
return null;
|
|
11222
|
+
}
|
|
11223
|
+
}));
|
|
11224
|
+
}
|
|
11225
|
+
set selectionMultiEnabled(enableMultiSelection) {
|
|
11226
|
+
if (this.selectionModel) {
|
|
11227
|
+
this.selectionModel.isMultipleSelection = enableMultiSelection;
|
|
11228
|
+
}
|
|
11353
11229
|
}
|
|
11354
11230
|
/***************************************************************************
|
|
11355
11231
|
* *
|
|
11356
|
-
*
|
|
11232
|
+
* On click properties *
|
|
11357
11233
|
* *
|
|
11358
11234
|
**************************************************************************/
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11235
|
+
get itemClick() {
|
|
11236
|
+
return this._itemClickSubject;
|
|
11237
|
+
}
|
|
11238
|
+
/***************************************************************************
|
|
11239
|
+
* *
|
|
11240
|
+
* Style Properties *
|
|
11241
|
+
* *
|
|
11242
|
+
**************************************************************************/
|
|
11243
|
+
set dense(value) {
|
|
11244
|
+
this._dense = coerceBooleanProperty(value);
|
|
11245
|
+
}
|
|
11246
|
+
get dense() {
|
|
11247
|
+
return this._dense;
|
|
11248
|
+
}
|
|
11249
|
+
set float(value) {
|
|
11250
|
+
this._float = coerceBooleanProperty(value);
|
|
11251
|
+
}
|
|
11252
|
+
get float() {
|
|
11253
|
+
return this._float;
|
|
11254
|
+
}
|
|
11255
|
+
set embedded(value) {
|
|
11256
|
+
this._embedded = coerceBooleanProperty(value);
|
|
11257
|
+
}
|
|
11258
|
+
get embedded() {
|
|
11259
|
+
return this._embedded;
|
|
11260
|
+
}
|
|
11261
|
+
/***************************************************************************
|
|
11262
|
+
* *
|
|
11263
|
+
* Event Entry Points *
|
|
11264
|
+
* *
|
|
11265
|
+
**************************************************************************/
|
|
11266
|
+
/**
|
|
11267
|
+
* Called after a new DataContext has been set.
|
|
11268
|
+
* Subclasses may add additional behaviour at this stage.
|
|
11269
|
+
* @param data
|
|
11270
|
+
* @protected
|
|
11271
|
+
*/
|
|
11272
|
+
onDataContextSet(data) {
|
|
11273
|
+
}
|
|
11274
|
+
onItemClick(entity) {
|
|
11275
|
+
if (entity) {
|
|
11276
|
+
switch (this.interactionMode) {
|
|
11277
|
+
case 'open':
|
|
11278
|
+
if (this.selectionModel.hasValue) {
|
|
11279
|
+
this.selectionModel.toggle(entity);
|
|
11280
|
+
}
|
|
11281
|
+
else {
|
|
11282
|
+
this._itemClickSubject.next(entity);
|
|
11283
|
+
}
|
|
11284
|
+
break;
|
|
11285
|
+
case 'selection':
|
|
11286
|
+
this.selectionModel.toggle(entity);
|
|
11287
|
+
break;
|
|
11288
|
+
}
|
|
11362
11289
|
}
|
|
11363
|
-
const template = this.templates.find((item) => item.placeholderId === placeholderId);
|
|
11364
|
-
return template ? template.templateRef : null;
|
|
11365
11290
|
}
|
|
11366
|
-
|
|
11367
|
-
if (
|
|
11368
|
-
this.
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
this.emitRemove(items);
|
|
11378
|
-
}
|
|
11379
|
-
});
|
|
11291
|
+
onItemDoubleClick(entity) {
|
|
11292
|
+
if (entity) {
|
|
11293
|
+
switch (this.interactionMode) {
|
|
11294
|
+
// double click in open mode not supported
|
|
11295
|
+
case 'open':
|
|
11296
|
+
break;
|
|
11297
|
+
// double click in selection mode triggers normal item click
|
|
11298
|
+
case 'selection':
|
|
11299
|
+
this._itemClickSubject.next(entity);
|
|
11300
|
+
break;
|
|
11301
|
+
}
|
|
11380
11302
|
}
|
|
11381
|
-
|
|
11382
|
-
|
|
11303
|
+
}
|
|
11304
|
+
/***************************************************************************
|
|
11305
|
+
* *
|
|
11306
|
+
* Private Methods *
|
|
11307
|
+
* *
|
|
11308
|
+
**************************************************************************/
|
|
11309
|
+
getId(entity) {
|
|
11310
|
+
return this.dataContext?.dataSource?.getId(entity) || entity;
|
|
11311
|
+
}
|
|
11312
|
+
/**
|
|
11313
|
+
* Performs clean up of the current data context if auto clean up is enabled.
|
|
11314
|
+
*/
|
|
11315
|
+
autoCleanUp() {
|
|
11316
|
+
if (this.cleanUp && this.dataContext) {
|
|
11317
|
+
//this.logger.debug('Releasing DataContext resources to prevent memory leak. [cleanUp]="true"');
|
|
11318
|
+
this.dataContext.close();
|
|
11319
|
+
}
|
|
11320
|
+
}
|
|
11321
|
+
}
|
|
11322
|
+
ElderDataViewBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseComponent, deps: [{ token: SelectionModel }, { token: ElderDataViewOptionsProvider }], target: i0.ɵɵFactoryTarget.Directive });
|
|
11323
|
+
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 });
|
|
11324
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseComponent, decorators: [{
|
|
11325
|
+
type: Directive
|
|
11326
|
+
}], ctorParameters: function () { return [{ type: SelectionModel }, { type: ElderDataViewOptionsProvider }]; }, propDecorators: { interactionMode: [{
|
|
11327
|
+
type: Input
|
|
11328
|
+
}], cleanUp: [{
|
|
11329
|
+
type: Input
|
|
11330
|
+
}], selectableEvaluatorFn: [{
|
|
11331
|
+
type: Input
|
|
11332
|
+
}], selection: [{
|
|
11333
|
+
type: Input
|
|
11334
|
+
}], selectionChange: [{
|
|
11335
|
+
type: Output
|
|
11336
|
+
}], selectionSingleChange: [{
|
|
11337
|
+
type: Output
|
|
11338
|
+
}], selectionMultiEnabled: [{
|
|
11339
|
+
type: Input
|
|
11340
|
+
}], itemClick: [{
|
|
11341
|
+
type: Output
|
|
11342
|
+
}], dense: [{
|
|
11343
|
+
type: Input
|
|
11344
|
+
}], float: [{
|
|
11345
|
+
type: Input
|
|
11346
|
+
}], embedded: [{
|
|
11347
|
+
type: Input
|
|
11348
|
+
}] } });
|
|
11349
|
+
|
|
11350
|
+
class ElderDialogConfig {
|
|
11351
|
+
}
|
|
11352
|
+
|
|
11353
|
+
class ConfirmDialogConfig extends ElderDialogConfig {
|
|
11354
|
+
}
|
|
11355
|
+
class ElderConfirmDialogComponent {
|
|
11356
|
+
constructor(dialogRef) {
|
|
11357
|
+
this.dialogRef = dialogRef;
|
|
11358
|
+
this.yesNo = false;
|
|
11359
|
+
}
|
|
11360
|
+
}
|
|
11361
|
+
ElderConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderConfirmDialogComponent, deps: [{ token: i1$7.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
11362
|
+
ElderConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderConfirmDialogComponent, selector: "elder-confirm-dialog", ngImport: i0, template: "\n<h2 matDialogTitle translate>{{ title }}</h2>\n\n\n<mat-dialog-content>\n <p translate>{{ message }}</p>\n</mat-dialog-content>\n\n\n<mat-dialog-actions fxLayoutAlign=\"end center\" cdkTrapFocus>\n\n <button type=\"button\" mat-button\n (click)=\"dialogRef.close(false)\">\n {{ (yesNo ? \"actions.no\" : \"actions.cancel\") | translate}}\n </button>\n\n <button type=\"submit\" mat-raised-button cdkFocusInitial\n (click)=\"dialogRef.close(true)\">\n {{ (yesNo ? \"actions.yes\" : \"actions.ok\") | translate}}\n </button>\n\n</mat-dialog-actions>\n\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$7.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$7.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
|
11363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderConfirmDialogComponent, decorators: [{
|
|
11364
|
+
type: Component,
|
|
11365
|
+
args: [{ selector: 'elder-confirm-dialog', template: "\n<h2 matDialogTitle translate>{{ title }}</h2>\n\n\n<mat-dialog-content>\n <p translate>{{ message }}</p>\n</mat-dialog-content>\n\n\n<mat-dialog-actions fxLayoutAlign=\"end center\" cdkTrapFocus>\n\n <button type=\"button\" mat-button\n (click)=\"dialogRef.close(false)\">\n {{ (yesNo ? \"actions.no\" : \"actions.cancel\") | translate}}\n </button>\n\n <button type=\"submit\" mat-raised-button cdkFocusInitial\n (click)=\"dialogRef.close(true)\">\n {{ (yesNo ? \"actions.yes\" : \"actions.ok\") | translate}}\n </button>\n\n</mat-dialog-actions>\n\n" }]
|
|
11366
|
+
}], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }]; } });
|
|
11367
|
+
|
|
11368
|
+
class QuestionDialogConfig extends ElderDialogConfig {
|
|
11369
|
+
}
|
|
11370
|
+
class ElderQuestionDialogComponent {
|
|
11371
|
+
constructor(dialogRef, data) {
|
|
11372
|
+
this.dialogRef = dialogRef;
|
|
11373
|
+
this.data = data;
|
|
11374
|
+
}
|
|
11375
|
+
ngOnInit() {
|
|
11376
|
+
}
|
|
11377
|
+
confirm(event) {
|
|
11378
|
+
this.dialogRef.close(this.answer);
|
|
11379
|
+
}
|
|
11380
|
+
cancel(event) {
|
|
11381
|
+
this.dialogRef.close();
|
|
11382
|
+
}
|
|
11383
|
+
get isValid() {
|
|
11384
|
+
return !!this.answer;
|
|
11385
|
+
}
|
|
11386
|
+
}
|
|
11387
|
+
ElderQuestionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderQuestionDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
11388
|
+
ElderQuestionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderQuestionDialogComponent, selector: "elder-question-dialog", ngImport: i0, template: "<h2 matDialogTitle translate>{{ data.title }}</h2>\n\n<form #f=\"ngForm\" fxLayout=\"column\" (ngSubmit)=\"confirm($event)\" cdkTrapFocus>\n\n <mat-dialog-content>\n <p>{{data.question}}</p>\n\n <mat-form-field class=\"full-width\">\n <input matInput type=\"text\" name=\"name\" [(ngModel)]=\"answer\" cdkFocusInitial\n placeholder=\"{{'context.name' | translate}}\" required>\n </mat-form-field>\n </mat-dialog-content>\n\n <mat-dialog-actions fxLayoutAlign=\"end center\" >\n\n <button mat-button type=\"button\"\n (click)=\"cancel($event)\">\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-button type=\"submit\" color=\"primary\"\n [disabled]=\"!isValid\">\n {{'actions.ok' | translate}}\n </button>\n\n </mat-dialog-actions>\n\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$7.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$7.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
|
11389
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderQuestionDialogComponent, decorators: [{
|
|
11390
|
+
type: Component,
|
|
11391
|
+
args: [{ selector: 'elder-question-dialog', template: "<h2 matDialogTitle translate>{{ data.title }}</h2>\n\n<form #f=\"ngForm\" fxLayout=\"column\" (ngSubmit)=\"confirm($event)\" cdkTrapFocus>\n\n <mat-dialog-content>\n <p>{{data.question}}</p>\n\n <mat-form-field class=\"full-width\">\n <input matInput type=\"text\" name=\"name\" [(ngModel)]=\"answer\" cdkFocusInitial\n placeholder=\"{{'context.name' | translate}}\" required>\n </mat-form-field>\n </mat-dialog-content>\n\n <mat-dialog-actions fxLayoutAlign=\"end center\" >\n\n <button mat-button type=\"button\"\n (click)=\"cancel($event)\">\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-button type=\"submit\" color=\"primary\"\n [disabled]=\"!isValid\">\n {{'actions.ok' | translate}}\n </button>\n\n </mat-dialog-actions>\n\n</form>\n" }]
|
|
11392
|
+
}], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
11393
|
+
type: Inject,
|
|
11394
|
+
args: [MAT_DIALOG_DATA]
|
|
11395
|
+
}] }]; } });
|
|
11396
|
+
|
|
11397
|
+
class ElderDialogService {
|
|
11398
|
+
/***************************************************************************
|
|
11399
|
+
* *
|
|
11400
|
+
* Constructor *
|
|
11401
|
+
* *
|
|
11402
|
+
**************************************************************************/
|
|
11403
|
+
constructor(dialog, translateService) {
|
|
11404
|
+
this.dialog = dialog;
|
|
11405
|
+
this.translateService = translateService;
|
|
11406
|
+
/***************************************************************************
|
|
11407
|
+
* *
|
|
11408
|
+
* Fields *
|
|
11409
|
+
* *
|
|
11410
|
+
**************************************************************************/
|
|
11411
|
+
this.defaultDialogConfig = {
|
|
11412
|
+
role: 'dialog',
|
|
11413
|
+
disableClose: false,
|
|
11414
|
+
autoFocus: true,
|
|
11415
|
+
restoreFocus: true,
|
|
11416
|
+
closeOnNavigation: false
|
|
11417
|
+
};
|
|
11418
|
+
}
|
|
11419
|
+
/***************************************************************************
|
|
11420
|
+
* *
|
|
11421
|
+
* Public API *
|
|
11422
|
+
* *
|
|
11423
|
+
**************************************************************************/
|
|
11424
|
+
/**
|
|
11425
|
+
* @deprecated Use showConfirm({...}) instead
|
|
11426
|
+
*
|
|
11427
|
+
* @param title
|
|
11428
|
+
* @param message
|
|
11429
|
+
* @param config
|
|
11430
|
+
*/
|
|
11431
|
+
confirm(title, message, config) {
|
|
11432
|
+
return this.showConfirm({
|
|
11433
|
+
title: title,
|
|
11434
|
+
message: message,
|
|
11435
|
+
config: config || this.defaultDialogConfig
|
|
11436
|
+
});
|
|
11437
|
+
}
|
|
11438
|
+
/**
|
|
11439
|
+
* Creates a modal confirmation dialog.
|
|
11440
|
+
*
|
|
11441
|
+
* @param config object for conform dialog
|
|
11442
|
+
*/
|
|
11443
|
+
showConfirm(config) {
|
|
11444
|
+
if (!config) {
|
|
11445
|
+
throw new Error('Argument must not be null: config');
|
|
11446
|
+
}
|
|
11447
|
+
const rawMessages = new Map();
|
|
11448
|
+
rawMessages.set('title', config.title);
|
|
11449
|
+
rawMessages.set('message', config.message);
|
|
11450
|
+
return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
|
|
11451
|
+
const title = messages.get('title');
|
|
11452
|
+
const message = messages.get('message');
|
|
11453
|
+
let dialogRef;
|
|
11454
|
+
dialogRef = this.dialog.open(ElderConfirmDialogComponent, config.config);
|
|
11455
|
+
dialogRef.componentInstance.title = title;
|
|
11456
|
+
dialogRef.componentInstance.message = message;
|
|
11457
|
+
dialogRef.componentInstance.yesNo = config.yesNo;
|
|
11458
|
+
return dialogRef.afterClosed();
|
|
11459
|
+
}));
|
|
11460
|
+
}
|
|
11461
|
+
/**
|
|
11462
|
+
* @deprecated Use showQuestion({...}) instead
|
|
11463
|
+
*
|
|
11464
|
+
* Creates a modal question dialog.
|
|
11465
|
+
*
|
|
11466
|
+
* @param title
|
|
11467
|
+
* @param question
|
|
11468
|
+
* @param config
|
|
11469
|
+
*/
|
|
11470
|
+
question(title, question, config) {
|
|
11471
|
+
return this.showQuestion({
|
|
11472
|
+
title: title,
|
|
11473
|
+
question: question,
|
|
11474
|
+
config: config || this.defaultDialogConfig
|
|
11475
|
+
});
|
|
11476
|
+
}
|
|
11477
|
+
/**
|
|
11478
|
+
* Creates a modal question dialog.
|
|
11479
|
+
*
|
|
11480
|
+
* @param config
|
|
11481
|
+
*/
|
|
11482
|
+
showQuestion(config) {
|
|
11483
|
+
if (!config) {
|
|
11484
|
+
throw new Error('Argument must not be null: config');
|
|
11383
11485
|
}
|
|
11486
|
+
const rawMessages = new Map();
|
|
11487
|
+
rawMessages.set('title', config.title);
|
|
11488
|
+
rawMessages.set('question', config.question);
|
|
11489
|
+
return this.resolveTranslatedMap(rawMessages, config.interpolateParams).pipe(switchMap(messages => {
|
|
11490
|
+
const title = messages.get('title');
|
|
11491
|
+
const question = messages.get('question');
|
|
11492
|
+
const dlgConf = config.config || new MatDialogConfig();
|
|
11493
|
+
dlgConf.data = {
|
|
11494
|
+
title: title,
|
|
11495
|
+
question: question
|
|
11496
|
+
};
|
|
11497
|
+
const dialogRef = this.dialog.open(ElderQuestionDialogComponent, dlgConf);
|
|
11498
|
+
return dialogRef.afterClosed()
|
|
11499
|
+
.pipe(filter(response => !!response));
|
|
11500
|
+
}));
|
|
11501
|
+
}
|
|
11502
|
+
/***************************************************************************
|
|
11503
|
+
* *
|
|
11504
|
+
* Private methods *
|
|
11505
|
+
* *
|
|
11506
|
+
**************************************************************************/
|
|
11507
|
+
resolveTranslatedMap(messages, interpolateParams) {
|
|
11508
|
+
const rawMessages = Array.from(messages.values());
|
|
11509
|
+
return this.translateInterpolatedParams(interpolateParams).pipe(switchMap(translatedParams => this.translateService.get(rawMessages, translatedParams)), map(translatedValues => {
|
|
11510
|
+
const translated = new Map();
|
|
11511
|
+
messages.forEach((rawValue, key) => {
|
|
11512
|
+
translated.set(key, translatedValues[rawValue] || rawValue);
|
|
11513
|
+
});
|
|
11514
|
+
return translated;
|
|
11515
|
+
}));
|
|
11384
11516
|
}
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11517
|
+
/**
|
|
11518
|
+
* Translates a list of params
|
|
11519
|
+
*
|
|
11520
|
+
* @param interpolateParams
|
|
11521
|
+
*/
|
|
11522
|
+
translateInterpolatedParams(interpolateParams) {
|
|
11523
|
+
if (!interpolateParams) {
|
|
11524
|
+
return of({});
|
|
11392
11525
|
}
|
|
11526
|
+
const values = Object.getOwnPropertyNames(interpolateParams)
|
|
11527
|
+
.map(key => interpolateParams[key])
|
|
11528
|
+
.filter(value => !!value)
|
|
11529
|
+
.map(value => value + '');
|
|
11530
|
+
return this.translateService.get(values).pipe(map(translated => {
|
|
11531
|
+
Object.getOwnPropertyNames(interpolateParams)
|
|
11532
|
+
.forEach(key => {
|
|
11533
|
+
const value = interpolateParams[key];
|
|
11534
|
+
interpolateParams[key] = translated[value];
|
|
11535
|
+
});
|
|
11536
|
+
return interpolateParams;
|
|
11537
|
+
}));
|
|
11393
11538
|
}
|
|
11394
11539
|
}
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
11398
|
-
type:
|
|
11399
|
-
args: [{
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
type: Optional
|
|
11404
|
-
}, {
|
|
11405
|
-
type: Inject,
|
|
11406
|
-
args: [ELDER_DATA_VIEW]
|
|
11407
|
-
}] }, { type: ElderDialogService }]; }, propDecorators: { canAdd: [{
|
|
11408
|
-
type: Input
|
|
11409
|
-
}], canRemove: [{
|
|
11410
|
-
type: Input
|
|
11411
|
-
}], canMore: [{
|
|
11412
|
-
type: Input
|
|
11413
|
-
}], confirmRemoval: [{
|
|
11414
|
-
type: Input
|
|
11415
|
-
}], keepSelectionAfterRemoval: [{
|
|
11416
|
-
type: Input
|
|
11417
|
-
}], requestNew: [{
|
|
11418
|
-
type: Output
|
|
11419
|
-
}], requestRemove: [{
|
|
11420
|
-
type: Output
|
|
11421
|
-
}], templates: [{
|
|
11422
|
-
type: ContentChildren,
|
|
11423
|
-
args: [ElderToolbarContentDirective]
|
|
11424
|
-
}], selectionModel: [{
|
|
11425
|
-
type: Input
|
|
11426
|
-
}] } });
|
|
11540
|
+
ElderDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, deps: [{ token: i1$7.MatDialog }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
11541
|
+
ElderDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, providedIn: 'root' });
|
|
11542
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogService, decorators: [{
|
|
11543
|
+
type: Injectable,
|
|
11544
|
+
args: [{
|
|
11545
|
+
providedIn: 'root'
|
|
11546
|
+
}]
|
|
11547
|
+
}], ctorParameters: function () { return [{ type: i1$7.MatDialog }, { type: i2.TranslateService }]; } });
|
|
11427
11548
|
|
|
11428
|
-
class
|
|
11549
|
+
class ElderSelectionDialogComponent {
|
|
11429
11550
|
/***************************************************************************
|
|
11430
11551
|
* *
|
|
11431
11552
|
* Constructor *
|
|
11432
11553
|
* *
|
|
11433
11554
|
**************************************************************************/
|
|
11434
|
-
constructor() {
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
* Fields *
|
|
11438
|
-
* *
|
|
11439
|
-
**************************************************************************/
|
|
11440
|
-
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
11441
|
-
this.sort$ = new BehaviorSubject(Sort.NONE);
|
|
11442
|
-
this.availableSorts = [];
|
|
11443
|
-
this.sortChange = new EventEmitter();
|
|
11444
|
-
this.translationPrefix = 'documents.sorts.';
|
|
11555
|
+
constructor(dialogRef, data) {
|
|
11556
|
+
this.dialogRef = dialogRef;
|
|
11557
|
+
this.data = data;
|
|
11445
11558
|
}
|
|
11446
|
-
/***************************************************************************
|
|
11447
|
-
* *
|
|
11448
|
-
* Life Cycle *
|
|
11449
|
-
* *
|
|
11450
|
-
**************************************************************************/
|
|
11451
11559
|
ngOnInit() {
|
|
11452
11560
|
}
|
|
11453
11561
|
/***************************************************************************
|
|
11454
11562
|
* *
|
|
11455
|
-
*
|
|
11456
|
-
* *
|
|
11457
|
-
**************************************************************************/
|
|
11458
|
-
set sort(sort) {
|
|
11459
|
-
if (!sort) {
|
|
11460
|
-
sort = Sort.NONE;
|
|
11461
|
-
}
|
|
11462
|
-
this.sort$.next(sort);
|
|
11463
|
-
}
|
|
11464
|
-
get sort() {
|
|
11465
|
-
return this.sort$.getValue();
|
|
11466
|
-
}
|
|
11467
|
-
/***************************************************************************
|
|
11468
|
-
* *
|
|
11469
|
-
* API *
|
|
11563
|
+
* Public API *
|
|
11470
11564
|
* *
|
|
11471
11565
|
**************************************************************************/
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
this.setSort(sort);
|
|
11475
|
-
}
|
|
11476
|
-
toggleSortDirection(event) {
|
|
11477
|
-
event.stopPropagation();
|
|
11478
|
-
let dir;
|
|
11479
|
-
if (this.sort.dir === 'asc') {
|
|
11480
|
-
dir = 'desc';
|
|
11481
|
-
}
|
|
11482
|
-
else {
|
|
11483
|
-
dir = 'asc';
|
|
11484
|
-
}
|
|
11485
|
-
this.setSort(new Sort(this.sort.prop, dir));
|
|
11566
|
+
confirmSelection() {
|
|
11567
|
+
this.dialogRef.close();
|
|
11486
11568
|
}
|
|
11487
|
-
|
|
11488
|
-
this.
|
|
11489
|
-
this.sortChange.emit(sort);
|
|
11569
|
+
ngAfterViewInit() {
|
|
11570
|
+
// this.dialogRef.updateSize('20vw', '20vh');
|
|
11490
11571
|
}
|
|
11491
11572
|
}
|
|
11492
|
-
|
|
11493
|
-
|
|
11494
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
11573
|
+
ElderSelectionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
11574
|
+
ElderSelectionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionDialogComponent, selector: "elder-selection-dialog", inputs: { title: "title" }, ngImport: i0, template: "\n\n<div fxLayout=\"column\" fxFill>\n\n <div fxLayout=\"column\">\n <h2 *ngIf=\"title\">{{title | translate}}</h2>\n </div>\n\n <div fxLayout=\"column\" fxFlex>\n\n <ng-template [ngTemplateOutlet]=\"data.template\"></ng-template>\n\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n\n <button mat-button type=\"button\" mat-dialog-close>\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-raised-button type=\"button\"\n [disabled]=\"data.selectionModel.isEmpty()\"\n (click)=\"confirmSelection()\">\n {{'actions.select' | translate}}\n </button>\n\n </div>\n\n\n</div>\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$7.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
|
11575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogComponent, decorators: [{
|
|
11495
11576
|
type: Component,
|
|
11496
|
-
args: [{ selector: 'elder-
|
|
11497
|
-
}], ctorParameters: function () { return [
|
|
11498
|
-
|
|
11499
|
-
|
|
11500
|
-
|
|
11501
|
-
}], translationPrefix: [{
|
|
11502
|
-
type: Input
|
|
11503
|
-
}], sort: [{
|
|
11577
|
+
args: [{ selector: 'elder-selection-dialog', template: "\n\n<div fxLayout=\"column\" fxFill>\n\n <div fxLayout=\"column\">\n <h2 *ngIf=\"title\">{{title | translate}}</h2>\n </div>\n\n <div fxLayout=\"column\" fxFlex>\n\n <ng-template [ngTemplateOutlet]=\"data.template\"></ng-template>\n\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n\n <button mat-button type=\"button\" mat-dialog-close>\n {{'actions.cancel' | translate}}\n </button>\n\n <button mat-raised-button type=\"button\"\n [disabled]=\"data.selectionModel.isEmpty()\"\n (click)=\"confirmSelection()\">\n {{'actions.select' | translate}}\n </button>\n\n </div>\n\n\n</div>\n\n" }]
|
|
11578
|
+
}], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
11579
|
+
type: Inject,
|
|
11580
|
+
args: [MAT_DIALOG_DATA]
|
|
11581
|
+
}] }]; }, propDecorators: { title: [{
|
|
11504
11582
|
type: Input
|
|
11505
11583
|
}] } });
|
|
11506
11584
|
|
|
11507
|
-
class
|
|
11508
|
-
constructor(count, allSelected, someSelected, anySelected) {
|
|
11509
|
-
this.count = count;
|
|
11510
|
-
this.allSelected = allSelected;
|
|
11511
|
-
this.someSelected = someSelected;
|
|
11512
|
-
this.anySelected = anySelected;
|
|
11513
|
-
}
|
|
11514
|
-
}
|
|
11515
|
-
|
|
11516
|
-
class DataContextSelectionDirective {
|
|
11585
|
+
class ElderSelectionDialogDirective {
|
|
11517
11586
|
/***************************************************************************
|
|
11518
11587
|
* *
|
|
11519
11588
|
* Constructor *
|
|
11520
11589
|
* *
|
|
11521
11590
|
**************************************************************************/
|
|
11522
|
-
constructor(
|
|
11523
|
-
|
|
11524
|
-
|
|
11525
|
-
|
|
11526
|
-
* *
|
|
11527
|
-
**************************************************************************/
|
|
11528
|
-
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
11529
|
-
this.selectionModel$ = new BehaviorSubject(null);
|
|
11530
|
-
this.dataContext$ = new BehaviorSubject(null);
|
|
11531
|
-
this.selectionModel$.next(selectionModel);
|
|
11532
|
-
this.selectionState$ = this.buildSelectionState$(this.selectionModel$, this.dataContext$);
|
|
11533
|
-
}
|
|
11534
|
-
/***************************************************************************
|
|
11535
|
-
* *
|
|
11536
|
-
* Properties *
|
|
11537
|
-
* *
|
|
11538
|
-
**************************************************************************/
|
|
11539
|
-
set selectionModel(model) {
|
|
11540
|
-
this.selectionModel$.next(model);
|
|
11541
|
-
}
|
|
11542
|
-
get selectionModel() {
|
|
11543
|
-
return this.selectionModel$.getValue();
|
|
11544
|
-
}
|
|
11545
|
-
set dataContext(dataContext) {
|
|
11546
|
-
this.dataContext$.next(dataContext);
|
|
11547
|
-
}
|
|
11548
|
-
/** Whether the number of selected elements matches the totalSnapshot number of selectable rows. */
|
|
11549
|
-
get isAllSelectedSnapshot() {
|
|
11550
|
-
const numSelected = this.selectionModel.selectionSnapshot.length;
|
|
11551
|
-
const context = this.dataContext$.getValue();
|
|
11552
|
-
const numRows = context ? context.snapshot.data.length : 0;
|
|
11553
|
-
const numUnselectable = context ? context.snapshot.data.filter(i => !this.selectionModel.isSelectable(i)).length : 0;
|
|
11554
|
-
return numSelected >= numRows - numUnselectable; // True if all selectable items are selected
|
|
11591
|
+
constructor(templateRef, dialog) {
|
|
11592
|
+
this.templateRef = templateRef;
|
|
11593
|
+
this.dialog = dialog;
|
|
11594
|
+
this.close = new EventEmitter();
|
|
11555
11595
|
}
|
|
11556
11596
|
/***************************************************************************
|
|
11557
11597
|
* *
|
|
11558
11598
|
* Public API *
|
|
11559
11599
|
* *
|
|
11560
11600
|
**************************************************************************/
|
|
11561
|
-
|
|
11562
|
-
|
|
11563
|
-
|
|
11564
|
-
|
|
11565
|
-
|
|
11566
|
-
|
|
11567
|
-
|
|
11568
|
-
|
|
11569
|
-
|
|
11570
|
-
|
|
11571
|
-
}
|
|
11572
|
-
}
|
|
11573
|
-
}
|
|
11574
|
-
/***************************************************************************
|
|
11575
|
-
* *
|
|
11576
|
-
* Private methods *
|
|
11577
|
-
* *
|
|
11578
|
-
**************************************************************************/
|
|
11579
|
-
buildSelectionState$(selectionModel$, dataContext$) {
|
|
11580
|
-
return combineLatest([selectionModel$, dataContext$]).pipe(filter(([model, dc]) => !!model && !!dc), switchMap(([model, dc]) => this.buildSelectionStateInner$(model, dc)));
|
|
11601
|
+
open() {
|
|
11602
|
+
const dialogRef = this.dialog.open(ElderSelectionDialogComponent, {
|
|
11603
|
+
data: {
|
|
11604
|
+
template: this.templateRef,
|
|
11605
|
+
selectionModel: this.selectionModel
|
|
11606
|
+
},
|
|
11607
|
+
width: '80vw',
|
|
11608
|
+
height: '80vh'
|
|
11609
|
+
});
|
|
11610
|
+
dialogRef.afterClosed().subscribe(result => this.close.emit(result));
|
|
11581
11611
|
}
|
|
11582
|
-
|
|
11583
|
-
|
|
11584
|
-
|
|
11585
|
-
|
|
11586
|
-
|
|
11612
|
+
}
|
|
11613
|
+
ElderSelectionDialogDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogDirective, deps: [{ token: i0.TemplateRef }, { token: i1$7.MatDialog }], target: i0.ɵɵFactoryTarget.Directive });
|
|
11614
|
+
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 });
|
|
11615
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionDialogDirective, decorators: [{
|
|
11616
|
+
type: Directive,
|
|
11617
|
+
args: [{
|
|
11618
|
+
selector: '[elderDialog]',
|
|
11619
|
+
exportAs: 'elderSelection'
|
|
11620
|
+
}]
|
|
11621
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i1$7.MatDialog }]; }, propDecorators: { selectionModel: [{
|
|
11622
|
+
type: Input
|
|
11623
|
+
}], close: [{
|
|
11624
|
+
type: Output
|
|
11625
|
+
}] } });
|
|
11626
|
+
|
|
11627
|
+
/**
|
|
11628
|
+
* @deprecated Please switch to ElderDialogService
|
|
11629
|
+
*/
|
|
11630
|
+
class EbsCommonDialogService extends ElderDialogService {
|
|
11631
|
+
}
|
|
11632
|
+
EbsCommonDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
11633
|
+
EbsCommonDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService });
|
|
11634
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EbsCommonDialogService, decorators: [{
|
|
11635
|
+
type: Injectable
|
|
11636
|
+
}] });
|
|
11637
|
+
class ElderDialogModule {
|
|
11638
|
+
static forRoot() {
|
|
11639
|
+
return {
|
|
11640
|
+
ngModule: ElderDialogModule,
|
|
11641
|
+
providers: [
|
|
11642
|
+
// ElderDialogService,
|
|
11643
|
+
EbsCommonDialogService
|
|
11644
|
+
]
|
|
11645
|
+
};
|
|
11587
11646
|
}
|
|
11588
11647
|
}
|
|
11589
|
-
|
|
11590
|
-
|
|
11591
|
-
|
|
11592
|
-
|
|
11648
|
+
ElderDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
11649
|
+
ElderDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, declarations: [ElderConfirmDialogComponent,
|
|
11650
|
+
ElderQuestionDialogComponent,
|
|
11651
|
+
ElderSelectionDialogComponent,
|
|
11652
|
+
ElderSelectionDialogDirective], imports: [CommonModule, FormsModule,
|
|
11653
|
+
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11654
|
+
A11yModule,
|
|
11655
|
+
FlexLayoutModule, TranslateModule], exports: [ElderConfirmDialogComponent,
|
|
11656
|
+
ElderQuestionDialogComponent,
|
|
11657
|
+
ElderSelectionDialogComponent,
|
|
11658
|
+
ElderSelectionDialogDirective] });
|
|
11659
|
+
ElderDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, imports: [CommonModule, FormsModule,
|
|
11660
|
+
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11661
|
+
A11yModule,
|
|
11662
|
+
FlexLayoutModule, TranslateModule] });
|
|
11663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDialogModule, decorators: [{
|
|
11664
|
+
type: NgModule,
|
|
11593
11665
|
args: [{
|
|
11594
|
-
|
|
11595
|
-
|
|
11666
|
+
imports: [
|
|
11667
|
+
CommonModule, FormsModule,
|
|
11668
|
+
MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatInputModule,
|
|
11669
|
+
A11yModule,
|
|
11670
|
+
FlexLayoutModule, TranslateModule
|
|
11671
|
+
],
|
|
11672
|
+
declarations: [
|
|
11673
|
+
ElderConfirmDialogComponent,
|
|
11674
|
+
ElderQuestionDialogComponent,
|
|
11675
|
+
ElderSelectionDialogComponent,
|
|
11676
|
+
ElderSelectionDialogDirective
|
|
11677
|
+
],
|
|
11678
|
+
exports: [
|
|
11679
|
+
ElderConfirmDialogComponent,
|
|
11680
|
+
ElderQuestionDialogComponent,
|
|
11681
|
+
ElderSelectionDialogComponent,
|
|
11682
|
+
ElderSelectionDialogDirective
|
|
11683
|
+
]
|
|
11596
11684
|
}]
|
|
11597
|
-
}]
|
|
11598
|
-
|
|
11599
|
-
|
|
11600
|
-
|
|
11601
|
-
|
|
11602
|
-
|
|
11685
|
+
}] });
|
|
11686
|
+
|
|
11687
|
+
/**
|
|
11688
|
+
* This directive projects content identified by a placeholder id
|
|
11689
|
+
* into the toolbar at the corresponding place.
|
|
11690
|
+
*/
|
|
11691
|
+
class ElderToolbarContentDirective {
|
|
11692
|
+
constructor(templateRef) {
|
|
11693
|
+
this.templateRef = templateRef;
|
|
11694
|
+
}
|
|
11695
|
+
}
|
|
11696
|
+
ElderToolbarContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
11697
|
+
ElderToolbarContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderToolbarContentDirective, selector: "[elderToolbarContent]", inputs: { placeholderId: ["elderToolbarContent", "placeholderId"] }, ngImport: i0 });
|
|
11698
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderToolbarContentDirective, decorators: [{
|
|
11699
|
+
type: Directive,
|
|
11700
|
+
args: [{ selector: '[elderToolbarContent]' }]
|
|
11701
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { placeholderId: [{
|
|
11603
11702
|
type: Input,
|
|
11604
|
-
args: ['
|
|
11703
|
+
args: ['elderToolbarContent']
|
|
11605
11704
|
}] } });
|
|
11606
|
-
|
|
11607
|
-
class ElderSelectionMasterCheckboxComponent {
|
|
11705
|
+
class ElderDataToolbarComponent {
|
|
11608
11706
|
/***************************************************************************
|
|
11609
11707
|
* *
|
|
11610
11708
|
* Constructor *
|
|
11611
11709
|
* *
|
|
11612
11710
|
**************************************************************************/
|
|
11613
|
-
constructor(
|
|
11614
|
-
this.
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
this.
|
|
11711
|
+
constructor(selectionModel, dataView, dialogService) {
|
|
11712
|
+
this.dialogService = dialogService;
|
|
11713
|
+
this.canAdd = true;
|
|
11714
|
+
this.canRemove = true;
|
|
11715
|
+
this.canMore = true;
|
|
11716
|
+
this.confirmRemoval = true;
|
|
11717
|
+
this.keepSelectionAfterRemoval = false;
|
|
11718
|
+
this.requestNew = new Subject();
|
|
11719
|
+
this.requestRemove = new Subject();
|
|
11720
|
+
this.selectionFallback = new BehaviorSubject([]);
|
|
11721
|
+
this.selection$ = this.selectionFallback.asObservable();
|
|
11722
|
+
if (selectionModel) {
|
|
11723
|
+
this.selectionModel = selectionModel;
|
|
11724
|
+
}
|
|
11725
|
+
if (dataView) {
|
|
11726
|
+
this.selectionModel = dataView.selectionModel;
|
|
11727
|
+
}
|
|
11621
11728
|
}
|
|
11622
11729
|
/***************************************************************************
|
|
11623
11730
|
* *
|
|
11624
11731
|
* Life Cycle *
|
|
11625
11732
|
* *
|
|
11626
11733
|
**************************************************************************/
|
|
11627
|
-
ngOnInit() {
|
|
11628
|
-
}
|
|
11629
|
-
}
|
|
11630
|
-
ElderSelectionMasterCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionMasterCheckboxComponent, deps: [{ token: DataContextSelectionDirective }], target: i0.ɵɵFactoryTarget.Component });
|
|
11631
|
-
ElderSelectionMasterCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionMasterCheckboxComponent, selector: "elder-selection-master-checkbox", ngImport: i0, template: "<div\n *ngIf=\"\n dataContextSelection.selectionModel.isMultipleSelection\n && dataContextSelection?.selectionState$ | async as selectionState\"\n\n fxLayout=\"column\" fxFlex=\"none\"\n\n [matBadgeHidden]=\"selectionState.count === 0\"\n [matBadge]=\"selectionState.count + ''\"\n [matBadgePosition]=\"'above before'\"\n [matBadgeOverlap]=\"false\"\n [matBadgeSize]=\"'small'\"\n>\n <mat-checkbox fxFlex=\"none\"\n (change)=\"$event ? dataContextSelection.masterToggle() : null\"\n [checked]=\"selectionState.allSelected\"\n [indeterminate]=\"selectionState.someSelected\"\n >\n </mat-checkbox>\n</div>\n\n<!-- -->\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$8.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i4$3.MatBadge, selector: "[matBadge]", inputs: ["matBadgeDisabled", "matBadgeColor", "matBadgeOverlap", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11632
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionMasterCheckboxComponent, decorators: [{
|
|
11633
|
-
type: Component,
|
|
11634
|
-
args: [{ selector: 'elder-selection-master-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"\n dataContextSelection.selectionModel.isMultipleSelection\n && dataContextSelection?.selectionState$ | async as selectionState\"\n\n fxLayout=\"column\" fxFlex=\"none\"\n\n [matBadgeHidden]=\"selectionState.count === 0\"\n [matBadge]=\"selectionState.count + ''\"\n [matBadgePosition]=\"'above before'\"\n [matBadgeOverlap]=\"false\"\n [matBadgeSize]=\"'small'\"\n>\n <mat-checkbox fxFlex=\"none\"\n (change)=\"$event ? dataContextSelection.masterToggle() : null\"\n [checked]=\"selectionState.allSelected\"\n [indeterminate]=\"selectionState.someSelected\"\n >\n </mat-checkbox>\n</div>\n\n<!-- -->\n" }]
|
|
11635
|
-
}], ctorParameters: function () { return [{ type: DataContextSelectionDirective }]; } });
|
|
11636
|
-
|
|
11637
|
-
class DataContextStateIndicatorComponent {
|
|
11734
|
+
ngOnInit() { }
|
|
11638
11735
|
/***************************************************************************
|
|
11639
11736
|
* *
|
|
11640
|
-
*
|
|
11737
|
+
* Properties *
|
|
11641
11738
|
* *
|
|
11642
11739
|
**************************************************************************/
|
|
11643
|
-
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
|
|
11647
|
-
|
|
11648
|
-
|
|
11649
|
-
|
|
11740
|
+
set selectionModel(model) {
|
|
11741
|
+
this._selectionModel = model;
|
|
11742
|
+
if (model) {
|
|
11743
|
+
this.selection$ = model.selection;
|
|
11744
|
+
}
|
|
11745
|
+
else {
|
|
11746
|
+
this.selection$ = this.selectionFallback.asObservable();
|
|
11747
|
+
}
|
|
11650
11748
|
}
|
|
11651
|
-
|
|
11652
|
-
|
|
11653
|
-
* Life Cycle *
|
|
11654
|
-
* *
|
|
11655
|
-
**************************************************************************/
|
|
11656
|
-
ngOnInit() {
|
|
11749
|
+
get selectionModel() {
|
|
11750
|
+
return this._selectionModel;
|
|
11657
11751
|
}
|
|
11658
11752
|
/***************************************************************************
|
|
11659
11753
|
* *
|
|
11660
|
-
*
|
|
11754
|
+
* Public API *
|
|
11661
11755
|
* *
|
|
11662
11756
|
**************************************************************************/
|
|
11663
|
-
|
|
11664
|
-
this.
|
|
11757
|
+
getTemplate(placeholderId) {
|
|
11758
|
+
if (!this.templates) {
|
|
11759
|
+
return null;
|
|
11760
|
+
}
|
|
11761
|
+
const template = this.templates.find((item) => item.placeholderId === placeholderId);
|
|
11762
|
+
return template ? template.templateRef : null;
|
|
11763
|
+
}
|
|
11764
|
+
requestRemoveItems(items) {
|
|
11765
|
+
if (this.confirmRemoval) {
|
|
11766
|
+
this.dialogService
|
|
11767
|
+
.showConfirm({
|
|
11768
|
+
title: 'dialogs.confirm-deletion.title',
|
|
11769
|
+
message: 'dialogs.confirm-deletion.message',
|
|
11770
|
+
yesNo: true,
|
|
11771
|
+
interpolateParams: { numOfItems: items.length },
|
|
11772
|
+
})
|
|
11773
|
+
.subscribe((confirmed) => {
|
|
11774
|
+
if (confirmed) {
|
|
11775
|
+
this.emitRemove(items);
|
|
11776
|
+
}
|
|
11777
|
+
});
|
|
11778
|
+
}
|
|
11779
|
+
else {
|
|
11780
|
+
this.emitRemove(items);
|
|
11781
|
+
}
|
|
11782
|
+
}
|
|
11783
|
+
emitRemove(items) {
|
|
11784
|
+
this.requestRemove.next(items);
|
|
11785
|
+
if (!this.keepSelectionAfterRemoval) {
|
|
11786
|
+
// Clear the selection after deleting items
|
|
11787
|
+
if (this._selectionModel) {
|
|
11788
|
+
this._selectionModel.deselect(items);
|
|
11789
|
+
}
|
|
11790
|
+
}
|
|
11665
11791
|
}
|
|
11666
11792
|
}
|
|
11667
|
-
|
|
11668
|
-
|
|
11669
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
11793
|
+
ElderDataToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataToolbarComponent, deps: [{ token: SelectionModel, optional: true }, { token: ELDER_DATA_VIEW, optional: true }, { token: ElderDialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
11794
|
+
ElderDataToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderDataToolbarComponent, selector: "elder-data-toolbar", inputs: { canAdd: "canAdd", canRemove: "canRemove", canMore: "canMore", confirmRemoval: "confirmRemoval", keepSelectionAfterRemoval: "keepSelectionAfterRemoval", selectionModel: "selectionModel" }, outputs: { requestNew: "requestNew", requestRemove: "requestRemove" }, queries: [{ propertyName: "templates", predicate: ElderToolbarContentDirective }], ngImport: i0, template: "<!-- Table Toolbar -->\n<div\n fxLayout=\"row\"\n fxLayoutAlign=\"space-between center\"\n fxLayoutGap=\"10px\"\n style=\"padding: 4px 8px 0 8px\"\n *ngIf=\"selection$ | async as selection\"\n>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('main') || defaultContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n</div>\n\n<!-- Default Templates -->\n\n<!-- Default Main Content -->\n<ng-template #defaultContent let-selection>\n <!-- Left column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left') || defaultLeftContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('center') || defaultCenterContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <!-- Right column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right') || defaultRightContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n</ng-template>\n\n<!-- Default Left Content -->\n<ng-template #defaultLeftContent let-selection>\n <!-- Add Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canAdd\"\n (click)=\"requestNew.next($event)\"\n >\n <mat-icon>add</mat-icon>\n </button>\n\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n</ng-template>\n\n<!-- Default Center Content -->\n<ng-template #defaultCenterContent let-selection> </ng-template>\n\n<!-- Default Right Content -->\n<ng-template #defaultRightContent let-selection>\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n\n <!-- Delete Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canRemove\"\n [disabled]=\"!selection?.length\"\n (click)=\"requestRemoveItems(selection)\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n\n <!-- More Menu -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n [matMenuTriggerFor]=\"elderTableMenu\"\n [disabled]=\"!canMore\"\n >\n <mat-icon>more_vert</mat-icon>\n <mat-menu #elderTableMenu=\"matMenu\">\n <ng-content select=\"[mat-menu-item]\"></ng-content>\n <!-- Placeholder for mat menu items-->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.menu');\n context: { $implicit: selection }\n \"\n ></ng-container>\n </mat-menu>\n </button>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11795
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataToolbarComponent, decorators: [{
|
|
11670
11796
|
type: Component,
|
|
11671
|
-
args: [{ selector: 'elder-data-
|
|
11672
|
-
}], ctorParameters: function () { return [
|
|
11797
|
+
args: [{ selector: 'elder-data-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Table Toolbar -->\n<div\n fxLayout=\"row\"\n fxLayoutAlign=\"space-between center\"\n fxLayoutGap=\"10px\"\n style=\"padding: 4px 8px 0 8px\"\n *ngIf=\"selection$ | async as selection\"\n>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('main') || defaultContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n</div>\n\n<!-- Default Templates -->\n\n<!-- Default Main Content -->\n<ng-template #defaultContent let-selection>\n <!-- Left column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left') || defaultLeftContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('center') || defaultCenterContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n\n <!-- Right column -->\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right') || defaultRightContent;\n context: { $implicit: selection }\n \"\n ></ng-container>\n </div>\n</ng-template>\n\n<!-- Default Left Content -->\n<ng-template #defaultLeftContent let-selection>\n <!-- Add Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canAdd\"\n (click)=\"requestNew.next($event)\"\n >\n <mat-icon>add</mat-icon>\n </button>\n\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('left.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n</ng-template>\n\n<!-- Default Center Content -->\n<ng-template #defaultCenterContent let-selection> </ng-template>\n\n<!-- Default Right Content -->\n<ng-template #defaultRightContent let-selection>\n <!-- Placeholder for additional actions -->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.actions');\n context: { $implicit: selection }\n \"\n ></ng-container>\n\n <!-- Delete Action -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n *ngIf=\"canRemove\"\n [disabled]=\"!selection?.length\"\n (click)=\"requestRemoveItems(selection)\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n\n <!-- More Menu -->\n <button\n mat-icon-button type=\"button\"\n color=\"primary\"\n [matMenuTriggerFor]=\"elderTableMenu\"\n [disabled]=\"!canMore\"\n >\n <mat-icon>more_vert</mat-icon>\n <mat-menu #elderTableMenu=\"matMenu\">\n <ng-content select=\"[mat-menu-item]\"></ng-content>\n <!-- Placeholder for mat menu items-->\n <ng-container\n *ngTemplateOutlet=\"\n getTemplate('right.menu');\n context: { $implicit: selection }\n \"\n ></ng-container>\n </mat-menu>\n </button>\n</ng-template>\n" }]
|
|
11798
|
+
}], ctorParameters: function () { return [{ type: SelectionModel, decorators: [{
|
|
11799
|
+
type: Optional
|
|
11800
|
+
}] }, { type: undefined, decorators: [{
|
|
11801
|
+
type: Optional
|
|
11802
|
+
}, {
|
|
11803
|
+
type: Inject,
|
|
11804
|
+
args: [ELDER_DATA_VIEW]
|
|
11805
|
+
}] }, { type: ElderDialogService }]; }, propDecorators: { canAdd: [{
|
|
11673
11806
|
type: Input
|
|
11674
|
-
}]
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
TranslateModule, FlexLayoutModule], exports: [ElderDataToolbarComponent,
|
|
11693
|
-
ElderToolbarContentDirective,
|
|
11694
|
-
ElderSingleSortComponent,
|
|
11695
|
-
ElderSelectionMasterCheckboxComponent,
|
|
11696
|
-
DataContextSelectionDirective,
|
|
11697
|
-
DataContextStateIndicatorComponent] });
|
|
11698
|
-
ElderDataCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, imports: [CommonModule, RouterModule,
|
|
11699
|
-
// Material
|
|
11700
|
-
MatDividerModule,
|
|
11701
|
-
MatCheckboxModule, MatMenuModule,
|
|
11702
|
-
MatButtonModule, MatIconModule, MatBadgeModule,
|
|
11703
|
-
MatProgressBarModule,
|
|
11704
|
-
MatDialogModule, MatTooltipModule,
|
|
11705
|
-
// translations
|
|
11706
|
-
TranslateModule, FlexLayoutModule] });
|
|
11707
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, decorators: [{
|
|
11708
|
-
type: NgModule,
|
|
11709
|
-
args: [{
|
|
11710
|
-
imports: [
|
|
11711
|
-
CommonModule, RouterModule,
|
|
11712
|
-
// Material
|
|
11713
|
-
MatDividerModule,
|
|
11714
|
-
MatCheckboxModule, MatMenuModule,
|
|
11715
|
-
MatButtonModule, MatIconModule, MatBadgeModule,
|
|
11716
|
-
MatProgressBarModule,
|
|
11717
|
-
MatDialogModule, MatTooltipModule,
|
|
11718
|
-
// translations
|
|
11719
|
-
TranslateModule, FlexLayoutModule,
|
|
11720
|
-
],
|
|
11721
|
-
declarations: [
|
|
11722
|
-
ElderDataToolbarComponent,
|
|
11723
|
-
ElderToolbarContentDirective,
|
|
11724
|
-
ElderSingleSortComponent,
|
|
11725
|
-
ElderSelectionMasterCheckboxComponent,
|
|
11726
|
-
DataContextSelectionDirective,
|
|
11727
|
-
DataContextStateIndicatorComponent
|
|
11728
|
-
],
|
|
11729
|
-
exports: [
|
|
11730
|
-
ElderDataToolbarComponent,
|
|
11731
|
-
ElderToolbarContentDirective,
|
|
11732
|
-
ElderSingleSortComponent,
|
|
11733
|
-
ElderSelectionMasterCheckboxComponent,
|
|
11734
|
-
DataContextSelectionDirective,
|
|
11735
|
-
DataContextStateIndicatorComponent
|
|
11736
|
-
],
|
|
11737
|
-
}]
|
|
11738
|
-
}] });
|
|
11807
|
+
}], canRemove: [{
|
|
11808
|
+
type: Input
|
|
11809
|
+
}], canMore: [{
|
|
11810
|
+
type: Input
|
|
11811
|
+
}], confirmRemoval: [{
|
|
11812
|
+
type: Input
|
|
11813
|
+
}], keepSelectionAfterRemoval: [{
|
|
11814
|
+
type: Input
|
|
11815
|
+
}], requestNew: [{
|
|
11816
|
+
type: Output
|
|
11817
|
+
}], requestRemove: [{
|
|
11818
|
+
type: Output
|
|
11819
|
+
}], templates: [{
|
|
11820
|
+
type: ContentChildren,
|
|
11821
|
+
args: [ElderToolbarContentDirective]
|
|
11822
|
+
}], selectionModel: [{
|
|
11823
|
+
type: Input
|
|
11824
|
+
}] } });
|
|
11739
11825
|
|
|
11740
|
-
class
|
|
11826
|
+
class ElderSingleSortComponent {
|
|
11741
11827
|
/***************************************************************************
|
|
11742
11828
|
* *
|
|
11743
11829
|
* Constructor *
|
|
11744
11830
|
* *
|
|
11745
11831
|
**************************************************************************/
|
|
11746
|
-
constructor(
|
|
11747
|
-
this.dialogRef = dialogRef;
|
|
11748
|
-
this.data = data;
|
|
11749
|
-
this.selectionModel = selectionModel;
|
|
11832
|
+
constructor() {
|
|
11750
11833
|
/***************************************************************************
|
|
11751
11834
|
* *
|
|
11752
11835
|
* Fields *
|
|
11753
11836
|
* *
|
|
11754
11837
|
**************************************************************************/
|
|
11755
11838
|
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
11839
|
+
this.sort$ = new BehaviorSubject(Sort.NONE);
|
|
11840
|
+
this.availableSorts = [];
|
|
11841
|
+
this.sortChange = new EventEmitter();
|
|
11842
|
+
this.translationPrefix = 'documents.sorts.';
|
|
11756
11843
|
}
|
|
11757
11844
|
/***************************************************************************
|
|
11758
11845
|
* *
|
|
11759
|
-
*
|
|
11846
|
+
* Life Cycle *
|
|
11760
11847
|
* *
|
|
11761
11848
|
**************************************************************************/
|
|
11762
11849
|
ngOnInit() {
|
|
11763
11850
|
}
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
|
|
11769
|
-
|
|
11770
|
-
|
|
11771
|
-
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
class ColumnPositionSpec {
|
|
11776
|
-
constructor(position, relativeTo) {
|
|
11777
|
-
this.position = position;
|
|
11778
|
-
this.relativeTo = relativeTo;
|
|
11851
|
+
/***************************************************************************
|
|
11852
|
+
* *
|
|
11853
|
+
* Properties *
|
|
11854
|
+
* *
|
|
11855
|
+
**************************************************************************/
|
|
11856
|
+
set sort(sort) {
|
|
11857
|
+
if (!sort) {
|
|
11858
|
+
sort = Sort.NONE;
|
|
11859
|
+
}
|
|
11860
|
+
this.sort$.next(sort);
|
|
11779
11861
|
}
|
|
11780
|
-
|
|
11781
|
-
return
|
|
11862
|
+
get sort() {
|
|
11863
|
+
return this.sort$.getValue();
|
|
11782
11864
|
}
|
|
11783
|
-
|
|
11784
|
-
|
|
11865
|
+
/***************************************************************************
|
|
11866
|
+
* *
|
|
11867
|
+
* API *
|
|
11868
|
+
* *
|
|
11869
|
+
**************************************************************************/
|
|
11870
|
+
setSortProp(sortProp) {
|
|
11871
|
+
const sort = new Sort(sortProp, this.sort.dir);
|
|
11872
|
+
this.setSort(sort);
|
|
11873
|
+
}
|
|
11874
|
+
toggleSortDirection(event) {
|
|
11875
|
+
event.stopPropagation();
|
|
11876
|
+
let dir;
|
|
11877
|
+
if (this.sort.dir === 'asc') {
|
|
11878
|
+
dir = 'desc';
|
|
11879
|
+
}
|
|
11880
|
+
else {
|
|
11881
|
+
dir = 'asc';
|
|
11882
|
+
}
|
|
11883
|
+
this.setSort(new Sort(this.sort.prop, dir));
|
|
11884
|
+
}
|
|
11885
|
+
setSort(sort) {
|
|
11886
|
+
this.sort = sort;
|
|
11887
|
+
this.sortChange.emit(sort);
|
|
11785
11888
|
}
|
|
11786
11889
|
}
|
|
11787
|
-
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
|
|
11890
|
+
ElderSingleSortComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSingleSortComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11891
|
+
ElderSingleSortComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSingleSortComponent, selector: "elder-single-sort", inputs: { availableSorts: "availableSorts", translationPrefix: "translationPrefix", sort: "sort" }, outputs: { sortChange: "sortChange" }, ngImport: i0, template: "<div *ngIf=\"(sort$ | async) as sort\" fxLayout=\"row\" fxFlex=\"none\">\n\n <button mat-button type=\"button\" [matMenuTriggerFor]=\"menu\">\n\n {{ translationPrefix + sort.prop | translate}}\n\n <mat-icon style=\"font-size: 22px\">sort</mat-icon>\n\n <mat-menu #menu=\"matMenu\">\n <button mat-menu-item type=\"button\"\n *ngFor=\"let mysort of availableSorts\"\n (click)=\"setSortProp(mysort)\"\n >\n <mat-icon>sort</mat-icon>\n <span [class.mat-body-strong]=\"sort.prop == mysort\">{{translationPrefix + mysort | translate}}</span>\n </button>\n </mat-menu>\n\n </button>\n\n <button mat-icon-button type=\"button\" (click)=\"toggleSortDirection($event)\">\n <mat-icon style=\"font-size: 22px\">{{sort.dir === 'asc' ? 'arrow_downward' : 'arrow_upward'}}</mat-icon>\n </button>\n\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11892
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSingleSortComponent, decorators: [{
|
|
11893
|
+
type: Component,
|
|
11894
|
+
args: [{ selector: 'elder-single-sort', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"(sort$ | async) as sort\" fxLayout=\"row\" fxFlex=\"none\">\n\n <button mat-button type=\"button\" [matMenuTriggerFor]=\"menu\">\n\n {{ translationPrefix + sort.prop | translate}}\n\n <mat-icon style=\"font-size: 22px\">sort</mat-icon>\n\n <mat-menu #menu=\"matMenu\">\n <button mat-menu-item type=\"button\"\n *ngFor=\"let mysort of availableSorts\"\n (click)=\"setSortProp(mysort)\"\n >\n <mat-icon>sort</mat-icon>\n <span [class.mat-body-strong]=\"sort.prop == mysort\">{{translationPrefix + mysort | translate}}</span>\n </button>\n </mat-menu>\n\n </button>\n\n <button mat-icon-button type=\"button\" (click)=\"toggleSortDirection($event)\">\n <mat-icon style=\"font-size: 22px\">{{sort.dir === 'asc' ? 'arrow_downward' : 'arrow_upward'}}</mat-icon>\n </button>\n\n</div>\n" }]
|
|
11895
|
+
}], ctorParameters: function () { return []; }, propDecorators: { availableSorts: [{
|
|
11896
|
+
type: Input
|
|
11897
|
+
}], sortChange: [{
|
|
11898
|
+
type: Output
|
|
11899
|
+
}], translationPrefix: [{
|
|
11900
|
+
type: Input
|
|
11901
|
+
}], sort: [{
|
|
11902
|
+
type: Input
|
|
11903
|
+
}] } });
|
|
11904
|
+
|
|
11905
|
+
class MasterSelectionState {
|
|
11906
|
+
constructor(count, allSelected, someSelected, anySelected) {
|
|
11907
|
+
this.count = count;
|
|
11908
|
+
this.allSelected = allSelected;
|
|
11909
|
+
this.someSelected = someSelected;
|
|
11910
|
+
this.anySelected = anySelected;
|
|
11792
11911
|
}
|
|
11793
11912
|
}
|
|
11794
|
-
|
|
11795
|
-
|
|
11913
|
+
|
|
11914
|
+
class DataContextSelectionDirective {
|
|
11915
|
+
/***************************************************************************
|
|
11916
|
+
* *
|
|
11917
|
+
* Constructor *
|
|
11918
|
+
* *
|
|
11919
|
+
**************************************************************************/
|
|
11920
|
+
constructor(selectionModel) {
|
|
11796
11921
|
/***************************************************************************
|
|
11797
11922
|
* *
|
|
11798
11923
|
* Fields *
|
|
11799
11924
|
* *
|
|
11800
11925
|
**************************************************************************/
|
|
11801
11926
|
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
11927
|
+
this.selectionModel$ = new BehaviorSubject(null);
|
|
11928
|
+
this.dataContext$ = new BehaviorSubject(null);
|
|
11929
|
+
this.selectionModel$.next(selectionModel);
|
|
11930
|
+
this.selectionState$ = this.buildSelectionState$(this.selectionModel$, this.dataContext$);
|
|
11802
11931
|
}
|
|
11803
11932
|
/***************************************************************************
|
|
11804
11933
|
* *
|
|
11805
|
-
*
|
|
11934
|
+
* Properties *
|
|
11806
11935
|
* *
|
|
11807
11936
|
**************************************************************************/
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
return
|
|
11937
|
+
set selectionModel(model) {
|
|
11938
|
+
this.selectionModel$.next(model);
|
|
11939
|
+
}
|
|
11940
|
+
get selectionModel() {
|
|
11941
|
+
return this.selectionModel$.getValue();
|
|
11942
|
+
}
|
|
11943
|
+
set dataContext(dataContext) {
|
|
11944
|
+
this.dataContext$.next(dataContext);
|
|
11945
|
+
}
|
|
11946
|
+
/** Whether the number of selected elements matches the totalSnapshot number of selectable rows. */
|
|
11947
|
+
get isAllSelectedSnapshot() {
|
|
11948
|
+
const numSelected = this.selectionModel.selectionSnapshot.length;
|
|
11949
|
+
const context = this.dataContext$.getValue();
|
|
11950
|
+
const numRows = context ? context.snapshot.data.length : 0;
|
|
11951
|
+
const numUnselectable = context ? context.snapshot.data.filter(i => !this.selectionModel.isSelectable(i)).length : 0;
|
|
11952
|
+
return numSelected >= numRows - numUnselectable; // True if all selectable items are selected
|
|
11813
11953
|
}
|
|
11814
11954
|
/***************************************************************************
|
|
11815
11955
|
* *
|
|
11816
|
-
*
|
|
11956
|
+
* Public API *
|
|
11817
11957
|
* *
|
|
11818
11958
|
**************************************************************************/
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
startIndex: 0,
|
|
11825
|
-
endIndex: 0
|
|
11826
|
-
};
|
|
11827
|
-
for (const grp of groupHierarchy) {
|
|
11828
|
-
// grp defined position relative to prev group
|
|
11829
|
-
previousIndex = this.insertColumnsAt(sorted, grp.columns, grp.columnsPosition, previousIndex);
|
|
11830
|
-
}
|
|
11831
|
-
return sorted;
|
|
11832
|
-
}
|
|
11833
|
-
insertColumnsAt(existingColumns, groupItems, positionSpec, previousGroup) {
|
|
11834
|
-
let insertIndex;
|
|
11835
|
-
if (positionSpec.relativeTo) {
|
|
11836
|
-
insertIndex = this.calcInsertIndexRelativeToColumn(positionSpec.position, positionSpec.relativeTo, existingColumns);
|
|
11959
|
+
/** Selects all rows if they are not all selected; otherwise clear selection. */
|
|
11960
|
+
masterToggle() {
|
|
11961
|
+
this.log.debug('masterToggle triggered, toggling all!');
|
|
11962
|
+
if (this.isAllSelectedSnapshot) {
|
|
11963
|
+
this.selectionModel.clear();
|
|
11837
11964
|
}
|
|
11838
11965
|
else {
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
startIndex: insertIndex,
|
|
11844
|
-
endIndex: insertIndex + groupItems.length
|
|
11845
|
-
};
|
|
11846
|
-
}
|
|
11847
|
-
calcInsertIndexRelativeToColumn(position, relativeToCol, existingColumns) {
|
|
11848
|
-
const relativeIndex = existingColumns
|
|
11849
|
-
.findIndex(c => c.cdkColumn.name === relativeToCol);
|
|
11850
|
-
switch (position) {
|
|
11851
|
-
case 'start':
|
|
11852
|
-
case 'after':
|
|
11853
|
-
// after relative
|
|
11854
|
-
return relativeIndex + 1;
|
|
11855
|
-
case 'before':
|
|
11856
|
-
case 'end':
|
|
11857
|
-
// before relative
|
|
11858
|
-
return relativeIndex;
|
|
11859
|
-
}
|
|
11860
|
-
}
|
|
11861
|
-
calcInsertIndexRelativeToPreviousGroup(position, existingColumns, previousGroup) {
|
|
11862
|
-
switch (position) {
|
|
11863
|
-
case 'start':
|
|
11864
|
-
return 0;
|
|
11865
|
-
case 'end':
|
|
11866
|
-
return existingColumns.length;
|
|
11867
|
-
case 'after':
|
|
11868
|
-
// after relative to previous group
|
|
11869
|
-
return previousGroup.endIndex;
|
|
11870
|
-
case 'before':
|
|
11871
|
-
// before relative to previous group
|
|
11872
|
-
return previousGroup.startIndex;
|
|
11966
|
+
const context = this.dataContext$.getValue();
|
|
11967
|
+
if (context) {
|
|
11968
|
+
this.selectionModel.select(context.snapshot.data);
|
|
11969
|
+
}
|
|
11873
11970
|
}
|
|
11874
11971
|
}
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
class ElderTableGroup {
|
|
11884
|
-
constructor(id, index) {
|
|
11885
|
-
this.id = id;
|
|
11886
|
-
this.index = index;
|
|
11887
|
-
}
|
|
11888
|
-
static create(groupIndex) {
|
|
11889
|
-
return ElderTableGroup.of(UuidUtil.weakUuid4(), groupIndex);
|
|
11972
|
+
/***************************************************************************
|
|
11973
|
+
* *
|
|
11974
|
+
* Private methods *
|
|
11975
|
+
* *
|
|
11976
|
+
**************************************************************************/
|
|
11977
|
+
buildSelectionState$(selectionModel$, dataContext$) {
|
|
11978
|
+
return combineLatest([selectionModel$, dataContext$]).pipe(filter(([model, dc]) => !!model && !!dc), switchMap(([model, dc]) => this.buildSelectionStateInner$(model, dc)));
|
|
11890
11979
|
}
|
|
11891
|
-
|
|
11892
|
-
return
|
|
11980
|
+
buildSelectionStateInner$(model, dc) {
|
|
11981
|
+
return combineLatest([model.selection, dc.data]).pipe(map(([selection, currentData]) => {
|
|
11982
|
+
const unselectable = currentData.filter(i => !model.isSelectable(i));
|
|
11983
|
+
return new MasterSelectionState(selection.length, selection.length >= currentData.length - unselectable.length, selection.length > 0 && selection.length < currentData.length - unselectable.length, selection.length > 0);
|
|
11984
|
+
}));
|
|
11893
11985
|
}
|
|
11894
11986
|
}
|
|
11895
|
-
|
|
11987
|
+
DataContextSelectionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextSelectionDirective, deps: [{ token: SelectionModel, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
11988
|
+
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 });
|
|
11989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextSelectionDirective, decorators: [{
|
|
11990
|
+
type: Directive,
|
|
11991
|
+
args: [{
|
|
11992
|
+
selector: '[elderDataContextSelection]',
|
|
11993
|
+
exportAs: 'elderDataContextSelection'
|
|
11994
|
+
}]
|
|
11995
|
+
}], ctorParameters: function () { return [{ type: SelectionModel, decorators: [{
|
|
11996
|
+
type: Optional
|
|
11997
|
+
}] }]; }, propDecorators: { selectionModel: [{
|
|
11998
|
+
type: Input,
|
|
11999
|
+
args: ['elderDataContextSelectionModel']
|
|
12000
|
+
}], dataContext: [{
|
|
12001
|
+
type: Input,
|
|
12002
|
+
args: ['elderDataContextSelection']
|
|
12003
|
+
}] } });
|
|
12004
|
+
|
|
12005
|
+
class ElderSelectionMasterCheckboxComponent {
|
|
11896
12006
|
/***************************************************************************
|
|
11897
12007
|
* *
|
|
11898
12008
|
* Constructor *
|
|
11899
12009
|
* *
|
|
11900
12010
|
**************************************************************************/
|
|
11901
|
-
constructor() {
|
|
12011
|
+
constructor(dataContextSelection) {
|
|
12012
|
+
this.dataContextSelection = dataContextSelection;
|
|
11902
12013
|
/***************************************************************************
|
|
11903
12014
|
* *
|
|
11904
12015
|
* Fields *
|
|
11905
12016
|
* *
|
|
11906
12017
|
**************************************************************************/
|
|
11907
12018
|
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
11908
|
-
this.elderColumnLayout = new ElderColumnLayout();
|
|
11909
|
-
this._groups = new Map();
|
|
11910
|
-
this._columnGroups = new ReactiveMap();
|
|
11911
|
-
this._rowDefGroups = new ReactiveMap();
|
|
11912
|
-
this._sortGroups = new ReactiveMap();
|
|
11913
|
-
this.selectionVisible$ = new BehaviorSubject(false);
|
|
11914
|
-
/**
|
|
11915
|
-
* The columns to display explicitly set by the user.
|
|
11916
|
-
* We need to support inserting display columns by index or anchored to existing ones.
|
|
11917
|
-
* before([columns])
|
|
11918
|
-
* after()
|
|
11919
|
-
* start()
|
|
11920
|
-
* end([])
|
|
11921
|
-
* @private
|
|
11922
|
-
*/
|
|
11923
|
-
this.displayedColumns$ = new BehaviorSubject(undefined);
|
|
11924
|
-
this.displayedColumnsInner$ = this.renderDisplayedColumns(this.displayedColumns$, this.columnDefs$, this.selectionVisible$);
|
|
11925
12019
|
}
|
|
11926
12020
|
/***************************************************************************
|
|
11927
12021
|
* *
|
|
11928
|
-
*
|
|
12022
|
+
* Life Cycle *
|
|
11929
12023
|
* *
|
|
11930
12024
|
**************************************************************************/
|
|
11931
|
-
|
|
11932
|
-
this.selectionVisible$.next(visible);
|
|
11933
|
-
}
|
|
11934
|
-
get selectionVisible() {
|
|
11935
|
-
return this.selectionVisible$.getValue();
|
|
11936
|
-
}
|
|
11937
|
-
set displayedColumns(columns) {
|
|
11938
|
-
this.displayedColumns$.next(columns);
|
|
11939
|
-
}
|
|
11940
|
-
get displayedColumns() {
|
|
11941
|
-
return this.displayedColumns$.getValue();
|
|
12025
|
+
ngOnInit() {
|
|
11942
12026
|
}
|
|
12027
|
+
}
|
|
12028
|
+
ElderSelectionMasterCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionMasterCheckboxComponent, deps: [{ token: DataContextSelectionDirective }], target: i0.ɵɵFactoryTarget.Component });
|
|
12029
|
+
ElderSelectionMasterCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectionMasterCheckboxComponent, selector: "elder-selection-master-checkbox", ngImport: i0, template: "<div\n *ngIf=\"\n dataContextSelection.selectionModel.isMultipleSelection\n && dataContextSelection?.selectionState$ | async as selectionState\"\n\n fxLayout=\"column\" fxFlex=\"none\"\n\n [matBadgeHidden]=\"selectionState.count === 0\"\n [matBadge]=\"selectionState.count + ''\"\n [matBadgePosition]=\"'above before'\"\n [matBadgeOverlap]=\"false\"\n [matBadgeSize]=\"'small'\"\n>\n <mat-checkbox fxFlex=\"none\"\n (change)=\"$event ? dataContextSelection.masterToggle() : null\"\n [checked]=\"selectionState.allSelected\"\n [indeterminate]=\"selectionState.someSelected\"\n >\n </mat-checkbox>\n</div>\n\n<!-- -->\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$8.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i4$3.MatBadge, selector: "[matBadge]", inputs: ["matBadgeDisabled", "matBadgeColor", "matBadgeOverlap", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12030
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectionMasterCheckboxComponent, decorators: [{
|
|
12031
|
+
type: Component,
|
|
12032
|
+
args: [{ selector: 'elder-selection-master-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"\n dataContextSelection.selectionModel.isMultipleSelection\n && dataContextSelection?.selectionState$ | async as selectionState\"\n\n fxLayout=\"column\" fxFlex=\"none\"\n\n [matBadgeHidden]=\"selectionState.count === 0\"\n [matBadge]=\"selectionState.count + ''\"\n [matBadgePosition]=\"'above before'\"\n [matBadgeOverlap]=\"false\"\n [matBadgeSize]=\"'small'\"\n>\n <mat-checkbox fxFlex=\"none\"\n (change)=\"$event ? dataContextSelection.masterToggle() : null\"\n [checked]=\"selectionState.allSelected\"\n [indeterminate]=\"selectionState.someSelected\"\n >\n </mat-checkbox>\n</div>\n\n<!-- -->\n" }]
|
|
12033
|
+
}], ctorParameters: function () { return [{ type: DataContextSelectionDirective }]; } });
|
|
12034
|
+
|
|
12035
|
+
class DataContextStateIndicatorComponent {
|
|
11943
12036
|
/***************************************************************************
|
|
11944
12037
|
* *
|
|
11945
|
-
*
|
|
12038
|
+
* Constructor *
|
|
11946
12039
|
* *
|
|
11947
12040
|
**************************************************************************/
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
return this._sortGroups.values$;
|
|
11956
|
-
}
|
|
11957
|
-
// ---
|
|
11958
|
-
valuesSortedByGroupIndex(myMap, groups) {
|
|
11959
|
-
return Array.from(myMap.entries())
|
|
11960
|
-
.sort(([a_key], [b_key]) => {
|
|
11961
|
-
const grpAIndex = groups.get(a_key)?.index ?? 0;
|
|
11962
|
-
const grpBIndex = groups.get(b_key)?.index ?? 0;
|
|
11963
|
-
return naturalValueComparator(grpAIndex, grpBIndex);
|
|
11964
|
-
}).map(([a_key, a_value]) => a_value);
|
|
11965
|
-
}
|
|
11966
|
-
sortAndFlatten(reactMap) {
|
|
11967
|
-
return reactMap.map$.pipe(map(myMap => this.valuesSortedByGroupIndex(myMap, this._groups)), map(columns => CollectionUtil.flatten(columns)));
|
|
12041
|
+
constructor() {
|
|
12042
|
+
/***************************************************************************
|
|
12043
|
+
* *
|
|
12044
|
+
* Fields *
|
|
12045
|
+
* *
|
|
12046
|
+
**************************************************************************/
|
|
12047
|
+
this.dataContext$ = new BehaviorSubject(null);
|
|
11968
12048
|
}
|
|
11969
|
-
/*
|
|
11970
|
-
public get sortHeaders$(): Observable<MatSortHeader[]> {
|
|
11971
|
-
return this._sortGroups.values$.pipe(
|
|
11972
|
-
map(groups => this.flattenDefs(groups))
|
|
11973
|
-
);
|
|
11974
|
-
}*/
|
|
11975
12049
|
/***************************************************************************
|
|
11976
12050
|
* *
|
|
11977
|
-
*
|
|
12051
|
+
* Life Cycle *
|
|
11978
12052
|
* *
|
|
11979
12053
|
**************************************************************************/
|
|
11980
|
-
|
|
11981
|
-
this._groups.set(group.id, group);
|
|
11982
|
-
}
|
|
11983
|
-
updateColumnGroup(group, columnGroup) {
|
|
11984
|
-
this._columnGroups.set(group.id, columnGroup);
|
|
11985
|
-
}
|
|
11986
|
-
updateRowDefs(group, rows) {
|
|
11987
|
-
this._rowDefGroups.set(group.id, rows);
|
|
11988
|
-
}
|
|
11989
|
-
updateSortGroup(group, sort) {
|
|
11990
|
-
this._sortGroups.set(group.id, sort);
|
|
11991
|
-
}
|
|
11992
|
-
clearColumnDefGroup(group) {
|
|
11993
|
-
this._columnGroups.delete(group.id);
|
|
11994
|
-
}
|
|
11995
|
-
clearRowDefGroup(group) {
|
|
11996
|
-
this._rowDefGroups.delete(group.id);
|
|
11997
|
-
}
|
|
11998
|
-
clearSortGroup(group) {
|
|
11999
|
-
this._sortGroups.delete(group.id);
|
|
12000
|
-
}
|
|
12001
|
-
deRegisterGroup(group) {
|
|
12002
|
-
this.clearColumnDefGroup(group);
|
|
12003
|
-
this.clearRowDefGroup(group);
|
|
12004
|
-
this.clearSortGroup(group);
|
|
12005
|
-
this._groups.delete(group.id);
|
|
12054
|
+
ngOnInit() {
|
|
12006
12055
|
}
|
|
12007
12056
|
/***************************************************************************
|
|
12008
12057
|
* *
|
|
12009
|
-
*
|
|
12058
|
+
* Properties *
|
|
12010
12059
|
* *
|
|
12011
12060
|
**************************************************************************/
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
let columns = displayedColumns;
|
|
12015
|
-
if (!columns) {
|
|
12016
|
-
columns = [];
|
|
12017
|
-
// If the user did not define columns to display
|
|
12018
|
-
// Assume he wants all his own columns in given order
|
|
12019
|
-
if (columnDefs) {
|
|
12020
|
-
columnDefs.forEach(col => {
|
|
12021
|
-
columns.push(col.name);
|
|
12022
|
-
});
|
|
12023
|
-
}
|
|
12024
|
-
}
|
|
12025
|
-
if (this.selectionVisible) {
|
|
12026
|
-
columns = ['select', ...columns];
|
|
12027
|
-
}
|
|
12028
|
-
return columns;
|
|
12029
|
-
}));
|
|
12061
|
+
set dataContext(dataContext) {
|
|
12062
|
+
this.dataContext$.next(dataContext);
|
|
12030
12063
|
}
|
|
12031
12064
|
}
|
|
12032
|
-
|
|
12033
|
-
|
|
12034
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
12035
|
-
type:
|
|
12036
|
-
|
|
12065
|
+
DataContextStateIndicatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextStateIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12066
|
+
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 });
|
|
12067
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataContextStateIndicatorComponent, decorators: [{
|
|
12068
|
+
type: Component,
|
|
12069
|
+
args: [{ selector: 'elder-data-context-state-indicator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"dataContext$ | async as dataContext\">\n\n <ng-container *ngIf=\"dataContext else noDataContext\">\n\n <ng-container *ngIf=\"(dataContext.isStarted$ | async) else dataContextNotStarted\">\n\n <ng-container *ngIf=\"!(dataContext?.status | async)?.hasError else dataContextHasError\">\n\n <ng-container *ngIf=\"(dataContext?.data | async)?.length === 0\">\n <ng-template [ngTemplateOutlet]=\"dataContextNoData\"></ng-template>\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n</ng-container>\n\n<ng-template #noDataContext>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'No data context'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNotStarted>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'Data context not started'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextHasError>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', iconColor: 'warn', text: 'Error while loading data'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNoData>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'info', text: 'No data available'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #indicator let-icon=\"icon\" let-iconColor=\"iconColor\" let-text=\"text\">\n\n <div fxFill\n fxLayout=\"column\"\n fxLayoutAlign=\"center center\"\n class=\"elder-dc-indicator-container mat-body-1\"\n >\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"16px\">\n <mat-icon [color]=\"iconColor\">{{icon}}</mat-icon>\n <span class=\"hint mat-body-1\">{{text | translate}}</span>\n </div>\n\n </div>\n\n</ng-template>\n", styles: [".elder-dc-indicator-container{color:gray;padding-top:96px;padding-bottom:96px}\n"] }]
|
|
12070
|
+
}], ctorParameters: function () { return []; }, propDecorators: { dataContext: [{
|
|
12071
|
+
type: Input
|
|
12072
|
+
}] } });
|
|
12037
12073
|
|
|
12038
|
-
|
|
12039
|
-
return modelProvider ?? newElderTableModel();
|
|
12040
|
-
}
|
|
12041
|
-
function newElderTableModel() {
|
|
12042
|
-
return new ElderTableModel();
|
|
12043
|
-
}
|
|
12044
|
-
class ElderTableProviders {
|
|
12074
|
+
class ElderDataCommonModule {
|
|
12045
12075
|
}
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
|
|
12057
|
-
|
|
12058
|
-
|
|
12059
|
-
|
|
12060
|
-
|
|
12061
|
-
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
|
|
12065
|
-
|
|
12066
|
-
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
};
|
|
12076
|
+
ElderDataCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12077
|
+
ElderDataCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, declarations: [ElderDataToolbarComponent,
|
|
12078
|
+
ElderToolbarContentDirective,
|
|
12079
|
+
ElderSingleSortComponent,
|
|
12080
|
+
ElderSelectionMasterCheckboxComponent,
|
|
12081
|
+
DataContextSelectionDirective,
|
|
12082
|
+
DataContextStateIndicatorComponent], imports: [CommonModule, RouterModule,
|
|
12083
|
+
// Material
|
|
12084
|
+
MatDividerModule,
|
|
12085
|
+
MatCheckboxModule, MatMenuModule,
|
|
12086
|
+
MatButtonModule, MatIconModule, MatBadgeModule,
|
|
12087
|
+
MatProgressBarModule,
|
|
12088
|
+
MatDialogModule, MatTooltipModule,
|
|
12089
|
+
// translations
|
|
12090
|
+
TranslateModule, FlexLayoutModule], exports: [ElderDataToolbarComponent,
|
|
12091
|
+
ElderToolbarContentDirective,
|
|
12092
|
+
ElderSingleSortComponent,
|
|
12093
|
+
ElderSelectionMasterCheckboxComponent,
|
|
12094
|
+
DataContextSelectionDirective,
|
|
12095
|
+
DataContextStateIndicatorComponent] });
|
|
12096
|
+
ElderDataCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, imports: [CommonModule, RouterModule,
|
|
12097
|
+
// Material
|
|
12098
|
+
MatDividerModule,
|
|
12099
|
+
MatCheckboxModule, MatMenuModule,
|
|
12100
|
+
MatButtonModule, MatIconModule, MatBadgeModule,
|
|
12101
|
+
MatProgressBarModule,
|
|
12102
|
+
MatDialogModule, MatTooltipModule,
|
|
12103
|
+
// translations
|
|
12104
|
+
TranslateModule, FlexLayoutModule] });
|
|
12105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataCommonModule, decorators: [{
|
|
12106
|
+
type: NgModule,
|
|
12107
|
+
args: [{
|
|
12108
|
+
imports: [
|
|
12109
|
+
CommonModule, RouterModule,
|
|
12110
|
+
// Material
|
|
12111
|
+
MatDividerModule,
|
|
12112
|
+
MatCheckboxModule, MatMenuModule,
|
|
12113
|
+
MatButtonModule, MatIconModule, MatBadgeModule,
|
|
12114
|
+
MatProgressBarModule,
|
|
12115
|
+
MatDialogModule, MatTooltipModule,
|
|
12116
|
+
// translations
|
|
12117
|
+
TranslateModule, FlexLayoutModule,
|
|
12118
|
+
],
|
|
12119
|
+
declarations: [
|
|
12120
|
+
ElderDataToolbarComponent,
|
|
12121
|
+
ElderToolbarContentDirective,
|
|
12122
|
+
ElderSingleSortComponent,
|
|
12123
|
+
ElderSelectionMasterCheckboxComponent,
|
|
12124
|
+
DataContextSelectionDirective,
|
|
12125
|
+
DataContextStateIndicatorComponent
|
|
12126
|
+
],
|
|
12127
|
+
exports: [
|
|
12128
|
+
ElderDataToolbarComponent,
|
|
12129
|
+
ElderToolbarContentDirective,
|
|
12130
|
+
ElderSingleSortComponent,
|
|
12131
|
+
ElderSelectionMasterCheckboxComponent,
|
|
12132
|
+
DataContextSelectionDirective,
|
|
12133
|
+
DataContextStateIndicatorComponent
|
|
12134
|
+
],
|
|
12135
|
+
}]
|
|
12136
|
+
}] });
|
|
12075
12137
|
|
|
12076
|
-
|
|
12077
|
-
* Configures the selection mode on supporting components.
|
|
12078
|
-
*/
|
|
12079
|
-
class ElderDataViewSelectionMode {
|
|
12080
|
-
constructor() {
|
|
12081
|
-
this.sorts = [];
|
|
12082
|
-
this.filters = [];
|
|
12083
|
-
this.multi = false;
|
|
12084
|
-
}
|
|
12085
|
-
}
|
|
12086
|
-
function createSelectionModel() {
|
|
12087
|
-
return new SelectionModel();
|
|
12088
|
-
}
|
|
12089
|
-
function createDataViewSelection() {
|
|
12090
|
-
return new ElderDataViewSelectionMode();
|
|
12091
|
-
}
|
|
12092
|
-
class SelectionModelPopupDirective {
|
|
12138
|
+
class ElderTableRowDirective {
|
|
12093
12139
|
/***************************************************************************
|
|
12094
12140
|
* *
|
|
12095
12141
|
* Constructor *
|
|
12096
12142
|
* *
|
|
12097
12143
|
**************************************************************************/
|
|
12098
|
-
constructor(
|
|
12099
|
-
this.
|
|
12100
|
-
this.
|
|
12101
|
-
this.dialog = dialog;
|
|
12102
|
-
this.dataViewSelectionMode = dataViewSelectionMode;
|
|
12103
|
-
this.selectionModel = selectionModel;
|
|
12104
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
12144
|
+
constructor(rowRef, renderer) {
|
|
12145
|
+
this.rowRef = rowRef;
|
|
12146
|
+
this.renderer = renderer;
|
|
12105
12147
|
/***************************************************************************
|
|
12106
12148
|
* *
|
|
12107
12149
|
* Fields *
|
|
12108
12150
|
* *
|
|
12109
12151
|
**************************************************************************/
|
|
12110
|
-
this.
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
this._transformerFn = fn;
|
|
12152
|
+
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
12153
|
+
this._activated = false;
|
|
12154
|
+
this.focused$ = new BehaviorSubject(false);
|
|
12114
12155
|
}
|
|
12115
12156
|
/***************************************************************************
|
|
12116
12157
|
* *
|
|
12117
|
-
* Host
|
|
12158
|
+
* Host Listener *
|
|
12118
12159
|
* *
|
|
12119
12160
|
**************************************************************************/
|
|
12161
|
+
onFocus(event) {
|
|
12162
|
+
this.focused$.next(true);
|
|
12163
|
+
if (this.tableActivation) {
|
|
12164
|
+
this.tableActivation.activate(this._model);
|
|
12165
|
+
}
|
|
12166
|
+
}
|
|
12167
|
+
onBlur(event) {
|
|
12168
|
+
this.focused$.next(false);
|
|
12169
|
+
}
|
|
12120
12170
|
/***************************************************************************
|
|
12121
12171
|
* *
|
|
12122
|
-
*
|
|
12172
|
+
* Host Bindings *
|
|
12123
12173
|
* *
|
|
12124
12174
|
**************************************************************************/
|
|
12125
|
-
|
|
12126
|
-
|
|
12175
|
+
get activated() {
|
|
12176
|
+
return this._activated;
|
|
12177
|
+
}
|
|
12178
|
+
set activated(value) {
|
|
12179
|
+
if (this._activated !== value) {
|
|
12180
|
+
this._activated = value;
|
|
12181
|
+
this.activatedClassEnabled(value);
|
|
12182
|
+
}
|
|
12183
|
+
}
|
|
12127
12184
|
/***************************************************************************
|
|
12128
12185
|
* *
|
|
12129
|
-
*
|
|
12186
|
+
* Properties *
|
|
12130
12187
|
* *
|
|
12131
12188
|
**************************************************************************/
|
|
12132
|
-
|
|
12133
|
-
|
|
12134
|
-
|
|
12135
|
-
|
|
12136
|
-
this.
|
|
12137
|
-
|
|
12138
|
-
|
|
12139
|
-
this.
|
|
12140
|
-
|
|
12141
|
-
|
|
12142
|
-
this.
|
|
12143
|
-
const dialogRef = this.openSelectDialog();
|
|
12144
|
-
// This fixes dialog rendering when the browser template
|
|
12145
|
-
// view container is outside the invoking control, which
|
|
12146
|
-
// happens when use ng-content projection.
|
|
12147
|
-
this.changeDetectorRef.markForCheck();
|
|
12148
|
-
return dialogRef.afterClosed().pipe(switchMap((chosenEntities) => {
|
|
12149
|
-
if (chosenEntities) {
|
|
12150
|
-
return this._transformerFn
|
|
12151
|
-
? of(chosenEntities.map(value => this._transformerFn(value)))
|
|
12152
|
-
: of(chosenEntities);
|
|
12153
|
-
}
|
|
12154
|
-
else {
|
|
12155
|
-
return EMPTY;
|
|
12156
|
-
}
|
|
12157
|
-
}));
|
|
12189
|
+
set model(model) {
|
|
12190
|
+
this._model = model;
|
|
12191
|
+
}
|
|
12192
|
+
get model() {
|
|
12193
|
+
return this._model;
|
|
12194
|
+
}
|
|
12195
|
+
get tableActivation() {
|
|
12196
|
+
return this._tableActivation;
|
|
12197
|
+
}
|
|
12198
|
+
get hasFocus() {
|
|
12199
|
+
return this.focused$.getValue();
|
|
12158
12200
|
}
|
|
12159
12201
|
/***************************************************************************
|
|
12160
12202
|
* *
|
|
12161
|
-
*
|
|
12203
|
+
* Public API *
|
|
12162
12204
|
* *
|
|
12163
12205
|
**************************************************************************/
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
|
|
12206
|
+
bindTableActivation(activation) {
|
|
12207
|
+
if (this._tableActivation !== activation) {
|
|
12208
|
+
this._tableActivation = activation;
|
|
12209
|
+
this.enableRowFocus(!!this._tableActivation);
|
|
12210
|
+
if (!activation) {
|
|
12211
|
+
this.activated = false;
|
|
12212
|
+
}
|
|
12213
|
+
}
|
|
12214
|
+
}
|
|
12215
|
+
bringToView() {
|
|
12216
|
+
const row = this.rowRef.nativeElement;
|
|
12217
|
+
// scroll-snap-align: start;
|
|
12218
|
+
row.scrollIntoView({
|
|
12219
|
+
block: 'nearest',
|
|
12220
|
+
inline: 'nearest' // horizontal alignment
|
|
12173
12221
|
});
|
|
12174
12222
|
}
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12178
|
-
|
|
12179
|
-
provide: SelectionModel,
|
|
12180
|
-
useFactory: createSelectionModel
|
|
12181
|
-
},
|
|
12182
|
-
{
|
|
12183
|
-
provide: ElderDataViewSelectionMode,
|
|
12184
|
-
useFactory: createDataViewSelection
|
|
12185
|
-
},
|
|
12186
|
-
ElderTableProviders.ClearTableModel // Since this popup is frequently used inside an elder-table search box
|
|
12187
|
-
], ngImport: i0 });
|
|
12188
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SelectionModelPopupDirective, decorators: [{
|
|
12189
|
-
type: Directive,
|
|
12190
|
-
args: [{
|
|
12191
|
-
selector: '[elderSelectionModelPopup]',
|
|
12192
|
-
providers: [
|
|
12193
|
-
{
|
|
12194
|
-
provide: SelectionModel,
|
|
12195
|
-
useFactory: createSelectionModel
|
|
12196
|
-
},
|
|
12197
|
-
{
|
|
12198
|
-
provide: ElderDataViewSelectionMode,
|
|
12199
|
-
useFactory: createDataViewSelection
|
|
12200
|
-
},
|
|
12201
|
-
ElderTableProviders.ClearTableModel // Since this popup is frequently used inside an elder-table search box
|
|
12202
|
-
]
|
|
12203
|
-
}]
|
|
12204
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i1$7.MatDialog }, { type: ElderDataViewSelectionMode }, { type: SelectionModel }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { elderSelectionModelPopupTransform: [{
|
|
12205
|
-
type: Input,
|
|
12206
|
-
args: ['elderSelectionModelPopupTransform']
|
|
12207
|
-
}] } });
|
|
12208
|
-
|
|
12209
|
-
class ElderDataViewBaseComponent {
|
|
12223
|
+
foucs() {
|
|
12224
|
+
const row = this.rowRef.nativeElement;
|
|
12225
|
+
row.focus();
|
|
12226
|
+
}
|
|
12210
12227
|
/***************************************************************************
|
|
12211
12228
|
* *
|
|
12212
|
-
*
|
|
12229
|
+
* Private methods *
|
|
12213
12230
|
* *
|
|
12214
12231
|
**************************************************************************/
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
* Fields *
|
|
12220
|
-
* *
|
|
12221
|
-
**************************************************************************/
|
|
12222
|
-
/**
|
|
12223
|
-
* Underlying data context.
|
|
12224
|
-
*/
|
|
12225
|
-
this.dataContext$ = new BehaviorSubject(null);
|
|
12226
|
-
this.interactionMode = 'open';
|
|
12227
|
-
/**
|
|
12228
|
-
* If true, this table is in dense mode.
|
|
12229
|
-
* Heights are generally reduced.
|
|
12230
|
-
*/
|
|
12231
|
-
this._dense = false;
|
|
12232
|
-
/**
|
|
12233
|
-
* If true, this table is in a floating card mode.
|
|
12234
|
-
* Otherwise, it is flat on the current panel.
|
|
12235
|
-
*/
|
|
12236
|
-
this._float = false;
|
|
12237
|
-
/**
|
|
12238
|
-
* If true, this table is in embedded mode.
|
|
12239
|
-
* No borders / floating visible so that the table can be embedded into another container
|
|
12240
|
-
*/
|
|
12241
|
-
this._embedded = false;
|
|
12242
|
-
this._itemClickSubject = new Subject();
|
|
12243
|
-
this.EntityIdKeyFn = (entity) => entity ? this.getId(entity) : 0;
|
|
12244
|
-
if (!selectionModel) {
|
|
12245
|
-
this.selectionModel = new SelectionModel(false, [], this.EntityIdKeyFn);
|
|
12232
|
+
enableRowFocus(enable) {
|
|
12233
|
+
// Make the rows focusable on click (but not on tabs)
|
|
12234
|
+
if (enable) {
|
|
12235
|
+
this.renderer.setAttribute(this.rowRef.nativeElement, 'tabIndex', '-1');
|
|
12246
12236
|
}
|
|
12247
12237
|
else {
|
|
12248
|
-
this.
|
|
12238
|
+
this.renderer.removeAttribute(this.rowRef.nativeElement, 'tabIndex');
|
|
12249
12239
|
}
|
|
12250
12240
|
}
|
|
12251
|
-
|
|
12252
|
-
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
**************************************************************************/
|
|
12256
|
-
get dataContext() {
|
|
12257
|
-
return this.dataContext$.getValue();
|
|
12258
|
-
}
|
|
12259
|
-
set dataContext(data) {
|
|
12260
|
-
this.dataContext$.next(data);
|
|
12261
|
-
this.onDataContextSet(data);
|
|
12262
|
-
}
|
|
12263
|
-
get dataActivePaged() {
|
|
12264
|
-
return this.dataContext;
|
|
12265
|
-
}
|
|
12266
|
-
get dataContinuable() {
|
|
12267
|
-
return this.dataContext;
|
|
12268
|
-
}
|
|
12269
|
-
get isContinuable() {
|
|
12270
|
-
if (!this.dataContext) {
|
|
12271
|
-
return false;
|
|
12241
|
+
activatedClassEnabled(enabled) {
|
|
12242
|
+
const activatedClass = 'elder-table-row-activated';
|
|
12243
|
+
if (enabled) {
|
|
12244
|
+
this.renderer.addClass(this.rowRef.nativeElement, activatedClass);
|
|
12272
12245
|
}
|
|
12273
|
-
|
|
12274
|
-
|
|
12275
|
-
get isActivePaged() {
|
|
12276
|
-
if (!this.dataContext) {
|
|
12277
|
-
return false;
|
|
12246
|
+
else {
|
|
12247
|
+
this.renderer.removeClass(this.rowRef.nativeElement, activatedClass);
|
|
12278
12248
|
}
|
|
12279
|
-
return isActivePagedDataContext(this.dataContext);
|
|
12280
12249
|
}
|
|
12281
|
-
|
|
12282
|
-
|
|
12283
|
-
|
|
12284
|
-
|
|
12285
|
-
|
|
12286
|
-
|
|
12287
|
-
|
|
12250
|
+
}
|
|
12251
|
+
ElderTableRowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableRowDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
12252
|
+
ElderTableRowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderTableRowDirective, selector: "tr[elderTableRow]", inputs: { model: ["elderTableRow", "model"] }, host: { listeners: { "focus": "onFocus($event)", "blur": "onBlur($event)" } }, exportAs: ["elderTableRow"], ngImport: i0 });
|
|
12253
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableRowDirective, decorators: [{
|
|
12254
|
+
type: Directive,
|
|
12255
|
+
args: [{
|
|
12256
|
+
selector: 'tr[elderTableRow]',
|
|
12257
|
+
exportAs: 'elderTableRow'
|
|
12258
|
+
}]
|
|
12259
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { onFocus: [{
|
|
12260
|
+
type: HostListener,
|
|
12261
|
+
args: ['focus', ['$event']]
|
|
12262
|
+
}], onBlur: [{
|
|
12263
|
+
type: HostListener,
|
|
12264
|
+
args: ['blur', ['$event']]
|
|
12265
|
+
}], model: [{
|
|
12266
|
+
type: Input,
|
|
12267
|
+
args: ['elderTableRow']
|
|
12268
|
+
}] } });
|
|
12269
|
+
|
|
12270
|
+
class ColumnPositionSpec {
|
|
12271
|
+
constructor(position, relativeTo) {
|
|
12272
|
+
this.position = position;
|
|
12273
|
+
this.relativeTo = relativeTo;
|
|
12288
12274
|
}
|
|
12289
|
-
|
|
12290
|
-
|
|
12275
|
+
static relativeToColumn(col, position) {
|
|
12276
|
+
return new ColumnPositionSpec(position, col);
|
|
12291
12277
|
}
|
|
12292
|
-
|
|
12293
|
-
return
|
|
12278
|
+
static relativeToPrevGroup(position) {
|
|
12279
|
+
return new ColumnPositionSpec(position, null);
|
|
12294
12280
|
}
|
|
12295
|
-
|
|
12296
|
-
|
|
12297
|
-
|
|
12298
|
-
|
|
12299
|
-
|
|
12300
|
-
|
|
12301
|
-
return null;
|
|
12302
|
-
}
|
|
12303
|
-
}));
|
|
12281
|
+
}
|
|
12282
|
+
class ElderColumnGroup {
|
|
12283
|
+
constructor(groupIndex, columnsPosition, columns) {
|
|
12284
|
+
this.groupIndex = groupIndex;
|
|
12285
|
+
this.columnsPosition = columnsPosition;
|
|
12286
|
+
this.columns = columns;
|
|
12304
12287
|
}
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12288
|
+
}
|
|
12289
|
+
class ElderColumnLayout {
|
|
12290
|
+
constructor() {
|
|
12291
|
+
/***************************************************************************
|
|
12292
|
+
* *
|
|
12293
|
+
* Fields *
|
|
12294
|
+
* *
|
|
12295
|
+
**************************************************************************/
|
|
12296
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
12309
12297
|
}
|
|
12310
12298
|
/***************************************************************************
|
|
12311
12299
|
* *
|
|
12312
|
-
*
|
|
12300
|
+
* Public API *
|
|
12313
12301
|
* *
|
|
12314
12302
|
**************************************************************************/
|
|
12315
|
-
|
|
12316
|
-
|
|
12303
|
+
layoutColumns(colGroups) {
|
|
12304
|
+
const sortedCols = this.renderColumns(colGroups);
|
|
12305
|
+
// Support absolute column positioning
|
|
12306
|
+
const cdkCols = sortedCols.map(col => col.cdkColumn);
|
|
12307
|
+
return cdkCols;
|
|
12317
12308
|
}
|
|
12318
12309
|
/***************************************************************************
|
|
12319
12310
|
* *
|
|
12320
|
-
*
|
|
12311
|
+
* Private methods *
|
|
12321
12312
|
* *
|
|
12322
12313
|
**************************************************************************/
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12333
|
-
|
|
12334
|
-
|
|
12335
|
-
|
|
12336
|
-
this._embedded = coerceBooleanProperty(value);
|
|
12337
|
-
}
|
|
12338
|
-
get embedded() {
|
|
12339
|
-
return this._embedded;
|
|
12314
|
+
renderColumns(colGroups) {
|
|
12315
|
+
const groupHierarchy = this.sortGroupsByIndex(colGroups);
|
|
12316
|
+
const sorted = [];
|
|
12317
|
+
// Now we can insert groups in defined order
|
|
12318
|
+
let previousIndex = {
|
|
12319
|
+
startIndex: 0,
|
|
12320
|
+
endIndex: 0
|
|
12321
|
+
};
|
|
12322
|
+
for (const grp of groupHierarchy) {
|
|
12323
|
+
// grp defined position relative to prev group
|
|
12324
|
+
previousIndex = this.insertColumnsAt(sorted, grp.columns, grp.columnsPosition, previousIndex);
|
|
12325
|
+
}
|
|
12326
|
+
return sorted;
|
|
12340
12327
|
}
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
|
|
12349
|
-
|
|
12350
|
-
|
|
12351
|
-
|
|
12352
|
-
|
|
12328
|
+
insertColumnsAt(existingColumns, groupItems, positionSpec, previousGroup) {
|
|
12329
|
+
let insertIndex;
|
|
12330
|
+
if (positionSpec.relativeTo) {
|
|
12331
|
+
insertIndex = this.calcInsertIndexRelativeToColumn(positionSpec.position, positionSpec.relativeTo, existingColumns);
|
|
12332
|
+
}
|
|
12333
|
+
else {
|
|
12334
|
+
insertIndex = this.calcInsertIndexRelativeToPreviousGroup(positionSpec.position, existingColumns, previousGroup);
|
|
12335
|
+
}
|
|
12336
|
+
existingColumns.splice(insertIndex, 0, ...groupItems);
|
|
12337
|
+
return {
|
|
12338
|
+
startIndex: insertIndex,
|
|
12339
|
+
endIndex: insertIndex + groupItems.length
|
|
12340
|
+
};
|
|
12353
12341
|
}
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
|
|
12366
|
-
this.selectionModel.toggle(entity);
|
|
12367
|
-
break;
|
|
12368
|
-
}
|
|
12342
|
+
calcInsertIndexRelativeToColumn(position, relativeToCol, existingColumns) {
|
|
12343
|
+
const relativeIndex = existingColumns
|
|
12344
|
+
.findIndex(c => c.cdkColumn.name === relativeToCol);
|
|
12345
|
+
switch (position) {
|
|
12346
|
+
case 'start':
|
|
12347
|
+
case 'after':
|
|
12348
|
+
// after relative
|
|
12349
|
+
return relativeIndex + 1;
|
|
12350
|
+
case 'before':
|
|
12351
|
+
case 'end':
|
|
12352
|
+
// before relative
|
|
12353
|
+
return relativeIndex;
|
|
12369
12354
|
}
|
|
12370
12355
|
}
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12376
|
-
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
|
|
12356
|
+
calcInsertIndexRelativeToPreviousGroup(position, existingColumns, previousGroup) {
|
|
12357
|
+
switch (position) {
|
|
12358
|
+
case 'start':
|
|
12359
|
+
return 0;
|
|
12360
|
+
case 'end':
|
|
12361
|
+
return existingColumns.length;
|
|
12362
|
+
case 'after':
|
|
12363
|
+
// after relative to previous group
|
|
12364
|
+
return previousGroup.endIndex;
|
|
12365
|
+
case 'before':
|
|
12366
|
+
// before relative to previous group
|
|
12367
|
+
return previousGroup.startIndex;
|
|
12382
12368
|
}
|
|
12383
12369
|
}
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
getId(entity) {
|
|
12390
|
-
return this.dataContext?.dataSource?.getId(entity) || entity;
|
|
12370
|
+
sortGroupsByIndex(colGroups) {
|
|
12371
|
+
return colGroups
|
|
12372
|
+
.sort((a, b) => {
|
|
12373
|
+
return naturalValueComparator(a.groupIndex, b.groupIndex);
|
|
12374
|
+
}).reverse();
|
|
12391
12375
|
}
|
|
12392
12376
|
}
|
|
12393
|
-
ElderDataViewBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseComponent, deps: [{ token: SelectionModel }, { token: ElderDataViewSelectionMode }], target: i0.ɵɵFactoryTarget.Component });
|
|
12394
|
-
ElderDataViewBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderDataViewBaseComponent, selector: "elder-data-view-base", inputs: { interactionMode: "interactionMode", selectableEvaluatorFn: "selectableEvaluatorFn", selection: "selection", selectionMultiEnabled: "selectionMultiEnabled", dense: "dense", float: "float", embedded: "embedded" }, outputs: { selectionChange: "selectionChange", selectionSingleChange: "selectionSingleChange", itemClick: "itemClick" }, ngImport: i0, template: '', isInline: true });
|
|
12395
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseComponent, decorators: [{
|
|
12396
|
-
type: Component,
|
|
12397
|
-
args: [{ selector: 'elder-data-view-base', template: '' }]
|
|
12398
|
-
}], ctorParameters: function () { return [{ type: SelectionModel }, { type: ElderDataViewSelectionMode }]; }, propDecorators: { interactionMode: [{
|
|
12399
|
-
type: Input
|
|
12400
|
-
}], selectableEvaluatorFn: [{
|
|
12401
|
-
type: Input
|
|
12402
|
-
}], selection: [{
|
|
12403
|
-
type: Input
|
|
12404
|
-
}], selectionChange: [{
|
|
12405
|
-
type: Output
|
|
12406
|
-
}], selectionSingleChange: [{
|
|
12407
|
-
type: Output
|
|
12408
|
-
}], selectionMultiEnabled: [{
|
|
12409
|
-
type: Input
|
|
12410
|
-
}], itemClick: [{
|
|
12411
|
-
type: Output
|
|
12412
|
-
}], dense: [{
|
|
12413
|
-
type: Input
|
|
12414
|
-
}], float: [{
|
|
12415
|
-
type: Input
|
|
12416
|
-
}], embedded: [{
|
|
12417
|
-
type: Input
|
|
12418
|
-
}] } });
|
|
12419
12377
|
|
|
12420
|
-
class
|
|
12378
|
+
class ElderTableGroup {
|
|
12379
|
+
constructor(id, index) {
|
|
12380
|
+
this.id = id;
|
|
12381
|
+
this.index = index;
|
|
12382
|
+
}
|
|
12383
|
+
static create(groupIndex) {
|
|
12384
|
+
return ElderTableGroup.of(UuidUtil.weakUuid4(), groupIndex);
|
|
12385
|
+
}
|
|
12386
|
+
static of(id, groupIndex) {
|
|
12387
|
+
return new ElderTableGroup(id, groupIndex);
|
|
12388
|
+
}
|
|
12421
12389
|
}
|
|
12422
|
-
|
|
12423
|
-
ElderDataViewBaseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseModule, declarations: [ElderDataViewBaseComponent], imports: [CommonModule] });
|
|
12424
|
-
ElderDataViewBaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseModule, imports: [CommonModule] });
|
|
12425
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderDataViewBaseModule, decorators: [{
|
|
12426
|
-
type: NgModule,
|
|
12427
|
-
args: [{
|
|
12428
|
-
declarations: [ElderDataViewBaseComponent],
|
|
12429
|
-
imports: [CommonModule],
|
|
12430
|
-
}]
|
|
12431
|
-
}] });
|
|
12432
|
-
|
|
12433
|
-
class ElderTableRowDirective {
|
|
12390
|
+
class ElderTableModel {
|
|
12434
12391
|
/***************************************************************************
|
|
12435
12392
|
* *
|
|
12436
12393
|
* Constructor *
|
|
12437
12394
|
* *
|
|
12438
12395
|
**************************************************************************/
|
|
12439
|
-
constructor(
|
|
12440
|
-
this.rowRef = rowRef;
|
|
12441
|
-
this.renderer = renderer;
|
|
12396
|
+
constructor() {
|
|
12442
12397
|
/***************************************************************************
|
|
12443
12398
|
* *
|
|
12444
12399
|
* Fields *
|
|
12445
12400
|
* *
|
|
12446
12401
|
**************************************************************************/
|
|
12447
12402
|
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
12448
|
-
this.
|
|
12449
|
-
this.
|
|
12403
|
+
this.elderColumnLayout = new ElderColumnLayout();
|
|
12404
|
+
this._groups = new Map();
|
|
12405
|
+
this._columnGroups = new ReactiveMap();
|
|
12406
|
+
this._rowDefGroups = new ReactiveMap();
|
|
12407
|
+
this._sortGroups = new ReactiveMap();
|
|
12408
|
+
this.selectionVisible$ = new BehaviorSubject(false);
|
|
12409
|
+
/**
|
|
12410
|
+
* The columns to display explicitly set by the user.
|
|
12411
|
+
* We need to support inserting display columns by index or anchored to existing ones.
|
|
12412
|
+
* before([columns])
|
|
12413
|
+
* after()
|
|
12414
|
+
* start()
|
|
12415
|
+
* end([])
|
|
12416
|
+
* @private
|
|
12417
|
+
*/
|
|
12418
|
+
this.displayedColumns$ = new BehaviorSubject(undefined);
|
|
12419
|
+
this.displayedColumnsInner$ = this.renderDisplayedColumns(this.displayedColumns$, this.columnDefs$, this.selectionVisible$);
|
|
12450
12420
|
}
|
|
12451
12421
|
/***************************************************************************
|
|
12452
12422
|
* *
|
|
12453
|
-
*
|
|
12423
|
+
* Properties *
|
|
12454
12424
|
* *
|
|
12455
12425
|
**************************************************************************/
|
|
12456
|
-
|
|
12457
|
-
this.
|
|
12458
|
-
if (this.tableActivation) {
|
|
12459
|
-
this.tableActivation.activate(this._model);
|
|
12460
|
-
}
|
|
12426
|
+
set selectionVisible(visible) {
|
|
12427
|
+
this.selectionVisible$.next(visible);
|
|
12461
12428
|
}
|
|
12462
|
-
|
|
12463
|
-
this.
|
|
12429
|
+
get selectionVisible() {
|
|
12430
|
+
return this.selectionVisible$.getValue();
|
|
12431
|
+
}
|
|
12432
|
+
set displayedColumns(columns) {
|
|
12433
|
+
this.displayedColumns$.next(columns);
|
|
12434
|
+
}
|
|
12435
|
+
get displayedColumns() {
|
|
12436
|
+
return this.displayedColumns$.getValue();
|
|
12464
12437
|
}
|
|
12465
12438
|
/***************************************************************************
|
|
12466
12439
|
* *
|
|
12467
|
-
*
|
|
12440
|
+
* Rendered Properties *
|
|
12468
12441
|
* *
|
|
12469
12442
|
**************************************************************************/
|
|
12470
|
-
get
|
|
12471
|
-
return this.
|
|
12443
|
+
get columnDefs$() {
|
|
12444
|
+
return this._columnGroups.values$.pipe(map(groups => this.elderColumnLayout.layoutColumns(groups)));
|
|
12472
12445
|
}
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12446
|
+
get rowDefs$() {
|
|
12447
|
+
return this.sortAndFlatten(this._rowDefGroups);
|
|
12448
|
+
}
|
|
12449
|
+
get sorts$() {
|
|
12450
|
+
return this._sortGroups.values$;
|
|
12451
|
+
}
|
|
12452
|
+
// ---
|
|
12453
|
+
valuesSortedByGroupIndex(myMap, groups) {
|
|
12454
|
+
return Array.from(myMap.entries())
|
|
12455
|
+
.sort(([a_key], [b_key]) => {
|
|
12456
|
+
const grpAIndex = groups.get(a_key)?.index ?? 0;
|
|
12457
|
+
const grpBIndex = groups.get(b_key)?.index ?? 0;
|
|
12458
|
+
return naturalValueComparator(grpAIndex, grpBIndex);
|
|
12459
|
+
}).map(([a_key, a_value]) => a_value);
|
|
12460
|
+
}
|
|
12461
|
+
sortAndFlatten(reactMap) {
|
|
12462
|
+
return reactMap.map$.pipe(map(myMap => this.valuesSortedByGroupIndex(myMap, this._groups)), map(columns => CollectionUtil.flatten(columns)));
|
|
12478
12463
|
}
|
|
12464
|
+
/*
|
|
12465
|
+
public get sortHeaders$(): Observable<MatSortHeader[]> {
|
|
12466
|
+
return this._sortGroups.values$.pipe(
|
|
12467
|
+
map(groups => this.flattenDefs(groups))
|
|
12468
|
+
);
|
|
12469
|
+
}*/
|
|
12479
12470
|
/***************************************************************************
|
|
12480
12471
|
* *
|
|
12481
|
-
*
|
|
12472
|
+
* Public API *
|
|
12482
12473
|
* *
|
|
12483
12474
|
**************************************************************************/
|
|
12484
|
-
|
|
12485
|
-
this.
|
|
12475
|
+
registerGroup(group) {
|
|
12476
|
+
this._groups.set(group.id, group);
|
|
12486
12477
|
}
|
|
12487
|
-
|
|
12488
|
-
|
|
12478
|
+
updateColumnGroup(group, columnGroup) {
|
|
12479
|
+
this._columnGroups.set(group.id, columnGroup);
|
|
12489
12480
|
}
|
|
12490
|
-
|
|
12491
|
-
|
|
12481
|
+
updateRowDefs(group, rows) {
|
|
12482
|
+
this._rowDefGroups.set(group.id, rows);
|
|
12492
12483
|
}
|
|
12493
|
-
|
|
12494
|
-
|
|
12484
|
+
updateSortGroup(group, sort) {
|
|
12485
|
+
this._sortGroups.set(group.id, sort);
|
|
12495
12486
|
}
|
|
12496
|
-
|
|
12497
|
-
|
|
12498
|
-
* Public API *
|
|
12499
|
-
* *
|
|
12500
|
-
**************************************************************************/
|
|
12501
|
-
bindTableActivation(activation) {
|
|
12502
|
-
if (this._tableActivation !== activation) {
|
|
12503
|
-
this._tableActivation = activation;
|
|
12504
|
-
this.enableRowFocus(!!this._tableActivation);
|
|
12505
|
-
if (!activation) {
|
|
12506
|
-
this.activated = false;
|
|
12507
|
-
}
|
|
12508
|
-
}
|
|
12487
|
+
clearColumnDefGroup(group) {
|
|
12488
|
+
this._columnGroups.delete(group.id);
|
|
12509
12489
|
}
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
// scroll-snap-align: start;
|
|
12513
|
-
row.scrollIntoView({
|
|
12514
|
-
block: 'nearest',
|
|
12515
|
-
inline: 'nearest' // horizontal alignment
|
|
12516
|
-
});
|
|
12490
|
+
clearRowDefGroup(group) {
|
|
12491
|
+
this._rowDefGroups.delete(group.id);
|
|
12517
12492
|
}
|
|
12518
|
-
|
|
12519
|
-
|
|
12520
|
-
|
|
12493
|
+
clearSortGroup(group) {
|
|
12494
|
+
this._sortGroups.delete(group.id);
|
|
12495
|
+
}
|
|
12496
|
+
deRegisterGroup(group) {
|
|
12497
|
+
this.clearColumnDefGroup(group);
|
|
12498
|
+
this.clearRowDefGroup(group);
|
|
12499
|
+
this.clearSortGroup(group);
|
|
12500
|
+
this._groups.delete(group.id);
|
|
12521
12501
|
}
|
|
12522
12502
|
/***************************************************************************
|
|
12523
12503
|
* *
|
|
12524
12504
|
* Private methods *
|
|
12525
12505
|
* *
|
|
12526
12506
|
**************************************************************************/
|
|
12527
|
-
|
|
12528
|
-
|
|
12529
|
-
|
|
12530
|
-
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
|
|
12535
|
-
|
|
12536
|
-
|
|
12537
|
-
|
|
12538
|
-
|
|
12539
|
-
|
|
12540
|
-
|
|
12541
|
-
|
|
12542
|
-
|
|
12543
|
-
|
|
12507
|
+
renderDisplayedColumns(userDefinedColumns$, columnDefs$, selectionVisible$) {
|
|
12508
|
+
return combineLatest([userDefinedColumns$, columnDefs$, selectionVisible$]).pipe(map(([displayedColumns, columnDefs, selectionVisible]) => {
|
|
12509
|
+
let columns = displayedColumns;
|
|
12510
|
+
if (!columns) {
|
|
12511
|
+
columns = [];
|
|
12512
|
+
// If the user did not define columns to display
|
|
12513
|
+
// Assume he wants all his own columns in given order
|
|
12514
|
+
if (columnDefs) {
|
|
12515
|
+
columnDefs.forEach(col => {
|
|
12516
|
+
columns.push(col.name);
|
|
12517
|
+
});
|
|
12518
|
+
}
|
|
12519
|
+
}
|
|
12520
|
+
if (this.selectionVisible) {
|
|
12521
|
+
columns = ['select', ...columns];
|
|
12522
|
+
}
|
|
12523
|
+
return columns;
|
|
12524
|
+
}));
|
|
12544
12525
|
}
|
|
12545
12526
|
}
|
|
12546
|
-
|
|
12547
|
-
|
|
12548
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type:
|
|
12549
|
-
type:
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
|
|
12555
|
-
|
|
12556
|
-
|
|
12557
|
-
|
|
12558
|
-
|
|
12559
|
-
|
|
12560
|
-
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
|
|
12527
|
+
ElderTableModel.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
12528
|
+
ElderTableModel.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel });
|
|
12529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableModel, decorators: [{
|
|
12530
|
+
type: Injectable
|
|
12531
|
+
}], ctorParameters: function () { return []; } });
|
|
12532
|
+
|
|
12533
|
+
function existingOrNewElderTableModel(modelProvider) {
|
|
12534
|
+
return modelProvider ?? newElderTableModel();
|
|
12535
|
+
}
|
|
12536
|
+
function newElderTableModel() {
|
|
12537
|
+
return new ElderTableModel();
|
|
12538
|
+
}
|
|
12539
|
+
class ElderTableProviders {
|
|
12540
|
+
}
|
|
12541
|
+
/**
|
|
12542
|
+
* Uses the existing ElderTableModel from a parent if available.
|
|
12543
|
+
* Otherwise, creates a new ElderTableModel and provides it.
|
|
12544
|
+
*/
|
|
12545
|
+
ElderTableProviders.ExistingOrNewTableModel = {
|
|
12546
|
+
provide: ElderTableModel,
|
|
12547
|
+
useFactory: existingOrNewElderTableModel,
|
|
12548
|
+
deps: [[new Optional(), new SkipSelf(), ElderTableModel]]
|
|
12549
|
+
};
|
|
12550
|
+
/**
|
|
12551
|
+
* Creates a new ElderTableModel root and provides it,
|
|
12552
|
+
* even if there is an existing parent table model.
|
|
12553
|
+
*/
|
|
12554
|
+
ElderTableProviders.NewTableModelRoot = {
|
|
12555
|
+
provide: ElderTableModel,
|
|
12556
|
+
useFactory: newElderTableModel
|
|
12557
|
+
};
|
|
12558
|
+
/**
|
|
12559
|
+
* If there is an existing ElderTableModel service provided, clears it.
|
|
12560
|
+
*
|
|
12561
|
+
* Child components will therefore be blocked from accessing any parent TableModel service
|
|
12562
|
+
* and are instead forced to create their own.
|
|
12563
|
+
*
|
|
12564
|
+
* This supports nesting ElderTable without sharing the table model / columns.
|
|
12565
|
+
*/
|
|
12566
|
+
ElderTableProviders.ClearTableModel = {
|
|
12567
|
+
provide: ElderTableModel,
|
|
12568
|
+
useValue: null
|
|
12569
|
+
};
|
|
12564
12570
|
|
|
12565
12571
|
/**
|
|
12566
12572
|
* Binds the elder table model to the CDK table.
|
|
@@ -13082,8 +13088,8 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13082
13088
|
* Constructor *
|
|
13083
13089
|
* *
|
|
13084
13090
|
**************************************************************************/
|
|
13085
|
-
constructor(tableModel, selectionModel,
|
|
13086
|
-
super(selectionModel,
|
|
13091
|
+
constructor(tableModel, selectionModel, dataViewOptionsProvider, matSort, parentExtension, cdr, zone) {
|
|
13092
|
+
super(selectionModel, dataViewOptionsProvider);
|
|
13087
13093
|
this.tableModel = tableModel;
|
|
13088
13094
|
this.parentExtension = parentExtension;
|
|
13089
13095
|
this.cdr = cdr;
|
|
@@ -13094,7 +13100,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13094
13100
|
* *
|
|
13095
13101
|
**************************************************************************/
|
|
13096
13102
|
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
13097
|
-
this.destroy$ = new Subject();
|
|
13098
13103
|
/**
|
|
13099
13104
|
* Load next chunk after current is done
|
|
13100
13105
|
*/
|
|
@@ -13115,14 +13120,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13115
13120
|
*/
|
|
13116
13121
|
this.hiddenField = null;
|
|
13117
13122
|
this.pageSizeOptions = [30, 50, 100, 150, 200];
|
|
13118
|
-
/**
|
|
13119
|
-
* Define if elder-table should clean up the
|
|
13120
|
-
* data-context resources for you.
|
|
13121
|
-
*
|
|
13122
|
-
* In more advanced scenarios where you plan to reuse the same data-context
|
|
13123
|
-
* set this to false and release the resources yourself. (dataContext.close)
|
|
13124
|
-
*/
|
|
13125
|
-
this.cleanUp = true;
|
|
13126
13123
|
this.keepSelection = true;
|
|
13127
13124
|
this.showFooter = false;
|
|
13128
13125
|
this.toolbarRowTemplates$ = new BehaviorSubject([]);
|
|
@@ -13142,16 +13139,7 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13142
13139
|
* *
|
|
13143
13140
|
**************************************************************************/
|
|
13144
13141
|
ngOnInit() {
|
|
13145
|
-
|
|
13146
|
-
this.selectionVisible = true;
|
|
13147
|
-
this.selectionMultiEnabled = this.dataViewSelection.multi;
|
|
13148
|
-
this.interactionMode = 'selection';
|
|
13149
|
-
this.float = false;
|
|
13150
|
-
if (this.dataContext) {
|
|
13151
|
-
this.dataContext.filter.updateFilters(this.dataViewSelection.filters);
|
|
13152
|
-
this.dataContext.sort.updateSorts(this.dataViewSelection.sorts);
|
|
13153
|
-
}
|
|
13154
|
-
}
|
|
13142
|
+
super.ngOnInit();
|
|
13155
13143
|
ElderTableModelCdkTableBinding
|
|
13156
13144
|
.of(this.tableModel)
|
|
13157
13145
|
.table(this.matTable)
|
|
@@ -13181,11 +13169,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13181
13169
|
.updated(rows => this.rows$.next(rows))
|
|
13182
13170
|
.bindUntil(this.destroy$);
|
|
13183
13171
|
}
|
|
13184
|
-
ngOnDestroy() {
|
|
13185
|
-
this.destroy$.next();
|
|
13186
|
-
this.destroy$.complete();
|
|
13187
|
-
this.autoCleanUp();
|
|
13188
|
-
}
|
|
13189
13172
|
/***************************************************************************
|
|
13190
13173
|
* *
|
|
13191
13174
|
* Properties *
|
|
@@ -13309,18 +13292,9 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
13309
13292
|
}
|
|
13310
13293
|
});
|
|
13311
13294
|
}
|
|
13312
|
-
/**
|
|
13313
|
-
* Performs clean up of the current data context if auto clean up is enabled.
|
|
13314
|
-
*/
|
|
13315
|
-
autoCleanUp() {
|
|
13316
|
-
if (this.cleanUp && this.dataContext) {
|
|
13317
|
-
this.logger.debug('Releasing DataContext resources to prevent memory leak. [cleanUp]="true"');
|
|
13318
|
-
this.dataContext.close();
|
|
13319
|
-
}
|
|
13320
|
-
}
|
|
13321
13295
|
}
|
|
13322
|
-
ElderTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableComponent, deps: [{ token: ElderTableModel }, { token: SelectionModel, optional: true }, { token:
|
|
13323
|
-
ElderTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderTableComponent, selector: "elder-table, ebs-table", inputs: { idField: "idField", removingField: "removingField", hiddenField: "hiddenField", pageSizeOptions: "pageSizeOptions",
|
|
13296
|
+
ElderTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderTableComponent, deps: [{ token: ElderTableModel }, { token: SelectionModel, optional: true }, { token: ElderDataViewOptionsProvider, optional: true, skipSelf: true }, { token: i2$4.MatSort, optional: true }, { token: ElderTableExtensionDirective, optional: true, skipSelf: true }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
13297
|
+
ElderTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderTableComponent, selector: "elder-table, ebs-table", inputs: { idField: "idField", removingField: "removingField", hiddenField: "hiddenField", pageSizeOptions: "pageSizeOptions", keepSelection: "keepSelection", showFooter: "showFooter", toolbarTemplate: "toolbarTemplate", data: "data", displayedColumns: "displayedColumns", selectionVisible: "selectionVisible" }, providers: [
|
|
13324
13298
|
ElderTableProviders.ExistingOrNewTableModel,
|
|
13325
13299
|
{
|
|
13326
13300
|
provide: ELDER_DATA_VIEW,
|
|
@@ -13338,7 +13312,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
13338
13312
|
], template: "\n<div fxLayout=\"column\" fxFlex\n class=\"elder-table\"\n [class.elder-mat-table-container]=\"!embedded\"\n [class.mat-elevation-z5]=\"float\"\n [class.elder-mat-table-flat]=\"!embedded && !float\"\n>\n\n <!-- Toolbar Rows -->\n <ng-container *ngFor=\"let toolbarRowTemplate of toolbarRowTemplates$ | async\">\n <ng-template *ngTemplateOutlet=\"toolbarRowTemplate; context: {$implicit: this}\">\n </ng-template>\n </ng-container>\n\n <!-- Scrollable Table -->\n <div fxLayout=\"column\" class=\"scrollable elder-table-scroll\"\n infiniteScroll\n [eventThrottle]=\"150\"\n [offsetFactor]=\"2\"\n [ignoreScrollEvent]=\"!isContinuable || !(canLoadMore$ | async)\"\n (closeToEnd)=\"requestMoreDataZoned($event)\"\n >\n <table\n mat-table\n class=\"elder-mat-inner-table\"\n [trackBy]=\"trackByFn\"\n [dataSource]=\"$any(dataContext$ | async)\"\n [elderDataContextSelection]=\"dataContext$ | async\" #dataSelection=\"elderDataContextSelection\"\n [elderDataContextSelectionModel]=\"selectionModel\"\n >\n\n <!-- selection Column -->\n <ng-container matColumnDef=\"select\">\n <th mat-header-cell *matHeaderCellDef>\n <elder-selection-master-checkbox></elder-selection-master-checkbox>\n </th>\n <td mat-cell *matCellDef=\"let entity\">\n <mat-checkbox (click)=\"$event.stopPropagation()\"\n (change)=\"$event ? selectionModel.toggle(entity) : null\"\n [checked]=\"selectionModel.observeSelection(entity) | async\"\n [disabled]=\"!selectionModel.isSelectable(entity)\"\n class=\"elder-table-checkbox\"\n [class.elder-table-checkbox-visible]=\"(dataSelection.selectionState$ | async).anySelected\"\n >\n </mat-checkbox>\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container *ngIf=\"(tableModel.displayedColumnsInner$ | async) as displayedColumnsInner\">\n <tr mat-header-row *matHeaderRowDef=\"displayedColumnsInner; sticky: true\"></tr>\n <tr mat-row class=\"elder-table-row\"\n *matRowDef=\"let entity; columns: displayedColumnsInner;\"\n [elderTableRow]=\"entity\"\n [class.dense]=\"dense\"\n [class.elder-row-hidden]=\"hiddenField && entity[hiddenField]\"\n [class.elder-row-removing]=\"removingField && entity[removingField]\"\n [class.elder-table-row-selected]=\"interactionMode === 'selection' && selectionModel.observeSelection(entity) | async\"\n (click)=\"onItemClick(entity)\"\n (dblclick)=\"onItemDoubleClick(entity)\"\n >\n </tr>\n <ng-container *ngIf=\"showFooter\">\n <tr mat-footer-row *matFooterRowDef=\"displayedColumnsInner; sticky: true\"></tr>\n </ng-container>\n </ng-container>\n </table>\n </div>\n\n <elder-data-context-state-indicator fxFlex=\"none\" [dataContext]=\"dataContext\">\n </elder-data-context-state-indicator>\n\n <mat-progress-bar fxFlex=\"none\"\n [mode]=\"(dataContext?.loading | async) ? 'indeterminate' : 'determinate'\"\n [color]=\"((dataContext?.status | async)?.hasError) ? 'warn' : 'primary'\">\n </mat-progress-bar>\n\n <!-- Optional Paginator Toolbar -->\n <mat-paginator #matPaginator *ngIf=\"isActivePaged && (dataActivePaged.page | async) as page\"\n fxFlex=\"none\"\n [length]=\"dataContext?.total | async\"\n [pageIndex]=\"page?.index\"\n [pageSize]=\"page?.size\"\n [pageSizeOptions]=\"pageSizeOptions\">\n </mat-paginator>\n\n <!-- Optional Continuation Footer -->\n <div *ngIf=\"isContinuable\" class=\"elder-table-footer\"\n fxLayout=\"row\" fxFlex=\"none\" fxLayoutAlign=\"end center\" fxLayoutGap=\"10px\"\n style=\"padding-right: 10px\" >\n\n <span class=\"mat-caption noselect\" style=\"color: gray\">\n {{(dataContext?.data | async)?.length}} / {{total$ | async}}\n </span>\n\n <button mat-icon-button type=\"button\" color=\"primary\"\n [disabled]=\"!(canLoadMore$ | async)\"\n (click)=\"dataContinuable.loadMore()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </div>\n\n</div>\n", styles: [".elder-table-scroll{height:100%}.elder-mat-inner-table{width:100%}.elder-table-row.dense{height:42px!important}.elder-mat-table-container{border-radius:4px;overflow:hidden}.mat-column-select{overflow:initial;max-width:42px;width:42px}.elder-row-removing{text-decoration:line-through}.elder-row-hidden{display:none}.elder-table-row{cursor:pointer}:host{min-width:0;min-height:0}.elder-table-hint{color:gray}.elder-table-footer{height:44px}.elder-table-checkbox{opacity:.25;transition:opacity .5s ease-in-out}.elder-table-row:hover .elder-table-checkbox{opacity:.9}.elder-table-checkbox-visible{opacity:1}.mat-table .mat-header-cell{padding-left:8px;padding-right:12px;overflow-wrap:normal;word-wrap:normal;word-break:normal;white-space:inherit;-webkit-hyphens:auto;hyphens:auto}.mat-table .mat-header-cell:first-of-type{padding-left:20px}.mat-table .mat-header-cell:last-of-type{padding-right:8px}.mat-table .mat-header-cell:last-of-type[mat-sort-header]:not([arrowposition=before]){padding-right:8px}.mat-table .mat-header-cell[mat-sort-header][arrowposition=before]{padding-left:0}.mat-table .mat-header-cell[mat-sort-header]:not([arrowposition=before]){padding-right:12px}.mat-table .mat-header-cell>.mat-sort-header-container{display:inline-flex}.mat-table .mat-cell{padding-left:8px;padding-right:12px;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;white-space:inherit;-webkit-hyphens:auto;hyphens:auto}.mat-table .mat-cell:first-of-type{padding-left:20px}.mat-table .mat-cell:last-of-type{padding-right:8px}.mat-table .mat-footer-cell{padding-left:8px;padding-right:12px;font-weight:700}.mat-table .mat-footer-cell:first-of-type{padding-left:20px}.mat-table .mat-footer-cell:last-of-type{padding-right:8px}.mat-table .mat-footer-cell .mat-paginator{margin-left:-8px;margin-right:-8px}\n"] }]
|
|
13339
13313
|
}], ctorParameters: function () { return [{ type: ElderTableModel }, { type: SelectionModel, decorators: [{
|
|
13340
13314
|
type: Optional
|
|
13341
|
-
}] }, { type:
|
|
13315
|
+
}] }, { type: ElderDataViewOptionsProvider, decorators: [{
|
|
13342
13316
|
type: Optional
|
|
13343
13317
|
}, {
|
|
13344
13318
|
type: SkipSelf
|
|
@@ -13371,8 +13345,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
13371
13345
|
type: Input
|
|
13372
13346
|
}], pageSizeOptions: [{
|
|
13373
13347
|
type: Input
|
|
13374
|
-
}], cleanUp: [{
|
|
13375
|
-
type: Input
|
|
13376
13348
|
}], keepSelection: [{
|
|
13377
13349
|
type: Input
|
|
13378
13350
|
}], showFooter: [{
|
|
@@ -15230,8 +15202,8 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15230
15202
|
* Constructor *
|
|
15231
15203
|
* *
|
|
15232
15204
|
**************************************************************************/
|
|
15233
|
-
constructor(selectionModel,
|
|
15234
|
-
super(selectionModel,
|
|
15205
|
+
constructor(selectionModel, dataViewOptionsProvider, mediaObserver) {
|
|
15206
|
+
super(selectionModel, dataViewOptionsProvider);
|
|
15235
15207
|
this.mediaObserver = mediaObserver;
|
|
15236
15208
|
/***************************************************************************
|
|
15237
15209
|
* *
|
|
@@ -15264,7 +15236,6 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15264
15236
|
this.idField = 'id';
|
|
15265
15237
|
this.selectionVisible = true;
|
|
15266
15238
|
this.pageSizeOptions = [30, 50, 100, 150, 200];
|
|
15267
|
-
this.destroy$ = new Subject();
|
|
15268
15239
|
}
|
|
15269
15240
|
/***************************************************************************
|
|
15270
15241
|
* *
|
|
@@ -15272,6 +15243,7 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15272
15243
|
* *
|
|
15273
15244
|
**************************************************************************/
|
|
15274
15245
|
ngOnInit() {
|
|
15246
|
+
super.ngOnInit();
|
|
15275
15247
|
const columnCount$ = (this.responsiveColumnCount
|
|
15276
15248
|
? this.responsiveColumn()
|
|
15277
15249
|
: this._columnCount);
|
|
@@ -15279,16 +15251,6 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15279
15251
|
this.dataContext$.pipe(filter(dc => !!dc), switchMap(dc => dc.data)),
|
|
15280
15252
|
columnCount$
|
|
15281
15253
|
]).pipe(debounceTime(50), map(([data, columns]) => this.groupForColumns(data, columns)));
|
|
15282
|
-
if (this.dataViewSelection) {
|
|
15283
|
-
this.selectionVisible = true;
|
|
15284
|
-
this.selectionMultiEnabled = this.dataViewSelection.multi;
|
|
15285
|
-
this.float = false;
|
|
15286
|
-
const dataContext = this.dataContext$.getValue();
|
|
15287
|
-
if (dataContext) {
|
|
15288
|
-
dataContext.filter.updateFilters(this.dataViewSelection.filters);
|
|
15289
|
-
dataContext.sort.updateSorts(this.dataViewSelection.sorts);
|
|
15290
|
-
}
|
|
15291
|
-
}
|
|
15292
15254
|
}
|
|
15293
15255
|
ngAfterViewInit() {
|
|
15294
15256
|
MatTableDataContextBindingBuilder
|
|
@@ -15296,10 +15258,6 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15296
15258
|
.withPaginator(of(this.matPaginator))
|
|
15297
15259
|
.bindUntil(this.destroy$);
|
|
15298
15260
|
}
|
|
15299
|
-
ngOnDestroy() {
|
|
15300
|
-
this.destroy$.next();
|
|
15301
|
-
this.destroy$.complete();
|
|
15302
|
-
}
|
|
15303
15261
|
/***************************************************************************
|
|
15304
15262
|
* *
|
|
15305
15263
|
* Properties *
|
|
@@ -15414,7 +15372,7 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
15414
15372
|
return this.mediaObserver.asObservable().pipe(filter(changes => changes.length > 0), map(changes => this.sizeToColumns.get(changes[0].mqAlias)), debounceTime(150), startWith(start));
|
|
15415
15373
|
}
|
|
15416
15374
|
}
|
|
15417
|
-
ElderGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderGridComponent, deps: [{ token: SelectionModel, optional: true }, { token:
|
|
15375
|
+
ElderGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderGridComponent, deps: [{ token: SelectionModel, optional: true }, { token: ElderDataViewOptionsProvider, optional: true, skipSelf: true }, { token: i3$5.MediaObserver }], target: i0.ɵɵFactoryTarget.Component });
|
|
15418
15376
|
ElderGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderGridComponent, selector: "elder-grid", inputs: { toolbarVisible: "toolbarVisible", footerVisible: "footerVisible", itemHeight: "itemHeight", responsiveColumnCount: "responsiveColumnCount", availableSorts: "availableSorts", sortTranslationPrefix: "sortTranslationPrefix", hiddenField: "hiddenField", idField: "idField", selectionVisible: "selectionVisible", pageSizeOptions: "pageSizeOptions", tileTemplate: "tileTemplate", toolbarTemplate: "toolbarTemplate", data: "data", columnCount: "columnCount" }, providers: [
|
|
15419
15377
|
{
|
|
15420
15378
|
provide: ELDER_DATA_VIEW,
|
|
@@ -15431,7 +15389,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
15431
15389
|
], template: "<div fxLayout=\"column\" class=\"scroll-fix\" fxFill>\n\n <!-- Grid Browser -->\n <div fxLayout=\"column\" fxFlex\n class=\"scroll-fix elder-grid-container\"\n *ngIf=\"dataContext$ | async as data\"\n [class.elder-mat-table-container]=\"!embedded\"\n [class.mat-elevation-z5]=\"float\"\n [class.elder-mat-table-flat]=\"!embedded && !float\"\n\n [elderDataContextSelection]=\"data\" #dataSelection=\"elderDataContextSelection\"\n [elderDataContextSelectionModel]=\"selectionModel\"\n >\n\n <!-- Toolbar Row -->\n <div *ngIf=\"toolbarVisible\"\n fxLayout=\"row\" fxLayoutAlign=\"start center\" fxFlex=\"none\" class=\"elder-grid-toolbar\">\n\n <div fxLayout=\"column\" fxFlex=\"none\" style=\"padding-left: 8px; padding-right: 8px\" *ngIf=\"selectionVisible\">\n <elder-selection-master-checkbox fxFlex=\"none\" style=\"padding-left: 12px\"></elder-selection-master-checkbox>\n </div>\n\n <!-- Toolbar -->\n <ng-container *ngIf=\"toolbarTemplate\">\n <ng-template *ngTemplateOutlet=\"toolbarTemplate; context: {$implicit: this}\"></ng-template>\n </ng-container>\n\n <elder-single-sort *ngIf=\"availableSorts && availableSorts.length > 0 && data.sort.sorts | async as sorts\"\n fxFlex=\"none\"\n [availableSorts]=\"availableSorts\"\n [translationPrefix]=\"sortTranslationPrefix\"\n [sort]=\"sorts[0]\"\n (sortChange)=\"updateSort($event)\">\n </elder-single-sort>\n\n </div>\n\n <mat-divider *ngIf=\"toolbarVisible\"></mat-divider>\n\n <elder-data-context-state-indicator fxFlex=\"none\" [dataContext]=\"data\">\n </elder-data-context-state-indicator>\n\n <!-- [cdkDropListSortingDisabled]=\"true\" -->\n <!-- cdkDropList -->\n <cdk-virtual-scroll-viewport\n class=\"elder-grid-browser\" fxLayout=\"column\" fxFlex\n id=\"documents-container\"\n [itemSize]=\"itemHeight\"\n [minBufferPx]=\"itemHeight * 2\"\n [maxBufferPx]=\"itemHeight * 3\"\n #virtualScrollViewPort\n infiniteScroll\n [eventThrottle]=\"200\"\n [offsetFactor]=\"2\"\n [ignoreScrollEvent]=\"data.loading | async\"\n [containerId]=\"'documents-container'\" [listenToHost]=\"false\"\n (closeToEnd)=\"requestMoreDataZoned($event)\">\n\n <!-- (scrolling)=\"onScrolling($event)\" -->\n\n <div\n *cdkVirtualFor=\"let row of dataRows$; trackBy: trackByIndex; templateCacheSize: 50\"\n class=\"elder-grid-tile-row\"\n [style.height]=\"itemHeight + 'px'\">\n\n <ng-container *ngFor=\"let tile of row; trackBy: trackByFn\">\n\n <!-- Tile Cell -->\n <div *ngIf=\"showTile(tile)\" class=\"elder-grid-tile\">\n <!-- cdkDrag [cdkDragDisabled]=\"true\" [cdkDragData]=\"tile\" -->\n <!-- <div class=\"tile-placeholder\" *cdkDragPlaceholder></div> -->\n <div class=\"elder-grid-tile-content\"\n (click)=\"onItemClick(tile)\"\n (dblclick)=\"onItemDoubleClick(tile)\">\n <ng-container\n *ngTemplateOutlet=\"tileTemplate || simpleTileTemplate; context: {$implicit: tile}\">\n </ng-container>\n\n <!-- Overlay (Selection) -->\n <ng-container *ngIf=\"selectionVisible\">\n <div *ngIf=\"selectionModel.selection | async as selection\"\n class=\"elder-grid-tile-overlay\"\n [class.elder-grid-tile-overlay-hidden]=\"!inSelectionMode(selection)\"\n [class.elder-grid-tile-overlay-visible]=\"inSelectionMode(selection)\"\n [class.elder-click-through]=\"true\"\n >\n <button mat-icon-button type=\"button\"\n (click)=\"selectionModel.toggle(tile)\" elderStopEventPropagation\n class=\"elder-grid-tile-check\">\n <mat-icon\n [class.elder-selected]=\"(selectionModel.observeSelection(tile) | async)\"\n >\n {{(selectionModel.observeSelection(tile) | async) ? 'check_circle' : 'radio_button_unchecked'}}\n </mat-icon>\n </button>\n </div>\n </ng-container>\n\n </div>\n </div>\n\n <div *ngIf=\"!showTile(tile)\" class=\"elder-grid-tile-hidden\"></div>\n </ng-container>\n\n </div>\n\n </cdk-virtual-scroll-viewport>\n\n\n <mat-progress-bar fxFlex=\"none\"\n [mode]=\"(data?.loading | async) ? 'indeterminate' : 'determinate'\"\n [color]=\"(data && (data.status | async)?.hasError) ? 'warn' : 'primary'\">\n </mat-progress-bar>\n\n <!-- Footer -->\n <div class=\"elder-grid-footer\" *ngIf=\"footerVisible\"\n fxLayout=\"row\" fxFlex=\"none\" fxLayoutAlign=\"end center\" fxLayoutGap=\"10px\"\n style=\"padding-right: 10px\">\n\n <!-- Continuable -->\n <ng-container *ngIf=\"isContinuable\">\n <span class=\"mat-caption noselect\" style=\"color: gray\">\n {{(dataSnapshot?.data | async)?.length}} / {{total$ | async}}\n </span>\n\n <button mat-icon-button type=\"button\"\n color=\"primary\"\n [disabled]=\"!(canLoadMore$ | async)\"\n (click)=\"dataSnapshot.loadMore()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </ng-container>\n\n <!-- Paged -->\n <mat-paginator #matPaginator *ngIf=\"isActivePaged && (dataActivePaged.page | async) as page\"\n fxFlex=\"none\"\n [length]=\"dataContext?.total | async\"\n [pageIndex]=\"page?.index\"\n [pageSize]=\"page?.size\"\n [pageSizeOptions]=\"pageSizeOptions\">\n </mat-paginator>\n\n <!-- Local Source -->\n <ng-container *ngIf=\"!isActivePaged && !isContinuable\">\n <span class=\"mat-caption noselect\" style=\"color: gray\">\n {{(dataSnapshot?.data | async)?.length}}\n </span>\n </ng-container>\n\n </div>\n\n\n </div>\n</div>\n\n<ng-template #simpleTileTemplate let-tile>\n <div *ngIf=\"tile\" fxLayout=\"column\" fxFlex fxLayoutAlign=\"center center\" style=\"background-color: lightblue\">\n <p class=\"noselect\">Tile: {{tile}}</p>\n </div>\n</ng-template>\n", styles: [":host{min-width:0;min-height:0}.scroll-fix{min-width:0;min-height:0}.elder-grid-tile-row{display:flex;flex-direction:row;padding:5px;margin:0 -5px}.elder-grid-tile-hidden{flex:0 1 100%;margin:5px;width:100%;height:100%}.elder-grid-tile-content{position:relative;width:100%;height:100%;overflow:hidden}.cdk-drag-preview{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{flex:0 1 100%;background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}.elder-grid-tile-overlay{position:absolute;left:0;top:0;right:0;bottom:0;transition:background-color .2s ease-in,opacity .2s ease-in}.elder-grid-tile-overlay-visible{opacity:1}.elder-grid-tile-overlay-hidden{opacity:0}.elder-grid-tile-content:hover .elder-grid-tile-overlay{opacity:1;transition:background-color .2s ease-in,opacity .2s ease-in}.elder-click-through{pointer-events:none}\n"] }]
|
|
15432
15390
|
}], ctorParameters: function () { return [{ type: SelectionModel, decorators: [{
|
|
15433
15391
|
type: Optional
|
|
15434
|
-
}] }, { type:
|
|
15392
|
+
}] }, { type: ElderDataViewOptionsProvider, decorators: [{
|
|
15435
15393
|
type: Optional
|
|
15436
15394
|
}, {
|
|
15437
15395
|
type: SkipSelf
|
|
@@ -18745,7 +18703,7 @@ class ElderLocalizedInputTableComponent extends FormFieldBaseComponent {
|
|
|
18745
18703
|
}
|
|
18746
18704
|
}
|
|
18747
18705
|
ElderLocalizedInputTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderLocalizedInputTableComponent, deps: [{ token: ElderToastService }, { token: ElderLanguageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
18748
|
-
ElderLocalizedInputTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderLocalizedInputTableComponent, selector: "elder-localized-input-table", inputs: { dense: "dense", float: "float", embedded: "embedded", textColumns: "textColumns", defaultLanguageTags: "defaultLanguageTags" }, providers: buildFormIntegrationProviders(ElderLocalizedInputTableComponent), queries: [{ propertyName: "textColumnsQuery", predicate: ElderLocalizedTextColumnDirective }], usesInheritance: true, ngImport: i0, template: "<div fxLayout=\"column\" fxFill>\n <elder-table matSort fxFlex\n [data]=\"data\"\n [selectionVisible]=\"true\"\n [selectionMultiEnabled]=\"true\"\n [dense]=\"dense\"\n [float]=\"float\"\n [embedded]=\"embedded\"\n >\n\n <elder-data-toolbar\n *elderTableToolbar\n [canAdd]=\"!isLocked\"\n [canRemove]=\"!isLocked\"\n [canMore]=\"false\"\n (requestNew)=\"onNewRequested()\"\n (requestRemove)=\"onRemoveRequested($event)\"\n >\n\n <ng-template elderToolbarContent=\"left.actions\">\n <div fxLayout=\"column\" fxLayoutAlign=\"start center\">\n <h4 elderCardSubtitle style=\"margin: 0\">{{label ?? placeholder}}</h4>\n </div>\n </ng-template>\n\n </elder-data-toolbar>\n\n <ng-container matColumnDef=\"locale\">\n <th mat-header-cell *matHeaderCellDef style=\"width: 100px\" mat-sort-header>Locale</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-chip-list><mat-chip>{{localized.locale}}</mat-chip></mat-chip-list>\n </td>\n </ng-container>\n\n <ng-container *ngFor=\"let textColumn of textColumns$ | async\" matColumnDef=\"{{textColumn.name}}\">\n <th mat-header-cell *matHeaderCellDef>{{textColumn.title | translate}}</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-form-field class=\"full-width\">\n <input\n matInput\n type=\"text\"\n name=\"i18n-{{localized.locale}}-{{textColumn.name}}\"\n [ngModel]=\"localized[textColumn.name]\" [ngModelOptions]=\"{updateOn: 'blur'}\"\n (ngModelChange)=\"onColumnTextUpdated(localized, textColumn, $event)\"\n [required]=\"required && textColumn.required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n />\n <mat-hint>{{textColumn.title | translate}} ({{localized.locale}})</mat-hint>\n <mat-error>Required</mat-error>\n </mat-form-field>\n </td>\n </ng-container>\n\n </elder-table>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i11.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i11.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2$4.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i2$4.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i5$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ElderTableComponent, selector: "elder-table, ebs-table", inputs: ["idField", "removingField", "hiddenField", "pageSizeOptions", "
|
|
18706
|
+
ElderLocalizedInputTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ElderLocalizedInputTableComponent, selector: "elder-localized-input-table", inputs: { dense: "dense", float: "float", embedded: "embedded", textColumns: "textColumns", defaultLanguageTags: "defaultLanguageTags" }, providers: buildFormIntegrationProviders(ElderLocalizedInputTableComponent), queries: [{ propertyName: "textColumnsQuery", predicate: ElderLocalizedTextColumnDirective }], usesInheritance: true, ngImport: i0, template: "<div fxLayout=\"column\" fxFill>\n <elder-table matSort fxFlex\n [data]=\"data\"\n [selectionVisible]=\"true\"\n [selectionMultiEnabled]=\"true\"\n [dense]=\"dense\"\n [float]=\"float\"\n [embedded]=\"embedded\"\n >\n\n <elder-data-toolbar\n *elderTableToolbar\n [canAdd]=\"!isLocked\"\n [canRemove]=\"!isLocked\"\n [canMore]=\"false\"\n (requestNew)=\"onNewRequested()\"\n (requestRemove)=\"onRemoveRequested($event)\"\n >\n\n <ng-template elderToolbarContent=\"left.actions\">\n <div fxLayout=\"column\" fxLayoutAlign=\"start center\">\n <h4 elderCardSubtitle style=\"margin: 0\">{{label ?? placeholder}}</h4>\n </div>\n </ng-template>\n\n </elder-data-toolbar>\n\n <ng-container matColumnDef=\"locale\">\n <th mat-header-cell *matHeaderCellDef style=\"width: 100px\" mat-sort-header>Locale</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-chip-list><mat-chip>{{localized.locale}}</mat-chip></mat-chip-list>\n </td>\n </ng-container>\n\n <ng-container *ngFor=\"let textColumn of textColumns$ | async\" matColumnDef=\"{{textColumn.name}}\">\n <th mat-header-cell *matHeaderCellDef>{{textColumn.title | translate}}</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-form-field class=\"full-width\">\n <input\n matInput\n type=\"text\"\n name=\"i18n-{{localized.locale}}-{{textColumn.name}}\"\n [ngModel]=\"localized[textColumn.name]\" [ngModelOptions]=\"{updateOn: 'blur'}\"\n (ngModelChange)=\"onColumnTextUpdated(localized, textColumn, $event)\"\n [required]=\"required && textColumn.required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n />\n <mat-hint>{{textColumn.title | translate}} ({{localized.locale}})</mat-hint>\n <mat-error>Required</mat-error>\n </mat-form-field>\n </td>\n </ng-container>\n\n </elder-table>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i11.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i11.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2$4.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i2$4.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i5$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ElderTableComponent, selector: "elder-table, ebs-table", inputs: ["idField", "removingField", "hiddenField", "pageSizeOptions", "keepSelection", "showFooter", "toolbarTemplate", "data", "displayedColumns", "selectionVisible"] }, { kind: "directive", type: ElderTableToolbarDirective, selector: "[elderTableToolbar]" }, { kind: "component", type: ElderDataToolbarComponent, selector: "elder-data-toolbar", inputs: ["canAdd", "canRemove", "canMore", "confirmRemoval", "keepSelectionAfterRemoval", "selectionModel"], outputs: ["requestNew", "requestRemove"] }, { kind: "directive", type: ElderToolbarContentDirective, selector: "[elderToolbarContent]", inputs: ["elderToolbarContent"] }, { kind: "component", type: i6$1.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i6$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: ElderCardSubtitleDirective, selector: "elder-card-subtitle, [elder-card-subtitle], [elderCardSubtitle]" }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
18749
18707
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderLocalizedInputTableComponent, decorators: [{
|
|
18750
18708
|
type: Component,
|
|
18751
18709
|
args: [{ selector: 'elder-localized-input-table', changeDetection: ChangeDetectionStrategy.OnPush, providers: buildFormIntegrationProviders(ElderLocalizedInputTableComponent), template: "<div fxLayout=\"column\" fxFill>\n <elder-table matSort fxFlex\n [data]=\"data\"\n [selectionVisible]=\"true\"\n [selectionMultiEnabled]=\"true\"\n [dense]=\"dense\"\n [float]=\"float\"\n [embedded]=\"embedded\"\n >\n\n <elder-data-toolbar\n *elderTableToolbar\n [canAdd]=\"!isLocked\"\n [canRemove]=\"!isLocked\"\n [canMore]=\"false\"\n (requestNew)=\"onNewRequested()\"\n (requestRemove)=\"onRemoveRequested($event)\"\n >\n\n <ng-template elderToolbarContent=\"left.actions\">\n <div fxLayout=\"column\" fxLayoutAlign=\"start center\">\n <h4 elderCardSubtitle style=\"margin: 0\">{{label ?? placeholder}}</h4>\n </div>\n </ng-template>\n\n </elder-data-toolbar>\n\n <ng-container matColumnDef=\"locale\">\n <th mat-header-cell *matHeaderCellDef style=\"width: 100px\" mat-sort-header>Locale</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-chip-list><mat-chip>{{localized.locale}}</mat-chip></mat-chip-list>\n </td>\n </ng-container>\n\n <ng-container *ngFor=\"let textColumn of textColumns$ | async\" matColumnDef=\"{{textColumn.name}}\">\n <th mat-header-cell *matHeaderCellDef>{{textColumn.title | translate}}</th>\n <td mat-cell *matCellDef=\"let localized\">\n <mat-form-field class=\"full-width\">\n <input\n matInput\n type=\"text\"\n name=\"i18n-{{localized.locale}}-{{textColumn.name}}\"\n [ngModel]=\"localized[textColumn.name]\" [ngModelOptions]=\"{updateOn: 'blur'}\"\n (ngModelChange)=\"onColumnTextUpdated(localized, textColumn, $event)\"\n [required]=\"required && textColumn.required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n />\n <mat-hint>{{textColumn.title | translate}} ({{localized.locale}})</mat-hint>\n <mat-error>Required</mat-error>\n </mat-form-field>\n </td>\n </ng-container>\n\n </elder-table>\n</div>\n" }]
|
|
@@ -21197,12 +21155,160 @@ class ElderSelectValueDirective {
|
|
|
21197
21155
|
this.viewContainer = viewContainer;
|
|
21198
21156
|
}
|
|
21199
21157
|
}
|
|
21200
|
-
ElderSelectValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectValueDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
21201
|
-
ElderSelectValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectValueDirective, selector: "[elderSelectValue]", ngImport: i0 });
|
|
21202
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectValueDirective, decorators: [{
|
|
21158
|
+
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 });
|
|
21159
|
+
ElderSelectValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: ElderSelectValueDirective, selector: "[elderSelectValue]", ngImport: i0 });
|
|
21160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderSelectValueDirective, decorators: [{
|
|
21161
|
+
type: Directive,
|
|
21162
|
+
args: [{ selector: '[elderSelectValue]' }]
|
|
21163
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
|
|
21164
|
+
|
|
21165
|
+
class TemplatedSelectionDialogComponent {
|
|
21166
|
+
/***************************************************************************
|
|
21167
|
+
* *
|
|
21168
|
+
* Constructor *
|
|
21169
|
+
* *
|
|
21170
|
+
**************************************************************************/
|
|
21171
|
+
constructor(dialogRef, data, selectionModel) {
|
|
21172
|
+
this.dialogRef = dialogRef;
|
|
21173
|
+
this.data = data;
|
|
21174
|
+
this.selectionModel = selectionModel;
|
|
21175
|
+
/***************************************************************************
|
|
21176
|
+
* *
|
|
21177
|
+
* Fields *
|
|
21178
|
+
* *
|
|
21179
|
+
**************************************************************************/
|
|
21180
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
21181
|
+
}
|
|
21182
|
+
/***************************************************************************
|
|
21183
|
+
* *
|
|
21184
|
+
* Component Events *
|
|
21185
|
+
* *
|
|
21186
|
+
**************************************************************************/
|
|
21187
|
+
ngOnInit() {
|
|
21188
|
+
}
|
|
21189
|
+
}
|
|
21190
|
+
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 });
|
|
21191
|
+
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 });
|
|
21192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: TemplatedSelectionDialogComponent, decorators: [{
|
|
21193
|
+
type: Component,
|
|
21194
|
+
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" }]
|
|
21195
|
+
}], ctorParameters: function () { return [{ type: i1$7.MatDialogRef }, { type: undefined, decorators: [{
|
|
21196
|
+
type: Inject,
|
|
21197
|
+
args: [MAT_DIALOG_DATA]
|
|
21198
|
+
}] }, { type: SelectionModel }]; } });
|
|
21199
|
+
|
|
21200
|
+
function createSelectionModel$1() {
|
|
21201
|
+
return new SelectionModel();
|
|
21202
|
+
}
|
|
21203
|
+
function createDataViewOptionsProvider() {
|
|
21204
|
+
return new ElderDataViewOptionsProvider();
|
|
21205
|
+
}
|
|
21206
|
+
class SelectionModelPopupDirective {
|
|
21207
|
+
/***************************************************************************
|
|
21208
|
+
* *
|
|
21209
|
+
* Constructor *
|
|
21210
|
+
* *
|
|
21211
|
+
**************************************************************************/
|
|
21212
|
+
constructor(templateRef, viewContainer, dialog, dataViewOptionsProvider, selectionModel, changeDetectorRef) {
|
|
21213
|
+
this.templateRef = templateRef;
|
|
21214
|
+
this.viewContainer = viewContainer;
|
|
21215
|
+
this.dialog = dialog;
|
|
21216
|
+
this.dataViewOptionsProvider = dataViewOptionsProvider;
|
|
21217
|
+
this.selectionModel = selectionModel;
|
|
21218
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
21219
|
+
/***************************************************************************
|
|
21220
|
+
* *
|
|
21221
|
+
* Fields *
|
|
21222
|
+
* *
|
|
21223
|
+
**************************************************************************/
|
|
21224
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
21225
|
+
}
|
|
21226
|
+
set elderSelectionModelPopupTransform(fn) {
|
|
21227
|
+
this._transformerFn = fn;
|
|
21228
|
+
}
|
|
21229
|
+
/***************************************************************************
|
|
21230
|
+
* *
|
|
21231
|
+
* Public API *
|
|
21232
|
+
* *
|
|
21233
|
+
**************************************************************************/
|
|
21234
|
+
/**
|
|
21235
|
+
* Let the user choose some entities and return the selection.
|
|
21236
|
+
*/
|
|
21237
|
+
choose(keyGetter, currentSelection, filters, sorts, multi = false) {
|
|
21238
|
+
this.dataViewOptionsProvider.updateOptions(options => options
|
|
21239
|
+
.withFilters(filters || [])
|
|
21240
|
+
.withSorts(sorts || [])
|
|
21241
|
+
.withSelectionMultiEnabled(multi));
|
|
21242
|
+
this.selectionModel.isMultipleSelection = multi;
|
|
21243
|
+
this.selectionModel.keyGetterFn = keyGetter;
|
|
21244
|
+
this.selectionModel.replaceSelection(currentSelection);
|
|
21245
|
+
this.log.info('Replaced selection popup with current ' + currentSelection.length + ' entities:', currentSelection);
|
|
21246
|
+
const dialogRef = this.openSelectDialog();
|
|
21247
|
+
// This fixes dialog rendering when the browser template
|
|
21248
|
+
// view container is outside the invoking control, which
|
|
21249
|
+
// happens when using ng-content projection.
|
|
21250
|
+
this.changeDetectorRef.markForCheck();
|
|
21251
|
+
return dialogRef.afterClosed().pipe(switchMap((chosenEntities) => {
|
|
21252
|
+
if (chosenEntities) {
|
|
21253
|
+
return this._transformerFn
|
|
21254
|
+
? of(chosenEntities.map(value => this._transformerFn(value)))
|
|
21255
|
+
: of(chosenEntities);
|
|
21256
|
+
}
|
|
21257
|
+
else {
|
|
21258
|
+
return EMPTY;
|
|
21259
|
+
}
|
|
21260
|
+
}));
|
|
21261
|
+
}
|
|
21262
|
+
/***************************************************************************
|
|
21263
|
+
* *
|
|
21264
|
+
* Private methods *
|
|
21265
|
+
* *
|
|
21266
|
+
**************************************************************************/
|
|
21267
|
+
openSelectDialog() {
|
|
21268
|
+
return this.dialog.open(TemplatedSelectionDialogComponent, {
|
|
21269
|
+
width: '90vw',
|
|
21270
|
+
height: '90vh',
|
|
21271
|
+
panelClass: 'custom-dialog-container',
|
|
21272
|
+
data: {
|
|
21273
|
+
selectionComponentTemplate: this.templateRef
|
|
21274
|
+
},
|
|
21275
|
+
viewContainerRef: this.viewContainer
|
|
21276
|
+
});
|
|
21277
|
+
}
|
|
21278
|
+
}
|
|
21279
|
+
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 });
|
|
21280
|
+
SelectionModelPopupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: SelectionModelPopupDirective, selector: "[elderSelectionModelPopup]", inputs: { elderSelectionModelPopupTransform: "elderSelectionModelPopupTransform" }, providers: [
|
|
21281
|
+
{
|
|
21282
|
+
provide: SelectionModel,
|
|
21283
|
+
useFactory: createSelectionModel$1
|
|
21284
|
+
},
|
|
21285
|
+
{
|
|
21286
|
+
provide: ElderDataViewOptionsProvider,
|
|
21287
|
+
useFactory: createDataViewOptionsProvider
|
|
21288
|
+
},
|
|
21289
|
+
ElderTableProviders.ClearTableModel // Since this popup is frequently used inside an elder-table search box
|
|
21290
|
+
], exportAs: ["elderSelectionModelPopup"], ngImport: i0 });
|
|
21291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SelectionModelPopupDirective, decorators: [{
|
|
21203
21292
|
type: Directive,
|
|
21204
|
-
args: [{
|
|
21205
|
-
|
|
21293
|
+
args: [{
|
|
21294
|
+
selector: '[elderSelectionModelPopup]',
|
|
21295
|
+
exportAs: 'elderSelectionModelPopup',
|
|
21296
|
+
providers: [
|
|
21297
|
+
{
|
|
21298
|
+
provide: SelectionModel,
|
|
21299
|
+
useFactory: createSelectionModel$1
|
|
21300
|
+
},
|
|
21301
|
+
{
|
|
21302
|
+
provide: ElderDataViewOptionsProvider,
|
|
21303
|
+
useFactory: createDataViewOptionsProvider
|
|
21304
|
+
},
|
|
21305
|
+
ElderTableProviders.ClearTableModel // Since this popup is frequently used inside an elder-table search box
|
|
21306
|
+
]
|
|
21307
|
+
}]
|
|
21308
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i1$7.MatDialog }, { type: ElderDataViewOptionsProvider }, { type: SelectionModel }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { elderSelectionModelPopupTransform: [{
|
|
21309
|
+
type: Input,
|
|
21310
|
+
args: ['elderSelectionModelPopupTransform']
|
|
21311
|
+
}] } });
|
|
21206
21312
|
|
|
21207
21313
|
class ElderSelectComponentState {
|
|
21208
21314
|
constructor(idle, loading, error) {
|
|
@@ -25088,13 +25194,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
25088
25194
|
}]
|
|
25089
25195
|
}] });
|
|
25090
25196
|
|
|
25197
|
+
class TypedEventMessage {
|
|
25198
|
+
constructor(type, data) {
|
|
25199
|
+
this.type = type;
|
|
25200
|
+
this.data = data;
|
|
25201
|
+
}
|
|
25202
|
+
// type predicate to check weather an object is a DataViewMessage type
|
|
25203
|
+
static isOfType(obj) {
|
|
25204
|
+
return obj.type !== undefined
|
|
25205
|
+
&& obj.data !== undefined;
|
|
25206
|
+
}
|
|
25207
|
+
}
|
|
25208
|
+
class DataViewSelectionInit {
|
|
25209
|
+
constructor(options, initialSelection = [], idField = 'id') {
|
|
25210
|
+
this.options = options;
|
|
25211
|
+
this.initialSelection = initialSelection;
|
|
25212
|
+
this.idField = idField;
|
|
25213
|
+
}
|
|
25214
|
+
}
|
|
25215
|
+
class DataViewSelection {
|
|
25216
|
+
constructor(selection) {
|
|
25217
|
+
this.selection = selection;
|
|
25218
|
+
}
|
|
25219
|
+
}
|
|
25220
|
+
class DataViewMessage extends TypedEventMessage {
|
|
25221
|
+
constructor(type, data) {
|
|
25222
|
+
super(type, data);
|
|
25223
|
+
this.type = type;
|
|
25224
|
+
this.data = data;
|
|
25225
|
+
}
|
|
25226
|
+
static initialSelection(init) {
|
|
25227
|
+
return new DataViewMessage('SELECTION_INIT', init);
|
|
25228
|
+
}
|
|
25229
|
+
static selection(selection) {
|
|
25230
|
+
return new DataViewMessage('SELECTION_SELECTED', selection);
|
|
25231
|
+
}
|
|
25232
|
+
// type predicate to check weather an object is a DataViewMessage type
|
|
25233
|
+
static isOfType(obj) {
|
|
25234
|
+
return obj.type !== undefined
|
|
25235
|
+
&& obj.data !== undefined;
|
|
25236
|
+
}
|
|
25237
|
+
}
|
|
25238
|
+
|
|
25091
25239
|
class IFrameState {
|
|
25092
|
-
constructor(
|
|
25093
|
-
this.
|
|
25240
|
+
constructor(type, message = null) {
|
|
25241
|
+
this.type = type;
|
|
25094
25242
|
this.message = message;
|
|
25095
25243
|
}
|
|
25244
|
+
get isLoading() {
|
|
25245
|
+
return this.type === 'LOADING';
|
|
25246
|
+
}
|
|
25247
|
+
get hasLoaded() {
|
|
25248
|
+
return this.type == 'LOADED';
|
|
25249
|
+
}
|
|
25096
25250
|
get hasError() {
|
|
25097
|
-
return this.
|
|
25251
|
+
return this.type === 'ERROR';
|
|
25098
25252
|
}
|
|
25099
25253
|
}
|
|
25100
25254
|
class IframeHostComponent {
|
|
@@ -25109,24 +25263,37 @@ class IframeHostComponent {
|
|
|
25109
25263
|
* Fields *
|
|
25110
25264
|
* *
|
|
25111
25265
|
**************************************************************************/
|
|
25112
|
-
this.
|
|
25266
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
25113
25267
|
this.iframeParams$ = new BehaviorSubject(null);
|
|
25114
|
-
this.iframeState$ = new BehaviorSubject(new IFrameState('
|
|
25115
|
-
this.
|
|
25268
|
+
this.iframeState$ = new BehaviorSubject(new IFrameState('LOADING'));
|
|
25269
|
+
this.message = new EventEmitter();
|
|
25116
25270
|
this.close = new EventEmitter();
|
|
25117
25271
|
}
|
|
25118
25272
|
/***************************************************************************
|
|
25119
25273
|
* *
|
|
25120
|
-
*
|
|
25274
|
+
* Listeners *
|
|
25121
25275
|
* *
|
|
25122
25276
|
**************************************************************************/
|
|
25123
|
-
|
|
25124
|
-
|
|
25125
|
-
|
|
25126
|
-
|
|
25127
|
-
|
|
25277
|
+
/**
|
|
25278
|
+
* Listens for messages from window.
|
|
25279
|
+
* Makes it possible to react upon messages from iframe child window.
|
|
25280
|
+
*
|
|
25281
|
+
* @param event message from child window
|
|
25282
|
+
*/
|
|
25283
|
+
onWindowMessage(event) {
|
|
25284
|
+
this.log.debug('Received message from child:', event);
|
|
25285
|
+
if (event) {
|
|
25286
|
+
if (TypedEventMessage.isOfType(event.data))
|
|
25287
|
+
this.handleMessageFromChild(event.data);
|
|
25288
|
+
}
|
|
25128
25289
|
return true;
|
|
25129
25290
|
}
|
|
25291
|
+
/***************************************************************************
|
|
25292
|
+
* *
|
|
25293
|
+
* Lifecycle *
|
|
25294
|
+
* *
|
|
25295
|
+
**************************************************************************/
|
|
25296
|
+
ngOnInit() { }
|
|
25130
25297
|
/***************************************************************************
|
|
25131
25298
|
* *
|
|
25132
25299
|
* Properties *
|
|
@@ -25140,9 +25307,17 @@ class IframeHostComponent {
|
|
|
25140
25307
|
* Public API *
|
|
25141
25308
|
* *
|
|
25142
25309
|
**************************************************************************/
|
|
25143
|
-
|
|
25144
|
-
this.
|
|
25145
|
-
this.iframeState$.next(new IFrameState('
|
|
25310
|
+
onIframeLoadEvent(event) {
|
|
25311
|
+
this.log.debug('Finished loading iframe', event);
|
|
25312
|
+
this.iframeState$.next(new IFrameState('LOADED'));
|
|
25313
|
+
}
|
|
25314
|
+
onIframeErrorEvent(err) {
|
|
25315
|
+
this.log.warn('Failed to load iframe', err);
|
|
25316
|
+
this.iframeState$.next(new IFrameState('ERROR', err + ''));
|
|
25317
|
+
}
|
|
25318
|
+
sendMessageToChild(msg) {
|
|
25319
|
+
this.log.debug('Sending message to iframe child:', msg);
|
|
25320
|
+
this.iframe.nativeElement.contentWindow.postMessage(msg, "*");
|
|
25146
25321
|
}
|
|
25147
25322
|
doClose(event) {
|
|
25148
25323
|
this.close.emit();
|
|
@@ -25152,28 +25327,26 @@ class IframeHostComponent {
|
|
|
25152
25327
|
* Private methods *
|
|
25153
25328
|
* *
|
|
25154
25329
|
**************************************************************************/
|
|
25155
|
-
|
|
25156
|
-
this.
|
|
25157
|
-
|
|
25158
|
-
|
|
25159
|
-
this.post.emit(message.data);
|
|
25160
|
-
break;
|
|
25161
|
-
case 'CLOSE':
|
|
25162
|
-
this.close.emit(message.data);
|
|
25163
|
-
break;
|
|
25330
|
+
handleMessageFromChild(message) {
|
|
25331
|
+
this.message.next(message);
|
|
25332
|
+
if (message.type === 'CLOSE') {
|
|
25333
|
+
this.close.emit(message.data);
|
|
25164
25334
|
}
|
|
25165
25335
|
}
|
|
25166
25336
|
}
|
|
25167
25337
|
IframeHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25168
|
-
IframeHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: { iframeParams: "iframeParams" }, outputs: {
|
|
25338
|
+
IframeHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: { iframeParams: "iframeParams" }, outputs: { message: "message", close: "close" }, host: { listeners: { "window:message": "onWindowMessage($event)" } }, viewQueries: [{ propertyName: "iframe", first: true, predicate: ["iframe"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"{state: iframeState$ | async, params: iframeParams$ | async} as ctx\">\n\n <div fxLayout=\"column\" fxFill>\n\n <!-- In Case of Error -->\n <div *ngIf=\"ctx.state.hasError\"\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n fxFlex\n >\n <span>Failed to load Iframe: {{ctx.state.message}}</span>\n </div>\n\n <!-- IFrame -->\n <iframe fxFlex #iframe\n *ngIf=\"!ctx.state.hasError\"\n (load)=\"onIframeLoadEvent($event)\"\n (error)=\"onIframeErrorEvent($event)\"\n [src]=\"ctx.params.srcUrl | elderSafeUrl\"\n class=\"iframe\"\n allow=\"clipboard *;clipboard-read *;clipboard-write *;\"\n ></iframe>\n\n <!-- Bottom Toolbar -->\n <div *ngIf=\"!ctx.params.hideActionBar\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" fxFlex=\"none\" class=\"toolbar\">\n\n <a mat-icon-button (click)=\"doClose($event)\" class=\"dense-button\">\n <mat-icon class=\"small-icon\">close</mat-icon>\n </a>\n\n <a mat-icon-button class=\"dense-button\"\n [href]=\"ctx.params.srcUrl | elderSafeUrl\" target=\"_blank\">\n <mat-icon class=\"small-icon\">open_in_new</mat-icon>\n </a>\n\n </div>\n\n </div>\n\n</ng-container>\n\n\n\n", styles: [".iframe{margin:0;border:0;height:100%;background-color:#fff}\n"], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "pipe", type: ElderSafeUrlPipe, name: "elderSafeUrl" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
25169
25339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeHostComponent, decorators: [{
|
|
25170
25340
|
type: Component,
|
|
25171
|
-
args: [{ selector: 'elder-i-frame-host', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{state: iframeState$ | async, params: iframeParams$ | async} as ctx\">\n\n <div fxLayout=\"column\" fxFill>\n\n <!-- In Case of Error -->\n <div *ngIf=\"ctx.state.hasError\"\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n fxFlex\n >\n <span>Failed to load Iframe: {{ctx.state.message}}</span>\n </div>\n\n <!-- IFrame -->\n <iframe fxFlex\n *ngIf=\"!ctx.state.hasError\"\n (error)=\"
|
|
25172
|
-
}], ctorParameters: function () { return []; }, propDecorators: {
|
|
25341
|
+
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"] }]
|
|
25342
|
+
}], ctorParameters: function () { return []; }, propDecorators: { iframe: [{
|
|
25343
|
+
type: ViewChild,
|
|
25344
|
+
args: ['iframe']
|
|
25345
|
+
}], message: [{
|
|
25173
25346
|
type: Output
|
|
25174
25347
|
}], close: [{
|
|
25175
25348
|
type: Output
|
|
25176
|
-
}],
|
|
25349
|
+
}], onWindowMessage: [{
|
|
25177
25350
|
type: HostListener,
|
|
25178
25351
|
args: ['window:message', ['$event']]
|
|
25179
25352
|
}], iframeParams: [{
|
|
@@ -25214,7 +25387,7 @@ class IframeDialogComponent {
|
|
|
25214
25387
|
}
|
|
25215
25388
|
}
|
|
25216
25389
|
IframeDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeDialogComponent, deps: [{ token: i1$7.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
25217
|
-
IframeDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeDialogComponent, selector: "elder-i-frame-dialog", ngImport: i0, template: "<div *ngIf=\"iframeParams$ | async as iFrameParams\" fxFill>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: ["iframeParams"], outputs: ["
|
|
25390
|
+
IframeDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeDialogComponent, selector: "elder-i-frame-dialog", ngImport: i0, template: "<div *ngIf=\"iframeParams$ | async as iFrameParams\" fxFill>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: ["iframeParams"], outputs: ["message", "close"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
25218
25391
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeDialogComponent, decorators: [{
|
|
25219
25392
|
type: Component,
|
|
25220
25393
|
args: [{ selector: 'elder-i-frame-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"iframeParams$ | async as iFrameParams\" fxFill>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n" }]
|
|
@@ -25286,7 +25459,7 @@ class IframeSideContentComponent {
|
|
|
25286
25459
|
IframeSideContentComponent.QUERY_PARAM_SRC_URL = 'srcUrl';
|
|
25287
25460
|
IframeSideContentComponent.QUERY_PARAM_WIDTH = 'width';
|
|
25288
25461
|
IframeSideContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeSideContentComponent, deps: [{ token: i1$3.Router }, { token: i1$3.ActivatedRoute }, { token: ElderShellService }], target: i0.ɵɵFactoryTarget.Component });
|
|
25289
|
-
IframeSideContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeSideContentComponent, selector: "elder-i-frame-side-host", ngImport: i0, template: "\n<div *ngIf=\"iframeParams$ | async as iFrameParams\"\n [style.width]=\"iFrameParams.width\" fxFill\n>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: ["iframeParams"], outputs: ["
|
|
25462
|
+
IframeSideContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: IframeSideContentComponent, selector: "elder-i-frame-side-host", ngImport: i0, template: "\n<div *ngIf=\"iframeParams$ | async as iFrameParams\"\n [style.width]=\"iFrameParams.width\" fxFill\n>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i2$3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: IframeHostComponent, selector: "elder-i-frame-host", inputs: ["iframeParams"], outputs: ["message", "close"] }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
25290
25463
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IframeSideContentComponent, decorators: [{
|
|
25291
25464
|
type: Component,
|
|
25292
25465
|
args: [{ selector: 'elder-i-frame-side-host', changeDetection: ChangeDetectionStrategy.OnPush, template: "\n<div *ngIf=\"iframeParams$ | async as iFrameParams\"\n [style.width]=\"iFrameParams.width\" fxFill\n>\n\n <elder-i-frame-host fxFlex\n [iframeParams]=\"iFrameParams\"\n (close)=\"close($event)\">\n </elder-i-frame-host>\n\n</div>\n\n\n\n" }]
|
|
@@ -25321,7 +25494,7 @@ class IframeService {
|
|
|
25321
25494
|
}
|
|
25322
25495
|
postCloseMessage(data) {
|
|
25323
25496
|
IframeService.postToParent({
|
|
25324
|
-
|
|
25497
|
+
type: 'CLOSE',
|
|
25325
25498
|
data: data
|
|
25326
25499
|
});
|
|
25327
25500
|
}
|
|
@@ -25375,13 +25548,250 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
25375
25548
|
['$event']]
|
|
25376
25549
|
}] } });
|
|
25377
25550
|
|
|
25551
|
+
/**
|
|
25552
|
+
* Container for displaying a remote data view in an iframe.
|
|
25553
|
+
* Provides capabilities to communicate between remote data view (child)
|
|
25554
|
+
* and iframe parent.
|
|
25555
|
+
*/
|
|
25556
|
+
class DataViewIframeComponent {
|
|
25557
|
+
/***************************************************************************
|
|
25558
|
+
* *
|
|
25559
|
+
* Constructor *
|
|
25560
|
+
* *
|
|
25561
|
+
**************************************************************************/
|
|
25562
|
+
constructor(selectionModel) {
|
|
25563
|
+
this.selectionModel = selectionModel;
|
|
25564
|
+
/***************************************************************************
|
|
25565
|
+
* *
|
|
25566
|
+
* Fields *
|
|
25567
|
+
* *
|
|
25568
|
+
**************************************************************************/
|
|
25569
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
25570
|
+
this._dataViewOptions$ = new BehaviorSubject(null);
|
|
25571
|
+
this._destroy$ = new Subject();
|
|
25572
|
+
}
|
|
25573
|
+
/***************************************************************************
|
|
25574
|
+
* *
|
|
25575
|
+
* Life Cycle *
|
|
25576
|
+
* *
|
|
25577
|
+
**************************************************************************/
|
|
25578
|
+
ngOnInit() {
|
|
25579
|
+
}
|
|
25580
|
+
ngAfterViewInit() {
|
|
25581
|
+
// iframe is only available after view init
|
|
25582
|
+
this.setupDataViewOptionsBridge(this.iframeHost);
|
|
25583
|
+
}
|
|
25584
|
+
ngOnDestroy() {
|
|
25585
|
+
this._destroy$.next();
|
|
25586
|
+
this._destroy$.complete();
|
|
25587
|
+
}
|
|
25588
|
+
/***************************************************************************
|
|
25589
|
+
* *
|
|
25590
|
+
* Properties *
|
|
25591
|
+
* *
|
|
25592
|
+
**************************************************************************/
|
|
25593
|
+
get dataViewOptions() {
|
|
25594
|
+
return this._dataViewOptions$.getValue();
|
|
25595
|
+
}
|
|
25596
|
+
set dataViewOptions(options) {
|
|
25597
|
+
this._dataViewOptions$.next(options);
|
|
25598
|
+
}
|
|
25599
|
+
get dataViewOptions$() {
|
|
25600
|
+
return this._dataViewOptions$.asObservable();
|
|
25601
|
+
}
|
|
25602
|
+
/***************************************************************************
|
|
25603
|
+
* *
|
|
25604
|
+
* Public API *
|
|
25605
|
+
* *
|
|
25606
|
+
**************************************************************************/
|
|
25607
|
+
onMessageFromChild(message) {
|
|
25608
|
+
if (DataViewMessage.isOfType(message)) {
|
|
25609
|
+
switch (message.type) {
|
|
25610
|
+
case 'SELECTION_SELECTED':
|
|
25611
|
+
this.handleSelectionMessage(message.data);
|
|
25612
|
+
break;
|
|
25613
|
+
}
|
|
25614
|
+
}
|
|
25615
|
+
}
|
|
25616
|
+
sendMessageToChild(message) {
|
|
25617
|
+
this.log.debug("Sending message to iframe child:", message);
|
|
25618
|
+
this.iframeHost.sendMessageToChild(message);
|
|
25619
|
+
}
|
|
25620
|
+
/***************************************************************************
|
|
25621
|
+
* *
|
|
25622
|
+
* Private Methods *
|
|
25623
|
+
* *
|
|
25624
|
+
**************************************************************************/
|
|
25625
|
+
handleSelectionMessage(dataViewSelection) {
|
|
25626
|
+
if (this.selectionModel) {
|
|
25627
|
+
this.selectionModel.replaceSelection(dataViewSelection.selection);
|
|
25628
|
+
}
|
|
25629
|
+
}
|
|
25630
|
+
setupDataViewOptionsBridge(iframeHost) {
|
|
25631
|
+
combineLatest([
|
|
25632
|
+
this._dataViewOptions$,
|
|
25633
|
+
iframeHost.iframeState$
|
|
25634
|
+
]).pipe(takeUntil(this._destroy$), filter(([options, state]) => !!options && state.hasLoaded)).subscribe(([options, state]) => this.sendMessageToChild(this.buildDataViewInitMessage(options, this.initialSelection)));
|
|
25635
|
+
}
|
|
25636
|
+
buildDataViewInitMessage(options, initialSelection) {
|
|
25637
|
+
return DataViewMessage.initialSelection(new DataViewSelectionInit(options, initialSelection, this.idField));
|
|
25638
|
+
}
|
|
25639
|
+
}
|
|
25640
|
+
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 });
|
|
25641
|
+
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 });
|
|
25642
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataViewIframeComponent, decorators: [{
|
|
25643
|
+
type: Component,
|
|
25644
|
+
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" }]
|
|
25645
|
+
}], ctorParameters: function () { return [{ type: SelectionModel, decorators: [{
|
|
25646
|
+
type: Optional
|
|
25647
|
+
}] }]; }, propDecorators: { srcUrl: [{
|
|
25648
|
+
type: Input
|
|
25649
|
+
}], idField: [{
|
|
25650
|
+
type: Input
|
|
25651
|
+
}], initialSelection: [{
|
|
25652
|
+
type: Input
|
|
25653
|
+
}], iframeHost: [{
|
|
25654
|
+
type: ViewChild,
|
|
25655
|
+
args: [IframeHostComponent]
|
|
25656
|
+
}], dataViewOptions: [{
|
|
25657
|
+
type: Input
|
|
25658
|
+
}] } });
|
|
25659
|
+
|
|
25660
|
+
function createSelectionModel() {
|
|
25661
|
+
return new SelectionModel();
|
|
25662
|
+
}
|
|
25663
|
+
function createDataOptionsProvider() {
|
|
25664
|
+
return new ElderDataViewOptionsProvider();
|
|
25665
|
+
}
|
|
25666
|
+
/**
|
|
25667
|
+
* An adapter bridging communication between
|
|
25668
|
+
* a data view displayed in an iframe and its parent.
|
|
25669
|
+
*
|
|
25670
|
+
* For example propagates selection model changes
|
|
25671
|
+
* to the iframe parent.
|
|
25672
|
+
*/
|
|
25673
|
+
class DataViewIframeAdapterDirective {
|
|
25674
|
+
/***************************************************************************
|
|
25675
|
+
* *
|
|
25676
|
+
* Constructor *
|
|
25677
|
+
* *
|
|
25678
|
+
**************************************************************************/
|
|
25679
|
+
constructor(iframeService, selectionModel, dataViewOptionsProvider) {
|
|
25680
|
+
this.iframeService = iframeService;
|
|
25681
|
+
this.selectionModel = selectionModel;
|
|
25682
|
+
this.dataViewOptionsProvider = dataViewOptionsProvider;
|
|
25683
|
+
/***************************************************************************
|
|
25684
|
+
* *
|
|
25685
|
+
* Fields *
|
|
25686
|
+
* *
|
|
25687
|
+
**************************************************************************/
|
|
25688
|
+
this.log = LoggerFactory.getLogger(this.constructor.name);
|
|
25689
|
+
this._destroy$ = new Subject();
|
|
25690
|
+
selectionModel.selection.pipe(takeUntil(this._destroy$)).subscribe(selection => this.propagateSelectionToParent(selection));
|
|
25691
|
+
}
|
|
25692
|
+
/***************************************************************************
|
|
25693
|
+
* *
|
|
25694
|
+
* Listeners *
|
|
25695
|
+
* *
|
|
25696
|
+
**************************************************************************/
|
|
25697
|
+
/**
|
|
25698
|
+
* Listens for messages from parent window.
|
|
25699
|
+
* Makes it possible to react upon messages from iframe parent.
|
|
25700
|
+
*
|
|
25701
|
+
* @param event message from parent window
|
|
25702
|
+
*/
|
|
25703
|
+
onWindowsMessage(event) {
|
|
25704
|
+
this.log.debug('Received message event from parent:', event);
|
|
25705
|
+
if (event) {
|
|
25706
|
+
if (DataViewMessage.isOfType(event.data)) {
|
|
25707
|
+
this.log.debug('Received data view message from parent:', event);
|
|
25708
|
+
this.handleMessageFromParent(event.data);
|
|
25709
|
+
}
|
|
25710
|
+
}
|
|
25711
|
+
return true;
|
|
25712
|
+
}
|
|
25713
|
+
/***************************************************************************
|
|
25714
|
+
* *
|
|
25715
|
+
* Life Cycle *
|
|
25716
|
+
* *
|
|
25717
|
+
**************************************************************************/
|
|
25718
|
+
ngOnInit() {
|
|
25719
|
+
}
|
|
25720
|
+
ngOnDestroy() {
|
|
25721
|
+
this._destroy$.next();
|
|
25722
|
+
this._destroy$.complete();
|
|
25723
|
+
}
|
|
25724
|
+
/***************************************************************************
|
|
25725
|
+
* *
|
|
25726
|
+
* Private Methods *
|
|
25727
|
+
* *
|
|
25728
|
+
**************************************************************************/
|
|
25729
|
+
handleMessageFromParent(message) {
|
|
25730
|
+
switch (message.type) {
|
|
25731
|
+
case 'SELECTION_INIT':
|
|
25732
|
+
this.initializeDataView(message.data);
|
|
25733
|
+
break;
|
|
25734
|
+
}
|
|
25735
|
+
}
|
|
25736
|
+
initializeDataView(init) {
|
|
25737
|
+
this.dataViewOptionsProvider.updateOptions(options => options
|
|
25738
|
+
.withSorts(init.options.sorts)
|
|
25739
|
+
.withFilters(init.options.filters));
|
|
25740
|
+
this.selectionModel.keyGetterFn = (entity) => entity[init.idField];
|
|
25741
|
+
this.selectionModel.isMultipleSelection = init.options.selectionMultiEnabled;
|
|
25742
|
+
if (init.initialSelection) {
|
|
25743
|
+
this.selectionModel.replaceSelection(init.initialSelection);
|
|
25744
|
+
}
|
|
25745
|
+
}
|
|
25746
|
+
propagateSelectionToParent(selection) {
|
|
25747
|
+
this.log.debug('Propagating selection to iframe parent:', selection);
|
|
25748
|
+
const message = this.buildSelectionMessage(selection);
|
|
25749
|
+
this.iframeService.postDataMessage(message);
|
|
25750
|
+
}
|
|
25751
|
+
buildSelectionMessage(selection) {
|
|
25752
|
+
return DataViewMessage.selection(new DataViewSelection(selection));
|
|
25753
|
+
}
|
|
25754
|
+
}
|
|
25755
|
+
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 });
|
|
25756
|
+
DataViewIframeAdapterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: DataViewIframeAdapterDirective, selector: "[elderDataViewIframeAdapter]", host: { listeners: { "window:message": "onWindowsMessage($event)" } }, providers: [
|
|
25757
|
+
{
|
|
25758
|
+
provide: SelectionModel,
|
|
25759
|
+
useFactory: createSelectionModel
|
|
25760
|
+
},
|
|
25761
|
+
{
|
|
25762
|
+
provide: ElderDataViewOptionsProvider,
|
|
25763
|
+
useFactory: createDataOptionsProvider
|
|
25764
|
+
}
|
|
25765
|
+
], ngImport: i0 });
|
|
25766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DataViewIframeAdapterDirective, decorators: [{
|
|
25767
|
+
type: Directive,
|
|
25768
|
+
args: [{
|
|
25769
|
+
selector: '[elderDataViewIframeAdapter]',
|
|
25770
|
+
providers: [
|
|
25771
|
+
{
|
|
25772
|
+
provide: SelectionModel,
|
|
25773
|
+
useFactory: createSelectionModel
|
|
25774
|
+
},
|
|
25775
|
+
{
|
|
25776
|
+
provide: ElderDataViewOptionsProvider,
|
|
25777
|
+
useFactory: createDataOptionsProvider
|
|
25778
|
+
}
|
|
25779
|
+
]
|
|
25780
|
+
}]
|
|
25781
|
+
}], ctorParameters: function () { return [{ type: IframeService }, { type: SelectionModel }, { type: ElderDataViewOptionsProvider }]; }, propDecorators: { onWindowsMessage: [{
|
|
25782
|
+
type: HostListener,
|
|
25783
|
+
args: ['window:message', ['$event']]
|
|
25784
|
+
}] } });
|
|
25785
|
+
|
|
25378
25786
|
class ElderIFrameModule {
|
|
25379
25787
|
}
|
|
25380
25788
|
ElderIFrameModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderIFrameModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
25381
25789
|
ElderIFrameModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ElderIFrameModule, declarations: [IframeHostComponent,
|
|
25382
25790
|
IframeDialogComponent,
|
|
25383
25791
|
IframeSideContentComponent,
|
|
25384
|
-
IframeCloseDirective
|
|
25792
|
+
IframeCloseDirective,
|
|
25793
|
+
DataViewIframeComponent,
|
|
25794
|
+
DataViewIframeAdapterDirective], imports: [
|
|
25385
25795
|
// Angular
|
|
25386
25796
|
CommonModule,
|
|
25387
25797
|
RouterModule,
|
|
@@ -25396,7 +25806,9 @@ ElderIFrameModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versi
|
|
|
25396
25806
|
ElderPipesModule], exports: [IframeHostComponent,
|
|
25397
25807
|
IframeDialogComponent,
|
|
25398
25808
|
IframeSideContentComponent,
|
|
25399
|
-
IframeCloseDirective
|
|
25809
|
+
IframeCloseDirective,
|
|
25810
|
+
DataViewIframeComponent,
|
|
25811
|
+
DataViewIframeAdapterDirective] });
|
|
25400
25812
|
ElderIFrameModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ElderIFrameModule, imports: [
|
|
25401
25813
|
// Angular
|
|
25402
25814
|
CommonModule,
|
|
@@ -25431,13 +25843,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
25431
25843
|
IframeHostComponent,
|
|
25432
25844
|
IframeDialogComponent,
|
|
25433
25845
|
IframeSideContentComponent,
|
|
25434
|
-
IframeCloseDirective
|
|
25846
|
+
IframeCloseDirective,
|
|
25847
|
+
DataViewIframeComponent,
|
|
25848
|
+
DataViewIframeAdapterDirective
|
|
25435
25849
|
],
|
|
25436
25850
|
exports: [
|
|
25437
25851
|
IframeHostComponent,
|
|
25438
25852
|
IframeDialogComponent,
|
|
25439
25853
|
IframeSideContentComponent,
|
|
25440
|
-
IframeCloseDirective
|
|
25854
|
+
IframeCloseDirective,
|
|
25855
|
+
DataViewIframeComponent,
|
|
25856
|
+
DataViewIframeAdapterDirective
|
|
25441
25857
|
]
|
|
25442
25858
|
}]
|
|
25443
25859
|
}] });
|
|
@@ -26572,5 +26988,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
26572
26988
|
* Generated bundle index. Do not edit.
|
|
26573
26989
|
*/
|
|
26574
26990
|
|
|
26575
|
-
export { AuditedEntity, AutoStartSpec, BlobUrl, BytesFormat, BytesPerSecondFormat, BytesPipe, CardDropEvent, CardOrganizerData, CardStack, CollectionUtil, ComparatorBuilder, ConfirmDialogConfig, ContinuableListing, CsvColumnSpec, CsvSerializer, CsvSpec, CsvStreamExporter, CsvStreamExporterBuilder, CsvStreamExporterBuilderService, Currency, CurrencyCode, CurrencyUnit, CurrencyUnitRegistry, CustomDateAdapter, DataContextActivePage, DataContextAutoStarter, DataContextBase, DataContextBuilder, DataContextContinuableBase, DataContextContinuablePaged, DataContextContinuableToken, DataContextLifeCycleBinding, DataContextSelectionDirective, DataContextSimple, DataContextSnapshot, DataContextSourceAutoReloader, DataContextStateIndicatorComponent, DataContextStatus, DataSourceAdapter, DataSourceProcessor, DataTransferFactory, DataTransferProgress, DataTransferProgressAggregate, DataTransferState, DataTransferStatus, DateUtil, DelegateContinuableDataSource, DelegateDataSource, DelegateListDataSource, DelegatePagedDataSource, Dimensions, DrawerOutletBinding, DurationBucket, DurationFormat, ELDER_SELECT_BASE, EbsCommonDialogService, EbsToastService, ElderAccessDeniedComponent, ElderAccessDeniedModule, ElderAppHeaderComponent, ElderAuditModule, ElderAuditedEntityComponent, ElderAutoSelectFirstDirective, ElderAutocompleteComponent, ElderAutocompleteDirective, ElderAutocompleteModule, ElderBlobViewerComponent, ElderBreadCrumbsComponent, ElderBreadCrumbsModule, ElderButtonGroupComponent, ElderButtonGroupModule, ElderCardComponent, ElderCardContentDirective, ElderCardHeaderActionsDirective, ElderCardHeaderComponent, ElderCardModule, ElderCardOrganizerComponent, ElderCardOrganizerModule, ElderCardPanelComponent, ElderCardStackComponent, ElderCardSubtitleDirective, ElderCardTitleDirective, ElderCheckboxState, ElderChipListSelectComponent, ElderChipListSelectModule, ElderClearSelectDirective, ElderClipboardPutDirective, ElderClipboardService, ElderConfirmDialogComponent, ElderConnectivityModule, ElderConnectivityService, ElderContainersModule, ElderCsvExportBtnComponent, ElderCsvModule, ElderCurrencyModule, ElderCurrencyPipe, ElderDataCommonModule, ElderDataToolbarComponent, ElderDataTransferModule, ElderDataTransferService, ElderDataViewBaseComponent,
|
|
26991
|
+
export { AuditedEntity, AutoStartSpec, BlobUrl, BytesFormat, BytesPerSecondFormat, BytesPipe, CardDropEvent, CardOrganizerData, CardStack, CollectionUtil, ComparatorBuilder, ConfirmDialogConfig, ContinuableListing, CsvColumnSpec, CsvSerializer, CsvSpec, CsvStreamExporter, CsvStreamExporterBuilder, CsvStreamExporterBuilderService, Currency, CurrencyCode, CurrencyUnit, CurrencyUnitRegistry, CustomDateAdapter, DataContextActivePage, DataContextAutoStarter, DataContextBase, DataContextBuilder, DataContextContinuableBase, DataContextContinuablePaged, DataContextContinuableToken, DataContextLifeCycleBinding, DataContextSelectionDirective, DataContextSimple, DataContextSnapshot, DataContextSourceAutoReloader, DataContextStateIndicatorComponent, DataContextStatus, DataSourceAdapter, DataSourceProcessor, DataTransferFactory, DataTransferProgress, DataTransferProgressAggregate, DataTransferState, DataTransferStatus, DataViewIframeAdapterDirective, DataViewIframeComponent, DataViewMessage, DataViewOptionsProviderBinding, DataViewSelection, DataViewSelectionInit, DateUtil, DelegateContinuableDataSource, DelegateDataSource, DelegateListDataSource, DelegatePagedDataSource, Dimensions, DrawerOutletBinding, DurationBucket, DurationFormat, ELDER_DATA_VIEW, ELDER_SELECT_BASE, EbsCommonDialogService, EbsToastService, ElderAccessDeniedComponent, ElderAccessDeniedModule, ElderAppHeaderComponent, ElderAuditModule, ElderAuditedEntityComponent, ElderAutoSelectFirstDirective, ElderAutocompleteComponent, ElderAutocompleteDirective, ElderAutocompleteModule, ElderBlobViewerComponent, ElderBreadCrumbsComponent, ElderBreadCrumbsModule, ElderButtonGroupComponent, ElderButtonGroupModule, ElderCardComponent, ElderCardContentDirective, ElderCardHeaderActionsDirective, ElderCardHeaderComponent, ElderCardModule, ElderCardOrganizerComponent, ElderCardOrganizerModule, ElderCardPanelComponent, ElderCardStackComponent, ElderCardSubtitleDirective, ElderCardTitleDirective, ElderCheckboxState, ElderChipListSelectComponent, ElderChipListSelectModule, ElderClearSelectDirective, ElderClipboardPutDirective, ElderClipboardService, ElderConfirmDialogComponent, ElderConnectivityModule, ElderConnectivityService, ElderContainersModule, ElderCsvExportBtnComponent, ElderCsvModule, ElderCurrencyModule, ElderCurrencyPipe, ElderDataCommonModule, ElderDataToolbarComponent, ElderDataTransferModule, ElderDataTransferService, ElderDataViewBaseComponent, ElderDataViewOptionsProvider, ElderDateSwitcherComponent, ElderDateTimeInputComponent, ElderDatesModule, ElderDelayedFocusDirective, ElderDialogConfig, ElderDialogModule, ElderDialogService, ElderDimensionsInputComponent, ElderDurationInputComponent, ElderEntityValueAccessorUtil, ElderEnumTranslationService, ElderErrorModule, ElderEventSourceService, ElderExceptionDetailComponent, ElderExpandToggleButtonComponent, ElderExpandToggleButtonModule, ElderFileDropZoneDirective, ElderFileModule, ElderFileSelectComponent, ElderFileSelectDirective, ElderFileUploadComponent, ElderFormFieldControlBase, ElderFormFieldDenseDirective, ElderFormFieldLabelDirective, ElderFormFieldNoHintDirective, ElderFormFieldNoSpinnerDirective, ElderFormsDirectivesModule, ElderFormsModule, ElderFromFieldBase, ElderFromFieldEntityBase, ElderFromFieldMultiEntityBase, ElderGlobalSearchComponent, ElderGlobalSearchModule, ElderGlobalSearchService, ElderGridComponent, ElderGridModule, ElderGridTileDirective, ElderGridToolbarDirective, ElderHeaderComponent, ElderHeaderModule, ElderHttpClient, ElderI18nEntitiesModule, ElderIFrameModule, ElderInfiniteAutocompleteDirective, ElderInfiniteScrollDirective, ElderInfiniteScrollLegacyDirective, ElderInfiniteScrollModule, ElderInputPatternDirective, ElderIntervalInputComponent, ElderKeyEventDirective, ElderLabelInputComponent, ElderLabelsModule, ElderLanguageConfig, ElderLanguageInterceptor, ElderLanguageModule, ElderLanguageService, ElderLanguageSwitcherComponent, ElderLocalDateInputComponent, ElderLocalTimeInputComponent, ElderLocalesDeChModule, ElderLocalizedInputComponent, ElderLocalizedInputDialogComponent, ElderLocalizedInputDialogService, ElderLocalizedInputTableComponent, ElderLocalizedTextColumnDirective, ElderLocalizedTextsDirective, ElderMaxDirective, ElderMeasuresModule, ElderMinDirective, ElderMultiAutoCompleteModule, ElderMultiAutocompleteComponent, ElderMultiEntityValueAccessorUtil, ElderMultiSelectBase, ElderMultiSelectChipsComponent, ElderMultiSelectFormField, ElderMultipleOfValidator, ElderNavGroupComponent, ElderNavLinkComponent, ElderNavListComponent, ElderNavModule, ElderNextFocusableDirective, ElderNumberCellDirective, ElderOfflineIndicatorComponent, ElderOverlayComponent, ElderOverlayModule, ElderOverlayOriginDirective, ElderOverlayTriggerDirective, ElderPaddingDirective, ElderPanelComponent, ElderPanelModule, ElderPeriodInputComponent, ElderPipesModule, ElderPlugParentFormDirective, ElderPlugParentFormDirectiveLegacy, ElderProgressBarComponent, ElderProgressBarModule, ElderQuantityInputComponent, ElderQuantityModule, ElderQuantityPipe, ElderQuantityService, ElderQuantityTransformPipe, ElderQuestionDialogComponent, ElderRepeatPipe, ElderRepeatPipeLegacy, ElderRequiredIgnoreZeroValidator, ElderRoundPipe, ElderRouteOutletDrawerService, ElderRouterOutletService, ElderSafeUrlPipe, ElderScrollContainerComponent, ElderSearchBoxComponent, ElderSearchContextDirective, ElderSearchInputDirective, ElderSearchModule, ElderSearchPanelComponent, ElderSelectBase, ElderSelectChipAvatarDirective, ElderSelectChipDirective, ElderSelectComponent, ElderSelectComponentState, ElderSelectCustomInputDirective, ElderSelectFormField, ElderSelectListComponent, ElderSelectListItemComponent, ElderSelectListModule, ElderSelectModule, ElderSelectOnTabDirective, ElderSelectValueDirective, ElderSelectionDialogComponent, ElderSelectionDialogDirective, ElderSelectionMasterCheckboxComponent, ElderShellCenterDirective, ElderShellComponent, ElderShellModule, ElderShellNavigationToggleComponent, ElderShellService, ElderShellSideLeftDirective, ElderShellSideRightDirective, ElderShellSlotDirective, ElderSimpleSelectionViewComponent, ElderSimpleSelectionViewModule, ElderSingleSortComponent, ElderStackCardDirective, ElderStopEventPropagationDirective, ElderStopEventPropagationDirectiveLegacy, ElderSvgViewerComponent, ElderTabDirective, ElderTabFocusTrapDirective, ElderTabGroupRoutingDirective, ElderTabModule, ElderTableActivationDirective, ElderTableComponent, ElderTableExtensionDirective, ElderTableGroup, ElderTableModel, ElderTableModelCdkTableBinding, ElderTableModelQueryGroup, ElderTableModule, ElderTableProviders, ElderTableRootDirective, ElderTableSortDirective, ElderTableToolbarDirective, ElderThemeApplierDirective, ElderThemeDirective, ElderThemeModule, ElderThemePreferenceService, ElderThemeService, ElderThemeToggleComponent, ElderTimeModule, ElderToastModule, ElderToastService, ElderToolbarColumnDirective, ElderToolbarComponent, ElderToolbarContentDirective, ElderToolbarModule, ElderToolbarService, ElderToolbarTitleComponent, ElderToolbarTitleService, ElderTouchedDirective, ElderTouchedDirectiveLegacy, ElderTrimPipe, ElderTripleStateCheckboxDirective, ElderTruncatePipe, ElderUnitSelectDirective, ElderUnitService, ElderUrlFragment, ElderUrlFragmentModule, ElderUrlFragmentParamsService, ElderUrlFragmentSwitcherComponent, ElderViewersModule, EntitySetPatch, ErrorUtil, ExceptionDetailCtx, FileUploadClient, Filter, FilterContext, FilterUtil, FormFieldBaseComponent, HttpClientBuilder, HttpClientPristine, HttpDataTransfer, HttpDataTransferAggregateComponent, HttpDataTransferComponent, HttpDataTransferIndicatorComponent, HttpDataTransferOverviewComponent, HttpParamsBuilder, I18nBase, I18nPickAsyncPipe, I18nPickPipe, I18nText, IFrameState, IframeCloseDirective, IframeDialogComponent, IframeHostComponent, IframeService, IframeSideContentComponent, InternalRestClientConfig, Interval, IsoDurationPipe, IsoIntervalParsePipe, IsoIntervalPipe, JsonMapUtil, KafentConfig, KafentEvent, KafentEventService, KafentEventStream, KafentEventStreamDisabled, KafentEventStreamSse, KafentEventTransport, KafentModule, KafentSseEventChannel, KafentTokenProvider, KafentTokenProviderSessionStorage, KafentTopicSse, KnownElderThemes, KnownLocaleType, LocalListDataSource, LocalPagedDataSource, LocalisationPickerService, MasterSelectionState, MatTableDataContextBinding, MatTableDataContextBindingBuilder, MultiModelBaseComponent, NextNumberUtil, Objects, OnlineStatus, Page, PageRequest, Pageable, ParseUtil, Path, PathNode, PeriodBucket, PeriodDuration, PeriodFormat, ProcessIterationContext, ProcessState, PropertyPathUtil, Quantity, QueryListBinding, QuestionDialogConfig, ReactiveEventSource, ReactiveMap, RefreshingEntity, ReplacementResult, RestClient, RestClientConfig, RestClientContinuable, RestClientList, RestClientPaged, SearchQuery, SelectionModel, SelectionModelPopupDirective, Sets, SimpleLocalisationPicker, Sort, SortOption, SortUtil, SubBar, SuggestionProvider, TemplateCompositeControl, TemplatedSelectionDialogComponent, TextRange, ThemeSpec, TimeAgoPipe, TimeDurationPipe, TimeUtil, ToastService, ToastType, TokenChunkRequest, ToolbarHeader, TranslatedEnumValue, TypedEventMessage, Unit, UnitDimension, UnitDimensionInfo, UnitInfo, UnitRegistry, UrlBuilder, UrlQueryParams, UuidUtil, ValueAccessorBase, ValueWrapper, ViewProviders, WeightPipe, WordPositionFinder, alphaNumStringComparator, buildFormIntegrationProviders, createDataOptionsProvider, createSelectionModel, existingOrNewElderTableModel, isActivePagedDataContext, isContinuableDataContext, isContinuableDataSource, isDataContext, isDataSource, isElderEntityValueAccessor, isElderMultiEntityValueAccessor, isListDataSource, isPagedDataSource, naturalValueComparator, newElderTableModel, proxyControlContainer, registerLocale, runInZone, themeInit };
|
|
26576
26992
|
//# sourceMappingURL=elderbyte-ngx-starter.mjs.map
|