@ex-grid/core 0.2.0-beta.3 → 0.2.0-rc.1

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/index.d.ts CHANGED
@@ -787,6 +787,8 @@ export declare class FetchingGridSource<Row> implements GridSource<Row> {
787
787
  #private;
788
788
  /** A Find step through the Consumer's server (ADR-0055); absent when it was given no `find`. */
789
789
  readonly find?: (request: GridFindRequest, signal: AbortSignal) => Promise<GridFindResult>;
790
+ /** A page of a Find All through the Consumer's server (ADR-0470); absent when it was given no `findAll`. */
791
+ readonly findAll?: (request: GridFindAllRequest, signal: AbortSignal) => Promise<GridFindAllPage>;
790
792
  /** A Selection Summary through the Consumer's server (ADR-0130); absent when it was given no
791
793
  * `summarize`. */
792
794
  readonly summarize?: (request: GridSummaryRequest, signal: AbortSignal) => Promise<GridSummaryResult>;
@@ -958,6 +960,9 @@ export declare interface FetchingSourceOptions<Row> {
958
960
  /** A Find step (ADR-0055), answered under the Sort and the Filter in force; `findStep` is the reference
959
961
  * for what a match is. Without it the source does not find. */
960
962
  readonly find?: (request: GridFindRequest, query: QueryInForce, signal: AbortSignal) => Promise<GridFindResult>;
963
+ /** A page of a Find All (ADR-0470), answered under the Sort and the Filter in force with the exact count; `findAll`
964
+ * is the reference for the list and its order. Offered only beside `find`: without both the source lists nothing. */
965
+ readonly findAll?: (request: GridFindAllRequest, query: QueryInForce, signal: AbortSignal) => Promise<GridFindAllPage>;
961
966
  /** A Selection Summary (ADR-0130), answered under the Sort and the Filter in force as `summaryOf` would
962
967
  * over that result, or declined. Without it the source does not summarise. */
963
968
  readonly summarize?: (request: GridSummaryRequest, query: QueryInForce, signal: AbortSignal) => Promise<GridSummaryResult>;
@@ -1158,6 +1163,38 @@ export declare interface FilterSpec {
1158
1163
  * form where the source answers TooMany; or both, which the built-in panel shows as the value list. */
1159
1164
  export declare type FilterUi = 'condition' | 'valueList' | 'both';
1160
1165
 
1166
+ /**
1167
+ * One page of the reference Find All over `rows` (ADR-0470 §2), read under `rowSequenceVersion`: the whole list walked
1168
+ * and the range asked read from it. A source that answers many pages of one list keeps a {@link FindAllMatches}
1169
+ * instead, as `GridSource.from` does.
1170
+ */
1171
+ export declare function findAll<Row>(rows: readonly Row[], rowSequenceVersion: number, request: GridFindAllRequest, textOf: (column: string) => ((row: Row) => string) | undefined): GridFindAllPage;
1172
+
1173
+ /**
1174
+ * Every match of a Find All over one set of rows, found once and read a page at a time: the reference source keeps
1175
+ * one while the rows, the pattern, the scope and the columns stand, so a list scrolled through is walked once. Each
1176
+ * match is held as its cell's ordinal in row-major order, a number for millions of matches rather than an object.
1177
+ */
1178
+ export declare class FindAllMatches<Row> {
1179
+ #private;
1180
+ private constructor();
1181
+ /**
1182
+ * Walks `rows` once (ADR-0470 §2), by rows and across a row in the request's column order. `textOf` answers a
1183
+ * column's displayed text by name, or `undefined` for a column with no text to search or one not known, which is
1184
+ * skipped, as a step skips it. An empty pattern matches nothing. `rowLabel`, where given, names each match's row in
1185
+ * the Consumer's words.
1186
+ */
1187
+ static of<Row>(rows: readonly Row[], request: Omit<GridFindAllRequest, 'start' | 'count' | 'rowSequenceVersion'>, textOf: (column: string) => ((row: Row) => string) | undefined, rowLabel?: (row: Row) => string): FindAllMatches<Row>;
1188
+ /** How many cells match. */
1189
+ get total(): number;
1190
+ /** The entries from `start`, `count` of them or every one left, under `rowSequenceVersion`. A range past the end
1191
+ * holds none; a range outside the list's positions is refused. */
1192
+ page(start: number, count: number, rowSequenceVersion: number): GridFindAllPage;
1193
+ }
1194
+
1195
+ /** A page of a Find All's list, frozen and checked: `matches` at most as many as the range asked. */
1196
+ export declare function findAllPage(total: number, matches: readonly GridFindAllMatch[], rowSequenceVersion: number): GridFindAllPage;
1197
+
1161
1198
  /**
1162
1199
  * The reference rule for one cell (ADR-0055, ADR-0332 §4): whether `displayedText`, the column's format
1163
1200
  * applied, matches `pattern`. The step finds by it, and the grid marks the painted matches by it. An empty
@@ -1249,6 +1286,22 @@ export declare const findPanelLabelIds: Readonly<{
1249
1286
  readonly replaceRefusedMore: 'find-replace-refused-more';
1250
1287
  /** Why a match in a column that is not Editable cannot be written. */
1251
1288
  readonly notEditable: 'find-not-editable';
1289
+ /** The Find All button (ADR-0470 §1). */
1290
+ readonly findAll: 'find-all';
1291
+ /** The list of a Find All's matches: its accessible name. */
1292
+ readonly findAllList: 'find-all-list';
1293
+ /** What a Find All that matched several cells says, their count at `{count}`. */
1294
+ readonly findAllFound: 'find-all-found';
1295
+ /** What a Find All that matched one cell says. */
1296
+ readonly findAllFoundOne: 'find-all-found-one';
1297
+ /** What a Find All that matched nothing says. */
1298
+ readonly findAllNone: 'find-all-none';
1299
+ /** Where a match in a row is, its row's number from 1 at `{row}` and its column's header at `{column}`. */
1300
+ readonly findAllInRow: 'find-all-in-row';
1301
+ /** Where a match in a row is, by the Consumer's label for the row at `{row}` and its column's header at `{column}`. */
1302
+ readonly findAllInLabelledRow: 'find-all-in-labelled-row';
1303
+ /** Where a match in a header is, the header's text at `{column}`. */
1304
+ readonly findAllInHeader: 'find-all-in-header';
1252
1305
  }>;
1253
1306
 
1254
1307
  /** One cell a Replace could not write, as the panel names it: its row's number from 1, its column's header,
@@ -1281,6 +1334,10 @@ export declare interface FindPanelView {
1281
1334
  /** What the last step or Replace came to, in the grid's words, for a live region; empty when it says nothing
1282
1335
  * (ADR-0033). */
1283
1336
  readonly outcome: string;
1337
+ /** Whether the panel offers Find All (ADR-0470 §1): the source lists every match. While it does, the contents draw
1338
+ * a Find All button that calls {@link GridFindPanelSlotContext.findAll}; the list and its count are the core's, drawn
1339
+ * under the contents (ADR-0470 §3). */
1340
+ readonly findAllShown: boolean;
1284
1341
  }
1285
1342
 
1286
1343
  /**
@@ -2095,6 +2152,78 @@ export declare interface GridFilterPanelSlotContext {
2095
2152
  }) => void;
2096
2153
  }
2097
2154
 
2155
+ /** One line of a Find All's list: where the match is, and the text it displays. */
2156
+ export declare interface GridFindAllLine {
2157
+ /** Where the match is, in the grid's words: "Row 12, Trader", "Header Trader", "Sheet2!B12". */
2158
+ readonly where: string;
2159
+ /** The matched cell's displayed text. */
2160
+ readonly text: string;
2161
+ }
2162
+
2163
+ /**
2164
+ * A Find All list a find panel slot's contents hold themselves (ADR-0470 §7), handed to the core to draw as it draws
2165
+ * its own: ExSheet's over every Sheet of its Workbook. The contents answer how many lines it holds, each line, and
2166
+ * what choosing one does; the core draws the count and the lines, takes the list's keys and clicks in their place in
2167
+ * the Input Order, and takes the list away when the text or an option changes or the panel closes.
2168
+ */
2169
+ export declare interface GridFindAllList {
2170
+ /** How many lines the list holds: every match, never capped. */
2171
+ readonly count: number;
2172
+ /** Line `index`, from 0 to `count` − 1. */
2173
+ readonly line: (index: number) => GridFindAllLine;
2174
+ /** The user chose line `index`, in its turn: the contents move to it, as a step that found it would, and answer
2175
+ * whether they did; a choice they refuse (ExSheet's, while a cell is edited) leaves the list's current line as it
2176
+ * was. */
2177
+ readonly choose: (index: number) => boolean;
2178
+ }
2179
+
2180
+ /** One cell of a Find All's list: where it is, and the text it displays, which is what matched. */
2181
+ export declare interface GridFindAllMatch {
2182
+ /** The row's position in the order the request was read in. */
2183
+ readonly row: number;
2184
+ /** The column's name, one of the request's `columns`. */
2185
+ readonly column: string;
2186
+ /** The cell's displayed text, as the user reads it. */
2187
+ readonly text: string;
2188
+ /** What the list calls the row, in the Consumer's words (a trade's id, say), in place of its position; absent,
2189
+ * the list names it by its position in the order shown (ADR-0470 §3). */
2190
+ readonly rowLabel?: string | undefined;
2191
+ }
2192
+
2193
+ /**
2194
+ * The Consumer's answer to a Find All (ADR-0470 §2): the entries of the range asked and the exact count of the whole
2195
+ * list, which is never an estimate and never capped, read under one Row Sequence Version.
2196
+ */
2197
+ export declare interface GridFindAllPage {
2198
+ /** How many cells match, exactly, over every row in the scope. */
2199
+ readonly total: number;
2200
+ /** The entries from the request's `start`, in walk order: `count` of them, or every one left past `start`. */
2201
+ readonly matches: readonly GridFindAllMatch[];
2202
+ /** The order the rows were read in. Under another than the request's, the grid drops the list as the order
2203
+ * having moved. */
2204
+ readonly rowSequenceVersion: number;
2205
+ }
2206
+
2207
+ /**
2208
+ * A Find All (ADR-0470 §2): what a Find step would look for, over every row, and the range of the list the grid wants
2209
+ * now. The grid asks for the range it shows, a page at a time, under the Row Sequence Version it read the positions
2210
+ * in; the Consumer answers that range and the exact count of the whole list.
2211
+ */
2212
+ export declare interface GridFindAllRequest extends GridFindPattern {
2213
+ /** The selected ranges, when more than one cell is selected, as a Find step's. Absent: every row. */
2214
+ readonly scope?: readonly SelectionRange[] | undefined;
2215
+ /** The visible columns' names in the grid's current order: position `i` here is column `i` of every position in
2216
+ * this request and its answer. */
2217
+ readonly columns: readonly string[];
2218
+ /** The order the positions above were read in (ADR-0011). An answer under another version is discarded, and the
2219
+ * list with it. */
2220
+ readonly rowSequenceVersion: number;
2221
+ /** The first entry of the list wanted, counted from 0 in walk order. */
2222
+ readonly start: number;
2223
+ /** How many entries are wanted from `start`: the answer holds this many, or every one left past `start`. */
2224
+ readonly count: number;
2225
+ }
2226
+
2098
2227
  /**
2099
2228
  * What the find panel's contents are handed (ADR-0055, ADR-0332): what the panel shows and the changes and steps the
2100
2229
  * user makes in it. The core owns the search, the request, the answer and the Focus it moves; the contents draw a
@@ -2130,6 +2259,16 @@ export declare interface GridFindPanelSlotContext {
2130
2259
  readonly replace: () => void;
2131
2260
  /** Replace All, asked of the Consumer. Nothing while Replace is not shown or a Replace All is out. */
2132
2261
  readonly replaceAll: () => void;
2262
+ /** Find All, its list asked of the Consumer and drawn by the core under the contents (ADR-0470). Nothing while Find
2263
+ * All is not offered. */
2264
+ readonly findAll: () => void;
2265
+ /** Find All, its list the contents' own (ADR-0470 §7), as ExSheet's over its Workbook: `list` is asked in the
2266
+ * call's turn among the inputs, and the core draws what it answers under the contents as it draws its own list.
2267
+ * Nothing while the find field is empty. */
2268
+ readonly listFindAll: (list: () => GridFindAllList) => void;
2269
+ /** An option of the contents' own changed what a search means (ADR-0470 §5), as ExSheet's Within does: the list
2270
+ * standing goes, as it goes when the text or one of the core's options changes. */
2271
+ readonly dropFindAll: () => void;
2133
2272
  /** Closes the panel as a Cancel, for a dismissal of the contents' own; the keyboard returns to the grid. */
2134
2273
  readonly close: () => void;
2135
2274
  /** The count of the core's requests for the find field to take the keyboard: the opening, Ctrl+F or Ctrl+H again,
@@ -2539,6 +2678,12 @@ export declare class GridMetrics {
2539
2678
  get nameBoxWidthPx(): number;
2540
2679
  /** The fill handle's side (ADR-0050, item 5): a little under a third of a row, and at least 5px. */
2541
2680
  get fillHandleSizePx(): number;
2681
+ /** The side of a Reference Outline's corner square (ADR-0480): 5px, as Excel draws it, in the Reference's colour
2682
+ * with a 1px margin of the ground, centred on the outline's corner. */
2683
+ get referenceHandleSizePx(): number;
2684
+ /** How wide the strip along a Reference Outline's line is that a press grabs it by (ADR-0480): 5px, centred on
2685
+ * the line, wider than the line so that it can be pressed. */
2686
+ get referenceGripPx(): number;
2542
2687
  /** A cell's horizontal padding on one side; a cell pays it twice. */
2543
2688
  get cellPaddingXPx(): number;
2544
2689
  /** The width of one digit: the unit `####` is counted in (ADR-0016). */
@@ -2696,6 +2841,11 @@ export declare interface GridOptions<Row> extends CellPaintOptions<Row>, Formula
2696
2841
  /** A band across the Focus's row, beneath the Selection's tints (ADR-0008), filled with
2697
2842
  * `--ex-focus-row-fill`. Off unless given. */
2698
2843
  readonly highlightFocusRow?: boolean;
2844
+ /** A band down the Focus's column, beneath the Selection's tints (ADR-0008, 2026-11-03), filled with
2845
+ * `--ex-focus-column-fill`, which is `--ex-focus-row-fill` unless set. It covers the column's cells and not its
2846
+ * header, and with `highlightFocusRow` as well the two cross as Excel's Focus Cell does, the Focus's cell tinted
2847
+ * once. Off unless given. */
2848
+ readonly highlightFocusColumn?: boolean;
2699
2849
  /** A band across the row under the pointer, what every design system's table calls Hover (ADR-0029),
2700
2850
  * filled with `--ex-row-hover-background`. It is the overlay's, so no row learns anything and none is
2701
2851
  * painted again; it goes when the pointer leaves the grid or the rows move under it. Off unless given,
@@ -3018,6 +3168,16 @@ export declare interface GridOptions<Row> extends CellPaintOptions<Row>, Formula
3018
3168
  * earlier. None, and nothing is outlined.
3019
3169
  */
3020
3170
  readonly outlinedColumns?: readonly GridOutlinedColumn[];
3171
+ /**
3172
+ * The text a Reference is rewritten to when its Reference Outline is dragged (ADR-0480): `reference` as it stands
3173
+ * in the editor's text, and the cells it is to name, answered as the Reference naming them written as `reference`
3174
+ * was (`$A$1` moved two columns is `$C$1`). Declared beside `referencesIn`, every outline over this grid's cells
3175
+ * carries grips while an edit is open: its edges, which move the Reference keeping its size, and a square at each
3176
+ * corner, which resizes it from the opposite corner. The text is rewritten each time the range reached changes;
3177
+ * the caret stays where it was, and Escape mid-drag puts the Reference back. A non-string or empty answer is
3178
+ * refused by name. None, and no outline carries a grip.
3179
+ */
3180
+ readonly moveReference?: (reference: string, range: SelectionRange) => string;
3021
3181
  /**
3022
3182
  * Whether, in this text with the caret here, a Reference can go at the caret (ADR-0051): after `=`, an operator,
3023
3183
  * `(` or `,` in a Formula. Asked synchronously on the editor's text and caret as each key or press finds them,
@@ -3712,6 +3872,9 @@ export declare interface GridSource<Row> {
3712
3872
  * this member, and otherwise refuses Find as unavailable. `findStep` is the reference for what a match
3713
3873
  * is. */
3714
3874
  find?(request: GridFindRequest, signal: AbortSignal): Promise<GridFindResult>;
3875
+ /** Answers a page of a Find All (ADR-0470), where this source lists every match: the grid offers Find All only
3876
+ * for a source that has this member beside `find`. `findAll` is the reference for the list and its order. */
3877
+ findAll?(request: GridFindAllRequest, signal: AbortSignal): Promise<GridFindAllPage>;
3715
3878
  /** Answers a Selection Summary (ADR-0130), where this source summarises: the grid asks only a source
3716
3879
  * that has this member, and otherwise shows no figure. `summaryOf` is the reference for what each
3717
3880
  * figure is. */
@@ -4155,6 +4318,13 @@ export declare class InMemoryGridSource<Row> implements GridSource<Row> {
4155
4318
  * discards it by the version, which is the one place that knows.
4156
4319
  */
4157
4320
  find(request: GridFindRequest, signal: AbortSignal): Promise<GridFindResult>;
4321
+ /**
4322
+ * The reference Find All (ADR-0470): `findAll` over the current result, matching each column's displayed text as
4323
+ * `find` does. The matches are found once for a question and read a page at a time while the result stands. A
4324
+ * request read under another version is answered anyway, under this source's: the grid discards it by the
4325
+ * version.
4326
+ */
4327
+ findAll(request: GridFindAllRequest, signal: AbortSignal): Promise<GridFindAllPage>;
4158
4328
  /**
4159
4329
  * The reference Selection Summary (ADR-0130): `summaryOf` over the current result, reading each column's
4160
4330
  * value. A column this source was not told about, or one with no value of its own, is blank. It never
@@ -4222,6 +4392,8 @@ export declare interface InMemorySourceOptions<Row> {
4222
4392
  readonly rowKey?: RowKeyOf<Row>;
4223
4393
  /** The clock live changes are gathered by; the browser's unless given. Read only under a Row Key. */
4224
4394
  readonly clock?: GridClock;
4395
+ /** What a Find All's list calls a row, in place of its position (ADR-0470 §3): a trade's id, say. */
4396
+ readonly findAllRowLabel?: (row: Row) => string;
4225
4397
  }
4226
4398
 
4227
4399
  /** A clock's ticks at an offset of `offsetMinutes` from UTC as the Temporal `Instant` they name, read through its