@fusion.dev/helix-headless 0.148.0 → 0.149.1

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.
Files changed (240) hide show
  1. package/custom-elements.json +6966 -1798
  2. package/dist/announcement/root/announcement-root.d.ts +5 -0
  3. package/dist/announcement/root/announcement-root.js +5 -2
  4. package/dist/area-chart/root/area-chart-root.d.ts +11 -0
  5. package/dist/area-chart/root/area-chart-root.js +20 -7
  6. package/dist/avatar/group/avatar-group.d.ts +10 -2
  7. package/dist/avatar/group/avatar-group.js +10 -5
  8. package/dist/badge/count.d.ts +6 -1
  9. package/dist/badge/count.js +3 -3
  10. package/dist/badge/root/badge-root.d.ts +6 -2
  11. package/dist/badge/root/badge-root.js +3 -3
  12. package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
  13. package/dist/bar-chart/root/bar-chart-root.js +17 -4
  14. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
  15. package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
  16. package/dist/button/root/button-root.d.ts +10 -1
  17. package/dist/button/root/button-root.js +3 -2
  18. package/dist/button-group/root/button-group-root.d.ts +3 -0
  19. package/dist/button-group/root/button-group-root.js +2 -2
  20. package/dist/callout/root/callout-root.d.ts +16 -2
  21. package/dist/callout/root/callout-root.js +16 -4
  22. package/dist/canvas/describe.d.ts +10 -0
  23. package/dist/canvas/describe.js +9 -0
  24. package/dist/canvas/neighbor.d.ts +17 -0
  25. package/dist/canvas/neighbor.js +1 -0
  26. package/dist/canvas/node/canvas-node.js +3 -2
  27. package/dist/canvas/root/canvas-root.d.ts +65 -8
  28. package/dist/canvas/root/canvas-root.js +115 -49
  29. package/dist/carousel/root/carousel-root.d.ts +5 -0
  30. package/dist/carousel/root/carousel-root.js +16 -5
  31. package/dist/chat/composer/chat-composer.d.ts +5 -0
  32. package/dist/chat/composer/chat-composer.js +4 -1
  33. package/dist/chat/message/chat-message.d.ts +9 -5
  34. package/dist/chat/message/chat-message.js +8 -4
  35. package/dist/chat/naming.js +2 -2
  36. package/dist/chat/root/chat-root.d.ts +27 -1
  37. package/dist/chat/root/chat-root.js +37 -9
  38. package/dist/checkbox/root/checkbox-root.d.ts +11 -0
  39. package/dist/checkbox/root/checkbox-root.js +8 -2
  40. package/dist/checkbox-group/root/checkbox-group-root.d.ts +11 -0
  41. package/dist/checkbox-group/root/checkbox-group-root.js +11 -3
  42. package/dist/code-block/root/code-block-root.d.ts +12 -2
  43. package/dist/code-block/root/code-block-root.js +12 -2
  44. package/dist/color-input/root/color-input-root.d.ts +13 -0
  45. package/dist/color-input/root/color-input-root.js +18 -5
  46. package/dist/color-picker/root/color-picker-root.d.ts +19 -3
  47. package/dist/color-picker/root/color-picker-root.js +47 -13
  48. package/dist/combobox/root/combobox-root.d.ts +36 -7
  49. package/dist/combobox/root/combobox-root.js +37 -12
  50. package/dist/command/root/command-root.d.ts +15 -6
  51. package/dist/command/root/command-root.js +9 -4
  52. package/dist/copy-button/root/copy-button-root.d.ts +5 -0
  53. package/dist/copy-button/root/copy-button-root.js +7 -2
  54. package/dist/data-table/root/data-table-root.d.ts +171 -29
  55. package/dist/data-table/root/data-table-root.js +268 -118
  56. package/dist/date-input/root/date-input-root.d.ts +32 -9
  57. package/dist/date-input/root/date-input-root.js +66 -44
  58. package/dist/date-picker/root/date-picker-root.d.ts +38 -15
  59. package/dist/date-picker/root/date-picker-root.js +52 -33
  60. package/dist/dialog/root/dialog-root.d.ts +12 -1
  61. package/dist/dialog/root/dialog-root.js +11 -4
  62. package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
  63. package/dist/donut-chart/root/donut-chart-root.js +8 -5
  64. package/dist/drawer/root/drawer-root.d.ts +12 -1
  65. package/dist/drawer/root/drawer-root.js +9 -2
  66. package/dist/drilldown/root/drilldown-root.d.ts +5 -0
  67. package/dist/drilldown/root/drilldown-root.js +4 -1
  68. package/dist/element-events.generated.js +25 -3
  69. package/dist/file-input/root/file-input-root.d.ts +18 -3
  70. package/dist/file-input/root/file-input-root.js +34 -17
  71. package/dist/filter-input/chip/filter-chip.d.ts +13 -0
  72. package/dist/filter-input/chip/filter-chip.js +6 -1
  73. package/dist/filter-input/menu/filter-menu.d.ts +5 -0
  74. package/dist/filter-input/menu/filter-menu.js +3 -1
  75. package/dist/filter-input/root/filter-input-root.d.ts +20 -3
  76. package/dist/filter-input/root/filter-input-root.js +8 -4
  77. package/dist/format-date/root/format-date-root.d.ts +20 -2
  78. package/dist/format-date/root/format-date-root.js +5 -2
  79. package/dist/graph/root/graph-model.d.ts +11 -0
  80. package/dist/graph/root/graph-model.js +4 -0
  81. package/dist/graph/root/graph-root.d.ts +78 -9
  82. package/dist/graph/root/graph-root.js +124 -27
  83. package/dist/heatmap/root/heatmap-root.d.ts +25 -4
  84. package/dist/heatmap/root/heatmap-root.js +27 -7
  85. package/dist/icon-button/root/icon-button-root.d.ts +5 -0
  86. package/dist/icon-button/root/icon-button-root.js +1 -0
  87. package/dist/input/root/input-root.d.ts +5 -0
  88. package/dist/input/root/input-root.js +4 -1
  89. package/dist/lightbox/root/lightbox-root.d.ts +14 -4
  90. package/dist/lightbox/root/lightbox-root.js +25 -7
  91. package/dist/line-chart/root/line-chart-root.d.ts +5 -0
  92. package/dist/line-chart/root/line-chart-root.js +4 -2
  93. package/dist/list/item/list-item.d.ts +32 -0
  94. package/dist/list/item/list-item.js +34 -7
  95. package/dist/list/root/list-root.d.ts +87 -0
  96. package/dist/list/root/list-root.js +112 -2
  97. package/dist/listbox/reorder/index.d.ts +1 -0
  98. package/dist/listbox/reorder/index.js +4 -0
  99. package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
  100. package/dist/listbox/reorder/listbox-reorder.js +151 -0
  101. package/dist/listbox/root/listbox-root.d.ts +68 -11
  102. package/dist/listbox/root/listbox-root.js +41 -9
  103. package/dist/loader/root/loader-root.d.ts +5 -0
  104. package/dist/loader/root/loader-root.js +3 -1
  105. package/dist/map/area/map-area.d.ts +5 -0
  106. package/dist/map/area/map-area.js +3 -1
  107. package/dist/map/buildings/map-buildings.d.ts +5 -0
  108. package/dist/map/buildings/map-buildings.js +3 -1
  109. package/dist/map/contours/map-contours.d.ts +5 -0
  110. package/dist/map/contours/map-contours.js +3 -1
  111. package/dist/map/landcover/map-landcover.d.ts +5 -0
  112. package/dist/map/landcover/map-landcover.js +3 -1
  113. package/dist/map/marker/map-marker.d.ts +16 -1
  114. package/dist/map/marker/map-marker.js +13 -5
  115. package/dist/map/points/map-points.d.ts +5 -0
  116. package/dist/map/points/map-points.js +6 -4
  117. package/dist/map/position/map-position.d.ts +5 -0
  118. package/dist/map/position/map-position.js +3 -1
  119. package/dist/map/raster/map-raster.d.ts +5 -0
  120. package/dist/map/raster/map-raster.js +3 -1
  121. package/dist/map/root/map-root.d.ts +33 -14
  122. package/dist/map/root/map-root.js +59 -22
  123. package/dist/map/route/map-route.d.ts +5 -0
  124. package/dist/map/route/map-route.js +3 -1
  125. package/dist/map/terrain/map-terrain.d.ts +5 -0
  126. package/dist/map/terrain/map-terrain.js +3 -1
  127. package/dist/menu/root/menu-root.d.ts +5 -0
  128. package/dist/menu/root/menu-root.js +3 -1
  129. package/dist/meter/root/meter-root.d.ts +16 -3
  130. package/dist/meter/root/meter-root.js +12 -5
  131. package/dist/navigation/root/navigation-root.d.ts +5 -0
  132. package/dist/navigation/root/navigation-root.js +3 -1
  133. package/dist/notifications/notification/notification.d.ts +5 -0
  134. package/dist/notifications/notification/notification.js +3 -1
  135. package/dist/notifications/root/notifications-root.d.ts +8 -0
  136. package/dist/notifications/root/notifications-root.js +10 -2
  137. package/dist/number-input/root/number-input-root.d.ts +21 -8
  138. package/dist/number-input/root/number-input-root.js +26 -11
  139. package/dist/object-inspector/root/object-inspector-root.d.ts +51 -12
  140. package/dist/object-inspector/root/object-inspector-root.js +21 -20
  141. package/dist/outline/root/outline-root.d.ts +5 -0
  142. package/dist/outline/root/outline-root.js +3 -1
  143. package/dist/pagination/root/pagination-root.d.ts +7 -1
  144. package/dist/pagination/root/pagination-root.js +16 -7
  145. package/dist/pagination/size/pagination-size.d.ts +7 -3
  146. package/dist/pagination/size/pagination-size.js +4 -2
  147. package/dist/pagination/summary/pagination-summary.d.ts +8 -6
  148. package/dist/pagination/summary/pagination-summary.js +4 -9
  149. package/dist/pin-input/code.d.ts +6 -6
  150. package/dist/pin-input/code.js +1 -5
  151. package/dist/pin-input/root/pin-input-root.d.ts +9 -3
  152. package/dist/pin-input/root/pin-input-root.js +6 -2
  153. package/dist/popover/root/popover-root.d.ts +12 -2
  154. package/dist/popover/root/popover-root.js +10 -4
  155. package/dist/progress/root/progress-root.d.ts +7 -2
  156. package/dist/progress/root/progress-root.js +5 -2
  157. package/dist/qr-code/name.d.ts +3 -2
  158. package/dist/qr-code/name.js +2 -2
  159. package/dist/qr-code/root/qr-code-root.d.ts +12 -2
  160. package/dist/qr-code/root/qr-code-root.js +9 -2
  161. package/dist/radio/group/radio-group.d.ts +11 -0
  162. package/dist/radio/group/radio-group.js +8 -2
  163. package/dist/rating/root/rating-root.d.ts +12 -1
  164. package/dist/rating/root/rating-root.js +10 -3
  165. package/dist/scatter-chart/root/scatter-chart-root.d.ts +20 -2
  166. package/dist/scatter-chart/root/scatter-chart-root.js +20 -5
  167. package/dist/select/root/select-root.d.ts +11 -0
  168. package/dist/select/root/select-root.js +13 -3
  169. package/dist/skip-link/root/skip-link-root.d.ts +5 -0
  170. package/dist/skip-link/root/skip-link-root.js +3 -1
  171. package/dist/slider/root/slider-root.d.ts +7 -2
  172. package/dist/slider/root/slider-root.js +11 -5
  173. package/dist/sparkline/readings.d.ts +15 -5
  174. package/dist/sparkline/readings.js +3 -3
  175. package/dist/sparkline/root/sparkline-root.d.ts +9 -4
  176. package/dist/sparkline/root/sparkline-root.js +9 -3
  177. package/dist/speed-dial/root/speed-dial-root.d.ts +5 -0
  178. package/dist/speed-dial/root/speed-dial-root.js +4 -1
  179. package/dist/splitter/root/splitter-root.d.ts +6 -1
  180. package/dist/splitter/root/splitter-root.js +9 -4
  181. package/dist/steps/root/steps-root.d.ts +9 -2
  182. package/dist/steps/root/steps-root.js +6 -3
  183. package/dist/steps/step/step.d.ts +12 -0
  184. package/dist/steps/step/step.js +11 -2
  185. package/dist/switch/root/switch-root.d.ts +11 -0
  186. package/dist/switch/root/switch-root.js +8 -2
  187. package/dist/table/column/table-column.d.ts +11 -4
  188. package/dist/table/column/table-column.js +15 -10
  189. package/dist/table/grid-controller.d.ts +8 -3
  190. package/dist/table/grid-controller.js +17 -11
  191. package/dist/table/root/table-root.d.ts +107 -5
  192. package/dist/table/root/table-root.js +122 -20
  193. package/dist/table/row/table-row.d.ts +42 -0
  194. package/dist/table/row/table-row.js +40 -1
  195. package/dist/tabs/root/tabs-root.d.ts +5 -0
  196. package/dist/tabs/root/tabs-root.js +3 -1
  197. package/dist/tag/group/tag-group.d.ts +5 -0
  198. package/dist/tag/group/tag-group.js +3 -1
  199. package/dist/tag/root/tag-root.d.ts +14 -1
  200. package/dist/tag/root/tag-root.js +11 -8
  201. package/dist/textarea/root/textarea-root.d.ts +5 -0
  202. package/dist/textarea/root/textarea-root.js +3 -1
  203. package/dist/time-input/root/time-input-root.d.ts +14 -7
  204. package/dist/time-input/root/time-input-root.js +43 -32
  205. package/dist/time-picker/root/time-picker-root.d.ts +15 -7
  206. package/dist/time-picker/root/time-picker-root.js +25 -12
  207. package/dist/toast/item/toast-item.d.ts +7 -0
  208. package/dist/toast/item/toast-item.js +1 -0
  209. package/dist/toast/root/toast-root.d.ts +9 -1
  210. package/dist/toast/root/toast-root.js +5 -4
  211. package/dist/toolbar/root/toolbar-root.d.ts +5 -0
  212. package/dist/toolbar/root/toolbar-root.js +5 -2
  213. package/dist/tooltip/root/tooltip-root.d.ts +27 -17
  214. package/dist/tour/root/tour-root.d.ts +8 -2
  215. package/dist/tour/root/tour-root.js +4 -2
  216. package/dist/tour/stop/tour-stop.d.ts +5 -0
  217. package/dist/tour/stop/tour-stop.js +6 -1
  218. package/dist/tree/grip.d.ts +5 -0
  219. package/dist/tree/grip.js +1 -0
  220. package/dist/tree/item/tree-item.d.ts +24 -0
  221. package/dist/tree/item/tree-item.js +27 -5
  222. package/dist/tree/root/tree-root.d.ts +66 -1
  223. package/dist/tree/root/tree-root.js +77 -5
  224. package/dist/trend/root/trend-root.d.ts +20 -4
  225. package/dist/trend/root/trend-root.js +20 -5
  226. package/dist/video/root/video-root.d.ts +12 -3
  227. package/dist/video/root/video-root.js +41 -14
  228. package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
  229. package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
  230. package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
  231. package/dist/video-playlist/root/video-playlist-root.js +3 -1
  232. package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
  233. package/dist/virtual-list/root/virtual-list-root.js +5 -2
  234. package/lint.json +1 -1
  235. package/package.json +9 -8
  236. package/types/jsx.d.ts +4014 -1862
  237. package/types/vue.d.ts +1266 -624
  238. package/types/words.d.ts +3280 -0
  239. package/dist/toast/hotkey.d.ts +0 -22
  240. package/dist/toast/hotkey.js +0 -23
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { AriaForwardController, customElement, HelixFormElement, HostClickController, MixinControllerChecked, MixinField, markRegion, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, customElement, HelixFormElement, HostClickController, MixinControllerChecked, MixinField, markRegion, words, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  let HelixHeadlessSwitch = class HelixHeadlessSwitch extends MixinControllerChecked(MixinField(HelixFormElement)) {
@@ -16,6 +16,7 @@ let HelixHeadlessSwitch = class HelixHeadlessSwitch extends MixinControllerCheck
16
16
  });
17
17
  this.clicks = new HostClickController(this, () => this.partNamed('control'));
18
18
  this.value = 'on';
19
+ this.valueMissingMessage = 'Turn this on to continue.';
19
20
  this.handleChange = (event) => {
20
21
  event.stopPropagation();
21
22
  const control = event.target;
@@ -27,9 +28,10 @@ let HelixHeadlessSwitch = class HelixHeadlessSwitch extends MixinControllerCheck
27
28
  this.announceChange();
28
29
  };
29
30
  }
31
+ static { this.words = 'helix-switch'; }
30
32
  sync() {
31
33
  this.internals.setFormValue(this.checked ? this.value : null);
32
- this.reportRequired(!this.checked, 'Turn this on to continue.', 'control');
34
+ this.reportRequired(!this.checked, this.valueMissingMessage, 'control');
33
35
  }
34
36
  formResetCallback() {
35
37
  super.formResetCallback();
@@ -72,6 +74,10 @@ let HelixHeadlessSwitch = class HelixHeadlessSwitch extends MixinControllerCheck
72
74
  __decorate([
73
75
  property()
74
76
  ], HelixHeadlessSwitch.prototype, "value", void 0);
77
+ __decorate([
78
+ words,
79
+ property({ attribute: 'value-missing-message' })
80
+ ], HelixHeadlessSwitch.prototype, "valueMissingMessage", void 0);
75
81
  HelixHeadlessSwitch = __decorate([
76
82
  customElement('helix-headless-switch')
77
83
  ], HelixHeadlessSwitch);
@@ -86,6 +86,11 @@ export declare const edgeOf: (align: string | undefined) => string | undefined;
86
86
  * @cssstate sorted-descending - While the table is sorted by this column, largest first.
87
87
  */
88
88
  export declare class HelixHeadlessTableColumn extends HelixElement {
89
+ /**
90
+ * The key this part's words are registered under, its styled tag:
91
+ * `registerWords('de', { 'helix-table-column': { resizeLabel: '{name} anpassen' } })`.
92
+ */
93
+ static words: string;
89
94
  /**
90
95
  * A function that reads the cell's content from a row, for cells that `field`
91
96
  * alone cannot read.
@@ -124,8 +129,9 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
124
129
  */
125
130
  field: string;
126
131
  /**
127
- * The accessible name of the grip that moves the column. `{name}` is replaced
128
- * with the heading text.
132
+ * The accessible name of the grip that moves the column. `{name}` is the
133
+ * heading text, and `{named}` is `no` for a column without one, so the
134
+ * sentence for it can name the column another way.
129
135
  *
130
136
  * **Every word a column speaks is a property**, so a table in another
131
137
  * language hears its own rather than English around its own headings.
@@ -142,7 +148,7 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
142
148
  resizable: boolean;
143
149
  /**
144
150
  * The accessible name of the separator that resizes the column. `{name}` is
145
- * replaced with the heading text.
151
+ * the heading text, and `{named}` is `no` for a column without one.
146
152
  */
147
153
  resizeLabel: string;
148
154
  /**
@@ -234,7 +240,8 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
234
240
  width: string;
235
241
  /**
236
242
  * The text screen readers announce for the column's width. `{width}` is
237
- * replaced with the width.
243
+ * the width in pixels, written in the locale, and each language writes the
244
+ * forms it has.
238
245
  */
239
246
  widthLabel: string;
240
247
  /**
@@ -5,8 +5,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  var HelixHeadlessTableColumn_1;
8
- import { customElement, fillTemplate, HelixBeforeResizeEvent, HelixElement, HelixResizedEvent, hostAria, inlineStep, isRtl, requestChange, valueAt, } from '@fusion.dev/helix-core';
9
- import { dotsThreeVertical } from '@fusion.dev/helix-icons';
8
+ import { customElement, formatWords, HelixBeforeResizeEvent, HelixElement, HelixResizedEvent, hostAria, inlineStep, isRtl, requestChange, valueAt, words, } from '@fusion.dev/helix-core';
9
+ import { dotsSixVertical } from '@fusion.dev/helix-icons';
10
10
  import { html, nothing } from 'lit';
11
11
  import { property, state } from 'lit/decorators.js';
12
12
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
@@ -18,13 +18,13 @@ let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixEleme
18
18
  this.cell = undefined;
19
19
  this.compare = undefined;
20
20
  this.field = '';
21
- this.moveLabel = 'Move {name}';
21
+ this.moveLabel = '{named, select, no {Move column} other {Move {name}}}';
22
22
  this.resizable = false;
23
- this.resizeLabel = 'Resize {name}';
23
+ this.resizeLabel = '{named, select, no {Resize column} other {Resize {name}}}';
24
24
  this.rowHeader = false;
25
25
  this.sortable = false;
26
26
  this.width = '';
27
- this.widthLabel = '{width} pixels';
27
+ this.widthLabel = '{width, plural, one {# pixel} other {# pixels}}';
28
28
  this.isTableColumn = true;
29
29
  this.sorted = undefined;
30
30
  this.movable = false;
@@ -67,6 +67,7 @@ let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixEleme
67
67
  };
68
68
  }
69
69
  static { HelixHeadlessTableColumn_1 = this; }
70
+ static { this.words = 'helix-table-column'; }
70
71
  static { this.NARROWEST = 48; }
71
72
  static { this.STEP = 16; }
72
73
  get track() {
@@ -170,6 +171,7 @@ let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixEleme
170
171
  }
171
172
  render() {
172
173
  const name = this.name;
174
+ const named = { name, named: name ? 'yes' : 'no' };
173
175
  const grid = this.gridCell;
174
176
  const control = grid ? '-1' : nothing;
175
177
  return html `<span
@@ -179,9 +181,9 @@ let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixEleme
179
181
  aria-sort=${grid && this.canSort ? (this.sorted ?? 'none') : nothing}
180
182
  aria-label=${grid && (this.movable || this.resizable) && name ? name : nothing}
181
183
  >${this.movable
182
- ? html `<button part="grip" type="button" tabindex=${control} aria-label=${fillTemplate(this.moveLabel, { name: name || 'column' })}>
183
- <svg aria-hidden="true" fill="currentColor" part="grip-mark" viewBox=${dotsThreeVertical.viewBox}>
184
- ${unsafeSVG(dotsThreeVertical.content)}
184
+ ? html `<button part="grip" type="button" tabindex=${control} aria-label=${formatWords(this, 'moveLabel', named)}>
185
+ <svg aria-hidden="true" fill="currentColor" part="grip-mark" viewBox=${dotsSixVertical.viewBox}>
186
+ ${unsafeSVG(dotsSixVertical.content)}
185
187
  </svg>
186
188
  </button>`
187
189
  : nothing}${this.canSort
@@ -191,12 +193,12 @@ let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixEleme
191
193
  part="resizer"
192
194
  role="separator"
193
195
  tabindex=${grid ? '-1' : '0'}
194
- aria-label=${fillTemplate(this.resizeLabel, { name: name || 'column' })}
196
+ aria-label=${formatWords(this, 'resizeLabel', named)}
195
197
  aria-orientation="vertical"
196
198
  aria-valuemin=${HelixHeadlessTableColumn_1.NARROWEST}
197
199
  aria-valuemax="4096"
198
200
  aria-valuenow=${Math.max(HelixHeadlessTableColumn_1.NARROWEST, this.drawn)}
199
- aria-valuetext=${fillTemplate(this.widthLabel, { width: this.drawn })}
201
+ aria-valuetext=${formatWords(this, 'widthLabel', { width: this.drawn })}
200
202
  @keydown=${this.handleResizeKey}
201
203
  @pointerdown=${this.handleResizeStart}
202
204
  @pointermove=${this.handleResizeMove}
@@ -216,12 +218,14 @@ __decorate([
216
218
  property()
217
219
  ], HelixHeadlessTableColumn.prototype, "field", void 0);
218
220
  __decorate([
221
+ words,
219
222
  property({ attribute: 'move-label' })
220
223
  ], HelixHeadlessTableColumn.prototype, "moveLabel", void 0);
221
224
  __decorate([
222
225
  property({ type: Boolean })
223
226
  ], HelixHeadlessTableColumn.prototype, "resizable", void 0);
224
227
  __decorate([
228
+ words,
225
229
  property({ attribute: 'resize-label' })
226
230
  ], HelixHeadlessTableColumn.prototype, "resizeLabel", void 0);
227
231
  __decorate([
@@ -237,6 +241,7 @@ __decorate([
237
241
  property()
238
242
  ], HelixHeadlessTableColumn.prototype, "width", void 0);
239
243
  __decorate([
244
+ words,
240
245
  property({ attribute: 'width-label' })
241
246
  ], HelixHeadlessTableColumn.prototype, "widthLabel", void 0);
242
247
  __decorate([
@@ -1,6 +1,11 @@
1
1
  import { type GridPlace } from '@fusion.dev/helix-core';
2
2
  import type { ReactiveController, ReactiveControllerHost } from 'lit';
3
3
  import type { HelixHeadlessTableColumn } from './column/table-column.js';
4
+ /**
5
+ * A column the table draws before the consumer's cells: the grips of a
6
+ * `reorderable` table, and the checkboxes of a `selectable` one.
7
+ */
8
+ export type LeadColumn = 'grip' | 'select';
4
9
  /** A place in the grid with the element that holds focus there. */
5
10
  export interface GridCell extends GridPlace {
6
11
  cell: HTMLElement;
@@ -13,14 +18,14 @@ export interface TableGridOptions {
13
18
  activate: (place: GridCell, event: KeyboardEvent) => boolean;
14
19
  /** The headings that are drawn, in order. */
15
20
  columns: () => HelixHeadlessTableColumn[];
21
+ /** The columns the table draws before the consumer's cells, in order. */
22
+ lead: () => readonly LeadColumn[];
16
23
  /** The element in the table's own shadow root holding a part of that name. */
17
24
  part: (name: string) => HTMLElement | null;
18
25
  /** The rows in the order they are drawn. */
19
26
  rows: () => Element[];
20
27
  /** Selects every row for Control or Command with A, and says whether it did. */
21
28
  selectAll: () => boolean;
22
- /** Whether a checkbox column leads. */
23
- selectable: () => boolean;
24
29
  /** Whether the table is a grid now. */
25
30
  on: () => boolean;
26
31
  }
@@ -66,7 +71,7 @@ export declare class TableGridController implements ReactiveController {
66
71
  * table draws itself are drawn with the stop where it now is.
67
72
  */
68
73
  hostUpdate(): void;
69
- /** How many columns lead the consumer's cells: the checkbox column, where there is one. */
74
+ /** How many columns lead the consumer's cells: the grips and the checkboxes, where there are any. */
70
75
  private get offset();
71
76
  /** The first row: the headings where there are any, and the first row of cells otherwise. */
72
77
  private get top();
@@ -1,4 +1,5 @@
1
1
  import { deepActiveElement, deepContains, focusableElements, gridMove, inlineStep, pageRows, scrollingAncestor, scrollRoom, selectsAll, whenHydrated, } from '@fusion.dev/helix-core';
2
+ const HEADS = { grip: 'grip-head', select: 'select-all' };
2
3
  const shown = (element) => {
3
4
  const hidden = element.getAttribute('hidden');
4
5
  return hidden === null || hidden === 'until-found';
@@ -125,10 +126,10 @@ export class TableGridController {
125
126
  this.focusRow = undefined;
126
127
  }
127
128
  get offset() {
128
- return this.options.selectable() ? 1 : 0;
129
+ return this.options.lead().length;
129
130
  }
130
131
  get top() {
131
- return this.options.columns().length > 0 || this.options.selectable() ? -1 : 0;
132
+ return this.options.columns().length > 0 || this.offset > 0 ? -1 : 0;
132
133
  }
133
134
  cellsOf(row) {
134
135
  return [...(row?.children ?? [])].filter(shown);
@@ -138,15 +139,15 @@ export class TableGridController {
138
139
  return this.offset + own;
139
140
  }
140
141
  cellAt({ column, row }) {
141
- const lead = column < this.offset;
142
+ const lead = this.options.lead()[column];
142
143
  if (row === -1) {
143
144
  return lead
144
- ? this.options.part('select-all')
145
+ ? this.options.part(HEADS[lead])
145
146
  : (this.options.columns()[column - this.offset]?.cellBox ?? null);
146
147
  }
147
148
  const line = this.options.rows()[row];
148
149
  if (lead) {
149
- return line?.shadowRoot?.querySelector('[part~="select"]') ?? null;
150
+ return line?.shadowRoot?.querySelector(`[part~="${lead}"]`) ?? null;
150
151
  }
151
152
  return this.cellsOf(line)[column - this.offset] ?? null;
152
153
  }
@@ -178,12 +179,14 @@ export class TableGridController {
178
179
  return cell ? { cell, column: heading + this.offset, row: -1 } : undefined;
179
180
  }
180
181
  const part = node.getAttribute('part') ?? '';
181
- if (part === 'select-all' && node.getRootNode() === this.host.shadowRoot) {
182
- return { cell: node, column: 0, row: -1 };
183
- }
184
182
  const root = node.getRootNode();
185
- if (part.split(' ').includes('select') && rows.includes(root.host)) {
186
- return { cell: node, column: 0, row: rows.indexOf(root.host) };
183
+ for (const [column, lead] of this.options.lead().entries()) {
184
+ if (part === HEADS[lead] && root === this.host.shadowRoot) {
185
+ return { cell: node, column, row: -1 };
186
+ }
187
+ if (part.split(' ').includes(lead) && rows.includes(root.host)) {
188
+ return { cell: node, column, row: rows.indexOf(root.host) };
189
+ }
187
190
  }
188
191
  const parent = node.parentElement;
189
192
  if (parent && rows.includes(parent) && shown(node)) {
@@ -202,6 +205,7 @@ export class TableGridController {
202
205
  mark() {
203
206
  const on = this.options.on();
204
207
  const at = this.current();
208
+ const lead = this.options.lead();
205
209
  this.stopIndex = Math.max(0, at.row);
206
210
  const columns = this.options.columns();
207
211
  for (const [index, column] of columns.entries()) {
@@ -211,9 +215,11 @@ export class TableGridController {
211
215
  for (const [index, line] of this.options.rows().entries()) {
212
216
  const row = line;
213
217
  if (row.isTableRow) {
218
+ const here = on && at.row === index;
214
219
  whenHydrated(row, () => {
215
220
  row.gridCell = on;
216
- row.selectStop = on && at.row === index && at.column === 0 && this.offset === 1;
221
+ row.gripStop = here && lead[at.column] === 'grip';
222
+ row.selectStop = here && lead[at.column] === 'select';
217
223
  });
218
224
  }
219
225
  for (const [place, cell] of this.cellsOf(line).entries()) {
@@ -53,6 +53,25 @@ declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.
53
53
  * Tab reaches each checkbox, and Space ticks it. To act on one row, put a
54
54
  * link or a button in a cell, or give the row an `href`.
55
55
  *
56
+ * **Moving rows.** `reorderable` adds a column of grips before the checkboxes,
57
+ * under a heading named by `row-grips-label`.
58
+ *
59
+ * 1. Each row is known by its `value`, or by its place among the rows where it
60
+ * has none, as for selecting. Give rows a `value` when they move, so a key
61
+ * stays with its row.
62
+ * 2. A grip is a button named by `move-row-label` ("Move {row}") with the
63
+ * words of the row's first cell. Drag it to move its row, and the page
64
+ * scrolls near an edge. Or press it with Space, Enter, or a click to pick
65
+ * the row up, move it with Up, Down, Home, and End, and press it again to
66
+ * drop it. A click on another row drops it there, and Escape puts it back.
67
+ * 3. `helix-before-reorder` asks first, and `helix-reorder` follows with
68
+ * `keys`, every row's key in the new order. **You move the rows**: the
69
+ * table moves no element of yours, and focus goes back to the moved row's
70
+ * grip once you have.
71
+ * 4. Each step is said in the table's live region, in words you can change:
72
+ * `picked-up-label`, `moved-label`, `dropped-label`, and `canceled-label`.
73
+ * The grips do nothing while a sort is set.
74
+ *
56
75
  * **A grid.** `grid` makes the table one tab stop that the arrow keys move
57
76
  * through cell by cell, the headings included, as React Aria's table is. The
58
77
  * table is then a `grid` and each value a `gridcell`, and the table gives
@@ -70,6 +89,7 @@ declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.
70
89
  * | Enter on a cell of a row with `href` | Follows the row's link. |
71
90
  * | Enter, Space on a sortable heading | Sorts by the column. |
72
91
  * | Space on a row, Enter or Space on its checkbox cell | Selects the row, in a `selectable` table. |
92
+ * | Enter or Space on a grip cell | Picks the row up, or drops it, in a `reorderable` table. Up, Down, Home, and End move a row picked up, and Escape puts it back. |
73
93
  * | Control or Command with A | Selects every row, in a `selectable` table. |
74
94
  * | Tab | Leaves the table. |
75
95
  *
@@ -87,6 +107,8 @@ declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.
87
107
  * @slot - The table's rows.
88
108
  * @slot heading - Words that name the table, shown above it, such as a heading.
89
109
  *
110
+ * @event {HelixBeforeReorderEvent} helix-before-reorder - Fired when a row is dropped at a new place, in a `reorderable` table, with every row's key in the new order. Cancelable: cancel it to keep the row where it is.
111
+ * @event {HelixReorderEvent} helix-reorder - Fired after `helix-before-reorder` when nobody canceled it. Move your rows to the order in `keys`. Cancelable: cancel it to say the move did not happen.
90
112
  * @event {HelixSelectEvent} helix-select - The selection is about to change. The event carries every selected key, separated by commas. Cancelable: cancel it to keep the current selection.
91
113
  * @event {HelixSelectedEvent} helix-selected - Fired after the selection changes, with every selected key, separated by commas.
92
114
  * @event {HelixSortEvent} helix-sort - A different sort order was requested, as `field:direction`, or empty for the order the rows were written in. Cancelable: cancel it to keep the current order.
@@ -103,11 +125,13 @@ declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.
103
125
  * @csspart checkbox-mark-checked - Added to `checkbox-mark` while its box is checked.
104
126
  * @csspart checkbox-mark-dash - Added to `checkbox-mark` while it draws the dash, which it keeps until its box is checked.
105
127
  * @csspart checkbox-mark-indeterminate - Added to `checkbox-mark` while only some rows are selected.
128
+ * @csspart drag-preview - A copy of the row a pointer drags by its grip, which follows the pointer in the top layer until the row is let go, in a `reorderable` table. Hidden from assistive technology.
106
129
  * @csspart empty - The text shown when there are no rows.
107
130
  * @csspart grid-end - An empty box after the rows, in a `grid` table. Tab focuses it on its way out of the table, so the key leaves from the end.
108
131
  * @csspart grid-start - An empty box before the rows, in a `grid` table. Shift with Tab focuses it on its way out of the table.
132
+ * @csspart grip-head - The heading over the row grips, in a `reorderable` table.
109
133
  * @csspart head - The row that holds the column headings. It has `display: contents`, so it takes no space of its own.
110
- * @csspart live - A live region that repeats the empty and loading text, so screen readers announce it when it changes. Visually hidden in the styled tier.
134
+ * @csspart live - A live region that repeats the empty and loading text, and says each step of a move, so screen readers announce it when it changes. Visually hidden in the styled tier.
111
135
  * @csspart loading - The text shown while the rows are loading.
112
136
  * @csspart select-all - The heading that holds the checkbox that selects every row.
113
137
  * @csspart table - The grid.
@@ -115,8 +139,24 @@ declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.
115
139
  * @cssproperty --table-template - The column track list the table works out from its columns. The component writes it inline on the element that reads it, so setting it has no effect. Set `columns` to change the tracks.
116
140
  */
117
141
  export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
118
- /** The word for an ascending sort, in `sorted-label`. */
142
+ /**
143
+ * The key this family's words are registered under, its styled tag:
144
+ * `registerWords('de', { 'helix-table': { selectAllLabel: 'Alle Zeilen auswählen' } })`.
145
+ */
146
+ static words: string;
147
+ /**
148
+ * The word for an ascending sort, in a `sorted-label` that writes `{order}`.
149
+ *
150
+ * @deprecated Write the whole sentence for each order in `sorted-label`, with
151
+ * `{direction, select, ascending {...} descending {...} other {...}}`.
152
+ * Removed in the next major version.
153
+ */
119
154
  ascendingLabel: string;
155
+ /**
156
+ * What screen readers hear when a held row is put back, or a move is
157
+ * refused, in a `reorderable` table.
158
+ */
159
+ canceledLabel: string;
120
160
  /**
121
161
  * The column widths as one track list, written once on the table.
122
162
  *
@@ -157,8 +197,21 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
157
197
  * The starting sort order, used until `sort` is set.
158
198
  */
159
199
  defaultSort: string;
160
- /** The word for a descending sort, in `sorted-label`. */
200
+ /**
201
+ * The word for a descending sort, in a `sorted-label` that writes `{order}`.
202
+ *
203
+ * @deprecated Write the whole sentence for each order in `sorted-label`, with
204
+ * `{direction, select, ascending {...} descending {...} other {...}}`.
205
+ * Removed in the next major version.
206
+ */
161
207
  descendingLabel: string;
208
+ /** What screen readers hear when a held row is dropped, in a `reorderable` table. */
209
+ droppedLabel: string;
210
+ /**
211
+ * The table's name where neither `label` nor an `aria-label` or
212
+ * `aria-labelledby` on the host gives it one.
213
+ */
214
+ fallbackLabel: string;
162
215
  /**
163
216
  * Makes the table a grid: one tab stop, and the arrow keys, Home, End and the
164
217
  * Page keys move focus between its cells, the headings included. Enter moves
@@ -176,6 +229,29 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
176
229
  * wins over this.
177
230
  */
178
231
  label: string;
232
+ /**
233
+ * What screen readers hear each time a key moves a held row, in a
234
+ * `reorderable` table. `{name}` is the row's words, `{position}` the place it
235
+ * would go, counting from 1, and `{count}` the number of rows.
236
+ */
237
+ movedLabel: string;
238
+ /**
239
+ * The name of a row's grip, in a `reorderable` table. `{row}` is replaced
240
+ * with the words of the row's first cell.
241
+ */
242
+ moveRowLabel: string;
243
+ /**
244
+ * What screen readers hear when a key or a click picks up a row, in a
245
+ * `reorderable` table. `{name}` is the row's words.
246
+ */
247
+ pickedUpLabel: string;
248
+ /**
249
+ * Adds a column of grips that move rows, by dragging or with the keys. The
250
+ * table moves no row itself: you move your rows on `helix-reorder`.
251
+ */
252
+ reorderable: boolean;
253
+ /** The name of the heading over the row grips, in a `reorderable` table. */
254
+ rowGripsLabel: string;
179
255
  /**
180
256
  * Adds a column of checkboxes for selecting rows. Each row is known by its
181
257
  * `value`, and by its place among the rows as written where it has none.
@@ -194,7 +270,9 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
194
270
  set selected(next: string);
195
271
  /**
196
272
  * What screen readers hear when the chosen rows change. `{count}` is how many
197
- * rows are chosen.
273
+ * rows are chosen, written in the locale, and a language that needs plural
274
+ * forms writes them: `{count, plural, one {# wybrany} few {# wybrane} many
275
+ * {# wybranych} other {# wybranego}}`.
198
276
  */
199
277
  selectedLabel: string;
200
278
  /**
@@ -215,7 +293,9 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
215
293
  set sort(next: string);
216
294
  /**
217
295
  * What screen readers hear when the table is sorted. `{column}` is the
218
- * column's heading and `{order}` is `ascending-label` or `descending-label`.
296
+ * column's heading and `{direction}` is `ascending` or `descending`, so each
297
+ * order has its whole sentence. `{order}` is the deprecated
298
+ * `ascending-label` or `descending-label`.
219
299
  */
220
300
  sortedLabel: string;
221
301
  /** What screen readers hear when the table stops being sorted. */
@@ -235,6 +315,21 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
235
315
  protected readonly aria: AriaForwardController;
236
316
  /** The keyboard of a `grid` table, in `grid-controller.ts`. */
237
317
  private readonly gridKeys;
318
+ /**
319
+ * Moving rows by their grips, in a `reorderable` table. The rows are the
320
+ * page's, so a drop asks the page to move them, and the grips do nothing
321
+ * while a sort decides the order.
322
+ */
323
+ private readonly reorder;
324
+ /** The columns drawn before the consumer's cells: the grips, then the checkboxes. */
325
+ private get lead();
326
+ /** The row that stands for a key. */
327
+ private rowFor;
328
+ /**
329
+ * What takes focus for a row's grip, in a `reorderable` table: the cell in a
330
+ * grid, where every cell takes focus, and the button otherwise.
331
+ */
332
+ private gripOf;
238
333
  /**
239
334
  * Asks for a different order, and reports whether the request stood.
240
335
  */
@@ -264,6 +359,11 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
264
359
  * new order is said. Not on the first render, which is the table arriving.
265
360
  */
266
361
  private news;
362
+ /**
363
+ * The sentence a sort is said in: `sorted-label` with the column, and the
364
+ * order both as `{direction}` and as the deprecated `{order}` word.
365
+ */
366
+ private sortSaid;
267
367
  /** The sort as the last render had it, so a selection said beside a sort waits. */
268
368
  private heardSortBefore;
269
369
  /** The selection last heard, so a render that changed nothing says nothing. */
@@ -442,6 +542,8 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
442
542
  private alignCells;
443
543
  protected willUpdate(changed: PropertyValues): void;
444
544
  protected updated(changed: PropertyValues): void;
545
+ /** The heading over the row grips, named by `row-grips-label`. */
546
+ private renderGripHead;
445
547
  /** The heading of the checkbox column, which selects every row. */
446
548
  private renderSelectAll;
447
549
  protected render(): TemplateResult;