@umriss-ui/table 0.46.0 → 0.47.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/CHANGELOG.md +15 -2
- package/dist/index.d.ts +79 -4
- package/dist/table.js +1362 -1329
- package/docs/llms-full.md +245 -36
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,13 +5,13 @@ props, behaviour.
|
|
|
5
5
|
|
|
6
6
|
**The numbers** follow the rule of `@umriss-ui/core` and `@umriss-ui/charts`: the
|
|
7
7
|
middle digit rises when something is added, the last one when something is
|
|
8
|
-
repaired. The
|
|
8
|
+
repaired. The seven packages are released in step, and a rename keeps its old name
|
|
9
9
|
for one further minor, with a warning, before the minor after it removes the name
|
|
10
10
|
([the upgrade promise, ADR-0066](../../docs/adr/0066-one-number-peers-over-the-minor-a-rename-lives-one-minor.md)).
|
|
11
11
|
**Whatever changes existing behaviour stands under a heading "Changed" of its
|
|
12
12
|
own**, no matter which digit rose, with a `Migration:` line.
|
|
13
13
|
|
|
14
|
-
From 0.34.0 the packages share one number - five,
|
|
14
|
+
From 0.34.0 the packages share one number - five, six from 0.40.0, when the dashboard joined, and seven from 0.47.0, when alarms joined: they are released together, and a package without a change of its own still gets a heading for it.
|
|
15
15
|
|
|
16
16
|
**Names read forwards.** Where an entry describes a name that has since been
|
|
17
17
|
renamed, it is named here as it is called today; names that were removed stand
|
|
@@ -26,6 +26,19 @@ is one of the internal numbers from before core's first publication as `0.1.0`
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
+
## 0.47.0 – The alarm package's table, seconds, and a selection a grid announces (Oct. 2026)
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- **`tableModel`**, the table's pipeline as a pure function - filter, sort, page over rows and model columns; the types `TableProjection` and `Line` join the main entry.
|
|
34
|
+
- **`format="timeWithSeconds"` and `format="dateTimeWithSeconds"`** write a point in time with its seconds, in the cell, the list filter, the group line and the aggregate, in the formats' own notation (German included). The CSV and the XLSX keep the timestamp.
|
|
35
|
+
- **A grid with `selectable` announces its selection:** the grid carries `aria-multiselectable` and every body row `aria-selected`; a click on a box, Space on a row and "select all" announce the count ("3 selected"). A selection changed from outside is not announced; a native table keeps its checkboxes as the carrier.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- **The peer range on core moves to `^0.47.0`.**
|
|
40
|
+
- Migration: install the 0.47 version of `@umriss-ui/core` beside it.
|
|
41
|
+
|
|
29
42
|
## 0.46.0 – Row ranges, a column drag, and a view that survives JSON (Oct. 2026)
|
|
30
43
|
|
|
31
44
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ButtonProps } from '@umriss-ui/core';
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
|
+
import { FlatteningEntry } from '@umriss-ui/core';
|
|
3
4
|
import { Formats } from '@umriss-ui/core';
|
|
4
5
|
import { HTMLAttributes } from 'react';
|
|
5
6
|
import { InputProps } from '@umriss-ui/core';
|
|
@@ -297,8 +298,17 @@ export declare type Computed<Z, W> = ColumnBase & ValuePaths<W> & {
|
|
|
297
298
|
other points in time as ISO text. */
|
|
298
299
|
export declare const csv: ExportFormat;
|
|
299
300
|
|
|
300
|
-
|
|
301
|
-
|
|
301
|
+
declare const DATE_FORMATS: readonly ["date", "time", "dateTime", "timeWithSeconds", "dateTimeWithSeconds"];
|
|
302
|
+
|
|
303
|
+
/** The names of the standard presentations of a point in time, with the English
|
|
304
|
+
text of 17 March 2026 at 09:05:03 for each:
|
|
305
|
+
- `"date"`: "17/03/2026"
|
|
306
|
+
- `"time"`: "09:05"
|
|
307
|
+
- `"dateTime"`: "17/03/2026, 09:05"
|
|
308
|
+
- `"timeWithSeconds"`: "09:05:03"
|
|
309
|
+
- `"dateTimeWithSeconds"`: "17/03/2026, 09:05:03"
|
|
310
|
+
German formats write the same with "17.03.2026". */
|
|
311
|
+
export declare type DateFormat = (typeof DATE_FORMATS)[number];
|
|
302
312
|
|
|
303
313
|
/** The span a point in time is grouped by. */
|
|
304
314
|
export declare type DatePeriod = "day" | "week" | "month" | "year";
|
|
@@ -407,8 +417,8 @@ export declare type FieldColumn<Z, K extends Field<Z>> = ColumnBase & ValuePaths
|
|
|
407
417
|
/** An id of one's own instead of the field name – for two columns over the same field. */
|
|
408
418
|
id?: string;
|
|
409
419
|
/** A standard presentation by name: `"percent"`, `"count"` or
|
|
410
|
-
`{ decimals }` for numbers, `"date"`, `"time"
|
|
411
|
-
points in time. Alignment, sorting, export and footer stay with the value. */
|
|
420
|
+
`{ decimals }` for numbers, `"date"`, `"time"`, `"dateTime"`,
|
|
421
|
+
`"timeWithSeconds"` or `"dateTimeWithSeconds"` for points in time. Alignment, sorting, export and footer stay with the value. */
|
|
412
422
|
format?: FormatFor<Z[K]>;
|
|
413
423
|
/** A filter in the column header: `"list"` offers the values that occur,
|
|
414
424
|
`"range"` two bounds (numbers or points in time), a filter from
|
|
@@ -500,6 +510,33 @@ export declare interface GroupLevel<Z> {
|
|
|
500
510
|
aggregates a column offers. */
|
|
501
511
|
export declare type IsDisplayable<W> = [Present<W>] extends [never] ? false : [Present<W>] extends [Displayable] ? true : false;
|
|
502
512
|
|
|
513
|
+
/** One line of a grouped table. A header heads a group of an outer level; a row
|
|
514
|
+
of the innermost level stands in its span; a folded span is one line. */
|
|
515
|
+
export declare type Line<Z> = {
|
|
516
|
+
kind: "header";
|
|
517
|
+
group: RowGroup<Z>;
|
|
518
|
+
/** The headers around it. */
|
|
519
|
+
parents: readonly RowGroup<Z>[];
|
|
520
|
+
/** Repeated at the top of a page that begins inside the group. */
|
|
521
|
+
continued: boolean;
|
|
522
|
+
} | {
|
|
523
|
+
kind: "row";
|
|
524
|
+
row: Z;
|
|
525
|
+
parents: readonly RowGroup<Z>[];
|
|
526
|
+
/** The span the row stands in - the innermost group, when there are
|
|
527
|
+
several levels; a single level has no span, its rows stand under
|
|
528
|
+
their group header. */
|
|
529
|
+
span: RowGroup<Z> | undefined;
|
|
530
|
+
/** The span shows its value on this line: the group's first row, or the
|
|
531
|
+
first of a page that begins inside it. */
|
|
532
|
+
first: boolean;
|
|
533
|
+
continued: boolean;
|
|
534
|
+
} | {
|
|
535
|
+
kind: "folded";
|
|
536
|
+
group: RowGroup<Z>;
|
|
537
|
+
parents: readonly RowGroup<Z>[];
|
|
538
|
+
};
|
|
539
|
+
|
|
503
540
|
/** The condition of a list filter: the chosen values, an absent one as `null`. */
|
|
504
541
|
export declare type ListCondition<W> = readonly (Present<W> | null)[];
|
|
505
542
|
|
|
@@ -813,6 +850,9 @@ export declare interface TableInput<Z = unknown, K extends string = string> {
|
|
|
813
850
|
tree?: TreeInput<Z>;
|
|
814
851
|
}
|
|
815
852
|
|
|
853
|
+
/** The table's pipeline as a pure function - filter, sort, page over rows and model columns. */
|
|
854
|
+
export declare function tableModel<Z, K extends string = string>(rows: readonly Z[], columns: readonly ModelColumn<Z, K>[], input: TableInput<Z, K>): TableProjection<Z, K>;
|
|
855
|
+
|
|
816
856
|
/** The options of `useTable`: automatic, or in server mode over a server's rows. */
|
|
817
857
|
export declare type TableOptions<Z> = TableOptionsCommon<Z> & (AutomaticMode<Z> | ServerMode<Z>);
|
|
818
858
|
|
|
@@ -859,6 +899,41 @@ declare interface TableOptionsCommon<Z> {
|
|
|
859
899
|
selection?: TableSelection<string>;
|
|
860
900
|
}
|
|
861
901
|
|
|
902
|
+
/** The table's pipeline as a pure function - filter, sort, page over rows and model columns. */
|
|
903
|
+
export declare interface TableProjection<Z, K extends string = string> {
|
|
904
|
+
/** The visible columns in their order – the basis for the header row, the
|
|
905
|
+
column menu and the CSV export. */
|
|
906
|
+
columns: readonly ModelColumn<Z, K>[];
|
|
907
|
+
/** Everything the filter leaves – the basis for figures and the selection. */
|
|
908
|
+
filtered: Z[];
|
|
909
|
+
/** Only the current page - with a grouping, the rows among its lines. */
|
|
910
|
+
visible: Z[];
|
|
911
|
+
/** With a grouping: the groups, outermost first. */
|
|
912
|
+
groups?: RowGroup<Z>[];
|
|
913
|
+
/** With a grouping: every line of the filtered set. */
|
|
914
|
+
lines?: Line<Z>[];
|
|
915
|
+
/** With a grouping: the lines of the current page, with what it repeats. */
|
|
916
|
+
visibleLines?: Line<Z>[];
|
|
917
|
+
/** Tree rows: the flattening - the rows shown, in reading order, with
|
|
918
|
+
their level and state. `visible` holds their rows. */
|
|
919
|
+
entries?: readonly FlatteningEntry<Z>[];
|
|
920
|
+
/** Tree rows: every row the flattening shows, before a virtual window. */
|
|
921
|
+
shown?: Z[];
|
|
922
|
+
/** Tree rows: the roots that match or lead to a match - what a footer
|
|
923
|
+
sums, since a parent already holds its children. */
|
|
924
|
+
roots?: Z[];
|
|
925
|
+
/** Tree rows: every row of the filtered tree in reading order, open or
|
|
926
|
+
not, path rows included - what the export writes. */
|
|
927
|
+
exported?: readonly FlatteningEntry<Z>[];
|
|
928
|
+
/** Tree rows: how many rows the tree has on every level - what "of 1,204"
|
|
929
|
+
counts, as the rows the pre-filter admits do for a flat table. */
|
|
930
|
+
total?: number;
|
|
931
|
+
/** The clamped page actually shown. */
|
|
932
|
+
page: number;
|
|
933
|
+
pageCount: number;
|
|
934
|
+
columnCount: number;
|
|
935
|
+
}
|
|
936
|
+
|
|
862
937
|
/** The props of `Table`: how the table looks and behaves. Its state comes from
|
|
863
938
|
`useTable`, its columns from the JSX inside it. */
|
|
864
939
|
export declare interface TableProps<Z> extends Omit<HTMLAttributes<HTMLDivElement>, "children">, RefProp<HTMLDivElement> {
|