import * as i0 from '@angular/core'; import { AfterViewInit, OnDestroy, EventEmitter, ElementRef, NgZone, OnChanges, OnInit, TemplateRef, TrackByFunction, Renderer2 } from '@angular/core'; import { WindowRef } from '@kirbydesign/designsystem/types'; import { Subject } from 'rxjs'; import { ThemeColor } from '@kirbydesign/core'; import * as i4 from '@ionic/angular/standalone'; import { IonItemSliding, IonList } from '@ionic/angular/standalone'; import { PlatformService } from '@kirbydesign/designsystem/helpers'; import { ItemSwipeAction, ItemSlidingSide, ItemSwipeActionSlots } from '@kirbydesign/designsystem/item-sliding'; import * as i1 from '@angular/common'; import * as i2 from '@kirbydesign/designsystem/icon'; import * as i3 from '@kirbydesign/designsystem/spinner'; interface Scroll { distanceToViewBottom: number; elementHeight: number; viewHeight: number; } /** * Specify debounce duration in ms */ declare const INFINITE_SCROLL_DEBOUNCE = 100; declare class InfiniteScrollDirective implements AfterViewInit, OnDestroy { private elementRef; private windowRef; private zone; /** * Event that will be triggered when the user has scrolled to * bottom of the element */ scrollEnd: EventEmitter; /** * If true then {@link scrollEnd} event should NOT be emitted */ disabled: boolean; /** * Emits a new value on element scroll event */ scroll$: Subject; /** * Completes on component destroy lifecycle event * used to unsubscribe from infinite observables */ private ngUnsubscribe$; /** * An offset from the bottom of the element to trigger {@link scrollEnd} event */ private offset; constructor(elementRef: ElementRef, windowRef: WindowRef, zone: NgZone); ngAfterViewInit(): void; /** * On element scroll event emit next {@link scroll$} observable value */ onScroll(): void; /** * trigger {@link ngUnsubscribe} complete on component destroy lifecycle hook */ ngOnDestroy(): void; private getScroll; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class ListItemColorDirective implements OnChanges { kirbyListItemColor: (item: any) => ThemeColor; item: any; color: ThemeColor; ngOnChanges(): void; private getColor; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } type ListSwipeActionBaseTypes = Pick; type ListSwipeAction = { [Property in keyof ListSwipeActionBaseTypes]: ((item: any) => ListSwipeActionBaseTypes[Property]) | ListSwipeActionBaseTypes[Property]; } & { position: ItemSlidingSide; onSelected: (item: any) => void; }; type BoundaryClass = 'first' | 'last'; declare class ListItemComponent implements OnInit, AfterViewInit { private platform; _isSwipingEnabled: boolean; constructor(platform: PlatformService); ionItemSliding: IonItemSliding; item: any; boundaryClass: BoundaryClass | BoundaryClass[]; swipeActions: ListSwipeAction[]; itemTemplate: TemplateRef; isSelected: boolean; isSelectable: boolean; getItemColor: (item: any) => ThemeColor; itemSelect: EventEmitter; _onItemSelect(item: any): void; swipeActionSelect: EventEmitter; _onSwipeActionSelect(swipeAction: any, item: any, event: any): void; ngOnInit(): void; ngAfterViewInit(): void; _hasSwipeActions(item: any): boolean; _getSwipeActions(item: any, direction?: ItemSlidingSide): ListSwipeAction[]; private isSwipeActionDisabled; _getSwipeActionEnd(item: any): ItemSwipeActionSlots; _getSwipeActionIcon(swipeAction: ListSwipeAction, item: any): string; _getSwipeActionTitle(swipeAction: ListSwipeAction, item: any): string; _getSwipeActionType(swipeAction: ListSwipeAction, item: any): ThemeColor; private initializeSwipeActions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface LoadOnDemandEvent { complete: (disableLoadOnDemand?: boolean) => void; } interface LoadOnDemandEventData { object: any; returnValue: any; } type ListShape = 'square' | 'rounded' | 'none'; type StandAloneSpacing = 'xxxxs' | 'xxxs' | 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'xxxl'; declare class ListComponent implements OnInit, OnChanges, AfterViewInit { private listHelper; private element; private renderer; list: any; scrollDirective: InfiniteScrollDirective; /** * Provide items for the list to render. Items must be provided in the order you expect them to be rendered. */ items: any[]; getItemColor: (item: any) => ThemeColor; /** * Callback to determine name of section. Sections will be ordered alphabetically. */ getSectionName: (item: any) => string; /** * Callback that defines how to track changes for items in the iterable. */ trackBy: TrackByFunction; /** * Property name to decide which items should be stand alone */ getStandAloneByProperty: string; /** * Bottom margin for stand alone items */ standAloneSpacing: StandAloneSpacing; /** * Text to display when no more items can be loaded (used for "on demand"-loading). */ noMoreItemsText: string; /** * Determines if dividers (bottom-border on list items) should be shown or not. */ showDivider: boolean; /** * Determines if list row text should turn bold on selection */ markSelectedRow: boolean; /** * Determine outline shape of: * - list, if {@link #isSectionsEnabled} is `false` * - section, if {@link #isSectionsEnabled} is `true` * * `square` means **without** rounded corners, `rounded` means **with** rounded corners., `none` means **without** padding, border, box-shadow and background. */ shape: ListShape; get isShapeRounded(): boolean; get isShapeNone(): boolean; hasItemSpacing: boolean; /** * Determines if the loadOnDemand event should be emitted. * Will default to true if there is at least one subscriber to the loadOnDemand event */ isLoadOnDemandEnabled: boolean; /** * Emitting event when more items are to be loaded. */ loadOnDemand: EventEmitter; /** * Determines if list items should have swipe actions or not * - the order of swipe actions is used to determine edge actions, * as well as their order of appearance on the screen. */ swipeActions: ListSwipeAction[]; /** * Emitting event when an item is selected (tapped on mobile, clicked on web) */ itemSelect: EventEmitter; disableSelectionHighlight: boolean; private _attributesToForward; headerTemplate: TemplateRef; sectionHeaderTemplate: TemplateRef; footerTemplate: TemplateRef; /** * The first element that matches ListItemDirective. * As a structural directive it unfolds into a template. This is a reference to that. */ itemTemplate: TemplateRef; _isSectionsEnabled: boolean; _isStandAloneEnabled: boolean; _isSelectable: boolean; _isLoading: boolean; _groupedItems: any[]; _selectedItem: any; constructor(listHelper: ListHelper, element: ElementRef, renderer: Renderer2); ngOnInit(): void; ngOnChanges(): void; ngAfterViewInit(): void; _onLoadOnDemand(): void; sectionTrackBy(index: number, section: { name: string; }): string | number; onItemSelect(item: any): void; onSwipeActionSelect(args: any): void; _getBoundaryClass(index: number, section?: any[]): BoundaryClass[] | BoundaryClass; standAloneClass(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } type Section = { name: string; items: T[]; }; type SectionWithStandAloneItems = { name: string; lists: T[][]; }; declare class ListHelper { onLoadOnDemand(component: ListComponent): void; groupSections(items: T[], getGroupName: (item: T) => string): Section[]; groupStandAloneItems(items: T[], standAloneProperty: string): { items: T[]; }[]; groupSectionsWithStandAloneItems(items: T[], getGroupName: (item: T) => string, standAloneProperty: string): SectionWithStandAloneItems[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ListExperimentalComponent { list: IonList; closeAllSlidingItems(e: MouseEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ListHeaderComponent { constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ListSectionHeaderComponent { title: string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ListItemTemplateDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class ListHeaderDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class ListSectionHeaderDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class ListFooterDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class ListModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { INFINITE_SCROLL_DEBOUNCE, InfiniteScrollDirective, ListComponent, ListExperimentalComponent, ListFooterDirective, ListHeaderComponent, ListHeaderDirective, ListHelper, ListItemColorDirective, ListItemComponent, ListItemTemplateDirective, ListModule, ListSectionHeaderComponent, ListSectionHeaderDirective }; export type { BoundaryClass, ListShape, ListSwipeAction, LoadOnDemandEvent, LoadOnDemandEventData, Scroll, StandAloneSpacing }; //# sourceMappingURL=kirbydesign-designsystem-list.d.ts.map