@fusion.dev/helix-headless 0.180.0 → 0.181.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 +214 -3
- package/dist/checkbox/root/checkbox-root.d.ts +6 -0
- package/dist/checkbox/root/checkbox-root.js +5 -0
- package/dist/heatmap/rectangle.d.ts +24 -0
- package/dist/heatmap/rectangle.js +18 -0
- package/dist/heatmap/root/heatmap-root.d.ts +38 -1
- package/dist/heatmap/root/heatmap-root.js +39 -1
- package/dist/radio/root/radio-root.d.ts +6 -0
- package/dist/radio/root/radio-root.js +5 -0
- package/dist/switch/root/switch-root.d.ts +6 -0
- package/dist/switch/root/switch-root.js +5 -0
- package/dist/toggle/root/toggle-root.d.ts +6 -0
- package/dist/toggle/root/toggle-root.js +5 -0
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +68 -0
- package/types/vue.d.ts +9 -1
package/custom-elements.json
CHANGED
|
@@ -29727,6 +29727,19 @@
|
|
|
29727
29727
|
},
|
|
29728
29728
|
"description": "Asks the slot, and records the answer as a state.\n\nCalled on `slotchange` and after every update, and the second is not\nbelt-and-braces: **`slotchange` does not fire when nothing is assigned.**\nWithout it a checkbox labeled only by its property, which is most of them,\nnever hears about its own label and renders without one.\n\n**`:state(has-label)` and not `data-has-label`.** The answer comes from\n`assignedNodes` and a server has no tree to ask, so an attribute would\nappear on every labeled checkbox the instant it upgraded and on none that\nany server sent. See `HelixElement.toggleState`."
|
|
29729
29729
|
},
|
|
29730
|
+
{
|
|
29731
|
+
"kind": "method",
|
|
29732
|
+
"name": "click",
|
|
29733
|
+
"return": {
|
|
29734
|
+
"type": {
|
|
29735
|
+
"text": "void"
|
|
29736
|
+
}
|
|
29737
|
+
},
|
|
29738
|
+
"description": "Ticks or clears the box, as `click()` does a native checkbox: passed to the control\ninside, so the one click a listener hears is the control's, after it has\nmoved. See `HostClickController`.",
|
|
29739
|
+
"type": {
|
|
29740
|
+
"text": "click() => void"
|
|
29741
|
+
}
|
|
29742
|
+
},
|
|
29730
29743
|
{
|
|
29731
29744
|
"kind": "field",
|
|
29732
29745
|
"name": "checked",
|
|
@@ -79050,6 +79063,90 @@
|
|
|
79050
79063
|
}
|
|
79051
79064
|
]
|
|
79052
79065
|
},
|
|
79066
|
+
{
|
|
79067
|
+
"kind": "javascript-module",
|
|
79068
|
+
"path": "src/heatmap/rectangle.ts",
|
|
79069
|
+
"declarations": [
|
|
79070
|
+
{
|
|
79071
|
+
"kind": "function",
|
|
79072
|
+
"name": "rectangleOf",
|
|
79073
|
+
"return": {
|
|
79074
|
+
"type": {
|
|
79075
|
+
"text": "number[]"
|
|
79076
|
+
}
|
|
79077
|
+
},
|
|
79078
|
+
"parameters": [
|
|
79079
|
+
{
|
|
79080
|
+
"name": "count",
|
|
79081
|
+
"type": {
|
|
79082
|
+
"text": "number"
|
|
79083
|
+
}
|
|
79084
|
+
},
|
|
79085
|
+
{
|
|
79086
|
+
"name": "rows",
|
|
79087
|
+
"type": {
|
|
79088
|
+
"text": "number"
|
|
79089
|
+
}
|
|
79090
|
+
},
|
|
79091
|
+
{
|
|
79092
|
+
"name": "from",
|
|
79093
|
+
"type": {
|
|
79094
|
+
"text": "number"
|
|
79095
|
+
}
|
|
79096
|
+
},
|
|
79097
|
+
{
|
|
79098
|
+
"name": "to",
|
|
79099
|
+
"type": {
|
|
79100
|
+
"text": "number"
|
|
79101
|
+
}
|
|
79102
|
+
}
|
|
79103
|
+
],
|
|
79104
|
+
"description": "The cells between `from` and `to` by row and by column, in the order the\ncells are drawn: every cell whose column lies between theirs and whose row\nlies between theirs. A place past the end of a short last column holds no\ncell and is skipped. With one row, it is the run of cells from one to the\nother."
|
|
79105
|
+
},
|
|
79106
|
+
{
|
|
79107
|
+
"kind": "function",
|
|
79108
|
+
"name": "inSequence",
|
|
79109
|
+
"return": {
|
|
79110
|
+
"type": {
|
|
79111
|
+
"text": "string[]"
|
|
79112
|
+
}
|
|
79113
|
+
},
|
|
79114
|
+
"parameters": [
|
|
79115
|
+
{
|
|
79116
|
+
"name": "picked",
|
|
79117
|
+
"type": {
|
|
79118
|
+
"text": "readonly string[]"
|
|
79119
|
+
}
|
|
79120
|
+
},
|
|
79121
|
+
{
|
|
79122
|
+
"name": "order",
|
|
79123
|
+
"type": {
|
|
79124
|
+
"text": "readonly string[]"
|
|
79125
|
+
}
|
|
79126
|
+
}
|
|
79127
|
+
],
|
|
79128
|
+
"description": "`picked` without repeats, in the order `order` gives: the selected cells in\nthe order the table lists them. A value `order` does not hold keeps its\nplace after the rest, so a selected day the strip no longer draws stays\nselected."
|
|
79129
|
+
}
|
|
79130
|
+
],
|
|
79131
|
+
"exports": [
|
|
79132
|
+
{
|
|
79133
|
+
"kind": "js",
|
|
79134
|
+
"name": "rectangleOf",
|
|
79135
|
+
"declaration": {
|
|
79136
|
+
"name": "rectangleOf",
|
|
79137
|
+
"module": "src/heatmap/rectangle.ts"
|
|
79138
|
+
}
|
|
79139
|
+
},
|
|
79140
|
+
{
|
|
79141
|
+
"kind": "js",
|
|
79142
|
+
"name": "inSequence",
|
|
79143
|
+
"declaration": {
|
|
79144
|
+
"name": "inSequence",
|
|
79145
|
+
"module": "src/heatmap/rectangle.ts"
|
|
79146
|
+
}
|
|
79147
|
+
}
|
|
79148
|
+
]
|
|
79149
|
+
},
|
|
79053
79150
|
{
|
|
79054
79151
|
"kind": "javascript-module",
|
|
79055
79152
|
"path": "src/heatmap/root/buckets.ts",
|
|
@@ -79214,7 +79311,7 @@
|
|
|
79214
79311
|
"declarations": [
|
|
79215
79312
|
{
|
|
79216
79313
|
"kind": "class",
|
|
79217
|
-
"description": "A grid of cells, each colored by a tone. `rows=\"1\"` makes a status strip, and\n`rows=\"7\"` makes a contribution graph. GitHub's contribution graph uses five\ndiscrete levels, which a set of tones covers.\n\nColor in a heatmap is per cell. In every other Helix chart, color is per\nseries, so ninety differently colored cells would need ninety series.\n\n**The data is a real `<table>` named by `for`**, as in every Helix chart, and\nthe table is the accessible representation. Hide it with\n`data-hidden-visually`, and screen readers still read it.\n\nA cell takes its tone from its own `data-tone`, or from `thresholds` and\n`tones` applied to its value. `data-tone` wins, so when you already know a\nday was degraded, you can set the tone directly.\n\n**The headless tier does not resolve tone names.** A tone named `success`\nwrites `--heatmap-tone: var(--heatmap-tone-success)`, and the styled tier or\nyour own stylesheet defines that property. The headless tier does not use\n`var(--helix-color-*)`.\n\n**The strip is read by key.** It takes focus once it has cells. The up and\ndown arrows move a cell, the left and right arrows move a column, which is a\nweek with `rows=\"7\"`, and Home and End go to the first and the last. The\ntooltip follows, the `live` part says the cell's row in words, and Escape\nputs the tooltip away. PageUp and PageDown move a month, to the same day,\nwhere each row's header carries its date as a `<time datetime>`, and four\ncolumns otherwise, which is four weeks with `rows=\"7\"`.\n\n**The strip describes itself.** The `overview` part says the busiest\nreading and the total of the readings drawn, \"Busiest: 11 Jun, 12; Total\n84\", and the strip is described by it, as every chart is by its summary.\nHide it visually. The `summary` slot is still yours, for words of your own.\n\n**`selection-mode` lets a reader select cells**: `single` one at a time and\n`multiple` any number. Space, Enter or a press selects the cell the keys or\nthe pointer rest on, or lets it go, and under `multiple` Shift with an arrow,\nHome, End, PageUp or PageDown takes in every cell from the last one pressed\nto where the key went. `value` holds the selected days, separated by\ncommas: each by its row's `<time datetime>`, such as `2026-06-11`, or by\nits row's name where the row carries no date. A change asks with\n`helix-before-change` and tells with `change`, and the `selection` part says\nhow many are selected, in `selection-label`.\n\n**Under `selection-mode` the strip is a grid**, so the selection is state a\nreader is told rather than words alone: each column of the strip is a `row`,\na week with `rows=\"7\"`, and each cell a `gridcell` named by its row in the\ntable and carrying `aria-selected`. The strip says\n`aria-multiselectable` under `multiple` and points at the cell the keys rest\non with `aria-activedescendant`, so a screen reader reads that cell, and the\n`live` part stays quiet. Without `selection-mode` nothing is selectable, and\nthe strip is an application with the readout, as every chart's plot is.\n\n**Readings are sent as every chart sends them.** `helix-reading-change`\nsays each move of the reading, by pointer, tap or key, and\n`helix-reading-press` a reading clicked, tapped, or pressed with Enter or\nSpace, each with the row of the table in `index`.\n\n**Nothing to draw.** A table with no readings shows `empty-text`, \"No\nreadings\", under the strip, and `loading` shows `loading-text` there until\nreadings arrive. The `empty` and `loading` slots take markup in place of\neither, as on every chart.\n\n**Keyboard.** The strip is one tab stop once it has cells.\n\n| Key | What it does |\n|---|---|\n| Tab | Moves focus to the strip and shows the first cell. |\n| Down, Up | Moves to the next or the previous cell. |\n| Right, Left | Moves a column on or back, a week with `rows=\"7\"`. On a right-to-left page, Left moves on. |\n| Home, End | Moves to the first or the last cell. |\n| Page Down, Page Up | Moves a month on or back where the rows carry dates, and four columns otherwise. |\n| Enter, Space | Presses the cell, which sends `helix-reading-press`, and selects it or lets it go under `selection-mode`. |\n| Shift with an arrow, Home, End, Page Up or Page Down | Selects every cell from the last one pressed to where the key went, under `selection-mode=\"multiple\"`. |\n| Escape | Puts the cell's tooltip away. |",
|
|
79314
|
+
"description": "A grid of cells, each colored by a tone. `rows=\"1\"` makes a status strip, and\n`rows=\"7\"` makes a contribution graph. GitHub's contribution graph uses five\ndiscrete levels, which a set of tones covers.\n\nColor in a heatmap is per cell. In every other Helix chart, color is per\nseries, so ninety differently colored cells would need ninety series.\n\n**The data is a real `<table>` named by `for`**, as in every Helix chart, and\nthe table is the accessible representation. Hide it with\n`data-hidden-visually`, and screen readers still read it.\n\nA cell takes its tone from its own `data-tone`, or from `thresholds` and\n`tones` applied to its value. `data-tone` wins, so when you already know a\nday was degraded, you can set the tone directly.\n\n**The headless tier does not resolve tone names.** A tone named `success`\nwrites `--heatmap-tone: var(--heatmap-tone-success)`, and the styled tier or\nyour own stylesheet defines that property. The headless tier does not use\n`var(--helix-color-*)`.\n\n**The strip is read by key.** It takes focus once it has cells. The up and\ndown arrows move a cell, the left and right arrows move a column, which is a\nweek with `rows=\"7\"`, and Home and End go to the first and the last. The\ntooltip follows, the `live` part says the cell's row in words, and Escape\nputs the tooltip away. PageUp and PageDown move a month, to the same day,\nwhere each row's header carries its date as a `<time datetime>`, and four\ncolumns otherwise, which is four weeks with `rows=\"7\"`.\n\n**The strip describes itself.** The `overview` part says the busiest\nreading and the total of the readings drawn, \"Busiest: 11 Jun, 12; Total\n84\", and the strip is described by it, as every chart is by its summary.\nHide it visually. The `summary` slot is still yours, for words of your own.\n\n**`selection-mode` lets a reader select cells**: `single` one at a time and\n`multiple` any number. Space, Enter or a press selects the cell the keys or\nthe pointer rest on, or lets it go, and under `multiple` Shift with an arrow,\nHome, End, PageUp or PageDown takes in every cell from the last one pressed\nto where the key went. `value` holds the selected days, separated by\ncommas: each by its row's `<time datetime>`, such as `2026-06-11`, or by\nits row's name where the row carries no date. A change asks with\n`helix-before-change` and tells with `change`, and the `selection` part says\nhow many are selected, in `selection-label`.\n\n**`selection-shape=\"rectangle\"` selects a rectangle of cells** under\n`multiple`, as a spreadsheet selects a range: the cells between two corners\nby row and by column, such as the same weekdays across three weeks with\n`rows=\"7\"`. Shift with a key that moves grows or shrinks it from the cell\nlast pressed, Shift with a click takes it to the cell clicked, and a click\nwith Ctrl or Command selects one cell or lets it go and starts the next\nrectangle there. The rectangle is the same cells on a right-to-left page,\nwhere the columns run from the right, a short last column adds only the\ncells it has, and `value` lists the selected days in the table's order.\n\n**Under `selection-mode` the strip is a grid**, so the selection is state a\nreader is told rather than words alone: each column of the strip is a `row`,\na week with `rows=\"7\"`, and each cell a `gridcell` named by its row in the\ntable and carrying `aria-selected`. The strip says\n`aria-multiselectable` under `multiple` and points at the cell the keys rest\non with `aria-activedescendant`, so a screen reader reads that cell, and the\n`live` part stays quiet. Without `selection-mode` nothing is selectable, and\nthe strip is an application with the readout, as every chart's plot is.\n\n**Readings are sent as every chart sends them.** `helix-reading-change`\nsays each move of the reading, by pointer, tap or key, and\n`helix-reading-press` a reading clicked, tapped, or pressed with Enter or\nSpace, each with the row of the table in `index`.\n\n**Nothing to draw.** A table with no readings shows `empty-text`, \"No\nreadings\", under the strip, and `loading` shows `loading-text` there until\nreadings arrive. The `empty` and `loading` slots take markup in place of\neither, as on every chart.\n\n**Keyboard.** The strip is one tab stop once it has cells.\n\n| Key | What it does |\n|---|---|\n| Tab | Moves focus to the strip and shows the first cell. |\n| Down, Up | Moves to the next or the previous cell. |\n| Right, Left | Moves a column on or back, a week with `rows=\"7\"`. On a right-to-left page, Left moves on. |\n| Home, End | Moves to the first or the last cell. |\n| Page Down, Page Up | Moves a month on or back where the rows carry dates, and four columns otherwise. |\n| Enter, Space | Presses the cell, which sends `helix-reading-press`, and selects it or lets it go under `selection-mode`. |\n| Shift with an arrow, Home, End, Page Up or Page Down | Selects every cell from the last one pressed to where the key went, under `selection-mode=\"multiple\"`. |\n| Shift with an arrow, Home, End, Page Up or Page Down, with `selection-shape=\"rectangle\"` | Grows or shrinks the rectangle from the last cell pressed to where the key went, in rows and columns, under `selection-mode=\"multiple\"`. |\n| Escape | Puts the cell's tooltip away. |",
|
|
79218
79315
|
"name": "HelixHeadlessHeatmap",
|
|
79219
79316
|
"cssProperties": [
|
|
79220
79317
|
{
|
|
@@ -79536,6 +79633,16 @@
|
|
|
79536
79633
|
"description": "How many cells a reader can select: `single` or `multiple`.\n\nAbsent selects nothing, and a press or Space does what it did.",
|
|
79537
79634
|
"attribute": "selection-mode"
|
|
79538
79635
|
},
|
|
79636
|
+
{
|
|
79637
|
+
"kind": "field",
|
|
79638
|
+
"name": "selectionShape",
|
|
79639
|
+
"type": {
|
|
79640
|
+
"text": "'linear' | 'rectangle'"
|
|
79641
|
+
},
|
|
79642
|
+
"default": "'linear'",
|
|
79643
|
+
"description": "What Shift takes in under `selection-mode=\"multiple\"`: `linear`, every\ncell between two in the table's order, or `rectangle`, the cells between\ntwo corners by row and by column, as a spreadsheet selects a range.",
|
|
79644
|
+
"attribute": "selection-shape"
|
|
79645
|
+
},
|
|
79539
79646
|
{
|
|
79540
79647
|
"kind": "field",
|
|
79541
79648
|
"name": "stripLabel",
|
|
@@ -79657,6 +79764,36 @@
|
|
|
79657
79764
|
"default": "-1",
|
|
79658
79765
|
"description": "Where a range taken in with Shift starts: the cell last pressed, or none."
|
|
79659
79766
|
},
|
|
79767
|
+
{
|
|
79768
|
+
"kind": "field",
|
|
79769
|
+
"name": "left",
|
|
79770
|
+
"type": {
|
|
79771
|
+
"text": "number"
|
|
79772
|
+
},
|
|
79773
|
+
"privacy": "private",
|
|
79774
|
+
"default": "-1",
|
|
79775
|
+
"description": "The cell the keys rested on before the key now being handled moved them."
|
|
79776
|
+
},
|
|
79777
|
+
{
|
|
79778
|
+
"kind": "field",
|
|
79779
|
+
"name": "base",
|
|
79780
|
+
"type": {
|
|
79781
|
+
"text": "string[] | undefined"
|
|
79782
|
+
},
|
|
79783
|
+
"privacy": "private",
|
|
79784
|
+
"default": "undefined",
|
|
79785
|
+
"description": "What a rectangle is added to: the selection when it was started, less its\nanchor, kept while `value` is still the rectangle last written."
|
|
79786
|
+
},
|
|
79787
|
+
{
|
|
79788
|
+
"kind": "field",
|
|
79789
|
+
"name": "shaped",
|
|
79790
|
+
"type": {
|
|
79791
|
+
"text": "string | undefined"
|
|
79792
|
+
},
|
|
79793
|
+
"privacy": "private",
|
|
79794
|
+
"default": "undefined",
|
|
79795
|
+
"description": "The `value` the last rectangle wrote."
|
|
79796
|
+
},
|
|
79660
79797
|
{
|
|
79661
79798
|
"kind": "field",
|
|
79662
79799
|
"name": "status",
|
|
@@ -79722,6 +79859,32 @@
|
|
|
79722
79859
|
],
|
|
79723
79860
|
"description": "Selects the drawn cell at `index`, or lets it go, as `selection-mode` says."
|
|
79724
79861
|
},
|
|
79862
|
+
{
|
|
79863
|
+
"kind": "method",
|
|
79864
|
+
"name": "stretch",
|
|
79865
|
+
"privacy": "private",
|
|
79866
|
+
"return": {
|
|
79867
|
+
"type": {
|
|
79868
|
+
"text": "void"
|
|
79869
|
+
}
|
|
79870
|
+
},
|
|
79871
|
+
"parameters": [
|
|
79872
|
+
{
|
|
79873
|
+
"name": "to",
|
|
79874
|
+
"type": {
|
|
79875
|
+
"text": "number"
|
|
79876
|
+
}
|
|
79877
|
+
}
|
|
79878
|
+
],
|
|
79879
|
+
"description": "Selects the rectangle from the anchor to the drawn cell at `to`, beside\nwhat was selected before it started, under `selection-shape=\"rectangle\"`.\nWithout an anchor it starts where the keys were."
|
|
79880
|
+
},
|
|
79881
|
+
{
|
|
79882
|
+
"kind": "field",
|
|
79883
|
+
"name": "onStripKeydown",
|
|
79884
|
+
"privacy": "private",
|
|
79885
|
+
"readonly": true,
|
|
79886
|
+
"description": "Notes where the keys rest before the pointer controller moves them."
|
|
79887
|
+
},
|
|
79725
79888
|
{
|
|
79726
79889
|
"kind": "field",
|
|
79727
79890
|
"name": "onKeydown",
|
|
@@ -79734,7 +79897,7 @@
|
|
|
79734
79897
|
"name": "onClick",
|
|
79735
79898
|
"privacy": "private",
|
|
79736
79899
|
"readonly": true,
|
|
79737
|
-
"description": "A press on a cell selects it, under `selection-mode`."
|
|
79900
|
+
"description": "A press on a cell selects it, under `selection-mode`, and Shift takes the\nrectangle to it under `selection-shape=\"rectangle\"`."
|
|
79738
79901
|
},
|
|
79739
79902
|
{
|
|
79740
79903
|
"kind": "field",
|
|
@@ -80740,6 +80903,15 @@
|
|
|
80740
80903
|
"description": "How many cells a reader can select: `single` or `multiple`.\n\nAbsent selects nothing, and a press or Space does what it did.",
|
|
80741
80904
|
"fieldName": "selectionMode"
|
|
80742
80905
|
},
|
|
80906
|
+
{
|
|
80907
|
+
"name": "selection-shape",
|
|
80908
|
+
"type": {
|
|
80909
|
+
"text": "'linear' | 'rectangle'"
|
|
80910
|
+
},
|
|
80911
|
+
"default": "'linear'",
|
|
80912
|
+
"description": "What Shift takes in under `selection-mode=\"multiple\"`: `linear`, every\ncell between two in the table's order, or `rectangle`, the cells between\ntwo corners by row and by column, as a spreadsheet selects a range.",
|
|
80913
|
+
"fieldName": "selectionShape"
|
|
80914
|
+
},
|
|
80743
80915
|
{
|
|
80744
80916
|
"name": "strip-label",
|
|
80745
80917
|
"type": {
|
|
@@ -137270,6 +137442,19 @@
|
|
|
137270
137442
|
},
|
|
137271
137443
|
"description": "Whether the radio holds the group's tab stop. Unset, the chosen radio\nholds it.\n\nThe stop rides on the selection, and an unanswered group has no selection,\nso without this every choice is `tabindex=\"-1\"` and the keyboard cannot\nenter the set at all. The group writes `true` for the chosen radio, or for\nthe first that can be chosen while nothing is, and `false` for every radio,\nthe chosen one too, while a toolbar the group sits in holds the stop.\n\n**Written by the group, with no attribute, and it reaches the control\nrather than the host.** A `tabindex` on the host is two faults at once: it\nis markup a consumer rendered and their server never sent, which React\nreports as a mismatch and does not patch up, and it puts the tab stop on\nthe element rather than on the `<button role=\"radio\">` inside it, so a\nscreen reader meets an unnamed box where a native group would have given\nthem an unchecked radio. `Toggle.Root` carries the same property for the\nsame reason."
|
|
137272
137444
|
},
|
|
137445
|
+
{
|
|
137446
|
+
"kind": "method",
|
|
137447
|
+
"name": "click",
|
|
137448
|
+
"return": {
|
|
137449
|
+
"type": {
|
|
137450
|
+
"text": "void"
|
|
137451
|
+
}
|
|
137452
|
+
},
|
|
137453
|
+
"description": "Chooses the radio, as `click()` does a native radio: passed to the control\ninside, so the one click a listener hears is the control's, after it has\nmoved. See `HostClickController`.",
|
|
137454
|
+
"type": {
|
|
137455
|
+
"text": "click() => void"
|
|
137456
|
+
}
|
|
137457
|
+
},
|
|
137273
137458
|
{
|
|
137274
137459
|
"kind": "field",
|
|
137275
137460
|
"name": "disabled",
|
|
@@ -157082,6 +157267,19 @@
|
|
|
157082
157267
|
},
|
|
157083
157268
|
"description": "The thumb, drawn inside the track after the input: nothing on this tier.\n\nA seam for a tier that draws the thumb as an element, so it can be a part\nand hold icons. An element here would be an empty child on every page that\nloads only this tier, which is the cost the `track` part notes."
|
|
157084
157269
|
},
|
|
157270
|
+
{
|
|
157271
|
+
"kind": "method",
|
|
157272
|
+
"name": "click",
|
|
157273
|
+
"return": {
|
|
157274
|
+
"type": {
|
|
157275
|
+
"text": "void"
|
|
157276
|
+
}
|
|
157277
|
+
},
|
|
157278
|
+
"description": "Turns the switch on or off, as `click()` does a native checkbox: passed to the control\ninside, so the one click a listener hears is the control's, after it has\nmoved. See `HostClickController`.",
|
|
157279
|
+
"type": {
|
|
157280
|
+
"text": "click() => void"
|
|
157281
|
+
}
|
|
157282
|
+
},
|
|
157085
157283
|
{
|
|
157086
157284
|
"kind": "field",
|
|
157087
157285
|
"name": "checked",
|
|
@@ -182922,6 +183120,19 @@
|
|
|
182922
183120
|
"text": "select() => boolean"
|
|
182923
183121
|
}
|
|
182924
183122
|
},
|
|
183123
|
+
{
|
|
183124
|
+
"kind": "method",
|
|
183125
|
+
"name": "click",
|
|
183126
|
+
"return": {
|
|
183127
|
+
"type": {
|
|
183128
|
+
"text": "void"
|
|
183129
|
+
}
|
|
183130
|
+
},
|
|
183131
|
+
"description": "Presses the toggle, as `click()` does a native button: passed to the control\ninside, so the one click a listener hears is the control's, after it has\nmoved. See `HostClickController`.",
|
|
183132
|
+
"type": {
|
|
183133
|
+
"text": "click() => void"
|
|
183134
|
+
}
|
|
183135
|
+
},
|
|
182925
183136
|
{
|
|
182926
183137
|
"kind": "field",
|
|
182927
183138
|
"name": "disabled",
|
|
@@ -199834,6 +200045,6 @@
|
|
|
199834
200045
|
],
|
|
199835
200046
|
"helix": {
|
|
199836
200047
|
"package": "@fusion.dev/helix-headless",
|
|
199837
|
-
"version": "0.
|
|
200048
|
+
"version": "0.181.0"
|
|
199838
200049
|
}
|
|
199839
200050
|
}
|
|
@@ -152,6 +152,12 @@ export declare class HelixHeadlessCheckbox extends HelixHeadlessCheckbox_base {
|
|
|
152
152
|
* any server sent. See `HelixElement.toggleState`.
|
|
153
153
|
*/
|
|
154
154
|
private syncLabelPresence;
|
|
155
|
+
/**
|
|
156
|
+
* Ticks or clears the box, as `click()` does a native checkbox: passed to the control
|
|
157
|
+
* inside, so the one click a listener hears is the control's, after it has
|
|
158
|
+
* moved. See `HostClickController`.
|
|
159
|
+
*/
|
|
160
|
+
click(): void;
|
|
155
161
|
protected render(): TemplateResult;
|
|
156
162
|
}
|
|
157
163
|
declare global {
|
|
@@ -83,6 +83,11 @@ let HelixHeadlessCheckbox = class HelixHeadlessCheckbox extends MixinControllerC
|
|
|
83
83
|
this.toggleState('has-label', filled && !hidden);
|
|
84
84
|
this.partNamed('label')?.toggleAttribute('hidden', !filled);
|
|
85
85
|
}
|
|
86
|
+
click() {
|
|
87
|
+
if (!this.clicks.click()) {
|
|
88
|
+
super.click();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
86
91
|
render() {
|
|
87
92
|
const named = this.label === '' ? this.getAttribute('aria-label') : null;
|
|
88
93
|
return html `<label part="field">
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arithmetic of a rectangle of cells on a heatmap's strip.
|
|
3
|
+
*
|
|
4
|
+
* Pure and beside the family's entry, so a spec holds it without a page. The
|
|
5
|
+
* strip fills `rows` cells down each column and then across, so cell `i` is in
|
|
6
|
+
* column `floor(i / rows)` and row `i % rows`, on every page: a right-to-left
|
|
7
|
+
* page turns the drawing about, and a rectangle between two cells takes in the
|
|
8
|
+
* same cells whichever way the columns run.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The cells between `from` and `to` by row and by column, in the order the
|
|
12
|
+
* cells are drawn: every cell whose column lies between theirs and whose row
|
|
13
|
+
* lies between theirs. A place past the end of a short last column holds no
|
|
14
|
+
* cell and is skipped. With one row, it is the run of cells from one to the
|
|
15
|
+
* other.
|
|
16
|
+
*/
|
|
17
|
+
export declare const rectangleOf: (count: number, rows: number, from: number, to: number) => number[];
|
|
18
|
+
/**
|
|
19
|
+
* `picked` without repeats, in the order `order` gives: the selected cells in
|
|
20
|
+
* the order the table lists them. A value `order` does not hold keeps its
|
|
21
|
+
* place after the rest, so a selected day the strip no longer draws stays
|
|
22
|
+
* selected.
|
|
23
|
+
*/
|
|
24
|
+
export declare const inSequence: (picked: readonly string[], order: readonly string[]) => string[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const within = (value, a, b) => (value - a) * (value - b) <= 0;
|
|
2
|
+
export const rectangleOf = (count, rows, from, to) => {
|
|
3
|
+
const taken = [];
|
|
4
|
+
for (let at = 0; at < count; at += 1) {
|
|
5
|
+
if (within(Math.floor(at / rows), Math.floor(from / rows), Math.floor(to / rows)) &&
|
|
6
|
+
within(at % rows, from % rows, to % rows)) {
|
|
7
|
+
taken.push(at);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return taken;
|
|
11
|
+
};
|
|
12
|
+
export const inSequence = (picked, order) => {
|
|
13
|
+
const at = (key) => {
|
|
14
|
+
const place = order.indexOf(key);
|
|
15
|
+
return place < 0 ? order.length : place;
|
|
16
|
+
};
|
|
17
|
+
return [...new Set(picked)].sort((a, b) => at(a) - at(b));
|
|
18
|
+
};
|
|
@@ -50,6 +50,16 @@ declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: an
|
|
|
50
50
|
* `helix-before-change` and tells with `change`, and the `selection` part says
|
|
51
51
|
* how many are selected, in `selection-label`.
|
|
52
52
|
*
|
|
53
|
+
* **`selection-shape="rectangle"` selects a rectangle of cells** under
|
|
54
|
+
* `multiple`, as a spreadsheet selects a range: the cells between two corners
|
|
55
|
+
* by row and by column, such as the same weekdays across three weeks with
|
|
56
|
+
* `rows="7"`. Shift with a key that moves grows or shrinks it from the cell
|
|
57
|
+
* last pressed, Shift with a click takes it to the cell clicked, and a click
|
|
58
|
+
* with Ctrl or Command selects one cell or lets it go and starts the next
|
|
59
|
+
* rectangle there. The rectangle is the same cells on a right-to-left page,
|
|
60
|
+
* where the columns run from the right, a short last column adds only the
|
|
61
|
+
* cells it has, and `value` lists the selected days in the table's order.
|
|
62
|
+
*
|
|
53
63
|
* **Under `selection-mode` the strip is a grid**, so the selection is state a
|
|
54
64
|
* reader is told rather than words alone: each column of the strip is a `row`,
|
|
55
65
|
* a week with `rows="7"`, and each cell a `gridcell` named by its row in the
|
|
@@ -80,6 +90,7 @@ declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: an
|
|
|
80
90
|
* | Page Down, Page Up | Moves a month on or back where the rows carry dates, and four columns otherwise. |
|
|
81
91
|
* | Enter, Space | Presses the cell, which sends `helix-reading-press`, and selects it or lets it go under `selection-mode`. |
|
|
82
92
|
* | Shift with an arrow, Home, End, Page Up or Page Down | Selects every cell from the last one pressed to where the key went, under `selection-mode="multiple"`. |
|
|
93
|
+
* | Shift with an arrow, Home, End, Page Up or Page Down, with `selection-shape="rectangle"` | Grows or shrinks the rectangle from the last cell pressed to where the key went, in rows and columns, under `selection-mode="multiple"`. |
|
|
83
94
|
* | Escape | Puts the cell's tooltip away. |
|
|
84
95
|
*
|
|
85
96
|
* @since 0.1.0
|
|
@@ -227,6 +238,12 @@ export declare class HelixHeadlessHeatmap extends HelixHeadlessHeatmap_base {
|
|
|
227
238
|
* Absent selects nothing, and a press or Space does what it did.
|
|
228
239
|
*/
|
|
229
240
|
selectionMode?: 'multiple' | 'single';
|
|
241
|
+
/**
|
|
242
|
+
* What Shift takes in under `selection-mode="multiple"`: `linear`, every
|
|
243
|
+
* cell between two in the table's order, or `rectangle`, the cells between
|
|
244
|
+
* two corners by row and by column, as a spreadsheet selects a range.
|
|
245
|
+
*/
|
|
246
|
+
selectionShape: 'linear' | 'rectangle';
|
|
230
247
|
/**
|
|
231
248
|
* The strip's name where the chart has none: no `aria-label`, `label`, or
|
|
232
249
|
* table caption.
|
|
@@ -318,6 +335,15 @@ export declare class HelixHeadlessHeatmap extends HelixHeadlessHeatmap_base {
|
|
|
318
335
|
private announced;
|
|
319
336
|
/** Where a range taken in with Shift starts: the cell last pressed, or none. */
|
|
320
337
|
private anchor;
|
|
338
|
+
/** The cell the keys rested on before the key now being handled moved them. */
|
|
339
|
+
private left;
|
|
340
|
+
/**
|
|
341
|
+
* What a rectangle is added to: the selection when it was started, less its
|
|
342
|
+
* anchor, kept while `value` is still the rectangle last written.
|
|
343
|
+
*/
|
|
344
|
+
private base;
|
|
345
|
+
/** The `value` the last rectangle wrote. */
|
|
346
|
+
private shaped;
|
|
321
347
|
/** The region a change of selection is said in, rendered from the first change. */
|
|
322
348
|
private readonly status;
|
|
323
349
|
/**
|
|
@@ -334,13 +360,24 @@ export declare class HelixHeadlessHeatmap extends HelixHeadlessHeatmap_base {
|
|
|
334
360
|
private choose;
|
|
335
361
|
/** Selects the drawn cell at `index`, or lets it go, as `selection-mode` says. */
|
|
336
362
|
private press;
|
|
363
|
+
/**
|
|
364
|
+
* Selects the rectangle from the anchor to the drawn cell at `to`, beside
|
|
365
|
+
* what was selected before it started, under `selection-shape="rectangle"`.
|
|
366
|
+
* Without an anchor it starts where the keys were.
|
|
367
|
+
*/
|
|
368
|
+
private stretch;
|
|
369
|
+
/** Notes where the keys rest before the pointer controller moves them. */
|
|
370
|
+
private readonly onStripKeydown;
|
|
337
371
|
/**
|
|
338
372
|
* Space and Enter select the cell the keys rest on, and Shift with a key
|
|
339
373
|
* that moved them takes in the range from the anchor. After the pointer
|
|
340
374
|
* controller, which has already moved `at` for an arrow.
|
|
341
375
|
*/
|
|
342
376
|
private readonly onKeydown;
|
|
343
|
-
/**
|
|
377
|
+
/**
|
|
378
|
+
* A press on a cell selects it, under `selection-mode`, and Shift takes the
|
|
379
|
+
* rectangle to it under `selection-shape="rectangle"`.
|
|
380
|
+
*/
|
|
344
381
|
private readonly onClick;
|
|
345
382
|
/**
|
|
346
383
|
* Every row in the table, oldest first, as the table is written, with its
|
|
@@ -8,6 +8,7 @@ import { AriaForwardController, byRow, CHART_PLOT, commaList, customElement, dra
|
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property, state } from 'lit/decorators.js';
|
|
10
10
|
import '../../tooltip/index.js';
|
|
11
|
+
import { inSequence, rectangleOf } from '../rectangle.js';
|
|
11
12
|
import { fits, monthPage, overviewOf, toneOf } from './buckets.js';
|
|
12
13
|
let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(MixinChartSource(HelixElement)) {
|
|
13
14
|
constructor() {
|
|
@@ -19,6 +20,7 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(M
|
|
|
19
20
|
this.rows = 1;
|
|
20
21
|
this.selectedLabel = 'selected';
|
|
21
22
|
this.selectionLabel = '{count, plural, one {# selected} other {# selected}}';
|
|
23
|
+
this.selectionShape = 'linear';
|
|
22
24
|
this.stripLabel = 'Heatmap';
|
|
23
25
|
this.thresholds = '';
|
|
24
26
|
this.tones = '';
|
|
@@ -32,7 +34,13 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(M
|
|
|
32
34
|
this.observer = undefined;
|
|
33
35
|
this.announced = undefined;
|
|
34
36
|
this.anchor = -1;
|
|
37
|
+
this.left = -1;
|
|
38
|
+
this.base = undefined;
|
|
39
|
+
this.shaped = undefined;
|
|
35
40
|
this.status = new StatusController(this);
|
|
41
|
+
this.onStripKeydown = () => {
|
|
42
|
+
this.left = this.pointer.at;
|
|
43
|
+
};
|
|
36
44
|
this.onKeydown = (event) => {
|
|
37
45
|
const at = this.pointer.at;
|
|
38
46
|
if (!this.selectionMode || at < 0 || event.altKey || event.ctrlKey || event.metaKey) {
|
|
@@ -47,6 +55,10 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(M
|
|
|
47
55
|
if (!event.shiftKey || !moves || this.selectionMode !== 'multiple') {
|
|
48
56
|
return;
|
|
49
57
|
}
|
|
58
|
+
if (this.selectionShape === 'rectangle') {
|
|
59
|
+
this.stretch(at);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
50
62
|
const keys = this.keysOf(this.drawn);
|
|
51
63
|
const added = rangeAdd(commaList(this.value), keys, this.anchor < 0 ? at : this.anchor, at);
|
|
52
64
|
if (added) {
|
|
@@ -56,7 +68,14 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(M
|
|
|
56
68
|
this.onClick = (event) => {
|
|
57
69
|
const cell = event.target?.closest?.('[part~="cell"]');
|
|
58
70
|
const index = Number(cell?.getAttribute('data-index') ?? -1);
|
|
59
|
-
if (cell
|
|
71
|
+
if (!cell || !Number.isInteger(index) || index < 0) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const rectangle = this.selectionMode === 'multiple' && this.selectionShape === 'rectangle';
|
|
75
|
+
if (rectangle && event.shiftKey && this.anchor >= 0) {
|
|
76
|
+
this.stretch(index);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
60
79
|
this.press(index);
|
|
61
80
|
}
|
|
62
81
|
};
|
|
@@ -112,8 +131,23 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(M
|
|
|
112
131
|
return;
|
|
113
132
|
}
|
|
114
133
|
this.anchor = index;
|
|
134
|
+
this.base = undefined;
|
|
115
135
|
this.choose(pressedValue(mode, this.value, key));
|
|
116
136
|
}
|
|
137
|
+
stretch(to) {
|
|
138
|
+
const keys = this.keysOf(this.drawn);
|
|
139
|
+
if (this.anchor < 0) {
|
|
140
|
+
this.anchor = this.left < 0 ? to : this.left;
|
|
141
|
+
}
|
|
142
|
+
if (this.base === undefined || this.value !== this.shaped) {
|
|
143
|
+
const corner = keys[this.anchor];
|
|
144
|
+
this.base = commaList(this.value).filter((one) => one !== corner);
|
|
145
|
+
}
|
|
146
|
+
const taken = rectangleOf(keys.length, this.rowCount, this.anchor, to).map((at) => keys[at] ?? '');
|
|
147
|
+
const all = this.keysOf(this.points);
|
|
148
|
+
this.choose(inSequence([...this.base, ...taken].filter(Boolean), all).join(', '));
|
|
149
|
+
this.shaped = this.value;
|
|
150
|
+
}
|
|
117
151
|
get points() {
|
|
118
152
|
const series = this.series[0];
|
|
119
153
|
if (!series) {
|
|
@@ -250,6 +284,7 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(M
|
|
|
250
284
|
style="--heatmap-rows: ${this.rowCount}"
|
|
251
285
|
tabindex=${readable ? '0' : nothing}
|
|
252
286
|
@click=${this.onClick}
|
|
287
|
+
@keydown=${this.onStripKeydown}
|
|
253
288
|
@pointerover=${this.onPointerOver}
|
|
254
289
|
@pointerleave=${this.onPointerLeave}
|
|
255
290
|
@pointerup=${this.onPointerUp}
|
|
@@ -348,6 +383,9 @@ __decorate([
|
|
|
348
383
|
__decorate([
|
|
349
384
|
property({ attribute: 'selection-mode' })
|
|
350
385
|
], HelixHeadlessHeatmap.prototype, "selectionMode", void 0);
|
|
386
|
+
__decorate([
|
|
387
|
+
property({ attribute: 'selection-shape' })
|
|
388
|
+
], HelixHeadlessHeatmap.prototype, "selectionShape", void 0);
|
|
351
389
|
__decorate([
|
|
352
390
|
words,
|
|
353
391
|
property({ attribute: 'strip-label' })
|
|
@@ -106,6 +106,12 @@ export declare class HelixHeadlessRadio extends HelixHeadlessRadio_base {
|
|
|
106
106
|
* re-renders nothing.
|
|
107
107
|
*/
|
|
108
108
|
protected firstUpdated(changed: PropertyValues): void;
|
|
109
|
+
/**
|
|
110
|
+
* Chooses the radio, as `click()` does a native radio: passed to the control
|
|
111
|
+
* inside, so the one click a listener hears is the control's, after it has
|
|
112
|
+
* moved. See `HostClickController`.
|
|
113
|
+
*/
|
|
114
|
+
click(): void;
|
|
109
115
|
protected render(): TemplateResult;
|
|
110
116
|
}
|
|
111
117
|
declare global {
|
|
@@ -22,6 +22,11 @@ let HelixHeadlessRadio = class HelixHeadlessRadio extends MixinSelectableItem(He
|
|
|
22
22
|
super.firstUpdated(changed);
|
|
23
23
|
this.finishHydration();
|
|
24
24
|
}
|
|
25
|
+
click() {
|
|
26
|
+
if (!this.clicks.click()) {
|
|
27
|
+
super.click();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
25
30
|
render() {
|
|
26
31
|
return html `<button
|
|
27
32
|
part="item"
|
|
@@ -101,6 +101,12 @@ export declare class HelixHeadlessSwitch extends HelixHeadlessSwitch_base {
|
|
|
101
101
|
* loads only this tier, which is the cost the `track` part notes.
|
|
102
102
|
*/
|
|
103
103
|
protected renderThumb(): TemplateResult | typeof nothing;
|
|
104
|
+
/**
|
|
105
|
+
* Turns the switch on or off, as `click()` does a native checkbox: passed to the control
|
|
106
|
+
* inside, so the one click a listener hears is the control's, after it has
|
|
107
|
+
* moved. See `HostClickController`.
|
|
108
|
+
*/
|
|
109
|
+
click(): void;
|
|
104
110
|
protected render(): TemplateResult;
|
|
105
111
|
}
|
|
106
112
|
declare global {
|
|
@@ -48,6 +48,11 @@ let HelixHeadlessSwitch = class HelixHeadlessSwitch extends MixinControllerCheck
|
|
|
48
48
|
renderThumb() {
|
|
49
49
|
return nothing;
|
|
50
50
|
}
|
|
51
|
+
click() {
|
|
52
|
+
if (!this.clicks.click()) {
|
|
53
|
+
super.click();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
51
56
|
render() {
|
|
52
57
|
return html `<label part="field">
|
|
53
58
|
<span part="track">
|
|
@@ -110,6 +110,12 @@ export declare class HelixHeadlessToggle extends HelixHeadlessToggle_base {
|
|
|
110
110
|
* re-renders nothing.
|
|
111
111
|
*/
|
|
112
112
|
protected firstUpdated(changed: PropertyValues): void;
|
|
113
|
+
/**
|
|
114
|
+
* Presses the toggle, as `click()` does a native button: passed to the control
|
|
115
|
+
* inside, so the one click a listener hears is the control's, after it has
|
|
116
|
+
* moved. See `HostClickController`.
|
|
117
|
+
*/
|
|
118
|
+
click(): void;
|
|
113
119
|
protected render(): TemplateResult;
|
|
114
120
|
}
|
|
115
121
|
declare global {
|
|
@@ -41,6 +41,11 @@ let HelixHeadlessToggle = class HelixHeadlessToggle extends MixinSelectableItem(
|
|
|
41
41
|
this.finishHydration();
|
|
42
42
|
auditName(this, () => this.partNamed('item'), 'Give it words in its default slot, an `aria-label`, or a label on the icon it holds.');
|
|
43
43
|
}
|
|
44
|
+
click() {
|
|
45
|
+
if (!this.clicks.click()) {
|
|
46
|
+
super.click();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
44
49
|
render() {
|
|
45
50
|
const alone = this.alone;
|
|
46
51
|
const radio = !alone && this.pressed === undefined;
|