import { a as ViewStateBase, t as GetViewStateOptions } from "./types-16GC5k1z.js"; import "./index-Cdcek1Oj.js"; import { LitElement, nothing } from "lit"; type Axis = `row` | `column`; type WhenSmall = `prevent` | `collapse` | `close`; interface PanelNode { kind: `panel`; id: string; el: HTMLElement; weight: number; fixedPx: number | null; minPx: number; maxPx: number | null; whenSmall: WhenSmall; collapsed: boolean; restoreWeight: number; } interface GroupNode { kind: `group`; id: string; el: HTMLElement | null; axis: Axis; children: LayoutNode[]; weight: number; fixedPx: number | null; } type LayoutNode = PanelNode | GroupNode; interface SnapshotNode { kind: `panel` | `group`; id: string; weight?: number; collapsed?: boolean; children?: SnapshotNode[]; } interface LayoutSnapshot { version: 1; root: SnapshotNode; } /** * Saved size of one direct child of an `ixfx-split-layout`, keyed by the * child's `id` in {@link SplitLayoutViewState.layout}. */ interface SplitPanelViewState { /** * Share (0..1) of the weighted flow. For a collapsed panel, the share it * returns to when expanded. */ readonly weight: number; /** Collapsed to the gutter. Absent ⇒ expanded. */ readonly collapsed?: boolean; } /** `ixfx-split-layout` view state (`kind: 'split-layout'`). */ type SplitLayoutViewState = ViewStateBase & { /** Direct children with an author-given `id`, keyed by that id. */ readonly layout?: Readonly>; }; interface PanelInfo { id: string; el: HTMLElement; index: number; path: string; weight: number; collapsed: boolean; min: number; max: number | null; whenSmall: WhenSmall; } interface SplitResizeDetail { sizes: Record; groupId: string; } type SplitResizeEvent = CustomEvent; interface SplitCollapseDetail { id: string; index: number; } type SplitCollapseEvent = CustomEvent; interface SplitExpandDetail { id: string; index: number; } type SplitExpandEvent = CustomEvent; interface SplitCloseDetail { id: string; index: number; } type SplitCloseEvent = CustomEvent; interface SplitChangeDetail { layout: LayoutSnapshot; } type SplitChangeEvent = CustomEvent; interface SplitLayoutElementEventMap { 'ixfx-split-resize': SplitResizeEvent; 'ixfx-split-collapse': SplitCollapseEvent; 'ixfx-split-expand': SplitExpandEvent; 'ixfx-split-close': SplitCloseEvent; 'ixfx-split-change': SplitChangeEvent; } declare class SplitPanelElement extends LitElement { id: string; size: string; weight: string; fixed: string; min: string; max: string; whenSmall: string; collapsed: boolean; snap: string; render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-split-panel': SplitPanelElement; } } declare class SplitLayoutElement extends LitElement { #private; direction: Axis; sizes: string; gutterSize: string; snap: string; /** Hide the gutter grip (dimpled handle). Gutters remain draggable. */ hideGrip: boolean; /** * Forget the saved size of a child that leaves instead of re-applying it * when a child with that id returns. For hosts that drive child sizes * themselves (e.g. `ixfx-dock-host`, whose leaf ids are positional). */ forgetAbsent: boolean; private _model; private _resizing; private _groupEl?; private _observer; private _applyingOwnMutation; private _dragStructurallyChanged; private _dragMachine; connectedCallback(): void; disconnectedCallback(): void; firstUpdated(): void; private _setupObserver; private _rebuildModel; private _writeCollapsedAttributes; get panels(): PanelInfo[]; /** * Snapshot the size and collapse of every direct child with an `id`. * Includes saved entries for children not currently slotted. */ getViewState(options?: GetViewStateOptions): SplitLayoutViewState; /** * Apply saved sizes. Entries for children that aren't slotted yet are kept * and applied when a child with that id appears. Present children without * an entry keep their relative size. */ setViewState(state: Partial): void; clearPendingViewState(): void; getSizes(_groupId?: string): Record; setSizes(weights: number[] | Record, _groupId?: string): void; collapse(idOrEl: string | HTMLElement): void; expand(idOrEl: string | HTMLElement): void; toggle(idOrEl: string | HTMLElement): void; closePanel(idOrEl: string | HTMLElement): boolean; /** * Bounding rects of the gutter elements, in gutter index order. lets * callers (e.g. dock junction handles) hit-test gutters without reaching * into the shadow DOM. */ getGutterRects(): DOMRect[]; /** * Programmatically begin dragging the gutter at `gutterIndex`, as if the * user had pressed on it at (`clientX`, `clientY`). The drag then follows * the pointer `pointerId` until pointerup, exactly like a native gutter * drag. Returns false when the index is out of range or the layout isn't * ready. Intended for composite resize affordances — e.g. a junction handle * that starts this drag alongside perpendicular drags on other layouts. */ beginGutterDrag(gutterIndex: number, pointerId: number, clientX: number, clientY: number): boolean; private _setCollapsedState; private _reindexSlots; private _findPanel; private _setFlexibleWeight; private _snapPx; private _collapsedPx; private _handleDragStart; private _handleDragMove; private _handleDragEnd; private _snapshotTracks; private _reseedDragState; private _onGutterPointerDown; private _onPointerMove; private _onPointerUp; private _emitResize; private _emitChange; protected render(): import("lit").TemplateResult<1> | typeof nothing; private _getTrackSizes; private _resolveTracks; private _renderGutter; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-split-layout': SplitLayoutElement; } interface HTMLElementEventMap { 'ixfx-split-resize': CustomEvent; 'ixfx-split-collapse': CustomEvent; 'ixfx-split-expand': CustomEvent; 'ixfx-split-close': CustomEvent; 'ixfx-split-change': CustomEvent; } } export { WhenSmall as C, SplitResizeEvent as S, SplitExpandEvent as _, LayoutNode as a, SplitPanelViewState as b, PanelNode as c, SplitChangeEvent as d, SplitCloseDetail as f, SplitExpandDetail as g, SplitCollapseEvent as h, GroupNode as i, SnapshotNode as l, SplitCollapseDetail as m, SplitPanelElement as n, LayoutSnapshot as o, SplitCloseEvent as p, Axis as r, PanelInfo as s, SplitLayoutElement as t, SplitChangeDetail as u, SplitLayoutElementEventMap as v, SplitResizeDetail as x, SplitLayoutViewState as y };