foldkit-data-grid 0.6.0 → 0.8.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/README.md +219 -1
- package/dist/columns.d.ts +48 -8
- package/dist/columns.d.ts.map +1 -1
- package/dist/columns.js +62 -16
- package/dist/columns.js.map +1 -1
- package/dist/crud.d.ts +10 -1
- package/dist/crud.d.ts.map +1 -1
- package/dist/crud.js.map +1 -1
- package/dist/filter.d.ts +126 -0
- package/dist/filter.d.ts.map +1 -0
- package/dist/filter.js +201 -0
- package/dist/filter.js.map +1 -0
- package/dist/grid.d.ts +629 -12
- package/dist/grid.d.ts.map +1 -1
- package/dist/grid.js +554 -263
- package/dist/grid.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/package.json +7 -7
package/dist/grid.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { RowModel } from "./rows.js";
|
|
|
4
4
|
import { Bundle } from "foldkit-bundle";
|
|
5
5
|
import { GridProjection } from "./projection.js";
|
|
6
6
|
import { ColumnState } from "./columnState.js";
|
|
7
|
+
import { FilterChange, FilterOf, FilterValue, FilterableId, Filters } from "./filter.js";
|
|
7
8
|
import { GridWindow, Viewport } from "./virtual.js";
|
|
8
9
|
/**
|
|
9
10
|
* One grid's interaction state: focus, the viewport and the column state, as
|
|
@@ -23,6 +24,11 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
23
24
|
readonly cellSelection?: boolean;
|
|
24
25
|
}) => {
|
|
25
26
|
id: string;
|
|
27
|
+
filterFor: (column: keyof Specs & string) => Option.Option<CellEditor>;
|
|
28
|
+
Filters: Schema.Codec<Filters<Specs>, unknown, never, never>;
|
|
29
|
+
noFilters: Filters<Specs>;
|
|
30
|
+
setFilter: (filters: Filters<Specs>, change: FilterChange<Specs>) => Filters<Specs>;
|
|
31
|
+
keeps: (filters: Filters<Specs>, read: { readonly [K in FilterableId<Specs>]: (row: Row) => FilterValue<FilterOf<Specs[K]>>; }) => ((row: Row) => boolean);
|
|
26
32
|
matchEdit: <const Handlers extends { readonly [K in EditableId<Specs>]: (edited: {
|
|
27
33
|
readonly row: string;
|
|
28
34
|
readonly value: EditValue<Specs[K]>;
|
|
@@ -59,6 +65,15 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
59
65
|
readonly _tag: "Show";
|
|
60
66
|
readonly column: keyof Specs & string;
|
|
61
67
|
}>;
|
|
68
|
+
Toggle: import("foldkit/schema").TaggedUnion<{
|
|
69
|
+
readonly Press: {};
|
|
70
|
+
readonly Key: {
|
|
71
|
+
drawn: Schema.OptionFromNullOr<Schema.Struct<{
|
|
72
|
+
readonly row: Schema.String;
|
|
73
|
+
readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
74
|
+
}>>;
|
|
75
|
+
};
|
|
76
|
+
}>;
|
|
62
77
|
columns: Columns<Row, Specs>;
|
|
63
78
|
rowSelection: "multiple" | "single" | undefined;
|
|
64
79
|
cellSelection: boolean;
|
|
@@ -276,6 +291,55 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
276
291
|
readonly draft: string;
|
|
277
292
|
readonly error: Option.Option<string>;
|
|
278
293
|
}>;
|
|
294
|
+
readonly filtering: Option.Option<{
|
|
295
|
+
readonly column: keyof Specs & string;
|
|
296
|
+
readonly form: {
|
|
297
|
+
readonly text: string;
|
|
298
|
+
readonly min: string;
|
|
299
|
+
readonly max: string;
|
|
300
|
+
readonly options: readonly string[];
|
|
301
|
+
readonly checked: "any" | "false" | "true";
|
|
302
|
+
readonly from: string;
|
|
303
|
+
readonly to: string;
|
|
304
|
+
};
|
|
305
|
+
readonly reported: Option.Option<{
|
|
306
|
+
readonly _tag: "Contains";
|
|
307
|
+
readonly text: string;
|
|
308
|
+
} | {
|
|
309
|
+
readonly _tag: "Between";
|
|
310
|
+
readonly from: Option.Option<string>;
|
|
311
|
+
readonly to: Option.Option<string>;
|
|
312
|
+
} | {
|
|
313
|
+
readonly _tag: "Is";
|
|
314
|
+
readonly checked: boolean;
|
|
315
|
+
} | {
|
|
316
|
+
readonly _tag: "OneOf";
|
|
317
|
+
readonly options: readonly string[];
|
|
318
|
+
} | {
|
|
319
|
+
readonly _tag: "Range";
|
|
320
|
+
readonly min: Option.Option<number>;
|
|
321
|
+
readonly max: Option.Option<number>;
|
|
322
|
+
}>;
|
|
323
|
+
readonly sent: readonly Option.Option<{
|
|
324
|
+
readonly _tag: "Contains";
|
|
325
|
+
readonly text: string;
|
|
326
|
+
} | {
|
|
327
|
+
readonly _tag: "Between";
|
|
328
|
+
readonly from: Option.Option<string>;
|
|
329
|
+
readonly to: Option.Option<string>;
|
|
330
|
+
} | {
|
|
331
|
+
readonly _tag: "Is";
|
|
332
|
+
readonly checked: boolean;
|
|
333
|
+
} | {
|
|
334
|
+
readonly _tag: "OneOf";
|
|
335
|
+
readonly options: readonly string[];
|
|
336
|
+
} | {
|
|
337
|
+
readonly _tag: "Range";
|
|
338
|
+
readonly min: Option.Option<number>;
|
|
339
|
+
readonly max: Option.Option<number>;
|
|
340
|
+
}>[];
|
|
341
|
+
readonly generation: number;
|
|
342
|
+
}>;
|
|
279
343
|
}, request: {
|
|
280
344
|
readonly from: string;
|
|
281
345
|
readonly to: string;
|
|
@@ -360,19 +424,68 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
360
424
|
readonly draft: string;
|
|
361
425
|
readonly error: Option.Option<string>;
|
|
362
426
|
}>;
|
|
427
|
+
readonly filtering: Option.Option<{
|
|
428
|
+
readonly column: keyof Specs & string;
|
|
429
|
+
readonly form: {
|
|
430
|
+
readonly text: string;
|
|
431
|
+
readonly min: string;
|
|
432
|
+
readonly max: string;
|
|
433
|
+
readonly options: readonly string[];
|
|
434
|
+
readonly checked: "any" | "false" | "true";
|
|
435
|
+
readonly from: string;
|
|
436
|
+
readonly to: string;
|
|
437
|
+
};
|
|
438
|
+
readonly reported: Option.Option<{
|
|
439
|
+
readonly _tag: "Contains";
|
|
440
|
+
readonly text: string;
|
|
441
|
+
} | {
|
|
442
|
+
readonly _tag: "Between";
|
|
443
|
+
readonly from: Option.Option<string>;
|
|
444
|
+
readonly to: Option.Option<string>;
|
|
445
|
+
} | {
|
|
446
|
+
readonly _tag: "Is";
|
|
447
|
+
readonly checked: boolean;
|
|
448
|
+
} | {
|
|
449
|
+
readonly _tag: "OneOf";
|
|
450
|
+
readonly options: readonly string[];
|
|
451
|
+
} | {
|
|
452
|
+
readonly _tag: "Range";
|
|
453
|
+
readonly min: Option.Option<number>;
|
|
454
|
+
readonly max: Option.Option<number>;
|
|
455
|
+
}>;
|
|
456
|
+
readonly sent: readonly Option.Option<{
|
|
457
|
+
readonly _tag: "Contains";
|
|
458
|
+
readonly text: string;
|
|
459
|
+
} | {
|
|
460
|
+
readonly _tag: "Between";
|
|
461
|
+
readonly from: Option.Option<string>;
|
|
462
|
+
readonly to: Option.Option<string>;
|
|
463
|
+
} | {
|
|
464
|
+
readonly _tag: "Is";
|
|
465
|
+
readonly checked: boolean;
|
|
466
|
+
} | {
|
|
467
|
+
readonly _tag: "OneOf";
|
|
468
|
+
readonly options: readonly string[];
|
|
469
|
+
} | {
|
|
470
|
+
readonly _tag: "Range";
|
|
471
|
+
readonly min: Option.Option<number>;
|
|
472
|
+
readonly max: Option.Option<number>;
|
|
473
|
+
}>[];
|
|
474
|
+
readonly generation: number;
|
|
475
|
+
}>;
|
|
363
476
|
};
|
|
364
477
|
draftOf: (projection: GridProjection<Row, keyof Specs & string>, address: {
|
|
365
478
|
readonly row: string;
|
|
366
479
|
readonly column: keyof Specs & string;
|
|
367
480
|
}) => string;
|
|
368
|
-
Out: import("foldkit/schema").TaggedUnion<{
|
|
369
|
-
|
|
481
|
+
Out: [FilterableId<Specs>] extends [never] ? import("foldkit/schema").TaggedUnion<{
|
|
482
|
+
Edited: {
|
|
370
483
|
row: Schema.String;
|
|
371
484
|
column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
372
485
|
text: Schema.String;
|
|
373
486
|
};
|
|
374
487
|
/** The cells their columns accepted, and those they refused, with why. */
|
|
375
|
-
|
|
488
|
+
Pasted: {
|
|
376
489
|
accepted: Schema.$Array<Schema.Struct<{
|
|
377
490
|
readonly row: Schema.String;
|
|
378
491
|
readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
@@ -385,13 +498,13 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
385
498
|
readonly error: Schema.String;
|
|
386
499
|
}>>;
|
|
387
500
|
};
|
|
388
|
-
|
|
389
|
-
|
|
501
|
+
UndoRequested: {};
|
|
502
|
+
RedoRequested: {};
|
|
390
503
|
/**
|
|
391
504
|
* A fill: carry `source` on to `to`. What it writes is worked out from the
|
|
392
505
|
* rows by `fill`, which the application holds.
|
|
393
506
|
*/
|
|
394
|
-
|
|
507
|
+
Filled: {
|
|
395
508
|
readonly source: Schema.Struct<{
|
|
396
509
|
readonly anchor: Schema.Struct<{
|
|
397
510
|
readonly row: Schema.String;
|
|
@@ -412,10 +525,58 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
412
525
|
* rows lie between is worked out from the rows by `extendRows`, which the
|
|
413
526
|
* application holds.
|
|
414
527
|
*/
|
|
528
|
+
RowsRequested: {
|
|
529
|
+
from: Schema.String;
|
|
530
|
+
to: Schema.String;
|
|
531
|
+
};
|
|
532
|
+
}> : import("foldkit/schema").TaggedUnion<{
|
|
533
|
+
readonly Edited: {
|
|
534
|
+
row: Schema.String;
|
|
535
|
+
column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
536
|
+
text: Schema.String;
|
|
537
|
+
};
|
|
538
|
+
readonly Pasted: {
|
|
539
|
+
accepted: Schema.$Array<Schema.Struct<{
|
|
540
|
+
readonly row: Schema.String;
|
|
541
|
+
readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
542
|
+
readonly text: Schema.String;
|
|
543
|
+
}>>;
|
|
544
|
+
refused: Schema.$Array<Schema.Struct<{
|
|
545
|
+
readonly row: Schema.String;
|
|
546
|
+
readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
547
|
+
readonly text: Schema.String;
|
|
548
|
+
readonly error: Schema.String;
|
|
549
|
+
}>>;
|
|
550
|
+
};
|
|
551
|
+
readonly UndoRequested: {};
|
|
552
|
+
readonly RedoRequested: {};
|
|
553
|
+
readonly Filled: {
|
|
554
|
+
readonly source: Schema.Struct<{
|
|
555
|
+
readonly anchor: Schema.Struct<{
|
|
556
|
+
readonly row: Schema.String;
|
|
557
|
+
readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
558
|
+
}>;
|
|
559
|
+
readonly focus: Schema.Struct<{
|
|
560
|
+
readonly row: Schema.String;
|
|
561
|
+
readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
562
|
+
}>;
|
|
563
|
+
}>;
|
|
564
|
+
readonly to: Schema.Struct<{
|
|
565
|
+
readonly row: Schema.String;
|
|
566
|
+
readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
567
|
+
}>;
|
|
568
|
+
};
|
|
415
569
|
readonly RowsRequested: {
|
|
416
570
|
from: Schema.String;
|
|
417
571
|
to: Schema.String;
|
|
418
572
|
};
|
|
573
|
+
/**
|
|
574
|
+
* A column's filter changed, or is none: the application's to store
|
|
575
|
+
* (`setFilter`) and apply (`keeps`, or a query's input).
|
|
576
|
+
*/
|
|
577
|
+
readonly Filtered: {
|
|
578
|
+
change: Schema.Codec<FilterChange<Specs>, unknown, never, never>;
|
|
579
|
+
};
|
|
419
580
|
}>;
|
|
420
581
|
Model: Schema.Struct<{
|
|
421
582
|
readonly focus: Schema.Struct<{
|
|
@@ -515,6 +676,72 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
515
676
|
readonly draft: Schema.String;
|
|
516
677
|
readonly error: Schema.OptionFromNullOr<Schema.String>;
|
|
517
678
|
}>>;
|
|
679
|
+
/**
|
|
680
|
+
* The column whose filter form is open, the form as typed, and the filter
|
|
681
|
+
* last reported (or the application's, when the form opened): a change is
|
|
682
|
+
* reported when the form reads as a valid filter other than this one.
|
|
683
|
+
*/
|
|
684
|
+
readonly filtering: Schema.OptionFromNullOr<Schema.Struct<{
|
|
685
|
+
readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
686
|
+
readonly form: Schema.Struct<{
|
|
687
|
+
readonly text: Schema.String;
|
|
688
|
+
readonly min: Schema.String;
|
|
689
|
+
readonly max: Schema.String;
|
|
690
|
+
readonly options: Schema.$Array<Schema.String>;
|
|
691
|
+
readonly checked: Schema.Literals<readonly ["any", "true", "false"]>;
|
|
692
|
+
readonly from: Schema.String;
|
|
693
|
+
readonly to: Schema.String;
|
|
694
|
+
}>;
|
|
695
|
+
readonly reported: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
|
|
696
|
+
readonly Contains: {
|
|
697
|
+
text: Schema.String;
|
|
698
|
+
};
|
|
699
|
+
readonly Range: {
|
|
700
|
+
min: Schema.OptionFromNullOr<Schema.Finite>;
|
|
701
|
+
max: Schema.OptionFromNullOr<Schema.Finite>;
|
|
702
|
+
};
|
|
703
|
+
readonly OneOf: {
|
|
704
|
+
options: Schema.$Array<Schema.String>;
|
|
705
|
+
};
|
|
706
|
+
readonly Is: {
|
|
707
|
+
checked: Schema.Boolean;
|
|
708
|
+
};
|
|
709
|
+
readonly Between: {
|
|
710
|
+
from: Schema.OptionFromNullOr<Schema.String>;
|
|
711
|
+
to: Schema.OptionFromNullOr<Schema.String>;
|
|
712
|
+
};
|
|
713
|
+
}>>;
|
|
714
|
+
/**
|
|
715
|
+
* Every filter the form opened with or reported since it was last
|
|
716
|
+
* seeded: the application's filter is the form's own echo while it is
|
|
717
|
+
* one of these (see `isEcho`), whenever and however cleaned it lands.
|
|
718
|
+
*/
|
|
719
|
+
readonly sent: Schema.$Array<Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
|
|
720
|
+
readonly Contains: {
|
|
721
|
+
text: Schema.String;
|
|
722
|
+
};
|
|
723
|
+
readonly Range: {
|
|
724
|
+
min: Schema.OptionFromNullOr<Schema.Finite>;
|
|
725
|
+
max: Schema.OptionFromNullOr<Schema.Finite>;
|
|
726
|
+
};
|
|
727
|
+
readonly OneOf: {
|
|
728
|
+
options: Schema.$Array<Schema.String>;
|
|
729
|
+
};
|
|
730
|
+
readonly Is: {
|
|
731
|
+
checked: Schema.Boolean;
|
|
732
|
+
};
|
|
733
|
+
readonly Between: {
|
|
734
|
+
from: Schema.OptionFromNullOr<Schema.String>;
|
|
735
|
+
to: Schema.OptionFromNullOr<Schema.String>;
|
|
736
|
+
};
|
|
737
|
+
}>>>;
|
|
738
|
+
/**
|
|
739
|
+
* Counts the form's reports and reseeds: a stale frame's change reseeds
|
|
740
|
+
* only while it is the one the frame was drawn at, so a second change
|
|
741
|
+
* from that frame adds to the first.
|
|
742
|
+
*/
|
|
743
|
+
readonly generation: Schema.Number;
|
|
744
|
+
}>>;
|
|
518
745
|
}>;
|
|
519
746
|
Message: import("foldkit/message").MessageUnion<{
|
|
520
747
|
/** The pointer or the browser focused a cell. */
|
|
@@ -681,7 +908,33 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
681
908
|
* test resolves them with a Message the runtime sends too.
|
|
682
909
|
*/
|
|
683
910
|
readonly MountStarted: {};
|
|
684
|
-
/**
|
|
911
|
+
/**
|
|
912
|
+
* The checkbox in the cell whose DOM id is `cell`, drawn `checked`, was
|
|
913
|
+
* pressed (`Toggle.Press`), or Space or Enter was pressed on the cell a
|
|
914
|
+
* frame drew as the tab stop (`Toggle.Key`, with the focus that frame was
|
|
915
|
+
* drawn from): the column's text for the other value is committed at once
|
|
916
|
+
* and reported as `Out.Edited`, with no draft. The id comes from the page,
|
|
917
|
+
* so a cell that is not a checkbox of this grid, or a toggle while an edit
|
|
918
|
+
* is open, changes nothing; nor does a key whose frame was drawn before
|
|
919
|
+
* focus moved, which would toggle the cell focus left.
|
|
920
|
+
*/
|
|
921
|
+
readonly EditToggled: {
|
|
922
|
+
cell: Schema.String;
|
|
923
|
+
checked: Schema.Boolean;
|
|
924
|
+
by: import("foldkit/schema").TaggedUnion<{
|
|
925
|
+
readonly Press: {};
|
|
926
|
+
readonly Key: {
|
|
927
|
+
drawn: Schema.OptionFromNullOr<Schema.Struct<{
|
|
928
|
+
readonly row: Schema.String;
|
|
929
|
+
readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
930
|
+
}>>;
|
|
931
|
+
};
|
|
932
|
+
}>;
|
|
933
|
+
};
|
|
934
|
+
/**
|
|
935
|
+
* An edit began on an editable cell, with the text it starts from. A
|
|
936
|
+
* checkbox's cell opens none: it is toggled (`EditToggled`).
|
|
937
|
+
*/
|
|
685
938
|
readonly EditStarted: {
|
|
686
939
|
address: Schema.Struct<{
|
|
687
940
|
readonly row: Schema.String;
|
|
@@ -786,6 +1039,144 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
786
1039
|
readonly FillEnded: {
|
|
787
1040
|
completed: Schema.Boolean;
|
|
788
1041
|
};
|
|
1042
|
+
/**
|
|
1043
|
+
* A column's filter form opened, from its button or Alt+ArrowDown on its
|
|
1044
|
+
* header, seeded with the application's filter as the view `drawn` it.
|
|
1045
|
+
* Focus goes to the header, so closing returns there. A column that does
|
|
1046
|
+
* not filter or is hidden, or a `drawn` its column refuses, opens nothing.
|
|
1047
|
+
*/
|
|
1048
|
+
readonly FilterOpened: {
|
|
1049
|
+
column: Schema.Literals<readonly (keyof Specs & string)[]>;
|
|
1050
|
+
drawn: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
|
|
1051
|
+
readonly Contains: {
|
|
1052
|
+
text: Schema.String;
|
|
1053
|
+
};
|
|
1054
|
+
readonly Range: {
|
|
1055
|
+
min: Schema.OptionFromNullOr<Schema.Finite>;
|
|
1056
|
+
max: Schema.OptionFromNullOr<Schema.Finite>;
|
|
1057
|
+
};
|
|
1058
|
+
readonly OneOf: {
|
|
1059
|
+
options: Schema.$Array<Schema.String>;
|
|
1060
|
+
};
|
|
1061
|
+
readonly Is: {
|
|
1062
|
+
checked: Schema.Boolean;
|
|
1063
|
+
};
|
|
1064
|
+
readonly Between: {
|
|
1065
|
+
from: Schema.OptionFromNullOr<Schema.String>;
|
|
1066
|
+
to: Schema.OptionFromNullOr<Schema.String>;
|
|
1067
|
+
};
|
|
1068
|
+
}>>;
|
|
1069
|
+
};
|
|
1070
|
+
/**
|
|
1071
|
+
* A text field of the open form was typed in. `stale` is set by a frame
|
|
1072
|
+
* drawn after the application's filter changed to one the form never sent
|
|
1073
|
+
* (a saved view, say): the form is seeded again from it first, unless the
|
|
1074
|
+
* form has reported since that frame. A field another kind owns changes nothing.
|
|
1075
|
+
*/
|
|
1076
|
+
readonly FilterTyped: {
|
|
1077
|
+
field: Schema.Literals<readonly ["text", "min", "max", "from", "to"]>;
|
|
1078
|
+
text: Schema.String;
|
|
1079
|
+
stale: Schema.OptionFromNullOr<Schema.Struct<{
|
|
1080
|
+
readonly drawn: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
|
|
1081
|
+
readonly Contains: {
|
|
1082
|
+
text: Schema.String;
|
|
1083
|
+
};
|
|
1084
|
+
readonly Range: {
|
|
1085
|
+
min: Schema.OptionFromNullOr<Schema.Finite>;
|
|
1086
|
+
max: Schema.OptionFromNullOr<Schema.Finite>;
|
|
1087
|
+
};
|
|
1088
|
+
readonly OneOf: {
|
|
1089
|
+
options: Schema.$Array<Schema.String>;
|
|
1090
|
+
};
|
|
1091
|
+
readonly Is: {
|
|
1092
|
+
checked: Schema.Boolean;
|
|
1093
|
+
};
|
|
1094
|
+
readonly Between: {
|
|
1095
|
+
from: Schema.OptionFromNullOr<Schema.String>;
|
|
1096
|
+
to: Schema.OptionFromNullOr<Schema.String>;
|
|
1097
|
+
};
|
|
1098
|
+
}>>;
|
|
1099
|
+
readonly generation: Schema.Number;
|
|
1100
|
+
}>>;
|
|
1101
|
+
};
|
|
1102
|
+
/** A choice's option was ticked or unticked; one the column does not offer changes nothing. */
|
|
1103
|
+
readonly FilterOptionToggled: {
|
|
1104
|
+
option: Schema.String;
|
|
1105
|
+
stale: Schema.OptionFromNullOr<Schema.Struct<{
|
|
1106
|
+
readonly drawn: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
|
|
1107
|
+
readonly Contains: {
|
|
1108
|
+
text: Schema.String;
|
|
1109
|
+
};
|
|
1110
|
+
readonly Range: {
|
|
1111
|
+
min: Schema.OptionFromNullOr<Schema.Finite>;
|
|
1112
|
+
max: Schema.OptionFromNullOr<Schema.Finite>;
|
|
1113
|
+
};
|
|
1114
|
+
readonly OneOf: {
|
|
1115
|
+
options: Schema.$Array<Schema.String>;
|
|
1116
|
+
};
|
|
1117
|
+
readonly Is: {
|
|
1118
|
+
checked: Schema.Boolean;
|
|
1119
|
+
};
|
|
1120
|
+
readonly Between: {
|
|
1121
|
+
from: Schema.OptionFromNullOr<Schema.String>;
|
|
1122
|
+
to: Schema.OptionFromNullOr<Schema.String>;
|
|
1123
|
+
};
|
|
1124
|
+
}>>;
|
|
1125
|
+
readonly generation: Schema.Number;
|
|
1126
|
+
}>>;
|
|
1127
|
+
};
|
|
1128
|
+
/** A checkbox's filter was set: any value, checked, or not. */
|
|
1129
|
+
readonly FilterChecked: {
|
|
1130
|
+
state: Schema.Literals<readonly ["any", "true", "false"]>;
|
|
1131
|
+
stale: Schema.OptionFromNullOr<Schema.Struct<{
|
|
1132
|
+
readonly drawn: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
|
|
1133
|
+
readonly Contains: {
|
|
1134
|
+
text: Schema.String;
|
|
1135
|
+
};
|
|
1136
|
+
readonly Range: {
|
|
1137
|
+
min: Schema.OptionFromNullOr<Schema.Finite>;
|
|
1138
|
+
max: Schema.OptionFromNullOr<Schema.Finite>;
|
|
1139
|
+
};
|
|
1140
|
+
readonly OneOf: {
|
|
1141
|
+
options: Schema.$Array<Schema.String>;
|
|
1142
|
+
};
|
|
1143
|
+
readonly Is: {
|
|
1144
|
+
checked: Schema.Boolean;
|
|
1145
|
+
};
|
|
1146
|
+
readonly Between: {
|
|
1147
|
+
from: Schema.OptionFromNullOr<Schema.String>;
|
|
1148
|
+
to: Schema.OptionFromNullOr<Schema.String>;
|
|
1149
|
+
};
|
|
1150
|
+
}>>;
|
|
1151
|
+
readonly generation: Schema.Number;
|
|
1152
|
+
}>>;
|
|
1153
|
+
};
|
|
1154
|
+
/** The open form was emptied: none is reported if a filter held. */
|
|
1155
|
+
readonly FilterCleared: {
|
|
1156
|
+
stale: Schema.OptionFromNullOr<Schema.Struct<{
|
|
1157
|
+
readonly drawn: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
|
|
1158
|
+
readonly Contains: {
|
|
1159
|
+
text: Schema.String;
|
|
1160
|
+
};
|
|
1161
|
+
readonly Range: {
|
|
1162
|
+
min: Schema.OptionFromNullOr<Schema.Finite>;
|
|
1163
|
+
max: Schema.OptionFromNullOr<Schema.Finite>;
|
|
1164
|
+
};
|
|
1165
|
+
readonly OneOf: {
|
|
1166
|
+
options: Schema.$Array<Schema.String>;
|
|
1167
|
+
};
|
|
1168
|
+
readonly Is: {
|
|
1169
|
+
checked: Schema.Boolean;
|
|
1170
|
+
};
|
|
1171
|
+
readonly Between: {
|
|
1172
|
+
from: Schema.OptionFromNullOr<Schema.String>;
|
|
1173
|
+
to: Schema.OptionFromNullOr<Schema.String>;
|
|
1174
|
+
};
|
|
1175
|
+
}>>;
|
|
1176
|
+
readonly generation: Schema.Number;
|
|
1177
|
+
}>>;
|
|
1178
|
+
};
|
|
1179
|
+
readonly FilterClosed: {};
|
|
789
1180
|
}>;
|
|
790
1181
|
bundle: Bundle.Bundle<"DataGrid", void, {
|
|
791
1182
|
readonly focus: {
|
|
@@ -868,7 +1259,60 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
868
1259
|
readonly draft: string;
|
|
869
1260
|
readonly error: Option.Option<string>;
|
|
870
1261
|
}>;
|
|
1262
|
+
readonly filtering: Option.Option<{
|
|
1263
|
+
readonly column: keyof Specs & string;
|
|
1264
|
+
readonly form: {
|
|
1265
|
+
readonly text: string;
|
|
1266
|
+
readonly min: string;
|
|
1267
|
+
readonly max: string;
|
|
1268
|
+
readonly options: readonly string[];
|
|
1269
|
+
readonly checked: "any" | "false" | "true";
|
|
1270
|
+
readonly from: string;
|
|
1271
|
+
readonly to: string;
|
|
1272
|
+
};
|
|
1273
|
+
readonly reported: Option.Option<{
|
|
1274
|
+
readonly _tag: "Contains";
|
|
1275
|
+
readonly text: string;
|
|
1276
|
+
} | {
|
|
1277
|
+
readonly _tag: "Between";
|
|
1278
|
+
readonly from: Option.Option<string>;
|
|
1279
|
+
readonly to: Option.Option<string>;
|
|
1280
|
+
} | {
|
|
1281
|
+
readonly _tag: "Is";
|
|
1282
|
+
readonly checked: boolean;
|
|
1283
|
+
} | {
|
|
1284
|
+
readonly _tag: "OneOf";
|
|
1285
|
+
readonly options: readonly string[];
|
|
1286
|
+
} | {
|
|
1287
|
+
readonly _tag: "Range";
|
|
1288
|
+
readonly min: Option.Option<number>;
|
|
1289
|
+
readonly max: Option.Option<number>;
|
|
1290
|
+
}>;
|
|
1291
|
+
readonly sent: readonly Option.Option<{
|
|
1292
|
+
readonly _tag: "Contains";
|
|
1293
|
+
readonly text: string;
|
|
1294
|
+
} | {
|
|
1295
|
+
readonly _tag: "Between";
|
|
1296
|
+
readonly from: Option.Option<string>;
|
|
1297
|
+
readonly to: Option.Option<string>;
|
|
1298
|
+
} | {
|
|
1299
|
+
readonly _tag: "Is";
|
|
1300
|
+
readonly checked: boolean;
|
|
1301
|
+
} | {
|
|
1302
|
+
readonly _tag: "OneOf";
|
|
1303
|
+
readonly options: readonly string[];
|
|
1304
|
+
} | {
|
|
1305
|
+
readonly _tag: "Range";
|
|
1306
|
+
readonly min: Option.Option<number>;
|
|
1307
|
+
readonly max: Option.Option<number>;
|
|
1308
|
+
}>[];
|
|
1309
|
+
readonly generation: number;
|
|
1310
|
+
}>;
|
|
871
1311
|
}, {
|
|
1312
|
+
readonly _tag: "RedoRequested";
|
|
1313
|
+
} | {
|
|
1314
|
+
readonly _tag: "UndoRequested";
|
|
1315
|
+
} | {
|
|
872
1316
|
readonly _tag: "AllRowsSelected";
|
|
873
1317
|
} | {
|
|
874
1318
|
readonly _tag: "CellPressed";
|
|
@@ -943,6 +1387,19 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
943
1387
|
} | {
|
|
944
1388
|
readonly _tag: "EditStepped";
|
|
945
1389
|
readonly by: "first" | "last" | "next" | "pageNext" | "pagePrevious" | "previous";
|
|
1390
|
+
} | {
|
|
1391
|
+
readonly _tag: "EditToggled";
|
|
1392
|
+
readonly cell: string;
|
|
1393
|
+
readonly checked: boolean;
|
|
1394
|
+
readonly by: {
|
|
1395
|
+
readonly _tag: "Key";
|
|
1396
|
+
readonly drawn: Option.Option<{
|
|
1397
|
+
readonly row: string;
|
|
1398
|
+
readonly column: keyof Specs & string;
|
|
1399
|
+
}>;
|
|
1400
|
+
} | {
|
|
1401
|
+
readonly _tag: "Press";
|
|
1402
|
+
};
|
|
946
1403
|
} | {
|
|
947
1404
|
readonly _tag: "EditTyped";
|
|
948
1405
|
readonly address: {
|
|
@@ -975,6 +1432,125 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
975
1432
|
};
|
|
976
1433
|
} | {
|
|
977
1434
|
readonly _tag: "FillStarted";
|
|
1435
|
+
} | {
|
|
1436
|
+
readonly _tag: "FilterChecked";
|
|
1437
|
+
readonly state: "any" | "false" | "true";
|
|
1438
|
+
readonly stale: Option.Option<{
|
|
1439
|
+
readonly drawn: Option.Option<{
|
|
1440
|
+
readonly _tag: "Contains";
|
|
1441
|
+
readonly text: string;
|
|
1442
|
+
} | {
|
|
1443
|
+
readonly _tag: "Between";
|
|
1444
|
+
readonly from: Option.Option<string>;
|
|
1445
|
+
readonly to: Option.Option<string>;
|
|
1446
|
+
} | {
|
|
1447
|
+
readonly _tag: "Is";
|
|
1448
|
+
readonly checked: boolean;
|
|
1449
|
+
} | {
|
|
1450
|
+
readonly _tag: "OneOf";
|
|
1451
|
+
readonly options: readonly string[];
|
|
1452
|
+
} | {
|
|
1453
|
+
readonly _tag: "Range";
|
|
1454
|
+
readonly min: Option.Option<number>;
|
|
1455
|
+
readonly max: Option.Option<number>;
|
|
1456
|
+
}>;
|
|
1457
|
+
readonly generation: number;
|
|
1458
|
+
}>;
|
|
1459
|
+
} | {
|
|
1460
|
+
readonly _tag: "FilterCleared";
|
|
1461
|
+
readonly stale: Option.Option<{
|
|
1462
|
+
readonly drawn: Option.Option<{
|
|
1463
|
+
readonly _tag: "Contains";
|
|
1464
|
+
readonly text: string;
|
|
1465
|
+
} | {
|
|
1466
|
+
readonly _tag: "Between";
|
|
1467
|
+
readonly from: Option.Option<string>;
|
|
1468
|
+
readonly to: Option.Option<string>;
|
|
1469
|
+
} | {
|
|
1470
|
+
readonly _tag: "Is";
|
|
1471
|
+
readonly checked: boolean;
|
|
1472
|
+
} | {
|
|
1473
|
+
readonly _tag: "OneOf";
|
|
1474
|
+
readonly options: readonly string[];
|
|
1475
|
+
} | {
|
|
1476
|
+
readonly _tag: "Range";
|
|
1477
|
+
readonly min: Option.Option<number>;
|
|
1478
|
+
readonly max: Option.Option<number>;
|
|
1479
|
+
}>;
|
|
1480
|
+
readonly generation: number;
|
|
1481
|
+
}>;
|
|
1482
|
+
} | {
|
|
1483
|
+
readonly _tag: "FilterClosed";
|
|
1484
|
+
} | {
|
|
1485
|
+
readonly _tag: "FilterOpened";
|
|
1486
|
+
readonly column: keyof Specs & string;
|
|
1487
|
+
readonly drawn: Option.Option<{
|
|
1488
|
+
readonly _tag: "Contains";
|
|
1489
|
+
readonly text: string;
|
|
1490
|
+
} | {
|
|
1491
|
+
readonly _tag: "Between";
|
|
1492
|
+
readonly from: Option.Option<string>;
|
|
1493
|
+
readonly to: Option.Option<string>;
|
|
1494
|
+
} | {
|
|
1495
|
+
readonly _tag: "Is";
|
|
1496
|
+
readonly checked: boolean;
|
|
1497
|
+
} | {
|
|
1498
|
+
readonly _tag: "OneOf";
|
|
1499
|
+
readonly options: readonly string[];
|
|
1500
|
+
} | {
|
|
1501
|
+
readonly _tag: "Range";
|
|
1502
|
+
readonly min: Option.Option<number>;
|
|
1503
|
+
readonly max: Option.Option<number>;
|
|
1504
|
+
}>;
|
|
1505
|
+
} | {
|
|
1506
|
+
readonly _tag: "FilterOptionToggled";
|
|
1507
|
+
readonly option: string;
|
|
1508
|
+
readonly stale: Option.Option<{
|
|
1509
|
+
readonly drawn: Option.Option<{
|
|
1510
|
+
readonly _tag: "Contains";
|
|
1511
|
+
readonly text: string;
|
|
1512
|
+
} | {
|
|
1513
|
+
readonly _tag: "Between";
|
|
1514
|
+
readonly from: Option.Option<string>;
|
|
1515
|
+
readonly to: Option.Option<string>;
|
|
1516
|
+
} | {
|
|
1517
|
+
readonly _tag: "Is";
|
|
1518
|
+
readonly checked: boolean;
|
|
1519
|
+
} | {
|
|
1520
|
+
readonly _tag: "OneOf";
|
|
1521
|
+
readonly options: readonly string[];
|
|
1522
|
+
} | {
|
|
1523
|
+
readonly _tag: "Range";
|
|
1524
|
+
readonly min: Option.Option<number>;
|
|
1525
|
+
readonly max: Option.Option<number>;
|
|
1526
|
+
}>;
|
|
1527
|
+
readonly generation: number;
|
|
1528
|
+
}>;
|
|
1529
|
+
} | {
|
|
1530
|
+
readonly _tag: "FilterTyped";
|
|
1531
|
+
readonly field: "from" | "max" | "min" | "text" | "to";
|
|
1532
|
+
readonly text: string;
|
|
1533
|
+
readonly stale: Option.Option<{
|
|
1534
|
+
readonly drawn: Option.Option<{
|
|
1535
|
+
readonly _tag: "Contains";
|
|
1536
|
+
readonly text: string;
|
|
1537
|
+
} | {
|
|
1538
|
+
readonly _tag: "Between";
|
|
1539
|
+
readonly from: Option.Option<string>;
|
|
1540
|
+
readonly to: Option.Option<string>;
|
|
1541
|
+
} | {
|
|
1542
|
+
readonly _tag: "Is";
|
|
1543
|
+
readonly checked: boolean;
|
|
1544
|
+
} | {
|
|
1545
|
+
readonly _tag: "OneOf";
|
|
1546
|
+
readonly options: readonly string[];
|
|
1547
|
+
} | {
|
|
1548
|
+
readonly _tag: "Range";
|
|
1549
|
+
readonly min: Option.Option<number>;
|
|
1550
|
+
readonly max: Option.Option<number>;
|
|
1551
|
+
}>;
|
|
1552
|
+
readonly generation: number;
|
|
1553
|
+
}>;
|
|
978
1554
|
} | {
|
|
979
1555
|
readonly _tag: "Focused";
|
|
980
1556
|
readonly address: {
|
|
@@ -1025,8 +1601,6 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
1025
1601
|
readonly text: string;
|
|
1026
1602
|
readonly from: string;
|
|
1027
1603
|
}[];
|
|
1028
|
-
} | {
|
|
1029
|
-
readonly _tag: "RedoRequested";
|
|
1030
1604
|
} | {
|
|
1031
1605
|
readonly _tag: "ResizeEnded";
|
|
1032
1606
|
readonly completed: boolean;
|
|
@@ -1049,13 +1623,49 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
1049
1623
|
readonly _tag: "RowsExtended";
|
|
1050
1624
|
readonly rows: readonly string[];
|
|
1051
1625
|
readonly to: string;
|
|
1626
|
+
}, [FilterableId<Specs>] extends [never] ? {
|
|
1627
|
+
readonly _tag: "Edited";
|
|
1628
|
+
readonly row: string;
|
|
1629
|
+
readonly column: keyof Specs & string;
|
|
1630
|
+
readonly text: string;
|
|
1631
|
+
} | {
|
|
1632
|
+
readonly _tag: "Filled";
|
|
1633
|
+
readonly source: {
|
|
1634
|
+
readonly anchor: {
|
|
1635
|
+
readonly row: string;
|
|
1636
|
+
readonly column: keyof Specs & string;
|
|
1637
|
+
};
|
|
1638
|
+
readonly focus: {
|
|
1639
|
+
readonly row: string;
|
|
1640
|
+
readonly column: keyof Specs & string;
|
|
1641
|
+
};
|
|
1642
|
+
};
|
|
1643
|
+
readonly to: {
|
|
1644
|
+
readonly row: string;
|
|
1645
|
+
readonly column: keyof Specs & string;
|
|
1646
|
+
};
|
|
1647
|
+
} | {
|
|
1648
|
+
readonly _tag: "Pasted";
|
|
1649
|
+
readonly accepted: readonly {
|
|
1650
|
+
readonly row: string;
|
|
1651
|
+
readonly column: keyof Specs & string;
|
|
1652
|
+
readonly text: string;
|
|
1653
|
+
}[];
|
|
1654
|
+
readonly refused: readonly {
|
|
1655
|
+
readonly row: string;
|
|
1656
|
+
readonly column: keyof Specs & string;
|
|
1657
|
+
readonly text: string;
|
|
1658
|
+
readonly error: string;
|
|
1659
|
+
}[];
|
|
1052
1660
|
} | {
|
|
1053
|
-
readonly _tag: "UndoRequested";
|
|
1054
|
-
}, {
|
|
1055
1661
|
readonly _tag: "RedoRequested";
|
|
1056
1662
|
} | {
|
|
1057
|
-
readonly _tag: "
|
|
1663
|
+
readonly _tag: "RowsRequested";
|
|
1664
|
+
readonly from: string;
|
|
1665
|
+
readonly to: string;
|
|
1058
1666
|
} | {
|
|
1667
|
+
readonly _tag: "UndoRequested";
|
|
1668
|
+
} : {
|
|
1059
1669
|
readonly _tag: "Edited";
|
|
1060
1670
|
readonly row: string;
|
|
1061
1671
|
readonly column: keyof Specs & string;
|
|
@@ -1076,6 +1686,9 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
1076
1686
|
readonly row: string;
|
|
1077
1687
|
readonly column: keyof Specs & string;
|
|
1078
1688
|
};
|
|
1689
|
+
} | {
|
|
1690
|
+
readonly _tag: "Filtered";
|
|
1691
|
+
readonly change: FilterChange<Specs>;
|
|
1079
1692
|
} | {
|
|
1080
1693
|
readonly _tag: "Pasted";
|
|
1081
1694
|
readonly accepted: readonly {
|
|
@@ -1089,10 +1702,14 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
|
|
|
1089
1702
|
readonly text: string;
|
|
1090
1703
|
readonly error: string;
|
|
1091
1704
|
}[];
|
|
1705
|
+
} | {
|
|
1706
|
+
readonly _tag: "RedoRequested";
|
|
1092
1707
|
} | {
|
|
1093
1708
|
readonly _tag: "RowsRequested";
|
|
1094
1709
|
readonly from: string;
|
|
1095
1710
|
readonly to: string;
|
|
1711
|
+
} | {
|
|
1712
|
+
readonly _tag: "UndoRequested";
|
|
1096
1713
|
}, never, never, import("foldkit-bundle").NoView, {}, {}>;
|
|
1097
1714
|
};
|
|
1098
1715
|
export declare const DataGrid: {
|