@fusion.dev/helix-headless 0.184.0 → 0.185.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/custom-elements.json +64 -5
- package/dist/data-table/root/data-table-root.d.ts +25 -6
- package/dist/data-table/root/data-table-root.js +21 -9
- package/dist/table/root/table-root.d.ts +4 -6
- package/dist/table/root/table-root.js +2 -28
- package/dist/table/tracks.d.ts +20 -0
- package/dist/table/tracks.js +28 -0
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +66 -34
- package/types/vue.d.ts +15 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusion.dev/helix-headless",
|
|
3
3
|
"description": "Headless component tier. Structure, accessibility, state, and form participation. No styling.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.185.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
},
|
|
50
50
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@fusion.dev/helix-core": "0.
|
|
53
|
-
"@fusion.dev/helix-icons": "0.
|
|
52
|
+
"@fusion.dev/helix-core": "0.185.0",
|
|
53
|
+
"@fusion.dev/helix-icons": "0.185.0",
|
|
54
54
|
"tslib": "^2.8.1",
|
|
55
55
|
"uqr": "^0.1.3"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@fusion.dev/helix-cem": "0.
|
|
59
|
-
"@fusion.dev/helix-testing": "0.
|
|
58
|
+
"@fusion.dev/helix-cem": "0.185.0",
|
|
59
|
+
"@fusion.dev/helix-testing": "0.185.0",
|
|
60
60
|
"@fusion.dev/scripts": "0.0.0-dev",
|
|
61
61
|
"@happy-dom/global-registrator": "^20.14.5",
|
|
62
62
|
"@lit-labs/ssr": "^4.1.0",
|
package/types/jsx.d.ts
CHANGED
|
@@ -9428,6 +9428,16 @@ and the grid becomes a tree grid.
|
|
|
9428
9428
|
Reflected, because the styled tier indents a tree grid's row headers by
|
|
9429
9429
|
it. No default, so a table that sets none writes nothing onto its host. */
|
|
9430
9430
|
childField?: (HelixHeadlessDataTable["childField"]) | undefined;
|
|
9431
|
+
/** The column tracks, as a grid track list such as `2fr 1fr max-content`,
|
|
9432
|
+
dealt out one track to a column in the order the columns are written. A
|
|
9433
|
+
column's own `width` wins in its place, and a column it does not reach
|
|
9434
|
+
takes the track a column with no `width` takes.
|
|
9435
|
+
|
|
9436
|
+
**The one track list a server can send.** A server rendering this element
|
|
9437
|
+
has no columns to read a `width` from, and neither has a stylesheet laying
|
|
9438
|
+
out the rows a page served before the table upgrades, so a table sized here
|
|
9439
|
+
lays those rows out at the widths it draws. */
|
|
9440
|
+
columns?: (HelixHeadlessDataTable["columns"]) | undefined;
|
|
9431
9441
|
/** The keys of the rows open at the start, separated by commas. Used until
|
|
9432
9442
|
`expanded` is set. */
|
|
9433
9443
|
"default-expanded"?: (HelixHeadlessDataTable["defaultExpanded"]) | undefined;
|
|
@@ -9861,6 +9871,16 @@ and the grid becomes a tree grid.
|
|
|
9861
9871
|
Reflected, because the styled tier indents a tree grid's row headers by
|
|
9862
9872
|
it. No default, so a table that sets none writes nothing onto its host. */
|
|
9863
9873
|
"prop:childField"?: (HelixHeadlessDataTable["childField"]) | undefined;
|
|
9874
|
+
/** The column tracks, as a grid track list such as `2fr 1fr max-content`,
|
|
9875
|
+
dealt out one track to a column in the order the columns are written. A
|
|
9876
|
+
column's own `width` wins in its place, and a column it does not reach
|
|
9877
|
+
takes the track a column with no `width` takes.
|
|
9878
|
+
|
|
9879
|
+
**The one track list a server can send.** A server rendering this element
|
|
9880
|
+
has no columns to read a `width` from, and neither has a stylesheet laying
|
|
9881
|
+
out the rows a page served before the table upgrades, so a table sized here
|
|
9882
|
+
lays those rows out at the widths it draws. */
|
|
9883
|
+
"prop:columns"?: (HelixHeadlessDataTable["columns"]) | undefined;
|
|
9864
9884
|
/** The keys of the rows open at the start, separated by commas. Used until
|
|
9865
9885
|
`expanded` is set. */
|
|
9866
9886
|
"attr:default-expanded"?: (HelixHeadlessDataTable["defaultExpanded"]) | undefined;
|
|
@@ -30132,13 +30152,11 @@ and each column may say otherwise.
|
|
|
30132
30152
|
**It is also the only track list a server can send.** The shim has no tree
|
|
30133
30153
|
to walk, so a render there knows of no columns and this attribute is the
|
|
30134
30154
|
whole answer: a table given one lays its grid out in the first paint, and a
|
|
30135
|
-
table sized only by its columns
|
|
30155
|
+
table sized only by its columns takes, until it upgrades, a track for each
|
|
30156
|
+
column at the width a column with no `width` takes (`helix.css`).
|
|
30136
30157
|
|
|
30137
|
-
|
|
30138
|
-
|
|
30139
|
-
and a list here would be a second way to say what that says. This table's
|
|
30140
|
-
cells are markup, and a table written as rows of cells with no column
|
|
30141
|
-
declared in it has nowhere else to be sized from. */
|
|
30158
|
+
Data Table takes the same list, for the same reason: a data table that
|
|
30159
|
+
serves its first page as rows is laid out by it before it upgrades. */
|
|
30142
30160
|
columns?: (HelixHeadlessTable["columns"]) | undefined;
|
|
30143
30161
|
/** The keys of the rows whose rows are shown at the start, separated by
|
|
30144
30162
|
commas. Used until `expanded` is set. */
|
|
@@ -30397,13 +30415,11 @@ and each column may say otherwise.
|
|
|
30397
30415
|
**It is also the only track list a server can send.** The shim has no tree
|
|
30398
30416
|
to walk, so a render there knows of no columns and this attribute is the
|
|
30399
30417
|
whole answer: a table given one lays its grid out in the first paint, and a
|
|
30400
|
-
table sized only by its columns
|
|
30418
|
+
table sized only by its columns takes, until it upgrades, a track for each
|
|
30419
|
+
column at the width a column with no `width` takes (`helix.css`).
|
|
30401
30420
|
|
|
30402
|
-
|
|
30403
|
-
|
|
30404
|
-
and a list here would be a second way to say what that says. This table's
|
|
30405
|
-
cells are markup, and a table written as rows of cells with no column
|
|
30406
|
-
declared in it has nowhere else to be sized from. */
|
|
30421
|
+
Data Table takes the same list, for the same reason: a data table that
|
|
30422
|
+
serves its first page as rows is laid out by it before it upgrades. */
|
|
30407
30423
|
"prop:columns"?: (HelixHeadlessTable["columns"]) | undefined;
|
|
30408
30424
|
/** The keys of the rows whose rows are shown at the start, separated by
|
|
30409
30425
|
commas. Used until `expanded` is set. */
|
|
@@ -44390,11 +44406,12 @@ export type CustomElements = {
|
|
|
44390
44406
|
* `csv()` returns the result as text: every row that passes the filter, in the
|
|
44391
44407
|
* order and the columns on screen. Saving the file is up to you.
|
|
44392
44408
|
*
|
|
44393
|
-
*
|
|
44394
|
-
*
|
|
44395
|
-
*
|
|
44396
|
-
*
|
|
44397
|
-
*
|
|
44409
|
+
* Size a column with its own `width`, or every column at once with `columns`,
|
|
44410
|
+
* a track list dealt out one track to a column in the order they are written,
|
|
44411
|
+
* as `Table` deals it. A column's `width` wins in its place. **A table that
|
|
44412
|
+
* serves its first page takes its widths from `columns`**: a server and a
|
|
44413
|
+
* stylesheet can read the table's own attributes and not its columns', so the
|
|
44414
|
+
* served rows are laid out at the widths the table draws.
|
|
44398
44415
|
*
|
|
44399
44416
|
* **The columns are an import of their own.** A column is the Table family's
|
|
44400
44417
|
* `TableColumn`, which the data table does not register, so a page that writes
|
|
@@ -44420,6 +44437,15 @@ export type CustomElements = {
|
|
|
44420
44437
|
*
|
|
44421
44438
|
* Reflected, because the styled tier indents a tree grid's row headers by
|
|
44422
44439
|
* it. No default, so a table that sets none writes nothing onto its host.
|
|
44440
|
+
* - `columns`: The column tracks, as a grid track list such as `2fr 1fr max-content`,
|
|
44441
|
+
* dealt out one track to a column in the order the columns are written. A
|
|
44442
|
+
* column's own `width` wins in its place, and a column it does not reach
|
|
44443
|
+
* takes the track a column with no `width` takes.
|
|
44444
|
+
*
|
|
44445
|
+
* **The one track list a server can send.** A server rendering this element
|
|
44446
|
+
* has no columns to read a `width` from, and neither has a stylesheet laying
|
|
44447
|
+
* out the rows a page served before the table upgrades, so a table sized here
|
|
44448
|
+
* lays those rows out at the widths it draws.
|
|
44423
44449
|
* - `default-expanded`/`defaultExpanded`: The keys of the rows open at the start, separated by commas. Used until
|
|
44424
44450
|
* `expanded` is set.
|
|
44425
44451
|
* - `default-filter`/`defaultFilter`: The starting search query, used until `filter` is set.
|
|
@@ -61412,13 +61438,11 @@ export type CustomElements = {
|
|
|
61412
61438
|
* **It is also the only track list a server can send.** The shim has no tree
|
|
61413
61439
|
* to walk, so a render there knows of no columns and this attribute is the
|
|
61414
61440
|
* whole answer: a table given one lays its grid out in the first paint, and a
|
|
61415
|
-
* table sized only by its columns
|
|
61441
|
+
* table sized only by its columns takes, until it upgrades, a track for each
|
|
61442
|
+
* column at the width a column with no `width` takes (`helix.css`).
|
|
61416
61443
|
*
|
|
61417
|
-
*
|
|
61418
|
-
*
|
|
61419
|
-
* and a list here would be a second way to say what that says. This table's
|
|
61420
|
-
* cells are markup, and a table written as rows of cells with no column
|
|
61421
|
-
* declared in it has nowhere else to be sized from.
|
|
61444
|
+
* Data Table takes the same list, for the same reason: a data table that
|
|
61445
|
+
* serves its first page as rows is laid out by it before it upgrades.
|
|
61422
61446
|
* - `default-expanded`/`defaultExpanded`: The keys of the rows whose rows are shown at the start, separated by
|
|
61423
61447
|
* commas. Used until `expanded` is set.
|
|
61424
61448
|
* - `default-selected`/`defaultSelected`: The keys selected at the start, separated by commas. Used until `selected`
|
|
@@ -74214,11 +74238,12 @@ export type CustomElementsSolidJs = {
|
|
|
74214
74238
|
* `csv()` returns the result as text: every row that passes the filter, in the
|
|
74215
74239
|
* order and the columns on screen. Saving the file is up to you.
|
|
74216
74240
|
*
|
|
74217
|
-
*
|
|
74218
|
-
*
|
|
74219
|
-
*
|
|
74220
|
-
*
|
|
74221
|
-
*
|
|
74241
|
+
* Size a column with its own `width`, or every column at once with `columns`,
|
|
74242
|
+
* a track list dealt out one track to a column in the order they are written,
|
|
74243
|
+
* as `Table` deals it. A column's `width` wins in its place. **A table that
|
|
74244
|
+
* serves its first page takes its widths from `columns`**: a server and a
|
|
74245
|
+
* stylesheet can read the table's own attributes and not its columns', so the
|
|
74246
|
+
* served rows are laid out at the widths the table draws.
|
|
74222
74247
|
*
|
|
74223
74248
|
* **The columns are an import of their own.** A column is the Table family's
|
|
74224
74249
|
* `TableColumn`, which the data table does not register, so a page that writes
|
|
@@ -74244,6 +74269,15 @@ export type CustomElementsSolidJs = {
|
|
|
74244
74269
|
*
|
|
74245
74270
|
* Reflected, because the styled tier indents a tree grid's row headers by
|
|
74246
74271
|
* it. No default, so a table that sets none writes nothing onto its host.
|
|
74272
|
+
* - `columns`: The column tracks, as a grid track list such as `2fr 1fr max-content`,
|
|
74273
|
+
* dealt out one track to a column in the order the columns are written. A
|
|
74274
|
+
* column's own `width` wins in its place, and a column it does not reach
|
|
74275
|
+
* takes the track a column with no `width` takes.
|
|
74276
|
+
*
|
|
74277
|
+
* **The one track list a server can send.** A server rendering this element
|
|
74278
|
+
* has no columns to read a `width` from, and neither has a stylesheet laying
|
|
74279
|
+
* out the rows a page served before the table upgrades, so a table sized here
|
|
74280
|
+
* lays those rows out at the widths it draws.
|
|
74247
74281
|
* - `default-expanded`/`defaultExpanded`: The keys of the rows open at the start, separated by commas. Used until
|
|
74248
74282
|
* `expanded` is set.
|
|
74249
74283
|
* - `default-filter`/`defaultFilter`: The starting search query, used until `filter` is set.
|
|
@@ -91431,13 +91465,11 @@ export type CustomElementsSolidJs = {
|
|
|
91431
91465
|
* **It is also the only track list a server can send.** The shim has no tree
|
|
91432
91466
|
* to walk, so a render there knows of no columns and this attribute is the
|
|
91433
91467
|
* whole answer: a table given one lays its grid out in the first paint, and a
|
|
91434
|
-
* table sized only by its columns
|
|
91468
|
+
* table sized only by its columns takes, until it upgrades, a track for each
|
|
91469
|
+
* column at the width a column with no `width` takes (`helix.css`).
|
|
91435
91470
|
*
|
|
91436
|
-
*
|
|
91437
|
-
*
|
|
91438
|
-
* and a list here would be a second way to say what that says. This table's
|
|
91439
|
-
* cells are markup, and a table written as rows of cells with no column
|
|
91440
|
-
* declared in it has nowhere else to be sized from.
|
|
91471
|
+
* Data Table takes the same list, for the same reason: a data table that
|
|
91472
|
+
* serves its first page as rows is laid out by it before it upgrades.
|
|
91441
91473
|
* - `default-expanded`/`defaultExpanded`: The keys of the rows whose rows are shown at the start, separated by
|
|
91442
91474
|
* commas. Used until `expanded` is set.
|
|
91443
91475
|
* - `default-selected`/`defaultSelected`: The keys selected at the start, separated by commas. Used until `selected`
|
package/types/vue.d.ts
CHANGED
|
@@ -4889,6 +4889,16 @@ and the grid becomes a tree grid.
|
|
|
4889
4889
|
Reflected, because the styled tier indents a tree grid's row headers by
|
|
4890
4890
|
it. No default, so a table that sets none writes nothing onto its host. */
|
|
4891
4891
|
childField?: (HelixHeadlessDataTable["childField"]) | undefined;
|
|
4892
|
+
/** The column tracks, as a grid track list such as `2fr 1fr max-content`,
|
|
4893
|
+
dealt out one track to a column in the order the columns are written. A
|
|
4894
|
+
column's own `width` wins in its place, and a column it does not reach
|
|
4895
|
+
takes the track a column with no `width` takes.
|
|
4896
|
+
|
|
4897
|
+
**The one track list a server can send.** A server rendering this element
|
|
4898
|
+
has no columns to read a `width` from, and neither has a stylesheet laying
|
|
4899
|
+
out the rows a page served before the table upgrades, so a table sized here
|
|
4900
|
+
lays those rows out at the widths it draws. */
|
|
4901
|
+
columns?: (HelixHeadlessDataTable["columns"]) | undefined;
|
|
4892
4902
|
/** The keys of the rows open at the start, separated by commas. Used until
|
|
4893
4903
|
`expanded` is set. */
|
|
4894
4904
|
"default-expanded"?: (HelixHeadlessDataTable["defaultExpanded"]) | undefined;
|
|
@@ -15441,13 +15451,11 @@ and each column may say otherwise.
|
|
|
15441
15451
|
**It is also the only track list a server can send.** The shim has no tree
|
|
15442
15452
|
to walk, so a render there knows of no columns and this attribute is the
|
|
15443
15453
|
whole answer: a table given one lays its grid out in the first paint, and a
|
|
15444
|
-
table sized only by its columns
|
|
15454
|
+
table sized only by its columns takes, until it upgrades, a track for each
|
|
15455
|
+
column at the width a column with no `width` takes (`helix.css`).
|
|
15445
15456
|
|
|
15446
|
-
|
|
15447
|
-
|
|
15448
|
-
and a list here would be a second way to say what that says. This table's
|
|
15449
|
-
cells are markup, and a table written as rows of cells with no column
|
|
15450
|
-
declared in it has nowhere else to be sized from. */
|
|
15457
|
+
Data Table takes the same list, for the same reason: a data table that
|
|
15458
|
+
serves its first page as rows is laid out by it before it upgrades. */
|
|
15451
15459
|
columns?: (HelixHeadlessTable["columns"]) | undefined;
|
|
15452
15460
|
/** The keys of the rows whose rows are shown at the start, separated by
|
|
15453
15461
|
commas. Used until `expanded` is set. */
|
|
@@ -19509,7 +19517,7 @@ export interface WcToolkitVueGlobalComponents {
|
|
|
19509
19517
|
HelixHeadlessCopyButtonVueProps,
|
|
19510
19518
|
HelixHeadlessCopyButtonVueEvents
|
|
19511
19519
|
>;
|
|
19512
|
-
/** Declare the columns as 'TableColumn' children and pass the rows as an array. The schema stays readable in the HTML, and the rows can be windowed, which ten thousand row elements cannot be. '''html <helix-headless-data-table .rows=${rows} sort="name:asc" page-size="20"> <helix-headless-table-column field="name" sortable>Name</helix-headless-table-column> <helix-headless-table-column field="size" text-align="end" sortable .cell=${bytes}>Size</helix-headless-table-column> </helix-headless-data-table> ''' For a short table written out by hand, use 'Table', which takes rows as markup. Sort and filter apply to the whole set, including the rows on other pages. **Write the first page as rows, so the served HTML carries the values.** The table reads each cell from its column, and a server does not pass the column children to this element, so on its own it serves the headings and no values. Write the first page under the columns as 'TableRow' and 'TableCell' elements, in the table's sort and page size and formatted as its columns draw them. The table shows your rows until 'rows' holds a row, then draws its own in their place and leaves yours in the page, unshown. A development build warns when the two differ. In React, map the first page of the same array in the same server component. 'selectable' adds a column of checkboxes, keyed on 'row-key': - A row is selected by its key, so the selection survives a sort, a filter, and a page change. - 'selected' holds the chosen keys, comma separated, the same shape 'Listbox' uses for a multiple choice. As with 'sort', writing it applies the selection, and 'default-selected' holds what the markup declared. - The checkbox in the heading selects every row in the result, across pages, and shows a dash while only some are chosen. - Shift with a press on a checkbox selects every row between it and the row last chosen. - 'selection-behavior="replace"' makes a press or a move select the row alone, as a file list does. Control or Command with a press adds or takes out one row, and Shift with a press selects every row from the one last chosen. To act on a single row, such as opening it, put a link or a button in a cell. **Keyboard.** The grid is one tab stop, and the arrow keys move between its cells, the headings included. | Key | What it does | |---|---| | Right, Left | Moves one cell along the row. Left moves on, on a right-to-left page. | | Down, Up | Moves one row, the heading row and the 'load-more' row included. | | Home, End | Moves to the first or the last cell of the row. | | Control with Home or End | Moves to the first or the last cell of the grid. | | Page Down, Page Up | Moves by the rows that fit in view. | | Enter, F2 | Moves into the cell's controls. Escape moves back to the cell, and Tab moves between the controls of one cell. | | Enter, Space on a sortable heading | Sorts by the column. | | Enter, Space on the 'load-more' row | Sends 'helix-load-more'. | | Space on a row | Selects the row, in a 'selectable' table. Under 'selection-behavior="replace"', selects it alone, and Control or Command with Space adds or takes out the row. | | Down, Up, Page Down, Page Up under 'selection-behavior="replace"' | Selects the row it moves to alone. Control or Command with the key moves without selecting. | | Shift with Down or Up | Selects the rows it moves across, in a 'selectable' table. | | Shift with Space | Selects every row from the one last chosen, in a 'selectable' table. | | Control or Command with A | Selects every row, in a 'selectable' table. | | Right on a row header in a tree grid | Opens a closed row, and moves one cell along an open one. | | Left on a row header in a tree grid | Closes an open row, and moves to the parent of a closed one. | | A letter or a word | Moves to the next row whose row header starts with what you typed. | 'selected' and 'expanded' hold their keys in the order of the rows, as do 'helix-select', 'helix-selected' and 'helix-expand'. Each row is named by its row header, the column marked 'row-header', or the first column with a 'field' where none is. A screen reader says it as a reader moves between rows. **Rows that hold rows.** 'child-field' names the field that holds a row's child rows, and the grid becomes a tree grid. The row header column draws a mark that a press opens and closes a row by, and 'expanded' holds the keys of the open rows, which 'row-key' names. Right on a closed row's header opens it, Left on an open one closes it, and Left on a child moves to its parent. A sort orders the rows under each parent, and a search shows the rows that lead to each match, open. 'load-more' adds a row after the last one with a button that sends 'helix-load-more'. A 'windowed' table also sends it by itself once a reader scrolls within one screen of the end, once for each number of rows. Add the next rows to 'rows', and set 'loading' while they are on their way. When a fetch fails, set 'error-text', such as "The files did not load", and put a button that tries again in the 'error' slot. The line shows after the rows in place of the empty and loading lines, the live region says it, and the table takes the 'error' state. Clear it once you try again. The controls inside the cells leave the tab order, so Tab moves past the whole grid. A windowed table keeps the row holding focus drawn while the rest scroll away. People can resize and reorder the columns. 'resizable' on a column puts a separator on its edge. 'reorderable' on the table puts a grip on each heading that has a 'field', moved by dragging or with the arrow keys. The new order is written to 'order' as a list of fields. Your markup is not rewritten: the table assigns the headings to its header in that order. **'reorderable-rows' lets people move rows.** A column of grips leads each row, named by 'move-row-label'. Drag a grip to move its row, and the table scrolls near an edge. Or press Space or Enter on a grip, or click it, to pick up its row, move it with Down and Up, Home and End, and press Space or Enter again to drop it. A click on another row drops it there, and Escape puts it back. The table says each step in its 'live' region. A drop sends 'helix-before-reorder', which you can refuse, and then 'helix-reorder' with 'kind' set to 'row', whose 'keys' hold every key of 'rows' in the new order. **You move the rows**: set 'rows' to the new order, and the table draws it. Set 'row-key', so a row is known by its key once it has moved. The grips do nothing while a 'sort' is set, since the sort decides the order, and a tree grid draws none. 'csv()' returns the result as text: every row that passes the filter, in the order and the columns on screen. Saving the file is up to you.
|
|
19520
|
+
/** Declare the columns as 'TableColumn' children and pass the rows as an array. The schema stays readable in the HTML, and the rows can be windowed, which ten thousand row elements cannot be. '''html <helix-headless-data-table .rows=${rows} sort="name:asc" page-size="20"> <helix-headless-table-column field="name" sortable>Name</helix-headless-table-column> <helix-headless-table-column field="size" text-align="end" sortable .cell=${bytes}>Size</helix-headless-table-column> </helix-headless-data-table> ''' For a short table written out by hand, use 'Table', which takes rows as markup. Sort and filter apply to the whole set, including the rows on other pages. **Write the first page as rows, so the served HTML carries the values.** The table reads each cell from its column, and a server does not pass the column children to this element, so on its own it serves the headings and no values. Write the first page under the columns as 'TableRow' and 'TableCell' elements, in the table's sort and page size and formatted as its columns draw them. The table shows your rows until 'rows' holds a row, then draws its own in their place and leaves yours in the page, unshown. A development build warns when the two differ. In React, map the first page of the same array in the same server component. 'selectable' adds a column of checkboxes, keyed on 'row-key': - A row is selected by its key, so the selection survives a sort, a filter, and a page change. - 'selected' holds the chosen keys, comma separated, the same shape 'Listbox' uses for a multiple choice. As with 'sort', writing it applies the selection, and 'default-selected' holds what the markup declared. - The checkbox in the heading selects every row in the result, across pages, and shows a dash while only some are chosen. - Shift with a press on a checkbox selects every row between it and the row last chosen. - 'selection-behavior="replace"' makes a press or a move select the row alone, as a file list does. Control or Command with a press adds or takes out one row, and Shift with a press selects every row from the one last chosen. To act on a single row, such as opening it, put a link or a button in a cell. **Keyboard.** The grid is one tab stop, and the arrow keys move between its cells, the headings included. | Key | What it does | |---|---| | Right, Left | Moves one cell along the row. Left moves on, on a right-to-left page. | | Down, Up | Moves one row, the heading row and the 'load-more' row included. | | Home, End | Moves to the first or the last cell of the row. | | Control with Home or End | Moves to the first or the last cell of the grid. | | Page Down, Page Up | Moves by the rows that fit in view. | | Enter, F2 | Moves into the cell's controls. Escape moves back to the cell, and Tab moves between the controls of one cell. | | Enter, Space on a sortable heading | Sorts by the column. | | Enter, Space on the 'load-more' row | Sends 'helix-load-more'. | | Space on a row | Selects the row, in a 'selectable' table. Under 'selection-behavior="replace"', selects it alone, and Control or Command with Space adds or takes out the row. | | Down, Up, Page Down, Page Up under 'selection-behavior="replace"' | Selects the row it moves to alone. Control or Command with the key moves without selecting. | | Shift with Down or Up | Selects the rows it moves across, in a 'selectable' table. | | Shift with Space | Selects every row from the one last chosen, in a 'selectable' table. | | Control or Command with A | Selects every row, in a 'selectable' table. | | Right on a row header in a tree grid | Opens a closed row, and moves one cell along an open one. | | Left on a row header in a tree grid | Closes an open row, and moves to the parent of a closed one. | | A letter or a word | Moves to the next row whose row header starts with what you typed. | 'selected' and 'expanded' hold their keys in the order of the rows, as do 'helix-select', 'helix-selected' and 'helix-expand'. Each row is named by its row header, the column marked 'row-header', or the first column with a 'field' where none is. A screen reader says it as a reader moves between rows. **Rows that hold rows.** 'child-field' names the field that holds a row's child rows, and the grid becomes a tree grid. The row header column draws a mark that a press opens and closes a row by, and 'expanded' holds the keys of the open rows, which 'row-key' names. Right on a closed row's header opens it, Left on an open one closes it, and Left on a child moves to its parent. A sort orders the rows under each parent, and a search shows the rows that lead to each match, open. 'load-more' adds a row after the last one with a button that sends 'helix-load-more'. A 'windowed' table also sends it by itself once a reader scrolls within one screen of the end, once for each number of rows. Add the next rows to 'rows', and set 'loading' while they are on their way. When a fetch fails, set 'error-text', such as "The files did not load", and put a button that tries again in the 'error' slot. The line shows after the rows in place of the empty and loading lines, the live region says it, and the table takes the 'error' state. Clear it once you try again. The controls inside the cells leave the tab order, so Tab moves past the whole grid. A windowed table keeps the row holding focus drawn while the rest scroll away. People can resize and reorder the columns. 'resizable' on a column puts a separator on its edge. 'reorderable' on the table puts a grip on each heading that has a 'field', moved by dragging or with the arrow keys. The new order is written to 'order' as a list of fields. Your markup is not rewritten: the table assigns the headings to its header in that order. **'reorderable-rows' lets people move rows.** A column of grips leads each row, named by 'move-row-label'. Drag a grip to move its row, and the table scrolls near an edge. Or press Space or Enter on a grip, or click it, to pick up its row, move it with Down and Up, Home and End, and press Space or Enter again to drop it. A click on another row drops it there, and Escape puts it back. The table says each step in its 'live' region. A drop sends 'helix-before-reorder', which you can refuse, and then 'helix-reorder' with 'kind' set to 'row', whose 'keys' hold every key of 'rows' in the new order. **You move the rows**: set 'rows' to the new order, and the table draws it. Set 'row-key', so a row is known by its key once it has moved. The grips do nothing while a 'sort' is set, since the sort decides the order, and a tree grid draws none. 'csv()' returns the result as text: every row that passes the filter, in the order and the columns on screen. Saving the file is up to you. Size a column with its own 'width', or every column at once with 'columns', a track list dealt out one track to a column in the order they are written, as 'Table' deals it. A column's 'width' wins in its place. **A table that serves its first page takes its widths from 'columns'**: a server and a stylesheet can read the table's own attributes and not its columns', so the served rows are laid out at the widths the table draws. **The columns are an import of their own.** A column is the Table family's 'TableColumn', which the data table does not register, so a page that writes one imports the Table entry beside the data table: '''js import '@fusion.dev/helix/data-table' import '@fusion.dev/helix/table' ''' In development, a data table holding a column nobody registered says so once the page has loaded, with the line to add. */
|
|
19513
19521
|
"helix-headless-data-table": DefineCustomElement<
|
|
19514
19522
|
HelixHeadlessDataTable,
|
|
19515
19523
|
HelixHeadlessDataTableVueProps,
|