tinybase 8.3.0 → 8.4.0-beta.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.
Files changed (39) hide show
  1. package/@types/ui-react-dom/index.d.ts +10 -10
  2. package/@types/ui-react-dom/with-schemas/index.d.ts +10 -10
  3. package/@types/ui-react-inspector/index.d.ts +1 -1
  4. package/@types/ui-react-inspector/with-schemas/index.d.ts +1 -1
  5. package/@types/ui-solid-dom/index.d.ts +2013 -0
  6. package/@types/ui-solid-dom/with-schemas/index.d.ts +2064 -0
  7. package/@types/ui-solid-inspector/index.d.ts +73 -0
  8. package/@types/ui-solid-inspector/with-schemas/index.d.ts +73 -0
  9. package/@types/ui-svelte-dom/index.d.ts +10 -10
  10. package/@types/ui-svelte-dom/with-schemas/index.d.ts +10 -10
  11. package/@types/ui-svelte-inspector/index.d.ts +1 -1
  12. package/@types/ui-svelte-inspector/with-schemas/index.d.ts +1 -1
  13. package/min/ui-solid/index.js +1 -1
  14. package/min/ui-solid/index.js.gz +0 -0
  15. package/min/ui-solid/with-schemas/index.js +1 -1
  16. package/min/ui-solid/with-schemas/index.js.gz +0 -0
  17. package/min/ui-solid-dom/index.js +1 -0
  18. package/min/ui-solid-dom/index.js.gz +0 -0
  19. package/min/ui-solid-dom/with-schemas/index.js +1 -0
  20. package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
  21. package/min/ui-solid-inspector/index.js +1 -0
  22. package/min/ui-solid-inspector/index.js.gz +0 -0
  23. package/min/ui-solid-inspector/with-schemas/index.js +1 -0
  24. package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
  25. package/min/ui-svelte-inspector/index.js +1 -1
  26. package/min/ui-svelte-inspector/index.js.gz +0 -0
  27. package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
  28. package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
  29. package/package.json +73 -1
  30. package/readme.md +14 -14
  31. package/releases.md +98 -62
  32. package/ui-solid/index.js +208 -104
  33. package/ui-solid/with-schemas/index.js +208 -104
  34. package/ui-solid-dom/index.js +1575 -0
  35. package/ui-solid-dom/with-schemas/index.js +1575 -0
  36. package/ui-solid-inspector/index.js +5621 -0
  37. package/ui-solid-inspector/with-schemas/index.js +5621 -0
  38. package/ui-svelte-inspector/index.js +6 -2
  39. package/ui-svelte-inspector/with-schemas/index.js +6 -2
@@ -0,0 +1,2064 @@
1
+ /**
2
+ * The ui-solid-dom module of the TinyBase project provides components to make
3
+ * it easy to create web-based reactive apps with Store objects.
4
+ *
5
+ * The components in this module use the Solid DOM module and so are not
6
+ * appropriate for environments like Solid Native (although those in the
7
+ * lower-level ui-solid module are).
8
+ * @see UI Components (Solid) demos
9
+ * @packageDocumentation
10
+ * @module ui-solid-dom
11
+ * @since v8.4.0
12
+ */
13
+ import type {Component} from 'solid-js';
14
+ import type {
15
+ CellIdFromSchema,
16
+ TableIdFromSchema,
17
+ } from '../../_internal/store/with-schemas/index.d.ts';
18
+ import type {
19
+ CellProps,
20
+ CellPropsForTableIdAndCellId,
21
+ ComponentReturnType,
22
+ ExtraProps,
23
+ ResultCellProps,
24
+ RowProps,
25
+ ValueProps,
26
+ } from '../../_internal/ui-solid/with-schemas/index.d.ts';
27
+ import type {
28
+ IndexesOrIndexesId,
29
+ QueriesOrQueriesId,
30
+ RelationshipsOrRelationshipsId,
31
+ StoreOrStoreId,
32
+ } from '../../_internal/ui/with-schemas/index.d.ts';
33
+ import type {Id, Ids} from '../../common/with-schemas/index.d.ts';
34
+ import type {NoSchemas} from '../../store/index.d.ts';
35
+ import type {OptionalSchemas} from '../../store/with-schemas/index.d.ts';
36
+
37
+ /**
38
+ * The CustomCell object is used to configure custom cell rendering in an HTML
39
+ * table.
40
+ * @category Configuration
41
+ * @since v8.4.0
42
+ */
43
+ export type CustomCell<
44
+ Schemas extends OptionalSchemas,
45
+ TableId extends TableIdFromSchema<Schemas[0]>,
46
+ CellId extends CellIdFromSchema<Schemas[0], TableId>,
47
+ > = {
48
+ /**
49
+ * An optional string that will be used as the label at the top of the table
50
+ * column for this Cell.
51
+ * @category Prop
52
+ * @since v8.4.0
53
+ */
54
+ label?: string;
55
+ /**
56
+ * An optional custom component for rendering each Cell in the Table (to
57
+ * override the default CellView component).
58
+ * @category Prop
59
+ * @since v8.4.0
60
+ */
61
+ component?: Component<CellPropsForTableIdAndCellId<Schemas, TableId, CellId>>;
62
+ /**
63
+ * An optional function for generating extra props for each custom Cell
64
+ * component based on Row and Cell Id.
65
+ * @category Prop
66
+ * @since v8.4.0
67
+ */
68
+ getComponentProps?: (rowId: Id, cellId: CellId) => ExtraProps;
69
+ };
70
+
71
+ /**
72
+ * The CustomResultCell object is used to configure custom cell rendering for
73
+ * query results in an HTML table.
74
+ * @category Configuration
75
+ * @since v8.4.0
76
+ */
77
+ export type CustomResultCell<Schemas extends OptionalSchemas> = {
78
+ /**
79
+ * An optional string that will be used as the label at the top of the table
80
+ * column for this Cell.
81
+ * @category Prop
82
+ * @since v8.4.0
83
+ */
84
+ label?: string;
85
+ /**
86
+ * An optional custom component for rendering each Cell in the ResultTable (to
87
+ * override the default ResultCellView component).
88
+ * @category Prop
89
+ * @since v8.4.0
90
+ */
91
+ component?: Component<ResultCellProps<Schemas>>;
92
+ /**
93
+ * An optional function for generating extra props for each custom Cell
94
+ * component based on Row and Cell Id.
95
+ * @category Prop
96
+ * @since v8.4.0
97
+ */
98
+ getComponentProps?: (rowId: Id, cellId: Id) => ExtraProps;
99
+ };
100
+
101
+ /**
102
+ * The ExtraRowCell object is used to configure the rendering of extra cells in
103
+ * an HTML table that's displaying a ResultTable or Table - before or after the
104
+ * regular data cells.
105
+ * @category Configuration
106
+ * @since v8.4.0
107
+ */
108
+ export type ExtraRowCell<
109
+ Schemas extends OptionalSchemas,
110
+ TableId extends TableIdFromSchema<Schemas[0]>,
111
+ > = {
112
+ /**
113
+ * A string that will be used as the label at the top of the column for this
114
+ * Cell.
115
+ * @category Prop
116
+ * @since v8.4.0
117
+ */
118
+ label: string;
119
+ /**
120
+ * A custom component for rendering each extra Cell in the table, and which
121
+ * will be passed props for the Row with which it is placed.
122
+ * @category Prop
123
+ * @since v8.4.0
124
+ */
125
+ component: Component<RowProps<Schemas, TableId>>;
126
+ };
127
+
128
+ /**
129
+ * The ExtraValueCell object is used to configure the rendering of extra cells
130
+ * in an HTML table that's displaying Values - before or after the regular data
131
+ * cells.
132
+ * @category Configuration
133
+ * @since v8.4.0
134
+ */
135
+ export type ExtraValueCell<Schemas extends OptionalSchemas> = {
136
+ /**
137
+ * A string that will be used as the label at the top of the column for this
138
+ * Cell.
139
+ * @category Prop
140
+ * @since v8.4.0
141
+ */
142
+ label: string;
143
+ /**
144
+ * A custom component for rendering each extra Cell in the table, and which
145
+ * will be passed props for the Value with which it is placed.
146
+ * @category Prop
147
+ * @since v8.4.0
148
+ */
149
+ component: Component<ValueProps<Schemas>>;
150
+ };
151
+
152
+ /**
153
+ * HtmlTableProps props are used for components that will render in an HTML
154
+ * table, such as the TableInHtmlTable component or SortedTableInHtmlTable
155
+ * component.
156
+ * @category Props
157
+ * @since v8.4.0
158
+ */
159
+ export type HtmlTableProps = {
160
+ /**
161
+ * A string className to use on the root of the resulting element.
162
+ * @category Prop
163
+ * @since v8.4.0
164
+ */
165
+ readonly className?: string;
166
+ /**
167
+ * Whether a header row should be rendered at the top of the table, defaulting
168
+ * to `true`.
169
+ * @category Prop
170
+ * @since v8.4.0
171
+ */
172
+ readonly headerRow?: boolean;
173
+ /**
174
+ * Whether an Id column should be rendered on the left of the table,
175
+ * defaulting to `true`.
176
+ * @category Prop
177
+ * @since v8.4.0
178
+ */
179
+ readonly idColumn?: boolean;
180
+ };
181
+
182
+ /**
183
+ * TableInHtmlTableProps props are used for components that will render a Table
184
+ * in an HTML table, such as the TableInHtmlTable component.
185
+ * @category Props
186
+ * @since v8.4.0
187
+ */
188
+ export type TableInHtmlTableProps<
189
+ Schemas extends OptionalSchemas,
190
+ TableIds extends TableIdFromSchema<Schemas[0]> = TableIdFromSchema<
191
+ Schemas[0]
192
+ >,
193
+ > = TableIds extends infer TableId
194
+ ? TableId extends TableIdFromSchema<Schemas[0]>
195
+ ? {
196
+ /**
197
+ * The Id of the Table in the Store to be rendered.
198
+ * @category Prop
199
+ * @since v8.4.0
200
+ */
201
+ readonly tableId: TableId;
202
+ /**
203
+ * The Store to be accessed: omit for the default context Store, provide an Id
204
+ * for a named context Store, or provide an explicit reference.
205
+ * @category Prop
206
+ * @since v8.4.0
207
+ */
208
+ readonly store?: StoreOrStoreId<Schemas>;
209
+ /**
210
+ * Whether the Cells should be editable. This affects the default CellView
211
+ * component (to use the EditableCellView component instead) but of course
212
+ * will not affect custom Cell components if you have set them.
213
+ * @category Prop
214
+ * @since v8.4.0
215
+ */
216
+ readonly editable?: boolean;
217
+ /**
218
+ * An optional list of Cell Ids to use for rendering a prescribed set of the
219
+ * Table's Cells in a given order. This can also be an object with the desired
220
+ * Cell Ids as keys, and with a value that can either be a string label to
221
+ * show in the column header, or a CustomCell object to further configure the
222
+ * column.
223
+ * @category Prop
224
+ * @since v8.4.0
225
+ */
226
+ readonly customCells?:
227
+ | CellIdFromSchema<Schemas[0], TableId>[]
228
+ | {
229
+ [CellId in CellIdFromSchema<Schemas[0], TableId>]?:
230
+ | string
231
+ | CustomCell<Schemas, TableId, CellId>;
232
+ };
233
+ }
234
+ : never
235
+ : never;
236
+
237
+ /**
238
+ * SortedTableInHtmlTableProps props are used for components that will render a
239
+ * sorted Table in an HTML table, such as the SortedTableInHtmlTable component.
240
+ * @category Props
241
+ * @since v8.4.0
242
+ */
243
+ export type SortedTableInHtmlTableProps<
244
+ Schemas extends OptionalSchemas,
245
+ TableIds extends TableIdFromSchema<Schemas[0]> = TableIdFromSchema<
246
+ Schemas[0]
247
+ >,
248
+ > = TableIds extends infer TableId
249
+ ? TableId extends TableIdFromSchema<Schemas[0]>
250
+ ? {
251
+ /**
252
+ * The Id of the Table in the Store to be rendered.
253
+ * @category Prop
254
+ * @since v8.4.0
255
+ */
256
+ readonly tableId: TableId;
257
+ /**
258
+ * The Id of the Cell whose values are used for the sorting. If omitted, the
259
+ * view will sort the Row Id itself.
260
+ * @category Prop
261
+ * @since v8.4.0
262
+ */
263
+ readonly cellId?: CellIdFromSchema<Schemas[0], TableId>;
264
+ /**
265
+ * Whether the sorting should be in descending order.
266
+ * @category Prop
267
+ * @since v8.4.0
268
+ */
269
+ readonly descending?: boolean;
270
+ /**
271
+ * The number of Row Ids to skip for pagination purposes.
272
+ * @category Prop
273
+ * @since v8.4.0
274
+ */
275
+ readonly offset?: number;
276
+ /**
277
+ * The maximum number of Row Ids to return.
278
+ * @category Prop
279
+ * @since v8.4.0
280
+ */
281
+ readonly limit?: number;
282
+ /**
283
+ * The Store to be accessed: omit for the default context Store, provide an Id
284
+ * for a named context Store, or provide an explicit reference.
285
+ * @category Prop
286
+ * @since v8.4.0
287
+ */
288
+ readonly store?: StoreOrStoreId<Schemas>;
289
+ /**
290
+ * Whether the Cells should be editable. This affects the default CellView
291
+ * component (to use the EditableCellView component instead) but of course
292
+ * will not affect custom Cell components if you have set them.
293
+ * @category Prop
294
+ * @since v8.4.0
295
+ */
296
+ readonly editable?: boolean;
297
+ /**
298
+ * An optional list of Cell Ids to use for rendering a prescribed set of the
299
+ * Table's Cells in a given order. This can also be an object with the desired
300
+ * Cell Ids as keys, and with a value that can either be a string label to
301
+ * show in the column header, or a CustomCell object to further configure the
302
+ * column.
303
+ * @category Prop
304
+ * @since v8.4.0
305
+ */
306
+ readonly customCells?:
307
+ | CellIdFromSchema<Schemas[0], TableId>[]
308
+ | {
309
+ [CellId in CellIdFromSchema<Schemas[0], TableId>]?:
310
+ | string
311
+ | CustomCell<Schemas, TableId, CellId>;
312
+ };
313
+ /**
314
+ * Whether the table should be interactive such that clicking a header changes
315
+ * the sorting and/or direction.
316
+ * @category Prop
317
+ * @since v8.4.0
318
+ */
319
+ readonly sortOnClick?: boolean;
320
+ /**
321
+ * Either `true` to show the default SortedTablePaginator for the Table, or
322
+ * provide your own paginator component that takes SortedTablePaginatorProps.
323
+ * @category Prop
324
+ * @since v8.4.0
325
+ */
326
+ readonly paginator?: boolean | Component<SortedTablePaginatorProps>;
327
+ /**
328
+ * A function that is called whenever the sorting or pagination of the Table
329
+ * is changed by the user, invoked with the sorted Cell Id, whether descending
330
+ * or not, and the offset of the pagination.
331
+ * @category Prop
332
+ * @since v8.4.0
333
+ */
334
+ readonly onChange?: (
335
+ sortAndOffset: [
336
+ cellId: CellIdFromSchema<Schemas[0], TableId> | undefined,
337
+ descending: boolean,
338
+ offset: number,
339
+ ],
340
+ ) => void;
341
+ }
342
+ : never
343
+ : never;
344
+
345
+ /**
346
+ * ValuesInHtmlTableProps props are used for components that will render Values
347
+ * in an HTML table, such as the ValuesInHtmlTable component.
348
+ * @category Props
349
+ * @since v8.4.0
350
+ */
351
+ export type ValuesInHtmlTableProps<Schemas extends OptionalSchemas> = {
352
+ /**
353
+ * The Store to be accessed: omit for the default context Store, provide an Id
354
+ * for a named context Store, or provide an explicit reference.
355
+ * @category Prop
356
+ * @since v8.4.0
357
+ */
358
+ readonly store?: StoreOrStoreId<Schemas>;
359
+ /**
360
+ * Whether the Values should be editable. This affects the default ValueView
361
+ * component (to use the EditableValueView component instead) but of course
362
+ * will not affect a custom valueComponent if you have set one.
363
+ * @category Prop
364
+ * @since v8.4.0
365
+ */
366
+ readonly editable?: boolean;
367
+ /**
368
+ * A custom component for rendering each Value in the Store (to override the
369
+ * default ValueView component).
370
+ * @category Prop
371
+ * @since v8.4.0
372
+ */
373
+ readonly valueComponent?: Component<ValueProps<Schemas>>;
374
+ /**
375
+ * A function for generating extra props for each custom Value component based
376
+ * on its Id.
377
+ * @category Prop
378
+ * @since v8.4.0
379
+ */
380
+ readonly getValueComponentProps?: (valueId: Id) => ExtraProps;
381
+ };
382
+
383
+ /**
384
+ * SliceInHtmlTableProps props are used for components that will render an Index
385
+ * Slice in an HTML table, such as the SliceInHtmlTable component.
386
+ * @category Props
387
+ * @since v8.4.0
388
+ */
389
+ export type SliceInHtmlTableProps<Schemas extends OptionalSchemas> = {
390
+ /**
391
+ * The Id of the Index in the Indexes object.
392
+ * @category Prop
393
+ * @since v8.4.0
394
+ */
395
+ readonly indexId: Id;
396
+ /**
397
+ * The Id of the Slice in the Index to be rendered.
398
+ * @category Prop
399
+ * @since v8.4.0
400
+ */
401
+ readonly sliceId: Id;
402
+ /**
403
+ * The Indexes object to be accessed: omit for the default context Indexes
404
+ * object, provide an Id for a named context Indexes object, or provide an
405
+ * explicit reference.
406
+ * @category Prop
407
+ * @since v8.4.0
408
+ */
409
+ readonly indexes?: IndexesOrIndexesId<Schemas>;
410
+ /**
411
+ * Whether the Cells should be editable. This affects the default CellView
412
+ * component (to use the EditableCellView component instead) but of course
413
+ * will not affect custom Cell components if you have set them.
414
+ * @category Prop
415
+ * @since v8.4.0
416
+ */
417
+ readonly editable?: boolean;
418
+ /**
419
+ * An optional list of Cell Ids to use for rendering a prescribed set of the
420
+ * Slice's Cells in a given order. This can also be an object with the desired
421
+ * Cell Ids as keys, and with a value that can either be a string label to
422
+ * show in the column header, or a CustomCell object to further configure the
423
+ * column.
424
+ * @category Prop
425
+ * @since v8.4.0
426
+ */
427
+ readonly customCells?:
428
+ | Ids
429
+ | {[cellId: Id]: string | CustomCell<NoSchemas, Id, Id>};
430
+ };
431
+
432
+ /**
433
+ * RelationshipInHtmlTableProps props are used for components that will render
434
+ * the contents of the two Tables linked by a Relationship as an HTML table,
435
+ * such as the RelationshipInHtmlTable component.
436
+ *
437
+ * Note the use of dotted 'tableId.cellId' string pairs when specifying custom
438
+ * rendering for the cells in this table, since Cells from both the
439
+ * relationship's 'local' and 'remote' Table objects can be rendered and need to
440
+ * be distinguished.
441
+ * @category Props
442
+ * @since v8.4.0
443
+ */
444
+ export type RelationshipInHtmlTableProps<Schemas extends OptionalSchemas> = {
445
+ /**
446
+ * The Id of the relationship in the Relationships object for which the
447
+ * relationship Table Rows will be rendered.
448
+ * @category Prop
449
+ * @since v8.4.0
450
+ */
451
+ readonly relationshipId: Id;
452
+ /**
453
+ * The Relationships object to be accessed: omit for the default context
454
+ * Relationships object, provide an Id for a named context Relationships
455
+ * object, or provide an explicit reference.
456
+ * @category Prop
457
+ * @since v8.4.0
458
+ */
459
+ readonly relationships?: RelationshipsOrRelationshipsId<Schemas>;
460
+ /**
461
+ * Whether the Cells should be editable. This affects the default CellView
462
+ * component (to use the EditableCellView component instead) but of course
463
+ * will not affect custom Cell components if you have set them.
464
+ * @category Prop
465
+ * @since v8.4.0
466
+ */
467
+ readonly editable?: boolean;
468
+ /**
469
+ * An optional list of dotted 'tableId.cellId' string pairs to use for
470
+ * rendering a prescribed set of the relationship Tables' Cells in a given
471
+ * order. This can also be an object with the desired 'tableId.cellId' string
472
+ * pairs as keys, and with a value that can either be a string label to show
473
+ * in the column header, or a CustomCell object to further configure the
474
+ * column.
475
+ * @category Prop
476
+ * @since v8.4.0
477
+ */
478
+ readonly customCells?:
479
+ | Ids
480
+ | {[cellId: Id]: string | CustomCell<NoSchemas, Id, Id>};
481
+ };
482
+
483
+ /**
484
+ * ResultTableInHtmlTableProps props are used for components that will render a
485
+ * ResultTable in an HTML table, such as the ResultTableInHtmlTable component.
486
+ * @category Props
487
+ * @since v8.4.0
488
+ */
489
+ export type ResultTableInHtmlTableProps<Schemas extends OptionalSchemas> = {
490
+ /**
491
+ * The Id of the query in the Queries object for which the ResultTable will be
492
+ * rendered.
493
+ * @category Prop
494
+ * @since v8.4.0
495
+ */
496
+ readonly queryId: Id;
497
+ /**
498
+ * The Queries object to be accessed: omit for the default context Queries
499
+ * object, provide an Id for a named context Queries object, or provide an
500
+ * explicit reference.
501
+ * @category Prop
502
+ * @since v8.4.0
503
+ */
504
+ readonly queries?: QueriesOrQueriesId<Schemas>;
505
+ /**
506
+ * An optional list of Cell Ids to use for rendering a prescribed set of the
507
+ * ResultTable's Cells in a given order. This can also be an object with the
508
+ * desired Cell Ids as keys, and with a value that can either be a string
509
+ * label to show in the column header, or a ResultCustomCell object to further
510
+ * configure the column.
511
+ * @category Prop
512
+ * @since v8.4.0
513
+ */
514
+ readonly customCells?:
515
+ | Ids
516
+ | {[cellId: Id]: string | CustomResultCell<Schemas>};
517
+ };
518
+
519
+ /**
520
+ * ResultSortedTableInHtmlTableProps props are used for components that will
521
+ * render a sorted Table in an HTML table, such as the SortedTableInHtmlTable
522
+ * component.
523
+ * @category Props
524
+ * @since v8.4.0
525
+ */
526
+ export type ResultSortedTableInHtmlTableProps<Schemas extends OptionalSchemas> =
527
+ {
528
+ /**
529
+ * The Id of the query in the Queries object for which the ResultTable will be
530
+ * rendered.
531
+ * @category Prop
532
+ * @since v8.4.0
533
+ */
534
+ readonly queryId: Id;
535
+ /**
536
+ * The Id of the Cell whose values are used for the sorting. If omitted, the
537
+ * view will sort the Row Id itself.
538
+ * @category Prop
539
+ * @since v8.4.0
540
+ */
541
+ readonly cellId?: Id;
542
+ /**
543
+ * Whether the sorting should be in descending order.
544
+ * @category Prop
545
+ * @since v8.4.0
546
+ */
547
+ readonly descending?: boolean;
548
+ /**
549
+ * The number of Row Ids to skip for pagination purposes.
550
+ * @category Prop
551
+ * @since v8.4.0
552
+ */
553
+ readonly offset?: number;
554
+ /**
555
+ * The maximum number of Row Ids to return.
556
+ * @category Prop
557
+ * @since v8.4.0
558
+ */
559
+ readonly limit?: number;
560
+ /**
561
+ * The Queries object to be accessed: omit for the default context Queries
562
+ * object, provide an Id for a named context Queries object, or provide an
563
+ * explicit reference.
564
+ * @category Prop
565
+ * @since v8.4.0
566
+ */
567
+ readonly queries?: QueriesOrQueriesId<Schemas>;
568
+ /**
569
+ * An optional list of Cell Ids to use for rendering a prescribed set of the
570
+ * ResultTable's Cells in a given order. This can also be an object with the
571
+ * desired Cell Ids as keys, and with a value that can either be a string
572
+ * label to show in the column header, or a ResultCustomCell object to further
573
+ * configure the column.
574
+ * @category Prop
575
+ * @since v8.4.0
576
+ */
577
+ readonly customCells?:
578
+ | Ids
579
+ | {[cellId: Id]: string | CustomResultCell<Schemas>};
580
+ /**
581
+ * Whether the table should be interactive such that clicking a header changes
582
+ * the sorting and/or direction.
583
+ * @category Prop
584
+ * @since v8.4.0
585
+ */
586
+ readonly sortOnClick?: boolean;
587
+ /**
588
+ * Either `true` to show the default SortedTablePaginator for the ResultTable,
589
+ * or provide your own paginator component that takes
590
+ * SortedTablePaginatorProps.
591
+ * @category Prop
592
+ * @since v8.4.0
593
+ */
594
+ readonly paginator?: boolean | Component<SortedTablePaginatorProps>;
595
+ /**
596
+ * A function that is called whenever the sorting or pagination of the
597
+ * ResultTable is changed by the user, invoked with the sorted Cell Id,
598
+ * whether descending or not, and the offset of the pagination.
599
+ * @category Prop
600
+ * @since v8.4.0
601
+ */
602
+ readonly onChange?: (
603
+ sortAndOffset: [
604
+ cellId: Id | undefined,
605
+ descending: boolean,
606
+ offset: number,
607
+ ],
608
+ ) => void;
609
+ };
610
+
611
+ /**
612
+ * SortedTablePaginatorProps props are used for components that will be used as
613
+ * a table paginator, such as the SortedTablePaginator component.
614
+ * @category Props
615
+ * @since v8.4.0
616
+ */
617
+ export type SortedTablePaginatorProps = {
618
+ /**
619
+ * An event that will fire when the offset is updated, called with the new
620
+ * offset.
621
+ * @category Prop
622
+ * @since v8.4.0
623
+ */
624
+ readonly onChange: (offset: number) => void;
625
+ /**
626
+ * The number of Row Ids to skip for pagination.
627
+ * @category Prop
628
+ * @since v8.4.0
629
+ */
630
+ readonly offset?: number;
631
+ /**
632
+ * The maximum number of Row Ids being returned.
633
+ * @category Prop
634
+ * @since v8.4.0
635
+ */
636
+ readonly limit?: number;
637
+ /**
638
+ * The total number of Row Ids in the paginated table.
639
+ * @category Prop
640
+ * @since v8.4.0
641
+ */
642
+ readonly total: number;
643
+ /**
644
+ * A noun to use in the pagination label for a single row, defaulting to
645
+ * 'row'.
646
+ * @category Prop
647
+ * @since v8.4.0
648
+ */
649
+ readonly singular?: string;
650
+ /**
651
+ * A noun to use in the pagination label for multiple rows, defaulting to the
652
+ * value of the singular noun suffixed with the letter 's'.
653
+ * @category Prop
654
+ * @since v8.4.0
655
+ */
656
+ readonly plural?: string;
657
+ };
658
+
659
+ export type WithSchemas<Schemas extends OptionalSchemas> = {
660
+ /**
661
+ * The TableInHtmlTable component renders the contents of a single Table in a
662
+ * Store as an HTML <table> element, and registers a listener so that any
663
+ * changes to that result will cause a re-render.
664
+ *
665
+ * This has schema-based typing. The following is a simplified representation:
666
+ *
667
+ * ```ts override
668
+ * TableInHtmlTable(
669
+ * props: TableInHtmlTableProps & HtmlTableProps,
670
+ * ): ComponentReturnType;
671
+ * ```
672
+ *
673
+ * See the <TableInHtmlTable /> (Solid) demo for this component in action:
674
+ *
675
+ * ![TableInHtmlTable example](https://beta.tinybase.org/shots/tableinhtmltable-solid-demo.png
676
+ * "TableInHtmlTable example")
677
+ *
678
+ * The component's props identify which Table to render based on Table Id, and
679
+ * Store (which is either the default context Store, a named context Store, or
680
+ * by explicit reference).
681
+ *
682
+ * This component renders a Table by iterating over its Row objects. By default
683
+ * the Cells are in turn rendered with the CellView component, but you can
684
+ * override this behavior by providing a `component` for each Cell in the
685
+ * `customCells` prop. You can pass additional props to that custom component
686
+ * with the `getComponentProps` callback. See the CustomCell type for more
687
+ * details.
688
+ *
689
+ * This component uses the useRowIds hook under the covers, which means that any
690
+ * changes to the structure of the Table will cause a re-render.
691
+ *
692
+ * You can use the `headerRow` and `idColumn` props to control whether the Ids
693
+ * appear in a <th> element at the top of the table, and the start of each row.
694
+ * @param props The props for this component.
695
+ * @returns A rendering of the Table in a <table> element.
696
+ * @example
697
+ * This example creates a Provider context into which a default Store is
698
+ * provided. The TableInHtmlTable component within it then renders the Table in
699
+ * a <table> element with a CSS class.
700
+ *
701
+ * ```jsx
702
+ * import {render} from 'solid-js/web';
703
+ * import {createStore} from 'tinybase';
704
+ * import {Provider} from 'tinybase/ui-solid';
705
+ * import {TableInHtmlTable} from 'tinybase/ui-solid-dom';
706
+ *
707
+ * const App = ({store}) => (
708
+ * <Provider store={store}>
709
+ * <Pane />
710
+ * </Provider>
711
+ * );
712
+ * const Pane = () => <TableInHtmlTable tableId="pets" className="table" />;
713
+ *
714
+ * const store = createStore().setTable('pets', {
715
+ * fido: {species: 'dog'},
716
+ * felix: {species: 'cat'},
717
+ * });
718
+ * const app = document.createElement('div');
719
+ * render(() => <App store={store} />, app); // !act
720
+ * console.log(app.innerHTML);
721
+ * // ->
722
+ * `
723
+ * <table class="table">
724
+ * <thead>
725
+ * <tr>
726
+ * <th>Id</th>
727
+ * <th>species</th>
728
+ * </tr>
729
+ * </thead>
730
+ * <tbody>
731
+ * <tr>
732
+ * <th title="fido">fido</th>
733
+ * <td>dog</td>
734
+ * </tr>
735
+ * <tr>
736
+ * <th title="felix">felix</th>
737
+ * <td>cat</td>
738
+ * </tr>
739
+ * </tbody>
740
+ * </table>
741
+ * `;
742
+ * ```
743
+ * @example
744
+ * This example creates a Provider context into which a default Store is
745
+ * provided. The TableInHtmlTable component within it then renders the Table
746
+ * with a custom component and a custom props callback for the `species` Cell.
747
+ * The header row at the top of the table and the Id column at the start of each
748
+ * row is removed.
749
+ *
750
+ * ```jsx
751
+ * import {render} from 'solid-js/web';
752
+ * import {createStore} from 'tinybase';
753
+ * import {CellView, Provider} from 'tinybase/ui-solid';
754
+ * import {TableInHtmlTable} from 'tinybase/ui-solid-dom';
755
+ *
756
+ * const App = ({store}) => (
757
+ * <Provider store={store}>
758
+ * <Pane />
759
+ * </Provider>
760
+ * );
761
+ * const Pane = () => (
762
+ * <TableInHtmlTable
763
+ * tableId="pets"
764
+ * customCells={customCells}
765
+ * headerRow={false}
766
+ * idColumn={false}
767
+ * />
768
+ * );
769
+ *
770
+ * const FormattedCellView = ({tableId, rowId, cellId, bold}) => (
771
+ * <>
772
+ * {bold ? <b>{rowId}</b> : rowId}:
773
+ * <CellView tableId={tableId} rowId={rowId} cellId={cellId} />
774
+ * </>
775
+ * );
776
+ * const customCells = {
777
+ * species: {
778
+ * component: FormattedCellView,
779
+ * getComponentProps: (rowId) => ({bold: rowId == 'fido'}),
780
+ * },
781
+ * };
782
+ *
783
+ * const store = createStore().setTable('pets', {
784
+ * fido: {species: 'dog'},
785
+ * felix: {species: 'cat'},
786
+ * });
787
+ * const app = document.createElement('div');
788
+ * render(() => <App store={store} />, app); // !act
789
+ * console.log(app.innerHTML);
790
+ * // ->
791
+ * `
792
+ * <table>
793
+ * <tbody>
794
+ * <tr>
795
+ * <td><b>fido</b>:dog</td>
796
+ * </tr>
797
+ * <tr>
798
+ * <td>felix:cat</td>
799
+ * </tr>
800
+ * </tbody>
801
+ * </table>
802
+ * `;
803
+ * ```
804
+ * @category Store components
805
+ * @since v8.4.0
806
+ */
807
+ TableInHtmlTable: (
808
+ props: TableInHtmlTableProps<Schemas> & HtmlTableProps,
809
+ ) => ComponentReturnType;
810
+
811
+ /**
812
+ * The SortedTableInHtmlTable component renders the contents of a single sorted
813
+ * Table in a Store, as an HTML <table> element, and registers a listener so
814
+ * that any changes to that result will cause a re-render.
815
+ *
816
+ * This has schema-based typing. The following is a simplified representation:
817
+ *
818
+ * ```ts override
819
+ * SortedTableInHtmlTable(
820
+ * props: SortedTableInHtmlTableProps & HtmlTableProps,
821
+ * ): ComponentReturnType;
822
+ * ```
823
+ *
824
+ * See the <SortedTableInHtmlTable /> (Solid) demo for this component in
825
+ * action:
826
+ *
827
+ * ![SortedTableInHtmlTable example](https://beta.tinybase.org/shots/sortedtableinhtmltable-solid-demo.png
828
+ * "SortedTableInHtmlTable example")
829
+ *
830
+ * The component's props identify which Table to render based on Table Id, and
831
+ * Store (which is either the default context Store, a named context Store, or
832
+ * by explicit reference). It also takes a Cell Id to sort by and a boolean to
833
+ * indicate that the sorting should be in descending order. The `offset` and
834
+ * `limit` props are used to paginate results, but default to `0` and
835
+ * `undefined` to return all available Row Ids if not specified.
836
+ *
837
+ * This component renders a ResultTable by iterating over its Row objects, in
838
+ * the order dictated by the sort parameters. By default the Cells are in turn
839
+ * rendered with the CellView component, but you can override this behavior by
840
+ * providing a `component` for each Cell in the `customCells` prop. You can pass
841
+ * additional props to that custom component with the `getComponentProps`
842
+ * callback. See the CustomCell type for more details.
843
+ *
844
+ * This component uses the useSortedRowIds hook under the covers, which means
845
+ * that any changes to the structure or sorting of the Table will cause a
846
+ * re-render.
847
+ *
848
+ * You can use the `headerRow` and `idColumn` props to control whether the Ids
849
+ * appear in a <th> element at the top of the table, and the start of each row.
850
+ *
851
+ * The `sortOnClick` prop makes the table's sorting interactive such that the
852
+ * user can click on a column heading to sort by that column. The style classes
853
+ * `sorted` and `ascending` (or `descending`) are added so that you can provide
854
+ * hints to the user how the sorting is being applied.
855
+ *
856
+ * Provide a paginator component for the Table with the `paginator` prop. Set to
857
+ * `true` to use the default SortedTablePaginator, or provide your own component
858
+ * that accepts SortedTablePaginatorProps.
859
+ *
860
+ * Finally, the `onChange` prop lets you listen to a user's changes to the
861
+ * Table's sorting or pagination.
862
+ * @param props The props for this component.
863
+ * @returns A rendering of the Table in a <table> element.
864
+ * @example
865
+ * This example creates a Provider context into which a default Store is
866
+ * provided. The SortedTableInHtmlTable component within it then renders the
867
+ * Table in a <table> element with a CSS class.
868
+ *
869
+ * ```jsx
870
+ * import {render} from 'solid-js/web';
871
+ * import {createStore} from 'tinybase';
872
+ * import {Provider} from 'tinybase/ui-solid';
873
+ * import {SortedTableInHtmlTable} from 'tinybase/ui-solid-dom';
874
+ *
875
+ * const App = ({store}) => (
876
+ * <Provider store={store}>
877
+ * <Pane />
878
+ * </Provider>
879
+ * );
880
+ * const Pane = () => (
881
+ * <SortedTableInHtmlTable
882
+ * tableId="pets"
883
+ * cellId="species"
884
+ * className="table"
885
+ * />
886
+ * );
887
+ *
888
+ * const store = createStore().setTables({
889
+ * pets: {
890
+ * fido: {species: 'dog'},
891
+ * felix: {species: 'cat'},
892
+ * },
893
+ * });
894
+ * const app = document.createElement('div');
895
+ * render(() => <App store={store} />, app); // !act
896
+ * console.log(app.innerHTML);
897
+ * // ->
898
+ * `
899
+ * <table class="table">
900
+ * <thead>
901
+ * <tr>
902
+ * <th>Id</th>
903
+ * <th class="sorted ascending">↑ species</th>
904
+ * </tr>
905
+ * </thead>
906
+ * <tbody>
907
+ * <tr>
908
+ * <th title="felix">felix</th>
909
+ * <td>cat</td>
910
+ * </tr>
911
+ * <tr>
912
+ * <th title="fido">fido</th>
913
+ * <td>dog</td>
914
+ * </tr>
915
+ * </tbody>
916
+ * </table>
917
+ * `;
918
+ * ```
919
+ * @example
920
+ * This example creates a Provider context into which a default Store is
921
+ * provided. The SortedTableInHtmlTable component within it then renders the
922
+ * Table with a custom component and a custom props callback for the `species`
923
+ * Cell. The header row at the top of the table and the Id column at the start
924
+ * of each row is removed.
925
+ *
926
+ * ```jsx
927
+ * import {render} from 'solid-js/web';
928
+ * import {createStore} from 'tinybase';
929
+ * import {CellView, Provider} from 'tinybase/ui-solid';
930
+ * import {SortedTableInHtmlTable} from 'tinybase/ui-solid-dom';
931
+ *
932
+ * const App = ({store}) => (
933
+ * <Provider store={store}>
934
+ * <Pane />
935
+ * </Provider>
936
+ * );
937
+ *
938
+ * const Pane = () => (
939
+ * <SortedTableInHtmlTable
940
+ * tableId="pets"
941
+ * cellId="species"
942
+ * customCells={customCells}
943
+ * headerRow={false}
944
+ * idColumn={false}
945
+ * />
946
+ * );
947
+ *
948
+ * const FormattedCellView = ({tableId, rowId, cellId, bold}) => (
949
+ * <>
950
+ * {bold ? <b>{rowId}</b> : rowId}:
951
+ * <CellView tableId={tableId} rowId={rowId} cellId={cellId} />
952
+ * </>
953
+ * );
954
+ * const customCells = {
955
+ * species: {
956
+ * component: FormattedCellView,
957
+ * getComponentProps: (rowId) => ({bold: rowId == 'fido'}),
958
+ * },
959
+ * };
960
+ *
961
+ * const store = createStore().setTables({
962
+ * pets: {
963
+ * fido: {species: 'dog'},
964
+ * felix: {species: 'cat'},
965
+ * },
966
+ * });
967
+ * const app = document.createElement('div');
968
+ * render(() => <App store={store} />, app); // !act
969
+ * console.log(app.innerHTML);
970
+ * // ->
971
+ * `
972
+ * <table>
973
+ * <tbody>
974
+ * <tr>
975
+ * <td>felix:cat</td>
976
+ * </tr>
977
+ * <tr>
978
+ * <td><b>fido</b>:dog</td>
979
+ * </tr>
980
+ * </tbody>
981
+ * </table>
982
+ * `;
983
+ * ```
984
+ * @category Store components
985
+ * @since v8.4.0
986
+ */
987
+ SortedTableInHtmlTable: (
988
+ props: SortedTableInHtmlTableProps<Schemas> & HtmlTableProps,
989
+ ) => ComponentReturnType;
990
+
991
+ /**
992
+ * The ValuesInHtmlTable component renders the keyed value contents of a Store
993
+ * as an HTML <table> element, and registers a listener so that any changes to
994
+ * that result will cause a re-render.
995
+ *
996
+ * This has schema-based typing. The following is a simplified representation:
997
+ *
998
+ * ```ts override
999
+ * ValuesInHtmlTable(
1000
+ * props: ValuesInHtmlTableProps & HtmlTableProps,
1001
+ * ): ComponentReturnType;
1002
+ * ```
1003
+ *
1004
+ * See the <ValuesInHtmlTable /> (Solid) demo for this component in action:
1005
+ *
1006
+ * ![ValuesInHtmlTable example](https://beta.tinybase.org/shots/valuesinhtmltable-solid-demo.png
1007
+ * "ValuesInHtmlTable example")
1008
+ *
1009
+ * The component's props identify which Row to render based on Table Id, Row Id,
1010
+ * and Store (which is either the default context Store, a named context Store,
1011
+ * or an explicit reference).
1012
+ *
1013
+ * This component renders a Store by iterating over its Value objects. By
1014
+ * default the Values are in turn rendered with the ValueView component, but you
1015
+ * can override this behavior by providing a `valueComponent` prop, a custom
1016
+ * component of your own that will render a Value based on ValueProps. You can
1017
+ * also pass additional props to your custom component with the
1018
+ * `getValueComponentProps` callback prop.
1019
+ *
1020
+ * This component uses the useValueIds hook under the covers, which means that
1021
+ * any changes to the structure of the Values in the Store will cause a
1022
+ * re-render.
1023
+ *
1024
+ * You can use the `headerRow` and `idColumn` props to control whether labels
1025
+ * and Ids appear in a <th> element at the top of the table, and the start of
1026
+ * each row.
1027
+ * @param props The props for this component.
1028
+ * @returns A rendering of the Values in a <table> element.
1029
+ * @example
1030
+ * This example creates a Provider context into which a default Store is
1031
+ * provided. The ValuesInHtmlTable component within it then renders the Values
1032
+ * in a <table> element with a CSS class.
1033
+ *
1034
+ * ```jsx
1035
+ * import {render} from 'solid-js/web';
1036
+ * import {createStore} from 'tinybase';
1037
+ * import {Provider} from 'tinybase/ui-solid';
1038
+ * import {ValuesInHtmlTable} from 'tinybase/ui-solid-dom';
1039
+ *
1040
+ * const App = ({store}) => (
1041
+ * <Provider store={store}>
1042
+ * <Pane />
1043
+ * </Provider>
1044
+ * );
1045
+ * const Pane = () => <ValuesInHtmlTable className="values" />;
1046
+ *
1047
+ * const store = createStore().setValues({open: true, employees: 3});
1048
+ * const app = document.createElement('div');
1049
+ * render(() => <App store={store} />, app); // !act
1050
+ * console.log(app.innerHTML);
1051
+ * // ->
1052
+ * `
1053
+ * <table class="values">
1054
+ * <thead>
1055
+ * <tr>
1056
+ * <th>Id</th>
1057
+ * <th>Value</th>
1058
+ * </tr>
1059
+ * </thead>
1060
+ * <tbody>
1061
+ * <tr>
1062
+ * <th title="open">open</th>
1063
+ * <td>true</td>
1064
+ * </tr>
1065
+ * <tr>
1066
+ * <th title="employees">employees</th>
1067
+ * <td>3</td>
1068
+ * </tr>
1069
+ * </tbody>
1070
+ * </table>
1071
+ * `;
1072
+ * ```
1073
+ * @example
1074
+ * This example creates a Provider context into which a default Store is
1075
+ * provided. The ValuesInHtmlTable component within it then renders the Row
1076
+ * with a custom Cell component and a custom props callback. The header row at
1077
+ * the top of the table and the Id column at the start of each row is removed.
1078
+ *
1079
+ * ```jsx
1080
+ * import {render} from 'solid-js/web';
1081
+ * import {createStore} from 'tinybase';
1082
+ * import {Provider, ValueView} from 'tinybase/ui-solid';
1083
+ * import {ValuesInHtmlTable} from 'tinybase/ui-solid-dom';
1084
+ *
1085
+ * const App = ({store}) => (
1086
+ * <Provider store={store}>
1087
+ * <Pane />
1088
+ * </Provider>
1089
+ * );
1090
+ * const getBoldProp = (valueId) => ({bold: valueId == 'open'});
1091
+ * const Pane = () => (
1092
+ * <ValuesInHtmlTable
1093
+ * valueComponent={FormattedValueView}
1094
+ * getValueComponentProps={getBoldProp}
1095
+ * headerRow={false}
1096
+ * idColumn={false}
1097
+ * />
1098
+ * );
1099
+ * const FormattedValueView = ({valueId, bold}) => (
1100
+ * <>
1101
+ * {bold ? <b>{valueId}</b> : valueId}
1102
+ * {': '}
1103
+ * <ValueView valueId={valueId} />
1104
+ * </>
1105
+ * );
1106
+ *
1107
+ * const store = createStore().setValues({open: true, employees: 3});
1108
+ * const app = document.createElement('div');
1109
+ * render(() => <App store={store} />, app); // !act
1110
+ * console.log(app.innerHTML);
1111
+ * // ->
1112
+ * `
1113
+ * <table>
1114
+ * <tbody>
1115
+ * <tr><td><b>open</b>: true</td></tr>
1116
+ * <tr><td>employees: 3</td></tr>
1117
+ * </tbody>
1118
+ * </table>
1119
+ * `;
1120
+ * ```
1121
+ * @category Store components
1122
+ * @since v8.4.0
1123
+ */
1124
+ ValuesInHtmlTable: (
1125
+ props: ValuesInHtmlTableProps<Schemas> & HtmlTableProps,
1126
+ ) => ComponentReturnType;
1127
+
1128
+ /**
1129
+ * The SliceInHtmlTable component renders the contents of a Slice as an HTML
1130
+ * <table> element, and registers a listener so that any changes to that result
1131
+ * will cause a re-render.
1132
+ *
1133
+ * This has schema-based typing. The following is a simplified representation:
1134
+ *
1135
+ * ```ts override
1136
+ * SliceInHtmlTable(
1137
+ * props: SliceInHtmlTableProps & HtmlTableProps,
1138
+ * ): ComponentReturnType;
1139
+ * ```
1140
+ *
1141
+ * See the <SliceInHtmlTable /> (Solid) demo for this component in action:
1142
+ *
1143
+ * ![SliceInHtmlTable example](https://beta.tinybase.org/shots/sliceinhtmltable-solid-demo.png
1144
+ * "SliceInHtmlTable example")
1145
+ *
1146
+ * The component's props identify which Slice to render based on Index Id, Slice
1147
+ * Id, and Indexes object (which is either the default context Indexes object, a
1148
+ * named context Indexes object, or an explicit reference).
1149
+ *
1150
+ * This component renders a Slice by iterating over its Row objects. By default
1151
+ * the Cells are in turn rendered with the CellView component, but you can
1152
+ * override this behavior by providing a `component` for each Cell in the
1153
+ * `customCells` prop. You can pass additional props to that custom component
1154
+ * with the `getComponentProps` callback. See the CustomCell type for more
1155
+ * details.
1156
+ *
1157
+ * This component uses the useSliceRowIds hook under the covers, which means
1158
+ * that any changes to the structure of the Slice will cause a re-render.
1159
+ *
1160
+ * You can use the `headerRow` and `idColumn` props to control whether labels
1161
+ * and Ids appear in a <th> element at the top of the table, and the start of
1162
+ * each row.
1163
+ * @param props The props for this component.
1164
+ * @returns A rendering of the Slice in a <table> element.
1165
+ * @example
1166
+ * This example creates a Provider context into which a default Indexes object
1167
+ * is provided. The SliceInHtmlTable component within it then renders the Slice
1168
+ * in a <table> element with a CSS class.
1169
+ *
1170
+ * ```jsx
1171
+ * import {render} from 'solid-js/web';
1172
+ * import {createIndexes, createStore} from 'tinybase';
1173
+ * import {Provider} from 'tinybase/ui-solid';
1174
+ * import {SliceInHtmlTable} from 'tinybase/ui-solid-dom';
1175
+ *
1176
+ * const App = ({indexes}) => (
1177
+ * <Provider indexes={indexes}>
1178
+ * <Pane />
1179
+ * </Provider>
1180
+ * );
1181
+ * const Pane = () => (
1182
+ * <SliceInHtmlTable indexId="bySpecies" sliceId="dog" className="slice" />
1183
+ * );
1184
+ *
1185
+ * const store = createStore().setTable('pets', {
1186
+ * fido: {species: 'dog'},
1187
+ * felix: {species: 'cat'},
1188
+ * cujo: {species: 'dog'},
1189
+ * });
1190
+ * const indexes = createIndexes(store);
1191
+ * indexes.setIndexDefinition('bySpecies', 'pets', 'species');
1192
+ *
1193
+ * const app = document.createElement('div');
1194
+ * render(() => <App indexes={indexes} />, app); // !act
1195
+ * console.log(app.innerHTML);
1196
+ * // ->
1197
+ * `
1198
+ * <table class="slice">
1199
+ * <thead>
1200
+ * <tr>
1201
+ * <th>Id</th>
1202
+ * <th>species</th>
1203
+ * </tr>
1204
+ * </thead>
1205
+ * <tbody>
1206
+ * <tr>
1207
+ * <th title="fido">fido</th>
1208
+ * <td>dog</td>
1209
+ * </tr>
1210
+ * <tr>
1211
+ * <th title="cujo">cujo</th>
1212
+ * <td>dog</td>
1213
+ * </tr>
1214
+ * </tbody>
1215
+ * </table>
1216
+ * `;
1217
+ * ```
1218
+ * @example
1219
+ * This example creates a Provider context into which a default Indexes object
1220
+ * is provided. The SliceInHtmlTable component within it then renders the Slice
1221
+ * with a custom component and a custom props callback for the `species` Cell.
1222
+ * The header row at the top of the table and the Id column at the start of each
1223
+ * row is removed.
1224
+ *
1225
+ * ```jsx
1226
+ * import {render} from 'solid-js/web';
1227
+ * import {createIndexes, createStore} from 'tinybase';
1228
+ * import {CellView, Provider} from 'tinybase/ui-solid';
1229
+ * import {SliceInHtmlTable} from 'tinybase/ui-solid-dom';
1230
+ *
1231
+ * const App = ({indexes}) => (
1232
+ * <Provider indexes={indexes}>
1233
+ * <Pane />
1234
+ * </Provider>
1235
+ * );
1236
+ * const Pane = () => (
1237
+ * <SliceInHtmlTable
1238
+ * indexId="bySpecies"
1239
+ * sliceId="dog"
1240
+ * customCells={customCells}
1241
+ * headerRow={false}
1242
+ * idColumn={false}
1243
+ * />
1244
+ * );
1245
+ *
1246
+ * const FormattedCellView = ({tableId, rowId, cellId, bold}) => (
1247
+ * <>
1248
+ * {bold ? <b>{rowId}</b> : rowId}:
1249
+ * <CellView tableId={tableId} rowId={rowId} cellId={cellId} />
1250
+ * </>
1251
+ * );
1252
+ * const customCells = {
1253
+ * species: {
1254
+ * component: FormattedCellView,
1255
+ * getComponentProps: (rowId) => ({bold: rowId == 'fido'}),
1256
+ * },
1257
+ * };
1258
+ *
1259
+ * const store = createStore().setTable('pets', {
1260
+ * fido: {species: 'dog', color: 'brown'},
1261
+ * felix: {species: 'cat'},
1262
+ * cujo: {species: 'dog'},
1263
+ * });
1264
+ * const indexes = createIndexes(store);
1265
+ * indexes.setIndexDefinition('bySpecies', 'pets', 'species');
1266
+ *
1267
+ * const app = document.createElement('div');
1268
+ * render(() => <App indexes={indexes} />, app); // !act
1269
+ * console.log(app.innerHTML);
1270
+ * // ->
1271
+ * `
1272
+ * <table>
1273
+ * <tbody>
1274
+ * <tr>
1275
+ * <td><b>fido</b>:</td>
1276
+ * </tr>
1277
+ * <tr>
1278
+ * <td>cujo:</td>
1279
+ * </tr>
1280
+ * </tbody>
1281
+ * </table>
1282
+ * `;
1283
+ * ```
1284
+ * @category Other components
1285
+ * @since v8.4.0
1286
+ */
1287
+ SliceInHtmlTable: (
1288
+ props: SliceInHtmlTableProps<Schemas> & HtmlTableProps,
1289
+ ) => ComponentReturnType;
1290
+
1291
+ /**
1292
+ * The RelationshipInHtmlTable component renders the contents of the two Tables
1293
+ * linked by a Relationship as an HTML <table> element, and registers a listener
1294
+ * so that any changes to that result will cause a re-render.
1295
+ *
1296
+ * This has schema-based typing. The following is a simplified representation:
1297
+ *
1298
+ * ```ts override
1299
+ * RelationshipInHtmlTable(
1300
+ * props: RelationshipInHtmlTableProps & HtmlTableProps,
1301
+ * ): ComponentReturnType;
1302
+ * ```
1303
+ *
1304
+ * See the <RelationshipInHtmlTable /> (Solid) demo for this component in
1305
+ * action:
1306
+ *
1307
+ * ![RelationshipInHtmlTable example](https://beta.tinybase.org/shots/relationshipinhtmltable-solid-demo.png
1308
+ * "RelationshipInHtmlTable example")
1309
+ *
1310
+ * The component's props identify which Relationship to render based on
1311
+ * Relationship Id and Relationships object (which is either the default context
1312
+ * Relationships object, a named context Relationships object, or an explicit
1313
+ * reference).
1314
+ *
1315
+ * This component renders the two Table objects by iterating over their related
1316
+ * Row objects. By default the Cells are in turn rendered with the CellView
1317
+ * component, but you can override this behavior by providing a `component` for
1318
+ * each Cell in the `customCells` prop. You can pass additional props to that
1319
+ * custom component with the `getComponentProps` callback. See the CustomCell
1320
+ * type for more details.
1321
+ *
1322
+ * Note the use of dotted 'tableId.cellId' string pairs when specifying custom
1323
+ * rendering for the cells in this table, since Cells from both the
1324
+ * relationship's 'local' and 'remote' Table objects can be rendered and need to
1325
+ * be distinguished.
1326
+ *
1327
+ * This component uses the useRowIds and useRemoteRowId hooks under the covers,
1328
+ * which means that any changes to the structure of either Table resulting in a
1329
+ * change to the relationship will cause a re-render.
1330
+ *
1331
+ * You can use the `headerRow` and `idColumn` props to control whether labels
1332
+ * and Ids appear in a <th> element at the top of the table, and the start of
1333
+ * each row.
1334
+ * @param props The props for this component.
1335
+ * @returns A rendering of the two Tables linked by a Relationship in a
1336
+ * <table> element.
1337
+ * @example
1338
+ * This example creates a Provider context into which a default Relationships
1339
+ * object is provided. The RelationshipInHtmlTable component within it then
1340
+ * renders the two Tables linked by a relationship in a <table> element with a
1341
+ * CSS class. Note the dotted pairs that are used as column headings.
1342
+ *
1343
+ * ```jsx
1344
+ * import {render} from 'solid-js/web';
1345
+ * import {createRelationships, createStore} from 'tinybase';
1346
+ * import {Provider} from 'tinybase/ui-solid';
1347
+ * import {RelationshipInHtmlTable} from 'tinybase/ui-solid-dom';
1348
+ *
1349
+ * const App = ({relationships}) => (
1350
+ * <Provider relationships={relationships}>
1351
+ * <Pane />
1352
+ * </Provider>
1353
+ * );
1354
+ * const Pane = () => (
1355
+ * <RelationshipInHtmlTable
1356
+ * relationshipId="petSpecies"
1357
+ * className="relationship"
1358
+ * />
1359
+ * );
1360
+ *
1361
+ * const relationships = createRelationships(
1362
+ * createStore()
1363
+ * .setTable('pets', {fido: {species: 'dog'}, cujo: {species: 'dog'}})
1364
+ * .setTable('species', {wolf: {price: 10}, dog: {price: 5}}),
1365
+ * ).setRelationshipDefinition('petSpecies', 'pets', 'species', 'species');
1366
+ *
1367
+ * const app = document.createElement('div');
1368
+ * render(() => <App relationships={relationships} />, app); // !act
1369
+ * console.log(app.innerHTML);
1370
+ * // ->
1371
+ * `
1372
+ * <table class="relationship">
1373
+ * <thead>
1374
+ * <tr>
1375
+ * <th>pets.Id</th>
1376
+ * <th>species.Id</th>
1377
+ * <th>pets.species</th>
1378
+ * <th>species.price</th>
1379
+ * </tr>
1380
+ * </thead>
1381
+ * <tbody>
1382
+ * <tr>
1383
+ * <th title="fido">fido</th>
1384
+ * <th title="dog">dog</th>
1385
+ * <td>dog</td>
1386
+ * <td>5</td>
1387
+ * </tr>
1388
+ * <tr>
1389
+ * <th title="cujo">cujo</th>
1390
+ * <th title="dog">dog</th>
1391
+ * <td>dog</td>
1392
+ * <td>5</td>
1393
+ * </tr>
1394
+ * </tbody>
1395
+ * </table>
1396
+ * `;
1397
+ * ```
1398
+ * @example
1399
+ * This example creates a Provider context into which a default Relationships
1400
+ * object is provided. The RelationshipInHtmlTable component within it then
1401
+ * renders the two Tables linked by a relationship with a custom component and a
1402
+ * custom props callback for the `species` Cell. The header row at the top of
1403
+ * the table and the Id column at the start of each row is removed.
1404
+ *
1405
+ * ```jsx
1406
+ * import {render} from 'solid-js/web';
1407
+ * import {createRelationships, createStore} from 'tinybase';
1408
+ * import {CellView, Provider} from 'tinybase/ui-solid';
1409
+ * import {RelationshipInHtmlTable} from 'tinybase/ui-solid-dom';
1410
+ *
1411
+ * const App = ({relationships}) => (
1412
+ * <Provider relationships={relationships}>
1413
+ * <Pane />
1414
+ * </Provider>
1415
+ * );
1416
+ * const Pane = () => (
1417
+ * <RelationshipInHtmlTable
1418
+ * relationshipId="petSpecies"
1419
+ * customCells={customCells}
1420
+ * idColumn={false}
1421
+ * headerRow={false}
1422
+ * />
1423
+ * );
1424
+ *
1425
+ * const FormattedCellView = ({tableId, rowId, cellId, store, bold}) => (
1426
+ * <>
1427
+ * {bold ? <b>{rowId}</b> : rowId}:
1428
+ * <CellView
1429
+ * tableId={tableId}
1430
+ * rowId={rowId}
1431
+ * cellId={cellId}
1432
+ * store={store}
1433
+ * />
1434
+ * </>
1435
+ * );
1436
+ * const customCells = {
1437
+ * 'species.price': {
1438
+ * component: FormattedCellView,
1439
+ * getComponentProps: (rowId) => ({bold: rowId == 'dog'}),
1440
+ * },
1441
+ * };
1442
+ *
1443
+ * const relationships = createRelationships(
1444
+ * createStore()
1445
+ * .setTable('pets', {fido: {species: 'dog'}, cujo: {species: 'wolf'}})
1446
+ * .setTable('species', {wolf: {price: 10}, dog: {price: 5}}),
1447
+ * ).setRelationshipDefinition('petSpecies', 'pets', 'species', 'species');
1448
+ *
1449
+ * const app = document.createElement('div');
1450
+ * render(() => <App relationships={relationships} />, app); // !act
1451
+ * console.log(app.innerHTML);
1452
+ * // ->
1453
+ * `
1454
+ * <table>
1455
+ * <tbody>
1456
+ * <tr>
1457
+ * <td><b>dog</b>:5</td>
1458
+ * </tr>
1459
+ * <tr>
1460
+ * <td>wolf:10</td>
1461
+ * </tr>
1462
+ * </tbody>
1463
+ * </table>
1464
+ * `;
1465
+ * ```
1466
+ * @category Other components
1467
+ * @since v8.4.0
1468
+ */
1469
+ RelationshipInHtmlTable: (
1470
+ props: RelationshipInHtmlTableProps<Schemas> & HtmlTableProps,
1471
+ ) => ComponentReturnType;
1472
+
1473
+ /**
1474
+ * The ResultTableInHtmlTable component renders the contents of a single query's
1475
+ * ResultTable in a Queries object as an HTML <table> element, and registers a
1476
+ * listener so that any changes to that result will cause a re-render.
1477
+ *
1478
+ * This has schema-based typing. The following is a simplified representation:
1479
+ *
1480
+ * ```ts override
1481
+ * ResultTableInHtmlTable(
1482
+ * props: ResultTableInHtmlTableProps & HtmlTableProps,
1483
+ * ): ComponentReturnType;
1484
+ * ```
1485
+ *
1486
+ * See the <ResultTableInHtmlTable /> (Solid) demo for this component in
1487
+ * action:
1488
+ *
1489
+ * ![ResultTableInHtmlTable example](https://beta.tinybase.org/shots/resulttableinhtmltable-solid-demo.png
1490
+ * "ResultTableInHtmlTable example")
1491
+ *
1492
+ * The component's props identify which ResultTable to render based on query Id,
1493
+ * and Queries object (which is either the default context Queries object, a
1494
+ * named context Queries object, or by explicit reference).
1495
+ *
1496
+ * This component renders a ResultTable by iterating over its Row objects. By
1497
+ * default the Cells are in turn rendered with the CellView component, but you
1498
+ * can override this behavior by providing a `component` for each Cell in the
1499
+ * `customCells` prop. You can pass additional props to that custom component
1500
+ * with the `getComponentProps` callback. See the ResultCustomCell type for more
1501
+ * details.
1502
+ *
1503
+ * This component uses the useRowIds hook under the covers, which means that any
1504
+ * changes to the structure of the Table will cause a re-render.
1505
+ *
1506
+ * You can use the `headerRow` and `idColumn` props to control whether the Ids
1507
+ * appear in a <th> element at the top of the table, and the start of each row.
1508
+ * @param props The props for this component.
1509
+ * @returns A rendering of the ResultTable in a <table> element.
1510
+ * @example
1511
+ * This example creates a Provider context into which a default Queries object
1512
+ * is provided. The ResultTableInHtmlTable component within it then renders the
1513
+ * ResultTable in a <table> element with a CSS class.
1514
+ *
1515
+ * ```jsx
1516
+ * import {render} from 'solid-js/web';
1517
+ * import {createQueries, createStore} from 'tinybase';
1518
+ * import {Provider} from 'tinybase/ui-solid';
1519
+ * import {ResultTableInHtmlTable} from 'tinybase/ui-solid-dom';
1520
+ *
1521
+ * const App = ({queries}) => (
1522
+ * <Provider queries={queries}>
1523
+ * <Pane />
1524
+ * </Provider>
1525
+ * );
1526
+ * const Pane = () => (
1527
+ * <ResultTableInHtmlTable queryId="petColors" className="table" />
1528
+ * );
1529
+ *
1530
+ * const queries = createQueries(
1531
+ * createStore().setTable('pets', {
1532
+ * fido: {species: 'dog', color: 'brown'},
1533
+ * felix: {species: 'cat', color: 'black'},
1534
+ * }),
1535
+ * ).setQueryDefinition('petColors', 'pets', ({select}) => select('color'));
1536
+ * const app = document.createElement('div');
1537
+ * render(() => <App queries={queries} />, app); // !act
1538
+ * console.log(app.innerHTML);
1539
+ * // ->
1540
+ * `
1541
+ * <table class="table">
1542
+ * <thead>
1543
+ * <tr>
1544
+ * <th>Id</th>
1545
+ * <th>color</th>
1546
+ * </tr>
1547
+ * </thead>
1548
+ * <tbody>
1549
+ * <tr>
1550
+ * <th title="fido">fido</th>
1551
+ * <td>brown</td>
1552
+ * </tr>
1553
+ * <tr>
1554
+ * <th title="felix">felix</th>
1555
+ * <td>black</td>
1556
+ * </tr>
1557
+ * </tbody>
1558
+ * </table>
1559
+ * `;
1560
+ * ```
1561
+ * @example
1562
+ * This example creates a Provider context into which a default Queries object
1563
+ * is provided. The ResultTableInHtmlTable component within it then renders the
1564
+ * ResultTable with a custom component and a custom props callback for the
1565
+ * `color` Cell. The header row at the top of the table and the Id column at
1566
+ * the start of each row is removed.
1567
+ *
1568
+ * ```jsx
1569
+ * import {render} from 'solid-js/web';
1570
+ * import {createQueries, createStore} from 'tinybase';
1571
+ * import {Provider, ResultCellView} from 'tinybase/ui-solid';
1572
+ * import {ResultTableInHtmlTable} from 'tinybase/ui-solid-dom';
1573
+ *
1574
+ * const App = ({queries}) => (
1575
+ * <Provider queries={queries}>
1576
+ * <Pane />
1577
+ * </Provider>
1578
+ * );
1579
+ * const Pane = () => (
1580
+ * <ResultTableInHtmlTable
1581
+ * queryId="petColors"
1582
+ * customCells={customCells}
1583
+ * headerRow={false}
1584
+ * idColumn={false}
1585
+ * />
1586
+ * );
1587
+ *
1588
+ * const FormattedResultCellView = ({queryId, rowId, cellId, bold}) => (
1589
+ * <>
1590
+ * {bold ? <b>{rowId}</b> : rowId}:
1591
+ * <ResultCellView queryId={queryId} rowId={rowId} cellId={cellId} />
1592
+ * </>
1593
+ * );
1594
+ * const customCells = {
1595
+ * color: {
1596
+ * component: FormattedResultCellView,
1597
+ * getComponentProps: (rowId) => ({bold: rowId == 'fido'}),
1598
+ * },
1599
+ * };
1600
+ *
1601
+ * const queries = createQueries(
1602
+ * createStore().setTable('pets', {
1603
+ * fido: {species: 'dog', color: 'brown'},
1604
+ * felix: {species: 'cat', color: 'black'},
1605
+ * }),
1606
+ * ).setQueryDefinition('petColors', 'pets', ({select}) => select('color'));
1607
+ * const app = document.createElement('div');
1608
+ * render(() => <App queries={queries} />, app); // !act
1609
+ * console.log(app.innerHTML);
1610
+ * // ->
1611
+ * `
1612
+ * <table>
1613
+ * <tbody>
1614
+ * <tr>
1615
+ * <td><b>fido</b>:brown</td>
1616
+ * </tr>
1617
+ * <tr>
1618
+ * <td>felix:black</td>
1619
+ * </tr>
1620
+ * </tbody>
1621
+ * </table>
1622
+ * `;
1623
+ * ```
1624
+ * @category Queries components
1625
+ * @since v8.4.0
1626
+ */
1627
+ ResultTableInHtmlTable: (
1628
+ props: ResultTableInHtmlTableProps<Schemas> & HtmlTableProps,
1629
+ ) => ComponentReturnType;
1630
+
1631
+ /**
1632
+ * The SortedTableInHtmlTable component renders the contents of a single query's
1633
+ * sorted ResultTable in a Queries object as an HTML <table> element, and
1634
+ * registers a listener so that any changes to that result will cause a
1635
+ * re-render.
1636
+ *
1637
+ * This has schema-based typing. The following is a simplified representation:
1638
+ *
1639
+ * ```ts override
1640
+ * ResultSortedTableInHtmlTable(
1641
+ * props: ResultSortedTableInHtmlTableProps & HtmlTableProps,
1642
+ * ): ComponentReturnType;
1643
+ * ```
1644
+ *
1645
+ * See the <ResultSortedTableInHtmlTable /> (Solid) demo for this component in
1646
+ * action:
1647
+ *
1648
+ * ![ResultSortedTableInHtmlTable example](https://beta.tinybase.org/shots/resultsortedtableinhtmltable-solid-demo.png
1649
+ * "ResultSortedTableInHtmlTable example")
1650
+ *
1651
+ * The component's props identify which ResultTable to render based on query Id,
1652
+ * and Queries object (which is either the default context Queries object, a
1653
+ * named context Queries object, or by explicit reference). It also takes a Cell
1654
+ * Id to sort by and a boolean to indicate that the sorting should be in
1655
+ * descending order. The `offset` and `limit` props are used to paginate
1656
+ * results, but default to `0` and `undefined` to return all available Row Ids
1657
+ * if not specified.
1658
+ *
1659
+ * This component renders a ResultTable by iterating over its Row objects, in
1660
+ * the order dictated by the sort parameters. By default the Cells are in turn
1661
+ * rendered with the CellView component, but you can override this behavior by
1662
+ * providing a `component` for each Cell in the `customCells` prop. You can pass
1663
+ * additional props to that custom component with the `getComponentProps`
1664
+ * callback. See the ResultCustomCell type for more details.
1665
+ *
1666
+ * This component uses the useSortedRowIds hook under the covers, which means
1667
+ * that any changes to the structure or sorting of the ResultTable will cause a
1668
+ * re-render.
1669
+ *
1670
+ * You can use the `headerRow` and `idColumn` props to control whether the Ids
1671
+ * appear in a <th> element at the top of the table, and the start of each row.
1672
+ *
1673
+ * The `sortOnClick` prop makes the table's sorting interactive such that the
1674
+ * user can click on a column heading to sort by that column. The style classes
1675
+ * `sorted` and `ascending` (or `descending`) are added so that you can provide
1676
+ * hints to the user how the sorting is being applied.
1677
+ *
1678
+ * Provide a paginator component for the ResultTable with the `paginator` prop.
1679
+ * Set to `true` to use the default SortedTablePaginator, or provide your own
1680
+ * component that accepts SortedTablePaginatorProps.
1681
+ *
1682
+ * Finally, the `onChange` prop lets you listen to a user's changes to the
1683
+ * ResultTable's sorting or pagination.
1684
+ * @param props The props for this component.
1685
+ * @returns A rendering of the ResultTable in a <table> element.
1686
+ * @example
1687
+ * This example creates a Provider context into which a default Queries object
1688
+ * is provided. The ResultSortedTableInHtmlTable component within it then
1689
+ * renders the ResultTable in a <table> element with a CSS class.
1690
+ *
1691
+ * ```jsx
1692
+ * import {render} from 'solid-js/web';
1693
+ * import {createQueries, createStore} from 'tinybase';
1694
+ * import {Provider} from 'tinybase/ui-solid';
1695
+ * import {ResultSortedTableInHtmlTable} from 'tinybase/ui-solid-dom';
1696
+ *
1697
+ * const App = ({queries}) => (
1698
+ * <Provider queries={queries}>
1699
+ * <Pane />
1700
+ * </Provider>
1701
+ * );
1702
+ * const Pane = () => (
1703
+ * <ResultSortedTableInHtmlTable
1704
+ * queryId="petColors"
1705
+ * cellId="color"
1706
+ * className="table"
1707
+ * />
1708
+ * );
1709
+ *
1710
+ * const queries = createQueries(
1711
+ * createStore().setTable('pets', {
1712
+ * fido: {species: 'dog', color: 'brown'},
1713
+ * felix: {species: 'cat', color: 'black'},
1714
+ * }),
1715
+ * ).setQueryDefinition('petColors', 'pets', ({select}) => select('color'));
1716
+ * const app = document.createElement('div');
1717
+ * render(() => <App queries={queries} />, app); // !act
1718
+ * console.log(app.innerHTML);
1719
+ * // ->
1720
+ * `
1721
+ * <table class="table">
1722
+ * <thead>
1723
+ * <tr>
1724
+ * <th>Id</th>
1725
+ * <th class="sorted ascending">↑ color</th>
1726
+ * </tr>
1727
+ * </thead>
1728
+ * <tbody>
1729
+ * <tr>
1730
+ * <th title="felix">felix</th>
1731
+ * <td>black</td>
1732
+ * </tr>
1733
+ * <tr>
1734
+ * <th title="fido">fido</th>
1735
+ * <td>brown</td>
1736
+ * </tr>
1737
+ * </tbody>
1738
+ * </table>
1739
+ * `;
1740
+ * ```
1741
+ * @example
1742
+ * This example creates a Provider context into which a default Queries object
1743
+ * is provided. The ResultSortedTableInHtmlTable component within it then
1744
+ * renders the ResultTable with a custom component and a custom props callback
1745
+ * for the `color` Cell. The header row at the top of the table and the Id
1746
+ * column at the start of each row is removed.
1747
+ *
1748
+ * ```jsx
1749
+ * import {render} from 'solid-js/web';
1750
+ * import {createQueries, createStore} from 'tinybase';
1751
+ * import {Provider, ResultCellView} from 'tinybase/ui-solid';
1752
+ * import {ResultSortedTableInHtmlTable} from 'tinybase/ui-solid-dom';
1753
+ *
1754
+ * const App = ({queries}) => (
1755
+ * <Provider queries={queries}>
1756
+ * <Pane />
1757
+ * </Provider>
1758
+ * );
1759
+ *
1760
+ * const Pane = () => (
1761
+ * <ResultSortedTableInHtmlTable
1762
+ * queryId="petColors"
1763
+ * cellId="color"
1764
+ * customCells={customCells}
1765
+ * headerRow={false}
1766
+ * idColumn={false}
1767
+ * />
1768
+ * );
1769
+ *
1770
+ * const FormattedResultCellView = ({queryId, rowId, cellId, bold}) => (
1771
+ * <>
1772
+ * {bold ? <b>{rowId}</b> : rowId}:
1773
+ * <ResultCellView queryId={queryId} rowId={rowId} cellId={cellId} />
1774
+ * </>
1775
+ * );
1776
+ * const customCells = {
1777
+ * color: {
1778
+ * component: FormattedResultCellView,
1779
+ * getComponentProps: (rowId) => ({bold: rowId == 'fido'}),
1780
+ * },
1781
+ * };
1782
+ *
1783
+ * const queries = createQueries(
1784
+ * createStore().setTable('pets', {
1785
+ * fido: {species: 'dog', color: 'brown'},
1786
+ * felix: {species: 'cat', color: 'black'},
1787
+ * }),
1788
+ * ).setQueryDefinition('petColors', 'pets', ({select}) => select('color'));
1789
+ * const app = document.createElement('div');
1790
+ * render(() => <App queries={queries} />, app); // !act
1791
+ * console.log(app.innerHTML);
1792
+ * // ->
1793
+ * `
1794
+ * <table>
1795
+ * <tbody>
1796
+ * <tr>
1797
+ * <td>felix:black</td>
1798
+ * </tr>
1799
+ * <tr>
1800
+ * <td><b>fido</b>:brown</td>
1801
+ * </tr>
1802
+ * </tbody>
1803
+ * </table>
1804
+ * `;
1805
+ * ```
1806
+ * @category Queries components
1807
+ * @since v8.4.0
1808
+ */
1809
+ ResultSortedTableInHtmlTable: (
1810
+ props: ResultSortedTableInHtmlTableProps<Schemas> & HtmlTableProps,
1811
+ ) => ComponentReturnType;
1812
+
1813
+ /**
1814
+ * The EditableCellView component renders the value of a single Cell in a way
1815
+ * that can be edited in a web browser, and registers a listener so that any
1816
+ * changes to that result will cause a re-render.
1817
+ *
1818
+ * This has schema-based typing. The following is a simplified representation:
1819
+ *
1820
+ * ```ts override
1821
+ * EditableCellView(
1822
+ * props: CellProps & {readonly className?: string; readonly showType?: boolean},
1823
+ * ): ComponentReturnType;
1824
+ * ```
1825
+ *
1826
+ * See the <EditableCellView /> (Solid) demo for this component in action:
1827
+ *
1828
+ * ![EditableCellView example](https://beta.tinybase.org/shots/editablecellview-solid-demo.png
1829
+ * "EditableCellView example")
1830
+ *
1831
+ * The component's props identify which Cell to render based on Table Id, Row
1832
+ * Id, Cell Id, and Store (which is either the default context Store, a named
1833
+ * context Store, or an explicit reference).
1834
+ *
1835
+ * A Cell contains a string, number, boolean, object or array (since v8.0) so
1836
+ * the value is rendered in an appropriate <input> tag, possibly as JSON and a
1837
+ * button lets the user cycle through the types.
1838
+ *
1839
+ * Set the `showType` prop to false to remove the ability for the user to see or
1840
+ * change the Cell type. They will also not be able to change the type if there
1841
+ * is a TablesSchema applied to the Store.
1842
+ *
1843
+ * This component uses the useCell hook under the covers, which means that any
1844
+ * changes to the specified Cell outside of this component will cause a
1845
+ * re-render.
1846
+ *
1847
+ * You can provide a custom className prop which well be used on the root of the
1848
+ * resulting element. If omitted the element's class will be `editableCell`. The
1849
+ * debugIds prop has no effect on this component.
1850
+ * @param props The props for this component.
1851
+ * @returns An editable rendering of the Cell.
1852
+ * @example
1853
+ * This example creates a Provider context into which a default Store is
1854
+ * provided. The EditableCellView component within it then renders an editable
1855
+ * Cell.
1856
+ *
1857
+ * ```jsx
1858
+ * import {render} from 'solid-js/web';
1859
+ * import {createStore} from 'tinybase';
1860
+ * import {Provider} from 'tinybase/ui-solid';
1861
+ * import {EditableCellView} from 'tinybase/ui-solid-dom';
1862
+ *
1863
+ * const App = ({store}) => (
1864
+ * <Provider store={store}>
1865
+ * <Pane />
1866
+ * </Provider>
1867
+ * );
1868
+ * const Pane = () => (
1869
+ * <EditableCellView tableId="pets" rowId="fido" cellId="color" />
1870
+ * );
1871
+ *
1872
+ * const store = createStore().setCell('pets', 'fido', 'color', 'brown');
1873
+ * const app = document.createElement('div');
1874
+ * render(() => <App store={store} />, app); // !act
1875
+ * console.log(app.innerHTML);
1876
+ * // ->
1877
+ * `
1878
+ * <div class="editableCell">
1879
+ * <button title="string" class="string">string</button>
1880
+ * <input value="brown">
1881
+ * </div>
1882
+ * `;
1883
+ * ```
1884
+ * @category Store components
1885
+ * @since v8.4.0
1886
+ */
1887
+ EditableCellView: (
1888
+ props: CellProps<Schemas> & {
1889
+ className?: string;
1890
+ readonly showType?: boolean;
1891
+ },
1892
+ ) => ComponentReturnType;
1893
+
1894
+ /**
1895
+ * The EditableValueView component renders the value of a single Value in a way
1896
+ * that can be edited in a web browser, and registers a listener so that any
1897
+ * changes to that result will cause a re-render.
1898
+ *
1899
+ * This has schema-based typing. The following is a simplified representation:
1900
+ *
1901
+ * ```ts override
1902
+ * EditableValueView(
1903
+ * props: ValueProps & {
1904
+ * readonly className?: string;
1905
+ * readonly showType?: boolean;
1906
+ * },
1907
+ * ): ComponentReturnType;
1908
+ * ```
1909
+ *
1910
+ * See the <EditableValueView /> (Solid) demo for this component in action:
1911
+ *
1912
+ * ![EditableValueView example](https://beta.tinybase.org/shots/editablevalueview-solid-demo.png
1913
+ * "EditableValueView example")
1914
+ *
1915
+ * The component's props identify which Value to render based on Table Id, Row
1916
+ * Id, Value Id, and Store (which is either the default context Store, a named
1917
+ * context Store, or an explicit reference).
1918
+ *
1919
+ * A Value contains a string, number, boolean, object or array (since v8.0) so
1920
+ * the value is rendered in an appropriate <input> tag, possibly as JSON and a
1921
+ * button lets the user cycle through the types.
1922
+ *
1923
+ * Set the `showType` prop to false to remove the ability for the user to see or
1924
+ * change the Value type. They will also not be able to change the type if there
1925
+ * is a ValuesSchema applied to the Store.
1926
+ *
1927
+ * This component uses the useValue hook under the covers, which means that any
1928
+ * changes to the specified Value outside of this component will cause a
1929
+ * re-render.
1930
+ *
1931
+ * You can provide a custom className prop which well be used on the root of the
1932
+ * resulting element. If omitted the element's class will be `editableValue`.
1933
+ * The debugIds prop has no effect on this component.
1934
+ * @param props The props for this component.
1935
+ * @returns An editable rendering of the Value.
1936
+ * @example
1937
+ * This example creates a Provider context into which a default Store is
1938
+ * provided. The EditableValueView component within it then renders an editable
1939
+ * Value.
1940
+ *
1941
+ * ```jsx
1942
+ * import {render} from 'solid-js/web';
1943
+ * import {createStore} from 'tinybase';
1944
+ * import {Provider} from 'tinybase/ui-solid';
1945
+ * import {EditableValueView} from 'tinybase/ui-solid-dom';
1946
+ *
1947
+ * const App = ({store}) => (
1948
+ * <Provider store={store}>
1949
+ * <Pane />
1950
+ * </Provider>
1951
+ * );
1952
+ * const Pane = () => <EditableValueView valueId="employees" />;
1953
+ *
1954
+ * const store = createStore().setValue('employees', 3);
1955
+ * const app = document.createElement('div');
1956
+ * render(() => <App store={store} />, app); // !act
1957
+ * console.log(app.innerHTML);
1958
+ * // ->
1959
+ * `
1960
+ * <div class="editableValue">
1961
+ * <button title="number" class="number">number</button>
1962
+ * <input type="number" value="3">
1963
+ * </div>
1964
+ * `;
1965
+ * ```
1966
+ * @category Store components
1967
+ * @since v8.4.0
1968
+ */
1969
+ EditableValueView: (
1970
+ props: ValueProps<Schemas> & {
1971
+ className?: string;
1972
+ readonly showType?: boolean;
1973
+ },
1974
+ ) => ComponentReturnType;
1975
+
1976
+ /**
1977
+ * The SortedTablePaginator component renders a paginator for a sorted table.
1978
+ *
1979
+ * See the <SortedTableInHtmlTable /> (Solid) demo for this component in
1980
+ * action:
1981
+ *
1982
+ * ![SortedTablePaginator example](https://beta.tinybase.org/shots/sortedtablepaginator-solid-demo.png
1983
+ * "SortedTablePaginator example")
1984
+ *
1985
+ * The component displays 'previous' and 'next' buttons for paging through the
1986
+ * Table if there are more Row Ids than fit in each page. The component will
1987
+ * also display a label that shows which Row Ids are being displayed.
1988
+ *
1989
+ * The component's props identify initial pagination settings, and it will fire
1990
+ * an event when the pagination changes.
1991
+ * @param props The props for this component.
1992
+ * @returns The rendering of a paginator control with a label, and next and
1993
+ * previous buttons, where appropriate.
1994
+ * @example
1995
+ * This example creates a Provider context into which a default Store is
1996
+ * provided. The SortedTableInHtmlTable component within it then renders the
1997
+ * Table in a <table> element with a SortedTablePaginator (the default).
1998
+ *
1999
+ * ```jsx
2000
+ * import {render} from 'solid-js/web';
2001
+ * import {createStore} from 'tinybase';
2002
+ * import {Provider} from 'tinybase/ui-solid';
2003
+ * import {SortedTableInHtmlTable} from 'tinybase/ui-solid-dom';
2004
+ *
2005
+ * const App = ({store}) => (
2006
+ * <Provider store={store}>
2007
+ * <Pane />
2008
+ * </Provider>
2009
+ * );
2010
+ * const Pane = () => (
2011
+ * <SortedTableInHtmlTable
2012
+ * tableId="pets"
2013
+ * cellId="species"
2014
+ * limit={2}
2015
+ * paginator={true}
2016
+ * />
2017
+ * );
2018
+ *
2019
+ * const store = createStore().setTables({
2020
+ * pets: {
2021
+ * fido: {species: 'dog'},
2022
+ * felix: {species: 'cat'},
2023
+ * cujo: {species: 'wolf'},
2024
+ * lowly: {species: 'worm'},
2025
+ * polly: {species: 'parrot'},
2026
+ * },
2027
+ * });
2028
+ * const app = document.createElement('div');
2029
+ * render(() => <App store={store} />, app); // !act
2030
+ * console.log(app.innerHTML);
2031
+ * // ->
2032
+ * `
2033
+ * <table>
2034
+ * <caption>
2035
+ * <button class="previous" disabled="">←</button>
2036
+ * <button class="next">→</button>
2037
+ * 1 to 2 of 5 rows
2038
+ * </caption>
2039
+ * <thead>
2040
+ * <tr>
2041
+ * <th>Id</th>
2042
+ * <th class="sorted ascending">↑ species</th>
2043
+ * </tr>
2044
+ * </thead>
2045
+ * <tbody>
2046
+ * <tr>
2047
+ * <th title="felix">felix</th>
2048
+ * <td>cat</td>
2049
+ * </tr>
2050
+ * <tr>
2051
+ * <th title="fido">fido</th>
2052
+ * <td>dog</td>
2053
+ * </tr>
2054
+ * </tbody>
2055
+ * </table>
2056
+ * `;
2057
+ * ```
2058
+ * @category Store components
2059
+ * @since v8.4.0
2060
+ */
2061
+ SortedTablePaginator: (
2062
+ props: SortedTablePaginatorProps,
2063
+ ) => ComponentReturnType;
2064
+ };