@fusion.dev/helix-headless 0.171.0 → 0.172.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.
Files changed (33) hide show
  1. package/custom-elements.json +439 -65
  2. package/dist/chat/composer/chat-composer.d.ts +28 -1
  3. package/dist/chat/composer/chat-composer.js +22 -3
  4. package/dist/chat/root/chat-root.d.ts +38 -2
  5. package/dist/chat/root/chat-root.js +38 -1
  6. package/dist/color-input/root/color-input-root.d.ts +15 -1
  7. package/dist/color-input/root/color-input-root.js +19 -1
  8. package/dist/color-picker/root/color-picker-root.d.ts +5 -1
  9. package/dist/color-picker/root/color-picker-root.js +1 -1
  10. package/dist/data-table/root/data-table-root.d.ts +5 -1
  11. package/dist/data-table/root/data-table-root.js +1 -0
  12. package/dist/dialog/root/dialog-root.js +1 -0
  13. package/dist/drawer/root/drawer-root.d.ts +4 -0
  14. package/dist/drawer/root/drawer-root.js +1 -0
  15. package/dist/element-events.generated.js +1 -0
  16. package/dist/lightbox/root/lightbox-root.js +1 -0
  17. package/dist/listbox/root/listbox-root.d.ts +2 -1
  18. package/dist/listbox/root/listbox-root.js +3 -2
  19. package/dist/menu/item/menu-item.d.ts +2 -0
  20. package/dist/menu/item/menu-item.js +2 -0
  21. package/dist/menu/root/menu-root.d.ts +73 -12
  22. package/dist/menu/root/menu-root.js +103 -7
  23. package/dist/popover/root/popover-root.d.ts +59 -6
  24. package/dist/popover/root/popover-root.js +51 -3
  25. package/dist/select/root/select-root.d.ts +2 -2
  26. package/dist/select/root/select-root.js +2 -2
  27. package/dist/textarea/root/textarea-root.d.ts +8 -0
  28. package/dist/textarea/root/textarea-root.js +16 -0
  29. package/lint.json +1 -1
  30. package/package.json +5 -5
  31. package/types/jsx.d.ts +312 -30
  32. package/types/vue.d.ts +59 -8
  33. package/types/words.d.ts +8 -0
@@ -33,7 +33,7 @@ declare const HelixHeadlessSelect_base: (new (...args: any[]) => import("@fusion
33
33
  * | Down, Enter, Space | Opens the list on the chosen option, or the first. |
34
34
  * | Up | Opens the list on the chosen option, or the last. |
35
35
  * | Home, End | Opens the list on the first or the last option. |
36
- * | Left, Right | Chooses the option before or after the chosen one without opening, as React Aria's Select does, in either direction of text. |
36
+ * | Left, Right | Chooses the option before or after the chosen one without opening, as React Aria's Select does. On a right-to-left page Left chooses the one after. |
37
37
  * | A letter or a word | Chooses the option whose words start with what you typed, as a native `<select>` does. With `multiple`, opens the list on it. |
38
38
  *
39
39
  * In the open list, which is a `Listbox`:
@@ -371,7 +371,7 @@ export declare class HelixHeadlessSelect extends HelixHeadlessSelect_base {
371
371
  * middle of those letters is one of them. With `multiple`, a letter opens the
372
372
  * list on the match instead, because adding to a set is a choice the reader
373
373
  * makes in the list. ArrowLeft and ArrowRight choose the option before and
374
- * after the chosen one.
374
+ * after the chosen one, the other way round on a right-to-left page.
375
375
  */
376
376
  private readonly handleTriggerKeydown;
377
377
  /**
@@ -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, afterLinkFollowed, chosenValues, customElement, dataOptions, drawAutofill, drawStatus, HelixFormElement, hostAria, hostWords, isRtl, MixinControllerOpen, MixinControllerValue, MixinField, onApple, PopoverController, reportValues, StatusController, sideOf, typesCharacter, UpgradeController, words, wordsLocale, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, afterLinkFollowed, chosenValues, customElement, dataOptions, drawAutofill, drawStatus, HelixFormElement, hostAria, hostWords, inlineStep, isRtl, MixinControllerOpen, MixinControllerValue, MixinField, onApple, PopoverController, reportValues, StatusController, sideOf, typesCharacter, UpgradeController, words, wordsLocale, } from '@fusion.dev/helix-core';
8
8
  import { caretDown } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property } from 'lit/decorators.js';
@@ -131,7 +131,7 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
131
131
  }
132
132
  return;
133
133
  }
134
- const step = event.key === 'ArrowRight' ? 1 : event.key === 'ArrowLeft' ? -1 : 0;
134
+ const step = inlineStep(this, event.key);
135
135
  if (step !== 0 && !this.multiple && !(event.altKey || event.ctrlKey || event.metaKey)) {
136
136
  event.preventDefault();
137
137
  const reachable = this.items
@@ -217,6 +217,14 @@ export declare class HelixHeadlessTextarea extends HelixHeadlessTextarea_base {
217
217
  * and so does this.
218
218
  */
219
219
  setSelectionRange(start: number, end: number, direction?: SelectionDirection): void;
220
+ /**
221
+ * Replaces a range of the text, as the native method does: the selection
222
+ * where `start` and `end` are left out, and `selectMode` says what is
223
+ * selected after. It sends no event, as the native method sends none.
224
+ */
225
+ setRangeText(replacement: string, start?: number, end?: number, selectMode?: SelectionMode): void;
226
+ /** Selects everything in the field. */
227
+ select(): void;
220
228
  /** How many characters the value holds. */
221
229
  get textLength(): number;
222
230
  /** The control's type, which is always `textarea`. */
@@ -111,6 +111,22 @@ let HelixHeadlessTextarea = class HelixHeadlessTextarea extends MixinControllerV
111
111
  setSelectionRange(start, end, direction) {
112
112
  this.control?.setSelectionRange(start, end, direction);
113
113
  }
114
+ setRangeText(replacement, start, end, selectMode) {
115
+ const control = this.control;
116
+ if (!control) {
117
+ return;
118
+ }
119
+ if (start === undefined || end === undefined) {
120
+ control.setRangeText(replacement);
121
+ }
122
+ else {
123
+ control.setRangeText(replacement, start, end, selectMode);
124
+ }
125
+ this.value = control.value;
126
+ }
127
+ select() {
128
+ this.control?.select();
129
+ }
114
130
  get textLength() {
115
131
  return this.value.length;
116
132
  }