dd7d4d672a5a47b1319fb06768373df9b4ca4667af6cf5990fefd65cdca8e4b6.json raw

   1  {"ast":null,"code":"import * as bootstrap from 'bootstrap';\nimport * as i0 from \"@angular/core\";\nexport let ToastComponent = /*#__PURE__*/(() => {\n  class ToastComponent {\n    message;\n    bottom = 76;\n    idString = crypto.randomUUID();\n    toast;\n    ngAfterViewInit() {\n      const myToastEl = document.getElementById(this.idString);\n      if (!myToastEl) {\n        return;\n      }\n      this.toast = new bootstrap.Toast(myToastEl, {\n        delay: 2000\n      });\n    }\n    show(message) {\n      if (message) {\n        this.message = message;\n      }\n      this.toast?.show();\n    }\n    static ɵfac = function ToastComponent_Factory(__ngFactoryType__) {\n      return new (__ngFactoryType__ || ToastComponent)();\n    };\n    static ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n      type: ToastComponent,\n      selectors: [[\"lib-toast\"]],\n      hostVars: 2,\n      hostBindings: function ToastComponent_HostBindings(rf, ctx) {\n        if (rf & 2) {\n          i0.ɵɵstyleProp(\"bottom\", ctx.bottom, \"px\");\n        }\n      },\n      inputs: {\n        message: \"message\",\n        bottom: \"bottom\"\n      },\n      decls: 3,\n      vars: 2,\n      consts: [[\"role\", \"alert\", 1, \"toast\", \"hide\", 2, \"width\", \"100%\", 3, \"id\"], [1, \"toast-body\"]],\n      template: function ToastComponent_Template(rf, ctx) {\n        if (rf & 1) {\n          i0.ɵɵelementStart(0, \"div\", 0)(1, \"div\", 1);\n          i0.ɵɵtext(2);\n          i0.ɵɵelementEnd()();\n        }\n        if (rf & 2) {\n          i0.ɵɵproperty(\"id\", ctx.idString);\n          i0.ɵɵadvance(2);\n          i0.ɵɵtextInterpolate(ctx.message);\n        }\n      },\n      styles: [\"[_nghost-%COMP%] {\\n  position: absolute;\\n  align-self: center;\\n}\"]\n    });\n  }\n  return ToastComponent;\n})();","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}