@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.
- package/core/option/action.d.ts +1 -1
- package/core/pop-up/pop-up-trigger.d.ts +3 -3
- package/esm2022/core/option/action.mjs +5 -8
- package/esm2022/core/pop-up/pop-up-trigger.mjs +12 -12
- package/esm2022/core/version.mjs +2 -2
- package/esm2022/form-field/form-field.mjs +7 -8
- package/esm2022/list/list-selection.component.mjs +8 -12
- package/esm2022/navbar/navbar-item.component.mjs +6 -9
- package/esm2022/navbar/navbar.component.mjs +12 -13
- package/esm2022/popover/popover-confirm.component.mjs +3 -3
- package/esm2022/select/select.component.mjs +15 -14
- package/esm2022/tabs/paginated-tab-header.mjs +10 -12
- package/esm2022/tags/tag-list.component.mjs +9 -11
- package/esm2022/toast/toast.component.mjs +5 -6
- package/esm2022/tree/padding.directive.mjs +3 -9
- package/esm2022/tree/tree-base.mjs +5 -8
- package/esm2022/tree/tree-selection.component.mjs +10 -13
- package/esm2022/tree-select/tree-select.component.mjs +13 -13
- package/fesm2022/koobiq-components-core.mjs +14 -15
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +6 -7
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +7 -11
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +13 -18
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +3 -3
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +15 -14
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +9 -11
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +7 -9
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-toast.mjs +4 -5
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +12 -12
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +13 -24
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/form-field/form-field.d.ts +1 -1
- package/list/list-selection.component.d.ts +2 -4
- package/navbar/navbar-item.component.d.ts +2 -3
- package/navbar/navbar.component.d.ts +7 -5
- package/package.json +5 -5
- package/schematics/ng-add/index.js +4 -4
- package/select/select.component.d.ts +1 -2
- package/tabs/paginated-tab-header.d.ts +1 -3
- package/tags/tag-list.component.d.ts +1 -2
- package/toast/toast.component.d.ts +0 -1
- package/tree/padding.directive.d.ts +2 -4
- package/tree/tree-base.d.ts +2 -3
- package/tree/tree-selection.component.d.ts +2 -4
- 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
|
-
|
|
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(
|
|
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(
|
|
333
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
334
334
|
.subscribe(() => this.handlePaginatorPress('before'));
|
|
335
335
|
fromEvent(this.nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
336
|
-
.pipe(
|
|
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(
|
|
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(
|
|
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(
|
|
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.
|