@apipass/modals 0.1.4 → 0.1.8
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/apipass-modals.metadata.json +1 -1
- package/bundles/apipass-modals.umd.js +17 -82
- package/bundles/apipass-modals.umd.js.map +1 -1
- package/bundles/apipass-modals.umd.min.js +1 -1
- package/bundles/apipass-modals.umd.min.js.map +1 -1
- package/esm2015/lib/confirm-remove-modal.component.js +5 -70
- package/esm2015/modals.module.js +2 -7
- package/esm2015/public-api.js +2 -1
- package/fesm2015/apipass-modals.js +6 -75
- package/fesm2015/apipass-modals.js.map +1 -1
- package/lib/confirm-remove-modal.component.d.ts +14 -62
- package/package.json +10 -10
- package/public-api.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"ModalsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":13,"character":4},{"__symbolic":"reference","module":"@angular/material/dialog","name":"MatDialogModule","line":14,"character":4},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":15,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":16,"character":4},{"__symbolic":"reference","module":"@angular/material/input","name":"MatInputModule","line":17,"character":4},{"__symbolic":"reference","module":"@apipass/inputs","name":"InputsModule","line":18,"character":4},{"__symbolic":"reference","module":"@apipass/buttons","name":"ButtonsModule","line":19,"character":4},{"__symbolic":"reference","module":"@apipass/icons","name":"IconsModule","line":20,"character":4}],"declarations":[{"__symbolic":"reference","name":"
|
|
1
|
+
{"__symbolic":"module","version":4,"exports":[{"from":"@angular/material/dialog"}],"metadata":{"ModalsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":13,"character":4},{"__symbolic":"reference","module":"@angular/material/dialog","name":"MatDialogModule","line":14,"character":4},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":15,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":16,"character":4},{"__symbolic":"reference","module":"@angular/material/input","name":"MatInputModule","line":17,"character":4},{"__symbolic":"reference","module":"@apipass/inputs","name":"InputsModule","line":18,"character":4},{"__symbolic":"reference","module":"@apipass/buttons","name":"ButtonsModule","line":19,"character":4},{"__symbolic":"reference","module":"@apipass/icons","name":"IconsModule","line":20,"character":4}],"declarations":[{"__symbolic":"reference","name":"ConfirmRemoveModalDataComponent"}],"exports":[{"__symbolic":"reference","name":"ConfirmRemoveModalDataComponent"}],"providers":[]}]}],"members":{}},"ConfirmRemoveDialogData":{"__symbolic":"class","members":{}},"ConfirmRemoveModalDataComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":16,"character":1},"arguments":[{"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%}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":25,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/material/dialog","name":"MAT_DIALOG_DATA","line":25,"character":12}]}]],"parameters":[{"__symbolic":"reference","name":"MatDialogRef","module":"@angular/material/dialog","arguments":[{"__symbolic":"reference","name":"ConfirmRemoveModalDataComponent"}]},{"__symbolic":"reference","name":"ConfirmRemoveDialogData"}]}],"closeClick":[{"__symbolic":"method"}],"confirmClick":[{"__symbolic":"method"}],"isConfirmDisabled":[{"__symbolic":"method"}]}}},"origins":{"ModalsModule":"./modals.module","ConfirmRemoveDialogData":"./lib/confirm-remove-modal.component","ConfirmRemoveModalDataComponent":"./lib/confirm-remove-modal.component"},"importAs":"@apipass/modals"}
|
|
@@ -1,81 +1,14 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@apipass/modals', ['exports', '@angular/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.apipass = global.apipass || {}, global.apipass.modals = {}), global.ng.
|
|
5
|
-
}(this, (function (exports, core, common,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/material/dialog'), require('@angular/core'), require('@angular/common'), 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/material/dialog', '@angular/core', '@angular/common', '@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.material.dialog, global.ng.core, global.ng.common, global.ng.material.formField, global.ng.forms, global.ng.material.input, global.buttons, global.icons, global.inputs));
|
|
5
|
+
}(this, (function (exports, dialog, core, common, formField, forms, input, buttons, icons, inputs) { 'use strict';
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
function
|
|
7
|
+
var ConfirmRemoveDialogData = /** @class */ (function () {
|
|
8
|
+
function ConfirmRemoveDialogData() {
|
|
9
9
|
}
|
|
10
|
-
return
|
|
10
|
+
return ConfirmRemoveDialogData;
|
|
11
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
12
|
var ConfirmRemoveModalDataComponent = /** @class */ (function () {
|
|
80
13
|
function ConfirmRemoveModalDataComponent(dialogRef, data) {
|
|
81
14
|
this.dialogRef = dialogRef;
|
|
@@ -108,7 +41,7 @@
|
|
|
108
41
|
];
|
|
109
42
|
ConfirmRemoveModalDataComponent.ctorParameters = function () { return [
|
|
110
43
|
{ type: dialog.MatDialogRef },
|
|
111
|
-
{ type:
|
|
44
|
+
{ type: ConfirmRemoveDialogData, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
|
|
112
45
|
]; };
|
|
113
46
|
|
|
114
47
|
var ModalsModule = /** @class */ (function () {
|
|
@@ -129,14 +62,9 @@
|
|
|
129
62
|
icons.IconsModule,
|
|
130
63
|
],
|
|
131
64
|
declarations: [
|
|
132
|
-
ConfirmRemoveModalComponent,
|
|
133
65
|
ConfirmRemoveModalDataComponent
|
|
134
66
|
],
|
|
135
67
|
exports: [
|
|
136
|
-
ConfirmRemoveModalComponent,
|
|
137
|
-
ConfirmRemoveModalDataComponent
|
|
138
|
-
],
|
|
139
|
-
entryComponents: [
|
|
140
68
|
ConfirmRemoveModalDataComponent
|
|
141
69
|
],
|
|
142
70
|
providers: []
|
|
@@ -147,9 +75,16 @@
|
|
|
147
75
|
* Generated bundle index. Do not edit.
|
|
148
76
|
*/
|
|
149
77
|
|
|
150
|
-
|
|
78
|
+
Object.keys(dialog).forEach(function (k) {
|
|
79
|
+
if (k !== 'default') Object.defineProperty(exports, k, {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function () {
|
|
82
|
+
return dialog[k];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
exports.ConfirmRemoveDialogData = ConfirmRemoveDialogData;
|
|
151
87
|
exports.ConfirmRemoveModalDataComponent = ConfirmRemoveModalDataComponent;
|
|
152
|
-
exports.DialogConfig = DialogConfig;
|
|
153
88
|
exports.ModalsModule = ModalsModule;
|
|
154
89
|
|
|
155
90
|
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,
|
|
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, Inject} from '@angular/core';\r\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\r\n\r\nexport class ConfirmRemoveDialogData {\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 item?: any;\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: ConfirmRemoveDialogData,\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 {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 ConfirmRemoveModalDataComponent\r\n ],\r\n exports: [\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":["Component","MatDialogRef","Inject","MAT_DIALOG_DATA","NgModule","CommonModule","MatDialogModule","MatFormFieldModule","FormsModule","MatInputModule","InputsModule","ButtonsModule","IconsModule"],"mappings":";;;;;;;QAGA;SAWC;sCAAA;KAAA,IAAA;;QASC,yCACS,SAAwD,EAC/B,IAA6B;YADtD,cAAS,GAAT,SAAS,CAA+C;YAC/B,SAAI,GAAJ,IAAI,CAAyB;SAE9D;QAED,oDAAU,GAAV;YACE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;SACxB;QAED,sDAAY,GAAZ;;YACE,IAAI,QAAC,IAAI,CAAC,IAAI,0CAAE,iBAAiB,CAAA,IAAI,OAAA,IAAI,CAAC,IAAI,0CAAE,UAAU,aAAK,IAAI,CAAC,IAAI,0CAAE,iBAAiB,CAAA,EAAE;gBAC3F,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACjC;SACF;QAED,2DAAiB,GAAjB;;YACE,IAAI,QAAC,IAAI,CAAC,IAAI,0CAAE,iBAAiB,CAAA,EAAE;gBACjC,OAAO,KAAK,CAAC;aACd;YACD,OAAO,OAAA,IAAI,CAAC,IAAI,0CAAE,UAAU,aAAK,IAAI,CAAC,IAAI,0CAAE,iBAAiB,CAAA,CAAC;SAC/D;;;;gBA5BFA,cAAS,SAAC;oBACT,QAAQ,EAAE,2BAA2B;oBACrC,4wBAAkD;;iBAEnD;;;gBAnBwBC,mBAAY;gBAwBK,uBAAuB,uBAA5DC,WAAM,SAACC,sBAAe;;;;QCK3B;;;;;gBAnBCC,aAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;wBACZC,sBAAe;wBACfC,4BAAkB;wBAClBC,iBAAW;wBACXC,oBAAc;wBACdC,mBAAY;wBACZC,qBAAa;wBACbC,iBAAW;qBACZ;oBACD,YAAY,EAAE;wBACZ,+BAA+B;qBAChC;oBACD,OAAO,EAAE;wBACP,+BAA+B;qBAChC;oBACD,SAAS,EAAE,EAAE;iBACd;;;IC7BD;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/material/dialog"),require("@angular/core"),require("@angular/common"),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/material/dialog","@angular/core","@angular/common","@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.material.dialog,t.ng.core,t.ng.common,t.ng.material.formField,t.ng.forms,t.ng.material.input,t.buttons,t.icons,t.inputs)}(this,(function(t,e,a,o,i,n,r,l,s,d){"use strict";var m=function(){},u=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,a;(null===(t=this.data)||void 0===t?void 0:t.removeTextConfirm)&&(null===(e=this.data)||void 0===e?void 0:e.removeText)!==(null===(a=this.data)||void 0===a?void 0:a.removeTextConfirm)||this.dialogRef.close(this.data)},t.prototype.isConfirmDisabled=function(){var t,e,a;return!!(null===(t=this.data)||void 0===t?void 0:t.removeTextConfirm)&&(null===(e=this.data)||void 0===e?void 0:e.removeText)!==(null===(a=this.data)||void 0===a?void 0:a.removeTextConfirm)},t}();u.decorators=[{type:a.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%}"]}]}],u.ctorParameters=function(){return[{type:e.MatDialogRef},{type:m,decorators:[{type:a.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var c=function(){};c.decorators=[{type:a.NgModule,args:[{imports:[o.CommonModule,e.MatDialogModule,i.MatFormFieldModule,n.FormsModule,r.MatInputModule,d.InputsModule,l.ButtonsModule,s.IconsModule],declarations:[u],exports:[u],providers:[]}]}],Object.keys(e).forEach((function(a){"default"!==a&&Object.defineProperty(t,a,{enumerable:!0,get:function(){return e[a]}})})),t.ConfirmRemoveDialogData=m,t.ConfirmRemoveModalDataComponent=u,t.ModalsModule=c,Object.defineProperty(t,"__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":["
|
|
1
|
+
{"version":3,"sources":["../../../projects/modals/src/lib/confirm-remove-modal.component.ts","../../../projects/modals/src/modals.module.ts"],"names":["ConfirmRemoveModalDataComponent","dialogRef","data","this","prototype","closeClick","close","confirmClick","_a","removeTextConfirm","_b","removeText","_c","isConfirmDisabled","Component","args","selector","template","MatDialogRef","ConfirmRemoveDialogData","decorators","type","Inject","MAT_DIALOG_DATA","NgModule","imports","CommonModule","MatDialogModule","MatFormFieldModule","FormsModule","MatInputModule","InputsModule","ButtonsModule","IconsModule","declarations","exports","providers"],"mappings":"k4BAGA,0BAoBE,SAAAA,EACSC,EACyBC,GADzBC,KAAAF,UAAAA,EACyBE,KAAAD,KAAAA,SAIlCF,EAAAI,UAAAC,WAAA,WACEF,KAAKF,UAAUK,SAGjBN,EAAAI,UAAAG,aAAA,sBACgB,QAAVC,EAACL,KAAKD,YAAI,IAAAM,OAAA,EAAAA,EAAEC,qBAA8B,QAATC,EAAAP,KAAKD,YAAI,IAAAQ,OAAA,EAAAA,EAAEC,eAAwB,QAAdC,EAAKT,KAAKD,YAAI,IAAAU,OAAA,EAAAA,EAAEH,oBACxEN,KAAKF,UAAUK,MAAMH,KAAKD,OAI9BF,EAAAI,UAAAS,kBAAA,qBACE,SAAc,QAAVL,EAACL,KAAKD,YAAI,IAAAM,OAAA,EAAAA,EAAEC,qBAGA,QAATC,EAAAP,KAAKD,YAAI,IAAAQ,OAAA,EAAAA,EAAEC,eAAwB,QAAdC,EAAKT,KAAKD,YAAI,IAAAU,OAAA,EAAAA,EAAEH,6CA3B/CK,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,4BACVC,SAAA,8tCAjBuBC,EAAAA,oBAwBiBC,EAAuBC,WAAA,CAAA,CAAAC,KAA5DC,EAAAA,OAAMP,KAAA,CAACQ,EAAAA,4BCKZ,iCAnBCC,EAAAA,SAAQT,KAAA,CAAC,CACRU,QAAS,CACPC,EAAAA,aACAC,EAAAA,gBACAC,EAAAA,mBACAC,EAAAA,YACAC,EAAAA,eACAC,EAAAA,aACAC,EAAAA,cACAC,EAAAA,aAEFC,aAAc,CACZlC,GAEFmC,QAAS,CACPnC,GAEFoC,UAAW","sourcesContent":["import {Component, Inject} from '@angular/core';\r\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\r\n\r\nexport class ConfirmRemoveDialogData {\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 item?: any;\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: ConfirmRemoveDialogData,\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 {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 ConfirmRemoveModalDataComponent\r\n ],\r\n exports: [\r\n ConfirmRemoveModalDataComponent\r\n ],\r\n providers: []\r\n})\r\nexport class ModalsModule { }\r\n"]}
|
|
@@ -1,72 +1,7 @@
|
|
|
1
|
-
import { Component,
|
|
2
|
-
import { MAT_DIALOG_DATA,
|
|
3
|
-
export class
|
|
1
|
+
import { Component, Inject } from '@angular/core';
|
|
2
|
+
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
export class ConfirmRemoveDialogData {
|
|
4
4
|
}
|
|
5
|
-
export class ConfirmRemoveModalComponent {
|
|
6
|
-
constructor(dialog) {
|
|
7
|
-
this.dialog = dialog;
|
|
8
|
-
this.title = '';
|
|
9
|
-
this.content = '';
|
|
10
|
-
this.confirmIcon = '';
|
|
11
|
-
this.confirmText = 'Remove';
|
|
12
|
-
this.removeTextLabel = '';
|
|
13
|
-
this.removeTextConfirm = '';
|
|
14
|
-
this.showCloseIcon = true;
|
|
15
|
-
this.closeLabel = 'Close';
|
|
16
|
-
this.dialogConfig = new DialogConfig();
|
|
17
|
-
this.openModal = new EventEmitter();
|
|
18
|
-
this.confirmModal = new EventEmitter();
|
|
19
|
-
this.closeModal = new EventEmitter();
|
|
20
|
-
}
|
|
21
|
-
ngOnInit() {
|
|
22
|
-
this.openModal.subscribe((item) => {
|
|
23
|
-
this.dialogConfig.data = {
|
|
24
|
-
title: this.title,
|
|
25
|
-
content: this.content,
|
|
26
|
-
confirmIcon: this.confirmIcon,
|
|
27
|
-
confirmText: this.confirmText,
|
|
28
|
-
removeText: '',
|
|
29
|
-
removeTextLabel: this.removeTextLabel,
|
|
30
|
-
removeTextConfirm: this.removeTextConfirm,
|
|
31
|
-
showCloseIcon: this.showCloseIcon,
|
|
32
|
-
closeLabel: this.closeLabel,
|
|
33
|
-
item
|
|
34
|
-
};
|
|
35
|
-
const dialogRef = this.dialog.open(ConfirmRemoveModalDataComponent, this.dialogConfig);
|
|
36
|
-
dialogRef.afterClosed().subscribe((result) => {
|
|
37
|
-
if (!result) {
|
|
38
|
-
this.closeModal.next(item);
|
|
39
|
-
}
|
|
40
|
-
if (!this.removeTextConfirm || (result === null || result === void 0 ? void 0 : result.removeText) === this.removeTextConfirm) {
|
|
41
|
-
this.confirmModal.next(item);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
ConfirmRemoveModalComponent.decorators = [
|
|
48
|
-
{ type: Component, args: [{
|
|
49
|
-
selector: 'confirm-remove-modal',
|
|
50
|
-
template: ``
|
|
51
|
-
},] }
|
|
52
|
-
];
|
|
53
|
-
ConfirmRemoveModalComponent.ctorParameters = () => [
|
|
54
|
-
{ type: MatDialog }
|
|
55
|
-
];
|
|
56
|
-
ConfirmRemoveModalComponent.propDecorators = {
|
|
57
|
-
title: [{ type: Input }],
|
|
58
|
-
content: [{ type: Input }],
|
|
59
|
-
confirmIcon: [{ type: Input }],
|
|
60
|
-
confirmText: [{ type: Input }],
|
|
61
|
-
removeTextLabel: [{ type: Input }],
|
|
62
|
-
removeTextConfirm: [{ type: Input }],
|
|
63
|
-
showCloseIcon: [{ type: Input }],
|
|
64
|
-
closeLabel: [{ type: Input }],
|
|
65
|
-
dialogConfig: [{ type: Input }],
|
|
66
|
-
openModal: [{ type: Input }],
|
|
67
|
-
confirmModal: [{ type: Output }],
|
|
68
|
-
closeModal: [{ type: Output }]
|
|
69
|
-
};
|
|
70
5
|
export class ConfirmRemoveModalDataComponent {
|
|
71
6
|
constructor(dialogRef, data) {
|
|
72
7
|
this.dialogRef = dialogRef;
|
|
@@ -98,6 +33,6 @@ ConfirmRemoveModalDataComponent.decorators = [
|
|
|
98
33
|
];
|
|
99
34
|
ConfirmRemoveModalDataComponent.ctorParameters = () => [
|
|
100
35
|
{ type: MatDialogRef },
|
|
101
|
-
{ type:
|
|
36
|
+
{ type: ConfirmRemoveDialogData, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
|
|
102
37
|
];
|
|
103
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
38
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlybS1yZW1vdmUtbW9kYWwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbW9kYWxzL3NyYy9saWIvY29uZmlybS1yZW1vdmUtbW9kYWwuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQUUsTUFBTSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ2hELE9BQU8sRUFBQyxlQUFlLEVBQUUsWUFBWSxFQUFDLE1BQU0sMEJBQTBCLENBQUM7QUFFdkUsTUFBTSxPQUFPLHVCQUF1QjtDQVduQztBQU9ELE1BQU0sT0FBTywrQkFBK0I7SUFFMUMsWUFDUyxTQUF3RCxFQUMvQixJQUE2QjtRQUR0RCxjQUFTLEdBQVQsU0FBUyxDQUErQztRQUMvQixTQUFJLEdBQUosSUFBS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leHQgPT09IHRoaXMuZGF0YT8ucmVtb3ZlVGV4dENvbmZpcm0pIHtcclxuICAgICAgdGhpcy5kaWFsb2dSZWYuY2xvc2UodGhpcy5kYXRhKTtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIGlzQ29uZmlybURpc2FibGVkKCk6IGJvb2xlYW4ge1xyXG4gICAgaWYgKCF0aGlzLmRhdGE/LnJlbW92ZVRleHRDb25maXJtKSB7XHJcbiAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH1cclxuICAgIHJldHVybiB0aGlzLmRhdGE/LnJlbW92ZVRleHQgIT09IHRoaXMuZGF0YT8ucmVtb3ZlVGV4dENvbmZpcm07XHJcbiAgfVxyXG5cclxufVxyXG4iXX0=
|
package/esm2015/modals.module.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import {
|
|
3
|
+
import { ConfirmRemoveModalDataComponent } from './lib/confirm-remove-modal.component';
|
|
4
4
|
import { MatDialogModule } from '@angular/material/dialog';
|
|
5
5
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
@@ -23,17 +23,12 @@ ModalsModule.decorators = [
|
|
|
23
23
|
IconsModule,
|
|
24
24
|
],
|
|
25
25
|
declarations: [
|
|
26
|
-
ConfirmRemoveModalComponent,
|
|
27
26
|
ConfirmRemoveModalDataComponent
|
|
28
27
|
],
|
|
29
28
|
exports: [
|
|
30
|
-
ConfirmRemoveModalComponent,
|
|
31
|
-
ConfirmRemoveModalDataComponent
|
|
32
|
-
],
|
|
33
|
-
entryComponents: [
|
|
34
29
|
ConfirmRemoveModalDataComponent
|
|
35
30
|
],
|
|
36
31
|
providers: []
|
|
37
32
|
},] }
|
|
38
33
|
];
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJza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GUsXHJcbiAgICBJY29uc01vZHVsZSxcclxuICBdLFxyXG4gIGRlY2xhcmF0aW9uczogW1xyXG4gICAgQ29uZmlybVJlbW92ZU1vZGFsRGF0YUNvbXBvbmVudFxyXG4gIF0sXHJcbiAgZXhwb3J0czogW1xyXG4gICAgQ29uZmlybVJlbW92ZU1vZGFsRGF0YUNvbXBvbmVudFxyXG4gIF0sXHJcbiAgcHJvdmlkZXJzOiBbXVxyXG59KVxyXG5leHBvcnQgY2xhc3MgTW9kYWxzTW9kdWxlIHsgfVxyXG4iXX0=
|
package/esm2015/public-api.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from '@angular/material/dialog';
|
|
1
2
|
export * from './modals.module';
|
|
2
3
|
export * from './lib/confirm-remove-modal.component';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL21vZGFscy9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDBCQUEwQixDQUFBO0FBQ3hDLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxzQ0FBc0MsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJ0Bhbmd1bGFyL21hdGVyaWFsL2RpYWxvZydcbmV4cG9ydCAqIGZyb20gJy4vbW9kYWxzLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb25maXJtLXJlbW92ZS1tb2RhbC5jb21wb25lbnQnO1xuIl19
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
2
|
+
export * from '@angular/material/dialog';
|
|
3
|
+
import { Component, Inject, NgModule } from '@angular/core';
|
|
2
4
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
4
5
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
5
6
|
import { FormsModule } from '@angular/forms';
|
|
6
7
|
import { MatInputModule } from '@angular/material/input';
|
|
@@ -8,73 +9,8 @@ import { ButtonsModule } from '@apipass/buttons';
|
|
|
8
9
|
import { IconsModule } from '@apipass/icons';
|
|
9
10
|
import { InputsModule } from '@apipass/inputs';
|
|
10
11
|
|
|
11
|
-
class
|
|
12
|
+
class ConfirmRemoveDialogData {
|
|
12
13
|
}
|
|
13
|
-
class ConfirmRemoveModalComponent {
|
|
14
|
-
constructor(dialog) {
|
|
15
|
-
this.dialog = dialog;
|
|
16
|
-
this.title = '';
|
|
17
|
-
this.content = '';
|
|
18
|
-
this.confirmIcon = '';
|
|
19
|
-
this.confirmText = 'Remove';
|
|
20
|
-
this.removeTextLabel = '';
|
|
21
|
-
this.removeTextConfirm = '';
|
|
22
|
-
this.showCloseIcon = true;
|
|
23
|
-
this.closeLabel = 'Close';
|
|
24
|
-
this.dialogConfig = new DialogConfig();
|
|
25
|
-
this.openModal = new EventEmitter();
|
|
26
|
-
this.confirmModal = new EventEmitter();
|
|
27
|
-
this.closeModal = new EventEmitter();
|
|
28
|
-
}
|
|
29
|
-
ngOnInit() {
|
|
30
|
-
this.openModal.subscribe((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
|
|
42
|
-
};
|
|
43
|
-
const dialogRef = this.dialog.open(ConfirmRemoveModalDataComponent, this.dialogConfig);
|
|
44
|
-
dialogRef.afterClosed().subscribe((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
|
-
}
|
|
55
|
-
ConfirmRemoveModalComponent.decorators = [
|
|
56
|
-
{ type: Component, args: [{
|
|
57
|
-
selector: 'confirm-remove-modal',
|
|
58
|
-
template: ``
|
|
59
|
-
},] }
|
|
60
|
-
];
|
|
61
|
-
ConfirmRemoveModalComponent.ctorParameters = () => [
|
|
62
|
-
{ type: MatDialog }
|
|
63
|
-
];
|
|
64
|
-
ConfirmRemoveModalComponent.propDecorators = {
|
|
65
|
-
title: [{ type: Input }],
|
|
66
|
-
content: [{ type: Input }],
|
|
67
|
-
confirmIcon: [{ type: Input }],
|
|
68
|
-
confirmText: [{ type: Input }],
|
|
69
|
-
removeTextLabel: [{ type: Input }],
|
|
70
|
-
removeTextConfirm: [{ type: Input }],
|
|
71
|
-
showCloseIcon: [{ type: Input }],
|
|
72
|
-
closeLabel: [{ type: Input }],
|
|
73
|
-
dialogConfig: [{ type: Input }],
|
|
74
|
-
openModal: [{ type: Input }],
|
|
75
|
-
confirmModal: [{ type: Output }],
|
|
76
|
-
closeModal: [{ type: Output }]
|
|
77
|
-
};
|
|
78
14
|
class ConfirmRemoveModalDataComponent {
|
|
79
15
|
constructor(dialogRef, data) {
|
|
80
16
|
this.dialogRef = dialogRef;
|
|
@@ -106,7 +42,7 @@ ConfirmRemoveModalDataComponent.decorators = [
|
|
|
106
42
|
];
|
|
107
43
|
ConfirmRemoveModalDataComponent.ctorParameters = () => [
|
|
108
44
|
{ type: MatDialogRef },
|
|
109
|
-
{ type:
|
|
45
|
+
{ type: ConfirmRemoveDialogData, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
|
|
110
46
|
];
|
|
111
47
|
|
|
112
48
|
class ModalsModule {
|
|
@@ -124,14 +60,9 @@ ModalsModule.decorators = [
|
|
|
124
60
|
IconsModule,
|
|
125
61
|
],
|
|
126
62
|
declarations: [
|
|
127
|
-
ConfirmRemoveModalComponent,
|
|
128
63
|
ConfirmRemoveModalDataComponent
|
|
129
64
|
],
|
|
130
65
|
exports: [
|
|
131
|
-
ConfirmRemoveModalComponent,
|
|
132
|
-
ConfirmRemoveModalDataComponent
|
|
133
|
-
],
|
|
134
|
-
entryComponents: [
|
|
135
66
|
ConfirmRemoveModalDataComponent
|
|
136
67
|
],
|
|
137
68
|
providers: []
|
|
@@ -142,5 +73,5 @@ ModalsModule.decorators = [
|
|
|
142
73
|
* Generated bundle index. Do not edit.
|
|
143
74
|
*/
|
|
144
75
|
|
|
145
|
-
export {
|
|
76
|
+
export { ConfirmRemoveDialogData, ConfirmRemoveModalDataComponent, ModalsModule };
|
|
146
77
|
//# sourceMappingURL=apipass-modals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apipass-modals.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,
|
|
1
|
+
{"version":3,"file":"apipass-modals.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, Inject} from '@angular/core';\r\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\r\n\r\nexport class ConfirmRemoveDialogData {\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 item?: any;\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: ConfirmRemoveDialogData,\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 {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 ConfirmRemoveModalDataComponent\r\n ],\r\n exports: [\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":[],"mappings":";;;;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|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
role?: DialogRole;
|
|
14
|
-
panelClass?: string | string[];
|
|
15
|
-
hasBackdrop?: boolean;
|
|
16
|
-
backdropClass?: string;
|
|
17
|
-
disableClose?: boolean;
|
|
18
|
-
width?: string;
|
|
19
|
-
height?: string;
|
|
20
|
-
minWidth?: number | string;
|
|
21
|
-
minHeight?: number | string;
|
|
22
|
-
maxWidth?: number | string;
|
|
23
|
-
maxHeight?: number | string;
|
|
24
|
-
data?: any;
|
|
25
|
-
position?: DialogPosition;
|
|
26
|
-
direction?: Direction;
|
|
27
|
-
ariaDescribedBy?: string | null;
|
|
28
|
-
ariaLabelledBy?: string | null;
|
|
29
|
-
ariaLabel?: string | null;
|
|
30
|
-
autoFocus?: boolean;
|
|
31
|
-
restoreFocus?: boolean;
|
|
32
|
-
closeOnNavigation?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface DialogData {
|
|
35
|
-
title: string;
|
|
36
|
-
content: string;
|
|
37
|
-
confirmIcon: string;
|
|
38
|
-
confirmText: string;
|
|
39
|
-
removeText: string;
|
|
40
|
-
removeTextLabel: string;
|
|
41
|
-
removeTextConfirm: string;
|
|
42
|
-
showCloseIcon: boolean;
|
|
43
|
-
closeLabel: string;
|
|
44
|
-
}
|
|
45
|
-
export declare class ConfirmRemoveModalComponent implements OnInit {
|
|
46
|
-
dialog: MatDialog;
|
|
47
|
-
title: string;
|
|
48
|
-
content: string;
|
|
49
|
-
confirmIcon: string;
|
|
50
|
-
confirmText: string;
|
|
51
|
-
removeTextLabel: string;
|
|
52
|
-
removeTextConfirm: string;
|
|
53
|
-
showCloseIcon: boolean;
|
|
54
|
-
closeLabel: string;
|
|
55
|
-
dialogConfig: DialogConfig;
|
|
56
|
-
openModal: EventEmitter<any>;
|
|
57
|
-
confirmModal: EventEmitter<any>;
|
|
58
|
-
closeModal: EventEmitter<any>;
|
|
59
|
-
constructor(dialog: MatDialog);
|
|
60
|
-
ngOnInit(): void;
|
|
1
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
2
|
+
export declare class ConfirmRemoveDialogData {
|
|
3
|
+
title?: string;
|
|
4
|
+
content?: string;
|
|
5
|
+
confirmIcon?: string;
|
|
6
|
+
confirmText?: string;
|
|
7
|
+
removeText?: string;
|
|
8
|
+
removeTextLabel?: string;
|
|
9
|
+
removeTextConfirm?: string;
|
|
10
|
+
showCloseIcon?: boolean;
|
|
11
|
+
closeLabel?: string;
|
|
12
|
+
item?: any;
|
|
61
13
|
}
|
|
62
14
|
export declare class ConfirmRemoveModalDataComponent {
|
|
63
15
|
dialogRef: MatDialogRef<ConfirmRemoveModalDataComponent>;
|
|
64
|
-
data:
|
|
65
|
-
constructor(dialogRef: MatDialogRef<ConfirmRemoveModalDataComponent>, data:
|
|
16
|
+
data: ConfirmRemoveDialogData;
|
|
17
|
+
constructor(dialogRef: MatDialogRef<ConfirmRemoveModalDataComponent>, data: ConfirmRemoveDialogData);
|
|
66
18
|
closeClick(): void;
|
|
67
19
|
confirmClick(): void;
|
|
68
20
|
isConfirmDisabled(): boolean;
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apipass/modals",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/animations": "10.0.11",
|
|
6
|
-
"@angular/cdk": "10.
|
|
7
|
-
"@angular/common": "10.0.11",
|
|
8
|
-
"@angular/core": "10.0.11",
|
|
9
|
-
"@angular/forms": "10.0.11"
|
|
5
|
+
"@angular/animations": "^10.0.11",
|
|
6
|
+
"@angular/cdk": "^10.1.3",
|
|
7
|
+
"@angular/common": "^10.0.11",
|
|
8
|
+
"@angular/core": "^10.0.11",
|
|
9
|
+
"@angular/forms": "^10.0.11"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@angular/material": "10.
|
|
13
|
-
"@apipass/buttons": "^0.1.
|
|
14
|
-
"@apipass/icons": "^0.1.
|
|
15
|
-
"@apipass/inputs": "^0.1.
|
|
12
|
+
"@angular/material": "^10.1.3",
|
|
13
|
+
"@apipass/buttons": "^0.1.4",
|
|
14
|
+
"@apipass/icons": "^0.1.4",
|
|
15
|
+
"@apipass/inputs": "^0.1.4",
|
|
16
16
|
"tslib": "2.0.0"
|
|
17
17
|
},
|
|
18
18
|
"main": "bundles/apipass-modals.umd.js",
|
package/public-api.d.ts
CHANGED