@fusion.dev/helix-headless 0.182.2 → 0.183.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/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.182.2",
4
+ "version": "0.183.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.182.2",
53
- "@fusion.dev/helix-icons": "0.182.2",
52
+ "@fusion.dev/helix-core": "0.183.0",
53
+ "@fusion.dev/helix-icons": "0.183.0",
54
54
  "tslib": "^2.8.1",
55
55
  "uqr": "^0.1.3"
56
56
  },
57
57
  "devDependencies": {
58
- "@fusion.dev/helix-cem": "0.182.2",
59
- "@fusion.dev/helix-testing": "0.182.2",
58
+ "@fusion.dev/helix-cem": "0.183.0",
59
+ "@fusion.dev/helix-testing": "0.183.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
@@ -36982,6 +36982,13 @@ are rendered at a time.
36982
36982
  An `aria-label` or `aria-labelledby` on the host names the list too, and
36983
36983
  wins over this. */
36984
36984
  label?: (HelixHeadlessVirtualList["label"]) | undefined;
36985
+ /** How items of more than one column are laid out. `grid`, the default, puts
36986
+ them in lines of equal columns. `waterfall` puts each item, in the order
36987
+ of the set, under the column that ends highest, as a wall of photos of
36988
+ different heights is: `columns`, or `min-column-width`, says how many
36989
+ columns. Rows of a waterfall are measured, and Up and Down move along a
36990
+ column. */
36991
+ layout?: (HelixHeadlessVirtualList["layout"]) | undefined;
36985
36992
  /** Marks the list as busy fetching more items, and draws a row after the last
36986
36993
  item that says so.
36987
36994
 
@@ -37014,14 +37021,15 @@ follows the box as it resizes, which `columns` then does not decide. */
37014
37021
  /** Which way the list runs. `horizontal` lays the items out along a line
37015
37022
  and scrolls it sideways: Left and Right move between items, the other
37016
37023
  way round on a right-to-left page, and `estimate` is an item's width. A
37017
- grid always runs down. */
37024
+ grid and a waterfall always run down. */
37018
37025
  orientation?: (HelixHeadlessVirtualList["orientation"]) | undefined;
37019
37026
  /** Lets a reader move items, once `@fusion.dev/helix/virtual-list/reorder`
37020
37027
  (or `@fusion.dev/helix-headless/virtual-list/reorder`) is imported: Alt
37021
37028
  with an arrow moves the row the keys are on, and a pointer drags a row.
37022
37029
  The list moves no item itself: you move your `items` on `helix-reorder`.
37023
37030
  Without that import it does nothing, so a list that never moves items
37024
- carries none of the code. A list of one column, without sections. */
37031
+ carries none of the code. A list of one column, without sections or a
37032
+ waterfall. */
37025
37033
  reorderable?: (HelixHeadlessVirtualList["reorderable"]) | undefined;
37026
37034
  /** The field of each item that names its section, as a key or a path of
37027
37035
  keys. Set, the items are drawn in sections: a header, then the items, in
@@ -37150,6 +37158,13 @@ are rendered at a time.
37150
37158
  An `aria-label` or `aria-labelledby` on the host names the list too, and
37151
37159
  wins over this. */
37152
37160
  "prop:label"?: (HelixHeadlessVirtualList["label"]) | undefined;
37161
+ /** How items of more than one column are laid out. `grid`, the default, puts
37162
+ them in lines of equal columns. `waterfall` puts each item, in the order
37163
+ of the set, under the column that ends highest, as a wall of photos of
37164
+ different heights is: `columns`, or `min-column-width`, says how many
37165
+ columns. Rows of a waterfall are measured, and Up and Down move along a
37166
+ column. */
37167
+ "prop:layout"?: (HelixHeadlessVirtualList["layout"]) | undefined;
37153
37168
  /** Marks the list as busy fetching more items, and draws a row after the last
37154
37169
  item that says so.
37155
37170
 
@@ -37182,14 +37197,15 @@ follows the box as it resizes, which `columns` then does not decide. */
37182
37197
  /** Which way the list runs. `horizontal` lays the items out along a line
37183
37198
  and scrolls it sideways: Left and Right move between items, the other
37184
37199
  way round on a right-to-left page, and `estimate` is an item's width. A
37185
- grid always runs down. */
37200
+ grid and a waterfall always run down. */
37186
37201
  "prop:orientation"?: (HelixHeadlessVirtualList["orientation"]) | undefined;
37187
37202
  /** Lets a reader move items, once `@fusion.dev/helix/virtual-list/reorder`
37188
37203
  (or `@fusion.dev/helix-headless/virtual-list/reorder`) is imported: Alt
37189
37204
  with an arrow moves the row the keys are on, and a pointer drags a row.
37190
37205
  The list moves no item itself: you move your `items` on `helix-reorder`.
37191
37206
  Without that import it does nothing, so a list that never moves items
37192
- carries none of the code. A list of one column, without sections. */
37207
+ carries none of the code. A list of one column, without sections or a
37208
+ waterfall. */
37193
37209
  "prop:reorderable"?: (HelixHeadlessVirtualList["reorderable"]) | undefined;
37194
37210
  /** The field of each item that names its section, as a key or a path of
37195
37211
  keys. Set, the items are drawn in sections: a header, then the items, in
@@ -38870,6 +38886,7 @@ export type CustomElements = {
38870
38886
  * - `bar`: One column. Under `stacked`, one segment of a category's column.
38871
38887
  * - `bar-end`: The bar at a column's far end, the end away from zero, which is the end to round. A column standing alone is its own far end. Under `stacked`, the last positive segment above zero and the last negative one below it. Its `data-end` is `positive` or `negative`. A blank or a zero is never the end. Set together with `bar`.
38872
38888
  * - `bar-end-negative`: A far end below zero, whose far end is its bottom, or its inline start when the bars run across. Set together with `bar-end`.
38889
+ * - `bar-negative`: A bar below zero, standing alone or any segment of a stack below it, whose base is its top, or its inline end when the bars run across. Set together with `bar`.
38873
38890
  * - `bar-wash-end`: The far stop of a bar's gradient, where one is used.
38874
38891
  * - `bar-wash-start`: The stop of a bar's gradient at its base.
38875
38892
  * - `baseline`: The line the columns stand on.
@@ -66680,6 +66697,32 @@ export type CustomElements = {
66680
66697
  * smallest item size, and follows the box as it resizes. `gap` spaces the rows, and the columns
66681
66698
  * of a grid, by a number of pixels the list counts in each row's place.
66682
66699
  *
66700
+ * A grid without `selection-mode` is a grid to a reader, as the APG's grid
66701
+ * and React Aria's grid list are: the box is a `grid` with `aria-rowcount`
66702
+ * and `aria-colcount`, each line drawn is a `row` with `aria-rowindex`, and
66703
+ * each item a `gridcell` with `aria-colindex`. Each line is a slot of the
66704
+ * list's own, so your rows stay its children: give an item one element. With
66705
+ * `selection-mode` it stays a list box of options, as React Aria's list box
66706
+ * in a grid layout does.
66707
+ *
66708
+ * **A waterfall.** `layout="waterfall"` puts each item, in the order of the
66709
+ * set, under the column that ends highest so far, the leftmost of a tie, as a
66710
+ * wall of photos of different heights is, and as React Aria's waterfall
66711
+ * layout and TanStack Virtual's lanes do. `columns`, or `min-column-width`,
66712
+ * says how many columns. Every item is measured, at the width of its column,
66713
+ * and placed at its column and its height, so items of any height leave no
66714
+ * holes. The list draws the items that reach into the box, and the item
66715
+ * holding focus. A reader hears a list, or a list box, in the order of the
66716
+ * set, which is also the order Tab and a screen reader's own keys take.
66717
+ *
66718
+ * In a waterfall, Down and Up move along the column to the next or the
66719
+ * previous item in it, Right and Left move to the next or the previous
66720
+ * column, to the item there that sits beside this one the most, or the
66721
+ * nearest above where none does, and Page Down and Page Up move a box down
66722
+ * or up the column. Home and End go to the first and the last item of the
66723
+ * set, and Shift with a key takes in the items between in the order of the
66724
+ * set.
66725
+ *
66683
66726
  * **Across.** `orientation="horizontal"` lays the items out along a line and
66684
66727
  * scrolls it sideways, as a strip of cards does, windowed the same way:
66685
66728
  * `estimate` is then an item's width, and the box needs an inline size.
@@ -66698,10 +66741,11 @@ export type CustomElements = {
66698
66741
  *
66699
66742
  * | Key | What it does |
66700
66743
  * |---|---|
66701
- * | Down, Up | Moves to the next or the previous item, or in a grid to the item in the same column on the next or the previous line. |
66702
- * | Right, Left | In a grid, moves to the next or the previous item along the line, the other way round on a right-to-left page. In a list that runs across, moves to the next or the previous item the same way, and Down and Up are left to the row. |
66703
- * | Home, End | Moves to the first or the last item. |
66704
- * | Page Down, Page Up | Moves by the number of items, or of lines in a grid, on screen. |
66744
+ * | Down, Up | Moves to the next or the previous item, or in a grid to the item in the same column on the next or the previous line, or in a waterfall to the next or the previous item down the same column. |
66745
+ * | Right, Left | In a grid, moves to the next or the previous item along the line, the other way round on a right-to-left page. In a waterfall, moves to the item beside in the next or the previous column. In a list that runs across, moves to the next or the previous item the same way, and Down and Up are left to the row. |
66746
+ * | Home, End | Moves to the first or the last item. In a grid without `selection-mode`, to the first or the last item of the line. |
66747
+ * | Control or Command with Home or End | In a grid without `selection-mode`, moves to the first or the last item. |
66748
+ * | Page Down, Page Up | Moves by the number of items, or of lines in a grid, on screen, or in a waterfall a box down or up the column. |
66705
66749
  * | A letter or a word | Moves to the next item whose text starts with what you typed. |
66706
66750
  * | Escape | Lets go of every chosen item, in a list with `selection-mode`. |
66707
66751
  * | Alt with Up or Down | In a `reorderable` list, moves the item a place. Alt with Home or End moves it to either end. |
@@ -66716,8 +66760,9 @@ export type CustomElements = {
66716
66760
  * or the item itself when it is a string or a number.
66717
66761
  *
66718
66762
  * Each row says its place in the whole set with `aria-posinset` and
66719
- * `aria-setsize`, so a screen reader says "4,000 of 10,000". The row holding
66720
- * focus stays drawn when it scrolls out.
66763
+ * `aria-setsize`, so a screen reader says "4,000 of 10,000", and each cell of
66764
+ * a grid its line and its column. The row holding focus stays drawn when it
66765
+ * scrolls out.
66721
66766
  *
66722
66767
  * **Selecting.** `selection-mode` makes the list a list box a reader chooses
66723
66768
  * from: `single` selects one item and `multiple` any number. Space or a press
@@ -66825,6 +66870,12 @@ export type CustomElements = {
66825
66870
  *
66826
66871
  * An `aria-label` or `aria-labelledby` on the host names the list too, and
66827
66872
  * wins over this.
66873
+ * - `layout`: How items of more than one column are laid out. `grid`, the default, puts
66874
+ * them in lines of equal columns. `waterfall` puts each item, in the order
66875
+ * of the set, under the column that ends highest, as a wall of photos of
66876
+ * different heights is: `columns`, or `min-column-width`, says how many
66877
+ * columns. Rows of a waterfall are measured, and Up and Down move along a
66878
+ * column.
66828
66879
  * - `loading`: Marks the list as busy fetching more items, and draws a row after the last
66829
66880
  * item that says so.
66830
66881
  *
@@ -66847,13 +66898,14 @@ export type CustomElements = {
66847
66898
  * - `orientation`: Which way the list runs. `horizontal` lays the items out along a line
66848
66899
  * and scrolls it sideways: Left and Right move between items, the other
66849
66900
  * way round on a right-to-left page, and `estimate` is an item's width. A
66850
- * grid always runs down.
66901
+ * grid and a waterfall always run down.
66851
66902
  * - `reorderable`: Lets a reader move items, once `@fusion.dev/helix/virtual-list/reorder`
66852
66903
  * (or `@fusion.dev/helix-headless/virtual-list/reorder`) is imported: Alt
66853
66904
  * with an arrow moves the row the keys are on, and a pointer drags a row.
66854
66905
  * The list moves no item itself: you move your `items` on `helix-reorder`.
66855
66906
  * Without that import it does nothing, so a list that never moves items
66856
- * carries none of the code. A list of one column, without sections.
66907
+ * carries none of the code. A list of one column, without sections or a
66908
+ * waterfall.
66857
66909
  * - `section-field`/`sectionField`: The field of each item that names its section, as a key or a path of
66858
66910
  * keys. Set, the items are drawn in sections: a header, then the items, in
66859
66911
  * an element with the `group` role that the header names. A section starts
@@ -68575,6 +68627,7 @@ export type CustomElementsSolidJs = {
68575
68627
  * - `bar`: One column. Under `stacked`, one segment of a category's column.
68576
68628
  * - `bar-end`: The bar at a column's far end, the end away from zero, which is the end to round. A column standing alone is its own far end. Under `stacked`, the last positive segment above zero and the last negative one below it. Its `data-end` is `positive` or `negative`. A blank or a zero is never the end. Set together with `bar`.
68577
68629
  * - `bar-end-negative`: A far end below zero, whose far end is its bottom, or its inline start when the bars run across. Set together with `bar-end`.
68630
+ * - `bar-negative`: A bar below zero, standing alone or any segment of a stack below it, whose base is its top, or its inline end when the bars run across. Set together with `bar`.
68578
68631
  * - `bar-wash-end`: The far stop of a bar's gradient, where one is used.
68579
68632
  * - `bar-wash-start`: The stop of a bar's gradient at its base.
68580
68633
  * - `baseline`: The line the columns stand on.
@@ -96698,6 +96751,32 @@ export type CustomElementsSolidJs = {
96698
96751
  * smallest item size, and follows the box as it resizes. `gap` spaces the rows, and the columns
96699
96752
  * of a grid, by a number of pixels the list counts in each row's place.
96700
96753
  *
96754
+ * A grid without `selection-mode` is a grid to a reader, as the APG's grid
96755
+ * and React Aria's grid list are: the box is a `grid` with `aria-rowcount`
96756
+ * and `aria-colcount`, each line drawn is a `row` with `aria-rowindex`, and
96757
+ * each item a `gridcell` with `aria-colindex`. Each line is a slot of the
96758
+ * list's own, so your rows stay its children: give an item one element. With
96759
+ * `selection-mode` it stays a list box of options, as React Aria's list box
96760
+ * in a grid layout does.
96761
+ *
96762
+ * **A waterfall.** `layout="waterfall"` puts each item, in the order of the
96763
+ * set, under the column that ends highest so far, the leftmost of a tie, as a
96764
+ * wall of photos of different heights is, and as React Aria's waterfall
96765
+ * layout and TanStack Virtual's lanes do. `columns`, or `min-column-width`,
96766
+ * says how many columns. Every item is measured, at the width of its column,
96767
+ * and placed at its column and its height, so items of any height leave no
96768
+ * holes. The list draws the items that reach into the box, and the item
96769
+ * holding focus. A reader hears a list, or a list box, in the order of the
96770
+ * set, which is also the order Tab and a screen reader's own keys take.
96771
+ *
96772
+ * In a waterfall, Down and Up move along the column to the next or the
96773
+ * previous item in it, Right and Left move to the next or the previous
96774
+ * column, to the item there that sits beside this one the most, or the
96775
+ * nearest above where none does, and Page Down and Page Up move a box down
96776
+ * or up the column. Home and End go to the first and the last item of the
96777
+ * set, and Shift with a key takes in the items between in the order of the
96778
+ * set.
96779
+ *
96701
96780
  * **Across.** `orientation="horizontal"` lays the items out along a line and
96702
96781
  * scrolls it sideways, as a strip of cards does, windowed the same way:
96703
96782
  * `estimate` is then an item's width, and the box needs an inline size.
@@ -96716,10 +96795,11 @@ export type CustomElementsSolidJs = {
96716
96795
  *
96717
96796
  * | Key | What it does |
96718
96797
  * |---|---|
96719
- * | Down, Up | Moves to the next or the previous item, or in a grid to the item in the same column on the next or the previous line. |
96720
- * | Right, Left | In a grid, moves to the next or the previous item along the line, the other way round on a right-to-left page. In a list that runs across, moves to the next or the previous item the same way, and Down and Up are left to the row. |
96721
- * | Home, End | Moves to the first or the last item. |
96722
- * | Page Down, Page Up | Moves by the number of items, or of lines in a grid, on screen. |
96798
+ * | Down, Up | Moves to the next or the previous item, or in a grid to the item in the same column on the next or the previous line, or in a waterfall to the next or the previous item down the same column. |
96799
+ * | Right, Left | In a grid, moves to the next or the previous item along the line, the other way round on a right-to-left page. In a waterfall, moves to the item beside in the next or the previous column. In a list that runs across, moves to the next or the previous item the same way, and Down and Up are left to the row. |
96800
+ * | Home, End | Moves to the first or the last item. In a grid without `selection-mode`, to the first or the last item of the line. |
96801
+ * | Control or Command with Home or End | In a grid without `selection-mode`, moves to the first or the last item. |
96802
+ * | Page Down, Page Up | Moves by the number of items, or of lines in a grid, on screen, or in a waterfall a box down or up the column. |
96723
96803
  * | A letter or a word | Moves to the next item whose text starts with what you typed. |
96724
96804
  * | Escape | Lets go of every chosen item, in a list with `selection-mode`. |
96725
96805
  * | Alt with Up or Down | In a `reorderable` list, moves the item a place. Alt with Home or End moves it to either end. |
@@ -96734,8 +96814,9 @@ export type CustomElementsSolidJs = {
96734
96814
  * or the item itself when it is a string or a number.
96735
96815
  *
96736
96816
  * Each row says its place in the whole set with `aria-posinset` and
96737
- * `aria-setsize`, so a screen reader says "4,000 of 10,000". The row holding
96738
- * focus stays drawn when it scrolls out.
96817
+ * `aria-setsize`, so a screen reader says "4,000 of 10,000", and each cell of
96818
+ * a grid its line and its column. The row holding focus stays drawn when it
96819
+ * scrolls out.
96739
96820
  *
96740
96821
  * **Selecting.** `selection-mode` makes the list a list box a reader chooses
96741
96822
  * from: `single` selects one item and `multiple` any number. Space or a press
@@ -96843,6 +96924,12 @@ export type CustomElementsSolidJs = {
96843
96924
  *
96844
96925
  * An `aria-label` or `aria-labelledby` on the host names the list too, and
96845
96926
  * wins over this.
96927
+ * - `layout`: How items of more than one column are laid out. `grid`, the default, puts
96928
+ * them in lines of equal columns. `waterfall` puts each item, in the order
96929
+ * of the set, under the column that ends highest, as a wall of photos of
96930
+ * different heights is: `columns`, or `min-column-width`, says how many
96931
+ * columns. Rows of a waterfall are measured, and Up and Down move along a
96932
+ * column.
96846
96933
  * - `loading`: Marks the list as busy fetching more items, and draws a row after the last
96847
96934
  * item that says so.
96848
96935
  *
@@ -96865,13 +96952,14 @@ export type CustomElementsSolidJs = {
96865
96952
  * - `orientation`: Which way the list runs. `horizontal` lays the items out along a line
96866
96953
  * and scrolls it sideways: Left and Right move between items, the other
96867
96954
  * way round on a right-to-left page, and `estimate` is an item's width. A
96868
- * grid always runs down.
96955
+ * grid and a waterfall always run down.
96869
96956
  * - `reorderable`: Lets a reader move items, once `@fusion.dev/helix/virtual-list/reorder`
96870
96957
  * (or `@fusion.dev/helix-headless/virtual-list/reorder`) is imported: Alt
96871
96958
  * with an arrow moves the row the keys are on, and a pointer drags a row.
96872
96959
  * The list moves no item itself: you move your `items` on `helix-reorder`.
96873
96960
  * Without that import it does nothing, so a list that never moves items
96874
- * carries none of the code. A list of one column, without sections.
96961
+ * carries none of the code. A list of one column, without sections or a
96962
+ * waterfall.
96875
96963
  * - `section-field`/`sectionField`: The field of each item that names its section, as a key or a path of
96876
96964
  * keys. Set, the items are drawn in sections: a header, then the items, in
96877
96965
  * an element with the `group` role that the header names. A section starts
package/types/vue.d.ts CHANGED
@@ -18957,6 +18957,13 @@ are rendered at a time.
18957
18957
  An `aria-label` or `aria-labelledby` on the host names the list too, and
18958
18958
  wins over this. */
18959
18959
  label?: (HelixHeadlessVirtualList["label"]) | undefined;
18960
+ /** How items of more than one column are laid out. `grid`, the default, puts
18961
+ them in lines of equal columns. `waterfall` puts each item, in the order
18962
+ of the set, under the column that ends highest, as a wall of photos of
18963
+ different heights is: `columns`, or `min-column-width`, says how many
18964
+ columns. Rows of a waterfall are measured, and Up and Down move along a
18965
+ column. */
18966
+ layout?: (HelixHeadlessVirtualList["layout"]) | undefined;
18960
18967
  /** Marks the list as busy fetching more items, and draws a row after the last
18961
18968
  item that says so.
18962
18969
 
@@ -18989,14 +18996,15 @@ follows the box as it resizes, which `columns` then does not decide. */
18989
18996
  /** Which way the list runs. `horizontal` lays the items out along a line
18990
18997
  and scrolls it sideways: Left and Right move between items, the other
18991
18998
  way round on a right-to-left page, and `estimate` is an item's width. A
18992
- grid always runs down. */
18999
+ grid and a waterfall always run down. */
18993
19000
  orientation?: (HelixHeadlessVirtualList["orientation"]) | undefined;
18994
19001
  /** Lets a reader move items, once `@fusion.dev/helix/virtual-list/reorder`
18995
19002
  (or `@fusion.dev/helix-headless/virtual-list/reorder`) is imported: Alt
18996
19003
  with an arrow moves the row the keys are on, and a pointer drags a row.
18997
19004
  The list moves no item itself: you move your `items` on `helix-reorder`.
18998
19005
  Without that import it does nothing, so a list that never moves items
18999
- carries none of the code. A list of one column, without sections. */
19006
+ carries none of the code. A list of one column, without sections or a
19007
+ waterfall. */
19000
19008
  reorderable?: (HelixHeadlessVirtualList["reorderable"]) | undefined;
19001
19009
  /** The field of each item that names its section, as a key or a path of
19002
19010
  keys. Set, the items are drawn in sections: a header, then the items, in
@@ -20180,7 +20188,7 @@ export interface WcToolkitVueGlobalComponents {
20180
20188
  HelixHeadlessVideoVueProps,
20181
20189
  HelixHeadlessVideoVueEvents
20182
20190
  >;
20183
- /** The items arrive as data, in one of two ways: - 'items' takes an array. A framework sets it as a property, and React hydration keeps it. - 'for' names a '<script type="application/json">' that holds an array, which a server sends as markup. Each item is drawn into a row in one of two ways: - 'renderItem' is a function from an item and its index to the row's content: a Lit template, a string, or a DOM node. - A '<template>' child defines one row. 'data-field="name"' fills an element with the item's 'name' as text, and 'data-field-href="url"' writes the item's 'url' into 'href', the same for any attribute. A field may be a path of keys, such as 'author.name'. Rows are your markup in the light DOM, so your stylesheet styles them. **A grid.** 'columns' lays the items out that many to a line, as a grid of equal columns, and windows the set a line at a time, as React Aria's grid layout does. Each item draws one element, a cell of the grid, and 'estimate' is the height of a line. 'min-column-width' lays out as many columns as fit the box instead, as React Aria's grid layout does with its smallest item size, and follows the box as it resizes. 'gap' spaces the rows, and the columns of a grid, by a number of pixels the list counts in each row's place. **Across.** 'orientation="horizontal"' lays the items out along a line and scrolls it sideways, as a strip of cards does, windowed the same way: 'estimate' is then an item's width, and the box needs an inline size. **Sections.** 'section-field' names the field of each item that says which section it is in, and the list draws a header before each section's items, as React Aria's list box sections do. Each section is an element with the 'group' role, named by its header, which is its first child and carries 'data-header', so your stylesheet styles it, such as with 'position: sticky'. A section starts wherever the field changes, so give the items in order. The window counts the headers with the items, and a section the window starts inside is drawn with its header. 'renderSection' draws a header of your own. **Keyboard.** The list is one tab stop. | Key | What it does | |---|---| | Down, Up | Moves to the next or the previous item, or in a grid to the item in the same column on the next or the previous line. | | Right, Left | In a grid, moves to the next or the previous item along the line, the other way round on a right-to-left page. In a list that runs across, moves to the next or the previous item the same way, and Down and Up are left to the row. | | Home, End | Moves to the first or the last item. | | Page Down, Page Up | Moves by the number of items, or of lines in a grid, on screen. | | A letter or a word | Moves to the next item whose text starts with what you typed. | | Escape | Lets go of every chosen item, in a list with 'selection-mode'. | | Alt with Up or Down | In a 'reorderable' list, moves the item a place. Alt with Home or End moves it to either end. | | Tab | Moves into the focused row's own links and buttons, then out of the list. | An item that is not drawn is scrolled into view and focused, so a keyboard reaches the whole set. The row a reader last focused keeps the tab stop and stays drawn when it scrolls away, so Tab and Shift+Tab come back to it, as React Aria's collections do. In a list nobody has focused yet, the stop moves to the first row on screen. Typing matches each item's 'text-field', which is the first 'data-field' of the row template by default, or the item itself when it is a string or a number. Each row says its place in the whole set with 'aria-posinset' and 'aria-setsize', so a screen reader says "4,000 of 10,000". The row holding focus stays drawn when it scrolls out. **Selecting.** 'selection-mode' makes the list a list box a reader chooses from: 'single' selects one item and 'multiple' any number. Space or a press selects an item, Shift with Space, an arrow, Home, End or a press takes in the items from the last one chosen, and Control or Command with A selects them all, in 'multiple'. Escape lets go of every chosen item, and keeps the key from the dialog or menu around the list while there was something to let go of. 'value' holds the chosen items' keys, separated by commas, in the order of the set: 'key-field' names each item's key, and a string or a number item is its own key. A change asks with 'helix-before-change' and tells with 'change'. Each row is an 'option' marked 'aria-selected', so a row's own links and buttons are not reached there: keep those to a list without 'selection-mode'. 'selection-behavior="replace"' selects the item pressed alone, as a file list does, and the arrow keys carry the selection with them. Control or Command with a press or with Space adds or takes out one item, and with an arrow moves without selecting. **Disabled items.** 'disabled-keys' names items by their keys, separated by commas. Their rows carry 'aria-disabled', the keys and typing pass over them, and a press, Space, or Control with A does not select them. **Rows a stylesheet can tell apart.** A chosen row carries 'data-selected', a disabled one 'data-disabled', as React Aria's rows do, and the row the keys are on, which holds the tab stop, 'data-active', whether or not the list has focus. **Loading more.** 'helix-range-change' fires as the items on screen change, and 'range' holds them. 'helix-load-more' fires once a reader is within one screen of the end, once for each length of the set: add to 'items' and it can fire again. While you fetch, set 'loading': the list is busy, and a row after the last item says "Loading more" ('loading-label', or your own content in the 'loading' slot). 'scrollToIndex' takes a reader to an item. **Moving items** is a separate import, '@fusion.dev/helix/virtual-list/reorder', as React Aria's drag and drop is. With it imported, 'reorderable' lets a reader move items in a list of one column without sections: - Alt with Up or Down moves the item the keys are on a place, and Alt with Home or End to either end, as the APG's rearrangeable listbox does. - A pointer drags a whole row. A press that does not travel is still a press. The list scrolls near an edge, and an item far down a long set is reached by dragging to the edge. - A drop sends 'helix-before-reorder', which you can refuse, and then 'helix-reorder', whose 'keys' hold every item's key in the new order. **You move the items**: set 'items' to them in that order. The keys stay on the item that moved. - Each move is said in a region screen readers announce. The row being dragged carries 'data-dragging', and the row a drop would land beside 'data-drop-before' or 'data-drop-after'. **An empty list.** Set 'empty-label', or put your own content in the 'empty' slot, for a row shown when there are no items and none are loading, such as "No messages yet" and a link to write one. Without either, an empty list shows nothing, since a list whose items have not arrived yet has not said it has none. The list takes the 'empty' state while it has read its items and holds none, and the 'loading' state while 'loading' is set, so your stylesheet can change the box around it for either. A list with no name is reported once in a development build. Name it with 'label' or 'aria-label'. **Row height.** Rows are placed by 'estimate' until they are drawn. Then the list reads the drawn rows' height once and places every row by it, so a wrong estimate still reaches the last item. Set 'measured' for rows of different heights. Once the list draws rows of different heights, such as rows that wrap on a narrow screen, it places each row by its own height whether 'measured' is set or not. The list follows its source. A new 'items' array, an edit to the script's text, or a script replaced under the same id draws the new rows. A row that stays in view keeps its element as the list scrolls. The viewport scrolls on this tier. It carries 'data-scroller', and 'core' ships '[data-scroller] { overflow: auto }' into every shadow root, so 'scrollTop' works with no stylesheet. You still need to set a block size. */
20191
+ /** The items arrive as data, in one of two ways: - 'items' takes an array. A framework sets it as a property, and React hydration keeps it. - 'for' names a '<script type="application/json">' that holds an array, which a server sends as markup. Each item is drawn into a row in one of two ways: - 'renderItem' is a function from an item and its index to the row's content: a Lit template, a string, or a DOM node. - A '<template>' child defines one row. 'data-field="name"' fills an element with the item's 'name' as text, and 'data-field-href="url"' writes the item's 'url' into 'href', the same for any attribute. A field may be a path of keys, such as 'author.name'. Rows are your markup in the light DOM, so your stylesheet styles them. **A grid.** 'columns' lays the items out that many to a line, as a grid of equal columns, and windows the set a line at a time, as React Aria's grid layout does. Each item draws one element, a cell of the grid, and 'estimate' is the height of a line. 'min-column-width' lays out as many columns as fit the box instead, as React Aria's grid layout does with its smallest item size, and follows the box as it resizes. 'gap' spaces the rows, and the columns of a grid, by a number of pixels the list counts in each row's place. A grid without 'selection-mode' is a grid to a reader, as the APG's grid and React Aria's grid list are: the box is a 'grid' with 'aria-rowcount' and 'aria-colcount', each line drawn is a 'row' with 'aria-rowindex', and each item a 'gridcell' with 'aria-colindex'. Each line is a slot of the list's own, so your rows stay its children: give an item one element. With 'selection-mode' it stays a list box of options, as React Aria's list box in a grid layout does. **A waterfall.** 'layout="waterfall"' puts each item, in the order of the set, under the column that ends highest so far, the leftmost of a tie, as a wall of photos of different heights is, and as React Aria's waterfall layout and TanStack Virtual's lanes do. 'columns', or 'min-column-width', says how many columns. Every item is measured, at the width of its column, and placed at its column and its height, so items of any height leave no holes. The list draws the items that reach into the box, and the item holding focus. A reader hears a list, or a list box, in the order of the set, which is also the order Tab and a screen reader's own keys take. In a waterfall, Down and Up move along the column to the next or the previous item in it, Right and Left move to the next or the previous column, to the item there that sits beside this one the most, or the nearest above where none does, and Page Down and Page Up move a box down or up the column. Home and End go to the first and the last item of the set, and Shift with a key takes in the items between in the order of the set. **Across.** 'orientation="horizontal"' lays the items out along a line and scrolls it sideways, as a strip of cards does, windowed the same way: 'estimate' is then an item's width, and the box needs an inline size. **Sections.** 'section-field' names the field of each item that says which section it is in, and the list draws a header before each section's items, as React Aria's list box sections do. Each section is an element with the 'group' role, named by its header, which is its first child and carries 'data-header', so your stylesheet styles it, such as with 'position: sticky'. A section starts wherever the field changes, so give the items in order. The window counts the headers with the items, and a section the window starts inside is drawn with its header. 'renderSection' draws a header of your own. **Keyboard.** The list is one tab stop. | Key | What it does | |---|---| | Down, Up | Moves to the next or the previous item, or in a grid to the item in the same column on the next or the previous line, or in a waterfall to the next or the previous item down the same column. | | Right, Left | In a grid, moves to the next or the previous item along the line, the other way round on a right-to-left page. In a waterfall, moves to the item beside in the next or the previous column. In a list that runs across, moves to the next or the previous item the same way, and Down and Up are left to the row. | | Home, End | Moves to the first or the last item. In a grid without 'selection-mode', to the first or the last item of the line. | | Control or Command with Home or End | In a grid without 'selection-mode', moves to the first or the last item. | | Page Down, Page Up | Moves by the number of items, or of lines in a grid, on screen, or in a waterfall a box down or up the column. | | A letter or a word | Moves to the next item whose text starts with what you typed. | | Escape | Lets go of every chosen item, in a list with 'selection-mode'. | | Alt with Up or Down | In a 'reorderable' list, moves the item a place. Alt with Home or End moves it to either end. | | Tab | Moves into the focused row's own links and buttons, then out of the list. | An item that is not drawn is scrolled into view and focused, so a keyboard reaches the whole set. The row a reader last focused keeps the tab stop and stays drawn when it scrolls away, so Tab and Shift+Tab come back to it, as React Aria's collections do. In a list nobody has focused yet, the stop moves to the first row on screen. Typing matches each item's 'text-field', which is the first 'data-field' of the row template by default, or the item itself when it is a string or a number. Each row says its place in the whole set with 'aria-posinset' and 'aria-setsize', so a screen reader says "4,000 of 10,000", and each cell of a grid its line and its column. The row holding focus stays drawn when it scrolls out. **Selecting.** 'selection-mode' makes the list a list box a reader chooses from: 'single' selects one item and 'multiple' any number. Space or a press selects an item, Shift with Space, an arrow, Home, End or a press takes in the items from the last one chosen, and Control or Command with A selects them all, in 'multiple'. Escape lets go of every chosen item, and keeps the key from the dialog or menu around the list while there was something to let go of. 'value' holds the chosen items' keys, separated by commas, in the order of the set: 'key-field' names each item's key, and a string or a number item is its own key. A change asks with 'helix-before-change' and tells with 'change'. Each row is an 'option' marked 'aria-selected', so a row's own links and buttons are not reached there: keep those to a list without 'selection-mode'. 'selection-behavior="replace"' selects the item pressed alone, as a file list does, and the arrow keys carry the selection with them. Control or Command with a press or with Space adds or takes out one item, and with an arrow moves without selecting. **Disabled items.** 'disabled-keys' names items by their keys, separated by commas. Their rows carry 'aria-disabled', the keys and typing pass over them, and a press, Space, or Control with A does not select them. **Rows a stylesheet can tell apart.** A chosen row carries 'data-selected', a disabled one 'data-disabled', as React Aria's rows do, and the row the keys are on, which holds the tab stop, 'data-active', whether or not the list has focus. **Loading more.** 'helix-range-change' fires as the items on screen change, and 'range' holds them. 'helix-load-more' fires once a reader is within one screen of the end, once for each length of the set: add to 'items' and it can fire again. While you fetch, set 'loading': the list is busy, and a row after the last item says "Loading more" ('loading-label', or your own content in the 'loading' slot). 'scrollToIndex' takes a reader to an item. **Moving items** is a separate import, '@fusion.dev/helix/virtual-list/reorder', as React Aria's drag and drop is. With it imported, 'reorderable' lets a reader move items in a list of one column without sections: - Alt with Up or Down moves the item the keys are on a place, and Alt with Home or End to either end, as the APG's rearrangeable listbox does. - A pointer drags a whole row. A press that does not travel is still a press. The list scrolls near an edge, and an item far down a long set is reached by dragging to the edge. - A drop sends 'helix-before-reorder', which you can refuse, and then 'helix-reorder', whose 'keys' hold every item's key in the new order. **You move the items**: set 'items' to them in that order. The keys stay on the item that moved. - Each move is said in a region screen readers announce. The row being dragged carries 'data-dragging', and the row a drop would land beside 'data-drop-before' or 'data-drop-after'. **An empty list.** Set 'empty-label', or put your own content in the 'empty' slot, for a row shown when there are no items and none are loading, such as "No messages yet" and a link to write one. Without either, an empty list shows nothing, since a list whose items have not arrived yet has not said it has none. The list takes the 'empty' state while it has read its items and holds none, and the 'loading' state while 'loading' is set, so your stylesheet can change the box around it for either. A list with no name is reported once in a development build. Name it with 'label' or 'aria-label'. **Row height.** Rows are placed by 'estimate' until they are drawn. Then the list reads the drawn rows' height once and places every row by it, so a wrong estimate still reaches the last item. Set 'measured' for rows of different heights. Once the list draws rows of different heights, such as rows that wrap on a narrow screen, it places each row by its own height whether 'measured' is set or not. The list follows its source. A new 'items' array, an edit to the script's text, or a script replaced under the same id draws the new rows. A row that stays in view keeps its element as the list scrolls. The viewport scrolls on this tier. It carries 'data-scroller', and 'core' ships '[data-scroller] { overflow: auto }' into every shadow root, so 'scrollTop' works with no stylesheet. You still need to set a block size. */
20184
20192
  "helix-headless-virtual-list": DefineCustomElement<
20185
20193
  HelixHeadlessVirtualList,
20186
20194
  HelixHeadlessVirtualListVueProps,