@koobiq/components 18.2.0 → 18.2.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.
Files changed (54) hide show
  1. package/core/option/action.d.ts +1 -1
  2. package/core/pop-up/pop-up-trigger.d.ts +3 -3
  3. package/esm2022/core/option/action.mjs +5 -8
  4. package/esm2022/core/pop-up/pop-up-trigger.mjs +12 -12
  5. package/esm2022/core/version.mjs +2 -2
  6. package/esm2022/form-field/form-field.mjs +7 -8
  7. package/esm2022/list/list-selection.component.mjs +8 -12
  8. package/esm2022/navbar/navbar-item.component.mjs +6 -9
  9. package/esm2022/navbar/navbar.component.mjs +12 -13
  10. package/esm2022/popover/popover-confirm.component.mjs +3 -3
  11. package/esm2022/select/select.component.mjs +15 -14
  12. package/esm2022/tabs/paginated-tab-header.mjs +10 -12
  13. package/esm2022/tags/tag-list.component.mjs +9 -11
  14. package/esm2022/toast/toast.component.mjs +5 -6
  15. package/esm2022/tree/padding.directive.mjs +3 -9
  16. package/esm2022/tree/tree-base.mjs +5 -8
  17. package/esm2022/tree/tree-selection.component.mjs +10 -13
  18. package/esm2022/tree-select/tree-select.component.mjs +13 -13
  19. package/fesm2022/koobiq-components-core.mjs +14 -15
  20. package/fesm2022/koobiq-components-core.mjs.map +1 -1
  21. package/fesm2022/koobiq-components-form-field.mjs +6 -7
  22. package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
  23. package/fesm2022/koobiq-components-list.mjs +7 -11
  24. package/fesm2022/koobiq-components-list.mjs.map +1 -1
  25. package/fesm2022/koobiq-components-navbar.mjs +13 -18
  26. package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
  27. package/fesm2022/koobiq-components-popover.mjs +3 -3
  28. package/fesm2022/koobiq-components-popover.mjs.map +1 -1
  29. package/fesm2022/koobiq-components-select.mjs +15 -14
  30. package/fesm2022/koobiq-components-select.mjs.map +1 -1
  31. package/fesm2022/koobiq-components-tabs.mjs +9 -11
  32. package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
  33. package/fesm2022/koobiq-components-tags.mjs +7 -9
  34. package/fesm2022/koobiq-components-tags.mjs.map +1 -1
  35. package/fesm2022/koobiq-components-toast.mjs +4 -5
  36. package/fesm2022/koobiq-components-toast.mjs.map +1 -1
  37. package/fesm2022/koobiq-components-tree-select.mjs +12 -12
  38. package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
  39. package/fesm2022/koobiq-components-tree.mjs +13 -24
  40. package/fesm2022/koobiq-components-tree.mjs.map +1 -1
  41. package/form-field/form-field.d.ts +1 -1
  42. package/list/list-selection.component.d.ts +2 -4
  43. package/navbar/navbar-item.component.d.ts +2 -3
  44. package/navbar/navbar.component.d.ts +7 -5
  45. package/package.json +5 -5
  46. package/schematics/ng-add/index.js +4 -4
  47. package/select/select.component.d.ts +1 -2
  48. package/tabs/paginated-tab-header.d.ts +1 -3
  49. package/tags/tag-list.component.d.ts +1 -2
  50. package/toast/toast.component.d.ts +0 -1
  51. package/tree/padding.directive.d.ts +2 -4
  52. package/tree/tree-base.d.ts +2 -3
  53. package/tree/tree-selection.component.d.ts +2 -4
  54. package/tree-select/tree-select.component.d.ts +1 -2
@@ -2,7 +2,7 @@ import * as i3 from '@angular/cdk/bidi';
2
2
  import * as i1$1 from '@angular/cdk/portal';
3
3
  import { CdkPortalOutlet, CdkPortal, TemplatePortal, PortalModule } from '@angular/cdk/portal';
4
4
  import * as i0 from '@angular/core';
5
- import { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Input, Output, ViewChild, forwardRef, Directive, Inject, InjectionToken, TemplateRef, ContentChild, ContentChildren, Attribute, NgModule } from '@angular/core';
5
+ import { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Input, Output, ViewChild, forwardRef, Directive, Inject, inject, DestroyRef, InjectionToken, TemplateRef, ContentChild, ContentChildren, Attribute, NgModule } from '@angular/core';
6
6
  import { Subscription, Subject, fromEvent, of, merge, timer } from 'rxjs';
7
7
  import { startWith, takeUntil, debounceTime } from 'rxjs/operators';
8
8
  import { trigger, state, style, transition, animate } from '@angular/animations';
@@ -16,6 +16,7 @@ import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
16
16
  import * as i1$2 from '@angular/cdk/a11y';
17
17
  import { FocusKeyManager, A11yModule } from '@angular/cdk/a11y';
18
18
  import { hasModifierKey, ENTER, SPACE } from '@angular/cdk/keycodes';
19
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
19
20
  import { HOME, END, UP_ARROW, DOWN_ARROW, RIGHT_ARROW, LEFT_ARROW } from '@koobiq/cdk/keycodes';
20
21
  import { KBQ_DROPDOWN_SCROLL_STRATEGY } from '@koobiq/components/dropdown';
21
22
  import * as i4 from '@koobiq/components/icon';
@@ -312,8 +313,7 @@ class KbqPaginatedTabHeader {
312
313
  * layout recalculations if it's known that pagination won't be required.
313
314
  */
314
315
  this.disablePagination = false;
315
- /** Emits when the component is destroyed. */
316
- this.destroyed = new Subject();
316
+ this.destroyRef = inject(DestroyRef);
317
317
  this.vertical = false;
318
318
  /** Stream that will stop the automated scrolling. */
319
319
  this.stopScrolling = new Subject();
@@ -322,7 +322,7 @@ class KbqPaginatedTabHeader {
322
322
  // Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
323
323
  ngZone.runOutsideAngular(() => {
324
324
  fromEvent(elementRef.nativeElement, 'mouseleave')
325
- .pipe(takeUntil(this.destroyed))
325
+ .pipe(takeUntilDestroyed())
326
326
  .subscribe(() => this.stopInterval());
327
327
  });
328
328
  }
@@ -330,10 +330,10 @@ class KbqPaginatedTabHeader {
330
330
  ngAfterViewInit() {
331
331
  // We need to handle these events manually, because we want to bind passive event listeners.
332
332
  fromEvent(this.previousPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
333
- .pipe(takeUntil(this.destroyed))
333
+ .pipe(takeUntilDestroyed(this.destroyRef))
334
334
  .subscribe(() => this.handlePaginatorPress('before'));
335
335
  fromEvent(this.nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
336
- .pipe(takeUntil(this.destroyed))
336
+ .pipe(takeUntilDestroyed(this.destroyRef))
337
337
  .subscribe(() => this.handlePaginatorPress('after'));
338
338
  }
339
339
  ngAfterContentInit() {
@@ -350,7 +350,7 @@ class KbqPaginatedTabHeader {
350
350
  // On dir change or window resize, realign the ink bar and update the orientation of
351
351
  // the key manager if the direction has changed.
352
352
  merge(dirChange, resize, this.items.changes)
353
- .pipe(takeUntil(this.destroyed))
353
+ .pipe(takeUntilDestroyed(this.destroyRef))
354
354
  .subscribe(() => {
355
355
  // We need to defer this to give the browser some time to recalculate
356
356
  // the element dimensions. The call has to be wrapped in `NgZone.run`,
@@ -364,7 +364,7 @@ class KbqPaginatedTabHeader {
364
364
  // If there is a change in the focus key manager we need to emit the `indexFocused`
365
365
  // event in order to provide a public event that notifies about focus changes. Also we realign
366
366
  // the tabs container by scrolling the new focused tab into the visible section.
367
- this.keyManager.change.pipe(takeUntil(this.destroyed)).subscribe((newFocusIndex) => {
367
+ this.keyManager.change.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((newFocusIndex) => {
368
368
  this.indexFocused.emit(newFocusIndex);
369
369
  this.setTabFocus(newFocusIndex);
370
370
  });
@@ -393,8 +393,6 @@ class KbqPaginatedTabHeader {
393
393
  }
394
394
  }
395
395
  ngOnDestroy() {
396
- this.destroyed.next();
397
- this.destroyed.complete();
398
396
  this.stopScrolling.complete();
399
397
  }
400
398
  handleKeydown(event) {
@@ -650,7 +648,7 @@ class KbqPaginatedTabHeader {
650
648
  // Start a timer after the delay and keep firing based on the interval.
651
649
  timer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)
652
650
  // Keep the timer going until something tells it to stop or the component is destroyed.
653
- .pipe(takeUntil(merge(this.stopScrolling, this.destroyed)))
651
+ .pipe(takeUntilDestroyed(this.destroyRef), takeUntil(this.stopScrolling))
654
652
  .subscribe(() => {
655
653
  const { maxScrollDistance, distance } = this.scrollHeader(direction);
656
654
  // Stop the timer if we've reached the start or the end.