import { KbqOverflowItemsModule } from '@koobiq/components/overflow-items';

KbqOverflowItem

directiveCopy link to KbqOverflowItem

Directive for the item that can be hidden by the KbqOverflowItems directive.

@Directive({ selector: '[kbqOverflowItem]', exportAs: 'kbqOverflowItem' })
class KbqOverflowItem extends ElementVisibilityManager {
    readonly id = input.required<unknown>({ alias: 'kbqOverflowItem' });
    readonly order = input<number | null>(null);
    readonly alwaysVisible = input<boolean>(false);
}
kbqOverflowIteminputrequiredCopy link to kbqOverflowItemunknown

Unique identifier for the item.

orderinputCopy link to ordernumber | null

Defines the order in which the item is processed in the overflow container, without changing its original position in the QueryList.

alwaysVisibleinputCopy link to alwaysVisibleboolean

Element with this attribute will be ignored when hiding and will always remain visible. Defaults to false.

KbqOverflowItems

directiveCopy link to KbqOverflowItems

Directive for managing the visibility of items that overflow the container.

@Directive({ selector: '[kbqOverflowItems]', exportAs: 'kbqOverflowItems' })
class KbqOverflowItems {
    readonly reverseOverflowOrder = input<boolean>(false);
    readonly debounceTime = input<number>(0);
    readonly additionalResizeObserverTargets = input<Element | Element[]>(
        this.document.body
    );
    readonly orientation = input<KbqOrientation>('horizontal');
    readonly wrap = input<KbqFlexWrap>('nowrap');
    readonly changes = output<ReadonlySet<unknown>>();
    readonly hiddenItemIDs: Signal<ReadonlySet<unknown>>;
}
reverseOverflowOrderinputCopy link to reverseOverflowOrderboolean

Whether the overflow order should be reversed. Defaults to false.

Example
[0, 1, hidden, hidden] ---> [hidden, hidden, 2, 3]
debounceTimeinputCopy link to debounceTimenumber

Debounce time for recalculating items visibility. Defaults to 0.

additionalResizeObserverTargetsinputCopy link to additionalResizeObserverTargetsElement | Element[]

List of additional elements to observe for resize changes. Defaults to document.body.

orientationinputCopy link to orientationKbqOrientation

Defines the orientation of the overflow items. Defaults to 'horizontal'.

wrapinputCopy link to wrapKbqFlexWrap

Defines the wrap of the overflow items. Defaults to 'nowrap'.

changesoutputCopy link to changesReadonlySet<unknown>

Emits the set of hidden items after every recalculation, also when it has not changed: a recalculation shows every item before it hides the overflown ones again, so a consumer that hides items itself re-applies that here.

hiddenItemIDsCopy link to hiddenItemIDsSignal<ReadonlySet<unknown>>

Set of hidden item IDs.

KbqOverflowItemsResult

directiveCopy link to KbqOverflowItemsResult

Directive for displaying the result of hidden items by the KbqOverflowItems directive.

@Directive({
    selector: '[kbqOverflowItemsResult]',
    exportAs: 'kbqOverflowItemsResult'
})
class KbqOverflowItemsResult extends ElementVisibilityManager {}
Suggestions for improvement
If you found a mistake or want to improve the article, create an issue on GitHub.