@zag-js/number-input 0.0.0-dev-20220704151659 → 0.0.0-dev-20220704163406
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 +38 -36
- package/dist/index.mjs +38 -36
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -50,10 +50,39 @@ var ariaAttr = (guard) => {
|
|
|
50
50
|
return guard ? "true" : void 0;
|
|
51
51
|
};
|
|
52
52
|
var MAX_Z_INDEX = 2147483647;
|
|
53
|
+
var runIfFn = (v, ...a) => {
|
|
54
|
+
const res = typeof v === "function" ? v(...a) : v;
|
|
55
|
+
return res != null ? res : void 0;
|
|
56
|
+
};
|
|
57
|
+
var callAll = (...fns) => (...a) => {
|
|
58
|
+
fns.forEach(function(fn) {
|
|
59
|
+
fn == null ? void 0 : fn(...a);
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
var isArray = (v) => Array.isArray(v);
|
|
63
|
+
var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
|
|
64
|
+
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
65
|
+
var isDom = () => typeof window !== "undefined";
|
|
66
|
+
function getPlatform() {
|
|
67
|
+
var _a;
|
|
68
|
+
const agent = navigator.userAgentData;
|
|
69
|
+
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
|
|
70
|
+
}
|
|
71
|
+
var pt = (v) => isDom() && v.test(getPlatform());
|
|
72
|
+
var vn = (v) => isDom() && v.test(navigator.vendor);
|
|
73
|
+
var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;
|
|
74
|
+
var isMac = () => pt(/^Mac/) && !isTouchDevice;
|
|
75
|
+
var isSafari = () => isApple() && vn(/apple/i);
|
|
76
|
+
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
|
|
77
|
+
var isIos = () => isApple() && !isMac();
|
|
53
78
|
function getNativeEvent(e) {
|
|
54
79
|
var _a;
|
|
55
80
|
return (_a = e.nativeEvent) != null ? _a : e;
|
|
56
81
|
}
|
|
82
|
+
var supportsPointerEvent = () => isDom() && window.onpointerdown === null;
|
|
83
|
+
var isTouchEvent = (v) => isObject(v) && hasProp(v, "touches");
|
|
84
|
+
var isLeftClick = (v) => v.button === 0;
|
|
85
|
+
var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
|
|
57
86
|
function observeAttributes(node, attributes, fn) {
|
|
58
87
|
if (!node)
|
|
59
88
|
return;
|
|
@@ -69,19 +98,6 @@ function observeAttributes(node, attributes, fn) {
|
|
|
69
98
|
obs.observe(node, { attributes: true, attributeFilter: attrs });
|
|
70
99
|
return () => obs.disconnect();
|
|
71
100
|
}
|
|
72
|
-
var isArray = (v) => Array.isArray(v);
|
|
73
|
-
var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
|
|
74
|
-
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
75
|
-
var isTouchEvent = (v) => isObject(v) && hasProp(v, "touches");
|
|
76
|
-
var runIfFn = (v, ...a) => {
|
|
77
|
-
const res = typeof v === "function" ? v(...a) : v;
|
|
78
|
-
return res != null ? res : void 0;
|
|
79
|
-
};
|
|
80
|
-
var callAll = (...fns) => (...a) => {
|
|
81
|
-
fns.forEach(function(fn) {
|
|
82
|
-
fn == null ? void 0 : fn(...a);
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
101
|
var fallback = {
|
|
86
102
|
pageX: 0,
|
|
87
103
|
pageY: 0,
|
|
@@ -224,29 +240,6 @@ function decimalOperation(a, op, b) {
|
|
|
224
240
|
}
|
|
225
241
|
var nf = new Intl.NumberFormat("en-US", { style: "decimal", maximumFractionDigits: 20 });
|
|
226
242
|
|
|
227
|
-
// ../../utilities/core/dist/index.mjs
|
|
228
|
-
var isDom = () => typeof window !== "undefined";
|
|
229
|
-
function getPlatform() {
|
|
230
|
-
var _a;
|
|
231
|
-
const agent = navigator.userAgentData;
|
|
232
|
-
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
|
|
233
|
-
}
|
|
234
|
-
var pt = (v) => isDom() && v.test(getPlatform());
|
|
235
|
-
var vn = (v) => isDom() && v.test(navigator.vendor);
|
|
236
|
-
var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;
|
|
237
|
-
var isMac = () => pt(/^Mac/) && !isTouchDevice;
|
|
238
|
-
var isSafari = () => isApple() && vn(/apple/i);
|
|
239
|
-
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
|
|
240
|
-
var isIos = () => isApple() && !isMac();
|
|
241
|
-
var supportsPointerEvent = () => isDom() && window.onpointerdown === null;
|
|
242
|
-
var isLeftClick = (v) => v.button === 0;
|
|
243
|
-
var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
|
|
244
|
-
var callAll2 = (...fns) => (...a) => {
|
|
245
|
-
fns.forEach(function(fn) {
|
|
246
|
-
fn == null ? void 0 : fn(...a);
|
|
247
|
-
});
|
|
248
|
-
};
|
|
249
|
-
|
|
250
243
|
// src/number-input.dom.ts
|
|
251
244
|
var dom = {
|
|
252
245
|
getDoc: (ctx) => {
|
|
@@ -568,6 +561,15 @@ function connect(state, send, normalize) {
|
|
|
568
561
|
|
|
569
562
|
// src/number-input.machine.ts
|
|
570
563
|
var import_core = require("@zag-js/core");
|
|
564
|
+
|
|
565
|
+
// ../../utilities/core/dist/index.mjs
|
|
566
|
+
var callAll2 = (...fns) => (...a) => {
|
|
567
|
+
fns.forEach(function(fn) {
|
|
568
|
+
fn == null ? void 0 : fn(...a);
|
|
569
|
+
});
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
// src/number-input.machine.ts
|
|
571
573
|
var { not, and } = import_core.guards;
|
|
572
574
|
function machine(ctx = {}) {
|
|
573
575
|
return (0, import_core.createMachine)({
|
package/dist/index.mjs
CHANGED
|
@@ -26,10 +26,39 @@ var ariaAttr = (guard) => {
|
|
|
26
26
|
return guard ? "true" : void 0;
|
|
27
27
|
};
|
|
28
28
|
var MAX_Z_INDEX = 2147483647;
|
|
29
|
+
var runIfFn = (v, ...a) => {
|
|
30
|
+
const res = typeof v === "function" ? v(...a) : v;
|
|
31
|
+
return res != null ? res : void 0;
|
|
32
|
+
};
|
|
33
|
+
var callAll = (...fns) => (...a) => {
|
|
34
|
+
fns.forEach(function(fn) {
|
|
35
|
+
fn == null ? void 0 : fn(...a);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var isArray = (v) => Array.isArray(v);
|
|
39
|
+
var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
|
|
40
|
+
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
41
|
+
var isDom = () => typeof window !== "undefined";
|
|
42
|
+
function getPlatform() {
|
|
43
|
+
var _a;
|
|
44
|
+
const agent = navigator.userAgentData;
|
|
45
|
+
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
|
|
46
|
+
}
|
|
47
|
+
var pt = (v) => isDom() && v.test(getPlatform());
|
|
48
|
+
var vn = (v) => isDom() && v.test(navigator.vendor);
|
|
49
|
+
var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;
|
|
50
|
+
var isMac = () => pt(/^Mac/) && !isTouchDevice;
|
|
51
|
+
var isSafari = () => isApple() && vn(/apple/i);
|
|
52
|
+
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
|
|
53
|
+
var isIos = () => isApple() && !isMac();
|
|
29
54
|
function getNativeEvent(e) {
|
|
30
55
|
var _a;
|
|
31
56
|
return (_a = e.nativeEvent) != null ? _a : e;
|
|
32
57
|
}
|
|
58
|
+
var supportsPointerEvent = () => isDom() && window.onpointerdown === null;
|
|
59
|
+
var isTouchEvent = (v) => isObject(v) && hasProp(v, "touches");
|
|
60
|
+
var isLeftClick = (v) => v.button === 0;
|
|
61
|
+
var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
|
|
33
62
|
function observeAttributes(node, attributes, fn) {
|
|
34
63
|
if (!node)
|
|
35
64
|
return;
|
|
@@ -45,19 +74,6 @@ function observeAttributes(node, attributes, fn) {
|
|
|
45
74
|
obs.observe(node, { attributes: true, attributeFilter: attrs });
|
|
46
75
|
return () => obs.disconnect();
|
|
47
76
|
}
|
|
48
|
-
var isArray = (v) => Array.isArray(v);
|
|
49
|
-
var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
|
|
50
|
-
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
51
|
-
var isTouchEvent = (v) => isObject(v) && hasProp(v, "touches");
|
|
52
|
-
var runIfFn = (v, ...a) => {
|
|
53
|
-
const res = typeof v === "function" ? v(...a) : v;
|
|
54
|
-
return res != null ? res : void 0;
|
|
55
|
-
};
|
|
56
|
-
var callAll = (...fns) => (...a) => {
|
|
57
|
-
fns.forEach(function(fn) {
|
|
58
|
-
fn == null ? void 0 : fn(...a);
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
77
|
var fallback = {
|
|
62
78
|
pageX: 0,
|
|
63
79
|
pageY: 0,
|
|
@@ -200,29 +216,6 @@ function decimalOperation(a, op, b) {
|
|
|
200
216
|
}
|
|
201
217
|
var nf = new Intl.NumberFormat("en-US", { style: "decimal", maximumFractionDigits: 20 });
|
|
202
218
|
|
|
203
|
-
// ../../utilities/core/dist/index.mjs
|
|
204
|
-
var isDom = () => typeof window !== "undefined";
|
|
205
|
-
function getPlatform() {
|
|
206
|
-
var _a;
|
|
207
|
-
const agent = navigator.userAgentData;
|
|
208
|
-
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
|
|
209
|
-
}
|
|
210
|
-
var pt = (v) => isDom() && v.test(getPlatform());
|
|
211
|
-
var vn = (v) => isDom() && v.test(navigator.vendor);
|
|
212
|
-
var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;
|
|
213
|
-
var isMac = () => pt(/^Mac/) && !isTouchDevice;
|
|
214
|
-
var isSafari = () => isApple() && vn(/apple/i);
|
|
215
|
-
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
|
|
216
|
-
var isIos = () => isApple() && !isMac();
|
|
217
|
-
var supportsPointerEvent = () => isDom() && window.onpointerdown === null;
|
|
218
|
-
var isLeftClick = (v) => v.button === 0;
|
|
219
|
-
var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
|
|
220
|
-
var callAll2 = (...fns) => (...a) => {
|
|
221
|
-
fns.forEach(function(fn) {
|
|
222
|
-
fn == null ? void 0 : fn(...a);
|
|
223
|
-
});
|
|
224
|
-
};
|
|
225
|
-
|
|
226
219
|
// src/number-input.dom.ts
|
|
227
220
|
var dom = {
|
|
228
221
|
getDoc: (ctx) => {
|
|
@@ -544,6 +537,15 @@ function connect(state, send, normalize) {
|
|
|
544
537
|
|
|
545
538
|
// src/number-input.machine.ts
|
|
546
539
|
import { choose, createMachine, guards, ref } from "@zag-js/core";
|
|
540
|
+
|
|
541
|
+
// ../../utilities/core/dist/index.mjs
|
|
542
|
+
var callAll2 = (...fns) => (...a) => {
|
|
543
|
+
fns.forEach(function(fn) {
|
|
544
|
+
fn == null ? void 0 : fn(...a);
|
|
545
|
+
});
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
// src/number-input.machine.ts
|
|
547
549
|
var { not, and } = guards;
|
|
548
550
|
function machine(ctx = {}) {
|
|
549
551
|
return createMachine({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/number-input",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20220704163406",
|
|
4
4
|
"description": "Core logic for the number-input widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zag-js/core": "0.0.0-dev-
|
|
33
|
-
"@zag-js/dom-utils": "0.0.0-dev-
|
|
32
|
+
"@zag-js/core": "0.0.0-dev-20220704163406",
|
|
33
|
+
"@zag-js/dom-utils": "0.0.0-dev-20220704163406",
|
|
34
34
|
"@zag-js/number-utils": "0.1.2",
|
|
35
|
-
"@zag-js/types": "0.0.0-dev-
|
|
35
|
+
"@zag-js/types": "0.0.0-dev-20220704163406",
|
|
36
36
|
"@zag-js/utils": "0.1.2"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|