@enigmatry/entry-components 15.2.1-preview.1 → 16.0.0-preview
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/common/directives/auto-disable-button.directive.d.ts +1 -1
- package/dialog/dialogs/entry-dialog.component.d.ts +1 -1
- package/{esm2020 → esm2022}/button/entry-button.directive.mjs +4 -4
- package/{esm2020 → esm2022}/button/entry-button.module.mjs +7 -7
- package/{esm2020 → esm2022}/common/common.module.mjs +7 -7
- package/{esm2020 → esm2022}/common/date-time/entry-date-time-adapter.mjs +4 -4
- package/{esm2020 → esm2022}/common/directives/auto-disable-button.directive.mjs +4 -4
- package/{esm2020 → esm2022}/common/directives/scroll-to-invalid-control.directive.mjs +4 -4
- package/{esm2020 → esm2022}/common/event-plugins/debounce.plugin.mjs +4 -4
- package/{esm2020 → esm2022}/common/event-plugins/throttle.plugin.mjs +4 -4
- package/{esm2020 → esm2022}/common/interceptors/accept-language.interceptor.mjs +4 -4
- package/{esm2020 → esm2022}/dialog/dialogs/alert/entry-alert-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/dialog/dialogs/confirm/entry-confirm-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/dialog/dialogs/entry-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/dialog/dialogs/error/entry-error-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/dialog/entry-dialog.module.mjs +19 -19
- package/esm2022/dialog/entry-dialog.service.mjs +86 -0
- package/esm2022/file-input/entry-file-input.component.mjs +201 -0
- package/{esm2020 → esm2022}/file-input/entry-file-input.module.mjs +13 -13
- package/{esm2020 → esm2022}/modules/entry-components.module.mjs +21 -21
- package/{esm2020 → esm2022}/permissions/permission.directive.mjs +4 -4
- package/{esm2020 → esm2022}/permissions/permission.module.mjs +7 -7
- package/{esm2020 → esm2022}/permissions/permission.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/search-filter/autocomplete/autocomplete-search-filter.component.mjs +4 -4
- package/esm2022/search-filter/date/date-search-filter.component.mjs +19 -0
- package/{esm2020 → esm2022}/search-filter/date-time/date-time-search-filter.component.mjs +7 -7
- package/{esm2020 → esm2022}/search-filter/entry-search-filter.component.mjs +4 -4
- package/{esm2020 → esm2022}/search-filter/entry-search-filter.module.mjs +28 -28
- package/{esm2020 → esm2022}/search-filter/select/select-search-filter.component.mjs +4 -4
- package/{esm2020 → esm2022}/search-filter/text/text-search-filter.component.mjs +4 -4
- package/{esm2020 → esm2022}/spinner/entry-spinner/spinner.component.mjs +10 -10
- package/{esm2020 → esm2022}/spinner/spinner-overlay-container.mjs +4 -4
- package/{esm2020 → esm2022}/spinner/spinner.module.mjs +9 -9
- package/{esm2020 → esm2022}/table/components/entry-cell/entry-cell.component.mjs +4 -4
- package/esm2022/table/components/entry-cell-context-menu/entry-cell-context-menu.component.mjs +33 -0
- package/{esm2020 → esm2022}/table/components/entry-cell-formatted-value/entry-cell-formatted-value.component.mjs +4 -4
- package/esm2022/table/components/entry-table/entry-table.component.mjs +248 -0
- package/{esm2020 → esm2022}/table/entry-table.module.mjs +33 -33
- package/{esm2020 → esm2022}/table/interfaces/entry-table-config.mjs +1 -2
- package/{esm2020 → esm2022}/validation/entry-display-control-validation.directive.mjs +4 -4
- package/{esm2020 → esm2022}/validation/entry-form-errors.component.mjs +6 -6
- package/{esm2020 → esm2022}/validation/entry-validation.module.mjs +13 -13
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-button.mjs +9 -9
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-button.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-common.mjs +24 -24
- package/{fesm2015 → fesm2022}/enigmatry-entry-components-common.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-dialog.mjs +33 -33
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-dialog.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-file-input.mjs +21 -17
- package/fesm2022/enigmatry-entry-components-file-input.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-permissions.mjs +12 -12
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-permissions.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-search-filter.mjs +387 -0
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-search-filter.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-spinner.mjs +20 -20
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-spinner.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-table.mjs +45 -46
- package/fesm2022/enigmatry-entry-components-table.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-validation.mjs +20 -20
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-validation.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components.mjs +20 -20
- package/{fesm2020 → fesm2022}/enigmatry-entry-components.mjs.map +1 -1
- package/file-input/entry-file-input.component.d.ts +1 -1
- package/package.json +39 -63
- package/permissions/permission.directive.d.ts +1 -1
- package/search-filter/autocomplete/autocomplete-search-filter.component.d.ts +1 -1
- package/search-filter/date/date-search-filter.component.d.ts +1 -1
- package/search-filter/date-time/date-time-search-filter.component.d.ts +1 -1
- package/search-filter/entry-search-filter.component.d.ts +1 -1
- package/search-filter/select/select-search-filter.component.d.ts +1 -1
- package/search-filter/text/text-search-filter.component.d.ts +1 -1
- package/spinner/entry-spinner/spinner.component.d.ts +1 -1
- package/table/components/entry-cell/entry-cell.component.d.ts +1 -1
- package/table/components/entry-cell-context-menu/entry-cell-context-menu.component.d.ts +1 -1
- package/table/components/entry-cell-formatted-value/entry-cell-formatted-value.component.d.ts +1 -1
- package/table/components/entry-table/entry-table.component.d.ts +1 -1
- package/validation/entry-display-control-validation.directive.d.ts +1 -1
- package/validation/entry-form-errors.component.d.ts +1 -1
- package/esm2020/dialog/entry-dialog.service.mjs +0 -86
- package/esm2020/file-input/entry-file-input.component.mjs +0 -197
- package/esm2020/search-filter/date/date-search-filter.component.mjs +0 -19
- package/esm2020/table/components/entry-cell-context-menu/entry-cell-context-menu.component.mjs +0 -33
- package/esm2020/table/components/entry-table/entry-table.component.mjs +0 -248
- package/fesm2015/enigmatry-entry-components-button.mjs +0 -114
- package/fesm2015/enigmatry-entry-components-button.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-common.mjs +0 -405
- package/fesm2015/enigmatry-entry-components-dialog.mjs +0 -333
- package/fesm2015/enigmatry-entry-components-dialog.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-file-input.mjs +0 -237
- package/fesm2015/enigmatry-entry-components-file-input.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-permissions.mjs +0 -98
- package/fesm2015/enigmatry-entry-components-permissions.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-search-filter.mjs +0 -394
- package/fesm2015/enigmatry-entry-components-search-filter.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-spinner.mjs +0 -156
- package/fesm2015/enigmatry-entry-components-spinner.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-table.mjs +0 -462
- package/fesm2015/enigmatry-entry-components-table.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-validation.mjs +0 -219
- package/fesm2015/enigmatry-entry-components-validation.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components.mjs +0 -87
- package/fesm2015/enigmatry-entry-components.mjs.map +0 -1
- package/fesm2020/enigmatry-entry-components-common.mjs.map +0 -1
- package/fesm2020/enigmatry-entry-components-file-input.mjs.map +0 -1
- package/fesm2020/enigmatry-entry-components-search-filter.mjs +0 -387
- package/fesm2020/enigmatry-entry-components-table.mjs.map +0 -1
- /package/{esm2020 → esm2022}/button/enigmatry-entry-components-button.mjs +0 -0
- /package/{esm2020 → esm2022}/button/entry-button-config.mjs +0 -0
- /package/{esm2020 → esm2022}/button/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/common/constants.mjs +0 -0
- /package/{esm2020 → esm2022}/common/date-time/entry-date-time.mjs +0 -0
- /package/{esm2020 → esm2022}/common/date-time/index.mjs +0 -0
- /package/{esm2020 → esm2022}/common/directives/index.mjs +0 -0
- /package/{esm2020 → esm2022}/common/enigmatry-entry-components-common.mjs +0 -0
- /package/{esm2020 → esm2022}/common/event-plugins/abstract.plugin.mjs +0 -0
- /package/{esm2020 → esm2022}/common/event-plugins/index.mjs +0 -0
- /package/{esm2020 → esm2022}/common/interceptors/index.mjs +0 -0
- /package/{esm2020 → esm2022}/common/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/common/utils/index.mjs +0 -0
- /package/{esm2020 → esm2022}/common/utils/provide-config.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/dialogs/alert/entry-alert-dialog-data.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/dialogs/confirm/entry-confirm-dialog-data.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/dialogs/error/entry-error-dialog-data.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/enigmatry-entry-components-dialog.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/entry-dialog-buttons-alignment.type.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/entry-dialog-config.model.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/enigmatry-entry-components.mjs +0 -0
- /package/{esm2020 → esm2022}/file-input/enigmatry-entry-components-file-input.mjs +0 -0
- /package/{esm2020 → esm2022}/file-input/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/permissions/enigmatry-entry-components-permissions.mjs +0 -0
- /package/{esm2020 → esm2022}/permissions/permission-type.mjs +0 -0
- /package/{esm2020 → esm2022}/permissions/permission.guard.mjs +0 -0
- /package/{esm2020 → esm2022}/permissions/permission.service.mjs +0 -0
- /package/{esm2020 → esm2022}/permissions/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/autocomplete/autocomplete-search-filter.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/control-type.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/date/date-search-filter.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/date-time/date-time-search-filter.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/enigmatry-entry-components-search-filter.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/search-filter-base.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/search-filter-config.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/search-filter-params.type.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/select/select-search-filter.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/select-option.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/text/text-search-filter.model.mjs +0 -0
- /package/{esm2020 → esm2022}/spinner/enigmatry-entry-components-spinner.mjs +0 -0
- /package/{esm2020 → esm2022}/spinner/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/table/components/index.mjs +0 -0
- /package/{esm2020 → esm2022}/table/enigmatry-entry-components-table.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/cell-template.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/column-def.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/column-sort-prop.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/column-type-parameter.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/column-type.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/context-menu-item.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/index.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/paged-query.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/pagination.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/row-class-formatter.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/row-context-menu-formatter.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/row-selection-formatter.mjs +0 -0
- /package/{esm2020 → esm2022}/table/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/validation/enigmatry-entry-components-validation.mjs +0 -0
- /package/{esm2020 → esm2022}/validation/entry-validation-config.model.mjs +0 -0
- /package/{esm2020 → esm2022}/validation/entry-validation.mjs +0 -0
- /package/{esm2020 → esm2022}/validation/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/validation/validation-problem-details.interface.mjs +0 -0
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Inject, Input, ChangeDetectionStrategy, Injectable, NgModule } from '@angular/core';
|
|
3
|
-
import { of } from 'rxjs';
|
|
4
|
-
import { createInjectionToken, provideConfig } from '@enigmatry/entry-components/common';
|
|
5
|
-
import * as i1 from '@angular/material/dialog';
|
|
6
|
-
import { MAT_DIALOG_DATA, MatDialogConfig, MatDialogModule } from '@angular/material/dialog';
|
|
7
|
-
import * as i2 from '@angular/common';
|
|
8
|
-
import { CommonModule } from '@angular/common';
|
|
9
|
-
import * as i3 from '@angular/material/icon';
|
|
10
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
11
|
-
import * as i4 from '@angular/material/button';
|
|
12
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
13
|
-
import * as i5 from '@enigmatry/entry-components/button';
|
|
14
|
-
import { EntryButtonModule } from '@enigmatry/entry-components/button';
|
|
15
|
-
import { take } from 'rxjs/operators';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Used to provide default configurations on module level.
|
|
19
|
-
*/
|
|
20
|
-
class EntryDialogConfig {
|
|
21
|
-
constructor(config = {}) {
|
|
22
|
-
var _a, _b, _c, _d, _e;
|
|
23
|
-
this.confirmButtonText = (_a = config.confirmButtonText) !== null && _a !== void 0 ? _a : 'Ok';
|
|
24
|
-
this.cancelButtonText = (_b = config.cancelButtonText) !== null && _b !== void 0 ? _b : 'Cancel';
|
|
25
|
-
this.buttonsAlignment = (_c = config.buttonsAlignment) !== null && _c !== void 0 ? _c : 'end';
|
|
26
|
-
this.hideClose = (_d = config.hideClose) !== null && _d !== void 0 ? _d : true;
|
|
27
|
-
this.disableClose = (_e = config.disableClose) !== null && _e !== void 0 ? _e : false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Entry dialog injection token of EntryDialogConfig type containing dialog default configurations.
|
|
32
|
-
*
|
|
33
|
-
* Defaults:
|
|
34
|
-
* - confirmButtonText: 'Ok'
|
|
35
|
-
* - cancelButtonText: 'Cancel'
|
|
36
|
-
* - buttonsAlignment: 'end'
|
|
37
|
-
* - hideClose: true
|
|
38
|
-
* - disableClose: false
|
|
39
|
-
*/
|
|
40
|
-
const ENTRY_DIALOG_CONFIG = createInjectionToken(new EntryDialogConfig());
|
|
41
|
-
/**
|
|
42
|
-
* Can be used to provide entry dialog configuration.
|
|
43
|
-
*/
|
|
44
|
-
function provideEntryDialogConfig(config) {
|
|
45
|
-
return provideConfig(ENTRY_DIALOG_CONFIG, () => new EntryDialogConfig(config));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Base Entry dialog component. Must be extended when building custom dialogs.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```html
|
|
53
|
-
* <entry-dialog title="TITLE"><p>Dialog content</p></entry-dialog>
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
class EntryDialogComponent {
|
|
57
|
-
constructor(mdDialogRef, config) {
|
|
58
|
-
this.mdDialogRef = mdDialogRef;
|
|
59
|
-
this.config = config;
|
|
60
|
-
/** Dialog buttons horizontal alignment */
|
|
61
|
-
this.buttonsAlignment = this.config.buttonsAlignment;
|
|
62
|
-
/** Confirm button label */
|
|
63
|
-
this.confirmButtonText = this.config.confirmButtonText;
|
|
64
|
-
/** Cancel button label */
|
|
65
|
-
this.cancelButtonText = this.config.cancelButtonText;
|
|
66
|
-
/** Show or hide dialog close button */
|
|
67
|
-
this.hideClose = this.config.hideClose;
|
|
68
|
-
this.confirm = () => of(true);
|
|
69
|
-
this.cancel = () => this.close(false);
|
|
70
|
-
// @HostListener('keydown.esc')
|
|
71
|
-
// onEsc = () => {
|
|
72
|
-
// if (!this.disableClose) {
|
|
73
|
-
// this.cancel();
|
|
74
|
-
// }
|
|
75
|
-
// };
|
|
76
|
-
this.onSubmit = () => this.confirm().subscribe({
|
|
77
|
-
next: closeDialog => {
|
|
78
|
-
if (closeDialog) {
|
|
79
|
-
this.close(closeDialog);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
this.close = (value = true) => this.mdDialogRef.close(value);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
EntryDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: ENTRY_DIALOG_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
87
|
-
EntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: EntryDialogComponent, selector: "entry-dialog", inputs: { title: "title", buttonsAlignment: "buttonsAlignment", confirmButtonText: "confirmButtonText", cancelButtonText: "cancelButtonText", hideButtons: "hideButtons", hideCancel: "hideCancel", hideClose: "hideClose", disableConfirm: "disableConfirm", buttonsTemplate: "buttonsTemplate", confirm: "confirm", cancel: "cancel" }, ngImport: i0, template: "<div class=\"entry-dialog\">\n <div class=\"dialog-header\">\n <h1 class=\"title\" [ngClass]=\"{'without-close-icon': hideClose === true}\" mat-dialog-title>{{ title }}</h1>\n <button mat-icon-button *ngIf=\"!hideClose\" type=\"button\" class=\"close-button\" (click)=\"cancel()\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n\n <mat-dialog-content class=\"dialog-content\" [ngClass]=\"{'with-actions': !hideButtons}\">\n <ng-content></ng-content>\n </mat-dialog-content>\n\n <mat-dialog-actions class=\"dialog-actions\" [align]=\"buttonsAlignment\" *ngIf=\"!hideButtons\">\n <ng-container *ngIf=\"buttonsTemplate; then buttonsTemplate; else defaultButtonsTemplate\">\n </ng-container>\n </mat-dialog-actions>\n \n <ng-template #defaultButtonsTemplate>\n <button cdkFocusInitial mat-button entry-submit-button (click)=\"onSubmit()\">\n <span>{{confirmButtonText}}</span>\n </button>\n <button *ngIf=\"!hideCancel\" mat-button entry-cancel-button (click)=\"cancel()\">\n <span>{{cancelButtonText}}</span>\n </button>\n </ng-template>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i5.EntryButtonDirective, selector: "[mat-button][entry-submit-button],[mat-button][entry-cancel-button]" }] });
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryDialogComponent, decorators: [{
|
|
89
|
-
type: Component,
|
|
90
|
-
args: [{ selector: 'entry-dialog', template: "<div class=\"entry-dialog\">\n <div class=\"dialog-header\">\n <h1 class=\"title\" [ngClass]=\"{'without-close-icon': hideClose === true}\" mat-dialog-title>{{ title }}</h1>\n <button mat-icon-button *ngIf=\"!hideClose\" type=\"button\" class=\"close-button\" (click)=\"cancel()\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n\n <mat-dialog-content class=\"dialog-content\" [ngClass]=\"{'with-actions': !hideButtons}\">\n <ng-content></ng-content>\n </mat-dialog-content>\n\n <mat-dialog-actions class=\"dialog-actions\" [align]=\"buttonsAlignment\" *ngIf=\"!hideButtons\">\n <ng-container *ngIf=\"buttonsTemplate; then buttonsTemplate; else defaultButtonsTemplate\">\n </ng-container>\n </mat-dialog-actions>\n \n <ng-template #defaultButtonsTemplate>\n <button cdkFocusInitial mat-button entry-submit-button (click)=\"onSubmit()\">\n <span>{{confirmButtonText}}</span>\n </button>\n <button *ngIf=\"!hideCancel\" mat-button entry-cancel-button (click)=\"cancel()\">\n <span>{{cancelButtonText}}</span>\n </button>\n </ng-template>\n</div>" }]
|
|
91
|
-
}], ctorParameters: function () {
|
|
92
|
-
return [{ type: i1.MatDialogRef }, { type: EntryDialogConfig, decorators: [{
|
|
93
|
-
type: Inject,
|
|
94
|
-
args: [ENTRY_DIALOG_CONFIG]
|
|
95
|
-
}] }];
|
|
96
|
-
}, propDecorators: { title: [{
|
|
97
|
-
type: Input
|
|
98
|
-
}], buttonsAlignment: [{
|
|
99
|
-
type: Input
|
|
100
|
-
}], confirmButtonText: [{
|
|
101
|
-
type: Input
|
|
102
|
-
}], cancelButtonText: [{
|
|
103
|
-
type: Input
|
|
104
|
-
}], hideButtons: [{
|
|
105
|
-
type: Input
|
|
106
|
-
}], hideCancel: [{
|
|
107
|
-
type: Input
|
|
108
|
-
}], hideClose: [{
|
|
109
|
-
type: Input
|
|
110
|
-
}], disableConfirm: [{
|
|
111
|
-
type: Input
|
|
112
|
-
}], buttonsTemplate: [{
|
|
113
|
-
type: Input
|
|
114
|
-
}], confirm: [{
|
|
115
|
-
type: Input
|
|
116
|
-
}], cancel: [{
|
|
117
|
-
type: Input
|
|
118
|
-
}] } });
|
|
119
|
-
|
|
120
|
-
class EntryAlertDialogComponent extends EntryDialogComponent {
|
|
121
|
-
constructor(mdDialogRef, config, data) {
|
|
122
|
-
super(mdDialogRef, config);
|
|
123
|
-
this.mdDialogRef = mdDialogRef;
|
|
124
|
-
this.config = config;
|
|
125
|
-
this.data = data;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
EntryAlertDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryAlertDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: ENTRY_DIALOG_CONFIG }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
129
|
-
EntryAlertDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: EntryAlertDialogComponent, selector: "entry-alert-dialog", usesInheritance: true, ngImport: i0, template: "<entry-dialog\n [title]=\"data.title\"\n [confirmButtonText]=\"data.confirmText ?? config.confirmButtonText\"\n [buttonsAlignment]=\"data.buttonsAlignment ?? config.buttonsAlignment\"\n [hideClose]=\"data.hideClose ?? config.hideClose\"\n [hideCancel]=\"true\">\n <p>{{data.message}}</p>\n</entry-dialog>", dependencies: [{ kind: "component", type: EntryDialogComponent, selector: "entry-dialog", inputs: ["title", "buttonsAlignment", "confirmButtonText", "cancelButtonText", "hideButtons", "hideCancel", "hideClose", "disableConfirm", "buttonsTemplate", "confirm", "cancel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
130
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryAlertDialogComponent, decorators: [{
|
|
131
|
-
type: Component,
|
|
132
|
-
args: [{ selector: 'entry-alert-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<entry-dialog\n [title]=\"data.title\"\n [confirmButtonText]=\"data.confirmText ?? config.confirmButtonText\"\n [buttonsAlignment]=\"data.buttonsAlignment ?? config.buttonsAlignment\"\n [hideClose]=\"data.hideClose ?? config.hideClose\"\n [hideCancel]=\"true\">\n <p>{{data.message}}</p>\n</entry-dialog>" }]
|
|
133
|
-
}], ctorParameters: function () {
|
|
134
|
-
return [{ type: i1.MatDialogRef }, { type: EntryDialogConfig, decorators: [{
|
|
135
|
-
type: Inject,
|
|
136
|
-
args: [ENTRY_DIALOG_CONFIG]
|
|
137
|
-
}] }, { type: undefined, decorators: [{
|
|
138
|
-
type: Inject,
|
|
139
|
-
args: [MAT_DIALOG_DATA]
|
|
140
|
-
}] }];
|
|
141
|
-
} });
|
|
142
|
-
|
|
143
|
-
class EntryConfirmDialogComponent extends EntryDialogComponent {
|
|
144
|
-
constructor(mdDialogRef, config, data) {
|
|
145
|
-
super(mdDialogRef, config);
|
|
146
|
-
this.mdDialogRef = mdDialogRef;
|
|
147
|
-
this.config = config;
|
|
148
|
-
this.data = data;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
EntryConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryConfirmDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: ENTRY_DIALOG_CONFIG }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
152
|
-
EntryConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: EntryConfirmDialogComponent, selector: "entry-confirm-dialog", usesInheritance: true, ngImport: i0, template: "<entry-dialog\n [title]=\"data.title\"\n [confirmButtonText]=\"data.confirmText ?? config.confirmButtonText\"\n [cancelButtonText]=\"data.cancelText ?? config.cancelButtonText\"\n [buttonsAlignment]=\"data.buttonsAlignment ?? config.buttonsAlignment\"\n [hideClose]=\"data.hideClose ?? config.hideClose\">\n <p>{{data.message}}</p>\n</entry-dialog>", dependencies: [{ kind: "component", type: EntryDialogComponent, selector: "entry-dialog", inputs: ["title", "buttonsAlignment", "confirmButtonText", "cancelButtonText", "hideButtons", "hideCancel", "hideClose", "disableConfirm", "buttonsTemplate", "confirm", "cancel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
153
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryConfirmDialogComponent, decorators: [{
|
|
154
|
-
type: Component,
|
|
155
|
-
args: [{ selector: 'entry-confirm-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<entry-dialog\n [title]=\"data.title\"\n [confirmButtonText]=\"data.confirmText ?? config.confirmButtonText\"\n [cancelButtonText]=\"data.cancelText ?? config.cancelButtonText\"\n [buttonsAlignment]=\"data.buttonsAlignment ?? config.buttonsAlignment\"\n [hideClose]=\"data.hideClose ?? config.hideClose\">\n <p>{{data.message}}</p>\n</entry-dialog>" }]
|
|
156
|
-
}], ctorParameters: function () {
|
|
157
|
-
return [{ type: i1.MatDialogRef }, { type: EntryDialogConfig, decorators: [{
|
|
158
|
-
type: Inject,
|
|
159
|
-
args: [ENTRY_DIALOG_CONFIG]
|
|
160
|
-
}] }, { type: undefined, decorators: [{
|
|
161
|
-
type: Inject,
|
|
162
|
-
args: [MAT_DIALOG_DATA]
|
|
163
|
-
}] }];
|
|
164
|
-
} });
|
|
165
|
-
|
|
166
|
-
class EntryErrorDialogComponent extends EntryDialogComponent {
|
|
167
|
-
constructor(mdDialogRef, config, data) {
|
|
168
|
-
super(mdDialogRef, config);
|
|
169
|
-
this.mdDialogRef = mdDialogRef;
|
|
170
|
-
this.config = config;
|
|
171
|
-
this.data = data;
|
|
172
|
-
this.errors = [];
|
|
173
|
-
this.extractValidationErrors();
|
|
174
|
-
}
|
|
175
|
-
extractValidationErrors() {
|
|
176
|
-
if (Array.isArray(this.data.errors)) {
|
|
177
|
-
this.errors = this.data.errors;
|
|
178
|
-
}
|
|
179
|
-
else if (this.data.errors.errors) {
|
|
180
|
-
const validationErrors = this.data.errors.errors;
|
|
181
|
-
this.errors = Object.entries(validationErrors)
|
|
182
|
-
.map(values => values[1])
|
|
183
|
-
.reduce((a, b) => a.concat(b), []);
|
|
184
|
-
}
|
|
185
|
-
else if (this.data.message) {
|
|
186
|
-
this.errors = [this.data.message];
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
EntryErrorDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryErrorDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: ENTRY_DIALOG_CONFIG }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
191
|
-
EntryErrorDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: EntryErrorDialogComponent, selector: "entry-error-dialog", usesInheritance: true, ngImport: i0, template: "<entry-dialog\n [title]=\"data.title\"\n [confirmButtonText]=\"data.confirmText ?? config.confirmButtonText\"\n [buttonsAlignment]=\"data.buttonsAlignment ?? config.buttonsAlignment\"\n [hideClose]=\"data.hideClose ?? config.hideClose\"\n [hideCancel]=\"true\">\n <p *ngFor=\"let error of errors\">{{error}}</p>\n</entry-dialog>", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: EntryDialogComponent, selector: "entry-dialog", inputs: ["title", "buttonsAlignment", "confirmButtonText", "cancelButtonText", "hideButtons", "hideCancel", "hideClose", "disableConfirm", "buttonsTemplate", "confirm", "cancel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
192
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryErrorDialogComponent, decorators: [{
|
|
193
|
-
type: Component,
|
|
194
|
-
args: [{ selector: 'entry-error-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<entry-dialog\n [title]=\"data.title\"\n [confirmButtonText]=\"data.confirmText ?? config.confirmButtonText\"\n [buttonsAlignment]=\"data.buttonsAlignment ?? config.buttonsAlignment\"\n [hideClose]=\"data.hideClose ?? config.hideClose\"\n [hideCancel]=\"true\">\n <p *ngFor=\"let error of errors\">{{error}}</p>\n</entry-dialog>" }]
|
|
195
|
-
}], ctorParameters: function () {
|
|
196
|
-
return [{ type: i1.MatDialogRef }, { type: EntryDialogConfig, decorators: [{
|
|
197
|
-
type: Inject,
|
|
198
|
-
args: [ENTRY_DIALOG_CONFIG]
|
|
199
|
-
}] }, { type: undefined, decorators: [{
|
|
200
|
-
type: Inject,
|
|
201
|
-
args: [MAT_DIALOG_DATA]
|
|
202
|
-
}] }];
|
|
203
|
-
} });
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Used to open built-in and custom entry dialogs.
|
|
207
|
-
*/
|
|
208
|
-
class EntryDialogService {
|
|
209
|
-
constructor(config, matDialog) {
|
|
210
|
-
this.config = config;
|
|
211
|
-
this.matDialog = matDialog;
|
|
212
|
-
/**
|
|
213
|
-
* Opens alert dialog.
|
|
214
|
-
*
|
|
215
|
-
* @param data - Contains title, message and optional confirm button text
|
|
216
|
-
* @returns `true` if confirmed, `undefined` if closed by clicking on backdrop or pressing escape
|
|
217
|
-
*/
|
|
218
|
-
this.openAlert = (data) => {
|
|
219
|
-
data.disableClose = data.disableClose === undefined ? this.config.disableClose : data.disableClose;
|
|
220
|
-
return this.open(EntryAlertDialogComponent, data, data.disableClose);
|
|
221
|
-
};
|
|
222
|
-
/**
|
|
223
|
-
* Opens confirm dialog.
|
|
224
|
-
*
|
|
225
|
-
* @param data - Contains title, message and optional confirm/cancel buttons text
|
|
226
|
-
* @returns `true` if confirmed, `false` if canceled or closed, `undefined` if closed by clicking on backdrop or pressing escape
|
|
227
|
-
*/
|
|
228
|
-
this.openConfirm = (data) => {
|
|
229
|
-
data.disableClose = data.disableClose === undefined ? this.config.disableClose : data.disableClose;
|
|
230
|
-
return this.open(EntryConfirmDialogComponent, data, data.disableClose);
|
|
231
|
-
};
|
|
232
|
-
/**
|
|
233
|
-
* Opens error dialog.
|
|
234
|
-
*
|
|
235
|
-
* @param data - Contains title, errors and optional confirm button text
|
|
236
|
-
* @returns `true` if confirmed, `undefined` if closed by clicking on backdrop or pressing escape
|
|
237
|
-
*/
|
|
238
|
-
this.openError = (data) => {
|
|
239
|
-
data.disableClose = data.disableClose === undefined ? this.config.disableClose : data.disableClose;
|
|
240
|
-
return this.open(EntryErrorDialogComponent, data, data.disableClose);
|
|
241
|
-
};
|
|
242
|
-
/**
|
|
243
|
-
* Opens dialog with custom component.
|
|
244
|
-
*
|
|
245
|
-
* @param component - Dialog custom component implementation
|
|
246
|
-
* @param data - Optional parameter used to supply component with input parameters
|
|
247
|
-
* @param disableClose - Optional parameter that disable closing dialog when pressing escape or clicking on backdrop
|
|
248
|
-
* @param cssClass - Optional parameter used to set custom class to Material overlay pane
|
|
249
|
-
* @returns Any result custom implementation provides
|
|
250
|
-
*/
|
|
251
|
-
this.open = (component, data = undefined, disableClose = undefined, cssClass = '') => {
|
|
252
|
-
const configuration = new MatDialogConfig();
|
|
253
|
-
configuration.data = data;
|
|
254
|
-
configuration.disableClose = disableClose === undefined
|
|
255
|
-
? this.config.disableClose
|
|
256
|
-
: disableClose;
|
|
257
|
-
this.setPanelClassFor(configuration, cssClass);
|
|
258
|
-
return this.matDialog
|
|
259
|
-
.open(component, configuration)
|
|
260
|
-
.afterClosed()
|
|
261
|
-
.pipe(take(1));
|
|
262
|
-
};
|
|
263
|
-
/**
|
|
264
|
-
* Closes all opened dialogs.
|
|
265
|
-
*/
|
|
266
|
-
this.closeAll = () => this.matDialog.closeAll();
|
|
267
|
-
this.setPanelClassFor = (configuration, cssClass) => {
|
|
268
|
-
configuration.panelClass = ['dialog-container', cssClass];
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
EntryDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryDialogService, deps: [{ token: ENTRY_DIALOG_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
273
|
-
EntryDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryDialogService });
|
|
274
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryDialogService, decorators: [{
|
|
275
|
-
type: Injectable
|
|
276
|
-
}], ctorParameters: function () {
|
|
277
|
-
return [{ type: EntryDialogConfig, decorators: [{
|
|
278
|
-
type: Inject,
|
|
279
|
-
args: [ENTRY_DIALOG_CONFIG]
|
|
280
|
-
}] }, { type: i1.MatDialog }];
|
|
281
|
-
} });
|
|
282
|
-
|
|
283
|
-
class EntryDialogModule {
|
|
284
|
-
}
|
|
285
|
-
EntryDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
286
|
-
EntryDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: EntryDialogModule, declarations: [EntryDialogComponent,
|
|
287
|
-
EntryAlertDialogComponent,
|
|
288
|
-
EntryConfirmDialogComponent,
|
|
289
|
-
EntryErrorDialogComponent], imports: [CommonModule,
|
|
290
|
-
MatDialogModule,
|
|
291
|
-
MatIconModule,
|
|
292
|
-
MatButtonModule,
|
|
293
|
-
EntryButtonModule], exports: [EntryDialogComponent,
|
|
294
|
-
EntryAlertDialogComponent,
|
|
295
|
-
EntryConfirmDialogComponent,
|
|
296
|
-
EntryErrorDialogComponent] });
|
|
297
|
-
EntryDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryDialogModule, providers: [EntryDialogService], imports: [CommonModule,
|
|
298
|
-
MatDialogModule,
|
|
299
|
-
MatIconModule,
|
|
300
|
-
MatButtonModule,
|
|
301
|
-
EntryButtonModule] });
|
|
302
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryDialogModule, decorators: [{
|
|
303
|
-
type: NgModule,
|
|
304
|
-
args: [{
|
|
305
|
-
declarations: [
|
|
306
|
-
EntryDialogComponent,
|
|
307
|
-
EntryAlertDialogComponent,
|
|
308
|
-
EntryConfirmDialogComponent,
|
|
309
|
-
EntryErrorDialogComponent
|
|
310
|
-
],
|
|
311
|
-
imports: [
|
|
312
|
-
CommonModule,
|
|
313
|
-
MatDialogModule,
|
|
314
|
-
MatIconModule,
|
|
315
|
-
MatButtonModule,
|
|
316
|
-
EntryButtonModule
|
|
317
|
-
],
|
|
318
|
-
exports: [
|
|
319
|
-
EntryDialogComponent,
|
|
320
|
-
EntryAlertDialogComponent,
|
|
321
|
-
EntryConfirmDialogComponent,
|
|
322
|
-
EntryErrorDialogComponent
|
|
323
|
-
],
|
|
324
|
-
providers: [EntryDialogService]
|
|
325
|
-
}]
|
|
326
|
-
}] });
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Generated bundle index. Do not edit.
|
|
330
|
-
*/
|
|
331
|
-
|
|
332
|
-
export { ENTRY_DIALOG_CONFIG, EntryAlertDialogComponent, EntryConfirmDialogComponent, EntryDialogComponent, EntryDialogConfig, EntryDialogModule, EntryDialogService, EntryErrorDialogComponent, provideEntryDialogConfig };
|
|
333
|
-
//# sourceMappingURL=enigmatry-entry-components-dialog.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enigmatry-entry-components-dialog.mjs","sources":["../../../../libs/entry-components/dialog/entry-dialog-config.model.ts","../../../../libs/entry-components/dialog/dialogs/entry-dialog.component.ts","../../../../libs/entry-components/dialog/dialogs/entry-dialog.component.html","../../../../libs/entry-components/dialog/dialogs/alert/entry-alert-dialog.component.ts","../../../../libs/entry-components/dialog/dialogs/alert/entry-alert-dialog.component.html","../../../../libs/entry-components/dialog/dialogs/confirm/entry-confirm-dialog.component.ts","../../../../libs/entry-components/dialog/dialogs/confirm/entry-confirm-dialog.component.html","../../../../libs/entry-components/dialog/dialogs/error/entry-error-dialog.component.ts","../../../../libs/entry-components/dialog/dialogs/error/entry-error-dialog.component.html","../../../../libs/entry-components/dialog/entry-dialog.service.ts","../../../../libs/entry-components/dialog/entry-dialog.module.ts","../../../../libs/entry-components/dialog/enigmatry-entry-components-dialog.ts"],"sourcesContent":["import { createInjectionToken, provideConfig } from '@enigmatry/entry-components/common';\nimport { EntryDialogButtonsAlignment } from './entry-dialog-buttons-alignment.type';\nimport { Provider } from '@angular/core';\n\n/**\n * Used to provide default configurations on module level.\n */\nexport class EntryDialogConfig {\n /** Confirm button label (default 'Ok') */\n confirmButtonText: string;\n /** Cancel button label (default 'Cancel') */\n cancelButtonText: string;\n /** Dialog buttons horizontal alignment (default 'align-right') */\n buttonsAlignment: EntryDialogButtonsAlignment;\n /** Determines if close button is visible (default is true) */\n hideClose: boolean;\n /** Disable closing dialog when pressing escape or clicking on backdrop (default false) */\n disableClose: boolean;\n\n constructor(config: Partial<EntryDialogConfig> = {}) {\n this.confirmButtonText = config.confirmButtonText ?? 'Ok';\n this.cancelButtonText = config.cancelButtonText ?? 'Cancel';\n this.buttonsAlignment = config.buttonsAlignment ?? 'end';\n this.hideClose = config.hideClose ?? true;\n this.disableClose = config.disableClose ?? false;\n }\n}\n\n/**\n * Entry dialog injection token of EntryDialogConfig type containing dialog default configurations.\n *\n * Defaults:\n * - confirmButtonText: 'Ok'\n * - cancelButtonText: 'Cancel'\n * - buttonsAlignment: 'end'\n * - hideClose: true\n * - disableClose: false\n */\nexport const ENTRY_DIALOG_CONFIG = createInjectionToken(new EntryDialogConfig());\n\n/**\n * Can be used to provide entry dialog configuration.\n */\nexport function provideEntryDialogConfig(config: Partial<EntryDialogConfig>): Provider {\n return provideConfig(ENTRY_DIALOG_CONFIG, () => new EntryDialogConfig(config));\n}\n","import { Component, Inject, Input, TemplateRef } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { Observable, of } from 'rxjs';\nimport { ENTRY_DIALOG_CONFIG, EntryDialogConfig } from '../entry-dialog-config.model';\nimport { EntryDialogButtonsAlignment } from '../entry-dialog-buttons-alignment.type';\n\n/**\n * Base Entry dialog component. Must be extended when building custom dialogs.\n *\n * @example\n * ```html\n * <entry-dialog title=\"TITLE\"><p>Dialog content</p></entry-dialog>\n * ```\n */\n@Component({\n selector: 'entry-dialog',\n templateUrl: './entry-dialog.component.html',\n styleUrls: ['./entry-dialog.component.scss']\n})\nexport class EntryDialogComponent {\n /** Dialog header title */\n @Input() title: string;\n /** Dialog buttons horizontal alignment */\n @Input() buttonsAlignment: EntryDialogButtonsAlignment = this.config.buttonsAlignment;\n /** Confirm button label */\n @Input() confirmButtonText = this.config.confirmButtonText;\n /** Cancel button label */\n @Input() cancelButtonText = this.config.cancelButtonText;\n /** Show or hide dialog buttons */\n @Input() hideButtons: boolean;\n /** Show or hide dialog cancel button */\n @Input() hideCancel: boolean;\n /** Show or hide dialog close button */\n @Input() hideClose: boolean = this.config.hideClose;\n /** Enable or disable dialog confirm button */\n @Input() disableConfirm: boolean;\n /** Provide custom buttons template */\n @Input() buttonsTemplate: TemplateRef<any> | null | undefined;\n\n constructor(\n protected readonly mdDialogRef: MatDialogRef<EntryDialogComponent>,\n @Inject(ENTRY_DIALOG_CONFIG) protected readonly config: EntryDialogConfig) { }\n\n @Input() confirm: () => Observable<unknown> = () => of(true);\n @Input() cancel = () => this.close(false);\n\n // @HostListener('keydown.esc')\n // onEsc = () => {\n // if (!this.disableClose) {\n // this.cancel();\n // }\n // };\n\n onSubmit = () =>\n this.confirm().subscribe({\n next: closeDialog => {\n if (closeDialog) {\n this.close(closeDialog);\n }\n }\n });\n\n close = (value: unknown = true) => this.mdDialogRef.close(value);\n}\n","<div class=\"entry-dialog\">\n <div class=\"dialog-header\">\n <h1 class=\"title\" [ngClass]=\"{'without-close-icon': hideClose === true}\" mat-dialog-title>{{ title }}</h1>\n <button mat-icon-button *ngIf=\"!hideClose\" type=\"button\" class=\"close-button\" (click)=\"cancel()\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n\n <mat-dialog-content class=\"dialog-content\" [ngClass]=\"{'with-actions': !hideButtons}\">\n <ng-content></ng-content>\n </mat-dialog-content>\n\n <mat-dialog-actions class=\"dialog-actions\" [align]=\"buttonsAlignment\" *ngIf=\"!hideButtons\">\n <ng-container *ngIf=\"buttonsTemplate; then buttonsTemplate; else defaultButtonsTemplate\">\n </ng-container>\n </mat-dialog-actions>\n \n <ng-template #defaultButtonsTemplate>\n <button cdkFocusInitial mat-button entry-submit-button (click)=\"onSubmit()\">\n <span>{{confirmButtonText}}</span>\n </button>\n <button *ngIf=\"!hideCancel\" mat-button entry-cancel-button (click)=\"cancel()\">\n <span>{{cancelButtonText}}</span>\n </button>\n </ng-template>\n</div>","import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';\nimport { EntryDialogComponent } from '../entry-dialog.component';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { IEntryAlertDialogData } from './entry-alert-dialog-data.interface';\nimport { ENTRY_DIALOG_CONFIG, EntryDialogConfig } from '../../entry-dialog-config.model';\n\n@Component({\n selector: 'entry-alert-dialog',\n templateUrl: './entry-alert-dialog.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class EntryAlertDialogComponent extends EntryDialogComponent {\n constructor(\n protected readonly mdDialogRef: MatDialogRef<EntryDialogComponent>,\n @Inject(ENTRY_DIALOG_CONFIG) public readonly config: EntryDialogConfig,\n @Inject(MAT_DIALOG_DATA) public data: IEntryAlertDialogData) {\n super(mdDialogRef, config);\n }\n}\n","<entry-dialog\n [title]=\"data.title\"\n [confirmButtonText]=\"data.confirmText ?? config.confirmButtonText\"\n [buttonsAlignment]=\"data.buttonsAlignment ?? config.buttonsAlignment\"\n [hideClose]=\"data.hideClose ?? config.hideClose\"\n [hideCancel]=\"true\">\n <p>{{data.message}}</p>\n</entry-dialog>","import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { EntryDialogComponent } from '../entry-dialog.component';\nimport { IEntryConfirmDialogData } from './entry-confirm-dialog-data.interface';\nimport { ENTRY_DIALOG_CONFIG, EntryDialogConfig } from '../../entry-dialog-config.model';\n\n@Component({\n selector: 'entry-confirm-dialog',\n templateUrl: './entry-confirm-dialog.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class EntryConfirmDialogComponent extends EntryDialogComponent {\n constructor(\n protected readonly mdDialogRef: MatDialogRef<EntryDialogComponent>,\n @Inject(ENTRY_DIALOG_CONFIG) public readonly config: EntryDialogConfig,\n @Inject(MAT_DIALOG_DATA) readonly data: IEntryConfirmDialogData) {\n super(mdDialogRef, config);\n }\n}\n","<entry-dialog\n [title]=\"data.title\"\n [confirmButtonText]=\"data.confirmText ?? config.confirmButtonText\"\n [cancelButtonText]=\"data.cancelText ?? config.cancelButtonText\"\n [buttonsAlignment]=\"data.buttonsAlignment ?? config.buttonsAlignment\"\n [hideClose]=\"data.hideClose ?? config.hideClose\">\n <p>{{data.message}}</p>\n</entry-dialog>","import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';\nimport { EntryDialogComponent } from '../entry-dialog.component';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { IEntryErrorDialogData } from './entry-error-dialog-data.interface';\nimport { ENTRY_DIALOG_CONFIG, EntryDialogConfig } from '../../entry-dialog-config.model';\n\n@Component({\n selector: 'entry-error-dialog',\n templateUrl: './entry-error-dialog.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class EntryErrorDialogComponent extends EntryDialogComponent {\n errors: string[] = [];\n constructor(\n protected readonly mdDialogRef: MatDialogRef<EntryDialogComponent>,\n @Inject(ENTRY_DIALOG_CONFIG) public readonly config: EntryDialogConfig,\n @Inject(MAT_DIALOG_DATA) public data: IEntryErrorDialogData) {\n super(mdDialogRef, config);\n this.extractValidationErrors();\n }\n\n private extractValidationErrors(): void {\n if (Array.isArray(this.data.errors)) {\n this.errors = this.data.errors as string[];\n } else if (this.data.errors.errors) {\n const validationErrors = this.data.errors.errors;\n this.errors = Object.entries(validationErrors)\n .map(values => values[1])\n .reduce((a, b) => a.concat(b), []);\n } else if (this.data.message) {\n this.errors = [this.data.message];\n }\n }\n}\n","<entry-dialog\n [title]=\"data.title\"\n [confirmButtonText]=\"data.confirmText ?? config.confirmButtonText\"\n [buttonsAlignment]=\"data.buttonsAlignment ?? config.buttonsAlignment\"\n [hideClose]=\"data.hideClose ?? config.hideClose\"\n [hideCancel]=\"true\">\n <p *ngFor=\"let error of errors\">{{error}}</p>\n</entry-dialog>","import { Inject, Injectable, Type } from '@angular/core';\nimport { MatDialog, MatDialogConfig } from '@angular/material/dialog';\nimport { EntryDialogComponent } from './dialogs/entry-dialog.component';\nimport { take } from 'rxjs/operators';\nimport { IEntryAlertDialogData } from './dialogs/alert/entry-alert-dialog-data.interface';\nimport { EntryAlertDialogComponent } from './dialogs/alert/entry-alert-dialog.component';\nimport { Observable } from 'rxjs';\nimport { EntryConfirmDialogComponent } from './dialogs/confirm/entry-confirm-dialog.component';\nimport { IEntryConfirmDialogData } from './dialogs/confirm/entry-confirm-dialog-data.interface';\nimport { ENTRY_DIALOG_CONFIG, EntryDialogConfig } from './entry-dialog-config.model';\nimport { IEntryErrorDialogData } from './dialogs/error/entry-error-dialog-data.interface';\nimport { EntryErrorDialogComponent } from './dialogs/error/entry-error-dialog.component';\n\n/**\n * Used to open built-in and custom entry dialogs.\n */\n@Injectable()\nexport class EntryDialogService {\n constructor(\n @Inject(ENTRY_DIALOG_CONFIG) protected readonly config: EntryDialogConfig,\n private readonly matDialog: MatDialog) { }\n\n /**\n * Opens alert dialog.\n *\n * @param data - Contains title, message and optional confirm button text\n * @returns `true` if confirmed, `undefined` if closed by clicking on backdrop or pressing escape\n */\n openAlert = (data: Partial<IEntryAlertDialogData>): Observable<true | undefined> => {\n data.disableClose = data.disableClose === undefined ? this.config.disableClose : data.disableClose;\n return this.open(EntryAlertDialogComponent, data, data.disableClose);\n };\n\n /**\n * Opens confirm dialog.\n *\n * @param data - Contains title, message and optional confirm/cancel buttons text\n * @returns `true` if confirmed, `false` if canceled or closed, `undefined` if closed by clicking on backdrop or pressing escape\n */\n openConfirm = (data: Partial<IEntryConfirmDialogData>): Observable<boolean | undefined> => {\n data.disableClose = data.disableClose === undefined ? this.config.disableClose : data.disableClose;\n return this.open(EntryConfirmDialogComponent, data, data.disableClose);\n };\n\n /**\n * Opens error dialog.\n *\n * @param data - Contains title, errors and optional confirm button text\n * @returns `true` if confirmed, `undefined` if closed by clicking on backdrop or pressing escape\n */\n openError = (data: Partial<IEntryErrorDialogData>): Observable<true | undefined> => {\n data.disableClose = data.disableClose === undefined ? this.config.disableClose : data.disableClose;\n return this.open(EntryErrorDialogComponent, data, data.disableClose);\n };\n\n /**\n * Opens dialog with custom component.\n *\n * @param component - Dialog custom component implementation\n * @param data - Optional parameter used to supply component with input parameters\n * @param disableClose - Optional parameter that disable closing dialog when pressing escape or clicking on backdrop\n * @param cssClass - Optional parameter used to set custom class to Material overlay pane\n * @returns Any result custom implementation provides\n */\n open = (\n component: Type<EntryDialogComponent>,\n data: unknown = undefined,\n disableClose: boolean | undefined = undefined,\n cssClass: string = ''): Observable<any> => {\n const configuration = new MatDialogConfig<unknown>();\n configuration.data = data;\n configuration.disableClose = disableClose === undefined\n ? this.config.disableClose\n : disableClose;\n this.setPanelClassFor(configuration, cssClass);\n\n return this.matDialog\n .open(component, configuration)\n .afterClosed()\n .pipe(take(1));\n };\n\n /**\n * Closes all opened dialogs.\n */\n closeAll = (): void => this.matDialog.closeAll();\n\n private setPanelClassFor = <T>(configuration: MatDialogConfig<T>, cssClass: string) => {\n configuration.panelClass = ['dialog-container', cssClass];\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\nimport { EntryAlertDialogComponent } from './dialogs/alert/entry-alert-dialog.component';\nimport { EntryConfirmDialogComponent } from './dialogs/confirm/entry-confirm-dialog.component';\nimport { EntryDialogComponent } from './dialogs/entry-dialog.component';\nimport { EntryButtonModule } from '@enigmatry/entry-components/button';\nimport { EntryDialogService } from './entry-dialog.service';\nimport { EntryErrorDialogComponent } from './dialogs/error/entry-error-dialog.component';\n\n@NgModule({\n declarations: [\n EntryDialogComponent,\n EntryAlertDialogComponent,\n EntryConfirmDialogComponent,\n EntryErrorDialogComponent\n ],\n imports: [\n CommonModule,\n MatDialogModule,\n MatIconModule,\n MatButtonModule,\n EntryButtonModule\n ],\n exports: [\n EntryDialogComponent,\n EntryAlertDialogComponent,\n EntryConfirmDialogComponent,\n EntryErrorDialogComponent\n ],\n providers: [EntryDialogService]\n})\nexport class EntryDialogModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.EntryDialogComponent","i3.EntryDialogComponent"],"mappings":";;;;;;;;;;;;;;;;AAIA;;AAEG;MACU,iBAAiB,CAAA;IAY1B,WAAY,CAAA,SAAqC,EAAE,EAAA;;QAC/C,IAAI,CAAC,iBAAiB,GAAG,CAAA,EAAA,GAAA,MAAM,CAAC,iBAAiB,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,IAAI,CAAC;QAC1D,IAAI,CAAC,gB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B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,oBAAoB;wBACpB,yBAAyB;wBACzB,2BAA2B;wBAC3B,yBAAyB;AAC1B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,eAAe;wBACf,aAAa;wBACb,eAAe;wBACf,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;wBACpB,yBAAyB;wBACzB,2BAA2B;wBAC3B,yBAAyB;AAC1B,qBAAA;oBACD,SAAS,EAAE,CAAC,kBAAkB,CAAC;iBAChC,CAAA;;;ACjCD;;AAEG;;;;"}
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { forwardRef, EventEmitter, ElementRef, Component, ChangeDetectionStrategy, Input, Output, ViewChild, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
6
|
-
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule } from '@angular/forms';
|
|
7
|
-
import { Subject, fromEvent } from 'rxjs';
|
|
8
|
-
import { takeUntil } from 'rxjs/operators';
|
|
9
|
-
import * as i2 from '@angular/material/icon';
|
|
10
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
11
|
-
import * as i3 from '@angular/material/button';
|
|
12
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
13
|
-
import * as i4 from '@enigmatry/entry-components/button';
|
|
14
|
-
import { EntryButtonModule } from '@enigmatry/entry-components/button';
|
|
15
|
-
|
|
16
|
-
/* eslint-disable @typescript-eslint/member-ordering */
|
|
17
|
-
const providers = [
|
|
18
|
-
{
|
|
19
|
-
provide: NG_VALUE_ACCESSOR,
|
|
20
|
-
useExisting: forwardRef(() => EntryFileInputComponent),
|
|
21
|
-
multi: true
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
provide: NG_VALIDATORS,
|
|
25
|
-
useExisting: forwardRef(() => EntryFileInputComponent),
|
|
26
|
-
multi: true
|
|
27
|
-
}
|
|
28
|
-
];
|
|
29
|
-
class EntryFileInputComponent {
|
|
30
|
-
/**
|
|
31
|
-
* Same as 'multiple' attribute in <input/> element.
|
|
32
|
-
*/
|
|
33
|
-
set multiple(multiple) {
|
|
34
|
-
this._multiple = coerceBooleanProperty(multiple);
|
|
35
|
-
}
|
|
36
|
-
get multiple() {
|
|
37
|
-
return this._multiple;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Same as 'disabled' attribute in <input/> element.
|
|
41
|
-
*/
|
|
42
|
-
set disabled(disabled) {
|
|
43
|
-
this._disabled = coerceBooleanProperty(disabled);
|
|
44
|
-
}
|
|
45
|
-
get disabled() {
|
|
46
|
-
return this._disabled;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Same as 'readonly' attribute in <input/> element.
|
|
50
|
-
*/
|
|
51
|
-
set readonly(readonly) {
|
|
52
|
-
this._readonly = coerceBooleanProperty(readonly);
|
|
53
|
-
}
|
|
54
|
-
get readonly() {
|
|
55
|
-
return this._readonly;
|
|
56
|
-
}
|
|
57
|
-
constructor(_ngZone, _renderer) {
|
|
58
|
-
this._ngZone = _ngZone;
|
|
59
|
-
this._renderer = _renderer;
|
|
60
|
-
/**
|
|
61
|
-
* Label for the select file button. Defaults to 'Choose file...'
|
|
62
|
-
*/
|
|
63
|
-
this.label = 'Choose file...';
|
|
64
|
-
/**
|
|
65
|
-
* MatIcon for the select file button. Defaults to 'insert_drive_file' (optional)
|
|
66
|
-
*/
|
|
67
|
-
this.matIcon = 'insert_drive_file';
|
|
68
|
-
this._multiple = false;
|
|
69
|
-
this._disabled = false;
|
|
70
|
-
this._readonly = false;
|
|
71
|
-
/**
|
|
72
|
-
* Size limit per file in KB (kilobytes)
|
|
73
|
-
*/
|
|
74
|
-
this.maxFileSizeInKb = undefined;
|
|
75
|
-
/**
|
|
76
|
-
* Number of files allowed when multiple=true
|
|
77
|
-
*/
|
|
78
|
-
this.maxFileCount = undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Event emitted when a file is selected. Emits a [File | FileList] object.
|
|
81
|
-
*/
|
|
82
|
-
this.selectedFile = new EventEmitter();
|
|
83
|
-
this._destroy$ = new Subject();
|
|
84
|
-
// implements ControlValueAccessor interface
|
|
85
|
-
this.onChange = (_) => { };
|
|
86
|
-
this.onTouched = () => { };
|
|
87
|
-
}
|
|
88
|
-
get fileNames() {
|
|
89
|
-
if (this.value instanceof File) {
|
|
90
|
-
return this.value.name;
|
|
91
|
-
}
|
|
92
|
-
if (this.value instanceof FileList) {
|
|
93
|
-
return `${this.value.length} files`;
|
|
94
|
-
}
|
|
95
|
-
return '';
|
|
96
|
-
}
|
|
97
|
-
ngOnInit() {
|
|
98
|
-
// Handle click event on custom file button and trigger click on native file input
|
|
99
|
-
this._ngZone.runOutsideAngular(() => {
|
|
100
|
-
fromEvent(this._fileButton.nativeElement, 'click')
|
|
101
|
-
.pipe(takeUntil(this._destroy$))
|
|
102
|
-
.subscribe(() => {
|
|
103
|
-
this._fileInput.nativeElement.click();
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
ngOnDestroy() {
|
|
108
|
-
this._destroy$.next();
|
|
109
|
-
}
|
|
110
|
-
onFileSelect(event) {
|
|
111
|
-
const fileInputEl = event.target;
|
|
112
|
-
const files = fileInputEl.files;
|
|
113
|
-
const value = this._multiple
|
|
114
|
-
? (files === null || files === void 0 ? void 0 : files.length) > 1 ? files : files[0]
|
|
115
|
-
: files[0];
|
|
116
|
-
this.value = value;
|
|
117
|
-
this.onChange(value);
|
|
118
|
-
this.onTouched();
|
|
119
|
-
if (value) {
|
|
120
|
-
this.selectedFile.emit(value);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
clear() {
|
|
124
|
-
this.value = undefined;
|
|
125
|
-
this.onChange(undefined);
|
|
126
|
-
this._renderer.setProperty(this._fileInput.nativeElement, 'value', '');
|
|
127
|
-
}
|
|
128
|
-
writeValue(value) {
|
|
129
|
-
this.value = value;
|
|
130
|
-
}
|
|
131
|
-
registerOnChange(fn) {
|
|
132
|
-
this.onChange = fn;
|
|
133
|
-
}
|
|
134
|
-
registerOnTouched(fn) {
|
|
135
|
-
this.onTouched = fn;
|
|
136
|
-
}
|
|
137
|
-
setDisabledState(isDisabled) {
|
|
138
|
-
this._disabled = isDisabled;
|
|
139
|
-
}
|
|
140
|
-
// implements Validator interface
|
|
141
|
-
validate(control) {
|
|
142
|
-
const isSizeLimitExceeded = this.isFileSizeLimitExceeded(control.value);
|
|
143
|
-
const isCountLimitExceeded = this.isFileCountLimitExceeded(control.value);
|
|
144
|
-
if (!isSizeLimitExceeded && !isCountLimitExceeded) {
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
return Object.assign(Object.assign({}, (isSizeLimitExceeded ? { maxFileSize: true } : {})), (isCountLimitExceeded ? { maxFileCount: true } : {}));
|
|
148
|
-
}
|
|
149
|
-
isFileCountLimitExceeded(files) {
|
|
150
|
-
const isMultiple = this.multiple && files instanceof FileList;
|
|
151
|
-
const maxFileCount = this.maxFileCount;
|
|
152
|
-
const actualFileCount = files === null || files === void 0 ? void 0 : files.length;
|
|
153
|
-
return isMultiple && maxFileCount && actualFileCount > maxFileCount;
|
|
154
|
-
}
|
|
155
|
-
isFileSizeLimitExceeded(files) {
|
|
156
|
-
if (!this.maxFileSizeInKb) {
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
const maxFileSizeInBytes = this.maxFileSizeInKb * 1024;
|
|
160
|
-
if (files instanceof File) {
|
|
161
|
-
return files.size > maxFileSizeInBytes;
|
|
162
|
-
}
|
|
163
|
-
if (files instanceof FileList) {
|
|
164
|
-
return Array.from(files).some(file => file.size > maxFileSizeInBytes);
|
|
165
|
-
}
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
EntryFileInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryFileInputComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
170
|
-
EntryFileInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: EntryFileInputComponent, selector: "entry-file-input", inputs: { label: "label", matIcon: "matIcon", accept: "accept", multiple: "multiple", disabled: "disabled", readonly: "readonly", maxFileSizeInKb: "maxFileSizeInKb", maxFileCount: "maxFileCount" }, outputs: { selectedFile: "selectedFile" }, providers: providers, viewQueries: [{ propertyName: "_fileButton", first: true, predicate: ["fileButton"], descendants: true, read: ElementRef, static: true }, { propertyName: "_fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], ngImport: i0, template: "<button \r\n #fileButton \r\n mat-button \r\n entry-submit-button \r\n type=\"button\" \r\n [disabled]=\"disabled || readonly\">\r\n <mat-icon *ngIf=\"matIcon\">{{matIcon}}</mat-icon>\r\n <span>{{label}}</span>\r\n</button>\r\n<ng-container *ngIf=\"value\">\r\n {{fileNames}}\r\n</ng-container>\r\n<input\r\n #fileInput\r\n type=\"file\"\r\n class=\"file-input-hidden\"\r\n [accept]=\"accept\"\r\n [multiple]=\"multiple\"\r\n [disabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n (change)=\"onFileSelect($event)\"\r\n/>", styles: [".file-input-hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.EntryButtonDirective, selector: "[mat-button][entry-submit-button],[mat-button][entry-cancel-button]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
171
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryFileInputComponent, decorators: [{
|
|
172
|
-
type: Component,
|
|
173
|
-
args: [{ selector: 'entry-file-input', changeDetection: ChangeDetectionStrategy.OnPush, providers: providers, template: "<button \r\n #fileButton \r\n mat-button \r\n entry-submit-button \r\n type=\"button\" \r\n [disabled]=\"disabled || readonly\">\r\n <mat-icon *ngIf=\"matIcon\">{{matIcon}}</mat-icon>\r\n <span>{{label}}</span>\r\n</button>\r\n<ng-container *ngIf=\"value\">\r\n {{fileNames}}\r\n</ng-container>\r\n<input\r\n #fileInput\r\n type=\"file\"\r\n class=\"file-input-hidden\"\r\n [accept]=\"accept\"\r\n [multiple]=\"multiple\"\r\n [disabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n (change)=\"onFileSelect($event)\"\r\n/>", styles: [".file-input-hidden{display:none}\n"] }]
|
|
174
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }]; }, propDecorators: { label: [{
|
|
175
|
-
type: Input
|
|
176
|
-
}], matIcon: [{
|
|
177
|
-
type: Input
|
|
178
|
-
}], accept: [{
|
|
179
|
-
type: Input
|
|
180
|
-
}], multiple: [{
|
|
181
|
-
type: Input
|
|
182
|
-
}], disabled: [{
|
|
183
|
-
type: Input
|
|
184
|
-
}], readonly: [{
|
|
185
|
-
type: Input
|
|
186
|
-
}], maxFileSizeInKb: [{
|
|
187
|
-
type: Input
|
|
188
|
-
}], maxFileCount: [{
|
|
189
|
-
type: Input
|
|
190
|
-
}], selectedFile: [{
|
|
191
|
-
type: Output
|
|
192
|
-
}], _fileButton: [{
|
|
193
|
-
type: ViewChild,
|
|
194
|
-
args: ['fileButton', { static: true, read: ElementRef }]
|
|
195
|
-
}], _fileInput: [{
|
|
196
|
-
type: ViewChild,
|
|
197
|
-
args: ['fileInput', { static: true }]
|
|
198
|
-
}] } });
|
|
199
|
-
|
|
200
|
-
class EntryFileInputModule {
|
|
201
|
-
}
|
|
202
|
-
EntryFileInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryFileInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
203
|
-
EntryFileInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: EntryFileInputModule, declarations: [EntryFileInputComponent], imports: [CommonModule,
|
|
204
|
-
FormsModule,
|
|
205
|
-
MatIconModule,
|
|
206
|
-
MatButtonModule,
|
|
207
|
-
EntryButtonModule], exports: [EntryFileInputComponent] });
|
|
208
|
-
EntryFileInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryFileInputModule, imports: [CommonModule,
|
|
209
|
-
FormsModule,
|
|
210
|
-
MatIconModule,
|
|
211
|
-
MatButtonModule,
|
|
212
|
-
EntryButtonModule] });
|
|
213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryFileInputModule, decorators: [{
|
|
214
|
-
type: NgModule,
|
|
215
|
-
args: [{
|
|
216
|
-
declarations: [
|
|
217
|
-
EntryFileInputComponent
|
|
218
|
-
],
|
|
219
|
-
imports: [
|
|
220
|
-
CommonModule,
|
|
221
|
-
FormsModule,
|
|
222
|
-
MatIconModule,
|
|
223
|
-
MatButtonModule,
|
|
224
|
-
EntryButtonModule
|
|
225
|
-
],
|
|
226
|
-
exports: [
|
|
227
|
-
EntryFileInputComponent
|
|
228
|
-
]
|
|
229
|
-
}]
|
|
230
|
-
}] });
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Generated bundle index. Do not edit.
|
|
234
|
-
*/
|
|
235
|
-
|
|
236
|
-
export { EntryFileInputComponent, EntryFileInputModule };
|
|
237
|
-
//# sourceMappingURL=enigmatry-entry-components-file-input.mjs.map
|