@zag-js/number-input 0.0.0-dev-20220604091726 → 0.0.0-dev-20220604123738
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 +20 -11
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +20 -11
- package/dist/index.mjs.map +3 -3
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -31,6 +31,9 @@ function raf(fn) {
|
|
|
31
31
|
globalThis.cancelAnimationFrame(id);
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
+
var isDom = () => typeof window !== "undefined";
|
|
35
|
+
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
36
|
+
var isTouchDevice = isDom() && !!navigator.maxTouchPoints;
|
|
34
37
|
var runIfFn = (v, ...a) => {
|
|
35
38
|
const res = typeof v === "function" ? v(...a) : v;
|
|
36
39
|
return res != null ? res : void 0;
|
|
@@ -38,7 +41,6 @@ var runIfFn = (v, ...a) => {
|
|
|
38
41
|
var noop = () => {
|
|
39
42
|
};
|
|
40
43
|
var pipe = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
|
|
41
|
-
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
42
44
|
function getListenerElements() {
|
|
43
45
|
;
|
|
44
46
|
globalThis.__listenerElements__ = globalThis.__listenerElements__ || /* @__PURE__ */ new Map();
|
|
@@ -296,9 +298,11 @@ function decimalOperation(a, op, b) {
|
|
|
296
298
|
var nf = new Intl.NumberFormat("en-US", { style: "decimal", maximumFractionDigits: 20 });
|
|
297
299
|
|
|
298
300
|
// ../../utilities/rect/dist/index.mjs
|
|
301
|
+
var isDom2 = () => typeof window !== "undefined";
|
|
299
302
|
var isArray = (v) => Array.isArray(v);
|
|
300
303
|
var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
|
|
301
304
|
var hasProp2 = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
305
|
+
var isTouchDevice2 = isDom2() && !!navigator.maxTouchPoints;
|
|
302
306
|
var isTouchEvent = (v) => isObject(v) && hasProp2(v, "touches");
|
|
303
307
|
var fallback = { pageX: 0, pageY: 0, clientX: 0, clientY: 0 };
|
|
304
308
|
function getEventPoint(e, t = "page") {
|
|
@@ -317,18 +321,23 @@ function createNormalizer(fn) {
|
|
|
317
321
|
var normalizeProp = createNormalizer((v) => v);
|
|
318
322
|
|
|
319
323
|
// ../../utilities/core/dist/index.mjs
|
|
320
|
-
var
|
|
321
|
-
|
|
322
|
-
var
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
var
|
|
327
|
-
var
|
|
328
|
-
var
|
|
329
|
-
var
|
|
324
|
+
var isDom3 = () => typeof window !== "undefined";
|
|
325
|
+
function getPlatform() {
|
|
326
|
+
var _a;
|
|
327
|
+
const agent = navigator.userAgentData;
|
|
328
|
+
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
|
|
329
|
+
}
|
|
330
|
+
var pt = (v) => isDom3() && v.test(getPlatform());
|
|
331
|
+
var vn = (v) => isDom3() && v.test(navigator.vendor);
|
|
332
|
+
var isTouchDevice3 = isDom3() && !!navigator.maxTouchPoints;
|
|
333
|
+
var isMac = () => pt(/^Mac/) && !isTouchDevice3;
|
|
334
|
+
var isSafari = () => isApple() && vn(/apple/i);
|
|
335
|
+
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
|
|
336
|
+
var isIos = () => isApple() && !isMac();
|
|
337
|
+
var supportsPointerEvent = () => isDom3() && window.onpointerdown === null;
|
|
330
338
|
var isLeftClick = (v) => v.button === 0;
|
|
331
339
|
var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
|
|
340
|
+
var pipe2 = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
|
|
332
341
|
|
|
333
342
|
// src/number-input.dom.ts
|
|
334
343
|
var dom = {
|