A CDK DataSource that optionally integrates with CngxSort,
CngxFilter, CngxSearch, and CngxPaginate present in the injection
tree. Each directive is injected optionally - if absent, that processing
step is skipped.
Injection resolves UPWARD only. Any atom hosted by a descendant component
a hostDirective on an element below the consumer's injector - is
invisible to these injects, and the matching step is silently skipped:
the atom's own state still toggles (headers flip their arrows) while the
rows never move. CngxDataGridAccordion is the case where this is always
true: it hosts CngxSort and CngxFilter on the group element. Hand
such atoms in through the options thunks instead:
Accepts either a plain Signal<T[]> or a CngxAsyncState<T[]>.
When a CngxAsyncState is provided, the data source exposes the full
UX state (isLoading, isRefreshing, error, isEmpty) so the
table can show skeleton rows, error states, and loading indicators.
// Plain signalreadonly dataSource = injectSmartDataSource(this.items);// With async state - full UX lifecyclereadonly residents = injectAsyncState(() => this.api.getAll(this.filter()));readonly dataSource = injectSmartDataSource(this.residents);// dataSource.isLoading(), dataSource.error(), dataSource.isRefreshing()