ngx-kit 8.3.6 → 8.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ const NGX_NOTIFY_DEFAULTS = {
16
16
  closeOnTap: true,
17
17
  containerClass: 'ngx-bg-notify',
18
18
  notificationClass: 'ngx-notify',
19
+ usePopover: true,
19
20
  };
20
21
 
21
22
  /**
@@ -176,10 +177,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
176
177
  type: Input
177
178
  }], bar: [{ type: i0.ViewChild, args: ['bar', { isSignal: true }] }], onClose: [{ type: i0.Output, args: ["onClose"] }], onFinish: [{ type: i0.Output, args: ["onFinish"] }] } });
178
179
 
179
- // We'll include a tiny inline uuid fallback if uuid package is not available
180
180
  function makeId() {
181
- // simple random id
182
- return 'n_' + Math.random().toString(36).substr(2, 9);
181
+ return 'n_' + Math.random().toString(36).substring(2, 11);
183
182
  }
184
183
  class NgxNotifyService {
185
184
  queue = [];
@@ -190,58 +189,114 @@ class NgxNotifyService {
190
189
  doc = inject(DOCUMENT);
191
190
  win = inject(WINDOW);
192
191
  defaultOptions = inject(NGX_NOTIFY_CONFIG);
192
+ removalTimers = new Map();
193
193
  constructor() { }
194
- configureContainer(position, containerClass) {
194
+ configureContainer(opt) {
195
+ const { containerClass, position, usePopover } = opt;
195
196
  if (!this.container) {
196
197
  this.container = this.doc.createElement('div');
197
198
  this.doc.body.appendChild(this.container);
198
199
  }
199
- this.container.className = containerClass + ' ngx-notify-container ' + `ngx-pos-${position}`;
200
- this.container.style.position = 'fixed';
201
- this.container.style.zIndex = '99999';
202
- // center special
203
- if (position === 'center') {
204
- this.container.style.left = '50%';
205
- this.container.style.top = '50%';
206
- this.container.style.transform = 'translate(-50%,-50%)';
207
- this.container.style.display = 'flex';
208
- this.container.style.flexDirection = 'column';
209
- this.container.style.alignItems = 'center';
210
- this.container.style.pointerEvents = 'none';
211
- }
212
- else {
213
- if (position?.includes('center')) {
214
- this.container.style.left = '50%';
215
- this.container.style.transform = 'translateX(-50%)';
216
- }
217
- else {
218
- this.container.style.transform = 'translateX(0)';
219
- }
220
- // corners
221
- if (position?.includes('top')) {
222
- this.container.style.top = '20px';
223
- }
224
- else {
225
- this.container.style.bottom = '20px';
200
+ const container = this.container;
201
+ container.className = containerClass + ' ngx-notify-container ngx-pos-' + position;
202
+ // Explicitly reset positioning so changing options does not leave
203
+ // stale styles from the previous configuration.
204
+ Object.assign(container.style, {
205
+ position: 'fixed',
206
+ zIndex: '99999',
207
+ inset: 'auto',
208
+ top: 'auto',
209
+ right: 'auto',
210
+ bottom: 'auto',
211
+ left: 'auto',
212
+ margin: '0',
213
+ transform: 'none',
214
+ width: 'max-content',
215
+ maxWidth: 'calc(100vw - 40px)',
216
+ maxHeight: 'calc(100vh - 40px)',
217
+ boxSizing: 'border-box',
218
+ border: '0',
219
+ padding: '0',
220
+ background: 'transparent',
221
+ color: 'inherit',
222
+ overflow: 'visible',
223
+ pointerEvents: 'none',
224
+ display: 'flex',
225
+ flexDirection: 'column',
226
+ alignItems: 'stretch',
227
+ });
228
+ // Detect the page's direction without requiring an extra option.
229
+ const direction = container.closest('[dir]')?.getAttribute('dir') ||
230
+ this.doc.documentElement.getAttribute('dir') ||
231
+ this.doc.body?.getAttribute('dir') ||
232
+ 'ltr';
233
+ container.dir = direction === 'rtl' ? 'rtl' : 'ltr';
234
+ // Keep left/right as physical viewport positions.
235
+ // RTL affects text direction, not the meaning of these positions.
236
+ switch (position) {
237
+ case 'center':
238
+ container.style.top = '50%';
239
+ container.style.left = '50%';
240
+ container.style.transform = 'translate(-50%, -50%)';
241
+ container.style.alignItems = 'center';
242
+ break;
243
+ default: {
244
+ if (position?.includes('top')) {
245
+ container.style.top = '20px';
246
+ }
247
+ else {
248
+ container.style.bottom = '20px';
249
+ }
250
+ if (position?.includes('left')) {
251
+ container.style.left = '20px';
252
+ container.style.alignItems = 'flex-start';
253
+ }
254
+ else if (position?.includes('right')) {
255
+ container.style.right = '20px';
256
+ container.style.alignItems = 'flex-end';
257
+ }
258
+ else if (position?.includes('center')) {
259
+ container.style.left = '50%';
260
+ container.style.transform = 'translateX(-50%)';
261
+ container.style.alignItems = 'center';
262
+ }
263
+ if (position?.includes('bottom')) {
264
+ container.style.flexDirection = 'column-reverse';
265
+ }
266
+ break;
226
267
  }
227
- if (position?.includes('left')) {
228
- this.container.style.left = '20px';
229
- this.container.style.right = 'auto';
268
+ }
269
+ if (usePopover) {
270
+ // Apply the positioning styles before entering the top layer.
271
+ container.setAttribute('popover', 'manual');
272
+ if (!container.matches(':popover-open')) {
273
+ try {
274
+ container.showPopover();
275
+ }
276
+ catch {
277
+ // Avoid breaking notification display if the browser does not
278
+ // support Popover or the element cannot enter the top layer.
279
+ container.removeAttribute('popover');
280
+ }
230
281
  }
231
- if (position?.includes('right')) {
232
- this.container.style.right = '20px';
233
- this.container.style.left = 'auto';
282
+ }
283
+ else {
284
+ if (container.matches(':popover-open')) {
285
+ try {
286
+ container.hidePopover();
287
+ }
288
+ catch {
289
+ // The element may already have left the top layer.
290
+ }
234
291
  }
235
- // else container.style.right = '20px';
236
- this.container.style.display = 'flex';
237
- this.container.style.flexDirection = 'column';
238
- if (position?.includes('bottom'))
239
- this.container.style.flexDirection = 'column-reverse';
240
- this.container.style.pointerEvents = 'none';
292
+ container.removeAttribute('popover');
241
293
  }
242
294
  }
243
295
  show(message, description, type = 'info', options) {
244
- const opts = { ...this.defaultOptions, ...(options || {}) };
296
+ const opts = {
297
+ ...this.defaultOptions,
298
+ ...(options || {}),
299
+ };
245
300
  const id = typeof this.win.crypto?.randomUUID === 'function'
246
301
  ? this.win.crypto.randomUUID()
247
302
  : makeId();
@@ -255,8 +310,13 @@ class NgxNotifyService {
255
310
  onFinish: new EventEmitter(),
256
311
  close: () => this.close(id),
257
312
  };
258
- this.configureContainer(opts.position, opts.containerClass);
259
- // queue or show immediately
313
+ this.configureContainer(opts);
314
+ // Cancel a pending removal if the same ID is ever reused.
315
+ const timer = this.removalTimers.get(id);
316
+ if (timer) {
317
+ clearTimeout(timer);
318
+ this.removalTimers.delete(id);
319
+ }
260
320
  if (this.visible.length >= opts.maxVisible) {
261
321
  this.queue.push(payload);
262
322
  }
@@ -266,9 +326,11 @@ class NgxNotifyService {
266
326
  return payload;
267
327
  }
268
328
  _createAndShow(payload) {
269
- if (!this.container)
270
- this.configureContainer(payload.options.position, payload.options.containerClass);
271
- const host = document.createElement('div');
329
+ if (!this.container) {
330
+ this.configureContainer(payload.options);
331
+ }
332
+ // Use DOCUMENT rather than the global document.
333
+ const host = this.doc.createElement('div');
272
334
  this.container.appendChild(host);
273
335
  const compRef = createComponent(NgxNotificationComponent, {
274
336
  environmentInjector: this.envInjector,
@@ -290,48 +352,81 @@ class NgxNotifyService {
290
352
  this.visible.push({ ref: compRef, payload });
291
353
  }
292
354
  close(id) {
293
- const el = this.visible.find((x) => x.payload.id == id)?.ref?.instance?.el;
294
- if (el) {
295
- this.removeEl({ id, el });
355
+ const item = this.visible.find((x) => x.payload.id === id);
356
+ if (item) {
357
+ const el = item.ref.instance.el.nativeElement;
358
+ if (el) {
359
+ this.removeEl({ id, el });
360
+ }
296
361
  }
297
- // if in queue remove it
362
+ // If the notification is still queued, remove it immediately.
298
363
  this.queue = this.queue.filter((q) => q.id !== id);
364
+ this.cleanupIfEmpty();
299
365
  }
300
366
  removeNode(node, id) {
367
+ // Prevent multiple close/finish events from scheduling duplicate
368
+ // removal operations for the same notification.
369
+ if (this.removalTimers.has(id)) {
370
+ return;
371
+ }
301
372
  node.style.opacity = '0';
302
373
  node.style.transform = 'translateY(-30px)';
303
374
  node.style.transition = 'all 300ms';
304
- setTimeout(() => {
375
+ const timer = setTimeout(() => {
376
+ this.removalTimers.delete(id);
305
377
  const item = this.visible.find((x) => x.payload.id === id);
306
378
  if (item) {
307
379
  this.appRef.detachView(item.ref.hostView);
308
380
  item.ref.destroy();
309
381
  }
310
382
  this.visible = this.visible.filter((v) => v.payload.id !== id);
311
- // show next in queue
383
+ // Preserve queue behavior: make room first, then clean up.
312
384
  this._showNextIfPossible();
385
+ this.cleanupIfEmpty();
313
386
  }, 300);
387
+ this.removalTimers.set(id, timer);
314
388
  }
315
389
  removeEl(d) {
316
- if (d.el)
390
+ if (d.el) {
317
391
  this.removeNode(d.el, d.id);
392
+ }
318
393
  else {
319
- // if in queue remove it
320
394
  this.queue = this.queue.filter((q) => q.id !== d.id);
395
+ this.cleanupIfEmpty();
321
396
  }
322
397
  }
323
398
  _showNextIfPossible() {
324
- if (!this.queue.length)
399
+ if (!this.queue.length) {
325
400
  return;
326
- const next = this.queue.shift();
327
- // ensure we don't exceed maxVisible
401
+ }
402
+ const next = this.queue[0];
328
403
  if (this.visible.length < next.options.maxVisible) {
404
+ this.queue.shift();
405
+ // Reapply this notification's configuration if needed.
406
+ this.configureContainer(next.options);
329
407
  this._createAndShow(next);
330
408
  }
331
- else {
332
- // push back
333
- this.queue.unshift(next);
409
+ }
410
+ cleanupIfEmpty() {
411
+ // Do not remove the container while notifications are visible,
412
+ // waiting in the queue, or still animating out.
413
+ if (this.visible.length > 0 || this.queue.length > 0 || this.removalTimers.size > 0) {
414
+ return;
415
+ }
416
+ const container = this.container;
417
+ if (!container) {
418
+ return;
419
+ }
420
+ if (container.matches(':popover-open')) {
421
+ try {
422
+ container.hidePopover();
423
+ }
424
+ catch {
425
+ // Ignore an already-closed popover.
426
+ }
334
427
  }
428
+ container.remove();
429
+ this.container = null;
335
430
  }
336
431
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxNotifyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
337
432
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxNotifyService, providedIn: 'root' });
@@ -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-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","<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/core';\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 close: () => this.close(id),\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\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\n private close(id: string) {\n const el = this.visible.find((x) => x.payload.id == id)?.ref?.instance?.el;\n if (el) {\n this.removeEl({ id, el });\n }\n // if in queue remove it\n this.queue = this.queue.filter((q) => q.id !== id);\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.detachView(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 {\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;;;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,YAA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AgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACX5B,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,OAAO,OAAO,CAAC,OAAe,EAAE,WAAoB,EAAE,OAA0B,EAAA;AAC9E,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,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CAAC,SAAS,EAAE;YACd;QACF;AAEA,QAAA,IAAI,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;AACtC,YAAA,IAAI;gBACF,SAAS,CAAC,WAAW,EAAE;YACzB;AAAE,YAAA,MAAM;;YAER;QACF;QAEA,SAAS,CAAC,MAAM,EAAE;AAClB,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI;IACvB;uGAnTW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,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;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-kit",
3
- "version": "8.3.6",
3
+ "version": "8.3.8",
4
4
  "description": "Angular input components",
5
5
  "author": "Mohammadreza Samani <mr.samani1368@gmail.com>",
6
6
  "license": "MIT",
@@ -361,10 +361,8 @@ interface BaseOverlayOptions<T = any> {
361
361
  alignment?: Alignment;
362
362
  margin?: number;
363
363
  /**
364
- * Whether to render this overlay using the native Popover API (top-layer
365
- * rendering, escapes clipping/stacking-context issues of ancestors).
366
- * Falls back automatically to a manual z-index based overlay when the
367
- * browser doesn't support the Popover API. Defaults to `true`.
364
+ * Whether to render this overlay using the native Popover API
365
+ * @default true
368
366
  */
369
367
  usePopover?: boolean;
370
368
  /**
@@ -64,6 +64,11 @@ interface NgxNotifyOptions {
64
64
  * Additional notification class
65
65
  */
66
66
  notificationClass?: string;
67
+ /**
68
+ * Whether to render this overlay using the native Popover API
69
+ * @default true
70
+ */
71
+ usePopover?: boolean;
67
72
  }
68
73
 
69
74
  declare function provideNotify(options?: NgxNotifyOptions): EnvironmentProviders;
@@ -96,7 +101,7 @@ declare class NgxNotificationComponent implements OnInit, OnDestroy {
96
101
  safeDescription: SafeHtml | string;
97
102
  showClass: _angular_core.WritableSignal<string>;
98
103
  protected doc: Document;
99
- protected el: ElementRef<any>;
104
+ el: ElementRef<any>;
100
105
  protected sanitizer: DomSanitizer;
101
106
  protected chdr: ChangeDetectorRef;
102
107
  constructor();
@@ -125,14 +130,16 @@ declare class NgxNotifyService {
125
130
  private doc;
126
131
  private win;
127
132
  private defaultOptions;
133
+ private removalTimers;
128
134
  constructor();
129
- configureContainer(position: NgxNotifyOptions['position'], containerClass: string): void;
135
+ configureContainer(opt: NgxNotifyOptions): void;
130
136
  show(message: string, description?: string, type?: NgxNotifyType, options?: NgxNotifyOptions): NgxNotifyPayload;
131
137
  private _createAndShow;
132
138
  private close;
133
139
  private removeNode;
134
140
  private removeEl;
135
141
  private _showNextIfPossible;
142
+ private cleanupIfEmpty;
136
143
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxNotifyService, never>;
137
144
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<NgxNotifyService>;
138
145
  }