import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type LyraAnchorTargetEventMap}from'../../../internal/anchor-target.js';import type{LyraAnchor,LyraAnchorKind}from'../document-viewer/anchors.js';import type{LyraSearchChangeDetail}from'../../../internal/text-viewer-target.js';export interface LyraSpreadsheetViewerEventMap extends Omit{'lr-render-error':CustomEvent<{error:unknown;}>; /** Fired whenever the search query, match count, or active match index changes, from * `search()`/`searchNext()`/`searchPrevious()`/`clearSearch()`. */ 'lr-search-change':CustomEvent;}declare class LyraSpreadsheetViewerBase extends LyraElement{}declare const LyraSpreadsheetViewer_base:Omit &(new(...args:ConstructorParameters)=>InstanceType &import("../../../lyra.js").LyraAnchorTarget&{renderAnchorLiveRegion():unknown;}); /** * Fetches and renders `.xlsx` and legacy `.xls` workbooks with virtualized rows and sheet tabs. * * Adopts `DocumentAnchorTarget`: a `cell-range` anchor addresses one sheet's raw grid, 1-based, with * its (always-present) header row included -- matching how a spreadsheet app itself labels `A1`. * The target sheet resolves from the anchor's own `sheet` field (falling back to a `Sheet!`-prefixed * `range`, then the currently active sheet when neither is set); `scrollToAnchor()` switches * ``'s `active` tab first when the resolved sheet isn't already active, then scrolls the * addressed row into view via the virtualized list's `active-item-id`, then scrolls the first addressed * column horizontally into view. `highlights` paint a structural `part="cell-highlight"` cell * wrapping a focusable native `part="cell-highlight-action"` button, recomputed per row inside * `renderRow()` so a row scrolled out and back in reconstructs its highlight for free, with no * persistent DOM to keep in sync. `search()` is a case-insensitive * substring match over every sheet's stringified cell values (the same stringification `cell()` * already renders), ordered sheet then row then column, switching tabs as navigation crosses sheets. * Each sheet is independently limited to 10,000 rows and 1,000 columns; a workbook additionally * retains at most 256 sheets and 1,000,000 aggregate expanded cells. Internal tab and virtual-list * lifecycle events stay contained inside the viewer. * * @customElement lr-spreadsheet-viewer * @event lr-render-error - Fired when fetching or parsing fails. * @event lr-highlight-activate - A `highlights` cell was clicked, or activated via Enter/Space * while focused. `detail: { highlightId }`. * @event lr-anchor-result - Fired after an `anchor` property assignment or a `scrollToAnchor()` * call is applied. `detail: { found }`. * @event lr-search-change - Fired whenever the search query, match count, or active match index * changes, including source-reset and effective-locale re-evaluation. `detail: { query, * matchCount, matchCountExact, activeIndex }`. Search accepts at most 4,096 query code units, * scans at most 4,000,000 cell code units, and retains at most 1,000 matches; * `matchCountExact=false` identifies a ceiling-truncated lower bound. * @csspart base - The root wrapper. * @csspart body - The scrollable wrapper around the fetched-state content, capped by `max-height`. * @csspart tabs - The sheet-switching ``, rendered only for a multi-sheet workbook; * its `lr-tab-show`/`lr-tab-hide` lifecycle events do not escape this viewer. * @csspart sheet - The wrapper around one sheet's header row and virtualized body. * @csspart rows - The virtualized row list. * @csspart header-row - A sheet's header row. * @csspart data-row - One virtualized data row. * @csspart cell - One rendered cell. * @csspart cell-highlight - A structural cell covered by a `highlights` entry. * @csspart cell-highlight-action - The native button filling a highlighted cell -- focusable, * emits `lr-highlight-activate` on click or Enter/Space. Its accessible name localizes the * complete cell-value and annotation message through separate `{value}` and `{label}` * placeholders. * @csspart spinner - Visible ordinary loading content with a motion-safe progress indicator. * @csspart error - The error message region. * @cssprop [--lr-spreadsheet-viewer-highlight-color=var(--lr-color-brand)] - Outline color of a * highlighted cell. The active highlight changes a private warning-color default; an inherited * or direct public value remains authoritative. * @cssprop [--lr-spreadsheet-viewer-highlight-outline-offset=calc(-1 * var(--lr-border-width-medium))] - * Outline offset of a highlighted cell. * @cssprop [--lr-spreadsheet-viewer-max-height=none] - Maximum block size of `[part="body"]` * before it scrolls internally. The `maxHeight` property sets this token inline on * `[part="base"]`. * @status stable * @since 4.0.0 */ export declare class LyraSpreadsheetViewer extends LyraSpreadsheetViewer_base{static styles:import("lit").CSSResultGroup[]; /** URL to fetch and parse. */ src:string; /** Source filename or display name, used as the viewer's accessible name. */ name:string; /** A CSS `max-height`; invalid values are ignored. */ maxHeight:string; /** Anchor kinds this viewer resolves via `scrollToAnchor()`. */ readonly anchorKinds:readonly LyraAnchorKind[];private fetchState; /** Index into `fetchState.sheets` of the sheet currently shown -- bound to ``'s own * `active` (as `sheet-${index}`), and switched by `scrollToAnchor()`/search navigation whenever * a match lives on a different sheet. */ private activeSheetIndex; /** The virtualized body row currently scrolled into view on the active sheet -- bound to * ``'s own `active-item-id`. */ private activeRowKey;private searchMatches;private searchMatchCountExact;private searchActiveIndex;private searchQuery;private lastSearchLocale;private pendingSearchResetEvent;private generation;private loadLibrary;private lastLoadSrc;private readonly announcements;private readonly pendingAnimationFrames;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;private waitForOwnerAnimationFrame;private cancelPendingAnimationFrames;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private load; /** `rawRow` is 1-based, including the sheet's (always-present) header row -- the same raw-grid * addressing convention every `cell-range` anchor uses. A highlight with no sheet resolved (from * neither `anchor.sheet` nor a `Sheet!`-prefixed `range`) applies to every sheet. */ private cellHighlightsForRow;private renderCell;private renderRow;private readonly virtualListKeyFunction;private renderSheet;private renderLoaded;private onTabsChange; /** Switches to `sheetIndex` (if needed) then scrolls raw-grid `(rawRow, col)` into view -- shared * by `applyAnchor()` and every search navigation method, so both stay byte-identical in how a * coordinate becomes a scroll. */ private jumpToCell;protected applyAnchor(anchor:LyraAnchor):Promise;private scrollColumnIntoView; /** Case-insensitive substring search over every sheet's raw-grid cells (the same stringification * `cell()` renders), ordered sheet then row then column -- each sheet's header row is included, * the same raw-grid convention `cell-range` anchors use. An empty/whitespace-only query behaves * like `clearSearch()` and resolves `0`. Returns at most 1,000 retained matches; * `lr-search-change.detail.matchCountExact=false` identifies that return as a lower bound. */ search(query:string):Promise; /** Advances to the next match, wrapping to the first after the last, switching sheets when the * next match lives on a different one. Resolves `false` (no-op) when there are no matches. */ searchNext():Promise; /** Moves to the previous match, wrapping to the last before the first, switching sheets when the * previous match lives on a different one. Resolves `false` (no-op) when there are no matches. */ searchPrevious():Promise; /** Clears the query, matches, and active index, and resets `lr-search-change` to a * 0-match/no-active-index state. */ clearSearch():void;private emitSearchChange;private stopInternalEvent;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-spreadsheet-viewer':LyraSpreadsheetViewer;}}export{};