@zag-js/number-input 1.15.4 → 1.15.6
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/dist/index.js +3 -1
- package/dist/index.mjs +4 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -277,7 +277,8 @@ function connect(service, normalize) {
|
|
|
277
277
|
tabIndex: -1,
|
|
278
278
|
"aria-controls": getInputId(scope),
|
|
279
279
|
onPointerDown(event) {
|
|
280
|
-
if (isDecrementDisabled
|
|
280
|
+
if (isDecrementDisabled) return;
|
|
281
|
+
if (!domQuery.isLeftClick(event)) return;
|
|
281
282
|
send({ type: "TRIGGER.PRESS_DOWN", hint: "decrement", pointerType: event.pointerType });
|
|
282
283
|
if (event.pointerType === "mouse") {
|
|
283
284
|
event.preventDefault();
|
|
@@ -333,6 +334,7 @@ function connect(service, normalize) {
|
|
|
333
334
|
role: "presentation",
|
|
334
335
|
onMouseDown(event) {
|
|
335
336
|
if (disabled) return;
|
|
337
|
+
if (!domQuery.isLeftClick(event)) return;
|
|
336
338
|
const point = domQuery.getEventPoint(event);
|
|
337
339
|
const win = domQuery.getWindow(event.currentTarget);
|
|
338
340
|
const dpr = win.devicePixelRatio;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createAnatomy } from '@zag-js/anatomy';
|
|
2
|
-
import { raf, setElementValue, addDomEvent, isSafari, requestPointerLock, observeAttributes, trackFormControl, MAX_Z_INDEX, dataAttr, getEventPoint, getWindow,
|
|
2
|
+
import { raf, setElementValue, addDomEvent, isSafari, requestPointerLock, observeAttributes, trackFormControl, MAX_Z_INDEX, dataAttr, isLeftClick, getEventPoint, getWindow, ariaAttr, isComposingEvent, getEventStep, isModifierKey } from '@zag-js/dom-query';
|
|
3
3
|
import { isValueAtMax, isValueAtMin, clampValue, decrementValue, incrementValue, callAll, isValueWithinRange, createSplitProps, roundToDpr, wrap } from '@zag-js/utils';
|
|
4
4
|
import { setup, memo } from '@zag-js/core';
|
|
5
5
|
import { NumberParser } from '@internationalized/number';
|
|
@@ -275,7 +275,8 @@ function connect(service, normalize) {
|
|
|
275
275
|
tabIndex: -1,
|
|
276
276
|
"aria-controls": getInputId(scope),
|
|
277
277
|
onPointerDown(event) {
|
|
278
|
-
if (isDecrementDisabled
|
|
278
|
+
if (isDecrementDisabled) return;
|
|
279
|
+
if (!isLeftClick(event)) return;
|
|
279
280
|
send({ type: "TRIGGER.PRESS_DOWN", hint: "decrement", pointerType: event.pointerType });
|
|
280
281
|
if (event.pointerType === "mouse") {
|
|
281
282
|
event.preventDefault();
|
|
@@ -331,6 +332,7 @@ function connect(service, normalize) {
|
|
|
331
332
|
role: "presentation",
|
|
332
333
|
onMouseDown(event) {
|
|
333
334
|
if (disabled) return;
|
|
335
|
+
if (!isLeftClick(event)) return;
|
|
334
336
|
const point = getEventPoint(event);
|
|
335
337
|
const win = getWindow(event.currentTarget);
|
|
336
338
|
const dpr = win.devicePixelRatio;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/number-input",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.6",
|
|
4
4
|
"description": "Core logic for the number-input widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@internationalized/number": "3.6.3",
|
|
30
|
-
"@zag-js/anatomy": "1.15.
|
|
31
|
-
"@zag-js/core": "1.15.
|
|
32
|
-
"@zag-js/dom-query": "1.15.
|
|
33
|
-
"@zag-js/types": "1.15.
|
|
34
|
-
"@zag-js/utils": "1.15.
|
|
30
|
+
"@zag-js/anatomy": "1.15.6",
|
|
31
|
+
"@zag-js/core": "1.15.6",
|
|
32
|
+
"@zag-js/dom-query": "1.15.6",
|
|
33
|
+
"@zag-js/types": "1.15.6",
|
|
34
|
+
"@zag-js/utils": "1.15.6"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"clean-package": "2.2.0"
|