@zag-js/pin-input 0.0.0-dev-20230220134212 → 0.0.0-dev-20230221113221
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/{chunk-Y7IZ6OAH.mjs → chunk-33MIXMUC.mjs} +7 -1
- package/dist/{chunk-IGE2OJGQ.mjs → chunk-RRQHVZIR.mjs} +1 -1
- package/dist/{chunk-VZQYAAIE.mjs → chunk-WLNKIOPV.mjs} +1 -1
- package/dist/index.js +7 -1
- package/dist/index.mjs +3 -3
- package/dist/pin-input.connect.js +7 -1
- package/dist/pin-input.connect.mjs +2 -2
- package/dist/pin-input.dom.d.ts +3 -0
- package/dist/pin-input.dom.js +7 -1
- package/dist/pin-input.dom.mjs +1 -1
- package/dist/pin-input.machine.js +7 -1
- package/dist/pin-input.machine.mjs +2 -2
- package/package.json +2 -2
|
@@ -21,7 +21,13 @@ function defineDomHelpers(helpers) {
|
|
|
21
21
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
22
22
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
23
23
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
24
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
24
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
25
|
+
queryById: (ctx, id) => {
|
|
26
|
+
const el = dom2.getById(ctx, id);
|
|
27
|
+
if (!el)
|
|
28
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
29
|
+
return el;
|
|
30
|
+
}
|
|
25
31
|
};
|
|
26
32
|
return {
|
|
27
33
|
...dom2,
|
package/dist/index.js
CHANGED
|
@@ -84,7 +84,13 @@ function defineDomHelpers(helpers) {
|
|
|
84
84
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
85
85
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
86
86
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
87
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
87
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
88
|
+
queryById: (ctx, id) => {
|
|
89
|
+
const el = dom2.getById(ctx, id);
|
|
90
|
+
if (!el)
|
|
91
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
92
|
+
return el;
|
|
93
|
+
}
|
|
88
94
|
};
|
|
89
95
|
return {
|
|
90
96
|
...dom2,
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
connect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RRQHVZIR.mjs";
|
|
4
4
|
import {
|
|
5
5
|
anatomy
|
|
6
6
|
} from "./chunk-BJXKBZJG.mjs";
|
|
7
7
|
import {
|
|
8
8
|
machine
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WLNKIOPV.mjs";
|
|
10
10
|
import "./chunk-NT4W6JYX.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-33MIXMUC.mjs";
|
|
12
12
|
export {
|
|
13
13
|
anatomy,
|
|
14
14
|
connect,
|
|
@@ -61,7 +61,13 @@ function defineDomHelpers(helpers) {
|
|
|
61
61
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
62
62
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
63
63
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
64
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
64
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
65
|
+
queryById: (ctx, id) => {
|
|
66
|
+
const el = dom2.getById(ctx, id);
|
|
67
|
+
if (!el)
|
|
68
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
69
|
+
return el;
|
|
70
|
+
}
|
|
65
71
|
};
|
|
66
72
|
return {
|
|
67
73
|
...dom2,
|
package/dist/pin-input.dom.d.ts
CHANGED
|
@@ -18,6 +18,9 @@ declare const dom: {
|
|
|
18
18
|
getById: <T = HTMLElement>(ctx: {
|
|
19
19
|
getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
|
|
20
20
|
}, id: string) => T | null;
|
|
21
|
+
queryById: <T_1 = HTMLElement>(ctx: {
|
|
22
|
+
getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
|
|
23
|
+
}, id: string) => T_1;
|
|
21
24
|
} & {
|
|
22
25
|
getRootId: (ctx: MachineContext) => string;
|
|
23
26
|
getInputId: (ctx: MachineContext, id: string) => string;
|
package/dist/pin-input.dom.js
CHANGED
|
@@ -44,7 +44,13 @@ function defineDomHelpers(helpers) {
|
|
|
44
44
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
45
45
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
46
46
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
47
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
47
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
48
|
+
queryById: (ctx, id) => {
|
|
49
|
+
const el = dom2.getById(ctx, id);
|
|
50
|
+
if (!el)
|
|
51
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
52
|
+
return el;
|
|
53
|
+
}
|
|
48
54
|
};
|
|
49
55
|
return {
|
|
50
56
|
...dom2,
|
package/dist/pin-input.dom.mjs
CHANGED
|
@@ -61,7 +61,13 @@ function defineDomHelpers(helpers) {
|
|
|
61
61
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
62
62
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
63
63
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
64
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
64
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
65
|
+
queryById: (ctx, id) => {
|
|
66
|
+
const el = dom2.getById(ctx, id);
|
|
67
|
+
if (!el)
|
|
68
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
69
|
+
return el;
|
|
70
|
+
}
|
|
65
71
|
};
|
|
66
72
|
return {
|
|
67
73
|
...dom2,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/pin-input",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230221113221",
|
|
4
4
|
"description": "Core logic for the pin-input widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@zag-js/anatomy": "0.1.4",
|
|
30
|
-
"@zag-js/core": "0.0.0-dev-
|
|
30
|
+
"@zag-js/core": "0.0.0-dev-20230221113221",
|
|
31
31
|
"@zag-js/types": "0.3.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|