@zag-js/number-input 0.0.0-dev-20220709173135 → 0.0.0-dev-20220710102425
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 +2 -1
- package/dist/index.mjs +2 -1
- package/dist/number-input.dom.d.ts +3 -0
- package/dist/number-input.types.d.ts +9 -2
- package/package.json +5 -3
package/dist/index.js
CHANGED
|
@@ -116,7 +116,8 @@ function defineDomHelpers(domUtils) {
|
|
|
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
|
+
getActiveElement: (ctx) => roots.getDoc(ctx).activeElement,
|
|
120
|
+
getById: (ctx, id) => roots.getRootNode(ctx).getElementById(id)
|
|
120
121
|
};
|
|
121
122
|
return __spreadValues2(__spreadValues2({}, roots), domUtils);
|
|
122
123
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -92,7 +92,8 @@ function defineDomHelpers(domUtils) {
|
|
|
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
|
+
getActiveElement: (ctx) => roots.getDoc(ctx).activeElement,
|
|
96
|
+
getById: (ctx, id) => roots.getRootNode(ctx).getElementById(id)
|
|
96
97
|
};
|
|
97
98
|
return __spreadValues2(__spreadValues2({}, roots), domUtils);
|
|
98
99
|
}
|
|
@@ -12,6 +12,9 @@ export declare const dom: {
|
|
|
12
12
|
getActiveElement: (ctx: {
|
|
13
13
|
getRootNode?: () => Node | Document | ShadowRoot;
|
|
14
14
|
}) => HTMLElement;
|
|
15
|
+
getById: (ctx: {
|
|
16
|
+
getRootNode?: () => Node | Document | ShadowRoot;
|
|
17
|
+
}, id: string) => HTMLElement;
|
|
15
18
|
} & {
|
|
16
19
|
getRootId: (ctx: Ctx) => string;
|
|
17
20
|
getInputId: (ctx: Ctx) => string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { StateMachine as S } from "@zag-js/core";
|
|
2
|
-
import type { FormatDecimalOptions } from "@zag-js/number-utils";
|
|
3
2
|
import type { CommonProperties, Context, DirectionProperty, RequiredBy } from "@zag-js/types";
|
|
4
3
|
declare type ValidityState = "rangeUnderflow" | "rangeOverflow";
|
|
5
4
|
declare type ElementIds = Partial<{
|
|
@@ -25,7 +24,7 @@ declare type IntlMessages = {
|
|
|
25
24
|
*/
|
|
26
25
|
decrementLabel: string;
|
|
27
26
|
};
|
|
28
|
-
declare type PublicContext = DirectionProperty & CommonProperties &
|
|
27
|
+
declare type PublicContext = DirectionProperty & CommonProperties & {
|
|
29
28
|
/**
|
|
30
29
|
* The ids of the elements in the number input. Useful for composition.
|
|
31
30
|
*/
|
|
@@ -126,6 +125,14 @@ declare type PublicContext = DirectionProperty & CommonProperties & FormatDecima
|
|
|
126
125
|
value: string;
|
|
127
126
|
valueAsNumber: number;
|
|
128
127
|
}) => void;
|
|
128
|
+
/**
|
|
129
|
+
* The minimum number of fraction digits to use. Possible values are from 0 to 20
|
|
130
|
+
*/
|
|
131
|
+
minFractionDigits?: number;
|
|
132
|
+
/**
|
|
133
|
+
* The maximum number of fraction digits to use. Possible values are from 0 to 20;
|
|
134
|
+
*/
|
|
135
|
+
maxFractionDigits?: number;
|
|
129
136
|
};
|
|
130
137
|
export declare type UserDefinedContext = RequiredBy<PublicContext, "id">;
|
|
131
138
|
declare type ComputedContext = Readonly<{
|
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-20220710102425",
|
|
4
4
|
"description": "Core logic for the number-input widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -30,9 +30,11 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@zag-js/core": "0.1.7",
|
|
33
|
-
"@zag-js/
|
|
33
|
+
"@zag-js/types": "0.0.0-dev-20220710102425"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@zag-js/dom-utils": "0.0.0-dev-20220710102425",
|
|
34
37
|
"@zag-js/number-utils": "0.1.2",
|
|
35
|
-
"@zag-js/types": "0.0.0-dev-20220709173135",
|
|
36
38
|
"@zag-js/utils": "0.1.2"
|
|
37
39
|
},
|
|
38
40
|
"scripts": {
|