88437a61e7e532980c45847d3ce249a03580063a6b9b397fa9d67e7b260a5dd3.json raw
1 {"ast":null,"code":"import { EventEmitter } from '@angular/core';\nimport * as bootstrap from 'bootstrap';\nimport * as i0 from \"@angular/core\";\nexport let ConfirmComponent = /*#__PURE__*/(() => {\n class ConfirmComponent {\n yes = new EventEmitter();\n no = new EventEmitter();\n message;\n onYes;\n modal;\n idString = crypto.randomUUID();\n ngAfterViewInit() {\n const myModalEl = document.getElementById(this.idString);\n if (!myModalEl) {\n return;\n }\n this.modal = new bootstrap.Modal(myModalEl);\n }\n onClickYes() {\n this.modal?.hide();\n if (typeof this.onYes !== 'undefined') {\n this.onYes();\n }\n }\n show(message, onYes) {\n this.message = message;\n this.onYes = onYes;\n this.modal?.show();\n }\n static ɵfac = function ConfirmComponent_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ConfirmComponent)();\n };\n static ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n type: ConfirmComponent,\n selectors: [[\"lib-confirm\"]],\n outputs: {\n yes: \"yes\",\n no: \"no\"\n },\n decls: 15,\n vars: 2,\n consts: [[\"data-bs-backdrop\", \"static\", \"tabindex\", \"-1\", 1, \"modal\", \"fade\", 3, \"id\"], [1, \"modal-dialog\", \"modal-sm\", \"modal-dialog-centered\", \"modal-dialog-scrollable\"], [1, \"modal-content\"], [1, \"modal-header\"], [1, \"modal-title\"], [\"type\", \"button\", 1, \"btn-close\", 3, \"click\"], [1, \"modal-body\"], [1, \"modal-footer\"], [\"type\", \"button\", 1, \"btn\", \"btn-secondary\", 3, \"click\"], [\"type\", \"button\", 1, \"btn\", \"btn-primary\", 3, \"click\"]],\n template: function ConfirmComponent_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 0)(1, \"div\", 1)(2, \"div\", 2)(3, \"div\", 3)(4, \"h5\", 4);\n i0.ɵɵtext(5, \"Please confirm\");\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(6, \"button\", 5);\n i0.ɵɵlistener(\"click\", function ConfirmComponent_Template_button_click_6_listener() {\n ctx.modal == null ? null : ctx.modal.hide();\n return ctx.no.emit();\n });\n i0.ɵɵelementEnd()();\n i0.ɵɵelementStart(7, \"div\", 6)(8, \"span\");\n i0.ɵɵtext(9);\n i0.ɵɵelementEnd()();\n i0.ɵɵelementStart(10, \"div\", 7)(11, \"button\", 8);\n i0.ɵɵlistener(\"click\", function ConfirmComponent_Template_button_click_11_listener() {\n return ctx.modal == null ? null : ctx.modal.hide();\n });\n i0.ɵɵtext(12, \" No \");\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(13, \"button\", 9);\n i0.ɵɵlistener(\"click\", function ConfirmComponent_Template_button_click_13_listener() {\n return ctx.onClickYes();\n });\n i0.ɵɵtext(14, \" Yes \");\n i0.ɵɵelementEnd()()()()();\n }\n if (rf & 2) {\n i0.ɵɵproperty(\"id\", ctx.idString);\n i0.ɵɵadvance(9);\n i0.ɵɵtextInterpolate(ctx.message);\n }\n },\n styles: [\"[_nghost-%COMP%] .modal[_ngcontent-%COMP%] {\\n --bs-modal-margin: 32px;\\n}\"]\n });\n }\n return ConfirmComponent;\n})();","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}