@fusion.dev/helix 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 +39 -8
- package/dist/data-table/root/data-table-root.css.js +1 -1
- package/dist/data-table/root/data-table-root.d.ts +3 -1
- package/dist/strands/root/strands-root.d.ts +4 -4
- package/dist/strands/root/strands-root.js +1 -6
- package/lint.json +1 -1
- package/package.json +6 -6
- package/types/jsx.d.ts +62 -28
- package/types/vue.d.ts +16 -8
package/custom-elements.json
CHANGED
|
@@ -57497,7 +57497,7 @@
|
|
|
57497
57497
|
"declarations": [
|
|
57498
57498
|
{
|
|
57499
57499
|
"kind": "class",
|
|
57500
|
-
"description": "Rows have hairline rules between them and no fill, and the headings are set\napart by weight and color. Helix shows depth with a single border and no\nelevation, and a header band would be elevation.\n\nThe grid scrolls in its own box, and the toolbar and footer sit outside it,\nso the search field stays in place when the columns scroll sideways.\n\n`windowed` draws only the rows in view, for a result too long to lay out at\nonce, and the headings stay in place while the rows scroll. It works with or\nwithout `paginated` and with either `mode`, so a page or a chunk from a\nserver can be windowed.\n\n**Write the first page as rows, so the served HTML carries the values.**\nWrite it under the columns as `helix-table-row` and `helix-table-cell`\nelements. `@fusion.dev/helix-styles/helix.css` lays them out as the table\ndraws them before it upgrades, and the table shows them until `rows` holds a\nrow.",
|
|
57500
|
+
"description": "Rows have hairline rules between them and no fill, and the headings are set\napart by weight and color. Helix shows depth with a single border and no\nelevation, and a header band would be elevation.\n\nThe grid scrolls in its own box, and the toolbar and footer sit outside it,\nso the search field stays in place when the columns scroll sideways.\n\n`windowed` draws only the rows in view, for a result too long to lay out at\nonce, and the headings stay in place while the rows scroll. It works with or\nwithout `paginated` and with either `mode`, so a page or a chunk from a\nserver can be windowed.\n\n**Write the first page as rows, so the served HTML carries the values.**\nWrite it under the columns as `helix-table-row` and `helix-table-cell`\nelements. `@fusion.dev/helix-styles/helix.css` lays them out as the table\ndraws them before it upgrades, and the table shows them until `rows` holds a\nrow. It holds the checkbox column and the pagination's row from the first\npaint, and takes the widths from `columns`, so nothing moves when the table\nupgrades or draws its own rows.",
|
|
57501
57501
|
"name": "HelixDataTable",
|
|
57502
57502
|
"cssProperties": [
|
|
57503
57503
|
{
|
|
@@ -58468,6 +58468,20 @@
|
|
|
58468
58468
|
"module": "src/data-table/root/data-table-root.ts"
|
|
58469
58469
|
}
|
|
58470
58470
|
},
|
|
58471
|
+
{
|
|
58472
|
+
"kind": "field",
|
|
58473
|
+
"name": "columns",
|
|
58474
|
+
"type": {
|
|
58475
|
+
"text": "string"
|
|
58476
|
+
},
|
|
58477
|
+
"default": "''",
|
|
58478
|
+
"description": "The column tracks, as a grid track list such as `2fr 1fr max-content`,\ndealt out one track to a column in the order the columns are written. A\ncolumn's own `width` wins in its place, and a column it does not reach\ntakes the track a column with no `width` takes.\n\n**The one track list a server can send.** A server rendering this element\nhas no columns to read a `width` from, and neither has a stylesheet laying\nout the rows a page served before the table upgrades, so a table sized here\nlays those rows out at the widths it draws.",
|
|
58479
|
+
"attribute": "columns",
|
|
58480
|
+
"inheritedFrom": {
|
|
58481
|
+
"name": "HelixHeadlessDataTable",
|
|
58482
|
+
"module": "src/data-table/root/data-table-root.ts"
|
|
58483
|
+
}
|
|
58484
|
+
},
|
|
58471
58485
|
{
|
|
58472
58486
|
"kind": "field",
|
|
58473
58487
|
"name": "defaultExpanded",
|
|
@@ -59934,7 +59948,7 @@
|
|
|
59934
59948
|
"text": "string"
|
|
59935
59949
|
},
|
|
59936
59950
|
"privacy": "private",
|
|
59937
|
-
"description": "The track list
|
|
59951
|
+
"description": "The track list: each column's `width`, or its track in `columns`, or the\ntrack a column with neither takes.\n\nA render that knows no columns, on a server or hydrating what one sent,\nhas `columns` alone, and sends it as it is.",
|
|
59938
59952
|
"readonly": true,
|
|
59939
59953
|
"inheritedFrom": {
|
|
59940
59954
|
"name": "HelixHeadlessDataTable",
|
|
@@ -62144,6 +62158,19 @@
|
|
|
62144
62158
|
"module": "src/data-table/root/data-table-root.ts"
|
|
62145
62159
|
}
|
|
62146
62160
|
},
|
|
62161
|
+
{
|
|
62162
|
+
"name": "columns",
|
|
62163
|
+
"type": {
|
|
62164
|
+
"text": "string"
|
|
62165
|
+
},
|
|
62166
|
+
"default": "''",
|
|
62167
|
+
"description": "The column tracks, as a grid track list such as `2fr 1fr max-content`,\ndealt out one track to a column in the order the columns are written. A\ncolumn's own `width` wins in its place, and a column it does not reach\ntakes the track a column with no `width` takes.\n\n**The one track list a server can send.** A server rendering this element\nhas no columns to read a `width` from, and neither has a stylesheet laying\nout the rows a page served before the table upgrades, so a table sized here\nlays those rows out at the widths it draws.",
|
|
62168
|
+
"fieldName": "columns",
|
|
62169
|
+
"inheritedFrom": {
|
|
62170
|
+
"name": "HelixHeadlessDataTable",
|
|
62171
|
+
"module": "src/data-table/root/data-table-root.ts"
|
|
62172
|
+
}
|
|
62173
|
+
},
|
|
62147
62174
|
{
|
|
62148
62175
|
"name": "default-expanded",
|
|
62149
62176
|
"type": {
|
|
@@ -200086,7 +200113,7 @@
|
|
|
200086
200113
|
"declarations": [
|
|
200087
200114
|
{
|
|
200088
200115
|
"kind": "class",
|
|
200089
|
-
"description": "Hundreds of thin strands are drawn as one ribbon, and the light they add\ntogether is bloomed, so where they converge the ribbon burns hot. The ribbon\nmoves on its own all the time: it sways and breathes, its strands wave and\nroll over one another, and light runs along them.\n\nIts palette comes from the tokens. The strands are `--helix-color-primary`,\na few are `--helix-color-accent` for depth, and the page they light is\n`--helix-color-background`. On a light page the light becomes ink, because\nlight added to near-white cannot be seen.\n\n**Four forms, set with `variant`.** `bend` turns bright strands through one\ntight point, with its arms opening to the right. `ribbon`, the default, is a\nbroad, soft ribbon in long curves. `sweep` enters at a top corner, the one\n`at` is nearer, and crosses in one diagonal to the far side. `waves` is sharp\nstrands crossing the full width.\n\n**Quiet behind words.** `quiet` names elements, such as a hero's words, that\nthe light dims behind to a faint glow, so a bright ribbon can cross the page\nunder them and they stay crisp.\n\n**In its own box, by default.** The element fills the box it is given, the\nway an image does, and `at` places the bend's apex or the ribbon's axis across\nit. Content placed inside sits over the ribbon, in the `content` part.\n\n**Down the whole page, with `travel`.** The element fixes itself behind the\npage, on `--helix-layer-beneath`, and lays one ribbon from the top of the page to the\nbottom, so scrolling travels along it. Put `helix-strands-stop` elements\ninside to pin a form to a section: each names an element with `for` and says\nwhich form the ribbon takes there. Between stops the ribbon fills the gap in\nits own `variant`, and between two waves less than a screen and a half\napart it turns off screen so each wave reads alone. Set `z-index` on the\nelement to move it.\n\nThe ribbon stops moving in these cases:\n- `prefers-reduced-motion` is set. The element shows one still frame, and in\n `travel` still follows the scroll
|
|
200116
|
+
"description": "Hundreds of thin strands are drawn as one ribbon, and the light they add\ntogether is bloomed, so where they converge the ribbon burns hot. The ribbon\nmoves on its own all the time: it sways and breathes, its strands wave and\nroll over one another, and light runs along them.\n\nIts palette comes from the tokens. The strands are `--helix-color-primary`,\na few are `--helix-color-accent` for depth, and the page they light is\n`--helix-color-background`. On a light page the light becomes ink, because\nlight added to near-white cannot be seen.\n\n**Four forms, set with `variant`.** `bend` turns bright strands through one\ntight point, with its arms opening to the right. `ribbon`, the default, is a\nbroad, soft ribbon in long curves. `sweep` enters at a top corner, the one\n`at` is nearer, and crosses in one diagonal to the far side. `waves` is sharp\nstrands crossing the full width.\n\n**Quiet behind words.** `quiet` names elements, such as a hero's words, that\nthe light dims behind to a faint glow, so a bright ribbon can cross the page\nunder them and they stay crisp.\n\n**In its own box, by default.** The element fills the box it is given, the\nway an image does, and `at` places the bend's apex or the ribbon's axis across\nit. Content placed inside sits over the ribbon, in the `content` part.\n\n**Down the whole page, with `travel`.** The element fixes itself behind the\npage, on `--helix-layer-beneath`, and lays one ribbon from the top of the page to the\nbottom, so scrolling travels along it. Put `helix-strands-stop` elements\ninside to pin a form to a section: each names an element with `for` and says\nwhich form the ribbon takes there. Between stops the ribbon fills the gap in\nits own `variant`, and between two waves less than a screen and a half\napart it turns off screen so each wave reads alone. Set `z-index` on the\nelement to move it.\n\nThe ribbon stops moving in these cases:\n- `prefers-reduced-motion` is set. The element shows one still frame, and in\n `travel` still follows the scroll.\n- The element is off screen or in a background tab.\n\nIt shows a gradient from the same tokens in these cases, and matches\n`:state(fallback)` and sends `helix-strands-fallback` with the reason:\n- The renderer draws on the CPU, such as a headless browser or a machine with\n no usable GPU.\n- There is no WebGL, or the browser took the drawing context back.\n\nStrands is styled only and has behavior, as `Aura` does: its behavior is\ndrawing to a canvas, so there is no structure for a headless version to hold.",
|
|
200090
200117
|
"name": "HelixStrands",
|
|
200091
200118
|
"cssProperties": [
|
|
200092
200119
|
{
|
|
@@ -200447,7 +200474,7 @@
|
|
|
200447
200474
|
},
|
|
200448
200475
|
"privacy": "private",
|
|
200449
200476
|
"default": "0",
|
|
200450
|
-
"description": "In `travel`, the scroll position the ribbon
|
|
200477
|
+
"description": "In `travel`, the scroll position the ribbon was last drawn at."
|
|
200451
200478
|
},
|
|
200452
200479
|
{
|
|
200453
200480
|
"kind": "field",
|
|
@@ -200679,7 +200706,7 @@
|
|
|
200679
200706
|
"name": "handleScroll",
|
|
200680
200707
|
"privacy": "private",
|
|
200681
200708
|
"readonly": true,
|
|
200682
|
-
"description": "The page scrolled. A running loop
|
|
200709
|
+
"description": "The page scrolled. A running loop draws the new position on its next\nframe; a stopped one, for a reader who asked for no motion, paints once."
|
|
200683
200710
|
},
|
|
200684
200711
|
{
|
|
200685
200712
|
"kind": "method",
|
|
@@ -206211,7 +206238,7 @@
|
|
|
206211
206238
|
"text": "string"
|
|
206212
206239
|
},
|
|
206213
206240
|
"default": "''",
|
|
206214
|
-
"description": "The column widths as one track list, written once on the table.\n\nWith `TableColumn` children, each track sizes the column in its place, a\nhidden column counted, so hiding one takes its track with it and the rest\nkeep theirs. The columns decide how many tracks there are and this list\nonly how wide: a track past the last column is dropped, and a column past\nthe last track shares what is left. With no columns declared it is the\nwhole track list. Tracks count as the grid counts them, so `minmax(0, 1fr)`\nis one and `repeat(2, 8rem)` is two, and one the grid would refuse leaves\nits column at the default rather than taking the table down to one column.\n\n**A column's own `width` wins over its track here.** The width is written\non the column it sizes, which is the more particular statement, and it is\nwhere a resize lands: a reader dragging a column's edge writes `width`, so\nwere this list to win, the drag would move the separator and leave the\ntrack where the list put it. This is the table's default for its columns,\nand each column may say otherwise.\n\n**It is also the only track list a server can send.** The shim has no tree\nto walk, so a render there knows of no columns and this attribute is the\nwhole answer: a table given one lays its grid out in the first paint, and a\ntable sized only by its columns
|
|
206241
|
+
"description": "The column widths as one track list, written once on the table.\n\nWith `TableColumn` children, each track sizes the column in its place, a\nhidden column counted, so hiding one takes its track with it and the rest\nkeep theirs. The columns decide how many tracks there are and this list\nonly how wide: a track past the last column is dropped, and a column past\nthe last track shares what is left. With no columns declared it is the\nwhole track list. Tracks count as the grid counts them, so `minmax(0, 1fr)`\nis one and `repeat(2, 8rem)` is two, and one the grid would refuse leaves\nits column at the default rather than taking the table down to one column.\n\n**A column's own `width` wins over its track here.** The width is written\non the column it sizes, which is the more particular statement, and it is\nwhere a resize lands: a reader dragging a column's edge writes `width`, so\nwere this list to win, the drag would move the separator and leave the\ntrack where the list put it. This is the table's default for its columns,\nand each column may say otherwise.\n\n**It is also the only track list a server can send.** The shim has no tree\nto walk, so a render there knows of no columns and this attribute is the\nwhole answer: a table given one lays its grid out in the first paint, and a\ntable sized only by its columns takes, until it upgrades, a track for each\ncolumn at the width a column with no `width` takes (`helix.css`).\n\nData Table takes the same list, for the same reason: a data table that\nserves its first page as rows is laid out by it before it upgrades.",
|
|
206215
206242
|
"attribute": "columns",
|
|
206216
206243
|
"inheritedFrom": {
|
|
206217
206244
|
"name": "HelixHeadlessTable",
|
|
@@ -208300,6 +208327,10 @@
|
|
|
208300
208327
|
{
|
|
208301
208328
|
"description": "A heading that names the table, and a checkbox on each row that selects it.",
|
|
208302
208329
|
"slug": "selecting"
|
|
208330
|
+
},
|
|
208331
|
+
{
|
|
208332
|
+
"description": "A thousand rows written as markup, with only the rows in view drawn.",
|
|
208333
|
+
"slug": "windowed"
|
|
208303
208334
|
}
|
|
208304
208335
|
],
|
|
208305
208336
|
"source": "helix/styled/src/table"
|
|
@@ -208378,7 +208409,7 @@
|
|
|
208378
208409
|
"text": "string"
|
|
208379
208410
|
},
|
|
208380
208411
|
"default": "''",
|
|
208381
|
-
"description": "The column widths as one track list, written once on the table.\n\nWith `TableColumn` children, each track sizes the column in its place, a\nhidden column counted, so hiding one takes its track with it and the rest\nkeep theirs. The columns decide how many tracks there are and this list\nonly how wide: a track past the last column is dropped, and a column past\nthe last track shares what is left. With no columns declared it is the\nwhole track list. Tracks count as the grid counts them, so `minmax(0, 1fr)`\nis one and `repeat(2, 8rem)` is two, and one the grid would refuse leaves\nits column at the default rather than taking the table down to one column.\n\n**A column's own `width` wins over its track here.** The width is written\non the column it sizes, which is the more particular statement, and it is\nwhere a resize lands: a reader dragging a column's edge writes `width`, so\nwere this list to win, the drag would move the separator and leave the\ntrack where the list put it. This is the table's default for its columns,\nand each column may say otherwise.\n\n**It is also the only track list a server can send.** The shim has no tree\nto walk, so a render there knows of no columns and this attribute is the\nwhole answer: a table given one lays its grid out in the first paint, and a\ntable sized only by its columns
|
|
208412
|
+
"description": "The column widths as one track list, written once on the table.\n\nWith `TableColumn` children, each track sizes the column in its place, a\nhidden column counted, so hiding one takes its track with it and the rest\nkeep theirs. The columns decide how many tracks there are and this list\nonly how wide: a track past the last column is dropped, and a column past\nthe last track shares what is left. With no columns declared it is the\nwhole track list. Tracks count as the grid counts them, so `minmax(0, 1fr)`\nis one and `repeat(2, 8rem)` is two, and one the grid would refuse leaves\nits column at the default rather than taking the table down to one column.\n\n**A column's own `width` wins over its track here.** The width is written\non the column it sizes, which is the more particular statement, and it is\nwhere a resize lands: a reader dragging a column's edge writes `width`, so\nwere this list to win, the drag would move the separator and leave the\ntrack where the list put it. This is the table's default for its columns,\nand each column may say otherwise.\n\n**It is also the only track list a server can send.** The shim has no tree\nto walk, so a render there knows of no columns and this attribute is the\nwhole answer: a table given one lays its grid out in the first paint, and a\ntable sized only by its columns takes, until it upgrades, a track for each\ncolumn at the width a column with no `width` takes (`helix.css`).\n\nData Table takes the same list, for the same reason: a data table that\nserves its first page as rows is laid out by it before it upgrades.",
|
|
208382
208413
|
"fieldName": "columns",
|
|
208383
208414
|
"inheritedFrom": {
|
|
208384
208415
|
"name": "HelixHeadlessTable",
|
|
@@ -254052,6 +254083,6 @@
|
|
|
254052
254083
|
],
|
|
254053
254084
|
"helix": {
|
|
254054
254085
|
"package": "@fusion.dev/helix",
|
|
254055
|
-
"version": "0.
|
|
254086
|
+
"version": "0.185.0"
|
|
254056
254087
|
}
|
|
254057
254088
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {display: block}[part="toolbar"], [part="table"], [part="footer"] {grid-column: 1 / -1}[part="table"] {display: grid;grid-template-columns: var(--data-table-columns, var(--data-table-template, minmax(0, 1fr)));inline-size: 100%;overflow-x: auto}[part="table"] {--_data-table-fade: to right;animation: data-table-edges linear both;animation-timeline: scroll(self inline);mask-image: linear-gradient(var(--_data-table-fade), transparent, #000 var(--_data-table-fade-start, 0rem), #000 calc(100% - var(--_data-table-fade-end, 0rem)), transparent)}:host(:dir(rtl)) [part="table"] {--_data-table-fade: to left}@keyframes data-table-edges {0% {--_data-table-fade-end: var(--helix-space-xl);--_data-table-fade-start: 0rem}5%, 95% {--_data-table-fade-end: var(--helix-space-xl);--_data-table-fade-start: var(--helix-space-xl)}100% {--_data-table-fade-end: 0rem;--_data-table-fade-start: var(--helix-space-xl)}}@media (prefers-reduced-motion: reduce) {[part="table"] {animation: none}}[part="head"], [part~="row"] {display: contents}[part~="cell"] {border-block-end: var(--helix-border-thin) solid var(--data-table-rule-color, var(--helix-color-border));color: var(--data-table-color, var(--helix-color-foreground));font-family: var(--helix-font-sans);font-size: var(--data-table-text, var(--helix-text-sm));padding-block: var(--data-table-padding-block, var(--helix-space-sm));padding-inline: var(--data-table-padding-inline, var(--helix-space-none) var(--helix-space-md));text-align: var(--data-table-cell-align)}[part~="row"]:last-of-type [part~="cell"] {border-block-end-color: transparent}::slotted(helix-table-column) {--_table-heading-color: var(--data-table-heading-color);--_table-heading-padding-block: var(--data-table-padding-block);--_table-heading-padding-inline: var(--data-table-padding-inline);--_table-heading-rule-color: var(--data-table-rule-color);--_table-heading-text: var(--data-table-text)}::slotted(helix-table-column[sortable]) {cursor: pointer}[part~="cell"]:focus-visible, [part="more-cell"]:focus-visible, [part~="select"]:focus-visible, [part="select-all"]:focus-visible, [part="row-grip"]:focus-visible, [part="grip-head"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1)}[part~="select"], [part="select-all"], [part="row-grip"], [part="grip-head"] {align-items: center;border-block-end: var(--helix-border-thin) solid var(--data-table-rule-color, var(--helix-color-border));display: flex;justify-content: center;padding-block: var(--data-table-padding-block, var(--helix-space-sm));padding-inline: var(--data-table-padding-inline, var(--helix-space-sm))}[part~="row"]:last-of-type [part~="select"], [part~="row"]:last-of-type [part="row-grip"] {border-block-end-color: transparent}[part~="row"][aria-selected="true"] > * {background-color: var(--data-table-selected-background-color, color-mix(in srgb, var(--helix-color-primary) 10%, var(--helix-color-background)))}[part="row-grip-button"] {all: unset;align-items: center;border-radius: var(--helix-radii-sm);box-sizing: border-box;color: var(--data-table-grip-color, var(--helix-color-foreground-muted));cursor: grab;display: inline-flex;touch-action: none}[part="row-grip-button"]:active {cursor: grabbing}[part="row-grip-button"][aria-disabled="true"] {cursor: default;opacity: var(--data-table-grip-disabled-opacity, 0.4)}[part="row-grip-mark"] {block-size: 1em;inline-size: 1em}[part~="row"][part~="row-dragging"] > * {opacity: var(--data-table-dragging-opacity, 0.5)}[part~="row"][part~="row-drop-before"] > * {box-shadow: inset 0 var(--data-table-drop-indicator-size, var(--helix-border-thick)) 0 0 var(--data-table-drop-indicator-color, var(--helix-color-primary))}[part~="row"][part~="row-drop-after"] > * {box-shadow: inset 0 calc(var(--data-table-drop-indicator-size, var(--helix-border-thick)) * -1) 0 0 var(--data-table-drop-indicator-color, var(--helix-color-primary))}[part="toolbar"][data-empty], [part="footer"][data-empty] {display: none}[part="toolbar"] {padding-block-end: var(--data-table-toolbar-gap, var(--helix-space-sm))}[part="footer"] {align-items: center;display: flex;flex-wrap: wrap;gap: var(--data-table-footer-item-gap, var(--helix-space-md));padding-block-start: var(--data-table-footer-gap, var(--helix-space-sm))}[part="pagination"] {margin-inline-start: auto}[part="empty"], [part="loading"] {grid-column: 1 / -1}[part="error"] {color: var(--data-table-error-color, var(--helix-color-foreground));font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);grid-column: 1 / -1;margin: var(--helix-space-none);padding-block: var(--helix-space-md);padding-inline: var(--helix-space-sm);text-align: center}:host([child-field]) [part~="cell-header"] {--_data-table-gutter: calc(var(--data-table-toggle-size, var(--helix-size-icon-tight)) + var(--data-table-toggle-gap, var(--helix-space-2xs)));padding-inline-start: calc((var(--data-table-level, 1) - 1) * var(--data-table-indent, var(--_data-table-gutter)))}:host([child-field]) [part~="cell-header"]:not(:has([part~="toggle"])) {padding-inline-start: calc((var(--data-table-level, 1) - 1) * var(--data-table-indent, var(--_data-table-gutter)) + var(--_data-table-gutter))}[part~="toggle"] {align-items: center;background: none;block-size: var(--data-table-toggle-size, var(--helix-size-icon-tight));border: none;color: var(--data-table-toggle-color, var(--helix-color-foreground-muted));cursor: pointer;display: inline-flex;inline-size: var(--data-table-toggle-size, var(--helix-size-icon-tight));justify-content: center;margin-inline-end: var(--data-table-toggle-gap, var(--helix-space-2xs));padding: 0;vertical-align: middle}[part="toggle-mark"] {block-size: 100%;inline-size: 100%}[part="more"] {display: contents}[part="more-cell"] {display: flex;grid-column: 1 / -1;padding-block: var(--data-table-padding-block, var(--helix-space-sm))}[part="more-button"] {background: none;border: var(--helix-border-thin) solid var(--data-table-more-border-color, var(--helix-color-border));border-radius: var(--data-table-more-radius, var(--helix-radii-sm));color: var(--data-table-color, var(--helix-color-foreground));cursor: pointer;font-family: var(--helix-font-sans);font-size: var(--data-table-text, var(--helix-text-sm));padding-block: var(--data-table-more-padding-block, var(--helix-space-2xs));padding-inline: var(--data-table-more-padding-inline, var(--helix-space-sm))}[part="more-button"]:hover {background-color: var(--data-table-more-hover-background-color, var(--helix-color-surface-raised))}:host([windowed]) [part="table"] {block-size: var(--data-table-block-size, 24em);overflow-y: auto;overscroll-behavior: contain}:host([windowed]) ::slotted(helix-table-column) {--_table-heading-background-color: var(--data-table-heading-background-color, var(--helix-color-background));--_table-heading-layer: var(--helix-layer-sticky);--_table-heading-position: sticky}:host([windowed]) [part="select-all"], :host([windowed]) [part="grip-head"] {background-color: var(--data-table-heading-background-color, var(--helix-color-background));inset-block-start: 0;position: sticky;z-index: var(--helix-layer-sticky)}[part="before"], [part="after"] {grid-column: 1 / -1}:host([loading]) [part="table"] {opacity: 0.5}[part="drag-preview"] {background-color: var(--data-table-drag-preview-background-color, var(--helix-color-surface-raised));border: var(--data-table-drag-preview-border-width, var(--helix-border-floating)) solid var(--data-table-drag-preview-border-color, var(--helix-color-border));border-radius: var(--data-table-drag-preview-radius, var(--helix-radii-sm));box-shadow: var(--data-table-drag-preview-shadow, var(--helix-shadow-floating));opacity: var(--data-table-drag-preview-opacity, 0.9)}@media print {:host {background-color: transparent}[part="table"] {overflow-x: visible}:host([windowed]) [part="table"] {block-size: auto;overflow-y: visible}[part="footer"] {display: none}}`);
|
|
2
|
+
export const styles = createSheet(`:host {display: block}[part="toolbar"], [part="table"], [part="footer"] {grid-column: 1 / -1}[part="table"] {display: grid;grid-template-columns: var(--data-table-columns, var(--data-table-template, minmax(0, 1fr)));inline-size: 100%;overflow-x: auto}[part="table"] {--_data-table-fade: to right;animation: data-table-edges linear both;animation-timeline: scroll(self inline);mask-image: linear-gradient(var(--_data-table-fade), transparent, #000 var(--_data-table-fade-start, 0rem), #000 calc(100% - var(--_data-table-fade-end, 0rem)), transparent)}:host(:dir(rtl)) [part="table"] {--_data-table-fade: to left}@keyframes data-table-edges {0% {--_data-table-fade-end: var(--helix-space-xl);--_data-table-fade-start: 0rem}5%, 95% {--_data-table-fade-end: var(--helix-space-xl);--_data-table-fade-start: var(--helix-space-xl)}100% {--_data-table-fade-end: 0rem;--_data-table-fade-start: var(--helix-space-xl)}}@media (prefers-reduced-motion: reduce) {[part="table"] {animation: none}}[part="head"], [part~="row"] {display: contents}[part~="cell"] {border-block-end: var(--helix-border-thin) solid var(--data-table-rule-color, var(--helix-color-border));color: var(--data-table-color, var(--helix-color-foreground));font-family: var(--helix-font-sans);font-size: var(--data-table-text, var(--helix-text-sm));padding-block: var(--data-table-padding-block, var(--helix-space-sm));padding-inline: var(--data-table-padding-inline, var(--helix-space-none) var(--helix-space-md));text-align: var(--data-table-cell-align)}[part~="row"]:last-of-type [part~="cell"] {border-block-end-color: transparent}::slotted(helix-table-column) {--_table-heading-color: var(--data-table-heading-color);--_table-heading-padding-block: var(--data-table-padding-block);--_table-heading-padding-inline: var(--data-table-padding-inline);--_table-heading-rule-color: var(--data-table-rule-color);--_table-heading-text: var(--data-table-text)}::slotted(helix-table-column[sortable]) {cursor: pointer}[part~="cell"]:focus-visible, [part="more-cell"]:focus-visible, [part~="select"]:focus-visible, [part="select-all"]:focus-visible, [part="row-grip"]:focus-visible, [part="grip-head"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1)}[part~="select"], [part="select-all"], [part="row-grip"], [part="grip-head"] {align-items: center;border-block-end: var(--helix-border-thin) solid var(--data-table-rule-color, var(--helix-color-border));display: flex;justify-content: center;padding-block: var(--data-table-padding-block, var(--helix-space-sm));padding-inline: var(--data-table-padding-inline, var(--helix-space-sm))}[part="grip-head"]::before {content: "";inline-size: 1em}[part~="row"]:last-of-type [part~="select"], [part~="row"]:last-of-type [part="row-grip"] {border-block-end-color: transparent}[part~="row"][aria-selected="true"] > * {background-color: var(--data-table-selected-background-color, color-mix(in srgb, var(--helix-color-primary) 10%, var(--helix-color-background)))}[part="row-grip-button"] {all: unset;align-items: center;border-radius: var(--helix-radii-sm);box-sizing: border-box;color: var(--data-table-grip-color, var(--helix-color-foreground-muted));cursor: grab;display: inline-flex;touch-action: none}[part="row-grip-button"]:active {cursor: grabbing}[part="row-grip-button"][aria-disabled="true"] {cursor: default;opacity: var(--data-table-grip-disabled-opacity, 0.4)}[part="row-grip-mark"] {block-size: 1em;inline-size: 1em}[part~="row"][part~="row-dragging"] > * {opacity: var(--data-table-dragging-opacity, 0.5)}[part~="row"][part~="row-drop-before"] > * {box-shadow: inset 0 var(--data-table-drop-indicator-size, var(--helix-border-thick)) 0 0 var(--data-table-drop-indicator-color, var(--helix-color-primary))}[part~="row"][part~="row-drop-after"] > * {box-shadow: inset 0 calc(var(--data-table-drop-indicator-size, var(--helix-border-thick)) * -1) 0 0 var(--data-table-drop-indicator-color, var(--helix-color-primary))}[part="toolbar"][data-empty], [part="footer"][data-empty] {display: none}[part="toolbar"] {padding-block-end: var(--data-table-toolbar-gap, var(--helix-space-sm))}[part="footer"] {align-items: center;display: flex;flex-wrap: wrap;gap: var(--data-table-footer-item-gap, var(--helix-space-md));padding-block-start: var(--data-table-footer-gap, var(--helix-space-sm))}[part="pagination"] {margin-inline-start: auto}[part="footer"][data-held] {min-block-size: calc(var(--pagination-size, var(--helix-size-control-tight)) + var(--data-table-footer-gap, var(--helix-space-sm)))}[part="footer"][data-held] [part="pagination"] {visibility: hidden}:host(:not(:defined))::before, :host(:not(:defined))::after {content: none !important}[part="empty"], [part="loading"] {grid-column: 1 / -1}[part="error"] {color: var(--data-table-error-color, var(--helix-color-foreground));font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);grid-column: 1 / -1;margin: var(--helix-space-none);padding-block: var(--helix-space-md);padding-inline: var(--helix-space-sm);text-align: center}:host([child-field]) [part~="cell-header"] {--_data-table-gutter: calc(var(--data-table-toggle-size, var(--helix-size-icon-tight)) + var(--data-table-toggle-gap, var(--helix-space-2xs)));padding-inline-start: calc((var(--data-table-level, 1) - 1) * var(--data-table-indent, var(--_data-table-gutter)))}:host([child-field]) [part~="cell-header"]:not(:has([part~="toggle"])) {padding-inline-start: calc((var(--data-table-level, 1) - 1) * var(--data-table-indent, var(--_data-table-gutter)) + var(--_data-table-gutter))}[part~="toggle"] {align-items: center;background: none;block-size: var(--data-table-toggle-size, var(--helix-size-icon-tight));border: none;color: var(--data-table-toggle-color, var(--helix-color-foreground-muted));cursor: pointer;display: inline-flex;inline-size: var(--data-table-toggle-size, var(--helix-size-icon-tight));justify-content: center;margin-inline-end: var(--data-table-toggle-gap, var(--helix-space-2xs));padding: 0;vertical-align: middle}[part="toggle-mark"] {block-size: 100%;inline-size: 100%}[part="more"] {display: contents}[part="more-cell"] {display: flex;grid-column: 1 / -1;padding-block: var(--data-table-padding-block, var(--helix-space-sm))}[part="more-button"] {background: none;border: var(--helix-border-thin) solid var(--data-table-more-border-color, var(--helix-color-border));border-radius: var(--data-table-more-radius, var(--helix-radii-sm));color: var(--data-table-color, var(--helix-color-foreground));cursor: pointer;font-family: var(--helix-font-sans);font-size: var(--data-table-text, var(--helix-text-sm));padding-block: var(--data-table-more-padding-block, var(--helix-space-2xs));padding-inline: var(--data-table-more-padding-inline, var(--helix-space-sm))}[part="more-button"]:hover {background-color: var(--data-table-more-hover-background-color, var(--helix-color-surface-raised))}:host([windowed]) [part="table"] {block-size: var(--data-table-block-size, 24em);overflow-y: auto;overscroll-behavior: contain}:host([windowed]) ::slotted(helix-table-column) {--_table-heading-background-color: var(--data-table-heading-background-color, var(--helix-color-background));--_table-heading-layer: var(--helix-layer-sticky);--_table-heading-position: sticky}:host([windowed]) [part="select-all"], :host([windowed]) [part="grip-head"] {background-color: var(--data-table-heading-background-color, var(--helix-color-background));inset-block-start: 0;position: sticky;z-index: var(--helix-layer-sticky)}[part="before"], [part="after"] {grid-column: 1 / -1}:host([loading]) [part="table"] {opacity: 0.5}[part="drag-preview"] {background-color: var(--data-table-drag-preview-background-color, var(--helix-color-surface-raised));border: var(--data-table-drag-preview-border-width, var(--helix-border-floating)) solid var(--data-table-drag-preview-border-color, var(--helix-color-border));border-radius: var(--data-table-drag-preview-radius, var(--helix-radii-sm));box-shadow: var(--data-table-drag-preview-shadow, var(--helix-shadow-floating));opacity: var(--data-table-drag-preview-opacity, 0.9)}@media print {:host {background-color: transparent}[part="table"] {overflow-x: visible}:host([windowed]) [part="table"] {block-size: auto;overflow-y: visible}[part="footer"] {display: none}}`);
|
|
@@ -22,7 +22,9 @@ import '../../pagination/index.js';
|
|
|
22
22
|
* Write it under the columns as `helix-table-row` and `helix-table-cell`
|
|
23
23
|
* elements. `@fusion.dev/helix-styles/helix.css` lays them out as the table
|
|
24
24
|
* draws them before it upgrades, and the table shows them until `rows` holds a
|
|
25
|
-
* row.
|
|
25
|
+
* row. It holds the checkbox column and the pagination's row from the first
|
|
26
|
+
* paint, and takes the widths from `columns`, so nothing moves when the table
|
|
27
|
+
* upgrades or draws its own rows.
|
|
26
28
|
*
|
|
27
29
|
* @since 0.1.0
|
|
28
30
|
* @status stable
|
|
@@ -40,7 +40,7 @@ import { type StrandsVariant } from '../path.js';
|
|
|
40
40
|
*
|
|
41
41
|
* The ribbon stops moving in these cases:
|
|
42
42
|
* - `prefers-reduced-motion` is set. The element shows one still frame, and in
|
|
43
|
-
* `travel` still follows the scroll
|
|
43
|
+
* `travel` still follows the scroll.
|
|
44
44
|
* - The element is off screen or in a background tab.
|
|
45
45
|
*
|
|
46
46
|
* It shows a gradient from the same tokens in these cases, and matches
|
|
@@ -185,7 +185,7 @@ export declare class HelixStrands extends HelixElement {
|
|
|
185
185
|
private readonly quietRects;
|
|
186
186
|
/** In `travel`, the path's `y` at even steps of its parameter. */
|
|
187
187
|
private table;
|
|
188
|
-
/** In `travel`, the scroll position the ribbon
|
|
188
|
+
/** In `travel`, the scroll position the ribbon was last drawn at. */
|
|
189
189
|
private offset;
|
|
190
190
|
/** Whether the opening frame has been drawn. Aura's settle: see `open`. */
|
|
191
191
|
private opened;
|
|
@@ -256,8 +256,8 @@ export declare class HelixStrands extends HelixElement {
|
|
|
256
256
|
/** A layout on the next frame, once, however many changes asked for one. */
|
|
257
257
|
private readonly relayout;
|
|
258
258
|
/**
|
|
259
|
-
* The page scrolled. A running loop
|
|
260
|
-
* one, for a reader who asked for no motion,
|
|
259
|
+
* The page scrolled. A running loop draws the new position on its next
|
|
260
|
+
* frame; a stopped one, for a reader who asked for no motion, paints once.
|
|
261
261
|
*/
|
|
262
262
|
private readonly handleScroll;
|
|
263
263
|
private paint;
|
|
@@ -10,7 +10,6 @@ import { styles } from './strands-root.css.js';
|
|
|
10
10
|
const MAX_CANVAS_EDGE = 4096;
|
|
11
11
|
const MAX_CANVAS_PIXELS = 4_194_304;
|
|
12
12
|
const OPENING_PATIENCE = 500;
|
|
13
|
-
const TRAVEL_EASE = 0.09;
|
|
14
13
|
const PACE = 0.25;
|
|
15
14
|
let HelixStrands = class HelixStrands extends HelixElement {
|
|
16
15
|
constructor() {
|
|
@@ -465,11 +464,7 @@ let HelixStrands = class HelixStrands extends HelixElement {
|
|
|
465
464
|
this.held = 0;
|
|
466
465
|
this.elapsed += step * PACE * Math.max(0, this.speed);
|
|
467
466
|
if (this.travel) {
|
|
468
|
-
|
|
469
|
-
this.offset += (target - this.offset) * (1 - Math.exp(-step / TRAVEL_EASE));
|
|
470
|
-
if (Math.abs(target - this.offset) < 0.5) {
|
|
471
|
-
this.offset = target;
|
|
472
|
-
}
|
|
467
|
+
this.offset = window.scrollY;
|
|
473
468
|
}
|
|
474
469
|
this.paint();
|
|
475
470
|
}
|