ngx-kit 2.1.0 → 3.1.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.
- package/fesm2022/ngx-kit-menu.mjs +4 -4
- package/fesm2022/ngx-kit-menu.mjs.map +1 -1
- package/fesm2022/ngx-kit-message.mjs +380 -0
- package/fesm2022/ngx-kit-message.mjs.map +1 -0
- package/fesm2022/ngx-kit-notify.mjs +3 -3
- package/fesm2022/ngx-kit-notify.mjs.map +1 -1
- package/fesm2022/ngx-kit-shared.mjs +20 -2
- package/fesm2022/ngx-kit-shared.mjs.map +1 -1
- package/package.json +5 -1
- package/styles/all.css +28 -0
- package/styles/confetti.css +28 -0
- package/types/ngx-kit-message.d.ts +284 -0
- package/types/ngx-kit-shared.d.ts +5 -1
|
@@ -26,7 +26,7 @@ class Notify {
|
|
|
26
26
|
static injector;
|
|
27
27
|
static show(type = 'info', message, description, options) {
|
|
28
28
|
if (!Notify.injector) {
|
|
29
|
-
throw new Error('ngx-
|
|
29
|
+
throw new Error('ngx-kit: Error on EnvironmentProvider. Ensure "provideNotify()" in root provider.');
|
|
30
30
|
}
|
|
31
31
|
return Notify.injector.get(NGX_NOTIFY_API).show(message, description, type, options);
|
|
32
32
|
}
|
|
@@ -170,11 +170,11 @@ class NgxNotificationComponent {
|
|
|
170
170
|
this.clearTimer();
|
|
171
171
|
}
|
|
172
172
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxNotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
173
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NgxNotificationComponent, isStandalone: true, selector: "ngx-notification", inputs: { payload: { classPropertyName: "payload", publicName: "payload", isSignal: true, isRequired: true, transformFunction: null }, containerClass: { classPropertyName: "containerClass", publicName: "containerClass", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onClose: "onClose", onFinish: "onFinish" }, viewQueries: [{ propertyName: "bar", first: true, predicate: ["bar"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"{{ containerClass }} {{ containerClass }}-{{ payload().type }} {{ showClass() }}\"\n role=\"status\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onTap()\"\n [attr.aria-live]=\"\n payload().type === 'error' || payload().type === 'warning' ? 'assertive' : 'polite'\n \"\n [attr.data-id]=\"payload().id\">\n <div class=\"ngx-notify-icon-container\">\n <div class=\"ngx-notify-icon\">\n @switch (payload().type) {\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M235.3 331.3C229.1 337.6 218.9 337.6 212.7 331.3L148.7 267.3C142.4 261.1 142.4 250.9 148.7 244.7C154.9 238.4 165.1 238.4 171.3 244.7L224 297.4L340.7 180.7C346.9 174.4 357.1 174.4 363.3 180.7C369.6 186.9 369.6 197.1 363.3 203.3L235.3 331.3zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 32C132.3 32 32 132.3 32 256C32 379.7 132.3 480 256 480C379.7 480 480 379.7 480 256C480 132.3 379.7 32 256 32z\" />\n </svg>\n }\n @case ('error') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M180.7 180.7C186.9 174.4 197.1 174.4 203.3 180.7L256 233.4L308.7 180.7C314.9 174.4 325.1 174.4 331.3 180.7C337.6 186.9 337.6 197.1 331.3 203.3L278.6 255.1L331.3 308.7C337.6 314.9 337.6 325.1 331.3 331.3C325.1 337.6 314.9 337.6 308.7 331.3L256 278.6L203.3 331.3C197.1 337.6 186.9 337.6 180.7 331.3C174.4 325.1 174.4 314.9 180.7 308.7L233.4 255.1L180.7 203.3C174.4 197.1 174.4 186.9 180.7 180.7V180.7zM.0669 191.5C.0669 172.4 7.652 154.1 21.16 140.6L140.6 21.15C154.1 7.648 172.4 .0625 191.5 .0625H320.5C339.6 .0625 357.9 7.648 371.4 21.15L490.8 140.6C504.3 154.1 511.9 172.4 511.9 191.5V320.5C511.9 339.6 504.3 357.9 490.8 371.4L371.4 490.8C357.9 504.3 339.6 511.9 320.5 511.9H191.5C172.4 511.9 154.1 504.3 140.6 490.8L21.15 371.4C7.652 357.9 .0666 339.6 .0666 320.5L.0669 191.5zM43.78 163.2C36.28 170.7 32.07 180.9 32.07 191.5V320.5C32.07 331.1 36.28 341.3 43.78 348.8L163.2 468.2C170.7 475.7 180.9 479.9 191.5 479.9H320.5C331.1 479.9 341.3 475.7 348.8 468.2L468.2 348.8C475.7 341.3 479.9 331.1 479.9 320.5V191.5C479.9 180.9 475.7 170.7 468.2 163.2L348.8 43.78C341.3 36.28 331.1 32.06 320.5 32.06H191.5C180.9 32.06 170.7 36.28 163.2 43.78L43.78 163.2zM43.78 348.8L21.15 371.4z\" />\n </svg>\n }\n @case ('warning') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 360c-13.25 0-23.1 10.74-23.1 24c0 13.25 10.75 24 23.1 24c13.25 0 23.1-10.75 23.1-24C280 370.7 269.3 360 256 360zM256 320c8.843 0 15.1-7.156 15.1-16V160c0-8.844-7.155-16-15.1-16S240 151.2 240 160v144C240 312.8 247.2 320 256 320zM504.3 397.3L304.5 59.38C294.4 42.27 276.2 32.03 256 32C235.8 32 217.7 42.22 207.5 59.36l-199.9 338c-10.05 16.97-10.2 37.34-.4218 54.5C17.29 469.5 35.55 480 56.1 480h399.9c20.51 0 38.75-10.53 48.81-28.17C514.6 434.7 514.4 414.3 504.3 397.3zM476.1 435.1C472.7 443.5 464.8 448 455.1 448H56.1c-8.906 0-16.78-4.484-21.08-12c-4.078-7.156-4.015-15.3 .1562-22.36L235.1 75.66C239.4 68.36 247.2 64 256 64c0 0-.0156 0 0 0c8.765 .0156 16.56 4.359 20.86 11.64l199.9 338C480.1 420.7 481.1 428.8 476.1 435.1z\" />\n </svg>\n }\n @case ('info') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 480c-123.5 0-224-100.5-224-224s100.5-224 224-224s224 100.5 224 224S379.5 480 256 480zM256 184c13.25 0 24-10.74 24-24c0-13.25-10.75-24-24-24S232 146.7 232 160C232 173.3 242.7 184 256 184zM304 352h-32V240C272 231.2 264.8 224 256 224H224C215.2 224 208 231.2 208 240S215.2 256 224 256h16v96h-32C199.2 352 192 359.2 192 368C192 376.8 199.2 384 208 384h96c8.836 0 16-7.164 16-16C320 359.2 312.8 352 304 352z\" />\n </svg>\n }\n }\n </div>\n </div>\n\n <div class=\"ngx-notify-content\">\n <div class=\"ngx-notify-title\" [innerHTML]=\"safeMessage\"></div>\n <div class=\"ngx-notify-description\" [innerHTML]=\"safeDescription\"></div>\n </div>\n\n @if (payload().options.dismissible) {\n <div class=\"ngx-notify-close-container\">\n <button class=\"ngx-notify-close\" (click)=\"close($event)\" aria-label=\"close\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path\n d=\"M315.3 411.3c-6.253 6.253-16.37 6.253-22.63 0L160 278.6l-132.7 132.7c-6.253 6.253-16.37 6.253-22.63 0c-6.253-6.253-6.253-16.37 0-22.63L137.4 256L4.69 123.3c-6.253-6.253-6.253-16.37 0-22.63c6.253-6.253 16.37-6.253 22.63 0L160 233.4l132.7-132.7c6.253-6.253 16.37-6.253 22.63 0c6.253 6.253 6.253 16.37 0 22.63L182.6 256l132.7 132.7C321.6 394.9 321.6 405.1 315.3 411.3z\" />\n </svg>\n </button>\n </div>\n }\n\n <div class=\"ngx-notify-progress\">\n <div class=\"progress-bar\" #bar></div>\n </div>\n</div>\n", styles: [":host{display:block;margin:8px 0;--ngx-notify-content-bg: light-dark(#ffffff, #
|
|
173
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NgxNotificationComponent, isStandalone: true, selector: "ngx-notification", inputs: { payload: { classPropertyName: "payload", publicName: "payload", isSignal: true, isRequired: true, transformFunction: null }, containerClass: { classPropertyName: "containerClass", publicName: "containerClass", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onClose: "onClose", onFinish: "onFinish" }, viewQueries: [{ propertyName: "bar", first: true, predicate: ["bar"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"{{ containerClass }} {{ containerClass }}-{{ payload().type }} {{ showClass() }}\"\n role=\"status\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onTap()\"\n [attr.aria-live]=\"\n payload().type === 'error' || payload().type === 'warning' ? 'assertive' : 'polite'\n \"\n [attr.data-id]=\"payload().id\">\n <div class=\"ngx-notify-icon-container\">\n <div class=\"ngx-notify-icon\">\n @switch (payload().type) {\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M235.3 331.3C229.1 337.6 218.9 337.6 212.7 331.3L148.7 267.3C142.4 261.1 142.4 250.9 148.7 244.7C154.9 238.4 165.1 238.4 171.3 244.7L224 297.4L340.7 180.7C346.9 174.4 357.1 174.4 363.3 180.7C369.6 186.9 369.6 197.1 363.3 203.3L235.3 331.3zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 32C132.3 32 32 132.3 32 256C32 379.7 132.3 480 256 480C379.7 480 480 379.7 480 256C480 132.3 379.7 32 256 32z\" />\n </svg>\n }\n @case ('error') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M180.7 180.7C186.9 174.4 197.1 174.4 203.3 180.7L256 233.4L308.7 180.7C314.9 174.4 325.1 174.4 331.3 180.7C337.6 186.9 337.6 197.1 331.3 203.3L278.6 255.1L331.3 308.7C337.6 314.9 337.6 325.1 331.3 331.3C325.1 337.6 314.9 337.6 308.7 331.3L256 278.6L203.3 331.3C197.1 337.6 186.9 337.6 180.7 331.3C174.4 325.1 174.4 314.9 180.7 308.7L233.4 255.1L180.7 203.3C174.4 197.1 174.4 186.9 180.7 180.7V180.7zM.0669 191.5C.0669 172.4 7.652 154.1 21.16 140.6L140.6 21.15C154.1 7.648 172.4 .0625 191.5 .0625H320.5C339.6 .0625 357.9 7.648 371.4 21.15L490.8 140.6C504.3 154.1 511.9 172.4 511.9 191.5V320.5C511.9 339.6 504.3 357.9 490.8 371.4L371.4 490.8C357.9 504.3 339.6 511.9 320.5 511.9H191.5C172.4 511.9 154.1 504.3 140.6 490.8L21.15 371.4C7.652 357.9 .0666 339.6 .0666 320.5L.0669 191.5zM43.78 163.2C36.28 170.7 32.07 180.9 32.07 191.5V320.5C32.07 331.1 36.28 341.3 43.78 348.8L163.2 468.2C170.7 475.7 180.9 479.9 191.5 479.9H320.5C331.1 479.9 341.3 475.7 348.8 468.2L468.2 348.8C475.7 341.3 479.9 331.1 479.9 320.5V191.5C479.9 180.9 475.7 170.7 468.2 163.2L348.8 43.78C341.3 36.28 331.1 32.06 320.5 32.06H191.5C180.9 32.06 170.7 36.28 163.2 43.78L43.78 163.2zM43.78 348.8L21.15 371.4z\" />\n </svg>\n }\n @case ('warning') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 360c-13.25 0-23.1 10.74-23.1 24c0 13.25 10.75 24 23.1 24c13.25 0 23.1-10.75 23.1-24C280 370.7 269.3 360 256 360zM256 320c8.843 0 15.1-7.156 15.1-16V160c0-8.844-7.155-16-15.1-16S240 151.2 240 160v144C240 312.8 247.2 320 256 320zM504.3 397.3L304.5 59.38C294.4 42.27 276.2 32.03 256 32C235.8 32 217.7 42.22 207.5 59.36l-199.9 338c-10.05 16.97-10.2 37.34-.4218 54.5C17.29 469.5 35.55 480 56.1 480h399.9c20.51 0 38.75-10.53 48.81-28.17C514.6 434.7 514.4 414.3 504.3 397.3zM476.1 435.1C472.7 443.5 464.8 448 455.1 448H56.1c-8.906 0-16.78-4.484-21.08-12c-4.078-7.156-4.015-15.3 .1562-22.36L235.1 75.66C239.4 68.36 247.2 64 256 64c0 0-.0156 0 0 0c8.765 .0156 16.56 4.359 20.86 11.64l199.9 338C480.1 420.7 481.1 428.8 476.1 435.1z\" />\n </svg>\n }\n @case ('info') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 480c-123.5 0-224-100.5-224-224s100.5-224 224-224s224 100.5 224 224S379.5 480 256 480zM256 184c13.25 0 24-10.74 24-24c0-13.25-10.75-24-24-24S232 146.7 232 160C232 173.3 242.7 184 256 184zM304 352h-32V240C272 231.2 264.8 224 256 224H224C215.2 224 208 231.2 208 240S215.2 256 224 256h16v96h-32C199.2 352 192 359.2 192 368C192 376.8 199.2 384 208 384h96c8.836 0 16-7.164 16-16C320 359.2 312.8 352 304 352z\" />\n </svg>\n }\n }\n </div>\n </div>\n\n <div class=\"ngx-notify-content\">\n <div class=\"ngx-notify-title\" [innerHTML]=\"safeMessage\"></div>\n <div class=\"ngx-notify-description\" [innerHTML]=\"safeDescription\"></div>\n </div>\n\n @if (payload().options.dismissible) {\n <div class=\"ngx-notify-close-container\">\n <button class=\"ngx-notify-close\" (click)=\"close($event)\" aria-label=\"close\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path\n fill=\"currentColor\"\n d=\"M315.3 411.3c-6.253 6.253-16.37 6.253-22.63 0L160 278.6l-132.7 132.7c-6.253 6.253-16.37 6.253-22.63 0c-6.253-6.253-6.253-16.37 0-22.63L137.4 256L4.69 123.3c-6.253-6.253-6.253-16.37 0-22.63c6.253-6.253 16.37-6.253 22.63 0L160 233.4l132.7-132.7c6.253-6.253 16.37-6.253 22.63 0c6.253 6.253 6.253 16.37 0 22.63L182.6 256l132.7 132.7C321.6 394.9 321.6 405.1 315.3 411.3z\" />\n </svg>\n </button>\n </div>\n }\n\n <div class=\"ngx-notify-progress\">\n <div class=\"progress-bar\" #bar></div>\n </div>\n</div>\n", styles: [":host{display:block;margin:8px 0;--ngx-notify-content-bg: light-dark(#ffffff, #262b35);--ngx-notify-content-fg: light-dark(#000, #fff)}.ngx-notify{display:flex;min-width:240px;width:500px;max-width:100%;border-radius:8px;box-shadow:0 0 30px #6766667c;opacity:0;transform:translateY(-8px);transition:opacity .28s ease,transform .28s ease;pointer-events:auto;overflow:hidden}.ngx-notify-icon-container{width:60px;min-width:60px;display:flex;align-items:center;justify-content:center}.ngx-notify-icon-container .ngx-notify-icon{padding:15px}.ngx-notify-icon-container .ngx-notify-icon svg{width:100%;height:100%}.ngx-notify-content{background-color:var(--ngx-notify-content-bg);color:var(--ngx-notify-content-fg);padding:15px;border-radius:0 0 0 15px;flex:auto}.ngx-notify-content .ngx-notify-title{font-size:1rem}.ngx-notify-content .ngx-notify-description{opacity:.8;font-size:.8rem}.ngx-show{opacity:1;transform:translateY(0)}.ngx-notify-info{background:#1cacff;--var-ngx-progress-bar-bg: #1cacff;color:#e8f3ff}.ngx-notify-success{background:#54c999;--var-ngx-progress-bar-bg: #54c999;color:#ebeceb}.ngx-notify-warning{background:#ffb242;--var-ngx-progress-bar-bg: #ffb242;color:#ffecec}.ngx-notify-error{background:#ff3c39;--var-ngx-progress-bar-bg: #ff3c39;color:#ffecec}.ngx-notify-close-container{background-color:var(--ngx-notify-content-bg);color:var(--ngx-notify-content-fg);display:flex;align-items:center;justify-content:center}.ngx-notify-close-container .ngx-notify-close{background:transparent;border:none;width:22px;height:22px;line-height:0;margin:0 5px;cursor:pointer;transform:rotate(0);transition:transform .4s}.ngx-notify-close-container .ngx-notify-close:hover{transform:rotate(90deg)}.ngx-notify-progress{position:absolute;bottom:0;height:4px;left:60px;right:0;overflow:hidden}.ngx-notify-progress .progress-bar{background-color:var(--var-ngx-progress-bar-bg);height:100%;transform:scaleX(0);transform-origin:left}::ng-deep html[dir=rtl] .ngx-notify-content,::ng-deep body[dir=ltr] .ngx-notify-content{border-radius:0 0 15px}::ng-deep html[dir=rtl] .ngx-notify-progress,::ng-deep body[dir=ltr] .ngx-notify-progress{left:0;right:60px}::ng-deep html[dir=rtl] .ngx-notify-progress .progress-bar,::ng-deep body[dir=ltr] .ngx-notify-progress .progress-bar{transform-origin:right!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
174
174
|
}
|
|
175
175
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxNotificationComponent, decorators: [{
|
|
176
176
|
type: Component,
|
|
177
|
-
args: [{ selector: 'ngx-notification', imports: [CommonModule], template: "<div\n class=\"{{ containerClass }} {{ containerClass }}-{{ payload().type }} {{ showClass() }}\"\n role=\"status\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onTap()\"\n [attr.aria-live]=\"\n payload().type === 'error' || payload().type === 'warning' ? 'assertive' : 'polite'\n \"\n [attr.data-id]=\"payload().id\">\n <div class=\"ngx-notify-icon-container\">\n <div class=\"ngx-notify-icon\">\n @switch (payload().type) {\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M235.3 331.3C229.1 337.6 218.9 337.6 212.7 331.3L148.7 267.3C142.4 261.1 142.4 250.9 148.7 244.7C154.9 238.4 165.1 238.4 171.3 244.7L224 297.4L340.7 180.7C346.9 174.4 357.1 174.4 363.3 180.7C369.6 186.9 369.6 197.1 363.3 203.3L235.3 331.3zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 32C132.3 32 32 132.3 32 256C32 379.7 132.3 480 256 480C379.7 480 480 379.7 480 256C480 132.3 379.7 32 256 32z\" />\n </svg>\n }\n @case ('error') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M180.7 180.7C186.9 174.4 197.1 174.4 203.3 180.7L256 233.4L308.7 180.7C314.9 174.4 325.1 174.4 331.3 180.7C337.6 186.9 337.6 197.1 331.3 203.3L278.6 255.1L331.3 308.7C337.6 314.9 337.6 325.1 331.3 331.3C325.1 337.6 314.9 337.6 308.7 331.3L256 278.6L203.3 331.3C197.1 337.6 186.9 337.6 180.7 331.3C174.4 325.1 174.4 314.9 180.7 308.7L233.4 255.1L180.7 203.3C174.4 197.1 174.4 186.9 180.7 180.7V180.7zM.0669 191.5C.0669 172.4 7.652 154.1 21.16 140.6L140.6 21.15C154.1 7.648 172.4 .0625 191.5 .0625H320.5C339.6 .0625 357.9 7.648 371.4 21.15L490.8 140.6C504.3 154.1 511.9 172.4 511.9 191.5V320.5C511.9 339.6 504.3 357.9 490.8 371.4L371.4 490.8C357.9 504.3 339.6 511.9 320.5 511.9H191.5C172.4 511.9 154.1 504.3 140.6 490.8L21.15 371.4C7.652 357.9 .0666 339.6 .0666 320.5L.0669 191.5zM43.78 163.2C36.28 170.7 32.07 180.9 32.07 191.5V320.5C32.07 331.1 36.28 341.3 43.78 348.8L163.2 468.2C170.7 475.7 180.9 479.9 191.5 479.9H320.5C331.1 479.9 341.3 475.7 348.8 468.2L468.2 348.8C475.7 341.3 479.9 331.1 479.9 320.5V191.5C479.9 180.9 475.7 170.7 468.2 163.2L348.8 43.78C341.3 36.28 331.1 32.06 320.5 32.06H191.5C180.9 32.06 170.7 36.28 163.2 43.78L43.78 163.2zM43.78 348.8L21.15 371.4z\" />\n </svg>\n }\n @case ('warning') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 360c-13.25 0-23.1 10.74-23.1 24c0 13.25 10.75 24 23.1 24c13.25 0 23.1-10.75 23.1-24C280 370.7 269.3 360 256 360zM256 320c8.843 0 15.1-7.156 15.1-16V160c0-8.844-7.155-16-15.1-16S240 151.2 240 160v144C240 312.8 247.2 320 256 320zM504.3 397.3L304.5 59.38C294.4 42.27 276.2 32.03 256 32C235.8 32 217.7 42.22 207.5 59.36l-199.9 338c-10.05 16.97-10.2 37.34-.4218 54.5C17.29 469.5 35.55 480 56.1 480h399.9c20.51 0 38.75-10.53 48.81-28.17C514.6 434.7 514.4 414.3 504.3 397.3zM476.1 435.1C472.7 443.5 464.8 448 455.1 448H56.1c-8.906 0-16.78-4.484-21.08-12c-4.078-7.156-4.015-15.3 .1562-22.36L235.1 75.66C239.4 68.36 247.2 64 256 64c0 0-.0156 0 0 0c8.765 .0156 16.56 4.359 20.86 11.64l199.9 338C480.1 420.7 481.1 428.8 476.1 435.1z\" />\n </svg>\n }\n @case ('info') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 480c-123.5 0-224-100.5-224-224s100.5-224 224-224s224 100.5 224 224S379.5 480 256 480zM256 184c13.25 0 24-10.74 24-24c0-13.25-10.75-24-24-24S232 146.7 232 160C232 173.3 242.7 184 256 184zM304 352h-32V240C272 231.2 264.8 224 256 224H224C215.2 224 208 231.2 208 240S215.2 256 224 256h16v96h-32C199.2 352 192 359.2 192 368C192 376.8 199.2 384 208 384h96c8.836 0 16-7.164 16-16C320 359.2 312.8 352 304 352z\" />\n </svg>\n }\n }\n </div>\n </div>\n\n <div class=\"ngx-notify-content\">\n <div class=\"ngx-notify-title\" [innerHTML]=\"safeMessage\"></div>\n <div class=\"ngx-notify-description\" [innerHTML]=\"safeDescription\"></div>\n </div>\n\n @if (payload().options.dismissible) {\n <div class=\"ngx-notify-close-container\">\n <button class=\"ngx-notify-close\" (click)=\"close($event)\" aria-label=\"close\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path\n d=\"M315.3 411.3c-6.253 6.253-16.37 6.253-22.63 0L160 278.6l-132.7 132.7c-6.253 6.253-16.37 6.253-22.63 0c-6.253-6.253-6.253-16.37 0-22.63L137.4 256L4.69 123.3c-6.253-6.253-6.253-16.37 0-22.63c6.253-6.253 16.37-6.253 22.63 0L160 233.4l132.7-132.7c6.253-6.253 16.37-6.253 22.63 0c6.253 6.253 6.253 16.37 0 22.63L182.6 256l132.7 132.7C321.6 394.9 321.6 405.1 315.3 411.3z\" />\n </svg>\n </button>\n </div>\n }\n\n <div class=\"ngx-notify-progress\">\n <div class=\"progress-bar\" #bar></div>\n </div>\n</div>\n", styles: [":host{display:block;margin:8px 0;--ngx-notify-content-bg: light-dark(#ffffff, #
|
|
177
|
+
args: [{ selector: 'ngx-notification', imports: [CommonModule], template: "<div\n class=\"{{ containerClass }} {{ containerClass }}-{{ payload().type }} {{ showClass() }}\"\n role=\"status\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onTap()\"\n [attr.aria-live]=\"\n payload().type === 'error' || payload().type === 'warning' ? 'assertive' : 'polite'\n \"\n [attr.data-id]=\"payload().id\">\n <div class=\"ngx-notify-icon-container\">\n <div class=\"ngx-notify-icon\">\n @switch (payload().type) {\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M235.3 331.3C229.1 337.6 218.9 337.6 212.7 331.3L148.7 267.3C142.4 261.1 142.4 250.9 148.7 244.7C154.9 238.4 165.1 238.4 171.3 244.7L224 297.4L340.7 180.7C346.9 174.4 357.1 174.4 363.3 180.7C369.6 186.9 369.6 197.1 363.3 203.3L235.3 331.3zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 32C132.3 32 32 132.3 32 256C32 379.7 132.3 480 256 480C379.7 480 480 379.7 480 256C480 132.3 379.7 32 256 32z\" />\n </svg>\n }\n @case ('error') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M180.7 180.7C186.9 174.4 197.1 174.4 203.3 180.7L256 233.4L308.7 180.7C314.9 174.4 325.1 174.4 331.3 180.7C337.6 186.9 337.6 197.1 331.3 203.3L278.6 255.1L331.3 308.7C337.6 314.9 337.6 325.1 331.3 331.3C325.1 337.6 314.9 337.6 308.7 331.3L256 278.6L203.3 331.3C197.1 337.6 186.9 337.6 180.7 331.3C174.4 325.1 174.4 314.9 180.7 308.7L233.4 255.1L180.7 203.3C174.4 197.1 174.4 186.9 180.7 180.7V180.7zM.0669 191.5C.0669 172.4 7.652 154.1 21.16 140.6L140.6 21.15C154.1 7.648 172.4 .0625 191.5 .0625H320.5C339.6 .0625 357.9 7.648 371.4 21.15L490.8 140.6C504.3 154.1 511.9 172.4 511.9 191.5V320.5C511.9 339.6 504.3 357.9 490.8 371.4L371.4 490.8C357.9 504.3 339.6 511.9 320.5 511.9H191.5C172.4 511.9 154.1 504.3 140.6 490.8L21.15 371.4C7.652 357.9 .0666 339.6 .0666 320.5L.0669 191.5zM43.78 163.2C36.28 170.7 32.07 180.9 32.07 191.5V320.5C32.07 331.1 36.28 341.3 43.78 348.8L163.2 468.2C170.7 475.7 180.9 479.9 191.5 479.9H320.5C331.1 479.9 341.3 475.7 348.8 468.2L468.2 348.8C475.7 341.3 479.9 331.1 479.9 320.5V191.5C479.9 180.9 475.7 170.7 468.2 163.2L348.8 43.78C341.3 36.28 331.1 32.06 320.5 32.06H191.5C180.9 32.06 170.7 36.28 163.2 43.78L43.78 163.2zM43.78 348.8L21.15 371.4z\" />\n </svg>\n }\n @case ('warning') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 360c-13.25 0-23.1 10.74-23.1 24c0 13.25 10.75 24 23.1 24c13.25 0 23.1-10.75 23.1-24C280 370.7 269.3 360 256 360zM256 320c8.843 0 15.1-7.156 15.1-16V160c0-8.844-7.155-16-15.1-16S240 151.2 240 160v144C240 312.8 247.2 320 256 320zM504.3 397.3L304.5 59.38C294.4 42.27 276.2 32.03 256 32C235.8 32 217.7 42.22 207.5 59.36l-199.9 338c-10.05 16.97-10.2 37.34-.4218 54.5C17.29 469.5 35.55 480 56.1 480h399.9c20.51 0 38.75-10.53 48.81-28.17C514.6 434.7 514.4 414.3 504.3 397.3zM476.1 435.1C472.7 443.5 464.8 448 455.1 448H56.1c-8.906 0-16.78-4.484-21.08-12c-4.078-7.156-4.015-15.3 .1562-22.36L235.1 75.66C239.4 68.36 247.2 64 256 64c0 0-.0156 0 0 0c8.765 .0156 16.56 4.359 20.86 11.64l199.9 338C480.1 420.7 481.1 428.8 476.1 435.1z\" />\n </svg>\n }\n @case ('info') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 480c-123.5 0-224-100.5-224-224s100.5-224 224-224s224 100.5 224 224S379.5 480 256 480zM256 184c13.25 0 24-10.74 24-24c0-13.25-10.75-24-24-24S232 146.7 232 160C232 173.3 242.7 184 256 184zM304 352h-32V240C272 231.2 264.8 224 256 224H224C215.2 224 208 231.2 208 240S215.2 256 224 256h16v96h-32C199.2 352 192 359.2 192 368C192 376.8 199.2 384 208 384h96c8.836 0 16-7.164 16-16C320 359.2 312.8 352 304 352z\" />\n </svg>\n }\n }\n </div>\n </div>\n\n <div class=\"ngx-notify-content\">\n <div class=\"ngx-notify-title\" [innerHTML]=\"safeMessage\"></div>\n <div class=\"ngx-notify-description\" [innerHTML]=\"safeDescription\"></div>\n </div>\n\n @if (payload().options.dismissible) {\n <div class=\"ngx-notify-close-container\">\n <button class=\"ngx-notify-close\" (click)=\"close($event)\" aria-label=\"close\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path\n fill=\"currentColor\"\n d=\"M315.3 411.3c-6.253 6.253-16.37 6.253-22.63 0L160 278.6l-132.7 132.7c-6.253 6.253-16.37 6.253-22.63 0c-6.253-6.253-6.253-16.37 0-22.63L137.4 256L4.69 123.3c-6.253-6.253-6.253-16.37 0-22.63c6.253-6.253 16.37-6.253 22.63 0L160 233.4l132.7-132.7c6.253-6.253 16.37-6.253 22.63 0c6.253 6.253 6.253 16.37 0 22.63L182.6 256l132.7 132.7C321.6 394.9 321.6 405.1 315.3 411.3z\" />\n </svg>\n </button>\n </div>\n }\n\n <div class=\"ngx-notify-progress\">\n <div class=\"progress-bar\" #bar></div>\n </div>\n</div>\n", styles: [":host{display:block;margin:8px 0;--ngx-notify-content-bg: light-dark(#ffffff, #262b35);--ngx-notify-content-fg: light-dark(#000, #fff)}.ngx-notify{display:flex;min-width:240px;width:500px;max-width:100%;border-radius:8px;box-shadow:0 0 30px #6766667c;opacity:0;transform:translateY(-8px);transition:opacity .28s ease,transform .28s ease;pointer-events:auto;overflow:hidden}.ngx-notify-icon-container{width:60px;min-width:60px;display:flex;align-items:center;justify-content:center}.ngx-notify-icon-container .ngx-notify-icon{padding:15px}.ngx-notify-icon-container .ngx-notify-icon svg{width:100%;height:100%}.ngx-notify-content{background-color:var(--ngx-notify-content-bg);color:var(--ngx-notify-content-fg);padding:15px;border-radius:0 0 0 15px;flex:auto}.ngx-notify-content .ngx-notify-title{font-size:1rem}.ngx-notify-content .ngx-notify-description{opacity:.8;font-size:.8rem}.ngx-show{opacity:1;transform:translateY(0)}.ngx-notify-info{background:#1cacff;--var-ngx-progress-bar-bg: #1cacff;color:#e8f3ff}.ngx-notify-success{background:#54c999;--var-ngx-progress-bar-bg: #54c999;color:#ebeceb}.ngx-notify-warning{background:#ffb242;--var-ngx-progress-bar-bg: #ffb242;color:#ffecec}.ngx-notify-error{background:#ff3c39;--var-ngx-progress-bar-bg: #ff3c39;color:#ffecec}.ngx-notify-close-container{background-color:var(--ngx-notify-content-bg);color:var(--ngx-notify-content-fg);display:flex;align-items:center;justify-content:center}.ngx-notify-close-container .ngx-notify-close{background:transparent;border:none;width:22px;height:22px;line-height:0;margin:0 5px;cursor:pointer;transform:rotate(0);transition:transform .4s}.ngx-notify-close-container .ngx-notify-close:hover{transform:rotate(90deg)}.ngx-notify-progress{position:absolute;bottom:0;height:4px;left:60px;right:0;overflow:hidden}.ngx-notify-progress .progress-bar{background-color:var(--var-ngx-progress-bar-bg);height:100%;transform:scaleX(0);transform-origin:left}::ng-deep html[dir=rtl] .ngx-notify-content,::ng-deep body[dir=ltr] .ngx-notify-content{border-radius:0 0 15px}::ng-deep html[dir=rtl] .ngx-notify-progress,::ng-deep body[dir=ltr] .ngx-notify-progress{left:0;right:60px}::ng-deep html[dir=rtl] .ngx-notify-progress .progress-bar,::ng-deep body[dir=ltr] .ngx-notify-progress .progress-bar{transform-origin:right!important}\n"] }]
|
|
178
178
|
}], ctorParameters: () => [], propDecorators: { payload: [{ type: i0.Input, args: [{ isSignal: true, alias: "payload", required: true }] }], containerClass: [{
|
|
179
179
|
type: Input
|
|
180
180
|
}], bar: [{ type: i0.ViewChild, args: ['bar', { isSignal: true }] }], onClose: [{ type: i0.Output, args: ["onClose"] }], onFinish: [{ type: i0.Output, args: ["onFinish"] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-kit-notify.mjs","sources":["../../../projects/libs/notify/models/notify-config.ts","../../../projects/libs/notify/notify-facade.ts","../../../projects/libs/notify/components/notification.component.ts","../../../projects/libs/notify/components/notification.component.html","../../../projects/libs/notify/services/notify.service.ts","../../../projects/libs/notify/notify-provider.ts","../../../projects/libs/notify/ngx-kit-notify.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { NgxNotifyOptions } from './notify-options';\nimport { NgxNotifyService } from '../services/notify.service';\n\nexport const NGX_NOTIFY_CONFIG = new InjectionToken<NgxNotifyOptions>('NgxNotifyOption');\nexport const NGX_NOTIFY_API = new InjectionToken<NgxNotifyService>('NgxNotifyService');\n\nexport const NGX_NOTIFY_DEFAULTS: Required<NgxNotifyOptions> = {\n timeout: 3000,\n position: 'top-center',\n maxVisible: 10,\n allowHtml: false,\n pauseOnHover: true,\n dismissible: true,\n closeOnTap: true,\n containerClass: 'ngx-bg-notify',\n notificationClass: 'ngx-notify',\n};\n","import { Injector } from '@angular/core';\nimport { NgxNotifyOptions } from './models/notify-options';\nimport { NGX_NOTIFY_API } from './models/notify-config';\nimport { NgxNotifyPayload } from './models/notify.model';\n\n/**\n * Static facade so call sites can use: Notify.warn('msg', opts)\n * Module will set the service instance in its constructor.\n */\nexport class Notify {\n static injector: Injector;\n\n static show(\n type: 'info' | 'success' | 'warning' | 'error' = 'info',\n message: string,\n description?: string,\n options?: NgxNotifyOptions,\n ): NgxNotifyPayload {\n if (!Notify.injector) {\n throw new Error(\n 'ngx-notify: Error on EnvironmentProvider. Ensure \"provideNotify()\" in root provider.',\n );\n }\n return Notify.injector.get(NGX_NOTIFY_API).show(message, description, type, options);\n }\n\n static info(message: string, description?: string, options?: NgxNotifyOptions) {\n return this.show('info', message, description, options);\n }\n\n static success(message: string, description?: string, options?: NgxNotifyOptions) {\n return this.show('success', message, description, options);\n }\n static warning(message: string, description?: string, options?: NgxNotifyOptions) {\n return this.show('warning', message, description, options);\n }\n static error(message: string, description?: string, options?: NgxNotifyOptions) {\n return this.show('error', message, description, options);\n }\n}\n","import {\n Component,\n OnInit,\n OnDestroy,\n Input,\n ChangeDetectorRef,\n DOCUMENT,\n inject,\n ElementRef,\n afterNextRender,\n signal,\n output,\n input,\n effect,\n viewChild,\n} from '@angular/core';\nimport { INotifyEnd, NgxNotifyPayload } from '../models/notify.model';\nimport { CommonModule } from '@angular/common';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n@Component({\n selector: 'ngx-notification',\n templateUrl: './notification.component.html',\n styleUrls: ['./notification.component.scss'],\n imports: [CommonModule],\n})\nexport class NgxNotificationComponent implements OnInit, OnDestroy {\n payload = input.required<NgxNotifyPayload>();\n @Input() containerClass = 'ngx-notify';\n\n bar = viewChild<ElementRef<HTMLElement>>('bar');\n onClose = output<INotifyEnd>();\n onFinish = output<INotifyEnd>();\n\n private _rafId = 0;\n private _duration = 0;\n private _remaining = 0;\n private _endTs = 0;\n private _paused = false;\n\n safeMessage: SafeHtml | string = '';\n safeDescription: SafeHtml | string = '';\n showClass = signal('');\n protected doc = inject(DOCUMENT);\n protected el = inject(ElementRef);\n protected sanitizer = inject(DomSanitizer);\n protected chdr = inject(ChangeDetectorRef);\n constructor() {\n afterNextRender(() => {\n this.showClass.set('ngx-show');\n this.chdr.detectChanges();\n });\n effect(() => {\n const payload = this.payload();\n\n // decide how to render message\n if (payload.options.allowHtml) {\n this.safeMessage = this.sanitizer.bypassSecurityTrustHtml(payload.message);\n this.safeDescription = this.sanitizer.bypassSecurityTrustHtml(payload.description ?? '');\n } else {\n this.safeMessage = this.escapeHtml(payload.message);\n this.safeDescription = this.escapeHtml(payload.description);\n }\n });\n effect(() => {\n const timeout = this.payload().options.timeout ?? 0;\n this.startTimer(timeout);\n });\n }\n\n ngOnInit(): void {}\n\n ngOnDestroy(): void {\n this.clearTimer();\n }\n\n // Public API to start timer (used by service when created)\n startTimer(ms: number) {\n this.clearTimer();\n\n if (!this._paused) {\n this._duration = ms;\n }\n this._remaining = ms;\n this._endTs = performance.now() + ms;\n\n const bar = this.bar()?.nativeElement;\n if (bar) {\n bar.style.transition = `transform ${ms}ms linear`;\n bar.style.transform = 'scaleX(1)';\n }\n\n this.animateProgress();\n }\n pauseTimer() {\n this._paused = true;\n cancelAnimationFrame(this._rafId);\n this._remaining = Math.max(0, this._endTs - performance.now());\n const bar = this.bar()?.nativeElement;\n if (bar) {\n const matrix = getComputedStyle(bar).transform;\n bar.style.transition = 'none';\n bar.style.transform = matrix;\n }\n }\n\n resumeTimer() {\n if (!this._paused || this._remaining <= 0) {\n return;\n }\n\n this._paused = false;\n\n this.startTimer(this._remaining);\n }\n\n private clearTimer() {\n cancelAnimationFrame(this._rafId);\n this._rafId = 0;\n }\n\n private animateProgress() {\n const update = () => {\n const remaining = Math.max(0, this._endTs - performance.now());\n if (remaining <= 0) {\n this.onFinish.emit({\n id: this.payload().id,\n el: this.el.nativeElement,\n });\n return;\n }\n\n this._rafId = requestAnimationFrame(update);\n };\n\n this._rafId = requestAnimationFrame(update);\n }\n\n close(ev?: Event) {\n if (ev) ev.stopPropagation();\n this.onClose.emit({ id: this.payload().id, el: this.el.nativeElement });\n }\n\n onMouseEnter() {\n if (this.payload().options.pauseOnHover) this.pauseTimer();\n }\n onMouseLeave() {\n if (this.payload().options.pauseOnHover) this.resumeTimer();\n }\n onTap() {\n if (this.payload().options.closeOnTap) this.close();\n }\n\n escapeHtml(input?: string) {\n if (!input) return '';\n const div = this.doc.createElement('div');\n div.appendChild(this.doc.createTextNode(input));\n return div.textContent;\n }\n\n ngOnDestroyCleanup() {\n this.clearTimer();\n }\n}\n","<div\n class=\"{{ containerClass }} {{ containerClass }}-{{ payload().type }} {{ showClass() }}\"\n role=\"status\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onTap()\"\n [attr.aria-live]=\"\n payload().type === 'error' || payload().type === 'warning' ? 'assertive' : 'polite'\n \"\n [attr.data-id]=\"payload().id\">\n <div class=\"ngx-notify-icon-container\">\n <div class=\"ngx-notify-icon\">\n @switch (payload().type) {\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M235.3 331.3C229.1 337.6 218.9 337.6 212.7 331.3L148.7 267.3C142.4 261.1 142.4 250.9 148.7 244.7C154.9 238.4 165.1 238.4 171.3 244.7L224 297.4L340.7 180.7C346.9 174.4 357.1 174.4 363.3 180.7C369.6 186.9 369.6 197.1 363.3 203.3L235.3 331.3zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 32C132.3 32 32 132.3 32 256C32 379.7 132.3 480 256 480C379.7 480 480 379.7 480 256C480 132.3 379.7 32 256 32z\" />\n </svg>\n }\n @case ('error') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M180.7 180.7C186.9 174.4 197.1 174.4 203.3 180.7L256 233.4L308.7 180.7C314.9 174.4 325.1 174.4 331.3 180.7C337.6 186.9 337.6 197.1 331.3 203.3L278.6 255.1L331.3 308.7C337.6 314.9 337.6 325.1 331.3 331.3C325.1 337.6 314.9 337.6 308.7 331.3L256 278.6L203.3 331.3C197.1 337.6 186.9 337.6 180.7 331.3C174.4 325.1 174.4 314.9 180.7 308.7L233.4 255.1L180.7 203.3C174.4 197.1 174.4 186.9 180.7 180.7V180.7zM.0669 191.5C.0669 172.4 7.652 154.1 21.16 140.6L140.6 21.15C154.1 7.648 172.4 .0625 191.5 .0625H320.5C339.6 .0625 357.9 7.648 371.4 21.15L490.8 140.6C504.3 154.1 511.9 172.4 511.9 191.5V320.5C511.9 339.6 504.3 357.9 490.8 371.4L371.4 490.8C357.9 504.3 339.6 511.9 320.5 511.9H191.5C172.4 511.9 154.1 504.3 140.6 490.8L21.15 371.4C7.652 357.9 .0666 339.6 .0666 320.5L.0669 191.5zM43.78 163.2C36.28 170.7 32.07 180.9 32.07 191.5V320.5C32.07 331.1 36.28 341.3 43.78 348.8L163.2 468.2C170.7 475.7 180.9 479.9 191.5 479.9H320.5C331.1 479.9 341.3 475.7 348.8 468.2L468.2 348.8C475.7 341.3 479.9 331.1 479.9 320.5V191.5C479.9 180.9 475.7 170.7 468.2 163.2L348.8 43.78C341.3 36.28 331.1 32.06 320.5 32.06H191.5C180.9 32.06 170.7 36.28 163.2 43.78L43.78 163.2zM43.78 348.8L21.15 371.4z\" />\n </svg>\n }\n @case ('warning') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 360c-13.25 0-23.1 10.74-23.1 24c0 13.25 10.75 24 23.1 24c13.25 0 23.1-10.75 23.1-24C280 370.7 269.3 360 256 360zM256 320c8.843 0 15.1-7.156 15.1-16V160c0-8.844-7.155-16-15.1-16S240 151.2 240 160v144C240 312.8 247.2 320 256 320zM504.3 397.3L304.5 59.38C294.4 42.27 276.2 32.03 256 32C235.8 32 217.7 42.22 207.5 59.36l-199.9 338c-10.05 16.97-10.2 37.34-.4218 54.5C17.29 469.5 35.55 480 56.1 480h399.9c20.51 0 38.75-10.53 48.81-28.17C514.6 434.7 514.4 414.3 504.3 397.3zM476.1 435.1C472.7 443.5 464.8 448 455.1 448H56.1c-8.906 0-16.78-4.484-21.08-12c-4.078-7.156-4.015-15.3 .1562-22.36L235.1 75.66C239.4 68.36 247.2 64 256 64c0 0-.0156 0 0 0c8.765 .0156 16.56 4.359 20.86 11.64l199.9 338C480.1 420.7 481.1 428.8 476.1 435.1z\" />\n </svg>\n }\n @case ('info') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 480c-123.5 0-224-100.5-224-224s100.5-224 224-224s224 100.5 224 224S379.5 480 256 480zM256 184c13.25 0 24-10.74 24-24c0-13.25-10.75-24-24-24S232 146.7 232 160C232 173.3 242.7 184 256 184zM304 352h-32V240C272 231.2 264.8 224 256 224H224C215.2 224 208 231.2 208 240S215.2 256 224 256h16v96h-32C199.2 352 192 359.2 192 368C192 376.8 199.2 384 208 384h96c8.836 0 16-7.164 16-16C320 359.2 312.8 352 304 352z\" />\n </svg>\n }\n }\n </div>\n </div>\n\n <div class=\"ngx-notify-content\">\n <div class=\"ngx-notify-title\" [innerHTML]=\"safeMessage\"></div>\n <div class=\"ngx-notify-description\" [innerHTML]=\"safeDescription\"></div>\n </div>\n\n @if (payload().options.dismissible) {\n <div class=\"ngx-notify-close-container\">\n <button class=\"ngx-notify-close\" (click)=\"close($event)\" aria-label=\"close\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path\n d=\"M315.3 411.3c-6.253 6.253-16.37 6.253-22.63 0L160 278.6l-132.7 132.7c-6.253 6.253-16.37 6.253-22.63 0c-6.253-6.253-6.253-16.37 0-22.63L137.4 256L4.69 123.3c-6.253-6.253-6.253-16.37 0-22.63c6.253-6.253 16.37-6.253 22.63 0L160 233.4l132.7-132.7c6.253-6.253 16.37-6.253 22.63 0c6.253 6.253 6.253 16.37 0 22.63L182.6 256l132.7 132.7C321.6 394.9 321.6 405.1 315.3 411.3z\" />\n </svg>\n </button>\n </div>\n }\n\n <div class=\"ngx-notify-progress\">\n <div class=\"progress-bar\" #bar></div>\n </div>\n</div>\n","import {\n Injectable,\n ComponentRef,\n DOCUMENT,\n inject,\n createComponent,\n EnvironmentInjector,\n ApplicationRef,\n EventEmitter,\n} from '@angular/core';\nimport { NgxNotifyOptions } from '../models/notify-options';\nimport { INotifyEnd, NgxNotifyPayload, NgxNotifyType } from '../models/notify.model';\nimport { WINDOW } from 'ngx-kit/shared';\nimport { NGX_NOTIFY_CONFIG } from '../models/notify-config';\nimport { NgxNotificationComponent } from '../components/notification.component';\n\n// We'll include a tiny inline uuid fallback if uuid package is not available\nfunction makeId() {\n // simple random id\n return 'n_' + Math.random().toString(36).substr(2, 9);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class NgxNotifyService {\n private queue: NgxNotifyPayload[] = [];\n private visible: { ref: ComponentRef<any>; payload: NgxNotifyPayload }[] = [];\n private container: HTMLElement | null = null;\n\n private envInjector = inject(EnvironmentInjector);\n private appRef = inject(ApplicationRef);\n private doc = inject(DOCUMENT);\n private win = inject(WINDOW);\n private defaultOptions = inject(NGX_NOTIFY_CONFIG);\n constructor() {}\n\n configureContainer(position: NgxNotifyOptions['position'], containerClass: string) {\n if (!this.container) {\n this.container = this.doc.createElement('div');\n this.doc.body.appendChild(this.container);\n }\n\n this.container.className = containerClass + ' ngx-notify-container ' + `ngx-pos-${position}`;\n this.container.style.position = 'fixed';\n this.container.style.zIndex = '99999';\n\n // center special\n if (position === 'center') {\n this.container.style.left = '50%';\n this.container.style.top = '50%';\n this.container.style.transform = 'translate(-50%,-50%)';\n this.container.style.display = 'flex';\n this.container.style.flexDirection = 'column';\n this.container.style.alignItems = 'center';\n this.container.style.pointerEvents = 'none';\n } else {\n if (position?.includes('center')) {\n this.container.style.left = '50%';\n this.container.style.transform = 'translateX(-50%)';\n } else {\n this.container.style.transform = 'translateX(0)';\n }\n // corners\n if (position?.includes('top')) {\n this.container.style.top = '20px';\n } else {\n this.container.style.bottom = '20px';\n }\n if (position?.includes('left')) {\n this.container.style.left = '20px';\n this.container.style.right = 'auto';\n }\n if (position?.includes('right')) {\n this.container.style.right = '20px';\n this.container.style.left = 'auto';\n }\n // else container.style.right = '20px';\n this.container.style.display = 'flex';\n this.container.style.flexDirection = 'column';\n if (position?.includes('bottom')) this.container.style.flexDirection = 'column-reverse';\n this.container.style.pointerEvents = 'none';\n }\n }\n\n show(\n message: string,\n description?: string,\n type: NgxNotifyType = 'info',\n options?: NgxNotifyOptions,\n ) {\n const opts: NgxNotifyOptions = { ...this.defaultOptions, ...(options || {}) };\n const id =\n typeof (this.win as any).crypto?.randomUUID === 'function'\n ? (this.win as any).crypto.randomUUID()\n : makeId();\n\n const payload: NgxNotifyPayload = {\n id,\n message,\n description,\n type,\n options: opts,\n onClose: new EventEmitter(),\n onFinish: new EventEmitter(),\n };\n\n this.configureContainer(opts.position!, opts.containerClass!);\n\n // queue or show immediately\n if (this.visible.length >= opts.maxVisible!) {\n this.queue.push(payload);\n } else {\n this._createAndShow(payload);\n }\n return payload;\n }\n\n private _createAndShow(payload: NgxNotifyPayload) {\n if (!this.container)\n this.configureContainer(payload.options.position!, payload.options.containerClass!);\n const host = document.createElement('div');\n this.container!.appendChild(host);\n\n const compRef = createComponent(NgxNotificationComponent, {\n environmentInjector: this.envInjector,\n hostElement: host,\n });\n compRef.setInput('payload', payload);\n compRef.instance.onClose.subscribe((d) => {\n this.removeEl(d);\n payload.onClose.emit(d);\n });\n compRef.instance.onFinish.subscribe((d) => {\n this.removeEl(d);\n payload.onFinish.emit(d);\n payload.onClose.emit(d);\n });\n\n // Registers the component’s view so it participates in change detection cycle.\n this.appRef.attachView(compRef.hostView);\n // store visible\n this.visible.push({ ref: compRef, payload });\n }\n private removeNode(node: HTMLElement, id: string) {\n node.style.opacity = '0';\n node.style.transform = 'translateY(-30px)';\n node.style.transition = 'all 300ms';\n setTimeout(() => {\n const item = this.visible.find((x) => x.payload.id === id);\n if (item) {\n this.appRef.attachView(item.ref.hostView);\n item.ref.destroy();\n }\n this.visible = this.visible.filter((v) => v.payload.id !== id);\n // show next in queue\n this._showNextIfPossible();\n }, 300);\n }\n\n private removeEl(d: INotifyEnd) {\n if (d.el) this.removeNode(d.el, d.id);\n else {\n // if in queue remove it\n this.queue = this.queue.filter((q) => q.id !== d.id);\n }\n }\n\n private _showNextIfPossible() {\n if (!this.queue.length) return;\n const next = this.queue.shift()!;\n // ensure we don't exceed maxVisible\n if (this.visible.length < next.options.maxVisible!) {\n this._createAndShow(next);\n } else {\n // push back\n this.queue.unshift(next);\n }\n }\n}\n","import {\r\n EnvironmentProviders,\r\n inject,\r\n Injector,\r\n makeEnvironmentProviders,\r\n provideEnvironmentInitializer,\r\n} from '@angular/core';\r\nimport { NGX_NOTIFY_API, NGX_NOTIFY_CONFIG, NGX_NOTIFY_DEFAULTS } from './models/notify-config';\r\nimport { NgxNotifyOptions } from './models/notify-options';\r\nimport { Notify as NotifyFacade } from './notify-facade';\r\nimport { NgxNotifyService } from './services/notify.service';\r\nexport function provideNotify(options?: NgxNotifyOptions): EnvironmentProviders {\r\n return makeEnvironmentProviders([\r\n {\r\n provide: NGX_NOTIFY_CONFIG,\r\n useValue: { ...NGX_NOTIFY_DEFAULTS, ...(options || {}) },\r\n },\r\n {\r\n provide: NGX_NOTIFY_API,\r\n useExisting: NgxNotifyService,\r\n },\r\n provideEnvironmentInitializer(() => {\r\n NotifyFacade.injector = inject(Injector);\r\n }),\r\n ]);\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["NotifyFacade"],"mappings":";;;;;;MAIa,iBAAiB,GAAG,IAAI,cAAc,CAAmB,iBAAiB;MAC1E,cAAc,GAAG,IAAI,cAAc,CAAmB,kBAAkB;AAE9E,MAAM,mBAAmB,GAA+B;AAC7D,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,QAAQ,EAAE,YAAY;AACtB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,cAAc,EAAE,eAAe;AAC/B,IAAA,iBAAiB,EAAE,YAAY;;;ACXjC;;;AAGG;MACU,MAAM,CAAA;IACjB,OAAO,QAAQ;IAEf,OAAO,IAAI,CACT,IAAA,GAAiD,MAAM,EACvD,OAAe,EACf,WAAoB,EACpB,OAA0B,EAAA;AAE1B,QAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;AACpB,YAAA,MAAM,IAAI,KAAK,CACb,sFAAsF,CACvF;QACH;AACA,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC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|
|
1
|
+
{"version":3,"file":"ngx-kit-notify.mjs","sources":["../../../projects/libs/notify/models/notify-config.ts","../../../projects/libs/notify/notify-facade.ts","../../../projects/libs/notify/components/notification.component.ts","../../../projects/libs/notify/components/notification.component.html","../../../projects/libs/notify/services/notify.service.ts","../../../projects/libs/notify/notify-provider.ts","../../../projects/libs/notify/ngx-kit-notify.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { NgxNotifyOptions } from './notify-options';\nimport { NgxNotifyService } from '../services/notify.service';\n\nexport const NGX_NOTIFY_CONFIG = new InjectionToken<NgxNotifyOptions>('NgxNotifyOption');\nexport const NGX_NOTIFY_API = new InjectionToken<NgxNotifyService>('NgxNotifyService');\n\nexport const NGX_NOTIFY_DEFAULTS: Required<NgxNotifyOptions> = {\n timeout: 3000,\n position: 'top-center',\n maxVisible: 10,\n allowHtml: false,\n pauseOnHover: true,\n dismissible: true,\n closeOnTap: true,\n containerClass: 'ngx-bg-notify',\n notificationClass: 'ngx-notify',\n};\n","import { Injector } from '@angular/core';\nimport { NgxNotifyOptions } from './models/notify-options';\nimport { NGX_NOTIFY_API } from './models/notify-config';\nimport { NgxNotifyPayload } from './models/notify.model';\n\n/**\n * Static facade so call sites can use: Notify.warn('msg', opts)\n * Module will set the service instance in its constructor.\n */\nexport class Notify {\n static injector: Injector;\n\n static show(\n type: 'info' | 'success' | 'warning' | 'error' = 'info',\n message: string,\n description?: string,\n options?: NgxNotifyOptions,\n ): NgxNotifyPayload {\n if (!Notify.injector) {\n throw new Error(\n 'ngx-kit: Error on EnvironmentProvider. Ensure \"provideNotify()\" in root provider.',\n );\n }\n return Notify.injector.get(NGX_NOTIFY_API).show(message, description, type, options);\n }\n\n static info(message: string, description?: string, options?: NgxNotifyOptions) {\n return this.show('info', message, description, options);\n }\n\n static success(message: string, description?: string, options?: NgxNotifyOptions) {\n return this.show('success', message, description, options);\n }\n static warning(message: string, description?: string, options?: NgxNotifyOptions) {\n return this.show('warning', message, description, options);\n }\n static error(message: string, description?: string, options?: NgxNotifyOptions) {\n return this.show('error', message, description, options);\n }\n}\n","import {\n Component,\n OnInit,\n OnDestroy,\n Input,\n ChangeDetectorRef,\n DOCUMENT,\n inject,\n ElementRef,\n afterNextRender,\n signal,\n output,\n input,\n effect,\n viewChild,\n} from '@angular/core';\nimport { INotifyEnd, NgxNotifyPayload } from '../models/notify.model';\nimport { CommonModule } from '@angular/common';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n@Component({\n selector: 'ngx-notification',\n templateUrl: './notification.component.html',\n styleUrls: ['./notification.component.scss'],\n imports: [CommonModule],\n})\nexport class NgxNotificationComponent implements OnInit, OnDestroy {\n payload = input.required<NgxNotifyPayload>();\n @Input() containerClass = 'ngx-notify';\n\n bar = viewChild<ElementRef<HTMLElement>>('bar');\n onClose = output<INotifyEnd>();\n onFinish = output<INotifyEnd>();\n\n private _rafId = 0;\n private _duration = 0;\n private _remaining = 0;\n private _endTs = 0;\n private _paused = false;\n\n safeMessage: SafeHtml | string = '';\n safeDescription: SafeHtml | string = '';\n showClass = signal('');\n protected doc = inject(DOCUMENT);\n protected el = inject(ElementRef);\n protected sanitizer = inject(DomSanitizer);\n protected chdr = inject(ChangeDetectorRef);\n constructor() {\n afterNextRender(() => {\n this.showClass.set('ngx-show');\n this.chdr.detectChanges();\n });\n effect(() => {\n const payload = this.payload();\n\n // decide how to render message\n if (payload.options.allowHtml) {\n this.safeMessage = this.sanitizer.bypassSecurityTrustHtml(payload.message);\n this.safeDescription = this.sanitizer.bypassSecurityTrustHtml(payload.description ?? '');\n } else {\n this.safeMessage = this.escapeHtml(payload.message);\n this.safeDescription = this.escapeHtml(payload.description);\n }\n });\n effect(() => {\n const timeout = this.payload().options.timeout ?? 0;\n this.startTimer(timeout);\n });\n }\n\n ngOnInit(): void {}\n\n ngOnDestroy(): void {\n this.clearTimer();\n }\n\n // Public API to start timer (used by service when created)\n startTimer(ms: number) {\n this.clearTimer();\n\n if (!this._paused) {\n this._duration = ms;\n }\n this._remaining = ms;\n this._endTs = performance.now() + ms;\n\n const bar = this.bar()?.nativeElement;\n if (bar) {\n bar.style.transition = `transform ${ms}ms linear`;\n bar.style.transform = 'scaleX(1)';\n }\n\n this.animateProgress();\n }\n pauseTimer() {\n this._paused = true;\n cancelAnimationFrame(this._rafId);\n this._remaining = Math.max(0, this._endTs - performance.now());\n const bar = this.bar()?.nativeElement;\n if (bar) {\n const matrix = getComputedStyle(bar).transform;\n bar.style.transition = 'none';\n bar.style.transform = matrix;\n }\n }\n\n resumeTimer() {\n if (!this._paused || this._remaining <= 0) {\n return;\n }\n\n this._paused = false;\n\n this.startTimer(this._remaining);\n }\n\n private clearTimer() {\n cancelAnimationFrame(this._rafId);\n this._rafId = 0;\n }\n\n private animateProgress() {\n const update = () => {\n const remaining = Math.max(0, this._endTs - performance.now());\n if (remaining <= 0) {\n this.onFinish.emit({\n id: this.payload().id,\n el: this.el.nativeElement,\n });\n return;\n }\n\n this._rafId = requestAnimationFrame(update);\n };\n\n this._rafId = requestAnimationFrame(update);\n }\n\n close(ev?: Event) {\n if (ev) ev.stopPropagation();\n this.onClose.emit({ id: this.payload().id, el: this.el.nativeElement });\n }\n\n onMouseEnter() {\n if (this.payload().options.pauseOnHover) this.pauseTimer();\n }\n onMouseLeave() {\n if (this.payload().options.pauseOnHover) this.resumeTimer();\n }\n onTap() {\n if (this.payload().options.closeOnTap) this.close();\n }\n\n escapeHtml(input?: string) {\n if (!input) return '';\n const div = this.doc.createElement('div');\n div.appendChild(this.doc.createTextNode(input));\n return div.textContent;\n }\n\n ngOnDestroyCleanup() {\n this.clearTimer();\n }\n}\n","<div\n class=\"{{ containerClass }} {{ containerClass }}-{{ payload().type }} {{ showClass() }}\"\n role=\"status\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onTap()\"\n [attr.aria-live]=\"\n payload().type === 'error' || payload().type === 'warning' ? 'assertive' : 'polite'\n \"\n [attr.data-id]=\"payload().id\">\n <div class=\"ngx-notify-icon-container\">\n <div class=\"ngx-notify-icon\">\n @switch (payload().type) {\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M235.3 331.3C229.1 337.6 218.9 337.6 212.7 331.3L148.7 267.3C142.4 261.1 142.4 250.9 148.7 244.7C154.9 238.4 165.1 238.4 171.3 244.7L224 297.4L340.7 180.7C346.9 174.4 357.1 174.4 363.3 180.7C369.6 186.9 369.6 197.1 363.3 203.3L235.3 331.3zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 32C132.3 32 32 132.3 32 256C32 379.7 132.3 480 256 480C379.7 480 480 379.7 480 256C480 132.3 379.7 32 256 32z\" />\n </svg>\n }\n @case ('error') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M180.7 180.7C186.9 174.4 197.1 174.4 203.3 180.7L256 233.4L308.7 180.7C314.9 174.4 325.1 174.4 331.3 180.7C337.6 186.9 337.6 197.1 331.3 203.3L278.6 255.1L331.3 308.7C337.6 314.9 337.6 325.1 331.3 331.3C325.1 337.6 314.9 337.6 308.7 331.3L256 278.6L203.3 331.3C197.1 337.6 186.9 337.6 180.7 331.3C174.4 325.1 174.4 314.9 180.7 308.7L233.4 255.1L180.7 203.3C174.4 197.1 174.4 186.9 180.7 180.7V180.7zM.0669 191.5C.0669 172.4 7.652 154.1 21.16 140.6L140.6 21.15C154.1 7.648 172.4 .0625 191.5 .0625H320.5C339.6 .0625 357.9 7.648 371.4 21.15L490.8 140.6C504.3 154.1 511.9 172.4 511.9 191.5V320.5C511.9 339.6 504.3 357.9 490.8 371.4L371.4 490.8C357.9 504.3 339.6 511.9 320.5 511.9H191.5C172.4 511.9 154.1 504.3 140.6 490.8L21.15 371.4C7.652 357.9 .0666 339.6 .0666 320.5L.0669 191.5zM43.78 163.2C36.28 170.7 32.07 180.9 32.07 191.5V320.5C32.07 331.1 36.28 341.3 43.78 348.8L163.2 468.2C170.7 475.7 180.9 479.9 191.5 479.9H320.5C331.1 479.9 341.3 475.7 348.8 468.2L468.2 348.8C475.7 341.3 479.9 331.1 479.9 320.5V191.5C479.9 180.9 475.7 170.7 468.2 163.2L348.8 43.78C341.3 36.28 331.1 32.06 320.5 32.06H191.5C180.9 32.06 170.7 36.28 163.2 43.78L43.78 163.2zM43.78 348.8L21.15 371.4z\" />\n </svg>\n }\n @case ('warning') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 360c-13.25 0-23.1 10.74-23.1 24c0 13.25 10.75 24 23.1 24c13.25 0 23.1-10.75 23.1-24C280 370.7 269.3 360 256 360zM256 320c8.843 0 15.1-7.156 15.1-16V160c0-8.844-7.155-16-15.1-16S240 151.2 240 160v144C240 312.8 247.2 320 256 320zM504.3 397.3L304.5 59.38C294.4 42.27 276.2 32.03 256 32C235.8 32 217.7 42.22 207.5 59.36l-199.9 338c-10.05 16.97-10.2 37.34-.4218 54.5C17.29 469.5 35.55 480 56.1 480h399.9c20.51 0 38.75-10.53 48.81-28.17C514.6 434.7 514.4 414.3 504.3 397.3zM476.1 435.1C472.7 443.5 464.8 448 455.1 448H56.1c-8.906 0-16.78-4.484-21.08-12c-4.078-7.156-4.015-15.3 .1562-22.36L235.1 75.66C239.4 68.36 247.2 64 256 64c0 0-.0156 0 0 0c8.765 .0156 16.56 4.359 20.86 11.64l199.9 338C480.1 420.7 481.1 428.8 476.1 435.1z\" />\n </svg>\n }\n @case ('info') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d=\"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 480c-123.5 0-224-100.5-224-224s100.5-224 224-224s224 100.5 224 224S379.5 480 256 480zM256 184c13.25 0 24-10.74 24-24c0-13.25-10.75-24-24-24S232 146.7 232 160C232 173.3 242.7 184 256 184zM304 352h-32V240C272 231.2 264.8 224 256 224H224C215.2 224 208 231.2 208 240S215.2 256 224 256h16v96h-32C199.2 352 192 359.2 192 368C192 376.8 199.2 384 208 384h96c8.836 0 16-7.164 16-16C320 359.2 312.8 352 304 352z\" />\n </svg>\n }\n }\n </div>\n </div>\n\n <div class=\"ngx-notify-content\">\n <div class=\"ngx-notify-title\" [innerHTML]=\"safeMessage\"></div>\n <div class=\"ngx-notify-description\" [innerHTML]=\"safeDescription\"></div>\n </div>\n\n @if (payload().options.dismissible) {\n <div class=\"ngx-notify-close-container\">\n <button class=\"ngx-notify-close\" (click)=\"close($event)\" aria-label=\"close\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path\n fill=\"currentColor\"\n d=\"M315.3 411.3c-6.253 6.253-16.37 6.253-22.63 0L160 278.6l-132.7 132.7c-6.253 6.253-16.37 6.253-22.63 0c-6.253-6.253-6.253-16.37 0-22.63L137.4 256L4.69 123.3c-6.253-6.253-6.253-16.37 0-22.63c6.253-6.253 16.37-6.253 22.63 0L160 233.4l132.7-132.7c6.253-6.253 16.37-6.253 22.63 0c6.253 6.253 6.253 16.37 0 22.63L182.6 256l132.7 132.7C321.6 394.9 321.6 405.1 315.3 411.3z\" />\n </svg>\n </button>\n </div>\n }\n\n <div class=\"ngx-notify-progress\">\n <div class=\"progress-bar\" #bar></div>\n </div>\n</div>\n","import {\n Injectable,\n ComponentRef,\n DOCUMENT,\n inject,\n createComponent,\n EnvironmentInjector,\n ApplicationRef,\n EventEmitter,\n} from '@angular/core';\nimport { NgxNotifyOptions } from '../models/notify-options';\nimport { INotifyEnd, NgxNotifyPayload, NgxNotifyType } from '../models/notify.model';\nimport { WINDOW } from 'ngx-kit/shared';\nimport { NGX_NOTIFY_CONFIG } from '../models/notify-config';\nimport { NgxNotificationComponent } from '../components/notification.component';\n\n// We'll include a tiny inline uuid fallback if uuid package is not available\nfunction makeId() {\n // simple random id\n return 'n_' + Math.random().toString(36).substr(2, 9);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class NgxNotifyService {\n private queue: NgxNotifyPayload[] = [];\n private visible: { ref: ComponentRef<any>; payload: NgxNotifyPayload }[] = [];\n private container: HTMLElement | null = null;\n\n private envInjector = inject(EnvironmentInjector);\n private appRef = inject(ApplicationRef);\n private doc = inject(DOCUMENT);\n private win = inject(WINDOW);\n private defaultOptions = inject(NGX_NOTIFY_CONFIG);\n constructor() {}\n\n configureContainer(position: NgxNotifyOptions['position'], containerClass: string) {\n if (!this.container) {\n this.container = this.doc.createElement('div');\n this.doc.body.appendChild(this.container);\n }\n\n this.container.className = containerClass + ' ngx-notify-container ' + `ngx-pos-${position}`;\n this.container.style.position = 'fixed';\n this.container.style.zIndex = '99999';\n\n // center special\n if (position === 'center') {\n this.container.style.left = '50%';\n this.container.style.top = '50%';\n this.container.style.transform = 'translate(-50%,-50%)';\n this.container.style.display = 'flex';\n this.container.style.flexDirection = 'column';\n this.container.style.alignItems = 'center';\n this.container.style.pointerEvents = 'none';\n } else {\n if (position?.includes('center')) {\n this.container.style.left = '50%';\n this.container.style.transform = 'translateX(-50%)';\n } else {\n this.container.style.transform = 'translateX(0)';\n }\n // corners\n if (position?.includes('top')) {\n this.container.style.top = '20px';\n } else {\n this.container.style.bottom = '20px';\n }\n if (position?.includes('left')) {\n this.container.style.left = '20px';\n this.container.style.right = 'auto';\n }\n if (position?.includes('right')) {\n this.container.style.right = '20px';\n this.container.style.left = 'auto';\n }\n // else container.style.right = '20px';\n this.container.style.display = 'flex';\n this.container.style.flexDirection = 'column';\n if (position?.includes('bottom')) this.container.style.flexDirection = 'column-reverse';\n this.container.style.pointerEvents = 'none';\n }\n }\n\n show(\n message: string,\n description?: string,\n type: NgxNotifyType = 'info',\n options?: NgxNotifyOptions,\n ) {\n const opts: NgxNotifyOptions = { ...this.defaultOptions, ...(options || {}) };\n const id =\n typeof (this.win as any).crypto?.randomUUID === 'function'\n ? (this.win as any).crypto.randomUUID()\n : makeId();\n\n const payload: NgxNotifyPayload = {\n id,\n message,\n description,\n type,\n options: opts,\n onClose: new EventEmitter(),\n onFinish: new EventEmitter(),\n };\n\n this.configureContainer(opts.position!, opts.containerClass!);\n\n // queue or show immediately\n if (this.visible.length >= opts.maxVisible!) {\n this.queue.push(payload);\n } else {\n this._createAndShow(payload);\n }\n return payload;\n }\n\n private _createAndShow(payload: NgxNotifyPayload) {\n if (!this.container)\n this.configureContainer(payload.options.position!, payload.options.containerClass!);\n const host = document.createElement('div');\n this.container!.appendChild(host);\n\n const compRef = createComponent(NgxNotificationComponent, {\n environmentInjector: this.envInjector,\n hostElement: host,\n });\n compRef.setInput('payload', payload);\n compRef.instance.onClose.subscribe((d) => {\n this.removeEl(d);\n payload.onClose.emit(d);\n });\n compRef.instance.onFinish.subscribe((d) => {\n this.removeEl(d);\n payload.onFinish.emit(d);\n payload.onClose.emit(d);\n });\n\n // Registers the component’s view so it participates in change detection cycle.\n this.appRef.attachView(compRef.hostView);\n // store visible\n this.visible.push({ ref: compRef, payload });\n }\n private removeNode(node: HTMLElement, id: string) {\n node.style.opacity = '0';\n node.style.transform = 'translateY(-30px)';\n node.style.transition = 'all 300ms';\n setTimeout(() => {\n const item = this.visible.find((x) => x.payload.id === id);\n if (item) {\n this.appRef.attachView(item.ref.hostView);\n item.ref.destroy();\n }\n this.visible = this.visible.filter((v) => v.payload.id !== id);\n // show next in queue\n this._showNextIfPossible();\n }, 300);\n }\n\n private removeEl(d: INotifyEnd) {\n if (d.el) this.removeNode(d.el, d.id);\n else {\n // if in queue remove it\n this.queue = this.queue.filter((q) => q.id !== d.id);\n }\n }\n\n private _showNextIfPossible() {\n if (!this.queue.length) return;\n const next = this.queue.shift()!;\n // ensure we don't exceed maxVisible\n if (this.visible.length < next.options.maxVisible!) {\n this._createAndShow(next);\n } else {\n // push back\n this.queue.unshift(next);\n }\n }\n}\n","import {\r\n EnvironmentProviders,\r\n inject,\r\n Injector,\r\n makeEnvironmentProviders,\r\n provideEnvironmentInitializer,\r\n} from '@angular/core';\r\nimport { NGX_NOTIFY_API, NGX_NOTIFY_CONFIG, NGX_NOTIFY_DEFAULTS } from './models/notify-config';\r\nimport { NgxNotifyOptions } from './models/notify-options';\r\nimport { Notify as NotifyFacade } from './notify-facade';\r\nimport { NgxNotifyService } from './services/notify.service';\r\nexport function provideNotify(options?: NgxNotifyOptions): EnvironmentProviders {\r\n return makeEnvironmentProviders([\r\n {\r\n provide: NGX_NOTIFY_CONFIG,\r\n useValue: { ...NGX_NOTIFY_DEFAULTS, ...(options || {}) },\r\n },\r\n {\r\n provide: NGX_NOTIFY_API,\r\n useExisting: NgxNotifyService,\r\n },\r\n provideEnvironmentInitializer(() => {\r\n NotifyFacade.injector = inject(Injector);\r\n }),\r\n ]);\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["NotifyFacade"],"mappings":";;;;;;MAIa,iBAAiB,GAAG,IAAI,cAAc,CAAmB,iBAAiB;MAC1E,cAAc,GAAG,IAAI,cAAc,CAAmB,kBAAkB;AAE9E,MAAM,mBAAmB,GAA+B;AAC7D,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,QAAQ,EAAE,YAAY;AACtB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,cAAc,EAAE,eAAe;AAC/B,IAAA,iBAAiB,EAAE,YAAY;;;ACXjC;;;AAGG;MACU,MAAM,CAAA;IACjB,OAAO,QAAQ;IAEf,OAAO,IAAI,CACT,IAAA,GAAiD,MAAM,EACvD,OAAe,EACf,WAAoB,EACpB,OAA0B,EAAA;AAE1B,QAAA,IAAI,CAAC,MAAM,CAAC,QAAQ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A,MAAY,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC1C,QAAA,CAAC,CAAC;AACH,KAAA,CAAC;AACJ;;ACzBA;;AAEG;;;;"}
|
|
@@ -679,6 +679,24 @@ function randomStrnig(extraLength = 4, useNumeric = false) {
|
|
|
679
679
|
return `${Date.now().toString(36)}-${out.join('')}`;
|
|
680
680
|
}
|
|
681
681
|
|
|
682
|
+
function IsRtl(doc) {
|
|
683
|
+
return getComputedStyle(doc.documentElement).direction === 'rtl';
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
function makeConfetti(doc, wrap) {
|
|
687
|
+
wrap.innerHTML = '';
|
|
688
|
+
const colors = ['#3ee08f', '#43e0d8', '#8b7bff', '#ffc45c'];
|
|
689
|
+
for (let i = 0; i < 24; i++) {
|
|
690
|
+
const s = doc.createElement('span');
|
|
691
|
+
s.style.left = Math.random() * 100 + '%';
|
|
692
|
+
s.style.background = colors[i % colors.length];
|
|
693
|
+
s.style.animationDelay = Math.random() * 0.4 + 's';
|
|
694
|
+
s.style.animationDuration = 1.2 + Math.random() * 0.8 + 's';
|
|
695
|
+
s.style.borderRadius = Math.random() > 0.5 ? '50%' : '2px';
|
|
696
|
+
wrap.appendChild(s);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
682
700
|
class BrowserService {
|
|
683
701
|
platformId;
|
|
684
702
|
constructor(platformId) {
|
|
@@ -954,7 +972,7 @@ class OverlayService {
|
|
|
954
972
|
const dialogRect = dialog.getBoundingClientRect();
|
|
955
973
|
const vw = Math.min(document.body.clientWidth, window.innerWidth);
|
|
956
974
|
const vh = Math.min(document.body.clientHeight, window.innerHeight);
|
|
957
|
-
const isRTL =
|
|
975
|
+
const isRTL = IsRtl(this.doc);
|
|
958
976
|
let top = 0;
|
|
959
977
|
let left = 'auto';
|
|
960
978
|
let right = 'auto';
|
|
@@ -1019,5 +1037,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
1019
1037
|
* Generated bundle index. Do not edit.
|
|
1020
1038
|
*/
|
|
1021
1039
|
|
|
1022
|
-
export { BrowserService, DIALOG_OVERLAY_CLASSNAME, FOCUSABLE_SELECTOR, OverlayRef, OverlayService, RangeSliderComponent, SaturationComponent, SliderComponent, ValueModel, WINDOW, getOffsetPosition, randomStrnig };
|
|
1040
|
+
export { BrowserService, DIALOG_OVERLAY_CLASSNAME, FOCUSABLE_SELECTOR, IsRtl, OverlayRef, OverlayService, RangeSliderComponent, SaturationComponent, SliderComponent, ValueModel, WINDOW, getOffsetPosition, makeConfetti, randomStrnig };
|
|
1023
1041
|
//# sourceMappingURL=ngx-kit-shared.mjs.map
|