@zag-js/number-input 0.0.0-dev-20220709124657 → 0.0.0-dev-20220709173135
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 +4 -3
- package/dist/index.mjs +4 -3
- package/dist/number-input.dom.d.ts +3 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -105,7 +105,7 @@ function getDocument(el) {
|
|
|
105
105
|
return el;
|
|
106
106
|
return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function defineDomHelpers(domUtils) {
|
|
109
109
|
const roots = {
|
|
110
110
|
getRootNode: (ctx) => {
|
|
111
111
|
var _a, _b;
|
|
@@ -115,7 +115,8 @@ function withRootHelpers(domUtils) {
|
|
|
115
115
|
getWin: (ctx) => {
|
|
116
116
|
var _a;
|
|
117
117
|
return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window;
|
|
118
|
-
}
|
|
118
|
+
},
|
|
119
|
+
getActiveElement: (ctx) => roots.getDoc(ctx).activeElement
|
|
119
120
|
};
|
|
120
121
|
return __spreadValues2(__spreadValues2({}, roots), domUtils);
|
|
121
122
|
}
|
|
@@ -285,7 +286,7 @@ function decimalOperation(a, op, b) {
|
|
|
285
286
|
var nf = new Intl.NumberFormat("en-US", { style: "decimal", maximumFractionDigits: 20 });
|
|
286
287
|
|
|
287
288
|
// src/number-input.dom.ts
|
|
288
|
-
var dom =
|
|
289
|
+
var dom = defineDomHelpers({
|
|
289
290
|
getRootId: (ctx) => {
|
|
290
291
|
var _a, _b;
|
|
291
292
|
return (_b = (_a = ctx.ids) == null ? void 0 : _a.root) != null ? _b : `number-input:${ctx.id}`;
|
package/dist/index.mjs
CHANGED
|
@@ -81,7 +81,7 @@ function getDocument(el) {
|
|
|
81
81
|
return el;
|
|
82
82
|
return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function defineDomHelpers(domUtils) {
|
|
85
85
|
const roots = {
|
|
86
86
|
getRootNode: (ctx) => {
|
|
87
87
|
var _a, _b;
|
|
@@ -91,7 +91,8 @@ function withRootHelpers(domUtils) {
|
|
|
91
91
|
getWin: (ctx) => {
|
|
92
92
|
var _a;
|
|
93
93
|
return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window;
|
|
94
|
-
}
|
|
94
|
+
},
|
|
95
|
+
getActiveElement: (ctx) => roots.getDoc(ctx).activeElement
|
|
95
96
|
};
|
|
96
97
|
return __spreadValues2(__spreadValues2({}, roots), domUtils);
|
|
97
98
|
}
|
|
@@ -261,7 +262,7 @@ function decimalOperation(a, op, b) {
|
|
|
261
262
|
var nf = new Intl.NumberFormat("en-US", { style: "decimal", maximumFractionDigits: 20 });
|
|
262
263
|
|
|
263
264
|
// src/number-input.dom.ts
|
|
264
|
-
var dom =
|
|
265
|
+
var dom = defineDomHelpers({
|
|
265
266
|
getRootId: (ctx) => {
|
|
266
267
|
var _a, _b;
|
|
267
268
|
return (_b = (_a = ctx.ids) == null ? void 0 : _a.root) != null ? _b : `number-input:${ctx.id}`;
|
|
@@ -9,6 +9,9 @@ export declare const dom: {
|
|
|
9
9
|
getWin: (ctx: {
|
|
10
10
|
getRootNode?: () => Node | Document | ShadowRoot;
|
|
11
11
|
}) => Window & typeof globalThis;
|
|
12
|
+
getActiveElement: (ctx: {
|
|
13
|
+
getRootNode?: () => Node | Document | ShadowRoot;
|
|
14
|
+
}) => HTMLElement;
|
|
12
15
|
} & {
|
|
13
16
|
getRootId: (ctx: Ctx) => string;
|
|
14
17
|
getInputId: (ctx: Ctx) => string;
|
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-20220709173135",
|
|
4
4
|
"description": "Core logic for the number-input widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@zag-js/core": "0.1.7",
|
|
33
|
-
"@zag-js/dom-utils": "0.0.0-dev-
|
|
33
|
+
"@zag-js/dom-utils": "0.0.0-dev-20220709173135",
|
|
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-20220709173135",
|
|
36
36
|
"@zag-js/utils": "0.1.2"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|