@apipass/modals 0.1.5 → 0.1.9-alpha.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.
@@ -1,4 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@apipass/modals" />
5
+ export * from './public-api';
@@ -1,155 +1,193 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/material/dialog'), require('@angular/material/form-field'), require('@angular/forms'), require('@angular/material/input'), require('@apipass/buttons'), require('@apipass/icons'), require('@apipass/inputs')) :
3
- typeof define === 'function' && define.amd ? define('@apipass/modals', ['exports', '@angular/core', '@angular/common', '@angular/material/dialog', '@angular/material/form-field', '@angular/forms', '@angular/material/input', '@apipass/buttons', '@apipass/icons', '@apipass/inputs'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.apipass = global.apipass || {}, global.apipass.modals = {}), global.ng.core, global.ng.common, global.ng.material.dialog, global.ng.material.formField, global.ng.forms, global.ng.material.input, global.buttons, global.icons, global.inputs));
5
- }(this, (function (exports, core, common, dialog, formField, forms, input, buttons, icons, inputs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/material/dialog'), require('@angular/core'), require('@angular/common'), require('@apipass/buttons'), require('@apipass/icons'), require('@apipass/inputs'), require('@angular/forms'), require('@angular/material/form-field'), require('@angular/material/input')) :
3
+ typeof define === 'function' && define.amd ? define('@apipass/modals', ['exports', '@angular/material/dialog', '@angular/core', '@angular/common', '@apipass/buttons', '@apipass/icons', '@apipass/inputs', '@angular/forms', '@angular/material/form-field', '@angular/material/input'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.apipass = global.apipass || {}, global.apipass.modals = {}), global.ng.material.dialog, global.ng.core, global.ng.common, global.i3, global.i4, global.i5, global.ng.forms, global.ng.material.formField, global.ng.material.input));
5
+ }(this, (function (exports, i1, i0, i2, i3, i4, i5, i6, formField, input) { 'use strict';
6
6
 
7
- var DialogConfig = /** @class */ (function () {
8
- function DialogConfig() {
9
- }
10
- return DialogConfig;
11
- }());
12
- var ConfirmRemoveModalComponent = /** @class */ (function () {
13
- function ConfirmRemoveModalComponent(dialog) {
14
- this.dialog = dialog;
15
- this.title = '';
16
- this.content = '';
17
- this.confirmIcon = '';
18
- this.confirmText = 'Remove';
19
- this.removeTextLabel = '';
20
- this.removeTextConfirm = '';
21
- this.showCloseIcon = true;
22
- this.closeLabel = 'Close';
23
- this.dialogConfig = new DialogConfig();
24
- this.openModal = new core.EventEmitter();
25
- this.confirmModal = new core.EventEmitter();
26
- this.closeModal = new core.EventEmitter();
27
- }
28
- ConfirmRemoveModalComponent.prototype.ngOnInit = function () {
29
- var _this = this;
30
- this.openModal.subscribe(function (item) {
31
- _this.dialogConfig.data = {
32
- title: _this.title,
33
- content: _this.content,
34
- confirmIcon: _this.confirmIcon,
35
- confirmText: _this.confirmText,
36
- removeText: '',
37
- removeTextLabel: _this.removeTextLabel,
38
- removeTextConfirm: _this.removeTextConfirm,
39
- showCloseIcon: _this.showCloseIcon,
40
- closeLabel: _this.closeLabel,
41
- item: item
42
- };
43
- var dialogRef = _this.dialog.open(ConfirmRemoveModalDataComponent, _this.dialogConfig);
44
- dialogRef.afterClosed().subscribe(function (result) {
45
- if (!result) {
46
- _this.closeModal.next(item);
47
- }
48
- if (!_this.removeTextConfirm || (result === null || result === void 0 ? void 0 : result.removeText) === _this.removeTextConfirm) {
49
- _this.confirmModal.next(item);
50
- }
51
- });
52
- });
53
- };
54
- return ConfirmRemoveModalComponent;
55
- }());
56
- ConfirmRemoveModalComponent.decorators = [
57
- { type: core.Component, args: [{
58
- selector: 'confirm-remove-modal',
59
- template: ""
60
- },] }
61
- ];
62
- ConfirmRemoveModalComponent.ctorParameters = function () { return [
63
- { type: dialog.MatDialog }
64
- ]; };
65
- ConfirmRemoveModalComponent.propDecorators = {
66
- title: [{ type: core.Input }],
67
- content: [{ type: core.Input }],
68
- confirmIcon: [{ type: core.Input }],
69
- confirmText: [{ type: core.Input }],
70
- removeTextLabel: [{ type: core.Input }],
71
- removeTextConfirm: [{ type: core.Input }],
72
- showCloseIcon: [{ type: core.Input }],
73
- closeLabel: [{ type: core.Input }],
74
- dialogConfig: [{ type: core.Input }],
75
- openModal: [{ type: core.Input }],
76
- confirmModal: [{ type: core.Output }],
77
- closeModal: [{ type: core.Output }]
78
- };
79
- var ConfirmRemoveModalDataComponent = /** @class */ (function () {
80
- function ConfirmRemoveModalDataComponent(dialogRef, data) {
81
- this.dialogRef = dialogRef;
82
- this.data = data;
83
- }
84
- ConfirmRemoveModalDataComponent.prototype.closeClick = function () {
85
- this.dialogRef.close();
86
- };
87
- ConfirmRemoveModalDataComponent.prototype.confirmClick = function () {
88
- var _a, _b, _c;
89
- if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.removeTextConfirm) || ((_b = this.data) === null || _b === void 0 ? void 0 : _b.removeText) === ((_c = this.data) === null || _c === void 0 ? void 0 : _c.removeTextConfirm)) {
90
- this.dialogRef.close(this.data);
91
- }
92
- };
93
- ConfirmRemoveModalDataComponent.prototype.isConfirmDisabled = function () {
94
- var _a, _b, _c;
95
- if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.removeTextConfirm)) {
96
- return false;
97
- }
98
- return ((_b = this.data) === null || _b === void 0 ? void 0 : _b.removeText) !== ((_c = this.data) === null || _c === void 0 ? void 0 : _c.removeTextConfirm);
99
- };
100
- return ConfirmRemoveModalDataComponent;
101
- }());
102
- ConfirmRemoveModalDataComponent.decorators = [
103
- { type: core.Component, args: [{
104
- selector: 'confirm-remove-modal-data',
105
- template: "<div class=\"modal-title\">\r\n <h3 *ngIf=\"data.title\" mat-dialog-title>\r\n {{data.title}}\r\n </h3>\r\n <icon *ngIf=\"data.showCloseIcon\" type=\"tertiary clickable\" name=\"fas fa-times\" [title]=\"data.closeLabel\" (onClick)=\"closeClick()\"></icon>\r\n</div>\r\n\r\n<div class=\"modal-content\" mat-dialog-content>\r\n <p *ngIf=\"data.content\" [innerHTML]=\"data.content\"></p>\r\n <input-text *ngIf=\"data.removeTextConfirm\" [label]=\"data.removeTextLabel\" [(ngModel)]=\"data.removeText\"></input-text>\r\n</div>\r\n\r\n<div class=\"modal-actions\" mat-dialog-actions>\r\n <secondary-button [btnDisabled]=\"isConfirmDisabled()\" [icon]=\"data.confirmIcon\" [label]=\"data.confirmText\" (onClick)=\"confirmClick()\"></secondary-button>\r\n</div>\r\n",
106
- styles: [".modal-title{align-items:flex-start;display:flex;justify-content:center;position:relative;width:100%}.modal-title h3{font-weight:700;margin:0;text-align:center;width:100%}.modal-title icon{position:absolute;right:-5px;top:-5px}.modal-content{border:none!important;margin:20px 0!important;text-align:center!important;width:100%!important}.modal-content input-text{width:80%}.modal-actions{align-items:center;display:flex;justify-content:center;width:100%}"]
107
- },] }
108
- ];
109
- ConfirmRemoveModalDataComponent.ctorParameters = function () { return [
110
- { type: dialog.MatDialogRef },
111
- { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
112
- ]; };
7
+ function ConfirmRemoveModalDataComponent_h3_1_Template(rf, ctx) {
8
+ if (rf & 1) {
9
+ i0.ɵɵelementStart(0, "h3", 8);
10
+ i0.ɵɵtext(1);
11
+ i0.ɵɵelementEnd();
12
+ }
13
+ if (rf & 2) {
14
+ var ctx_r0 = i0.ɵɵnextContext();
15
+ i0.ɵɵadvance(1);
16
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.data.title, " ");
17
+ }
18
+ }
19
+ function ConfirmRemoveModalDataComponent_icon_2_Template(rf, ctx) {
20
+ if (rf & 1) {
21
+ var _r5_1 = i0.ɵɵgetCurrentView();
22
+ i0.ɵɵelementStart(0, "icon", 9);
23
+ i0.ɵɵlistener("onClick", function ConfirmRemoveModalDataComponent_icon_2_Template_icon_onClick_0_listener() { i0.ɵɵrestoreView(_r5_1); var ctx_r4 = i0.ɵɵnextContext(); return ctx_r4.closeClick(); });
24
+ i0.ɵɵelementEnd();
25
+ }
26
+ if (rf & 2) {
27
+ var ctx_r1 = i0.ɵɵnextContext();
28
+ i0.ɵɵproperty("title", ctx_r1.data.closeLabel);
29
+ }
30
+ }
31
+ function ConfirmRemoveModalDataComponent_p_4_Template(rf, ctx) {
32
+ if (rf & 1) {
33
+ i0.ɵɵelement(0, "p", 10);
34
+ }
35
+ if (rf & 2) {
36
+ var ctx_r2 = i0.ɵɵnextContext();
37
+ i0.ɵɵproperty("innerHTML", ctx_r2.data.content, i0.ɵɵsanitizeHtml);
38
+ }
39
+ }
40
+ function ConfirmRemoveModalDataComponent_input_text_5_Template(rf, ctx) {
41
+ if (rf & 1) {
42
+ var _r7_1 = i0.ɵɵgetCurrentView();
43
+ i0.ɵɵelementStart(0, "input-text", 11);
44
+ i0.ɵɵlistener("ngModelChange", function ConfirmRemoveModalDataComponent_input_text_5_Template_input_text_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r7_1); var ctx_r6 = i0.ɵɵnextContext(); return ctx_r6.data.removeText = $event; });
45
+ i0.ɵɵelementEnd();
46
+ }
47
+ if (rf & 2) {
48
+ var ctx_r3 = i0.ɵɵnextContext();
49
+ i0.ɵɵproperty("label", ctx_r3.data.removeTextLabel)("ngModel", ctx_r3.data.removeText);
50
+ }
51
+ }
52
+ var ConfirmRemoveDialogData = /** @class */ (function () {
53
+ function ConfirmRemoveDialogData() {
54
+ }
55
+ return ConfirmRemoveDialogData;
56
+ }());
57
+ var ConfirmRemoveModalDataComponent = /** @class */ (function () {
58
+ function ConfirmRemoveModalDataComponent(dialogRef, data) {
59
+ this.dialogRef = dialogRef;
60
+ this.data = data;
61
+ }
62
+ ConfirmRemoveModalDataComponent.prototype.closeClick = function () {
63
+ this.dialogRef.close();
64
+ };
65
+ ConfirmRemoveModalDataComponent.prototype.confirmClick = function () {
66
+ var _a, _b, _c;
67
+ if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.removeTextConfirm) || ((_b = this.data) === null || _b === void 0 ? void 0 : _b.removeText) === ((_c = this.data) === null || _c === void 0 ? void 0 : _c.removeTextConfirm)) {
68
+ this.dialogRef.close(this.data);
69
+ }
70
+ };
71
+ ConfirmRemoveModalDataComponent.prototype.isConfirmDisabled = function () {
72
+ var _a, _b, _c;
73
+ if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.removeTextConfirm)) {
74
+ return false;
75
+ }
76
+ return ((_b = this.data) === null || _b === void 0 ? void 0 : _b.removeText) !== ((_c = this.data) === null || _c === void 0 ? void 0 : _c.removeTextConfirm);
77
+ };
78
+ return ConfirmRemoveModalDataComponent;
79
+ }());
80
+ ConfirmRemoveModalDataComponent.ɵfac = function ConfirmRemoveModalDataComponent_Factory(t) { return new (t || ConfirmRemoveModalDataComponent)(i0.ɵɵdirectiveInject(i1.MatDialogRef), i0.ɵɵdirectiveInject(i1.MAT_DIALOG_DATA)); };
81
+ ConfirmRemoveModalDataComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ConfirmRemoveModalDataComponent, selectors: [["confirm-remove-modal-data"]], decls: 8, vars: 7, consts: [[1, "modal-title"], ["mat-dialog-title", "", 4, "ngIf"], ["type", "tertiary clickable", "name", "fas fa-times", 3, "title", "onClick", 4, "ngIf"], ["mat-dialog-content", "", 1, "modal-content"], [3, "innerHTML", 4, "ngIf"], [3, "label", "ngModel", "ngModelChange", 4, "ngIf"], ["mat-dialog-actions", "", 1, "modal-actions"], [3, "btnDisabled", "icon", "label", "onClick"], ["mat-dialog-title", ""], ["type", "tertiary clickable", "name", "fas fa-times", 3, "title", "onClick"], [3, "innerHTML"], [3, "label", "ngModel", "ngModelChange"]], template: function ConfirmRemoveModalDataComponent_Template(rf, ctx) {
82
+ if (rf & 1) {
83
+ i0.ɵɵelementStart(0, "div", 0);
84
+ i0.ɵɵtemplate(1, ConfirmRemoveModalDataComponent_h3_1_Template, 2, 1, "h3", 1);
85
+ i0.ɵɵtemplate(2, ConfirmRemoveModalDataComponent_icon_2_Template, 1, 1, "icon", 2);
86
+ i0.ɵɵelementEnd();
87
+ i0.ɵɵelementStart(3, "div", 3);
88
+ i0.ɵɵtemplate(4, ConfirmRemoveModalDataComponent_p_4_Template, 1, 1, "p", 4);
89
+ i0.ɵɵtemplate(5, ConfirmRemoveModalDataComponent_input_text_5_Template, 1, 2, "input-text", 5);
90
+ i0.ɵɵelementEnd();
91
+ i0.ɵɵelementStart(6, "div", 6);
92
+ i0.ɵɵelementStart(7, "secondary-button", 7);
93
+ i0.ɵɵlistener("onClick", function ConfirmRemoveModalDataComponent_Template_secondary_button_onClick_7_listener() { return ctx.confirmClick(); });
94
+ i0.ɵɵelementEnd();
95
+ i0.ɵɵelementEnd();
96
+ }
97
+ if (rf & 2) {
98
+ i0.ɵɵadvance(1);
99
+ i0.ɵɵproperty("ngIf", ctx.data.title);
100
+ i0.ɵɵadvance(1);
101
+ i0.ɵɵproperty("ngIf", ctx.data.showCloseIcon);
102
+ i0.ɵɵadvance(2);
103
+ i0.ɵɵproperty("ngIf", ctx.data.content);
104
+ i0.ɵɵadvance(1);
105
+ i0.ɵɵproperty("ngIf", ctx.data.removeTextConfirm);
106
+ i0.ɵɵadvance(2);
107
+ i0.ɵɵproperty("btnDisabled", ctx.isConfirmDisabled())("icon", ctx.data.confirmIcon)("label", ctx.data.confirmText);
108
+ }
109
+ }, directives: [i2.NgIf, i1.MatDialogContent, i1.MatDialogActions, i3.SecondaryButtonComponent, i1.MatDialogTitle, i4.IconComponent, i5.InputTextComponent, i6.NgControlStatus, i6.NgModel], styles: [".modal-title[_ngcontent-%COMP%]{align-items:flex-start;display:flex;justify-content:center;position:relative;width:100%}.modal-title[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-weight:700;margin:0;text-align:center;width:100%}.modal-title[_ngcontent-%COMP%] icon[_ngcontent-%COMP%]{position:absolute;right:-5px;top:-5px}.modal-content[_ngcontent-%COMP%]{border:none!important;margin:20px 0!important;text-align:center!important}.modal-content[_ngcontent-%COMP%] input-text[_ngcontent-%COMP%]{width:80%}.modal-actions[_ngcontent-%COMP%]{align-items:center;display:flex;justify-content:center;width:100%}"] });
110
+ /*@__PURE__*/ (function () {
111
+ i0.ɵsetClassMetadata(ConfirmRemoveModalDataComponent, [{
112
+ type: i0.Component,
113
+ args: [{
114
+ selector: 'confirm-remove-modal-data',
115
+ templateUrl: 'confirm-remove-modal.component.html',
116
+ styleUrls: ['confirm-remove-modal.component.scss']
117
+ }]
118
+ }], function () {
119
+ return [{ type: i1.MatDialogRef }, { type: ConfirmRemoveDialogData, decorators: [{
120
+ type: i0.Inject,
121
+ args: [i1.MAT_DIALOG_DATA]
122
+ }] }];
123
+ }, null);
124
+ })();
113
125
 
114
- var ModalsModule = /** @class */ (function () {
115
- function ModalsModule() {
116
- }
117
- return ModalsModule;
118
- }());
119
- ModalsModule.decorators = [
120
- { type: core.NgModule, args: [{
121
- imports: [
122
- common.CommonModule,
123
- dialog.MatDialogModule,
124
- formField.MatFormFieldModule,
125
- forms.FormsModule,
126
- input.MatInputModule,
127
- inputs.InputsModule,
128
- buttons.ButtonsModule,
129
- icons.IconsModule,
130
- ],
131
- declarations: [
132
- ConfirmRemoveModalComponent,
133
- ConfirmRemoveModalDataComponent
134
- ],
135
- exports: [
136
- ConfirmRemoveModalComponent,
137
- ConfirmRemoveModalDataComponent
138
- ],
139
- entryComponents: [
140
- ConfirmRemoveModalDataComponent
141
- ],
142
- providers: []
143
- },] }
144
- ];
126
+ var ModalsModule = /** @class */ (function () {
127
+ function ModalsModule() {
128
+ }
129
+ return ModalsModule;
130
+ }());
131
+ ModalsModule.ɵmod = i0.ɵɵdefineNgModule({ type: ModalsModule });
132
+ ModalsModule.ɵinj = i0.ɵɵdefineInjector({ factory: function ModalsModule_Factory(t) { return new (t || ModalsModule)(); }, providers: [], imports: [[
133
+ i2.CommonModule,
134
+ i1.MatDialogModule,
135
+ formField.MatFormFieldModule,
136
+ i6.FormsModule,
137
+ input.MatInputModule,
138
+ i5.InputsModule,
139
+ i3.ButtonsModule,
140
+ i4.IconsModule,
141
+ ]] });
142
+ (function () {
143
+ (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ModalsModule, { declarations: [ConfirmRemoveModalDataComponent], imports: [i2.CommonModule,
144
+ i1.MatDialogModule,
145
+ formField.MatFormFieldModule,
146
+ i6.FormsModule,
147
+ input.MatInputModule,
148
+ i5.InputsModule,
149
+ i3.ButtonsModule,
150
+ i4.IconsModule], exports: [ConfirmRemoveModalDataComponent] });
151
+ })();
152
+ /*@__PURE__*/ (function () {
153
+ i0.ɵsetClassMetadata(ModalsModule, [{
154
+ type: i0.NgModule,
155
+ args: [{
156
+ imports: [
157
+ i2.CommonModule,
158
+ i1.MatDialogModule,
159
+ formField.MatFormFieldModule,
160
+ i6.FormsModule,
161
+ input.MatInputModule,
162
+ i5.InputsModule,
163
+ i3.ButtonsModule,
164
+ i4.IconsModule,
165
+ ],
166
+ declarations: [
167
+ ConfirmRemoveModalDataComponent
168
+ ],
169
+ exports: [
170
+ ConfirmRemoveModalDataComponent
171
+ ],
172
+ providers: []
173
+ }]
174
+ }], null, null);
175
+ })();
145
176
 
146
- /**
147
- * Generated bundle index. Do not edit.
177
+ /**
178
+ * Generated bundle index. Do not edit.
148
179
  */
149
180
 
150
- exports.ConfirmRemoveModalComponent = ConfirmRemoveModalComponent;
181
+ Object.keys(i1).forEach(function (k) {
182
+ if (k !== 'default') Object.defineProperty(exports, k, {
183
+ enumerable: true,
184
+ get: function () {
185
+ return i1[k];
186
+ }
187
+ });
188
+ });
189
+ exports.ConfirmRemoveDialogData = ConfirmRemoveDialogData;
151
190
  exports.ConfirmRemoveModalDataComponent = ConfirmRemoveModalDataComponent;
152
- exports.DialogConfig = DialogConfig;
153
191
  exports.ModalsModule = ModalsModule;
154
192
 
155
193
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1 +1 @@
1
- {"version":3,"file":"apipass-modals.umd.js","sources":["../../../projects/modals/src/lib/confirm-remove-modal.component.ts","../../../projects/modals/src/modals.module.ts","../../../projects/modals/src/apipass-modals.ts"],"sourcesContent":["import {Component, EventEmitter, Inject, Input, OnInit, Output} from '@angular/core';\r\nimport {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material/dialog';\r\nimport {Direction} from '@angular/cdk/bidi';\r\n\r\nexport declare type DialogRole = 'dialog' | 'alertdialog';\r\n\r\nexport interface DialogPosition {\r\n top?: string;\r\n bottom?: string;\r\n left?: string;\r\n right?: string;\r\n}\r\n\r\nexport class DialogConfig {\r\n id?: string;\r\n role?: DialogRole;\r\n panelClass?: string | string[];\r\n hasBackdrop?: boolean;\r\n backdropClass?: string;\r\n disableClose?: boolean;\r\n\r\n width?: string;\r\n height?: string;\r\n minWidth?: number | string;\r\n minHeight?: number | string;\r\n maxWidth?: number | string;\r\n maxHeight?: number | string;\r\n\r\n data?: any;\r\n position?: DialogPosition;\r\n direction?: Direction;\r\n ariaDescribedBy?: string | null;\r\n ariaLabelledBy?: string | null;\r\n ariaLabel?: string | null;\r\n autoFocus?: boolean;\r\n restoreFocus?: boolean;\r\n closeOnNavigation?: boolean;\r\n}\r\n\r\nexport interface DialogData {\r\n title: string;\r\n content: string;\r\n confirmIcon: string;\r\n confirmText: string;\r\n removeText: string;\r\n removeTextLabel: string;\r\n removeTextConfirm: string;\r\n showCloseIcon: boolean;\r\n closeLabel: string;\r\n}\r\n\r\n@Component({\r\n selector: 'confirm-remove-modal',\r\n template: ``\r\n})\r\nexport class ConfirmRemoveModalComponent implements OnInit {\r\n\r\n @Input() public title = '';\r\n @Input() public content = '';\r\n @Input() public confirmIcon = '';\r\n @Input() public confirmText = 'Remove';\r\n @Input() public removeTextLabel = '';\r\n @Input() public removeTextConfirm = '';\r\n @Input() public showCloseIcon = true;\r\n @Input() public closeLabel = 'Close';\r\n\r\n @Input() public dialogConfig: DialogConfig = new DialogConfig();\r\n\r\n @Input() public openModal: EventEmitter<any> = new EventEmitter();\r\n @Output() public confirmModal: EventEmitter<any> = new EventEmitter();\r\n @Output() public closeModal: EventEmitter<any> = new EventEmitter();\r\n\r\n constructor(public dialog: MatDialog) {\r\n }\r\n\r\n ngOnInit(): void {\r\n this.openModal.subscribe((item: any) => {\r\n this.dialogConfig.data = {\r\n title: this.title,\r\n content: this.content,\r\n confirmIcon: this.confirmIcon,\r\n confirmText: this.confirmText,\r\n removeText: '',\r\n removeTextLabel: this.removeTextLabel,\r\n removeTextConfirm: this.removeTextConfirm,\r\n showCloseIcon: this.showCloseIcon,\r\n closeLabel: this.closeLabel,\r\n item\r\n };\r\n const dialogRef = this.dialog.open(ConfirmRemoveModalDataComponent, this.dialogConfig);\r\n dialogRef.afterClosed().subscribe((result: DialogData) => {\r\n if (!result) {\r\n this.closeModal.next(item);\r\n }\r\n if (!this.removeTextConfirm || result?.removeText === this.removeTextConfirm) {\r\n this.confirmModal.next(item);\r\n }\r\n });\r\n });\r\n }\r\n\r\n}\r\n\r\n@Component({\r\n selector: 'confirm-remove-modal-data',\r\n templateUrl: 'confirm-remove-modal.component.html',\r\n styleUrls: ['confirm-remove-modal.component.scss']\r\n})\r\nexport class ConfirmRemoveModalDataComponent {\r\n\r\n constructor(\r\n public dialogRef: MatDialogRef<ConfirmRemoveModalDataComponent>,\r\n @Inject(MAT_DIALOG_DATA) public data: DialogData,\r\n ) {\r\n }\r\n\r\n closeClick(): void {\r\n this.dialogRef.close();\r\n }\r\n\r\n confirmClick(): void {\r\n if (!this.data?.removeTextConfirm || this.data?.removeText === this.data?.removeTextConfirm) {\r\n this.dialogRef.close(this.data);\r\n }\r\n }\r\n\r\n isConfirmDisabled(): boolean {\r\n if (!this.data?.removeTextConfirm) {\r\n return false;\r\n }\r\n return this.data?.removeText !== this.data?.removeTextConfirm;\r\n }\r\n\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\nimport {ConfirmRemoveModalComponent, ConfirmRemoveModalDataComponent} from './lib/confirm-remove-modal.component';\r\nimport {MatDialogModule} from '@angular/material/dialog';\r\nimport {MatFormFieldModule} from '@angular/material/form-field';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {MatInputModule} from '@angular/material/input';\r\nimport {ButtonsModule} from '@apipass/buttons';\r\nimport {IconsModule} from '@apipass/icons';\r\nimport {InputsModule} from '@apipass/inputs';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n FormsModule,\r\n MatInputModule,\r\n InputsModule,\r\n ButtonsModule,\r\n IconsModule,\r\n ],\r\n declarations: [\r\n ConfirmRemoveModalComponent,\r\n ConfirmRemoveModalDataComponent\r\n ],\r\n exports: [\r\n ConfirmRemoveModalComponent,\r\n ConfirmRemoveModalDataComponent\r\n ],\r\n entryComponents: [\r\n ConfirmRemoveModalDataComponent\r\n ],\r\n providers: []\r\n})\r\nexport class ModalsModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["EventEmitter","Component","MatDialog","Input","Output","MatDialogRef","Inject","MAT_DIALOG_DATA","NgModule","CommonModule","MatDialogModule","MatFormFieldModule","FormsModule","MatInputModule","InputsModule","ButtonsModule","IconsModule"],"mappings":";;;;;;;QAaA;SAwBC;2BAAA;KAAA,IAAA;;QAmCC,qCAAmB,MAAiB;YAAjB,WAAM,GAAN,MAAM,CAAW;YAfpB,UAAK,GAAG,EAAE,CAAC;YACX,YAAO,GAAG,EAAE,CAAC;YACb,gBAAW,GAAG,EAAE,CAAC;YACjB,gBAAW,GAAG,QAAQ,CAAC;YACvB,oBAAe,GAAG,EAAE,CAAC;YACrB,sBAAiB,GAAG,EAAE,CAAC;YACvB,kBAAa,GAAG,IAAI,CAAC;YACrB,eAAU,GAAG,OAAO,CAAC;YAErB,iBAAY,GAAiB,IAAI,YAAY,EAAE,CAAC;YAEhD,cAAS,G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wBAC3B,+BAA+B;qBAChC;oBACD,eAAe,EAAE;wBACf,+BAA+B;qBAChC;oBACD,SAAS,EAAE,EAAE;iBACd;;;IClCD;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"apipass-modals.umd.js","sources":["../../../projects/modals/src/lib/confirm-remove-modal.component.html","../../../projects/modals/src/lib/confirm-remove-modal.component.ts","../../../projects/modals/src/modals.module.ts","../../../projects/modals/src/apipass-modals.ts"],"sourcesContent":["<div class=\"modal-title\">\n <h3 *ngIf=\"data.title\" mat-dialog-title>\n {{data.title}}\n </h3>\n <icon *ngIf=\"data.showCloseIcon\" type=\"tertiary clickable\" name=\"fas fa-times\" [title]=\"data.closeLabel\" (onClick)=\"closeClick()\"></icon>\n</div>\n\n<div class=\"modal-content\" mat-dialog-content>\n <p *ngIf=\"data.content\" [innerHTML]=\"data.content\"></p>\n <input-text *ngIf=\"data.removeTextConfirm\" [label]=\"data.removeTextLabel\" [(ngModel)]=\"data.removeText\"></input-text>\n</div>\n\n<div class=\"modal-actions\" mat-dialog-actions>\n <secondary-button [btnDisabled]=\"isConfirmDisabled()\" [icon]=\"data.confirmIcon\" [label]=\"data.confirmText\" (onClick)=\"confirmClick()\"></secondary-button>\n</div>\n","import {Component, Inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\n\nexport class ConfirmRemoveDialogData {\n title?: string;\n content?: string;\n confirmIcon?: string;\n confirmText?: string;\n removeText?: string;\n removeTextLabel?: string;\n removeTextConfirm?: string;\n showCloseIcon?: boolean;\n closeLabel?: string;\n item?: any;\n}\n\n@Component({\n selector: 'confirm-remove-modal-data',\n templateUrl: 'confirm-remove-modal.component.html',\n styleUrls: ['confirm-remove-modal.component.scss']\n})\nexport class ConfirmRemoveModalDataComponent {\n\n constructor(\n public dialogRef: MatDialogRef<ConfirmRemoveModalDataComponent>,\n @Inject(MAT_DIALOG_DATA) public data: ConfirmRemoveDialogData,\n ) {\n }\n\n closeClick(): void {\n this.dialogRef.close();\n }\n\n confirmClick(): void {\n if (!this.data?.removeTextConfirm || this.data?.removeText === this.data?.removeTextConfirm) {\n this.dialogRef.close(this.data);\n }\n }\n\n isConfirmDisabled(): boolean {\n if (!this.data?.removeTextConfirm) {\n return false;\n }\n return this.data?.removeText !== this.data?.removeTextConfirm;\n }\n\n}\n","import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ConfirmRemoveModalDataComponent} from './lib/confirm-remove-modal.component';\nimport {MatDialogModule} from '@angular/material/dialog';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {FormsModule} from '@angular/forms';\nimport {MatInputModule} from '@angular/material/input';\nimport {ButtonsModule} from '@apipass/buttons';\nimport {IconsModule} from '@apipass/icons';\nimport {InputsModule} from '@apipass/inputs';\n\n@NgModule({\n imports: [\n CommonModule,\n MatDialogModule,\n MatFormFieldModule,\n FormsModule,\n MatInputModule,\n InputsModule,\n ButtonsModule,\n IconsModule,\n ],\n declarations: [\n ConfirmRemoveModalDataComponent\n ],\n exports: [\n ConfirmRemoveModalDataComponent\n ],\n providers: []\n})\nexport class ModalsModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i0.ɵɵelementStart","i0.ɵɵtext","i0.ɵɵelementEnd","i0.ɵɵadvance","i0.ɵɵtextInterpolate1","i0.ɵɵlistener","i0.ɵɵproperty","i0.ɵɵelement","MAT_DIALOG_DATA","i0.ɵɵtemplate","Component","Inject","CommonModule","MatDialogModule","MatFormFieldModule","FormsModule","MatInputModule","InputsModule","ButtonsModule","IconsModule","NgModule"],"mappings":";;;;;;;;YACEA,6BACE;YAAAC,YACF;YAAAC,iBAAK;;;;YADHC,eACF;YADEC,kDACF;;;;;;YACAJ,+BAAyI;YAAhCK,sMAAwB;YAACH,iBAAO;;;;YAA1DI,8CAAyB;;;;;YAIxGC,wBAAuD;;;;YAA/BD,kEAA0B;;;;;;YAClDN,sCAAqH;YAA3CK,gPAA6B;YAAC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C;wBACT,QAAQ,EAAE,2BAA2B;wBACrC,WAAW,EAAE,qCAAqC;wBAClD,SAAS,EAAE,CAAC,qCAAqC,CAAC;qBACnD;;uDAKyC,uBAAuB;kCAA5DC,SAAM;mCAACH,kBAAe;;;;;;QCK3B;;;;oDAAa,YAAY;2GAAZ,YAAY,mBAFZ,EAAE,YAhBJ;gBACPI,eAAY;gBACZC,kBAAe;gBACfC,4BAAkB;gBAClBC,cAAW;gBACXC,oBAAc;gBACdC,eAAY;gBACZC,gBAAa;gBACbC,cAAW;aACZ;;iFASU,YAAY,mBAPrB,+BAA+B,aAV/BP,eAAY;gBACZC,kBAAe;gBACfC,4BAAkB;gBAClBC,cAAW;gBACXC,oBAAc;gBACdC,eAAY;gBACZC,gBAAa;gBACbC,cAAW,aAMX,+BAA+B;;;6BAItB,YAAY;sBAnBxBC,WAAQ;uBAAC;wBACR,OAAO,EAAE;4BACPR,eAAY;4BACZC,kBAAe;4BACfC,4BAAkB;4BAClBC,cAAW;4BACXC,oBAAc;4BACdC,eAAY;4BACZC,gBAAa;4BACbC,cAAW;yBACZ;wBACD,YAAY,EAAE;4BACZ,+BAA+B;yBAChC;wBACD,OAAO,EAAE;4BACP,+BAA+B;yBAChC;wBACD,SAAS,EAAE,EAAE;qBACd;;;;IC7BD;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/material/dialog"),require("@angular/material/form-field"),require("@angular/forms"),require("@angular/material/input"),require("@apipass/buttons"),require("@apipass/icons"),require("@apipass/inputs")):"function"==typeof define&&define.amd?define("@apipass/modals",["exports","@angular/core","@angular/common","@angular/material/dialog","@angular/material/form-field","@angular/forms","@angular/material/input","@apipass/buttons","@apipass/icons","@apipass/inputs"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).apipass=t.apipass||{},t.apipass.modals={}),t.ng.core,t.ng.common,t.ng.material.dialog,t.ng.material.formField,t.ng.forms,t.ng.material.input,t.buttons,t.icons,t.inputs)}(this,(function(t,e,o,n,i,a,r,l,s,d){"use strict";var m=function(){},c=function(){function t(t){this.dialog=t,this.title="",this.content="",this.confirmIcon="",this.confirmText="Remove",this.removeTextLabel="",this.removeTextConfirm="",this.showCloseIcon=!0,this.closeLabel="Close",this.dialogConfig=new m,this.openModal=new e.EventEmitter,this.confirmModal=new e.EventEmitter,this.closeModal=new e.EventEmitter}return t.prototype.ngOnInit=function(){var t=this;this.openModal.subscribe((function(e){t.dialogConfig.data={title:t.title,content:t.content,confirmIcon:t.confirmIcon,confirmText:t.confirmText,removeText:"",removeTextLabel:t.removeTextLabel,removeTextConfirm:t.removeTextConfirm,showCloseIcon:t.showCloseIcon,closeLabel:t.closeLabel,item:e},t.dialog.open(p,t.dialogConfig).afterClosed().subscribe((function(o){o||t.closeModal.next(e),t.removeTextConfirm&&(null==o?void 0:o.removeText)!==t.removeTextConfirm||t.confirmModal.next(e)}))}))},t}();c.decorators=[{type:e.Component,args:[{selector:"confirm-remove-modal",template:""}]}],c.ctorParameters=function(){return[{type:n.MatDialog}]},c.propDecorators={title:[{type:e.Input}],content:[{type:e.Input}],confirmIcon:[{type:e.Input}],confirmText:[{type:e.Input}],removeTextLabel:[{type:e.Input}],removeTextConfirm:[{type:e.Input}],showCloseIcon:[{type:e.Input}],closeLabel:[{type:e.Input}],dialogConfig:[{type:e.Input}],openModal:[{type:e.Input}],confirmModal:[{type:e.Output}],closeModal:[{type:e.Output}]};var p=function(){function t(t,e){this.dialogRef=t,this.data=e}return t.prototype.closeClick=function(){this.dialogRef.close()},t.prototype.confirmClick=function(){var t,e,o;(null===(t=this.data)||void 0===t?void 0:t.removeTextConfirm)&&(null===(e=this.data)||void 0===e?void 0:e.removeText)!==(null===(o=this.data)||void 0===o?void 0:o.removeTextConfirm)||this.dialogRef.close(this.data)},t.prototype.isConfirmDisabled=function(){var t,e,o;return!!(null===(t=this.data)||void 0===t?void 0:t.removeTextConfirm)&&(null===(e=this.data)||void 0===e?void 0:e.removeText)!==(null===(o=this.data)||void 0===o?void 0:o.removeTextConfirm)},t}();p.decorators=[{type:e.Component,args:[{selector:"confirm-remove-modal-data",template:'<div class="modal-title">\r\n <h3 *ngIf="data.title" mat-dialog-title>\r\n {{data.title}}\r\n </h3>\r\n <icon *ngIf="data.showCloseIcon" type="tertiary clickable" name="fas fa-times" [title]="data.closeLabel" (onClick)="closeClick()"></icon>\r\n</div>\r\n\r\n<div class="modal-content" mat-dialog-content>\r\n <p *ngIf="data.content" [innerHTML]="data.content"></p>\r\n <input-text *ngIf="data.removeTextConfirm" [label]="data.removeTextLabel" [(ngModel)]="data.removeText"></input-text>\r\n</div>\r\n\r\n<div class="modal-actions" mat-dialog-actions>\r\n <secondary-button [btnDisabled]="isConfirmDisabled()" [icon]="data.confirmIcon" [label]="data.confirmText" (onClick)="confirmClick()"></secondary-button>\r\n</div>\r\n',styles:[".modal-title{align-items:flex-start;display:flex;justify-content:center;position:relative;width:100%}.modal-title h3{font-weight:700;margin:0;text-align:center;width:100%}.modal-title icon{position:absolute;right:-5px;top:-5px}.modal-content{border:none!important;margin:20px 0!important;text-align:center!important;width:100%!important}.modal-content input-text{width:80%}.modal-actions{align-items:center;display:flex;justify-content:center;width:100%}"]}]}],p.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]}]};var u=function(){};u.decorators=[{type:e.NgModule,args:[{imports:[o.CommonModule,n.MatDialogModule,i.MatFormFieldModule,a.FormsModule,r.MatInputModule,d.InputsModule,l.ButtonsModule,s.IconsModule],declarations:[c,p],exports:[c,p],entryComponents:[p],providers:[]}]}],t.ConfirmRemoveModalComponent=c,t.ConfirmRemoveModalDataComponent=p,t.DialogConfig=m,t.ModalsModule=u,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/material/dialog"),require("@angular/core"),require("@angular/common"),require("@apipass/buttons"),require("@apipass/icons"),require("@apipass/inputs"),require("@angular/forms"),require("@angular/material/form-field"),require("@angular/material/input")):"function"==typeof define&&define.amd?define("@apipass/modals",["exports","@angular/material/dialog","@angular/core","@angular/common","@apipass/buttons","@apipass/icons","@apipass/inputs","@angular/forms","@angular/material/form-field","@angular/material/input"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).apipass=e.apipass||{},e.apipass.modals={}),e.ng.material.dialog,e.ng.core,e.ng.common,e.i3,e.i4,e.i5,e.ng.forms,e.ng.material.formField,e.ng.material.input)}(this,(function(e,t,n,o,a,i,l,r,d,c){"use strict";function m(e,t){if(1&e&&(n.ɵɵelementStart(0,"h3",8),n.ɵɵtext(1),n.ɵɵelementEnd()),2&e){var o=n.ɵɵnextContext();n.ɵɵadvance(1),n.ɵɵtextInterpolate1(" ",o.data.title," ")}}function s(e,t){if(1&e){var o=n.ɵɵgetCurrentView();n.ɵɵelementStart(0,"icon",9),n.ɵɵlistener("onClick",(function(){return n.ɵɵrestoreView(o),n.ɵɵnextContext().closeClick()})),n.ɵɵelementEnd()}if(2&e){var a=n.ɵɵnextContext();n.ɵɵproperty("title",a.data.closeLabel)}}function u(e,t){if(1&e&&n.ɵɵelement(0,"p",10),2&e){var o=n.ɵɵnextContext();n.ɵɵproperty("innerHTML",o.data.content,n.ɵɵsanitizeHtml)}}function p(e,t){if(1&e){var o=n.ɵɵgetCurrentView();n.ɵɵelementStart(0,"input-text",11),n.ɵɵlistener("ngModelChange",(function(e){return n.ɵɵrestoreView(o),n.ɵɵnextContext().data.removeText=e})),n.ɵɵelementEnd()}if(2&e){var a=n.ɵɵnextContext();n.ɵɵproperty("label",a.data.removeTextLabel)("ngModel",a.data.removeText)}}var f=function(){},g=function(){function e(e,t){this.dialogRef=e,this.data=t}return e.prototype.closeClick=function(){this.dialogRef.close()},e.prototype.confirmClick=function(){var e,t,n;(null===(e=this.data)||void 0===e?void 0:e.removeTextConfirm)&&(null===(t=this.data)||void 0===t?void 0:t.removeText)!==(null===(n=this.data)||void 0===n?void 0:n.removeTextConfirm)||this.dialogRef.close(this.data)},e.prototype.isConfirmDisabled=function(){var e,t,n;return!!(null===(e=this.data)||void 0===e?void 0:e.removeTextConfirm)&&(null===(t=this.data)||void 0===t?void 0:t.removeText)!==(null===(n=this.data)||void 0===n?void 0:n.removeTextConfirm)},e}();g.ɵfac=function(e){return new(e||g)(n.ɵɵdirectiveInject(t.MatDialogRef),n.ɵɵdirectiveInject(t.MAT_DIALOG_DATA))},g.ɵcmp=n.ɵɵdefineComponent({type:g,selectors:[["confirm-remove-modal-data"]],decls:8,vars:7,consts:[[1,"modal-title"],["mat-dialog-title","",4,"ngIf"],["type","tertiary clickable","name","fas fa-times",3,"title","onClick",4,"ngIf"],["mat-dialog-content","",1,"modal-content"],[3,"innerHTML",4,"ngIf"],[3,"label","ngModel","ngModelChange",4,"ngIf"],["mat-dialog-actions","",1,"modal-actions"],[3,"btnDisabled","icon","label","onClick"],["mat-dialog-title",""],["type","tertiary clickable","name","fas fa-times",3,"title","onClick"],[3,"innerHTML"],[3,"label","ngModel","ngModelChange"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div",0),n.ɵɵtemplate(1,m,2,1,"h3",1),n.ɵɵtemplate(2,s,1,1,"icon",2),n.ɵɵelementEnd(),n.ɵɵelementStart(3,"div",3),n.ɵɵtemplate(4,u,1,1,"p",4),n.ɵɵtemplate(5,p,1,2,"input-text",5),n.ɵɵelementEnd(),n.ɵɵelementStart(6,"div",6),n.ɵɵelementStart(7,"secondary-button",7),n.ɵɵlistener("onClick",(function(){return t.confirmClick()})),n.ɵɵelementEnd(),n.ɵɵelementEnd()),2&e&&(n.ɵɵadvance(1),n.ɵɵproperty("ngIf",t.data.title),n.ɵɵadvance(1),n.ɵɵproperty("ngIf",t.data.showCloseIcon),n.ɵɵadvance(2),n.ɵɵproperty("ngIf",t.data.content),n.ɵɵadvance(1),n.ɵɵproperty("ngIf",t.data.removeTextConfirm),n.ɵɵadvance(2),n.ɵɵproperty("btnDisabled",t.isConfirmDisabled())("icon",t.data.confirmIcon)("label",t.data.confirmText))},directives:[o.NgIf,t.MatDialogContent,t.MatDialogActions,a.SecondaryButtonComponent,t.MatDialogTitle,i.IconComponent,l.InputTextComponent,r.NgControlStatus,r.NgModel],styles:[".modal-title[_ngcontent-%COMP%]{align-items:flex-start;display:flex;justify-content:center;position:relative;width:100%}.modal-title[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-weight:700;margin:0;text-align:center;width:100%}.modal-title[_ngcontent-%COMP%] icon[_ngcontent-%COMP%]{position:absolute;right:-5px;top:-5px}.modal-content[_ngcontent-%COMP%]{border:none!important;margin:20px 0!important;text-align:center!important}.modal-content[_ngcontent-%COMP%] input-text[_ngcontent-%COMP%]{width:80%}.modal-actions[_ngcontent-%COMP%]{align-items:center;display:flex;justify-content:center;width:100%}"]});var M=function(){};M.ɵmod=n.ɵɵdefineNgModule({type:M}),M.ɵinj=n.ɵɵdefineInjector({factory:function(e){return new(e||M)},providers:[],imports:[[o.CommonModule,t.MatDialogModule,d.MatFormFieldModule,r.FormsModule,c.MatInputModule,l.InputsModule,a.ButtonsModule,i.IconsModule]]}),("undefined"==typeof ngJitMode||ngJitMode)&&n.ɵɵsetNgModuleScope(M,{declarations:[g],imports:[o.CommonModule,t.MatDialogModule,d.MatFormFieldModule,r.FormsModule,c.MatInputModule,l.InputsModule,a.ButtonsModule,i.IconsModule],exports:[g]}),Object.keys(t).forEach((function(n){"default"!==n&&Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),e.ConfirmRemoveDialogData=f,e.ConfirmRemoveModalDataComponent=g,e.ModalsModule=M,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=apipass-modals.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../projects/modals/src/lib/confirm-remove-modal.component.ts","../../../projects/modals/src/modals.module.ts"],"names":["ConfirmRemoveModalComponent","dialog","this","title","content","confirmIcon","confirmText","removeTextLabel","removeTextConfirm","showCloseIcon","closeLabel","dialogConfig","DialogConfig","openModal","EventEmitter","confirmModal","closeModal","prototype","ngOnInit","_this","subscribe","item","data","removeText","open","ConfirmRemoveModalDataComponent","afterClosed","result","next","Component","args","selector","template","MatDialog","Input","Output","dialogRef","closeClick","close","confirmClick","_a","_b","_c","isConfirmDisabled","MatDialogRef","Inject","MAT_DIALOG_DATA","NgModule","imports","CommonModule","MatDialogModule","MatFormFieldModule","FormsModule","MatInputModule","InputsModule","ButtonsModule","IconsModule","declarations","exports","entryComponents","providers"],"mappings":"k4BAaA,0BA2DE,SAAAA,EAAmBC,GAAAC,KAAAD,OAAAA,EAfHC,KAAAC,MAAQ,GACRD,KAAAE,QAAU,GACVF,KAAAG,YAAc,GACdH,KAAAI,YAAc,SACdJ,KAAAK,gBAAkB,GAClBL,KAAAM,kBAAoB,GACpBN,KAAAO,eAAgB,EAChBP,KAAAQ,WAAa,QAEbR,KAAAS,aAA6B,IAAIC,EAEjCV,KAAAW,UAA+B,IAAIC,EAAAA,aAClCZ,KAAAa,aAAkC,IAAID,EAAAA,aACtCZ,KAAAc,WAAgC,IAAIF,EAAAA,oBAKrDd,EAAAiB,UAAAC,SAAA,WAAA,IAAAC,EAAAjB,KACEA,KAAKW,UAAUO,WAAU,SAACC,GACxBF,EAAKR,aAAaW,KAAO,CACvBnB,MAAOgB,EAAKhB,MACZC,QAASe,EAAKf,QACdC,YAAac,EAAKd,YAClBC,YAAaa,EAAKb,YAClBiB,WAAY,GACZhB,gBAAiBY,EAAKZ,gBACtBC,kBAAmBW,EAAKX,kBACxBC,cAAeU,EAAKV,cACpBC,WAAYS,EAAKT,WACjBW,KAAIA,GAEYF,EAAKlB,OAAOuB,KAAKC,EAAiCN,EAAKR,cAC/De,cAAcN,WAAU,SAACO,GAC5BA,GACHR,EAAKH,WAAWY,KAAKP,GAElBF,EAAKX,oBAAqBmB,MAAAA,OAAM,EAANA,EAA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AC,EAAAA,aAEFC,aAAc,CACZzD,EACAyB,GAEFiC,QAAS,CACP1D,EACAyB,GAEFkC,gBAAiB,CACflC,GAEFmC,UAAW","sourcesContent":["import {Component, EventEmitter, Inject, Input, OnInit, Output} from '@angular/core';\r\nimport {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material/dialog';\r\nimport {Direction} from '@angular/cdk/bidi';\r\n\r\nexport declare type DialogRole = 'dialog' | 'alertdialog';\r\n\r\nexport interface DialogPosition {\r\n top?: string;\r\n bottom?: string;\r\n left?: string;\r\n right?: string;\r\n}\r\n\r\nexport class DialogConfig {\r\n id?: string;\r\n role?: DialogRole;\r\n panelClass?: string | string[];\r\n hasBackdrop?: boolean;\r\n backdropClass?: string;\r\n disableClose?: boolean;\r\n\r\n width?: string;\r\n height?: string;\r\n minWidth?: number | string;\r\n minHeight?: number | string;\r\n maxWidth?: number | string;\r\n maxHeight?: number | string;\r\n\r\n data?: any;\r\n position?: DialogPosition;\r\n direction?: Direction;\r\n ariaDescribedBy?: string | null;\r\n ariaLabelledBy?: string | null;\r\n ariaLabel?: string | null;\r\n autoFocus?: boolean;\r\n restoreFocus?: boolean;\r\n closeOnNavigation?: boolean;\r\n}\r\n\r\nexport interface DialogData {\r\n title: string;\r\n content: string;\r\n confirmIcon: string;\r\n confirmText: string;\r\n removeText: string;\r\n removeTextLabel: string;\r\n removeTextConfirm: string;\r\n showCloseIcon: boolean;\r\n closeLabel: string;\r\n}\r\n\r\n@Component({\r\n selector: 'confirm-remove-modal',\r\n template: ``\r\n})\r\nexport class ConfirmRemoveModalComponent implements OnInit {\r\n\r\n @Input() public title = '';\r\n @Input() public content = '';\r\n @Input() public confirmIcon = '';\r\n @Input() public confirmText = 'Remove';\r\n @Input() public removeTextLabel = '';\r\n @Input() public removeTextConfirm = '';\r\n @Input() public showCloseIcon = true;\r\n @Input() public closeLabel = 'Close';\r\n\r\n @Input() public dialogConfig: DialogConfig = new DialogConfig();\r\n\r\n @Input() public openModal: EventEmitter<any> = new EventEmitter();\r\n @Output() public confirmModal: EventEmitter<any> = new EventEmitter();\r\n @Output() public closeModal: EventEmitter<any> = new EventEmitter();\r\n\r\n constructor(public dialog: MatDialog) {\r\n }\r\n\r\n ngOnInit(): void {\r\n this.openModal.subscribe((item: any) => {\r\n this.dialogConfig.data = {\r\n title: this.title,\r\n content: this.content,\r\n confirmIcon: this.confirmIcon,\r\n confirmText: this.confirmText,\r\n removeText: '',\r\n removeTextLabel: this.removeTextLabel,\r\n removeTextConfirm: this.removeTextConfirm,\r\n showCloseIcon: this.showCloseIcon,\r\n closeLabel: this.closeLabel,\r\n item\r\n };\r\n const dialogRef = this.dialog.open(ConfirmRemoveModalDataComponent, this.dialogConfig);\r\n dialogRef.afterClosed().subscribe((result: DialogData) => {\r\n if (!result) {\r\n this.closeModal.next(item);\r\n }\r\n if (!this.removeTextConfirm || result?.removeText === this.removeTextConfirm) {\r\n this.confirmModal.next(item);\r\n }\r\n });\r\n });\r\n }\r\n\r\n}\r\n\r\n@Component({\r\n selector: 'confirm-remove-modal-data',\r\n templateUrl: 'confirm-remove-modal.component.html',\r\n styleUrls: ['confirm-remove-modal.component.scss']\r\n})\r\nexport class ConfirmRemoveModalDataComponent {\r\n\r\n constructor(\r\n public dialogRef: MatDialogRef<ConfirmRemoveModalDataComponent>,\r\n @Inject(MAT_DIALOG_DATA) public data: DialogData,\r\n ) {\r\n }\r\n\r\n closeClick(): void {\r\n this.dialogRef.close();\r\n }\r\n\r\n confirmClick(): void {\r\n if (!this.data?.removeTextConfirm || this.data?.removeText === this.data?.removeTextConfirm) {\r\n this.dialogRef.close(this.data);\r\n }\r\n }\r\n\r\n isConfirmDisabled(): boolean {\r\n if (!this.data?.removeTextConfirm) {\r\n return false;\r\n }\r\n return this.data?.removeText !== this.data?.removeTextConfirm;\r\n }\r\n\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\nimport {ConfirmRemoveModalComponent, ConfirmRemoveModalDataComponent} from './lib/confirm-remove-modal.component';\r\nimport {MatDialogModule} from '@angular/material/dialog';\r\nimport {MatFormFieldModule} from '@angular/material/form-field';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {MatInputModule} from '@angular/material/input';\r\nimport {ButtonsModule} from '@apipass/buttons';\r\nimport {IconsModule} from '@apipass/icons';\r\nimport {InputsModule} from '@apipass/inputs';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n FormsModule,\r\n MatInputModule,\r\n InputsModule,\r\n ButtonsModule,\r\n IconsModule,\r\n ],\r\n declarations: [\r\n ConfirmRemoveModalComponent,\r\n ConfirmRemoveModalDataComponent\r\n ],\r\n exports: [\r\n ConfirmRemoveModalComponent,\r\n ConfirmRemoveModalDataComponent\r\n ],\r\n entryComponents: [\r\n ConfirmRemoveModalDataComponent\r\n ],\r\n providers: []\r\n})\r\nexport class ModalsModule { }\r\n"]}
1
+ {"version":3,"sources":["../../../projects/modals/src/lib/confirm-remove-modal.component.html","../../../projects/modals/src/lib/confirm-remove-modal.component.ts","../../../projects/modals/src/modals.module.ts"],"names":["i0.ɵɵelementStart","i0.ɵɵtext","i0.ɵɵelementEnd","i0.ɵɵadvance","i0.ɵɵtextInterpolate1","i0.ɵɵlistener","i0.ɵɵproperty","i0.ɵɵelement","ctx_r3","data","removeText","ConfirmRemoveModalDataComponent","dialogRef","this","prototype","closeClick","close","confirmClick","_a","removeTextConfirm","_b","_c","isConfirmDisabled","i0","ɵɵdirectiveInject","i1","MatDialogRef","MAT_DIALOG_DATA","selectors","decls","vars","consts","template","rf","ctx","i0.ɵɵtemplate","confirmIcon","confirmText","ModalsModule","providers","imports","CommonModule","MatDialogModule","MatFormFieldModule","FormsModule","MatInputModule","InputsModule","ButtonsModule","IconsModule","declarations","exports"],"mappings":"y4BACEA,EAAAA,eAAAA,EAAAA,KAAAA,GACEC,EAAAA,OAAAA,GACFC,EAAAA,6CADEC,EAAAA,UAAAA,GA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AAA,UAAAA,GAAAG,EAAAA,WAAAA,OAAAA,EAAAA,KAAAA,mBAIMH,EAAAA,UAAAA,GAAAG,EAAAA,WAAAA,cAAAA,EAAAA,oBAAAA,CAAmC,OAAA4B,EAAAzB,KAAA2B,YAAnC9B,CAAmC,QAAA4B,EAAAzB,KAAA4B,4yBEiBvD,6CAAaC,iEAAAA,IAAYC,UAFZ,GAAEC,QAAA,CAhBJ,CACPC,EAAAA,aACAC,EAAAA,gBACAC,EAAAA,mBACAC,EAAAA,YACAC,EAAAA,eACAC,EAAAA,aACAC,EAAAA,cACAC,EAAAA,iFAUSV,EAAY,CAAAW,aAAA,CAPrBtC,GAA+B6B,QAAA,CAV/BC,EAAAA,aACAC,EAAAA,gBACAC,EAAAA,mBACAC,EAAAA,YACAC,EAAAA,eACAC,EAAAA,aACAC,EAAAA,cACAC,EAAAA,aAAWE,QAAA,CAMXvC","sourcesContent":["<div class=\"modal-title\">\n <h3 *ngIf=\"data.title\" mat-dialog-title>\n {{data.title}}\n </h3>\n <icon *ngIf=\"data.showCloseIcon\" type=\"tertiary clickable\" name=\"fas fa-times\" [title]=\"data.closeLabel\" (onClick)=\"closeClick()\"></icon>\n</div>\n\n<div class=\"modal-content\" mat-dialog-content>\n <p *ngIf=\"data.content\" [innerHTML]=\"data.content\"></p>\n <input-text *ngIf=\"data.removeTextConfirm\" [label]=\"data.removeTextLabel\" [(ngModel)]=\"data.removeText\"></input-text>\n</div>\n\n<div class=\"modal-actions\" mat-dialog-actions>\n <secondary-button [btnDisabled]=\"isConfirmDisabled()\" [icon]=\"data.confirmIcon\" [label]=\"data.confirmText\" (onClick)=\"confirmClick()\"></secondary-button>\n</div>\n","import {Component, Inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\n\nexport class ConfirmRemoveDialogData {\n title?: string;\n content?: string;\n confirmIcon?: string;\n confirmText?: string;\n removeText?: string;\n removeTextLabel?: string;\n removeTextConfirm?: string;\n showCloseIcon?: boolean;\n closeLabel?: string;\n item?: any;\n}\n\n@Component({\n selector: 'confirm-remove-modal-data',\n templateUrl: 'confirm-remove-modal.component.html',\n styleUrls: ['confirm-remove-modal.component.scss']\n})\nexport class ConfirmRemoveModalDataComponent {\n\n constructor(\n public dialogRef: MatDialogRef<ConfirmRemoveModalDataComponent>,\n @Inject(MAT_DIALOG_DATA) public data: ConfirmRemoveDialogData,\n ) {\n }\n\n closeClick(): void {\n this.dialogRef.close();\n }\n\n confirmClick(): void {\n if (!this.data?.removeTextConfirm || this.data?.removeText === this.data?.removeTextConfirm) {\n this.dialogRef.close(this.data);\n }\n }\n\n isConfirmDisabled(): boolean {\n if (!this.data?.removeTextConfirm) {\n return false;\n }\n return this.data?.removeText !== this.data?.removeTextConfirm;\n }\n\n}\n","import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ConfirmRemoveModalDataComponent} from './lib/confirm-remove-modal.component';\nimport {MatDialogModule} from '@angular/material/dialog';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {FormsModule} from '@angular/forms';\nimport {MatInputModule} from '@angular/material/input';\nimport {ButtonsModule} from '@apipass/buttons';\nimport {IconsModule} from '@apipass/icons';\nimport {InputsModule} from '@apipass/inputs';\n\n@NgModule({\n imports: [\n CommonModule,\n MatDialogModule,\n MatFormFieldModule,\n FormsModule,\n MatInputModule,\n InputsModule,\n ButtonsModule,\n IconsModule,\n ],\n declarations: [\n ConfirmRemoveModalDataComponent\n ],\n exports: [\n ConfirmRemoveModalDataComponent\n ],\n providers: []\n})\nexport class ModalsModule { }\n"]}
@@ -1,5 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public-api';
5
5
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpcGFzcy1tb2RhbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9tb2RhbHMvc3JjL2FwaXBhc3MtbW9kYWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0=