ngx-kit 8.3.8 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +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 usePopover: true,\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 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","<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';\n\nimport { NgxNotifyOptions } from '../models/notify-options';\nimport { INotifyEnd, NgxNotifyPayload, NgxNotifyType } from '../models/notify.model';\nimport { WINDOW } from 'ngx-kit/core';\nimport { NGX_NOTIFY_CONFIG } from '../models/notify-config';\nimport { NgxNotificationComponent } from '../components/notification.component';\n\nfunction makeId(): string {\n return 'n_' + Math.random().toString(36).substring(2, 11);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class NgxNotifyService {\n private queue: NgxNotifyPayload[] = [];\n\n private visible: {\n ref: ComponentRef<NgxNotificationComponent>;\n payload: NgxNotifyPayload;\n }[] = [];\n\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\n private removalTimers = new Map<string, ReturnType<typeof setTimeout>>();\n\n constructor() {}\n\n configureContainer(opt: NgxNotifyOptions): void {\n const { containerClass, position, usePopover } = opt;\n\n if (!this.container) {\n this.container = this.doc.createElement('div');\n this.doc.body.appendChild(this.container);\n }\n\n const container = this.container;\n\n container.className = containerClass + ' ngx-notify-container ngx-pos-' + position;\n\n // Explicitly reset positioning so changing options does not leave\n // stale styles from the previous configuration.\n Object.assign(container.style, {\n position: 'fixed',\n zIndex: '99999',\n inset: 'auto',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n margin: '0',\n transform: 'none',\n width: 'max-content',\n maxWidth: 'calc(100vw - 40px)',\n maxHeight: 'calc(100vh - 40px)',\n boxSizing: 'border-box',\n border: '0',\n padding: '0',\n background: 'transparent',\n color: 'inherit',\n overflow: 'visible',\n pointerEvents: 'none',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'stretch',\n });\n\n // Detect the page's direction without requiring an extra option.\n const direction =\n container.closest('[dir]')?.getAttribute('dir') ||\n this.doc.documentElement.getAttribute('dir') ||\n this.doc.body?.getAttribute('dir') ||\n 'ltr';\n\n container.dir = direction === 'rtl' ? 'rtl' : 'ltr';\n\n // Keep left/right as physical viewport positions.\n // RTL affects text direction, not the meaning of these positions.\n switch (position) {\n case 'center':\n container.style.top = '50%';\n container.style.left = '50%';\n container.style.transform = 'translate(-50%, -50%)';\n container.style.alignItems = 'center';\n break;\n\n default: {\n if (position?.includes('top')) {\n container.style.top = '20px';\n } else {\n container.style.bottom = '20px';\n }\n\n if (position?.includes('left')) {\n container.style.left = '20px';\n container.style.alignItems = 'flex-start';\n } else if (position?.includes('right')) {\n container.style.right = '20px';\n container.style.alignItems = 'flex-end';\n } else if (position?.includes('center')) {\n container.style.left = '50%';\n container.style.transform = 'translateX(-50%)';\n container.style.alignItems = 'center';\n }\n\n if (position?.includes('bottom')) {\n container.style.flexDirection = 'column-reverse';\n }\n\n break;\n }\n }\n\n if (usePopover) {\n // Apply the positioning styles before entering the top layer.\n container.setAttribute('popover', 'manual');\n\n if (!container.matches(':popover-open')) {\n try {\n container.showPopover();\n } catch {\n // Avoid breaking notification display if the browser does not\n // support Popover or the element cannot enter the top layer.\n container.removeAttribute('popover');\n }\n }\n } else {\n if (container.matches(':popover-open')) {\n try {\n container.hidePopover();\n } catch {\n // The element may already have left the top layer.\n }\n }\n\n container.removeAttribute('popover');\n }\n }\n\n show(\n message: string,\n description?: string,\n type: NgxNotifyType = 'info',\n options?: NgxNotifyOptions,\n ) {\n const opts: NgxNotifyOptions = {\n ...this.defaultOptions,\n ...(options || {}),\n };\n\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 close: () => this.close(id),\n };\n\n this.configureContainer(opts);\n\n // Cancel a pending removal if the same ID is ever reused.\n const timer = this.removalTimers.get(id);\n if (timer) {\n clearTimeout(timer);\n this.removalTimers.delete(id);\n }\n\n if (this.visible.length >= opts.maxVisible!) {\n this.queue.push(payload);\n } else {\n this._createAndShow(payload);\n }\n\n return payload;\n }\n\n private _createAndShow(payload: NgxNotifyPayload): void {\n if (!this.container) {\n this.configureContainer(payload.options);\n }\n\n // Use DOCUMENT rather than the global document.\n const host = this.doc.createElement('div');\n\n this.container!.appendChild(host);\n\n const compRef = createComponent(NgxNotificationComponent, {\n environmentInjector: this.envInjector,\n hostElement: host,\n });\n\n compRef.setInput('payload', payload);\n\n compRef.instance.onClose.subscribe((d) => {\n this.removeEl(d);\n payload.onClose.emit(d);\n });\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\n private close(id: string): void {\n const item = this.visible.find((x) => x.payload.id === id);\n\n if (item) {\n const el = item.ref.instance.el.nativeElement;\n\n if (el) {\n this.removeEl({ id, el });\n }\n }\n\n // If the notification is still queued, remove it immediately.\n this.queue = this.queue.filter((q) => q.id !== id);\n\n this.cleanupIfEmpty();\n }\n\n private removeNode(node: HTMLElement, id: string): void {\n // Prevent multiple close/finish events from scheduling duplicate\n // removal operations for the same notification.\n if (this.removalTimers.has(id)) {\n return;\n }\n\n node.style.opacity = '0';\n node.style.transform = 'translateY(-30px)';\n node.style.transition = 'all 300ms';\n\n const timer = setTimeout(() => {\n this.removalTimers.delete(id);\n\n const item = this.visible.find((x) => x.payload.id === id);\n\n if (item) {\n this.appRef.detachView(item.ref.hostView);\n item.ref.destroy();\n }\n\n this.visible = this.visible.filter((v) => v.payload.id !== id);\n\n // Preserve queue behavior: make room first, then clean up.\n this._showNextIfPossible();\n\n this.cleanupIfEmpty();\n }, 300);\n\n this.removalTimers.set(id, timer);\n }\n\n private removeEl(d: INotifyEnd): void {\n if (d.el) {\n this.removeNode(d.el, d.id);\n } else {\n this.queue = this.queue.filter((q) => q.id !== d.id);\n this.cleanupIfEmpty();\n }\n }\n\n private _showNextIfPossible(): void {\n if (!this.queue.length) {\n return;\n }\n\n const next = this.queue[0];\n\n if (this.visible.length < next.options.maxVisible!) {\n this.queue.shift();\n\n // Reapply this notification's configuration if needed.\n this.configureContainer(next.options);\n this._createAndShow(next);\n }\n }\n\n private cleanupIfEmpty(): void {\n // Do not remove the container while notifications are visible,\n // waiting in the queue, or still animating out.\n if (this.visible.length > 0 || this.queue.length > 0 || this.removalTimers.size > 0) {\n return;\n }\n\n const container = this.container;\n\n if (!container) {\n return;\n }\n\n if (container.matches(':popover-open')) {\n try {\n container.hidePopover();\n } catch {\n // Ignore an already-closed popover.\n }\n }\n\n container.remove();\n this.container = null;\n }\n}\n","import {\n EnvironmentProviders,\n inject,\n Injector,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n} from '@angular/core';\nimport { NGX_NOTIFY_API, NGX_NOTIFY_CONFIG, NGX_NOTIFY_DEFAULTS } from './models/notify-config';\nimport { NgxNotifyOptions } from './models/notify-options';\nimport { Notify as NotifyFacade } from './notify-facade';\nimport { NgxNotifyService } from './services/notify.service';\nexport function provideNotify(options?: NgxNotifyOptions): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: NGX_NOTIFY_CONFIG,\n useValue: { ...NGX_NOTIFY_DEFAULTS, ...(options || {}) },\n },\n {\n provide: NGX_NOTIFY_API,\n useExisting: NgxNotifyService,\n },\n provideEnvironmentInitializer(() => {\n NotifyFacade.injector = inject(Injector);\n }),\n ]);\n}\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,I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,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cADH,MAAM,EAAA,CAAA;;2FACnB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACV5B,SAAU,aAAa,CAAC,OAA0B,EAAA;AACtD,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA;AACE,YAAA,OAAO,EAAE,iBAAiB;YAC1B,QAAQ,EAAE,EAAE,GAAG,mBAAmB,EAAE,IAAI,OAAO,IAAI,EAAE,CAAC,EAAE;AACzD,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,cAAc;AACvB,YAAA,WAAW,EAAE,gBAAgB;AAC9B,SAAA;QACD,6BAA6B,CAAC,MAAK;AACjC,YAAAA,MAAY,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC1C,QAAA,CAAC,CAAC;AACH,KAAA,CAAC;AACJ;;ACzBA;;AAEG;;;;"}
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 usePopover: true,\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 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","<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';\n\nimport { NgxNotifyOptions } from '../models/notify-options';\nimport { INotifyEnd, NgxNotifyPayload, NgxNotifyType } from '../models/notify.model';\nimport { WINDOW } from 'ngx-kit/core';\nimport { NGX_NOTIFY_CONFIG } from '../models/notify-config';\nimport { NgxNotificationComponent } from '../components/notification.component';\n\nfunction makeId(): string {\n return 'n_' + Math.random().toString(36).substring(2, 11);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class NgxNotifyService {\n private queue: NgxNotifyPayload[] = [];\n\n private visible: {\n ref: ComponentRef<NgxNotificationComponent>;\n payload: NgxNotifyPayload;\n }[] = [];\n\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\n private removalTimers = new Map<string, ReturnType<typeof setTimeout>>();\n\n constructor() {}\n\n configureContainer(opt: NgxNotifyOptions): void {\n const { containerClass, position, usePopover } = opt;\n\n if (!this.container) {\n this.container = this.doc.createElement('div');\n this.doc.body.appendChild(this.container);\n }\n\n const container = this.container;\n\n container.className = containerClass + ' ngx-notify-container ngx-pos-' + position;\n\n // Explicitly reset positioning so changing options does not leave\n // stale styles from the previous configuration.\n Object.assign(container.style, {\n position: 'fixed',\n zIndex: '99999',\n inset: 'auto',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n margin: '0',\n transform: 'none',\n width: 'max-content',\n maxWidth: 'calc(100vw - 40px)',\n maxHeight: 'calc(100vh - 40px)',\n boxSizing: 'border-box',\n border: '0',\n padding: '0',\n background: 'transparent',\n color: 'inherit',\n overflow: 'visible',\n pointerEvents: 'none',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'stretch',\n });\n\n // Detect the page's direction without requiring an extra option.\n const direction =\n container.closest('[dir]')?.getAttribute('dir') ||\n this.doc.documentElement.getAttribute('dir') ||\n this.doc.body?.getAttribute('dir') ||\n 'ltr';\n\n container.dir = direction === 'rtl' ? 'rtl' : 'ltr';\n\n // Keep left/right as physical viewport positions.\n // RTL affects text direction, not the meaning of these positions.\n switch (position) {\n case 'center':\n container.style.top = '50%';\n container.style.left = '50%';\n container.style.transform = 'translate(-50%, -50%)';\n container.style.alignItems = 'center';\n break;\n\n default: {\n if (position?.includes('top')) {\n container.style.top = '20px';\n } else {\n container.style.bottom = '20px';\n }\n\n if (position?.includes('left')) {\n container.style.left = '20px';\n container.style.alignItems = 'flex-start';\n } else if (position?.includes('right')) {\n container.style.right = '20px';\n container.style.alignItems = 'flex-end';\n } else if (position?.includes('center')) {\n container.style.left = '50%';\n container.style.transform = 'translateX(-50%)';\n container.style.alignItems = 'center';\n }\n\n if (position?.includes('bottom')) {\n container.style.flexDirection = 'column-reverse';\n }\n\n break;\n }\n }\n\n if (usePopover) {\n // Apply the positioning styles before entering the top layer.\n container.setAttribute('popover', 'manual');\n\n if (!container.matches(':popover-open')) {\n try {\n container.showPopover();\n } catch {\n // Avoid breaking notification display if the browser does not\n // support Popover or the element cannot enter the top layer.\n container.removeAttribute('popover');\n }\n }\n } else {\n if (container.matches(':popover-open')) {\n try {\n container.hidePopover();\n } catch {\n // The element may already have left the top layer.\n }\n }\n\n container.removeAttribute('popover');\n }\n }\n\n show(\n message: string,\n description?: string,\n type: NgxNotifyType = 'info',\n options?: NgxNotifyOptions,\n ) {\n const opts: NgxNotifyOptions = {\n ...this.defaultOptions,\n ...(options || {}),\n };\n\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 close: () => this.close(id),\n };\n\n this.configureContainer(opts);\n\n // Cancel a pending removal if the same ID is ever reused.\n const timer = this.removalTimers.get(id);\n if (timer) {\n clearTimeout(timer);\n this.removalTimers.delete(id);\n }\n\n if (this.visible.length >= opts.maxVisible!) {\n this.queue.push(payload);\n } else {\n this._createAndShow(payload);\n }\n\n return payload;\n }\n\n private _createAndShow(payload: NgxNotifyPayload): void {\n if (!this.container) {\n this.configureContainer(payload.options);\n }\n\n // Use DOCUMENT rather than the global document.\n const host = this.doc.createElement('div');\n\n this.container!.appendChild(host);\n\n const compRef = createComponent(NgxNotificationComponent, {\n environmentInjector: this.envInjector,\n hostElement: host,\n });\n\n compRef.setInput('payload', payload);\n\n compRef.instance.onClose.subscribe((d) => {\n this.removeEl(d);\n payload.onClose.emit(d);\n });\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\n private close(id: string): void {\n const item = this.visible.find((x) => x.payload.id === id);\n\n if (item) {\n const el = item.ref.instance.el.nativeElement;\n\n if (el) {\n this.removeEl({ id, el });\n }\n }\n\n // If the notification is still queued, remove it immediately.\n this.queue = this.queue.filter((q) => q.id !== id);\n\n this.cleanupIfEmpty();\n }\n\n private removeNode(node: HTMLElement, id: string): void {\n // Prevent multiple close/finish events from scheduling duplicate\n // removal operations for the same notification.\n if (this.removalTimers.has(id)) {\n return;\n }\n\n node.style.opacity = '0';\n node.style.transform = 'translateY(-30px)';\n node.style.transition = 'all 300ms';\n\n const timer = setTimeout(() => {\n this.removalTimers.delete(id);\n\n const item = this.visible.find((x) => x.payload.id === id);\n\n if (item) {\n this.appRef.detachView(item.ref.hostView);\n item.ref.destroy();\n }\n\n this.visible = this.visible.filter((v) => v.payload.id !== id);\n\n // Preserve queue behavior: make room first, then clean up.\n this._showNextIfPossible();\n\n this.cleanupIfEmpty();\n }, 300);\n\n this.removalTimers.set(id, timer);\n }\n\n private removeEl(d: INotifyEnd): void {\n if (d.el) {\n this.removeNode(d.el, d.id);\n } else {\n this.queue = this.queue.filter((q) => q.id !== d.id);\n this.cleanupIfEmpty();\n }\n }\n\n private _showNextIfPossible(): void {\n if (!this.queue.length) {\n return;\n }\n\n const next = this.queue[0];\n\n if (this.visible.length < next.options.maxVisible!) {\n this.queue.shift();\n\n // Reapply this notification's configuration if needed.\n this.configureContainer(next.options);\n this._createAndShow(next);\n }\n }\n\n private cleanupIfEmpty(): void {\n // Do not remove the container while notifications are visible,\n // waiting in the queue, or still animating out.\n if (this.visible.length > 0 || this.queue.length > 0 || this.removalTimers.size > 0) {\n return;\n }\n\n const container = this.container;\n\n if (!container) {\n return;\n }\n\n if (container.matches(':popover-open')) {\n try {\n container.hidePopover();\n } catch {\n // Ignore an already-closed popover.\n }\n }\n\n container.remove();\n this.container = null;\n }\n}\n","import {\n EnvironmentProviders,\n inject,\n Injector,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n} from '@angular/core';\nimport { NGX_NOTIFY_API, NGX_NOTIFY_CONFIG, NGX_NOTIFY_DEFAULTS } from './models/notify-config';\nimport { NgxNotifyOptions } from './models/notify-options';\nimport { Notify as NotifyFacade } from './notify-facade';\nimport { NgxNotifyService } from './services/notify.service';\nexport function provideNotify(options?: NgxNotifyOptions): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: NGX_NOTIFY_CONFIG,\n useValue: { ...NGX_NOTIFY_DEFAULTS, ...(options || {}) },\n },\n {\n provide: NGX_NOTIFY_API,\n useExisting: NgxNotifyService,\n },\n provideEnvironmentInitializer(() => {\n NotifyFacade.injector = inject(Injector);\n }),\n ]);\n}\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;AAC/B,IAAA,UAAU,EAAE,IAAI;;;ACZlB;;;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,mFAAmF,CACpF;QACH;AACA,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC;IACtF;AAEA,IAAA,OAAO,IAAI,CAAC,OAAe,EAAE,WAAoB,EAAE,OAA0B,EAAA;AAC3E,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC;IACzD;AAEA,IAAA,O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@
1
1
  {
2
2
  "name": "ngx-kit",
3
- "version": "8.3.8",
3
+ "version": "8.4.0",
4
4
  "description": "Angular input components",
5
5
  "author": "Mohammadreza Samani <mr.samani1368@gmail.com>",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { InputSignal, Type, TemplateRef, InjectionToken, EnvironmentProviders, OnInit, AfterContentInit } from '@angular/core';
2
+ import { InputSignal, Type, TemplateRef, InjectionToken, EnvironmentProviders, OnInit, AfterContentInit, ElementRef } from '@angular/core';
3
3
  import * as ngx_kit_core from 'ngx-kit/core';
4
4
  import * as ngx_kit_data_table from 'ngx-kit/data-table';
5
5
 
@@ -9,6 +9,42 @@ interface SortMeta<T> {
9
9
  direction: SortDirection;
10
10
  }
11
11
 
12
+ declare enum DynamicDataFilterOperator {
13
+ Equal = 0,
14
+ NotEqual = 1,
15
+ Contains = 2,
16
+ StartsWith = 3,
17
+ EndsWith = 4,
18
+ GreaterThan = 5,
19
+ GreaterThanOrEqual = 6,
20
+ LessThan = 7,
21
+ LessThanOrEqual = 8,
22
+ Between = 9,
23
+ In = 10,
24
+ IsNull = 11,
25
+ IsNotNull = 12,
26
+ IsEmpty = 13,
27
+ IsNotEmpty = 14
28
+ }
29
+ type FilterDataType = 'text' | 'number' | 'date' | 'boolean' | 'enum';
30
+ interface EnumFilterOption<T = unknown> {
31
+ label: string;
32
+ value: T;
33
+ }
34
+ interface ColumnFilterConfig<T = unknown> {
35
+ type?: FilterDataType;
36
+ enabled?: boolean;
37
+ options?: EnumFilterOption<T>[];
38
+ placeholder?: string;
39
+ defaultOperator?: DynamicDataFilterOperator;
40
+ }
41
+ interface ColumnFilterState {
42
+ field: string;
43
+ operator: DynamicDataFilterOperator;
44
+ value: unknown;
45
+ valueTo?: unknown;
46
+ }
47
+
12
48
  interface PageEvent {
13
49
  page: number;
14
50
  pageSize: number;
@@ -16,13 +52,12 @@ interface PageEvent {
16
52
  interface PageState {
17
53
  pageIndex: number;
18
54
  pageSize: number;
19
- /** آفست صفر-پایه‌ی اولین ردیف صفحه‌ی جاری. */
20
55
  first: number;
21
56
  }
22
- /** هر بار سرور باید صفحه‌ی جدید را (در حالت lazy) واکشی کند، امیت می‌شود. */
23
57
  interface LazyLoadEvent<T> extends PageState {
24
58
  sorts?: SortMeta<T>[];
25
59
  sorting?: string;
60
+ filters?: ColumnFilterState[];
26
61
  }
27
62
 
28
63
  interface NgxPaginationOptions {
@@ -57,7 +92,7 @@ interface CellTemplateContext<T extends object> {
57
92
  field: TableFieldBase<T>;
58
93
  }
59
94
  /** شکل پایه‌ای مشترک بین همه‌ی ستون‌ها، صرف‌نظر از این‌که renderer دارند یا نه. */
60
- interface TableFieldBase<T extends object> {
95
+ interface TableFieldBase<T extends object, K extends keyof T = keyof T> {
61
96
  column: Extract<keyof T, string>;
62
97
  title: string;
63
98
  /**
@@ -76,6 +111,8 @@ interface TableFieldBase<T extends object> {
76
111
  align?: ColumnAlign;
77
112
  prefix?: string;
78
113
  formatter?: string | TableCellFormatter<T>;
114
+ filterable?: boolean;
115
+ filterConfig?: ColumnFilterConfig<T[K]>;
79
116
  }
80
117
  /** ستون بدون renderer (متن ساده / formatter / cellTemplate دستی). */
81
118
  interface PlainTableField<T extends object> extends TableFieldBase<T> {
@@ -140,6 +177,29 @@ declare class TableLocalization {
140
177
  noData: string;
141
178
  loading: string;
142
179
  operation: string;
180
+ filter: string;
181
+ clearFilter: string;
182
+ applyFilter: string;
183
+ search: string;
184
+ selectAll: string;
185
+ from: string;
186
+ to: string;
187
+ trueText: string;
188
+ falseText: string;
189
+ opEqual: string;
190
+ opNotEqual: string;
191
+ opContains: string;
192
+ opStartsWith: string;
193
+ opEndsWith: string;
194
+ opGreaterThan: string;
195
+ opGreaterThanOrEqual: string;
196
+ opLessThan: string;
197
+ opLessThanOrEqual: string;
198
+ opBetween: string;
199
+ opIsNull: string;
200
+ opIsNotNull: string;
201
+ opIsEmpty: string;
202
+ opIsNotEmpty: string;
143
203
  }
144
204
 
145
205
  declare const NGX_TABLE_CONFIG: InjectionToken<ResolvedTableOptions>;
@@ -229,24 +289,19 @@ declare class ColumnResize {
229
289
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ColumnResize, "[ngxColumnResize]", never, { "startWidth": { "alias": "ngxColumnResizeWidth"; "required": true; "isSignal": true; }; "minWidth": { "alias": "ngxColumnResizeMin"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "ngxColumnResizeMax"; "required": false; "isSignal": true; }; "direction": { "alias": "ngxColumnResizeDir"; "required": false; "isSignal": true; }; }, { "resizing": "resizing"; "resizeEnd": "resizeEnd"; }, never, never, true, never>;
230
290
  }
231
291
 
232
- /**
233
- * جدول داده‌ی جنریک و Type-Safe.
234
- *
235
- * `T` از روی چیزی که به [data] بایند می‌کنید استنتاج می‌شود؛ `field.column` در
236
- * `TableField<T, R>` محدود به `keyof T` است، و اگر از defineFields(renderers, ...)
237
- * استفاده کنید، `field.renderer` محدود به کلیدهای رجیستری و `rendererInputs`
238
- * دقیقاً همان ورودی‌های اضافه‌ی همان renderer است.
239
- *
240
- * دو حالت:
241
- * - کلاینت‌ساید (پیش‌فرض): [data] کل آرایه است؛ سورت/صفحه‌بندی داخلی و روی
242
- * یک computed خالص انجام می‌شود (بدون mutation روی آبجکت‌های شما).
243
- * - lazy: [lazy]="true" + [totalRecords]؛ [data] فقط صفحه‌ی جاری است؛ به
244
- * (lazyLoad) گوش بدهید.
245
- */
292
+ declare class ColumnFilterService {
293
+ applyFilters<T>(data: readonly T[], filters: Record<string, ColumnFilterState>): T[];
294
+ isFilterActive(filter?: ColumnFilterState | null): boolean;
295
+ private evaluateFilter;
296
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ColumnFilterService, never>;
297
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<ColumnFilterService>;
298
+ }
299
+
246
300
  declare class NgxTable<T extends object> implements OnInit, AfterContentInit {
247
301
  protected readonly config: ngx_kit_data_table.ResolvedTableOptions;
248
302
  protected readonly labels: ngx_kit_data_table.TableLocalization;
249
303
  protected readonly paginationConfig: ngx_kit_data_table.NgxPaginationOptions;
304
+ protected readonly columnFilterService: ColumnFilterService;
250
305
  readonly fields: _angular_core.InputSignal<TableField<T, any>[]>;
251
306
  readonly data: _angular_core.InputSignal<readonly T[]>;
252
307
  readonly totalRecords: _angular_core.InputSignal<number>;
@@ -264,8 +319,6 @@ declare class NgxTable<T extends object> implements OnInit, AfterContentInit {
264
319
  readonly lazy: _angular_core.InputSignal<boolean>;
265
320
  readonly resizable: _angular_core.InputSignal<boolean>;
266
321
  readonly height: _angular_core.InputSignal<string>;
267
- /** پیش‌فرض بر اساس ایندکس؛ برای جلوگیری از گم‌شدن state سطرها هنگام سورت،
268
- * یک شناسه‌ی یکتا بدهید: [trackBy]="(i, row) => row.id" */
269
322
  readonly trackBy: _angular_core.InputSignal<(index: number, row: T) => unknown>;
270
323
  readonly lazyLoad: _angular_core.OutputEmitterRef<LazyLoadEvent<T>>;
271
324
  readonly sortChange: _angular_core.OutputEmitterRef<SortMeta<T>[]>;
@@ -273,10 +326,13 @@ declare class NgxTable<T extends object> implements OnInit, AfterContentInit {
273
326
  field: string;
274
327
  width: number;
275
328
  }>;
329
+ readonly filterChange: _angular_core.OutputEmitterRef<ColumnFilterState[]>;
330
+ readonly elementRef: ElementRef<HTMLElement>;
276
331
  protected readonly pageIndex: _angular_core.WritableSignal<number>;
277
332
  protected readonly pageSizeS: _angular_core.WritableSignal<number>;
278
333
  protected readonly sorts: _angular_core.WritableSignal<SortMeta<T>[]>;
279
334
  protected readonly widths: _angular_core.WritableSignal<Record<string, number>>;
335
+ protected readonly activeFilters: _angular_core.WritableSignal<Record<string, ColumnFilterState>>;
280
336
  private readonly manuallyResized;
281
337
  private readonly rendererInputsCache;
282
338
  private cellTemplates;
@@ -289,23 +345,22 @@ declare class NgxTable<T extends object> implements OnInit, AfterContentInit {
289
345
  ngOnInit(): void;
290
346
  ngAfterContentInit(): void;
291
347
  private syncTemplateMap;
348
+ protected readonly filteredData: _angular_core.Signal<readonly T[]>;
292
349
  protected readonly sortedData: _angular_core.Signal<readonly T[]>;
293
350
  protected readonly totalCount: _angular_core.Signal<number>;
294
351
  protected readonly pagedData: _angular_core.Signal<readonly T[]>;
295
352
  private compare;
296
- /** بدون mutation روی داده‌ی ورودی: شماره‌ی ردیف صرفاً از روی page/pageSize/rowIndex محاسبه می‌شود. */
297
353
  protected recordNumber(rowIndex: number): number;
298
354
  protected sortDirectionFor(column: string): SortDirection | null;
299
355
  protected onHeaderClick(field: TableField<T, any>, event: MouseEvent): void;
356
+ protected isFilterable(field: TableField<T, any>): boolean;
357
+ protected getFilterState(column: string): ColumnFilterState | null;
358
+ protected getDistinctValues(column: string): unknown[];
359
+ protected onFilterApply(state: ColumnFilterState): void;
360
+ protected onFilterClear(field: string): void;
300
361
  protected onPaginate(event: PageEvent): void;
301
362
  private emitLazyIfNeeded;
302
363
  protected columnWidth(column: string): number;
303
- /**
304
- * مقدار CSS `flex` واقعیِ این ستون:
305
- * - اگه دستی ریسایز شده یا width عددی داره → `0 0 <px>` (ثابت، بدون رشد/کوچک‌شدن)
306
- * - اگه width رشته‌ای داره (مثلاً '20%') → `0 0 <رشته>` (ثابت، هر واحد CSS معتبری)
307
- * - اگه اصلاً width نداره → `1 1 0` (رشد می‌کنه تا فضای باقی‌مونده‌ی جدول رو پر کنه)
308
- */
309
364
  protected columnFlex(field: TableField<T, any>): string;
310
365
  protected columnMin(field: TableField<T, any>): number;
311
366
  protected columnMax(field: TableField<T, any>): number;
@@ -317,12 +372,9 @@ declare class NgxTable<T extends object> implements OnInit, AfterContentInit {
317
372
  protected getCellValue(row: T, field: TableField<T, any>): unknown;
318
373
  protected formatCellValue(row: T, field: TableField<T, any>): string;
319
374
  private stringify;
320
- /** ورودی‌های renderer را به‌ازای هر (field, row) کش می‌کند تا هر Change
321
- * Detection یک آبجکت جدید ساخته نشود؛ با WeakMap، وقتی row از حافظه خارج
322
- * شود (مثلاً بعد از عوض‌شدن صفحه)، entry آن هم خودکار پاک می‌شود. */
323
375
  protected getRendererInputs(row: T, field: TableField<T, any>): Record<string, unknown>;
324
376
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxTable<any>, never>;
325
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxTable<any>, "ngx-table", never, { "fields": { "alias": "fields"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": true; "isSignal": true; }; "totalRecords": { "alias": "totalRecords"; "required": true; "isSignal": true; }; "showRecordNumber": { "alias": "showRecordNumber"; "required": false; "isSignal": true; }; "operations": { "alias": "operations"; "required": false; "isSignal": true; }; "operationWidth": { "alias": "operationWidth"; "required": false; "isSignal": true; }; "numWidth": { "alias": "numWidth"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "page": { "alias": "page"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "multiSort": { "alias": "multiSort"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "trackBy": { "alias": "trackBy"; "required": false; "isSignal": true; }; }, { "pageChange": "pageChange"; "lazyLoad": "lazyLoad"; "sortChange": "sortChange"; "columnResize": "columnResize"; }, ["cellTemplates"], never, true, never>;
377
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxTable<any>, "ngx-table", never, { "fields": { "alias": "fields"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": true; "isSignal": true; }; "totalRecords": { "alias": "totalRecords"; "required": true; "isSignal": true; }; "showRecordNumber": { "alias": "showRecordNumber"; "required": false; "isSignal": true; }; "operations": { "alias": "operations"; "required": false; "isSignal": true; }; "operationWidth": { "alias": "operationWidth"; "required": false; "isSignal": true; }; "numWidth": { "alias": "numWidth"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "page": { "alias": "page"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "multiSort": { "alias": "multiSort"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "trackBy": { "alias": "trackBy"; "required": false; "isSignal": true; }; }, { "pageChange": "pageChange"; "lazyLoad": "lazyLoad"; "sortChange": "sortChange"; "columnResize": "columnResize"; "filterChange": "filterChange"; }, ["cellTemplates"], never, true, never>;
326
378
  }
327
379
 
328
380
  declare class NgxPagination {
@@ -351,5 +403,42 @@ declare class NgxPagination {
351
403
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxPagination, "ngx-pagination", never, { "total": { "alias": "total"; "required": true; "isSignal": true; }; "page": { "alias": "page"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "siblingCount": { "alias": "siblingCount"; "required": false; "isSignal": true; }; "boundaryCount": { "alias": "boundaryCount"; "required": false; "isSignal": true; }; }, { "page": "pageChange"; "pageSize": "pageSizeChange"; "paginate": "paginate"; }, never, never, true, never>;
352
404
  }
353
405
 
354
- export { ColumnResize, NGX_PAGINATION_CONFIG, NGX_PAGINATION_I18N, NGX_TABLE_CONFIG, NGX_TABLE_I18N, NgxPagination, NgxTable, PaginationLocalization, TableCell, TableLocalization, defineFields, defineRenderers, providePagination, provideTable };
355
- export type { CellRendererComponent, CellTemplateContext, ColumnAlign, ColumnSizingConfig, LazyLoadEvent, NgxPaginationOptions, NgxTableOptions, PageEvent, PageState, PlainTableField, RenderedTableField, RendererExtraInputs, RendererRegistry, ResolvedTableOptions, SortDirection, SortMeta, TableCellFormatter, TableField, TableFieldBase };
406
+ declare class NgxColumnFilter {
407
+ protected readonly labels: ngx_kit_data_table.TableLocalization;
408
+ private readonly elementRef;
409
+ readonly tableEl: _angular_core.InputSignal<ElementRef<HTMLElement>>;
410
+ readonly field: _angular_core.InputSignal<string>;
411
+ readonly config: _angular_core.InputSignal<ColumnFilterConfig<unknown> | undefined>;
412
+ readonly currentFilter: _angular_core.InputSignal<ColumnFilterState | null>;
413
+ readonly distinctValues: _angular_core.InputSignal<unknown[]>;
414
+ readonly applyFilter: _angular_core.OutputEmitterRef<ColumnFilterState>;
415
+ readonly clearFilter: _angular_core.OutputEmitterRef<string>;
416
+ protected readonly isOpen: _angular_core.WritableSignal<boolean>;
417
+ protected readonly filterType: _angular_core.Signal<FilterDataType>;
418
+ protected readonly selectedOperator: _angular_core.WritableSignal<DynamicDataFilterOperator>;
419
+ protected readonly filterValue: _angular_core.WritableSignal<any>;
420
+ protected readonly filterValueTo: _angular_core.WritableSignal<any>;
421
+ protected readonly selectedEnumValues: _angular_core.WritableSignal<Set<any>>;
422
+ protected readonly enumSearchQuery: _angular_core.WritableSignal<string>;
423
+ protected readonly operators: _angular_core.Signal<{
424
+ label: string;
425
+ value: DynamicDataFilterOperator;
426
+ }[]>;
427
+ protected readonly enumOptions: _angular_core.Signal<EnumFilterOption<unknown>[]>;
428
+ protected readonly filteredEnumOptions: _angular_core.Signal<EnumFilterOption<unknown>[]>;
429
+ protected readonly isNoValueOperator: _angular_core.Signal<boolean>;
430
+ protected toggleDropdown(event: MouseEvent): void;
431
+ updatePosition(): void;
432
+ private syncStateFromInput;
433
+ protected onApply(): void;
434
+ protected onClear(): void;
435
+ protected toggleEnumSelection(val: any): void;
436
+ protected toggleSelectAll(checked: boolean): void;
437
+ protected onDocumentClick(event: MouseEvent): void;
438
+ protected onEscape(): void;
439
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxColumnFilter, never>;
440
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxColumnFilter, "ngx-column-filter", never, { "tableEl": { "alias": "tableEl"; "required": true; "isSignal": true; }; "field": { "alias": "field"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "currentFilter": { "alias": "currentFilter"; "required": false; "isSignal": true; }; "distinctValues": { "alias": "distinctValues"; "required": false; "isSignal": true; }; }, { "applyFilter": "applyFilter"; "clearFilter": "clearFilter"; }, never, never, true, never>;
441
+ }
442
+
443
+ export { ColumnFilterService, ColumnResize, DynamicDataFilterOperator, NGX_PAGINATION_CONFIG, NGX_PAGINATION_I18N, NGX_TABLE_CONFIG, NGX_TABLE_I18N, NgxColumnFilter, NgxPagination, NgxTable, PaginationLocalization, TableCell, TableLocalization, defineFields, defineRenderers, providePagination, provideTable };
444
+ export type { CellRendererComponent, CellTemplateContext, ColumnAlign, ColumnFilterConfig, ColumnFilterState, ColumnSizingConfig, EnumFilterOption, FilterDataType, LazyLoadEvent, NgxPaginationOptions, NgxTableOptions, PageEvent, PageState, PlainTableField, RenderedTableField, RendererExtraInputs, RendererRegistry, ResolvedTableOptions, SortDirection, SortMeta, TableCellFormatter, TableField, TableFieldBase };