@nectary/components 3.3.2 → 3.3.3

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/input/index.js CHANGED
@@ -57,6 +57,7 @@ defineCustomElement('sinch-input', class extends NectaryElement {
57
57
  this.#$input.addEventListener('compositionend', this.#onCompositionEnd, options);
58
58
  this.#$input.addEventListener('focus', this.#onInputFocus, options);
59
59
  this.#$input.addEventListener('blur', this.#onInputBlur, options);
60
+ this.#$input.addEventListener('wheel', this.#onWheel, options);
60
61
  this.#$iconSlot.addEventListener('slotchange', this.#onIconSlotChange, options);
61
62
  this.#$leftSlot.addEventListener('slotchange', this.#onLeftSlotChange, options);
62
63
  this.#$rightSlot.addEventListener('slotchange', this.#onRightSlotChange, options);
@@ -66,6 +67,7 @@ defineCustomElement('sinch-input', class extends NectaryElement {
66
67
  this.addEventListener('-copy', this.#onCopyReactHandler, options);
67
68
  this.addEventListener('-cut', this.#onCutReactHandler, options);
68
69
  this.addEventListener('-paste', this.#onPasteReactHandler, options);
70
+ this.addEventListener('-wheel', this.#onWheelReactHandler, options);
69
71
  this.#sizeContext.listen(this.#controller.signal);
70
72
  subscribeContext(this, 'size', this.#onContextSize, this.#controller.signal);
71
73
  this.#onIconSlotChange();
@@ -419,6 +421,9 @@ defineCustomElement('sinch-input', class extends NectaryElement {
419
421
  this.#dispatchChangeEvent(nextValue);
420
422
  }
421
423
  };
424
+ #onWheel = () => {
425
+ this.dispatchEvent(new CustomEvent('-wheel'));
426
+ };
422
427
  #onMaskInputAutofillChange = () => {
423
428
  const nextVal = this.#$input.value;
424
429
  if (this.#maskSymbols !== null) {
@@ -639,4 +644,7 @@ defineCustomElement('sinch-input', class extends NectaryElement {
639
644
  #onPasteReactHandler = e => {
640
645
  getReactEventHandler(this, 'on-paste')?.(e);
641
646
  };
647
+ #onWheelReactHandler = e => {
648
+ getReactEventHandler(this, 'on-wheel')?.(e);
649
+ };
642
650
  });
package/input/types.d.ts CHANGED
@@ -34,7 +34,7 @@ export type TSinchInputElement = HTMLElement & {
34
34
  addEventListener(type: '-focus', listener: (e: CustomEvent<void>) => void): void;
35
35
  /** Blur event */
36
36
  addEventListener(type: '-blur', listener: (e: CustomEvent<void>) => void): void;
37
- /** Blur event */
37
+ /** Wheel event */
38
38
  addEventListener(type: '-wheel', listener: (e: CustomEvent<void>) => void): void;
39
39
  /** Text field type, `text` by default */
40
40
  setAttribute(name: 'type', value: TSinchInputType): void;
@@ -85,4 +85,7 @@ export type TSinchInputReact = TSinchElementReact<TSinchInputElement> & {
85
85
  'on-cut'?: (e: TSinchInputClipboardEvent) => void;
86
86
  'on-copy'?: (e: TSinchInputClipboardEvent) => void;
87
87
  'on-paste'?: (e: TSinchInputClipboardEvent) => void;
88
+ 'on-wheel'?: (e: CustomEvent<void> & {
89
+ target: TSinchInputElement;
90
+ }) => void;
88
91
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nectary/components",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
4
4
  "files": [
5
5
  "**/*/*.css",
6
6
  "**/*/*.json",