@fusion.dev/helix-headless 0.13.0 → 0.13.2

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.
@@ -15231,6 +15231,14 @@
15231
15231
  "name": "helix-create",
15232
15232
  "reactProp": "onhelix-create"
15233
15233
  },
15234
+ {
15235
+ "type": {
15236
+ "text": "HelixFilterEvent"
15237
+ },
15238
+ "description": "Fired as the reader types, carrying the text the list is being narrowed to. Cancelable: refusing it leaves the list whole, and is how a consumer takes the filtering for themselves.",
15239
+ "name": "helix-filter",
15240
+ "reactProp": "onhelix-filter"
15241
+ },
15234
15242
  {
15235
15243
  "name": "input",
15236
15244
  "type": {
@@ -49,6 +49,7 @@ declare const HelixHeadlessCombobox_base: (new (...args: any[]) => import("@fusi
49
49
  * @event {HelixBeforeCloseEvent} helix-before-close - Fired before it closes. Cancelable: refusing it takes the decision and nothing moves.
50
50
  * @event {HelixBeforeOpenEvent} helix-before-open - Fired before the panel opens. Cancelable: refusing it takes the decision and nothing moves.
51
51
  * @event {HelixCreateEvent} helix-create - Fired when the reader asks for something the list does not hold, and cancelable.
52
+ * @event {HelixFilterEvent} helix-filter - Fired as the reader types, carrying the text the list is being narrowed to. Cancelable: refusing it leaves the list whole, and is how a consumer takes the filtering for themselves.
52
53
  * @event {Event} input - Announced once the value has moved.
53
54
  * @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
54
55
  *
@@ -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, HelixCreateEvent, HelixFormElement, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, PopoverController, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, customElement, HelixCreateEvent, HelixFilterEvent, HelixFormElement, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, PopoverController, } from '@fusion.dev/helix-core';
8
8
  import { caretDown } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
@@ -47,7 +47,10 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
47
47
  event.stopPropagation();
48
48
  const typed = event.target.value;
49
49
  this.typed = typed;
50
- this.listbox?.requestFilter(typed);
50
+ const narrowing = new HelixFilterEvent({ value: typed });
51
+ if (this.dispatchEvent(narrowing)) {
52
+ this.listbox?.requestFilter(typed);
53
+ }
51
54
  this.suggestion = this.suggest && isInsertion(event) ? this.completionFor(typed) : '';
52
55
  if (!this.open) {
53
56
  this.requestOpen(true);
@@ -251,6 +254,7 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
251
254
  .value=${this.value}
252
255
  @helix-before-change=${this.handleChange}
253
256
  @change=${this.stopInner}
257
+ @helix-filter=${this.stopInner}
254
258
  @input=${this.stopInner}
255
259
  >
256
260
  <!-- The field's words are read off the options, and on the first
@@ -32,6 +32,7 @@ registerElementEvents({
32
32
  'helix-before-close',
33
33
  'helix-before-open',
34
34
  'helix-create',
35
+ 'helix-filter',
35
36
  'input',
36
37
  'toggle',
37
38
  ],
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.13.0",
4
+ "version": "0.13.2",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -45,14 +45,14 @@
45
45
  },
46
46
  "bugs": "https://github.com/project-fusion/fusion/issues",
47
47
  "dependencies": {
48
- "@fusion.dev/helix-core": "0.13.0",
49
- "@fusion.dev/helix-icons": "0.13.0",
48
+ "@fusion.dev/helix-core": "0.13.2",
49
+ "@fusion.dev/helix-icons": "0.13.2",
50
50
  "uqr": "^0.1.3"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@custom-elements-manifest/analyzer": "^0.11.0",
54
- "@fusion.dev/helix-cem": "0.13.0",
55
- "@fusion.dev/helix-testing": "0.13.0",
54
+ "@fusion.dev/helix-cem": "0.13.2",
55
+ "@fusion.dev/helix-testing": "0.13.2",
56
56
  "@fusion.dev/scripts": "0.0.0-dev",
57
57
  "@happy-dom/global-registrator": "^20.0.0",
58
58
  "@lit-labs/ssr": "^3.3.0",
package/types/jsx.d.ts CHANGED
@@ -2986,6 +2986,9 @@ export type HelixHeadlessComboboxHelixBeforeOpenElementEvent =
2986
2986
  /** `helix-create` event type */
2987
2987
  export type HelixHeadlessComboboxHelixCreateElementEvent =
2988
2988
  HelixHeadlessComboboxElementEvent<HelixCreateEvent>;
2989
+ /** `helix-filter` event type */
2990
+ export type HelixHeadlessComboboxHelixFilterElementEvent =
2991
+ HelixHeadlessComboboxElementEvent<HelixFilterEvent>;
2989
2992
 
2990
2993
  export type HelixHeadlessComboboxProps = {
2991
2994
  /** What the browser may autofill in the text field, as a platform token.
@@ -3135,6 +3138,8 @@ differently: they are one chooser to a consumer. */
3135
3138
  ) => void) | undefined;
3136
3139
  /** Fired when the reader asks for something the list does not hold, and cancelable. */
3137
3140
  "onhelix-create"?: ((e: HelixHeadlessComboboxHelixCreateElementEvent) => void) | undefined;
3141
+ /** Fired as the reader types, carrying the text the list is being narrowed to. Cancelable: refusing it leaves the list whole, and is how a consumer takes the filtering for themselves. */
3142
+ "onhelix-filter"?: ((e: HelixHeadlessComboboxHelixFilterElementEvent) => void) | undefined;
3138
3143
  /** Announced once the value has moved. */
3139
3144
  oninput?: ((e: HelixHeadlessComboboxElementEvent) => void) | undefined;
3140
3145
  /** Says the state moved, carrying `newState` and `oldState`. */
@@ -3288,6 +3293,8 @@ differently: they are one chooser to a consumer. */
3288
3293
  ) => void) | undefined;
3289
3294
  /** Fired when the reader asks for something the list does not hold, and cancelable. */
3290
3295
  "on:helix-create"?: ((e: HelixHeadlessComboboxHelixCreateElementEvent) => void) | undefined;
3296
+ /** Fired as the reader types, carrying the text the list is being narrowed to. Cancelable: refusing it leaves the list whole, and is how a consumer takes the filtering for themselves. */
3297
+ "on:helix-filter"?: ((e: HelixHeadlessComboboxHelixFilterElementEvent) => void) | undefined;
3291
3298
  /** Announced once the value has moved. */
3292
3299
  "on:input"?: ((e: HelixHeadlessComboboxElementEvent) => void) | undefined;
3293
3300
  /** Says the state moved, carrying `newState` and `oldState`. */
@@ -18440,6 +18447,7 @@ export type CustomElements = {
18440
18447
  * - `helix-before-close`: Fired before it closes. Cancelable: refusing it takes the decision and nothing moves.
18441
18448
  * - `helix-before-open`: Fired before the panel opens. Cancelable: refusing it takes the decision and nothing moves.
18442
18449
  * - `helix-create`: Fired when the reader asks for something the list does not hold, and cancelable.
18450
+ * - `helix-filter`: Fired as the reader types, carrying the text the list is being narrowed to. Cancelable: refusing it leaves the list whole, and is how a consumer takes the filtering for themselves.
18443
18451
  * - `input`: Announced once the value has moved.
18444
18452
  * - `toggle`: Says the state moved, carrying `newState` and `oldState`.
18445
18453
  *
@@ -32839,6 +32847,7 @@ export type CustomElementsSolidJs = {
32839
32847
  * - `helix-before-close`: Fired before it closes. Cancelable: refusing it takes the decision and nothing moves.
32840
32848
  * - `helix-before-open`: Fired before the panel opens. Cancelable: refusing it takes the decision and nothing moves.
32841
32849
  * - `helix-create`: Fired when the reader asks for something the list does not hold, and cancelable.
32850
+ * - `helix-filter`: Fired as the reader types, carrying the text the list is being narrowed to. Cancelable: refusing it leaves the list whole, and is how a consumer takes the filtering for themselves.
32842
32851
  * - `input`: Announced once the value has moved.
32843
32852
  * - `toggle`: Says the state moved, carrying `newState` and `oldState`.
32844
32853
  *
package/types/vue.d.ts CHANGED
@@ -1541,6 +1541,9 @@ export type HelixHeadlessComboboxHelixBeforeOpenElementEvent =
1541
1541
  /** `helix-create` event type */
1542
1542
  export type HelixHeadlessComboboxHelixCreateElementEvent =
1543
1543
  HelixHeadlessComboboxElementEvent<HelixCreateEvent>;
1544
+ /** `helix-filter` event type */
1545
+ export type HelixHeadlessComboboxHelixFilterElementEvent =
1546
+ HelixHeadlessComboboxElementEvent<HelixFilterEvent>;
1544
1547
 
1545
1548
  export type HelixHeadlessComboboxVueProps = {
1546
1549
  /** What the browser may autofill in the text field, as a platform token.
@@ -1686,6 +1689,8 @@ export type HelixHeadlessComboboxVueEvents = {
1686
1689
  "helix-before-open": HelixHeadlessComboboxHelixBeforeOpenElementEvent;
1687
1690
  /** Fired when the reader asks for something the list does not hold, and cancelable. */
1688
1691
  "helix-create": HelixHeadlessComboboxHelixCreateElementEvent;
1692
+ /** Fired as the reader types, carrying the text the list is being narrowed to. Cancelable: refusing it leaves the list whole, and is how a consumer takes the filtering for themselves. */
1693
+ "helix-filter": HelixHeadlessComboboxHelixFilterElementEvent;
1689
1694
  /** Announced once the value has moved. */
1690
1695
  input: HelixHeadlessComboboxElementEvent;
1691
1696
  /** Says the state moved, carrying `newState` and `oldState`. */