nath-angular-ui 0.6.0 → 0.6.1

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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, model, input, output, contentChild, TemplateRef, viewChild, signal, computed, effect, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, Pipe, InjectionToken, Injector, EnvironmentInjector, ApplicationRef, createEnvironmentInjector, createComponent, Service, Renderer2, viewChildren, SecurityContext, untracked, HostListener, ViewChild, booleanAttribute, Directive, contentChildren, ViewContainerRef } from '@angular/core';
2
+ import { inject, ElementRef, model, input, output, contentChild, TemplateRef, viewChild, signal, computed, effect, ViewEncapsulation, ChangeDetectionStrategy, Component, Service, Pipe, InjectionToken, Injector, EnvironmentInjector, ApplicationRef, createEnvironmentInjector, createComponent, Injectable, Renderer2, viewChildren, SecurityContext, untracked, HostListener, ViewChild, booleanAttribute, Directive, contentChildren, ViewContainerRef } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule, NgTemplateOutlet, DOCUMENT, NgStyle, NgClass, KeyValuePipe } from '@angular/common';
5
5
  import * as i2 from '@angular/cdk/overlay';
@@ -327,11 +327,20 @@ class BreadcrumbService {
327
327
  * @param crumbs Array of breadcrumbs items
328
328
  */
329
329
  set(crumbs) {
330
- this._breadcrumbs.set(crumbs);
330
+ this._breadcrumbs.set(crumbs.filter((crumb) => crumb !== null));
331
331
  }
332
+ /**
333
+ * Add a new breadcrumb to the current breadcrumbs array.
334
+ * @param crumb
335
+ */
332
336
  add(crumb) {
333
337
  this._breadcrumbs.update((v) => [...v, crumb]);
334
338
  }
339
+ /**
340
+ * Update a breadcrumb at a specific index.
341
+ * @param index
342
+ * @param crumb
343
+ */
335
344
  update(index, crumb) {
336
345
  this._breadcrumbs.update((v) => {
337
346
  const copy = [...v];
@@ -340,19 +349,27 @@ class BreadcrumbService {
340
349
  });
341
350
  }
342
351
  /**
343
- * Clears the breadcrumbs when leaving a page.
352
+ * Remove a breadcrumb at a specific index.
353
+ * @param index
354
+ */
355
+ remove(index) {
356
+ this._breadcrumbs.update((v) => {
357
+ const copy = [...v];
358
+ copy.splice(index, 1);
359
+ return copy;
360
+ });
361
+ }
362
+ /**
363
+ * Clear all breadcrumbs.
344
364
  */
345
365
  clear() {
346
366
  this._breadcrumbs.set([]);
347
367
  }
348
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
349
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BreadcrumbService, providedIn: 'root' });
368
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Service });
369
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.5", ngImport: i0, type: BreadcrumbService });
350
370
  }
351
371
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BreadcrumbService, decorators: [{
352
- type: Injectable,
353
- args: [{
354
- providedIn: 'root', // Shared instance across the app
355
- }]
372
+ type: Service
356
373
  }] });
357
374
 
358
375
  class NathBreadcrumbs {