@ixfx/components 0.7.1 → 0.7.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.
Files changed (49) hide show
  1. package/bundle/index.d.ts +24 -17
  2. package/bundle/index.d.ts.map +1 -1
  3. package/bundle/index.js +29 -1
  4. package/bundle/index.js.map +1 -1
  5. package/dist/{index-CG2vIgPv.d.ts → index-UvnoZUAo.d.ts} +4 -4
  6. package/dist/{index-CG2vIgPv.d.ts.map → index-UvnoZUAo.d.ts.map} +1 -1
  7. package/dist/index.d.ts +8 -3
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +27 -4
  10. package/dist/index.js.map +1 -1
  11. package/dist/labelled-radial-input.d.ts +1 -1
  12. package/dist/labelled-radial-input.js +1 -1
  13. package/dist/{labelled-slider-input-DzigjMwP.js → labelled-slider-input-BInB5GKL.js} +3 -3
  14. package/dist/{labelled-slider-input-DzigjMwP.js.map → labelled-slider-input-BInB5GKL.js.map} +1 -1
  15. package/dist/labelled-slider-input.d.ts +1 -1
  16. package/dist/labelled-slider-input.js +1 -1
  17. package/dist/polar-pad.d.ts +2 -2
  18. package/dist/polar-pad.js +1 -1
  19. package/dist/{radial-input-Dp5qz0ly.js → radial-input-BfA3GO0H.js} +2 -2
  20. package/dist/{radial-input-Dp5qz0ly.js.map → radial-input-BfA3GO0H.js.map} +1 -1
  21. package/dist/{radial-input-DXMN55Nz.d.ts → radial-input-DU6t2hYO.d.ts} +3 -3
  22. package/dist/{radial-input-DXMN55Nz.d.ts.map → radial-input-DU6t2hYO.d.ts.map} +1 -1
  23. package/dist/radial-input.d.ts +1 -1
  24. package/dist/radial-input.js +1 -1
  25. package/dist/range-input.d.ts +2 -2
  26. package/dist/range-input.js +1 -1
  27. package/dist/range.d.ts +2 -2
  28. package/dist/range.js +1 -1
  29. package/dist/select-horiz.d.ts +2 -2
  30. package/dist/select-horiz.js +1 -1
  31. package/dist/{slider-input-De4eoT11.js → slider-input-Bl1hFE89.js} +2 -2
  32. package/dist/{slider-input-De4eoT11.js.map → slider-input-Bl1hFE89.js.map} +1 -1
  33. package/dist/{slider-input-BfRUW2ZB.d.ts → slider-input-BxURAAmD.d.ts} +3 -3
  34. package/dist/{slider-input-BfRUW2ZB.d.ts.map → slider-input-BxURAAmD.d.ts.map} +1 -1
  35. package/dist/slider-input.d.ts +1 -1
  36. package/dist/slider-input.js +1 -1
  37. package/dist/swipe.d.ts +2 -2
  38. package/dist/swipe.js +1 -1
  39. package/dist/wheel-nudge-By5s_ioH.d.ts +31 -0
  40. package/dist/wheel-nudge-By5s_ioH.d.ts.map +1 -0
  41. package/dist/{wheel-nudge-BlSCe_hD.js → wheel-nudge-D5rmht3v.js} +6 -1
  42. package/dist/wheel-nudge-D5rmht3v.js.map +1 -0
  43. package/dist/xy-pad.d.ts +2 -2
  44. package/dist/xy-pad.js +1 -1
  45. package/docs-user/index.json +2 -2
  46. package/package.json +1 -1
  47. package/dist/wheel-nudge-BlSCe_hD.js.map +0 -1
  48. package/dist/wheel-nudge-DGrNzWuE.d.ts +0 -29
  49. package/dist/wheel-nudge-DGrNzWuE.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { n as WheelNudgeConsumerType, t as WheelDirection } from "./wheel-nudge-DGrNzWuE.js";
1
+ import { n as WheelNudgeConsumer, t as WheelDirection } from "./wheel-nudge-By5s_ioH.js";
2
2
  import { LitElement, PropertyValues } from "lit";
3
3
  //#region src/slider-input/types.d.ts
4
4
  /**
@@ -89,7 +89,7 @@ interface SliderInputElementEventMap {
89
89
  }
90
90
  //#endregion
91
91
  //#region src/slider-input/slider-input.d.ts
92
- declare const SliderInputElement_base: (new (...args: any[]) => WheelNudgeConsumerType<LitElement>) & typeof LitElement;
92
+ declare const SliderInputElement_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer);
93
93
  declare class SliderInputElement extends SliderInputElement_base {
94
94
  #private;
95
95
  valueA: number;
@@ -170,4 +170,4 @@ interface SliderInputElement {
170
170
  }
171
171
  //#endregion
172
172
  export { SliderValueMode as _, SliderInputChangeDetail as a, SliderInputInputDetail as c, SliderLaneType as d, SliderMarkerStyle as f, SliderValueDrag as g, SliderValueCFollow as h, SliderHandleKey as i, SliderInputInputEvent as l, SliderSingleStyle as m, SliderChangedField as n, SliderInputChangeEvent as o, SliderOrientation as p, SliderCrossover as r, SliderInputElementEventMap as s, SliderInputElement as t, SliderLaneData as u };
173
- //# sourceMappingURL=slider-input-BfRUW2ZB.d.ts.map
173
+ //# sourceMappingURL=slider-input-BxURAAmD.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slider-input-BfRUW2ZB.d.ts","names":[],"sources":["../src/slider-input/types.ts","../src/slider-input/slider-input.ts"],"mappings":";;;;;;KAIY;KACA;KACA;KACA;KACA;KACA;;;;;;;KAOA;KACA;KACA;;;;;;;UAQK;EACf;EACA,MAAM;;;;;EAKN;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;KAOU;;;;;;;;UASK;WACN;WACA;;WAEA;;WAEA;WACA;WACA;;WAEA;WACA;;WAEA,UAAU;;UAGJ;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,UAAU;;KAGT,wBAAwB,YAAY;KACpC,yBAAyB,YAAY;UAEhC;EACf,OAAO;EACP,QAAQ;;;;;cCZG,2BAA2B;;EAGtC;EAGA;;;;;;EAQA;EAGA;EAGA;EAGA;EAGA;EAGA,WAAW;EAGX,aAAa;EAGb,aAAa;EAGb,aAAa;;;;;;EAQb,cAAc;EAGd,WAAW;EAGX,WAAW;;;;;;;EASX,cAAc;EAGd;EAGA;;;;;;;;;;;;;EAeA;;EAyFS;EAiFT,QACE,aACA;IACE;IACA;IACA;IACA,OAAO;IACP;IACA;;EAgBJ,aAAa,aAAa;EAQ1B,aAAa,aAAa,kBAAkB;EAW5C,WAAW;EAKX,YAAY,oBAAoB;EAIhC,QAAQ,cAAc;EA0nCb,iBAAiB,WAAW,gBAAgB,OAAO;YAoXzC,WAAW,SAAS;EAsE9B;YA2JU,QAAQ,SAAS;EAkB3B;SAiBO,sBAAM;;QAqJhB;YACI;IACR,qBAAqB;;;UAKR;EACf,oBAAoB,gBAAgB,4BAClC,MAAM,GACN,WAAW,MAAM,oBAAoB,OAAO,2BAA2B,aACvE,oBAAoB,sCAEpB,cACA,UAAU,oCACV,oBAAoB"}
1
+ {"version":3,"file":"slider-input-BxURAAmD.d.ts","names":[],"sources":["../src/slider-input/types.ts","../src/slider-input/slider-input.ts"],"mappings":";;;;;;KAIY;KACA;KACA;KACA;KACA;KACA;;;;;;;KAOA;KACA;KACA;;;;;;;UAQK;EACf;EACA,MAAM;;;;;EAKN;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;KAOU;;;;;;;;UASK;WACN;WACA;;WAEA;;WAEA;WACA;WACA;;WAEA;WACA;;WAEA,UAAU;;UAGJ;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,UAAU;;KAGT,wBAAwB,YAAY;KACpC,yBAAyB,YAAY;UAEhC;EACf,OAAO;EACP,QAAQ;;;;;cCZG,2BAA2B;;EAGtC;EAGA;;;;;;EAQA;EAGA;EAGA;EAGA;EAGA;EAGA,WAAW;EAGX,aAAa;EAGb,aAAa;EAGb,aAAa;;;;;;EAQb,cAAc;EAGd,WAAW;EAGX,WAAW;;;;;;;EASX,cAAc;EAGd;EAGA;;;;;;;;;;;;;EAeA;;EAyFS;EAiFT,QACE,aACA;IACE;IACA;IACA;IACA,OAAO;IACP;IACA;;EAgBJ,aAAa,aAAa;EAQ1B,aAAa,aAAa,kBAAkB;EAW5C,WAAW;EAKX,YAAY,oBAAoB;EAIhC,QAAQ,cAAc;EA0nCb,iBAAiB,WAAW,gBAAgB,OAAO;YAoXzC,WAAW,SAAS;EAsE9B;YA2JU,QAAQ,SAAS;EAkB3B;SAiBO,sBAAM;;QAqJhB;YACI;IACR,qBAAqB;;;UAKR;EACf,oBAAoB,gBAAgB,4BAClC,MAAM,GACN,WAAW,MAAM,oBAAoB,OAAO,2BAA2B,aACvE,oBAAoB,sCAEpB,cACA,UAAU,oCACV,oBAAoB"}
@@ -1,2 +1,2 @@
1
- import { t as SliderInputElement } from "./slider-input-BfRUW2ZB.js";
1
+ import { t as SliderInputElement } from "./slider-input-BxURAAmD.js";
2
2
  export { SliderInputElement };
@@ -1,2 +1,2 @@
1
- import { t as SliderInputElement } from "./slider-input-De4eoT11.js";
1
+ import { t as SliderInputElement } from "./slider-input-Bl1hFE89.js";
2
2
  export { SliderInputElement };
package/dist/swipe.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as WheelNudgeConsumerType, t as WheelDirection } from "./wheel-nudge-DGrNzWuE.js";
1
+ import { n as WheelNudgeConsumer, t as WheelDirection } from "./wheel-nudge-By5s_ioH.js";
2
2
  import { CSSResultGroup, LitElement, html } from "lit";
3
3
  //#region src/swipe/swipe.d.ts
4
4
  type SwipeInputDetail = {
@@ -16,7 +16,7 @@ declare global {
16
16
  'ixfx-swipe': SwipeElement;
17
17
  }
18
18
  }
19
- declare const SwipeElement_base: (new (...args: any[]) => WheelNudgeConsumerType<LitElement>) & typeof LitElement;
19
+ declare const SwipeElement_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer);
20
20
  declare class SwipeElement extends SwipeElement_base {
21
21
  #private;
22
22
  barSpacing: number;
package/dist/swipe.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { t as themeFallbacks } from "./fallbacks-DNI9xt0F.js";
2
2
  import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js";
3
3
  import { t as prominenceStyles } from "./prominence-DlFShic3.js";
4
- import { t as WheelNudgeMixin } from "./wheel-nudge-BlSCe_hD.js";
4
+ import { t as WheelNudgeMixin } from "./wheel-nudge-D5rmht3v.js";
5
5
  import { LitElement, css, html, svg } from "lit";
6
6
  import { property } from "lit/decorators.js";
7
7
  //#region src/swipe/swipe.ts
@@ -0,0 +1,31 @@
1
+ import { LitElement } from "lit";
2
+ //#region src/mixins/wheel-nudge.d.ts
3
+ /**
4
+ * Direction of a wheel tick. `+1` for `deltaY < 0` (wheel up/away), `-1` for
5
+ * `deltaY > 0` (wheel down/toward).
6
+ */
7
+ type WheelDirection = 1 | -1;
8
+ /**
9
+ * Abstract surface a consumer of {@link WheelNudgeMixin} may override.
10
+ *
11
+ * `_applyWheelDelta` is called once per handled wheel tick. The consumer is
12
+ * expected to reuse its existing arrow-key step math (typically a shared
13
+ * `_stepByDelta(direction, effectiveStep)` private method) and call it here.
14
+ * The mixin ships a no-op default so `override` in a consumer always has a
15
+ * base member to attach to.
16
+ *
17
+ * `_shouldHandleWheel` may be overridden to restrict when the wheel acts
18
+ * (e.g. editable-number rejects while the user is typing).
19
+ *
20
+ * Both are declared here as methods (not arrow-function properties) so a
21
+ * consumer's `override _applyWheelDelta() {}` stays method-compatible with
22
+ * the base — see the `ts/method-signature-style` override in `eslint.config.js`,
23
+ * which stops the linter rewriting these back to property signatures.
24
+ */
25
+ interface WheelNudgeConsumer {
26
+ _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void;
27
+ _shouldHandleWheel(): boolean;
28
+ }
29
+ //#endregion
30
+ export { WheelNudgeConsumer as n, WheelDirection as t };
31
+ //# sourceMappingURL=wheel-nudge-By5s_ioH.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wheel-nudge-By5s_ioH.d.ts","names":[],"sources":["../src/mixins/wheel-nudge.ts"],"mappings":";;;;;;KASY;;;;;;;;;;;;;;;;;;UAmBK;EACf,iBAAiB,WAAW,gBAAgB,OAAO;EACnD"}
@@ -73,6 +73,11 @@ function WheelNudgeMixin(superClass) {
73
73
  if (root && root.activeElement !== null) return true;
74
74
  return false;
75
75
  }
76
+ /**
77
+ * Apply one wheel tick. No-op by default — consumers override this to run
78
+ * their arrow-key step math (see {@link WheelNudgeConsumer}).
79
+ */
80
+ _applyWheelDelta(_direction, _event) {}
76
81
  }
77
82
  __decorate([property({
78
83
  type: Boolean,
@@ -83,4 +88,4 @@ function WheelNudgeMixin(superClass) {
83
88
  //#endregion
84
89
  export { WheelNudgeMixin as t };
85
90
 
86
- //# sourceMappingURL=wheel-nudge-BlSCe_hD.js.map
91
+ //# sourceMappingURL=wheel-nudge-D5rmht3v.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wheel-nudge-D5rmht3v.js","names":[],"sources":["../src/mixins/wheel-nudge.ts"],"sourcesContent":["import type { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\ntype Constructor<T = object> = new (...args: any[]) => T;\n\n/**\n * Direction of a wheel tick. `+1` for `deltaY < 0` (wheel up/away), `-1` for\n * `deltaY > 0` (wheel down/toward).\n */\nexport type WheelDirection = 1 | -1;\n\n/**\n * Abstract surface a consumer of {@link WheelNudgeMixin} may override.\n *\n * `_applyWheelDelta` is called once per handled wheel tick. The consumer is\n * expected to reuse its existing arrow-key step math (typically a shared\n * `_stepByDelta(direction, effectiveStep)` private method) and call it here.\n * The mixin ships a no-op default so `override` in a consumer always has a\n * base member to attach to.\n *\n * `_shouldHandleWheel` may be overridden to restrict when the wheel acts\n * (e.g. editable-number rejects while the user is typing).\n *\n * Both are declared here as methods (not arrow-function properties) so a\n * consumer's `override _applyWheelDelta() {}` stays method-compatible with\n * the base — see the `ts/method-signature-style` override in `eslint.config.js`,\n * which stops the linter rewriting these back to property signatures.\n */\nexport interface WheelNudgeConsumer {\n _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void;\n _shouldHandleWheel(): boolean;\n}\n\n/**\n * Mixin that adds mousewheel support with an optional `lighttouch` hover mode.\n *\n * Activation rule:\n * - If the host's `disabled` property is truthy → ignore.\n * - Otherwise, handle if EITHER:\n * • `lighttouch` is true AND the pointer is currently over the host, OR\n * • the host (or anything in its shadow tree) currently has focus.\n *\n * Direction convention: `deltaY < 0` (wheel up/away) → +1 step; `deltaY > 0` → -1 step.\n *\n * Consumers must implement `_applyWheelDelta(direction, event)` (see\n * {@link WheelNudgeConsumer}). The mixin calls `event.preventDefault()` only when\n * the activation rule accepts the event, so page scroll is suppressed during\n * interaction without blocking wheel events over empty space.\n *\n * Usage:\n *\n * ```ts\n * class MyInput extends WheelNudgeMixin(LitElement) {\n * protected _applyWheelDelta(direction, event) {\n * const step = resolveAxisStep(this.range, this.stops, this.step, event.shiftKey);\n * this._stepByDelta(direction, step);\n * }\n * }\n * ```\n */\nexport function WheelNudgeMixin<T extends Constructor<LitElement>>(superClass: T): T & Constructor<WheelNudgeConsumer> {\n class WheelNudgeMixinClass extends superClass implements WheelNudgeConsumer {\n /**\n * When true, the wheel adjusts the value simply when the pointer is hovering\n * over the host (no focus required). When false (default), the host must\n * have focus for the wheel to act.\n */\n @property({ type: Boolean, reflect: true })\n lighttouch = false;\n\n /**\n * Imperative hover flag — not Lit-reactive (avoids update churn for what\n * is purely an interaction-time predicate).\n */\n _isHovering = false;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(`pointerenter`, this._onPointerEnter);\n this.addEventListener(`pointerleave`, this._onPointerLeave);\n this.addEventListener(`wheel`, this._onWheel, { passive: false });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(`pointerenter`, this._onPointerEnter);\n this.removeEventListener(`pointerleave`, this._onPointerLeave);\n this.removeEventListener(`wheel`, this._onWheel);\n this._isHovering = false;\n }\n\n _onPointerEnter = (): void => {\n this._isHovering = true;\n };\n\n _onPointerLeave = (): void => {\n this._isHovering = false;\n };\n\n /**\n * Override to restrict when wheel is handled (e.g. editable-number rejects\n * while the user is typing). Default: respect `disabled`, then apply the\n * focus-or-lighttouch rule described on the mixin.\n */\n _shouldHandleWheel(): boolean {\n const anyThis = this as unknown as { disabled?: boolean };\n if (anyThis.disabled)\n return false;\n if (this.lighttouch && this._isHovering)\n return true;\n if (this.matches?.(`:focus, :focus-within`))\n return true;\n const root = this.renderRoot;\n if (root && (root as ShadowRoot).activeElement !== null)\n return true;\n return false;\n }\n\n /**\n * Apply one wheel tick. No-op by default — consumers override this to run\n * their arrow-key step math (see {@link WheelNudgeConsumer}).\n */\n _applyWheelDelta(_direction: WheelDirection, _event: WheelEvent): void {\n // Intentionally empty; overridden by consumers.\n }\n\n _onWheel = (event: WheelEvent): void => {\n if (!this._shouldHandleWheel())\n return;\n event.preventDefault();\n // Some browsers (notably when the user holds Shift) send `deltaY=0`\n // and route the scroll into `deltaX` instead. Use whichever axis\n // actually moved so the direction sign matches the user's intent.\n const delta = event.deltaY !== 0 ? event.deltaY : event.deltaX;\n const direction: WheelDirection = delta < 0 ? 1 : -1;\n this._applyWheelDelta(direction, event);\n };\n }\n return WheelNudgeMixinClass;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,SAAgB,gBAAmD,YAAoD;CACrH,MAAM,6BAA6B,WAAyC;;;GAO7D,KAAA,aAAA;GAMC,KAAA,cAAA;GAiBgB,KAAA,wBAAA;IAC5B,KAAK,cAAc;GACrB;GAE8B,KAAA,wBAAA;IAC5B,KAAK,cAAc;GACrB;GA6BY,KAAA,YAAA,UAA4B;IACtC,IAAI,CAAC,KAAK,mBAAmB,GAC3B;IACF,MAAM,eAAe;IAKrB,MAAM,aADQ,MAAM,WAAW,IAAI,MAAM,SAAS,MAAM,UACd,IAAI,IAAI;IAClD,KAAK,iBAAiB,WAAW,KAAK;GACxC;;EA5DA,oBAAmC;GACjC,MAAM,kBAAkB;GACxB,KAAK,iBAAiB,gBAAgB,KAAK,eAAe;GAC1D,KAAK,iBAAiB,gBAAgB,KAAK,eAAe;GAC1D,KAAK,iBAAiB,SAAS,KAAK,UAAU,EAAE,SAAS,MAAM,CAAC;EAClE;EAEA,uBAAsC;GACpC,MAAM,qBAAqB;GAC3B,KAAK,oBAAoB,gBAAgB,KAAK,eAAe;GAC7D,KAAK,oBAAoB,gBAAgB,KAAK,eAAe;GAC7D,KAAK,oBAAoB,SAAS,KAAK,QAAQ;GAC/C,KAAK,cAAc;EACrB;;;;;;EAeA,qBAA8B;GAE5B,IAAI,KAAQ,UACV,OAAO;GACT,IAAI,KAAK,cAAc,KAAK,aAC1B,OAAO;GACT,IAAI,KAAK,UAAU,uBAAuB,GACxC,OAAO;GACT,MAAM,OAAO,KAAK;GAClB,IAAI,QAAS,KAAoB,kBAAkB,MACjD,OAAO;GACT,OAAO;EACT;;;;;EAMA,iBAAiB,YAA4B,QAA0B,CAEvE;CAaF;CAtEG,WAAA,CAAA,SAAS;EAAE,MAAM;EAAS,SAAS;CAAK,CAAC,CAAA,GAAA,qBAAA,WAAA,cAAA,KAAA,CAAA;CAuE5C,OAAO;AACT"}
package/dist/xy-pad.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { n as WheelNudgeConsumerType, t as WheelDirection } from "./wheel-nudge-DGrNzWuE.js";
1
+ import { n as WheelNudgeConsumer, t as WheelDirection } from "./wheel-nudge-By5s_ioH.js";
2
2
  import { LitElement, PropertyValues, html } from "lit";
3
3
  //#region src/xy-pad/xy-pad.d.ts
4
- declare const XyPad_base: (new (...args: any[]) => WheelNudgeConsumerType<LitElement>) & typeof LitElement;
4
+ declare const XyPad_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer);
5
5
  declare class XyPad extends XyPad_base {
6
6
  static styles: import("lit").CSSResult[];
7
7
  xMin: number;
package/dist/xy-pad.js CHANGED
@@ -2,7 +2,7 @@ import { t as themeFallbacks } from "./fallbacks-DNI9xt0F.js";
2
2
  import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js";
3
3
  import { t as prominenceStyles } from "./prominence-DlFShic3.js";
4
4
  import { t as resolveAxisStep } from "./keyboard-B5xD7Fz-.js";
5
- import { t as WheelNudgeMixin } from "./wheel-nudge-BlSCe_hD.js";
5
+ import { t as WheelNudgeMixin } from "./wheel-nudge-D5rmht3v.js";
6
6
  import { LitElement, css, html } from "lit";
7
7
  import { property } from "lit/decorators.js";
8
8
  //#region src/xy-pad/xy-pad.ts
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ixfx/components",
3
- "version": "0.7.1",
4
- "generated": "2026-09-06T10:36:57.248Z",
3
+ "version": "0.7.2",
4
+ "generated": "2026-09-06T14:04:51.476Z",
5
5
  "components": [
6
6
  {
7
7
  "name": "ac-text",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ixfx/components",
3
3
  "type": "module",
4
- "version": "0.7.1",
4
+ "version": "0.7.2",
5
5
  "packageManager": "pnpm@10.0.0",
6
6
  "description": "Web components for ixfx — Lit-based UI toolkit",
7
7
  "author": "Clint Heyer",
@@ -1 +0,0 @@
1
- {"version":3,"file":"wheel-nudge-BlSCe_hD.js","names":[],"sources":["../src/mixins/wheel-nudge.ts"],"sourcesContent":["import type { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\ntype Constructor<T = object> = new (...args: any[]) => T;\n\n/**\n * Direction of a wheel tick. `+1` for `deltaY < 0` (wheel up/away), `-1` for\n * `deltaY > 0` (wheel down/toward).\n */\nexport type WheelDirection = 1 | -1;\n\n/**\n * Abstract surface a consumer of {@link WheelNudgeMixin} must implement.\n *\n * `_applyWheelDelta` is called once per handled wheel tick. The consumer is\n * expected to reuse its existing arrow-key step math (typically a shared\n * `_stepByDelta(direction, effectiveStep)` private method) and call it here.\n *\n * `_shouldHandleWheel` may be overridden to restrict when the wheel acts\n * (e.g. editable-number rejects while the user is typing).\n */\nexport interface WheelNudgeConsumer {\n _applyWheelDelta: (direction: WheelDirection, event: WheelEvent) => void;\n _shouldHandleWheel: () => boolean;\n}\n\n/**\n * Internal: the surface a {@link WheelNudgeMixin}-decorated class exposes to\n * TypeScript — its own members plus the consumer contract.\n */\nexport type WheelNudgeConsumerType<TBase> = TBase & WheelNudgeConsumer;\ntype WheelNudgeMixinBase<T> = T extends Constructor<infer U> ? U : never;\ntype WheelNudgeMixinResult<T extends Constructor<LitElement>>\n = Constructor<WheelNudgeConsumerType<WheelNudgeMixinBase<T>>> & T;\n\n/**\n * Mixin that adds mousewheel support with an optional `lighttouch` hover mode.\n *\n * Activation rule:\n * - If the host's `disabled` property is truthy → ignore.\n * - Otherwise, handle if EITHER:\n * • `lighttouch` is true AND the pointer is currently over the host, OR\n * • the host (or anything in its shadow tree) currently has focus.\n *\n * Direction convention: `deltaY < 0` (wheel up/away) → +1 step; `deltaY > 0` → -1 step.\n *\n * Consumers must implement `_applyWheelDelta(direction, event)` (see\n * {@link WheelNudgeConsumer}). The mixin calls `event.preventDefault()` only when\n * the activation rule accepts the event, so page scroll is suppressed during\n * interaction without blocking wheel events over empty space.\n *\n * Usage:\n *\n * ```ts\n * class MyInput extends WheelNudgeMixin(LitElement) {\n * protected _applyWheelDelta(direction, event) {\n * const step = resolveAxisStep(this.range, this.stops, this.step, event.shiftKey);\n * this._stepByDelta(direction, step);\n * }\n * }\n * ```\n */\nexport function WheelNudgeMixin<T extends Constructor<LitElement>>(superClass: T): WheelNudgeMixinResult<T> {\n class WheelNudgeMixinClass extends superClass {\n /**\n * When true, the wheel adjusts the value simply when the pointer is hovering\n * over the host (no focus required). When false (default), the host must\n * have focus for the wheel to act.\n */\n @property({ type: Boolean, reflect: true })\n lighttouch = false;\n\n /**\n * Imperative hover flag — not Lit-reactive (avoids update churn for what\n * is purely an interaction-time predicate).\n */\n _isHovering = false;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(`pointerenter`, this._onPointerEnter);\n this.addEventListener(`pointerleave`, this._onPointerLeave);\n this.addEventListener(`wheel`, this._onWheel, { passive: false });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(`pointerenter`, this._onPointerEnter);\n this.removeEventListener(`pointerleave`, this._onPointerLeave);\n this.removeEventListener(`wheel`, this._onWheel);\n this._isHovering = false;\n }\n\n _onPointerEnter = (): void => {\n this._isHovering = true;\n };\n\n _onPointerLeave = (): void => {\n this._isHovering = false;\n };\n\n /**\n * Override to restrict when wheel is handled (e.g. editable-number rejects\n * while the user is typing). Default: respect `disabled`, then apply the\n * focus-or-lighttouch rule described on the mixin.\n */\n _shouldHandleWheel(): boolean {\n const anyThis = this as unknown as { disabled?: boolean };\n if (anyThis.disabled)\n return false;\n if (this.lighttouch && this._isHovering)\n return true;\n if (this.matches?.(`:focus, :focus-within`))\n return true;\n const root = this.renderRoot;\n if (root && (root as ShadowRoot).activeElement !== null)\n return true;\n return false;\n }\n\n _onWheel = (event: WheelEvent): void => {\n if (!this._shouldHandleWheel())\n return;\n event.preventDefault();\n // Some browsers (notably when the user holds Shift) send `deltaY=0`\n // and route the scroll into `deltaX` instead. Use whichever axis\n // actually moved so the direction sign matches the user's intent.\n const delta = event.deltaY !== 0 ? event.deltaY : event.deltaX;\n const direction: WheelDirection = delta < 0 ? 1 : -1;\n (this as unknown as WheelNudgeConsumer)._applyWheelDelta(direction, event);\n };\n }\n return WheelNudgeMixinClass as unknown as WheelNudgeMixinResult<T>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,gBAAmD,YAAyC;CAC1G,MAAM,6BAA6B,WAAW;;;GAO/B,KAAA,aAAA;GAMC,KAAA,cAAA;GAiBgB,KAAA,wBAAA;IAC5B,KAAK,cAAc;GACrB;GAE8B,KAAA,wBAAA;IAC5B,KAAK,cAAc;GACrB;GAqBY,KAAA,YAAA,UAA4B;IACtC,IAAI,CAAC,KAAK,mBAAmB,GAC3B;IACF,MAAM,eAAe;IAKrB,MAAM,aADQ,MAAM,WAAW,IAAI,MAAM,SAAS,MAAM,UACd,IAAI,IAAI;IAClD,KAAwC,iBAAiB,WAAW,KAAK;GAC3E;;EApDA,oBAAmC;GACjC,MAAM,kBAAkB;GACxB,KAAK,iBAAiB,gBAAgB,KAAK,eAAe;GAC1D,KAAK,iBAAiB,gBAAgB,KAAK,eAAe;GAC1D,KAAK,iBAAiB,SAAS,KAAK,UAAU,EAAE,SAAS,MAAM,CAAC;EAClE;EAEA,uBAAsC;GACpC,MAAM,qBAAqB;GAC3B,KAAK,oBAAoB,gBAAgB,KAAK,eAAe;GAC7D,KAAK,oBAAoB,gBAAgB,KAAK,eAAe;GAC7D,KAAK,oBAAoB,SAAS,KAAK,QAAQ;GAC/C,KAAK,cAAc;EACrB;;;;;;EAeA,qBAA8B;GAE5B,IAAI,KAAQ,UACV,OAAO;GACT,IAAI,KAAK,cAAc,KAAK,aAC1B,OAAO;GACT,IAAI,KAAK,UAAU,uBAAuB,GACxC,OAAO;GACT,MAAM,OAAO,KAAK;GAClB,IAAI,QAAS,KAAoB,kBAAkB,MACjD,OAAO;GACT,OAAO;EACT;CAaF;CA9DG,WAAA,CAAA,SAAS;EAAE,MAAM;EAAS,SAAS;CAAK,CAAC,CAAA,GAAA,qBAAA,WAAA,cAAA,KAAA,CAAA;CA+D5C,OAAO;AACT"}
@@ -1,29 +0,0 @@
1
- import { LitElement } from "lit";
2
- //#region src/mixins/wheel-nudge.d.ts
3
- /**
4
- * Direction of a wheel tick. `+1` for `deltaY < 0` (wheel up/away), `-1` for
5
- * `deltaY > 0` (wheel down/toward).
6
- */
7
- type WheelDirection = 1 | -1;
8
- /**
9
- * Abstract surface a consumer of {@link WheelNudgeMixin} must implement.
10
- *
11
- * `_applyWheelDelta` is called once per handled wheel tick. The consumer is
12
- * expected to reuse its existing arrow-key step math (typically a shared
13
- * `_stepByDelta(direction, effectiveStep)` private method) and call it here.
14
- *
15
- * `_shouldHandleWheel` may be overridden to restrict when the wheel acts
16
- * (e.g. editable-number rejects while the user is typing).
17
- */
18
- interface WheelNudgeConsumer {
19
- _applyWheelDelta: (direction: WheelDirection, event: WheelEvent) => void;
20
- _shouldHandleWheel: () => boolean;
21
- }
22
- /**
23
- * Internal: the surface a {@link WheelNudgeMixin}-decorated class exposes to
24
- * TypeScript — its own members plus the consumer contract.
25
- */
26
- type WheelNudgeConsumerType<TBase> = TBase & WheelNudgeConsumer;
27
- //#endregion
28
- export { WheelNudgeConsumerType as n, WheelDirection as t };
29
- //# sourceMappingURL=wheel-nudge-DGrNzWuE.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wheel-nudge-DGrNzWuE.d.ts","names":[],"sources":["../src/mixins/wheel-nudge.ts"],"mappings":";;;;;;KASY;;;;;;;;;;;UAYK;EACf,mBAAmB,WAAW,gBAAgB,OAAO;EACrD;;;;;;KAOU,uBAAuB,SAAS,QAAQ"}