@olvnck/ingrid 0.0.0-stage → 0.15.21
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/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +5535 -2
- package/THIRD_PARTY_NOTICES.md +10 -0
- package/dist/engine/clipboard/copy.d.ts +40 -0
- package/dist/engine/clipboard/options.d.ts +16 -0
- package/dist/engine/clipboard/text.d.ts +32 -0
- package/dist/engine/columns/autosize.d.ts +43 -0
- package/dist/engine/columns/dataType.d.ts +30 -0
- package/dist/engine/columns/fold.d.ts +48 -0
- package/dist/engine/columns/layout.d.ts +150 -0
- package/dist/engine/columns/model.d.ts +369 -0
- package/dist/engine/columns/query.d.ts +16 -0
- package/dist/engine/columns/tooltips.d.ts +27 -0
- package/dist/engine/data/client/clientSource.d.ts +151 -0
- package/dist/engine/data/client/columnFilters.d.ts +106 -0
- package/dist/engine/data/client/descendants.d.ts +35 -0
- package/dist/engine/data/client/diff.d.ts +23 -0
- package/dist/engine/data/client/fields.d.ts +70 -0
- package/dist/engine/data/client/filter.d.ts +95 -0
- package/dist/engine/data/client/flatten.d.ts +141 -0
- package/dist/engine/data/client/groupSize.d.ts +14 -0
- package/dist/engine/data/client/hierarchy.d.ts +85 -0
- package/dist/engine/data/client/order.d.ts +32 -0
- package/dist/engine/data/client/pipeline.d.ts +277 -0
- package/dist/engine/data/client/remap.d.ts +33 -0
- package/dist/engine/data/client/trees.d.ts +41 -0
- package/dist/engine/data/client/types.d.ts +173 -0
- package/dist/engine/data/memory/generate.d.ts +36 -0
- package/dist/engine/data/memory/memoryDatasource.d.ts +46 -0
- package/dist/engine/data/rowKey.d.ts +15 -0
- package/dist/engine/data/server/contract.d.ts +64 -0
- package/dist/engine/data/server/expansion.d.ts +35 -0
- package/dist/engine/data/server/levelStore.d.ts +99 -0
- package/dist/engine/data/server/loader.d.ts +128 -0
- package/dist/engine/data/server/reader.d.ts +88 -0
- package/dist/engine/data/server/response.d.ts +31 -0
- package/dist/engine/data/server/serverSource.d.ts +130 -0
- package/dist/engine/data/shared/aggregate.d.ts +12 -0
- package/dist/engine/data/shared/columnFilter.d.ts +19 -0
- package/dist/engine/data/shared/compare.d.ts +12 -0
- package/dist/engine/data/shared/dateParts.d.ts +19 -0
- package/dist/engine/data/shared/distinct.d.ts +30 -0
- package/dist/engine/data/shared/filterRecord.d.ts +7 -0
- package/dist/engine/data/shared/keys.d.ts +17 -0
- package/dist/engine/data/shared/quickFilter.d.ts +17 -0
- package/dist/engine/data/shared/sourceUtils.d.ts +11 -0
- package/dist/engine/data/shared/splice.d.ts +9 -0
- package/dist/engine/detail/builds.d.ts +26 -0
- package/dist/engine/detail/content.d.ts +24 -0
- package/dist/engine/detail/controller.d.ts +176 -0
- package/dist/engine/detail/events.d.ts +11 -0
- package/dist/engine/detail/follow.d.ts +56 -0
- package/dist/engine/detail/layer.d.ts +119 -0
- package/dist/engine/detail/live.d.ts +96 -0
- package/dist/engine/detail/options.d.ts +53 -0
- package/dist/engine/detail/state.d.ts +140 -0
- package/dist/engine/edit/clear.d.ts +20 -0
- package/dist/engine/edit/editing.d.ts +4 -0
- package/dist/engine/edit/editors/date.d.ts +3 -0
- package/dist/engine/edit/editors/index.d.ts +23 -0
- package/dist/engine/edit/editors/internals.d.ts +25 -0
- package/dist/engine/edit/editors/largeText.d.ts +2 -0
- package/dist/engine/edit/editors/number.d.ts +4 -0
- package/dist/engine/edit/editors/select.d.ts +2 -0
- package/dist/engine/edit/editors/text.d.ts +15 -0
- package/dist/engine/edit/fill.d.ts +47 -0
- package/dist/engine/edit/fillHandle.d.ts +66 -0
- package/dist/engine/edit/fillValues.d.ts +15 -0
- package/dist/engine/edit/operations.d.ts +68 -0
- package/dist/engine/edit/paste.d.ts +23 -0
- package/dist/engine/edit/pastePlan.d.ts +17 -0
- package/dist/engine/edit/popupHost.d.ts +63 -0
- package/dist/engine/edit/session.d.ts +52 -0
- package/dist/engine/edit/types.d.ts +234 -0
- package/dist/engine/edit/undo.d.ts +38 -0
- package/dist/engine/edit/validation.d.ts +10 -0
- package/dist/engine/edit/values.d.ts +38 -0
- package/dist/engine/export/columns.d.ts +19 -0
- package/dist/engine/export/deliver.d.ts +47 -0
- package/dist/engine/export/dsv.d.ts +2 -0
- package/dist/engine/export/expanded.d.ts +69 -0
- package/dist/engine/export/export.d.ts +25 -0
- package/dist/engine/export/headers.d.ts +15 -0
- package/dist/engine/export/options.d.ts +19 -0
- package/dist/engine/export/plan.d.ts +43 -0
- package/dist/engine/export/values.d.ts +33 -0
- package/dist/engine/export/walk.d.ts +31 -0
- package/dist/engine/export/writer.d.ts +62 -0
- package/dist/engine/export/xlsx/cells.d.ts +31 -0
- package/dist/engine/export/xlsx/index.d.ts +12 -0
- package/dist/engine/export/xlsx/parts.d.ts +36 -0
- package/dist/engine/export/xlsx/sheet.d.ts +30 -0
- package/dist/engine/export/xlsx/styles.d.ts +15 -0
- package/dist/engine/export/xlsx/table.d.ts +8 -0
- package/dist/engine/export/xlsx/zip.d.ts +24 -0
- package/dist/engine/filter/groupFilter.d.ts +28 -0
- package/dist/engine/filter/model.d.ts +235 -0
- package/dist/engine/filter/shorthand.d.ts +36 -0
- package/dist/engine/filter/state.d.ts +76 -0
- package/dist/engine/filter/summary.d.ts +16 -0
- package/dist/engine/filter/values.d.ts +40 -0
- package/dist/engine/find/index.d.ts +94 -0
- package/dist/engine/find/match.d.ts +38 -0
- package/dist/engine/find/model.d.ts +115 -0
- package/dist/engine/grid.d.ts +42 -0
- package/dist/engine/i18n/numbers.d.ts +34 -0
- package/dist/engine/i18n/texts.d.ts +306 -0
- package/dist/engine/interact/autoScroll.d.ts +11 -0
- package/dist/engine/interact/body.d.ts +41 -0
- package/dist/engine/interact/focus.d.ts +158 -0
- package/dist/engine/interact/header.d.ts +216 -0
- package/dist/engine/interact/host.d.ts +400 -0
- package/dist/engine/interact/keyboard.d.ts +20 -0
- package/dist/engine/interact/menuKey.d.ts +7 -0
- package/dist/engine/interact/own.d.ts +2 -0
- package/dist/engine/interact/ranges.d.ts +68 -0
- package/dist/engine/interact/rowSelection.d.ts +53 -0
- package/dist/engine/interact/shortcut.d.ts +21 -0
- package/dist/engine/interact/tooltips.d.ts +63 -0
- package/dist/engine/measure.d.ts +30 -0
- package/dist/engine/render/cells.d.ts +322 -0
- package/dist/engine/render/columns.d.ts +28 -0
- package/dist/engine/render/dom.d.ts +24 -0
- package/dist/engine/render/flash.d.ts +74 -0
- package/dist/engine/render/groupCell.d.ts +50 -0
- package/dist/engine/render/groupPanel.d.ts +21 -0
- package/dist/engine/render/header.d.ts +162 -0
- package/dist/engine/render/overlay.d.ts +15 -0
- package/dist/engine/render/pinnedRows.d.ts +106 -0
- package/dist/engine/render/rowPool.d.ts +3 -0
- package/dist/engine/render/scrollbars.d.ts +77 -0
- package/dist/engine/render/strategy.d.ts +397 -0
- package/dist/engine/reportError.d.ts +7 -0
- package/dist/engine/rowdrag/controller.d.ts +80 -0
- package/dist/engine/rowdrag/events.d.ts +17 -0
- package/dist/engine/rowdrag/gesture.d.ts +33 -0
- package/dist/engine/rowdrag/keys.d.ts +21 -0
- package/dist/engine/rowdrag/model.d.ts +67 -0
- package/dist/engine/rowdrag/options.d.ts +34 -0
- package/dist/engine/rowdrag/rows.d.ts +61 -0
- package/dist/engine/rowdrag/target.d.ts +59 -0
- package/dist/engine/rowdrag/zones.d.ts +79 -0
- package/dist/engine/schedule.d.ts +29 -0
- package/dist/engine/selection/aggregate.d.ts +30 -0
- package/dist/engine/selection/options.d.ts +7 -0
- package/dist/engine/selection/rangeRows.d.ts +19 -0
- package/dist/engine/selection/ranges.d.ts +114 -0
- package/dist/engine/selection/rows.d.ts +207 -0
- package/dist/engine/source.d.ts +225 -0
- package/dist/engine/synthetic.d.ts +28 -0
- package/dist/engine/table/cells.d.ts +52 -0
- package/dist/engine/table/headers.d.ts +20 -0
- package/dist/engine/table/host.d.ts +65 -0
- package/dist/engine/table/job.d.ts +21 -0
- package/dist/engine/table/rows.d.ts +99 -0
- package/dist/engine/table/slicer.d.ts +54 -0
- package/dist/engine/table/takes.d.ts +145 -0
- package/dist/engine/types.d.ts +2950 -0
- package/dist/engine/ui/announce.d.ts +7 -0
- package/dist/engine/ui/chooser.d.ts +19 -0
- package/dist/engine/ui/columnList.d.ts +41 -0
- package/dist/engine/ui/columnMenu.d.ts +96 -0
- package/dist/engine/ui/columnsPanel.d.ts +16 -0
- package/dist/engine/ui/contextMenu.d.ts +48 -0
- package/dist/engine/ui/controller.d.ts +295 -0
- package/dist/engine/ui/filters/apply.d.ts +53 -0
- package/dist/engine/ui/filters/custom.d.ts +3 -0
- package/dist/engine/ui/filters/date.d.ts +12 -0
- package/dist/engine/ui/filters/host.d.ts +102 -0
- package/dist/engine/ui/filters/multi.d.ts +6 -0
- package/dist/engine/ui/filters/number.d.ts +15 -0
- package/dist/engine/ui/filters/numberMask.d.ts +15 -0
- package/dist/engine/ui/filters/set.d.ts +3 -0
- package/dist/engine/ui/filters/simple.d.ts +52 -0
- package/dist/engine/ui/filters/text.d.ts +5 -0
- package/dist/engine/ui/filtersPanel.d.ts +18 -0
- package/dist/engine/ui/floating.d.ts +66 -0
- package/dist/engine/ui/floatingShorthand.d.ts +20 -0
- package/dist/engine/ui/floatingTypes.d.ts +82 -0
- package/dist/engine/ui/icons.d.ts +25 -0
- package/dist/engine/ui/menu.d.ts +45 -0
- package/dist/engine/ui/overlayHost.d.ts +7 -0
- package/dist/engine/ui/place.d.ts +37 -0
- package/dist/engine/ui/popup.d.ts +97 -0
- package/dist/engine/ui/sideBar.d.ts +26 -0
- package/dist/engine/ui/statusBar.d.ts +29 -0
- package/dist/engine/ui/toolbar/buttons.d.ts +21 -0
- package/dist/engine/ui/toolbar/chipState.d.ts +52 -0
- package/dist/engine/ui/toolbar/chips.d.ts +23 -0
- package/dist/engine/ui/toolbar/findBox.d.ts +10 -0
- package/dist/engine/ui/toolbar/quickFilterBox.d.ts +12 -0
- package/dist/engine/ui/toolbar/registry.d.ts +5 -0
- package/dist/engine/ui/toolbar/toolbar.d.ts +31 -0
- package/dist/engine/ui/toolbar/types.d.ts +23 -0
- package/dist/engine/ui/tooltip.d.ts +34 -0
- package/dist/engine/ui/virtualList.d.ts +35 -0
- package/dist/engine/viewport/heightView.d.ts +62 -0
- package/dist/engine/viewport/heights.d.ts +39 -0
- package/dist/engine/viewport/intervals.d.ts +19 -0
- package/dist/engine/viewport/range.d.ts +51 -0
- package/dist/engine/viewport/scroll.d.ts +45 -0
- package/dist/engine/viewport/stack.d.ts +160 -0
- package/dist/grid-C34VEap6.js +32310 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1273 -0
- package/dist/ingrid.css +1 -0
- package/dist/internal.d.ts +13 -0
- package/dist/internal.js +1 -0
- package/dist/locale/de.d.ts +4 -0
- package/dist/locale/de.js +222 -0
- package/dist/themes/primevue.css +63 -0
- package/dist/themes/tailwind.css +68 -0
- package/dist/vue/InGrid.vue.d.ts +263 -0
- package/dist/vue/stableOptions.d.ts +8 -0
- package/dist/vue/useClientSource.d.ts +28 -0
- package/dist/vue/useServerSource.d.ts +8 -0
- package/dist/vue/vueRenderer.d.ts +164 -0
- package/dist/xlsx-59umS_n_.js +325 -0
- package/package.json +78 -5
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { DisplayLayout } from '../columns/layout';
|
|
2
|
+
import type { HeaderView } from '../render/header';
|
|
3
|
+
import { type ResolvedCellSelection } from '../selection/options';
|
|
4
|
+
import { type RangeColumns, type RangeModel } from '../selection/ranges';
|
|
5
|
+
import type { Grid, GridOptions } from '../types';
|
|
6
|
+
import type { InteractHost } from './host';
|
|
7
|
+
/** The range methods, as the grid's API exposes them. */
|
|
8
|
+
export type RangeApi = Pick<Grid, 'getCellRanges' | 'setCellRanges' | 'addCellRange' | 'clearCellRanges' | 'getCellRangeSummary'>;
|
|
9
|
+
export interface RangeWiring {
|
|
10
|
+
/**
|
|
11
|
+
* The model (`InteractHost.ranges`), after a 'data' change still waiting went out: a change made through it is then
|
|
12
|
+
* delivered after the data change it follows. Null while cell selection is off.
|
|
13
|
+
*/
|
|
14
|
+
model(): RangeModel | null;
|
|
15
|
+
/** The resolved options; null while cell selection is off. */
|
|
16
|
+
options(): ResolvedCellSelection | null;
|
|
17
|
+
/** The range columns of the applied layout (`InteractHost.rangeColumns`), with or without cell selection. */
|
|
18
|
+
columns(): RangeColumns;
|
|
19
|
+
/**
|
|
20
|
+
* `cellSelection` (at creation and `setCellSelection`): creates or drops the model, or applies a new `unit` or
|
|
21
|
+
* `multiple` to the ranges. True when the ranges changed: the caller emits the one 'api' change.
|
|
22
|
+
*/
|
|
23
|
+
configure(option: GridOptions['cellSelection']): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* `cellFocus: 'row'` (at creation and `setCellFocus`): with cell selection on, the ranges work in the row unit
|
|
26
|
+
* — `options().unit` reports `'row'` — and switching it converts them as a `unit` change does. True when the
|
|
27
|
+
* ranges changed: the caller emits the one 'api' change.
|
|
28
|
+
*/
|
|
29
|
+
setRowFocus(on: boolean): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* `GridOptions.cellRanges`, after the first layout and query (no event). While the grid has no rows yet (a server
|
|
32
|
+
* source before its first answer, an empty client source) they wait, so the splice that brings the rows does not
|
|
33
|
+
* shift them: they land on the rows they name once there are rows.
|
|
34
|
+
*/
|
|
35
|
+
applyInitial(ranges: GridOptions['cellRanges']): void;
|
|
36
|
+
/** Every splice the grid applies: O(1) and silent while no range exists; its 'data' change waits for `settled`. */
|
|
37
|
+
splice(at: number, removed: number, inserted: number): void;
|
|
38
|
+
/** Every reset or count change the grid applies, and its count reconciliation: rectangles clamp. */
|
|
39
|
+
reset(rowCount: number): void;
|
|
40
|
+
/** The grid's `settle` (once per task with source changes, after its count fix-up): the batch's one 'data' change. */
|
|
41
|
+
settled(): void;
|
|
42
|
+
/** A layout was applied: hidden, removed and moved columns reach the model. */
|
|
43
|
+
layoutChanged(layout: DisplayLayout): void;
|
|
44
|
+
/**
|
|
45
|
+
* A drawn cell's state bits (the pool's `StrategyContext.cellBits` while cell selection is on); `pinned`: a
|
|
46
|
+
* cell of that pinned section's pool.
|
|
47
|
+
*/
|
|
48
|
+
cellBits(row: number, slot: number, pinned?: 'top' | 'bottom'): number;
|
|
49
|
+
/**
|
|
50
|
+
* A fill drag's preview, its `CELL_FILL_*` bits for a range column's cell (by display index
|
|
51
|
+
* among the range columns), added to `cellBits` — which is then another reader, so while no fill drag runs (null)
|
|
52
|
+
* a cell costs nothing more. Drawn cells follow at once (a state version move), also when the same reader comes
|
|
53
|
+
* again with a new preview.
|
|
54
|
+
*/
|
|
55
|
+
setFillPreview(read: ((row: number, displayIndex: number, pinned?: 'top' | 'bottom') => number) | null): void;
|
|
56
|
+
/**
|
|
57
|
+
* A pinned section's rows were set: the model takes both sections' counts, which `'all'` ranges and
|
|
58
|
+
* drawing cover; a change of the ranges — a corner or anchor clamped into a section that shrank — goes
|
|
59
|
+
* out as one 'data' change. `topShift`: the top section's rows moved by it at its head first (the pinned grand
|
|
60
|
+
* total came or went), the corners there following their rows (`RangeModel.shiftTop`) — one change for both.
|
|
61
|
+
*/
|
|
62
|
+
sectionsChanged(topShift?: 1 | -1): void;
|
|
63
|
+
/** The header highlight, when the ranges moved or (`force`) the header was updated. */
|
|
64
|
+
syncHeader(view: Pick<HeaderView, 'highlight'>, force?: boolean): void;
|
|
65
|
+
api: RangeApi;
|
|
66
|
+
destroy(): void;
|
|
67
|
+
}
|
|
68
|
+
export declare function createRangeWiring(host: InteractHost): RangeWiring;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { DisplayLayout } from '../columns/layout';
|
|
2
|
+
import { type ResolvedRowSelectionUi, type RowSelectionConfig, type RowSelectionModel, type SelectionOp } from '../selection/rows';
|
|
3
|
+
import { type SourceChange } from '../source';
|
|
4
|
+
import type { Grid, GridOptions, RowSelectionState, SelectionChange } from '../types';
|
|
5
|
+
import type { InteractHost } from './host';
|
|
6
|
+
type Resolved = RowSelectionConfig & ResolvedRowSelectionUi;
|
|
7
|
+
/** The row selection methods, as the grid's API exposes them. */
|
|
8
|
+
export type RowSelectionApi = Pick<Grid, 'getSelection' | 'setSelection' | 'getSelectedRows' | 'selectedRowCount' | 'isRowSelected' | 'selectRows' | 'deselectRows' | 'selectAll' | 'deselectAll'>;
|
|
9
|
+
export interface RowSelectionWiring {
|
|
10
|
+
/** The model; null while row selection is off. */
|
|
11
|
+
model(): RowSelectionModel | null;
|
|
12
|
+
/** The resolved options as given (the selection column's spec reads them); null while row selection is off. */
|
|
13
|
+
options(): Resolved | null;
|
|
14
|
+
/** The resolved options with the header checkbox as it currently applies (`InteractHost.rowSelectionUi`). */
|
|
15
|
+
ui(): Resolved | null;
|
|
16
|
+
/**
|
|
17
|
+
* `rowSelection` (at creation and `setRowSelection`): creates, replaces or reconfigures the model. A change of `mode`
|
|
18
|
+
* or `groupSelects` clears the selection, as does turning it off; the other options keep it, except that a
|
|
19
|
+
* new `selectable` deselects the selected rows it rejects. Returns true when the selection changed: the caller emits
|
|
20
|
+
* the one 'api' change once its layout follows the options.
|
|
21
|
+
*/
|
|
22
|
+
configure(option: GridOptions['rowSelection']): boolean;
|
|
23
|
+
/** `GridOptions.selection`, applied at creation (no event). */
|
|
24
|
+
applyInitial(state: RowSelectionState | undefined): void;
|
|
25
|
+
/**
|
|
26
|
+
* A new source (`setRows`): a new model for it, the selection carried by id. True when the count changed: the caller
|
|
27
|
+
* emits one 'data' change once it applied the reset.
|
|
28
|
+
*/
|
|
29
|
+
sourceReplaced(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Every source change, synchronously inside the source's listener and before anything else: rows that left the
|
|
32
|
+
* data leave the selection, the anchor follows splices and resets. True when the selection changed (the grid then
|
|
33
|
+
* emits one `'data'` change once it applied the change itself).
|
|
34
|
+
*/
|
|
35
|
+
sourceChanged(change: SourceChange): boolean;
|
|
36
|
+
/** One gesture or call on the model (`InteractHost.rowGesture`); true when the selection changed (the event went out). */
|
|
37
|
+
gesture(op: SelectionOp, source: SelectionChange['source']): boolean;
|
|
38
|
+
/** A drawn row's state bits. */
|
|
39
|
+
rowBits(row: number): number;
|
|
40
|
+
/** The column whose header shows the header checkbox in `layout`; null = none. */
|
|
41
|
+
headerColumn(layout: DisplayLayout): string | null;
|
|
42
|
+
/** Writes the header checkbox's states when they may have changed (once per pass, after header updates). */
|
|
43
|
+
syncHeaderBox(el: HTMLInputElement | null): void;
|
|
44
|
+
/**
|
|
45
|
+
* Space on the header cell that holds the header checkbox: what a click on the box does. False when
|
|
46
|
+
* the box is not shown or disabled (nothing changed).
|
|
47
|
+
*/
|
|
48
|
+
toggleAll(): boolean;
|
|
49
|
+
api: RowSelectionApi;
|
|
50
|
+
destroy(): void;
|
|
51
|
+
}
|
|
52
|
+
export declare function createRowSelectionWiring(host: InteractHost): RowSelectionWiring;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyboard chords such as `'Mod+Shift+C'`: parse, match, label. Pure; no DOM.
|
|
3
|
+
*/
|
|
4
|
+
import type { GridTexts } from '../i18n/texts';
|
|
5
|
+
export interface Shortcut {
|
|
6
|
+
/** Ctrl, or Cmd on macOS. */
|
|
7
|
+
mod: boolean;
|
|
8
|
+
shift: boolean;
|
|
9
|
+
alt: boolean;
|
|
10
|
+
/** The key as `KeyboardEvent.key` spells it: one character (a letter upper-cased), `F1`–`F24` or a named key. */
|
|
11
|
+
key: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parses `'Mod+Shift+C'` (parts case-insensitive, any order, last part the key: one character, `F1`–`F24` or a named
|
|
15
|
+
* key such as `PageDown`); null when invalid.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseShortcut(text: string): Shortcut | null;
|
|
18
|
+
/** True when the event is exactly this chord; falls back to `code` for layouts where Alt changes `key`. */
|
|
19
|
+
export declare function matchesShortcut(e: Pick<KeyboardEvent, 'key' | 'code' | 'ctrlKey' | 'metaKey' | 'shiftKey' | 'altKey'>, s: Shortcut): boolean;
|
|
20
|
+
/** The label: macOS `⌃⌥⇧⌘` order with symbols, elsewhere `Ctrl+Alt+Shift+` with the localised names. */
|
|
21
|
+
export declare function formatShortcut(s: Shortcut, mac: boolean, names: GridTexts['keyNames']): string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type DisplayLayout } from '../columns/layout';
|
|
2
|
+
import type { Locale } from '../i18n/texts';
|
|
3
|
+
import type { HeaderView } from '../render/header';
|
|
4
|
+
import type { SourceChange, ViewportSource } from '../source';
|
|
5
|
+
import type { ColumnInfo } from '../types';
|
|
6
|
+
import type { TooltipLayer } from '../ui/tooltip';
|
|
7
|
+
/** What the tooltip targets need from the grid. */
|
|
8
|
+
export interface TooltipHost {
|
|
9
|
+
root: HTMLElement;
|
|
10
|
+
rowsEl: HTMLElement;
|
|
11
|
+
/** The pinned sections: their rows' cells are targets too. */
|
|
12
|
+
sectionEls: readonly HTMLElement[];
|
|
13
|
+
header: HTMLElement;
|
|
14
|
+
layer: TooltipLayer;
|
|
15
|
+
source(): ViewportSource;
|
|
16
|
+
/** Pinned section `side`'s source: a pinned cell's row is an index into it. */
|
|
17
|
+
sectionSource(side: 'top' | 'bottom'): ViewportSource;
|
|
18
|
+
layout(): DisplayLayout;
|
|
19
|
+
locale(): Locale;
|
|
20
|
+
/** `GridOptions.keepGroupValues` (absent: off), for the cells' rule (`emptyGroupRows`). */
|
|
21
|
+
keepGroupValues?(): boolean;
|
|
22
|
+
/** The grouped columns, outermost first (`ColumnModel.rowGroups`). */
|
|
23
|
+
grouped(): readonly string[];
|
|
24
|
+
/** The cell an event target is in (the grid's `cellAt`): a body cell, or a pinned row's with `pinned`; null outside. */
|
|
25
|
+
cellAt(target: EventTarget | null): CellHit | null;
|
|
26
|
+
headerView: Pick<HeaderView, 'targetOf' | 'cellOf' | 'segmentOf' | 'describe'>;
|
|
27
|
+
/** The column as `getColumns` reports it; null when it is not displayed. */
|
|
28
|
+
columnInfo(id: string): ColumnInfo | null;
|
|
29
|
+
/** `reportErrorOnce`. */
|
|
30
|
+
report(owner: object, key: string, error: unknown): void;
|
|
31
|
+
/** `tooltips.touch`: a touch hold shows the tooltip. */
|
|
32
|
+
touch(): boolean;
|
|
33
|
+
/** The cell has an open editor: its own tooltip doesn't show. */
|
|
34
|
+
editing(row: number, column: string, pinned: 'top' | 'bottom' | undefined): boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface Tooltips {
|
|
37
|
+
/**
|
|
38
|
+
* The body listeners, the focus descriptions and the header's hook: while some column or group has a tooltip and
|
|
39
|
+
* `browser` is off; the touch hold's presses while also `touch` is on (read again at each call).
|
|
40
|
+
*/
|
|
41
|
+
setActive(on: boolean): void;
|
|
42
|
+
/** The header's `pointerover` / `pointerleave`. */
|
|
43
|
+
headerPointer(e: PointerEvent): void;
|
|
44
|
+
sourceChanged(change: SourceChange): void;
|
|
45
|
+
/** Pinned section `side`'s rows were set: a tooltip of a cell there hides, as for a body reset. */
|
|
46
|
+
pinnedRowsChanged(side: 'top' | 'bottom'): void;
|
|
47
|
+
/** After every header update (so after every layout change). */
|
|
48
|
+
headerUpdated(): void;
|
|
49
|
+
/**
|
|
50
|
+
* A grid popup opened (the layer hid its tooltip already): a running touch hold ends, so a menu the hold opens
|
|
51
|
+
* wins and the release swallows no click.
|
|
52
|
+
*/
|
|
53
|
+
popupOpened(): void;
|
|
54
|
+
}
|
|
55
|
+
/** A cell under an event target: its row (in its section when `pinned`), column and element. */
|
|
56
|
+
interface CellHit {
|
|
57
|
+
row: number;
|
|
58
|
+
column: string;
|
|
59
|
+
cell: HTMLElement;
|
|
60
|
+
pinned?: 'top' | 'bottom';
|
|
61
|
+
}
|
|
62
|
+
export declare function createTooltips(host: TooltipHost): Tooltips;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Length tokens the engine needs in px. */
|
|
2
|
+
export interface CssMetrics {
|
|
3
|
+
rowHeight: number;
|
|
4
|
+
headerHeight: number;
|
|
5
|
+
/** Height of one group header row. */
|
|
6
|
+
headerGroupHeight: number;
|
|
7
|
+
/** Height of the floating-filter row. */
|
|
8
|
+
floatingFilterHeight: number;
|
|
9
|
+
cellPaddingY: number;
|
|
10
|
+
rowBorder: number;
|
|
11
|
+
/** The row's room beyond a line, its padding and its border (whole 2 px): half of it pads an autoHeight cell. */
|
|
12
|
+
cellExtra: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Reads length-valued CSS variables (any unit) as px through hidden probe elements and reports changes, so a
|
|
16
|
+
* density or theme change is a pure CSS change. Must be called inside an effect scope.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createCssMetrics(root: HTMLElement, onChange: (metrics: CssMetrics) => void): {
|
|
19
|
+
read(): CssMetrics;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Largest element height (CSS px) the browser lays out inside `container`, measured there with layout sizes, so CSS
|
|
23
|
+
* zoom on an ancestor of the container is taken into account. Not cached; 0 when the container is not laid out
|
|
24
|
+
* (e.g. hidden).
|
|
25
|
+
*/
|
|
26
|
+
export declare function probeMaxHeight(container: HTMLElement): number;
|
|
27
|
+
/** Largest element height (px) the browser lays out and paints at the page level; probed once per page. */
|
|
28
|
+
export declare function maxElementHeight(): number;
|
|
29
|
+
/** Drops the page-level probe result, e.g. after a grid found its region clamped below it. */
|
|
30
|
+
export declare function forgetMaxElementHeight(): void;
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import type { DisplayLayout, ResolvedColumn } from '../columns/layout';
|
|
2
|
+
import { type GroupColumnSpec } from '../columns/model';
|
|
3
|
+
import type { GridTexts, Locale } from '../i18n/texts';
|
|
4
|
+
import type { RowInfo, ViewportSource } from '../source';
|
|
5
|
+
import type { CellContext, CellRenderer, CellRendererInstance } from '../types';
|
|
6
|
+
import { type FlashEntry } from './flash';
|
|
7
|
+
import { type GroupParts } from './groupCell';
|
|
8
|
+
import { type SectionSide } from './pinnedRows';
|
|
9
|
+
import { type FindDraw, type GripState } from './strategy';
|
|
10
|
+
export interface CellView {
|
|
11
|
+
el: HTMLElement;
|
|
12
|
+
/**
|
|
13
|
+
* Plain-text node, created once and rewritten through nodeValue (empty while a renderer owns the cell). While the
|
|
14
|
+
* cell shows find's marks (`marks`) it holds the text before the first one.
|
|
15
|
+
*/
|
|
16
|
+
text: Text;
|
|
17
|
+
/**
|
|
18
|
+
* Find: the nodes right after `text` in its container while the cell shows its text marked —
|
|
19
|
+
* `<mark>` elements and plain Text nodes, in order; null while `text` alone holds the text (the fast path).
|
|
20
|
+
*/
|
|
21
|
+
marks: ChildNode[] | null;
|
|
22
|
+
/** The occurrences the marks show (`FindDraw.marks`'s, flat `[start, end, …]`) and the active one (0 = none). */
|
|
23
|
+
markRanges: readonly number[] | null;
|
|
24
|
+
markActive: number;
|
|
25
|
+
/** Measured wrapper of autoHeight columns. */
|
|
26
|
+
wrap: HTMLElement | null;
|
|
27
|
+
/** The text's own `span.ig-cell-text` in a column with `ellipsis: 'start'`; null in the others. */
|
|
28
|
+
textSpan: HTMLElement | null;
|
|
29
|
+
/** Host element of a mounted custom renderer. */
|
|
30
|
+
host: HTMLElement | null;
|
|
31
|
+
/** Internal column index the cell is bound to (-1 = none). */
|
|
32
|
+
col: number;
|
|
33
|
+
/** `ResolvedColumn.version` the cell was assigned with (-1 = none). */
|
|
34
|
+
version: number;
|
|
35
|
+
/** `aria-colindex` last written (0 = none); follows moves without a re-bind. */
|
|
36
|
+
ariaCol: number;
|
|
37
|
+
lastText: string;
|
|
38
|
+
/** The class list last written: `baseClass`, then `dynamicClass` and `stateClass` when they are not empty. */
|
|
39
|
+
lastClass: string;
|
|
40
|
+
/** The column's static class list (`cellClassOf`), set when the cell is assigned to a column version. */
|
|
41
|
+
baseClass: string;
|
|
42
|
+
/** What the column's function `cellClass` returned at the cell's last value bind ('' = none). */
|
|
43
|
+
dynamicClass: string;
|
|
44
|
+
renderer: CellRenderer | null;
|
|
45
|
+
instance: CellRendererInstance | null;
|
|
46
|
+
mountQueued: boolean;
|
|
47
|
+
/** Renderer whose create() threw: not retried until the cell's renderer changes. */
|
|
48
|
+
failed: CellRenderer | null;
|
|
49
|
+
/** Latest context, used by the deferred mount. */
|
|
50
|
+
ctx: CellContext | null;
|
|
51
|
+
/** Parts of a group-column cell; null for other columns. */
|
|
52
|
+
group: GroupParts | null;
|
|
53
|
+
/** Where renderer hosts mount: the group label, else the wrapper or the cell itself. */
|
|
54
|
+
slot: HTMLElement | null;
|
|
55
|
+
/** The row's checkbox in a selection or group cell; kept detached while the row shows none. */
|
|
56
|
+
box: HTMLInputElement | null;
|
|
57
|
+
/** The box's `aria-label` last written ('' = none). */
|
|
58
|
+
boxLabel: string;
|
|
59
|
+
/**
|
|
60
|
+
* A checkbox column's box, created on first use and reused; in the cell, right after its text node,
|
|
61
|
+
* while the bound value draws one (`valueBoxState`).
|
|
62
|
+
*/
|
|
63
|
+
valueBox: HTMLInputElement | null;
|
|
64
|
+
/** The value box's `aria-label` last written ('' = none). */
|
|
65
|
+
valueBoxLabel: string;
|
|
66
|
+
/** The cell state bits last written (`StrategyContext.cellBits`; 0 = none). */
|
|
67
|
+
stateBits: number;
|
|
68
|
+
/** The class list's state part for `stateBits` ('' = none). */
|
|
69
|
+
stateClass: string;
|
|
70
|
+
/** The row `stateBits` were read for (−1 = to be read: the cell was just assigned to a column). */
|
|
71
|
+
stateRow: number;
|
|
72
|
+
/** `aria-selected` last written (null = none: not a range column, or cell selection off). */
|
|
73
|
+
ariaSelected: string | null;
|
|
74
|
+
/** The flash entry the cell shows (null = none). */
|
|
75
|
+
flash: FlashEntry | null;
|
|
76
|
+
/** The class list's flash part for it (`ig-flash` / `ig-copied`; '' = none). */
|
|
77
|
+
flashClass: string;
|
|
78
|
+
/** When that part's animation began (`performance.now()` time): the base of the cell's `animation-delay`. */
|
|
79
|
+
flashBase: number;
|
|
80
|
+
/**
|
|
81
|
+
* The value and text of the cell's last value bind while its column flashes changes: `undefined`
|
|
82
|
+
* and '' where that bind drew or read nothing. Two fields, not an object, so a bind allocates nothing.
|
|
83
|
+
*/
|
|
84
|
+
seenValue: unknown;
|
|
85
|
+
seenText: string;
|
|
86
|
+
/** The `title` last written under `tooltips.browser` ('' = none). */
|
|
87
|
+
title: string;
|
|
88
|
+
/**
|
|
89
|
+
* The row-drag grip, created on first use and reused; in the cell while `gripState` is not
|
|
90
|
+
* `'none'`.
|
|
91
|
+
*/
|
|
92
|
+
grip: HTMLElement | null;
|
|
93
|
+
/** The grip state last written. */
|
|
94
|
+
gripState: GripState;
|
|
95
|
+
/** The cell's `aria-label` last written ('' = none): the handle column's cells. */
|
|
96
|
+
label: string;
|
|
97
|
+
/**
|
|
98
|
+
* The detail chevron, created on first use and reused; in the cell while `toggleState` is not
|
|
99
|
+
* `'none'`.
|
|
100
|
+
*/
|
|
101
|
+
toggle: HTMLElement | null;
|
|
102
|
+
/** The chevron state last written. */
|
|
103
|
+
toggleState: DetailToggleState;
|
|
104
|
+
/**
|
|
105
|
+
* The cell's `aria-label` as the chevron's writer last wrote it ('' = none): the toggle column's cells.
|
|
106
|
+
* Apart from `label`: a cell is never both a handle cell and a toggle cell, and each writer leaves the other's alone.
|
|
107
|
+
*/
|
|
108
|
+
toggleLabel: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* What a cell's detail chevron shows: a master's chevron (`'open'` and `'closed'` look the same here — the
|
|
112
|
+
* row's `.ig-detail-open` turns it), a non-master's room in a `'cells'` column (`'room'`: a spacer), or nothing.
|
|
113
|
+
*/
|
|
114
|
+
export type DetailToggleState = 'open' | 'closed' | 'room' | 'none';
|
|
115
|
+
export declare function createCell(): CellView;
|
|
116
|
+
/**
|
|
117
|
+
* The static class list of a column's body cells (also used to style auto-size's probe cell). A function `cellClass`
|
|
118
|
+
* is not part of it: it is the per-cell dynamic part, written by `bindCellValue`.
|
|
119
|
+
*/
|
|
120
|
+
export declare function cellClassOf(col: ResolvedColumn): string;
|
|
121
|
+
/** True when the column's text is cut at its start; an `autoHeight` column ignores the option. */
|
|
122
|
+
export declare function startsCut(col: ResolvedColumn): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Writes a cell's state when its bits changed: the class list's state part from the prepared table (or the
|
|
125
|
+
* row-number cell's highlight; with a fill preview's edge, `fillClass`) and `aria-selected`, each only when
|
|
126
|
+
* it changed.
|
|
127
|
+
*/
|
|
128
|
+
export declare function writeCellState(cell: CellView, bits: number): void;
|
|
129
|
+
/**
|
|
130
|
+
* Draws the flash a cell shows: `entry` from the registry's lookup, null for none; `now` is the
|
|
131
|
+
* pass's time. Nothing is written while the entry stays the same. A new class part (re)starts the class's animation at
|
|
132
|
+
* `now`; another entry of the same kind keeps the running animation and moves its `animation-delay` (applied as if it
|
|
133
|
+
* had been set when the animation began), so a repeated flash restarts and a recycled element joins its new row's
|
|
134
|
+
* flash. The delay goes when the flash ends.
|
|
135
|
+
*/
|
|
136
|
+
export declare function writeCellFlash(cell: CellView, entry: FlashEntry | null, now: number): void;
|
|
137
|
+
/**
|
|
138
|
+
* A cell element moved in the DOM (a lane change, the rows put back in order) restarts its CSS animation: a running
|
|
139
|
+
* flash's delay follows, from `now`.
|
|
140
|
+
*/
|
|
141
|
+
export declare function restartFlash(cell: CellView, now: number): void;
|
|
142
|
+
/**
|
|
143
|
+
* A cell element moved with `moveBefore`: the engines differ — Firefox keeps a running animation, Chromium starts
|
|
144
|
+
* it again when the new parent has no style yet, as a span just inserted (both measured). A restarted animation
|
|
145
|
+
* is still pending (no start time) and its delay follows from `now` (`restartFlash`); a kept one keeps its delay, which,
|
|
146
|
+
* moved, would put its phase ahead. Reading the animations flushes style: only for a focused row's kind flip during a
|
|
147
|
+
* flash.
|
|
148
|
+
*/
|
|
149
|
+
export declare function followFlash(cell: CellView, now: number): void;
|
|
150
|
+
/** Sets or clears the focus bit of a cell's state: one cell's class list, written when it changed. */
|
|
151
|
+
export declare function writeCellFocus(cell: CellView, focused: boolean): void;
|
|
152
|
+
/**
|
|
153
|
+
* The field the group column shows on a row: a tree's label field; a group row's level's grouped field;
|
|
154
|
+
* a group's total row its group's — one level up, a total's level being its group's + 1 —; none on a leaf
|
|
155
|
+
* row or the grand total.
|
|
156
|
+
*/
|
|
157
|
+
export declare function groupFieldOf(spec: GroupColumnSpec, info: RowInfo | null): string | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Raw value of a column's cell: the row-number column's own `value`, the group column's key or label (from the row's
|
|
160
|
+
* `info`), else the source's. Not isolated: it may throw, and the caller decides how to report it.
|
|
161
|
+
*/
|
|
162
|
+
export declare function cellValue(col: ResolvedColumn, source: ViewportSource, row: number, info?: RowInfo | null): unknown;
|
|
163
|
+
/**
|
|
164
|
+
* The source's group rows hold no data: a client source's group rows and tree fillers have no row
|
|
165
|
+
* object. Null for every other source, whose group rows show what they hold (a server's: what the server sent).
|
|
166
|
+
* Decided once per pass, copy or auto-size, not per row. `treeField`: the tree's label field, which a filler answers
|
|
167
|
+
* with its key. For total rows (client data): the inputs their cells need.
|
|
168
|
+
*/
|
|
169
|
+
export interface EmptyGroupRows {
|
|
170
|
+
treeField: string | null;
|
|
171
|
+
/** `GridOptions.keepGroupValues`: an open group's row keeps its sums while its total row shows. */
|
|
172
|
+
keepGroupValues: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* The as-if-open walk (an export of every row): every group counts as open, so one with a total row
|
|
175
|
+
* blanks its own sums whether open or closed. False on screen, in copies and in find (the expansion as it is).
|
|
176
|
+
*/
|
|
177
|
+
asIfOpen: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* The flat label column's slot (`ResolvedColumn.index`): without a group column (no grouping, no tree data)
|
|
180
|
+
* the first displayed data column with no `aggregate`, in display order (left-pinned, centre, right-pinned; the
|
|
181
|
+
* grid-owned columns never), where the grand total writes its word; −1 for none (a group column, or every displayed
|
|
182
|
+
* data column has an aggregate).
|
|
183
|
+
*/
|
|
184
|
+
label: number;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* The decision for a pass (`EmptyGroupRows`; null: not client data). `keepGroupValues` is the grid's option;
|
|
188
|
+
* `asIfOpen` only the as-if-open export walk sets. The flat label column is decided here, once, from the displayed
|
|
189
|
+
* columns' definitions: only the grand total writes into it, so a grid without one is not affected. A pinned
|
|
190
|
+
* section's source answers as the body's (`sectionBody`): its grand total follows the same rule, and its app
|
|
191
|
+
* rows (leaves without a total row) are not affected.
|
|
192
|
+
*/
|
|
193
|
+
export declare function emptyGroupRows(source: ViewportSource, layout: DisplayLayout, keepGroupValues?: boolean, asIfOpen?: boolean): EmptyGroupRows | null;
|
|
194
|
+
/**
|
|
195
|
+
* The one rule cells, copy, export, auto-size, tooltips and find share. With `empty` (client
|
|
196
|
+
* data) a cell draws nothing — no value is read and no `format`, function `cellClass` or renderer is called, so an app's
|
|
197
|
+
* empty marker does not appear, a copy writes nothing and auto-size measures nothing — in a data column:
|
|
198
|
+
* - of a group row or tree filler, neither aggregated nor the column its key is shown in (its level's grouped column,
|
|
199
|
+
* or the tree's label field);
|
|
200
|
+
* - of a total row, not aggregated (every grouped field included: not the `rowGroup` exception, whose level test
|
|
201
|
+
* would let the next level's grouped column draw) — except the flat label column on the grand total;
|
|
202
|
+
* - aggregated, of a group row or tree parent while its total row shows (`sumsOnTotal`), its key's column excepted.
|
|
203
|
+
*
|
|
204
|
+
* The group column and the grid-owned columns always draw.
|
|
205
|
+
*/
|
|
206
|
+
export declare function drawsNothing(col: ResolvedColumn, info: RowInfo | null, empty: EmptyGroupRows | null): boolean;
|
|
207
|
+
/**
|
|
208
|
+
* The flat label cell — the one data column without an aggregate that a total row draws (`drawsNothing`
|
|
209
|
+
* lets no other through), so true only after `drawsNothing` said false. It shows the grand total's word as plain text
|
|
210
|
+
* (`formatCellText`): no `format`, function `cellClass`, renderer or value box, and its `value` is `undefined`.
|
|
211
|
+
*/
|
|
212
|
+
export declare function isTotalLabel(col: ResolvedColumn, info: RowInfo | null): boolean;
|
|
213
|
+
/** Writes the cell's `aria-colindex` when the column's display position changed; nothing is re-bound. */
|
|
214
|
+
export declare function syncColIndex(cell: CellView, col: ResolvedColumn): void;
|
|
215
|
+
/**
|
|
216
|
+
* Binds a cell element to a column: position variables, aria, classes, auto-height wrapper, renderer. A cell already
|
|
217
|
+
* bound to this column at this `version` only gets its `aria-colindex` updated.
|
|
218
|
+
*/
|
|
219
|
+
export declare function assignColumn(cell: CellView, col: ResolvedColumn): void;
|
|
220
|
+
/**
|
|
221
|
+
* The row's checkbox in this cell from the row's state bits (`ROW_BOX`, checked with `ROW_SELECTED`,
|
|
222
|
+
* indeterminate with `ROW_PARTIAL`, `ROW_BOX_DISABLED`): in a selection cell after its empty text, in a group cell in
|
|
223
|
+
* front of the chevron; none without `ROW_BOX`. The states are properties, compared with the element's own (a click
|
|
224
|
+
* toggles a box natively before the grid answers) and written only when they differ; the label when it changes.
|
|
225
|
+
*/
|
|
226
|
+
export declare function writeCheckbox(cell: CellView, bits: number, texts: GridTexts): void;
|
|
227
|
+
/** What a checkbox column's box shows. */
|
|
228
|
+
export type ValueBoxState = 'checked' | 'unchecked' | 'mixed';
|
|
229
|
+
/**
|
|
230
|
+
* The box a checkbox column's loaded cell draws for `value`: `true` ticked, `false` unticked, on a data row
|
|
231
|
+
* `null` / `undefined` mixed (indeterminate); on a group row only a boolean (a `min` / `max` aggregate, the
|
|
232
|
+
* grouped column's own key) — on a total row too (its sums, never a mixed box). Null for any other
|
|
233
|
+
* value: the cell shows its text, as in any other column.
|
|
234
|
+
*/
|
|
235
|
+
export declare function valueBoxState(value: unknown, info: RowInfo | null): ValueBoxState | null;
|
|
236
|
+
/** Shows `state` on a value box: its states as properties (CSP), each written only when the element's own differs. */
|
|
237
|
+
export declare function showValueBox(box: HTMLInputElement, state: ValueBoxState): void;
|
|
238
|
+
/**
|
|
239
|
+
* The row-drag grip of a cell: a `<span class="ig-row-drag-handle" aria-hidden="true">`
|
|
240
|
+
* holding the grip icon, first in the cell (before its text, wrapper and renderer host) — in a group cell after the row
|
|
241
|
+
* checkbox, before the chevron —, with `.ig-row-drag-disabled` for `'off'`, none for `'none'`; never focusable (the
|
|
242
|
+
* cell around it takes focus, `focus.ts`). One element per cell, reused. `label` is the cell's `aria-label` (the handle
|
|
243
|
+
* column's cells; '' = none). Write-if-changed.
|
|
244
|
+
*/
|
|
245
|
+
export declare function writeGrip(cell: CellView, state: GripState, label: string): void;
|
|
246
|
+
/**
|
|
247
|
+
* The detail chevron of a cell: a `<span class="ig-detail-toggle" aria-hidden="true">`
|
|
248
|
+
* holding the group chevron's icon (`.ig-detail-chevron`), first in the cell (after a row-drag grip, before its text,
|
|
249
|
+
* wrapper and renderer host); `.ig-detail-spacer` keeps a non-master's room in a `'cells'` column; none for `'none'`.
|
|
250
|
+
* Never focusable (the cell around it takes focus, `focus.ts`). One element per cell, reused. `label` is the cell's
|
|
251
|
+
* `aria-label` (the toggle column's cells; '' = none). Write-if-changed.
|
|
252
|
+
*/
|
|
253
|
+
export declare function writeDetailToggle(cell: CellView, state: DetailToggleState, label: string): void;
|
|
254
|
+
/** Destroys the cell's renderer instance, if any. */
|
|
255
|
+
export declare function releaseRenderer(cell: CellView): void;
|
|
256
|
+
export declare function markStale(cell: CellView): void;
|
|
257
|
+
export declare function isStale(cell: CellView): boolean;
|
|
258
|
+
/**
|
|
259
|
+
* `source.isLoaded(row)`, isolated: a throwing isLoaded is reported once per source and the row counts as not
|
|
260
|
+
* loaded, so the render pass goes on with the next row.
|
|
261
|
+
*/
|
|
262
|
+
export declare function isRowLoaded(source: ViewportSource, row: number): boolean;
|
|
263
|
+
/**
|
|
264
|
+
* A renderer's value write: the row pool's, which writes only while `cell` still shows the bind
|
|
265
|
+
* `ctx` was made for.
|
|
266
|
+
*/
|
|
267
|
+
export type CellWrite = (cell: CellView, ctx: CellContext, value: unknown) => boolean;
|
|
268
|
+
/**
|
|
269
|
+
* A cell's `title` under `tooltips.browser`: its tooltip's text for the bound value and text ('' = none). The
|
|
270
|
+
* grid's `StrategyContext.cellTitle`.
|
|
271
|
+
*/
|
|
272
|
+
export type CellTitle = (col: ResolvedColumn, row: number, value: unknown, text: string, info: RowInfo | null) => string;
|
|
273
|
+
/**
|
|
274
|
+
* Writes the cell's value for a row. Renderer cells are updated in place once mounted; until then they show
|
|
275
|
+
* plain text and the mount is queued within the frame budget. With `write` (a source that can write), a renderer's
|
|
276
|
+
* context on a loaded data row of a data column gets `setValue`. A checkbox column's cell
|
|
277
|
+
* shows its box instead of the text where `valueBoxState` gives one — live with `write` on a data row of an `editable`
|
|
278
|
+
* column. A total row is no data row: no `setValue`, no live box; its flat label cell
|
|
279
|
+
* (`isTotalLabel`) draws plain text — no function `cellClass`, renderer or value box.
|
|
280
|
+
*
|
|
281
|
+
* Returns false, without writing anything, when `getValue` throws: the caller then shows the whole row as not
|
|
282
|
+
* loaded. A throwing `format` only affects this cell, which falls back to the default text. With `keep` (the
|
|
283
|
+
* column flashes changes) a bind that returns true keeps the value and text in `seenValue` / `seenText`. With
|
|
284
|
+
* `title` (browser tooltips) the cell's `title` follows the bind; without, a title left from before goes.
|
|
285
|
+
*
|
|
286
|
+
* `pinned`: the row is a pinned section's — `format`, a function `cellClass` and a renderer's
|
|
287
|
+
* context get the side; the row-number cell is empty (pinned rows are not body rows). Undefined for a body row, whose
|
|
288
|
+
* calls keep their arguments.
|
|
289
|
+
*
|
|
290
|
+
* With `find` (a find term is set) a plain-text cell marks the term's occurrences in its own text and a
|
|
291
|
+
* renderer's context gets the cell's parts (`ctx.find`); a later find change redraws them without a bind (`refindCell`).
|
|
292
|
+
* It follows `pinned`.
|
|
293
|
+
*/
|
|
294
|
+
export declare function bindCellValue(cell: CellView, col: ResolvedColumn, row: number, source: ViewportSource, loaded: boolean, defer: (task: () => void) => void, locale: Locale, info?: RowInfo | null, empty?: EmptyGroupRows | null, write?: CellWrite | null, keep?: boolean, title?: CellTitle | null, pinned?: SectionSide | undefined, find?: FindDraw | null): boolean;
|
|
295
|
+
/**
|
|
296
|
+
* The column's `format`, isolated: a throwing format is reported once per column and falls back to the default.
|
|
297
|
+
* The group column formats a group row's key with its level's grouped column's `format`, shows
|
|
298
|
+
* "(Blank)" for a blank key and nothing on leaf rows; in tree mode it shows the label field's default text. `pinned`:
|
|
299
|
+
* a pinned row's section, `format`'s last argument there; undefined for a body row, whose call keeps
|
|
300
|
+
* two arguments.
|
|
301
|
+
*
|
|
302
|
+
* Total rows: the group column shows "Total <label>" (`texts.groupTotal`, `label` the group's own
|
|
303
|
+
* label as its row shows it, without a count) and "Total" on the grand total (`texts.grandTotal`). A data column without
|
|
304
|
+
* an aggregate that a total row draws is the flat label column (callers ask `drawsNothing` first, which lets no other
|
|
305
|
+
* through, `isTotalLabel`): the grand total's word as plain text, no `format`.
|
|
306
|
+
*/
|
|
307
|
+
export declare function formatCellText(col: ResolvedColumn, value: unknown, row: number, info: RowInfo | null, locale: Pick<Locale, 'texts'>, pinned?: SectionSide): string;
|
|
308
|
+
/**
|
|
309
|
+
* Writes the cell's plain text if it changed (also the failed row's error text). A cell showing find's
|
|
310
|
+
* marks gets its single Text node back, whatever the text.
|
|
311
|
+
*/
|
|
312
|
+
export declare function writeCellText(cell: CellView, text: string): void;
|
|
313
|
+
/**
|
|
314
|
+
* The mark rebind: a find version moved — the term, the options or the active match changed, or the term
|
|
315
|
+
* was cleared (`find` null) — and the cell follows it from what it shows, without a value bind: no `format`, function
|
|
316
|
+
* `cellClass` or renderer `update` beyond a renderer whose parts changed. A plain-text cell redraws its marks from its
|
|
317
|
+
* drawn text, past `writeCellText`'s equal-text skip; with `rematch` false (the term and options stayed, only the active
|
|
318
|
+
* match moved) only a cell holding the old or the new active occurrence changes. A renderer cell whose parts changed
|
|
319
|
+
* gets a new context with them (`ctx.find`). `row` and `info`: the display row the cell is bound to and its info;
|
|
320
|
+
* `write`: the value write a bind of the cell gets (`bindCellValue`'s). A stale cell is left to the value bind due.
|
|
321
|
+
*/
|
|
322
|
+
export declare function refindCell(cell: CellView, col: ResolvedColumn, row: number, source: ViewportSource, info: RowInfo | null, find: FindDraw | null, rematch: boolean, write: CellWrite | null): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DisplayLayout } from '../columns/layout';
|
|
2
|
+
export type { ResolvedColumn } from '../columns/layout';
|
|
3
|
+
export declare const LANE_INDEX: {
|
|
4
|
+
readonly left: 0;
|
|
5
|
+
readonly center: 1;
|
|
6
|
+
readonly right: 2;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Writes column positions and lane widths as CSS variables on the grid root (CSSOM, CSP-safe), only where they
|
|
10
|
+
* changed against `previous`, and removes the variables of columns that are no longer displayed. Slots are stable per
|
|
11
|
+
* column, so a move rewrites x positions only. The diff assumes the root's variables still match `previous`: the
|
|
12
|
+
* grid passes the layout it last wrote here, which a resize preview leaves behind the current one on purpose.
|
|
13
|
+
* `previous` null: nothing is written yet, so everything is — lane widths of 0px and the group offset too: a grid
|
|
14
|
+
* nested in a detail must hold its own values, never inherit its master's. The root's
|
|
15
|
+
* `.ig-pinned-lanes` follows whether a lane holds a pinned column (only then do rows clip).
|
|
16
|
+
*/
|
|
17
|
+
export declare function applyColumnVars(root: HTMLElement, next: DisplayLayout, previous: DisplayLayout | null): void;
|
|
18
|
+
/**
|
|
19
|
+
* Resize preview of the body: writes the variables of the columns `cols` and the lane widths on `el` (the rows
|
|
20
|
+
* region) wherever `next` differs from `base`, the layout the root's variables still hold. A change on the rows region
|
|
21
|
+
* restyles the body only; one on the root would restyle every header cell too. Only columns with rendered body cells
|
|
22
|
+
* need to be passed: a variable left behind for a column that has no cells is never read, and is rewritten before the
|
|
23
|
+
* column's cells come back. `written` mirrors what `el` carries (write-if-changed); `clearPreviewVars` removes it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function writePreviewVars(el: HTMLElement, written: Map<string, string>, next: DisplayLayout, base: DisplayLayout, cols: Iterable<number>): void;
|
|
26
|
+
/** Removes what `writePreviewVars` put on `el`: its descendants follow the root's variables again. */
|
|
27
|
+
export declare function clearPreviewVars(el: HTMLElement, written: Map<string, string>): void;
|
|
28
|
+
export declare function defaultFormat(value: unknown): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare function div(className: string, role?: string): HTMLDivElement;
|
|
2
|
+
/**
|
|
3
|
+
* A grid checkbox: native, out of the tab order; its pointer-down default is prevented by the grid's
|
|
4
|
+
* listeners, so it never takes DOM focus. States are written as properties (CSP-safe).
|
|
5
|
+
*/
|
|
6
|
+
export declare function checkbox(className: string): HTMLInputElement;
|
|
7
|
+
/**
|
|
8
|
+
* An icon in a `box` × `box` view box (default 12; SVG through createElementNS: strict CSP), styled by `className`. Its
|
|
9
|
+
* one path draws `d`; an empty `d` leaves the path without one, for a caller that sets it later (the header's sort
|
|
10
|
+
* arrow).
|
|
11
|
+
*/
|
|
12
|
+
export declare function svgIcon(d: string, className: string, box?: number): SVGSVGElement;
|
|
13
|
+
/**
|
|
14
|
+
* The elements in `el` that Tab reaches now, in document order: in the tab order, enabled, and shown (not inside a
|
|
15
|
+
* `[hidden]` or `[inert]` element, with a box). Reads layout (the rects): call it on a focus move, not every frame.
|
|
16
|
+
*/
|
|
17
|
+
export declare function tabbables(el: ParentNode): HTMLElement[];
|
|
18
|
+
/** True when the focused element is inside `el` (a focused body does not count). */
|
|
19
|
+
export declare function containsFocus(el: Element): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* A search box's keydown: Enter does nothing there, and is consumed so that an enclosing app form is not submitted
|
|
22
|
+
* (implicit submission) or a `<form method="dialog">` closed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function consumeEnter(event: KeyboardEvent): void;
|