@datarailsshared/datarailsshared 1.4.81 → 1.4.84

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.
@@ -1,16 +1,19 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { EventEmitter, Component, ViewEncapsulation, Input, Output, ChangeDetectionStrategy, ChangeDetectorRef, forwardRef, ElementRef, Inject, PLATFORM_ID, ContentChildren, Renderer2, HostBinding, ContentChild, Pipe, TemplateRef, HostListener, Directive, ComponentFactoryResolver, ViewContainerRef, ViewChild, Injector, Injectable, Host, NgModule, Optional } from '@angular/core';
3
- import { FormControl, NG_VALUE_ACCESSOR, NgModel, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
3
+ import { FormControl, NG_VALUE_ACCESSOR, FormGroup, NgModel, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
4
4
  import { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS, MatNativeDateModule } from '@angular/material/core';
5
5
  import { MomentDateAdapter, MAT_MOMENT_DATE_ADAPTER_OPTIONS, MatMomentDateModule } from '@angular/material-moment-adapter';
6
6
  import * as momentImported from 'moment';
7
7
  import { isPlatformBrowser, DOCUMENT, CommonModule } from '@angular/common';
8
8
  import { Subject, from, merge, fromEvent, noop as noop$1, BehaviorSubject } from 'rxjs';
9
- import { startWith, switchMap, takeUntil, filter, skip, first, debounceTime, distinctUntilChanged } from 'rxjs/operators';
9
+ import { startWith, switchMap, takeUntil, filter, skip, first, catchError, debounceTime, distinctUntilChanged } from 'rxjs/operators';
10
10
  import { transition, style, animate, trigger, state } from '@angular/animations';
11
11
  import * as i1 from '@angular/cdk/overlay';
12
12
  import { Overlay, OverlayPositionBuilder, OverlayConfig } from '@angular/cdk/overlay';
13
13
  import { ComponentPortal } from '@angular/cdk/portal';
14
+ import * as i1$1 from '@angular/material/dialog';
15
+ import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatDialogModule } from '@angular/material/dialog';
16
+ import * as _ from 'lodash';
14
17
  import { MatDatepickerModule, MatCalendar } from '@angular/material/datepicker';
15
18
  import { MatFormFieldModule } from '@angular/material/form-field';
16
19
  import { MatInputModule } from '@angular/material/input';
@@ -243,7 +246,7 @@ const MONTH_FORMATS = {
243
246
  monthYearA11yLabel: "MMMM YYYY"
244
247
  },
245
248
  };
246
- const ɵ0$5 = MONTH_FORMATS;
249
+ const ɵ0$6 = MONTH_FORMATS;
247
250
  class MonthTagComponent extends AnyTagComponent {
248
251
  constructor() {
249
252
  super();
@@ -302,7 +305,7 @@ MonthTagComponent.decorators = [
302
305
  useClass: MomentDateAdapter,
303
306
  deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
304
307
  },
305
- { provide: MAT_DATE_FORMATS, useValue: ɵ0$5 },
308
+ { provide: MAT_DATE_FORMATS, useValue: ɵ0$6 },
306
309
  ]
307
310
  },] }
308
311
  ];
@@ -423,7 +426,7 @@ const WEEK_FORMATS = {
423
426
  monthYearA11yLabel: "MMMM YYYY"
424
427
  },
425
428
  };
426
- const ɵ0$4 = WEEK_FORMATS;
429
+ const ɵ0$5 = WEEK_FORMATS;
427
430
  class WeekTagComponent extends AnyTagComponent {
428
431
  constructor() {
429
432
  super();
@@ -519,7 +522,7 @@ WeekTagComponent.decorators = [
519
522
  useClass: MomentDateAdapter,
520
523
  deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
521
524
  },
522
- { provide: MAT_DATE_FORMATS, useValue: ɵ0$4 },
525
+ { provide: MAT_DATE_FORMATS, useValue: ɵ0$5 },
523
526
  ]
524
527
  },] }
525
528
  ];
@@ -541,7 +544,7 @@ const YEAR_FORMATS = {
541
544
  monthYearA11yLabel: "MMMM YYYY"
542
545
  },
543
546
  };
544
- const ɵ0$3 = YEAR_FORMATS;
547
+ const ɵ0$4 = YEAR_FORMATS;
545
548
  class YearTagComponent extends AnyTagComponent {
546
549
  constructor() {
547
550
  super();
@@ -606,7 +609,7 @@ YearTagComponent.decorators = [
606
609
  useClass: MomentDateAdapter,
607
610
  deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
608
611
  },
609
- { provide: MAT_DATE_FORMATS, useValue: ɵ0$3 },
612
+ { provide: MAT_DATE_FORMATS, useValue: ɵ0$4 },
610
613
  ]
611
614
  },] }
612
615
  ];
@@ -720,7 +723,7 @@ const DAY_FORMATS = {
720
723
  monthYearA11yLabel: "MMMM YYYY"
721
724
  },
722
725
  };
723
- const ɵ0$2 = DAY_FORMATS;
726
+ const ɵ0$3 = DAY_FORMATS;
724
727
  class DayTagComponent extends AnyTagComponent {
725
728
  constructor() {
726
729
  super();
@@ -773,7 +776,7 @@ DayTagComponent.decorators = [
773
776
  useClass: MomentDateAdapter,
774
777
  deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
775
778
  },
776
- { provide: MAT_DATE_FORMATS, useValue: ɵ0$2 },
779
+ { provide: MAT_DATE_FORMATS, useValue: ɵ0$3 },
777
780
  ]
778
781
  },] }
779
782
  ];
@@ -2993,6 +2996,222 @@ DrErrorComponent.propDecorators = {
2993
2996
  label: [{ type: Input }]
2994
2997
  };
2995
2998
 
2999
+ class DialogWrapperComponent {
3000
+ constructor(dialogRef, dialogService, cdr, componentFactoryResolver, dialogData) {
3001
+ var _a, _b, _c, _d;
3002
+ this.dialogRef = dialogRef;
3003
+ this.dialogService = dialogService;
3004
+ this.cdr = cdr;
3005
+ this.componentFactoryResolver = componentFactoryResolver;
3006
+ this.dialogData = dialogData;
3007
+ this.class = ((_b = (_a = this.dialogData) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.noThemeSizeClass) ? null : ((_d = (_c = this.dialogData) === null || _c === void 0 ? void 0 : _c.theme) === null || _d === void 0 ? void 0 : _d.themeSize) || 'medium-modal';
3008
+ this.saving$ = new BehaviorSubject(false);
3009
+ this.destroy$ = new Subject();
3010
+ }
3011
+ ngAfterViewInit() {
3012
+ if (!this.dialogData.child) {
3013
+ return new Error('Expected componentTypeChild');
3014
+ }
3015
+ const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.dialogData.child);
3016
+ this.childComponent = this.content.createComponent(componentFactory).instance;
3017
+ this.childComponent.closeDialog = this.closeDialog.bind(this);
3018
+ this.childComponent.onAcceptDialog = this.onAcceptDialog.bind(this);
3019
+ // pass data to component child
3020
+ if (this.dialogData.childData) {
3021
+ _.assign(this.childComponent, this.dialogData.childData);
3022
+ }
3023
+ // call component child init func - looks like double init
3024
+ // if (this.childComponent.ngOnInit) {
3025
+ // this.childComponent.ngOnInit();
3026
+ // }
3027
+ this.cdr.detectChanges();
3028
+ }
3029
+ closeDialog(data) {
3030
+ this.dialogRef.close(data || false);
3031
+ }
3032
+ onDecline() {
3033
+ this.dialogRef.close(undefined);
3034
+ }
3035
+ onAcceptDialog(data) {
3036
+ if (!this.childComponent) {
3037
+ this.dialogRef.close(data || true);
3038
+ return;
3039
+ }
3040
+ const funcName = this.dialogData.acceptButton.functions;
3041
+ if (this.childComponent[funcName])
3042
+ this.childComponent[funcName]();
3043
+ const loadFuncName = this.dialogData.acceptButton.loading;
3044
+ if (this.childComponent[loadFuncName])
3045
+ this.isLoading = this.childComponent[loadFuncName]();
3046
+ if (this.dialogData.confirmFn) {
3047
+ this.saving$.next(true);
3048
+ this.dialogData.confirmFn().pipe(takeUntil(this.destroy$), catchError(error => this.dialogService.throwErr(error, this.saving$))).subscribe(() => {
3049
+ this.saving$.next(false);
3050
+ this.dialogRef.close(data || true);
3051
+ });
3052
+ }
3053
+ if (this.childComponent && !this.childComponent[funcName]) {
3054
+ this.dialogRef.close(data || true);
3055
+ return;
3056
+ }
3057
+ }
3058
+ ngOnDestroy() {
3059
+ this.destroy$.next(null);
3060
+ this.destroy$.complete();
3061
+ }
3062
+ }
3063
+ DialogWrapperComponent.decorators = [
3064
+ { type: Component, args: [{
3065
+ selector: 'dr-dialog-wrapper',
3066
+ template: "<div class=\"dialog-wrapper\"\n [class.dialog-wrapper--confirmation-no-title]=\"dialogData.theme?.isConfirmation && !dialogData.title\">\n <i class=\"dr-icon-exit\" data-test=\"close_btn\" (click)=\"closeDialog()\" *ngIf=\"!dialogData?.hideCloseBtn\"></i>\n\n <div header class=\"dialog-wrapper__header\" *ngIf=\"dialogData.title\">\n <h1 class=\"dialog-wrapper__header__title\" data-test=\"dialogTitle\">{{dialogData.title}}</h1>\n <h1 class=\"dialog-wrapper__header__subtitle\" data-test=\"dialogSubtitle\"\n *ngIf=\"dialogData.subtitle\">{{dialogData.subtitle}}</h1>\n </div>\n <div class=\"dialog-wrapper__content\"\n [class.dialog-wrapper__content--no-padding]=\"dialogData.theme?.contentNoPadding\">\n <span *ngIf=\"dialogData.contentIcon?.class\" class=\"dialog-wrapper__content__icon\">\n <i [ngClass]=\"dialogData.contentIcon.class\" [style.color]=\"dialogData.contentIcon?.color || 'inherit'\"></i>\n </span>\n <span [innerHTML]=\"dialogData.content\"></span>\n <span #content class=\"dialog-wrapper__content__anchor\"> </span>\n </div>\n <div footer class=\"dialog-wrapper__footer\" *ngIf=\"dialogData.cancelButton || dialogData.acceptButton\">\n <div class=\"dialog-wrapper__footer__buttons\">\n <dr-button *ngIf=\"dialogData.customButton\"\n (click)=\"onDecline()\"\n [theme]=\"'secondary'\"\n [isLoading]=\"isLoading\"\n data-test=\"declineBtn\"\n [drTooltip]=\"dialogData.tooltips?.custom\">\n {{dialogData.customButton.label}}\n </dr-button>\n <dr-button *ngIf=\"dialogData.cancelButton\"\n (click)=\"closeDialog()\"\n [theme]=\"'secondary'\"\n data-test=\"closeBtn\"\n [drTooltip]=\"dialogData.tooltips?.cancel\">\n {{dialogData.cancelButton.label}}\n </dr-button>\n <dr-button *ngIf=\"dialogData.acceptButton\"\n (click)=\"onAcceptDialog()\"\n [theme]=\"dialogData.acceptButton?.theme || 'primary'\"\n [isLoading]=\"isLoading\"\n data-test=\"acceptBtn\"\n [drTooltip]=\"dialogData.tooltips?.accept\">\n {{dialogData.acceptButton.label}}\n </dr-button>\n </div>\n </div>\n</div>\n",
3067
+ styles: [":host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}:host.large-modal{min-width:750px;max-width:750px}:host.medium-large-modal{min-width:669px;max-width:669px}:host.xl-modal{min-height:188px;max-height:800px;min-width:1100px;max-width:1100px}:host.xl-custom-modal{min-height:188px;max-height:800px;min-width:1100px;max-width:100%}::ng-deep .dialog-wrapper{display:flex;justify-content:space-between;flex-direction:column;position:relative}::ng-deep .dialog-wrapper>.dr-icon-exit{z-index:1;position:absolute;right:32px;top:20px;color:#51566f;cursor:pointer}::ng-deep .dialog-wrapper__header{display:flex;flex-direction:column;padding:8px 52px 8px 32px;border-bottom:1px solid #e5e6ea}::ng-deep .dialog-wrapper__header__title{color:#151b3f;position:static;font-weight:600;font-size:18px;line-height:24px}::ng-deep .dialog-wrapper__header__subtitle{font-size:14px;line-height:20px;margin:0}::ng-deep .dialog-wrapper--confirmation-no-title{padding-top:16px;height:100%}::ng-deep .dialog-wrapper__content{overflow-y:inherit;font-size:14px;font-weight:400;line-height:22px;padding:24px 32px 32px}::ng-deep .dialog-wrapper__content__anchor{display:none}::ng-deep .dialog-wrapper__content--no-padding{padding:0}::ng-deep .dialog-wrapper__content__icon{margin-right:10px;top:5px;position:relative}::ng-deep .dialog-wrapper__footer{border-top:1px solid #e5e6ea}::ng-deep .dialog-wrapper__footer__buttons{display:flex;justify-content:flex-end;padding-top:10px;padding-right:32px;padding-bottom:11px}::ng-deep .dialog-wrapper__footer__buttons dr-button:nth-child(n+2){margin-left:12px}\n"]
3068
+ },] }
3069
+ ];
3070
+ DialogWrapperComponent.ctorParameters = () => [
3071
+ { type: MatDialogRef },
3072
+ { type: DialogService },
3073
+ { type: ChangeDetectorRef },
3074
+ { type: ComponentFactoryResolver },
3075
+ { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
3076
+ ];
3077
+ DialogWrapperComponent.propDecorators = {
3078
+ content: [{ type: ViewChild, args: ['content', { read: ViewContainerRef },] }],
3079
+ class: [{ type: HostBinding, args: ['class',] }]
3080
+ };
3081
+
3082
+ class DialogModalWrapperComponent {
3083
+ constructor(dialogRef, dialogService, dialogData) {
3084
+ var _a, _b;
3085
+ this.dialogRef = dialogRef;
3086
+ this.dialogService = dialogService;
3087
+ this.dialogData = dialogData;
3088
+ this.class = (_b = (_a = this === null || this === void 0 ? void 0 : this.dialogData) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.themeSize;
3089
+ this.saving$ = new BehaviorSubject(false);
3090
+ this.isLoading = false;
3091
+ this.showServerErrorMessage = false;
3092
+ this.destroy$ = new Subject();
3093
+ }
3094
+ ngOnInit() {
3095
+ if (this.dialogData.fields) {
3096
+ this.form = new FormGroup(this.dialogData.fields.reduce((accumulator, currentValue) => {
3097
+ const currentFormControl = {};
3098
+ currentFormControl[currentValue.name] = new FormControl(currentValue.default || null, currentValue.validators || []);
3099
+ return Object.assign(accumulator, currentFormControl);
3100
+ }, {}));
3101
+ }
3102
+ }
3103
+ onAccept() {
3104
+ if (!this.dialogData.confirmFn)
3105
+ return this.dialogRef.close(this.form.value || true);
3106
+ this.isLoading = true;
3107
+ this.saving$.next(true);
3108
+ this.dialogData.confirmFn(this.form.value)
3109
+ .pipe(takeUntil(this.destroy$), catchError((err) => {
3110
+ this.showServerErrorMessage = true;
3111
+ this.isLoading = false;
3112
+ return this.dialogService.throwErr(err, this.saving$);
3113
+ }))
3114
+ .subscribe(() => {
3115
+ this.saving$.next(false);
3116
+ this.dialogRef.close(this.form.value || true);
3117
+ });
3118
+ }
3119
+ footerAction() {
3120
+ this.dialogData.footerTemplateData.action(this.form.value);
3121
+ }
3122
+ closeDialog() {
3123
+ this.dialogRef.close(false);
3124
+ }
3125
+ ngOnDestroy() {
3126
+ this.destroy$.next(null);
3127
+ this.destroy$.complete();
3128
+ }
3129
+ }
3130
+ DialogModalWrapperComponent.decorators = [
3131
+ { type: Component, args: [{
3132
+ selector: 'dr-dialog-modal-wrapper',
3133
+ template: "<div header class=\"header-dialog\">\n <h1 class=\"title-dialog\" data-test=\"modalTitle\">{{dialogData.title}}</h1>\n <i mat-icon-button *ngIf=\"!dialogData.hideCloseBtn\" (click)=\"closeDialog()\" class=\"dr-icon-exit icon-close\"\n data-test=\"xBtn\"></i>\n</div>\n<div *ngIf=\"dialogData.content\" class=\"content-dialog\">\n <ng-container>{{dialogData.content}}</ng-container>\n <span #content class=\"content-anchor\"></span>\n</div>\n<form *ngIf=\"dialogData.fields\" [formGroup]=\"form\" class=\"dr-smart-from\">\n <div class=\"dr-smart-form_wrapper\">\n <div *ngFor=\"let field of dialogData.fields\" class=\"dr-smart-form_group\"\n [ngStyle]=\"{'display': field.isLabelFullWidth ? 'block' : 'flex'}\">\n <label *ngIf=\"field.label\" [ngClass]=\"field.isLabelFullWidth ? 'col-md-12 mb-2' : 'col-md-2'\"\n class=\"label p-0 d-flex align-items-center\">{{field.label}}</label>\n <div class=\"input-group p-0\"\n [ngClass]=\"{'col-md-10': field.label && !field.isLabelFullWidth, 'col-md-12': !field.label || field.isLabelFullWidth}\">\n <dr-select *ngIf=\"field.type === 'select'\"\n [searchable]=\"dialogData.searchable\"\n [clearable]=\"dialogData.clearable\"\n [formControlName]=\"field.name\"\n [bindLabel]=\"field.bindLabel || null\"\n [bindValue]=\"field.bindValue || null\"\n [selectedItem]=\"field.default\"\n [items]=\"field.items || (field.items$ | async)\"\n [required]=\"true\"\n [placeholder]=\"field.placeholder\">\n <ng-template *ngIf=\"dialogData?.footerTemplateData\" #optionFooterTemplate>\n <button (click)=\"footerAction()\" class=\"dr-select-footer__btn\">\n <i *ngIf=\"dialogData.footerTemplateData.icon\"\n class=\"{{dialogData.footerTemplateData.icon}}\"></i>\n {{dialogData.footerTemplateData.label}}</button>\n </ng-template>\n </dr-select>\n <dr-input *ngIf=\"field.type === 'input'\" data-test=\"modalInput\" class=\"form-control\"\n [formControlName]=\"field.name\" [placeholder]=\"field.placeholder\"></dr-input>\n <label class=\"form-error-alert\" *ngIf=\"dialogData.errorMessage && !form.pristine && form.invalid\">\n {{dialogData.errorMessage}}\n </label>\n <label class=\"form-error-alert\"\n *ngIf=\"form.valid && showServerErrorMessage && dialogData.serverErrorMessage\">\n {{dialogData.serverErrorMessage}}\n </label>\n </div>\n </div>\n </div>\n</form>\n\n<div footer class=\"footer-dialog\">\n <div class=\"buttons-wrapper\" *ngIf=\"dialogData.cancelButton || dialogData.acceptButton\">\n <dr-button *ngIf=\"dialogData.cancelButton\" data-test=\"modalCloseBtn\" (click)=\"closeDialog()\"\n [theme]=\"'secondary'\"> {{dialogData.cancelButton.label}}</dr-button>\n <dr-button *ngIf=\"dialogData.acceptButton\" data-test=\"modalAddBtn\" (click)=\"onAccept()\" [theme]=\"'primary'\"\n [isLoading]=\"isLoading\" [disabled]=\"form.invalid\"> {{dialogData.acceptButton.label}}</dr-button>\n </div>\n</div>\n",
3134
+ styles: [":host{display:flex;justify-content:space-between;flex-direction:column}:host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}.header-dialog{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:8px 39px 8px 32px;border-bottom:1px solid #e5e6ea}.title-dialog{color:#151b3f;position:static;font-weight:bold;font-size:18px;line-height:24px}.content-dialog{font-weight:400;font-size:14px;padding:16px 32px 5px}.icon-close{color:#51566f;cursor:pointer}.dr-smart-from{font-size:14px;font-weight:500;line-height:22px;padding:16px 32px 22px}.content-dialog{padding:16px 32px 0;font-weight:400;font-size:14px;line-height:22px}.content-anchor{display:none}.footer-dialog{border-top:1px solid #e5e6ea}.buttons-wrapper{display:flex;justify-content:flex-end;padding-top:10px;padding-right:32px;padding-bottom:11px}.buttons-wrapper dr-button:nth-of-type(2){margin-left:12px}.form-error-alert{position:absolute;margin-top:5px;font-size:12px;color:red}.dr-select-footer__btn{background-color:transparent;display:flex;align-items:center;justify-content:flex-start;cursor:pointer;min-width:15rem;font-style:normal;font-weight:400;font-size:14px;line-height:24px;clear:both;width:100%;white-space:nowrap;padding:0 12px;height:36px;flex-shrink:0}\n"]
3135
+ },] }
3136
+ ];
3137
+ DialogModalWrapperComponent.ctorParameters = () => [
3138
+ { type: MatDialogRef },
3139
+ { type: DialogService },
3140
+ { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
3141
+ ];
3142
+ DialogModalWrapperComponent.propDecorators = {
3143
+ class: [{ type: HostBinding, args: ['class',] }]
3144
+ };
3145
+
3146
+ const DEFAULT_PANE_CLASS_NAME = 'wrapper-dialog';
3147
+ const DEFAULT_CONFIRM_THEME = { themeSize: 'small-modal' };
3148
+ class DialogService {
3149
+ constructor(dialog) {
3150
+ this.dialog = dialog;
3151
+ }
3152
+ /**
3153
+ * Function to open modal with custom form
3154
+ */
3155
+ openDialogWrapper(componentTypeChild, dialogData, componentTypeWrapper) {
3156
+ if (!componentTypeWrapper)
3157
+ componentTypeWrapper = DialogWrapperComponent;
3158
+ dialogData.data.child = componentTypeChild;
3159
+ if (dialogData.panelClass instanceof Array) {
3160
+ dialogData.panelClass.push(DEFAULT_PANE_CLASS_NAME);
3161
+ }
3162
+ else {
3163
+ dialogData.panelClass = [dialogData.panelClass || '', DEFAULT_PANE_CLASS_NAME];
3164
+ }
3165
+ this.wrapperComponent = this.openDialog(componentTypeWrapper, dialogData);
3166
+ return this.wrapperComponent;
3167
+ }
3168
+ /**
3169
+ * Function to open confirmation modal
3170
+ */
3171
+ openConfirmDialog(confirmDialogData) {
3172
+ const dialogData = { panelClass: DEFAULT_PANE_CLASS_NAME, data: null };
3173
+ Object.assign(dialogData, { data: confirmDialogData });
3174
+ if (!dialogData.data.theme)
3175
+ dialogData.data.theme = DEFAULT_CONFIRM_THEME;
3176
+ dialogData.data.theme.isConfirmation = true;
3177
+ return this.openDialog(DialogWrapperComponent, dialogData);
3178
+ }
3179
+ /**
3180
+ * Function to open confirmation modal with inputs
3181
+ */
3182
+ openConfirmDialogModal(confirmDialogData) {
3183
+ const dialogData = { panelClass: DEFAULT_PANE_CLASS_NAME, data: null };
3184
+ Object.assign(dialogData, { data: confirmDialogData });
3185
+ if (!dialogData.data.theme)
3186
+ dialogData.data.theme = DEFAULT_CONFIRM_THEME;
3187
+ return this.openDialog(DialogModalWrapperComponent, dialogData);
3188
+ }
3189
+ close(params) {
3190
+ this.wrapperComponent.close(params);
3191
+ }
3192
+ changeDialogThemeSize(theme) {
3193
+ this.wrapperComponent.componentInstance.class = theme;
3194
+ }
3195
+ openDialog(componentType, dialogData) {
3196
+ return this.dialog.open(componentType, dialogData);
3197
+ }
3198
+ throwErr(err, load) {
3199
+ if (load) {
3200
+ load.next(false);
3201
+ }
3202
+ throw err;
3203
+ }
3204
+ }
3205
+ DialogService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DialogService_Factory() { return new DialogService(i0.ɵɵinject(i1$1.MatDialog)); }, token: DialogService, providedIn: "root" });
3206
+ DialogService.decorators = [
3207
+ { type: Injectable, args: [{
3208
+ providedIn: 'root'
3209
+ },] }
3210
+ ];
3211
+ DialogService.ctorParameters = () => [
3212
+ { type: MatDialog }
3213
+ ];
3214
+
2996
3215
  var TooltipPosition;
2997
3216
  (function (TooltipPosition) {
2998
3217
  TooltipPosition["TOP"] = "top";
@@ -3009,6 +3228,27 @@ var TooltipPosition;
3009
3228
  TooltipPosition["LEFT_BOTTOM"] = "left-bottom";
3010
3229
  })(TooltipPosition || (TooltipPosition = {}));
3011
3230
 
3231
+ var DIALOG_SIZE;
3232
+ (function (DIALOG_SIZE) {
3233
+ DIALOG_SIZE["SMALL"] = "small-modal";
3234
+ DIALOG_SIZE["MEDIUM"] = "medium-modal";
3235
+ DIALOG_SIZE["MEDIUM_LARGE"] = "medium-large-modal";
3236
+ DIALOG_SIZE["LARGE"] = "large-modal";
3237
+ DIALOG_SIZE["X_LARGE"] = "xl-modal";
3238
+ DIALOG_SIZE["X_CUSTOM_LARGE"] = "xl-custom-modal";
3239
+ })(DIALOG_SIZE || (DIALOG_SIZE = {}));
3240
+ var DIALOG_BUTTON_LABEL;
3241
+ (function (DIALOG_BUTTON_LABEL) {
3242
+ DIALOG_BUTTON_LABEL["SAVE"] = "Save";
3243
+ DIALOG_BUTTON_LABEL["CANCEL"] = "Cancel";
3244
+ DIALOG_BUTTON_LABEL["CLOSE"] = "Close";
3245
+ })(DIALOG_BUTTON_LABEL || (DIALOG_BUTTON_LABEL = {}));
3246
+ var DIALOG_FIELD_TYPE;
3247
+ (function (DIALOG_FIELD_TYPE) {
3248
+ DIALOG_FIELD_TYPE["INPUT"] = "input";
3249
+ DIALOG_FIELD_TYPE["SELECT"] = "select";
3250
+ })(DIALOG_FIELD_TYPE || (DIALOG_FIELD_TYPE = {}));
3251
+
3012
3252
  class DrModelDebounceChangeDirective {
3013
3253
  constructor(ngModel) {
3014
3254
  this.ngModel = ngModel;
@@ -3111,7 +3351,7 @@ const components$3 = [DateTagComponent,
3111
3351
  AnyTagComponent,
3112
3352
  YearTagComponent,
3113
3353
  ForecastTagComponent];
3114
- const ɵ0$1 = { useUtc: true };
3354
+ const ɵ0$2 = { useUtc: true };
3115
3355
  class DateTagModule {
3116
3356
  }
3117
3357
  DateTagModule.decorators = [
@@ -3129,7 +3369,7 @@ DateTagModule.decorators = [
3129
3369
  ],
3130
3370
  exports: components$3,
3131
3371
  providers: [
3132
- { provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: ɵ0$1 }
3372
+ { provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: ɵ0$2 }
3133
3373
  ],
3134
3374
  declarations: components$3,
3135
3375
  },] }
@@ -3394,7 +3634,7 @@ DrDatePickerCustomHeaderComponent.ctorParameters = () => [
3394
3634
 
3395
3635
  const moment = require('moment');
3396
3636
  const noop = () => { };
3397
- const ɵ0 = noop;
3637
+ const ɵ0$1 = noop;
3398
3638
  class DrDatePickerComponent {
3399
3639
  constructor(cdr, dateAdapter, datePickerService) {
3400
3640
  this.cdr = cdr;
@@ -4034,9 +4274,9 @@ StepperComponent.propDecorators = {
4034
4274
  stepper: [{ type: ViewChild, args: ['stepper', { read: ElementRef },] }]
4035
4275
  };
4036
4276
 
4037
- class StepperModule {
4277
+ class DrStepperModule {
4038
4278
  }
4039
- StepperModule.decorators = [
4279
+ DrStepperModule.decorators = [
4040
4280
  { type: NgModule, args: [{
4041
4281
  declarations: [StepperComponent],
4042
4282
  imports: [
@@ -4047,11 +4287,33 @@ StepperModule.decorators = [
4047
4287
  },] }
4048
4288
  ];
4049
4289
 
4290
+ const ɵ0 = {}, ɵ1 = {};
4291
+ class DrDialogModule {
4292
+ }
4293
+ DrDialogModule.decorators = [
4294
+ { type: NgModule, args: [{
4295
+ declarations: [DialogWrapperComponent, DialogModalWrapperComponent],
4296
+ imports: [
4297
+ CommonModule,
4298
+ MatDialogModule,
4299
+ DrInputsModule,
4300
+ ReactiveFormsModule,
4301
+ DrTooltipModule
4302
+ ],
4303
+ exports: [DialogWrapperComponent, DialogModalWrapperComponent],
4304
+ providers: [
4305
+ { provide: MatDialogRef, useValue: ɵ0 },
4306
+ { provide: MAT_DIALOG_DATA, useValue: ɵ1 },
4307
+ DialogService
4308
+ ]
4309
+ },] }
4310
+ ];
4311
+
4050
4312
  /* components */
4051
4313
 
4052
4314
  /**
4053
4315
  * Generated bundle index. Do not edit.
4054
4316
  */
4055
4317
 
4056
- export { AnyTagComponent, CalendarView, CheckboxComponent, CustomDateFormat, DateFromats, DatePickerPeriodPosition, DateTagComponent, DateTagModule, DayTagComponent, DrAccordionComponent, DrAccordionItemBodyComponent, DrAccordionItemComponent, DrAccordionItemHeaderComponent, DrAccordionModule, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrButtonComponent, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrErrorComponent, DrErrorModule, DrInputComponent, DrInputsModule, DrLayoutBodyComponent, DrLayoutComponent, DrLayoutHeaderComponent, DrLayoutModule, DrModelDebounceChangeDirective, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrSelectComponent, DrSharedUtils, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, SpinnerSize, SpinnerType, StepperModule, TimeframeOption, TooltipComponent, TooltipPosition, WeekTagComponent, YearTagComponent, components$3 as ɵa, POPUP_ANIMATION as ɵb, DrDatePickerComponent as ɵc, DrDatePickerService as ɵd, DrDatePickerWithTimeframeComponent as ɵe, DrDatePickerFormatDirective as ɵf, DrDatePickerCustomHeaderComponent as ɵg, DrShowTimeframePipe as ɵh, TooltipInfoComponent as ɵi, TooltipInfoSimpleComponent as ɵj, TooltipNoBodyComponent as ɵk, TooltipProcessDefaultComponent as ɵl, StepperComponent as ɵm };
4318
+ export { AnyTagComponent, CalendarView, CheckboxComponent, CustomDateFormat, DIALOG_BUTTON_LABEL, DIALOG_FIELD_TYPE, DIALOG_SIZE, DateFromats, DatePickerPeriodPosition, DateTagComponent, DateTagModule, DayTagComponent, DialogService, DrAccordionComponent, DrAccordionItemBodyComponent, DrAccordionItemComponent, DrAccordionItemHeaderComponent, DrAccordionModule, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrButtonComponent, DrDialogModule, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrErrorComponent, DrErrorModule, DrInputComponent, DrInputsModule, DrLayoutBodyComponent, DrLayoutComponent, DrLayoutHeaderComponent, DrLayoutModule, DrModelDebounceChangeDirective, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrSelectComponent, DrSharedUtils, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrStepperModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, SpinnerSize, SpinnerType, TimeframeOption, TooltipComponent, TooltipPosition, WeekTagComponent, YearTagComponent, components$3 as ɵa, POPUP_ANIMATION as ɵb, DrDatePickerComponent as ɵc, DrDatePickerService as ɵd, DrDatePickerWithTimeframeComponent as ɵe, DrDatePickerFormatDirective as ɵf, DrDatePickerCustomHeaderComponent as ɵg, DrShowTimeframePipe as ɵh, TooltipInfoComponent as ɵi, TooltipInfoSimpleComponent as ɵj, TooltipNoBodyComponent as ɵk, TooltipProcessDefaultComponent as ɵl, StepperComponent as ɵm, DialogWrapperComponent as ɵn, DialogModalWrapperComponent as ɵo };
4057
4319
  //# sourceMappingURL=datarailsshared-datarailsshared.js.map