@gridkitjs/core 0.0.0-dev-20261112201151 → 0.0.0-dev-20261118111459
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-QGKPKQIO.js → chunk-PUD53NFG.js} +33 -12
- package/dist/chunk-PUD53NFG.js.map +1 -0
- package/dist/{filterEditor-B7C_n89V.d.ts → filterEditor-Dr7kwpCC.d.ts} +49 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/renderer.d.ts +2 -2
- package/dist/renderer.js +3 -1
- package/dist/renderer.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-QGKPKQIO.js.map +0 -1
|
@@ -2555,6 +2555,10 @@ interface ResolvedGroupRow {
|
|
|
2555
2555
|
readonly expanded: boolean;
|
|
2556
2556
|
/** Leaf row count under this group, regardless of collapse state. */
|
|
2557
2557
|
readonly count: number;
|
|
2558
|
+
/** 1-based place among the groups sharing its parent, for `aria-posinset`: the same on every page. */
|
|
2559
|
+
readonly position: number;
|
|
2560
|
+
/** How many groups share its parent, itself included, for `aria-setsize`: the same on every page. */
|
|
2561
|
+
readonly setSize: number;
|
|
2558
2562
|
/** Position among the display rows as rendered — same invariant ResolvedRow.rowIndex keeps. */
|
|
2559
2563
|
readonly rowIndex: number;
|
|
2560
2564
|
/** This header's absolute position in the whole filtered/sorted/grouped dataset, matching ResolvedRow.datasetIndex. */
|
|
@@ -2863,6 +2867,20 @@ interface ResolvedRow<Row> {
|
|
|
2863
2867
|
readonly rowIndex: number;
|
|
2864
2868
|
/** This row's absolute position in the whole filtered/sorted/grouped dataset, matching `CellTemplateContext`. */
|
|
2865
2869
|
readonly datasetIndex: number;
|
|
2870
|
+
/** Where the row sits in its group. Set by `groupRows`; absent from an ungrouped result. */
|
|
2871
|
+
readonly groupPosition?: RowGroupPosition;
|
|
2872
|
+
}
|
|
2873
|
+
/**
|
|
2874
|
+
* A data row's place inside its group: what a renderer draws as the row's
|
|
2875
|
+
* `aria-level`, `aria-posinset` and `aria-setsize` in a treegrid.
|
|
2876
|
+
*/
|
|
2877
|
+
interface RowGroupPosition {
|
|
2878
|
+
/** Nesting depth on `ResolvedGroupRow.level`'s scale: one deeper than the group holding the row, so `1` under a top-level group. */
|
|
2879
|
+
readonly level: number;
|
|
2880
|
+
/** 1-based place among the data rows of its group. */
|
|
2881
|
+
readonly position: number;
|
|
2882
|
+
/** How many data rows its group holds, its `count`: the same on every page the group spans. */
|
|
2883
|
+
readonly setSize: number;
|
|
2866
2884
|
}
|
|
2867
2885
|
/**
|
|
2868
2886
|
* A selected column. Carries the resolved column rather than the bare
|
|
@@ -3129,6 +3147,9 @@ interface KeyShortcutCapabilities {
|
|
|
3129
3147
|
* The `aria-keyshortcuts` string for a column header, naming only the keys
|
|
3130
3148
|
* that column actually responds to — so the keys are discoverable, since
|
|
3131
3149
|
* none of them is a convention a user would try unprompted.
|
|
3150
|
+
*
|
|
3151
|
+
* The same in either writing direction: both horizontal arrows work in
|
|
3152
|
+
* each, and only which way each one moves is mirrored.
|
|
3132
3153
|
*/
|
|
3133
3154
|
declare function buildKeyShortcuts(capabilities: KeyShortcutCapabilities): string;
|
|
3134
3155
|
/**
|
|
@@ -3140,6 +3161,20 @@ declare function buildKeyShortcuts(capabilities: KeyShortcutCapabilities): strin
|
|
|
3140
3161
|
*/
|
|
3141
3162
|
declare function accessDotted(obj: unknown, path: string): unknown;
|
|
3142
3163
|
|
|
3164
|
+
/**
|
|
3165
|
+
* The way a line runs: left to right, or right to left as in Arabic and
|
|
3166
|
+
* Hebrew. Rows, toolbars and the group-by bar run this way, so in `"rtl"`
|
|
3167
|
+
* the first column sits at the right edge.
|
|
3168
|
+
*/
|
|
3169
|
+
type WritingDirection = "ltr" | "rtl";
|
|
3170
|
+
/**
|
|
3171
|
+
* Which way a horizontal arrow key moves along a line in `direction`: `1`
|
|
3172
|
+
* to the next column, chip or toolbar control, `-1` to the previous one, or
|
|
3173
|
+
* `null` for any other key. The arrows point the way they move, so in
|
|
3174
|
+
* `"rtl"`, where the next one is to the left, `ArrowLeft` moves forward.
|
|
3175
|
+
*/
|
|
3176
|
+
declare function inlineStep(key: string, direction?: WritingDirection): 1 | -1 | null;
|
|
3177
|
+
|
|
3143
3178
|
/**
|
|
3144
3179
|
* The cell the grid's single tab stop sits on: a header cell, or a cell of
|
|
3145
3180
|
* body row `rowIndex`. A body focus's `rowIndex` counts from `0`.
|
|
@@ -3184,10 +3219,13 @@ declare function clampFocus(focus: GridFocus, rowCount: number, columnCount: num
|
|
|
3184
3219
|
* summary row (`groupAggregateDisplay: "row"`), which still occupies a real
|
|
3185
3220
|
* row slot for `rowCount`/`aria-rowindex` purposes but is presentational,
|
|
3186
3221
|
* not a stop of its own. Left/right and plain `Home`/`End` stay row-scoped
|
|
3187
|
-
* and so never consult it. Defaults to skipping nothing
|
|
3188
|
-
*
|
|
3222
|
+
* and so never consult it. Defaults to skipping nothing.
|
|
3223
|
+
*
|
|
3224
|
+
* `direction` is the way the grid's rows run, which the left and right
|
|
3225
|
+
* arrows follow: in `"rtl"`, where the first column is at the right edge,
|
|
3226
|
+
* `ArrowLeft` moves to the next column. Defaults to `"ltr"`.
|
|
3189
3227
|
*/
|
|
3190
|
-
declare function nextFocusForKey(key: string, modifiers: NavigationModifiers, focus: GridFocus, rowCount: number, columnCount: number, pageSize: number, isSkippableRow?: (rowIndex: number) => boolean): GridFocus | null;
|
|
3228
|
+
declare function nextFocusForKey(key: string, modifiers: NavigationModifiers, focus: GridFocus, rowCount: number, columnCount: number, pageSize: number, isSkippableRow?: (rowIndex: number) => boolean, direction?: WritingDirection): GridFocus | null;
|
|
3191
3229
|
|
|
3192
3230
|
/**
|
|
3193
3231
|
* Puts `columns` in the order `order` gives. Ids it lists come first, in that
|
|
@@ -3352,10 +3390,12 @@ declare function totalColumnWidth<Row, Node>(resolved: readonly ResolvedColumn<R
|
|
|
3352
3390
|
*/
|
|
3353
3391
|
declare function beginColumnResize<Row>(column: ColumnDefinition<Row, unknown>, startWidth: number, startPosition: number, defaults?: Partial<ColumnSizeDefaults>): ColumnResizeSession;
|
|
3354
3392
|
/**
|
|
3355
|
-
* The width the dragged column takes with the pointer at `position
|
|
3356
|
-
*
|
|
3393
|
+
* The width the dragged column takes with the pointer at `position`, its
|
|
3394
|
+
* edge at the inline end of the column: the right edge in `"ltr"`, the left
|
|
3395
|
+
* in `"rtl"`. Dragging that edge outward, away from the column, grows it in
|
|
3396
|
+
* either direction. `direction` defaults to `"ltr"`.
|
|
3357
3397
|
*/
|
|
3358
|
-
declare function applyColumnResize(session: ColumnResizeSession, position: number): number;
|
|
3398
|
+
declare function applyColumnResize(session: ColumnResizeSession, position: number, direction?: WritingDirection): number;
|
|
3359
3399
|
/**
|
|
3360
3400
|
* Fits columns to `availableWidth`: grows them to fill leftover space, or
|
|
3361
3401
|
* shrinks them to relieve an overflow, in both cases proportionally to each
|
|
@@ -3402,7 +3442,8 @@ declare function groupRowId(path: readonly unknown[]): string;
|
|
|
3402
3442
|
* own `direction`, followed depth-first by its nested groups and/or data
|
|
3403
3443
|
* rows. A group `expansion` collapses contributes only its own header,
|
|
3404
3444
|
* nothing beneath it — but its `count` still reports the group's full
|
|
3405
|
-
* leaf-row count either way.
|
|
3445
|
+
* leaf-row count either way. Each data row carries its `groupPosition`:
|
|
3446
|
+
* its depth, and its place among and the count of its group's rows.
|
|
3406
3447
|
*
|
|
3407
3448
|
* Filter and sort are expected to have already run (see `resolveShownRows`):
|
|
3408
3449
|
* this only reshapes their output, and never changes which rows appear or
|
|
@@ -3700,4 +3741,4 @@ declare function draftToFilter<Row>(draft: FilterEditorDraft<Row>, columnId: str
|
|
|
3700
3741
|
*/
|
|
3701
3742
|
declare function filterDraftChanged<Row>(opened: FilterEditorDraft<Row>, draft: FilterEditorDraft<Row>): boolean;
|
|
3702
3743
|
|
|
3703
|
-
export { type CellSelectionState as $, type AggregateState as A, type SerializedGridState as B, type ColumnType as C, type DataColumn as D, type ExportTable as E, type FilterState as F, type GridControllerOptions as G, type ExportSource as H, type ExportWriter as I, type GridExportOptions as J, type ExportFile as K, ALL_COLLAPSED as L, type MenuEntry as M, ALL_EXPANDED as N, type AggregateFn as O, type PaginationUnit as P, type AggregateSpec as Q, type ResolvedMenuEntry as R, type SortDirection as S, type ToolbarItemAttributes as T, type Borders as U, type BuiltInAggregate as V, type BuiltInCommandIcon as W, type BuiltInCommandId as X, type CellSelectEvent as Y, type CellSelectionChangeEvent as Z, type CellSelectionMode as _, type GridController as a, type JsonOptions as a$, type CellTemplateContext as a0, type ColumnAlignment as a1, type ColumnConstraints as a2, type ColumnFilterMenuOptions as a3, type ColumnOrderEvent as a4, type ColumnOrderState as a5, type ColumnResizeEvent as a6, type ColumnResolveOptions as a7, type ColumnSelectEvent as a8, type ColumnSelectionChangeEvent as a9, type FilterOperatorFamily as aA, type FilterPredicate as aB, type FilterScalar as aC, type FooterTemplateContext as aD, type FormatLocale as aE, type GridCommandActions as aF, type GridCommandEvent as aG, type GridCommandSource as aH, type GridContextMenuArea as aI, type GridContextMenuEntries as aJ, type GridContextMenuOptions as aK, type GridContextMenuRequest as aL, type GridContextMenuTarget as aM, type GridFilterMenuOptions as aN, type GridFocus as aO, type GridOptions as aP, type GridPanelKind as aQ, type GridToolbarOptions as aR, type GridViewOptions as aS, type GridViewState as aT, type GroupByBarVisibility as aU, type GroupByEntry as aV, type GroupByEvent as aW, type GroupExpansionEvent as aX, type GroupExpansionState as aY, type GroupFilterEntry as aZ, type HoverableConfig as a_, type ColumnSizeDefaults as aa, type ColumnSizingState as ab, type ColumnSortEntry as ac, type ColumnSortEvent as ad, type ColumnVisibilityEvent as ae, type ColumnWrapConfig as af, type ColumnsSelectEvent as ag, type ContextMenuOpenChangeEvent as ah, type CopyContent as ai, type CsvOptions as aj, DEFAULT_COLUMN_SIZES as ak, DEFAULT_FILTER_VALUE_LIMIT as al, type ExportCell as am, type ExportColumn as an, type ExportDataRow as ao, type ExportGroupRow as ap, type ExportGroupSummaryRow as aq, type ExportOptions as ar, type ExportRow as as, type ExportScalar as at, type ExportTotalRow as au, type ExportWriteContext as av, type FilterChangeEvent as aw, type FilterEntry as ax, type FilterMenuUi as ay, type FilterOperator as az, type GridCommandTarget as b,
|
|
3744
|
+
export { type CellSelectionState as $, type AggregateState as A, type SerializedGridState as B, type ColumnType as C, type DataColumn as D, type ExportTable as E, type FilterState as F, type GridControllerOptions as G, type ExportSource as H, type ExportWriter as I, type GridExportOptions as J, type ExportFile as K, ALL_COLLAPSED as L, type MenuEntry as M, ALL_EXPANDED as N, type AggregateFn as O, type PaginationUnit as P, type AggregateSpec as Q, type ResolvedMenuEntry as R, type SortDirection as S, type ToolbarItemAttributes as T, type Borders as U, type BuiltInAggregate as V, type BuiltInCommandIcon as W, type BuiltInCommandId as X, type CellSelectEvent as Y, type CellSelectionChangeEvent as Z, type CellSelectionMode as _, type GridController as a, type JsonOptions as a$, type CellTemplateContext as a0, type ColumnAlignment as a1, type ColumnConstraints as a2, type ColumnFilterMenuOptions as a3, type ColumnOrderEvent as a4, type ColumnOrderState as a5, type ColumnResizeEvent as a6, type ColumnResolveOptions as a7, type ColumnSelectEvent as a8, type ColumnSelectionChangeEvent as a9, type FilterOperatorFamily as aA, type FilterPredicate as aB, type FilterScalar as aC, type FooterTemplateContext as aD, type FormatLocale as aE, type GridCommandActions as aF, type GridCommandEvent as aG, type GridCommandSource as aH, type GridContextMenuArea as aI, type GridContextMenuEntries as aJ, type GridContextMenuOptions as aK, type GridContextMenuRequest as aL, type GridContextMenuTarget as aM, type GridFilterMenuOptions as aN, type GridFocus as aO, type GridOptions as aP, type GridPanelKind as aQ, type GridToolbarOptions as aR, type GridViewOptions as aS, type GridViewState as aT, type GroupByBarVisibility as aU, type GroupByEntry as aV, type GroupByEvent as aW, type GroupExpansionEvent as aX, type GroupExpansionState as aY, type GroupFilterEntry as aZ, type HoverableConfig as a_, type ColumnSizeDefaults as aa, type ColumnSizingState as ab, type ColumnSortEntry as ac, type ColumnSortEvent as ad, type ColumnVisibilityEvent as ae, type ColumnWrapConfig as af, type ColumnsSelectEvent as ag, type ContextMenuOpenChangeEvent as ah, type CopyContent as ai, type CsvOptions as aj, DEFAULT_COLUMN_SIZES as ak, DEFAULT_FILTER_VALUE_LIMIT as al, type ExportCell as am, type ExportColumn as an, type ExportDataRow as ao, type ExportGroupRow as ap, type ExportGroupSummaryRow as aq, type ExportOptions as ar, type ExportRow as as, type ExportScalar as at, type ExportTotalRow as au, type ExportWriteContext as av, type FilterChangeEvent as aw, type FilterEntry as ax, type FilterMenuUi as ay, type FilterOperator as az, type GridCommandTarget as b, formatCellValue as b$, type MenuItemEntry as b0, type MenuSubmenuEntry as b1, type OperatorFilterEntry as b2, type PaginationChangeEvent as b3, type PredicateFilterEntry as b4, type PrintDocument as b5, type PrintOptions as b6, type PrintOrientation as b7, type PrintPage as b8, type PrintSource as b9, type SerializedFilterState as bA, type SerializedGroupFilterEntry as bB, type SerializedOperatorFilterEntry as bC, type SerializedValueFilterEntry as bD, type TextFilterEntry as bE, type ToolbarCustomEntry as bF, type ValueFilterEntry as bG, accessDotted as bH, alignmentForType as bI, applyColumnOrder as bJ, applySelectionIntent as bK, bodyFocus as bL, buildExportTable as bM, builtInCommands as bN, clearSelection as bO, collapseAllGroups as bP, contextMenuEntries as bQ, createDefaultMessages as bR, csvWriter as bS, defaultContextMenu as bT, defaultFilterOperators as bU, defaultMessages as bV, defaultToolbar as bW, defineColumnsFromRows as bX, expandAllGroups as bY, exportPrintDocument as bZ, formatAggregateValue as b_, type ResizeMode as ba, type ResolvedGroupRow as bb, type ResolvedGroupSummaryRow as bc, type ResolvedMenuItem as bd, type ResolvedMenuSeparator as be, type ResolvedMenuSubmenu as bf, type ResolvedToolbarButton as bg, type ResolvedToolbarCustom as bh, type ResolvedToolbarMenu as bi, type ResolvedToolbarSearch as bj, type ResolvedToolbarSpacer as bk, type RowGroupPosition as bl, type RowPointerEvent as bm, type RowProps as bn, type RowSelectEvent as bo, type RowSelectionChangeEvent as bp, type RowsSelectEvent as bq, type SelectIntent as br, type SelectableConfig as bs, type SelectionCallbacks as bt, type SelectionDiff as bu, type SelectionDiffEvent as bv, type SelectionMode as bw, type SelectionState as bx, type SerializedFilterEntry as by, type SerializedFilterScalar as bz, type GridMessages as c, formatFilterOperand as c$, formatGroupValue as c0, getColumnId as c1, groupRowId as c2, groupRows as c3, headerFocus as c4, isColumnFiltered as c5, isGroupExpanded as c6, isSameCell as c7, jsonWriter as c8, moveColumnBefore as c9, type CopyRequest as cA, type CopySource as cB, type DropSide as cC, type FilterEditorAction as cD, type FilterEditorDraft as cE, type FilterEditorDraftBase as cF, KEYBOARD_STEP as cG, type KeyShortcutCapabilities as cH, type NavigationModifiers as cI, type ResolvedColumnFilterMenu as cJ, type WritingDirection as cK, applyColumnResize as cL, beginColumnResize as cM, buildKeyShortcuts as cN, buildPrintDocument as cO, clampColumnWidth as cP, clampFocus as cQ, columnValueOptions as cR, copyContent as cS, describeColumnFilter as cT, diffSelection as cU, draftToFilter as cV, filterDraftChanged as cW, filterEditorReducer as cX, filterOperandArity as cY, filterOperatorFamily as cZ, fitColumnsToWidth as c_, moveGroupByBefore as ca, resolveColumnHeaderText as cb, resolveColumnLabel as cc, resolveColumnWidths as cd, resolveDataColumns as ce, resolveExportWriters as cf, resolveMessages as cg, resolveRowId as ch, selectAll as ci, selectCell as cj, selectOnly as ck, selectRange as cl, toCsv as cm, toJson as cn, toggleCellSelection as co, toggleGroupExpansion as cp, toggleSelection as cq, toolbarEntries as cr, type SelectAllState as cs, type ColumnFilterShape as ct, type ColumnValueQuery as cu, type ColumnValueOptions as cv, type ValuesDraft as cw, type ColumnResizeSession as cx, type ColumnValueOption as cy, type ConditionsDraft as cz, type GridCommandHost as d, hasContextMenu as d0, initialFilterEditorDraft as d1, inlineStep as d2, intentOf as d3, movesColumn as d4, movesGroupBy as d5, nextFocusForKey as d6, parseFilterOperand as d7, resolveColumnConstraints as d8, resolveColumnFilterMenu as d9, resolveDropBefore as da, resolveKeyboardDropTarget as db, revertColumnSize as dc, selectAllState as dd, sizeColumnToContent as de, toConditionsDraft as df, toValuesDraft as dg, totalColumnWidth as dh, visibleFilterOptions as di, type GridCommandContext as e, type GridCommand as f, type GridToolbarTarget as g, type ToolbarEntry as h, type ResolvedToolbarItem as i, type ColumnSortState as j, type ResolvedRow as k, type FieldPath as l, type ResolvedColumn as m, type SelectedCellRef as n, type SelectedCell as o, type SelectedColumn as p, type DisplayRow as q, type PaginationState as r, type AggregateResults as s, type GroupByState as t, type GroupAggregateDisplay as u, type ColumnVisibilityState as v, type ColumnDefinition as w, type GridViewInput as x, type GridView as y, type GridState as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GridControllerOptions, a as GridController, b as GridCommandTarget, c as GridMessages, d as GridCommandHost, e as GridCommandContext, f as GridCommand, M as MenuEntry, R as ResolvedMenuEntry, g as GridToolbarTarget, T as ToolbarItemAttributes, h as ToolbarEntry, i as ResolvedToolbarItem, C as ColumnType, j as ColumnSortState, S as SortDirection, k as ResolvedRow, D as DataColumn, F as FilterState, l as FieldPath, m as ResolvedColumn, n as SelectedCellRef, o as SelectedCell, p as SelectedColumn, P as PaginationUnit, q as DisplayRow, r as PaginationState, A as AggregateState, s as AggregateResults, t as GroupByState, u as GroupAggregateDisplay, v as ColumnVisibilityState, w as ColumnDefinition, x as GridViewInput, y as GridView, z as GridState, B as SerializedGridState, E as ExportTable, H as ExportSource, I as ExportWriter, J as GridExportOptions, K as ExportFile } from './filterEditor-
|
|
2
|
-
export { L as ALL_COLLAPSED, N as ALL_EXPANDED, O as AggregateFn, Q as AggregateSpec, U as Borders, V as BuiltInAggregate, W as BuiltInCommandIcon, X as BuiltInCommandId, Y as CellSelectEvent, Z as CellSelectionChangeEvent, _ as CellSelectionMode, $ as CellSelectionState, a0 as CellTemplateContext, a1 as ColumnAlignment, a2 as ColumnConstraints, a3 as ColumnFilterMenuOptions, a4 as ColumnOrderEvent, a5 as ColumnOrderState, a6 as ColumnResizeEvent, a7 as ColumnResolveOptions, a8 as ColumnSelectEvent, a9 as ColumnSelectionChangeEvent, aa as ColumnSizeDefaults, ab as ColumnSizingState, ac as ColumnSortEntry, ad as ColumnSortEvent, ae as ColumnVisibilityEvent, af as ColumnWrapConfig, ag as ColumnsSelectEvent, ah as ContextMenuOpenChangeEvent, ai as CopyContent, aj as CsvOptions, ak as DEFAULT_COLUMN_SIZES, al as DEFAULT_FILTER_VALUE_LIMIT, am as ExportCell, an as ExportColumn, ao as ExportDataRow, ap as ExportGroupRow, aq as ExportGroupSummaryRow, ar as ExportOptions, as as ExportRow, at as ExportScalar, au as ExportTotalRow, av as ExportWriteContext, aw as FilterChangeEvent, ax as FilterEntry, ay as FilterMenuUi, az as FilterOperator, aA as FilterOperatorFamily, aB as FilterPredicate, aC as FilterScalar, aD as FooterTemplateContext, aE as FormatLocale, aF as GridCommandActions, aG as GridCommandEvent, aH as GridCommandSource, aI as GridContextMenuArea, aJ as GridContextMenuEntries, aK as GridContextMenuOptions, aL as GridContextMenuRequest, aM as GridContextMenuTarget, aN as GridFilterMenuOptions, aO as GridFocus, aP as GridOptions, aQ as GridPanelKind, aR as GridToolbarOptions, aS as GridViewOptions, aT as GridViewState, aU as GroupByBarVisibility, aV as GroupByEntry, aW as GroupByEvent, aX as GroupExpansionEvent, aY as GroupExpansionState, aZ as GroupFilterEntry, a_ as HoverableConfig, a$ as JsonOptions, b0 as MenuItemEntry, b1 as MenuSubmenuEntry, b2 as OperatorFilterEntry, b3 as PaginationChangeEvent, b4 as PredicateFilterEntry, b5 as PrintDocument, b6 as PrintOptions, b7 as PrintOrientation, b8 as PrintPage, b9 as PrintSource, ba as ResizeMode, bb as ResolvedGroupRow, bc as ResolvedGroupSummaryRow, bd as ResolvedMenuItem, be as ResolvedMenuSeparator, bf as ResolvedMenuSubmenu, bg as ResolvedToolbarButton, bh as ResolvedToolbarCustom, bi as ResolvedToolbarMenu, bj as ResolvedToolbarSearch, bk as ResolvedToolbarSpacer, bl as
|
|
1
|
+
import { G as GridControllerOptions, a as GridController, b as GridCommandTarget, c as GridMessages, d as GridCommandHost, e as GridCommandContext, f as GridCommand, M as MenuEntry, R as ResolvedMenuEntry, g as GridToolbarTarget, T as ToolbarItemAttributes, h as ToolbarEntry, i as ResolvedToolbarItem, C as ColumnType, j as ColumnSortState, S as SortDirection, k as ResolvedRow, D as DataColumn, F as FilterState, l as FieldPath, m as ResolvedColumn, n as SelectedCellRef, o as SelectedCell, p as SelectedColumn, P as PaginationUnit, q as DisplayRow, r as PaginationState, A as AggregateState, s as AggregateResults, t as GroupByState, u as GroupAggregateDisplay, v as ColumnVisibilityState, w as ColumnDefinition, x as GridViewInput, y as GridView, z as GridState, B as SerializedGridState, E as ExportTable, H as ExportSource, I as ExportWriter, J as GridExportOptions, K as ExportFile } from './filterEditor-Dr7kwpCC.js';
|
|
2
|
+
export { L as ALL_COLLAPSED, N as ALL_EXPANDED, O as AggregateFn, Q as AggregateSpec, U as Borders, V as BuiltInAggregate, W as BuiltInCommandIcon, X as BuiltInCommandId, Y as CellSelectEvent, Z as CellSelectionChangeEvent, _ as CellSelectionMode, $ as CellSelectionState, a0 as CellTemplateContext, a1 as ColumnAlignment, a2 as ColumnConstraints, a3 as ColumnFilterMenuOptions, a4 as ColumnOrderEvent, a5 as ColumnOrderState, a6 as ColumnResizeEvent, a7 as ColumnResolveOptions, a8 as ColumnSelectEvent, a9 as ColumnSelectionChangeEvent, aa as ColumnSizeDefaults, ab as ColumnSizingState, ac as ColumnSortEntry, ad as ColumnSortEvent, ae as ColumnVisibilityEvent, af as ColumnWrapConfig, ag as ColumnsSelectEvent, ah as ContextMenuOpenChangeEvent, ai as CopyContent, aj as CsvOptions, ak as DEFAULT_COLUMN_SIZES, al as DEFAULT_FILTER_VALUE_LIMIT, am as ExportCell, an as ExportColumn, ao as ExportDataRow, ap as ExportGroupRow, aq as ExportGroupSummaryRow, ar as ExportOptions, as as ExportRow, at as ExportScalar, au as ExportTotalRow, av as ExportWriteContext, aw as FilterChangeEvent, ax as FilterEntry, ay as FilterMenuUi, az as FilterOperator, aA as FilterOperatorFamily, aB as FilterPredicate, aC as FilterScalar, aD as FooterTemplateContext, aE as FormatLocale, aF as GridCommandActions, aG as GridCommandEvent, aH as GridCommandSource, aI as GridContextMenuArea, aJ as GridContextMenuEntries, aK as GridContextMenuOptions, aL as GridContextMenuRequest, aM as GridContextMenuTarget, aN as GridFilterMenuOptions, aO as GridFocus, aP as GridOptions, aQ as GridPanelKind, aR as GridToolbarOptions, aS as GridViewOptions, aT as GridViewState, aU as GroupByBarVisibility, aV as GroupByEntry, aW as GroupByEvent, aX as GroupExpansionEvent, aY as GroupExpansionState, aZ as GroupFilterEntry, a_ as HoverableConfig, a$ as JsonOptions, b0 as MenuItemEntry, b1 as MenuSubmenuEntry, b2 as OperatorFilterEntry, b3 as PaginationChangeEvent, b4 as PredicateFilterEntry, b5 as PrintDocument, b6 as PrintOptions, b7 as PrintOrientation, b8 as PrintPage, b9 as PrintSource, ba as ResizeMode, bb as ResolvedGroupRow, bc as ResolvedGroupSummaryRow, bd as ResolvedMenuItem, be as ResolvedMenuSeparator, bf as ResolvedMenuSubmenu, bg as ResolvedToolbarButton, bh as ResolvedToolbarCustom, bi as ResolvedToolbarMenu, bj as ResolvedToolbarSearch, bk as ResolvedToolbarSpacer, bl as RowGroupPosition, bm as RowPointerEvent, bn as RowProps, bo as RowSelectEvent, bp as RowSelectionChangeEvent, bq as RowsSelectEvent, br as SelectIntent, bs as SelectableConfig, bt as SelectionCallbacks, bu as SelectionDiff, bv as SelectionDiffEvent, bw as SelectionMode, bx as SelectionState, by as SerializedFilterEntry, bz as SerializedFilterScalar, bA as SerializedFilterState, bB as SerializedGroupFilterEntry, bC as SerializedOperatorFilterEntry, bD as SerializedValueFilterEntry, bE as TextFilterEntry, bF as ToolbarCustomEntry, bG as ValueFilterEntry, bH as accessDotted, bI as alignmentForType, bJ as applyColumnOrder, bK as applySelectionIntent, bL as bodyFocus, bM as buildExportTable, bN as builtInCommands, bO as clearSelection, bP as collapseAllGroups, bQ as contextMenuEntries, bR as createDefaultMessages, bS as csvWriter, bT as defaultContextMenu, bU as defaultFilterOperators, bV as defaultMessages, bW as defaultToolbar, bX as defineColumnsFromRows, bY as expandAllGroups, bZ as exportPrintDocument, b_ as formatAggregateValue, b$ as formatCellValue, c0 as formatGroupValue, c1 as getColumnId, c2 as groupRowId, c3 as groupRows, c4 as headerFocus, c5 as isColumnFiltered, c6 as isGroupExpanded, c7 as isSameCell, c8 as jsonWriter, c9 as moveColumnBefore, ca as moveGroupByBefore, cb as resolveColumnHeaderText, cc as resolveColumnLabel, cd as resolveColumnWidths, ce as resolveDataColumns, cf as resolveExportWriters, cg as resolveMessages, ch as resolveRowId, ci as selectAll, cj as selectCell, ck as selectOnly, cl as selectRange, cm as toCsv, cn as toJson, co as toggleCellSelection, cp as toggleGroupExpansion, cq as toggleSelection, cr as toolbarEntries } from './filterEditor-Dr7kwpCC.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Creates the state container for one grid — see `GridController`. Hold one
|
package/dist/index.js
CHANGED
package/dist/renderer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ResolvedMenuEntry, i as ResolvedToolbarItem, F as FilterState, D as DataColumn, v as ColumnVisibilityState,
|
|
2
|
-
export {
|
|
1
|
+
import { R as ResolvedMenuEntry, i as ResolvedToolbarItem, F as FilterState, D as DataColumn, v as ColumnVisibilityState, cs as SelectAllState, az as FilterOperator, b2 as OperatorFilterEntry, ct as ColumnFilterShape, C as ColumnType, cu as ColumnValueQuery, cv as ColumnValueOptions, aC as FilterScalar, cw as ValuesDraft } from './filterEditor-Dr7kwpCC.js';
|
|
2
|
+
export { cx as ColumnResizeSession, cy as ColumnValueOption, cz as ConditionsDraft, cA as CopyRequest, cB as CopySource, cC as DropSide, cD as FilterEditorAction, cE as FilterEditorDraft, cF as FilterEditorDraftBase, cG as KEYBOARD_STEP, cH as KeyShortcutCapabilities, cI as NavigationModifiers, cJ as ResolvedColumnFilterMenu, cK as WritingDirection, cL as applyColumnResize, cM as beginColumnResize, cN as buildKeyShortcuts, cO as buildPrintDocument, cP as clampColumnWidth, cQ as clampFocus, cR as columnValueOptions, cS as copyContent, cT as describeColumnFilter, cU as diffSelection, cV as draftToFilter, cW as filterDraftChanged, cX as filterEditorReducer, cY as filterOperandArity, cZ as filterOperatorFamily, c_ as fitColumnsToWidth, c$ as formatFilterOperand, d0 as hasContextMenu, d1 as initialFilterEditorDraft, d2 as inlineStep, d3 as intentOf, d4 as movesColumn, d5 as movesGroupBy, d6 as nextFocusForKey, d7 as parseFilterOperand, d8 as resolveColumnConstraints, d9 as resolveColumnFilterMenu, da as resolveDropBefore, db as resolveKeyboardDropTarget, dc as revertColumnSize, dd as selectAllState, de as sizeColumnToContent, df as toConditionsDraft, dg as toValuesDraft, dh as totalColumnWidth, di as visibleFilterOptions } from './filterEditor-Dr7kwpCC.js';
|
|
3
3
|
|
|
4
4
|
/** Where an arrow, Home or End key moves a menu's focus. */
|
|
5
5
|
type MenuMove = "next" | "previous" | "first" | "last";
|
package/dist/renderer.js
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
formatFilterOperand,
|
|
22
22
|
hasContextMenu,
|
|
23
23
|
initialFilterEditorDraft,
|
|
24
|
+
inlineStep,
|
|
24
25
|
intentOf,
|
|
25
26
|
isColumnVisible,
|
|
26
27
|
isScalarList,
|
|
@@ -44,7 +45,7 @@ import {
|
|
|
44
45
|
totalColumnWidth,
|
|
45
46
|
touchesColumn,
|
|
46
47
|
visibleFilterOptions
|
|
47
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-PUD53NFG.js";
|
|
48
49
|
|
|
49
50
|
// src/menu/navigation.ts
|
|
50
51
|
function startIndex(count, from, move) {
|
|
@@ -446,6 +447,7 @@ export {
|
|
|
446
447
|
formatFilterOperand,
|
|
447
448
|
hasContextMenu,
|
|
448
449
|
initialFilterEditorDraft,
|
|
450
|
+
inlineStep,
|
|
449
451
|
intentOf,
|
|
450
452
|
isPinnedToolbarItem,
|
|
451
453
|
movesColumn,
|
package/dist/renderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/menu/navigation.ts","../src/toolbar/overflow.ts","../src/toolbar/search.ts","../src/util/paginationWindow.ts","../src/util/columnChooser.ts","../src/filterMenu/conditions.ts","../src/filterMenu/valueCache.ts","../src/filterMenu/checklist.ts","../src/util/virtualization.ts"],"sourcesContent":["import type { ResolvedMenuEntry } from \"./types\";\n\n/** Where an arrow, Home or End key moves a menu's focus. */\nexport type MenuMove = \"next\" | \"previous\" | \"first\" | \"last\";\n\n/** Where the search for the next item begins, before skipping separators. */\nfunction startIndex(count: number, from: number, move: MenuMove): number {\n const focused = from >= 0 && from < count;\n switch (move) {\n case \"first\":\n return 0;\n case \"last\":\n return count - 1;\n case \"next\":\n return focused ? from + 1 : 0;\n case \"previous\":\n return focused ? from - 1 : count - 1;\n }\n}\n\n/**\n * The index of the item focus moves to from `from` — `-1` when nothing is\n * focused yet, so `\"next\"` lands on the first item and `\"previous\"` on the\n * last. Separators are skipped and `\"next\"`/`\"previous\"` wrap round the\n * ends; disabled items count, since they stay focusable for a screen reader\n * to find. `-1` when there is no item at all.\n *\n * Takes anything with a `type`, so a behaviour that reads its items off the\n * page can pass `{ type: \"item\" }` for each.\n */\nexport function nextMenuIndex(\n entries: readonly Pick<ResolvedMenuEntry, \"type\">[],\n from: number,\n move: MenuMove,\n): number {\n const count = entries.length;\n const step = move === \"next\" || move === \"first\" ? 1 : -1;\n const start = startIndex(count, from, move);\n for (let offset = 0; offset < count; offset++) {\n const index = (((start + step * offset) % count) + count) % count;\n if (entries[index]?.type !== \"separator\") {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * The index of the item `query` — what was typed, buffered for a moment —\n * picks, matched case-insensitively against the start of each label and\n * wrapping round the end; `-1` when none matches.\n *\n * `from` is the item focused now. A single letter, or the same letter\n * typed again and again, searches from the item after it, so repeating a\n * letter steps through every item it starts. A longer query searches from\n * `from` itself, so the item already found stays put while what is typed\n * still matches it.\n */\nexport function typeaheadIndex(\n labels: readonly string[],\n from: number,\n query: string,\n): number {\n const typed = query.toLowerCase();\n const firstCodePoint = typed.codePointAt(0);\n if (firstCodePoint === undefined) {\n return -1;\n }\n const first = String.fromCodePoint(firstCodePoint);\n const repeated = typed.replaceAll(first, \"\") === \"\";\n const prefix = repeated ? first : typed;\n const start = repeated ? from + 1 : Math.max(from, 0);\n for (let offset = 0; offset < labels.length; offset++) {\n const index = (start + offset) % labels.length;\n if (labels[index]?.toLowerCase().startsWith(prefix) === true) {\n return index;\n }\n }\n return -1;\n}\n","import { collapseSeparators } from \"../menu/resolveMenu\";\nimport type { ResolvedMenuEntry } from \"../menu/types\";\nimport type { ResolvedToolbarItem } from \"./types\";\n\n/** What `fitToolbarItems` fits: a toolbar's entries, by width, into its space. */\nexport interface ToolbarFitInput {\n /** Each entry's width, in order — `0` for a spacer, whose width is only the space left over. */\n readonly widths: readonly number[];\n /** The width the entries share. */\n readonly available: number;\n /** The width of the \"More\" button the entries that do not fit go into. */\n readonly moreWidth: number;\n /** Whether each entry, in order, stays however little room there is. */\n readonly pinned: readonly boolean[];\n}\n\n/**\n * How many of a toolbar's entries fit, from the start: the first `count`\n * stay in the toolbar, with every pinned entry after them, and the rest go\n * into a \"More\" menu.\n *\n * Pinned entries take their room first, wherever they are. Room for \"More\"\n * is kept only when something does not fit — when everything does, the\n * result is every entry and no \"More\" is drawn. Entries are taken in order\n * and the first that does not fit ends the count, so the toolbar keeps its\n * order rather than filling gaps with later, narrower entries; one with no\n * width, a spacer, fits wherever the entries before it did.\n */\nexport function fitToolbarItems({\n widths,\n available,\n moreWidth,\n pinned,\n}: ToolbarFitInput): number {\n const total = widths.reduce((sum, width) => sum + width, 0);\n if (total <= available) {\n return widths.length;\n }\n let used =\n moreWidth +\n widths.reduce((sum, width, index) => sum + (pinned[index] ? width : 0), 0);\n for (const [index, width] of widths.entries()) {\n if (!pinned[index]) {\n used += width;\n if (used > available) {\n return index;\n }\n }\n }\n return widths.length;\n}\n\n/**\n * Whether a toolbar entry stays in the toolbar however narrow it gets: the\n * search box and custom entries, which have no menu item to become.\n */\nexport function isPinnedToolbarItem(\n item: Pick<ResolvedToolbarItem, \"type\">,\n): boolean {\n return item.type === \"search\" || item.type === \"custom\";\n}\n\n/** A toolbar split at the count `fitToolbarItems` gave — see `splitToolbarItems`. */\nexport interface ToolbarSplit {\n /** What stays in the toolbar. */\n readonly shown: readonly ResolvedToolbarItem[];\n /** The \"More\" menu's entries, empty when everything fits. */\n readonly overflow: readonly ResolvedMenuEntry[];\n}\n\n/** An entry that did not fit, as the \"More\" menu lists it; `null` for a spacer. */\nfunction asMenuEntry(item: ResolvedToolbarItem): ResolvedMenuEntry | null {\n switch (item.type) {\n case \"button\":\n return {\n type: \"item\",\n id: item.id,\n label: item.label,\n icon: item.icon,\n shortcut: item.shortcut,\n disabled: item.disabled,\n checked: item.pressed,\n run: item.run,\n };\n case \"menu\":\n return {\n type: \"submenu\",\n id: item.id,\n label: item.label,\n icon: item.icon,\n items: item.items,\n };\n case \"separator\":\n return item;\n default:\n return null;\n }\n}\n\n/**\n * `items` split at the first `fit`: those before it, and every pinned item,\n * stay in the toolbar; the rest become the \"More\" menu's entries — a button\n * an item, checked where it was pressed, and a dropdown a submenu. Neither\n * side keeps a separator at its ends, doubled, or beside a spacer.\n */\nexport function splitToolbarItems(\n items: readonly ResolvedToolbarItem[],\n fit: number,\n): ToolbarSplit {\n const fits = (item: ResolvedToolbarItem, index: number) =>\n index < fit || isPinnedToolbarItem(item);\n return {\n shown: collapseSeparators(\n items.filter(fits),\n (item) => item.type === \"spacer\",\n ),\n overflow: collapseSeparators(\n items\n .filter((item, index) => !fits(item, index))\n .map(asMenuEntry)\n .filter((entry) => entry !== null),\n ),\n };\n}\n","import type { FilterState } from \"../types\";\nimport { filterQueryFor, setColumnFilter } from \"../util/filtering\";\n\n/**\n * What a search box shows for `filter`: the global text entry's query — the\n * one naming no column — without the `%` anchors that make it a \"contains\"\n * match, or `\"\"` when there is none. A `%` the user typed inside the text\n * stays: only the first and last characters are anchors.\n */\nexport function searchTextOf<Row>(filter: FilterState<Row>): string {\n const query = filterQueryFor(filter) ?? \"\";\n const start = query.startsWith(\"%\") ? 1 : 0;\n const end = query.endsWith(\"%\") ? -1 : undefined;\n return query.slice(start, end);\n}\n\n/**\n * `filter` with its global text entry set to search for `text` anywhere in\n * any column — the query `%text%` — or removed for an empty `text`. Every\n * entry naming a column stays as it was. `filter` itself, unchanged, when\n * it already searches for `text`.\n *\n * `text` is written as typed, spaces and all: a search box reads its text\n * back from the filter, and trimming here would take a space away from\n * under the caret as the user types it.\n */\nexport function setSearchText<Row>(\n filter: FilterState<Row>,\n text: string,\n): FilterState<Row> {\n return setColumnFilter(filter, undefined, text === \"\" ? \"\" : `%${text}%`);\n}\n","export type PaginationWindowEntry = number | \"ellipsis\";\n\n/**\n * Which page numbers a numbered pager should show for `currentPage` of\n * `pageCount` — the boundary + sibling windowing MUI's `usePagination` uses.\n * Always includes the first/last `boundaryCount` pages and a run of\n * `2 * siblingCount + 1` pages around `currentPage`, slid inwards rather than\n * cut short near either end, with one slot between each boundary and that\n * run holding either the single page it skips or an `\"ellipsis\"`.\n *\n * So once `pageCount` exceeds `2 * boundaryCount + 2 * siblingCount + 3`,\n * every window is exactly that many entries long, wherever `currentPage`\n * sits: a pager drawing one fixed-width slot per entry keeps its trailing\n * controls in place as the user pages through. Below that, every page shows.\n */\nexport function paginationWindow(\n currentPage: number,\n pageCount: number,\n options?: {\n boundaryCount?: number | undefined;\n siblingCount?: number | undefined;\n },\n): readonly PaginationWindowEntry[] {\n if (pageCount <= 0) {\n return [];\n }\n\n const boundaryCount = Math.max(0, Math.floor(options?.boundaryCount ?? 1));\n const siblingCount = Math.max(0, Math.floor(options?.siblingCount ?? 1));\n const slotCount = 2 * boundaryCount + 2 * siblingCount + 3;\n\n if (pageCount <= slotCount) {\n return Array.from({ length: pageCount }, (_, index) => index + 1);\n }\n\n const current = Math.min(Math.max(currentPage, 1), pageCount);\n // The sibling run, slid to stay clear of the slot beside each boundary.\n const runStart = Math.min(\n Math.max(current - siblingCount, boundaryCount + 2),\n pageCount - boundaryCount - 1 - 2 * siblingCount,\n );\n const runEnd = runStart + 2 * siblingCount;\n\n const entries: PaginationWindowEntry[] = [];\n for (let page = 1; page <= boundaryCount; page++) {\n entries.push(page);\n }\n entries.push(runStart === boundaryCount + 2 ? boundaryCount + 1 : \"ellipsis\");\n for (let page = runStart; page <= runEnd; page++) {\n entries.push(page);\n }\n entries.push(\n runEnd === pageCount - boundaryCount - 1\n ? pageCount - boundaryCount\n : \"ellipsis\",\n );\n for (let page = pageCount - boundaryCount + 1; page <= pageCount; page++) {\n entries.push(page);\n }\n\n return entries;\n}\n","import type { ColumnVisibilityState, DataColumn } from \"../types\";\nimport type { SelectAllState } from \"./filterEditor\";\nimport { resolveColumnHeaderText } from \"./grid\";\nimport { isColumnVisible } from \"./visibility\";\n\n/** What a column chooser is drawn from: every column, the visibility, and the search typed. */\nexport interface ColumnChooserInput<Row> {\n /** Every column in its current order, hidden ones included — a view's `dataColumns`. */\n readonly columns: readonly DataColumn<Row, unknown>[];\n readonly visibility: ColumnVisibilityState;\n /** Narrows the list to the columns whose header text contains it, ignoring case. */\n readonly search?: string | undefined;\n}\n\n/** One column's checkbox in a column chooser. */\nexport interface ColumnChooserEntry {\n readonly columnId: string;\n /** The column's header text — what the search matches, and the checkbox's label. */\n readonly label: string;\n /** Whether the column is shown — whether its checkbox is checked. */\n readonly visible: boolean;\n /**\n * Whether the checkbox cannot be unchecked: the column is shown and is\n * either not `hideable` or the last column shown. A hidden column can\n * always be shown, `hideable` or not.\n */\n readonly disabled: boolean;\n}\n\n/** What toggling a chooser's \"Show all\" checkbox does: shows these columns, or hides them. */\nexport interface ColumnChooserToggle {\n readonly visible: boolean;\n readonly columnIds: readonly string[];\n}\n\nexport interface ColumnChooserModel {\n /** The columns the search matches, in column order. */\n readonly entries: readonly ColumnChooserEntry[];\n /**\n * The \"Show all\" checkbox's state over the entries whose columns are\n * `hideable` — the ones it acts on. A column the user cannot hide is\n * always on, so counting it would leave \"Show all\" stuck at mixed.\n */\n readonly selectAll: SelectAllState;\n /** What toggling \"Show all\" does, or `null` when it can do nothing — a disabled checkbox. */\n readonly toggleAll: ColumnChooserToggle | null;\n}\n\n/** A column as the chooser reads it. */\ninterface ChooserColumn<Row> {\n readonly column: DataColumn<Row, unknown>;\n readonly label: string;\n readonly visible: boolean;\n}\n\nfunction isHideable<Row>(column: DataColumn<Row, unknown>): boolean {\n return column.column.hideable !== false;\n}\n\nfunction matchesSearch(label: string, search: string): boolean {\n return label.toLowerCase().includes(search.toLowerCase());\n}\n\nfunction selectAllStateOf(states: readonly boolean[]): SelectAllState {\n if (states.length > 0 && states.every(Boolean)) {\n return \"checked\";\n }\n return states.some(Boolean) ? \"mixed\" : \"unchecked\";\n}\n\n/**\n * A column chooser's list for a search, and what its \"Show all\" checkbox\n * says and does — the same tri-state over what the search shows that a\n * filter editor's select-all is (`selectAllState`).\n *\n * \"Show all\" shows every hidden column the search shows once any is hidden,\n * and hides those it shows once none is. It never touches a column that is\n * not `hideable`, and never hides the last column shown: when that is all\n * that would be left, the first of them in column order stays, since a grid\n * with no column shown has no header to bring one back from.\n */\nexport function resolveColumnChooser<Row>({\n columns,\n visibility,\n search = \"\",\n}: ColumnChooserInput<Row>): ColumnChooserModel {\n const all = columns.map((column): ChooserColumn<Row> => ({\n column,\n label: resolveColumnHeaderText(column.column),\n visible: isColumnVisible(column.column, visibility),\n }));\n const shownCount = all.filter(({ visible }) => visible).length;\n const matched = all.filter(({ label }) => matchesSearch(label, search));\n\n const entries = matched.map(\n ({ column, label, visible }): ColumnChooserEntry => ({\n columnId: column.id,\n label,\n visible,\n disabled: visible && (!isHideable(column) || shownCount === 1),\n }),\n );\n\n const covered = matched.filter(({ column }) => isHideable(column));\n const selectAll = selectAllStateOf(covered.map(({ visible }) => visible));\n return {\n entries,\n selectAll,\n toggleAll: toggleAllOf(covered, selectAll, shownCount),\n };\n}\n\nfunction toggleAllOf<Row>(\n covered: readonly ChooserColumn<Row>[],\n selectAll: SelectAllState,\n shownCount: number,\n): ColumnChooserToggle | null {\n const show = selectAll !== \"checked\";\n const changing = covered\n .filter(({ visible }) => visible !== show)\n .map(({ column }) => column.id);\n // Hiding every column shown would leave none: the first of them stays.\n const columnIds =\n !show && changing.length === shownCount ? changing.slice(1) : changing;\n return columnIds.length === 0 ? null : { visible: show, columnIds };\n}\n","import type { ColumnType, FilterOperator, OperatorFilterEntry } from \"../types\";\nimport type { ColumnFilterShape } from \"../util/filterEditor\";\nimport { isScalarList } from \"../util/filterOperators\";\nimport {\n filterOperandArity,\n formatFilterOperand,\n parseFilterOperand,\n} from \"./operators\";\n\n/**\n * One condition row of a simple filter editor as the user types it: text,\n * not yet a value, so a half-typed number or date stays in its input until\n * the editor is applied and `conditionsFromRows` reads it.\n */\nexport interface ConditionRowDraft {\n readonly operator: FilterOperator;\n /** The operand as typed — `between`'s lower end. */\n readonly text: string;\n /**\n * `between`'s upper end, as typed. Kept under any other operator, unread,\n * so switching back to `between` finds it still there.\n */\n readonly textTo: string;\n}\n\n/** What `conditionsFromRows` reads off an editor's rows. */\nexport interface ParsedConditionRows<Row> {\n /** A condition for each row that reads as one, in row order. */\n readonly conditions: readonly OperatorFilterEntry<Row>[];\n /**\n * The indexes of the rows that don't, for the editor to mark. Apply the\n * conditions only once this is empty.\n */\n readonly invalid: readonly number[];\n}\n\n/** A simple editor's rows: one condition, and an optional second joined to it. */\nconst ROW_COUNT = 2;\n\nfunction rowOf<Row>(\n condition: OperatorFilterEntry<Row>,\n type: ColumnType | undefined,\n): ConditionRowDraft {\n const { operator, value } = condition;\n if (isScalarList(value)) {\n const [low, high] = value;\n return {\n operator,\n text: formatFilterOperand(low, type),\n textTo: formatFilterOperand(high, type),\n };\n }\n return { operator, text: formatFilterOperand(value, type), textTo: \"\" };\n}\n\n/**\n * The rows a simple editor opens with over a column's filter `shape`, its\n * operands written as the column's `type` reads them: two, holding the\n * column's conditions when its filter is conditions, and each row they\n * don't fill starting at the first of `operators`, empty. With no operator\n * to start one at, only the rows the filter fills.\n */\nexport function conditionRowsFrom<Row>(\n shape: ColumnFilterShape<Row>,\n operators: readonly FilterOperator[],\n type: ColumnType | undefined,\n): readonly ConditionRowDraft[] {\n const filled =\n shape.kind === \"conditions\"\n ? shape.conditions.map((condition) => rowOf(condition, type))\n : [];\n const [first] = operators;\n if (first === undefined) {\n return filled;\n }\n const blank: ConditionRowDraft = { operator: first, text: \"\", textTo: \"\" };\n return Array.from(\n { length: ROW_COUNT },\n (_, index) => filled[index] ?? blank,\n );\n}\n\n/** Whether a row was left empty: none of the operands its operator takes is typed. */\nfunction isEmptyRow(row: ConditionRowDraft): boolean {\n switch (filterOperandArity(row.operator)) {\n case 0:\n return false;\n case 1:\n return row.text === \"\";\n case 2:\n return row.text === \"\" && row.textTo === \"\";\n }\n}\n\n/** `row` as a condition on `columnId`, or `undefined` when an operand it needs doesn't read. */\nfunction conditionOf<Row>(\n row: ConditionRowDraft,\n columnId: string,\n type: ColumnType | undefined,\n): OperatorFilterEntry<Row> | undefined {\n const { operator } = row;\n switch (filterOperandArity(operator)) {\n case 0:\n return { kind: \"operator\", columnId, operator };\n case 1: {\n const value = parseFilterOperand(row.text, type);\n return value === undefined\n ? undefined\n : { kind: \"operator\", columnId, operator, value };\n }\n case 2: {\n const low = parseFilterOperand(row.text, type);\n const high = parseFilterOperand(row.textTo, type);\n return low === undefined || high === undefined\n ? undefined\n : { kind: \"operator\", columnId, operator, value: [low, high] };\n }\n }\n}\n\n/**\n * The conditions a simple editor's rows stand for on `columnId`, each\n * operand read as the column's `type` filters (`parseFilterOperand`) — for\n * `filterEditorReducer`'s `setConditions`, with the combinator the editor\n * shows.\n *\n * A row needs every operand its operator takes, or it is `invalid`; the\n * blanks operators take none. A row after the first left empty is dropped\n * rather than invalid, since the second condition is optional; an empty\n * first row is invalid — clearing the filter is the editor's clear action,\n * not an apply with nothing typed.\n */\nexport function conditionsFromRows<Row>(\n rows: readonly ConditionRowDraft[],\n columnId: string,\n type: ColumnType | undefined,\n): ParsedConditionRows<Row> {\n const conditions: OperatorFilterEntry<Row>[] = [];\n const invalid: number[] = [];\n for (const [index, row] of rows.entries()) {\n if (index > 0 && isEmptyRow(row)) {\n continue;\n }\n const condition = conditionOf<Row>(row, columnId, type);\n if (condition === undefined) {\n invalid.push(index);\n } else {\n conditions.push(condition);\n }\n }\n return { conditions, invalid };\n}\n","import type { GridMessages } from \"../messages\";\nimport type { DataColumn, FilterEntry, FilterState } from \"../types\";\nimport type {\n ColumnValueOptions,\n ColumnValueQuery,\n} from \"../util/filterEditor\";\nimport { columnValueOptions, touchesColumn } from \"../util/filterEditor\";\nimport type { FormatLocale } from \"../util/format\";\n\n/**\n * What a cached list is labelled by: `columnValueOptions`' query without\n * `search` and `limit`, which a draft applies over the whole list.\n */\nexport type ColumnValueCacheQuery = Pick<\n ColumnValueQuery,\n \"locale\" | \"messages\"\n>;\n\n/** `columnValueOptions`, remembered per column. */\nexport interface ColumnValueOptionsCache<Row> {\n /**\n * `columnId`'s whole value list — `columnValueOptions` with no `search`\n * or `limit` — or the very list it returned last time, when nothing the\n * list is counted from or labelled by has changed since.\n */\n readonly get: (\n rows: readonly Row[],\n dataColumns: readonly DataColumn<Row, unknown>[],\n filter: FilterState<Row>,\n columnId: string,\n query?: ColumnValueCacheQuery,\n ) => ColumnValueOptions;\n}\n\n/** What every list in a cache is counted from and labelled by. */\ninterface CacheSource<Row> {\n readonly rows: readonly Row[];\n readonly dataColumns: readonly DataColumn<Row, unknown>[];\n readonly locale: FormatLocale;\n readonly messages: Partial<GridMessages> | undefined;\n}\n\ninterface CachedList<Row> {\n /** The entries it was counted under: every one not about its column. */\n readonly others: FilterState<Row>;\n readonly values: ColumnValueOptions;\n}\n\nfunction sameSource<Row>(a: CacheSource<Row>, b: CacheSource<Row>): boolean {\n return (\n a.rows === b.rows &&\n a.dataColumns === b.dataColumns &&\n a.locale === b.locale &&\n a.messages === b.messages\n );\n}\n\nfunction sameEntries<Row>(\n a: readonly FilterEntry<Row>[],\n b: readonly FilterEntry<Row>[],\n): boolean {\n return a.length === b.length && a.every((entry, index) => entry === b[index]);\n}\n\n/**\n * A memo of each column's checklist values, for a renderer to hold one of\n * per grid: reopening a column's checklist hands back the list it was given\n * last time — the same object — rather than counting `rows` again, until\n * something the list depends on changes.\n *\n * That is the `rows` and `dataColumns`, the `locale` and `messages` it is\n * labelled in, and the filter's entries not about the column — all compared\n * by identity, the entries one by one. Identity holds across an apply:\n * `draftToFilter` keeps every entry it doesn't replace as it was, so\n * filtering one column leaves the lists of the others to recount and its\n * own cached, since a column's list never depends on its own entries.\n *\n * Each column keeps its latest list. New rows, columns, locale or messages\n * drop every list, so the cache never holds on to rows the grid has let go\n * of — pass the grid's own, which keep their identity between renders.\n */\nexport function createColumnValueOptionsCache<\n Row,\n>(): ColumnValueOptionsCache<Row> {\n let source: CacheSource<Row> | undefined;\n const lists = new Map<string, CachedList<Row>>();\n return {\n get: (rows, dataColumns, filter, columnId, query = {}) => {\n const { locale, messages } = query;\n const current: CacheSource<Row> = { rows, dataColumns, locale, messages };\n if (source === undefined || !sameSource(source, current)) {\n lists.clear();\n source = current;\n }\n const others = filter.filter((entry) => !touchesColumn(entry, columnId));\n const cached = lists.get(columnId);\n if (cached !== undefined && sameEntries(cached.others, others)) {\n return cached.values;\n }\n const values = columnValueOptions(\n rows,\n dataColumns,\n filter,\n columnId,\n messages === undefined ? { locale } : { locale, messages },\n );\n lists.set(columnId, { others, values });\n return values;\n },\n };\n}\n","import type { FilterScalar } from \"../types\";\nimport type { ValuesDraft } from \"../util/filterEditor\";\nimport {\n keyOf,\n selectAllCoversBlanks,\n visibleFilterOptions,\n} from \"../util/filterEditor\";\n\n/** One row of a checklist: a value the column holds, or its blank cells. */\nexport type FilterChecklistItem = {\n /**\n * Tells the item apart from every other in the list: a value's key is the\n * one `draft.checked` holds it under, and the blanks have their own.\n */\n readonly key: string;\n /** The value as its cells print it, or the blanks' label. */\n readonly label: string;\n /** How many rows hold it, among those the other columns' filters keep. */\n readonly count: number;\n readonly checked: boolean;\n} & (\n | {\n /** Toggled with `filterEditorReducer`'s `toggleValue`. */\n readonly kind: \"value\";\n readonly value: Exclude<FilterScalar, null>;\n }\n | {\n /** Toggled with `filterEditorReducer`'s `setIncludeBlanks`. */\n readonly kind: \"blanks\";\n }\n);\n\nexport interface FilterChecklistOptions {\n /** How many values the list shows at most: the column's resolved `valueLimit`. */\n readonly valueLimit: number;\n /** The blanks item's label: the grid's `filterBlanks` message. */\n readonly blanksLabel: string;\n}\n\n/** What a checklist editor draws below its search box and select-all. */\nexport interface FilterChecklist {\n /**\n * The rows to draw, in order: the values the search shows, cut to\n * `valueLimit`, then the blanks while nothing is searched and some cells\n * are blank. Empty while `needsSearch`.\n */\n readonly items: readonly FilterChecklistItem[];\n /**\n * Whether the list waits for a search: the column holds more values than\n * `valueLimit` and nothing is searched yet — `filterSearchFirst(total)`.\n */\n readonly needsSearch: boolean;\n /**\n * How many of the values the search matches `valueLimit` left out of\n * `items` — `filterMoreValues(hiddenCount)`. `0` while `needsSearch`, so\n * the two notes never show together.\n */\n readonly hiddenCount: number;\n /** How many values the search matches — every value while nothing is searched. Blanks aside. */\n readonly total: number;\n}\n\n/**\n * The list a checklist editor draws for `draft`: the window of values its\n * search shows, as items carrying what each row says and whether it is\n * checked. A draft on its conditions draws through `toValuesDraft`.\n *\n * A column can hold far more values than a list is worth scrolling, so the\n * list shows at most `valueLimit` of them. Past that, it shows nothing until\n * something is searched (`needsSearch`) — every value is still in the draft,\n * and select-all still covers them all — and a search matching more shows\n * the first `valueLimit` of its matches in sort order, with the rest counted\n * in `hiddenCount`.\n *\n * The blanks item comes last, as in Excel's, and only while nothing is\n * searched: exactly when select-all counts the blanks, so the checkbox acts\n * on what the list shows.\n */\nexport function filterChecklist<Row>(\n draft: ValuesDraft<Row>,\n { valueLimit, blanksLabel }: FilterChecklistOptions,\n): FilterChecklist {\n const visible = visibleFilterOptions(draft);\n const total = visible.length;\n if (draft.search === \"\" && total > valueLimit) {\n return { items: [], needsSearch: true, hiddenCount: 0, total };\n }\n const items = visible\n .slice(0, valueLimit)\n .map(({ value, label, count }): FilterChecklistItem => {\n const key = keyOf(draft, value);\n const checked = draft.checked.has(key);\n return { kind: \"value\", key, value, label, count, checked };\n });\n const hiddenCount = total - items.length;\n if (selectAllCoversBlanks(draft)) {\n items.push({\n kind: \"blanks\",\n // Blank cells' own key, which no offered value has.\n key: keyOf(draft, null),\n label: blanksLabel,\n count: draft.blanks,\n checked: draft.includeBlanks,\n });\n }\n return { items, needsSearch: false, hiddenCount, total };\n}\n","/**\n * One entry per row: its measured height once known, `undefined` until then.\n * A row never yet rendered (or rendered but not yet observed) falls back to\n * `visibleRange`'s own `estimatedHeight` argument.\n */\nexport type RowHeights = readonly (number | undefined)[];\n\nexport interface VisibleRange {\n readonly startIndex: number;\n readonly endIndex: number; // inclusive\n /** Total height of every row before `startIndex` — the leading spacer's height. */\n readonly offsetBefore: number;\n /** Total height of every row after `endIndex` — the trailing spacer's height. */\n readonly offsetAfter: number;\n}\n\n/**\n * Which rows of a dynamic-height, virtualized list fall within\n * `[scrollTop, scrollTop + viewportHeight)`, padded by `overscan` rows on\n * each side and clamped to the array's own bounds.\n *\n * Walks a cumulative-offset prefix sum built from `heights` (measured height\n * where known, `estimatedHeight` otherwise) rather than assuming a uniform\n * row height — this codebase's rows are not uniform (`.is-wrapped` cells,\n * group header/summary rows), so a fixed-height virtualizer would either\n * break wrapping or force it out of scope.\n *\n * `O(n)` in `heights.length`. Deliberately not a Fenwick tree or a\n * binary-searchable prefix-sum structure — that optimization belongs in the\n * mutable height cache that already owns mutability (`createRowVirtualizer`\n * in `@gridkitjs/dom`), not in this pure function's contract, and is not\n * worth taking on until a profiled scenario actually shows it matters at\n * realistic row counts.\n */\nexport function visibleRange(\n heights: RowHeights,\n estimatedHeight: number,\n scrollTop: number,\n viewportHeight: number,\n overscan: number,\n): VisibleRange {\n const rowCount = heights.length;\n if (rowCount === 0) {\n return { startIndex: 0, endIndex: -1, offsetBefore: 0, offsetAfter: 0 };\n }\n\n function heightAt(index: number): number {\n return heights[index] ?? estimatedHeight;\n }\n\n const viewportBottom = scrollTop + viewportHeight;\n\n // The first row whose bottom edge crosses `scrollTop` — everything before\n // it is fully scrolled past. `top` tracks that row's own top edge (the\n // cumulative height of every row before it) as the walk advances. Stops at\n // the last row rather than walking off the end when `scrollTop` reaches or\n // exceeds the total height.\n let start = 0;\n let top = 0;\n while (start < rowCount - 1 && top + heightAt(start) <= scrollTop) {\n top += heightAt(start);\n start += 1;\n }\n const startTop = top;\n\n // From `start`, the last row whose top edge is still above `viewportBottom`\n // — the first row no longer even partially visible ends the walk one row\n // earlier than it, or the array itself runs out first. `bottom` tracks the\n // current row's own bottom edge.\n let end = start;\n let bottom = startTop + heightAt(start);\n while (end < rowCount - 1 && bottom < viewportBottom) {\n end += 1;\n bottom += heightAt(end);\n }\n\n const overscanStart = Math.max(0, start - overscan);\n const overscanEnd = Math.min(rowCount - 1, end + overscan);\n\n let offsetBefore = 0;\n for (let index = 0; index < overscanStart; index++) {\n offsetBefore += heightAt(index);\n }\n let offsetAfter = 0;\n for (let index = overscanEnd + 1; index < rowCount; index++) {\n offsetAfter += heightAt(index);\n }\n\n return {\n startIndex: overscanStart,\n endIndex: overscanEnd,\n offsetBefore,\n offsetAfter,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAS,WAAW,OAAe,MAAc,MAAwB;AACvE,QAAM,UAAU,QAAQ,KAAK,OAAO;AACpC,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO,QAAQ;AAAA,IACjB,KAA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AAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/menu/navigation.ts","../src/toolbar/overflow.ts","../src/toolbar/search.ts","../src/util/paginationWindow.ts","../src/util/columnChooser.ts","../src/filterMenu/conditions.ts","../src/filterMenu/valueCache.ts","../src/filterMenu/checklist.ts","../src/util/virtualization.ts"],"sourcesContent":["import type { ResolvedMenuEntry } from \"./types\";\n\n/** Where an arrow, Home or End key moves a menu's focus. */\nexport type MenuMove = \"next\" | \"previous\" | \"first\" | \"last\";\n\n/** Where the search for the next item begins, before skipping separators. */\nfunction startIndex(count: number, from: number, move: MenuMove): number {\n const focused = from >= 0 && from < count;\n switch (move) {\n case \"first\":\n return 0;\n case \"last\":\n return count - 1;\n case \"next\":\n return focused ? from + 1 : 0;\n case \"previous\":\n return focused ? from - 1 : count - 1;\n }\n}\n\n/**\n * The index of the item focus moves to from `from` — `-1` when nothing is\n * focused yet, so `\"next\"` lands on the first item and `\"previous\"` on the\n * last. Separators are skipped and `\"next\"`/`\"previous\"` wrap round the\n * ends; disabled items count, since they stay focusable for a screen reader\n * to find. `-1` when there is no item at all.\n *\n * Takes anything with a `type`, so a behaviour that reads its items off the\n * page can pass `{ type: \"item\" }` for each.\n */\nexport function nextMenuIndex(\n entries: readonly Pick<ResolvedMenuEntry, \"type\">[],\n from: number,\n move: MenuMove,\n): number {\n const count = entries.length;\n const step = move === \"next\" || move === \"first\" ? 1 : -1;\n const start = startIndex(count, from, move);\n for (let offset = 0; offset < count; offset++) {\n const index = (((start + step * offset) % count) + count) % count;\n if (entries[index]?.type !== \"separator\") {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * The index of the item `query` — what was typed, buffered for a moment —\n * picks, matched case-insensitively against the start of each label and\n * wrapping round the end; `-1` when none matches.\n *\n * `from` is the item focused now. A single letter, or the same letter\n * typed again and again, searches from the item after it, so repeating a\n * letter steps through every item it starts. A longer query searches from\n * `from` itself, so the item already found stays put while what is typed\n * still matches it.\n */\nexport function typeaheadIndex(\n labels: readonly string[],\n from: number,\n query: string,\n): number {\n const typed = query.toLowerCase();\n const firstCodePoint = typed.codePointAt(0);\n if (firstCodePoint === undefined) {\n return -1;\n }\n const first = String.fromCodePoint(firstCodePoint);\n const repeated = typed.replaceAll(first, \"\") === \"\";\n const prefix = repeated ? first : typed;\n const start = repeated ? from + 1 : Math.max(from, 0);\n for (let offset = 0; offset < labels.length; offset++) {\n const index = (start + offset) % labels.length;\n if (labels[index]?.toLowerCase().startsWith(prefix) === true) {\n return index;\n }\n }\n return -1;\n}\n","import { collapseSeparators } from \"../menu/resolveMenu\";\nimport type { ResolvedMenuEntry } from \"../menu/types\";\nimport type { ResolvedToolbarItem } from \"./types\";\n\n/** What `fitToolbarItems` fits: a toolbar's entries, by width, into its space. */\nexport interface ToolbarFitInput {\n /** Each entry's width, in order — `0` for a spacer, whose width is only the space left over. */\n readonly widths: readonly number[];\n /** The width the entries share. */\n readonly available: number;\n /** The width of the \"More\" button the entries that do not fit go into. */\n readonly moreWidth: number;\n /** Whether each entry, in order, stays however little room there is. */\n readonly pinned: readonly boolean[];\n}\n\n/**\n * How many of a toolbar's entries fit, from the start: the first `count`\n * stay in the toolbar, with every pinned entry after them, and the rest go\n * into a \"More\" menu.\n *\n * Pinned entries take their room first, wherever they are. Room for \"More\"\n * is kept only when something does not fit — when everything does, the\n * result is every entry and no \"More\" is drawn. Entries are taken in order\n * and the first that does not fit ends the count, so the toolbar keeps its\n * order rather than filling gaps with later, narrower entries; one with no\n * width, a spacer, fits wherever the entries before it did.\n */\nexport function fitToolbarItems({\n widths,\n available,\n moreWidth,\n pinned,\n}: ToolbarFitInput): number {\n const total = widths.reduce((sum, width) => sum + width, 0);\n if (total <= available) {\n return widths.length;\n }\n let used =\n moreWidth +\n widths.reduce((sum, width, index) => sum + (pinned[index] ? width : 0), 0);\n for (const [index, width] of widths.entries()) {\n if (!pinned[index]) {\n used += width;\n if (used > available) {\n return index;\n }\n }\n }\n return widths.length;\n}\n\n/**\n * Whether a toolbar entry stays in the toolbar however narrow it gets: the\n * search box and custom entries, which have no menu item to become.\n */\nexport function isPinnedToolbarItem(\n item: Pick<ResolvedToolbarItem, \"type\">,\n): boolean {\n return item.type === \"search\" || item.type === \"custom\";\n}\n\n/** A toolbar split at the count `fitToolbarItems` gave — see `splitToolbarItems`. */\nexport interface ToolbarSplit {\n /** What stays in the toolbar. */\n readonly shown: readonly ResolvedToolbarItem[];\n /** The \"More\" menu's entries, empty when everything fits. */\n readonly overflow: readonly ResolvedMenuEntry[];\n}\n\n/** An entry that did not fit, as the \"More\" menu lists it; `null` for a spacer. */\nfunction asMenuEntry(item: ResolvedToolbarItem): ResolvedMenuEntry | null {\n switch (item.type) {\n case \"button\":\n return {\n type: \"item\",\n id: item.id,\n label: item.label,\n icon: item.icon,\n shortcut: item.shortcut,\n disabled: item.disabled,\n checked: item.pressed,\n run: item.run,\n };\n case \"menu\":\n return {\n type: \"submenu\",\n id: item.id,\n label: item.label,\n icon: item.icon,\n items: item.items,\n };\n case \"separator\":\n return item;\n default:\n return null;\n }\n}\n\n/**\n * `items` split at the first `fit`: those before it, and every pinned item,\n * stay in the toolbar; the rest become the \"More\" menu's entries — a button\n * an item, checked where it was pressed, and a dropdown a submenu. Neither\n * side keeps a separator at its ends, doubled, or beside a spacer.\n */\nexport function splitToolbarItems(\n items: readonly ResolvedToolbarItem[],\n fit: number,\n): ToolbarSplit {\n const fits = (item: ResolvedToolbarItem, index: number) =>\n index < fit || isPinnedToolbarItem(item);\n return {\n shown: collapseSeparators(\n items.filter(fits),\n (item) => item.type === \"spacer\",\n ),\n overflow: collapseSeparators(\n items\n .filter((item, index) => !fits(item, index))\n .map(asMenuEntry)\n .filter((entry) => entry !== null),\n ),\n };\n}\n","import type { FilterState } from \"../types\";\nimport { filterQueryFor, setColumnFilter } from \"../util/filtering\";\n\n/**\n * What a search box shows for `filter`: the global text entry's query — the\n * one naming no column — without the `%` anchors that make it a \"contains\"\n * match, or `\"\"` when there is none. A `%` the user typed inside the text\n * stays: only the first and last characters are anchors.\n */\nexport function searchTextOf<Row>(filter: FilterState<Row>): string {\n const query = filterQueryFor(filter) ?? \"\";\n const start = query.startsWith(\"%\") ? 1 : 0;\n const end = query.endsWith(\"%\") ? -1 : undefined;\n return query.slice(start, end);\n}\n\n/**\n * `filter` with its global text entry set to search for `text` anywhere in\n * any column — the query `%text%` — or removed for an empty `text`. Every\n * entry naming a column stays as it was. `filter` itself, unchanged, when\n * it already searches for `text`.\n *\n * `text` is written as typed, spaces and all: a search box reads its text\n * back from the filter, and trimming here would take a space away from\n * under the caret as the user types it.\n */\nexport function setSearchText<Row>(\n filter: FilterState<Row>,\n text: string,\n): FilterState<Row> {\n return setColumnFilter(filter, undefined, text === \"\" ? \"\" : `%${text}%`);\n}\n","export type PaginationWindowEntry = number | \"ellipsis\";\n\n/**\n * Which page numbers a numbered pager should show for `currentPage` of\n * `pageCount` — the boundary + sibling windowing MUI's `usePagination` uses.\n * Always includes the first/last `boundaryCount` pages and a run of\n * `2 * siblingCount + 1` pages around `currentPage`, slid inwards rather than\n * cut short near either end, with one slot between each boundary and that\n * run holding either the single page it skips or an `\"ellipsis\"`.\n *\n * So once `pageCount` exceeds `2 * boundaryCount + 2 * siblingCount + 3`,\n * every window is exactly that many entries long, wherever `currentPage`\n * sits: a pager drawing one fixed-width slot per entry keeps its trailing\n * controls in place as the user pages through. Below that, every page shows.\n */\nexport function paginationWindow(\n currentPage: number,\n pageCount: number,\n options?: {\n boundaryCount?: number | undefined;\n siblingCount?: number | undefined;\n },\n): readonly PaginationWindowEntry[] {\n if (pageCount <= 0) {\n return [];\n }\n\n const boundaryCount = Math.max(0, Math.floor(options?.boundaryCount ?? 1));\n const siblingCount = Math.max(0, Math.floor(options?.siblingCount ?? 1));\n const slotCount = 2 * boundaryCount + 2 * siblingCount + 3;\n\n if (pageCount <= slotCount) {\n return Array.from({ length: pageCount }, (_, index) => index + 1);\n }\n\n const current = Math.min(Math.max(currentPage, 1), pageCount);\n // The sibling run, slid to stay clear of the slot beside each boundary.\n const runStart = Math.min(\n Math.max(current - siblingCount, boundaryCount + 2),\n pageCount - boundaryCount - 1 - 2 * siblingCount,\n );\n const runEnd = runStart + 2 * siblingCount;\n\n const entries: PaginationWindowEntry[] = [];\n for (let page = 1; page <= boundaryCount; page++) {\n entries.push(page);\n }\n entries.push(runStart === boundaryCount + 2 ? boundaryCount + 1 : \"ellipsis\");\n for (let page = runStart; page <= runEnd; page++) {\n entries.push(page);\n }\n entries.push(\n runEnd === pageCount - boundaryCount - 1\n ? pageCount - boundaryCount\n : \"ellipsis\",\n );\n for (let page = pageCount - boundaryCount + 1; page <= pageCount; page++) {\n entries.push(page);\n }\n\n return entries;\n}\n","import type { ColumnVisibilityState, DataColumn } from \"../types\";\nimport type { SelectAllState } from \"./filterEditor\";\nimport { resolveColumnHeaderText } from \"./grid\";\nimport { isColumnVisible } from \"./visibility\";\n\n/** What a column chooser is drawn from: every column, the visibility, and the search typed. */\nexport interface ColumnChooserInput<Row> {\n /** Every column in its current order, hidden ones included — a view's `dataColumns`. */\n readonly columns: readonly DataColumn<Row, unknown>[];\n readonly visibility: ColumnVisibilityState;\n /** Narrows the list to the columns whose header text contains it, ignoring case. */\n readonly search?: string | undefined;\n}\n\n/** One column's checkbox in a column chooser. */\nexport interface ColumnChooserEntry {\n readonly columnId: string;\n /** The column's header text — what the search matches, and the checkbox's label. */\n readonly label: string;\n /** Whether the column is shown — whether its checkbox is checked. */\n readonly visible: boolean;\n /**\n * Whether the checkbox cannot be unchecked: the column is shown and is\n * either not `hideable` or the last column shown. A hidden column can\n * always be shown, `hideable` or not.\n */\n readonly disabled: boolean;\n}\n\n/** What toggling a chooser's \"Show all\" checkbox does: shows these columns, or hides them. */\nexport interface ColumnChooserToggle {\n readonly visible: boolean;\n readonly columnIds: readonly string[];\n}\n\nexport interface ColumnChooserModel {\n /** The columns the search matches, in column order. */\n readonly entries: readonly ColumnChooserEntry[];\n /**\n * The \"Show all\" checkbox's state over the entries whose columns are\n * `hideable` — the ones it acts on. A column the user cannot hide is\n * always on, so counting it would leave \"Show all\" stuck at mixed.\n */\n readonly selectAll: SelectAllState;\n /** What toggling \"Show all\" does, or `null` when it can do nothing — a disabled checkbox. */\n readonly toggleAll: ColumnChooserToggle | null;\n}\n\n/** A column as the chooser reads it. */\ninterface ChooserColumn<Row> {\n readonly column: DataColumn<Row, unknown>;\n readonly label: string;\n readonly visible: boolean;\n}\n\nfunction isHideable<Row>(column: DataColumn<Row, unknown>): boolean {\n return column.column.hideable !== false;\n}\n\nfunction matchesSearch(label: string, search: string): boolean {\n return label.toLowerCase().includes(search.toLowerCase());\n}\n\nfunction selectAllStateOf(states: readonly boolean[]): SelectAllState {\n if (states.length > 0 && states.every(Boolean)) {\n return \"checked\";\n }\n return states.some(Boolean) ? \"mixed\" : \"unchecked\";\n}\n\n/**\n * A column chooser's list for a search, and what its \"Show all\" checkbox\n * says and does — the same tri-state over what the search shows that a\n * filter editor's select-all is (`selectAllState`).\n *\n * \"Show all\" shows every hidden column the search shows once any is hidden,\n * and hides those it shows once none is. It never touches a column that is\n * not `hideable`, and never hides the last column shown: when that is all\n * that would be left, the first of them in column order stays, since a grid\n * with no column shown has no header to bring one back from.\n */\nexport function resolveColumnChooser<Row>({\n columns,\n visibility,\n search = \"\",\n}: ColumnChooserInput<Row>): ColumnChooserModel {\n const all = columns.map((column): ChooserColumn<Row> => ({\n column,\n label: resolveColumnHeaderText(column.column),\n visible: isColumnVisible(column.column, visibility),\n }));\n const shownCount = all.filter(({ visible }) => visible).length;\n const matched = all.filter(({ label }) => matchesSearch(label, search));\n\n const entries = matched.map(\n ({ column, label, visible }): ColumnChooserEntry => ({\n columnId: column.id,\n label,\n visible,\n disabled: visible && (!isHideable(column) || shownCount === 1),\n }),\n );\n\n const covered = matched.filter(({ column }) => isHideable(column));\n const selectAll = selectAllStateOf(covered.map(({ visible }) => visible));\n return {\n entries,\n selectAll,\n toggleAll: toggleAllOf(covered, selectAll, shownCount),\n };\n}\n\nfunction toggleAllOf<Row>(\n covered: readonly ChooserColumn<Row>[],\n selectAll: SelectAllState,\n shownCount: number,\n): ColumnChooserToggle | null {\n const show = selectAll !== \"checked\";\n const changing = covered\n .filter(({ visible }) => visible !== show)\n .map(({ column }) => column.id);\n // Hiding every column shown would leave none: the first of them stays.\n const columnIds =\n !show && changing.length === shownCount ? changing.slice(1) : changing;\n return columnIds.length === 0 ? null : { visible: show, columnIds };\n}\n","import type { ColumnType, FilterOperator, OperatorFilterEntry } from \"../types\";\nimport type { ColumnFilterShape } from \"../util/filterEditor\";\nimport { isScalarList } from \"../util/filterOperators\";\nimport {\n filterOperandArity,\n formatFilterOperand,\n parseFilterOperand,\n} from \"./operators\";\n\n/**\n * One condition row of a simple filter editor as the user types it: text,\n * not yet a value, so a half-typed number or date stays in its input until\n * the editor is applied and `conditionsFromRows` reads it.\n */\nexport interface ConditionRowDraft {\n readonly operator: FilterOperator;\n /** The operand as typed — `between`'s lower end. */\n readonly text: string;\n /**\n * `between`'s upper end, as typed. Kept under any other operator, unread,\n * so switching back to `between` finds it still there.\n */\n readonly textTo: string;\n}\n\n/** What `conditionsFromRows` reads off an editor's rows. */\nexport interface ParsedConditionRows<Row> {\n /** A condition for each row that reads as one, in row order. */\n readonly conditions: readonly OperatorFilterEntry<Row>[];\n /**\n * The indexes of the rows that don't, for the editor to mark. Apply the\n * conditions only once this is empty.\n */\n readonly invalid: readonly number[];\n}\n\n/** A simple editor's rows: one condition, and an optional second joined to it. */\nconst ROW_COUNT = 2;\n\nfunction rowOf<Row>(\n condition: OperatorFilterEntry<Row>,\n type: ColumnType | undefined,\n): ConditionRowDraft {\n const { operator, value } = condition;\n if (isScalarList(value)) {\n const [low, high] = value;\n return {\n operator,\n text: formatFilterOperand(low, type),\n textTo: formatFilterOperand(high, type),\n };\n }\n return { operator, text: formatFilterOperand(value, type), textTo: \"\" };\n}\n\n/**\n * The rows a simple editor opens with over a column's filter `shape`, its\n * operands written as the column's `type` reads them: two, holding the\n * column's conditions when its filter is conditions, and each row they\n * don't fill starting at the first of `operators`, empty. With no operator\n * to start one at, only the rows the filter fills.\n */\nexport function conditionRowsFrom<Row>(\n shape: ColumnFilterShape<Row>,\n operators: readonly FilterOperator[],\n type: ColumnType | undefined,\n): readonly ConditionRowDraft[] {\n const filled =\n shape.kind === \"conditions\"\n ? shape.conditions.map((condition) => rowOf(condition, type))\n : [];\n const [first] = operators;\n if (first === undefined) {\n return filled;\n }\n const blank: ConditionRowDraft = { operator: first, text: \"\", textTo: \"\" };\n return Array.from(\n { length: ROW_COUNT },\n (_, index) => filled[index] ?? blank,\n );\n}\n\n/** Whether a row was left empty: none of the operands its operator takes is typed. */\nfunction isEmptyRow(row: ConditionRowDraft): boolean {\n switch (filterOperandArity(row.operator)) {\n case 0:\n return false;\n case 1:\n return row.text === \"\";\n case 2:\n return row.text === \"\" && row.textTo === \"\";\n }\n}\n\n/** `row` as a condition on `columnId`, or `undefined` when an operand it needs doesn't read. */\nfunction conditionOf<Row>(\n row: ConditionRowDraft,\n columnId: string,\n type: ColumnType | undefined,\n): OperatorFilterEntry<Row> | undefined {\n const { operator } = row;\n switch (filterOperandArity(operator)) {\n case 0:\n return { kind: \"operator\", columnId, operator };\n case 1: {\n const value = parseFilterOperand(row.text, type);\n return value === undefined\n ? undefined\n : { kind: \"operator\", columnId, operator, value };\n }\n case 2: {\n const low = parseFilterOperand(row.text, type);\n const high = parseFilterOperand(row.textTo, type);\n return low === undefined || high === undefined\n ? undefined\n : { kind: \"operator\", columnId, operator, value: [low, high] };\n }\n }\n}\n\n/**\n * The conditions a simple editor's rows stand for on `columnId`, each\n * operand read as the column's `type` filters (`parseFilterOperand`) — for\n * `filterEditorReducer`'s `setConditions`, with the combinator the editor\n * shows.\n *\n * A row needs every operand its operator takes, or it is `invalid`; the\n * blanks operators take none. A row after the first left empty is dropped\n * rather than invalid, since the second condition is optional; an empty\n * first row is invalid — clearing the filter is the editor's clear action,\n * not an apply with nothing typed.\n */\nexport function conditionsFromRows<Row>(\n rows: readonly ConditionRowDraft[],\n columnId: string,\n type: ColumnType | undefined,\n): ParsedConditionRows<Row> {\n const conditions: OperatorFilterEntry<Row>[] = [];\n const invalid: number[] = [];\n for (const [index, row] of rows.entries()) {\n if (index > 0 && isEmptyRow(row)) {\n continue;\n }\n const condition = conditionOf<Row>(row, columnId, type);\n if (condition === undefined) {\n invalid.push(index);\n } else {\n conditions.push(condition);\n }\n }\n return { conditions, invalid };\n}\n","import type { GridMessages } from \"../messages\";\nimport type { DataColumn, FilterEntry, FilterState } from \"../types\";\nimport type {\n ColumnValueOptions,\n ColumnValueQuery,\n} from \"../util/filterEditor\";\nimport { columnValueOptions, touchesColumn } from \"../util/filterEditor\";\nimport type { FormatLocale } from \"../util/format\";\n\n/**\n * What a cached list is labelled by: `columnValueOptions`' query without\n * `search` and `limit`, which a draft applies over the whole list.\n */\nexport type ColumnValueCacheQuery = Pick<\n ColumnValueQuery,\n \"locale\" | \"messages\"\n>;\n\n/** `columnValueOptions`, remembered per column. */\nexport interface ColumnValueOptionsCache<Row> {\n /**\n * `columnId`'s whole value list — `columnValueOptions` with no `search`\n * or `limit` — or the very list it returned last time, when nothing the\n * list is counted from or labelled by has changed since.\n */\n readonly get: (\n rows: readonly Row[],\n dataColumns: readonly DataColumn<Row, unknown>[],\n filter: FilterState<Row>,\n columnId: string,\n query?: ColumnValueCacheQuery,\n ) => ColumnValueOptions;\n}\n\n/** What every list in a cache is counted from and labelled by. */\ninterface CacheSource<Row> {\n readonly rows: readonly Row[];\n readonly dataColumns: readonly DataColumn<Row, unknown>[];\n readonly locale: FormatLocale;\n readonly messages: Partial<GridMessages> | undefined;\n}\n\ninterface CachedList<Row> {\n /** The entries it was counted under: every one not about its column. */\n readonly others: FilterState<Row>;\n readonly values: ColumnValueOptions;\n}\n\nfunction sameSource<Row>(a: CacheSource<Row>, b: CacheSource<Row>): boolean {\n return (\n a.rows === b.rows &&\n a.dataColumns === b.dataColumns &&\n a.locale === b.locale &&\n a.messages === b.messages\n );\n}\n\nfunction sameEntries<Row>(\n a: readonly FilterEntry<Row>[],\n b: readonly FilterEntry<Row>[],\n): boolean {\n return a.length === b.length && a.every((entry, index) => entry === b[index]);\n}\n\n/**\n * A memo of each column's checklist values, for a renderer to hold one of\n * per grid: reopening a column's checklist hands back the list it was given\n * last time — the same object — rather than counting `rows` again, until\n * something the list depends on changes.\n *\n * That is the `rows` and `dataColumns`, the `locale` and `messages` it is\n * labelled in, and the filter's entries not about the column — all compared\n * by identity, the entries one by one. Identity holds across an apply:\n * `draftToFilter` keeps every entry it doesn't replace as it was, so\n * filtering one column leaves the lists of the others to recount and its\n * own cached, since a column's list never depends on its own entries.\n *\n * Each column keeps its latest list. New rows, columns, locale or messages\n * drop every list, so the cache never holds on to rows the grid has let go\n * of — pass the grid's own, which keep their identity between renders.\n */\nexport function createColumnValueOptionsCache<\n Row,\n>(): ColumnValueOptionsCache<Row> {\n let source: CacheSource<Row> | undefined;\n const lists = new Map<string, CachedList<Row>>();\n return {\n get: (rows, dataColumns, filter, columnId, query = {}) => {\n const { locale, messages } = query;\n const current: CacheSource<Row> = { rows, dataColumns, locale, messages };\n if (source === undefined || !sameSource(source, current)) {\n lists.clear();\n source = current;\n }\n const others = filter.filter((entry) => !touchesColumn(entry, columnId));\n const cached = lists.get(columnId);\n if (cached !== undefined && sameEntries(cached.others, others)) {\n return cached.values;\n }\n const values = columnValueOptions(\n rows,\n dataColumns,\n filter,\n columnId,\n messages === undefined ? { locale } : { locale, messages },\n );\n lists.set(columnId, { others, values });\n return values;\n },\n };\n}\n","import type { FilterScalar } from \"../types\";\nimport type { ValuesDraft } from \"../util/filterEditor\";\nimport {\n keyOf,\n selectAllCoversBlanks,\n visibleFilterOptions,\n} from \"../util/filterEditor\";\n\n/** One row of a checklist: a value the column holds, or its blank cells. */\nexport type FilterChecklistItem = {\n /**\n * Tells the item apart from every other in the list: a value's key is the\n * one `draft.checked` holds it under, and the blanks have their own.\n */\n readonly key: string;\n /** The value as its cells print it, or the blanks' label. */\n readonly label: string;\n /** How many rows hold it, among those the other columns' filters keep. */\n readonly count: number;\n readonly checked: boolean;\n} & (\n | {\n /** Toggled with `filterEditorReducer`'s `toggleValue`. */\n readonly kind: \"value\";\n readonly value: Exclude<FilterScalar, null>;\n }\n | {\n /** Toggled with `filterEditorReducer`'s `setIncludeBlanks`. */\n readonly kind: \"blanks\";\n }\n);\n\nexport interface FilterChecklistOptions {\n /** How many values the list shows at most: the column's resolved `valueLimit`. */\n readonly valueLimit: number;\n /** The blanks item's label: the grid's `filterBlanks` message. */\n readonly blanksLabel: string;\n}\n\n/** What a checklist editor draws below its search box and select-all. */\nexport interface FilterChecklist {\n /**\n * The rows to draw, in order: the values the search shows, cut to\n * `valueLimit`, then the blanks while nothing is searched and some cells\n * are blank. Empty while `needsSearch`.\n */\n readonly items: readonly FilterChecklistItem[];\n /**\n * Whether the list waits for a search: the column holds more values than\n * `valueLimit` and nothing is searched yet — `filterSearchFirst(total)`.\n */\n readonly needsSearch: boolean;\n /**\n * How many of the values the search matches `valueLimit` left out of\n * `items` — `filterMoreValues(hiddenCount)`. `0` while `needsSearch`, so\n * the two notes never show together.\n */\n readonly hiddenCount: number;\n /** How many values the search matches — every value while nothing is searched. Blanks aside. */\n readonly total: number;\n}\n\n/**\n * The list a checklist editor draws for `draft`: the window of values its\n * search shows, as items carrying what each row says and whether it is\n * checked. A draft on its conditions draws through `toValuesDraft`.\n *\n * A column can hold far more values than a list is worth scrolling, so the\n * list shows at most `valueLimit` of them. Past that, it shows nothing until\n * something is searched (`needsSearch`) — every value is still in the draft,\n * and select-all still covers them all — and a search matching more shows\n * the first `valueLimit` of its matches in sort order, with the rest counted\n * in `hiddenCount`.\n *\n * The blanks item comes last, as in Excel's, and only while nothing is\n * searched: exactly when select-all counts the blanks, so the checkbox acts\n * on what the list shows.\n */\nexport function filterChecklist<Row>(\n draft: ValuesDraft<Row>,\n { valueLimit, blanksLabel }: FilterChecklistOptions,\n): FilterChecklist {\n const visible = visibleFilterOptions(draft);\n const total = visible.length;\n if (draft.search === \"\" && total > valueLimit) {\n return { items: [], needsSearch: true, hiddenCount: 0, total };\n }\n const items = visible\n .slice(0, valueLimit)\n .map(({ value, label, count }): FilterChecklistItem => {\n const key = keyOf(draft, value);\n const checked = draft.checked.has(key);\n return { kind: \"value\", key, value, label, count, checked };\n });\n const hiddenCount = total - items.length;\n if (selectAllCoversBlanks(draft)) {\n items.push({\n kind: \"blanks\",\n // Blank cells' own key, which no offered value has.\n key: keyOf(draft, null),\n label: blanksLabel,\n count: draft.blanks,\n checked: draft.includeBlanks,\n });\n }\n return { items, needsSearch: false, hiddenCount, total };\n}\n","/**\n * One entry per row: its measured height once known, `undefined` until then.\n * A row never yet rendered (or rendered but not yet observed) falls back to\n * `visibleRange`'s own `estimatedHeight` argument.\n */\nexport type RowHeights = readonly (number | undefined)[];\n\nexport interface VisibleRange {\n readonly startIndex: number;\n readonly endIndex: number; // inclusive\n /** Total height of every row before `startIndex` — the leading spacer's height. */\n readonly offsetBefore: number;\n /** Total height of every row after `endIndex` — the trailing spacer's height. */\n readonly offsetAfter: number;\n}\n\n/**\n * Which rows of a dynamic-height, virtualized list fall within\n * `[scrollTop, scrollTop + viewportHeight)`, padded by `overscan` rows on\n * each side and clamped to the array's own bounds.\n *\n * Walks a cumulative-offset prefix sum built from `heights` (measured height\n * where known, `estimatedHeight` otherwise) rather than assuming a uniform\n * row height — this codebase's rows are not uniform (`.is-wrapped` cells,\n * group header/summary rows), so a fixed-height virtualizer would either\n * break wrapping or force it out of scope.\n *\n * `O(n)` in `heights.length`. Deliberately not a Fenwick tree or a\n * binary-searchable prefix-sum structure — that optimization belongs in the\n * mutable height cache that already owns mutability (`createRowVirtualizer`\n * in `@gridkitjs/dom`), not in this pure function's contract, and is not\n * worth taking on until a profiled scenario actually shows it matters at\n * realistic row counts.\n */\nexport function visibleRange(\n heights: RowHeights,\n estimatedHeight: number,\n scrollTop: number,\n viewportHeight: number,\n overscan: number,\n): VisibleRange {\n const rowCount = heights.length;\n if (rowCount === 0) {\n return { startIndex: 0, endIndex: -1, offsetBefore: 0, offsetAfter: 0 };\n }\n\n function heightAt(index: number): number {\n return heights[index] ?? estimatedHeight;\n }\n\n const viewportBottom = scrollTop + viewportHeight;\n\n // The first row whose bottom edge crosses `scrollTop` — everything before\n // it is fully scrolled past. `top` tracks that row's own top edge (the\n // cumulative height of every row before it) as the walk advances. Stops at\n // the last row rather than walking off the end when `scrollTop` reaches or\n // exceeds the total height.\n let start = 0;\n let top = 0;\n while (start < rowCount - 1 && top + heightAt(start) <= scrollTop) {\n top += heightAt(start);\n start += 1;\n }\n const startTop = top;\n\n // From `start`, the last row whose top edge is still above `viewportBottom`\n // — the first row no longer even partially visible ends the walk one row\n // earlier than it, or the array itself runs out first. `bottom` tracks the\n // current row's own bottom edge.\n let end = start;\n let bottom = startTop + heightAt(start);\n while (end < rowCount - 1 && bottom < viewportBottom) {\n end += 1;\n bottom += heightAt(end);\n }\n\n const overscanStart = Math.max(0, start - overscan);\n const overscanEnd = Math.min(rowCount - 1, end + overscan);\n\n let offsetBefore = 0;\n for (let index = 0; index < overscanStart; index++) {\n offsetBefore += heightAt(index);\n }\n let offsetAfter = 0;\n for (let index = overscanEnd + 1; index < rowCount; index++) {\n offsetAfter += heightAt(index);\n }\n\n return {\n startIndex: overscanStart,\n endIndex: overscanEnd,\n offsetBefore,\n offsetAfter,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAS,WAAW,OAAe,MAAc,MAAwB;AACvE,QAAM,UAAU,QAAQ,KAAK,OAAO;AACpC,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO,QAAQ;AAAA,IACjB,KAAK;AACH,aAAO,UAAU,OAAO,IAAI;AAAA,IAC9B,KAAK;AACH,aAAO,UAAU,OAAO,IAAI,QAAQ;AAAA,EACxC;AACF;AAYO,SAA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