foldkit-data-grid 0.7.0 → 0.9.0

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/grid.d.ts CHANGED
@@ -6,6 +6,7 @@ import { GridProjection } from "./projection.js";
6
6
  import { ColumnState } from "./columnState.js";
7
7
  import { FilterChange, FilterOf, FilterValue, FilterableId, Filters } from "./filter.js";
8
8
  import { GridWindow, Viewport } from "./virtual.js";
9
+ import * as Update from "foldkit/update";
9
10
  /**
10
11
  * One grid's interaction state: focus, the viewport and the column state, as
11
12
  * one Bundle. Its update is the parts' own, joined: a key that moves focus
@@ -27,6 +28,8 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
27
28
  filterFor: (column: keyof Specs & string) => Option.Option<CellEditor>;
28
29
  Filters: Schema.Codec<Filters<Specs>, unknown, never, never>;
29
30
  noFilters: Filters<Specs>;
31
+ filterCount: (filters: Filters<Specs>) => number;
32
+ hasFilters: (filters: Filters<Specs>) => boolean;
30
33
  setFilter: (filters: Filters<Specs>, change: FilterChange<Specs>) => Filters<Specs>;
31
34
  keeps: (filters: Filters<Specs>, read: { readonly [K in FilterableId<Specs>]: (row: Row) => FilterValue<FilterOf<Specs[K]>>; }) => ((row: Row) => boolean);
32
35
  matchEdit: <const Handlers extends { readonly [K in EditableId<Specs>]: (edited: {
@@ -170,6 +173,141 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
170
173
  readonly columns?: number;
171
174
  };
172
175
  }) => GridWindow<keyof Specs & string>;
176
+ rangeSize: (rows: RowModel<Row>, model: {
177
+ readonly focus: {
178
+ readonly current: Option.Option<{
179
+ readonly row: string;
180
+ readonly column: keyof Specs & string;
181
+ }>;
182
+ readonly header: Option.Option<keyof Specs & string>;
183
+ };
184
+ readonly viewport: {
185
+ readonly top: number;
186
+ readonly left: number;
187
+ readonly width: number;
188
+ readonly height: number;
189
+ };
190
+ readonly columns: {
191
+ readonly start: readonly (keyof Specs & string)[];
192
+ readonly center: readonly (keyof Specs & string)[];
193
+ readonly end: readonly (keyof Specs & string)[];
194
+ readonly hidden: readonly (keyof Specs & string)[];
195
+ readonly widths: readonly {
196
+ readonly column: keyof Specs & string;
197
+ readonly width: number;
198
+ }[];
199
+ };
200
+ readonly resizing: Option.Option<{
201
+ readonly column: keyof Specs & string;
202
+ readonly from: number;
203
+ }>;
204
+ readonly dragging: Option.Option<{
205
+ readonly column: keyof Specs & string;
206
+ readonly delta: number;
207
+ }>;
208
+ readonly menu: Option.Option<{
209
+ readonly column: keyof Specs & string;
210
+ readonly active: number;
211
+ }>;
212
+ readonly filling: Option.Option<{
213
+ readonly source: {
214
+ readonly anchor: {
215
+ readonly row: string;
216
+ readonly column: keyof Specs & string;
217
+ };
218
+ readonly focus: {
219
+ readonly row: string;
220
+ readonly column: keyof Specs & string;
221
+ };
222
+ };
223
+ readonly to: {
224
+ readonly row: string;
225
+ readonly column: keyof Specs & string;
226
+ };
227
+ }>;
228
+ readonly selection: {
229
+ readonly rows: {
230
+ readonly _tag: "AllExcept";
231
+ readonly except: readonly string[];
232
+ } | {
233
+ readonly _tag: "Keys";
234
+ readonly keys: readonly string[];
235
+ };
236
+ readonly anchor: Option.Option<string>;
237
+ readonly cells: Option.Option<{
238
+ readonly anchor: {
239
+ readonly row: string;
240
+ readonly column: keyof Specs & string;
241
+ };
242
+ readonly focus: {
243
+ readonly row: string;
244
+ readonly column: keyof Specs & string;
245
+ };
246
+ }>;
247
+ };
248
+ readonly editing: Option.Option<{
249
+ readonly address: {
250
+ readonly row: string;
251
+ readonly column: keyof Specs & string;
252
+ };
253
+ readonly from: string;
254
+ readonly draft: string;
255
+ readonly error: Option.Option<string>;
256
+ }>;
257
+ readonly filtering: Option.Option<{
258
+ readonly column: keyof Specs & string;
259
+ readonly form: {
260
+ readonly text: string;
261
+ readonly min: string;
262
+ readonly max: string;
263
+ readonly options: readonly string[];
264
+ readonly checked: "any" | "false" | "true";
265
+ readonly from: string;
266
+ readonly to: string;
267
+ };
268
+ readonly reported: Option.Option<{
269
+ readonly _tag: "Between";
270
+ readonly from: Option.Option<string>;
271
+ readonly to: Option.Option<string>;
272
+ } | {
273
+ readonly _tag: "Contains";
274
+ readonly text: string;
275
+ } | {
276
+ readonly _tag: "Is";
277
+ readonly checked: boolean;
278
+ } | {
279
+ readonly _tag: "OneOf";
280
+ readonly options: readonly string[];
281
+ } | {
282
+ readonly _tag: "Range";
283
+ readonly min: Option.Option<number>;
284
+ readonly max: Option.Option<number>;
285
+ }>;
286
+ readonly sent: readonly Option.Option<{
287
+ readonly _tag: "Between";
288
+ readonly from: Option.Option<string>;
289
+ readonly to: Option.Option<string>;
290
+ } | {
291
+ readonly _tag: "Contains";
292
+ readonly text: string;
293
+ } | {
294
+ readonly _tag: "Is";
295
+ readonly checked: boolean;
296
+ } | {
297
+ readonly _tag: "OneOf";
298
+ readonly options: readonly string[];
299
+ } | {
300
+ readonly _tag: "Range";
301
+ readonly min: Option.Option<number>;
302
+ readonly max: Option.Option<number>;
303
+ }>[];
304
+ readonly generation: number;
305
+ }>;
306
+ }) => Option.Option<{
307
+ rows: number;
308
+ columns: number;
309
+ cells: number;
310
+ }>;
173
311
  fill: (rows: RowModel<Row>, state: {
174
312
  readonly columns: {
175
313
  readonly start: readonly (keyof Specs & string)[];
@@ -303,12 +441,30 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
303
441
  readonly to: string;
304
442
  };
305
443
  readonly reported: Option.Option<{
444
+ readonly _tag: "Between";
445
+ readonly from: Option.Option<string>;
446
+ readonly to: Option.Option<string>;
447
+ } | {
306
448
  readonly _tag: "Contains";
307
449
  readonly text: string;
308
450
  } | {
451
+ readonly _tag: "Is";
452
+ readonly checked: boolean;
453
+ } | {
454
+ readonly _tag: "OneOf";
455
+ readonly options: readonly string[];
456
+ } | {
457
+ readonly _tag: "Range";
458
+ readonly min: Option.Option<number>;
459
+ readonly max: Option.Option<number>;
460
+ }>;
461
+ readonly sent: readonly Option.Option<{
309
462
  readonly _tag: "Between";
310
463
  readonly from: Option.Option<string>;
311
464
  readonly to: Option.Option<string>;
465
+ } | {
466
+ readonly _tag: "Contains";
467
+ readonly text: string;
312
468
  } | {
313
469
  readonly _tag: "Is";
314
470
  readonly checked: boolean;
@@ -319,7 +475,7 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
319
475
  readonly _tag: "Range";
320
476
  readonly min: Option.Option<number>;
321
477
  readonly max: Option.Option<number>;
322
- }>;
478
+ }>[];
323
479
  readonly generation: number;
324
480
  }>;
325
481
  }, request: {
@@ -418,12 +574,30 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
418
574
  readonly to: string;
419
575
  };
420
576
  readonly reported: Option.Option<{
577
+ readonly _tag: "Between";
578
+ readonly from: Option.Option<string>;
579
+ readonly to: Option.Option<string>;
580
+ } | {
421
581
  readonly _tag: "Contains";
422
582
  readonly text: string;
423
583
  } | {
584
+ readonly _tag: "Is";
585
+ readonly checked: boolean;
586
+ } | {
587
+ readonly _tag: "OneOf";
588
+ readonly options: readonly string[];
589
+ } | {
590
+ readonly _tag: "Range";
591
+ readonly min: Option.Option<number>;
592
+ readonly max: Option.Option<number>;
593
+ }>;
594
+ readonly sent: readonly Option.Option<{
424
595
  readonly _tag: "Between";
425
596
  readonly from: Option.Option<string>;
426
597
  readonly to: Option.Option<string>;
598
+ } | {
599
+ readonly _tag: "Contains";
600
+ readonly text: string;
427
601
  } | {
428
602
  readonly _tag: "Is";
429
603
  readonly checked: boolean;
@@ -434,7 +608,7 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
434
608
  readonly _tag: "Range";
435
609
  readonly min: Option.Option<number>;
436
610
  readonly max: Option.Option<number>;
437
- }>;
611
+ }>[];
438
612
  readonly generation: number;
439
613
  }>;
440
614
  };
@@ -462,6 +636,11 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
462
636
  readonly error: Schema.String;
463
637
  }>>;
464
638
  };
639
+ /** A copy of `rows` by `columns` cells, whose text is already on the clipboard. */
640
+ Copied: {
641
+ rows: Schema.Number;
642
+ columns: Schema.Number;
643
+ };
465
644
  UndoRequested: {};
466
645
  RedoRequested: {};
467
646
  /**
@@ -512,6 +691,10 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
512
691
  readonly error: Schema.String;
513
692
  }>>;
514
693
  };
694
+ readonly Copied: {
695
+ rows: Schema.Number;
696
+ columns: Schema.Number;
697
+ };
515
698
  readonly UndoRequested: {};
516
699
  readonly RedoRequested: {};
517
700
  readonly Filled: {
@@ -675,6 +858,30 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
675
858
  to: Schema.OptionFromNullOr<Schema.String>;
676
859
  };
677
860
  }>>;
861
+ /**
862
+ * Every filter the form opened with or reported since it was last
863
+ * seeded: the application's filter is the form's own echo while it is
864
+ * one of these (see `isEcho`), whenever and however cleaned it lands.
865
+ */
866
+ readonly sent: Schema.$Array<Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
867
+ readonly Contains: {
868
+ text: Schema.String;
869
+ };
870
+ readonly Range: {
871
+ min: Schema.OptionFromNullOr<Schema.Finite>;
872
+ max: Schema.OptionFromNullOr<Schema.Finite>;
873
+ };
874
+ readonly OneOf: {
875
+ options: Schema.$Array<Schema.String>;
876
+ };
877
+ readonly Is: {
878
+ checked: Schema.Boolean;
879
+ };
880
+ readonly Between: {
881
+ from: Schema.OptionFromNullOr<Schema.String>;
882
+ to: Schema.OptionFromNullOr<Schema.String>;
883
+ };
884
+ }>>>;
678
885
  /**
679
886
  * Counts the form's reports and reseeds: a stale frame's change reseeds
680
887
  * only while it is the one the frame was drawn at, so a second change
@@ -946,6 +1153,11 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
946
1153
  readonly from: Schema.String;
947
1154
  }>>;
948
1155
  };
1156
+ /** The view's copy wrote the text of a box of `rows` by `columns` cells to the clipboard. */
1157
+ readonly Copied: {
1158
+ rows: Schema.Number;
1159
+ columns: Schema.Number;
1160
+ };
949
1161
  /**
950
1162
  * Ctrl or Meta with Z on the grid, or with Shift (or Ctrl+Y) for redo.
951
1163
  * An open edit keeps them, since the editor's own undo is the field's.
@@ -1009,9 +1221,9 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1009
1221
  };
1010
1222
  /**
1011
1223
  * A text field of the open form was typed in. `stale` is set by a frame
1012
- * drawn after the application's filter changed from outside the form:
1013
- * the form is seeded again from it first, unless the form has reported
1014
- * since that frame. A field another kind owns changes nothing.
1224
+ * drawn after the application's filter changed to one the form never sent
1225
+ * (a saved view, say): the form is seeded again from it first, unless the
1226
+ * form has reported since that frame. A field another kind owns changes nothing.
1015
1227
  */
1016
1228
  readonly FilterTyped: {
1017
1229
  field: Schema.Literals<readonly ["text", "min", "max", "from", "to"]>;
@@ -1211,12 +1423,30 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1211
1423
  readonly to: string;
1212
1424
  };
1213
1425
  readonly reported: Option.Option<{
1426
+ readonly _tag: "Between";
1427
+ readonly from: Option.Option<string>;
1428
+ readonly to: Option.Option<string>;
1429
+ } | {
1214
1430
  readonly _tag: "Contains";
1215
1431
  readonly text: string;
1216
1432
  } | {
1433
+ readonly _tag: "Is";
1434
+ readonly checked: boolean;
1435
+ } | {
1436
+ readonly _tag: "OneOf";
1437
+ readonly options: readonly string[];
1438
+ } | {
1439
+ readonly _tag: "Range";
1440
+ readonly min: Option.Option<number>;
1441
+ readonly max: Option.Option<number>;
1442
+ }>;
1443
+ readonly sent: readonly Option.Option<{
1217
1444
  readonly _tag: "Between";
1218
1445
  readonly from: Option.Option<string>;
1219
1446
  readonly to: Option.Option<string>;
1447
+ } | {
1448
+ readonly _tag: "Contains";
1449
+ readonly text: string;
1220
1450
  } | {
1221
1451
  readonly _tag: "Is";
1222
1452
  readonly checked: boolean;
@@ -1227,7 +1457,7 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1227
1457
  readonly _tag: "Range";
1228
1458
  readonly min: Option.Option<number>;
1229
1459
  readonly max: Option.Option<number>;
1230
- }>;
1460
+ }>[];
1231
1461
  readonly generation: number;
1232
1462
  }>;
1233
1463
  }, {
@@ -1281,6 +1511,10 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1281
1511
  } | {
1282
1512
  readonly _tag: "ColumnShown";
1283
1513
  readonly column: keyof Specs & string;
1514
+ } | {
1515
+ readonly _tag: "Copied";
1516
+ readonly rows: number;
1517
+ readonly columns: number;
1284
1518
  } | {
1285
1519
  readonly _tag: "EditCancelled";
1286
1520
  } | {
@@ -1359,12 +1593,12 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1359
1593
  readonly state: "any" | "false" | "true";
1360
1594
  readonly stale: Option.Option<{
1361
1595
  readonly drawn: Option.Option<{
1362
- readonly _tag: "Contains";
1363
- readonly text: string;
1364
- } | {
1365
1596
  readonly _tag: "Between";
1366
1597
  readonly from: Option.Option<string>;
1367
1598
  readonly to: Option.Option<string>;
1599
+ } | {
1600
+ readonly _tag: "Contains";
1601
+ readonly text: string;
1368
1602
  } | {
1369
1603
  readonly _tag: "Is";
1370
1604
  readonly checked: boolean;
@@ -1382,12 +1616,12 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1382
1616
  readonly _tag: "FilterCleared";
1383
1617
  readonly stale: Option.Option<{
1384
1618
  readonly drawn: Option.Option<{
1385
- readonly _tag: "Contains";
1386
- readonly text: string;
1387
- } | {
1388
1619
  readonly _tag: "Between";
1389
1620
  readonly from: Option.Option<string>;
1390
1621
  readonly to: Option.Option<string>;
1622
+ } | {
1623
+ readonly _tag: "Contains";
1624
+ readonly text: string;
1391
1625
  } | {
1392
1626
  readonly _tag: "Is";
1393
1627
  readonly checked: boolean;
@@ -1407,12 +1641,12 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1407
1641
  readonly _tag: "FilterOpened";
1408
1642
  readonly column: keyof Specs & string;
1409
1643
  readonly drawn: Option.Option<{
1410
- readonly _tag: "Contains";
1411
- readonly text: string;
1412
- } | {
1413
1644
  readonly _tag: "Between";
1414
1645
  readonly from: Option.Option<string>;
1415
1646
  readonly to: Option.Option<string>;
1647
+ } | {
1648
+ readonly _tag: "Contains";
1649
+ readonly text: string;
1416
1650
  } | {
1417
1651
  readonly _tag: "Is";
1418
1652
  readonly checked: boolean;
@@ -1429,12 +1663,12 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1429
1663
  readonly option: string;
1430
1664
  readonly stale: Option.Option<{
1431
1665
  readonly drawn: Option.Option<{
1432
- readonly _tag: "Contains";
1433
- readonly text: string;
1434
- } | {
1435
1666
  readonly _tag: "Between";
1436
1667
  readonly from: Option.Option<string>;
1437
1668
  readonly to: Option.Option<string>;
1669
+ } | {
1670
+ readonly _tag: "Contains";
1671
+ readonly text: string;
1438
1672
  } | {
1439
1673
  readonly _tag: "Is";
1440
1674
  readonly checked: boolean;
@@ -1454,12 +1688,12 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1454
1688
  readonly text: string;
1455
1689
  readonly stale: Option.Option<{
1456
1690
  readonly drawn: Option.Option<{
1457
- readonly _tag: "Contains";
1458
- readonly text: string;
1459
- } | {
1460
1691
  readonly _tag: "Between";
1461
1692
  readonly from: Option.Option<string>;
1462
1693
  readonly to: Option.Option<string>;
1694
+ } | {
1695
+ readonly _tag: "Contains";
1696
+ readonly text: string;
1463
1697
  } | {
1464
1698
  readonly _tag: "Is";
1465
1699
  readonly checked: boolean;
@@ -1546,6 +1780,10 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1546
1780
  readonly rows: readonly string[];
1547
1781
  readonly to: string;
1548
1782
  }, [FilterableId<Specs>] extends [never] ? {
1783
+ readonly _tag: "Copied";
1784
+ readonly rows: number;
1785
+ readonly columns: number;
1786
+ } | {
1549
1787
  readonly _tag: "Edited";
1550
1788
  readonly row: string;
1551
1789
  readonly column: keyof Specs & string;
@@ -1588,6 +1826,10 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1588
1826
  } | {
1589
1827
  readonly _tag: "UndoRequested";
1590
1828
  } : {
1829
+ readonly _tag: "Copied";
1830
+ readonly rows: number;
1831
+ readonly columns: number;
1832
+ } | {
1591
1833
  readonly _tag: "Edited";
1592
1834
  readonly row: string;
1593
1835
  readonly column: keyof Specs & string;
@@ -1632,7 +1874,688 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1632
1874
  readonly to: string;
1633
1875
  } | {
1634
1876
  readonly _tag: "UndoRequested";
1635
- }, never, never, import("foldkit-bundle").NoView, {}, {}>;
1877
+ }, never, never, import("foldkit-bundle").NoView, {}, {
1878
+ reveal: (model: {
1879
+ readonly focus: {
1880
+ readonly current: Option.Option<{
1881
+ readonly row: string;
1882
+ readonly column: keyof Specs & string;
1883
+ }>;
1884
+ readonly header: Option.Option<keyof Specs & string>;
1885
+ };
1886
+ readonly viewport: {
1887
+ readonly top: number;
1888
+ readonly left: number;
1889
+ readonly width: number;
1890
+ readonly height: number;
1891
+ };
1892
+ readonly columns: {
1893
+ readonly start: readonly (keyof Specs & string)[];
1894
+ readonly center: readonly (keyof Specs & string)[];
1895
+ readonly end: readonly (keyof Specs & string)[];
1896
+ readonly hidden: readonly (keyof Specs & string)[];
1897
+ readonly widths: readonly {
1898
+ readonly column: keyof Specs & string;
1899
+ readonly width: number;
1900
+ }[];
1901
+ };
1902
+ readonly resizing: Option.Option<{
1903
+ readonly column: keyof Specs & string;
1904
+ readonly from: number;
1905
+ }>;
1906
+ readonly dragging: Option.Option<{
1907
+ readonly column: keyof Specs & string;
1908
+ readonly delta: number;
1909
+ }>;
1910
+ readonly menu: Option.Option<{
1911
+ readonly column: keyof Specs & string;
1912
+ readonly active: number;
1913
+ }>;
1914
+ readonly filling: Option.Option<{
1915
+ readonly source: {
1916
+ readonly anchor: {
1917
+ readonly row: string;
1918
+ readonly column: keyof Specs & string;
1919
+ };
1920
+ readonly focus: {
1921
+ readonly row: string;
1922
+ readonly column: keyof Specs & string;
1923
+ };
1924
+ };
1925
+ readonly to: {
1926
+ readonly row: string;
1927
+ readonly column: keyof Specs & string;
1928
+ };
1929
+ }>;
1930
+ readonly selection: {
1931
+ readonly rows: {
1932
+ readonly _tag: "AllExcept";
1933
+ readonly except: readonly string[];
1934
+ } | {
1935
+ readonly _tag: "Keys";
1936
+ readonly keys: readonly string[];
1937
+ };
1938
+ readonly anchor: Option.Option<string>;
1939
+ readonly cells: Option.Option<{
1940
+ readonly anchor: {
1941
+ readonly row: string;
1942
+ readonly column: keyof Specs & string;
1943
+ };
1944
+ readonly focus: {
1945
+ readonly row: string;
1946
+ readonly column: keyof Specs & string;
1947
+ };
1948
+ }>;
1949
+ };
1950
+ readonly editing: Option.Option<{
1951
+ readonly address: {
1952
+ readonly row: string;
1953
+ readonly column: keyof Specs & string;
1954
+ };
1955
+ readonly from: string;
1956
+ readonly draft: string;
1957
+ readonly error: Option.Option<string>;
1958
+ }>;
1959
+ readonly filtering: Option.Option<{
1960
+ readonly column: keyof Specs & string;
1961
+ readonly form: {
1962
+ readonly text: string;
1963
+ readonly min: string;
1964
+ readonly max: string;
1965
+ readonly options: readonly string[];
1966
+ readonly checked: "any" | "false" | "true";
1967
+ readonly from: string;
1968
+ readonly to: string;
1969
+ };
1970
+ readonly reported: Option.Option<{
1971
+ readonly _tag: "Between";
1972
+ readonly from: Option.Option<string>;
1973
+ readonly to: Option.Option<string>;
1974
+ } | {
1975
+ readonly _tag: "Contains";
1976
+ readonly text: string;
1977
+ } | {
1978
+ readonly _tag: "Is";
1979
+ readonly checked: boolean;
1980
+ } | {
1981
+ readonly _tag: "OneOf";
1982
+ readonly options: readonly string[];
1983
+ } | {
1984
+ readonly _tag: "Range";
1985
+ readonly min: Option.Option<number>;
1986
+ readonly max: Option.Option<number>;
1987
+ }>;
1988
+ readonly sent: readonly Option.Option<{
1989
+ readonly _tag: "Between";
1990
+ readonly from: Option.Option<string>;
1991
+ readonly to: Option.Option<string>;
1992
+ } | {
1993
+ readonly _tag: "Contains";
1994
+ readonly text: string;
1995
+ } | {
1996
+ readonly _tag: "Is";
1997
+ readonly checked: boolean;
1998
+ } | {
1999
+ readonly _tag: "OneOf";
2000
+ readonly options: readonly string[];
2001
+ } | {
2002
+ readonly _tag: "Range";
2003
+ readonly min: Option.Option<number>;
2004
+ readonly max: Option.Option<number>;
2005
+ }>[];
2006
+ readonly generation: number;
2007
+ }>;
2008
+ }, rows: RowModel<Row>, target: {
2009
+ readonly row: number;
2010
+ readonly column?: keyof Specs & string;
2011
+ readonly rowHeight: number;
2012
+ readonly headerHeight: number;
2013
+ }) => Update.ReturnWithOutMessage<{
2014
+ readonly focus: {
2015
+ readonly current: Option.Option<{
2016
+ readonly row: string;
2017
+ readonly column: keyof Specs & string;
2018
+ }>;
2019
+ readonly header: Option.Option<keyof Specs & string>;
2020
+ };
2021
+ readonly viewport: {
2022
+ readonly top: number;
2023
+ readonly left: number;
2024
+ readonly width: number;
2025
+ readonly height: number;
2026
+ };
2027
+ readonly columns: {
2028
+ readonly start: readonly (keyof Specs & string)[];
2029
+ readonly center: readonly (keyof Specs & string)[];
2030
+ readonly end: readonly (keyof Specs & string)[];
2031
+ readonly hidden: readonly (keyof Specs & string)[];
2032
+ readonly widths: readonly {
2033
+ readonly column: keyof Specs & string;
2034
+ readonly width: number;
2035
+ }[];
2036
+ };
2037
+ readonly resizing: Option.Option<{
2038
+ readonly column: keyof Specs & string;
2039
+ readonly from: number;
2040
+ }>;
2041
+ readonly dragging: Option.Option<{
2042
+ readonly column: keyof Specs & string;
2043
+ readonly delta: number;
2044
+ }>;
2045
+ readonly menu: Option.Option<{
2046
+ readonly column: keyof Specs & string;
2047
+ readonly active: number;
2048
+ }>;
2049
+ readonly filling: Option.Option<{
2050
+ readonly source: {
2051
+ readonly anchor: {
2052
+ readonly row: string;
2053
+ readonly column: keyof Specs & string;
2054
+ };
2055
+ readonly focus: {
2056
+ readonly row: string;
2057
+ readonly column: keyof Specs & string;
2058
+ };
2059
+ };
2060
+ readonly to: {
2061
+ readonly row: string;
2062
+ readonly column: keyof Specs & string;
2063
+ };
2064
+ }>;
2065
+ readonly selection: {
2066
+ readonly rows: {
2067
+ readonly _tag: "AllExcept";
2068
+ readonly except: readonly string[];
2069
+ } | {
2070
+ readonly _tag: "Keys";
2071
+ readonly keys: readonly string[];
2072
+ };
2073
+ readonly anchor: Option.Option<string>;
2074
+ readonly cells: Option.Option<{
2075
+ readonly anchor: {
2076
+ readonly row: string;
2077
+ readonly column: keyof Specs & string;
2078
+ };
2079
+ readonly focus: {
2080
+ readonly row: string;
2081
+ readonly column: keyof Specs & string;
2082
+ };
2083
+ }>;
2084
+ };
2085
+ readonly editing: Option.Option<{
2086
+ readonly address: {
2087
+ readonly row: string;
2088
+ readonly column: keyof Specs & string;
2089
+ };
2090
+ readonly from: string;
2091
+ readonly draft: string;
2092
+ readonly error: Option.Option<string>;
2093
+ }>;
2094
+ readonly filtering: Option.Option<{
2095
+ readonly column: keyof Specs & string;
2096
+ readonly form: {
2097
+ readonly text: string;
2098
+ readonly min: string;
2099
+ readonly max: string;
2100
+ readonly options: readonly string[];
2101
+ readonly checked: "any" | "false" | "true";
2102
+ readonly from: string;
2103
+ readonly to: string;
2104
+ };
2105
+ readonly reported: Option.Option<{
2106
+ readonly _tag: "Between";
2107
+ readonly from: Option.Option<string>;
2108
+ readonly to: Option.Option<string>;
2109
+ } | {
2110
+ readonly _tag: "Contains";
2111
+ readonly text: string;
2112
+ } | {
2113
+ readonly _tag: "Is";
2114
+ readonly checked: boolean;
2115
+ } | {
2116
+ readonly _tag: "OneOf";
2117
+ readonly options: readonly string[];
2118
+ } | {
2119
+ readonly _tag: "Range";
2120
+ readonly min: Option.Option<number>;
2121
+ readonly max: Option.Option<number>;
2122
+ }>;
2123
+ readonly sent: readonly Option.Option<{
2124
+ readonly _tag: "Between";
2125
+ readonly from: Option.Option<string>;
2126
+ readonly to: Option.Option<string>;
2127
+ } | {
2128
+ readonly _tag: "Contains";
2129
+ readonly text: string;
2130
+ } | {
2131
+ readonly _tag: "Is";
2132
+ readonly checked: boolean;
2133
+ } | {
2134
+ readonly _tag: "OneOf";
2135
+ readonly options: readonly string[];
2136
+ } | {
2137
+ readonly _tag: "Range";
2138
+ readonly min: Option.Option<number>;
2139
+ readonly max: Option.Option<number>;
2140
+ }>[];
2141
+ readonly generation: number;
2142
+ }>;
2143
+ }, {
2144
+ readonly _tag: "RedoRequested";
2145
+ } | {
2146
+ readonly _tag: "UndoRequested";
2147
+ } | {
2148
+ readonly _tag: "AllRowsSelected";
2149
+ } | {
2150
+ readonly _tag: "CellPressed";
2151
+ readonly cell: string;
2152
+ readonly shiftKey: boolean;
2153
+ readonly toggleKey: boolean;
2154
+ } | {
2155
+ readonly _tag: "CellsCleared";
2156
+ } | {
2157
+ readonly _tag: "CellsSelected";
2158
+ readonly anchor: {
2159
+ readonly row: string;
2160
+ readonly column: keyof Specs & string;
2161
+ };
2162
+ readonly focus: {
2163
+ readonly row: string;
2164
+ readonly column: keyof Specs & string;
2165
+ };
2166
+ readonly reveal: Option.Option<{
2167
+ readonly top: number;
2168
+ readonly left: number;
2169
+ }>;
2170
+ } | {
2171
+ readonly _tag: "ColumnDragEnded";
2172
+ readonly completed: boolean;
2173
+ } | {
2174
+ readonly _tag: "ColumnDragStarted";
2175
+ readonly header: string;
2176
+ } | {
2177
+ readonly _tag: "ColumnDragged";
2178
+ readonly delta: number;
2179
+ } | {
2180
+ readonly _tag: "ColumnHidden";
2181
+ readonly column: keyof Specs & string;
2182
+ } | {
2183
+ readonly _tag: "ColumnMoved";
2184
+ readonly column: keyof Specs & string;
2185
+ readonly region: "center" | "end" | "start";
2186
+ readonly index: number;
2187
+ } | {
2188
+ readonly _tag: "ColumnResized";
2189
+ readonly column: keyof Specs & string;
2190
+ readonly width: number;
2191
+ } | {
2192
+ readonly _tag: "ColumnShown";
2193
+ readonly column: keyof Specs & string;
2194
+ } | {
2195
+ readonly _tag: "Copied";
2196
+ readonly rows: number;
2197
+ readonly columns: number;
2198
+ } | {
2199
+ readonly _tag: "EditCancelled";
2200
+ } | {
2201
+ readonly _tag: "EditChanged";
2202
+ readonly draft: string;
2203
+ } | {
2204
+ readonly _tag: "EditChosen";
2205
+ readonly draft: string;
2206
+ } | {
2207
+ readonly _tag: "EditCommitted";
2208
+ readonly next: Option.Option<{
2209
+ readonly row: string;
2210
+ readonly column: keyof Specs & string;
2211
+ }>;
2212
+ readonly reveal: Option.Option<{
2213
+ readonly top: number;
2214
+ readonly left: number;
2215
+ }>;
2216
+ } | {
2217
+ readonly _tag: "EditStarted";
2218
+ readonly address: {
2219
+ readonly row: string;
2220
+ readonly column: keyof Specs & string;
2221
+ };
2222
+ readonly draft: string;
2223
+ } | {
2224
+ readonly _tag: "EditStepped";
2225
+ readonly by: "first" | "last" | "next" | "pageNext" | "pagePrevious" | "previous";
2226
+ } | {
2227
+ readonly _tag: "EditToggled";
2228
+ readonly cell: string;
2229
+ readonly checked: boolean;
2230
+ readonly by: {
2231
+ readonly _tag: "Key";
2232
+ readonly drawn: Option.Option<{
2233
+ readonly row: string;
2234
+ readonly column: keyof Specs & string;
2235
+ }>;
2236
+ } | {
2237
+ readonly _tag: "Press";
2238
+ };
2239
+ } | {
2240
+ readonly _tag: "EditTyped";
2241
+ readonly address: {
2242
+ readonly row: string;
2243
+ readonly column: keyof Specs & string;
2244
+ };
2245
+ readonly text: string;
2246
+ readonly from: string;
2247
+ } | {
2248
+ readonly _tag: "FillDragged";
2249
+ readonly cell: string;
2250
+ } | {
2251
+ readonly _tag: "FillEnded";
2252
+ readonly completed: boolean;
2253
+ } | {
2254
+ readonly _tag: "FillRequested";
2255
+ readonly source: {
2256
+ readonly anchor: {
2257
+ readonly row: string;
2258
+ readonly column: keyof Specs & string;
2259
+ };
2260
+ readonly focus: {
2261
+ readonly row: string;
2262
+ readonly column: keyof Specs & string;
2263
+ };
2264
+ };
2265
+ readonly to: {
2266
+ readonly row: string;
2267
+ readonly column: keyof Specs & string;
2268
+ };
2269
+ } | {
2270
+ readonly _tag: "FillStarted";
2271
+ } | {
2272
+ readonly _tag: "FilterChecked";
2273
+ readonly state: "any" | "false" | "true";
2274
+ readonly stale: Option.Option<{
2275
+ readonly drawn: Option.Option<{
2276
+ readonly _tag: "Between";
2277
+ readonly from: Option.Option<string>;
2278
+ readonly to: Option.Option<string>;
2279
+ } | {
2280
+ readonly _tag: "Contains";
2281
+ readonly text: string;
2282
+ } | {
2283
+ readonly _tag: "Is";
2284
+ readonly checked: boolean;
2285
+ } | {
2286
+ readonly _tag: "OneOf";
2287
+ readonly options: readonly string[];
2288
+ } | {
2289
+ readonly _tag: "Range";
2290
+ readonly min: Option.Option<number>;
2291
+ readonly max: Option.Option<number>;
2292
+ }>;
2293
+ readonly generation: number;
2294
+ }>;
2295
+ } | {
2296
+ readonly _tag: "FilterCleared";
2297
+ readonly stale: Option.Option<{
2298
+ readonly drawn: Option.Option<{
2299
+ readonly _tag: "Between";
2300
+ readonly from: Option.Option<string>;
2301
+ readonly to: Option.Option<string>;
2302
+ } | {
2303
+ readonly _tag: "Contains";
2304
+ readonly text: string;
2305
+ } | {
2306
+ readonly _tag: "Is";
2307
+ readonly checked: boolean;
2308
+ } | {
2309
+ readonly _tag: "OneOf";
2310
+ readonly options: readonly string[];
2311
+ } | {
2312
+ readonly _tag: "Range";
2313
+ readonly min: Option.Option<number>;
2314
+ readonly max: Option.Option<number>;
2315
+ }>;
2316
+ readonly generation: number;
2317
+ }>;
2318
+ } | {
2319
+ readonly _tag: "FilterClosed";
2320
+ } | {
2321
+ readonly _tag: "FilterOpened";
2322
+ readonly column: keyof Specs & string;
2323
+ readonly drawn: Option.Option<{
2324
+ readonly _tag: "Between";
2325
+ readonly from: Option.Option<string>;
2326
+ readonly to: Option.Option<string>;
2327
+ } | {
2328
+ readonly _tag: "Contains";
2329
+ readonly text: string;
2330
+ } | {
2331
+ readonly _tag: "Is";
2332
+ readonly checked: boolean;
2333
+ } | {
2334
+ readonly _tag: "OneOf";
2335
+ readonly options: readonly string[];
2336
+ } | {
2337
+ readonly _tag: "Range";
2338
+ readonly min: Option.Option<number>;
2339
+ readonly max: Option.Option<number>;
2340
+ }>;
2341
+ } | {
2342
+ readonly _tag: "FilterOptionToggled";
2343
+ readonly option: string;
2344
+ readonly stale: Option.Option<{
2345
+ readonly drawn: Option.Option<{
2346
+ readonly _tag: "Between";
2347
+ readonly from: Option.Option<string>;
2348
+ readonly to: Option.Option<string>;
2349
+ } | {
2350
+ readonly _tag: "Contains";
2351
+ readonly text: string;
2352
+ } | {
2353
+ readonly _tag: "Is";
2354
+ readonly checked: boolean;
2355
+ } | {
2356
+ readonly _tag: "OneOf";
2357
+ readonly options: readonly string[];
2358
+ } | {
2359
+ readonly _tag: "Range";
2360
+ readonly min: Option.Option<number>;
2361
+ readonly max: Option.Option<number>;
2362
+ }>;
2363
+ readonly generation: number;
2364
+ }>;
2365
+ } | {
2366
+ readonly _tag: "FilterTyped";
2367
+ readonly field: "from" | "max" | "min" | "text" | "to";
2368
+ readonly text: string;
2369
+ readonly stale: Option.Option<{
2370
+ readonly drawn: Option.Option<{
2371
+ readonly _tag: "Between";
2372
+ readonly from: Option.Option<string>;
2373
+ readonly to: Option.Option<string>;
2374
+ } | {
2375
+ readonly _tag: "Contains";
2376
+ readonly text: string;
2377
+ } | {
2378
+ readonly _tag: "Is";
2379
+ readonly checked: boolean;
2380
+ } | {
2381
+ readonly _tag: "OneOf";
2382
+ readonly options: readonly string[];
2383
+ } | {
2384
+ readonly _tag: "Range";
2385
+ readonly min: Option.Option<number>;
2386
+ readonly max: Option.Option<number>;
2387
+ }>;
2388
+ readonly generation: number;
2389
+ }>;
2390
+ } | {
2391
+ readonly _tag: "Focused";
2392
+ readonly address: {
2393
+ readonly row: string;
2394
+ readonly column: keyof Specs & string;
2395
+ };
2396
+ } | {
2397
+ readonly _tag: "HeaderFocused";
2398
+ readonly column: keyof Specs & string;
2399
+ readonly reveal: Option.Option<{
2400
+ readonly top: number;
2401
+ readonly left: number;
2402
+ }>;
2403
+ } | {
2404
+ readonly _tag: "Measured";
2405
+ readonly top: number;
2406
+ readonly left: number;
2407
+ readonly width: number;
2408
+ readonly height: number;
2409
+ } | {
2410
+ readonly _tag: "MenuChosen";
2411
+ readonly index: number;
2412
+ } | {
2413
+ readonly _tag: "MenuClosed";
2414
+ } | {
2415
+ readonly _tag: "MenuMoved";
2416
+ readonly active: number;
2417
+ } | {
2418
+ readonly _tag: "MenuOpened";
2419
+ readonly column: keyof Specs & string;
2420
+ } | {
2421
+ readonly _tag: "MountStarted";
2422
+ } | {
2423
+ readonly _tag: "Moved";
2424
+ readonly address: {
2425
+ readonly row: string;
2426
+ readonly column: keyof Specs & string;
2427
+ };
2428
+ readonly reveal: Option.Option<{
2429
+ readonly top: number;
2430
+ readonly left: number;
2431
+ }>;
2432
+ } | {
2433
+ readonly _tag: "Pasted";
2434
+ readonly cells: readonly {
2435
+ readonly row: string;
2436
+ readonly column: keyof Specs & string;
2437
+ readonly text: string;
2438
+ readonly from: string;
2439
+ }[];
2440
+ } | {
2441
+ readonly _tag: "ResizeEnded";
2442
+ readonly completed: boolean;
2443
+ } | {
2444
+ readonly _tag: "ResizeMoved";
2445
+ readonly delta: number;
2446
+ } | {
2447
+ readonly _tag: "ResizeStarted";
2448
+ readonly header: string;
2449
+ } | {
2450
+ readonly _tag: "Revealed";
2451
+ readonly top: number;
2452
+ readonly left: number;
2453
+ } | {
2454
+ readonly _tag: "RowSelected";
2455
+ readonly row: string;
2456
+ } | {
2457
+ readonly _tag: "RowsCleared";
2458
+ } | {
2459
+ readonly _tag: "RowsExtended";
2460
+ readonly rows: readonly string[];
2461
+ readonly to: string;
2462
+ }, [FilterableId<Specs>] extends [never] ? {
2463
+ readonly _tag: "Copied";
2464
+ readonly rows: number;
2465
+ readonly columns: number;
2466
+ } | {
2467
+ readonly _tag: "Edited";
2468
+ readonly row: string;
2469
+ readonly column: keyof Specs & string;
2470
+ readonly text: string;
2471
+ } | {
2472
+ readonly _tag: "Filled";
2473
+ readonly source: {
2474
+ readonly anchor: {
2475
+ readonly row: string;
2476
+ readonly column: keyof Specs & string;
2477
+ };
2478
+ readonly focus: {
2479
+ readonly row: string;
2480
+ readonly column: keyof Specs & string;
2481
+ };
2482
+ };
2483
+ readonly to: {
2484
+ readonly row: string;
2485
+ readonly column: keyof Specs & string;
2486
+ };
2487
+ } | {
2488
+ readonly _tag: "Pasted";
2489
+ readonly accepted: readonly {
2490
+ readonly row: string;
2491
+ readonly column: keyof Specs & string;
2492
+ readonly text: string;
2493
+ }[];
2494
+ readonly refused: readonly {
2495
+ readonly row: string;
2496
+ readonly column: keyof Specs & string;
2497
+ readonly text: string;
2498
+ readonly error: string;
2499
+ }[];
2500
+ } | {
2501
+ readonly _tag: "RedoRequested";
2502
+ } | {
2503
+ readonly _tag: "RowsRequested";
2504
+ readonly from: string;
2505
+ readonly to: string;
2506
+ } | {
2507
+ readonly _tag: "UndoRequested";
2508
+ } : {
2509
+ readonly _tag: "Copied";
2510
+ readonly rows: number;
2511
+ readonly columns: number;
2512
+ } | {
2513
+ readonly _tag: "Edited";
2514
+ readonly row: string;
2515
+ readonly column: keyof Specs & string;
2516
+ readonly text: string;
2517
+ } | {
2518
+ readonly _tag: "Filled";
2519
+ readonly source: {
2520
+ readonly anchor: {
2521
+ readonly row: string;
2522
+ readonly column: keyof Specs & string;
2523
+ };
2524
+ readonly focus: {
2525
+ readonly row: string;
2526
+ readonly column: keyof Specs & string;
2527
+ };
2528
+ };
2529
+ readonly to: {
2530
+ readonly row: string;
2531
+ readonly column: keyof Specs & string;
2532
+ };
2533
+ } | {
2534
+ readonly _tag: "Filtered";
2535
+ readonly change: FilterChange<Specs>;
2536
+ } | {
2537
+ readonly _tag: "Pasted";
2538
+ readonly accepted: readonly {
2539
+ readonly row: string;
2540
+ readonly column: keyof Specs & string;
2541
+ readonly text: string;
2542
+ }[];
2543
+ readonly refused: readonly {
2544
+ readonly row: string;
2545
+ readonly column: keyof Specs & string;
2546
+ readonly text: string;
2547
+ readonly error: string;
2548
+ }[];
2549
+ } | {
2550
+ readonly _tag: "RedoRequested";
2551
+ } | {
2552
+ readonly _tag: "RowsRequested";
2553
+ readonly from: string;
2554
+ readonly to: string;
2555
+ } | {
2556
+ readonly _tag: "UndoRequested";
2557
+ }, never>;
2558
+ }>;
1636
2559
  };
1637
2560
  export declare const DataGrid: {
1638
2561
  make: typeof make;