@quadrel-enterprise-ui/framework 20.27.3-beta.236.1 → 20.27.3-beta.241.1
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/fesm2022/quadrel-enterprise-ui-framework.mjs +105 -55
- package/fesm2022/quadrel-enterprise-ui-framework.mjs.map +1 -1
- package/package.json +1 -1
- package/fesm2022/quadrel-enterprise-ui-framework-dialog-confirm.module-BQLiEzSo.mjs +0 -42
- package/fesm2022/quadrel-enterprise-ui-framework-dialog-confirm.module-BQLiEzSo.mjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ElementRef, Directive, InjectionToken, HostBinding, Input, ViewEncapsulation, Component, Injectable, Injector, HostListener, ChangeDetectionStrategy, ChangeDetectorRef, ViewChild, NgModule, EventEmitter, Output, Renderer2, Pipe, ViewContainerRef, NO_ERRORS_SCHEMA, DestroyRef, SecurityContext, NgZone, ViewChildren, forwardRef, ContentChildren, ContentChild, afterNextRender, isDevMode, QueryList, TemplateRef, CUSTOM_ELEMENTS_SCHEMA, provideAppInitializer } from '@angular/core';
|
|
3
|
-
import { Dialog, DialogRef, DialogModule } from '@angular/cdk/dialog';
|
|
3
|
+
import { Dialog, DialogRef, DialogModule, DIALOG_DATA } from '@angular/cdk/dialog';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
5
|
import { CommonModule, NgFor, NgIf, NgClass, NgTemplateOutlet, AsyncPipe } from '@angular/common';
|
|
6
|
-
import { BehaviorSubject, pairwise,
|
|
6
|
+
import { BehaviorSubject, pairwise, Subject, throwError, of, ReplaySubject, merge, fromEvent, isObservable, NEVER, Observable, EMPTY, shareReplay, Subscription, distinctUntilChanged as distinctUntilChanged$1, debounce, timer, map as map$1, switchMap, startWith as startWith$1, debounceTime as debounceTime$1, takeUntil as takeUntil$1, firstValueFrom, combineLatest, concat, take as take$1, tap as tap$1, from, delay, first, scan, queueScheduler, filter as filter$1, concatMap as concatMap$1, exhaustMap, finalize, forkJoin, delayWhen, combineLatestWith, withLatestFrom as withLatestFrom$1, async } from 'rxjs';
|
|
7
7
|
import { map, takeUntil, take, filter, catchError, debounceTime, startWith, distinctUntilChanged, concatMap, skip, tap, auditTime, withLatestFrom, observeOn, switchMap as switchMap$1, pairwise as pairwise$1, mergeMap, delay as delay$1 } from 'rxjs/operators';
|
|
8
8
|
import { v4 } from 'uuid';
|
|
9
9
|
import * as i3 from '@ngx-translate/core';
|
|
@@ -1161,58 +1161,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
1161
1161
|
}]
|
|
1162
1162
|
}] });
|
|
1163
1163
|
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
};
|
|
1169
|
-
const CANCEL_DEFAULTS = {
|
|
1170
|
-
title: { i18n: 'i18n.qd.page.cancel.confirmation.dialog.title' },
|
|
1171
|
-
message: { i18n: 'i18n.qd.page.cancel.confirmation.dialog.message' },
|
|
1172
|
-
confirm: { i18n: 'i18n.qd.page.cancel.confirmation.dialog.proceed' },
|
|
1173
|
-
cancel: { i18n: 'i18n.qd.page.cancel.confirmation.dialog.close' }
|
|
1174
|
-
};
|
|
1175
|
-
class QdConfirmationDialogOpenerService {
|
|
1176
|
-
dialog = inject(Dialog);
|
|
1177
|
-
showConfirmDialog(config, testId = 'dialog-confirm') {
|
|
1178
|
-
const resolved = {
|
|
1179
|
-
title: config.title ?? GENERIC_DEFAULTS.title,
|
|
1180
|
-
message: config.message,
|
|
1181
|
-
confirm: config.confirm ?? GENERIC_DEFAULTS.confirm,
|
|
1182
|
-
cancel: config.cancel ?? GENERIC_DEFAULTS.cancel
|
|
1183
|
-
};
|
|
1184
|
-
return from(import('./quadrel-enterprise-ui-framework-dialog-confirm.module-BQLiEzSo.mjs').then(m => m.QdDialogConfirmComponent)).pipe(switchMap(component => {
|
|
1185
|
-
const dialogRef = this.open(component, {
|
|
1186
|
-
title: resolved.title,
|
|
1187
|
-
dialogSize: QdDialogSize.Small,
|
|
1188
|
-
data: { ...resolved, testId }
|
|
1189
|
-
});
|
|
1190
|
-
return dialogRef.closed.pipe(map$1(result => !!result));
|
|
1191
|
-
}));
|
|
1192
|
-
}
|
|
1193
|
-
showDiscardConfirmDialog(message, testId = 'cancel-confirmation') {
|
|
1194
|
-
return this.showConfirmDialog({
|
|
1195
|
-
title: CANCEL_DEFAULTS.title,
|
|
1196
|
-
message: message ?? CANCEL_DEFAULTS.message,
|
|
1197
|
-
confirm: CANCEL_DEFAULTS.confirm,
|
|
1198
|
-
cancel: CANCEL_DEFAULTS.cancel
|
|
1199
|
-
}, testId);
|
|
1200
|
-
}
|
|
1201
|
-
open(component, config) {
|
|
1202
|
-
config.panelClass = 'qd-custom-panel';
|
|
1203
|
-
config.width = config.dialogSize || QdDialogSize.Default;
|
|
1204
|
-
config.disableClose = true;
|
|
1205
|
-
return this.dialog.open(component, config);
|
|
1206
|
-
}
|
|
1207
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdConfirmationDialogOpenerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1208
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdConfirmationDialogOpenerService, providedIn: 'root' });
|
|
1209
|
-
}
|
|
1210
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdConfirmationDialogOpenerService, decorators: [{
|
|
1211
|
-
type: Injectable,
|
|
1212
|
-
args: [{
|
|
1213
|
-
providedIn: 'root'
|
|
1214
|
-
}]
|
|
1215
|
-
}] });
|
|
1164
|
+
/**
|
|
1165
|
+
* DI token that provides the discard-confirmation dialog opener.
|
|
1166
|
+
*/
|
|
1167
|
+
const QD_DISCARD_CONFIRM_DIALOG_OPENER_TOKEN = new InjectionToken('QD_DISCARD_CONFIRM_DIALOG_OPENER_TOKEN');
|
|
1216
1168
|
|
|
1217
1169
|
/**
|
|
1218
1170
|
* Injection token for the host component of page dialogs with breadcrumbs.
|
|
@@ -1454,7 +1406,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
1454
1406
|
* */
|
|
1455
1407
|
class QdDialogComponent {
|
|
1456
1408
|
dialogRef = inject(DialogRef);
|
|
1457
|
-
dialog = inject(
|
|
1409
|
+
dialog = inject(QD_DISCARD_CONFIRM_DIALOG_OPENER_TOKEN);
|
|
1458
1410
|
changeDetectorRef = inject(ChangeDetectorRef);
|
|
1459
1411
|
dialogChangeGuard = inject(QdDialogChangeGuardService);
|
|
1460
1412
|
dialogService = inject(QdDialogService);
|
|
@@ -18824,6 +18776,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
18824
18776
|
}]
|
|
18825
18777
|
}] });
|
|
18826
18778
|
|
|
18779
|
+
/**
|
|
18780
|
+
* DI token that provides the component rendered inside the discard-confirmation
|
|
18781
|
+
* dialog.
|
|
18782
|
+
*
|
|
18783
|
+
* The dialog opener service opens this component through CDK `Dialog`. Binding
|
|
18784
|
+
* the component through a token instead of importing it directly keeps the
|
|
18785
|
+
* service free of the dialog module's import graph, so the discard dialog can be
|
|
18786
|
+
* bundled eagerly (no lazy chunk) without creating an import cycle.
|
|
18787
|
+
*/
|
|
18788
|
+
const QD_DISCARD_CONFIRM_DIALOG_COMPONENT_TOKEN = new InjectionToken('QD_DISCARD_CONFIRM_DIALOG_COMPONENT_TOKEN');
|
|
18789
|
+
|
|
18790
|
+
const GENERIC_DEFAULTS = {
|
|
18791
|
+
title: { i18n: 'i18n.qd.dialog.confirm.title' },
|
|
18792
|
+
confirm: { i18n: 'i18n.qd.dialog.confirm.proceed' },
|
|
18793
|
+
cancel: { i18n: 'i18n.qd.dialog.action.cancel' }
|
|
18794
|
+
};
|
|
18795
|
+
const CANCEL_DEFAULTS = {
|
|
18796
|
+
title: { i18n: 'i18n.qd.page.cancel.confirmation.dialog.title' },
|
|
18797
|
+
message: { i18n: 'i18n.qd.page.cancel.confirmation.dialog.message' },
|
|
18798
|
+
confirm: { i18n: 'i18n.qd.page.cancel.confirmation.dialog.proceed' },
|
|
18799
|
+
cancel: { i18n: 'i18n.qd.page.cancel.confirmation.dialog.close' }
|
|
18800
|
+
};
|
|
18801
|
+
class QdConfirmationDialogOpenerService {
|
|
18802
|
+
dialog = inject(Dialog);
|
|
18803
|
+
confirmDialogComponent = inject(QD_DISCARD_CONFIRM_DIALOG_COMPONENT_TOKEN);
|
|
18804
|
+
showConfirmDialog(config, testId = 'dialog-confirm') {
|
|
18805
|
+
const resolved = {
|
|
18806
|
+
title: config.title ?? GENERIC_DEFAULTS.title,
|
|
18807
|
+
message: config.message,
|
|
18808
|
+
confirm: config.confirm ?? GENERIC_DEFAULTS.confirm,
|
|
18809
|
+
cancel: config.cancel ?? GENERIC_DEFAULTS.cancel
|
|
18810
|
+
};
|
|
18811
|
+
const dialogRef = this.open(this.confirmDialogComponent, {
|
|
18812
|
+
title: resolved.title,
|
|
18813
|
+
dialogSize: QdDialogSize.Small,
|
|
18814
|
+
data: { ...resolved, testId }
|
|
18815
|
+
});
|
|
18816
|
+
return dialogRef.closed.pipe(map$1(result => !!result));
|
|
18817
|
+
}
|
|
18818
|
+
showDiscardConfirmDialog(message, testId = 'cancel-confirmation') {
|
|
18819
|
+
return this.showConfirmDialog({
|
|
18820
|
+
title: CANCEL_DEFAULTS.title,
|
|
18821
|
+
message: message ?? CANCEL_DEFAULTS.message,
|
|
18822
|
+
confirm: CANCEL_DEFAULTS.confirm,
|
|
18823
|
+
cancel: CANCEL_DEFAULTS.cancel
|
|
18824
|
+
}, testId);
|
|
18825
|
+
}
|
|
18826
|
+
open(component, config) {
|
|
18827
|
+
config.panelClass = 'qd-custom-panel';
|
|
18828
|
+
config.width = config.dialogSize || QdDialogSize.Default;
|
|
18829
|
+
config.disableClose = true;
|
|
18830
|
+
return this.dialog.open(component, config);
|
|
18831
|
+
}
|
|
18832
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdConfirmationDialogOpenerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
18833
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdConfirmationDialogOpenerService, providedIn: 'root' });
|
|
18834
|
+
}
|
|
18835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdConfirmationDialogOpenerService, decorators: [{
|
|
18836
|
+
type: Injectable,
|
|
18837
|
+
args: [{
|
|
18838
|
+
providedIn: 'root'
|
|
18839
|
+
}]
|
|
18840
|
+
}] });
|
|
18841
|
+
|
|
18827
18842
|
class QdSpinnerComponent {
|
|
18828
18843
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18829
18844
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdSpinnerComponent, isStandalone: false, selector: "qd-spinner", ngImport: i0, template: "<svg\n version=\"1.1\"\n id=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 32 32\"\n style=\"enable-background: new 0 0 32 32\"\n xml:space=\"preserve\"\n class=\"spinner\"\n>\n <path\n class=\"stroke\"\n d=\"M31.9,14.6l-2.3,0.2c0,0.4,0.1,0.8,0.1,1.2c0,7.6-6.1,13.7-13.7,13.7c-3.8,0-7.2-1.5-9.7-4s-4-5.9-4-9.7\n\tC2.3,8.4,8.4,2.3,16,2.3c3.8,0,7.2,1.5,9.7,4l1.6-1.6C24.4,1.8,20.4,0,16,0C7.2,0,0,7.2,0,16c0,4.4,1.8,8.4,4.7,11.3S11.6,32,16,32\n\tc8.8,0,16-7.2,16-16C32,15.5,32,15.1,31.9,14.6z\"\n />\n</svg>\n", styles: [":host{display:block}.spinner{height:32px;animation:rotateSpinner .8s linear infinite}.stroke{fill:#069}@keyframes rotateSpinner{to{transform:rotate(360deg)}}\n"] });
|
|
@@ -19230,6 +19245,10 @@ class QdDialogModule {
|
|
|
19230
19245
|
{
|
|
19231
19246
|
provide: QD_PAGE_DIALOG_WITH_BREADCRUMBS_HOST,
|
|
19232
19247
|
useValue: QdPageDialogWithBreadcrumbsComponent
|
|
19248
|
+
},
|
|
19249
|
+
{
|
|
19250
|
+
provide: QD_DISCARD_CONFIRM_DIALOG_OPENER_TOKEN,
|
|
19251
|
+
useExisting: QdConfirmationDialogOpenerService
|
|
19233
19252
|
}
|
|
19234
19253
|
], imports: [CommonModule,
|
|
19235
19254
|
TranslateModule,
|
|
@@ -19287,6 +19306,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
19287
19306
|
{
|
|
19288
19307
|
provide: QD_PAGE_DIALOG_WITH_BREADCRUMBS_HOST,
|
|
19289
19308
|
useValue: QdPageDialogWithBreadcrumbsComponent
|
|
19309
|
+
},
|
|
19310
|
+
{
|
|
19311
|
+
provide: QD_DISCARD_CONFIRM_DIALOG_OPENER_TOKEN,
|
|
19312
|
+
useExisting: QdConfirmationDialogOpenerService
|
|
19290
19313
|
}
|
|
19291
19314
|
]
|
|
19292
19315
|
}]
|
|
@@ -34603,6 +34626,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
34603
34626
|
}]
|
|
34604
34627
|
}] });
|
|
34605
34628
|
|
|
34629
|
+
class QdDialogConfirmComponent {
|
|
34630
|
+
dialogRef = inject(DialogRef);
|
|
34631
|
+
data = inject(DIALOG_DATA);
|
|
34632
|
+
config = this.data;
|
|
34633
|
+
testId = this.data?.testId ?? 'dialog-confirm';
|
|
34634
|
+
close() {
|
|
34635
|
+
this.dialogRef.close(false);
|
|
34636
|
+
}
|
|
34637
|
+
confirm() {
|
|
34638
|
+
this.dialogRef.close(true);
|
|
34639
|
+
}
|
|
34640
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdDialogConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
34641
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdDialogConfirmComponent, isStandalone: true, selector: "qd-dialog-confirm", ngImport: i0, template: "<qd-dialog>\n <qd-text-section>\n <qd-text-section-paragraph>\n {{ config.message.i18n | translate }}\n </qd-text-section-paragraph>\n </qd-text-section>\n\n <qd-dialog-action>\n <button qdButton qdButtonGhost color=\"secondary\" (click)=\"close()\" [data-test-id]=\"testId + '-close'\">\n {{ config.cancel.i18n | translate }}\n </button>\n\n <button qdButton color=\"error\" (click)=\"confirm()\" [data-test-id]=\"testId + '-proceed'\">\n {{ config.confirm.i18n | translate }}\n </button>\n </qd-dialog-action>\n</qd-dialog>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: QdButtonModule }, { kind: "component", type: QdButtonComponent, selector: "button[qdButton], a[qdButton], button[qd-button]", inputs: ["disabled", "color", "icon", "data-test-id", "additionalInfo"] }, { kind: "directive", type: QdButtonGhostDirective, selector: "button[qdButtonGhost], a[qdButtonGhost]" }, { kind: "ngmodule", type: QdTextSectionModule }, { kind: "component", type: QdTextSectionComponent, selector: "qd-text-section" }, { kind: "component", type: QdTextSectionParagraphComponent, selector: "qd-text-section-paragraph" }, { kind: "ngmodule", type: QdDialogModule }, { kind: "component", type: QdDialogActionComponent, selector: "qd-dialog-action" }, { kind: "component", type: QdDialogComponent, selector: "qd-dialog" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] });
|
|
34642
|
+
}
|
|
34643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdDialogConfirmComponent, decorators: [{
|
|
34644
|
+
type: Component,
|
|
34645
|
+
args: [{ selector: 'qd-dialog-confirm', standalone: true, imports: [CommonModule, TranslateModule, QdButtonModule, QdTextSectionModule, QdDialogModule], template: "<qd-dialog>\n <qd-text-section>\n <qd-text-section-paragraph>\n {{ config.message.i18n | translate }}\n </qd-text-section-paragraph>\n </qd-text-section>\n\n <qd-dialog-action>\n <button qdButton qdButtonGhost color=\"secondary\" (click)=\"close()\" [data-test-id]=\"testId + '-close'\">\n {{ config.cancel.i18n | translate }}\n </button>\n\n <button qdButton color=\"error\" (click)=\"confirm()\" [data-test-id]=\"testId + '-proceed'\">\n {{ config.confirm.i18n | translate }}\n </button>\n </qd-dialog-action>\n</qd-dialog>\n" }]
|
|
34646
|
+
}] });
|
|
34647
|
+
|
|
34606
34648
|
// @ts-strict-ignore
|
|
34607
34649
|
/**
|
|
34608
34650
|
* The **QdPageStep** is a single step inside the **QdPageStepper** within a **QdPage**.
|
|
@@ -35361,6 +35403,10 @@ class QdUiModule {
|
|
|
35361
35403
|
provide: HTTP_INTERCEPTORS,
|
|
35362
35404
|
useClass: QdNotificationsHttpInterceptorService,
|
|
35363
35405
|
multi: true
|
|
35406
|
+
},
|
|
35407
|
+
{
|
|
35408
|
+
provide: QD_DISCARD_CONFIRM_DIALOG_COMPONENT_TOKEN,
|
|
35409
|
+
useValue: QdDialogConfirmComponent
|
|
35364
35410
|
}
|
|
35365
35411
|
], imports: [QD_UI_MODULES, QdButtonModule,
|
|
35366
35412
|
QdChipModule,
|
|
@@ -35404,6 +35450,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
35404
35450
|
provide: HTTP_INTERCEPTORS,
|
|
35405
35451
|
useClass: QdNotificationsHttpInterceptorService,
|
|
35406
35452
|
multi: true
|
|
35453
|
+
},
|
|
35454
|
+
{
|
|
35455
|
+
provide: QD_DISCARD_CONFIRM_DIALOG_COMPONENT_TOKEN,
|
|
35456
|
+
useValue: QdDialogConfirmComponent
|
|
35407
35457
|
}
|
|
35408
35458
|
]
|
|
35409
35459
|
}]
|