@flywheel-io/vision 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/flywheel-io-vision.umd.js +402 -6
- package/bundles/flywheel-io-vision.umd.js.map +1 -1
- package/bundles/flywheel-io-vision.umd.min.js +1 -1
- package/bundles/flywheel-io-vision.umd.min.js.map +1 -1
- package/components/dialog/choice-dialog.component.d.ts +24 -0
- package/components/dialog/confirm-dialog.component.d.ts +12 -0
- package/components/dialog/dialog.module.d.ts +2 -0
- package/components/dialog/dialog.service.d.ts +19 -0
- package/components/dialog/error-dialog.component.d.ts +10 -0
- package/components/dialog/portal-dialog.component.d.ts +25 -0
- package/components/shared/pipes/pipes.module.d.ts +4 -0
- package/components/shared/pipes/translate.pipe.d.ts +15 -0
- package/components/shared/pipes/trusthtml.pipe.d.ts +7 -0
- package/components/shared/translation.service.d.ts +11 -0
- package/esm2015/components/dialog/choice-dialog.component.js +52 -0
- package/esm2015/components/dialog/confirm-dialog.component.js +40 -0
- package/esm2015/components/dialog/dialog.module.js +45 -0
- package/esm2015/components/dialog/dialog.service.js +69 -0
- package/esm2015/components/dialog/error-dialog.component.js +32 -0
- package/esm2015/components/dialog/portal-dialog.component.js +88 -0
- package/esm2015/components/notification/notification/notification.component.js +1 -1
- package/esm2015/components/shared/pipes/pipes.module.js +24 -0
- package/esm2015/components/shared/pipes/translate.pipe.js +40 -0
- package/esm2015/components/shared/pipes/trusthtml.pipe.js +20 -0
- package/esm2015/components/shared/translation.service.js +22 -0
- package/esm2015/flywheel-io-vision.js +5 -2
- package/esm2015/public-api.js +8 -1
- package/fesm2015/flywheel-io-vision.js +402 -6
- package/fesm2015/flywheel-io-vision.js.map +1 -1
- package/flywheel-io-vision.d.ts +4 -1
- package/flywheel-io-vision.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +7 -0
- package/scss/material/overrides.scss +8 -20
- package/styles.css +11 -80
- package/styles.scss +0 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { of } from 'rxjs';
|
|
3
|
+
export class TranslationService {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Very basic i18n implementation. Consumer apps can provide their own implementation of TranslationService to override.
|
|
7
|
+
*/
|
|
8
|
+
export class MinimalTranslationService {
|
|
9
|
+
getMessage(key, silent) {
|
|
10
|
+
return of(MinimalTranslationService.messages[key]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
MinimalTranslationService.messages = {
|
|
14
|
+
'common.actions.close': 'Close',
|
|
15
|
+
'confirmDialog.body': 'Are you sure?',
|
|
16
|
+
'confirmDialog.no': 'No',
|
|
17
|
+
'confirmDialog.yes': 'Yes',
|
|
18
|
+
};
|
|
19
|
+
MinimalTranslationService.decorators = [
|
|
20
|
+
{ type: Injectable }
|
|
21
|
+
];
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL3NoYXJlZC90cmFuc2xhdGlvbi5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUcxQixNQUFNLE9BQWdCLGtCQUFrQjtDQUV2QztBQUVEOztHQUVHO0FBRUYsTUFBTSxPQUFPLHlCQUF5QjtJQVFwQyxVQUFVLENBQUMsR0FBVyxFQUFFLE1BQWdCO1FBQ3RDLE9BQU8sRUFBRSxDQUFDLHlCQUF5QixDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO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c3NhZ2Uoa2V5OiBzdHJpbmcsIHNpbGVudD86IGJvb2xlYW4pOiBPYnNlcnZhYmxlPHN0cmluZz4ge1xuICAgICByZXR1cm4gb2YoTWluaW1hbFRyYW5zbGF0aW9uU2VydmljZS5tZXNzYWdlc1trZXldKTtcbiAgIH1cbiB9XG4iXX0=
|
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
* Generated bundle index. Do not edit.
|
|
3
3
|
*/
|
|
4
4
|
export * from './public-api';
|
|
5
|
-
export { FwNotificationTimerService as
|
|
6
|
-
|
|
5
|
+
export { FwNotificationTimerService as ɵd } from './components/notification/notification-timer.service';
|
|
6
|
+
export { PipesModule as ɵa } from './components/shared/pipes/pipes.module';
|
|
7
|
+
export { TranslatePipe as ɵb } from './components/shared/pipes/translate.pipe';
|
|
8
|
+
export { TrustHtmlPipe as ɵc } from './components/shared/pipes/trusthtml.pipe';
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmx5d2hlZWwtaW8tdmlzaW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2ZseXdoZWVsLWlvLXZpc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDO0FBRTdCLE9BQU8sRUFBQywwQkFBMEIsSUFBSSxFQUFFLEVBQUMsTUFBTSxzREFBc0QsQ0FBQztBQUN0RyxPQUFPLEVBQUMsV0FBVyxJQUFJLEVBQUUsRUFBQyxNQUFNLHdDQUF3QyxDQUFDO0FBQ3pFLE9BQU8sRUFBQyxhQUFhLElBQUksRUFBRSxFQUFDLE1BQU0sMENBQTBDLENBQUM7QUFDN0UsT0FBTyxFQUFDLGFBQWEsSUFBSSxFQUFFLEVBQUMsTUFBTSwwQ0FBMEMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcblxuZXhwb3J0IHtGd05vdGlmaWNhdGlvblRpbWVyU2VydmljZSBhcyDJtWR9IGZyb20gJy4vY29tcG9uZW50cy9ub3RpZmljYXRpb24vbm90aWZpY2F0aW9uLXRpbWVyLnNlcnZpY2UnO1xuZXhwb3J0IHtQaXBlc01vZHVsZSBhcyDJtWF9IGZyb20gJy4vY29tcG9uZW50cy9zaGFyZWQvcGlwZXMvcGlwZXMubW9kdWxlJztcbmV4cG9ydCB7VHJhbnNsYXRlUGlwZSBhcyDJtWJ9IGZyb20gJy4vY29tcG9uZW50cy9zaGFyZWQvcGlwZXMvdHJhbnNsYXRlLnBpcGUnO1xuZXhwb3J0IHtUcnVzdEh0bWxQaXBlIGFzIMm1Y30gZnJvbSAnLi9jb21wb25lbnRzL3NoYXJlZC9waXBlcy90cnVzdGh0bWwucGlwZSc7Il19
|
package/esm2015/public-api.js
CHANGED
|
@@ -2,6 +2,12 @@ export * from './components/button-group/button-group.component';
|
|
|
2
2
|
export * from './components/button-group/button-group.module';
|
|
3
3
|
export * from './components/button/button.component';
|
|
4
4
|
export * from './components/button/button.module';
|
|
5
|
+
export * from './components/dialog/choice-dialog.component';
|
|
6
|
+
export * from './components/dialog/confirm-dialog.component';
|
|
7
|
+
export * from './components/dialog/dialog.module';
|
|
8
|
+
export * from './components/dialog/dialog.service';
|
|
9
|
+
export * from './components/dialog/error-dialog.component';
|
|
10
|
+
export * from './components/dialog/portal-dialog.component';
|
|
5
11
|
export * from './components/notification/notification-container/notification-container.component';
|
|
6
12
|
export * from './components/notification/notification.module';
|
|
7
13
|
export * from './components/notification/notification.service';
|
|
@@ -13,4 +19,5 @@ export * from './components/popover/popover.component';
|
|
|
13
19
|
export * from './components/popover/popover.module';
|
|
14
20
|
export * from './components/table/table.component';
|
|
15
21
|
export * from './components/table/table.module';
|
|
16
|
-
|
|
22
|
+
export * from './components/shared/translation.service';
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsa0RBQWtELENBQUM7QUFDakUsY0FBYywrQ0FBK0MsQ0FBQztBQUM5RCxjQUFjLHNDQUFzQyxDQUFDO0FBQ3JELGNBQWMsbUNBQW1DLENBQUM7QUFDbEQsY0FBYyw2Q0FBNkMsQ0FBQztBQUM1RCxjQUFjLDhDQUE4QyxDQUFDO0FBQzdELGNBQWMsbUNBQW1DLENBQUM7QUFDbEQsY0FBYyxvQ0FBb0MsQ0FBQztBQUNuRCxjQUFjLDRDQUE0QyxDQUFDO0FBQzNELGNBQWMsNkNBQTZDLENBQUM7QUFDNUQsY0FBYyxtRkFBbUYsQ0FBQztBQUNsRyxjQUFjLCtDQUErQyxDQUFDO0FBQzlELGNBQWMsZ0RBQWdELENBQUM7QUFDL0QsY0FBYywrREFBK0QsQ0FBQztBQUM5RSxjQUFjLDJEQUEyRCxDQUFDO0FBQzFFLGNBQWMsZ0RBQWdELENBQUM7QUFDL0QsY0FBYyxnREFBZ0QsQ0FBQztBQUMvRCxjQUFjLHdDQUF3QyxDQUFDO0FBQ3ZELGNBQWMscUNBQXFDLENBQUM7QUFDcEQsY0FBYyxvQ0FBb0MsQ0FBQztBQUNuRCxjQUFjLGlDQUFpQyxDQUFDO0FBQ2hELGNBQWMseUNBQXlDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2NvbXBvbmVudHMvYnV0dG9uLWdyb3VwL2J1dHRvbi1ncm91cC5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9jb21wb25lbnRzL2J1dHRvbi1nc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vbm90aWZpY2F0aW9uL25vdGlmaWNhdGlvbi9ub3RpZmljYXRpb24ubW9kZWwnO1xuZXhwb3J0ICogZnJvbSAnLi9jb21wb25lbnRzL3BvcG92ZXIvcG9wb3Zlci10cmlnZ2VyLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2NvbXBvbmVudHMvcG9wb3Zlci9wb3BvdmVyLXRyaWdnZXIuZGlyZWN0aXZlJztcbmV4cG9ydCAqIGZyb20gJy4vY29tcG9uZW50cy9wb3BvdmVyL3BvcG92ZXIuY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vY29tcG9uZW50cy9wb3BvdmVyL3BvcG92ZXIubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vY29tcG9uZW50cy90YWJsZS90YWJsZS5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9jb21wb25lbnRzL3RhYmxlL3RhYmxlLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2NvbXBvbmVudHMvc2hhcmVkL3RyYW5zbGF0aW9uLnNlcnZpY2UnO1xuIl19
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { Component, ViewEncapsulation, Input, NgModule,
|
|
1
|
+
import { Component, ViewEncapsulation, Input, NgModule, Inject, Injectable, SimpleChange, ViewContainerRef, Pipe, ChangeDetectorRef, ɵɵdefineInjectable, ChangeDetectionStrategy, EventEmitter, Output, HostBinding, Directive, ElementRef, ViewChild, TemplateRef } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { MatButtonModule } from '@angular/material/button';
|
|
4
|
-
import {
|
|
4
|
+
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
|
|
5
|
+
import { ComponentPortal, TemplatePortal, PortalModule } from '@angular/cdk/portal';
|
|
5
6
|
import { MatIconModule } from '@angular/material/icon';
|
|
7
|
+
import { Subject, of, BehaviorSubject, Subscription } from 'rxjs';
|
|
8
|
+
import { takeUntil, debounceTime } from 'rxjs/operators';
|
|
9
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
6
10
|
import { Overlay } from '@angular/cdk/overlay';
|
|
7
|
-
import { TemplatePortal } from '@angular/cdk/portal';
|
|
8
11
|
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
12
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
10
13
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
11
14
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
12
|
-
import { debounceTime } from 'rxjs/operators';
|
|
13
15
|
import { MatInputModule } from '@angular/material/input';
|
|
14
16
|
import { MatSelectModule } from '@angular/material/select';
|
|
15
17
|
|
|
@@ -103,6 +105,400 @@ FwButtonModule.decorators = [
|
|
|
103
105
|
},] }
|
|
104
106
|
];
|
|
105
107
|
|
|
108
|
+
class FwChoiceDialog {
|
|
109
|
+
constructor(data) {
|
|
110
|
+
this.data = data;
|
|
111
|
+
this.alignActions = this.data.alignActions
|
|
112
|
+
? this.data.alignActions === 'start'
|
|
113
|
+
? null
|
|
114
|
+
: this.data.alignActions
|
|
115
|
+
: 'center';
|
|
116
|
+
this.choices = this.data.choices;
|
|
117
|
+
this.content = this.data.content;
|
|
118
|
+
this.title = this.data.title;
|
|
119
|
+
}
|
|
120
|
+
getTestId(choice) {
|
|
121
|
+
var _a;
|
|
122
|
+
return choice.testId || `${String((_a = choice.label) !== null && _a !== void 0 ? _a : choice.value).toLowerCase()}-button`;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
FwChoiceDialog.decorators = [
|
|
126
|
+
{ type: Component, args: [{
|
|
127
|
+
host: {
|
|
128
|
+
class: 'mat-dialog-component',
|
|
129
|
+
'test-id': 'choice-dialog',
|
|
130
|
+
},
|
|
131
|
+
selector: 'fw-choice-dialog',
|
|
132
|
+
template: `
|
|
133
|
+
<h1 mat-dialog-title *ngIf="title">{{ title }}</h1>
|
|
134
|
+
<div mat-dialog-content>{{ content }}</div>
|
|
135
|
+
<div mat-dialog-actions [align]="alignActions">
|
|
136
|
+
<ng-container *ngFor="let choice of choices" [ngSwitch]="choice.variant">
|
|
137
|
+
<button *ngSwitchCase="'raised'" mat-raised-button [color]="choice.color" [attr.test-id]="getTestId(choice)"
|
|
138
|
+
[mat-dialog-close]="choice.value">{{ choice.label }}</button>
|
|
139
|
+
<button *ngSwitchCase="'stroked'" mat-stroked-button [color]="choice.color" [attr.test-id]="getTestId(choice)"
|
|
140
|
+
[mat-dialog-close]="choice.value">{{ choice.label }}</button>
|
|
141
|
+
<button *ngSwitchCase="'flat'" mat-flat-button [color]="choice.color" [attr.test-id]="getTestId(choice)"
|
|
142
|
+
[mat-dialog-close]="choice.value">{{ choice.label }}</button>
|
|
143
|
+
<ng-container *ngSwitchDefault>
|
|
144
|
+
<button *ngIf="choice.color" mat-flat-button [color]="choice.color" [attr.test-id]="getTestId(choice)"
|
|
145
|
+
[mat-dialog-close]="choice.value">{{ choice.label }}</button>
|
|
146
|
+
<button *ngIf="!choice.color" mat-stroked-button [attr.test-id]="getTestId(choice)"
|
|
147
|
+
[mat-dialog-close]="choice.value">{{ choice.label }}</button>
|
|
148
|
+
</ng-container>
|
|
149
|
+
</ng-container>
|
|
150
|
+
</div>
|
|
151
|
+
`
|
|
152
|
+
},] }
|
|
153
|
+
];
|
|
154
|
+
FwChoiceDialog.ctorParameters = () => [
|
|
155
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
class FwConfirmDialog {
|
|
159
|
+
constructor(data) {
|
|
160
|
+
this.data = data;
|
|
161
|
+
this.title = this.data.title;
|
|
162
|
+
this.content = this.data.content;
|
|
163
|
+
this.html = this.data.html;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
FwConfirmDialog.decorators = [
|
|
167
|
+
{ type: Component, args: [{
|
|
168
|
+
host: {
|
|
169
|
+
class: 'mat-dialog-component',
|
|
170
|
+
'test-id': 'confirm-dialog',
|
|
171
|
+
},
|
|
172
|
+
selector: 'fw-confirm-dialog',
|
|
173
|
+
template: `
|
|
174
|
+
<h1 mat-dialog-title *ngIf="title">{{ title }}</h1>
|
|
175
|
+
<div mat-dialog-content *ngIf="html" class="markup" [innerHTML]="html | trusthtml"></div>
|
|
176
|
+
<div mat-dialog-content *ngIf="!html">{{ content || ('confirmDialog.body' | translate ) }}</div>
|
|
177
|
+
<div mat-dialog-actions align="center">
|
|
178
|
+
<button test-id="no-button" mat-stroked-button [mat-dialog-close]="false">{{ 'confirmDialog.no' | translate }}</button>
|
|
179
|
+
<button test-id="yes-button" mat-flat-button color="primary" [mat-dialog-close]="true">{{ 'confirmDialog.yes' | translate }}</button>
|
|
180
|
+
</div>
|
|
181
|
+
`,
|
|
182
|
+
styles: [`
|
|
183
|
+
[mat-dialog-content] {
|
|
184
|
+
text-align: center;
|
|
185
|
+
}
|
|
186
|
+
[mat-dialog-content].markup {
|
|
187
|
+
text-align: inherit;
|
|
188
|
+
}
|
|
189
|
+
`]
|
|
190
|
+
},] }
|
|
191
|
+
];
|
|
192
|
+
FwConfirmDialog.ctorParameters = () => [
|
|
193
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
|
|
194
|
+
];
|
|
195
|
+
|
|
196
|
+
class FwDialogService {
|
|
197
|
+
constructor(matDialog) {
|
|
198
|
+
this.matDialog = matDialog;
|
|
199
|
+
this.dialogs = [];
|
|
200
|
+
this.config = new Map();
|
|
201
|
+
}
|
|
202
|
+
closeAll(component) {
|
|
203
|
+
if (component) {
|
|
204
|
+
this.dialogs
|
|
205
|
+
.filter((el) => el.component === component)
|
|
206
|
+
.forEach((el) => el.ref.close());
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
this.matDialog.closeAll();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
open(component, config) {
|
|
213
|
+
const index = this.dialogs.findIndex(el => el.component === component);
|
|
214
|
+
let ref = null;
|
|
215
|
+
const baseConfig = Object.assign({ multi: 'allow' }, this.config.get(component));
|
|
216
|
+
switch (baseConfig.multi) {
|
|
217
|
+
case 'ignore':
|
|
218
|
+
// if an existing dialog of the same type doesn't exist, open one
|
|
219
|
+
if (index === -1) {
|
|
220
|
+
ref = this.matDialog.open(component, Object.assign(Object.assign({}, baseConfig), config));
|
|
221
|
+
this.dialogs.push({ component, ref });
|
|
222
|
+
}
|
|
223
|
+
break;
|
|
224
|
+
case 'replace':
|
|
225
|
+
// if an existing dialog of the same type exists, replace it.
|
|
226
|
+
if (index > -1) {
|
|
227
|
+
this.dialogs[index].ref.close();
|
|
228
|
+
ref = this.matDialog.open(component, Object.assign(Object.assign({}, baseConfig), config));
|
|
229
|
+
this.dialogs.splice(index, 1, { component, ref });
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
ref = this.matDialog.open(component, Object.assign(Object.assign({}, baseConfig), config));
|
|
233
|
+
this.dialogs.push({ component, ref });
|
|
234
|
+
}
|
|
235
|
+
break;
|
|
236
|
+
default:
|
|
237
|
+
ref = this.matDialog.open(component, Object.assign(Object.assign({}, baseConfig), config));
|
|
238
|
+
this.dialogs.push({ component, ref });
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
if (ref) {
|
|
242
|
+
ref.afterClosed().subscribe(() => {
|
|
243
|
+
// clean up open dialog reference
|
|
244
|
+
const index = this.dialogs.findIndex(el => el.ref === ref);
|
|
245
|
+
if (index >= 0) {
|
|
246
|
+
this.dialogs.splice(index, 1);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return ref;
|
|
251
|
+
}
|
|
252
|
+
registerDialog(component, config) {
|
|
253
|
+
this.config.set(component, config);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
FwDialogService.decorators = [
|
|
257
|
+
{ type: Injectable }
|
|
258
|
+
];
|
|
259
|
+
FwDialogService.ctorParameters = () => [
|
|
260
|
+
{ type: MatDialog }
|
|
261
|
+
];
|
|
262
|
+
|
|
263
|
+
class FwErrorDialog {
|
|
264
|
+
constructor(data, ref) {
|
|
265
|
+
this.data = data;
|
|
266
|
+
this.ref = ref;
|
|
267
|
+
this.message = this.data.message;
|
|
268
|
+
this.ref.disableClose = false;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
FwErrorDialog.decorators = [
|
|
272
|
+
{ type: Component, args: [{
|
|
273
|
+
host: {
|
|
274
|
+
class: 'mat-dialog-component',
|
|
275
|
+
'test-id': 'error-dialog',
|
|
276
|
+
},
|
|
277
|
+
selector: 'fw-error-dialog',
|
|
278
|
+
template: `
|
|
279
|
+
<div mat-dialog-content>{{ message }}</div>
|
|
280
|
+
<div mat-dialog-actions align="end">
|
|
281
|
+
<button test-id="close-button" mat-stroked-button mat-dialog-close>
|
|
282
|
+
{{ 'common.actions.close' | translate }}
|
|
283
|
+
</button>
|
|
284
|
+
</div>
|
|
285
|
+
`
|
|
286
|
+
},] }
|
|
287
|
+
];
|
|
288
|
+
FwErrorDialog.ctorParameters = () => [
|
|
289
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
290
|
+
{ type: MatDialogRef }
|
|
291
|
+
];
|
|
292
|
+
|
|
293
|
+
class FwPortalDialog {
|
|
294
|
+
constructor(data, viewContainerRef) {
|
|
295
|
+
this.data = data;
|
|
296
|
+
this.viewContainerRef = viewContainerRef;
|
|
297
|
+
this.content = this.data.content;
|
|
298
|
+
this.title = this.data.title;
|
|
299
|
+
this.destroyed$ = new Subject();
|
|
300
|
+
if (this.data.component) {
|
|
301
|
+
this.portal = new ComponentPortal(this.data.component.type, this.viewContainerRef);
|
|
302
|
+
}
|
|
303
|
+
else if (this.data.template) {
|
|
304
|
+
this.portal = new TemplatePortal(this.data.template, this.viewContainerRef);
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
throw new Error('One of [component, template] was not provided.');
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
ngOnDestroy() {
|
|
311
|
+
this.destroyed$.next();
|
|
312
|
+
}
|
|
313
|
+
attached(ref) {
|
|
314
|
+
var _a, _b;
|
|
315
|
+
if (this.data.component) {
|
|
316
|
+
ref = ref;
|
|
317
|
+
if (this.data.component.outputs) {
|
|
318
|
+
for (const [key, observer] of Object.entries(this.data.component.outputs)) {
|
|
319
|
+
const output$ = ref[key];
|
|
320
|
+
if (typeof (output$ === null || output$ === void 0 ? void 0 : output$.pipe) === 'function' && typeof output$.subscribe === 'function') {
|
|
321
|
+
output$.pipe(takeUntil(this.destroyed$)).subscribe(observer);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (this.data.component.inputs) {
|
|
326
|
+
const changes = {};
|
|
327
|
+
for (const [key, value] of Object.entries(this.data.component.inputs)) {
|
|
328
|
+
ref.instance[key] = value;
|
|
329
|
+
changes[key] = new SimpleChange(value, value, true);
|
|
330
|
+
}
|
|
331
|
+
(_b = (_a = ref.instance).ngOnChanges) === null || _b === void 0 ? void 0 : _b.call(_a, changes);
|
|
332
|
+
ref.changeDetectorRef.markForCheck();
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
FwPortalDialog.decorators = [
|
|
338
|
+
{ type: Component, args: [{
|
|
339
|
+
host: {
|
|
340
|
+
class: 'mat-dialog-component',
|
|
341
|
+
'test-id': 'portal-dialog',
|
|
342
|
+
},
|
|
343
|
+
selector: 'fw-portal-dialog',
|
|
344
|
+
template: `
|
|
345
|
+
<ng-container *ngIf="title">
|
|
346
|
+
<h1 mat-dialog-title>{{ title }}</h1>
|
|
347
|
+
<button test-id="dialog-close-corner" mat-icon-button mat-dialog-close>
|
|
348
|
+
<mat-icon>close</mat-icon>
|
|
349
|
+
</button>
|
|
350
|
+
</ng-container>
|
|
351
|
+
<mat-dialog-content>
|
|
352
|
+
<p *ngIf="content" class="content">{{ content }}</p>
|
|
353
|
+
<ng-template [cdkPortalOutlet]="portal" (attached)="attached($event)"></ng-template>
|
|
354
|
+
</mat-dialog-content>
|
|
355
|
+
<mat-dialog-actions align="end">
|
|
356
|
+
<button test-id="dialog-close-button" mat-stroked-button mat-dialog-close>
|
|
357
|
+
{{ 'common.actions.close' | translate }}
|
|
358
|
+
</button>
|
|
359
|
+
</mat-dialog-actions>
|
|
360
|
+
`,
|
|
361
|
+
styles: [`
|
|
362
|
+
:host {
|
|
363
|
+
min-width: 200px;
|
|
364
|
+
}
|
|
365
|
+
.content {
|
|
366
|
+
margin-bottom: 30px;
|
|
367
|
+
}
|
|
368
|
+
`]
|
|
369
|
+
},] }
|
|
370
|
+
];
|
|
371
|
+
FwPortalDialog.ctorParameters = () => [
|
|
372
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
373
|
+
{ type: ViewContainerRef }
|
|
374
|
+
];
|
|
375
|
+
|
|
376
|
+
class TranslationService {
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Very basic i18n implementation. Consumer apps can provide their own implementation of TranslationService to override.
|
|
380
|
+
*/
|
|
381
|
+
class MinimalTranslationService {
|
|
382
|
+
getMessage(key, silent) {
|
|
383
|
+
return of(MinimalTranslationService.messages[key]);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
MinimalTranslationService.messages = {
|
|
387
|
+
'common.actions.close': 'Close',
|
|
388
|
+
'confirmDialog.body': 'Are you sure?',
|
|
389
|
+
'confirmDialog.no': 'No',
|
|
390
|
+
'confirmDialog.yes': 'Yes',
|
|
391
|
+
};
|
|
392
|
+
MinimalTranslationService.decorators = [
|
|
393
|
+
{ type: Injectable }
|
|
394
|
+
];
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Translate a message given a nested key to a location in the loaded locale copy.
|
|
398
|
+
*/
|
|
399
|
+
class TranslatePipe {
|
|
400
|
+
constructor(cdr, translationService) {
|
|
401
|
+
this.cdr = cdr;
|
|
402
|
+
this.translationService = translationService;
|
|
403
|
+
this.subscriptions = {};
|
|
404
|
+
this.messages = {};
|
|
405
|
+
}
|
|
406
|
+
ngOnDestroy() {
|
|
407
|
+
for (const subscription of Object.values(this.subscriptions)) {
|
|
408
|
+
subscription.unsubscribe();
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
transform(key, silent = false) {
|
|
412
|
+
if (!(key in this.subscriptions)) {
|
|
413
|
+
this.subscriptions[key] = this.translationService.getMessage(key, silent).subscribe(message => {
|
|
414
|
+
this.messages[key] = message;
|
|
415
|
+
// trigger change detection to support components with ChangeDetectionStrategy.OnPush
|
|
416
|
+
this.cdr.markForCheck();
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
return this.messages[key] || '';
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
TranslatePipe.decorators = [
|
|
423
|
+
{ type: Pipe, args: [{
|
|
424
|
+
name: 'translate',
|
|
425
|
+
pure: false,
|
|
426
|
+
},] }
|
|
427
|
+
];
|
|
428
|
+
TranslatePipe.ctorParameters = () => [
|
|
429
|
+
{ type: ChangeDetectorRef },
|
|
430
|
+
{ type: TranslationService }
|
|
431
|
+
];
|
|
432
|
+
|
|
433
|
+
class TrustHtmlPipe {
|
|
434
|
+
constructor(sanitizer) {
|
|
435
|
+
this.sanitizer = sanitizer;
|
|
436
|
+
}
|
|
437
|
+
transform(html) {
|
|
438
|
+
return this.sanitizer.bypassSecurityTrustHtml(html);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
TrustHtmlPipe.decorators = [
|
|
442
|
+
{ type: Pipe, args: [{
|
|
443
|
+
name: 'trusthtml',
|
|
444
|
+
pure: true,
|
|
445
|
+
},] }
|
|
446
|
+
];
|
|
447
|
+
TrustHtmlPipe.ctorParameters = () => [
|
|
448
|
+
{ type: DomSanitizer }
|
|
449
|
+
];
|
|
450
|
+
|
|
451
|
+
const exports = [
|
|
452
|
+
TranslatePipe,
|
|
453
|
+
TrustHtmlPipe,
|
|
454
|
+
];
|
|
455
|
+
class PipesModule {
|
|
456
|
+
}
|
|
457
|
+
PipesModule.decorators = [
|
|
458
|
+
{ type: NgModule, args: [{
|
|
459
|
+
declarations: exports,
|
|
460
|
+
exports: exports,
|
|
461
|
+
providers: [
|
|
462
|
+
{
|
|
463
|
+
provide: TranslationService,
|
|
464
|
+
useClass: MinimalTranslationService,
|
|
465
|
+
},
|
|
466
|
+
],
|
|
467
|
+
},] }
|
|
468
|
+
];
|
|
469
|
+
|
|
470
|
+
const ɵ0 = {
|
|
471
|
+
disableClose: true,
|
|
472
|
+
hasBackdrop: true,
|
|
473
|
+
};
|
|
474
|
+
class FwDialogModule {
|
|
475
|
+
}
|
|
476
|
+
FwDialogModule.decorators = [
|
|
477
|
+
{ type: NgModule, args: [{
|
|
478
|
+
declarations: [
|
|
479
|
+
FwChoiceDialog,
|
|
480
|
+
FwConfirmDialog,
|
|
481
|
+
FwErrorDialog,
|
|
482
|
+
FwPortalDialog,
|
|
483
|
+
],
|
|
484
|
+
imports: [
|
|
485
|
+
CommonModule,
|
|
486
|
+
MatButtonModule,
|
|
487
|
+
MatDialogModule,
|
|
488
|
+
MatIconModule,
|
|
489
|
+
PipesModule,
|
|
490
|
+
PortalModule,
|
|
491
|
+
],
|
|
492
|
+
providers: [
|
|
493
|
+
FwDialogService,
|
|
494
|
+
{
|
|
495
|
+
provide: MAT_DIALOG_DEFAULT_OPTIONS,
|
|
496
|
+
useValue: ɵ0
|
|
497
|
+
}
|
|
498
|
+
],
|
|
499
|
+
},] }
|
|
500
|
+
];
|
|
501
|
+
|
|
106
502
|
function genId() {
|
|
107
503
|
return String.prototype.padStart(24, Math.floor(Math.random() * Date.now()).toString(16));
|
|
108
504
|
}
|
|
@@ -313,7 +709,7 @@ FwNotificationComponent.decorators = [
|
|
|
313
709
|
providers: [FwNotificationTimerService],
|
|
314
710
|
encapsulation: ViewEncapsulation.None,
|
|
315
711
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
316
|
-
styles: ["fw-notification{display:block;border-radius:4px;box-sizing:border-box;margin:5px 24px;max-width:33vw;min-width:344px;padding:14px 16px;transform-origin:center;background-color:#2f96b4;border:1px solid hsla(0,0%,100%,.
|
|
712
|
+
styles: ["fw-notification{display:block;border-radius:4px;box-sizing:border-box;margin:5px 24px;max-width:33vw;min-width:344px;padding:14px 16px;transform-origin:center;background-color:#2f96b4;border:1px solid hsla(0,0%,100%,.7019607843);box-shadow:0 0 12px #999;color:#fff;opacity:.99;white-space:pre-wrap}fw-notification.error{background-color:#bd362f}fw-notification.info{background-color:#2f96b4}fw-notification.success{background-color:#51a351}fw-notification.wait{background-color:#2f96b4}fw-notification.warning{background-color:#f89406}"]
|
|
317
713
|
},] }
|
|
318
714
|
];
|
|
319
715
|
FwNotificationComponent.ctorParameters = () => [
|
|
@@ -768,5 +1164,5 @@ FwTableModule.decorators = [
|
|
|
768
1164
|
* Generated bundle index. Do not edit.
|
|
769
1165
|
*/
|
|
770
1166
|
|
|
771
|
-
export { FwButtonComponent, FwButtonGroupComponent, FwButtonGroupModule, FwButtonModule, FwNotificationComponent, FwNotificationContainerComponent, FwNotificationModule, FwNotificationService, FwNotificationType, FwPopoverComponent, FwPopoverModule, FwPopoverTriggerComponent, FwPopoverTriggerDirective, FwTableComponent, FwTableModule, genId,
|
|
1167
|
+
export { FwButtonComponent, FwButtonGroupComponent, FwButtonGroupModule, FwButtonModule, FwChoiceDialog, FwConfirmDialog, FwDialogModule, FwDialogService, FwErrorDialog, FwNotificationComponent, FwNotificationContainerComponent, FwNotificationModule, FwNotificationService, FwNotificationType, FwPopoverComponent, FwPopoverModule, FwPopoverTriggerComponent, FwPopoverTriggerDirective, FwPortalDialog, FwTableComponent, FwTableModule, MinimalTranslationService, TranslationService, genId, ɵ0, PipesModule as ɵa, TranslatePipe as ɵb, TrustHtmlPipe as ɵc, FwNotificationTimerService as ɵd };
|
|
772
1168
|
//# sourceMappingURL=flywheel-io-vision.js.map
|