igniteui-webcomponents
Version:
Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.
60 lines (59 loc) • 2.14 kB
TypeScript
import type { ReactiveController } from 'lit';
import type { ComboHost, ComboRecord, FilteringOptions, GroupingOptions } from '../types.js';
export declare class DataState<T extends object> implements ReactiveController {
private readonly _host;
private readonly _filtering;
private readonly _grouping;
private _compareCollator;
private _dataState;
private _searchTerm;
private _dirty;
/** The current state of the data in the combo component. */
get dataState(): Readonly<ComboRecord<T>[]>;
/**
* Sets the current search term used for filtering the data.
* Triggers a data pipeline run if the value changes.
*/
set searchTerm(value: string);
/** The current search term used for filtering the data. */
get searchTerm(): string;
/** The current filtering options for the combo component. */
get filteringOptions(): FilteringOptions<T>;
/** The current grouping options for the combo component. */
get groupingOptions(): GroupingOptions<T>;
/** The current collator used for comparing values. */
get compareCollator(): Intl.Collator;
constructor(host: ComboHost<T>);
/**
* Lit lifecycle hook - runs before rendering.
* Executes pipeline if any changes were batched.
* @internal
*/
hostUpdate(): void;
/**
* Marks the data state as dirty, triggering a pipeline run before next render.
* This batches multiple changes into a single pipeline execution.
*/
private _markDirty;
/**
* Executes the data pipeline if marked dirty.
* Called during the update lifecycle to batch changes.
*/
private _runPipelineIfDirty;
/**
* Initial indexing of the data - converts raw data items into ComboRecord format with metadata.
*/
private _index;
/**
* Applies the data pipeline: indexing, filtering, and grouping.
*/
private _apply;
/**
* Updates the collator when locale changes.
*/
updateLocale(locale: string): void;
/**
* Marks data as dirty when host properties that affect data change.
*/
invalidate(): void;
}