@zag-js/slider 0.0.0-dev-20230217074947 → 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-5XVLG734.mjs → chunk-E2QSQCX6.mjs} +1 -1
- package/dist/{chunk-55KEN77D.mjs → chunk-VPBBCP3T.mjs} +7 -1
- package/dist/{chunk-X363CZYV.mjs → chunk-YMQNUMTS.mjs} +1 -1
- package/dist/index.js +7 -1
- package/dist/index.mjs +3 -3
- package/dist/slider.connect.js +7 -1
- package/dist/slider.connect.mjs +2 -2
- package/dist/slider.dom.d.ts +3 -0
- package/dist/slider.dom.js +7 -1
- package/dist/slider.dom.mjs +1 -1
- package/dist/slider.machine.js +7 -1
- package/dist/slider.machine.mjs +2 -2
- package/package.json +2 -2
|
@@ -25,7 +25,13 @@ function defineDomHelpers(helpers) {
|
|
|
25
25
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
26
26
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
27
27
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
28
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
28
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
29
|
+
queryById: (ctx, id) => {
|
|
30
|
+
const el = dom2.getById(ctx, id);
|
|
31
|
+
if (!el)
|
|
32
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
33
|
+
return el;
|
|
34
|
+
}
|
|
29
35
|
};
|
|
30
36
|
return {
|
|
31
37
|
...dom2,
|
package/dist/index.js
CHANGED
|
@@ -108,7 +108,13 @@ function defineDomHelpers(helpers) {
|
|
|
108
108
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
109
109
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
110
110
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
111
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
111
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
112
|
+
queryById: (ctx, id) => {
|
|
113
|
+
const el = dom2.getById(ctx, id);
|
|
114
|
+
if (!el)
|
|
115
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
116
|
+
return el;
|
|
117
|
+
}
|
|
112
118
|
};
|
|
113
119
|
return {
|
|
114
120
|
...dom2,
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
connect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YMQNUMTS.mjs";
|
|
4
4
|
import {
|
|
5
5
|
anatomy
|
|
6
6
|
} from "./chunk-3Y7IIPR5.mjs";
|
|
7
7
|
import {
|
|
8
8
|
machine
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-E2QSQCX6.mjs";
|
|
10
10
|
import "./chunk-3UP6QL6A.mjs";
|
|
11
11
|
import {
|
|
12
12
|
dom
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VPBBCP3T.mjs";
|
|
14
14
|
import "./chunk-IJAAAKZQ.mjs";
|
|
15
15
|
import "./chunk-YGFSMEUO.mjs";
|
|
16
16
|
export {
|
package/dist/slider.connect.js
CHANGED
|
@@ -57,7 +57,13 @@ function defineDomHelpers(helpers) {
|
|
|
57
57
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
58
58
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
59
59
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
60
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
60
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
61
|
+
queryById: (ctx, id) => {
|
|
62
|
+
const el = dom2.getById(ctx, id);
|
|
63
|
+
if (!el)
|
|
64
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
65
|
+
return el;
|
|
66
|
+
}
|
|
61
67
|
};
|
|
62
68
|
return {
|
|
63
69
|
...dom2,
|
package/dist/slider.connect.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
connect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YMQNUMTS.mjs";
|
|
4
4
|
import "./chunk-3Y7IIPR5.mjs";
|
|
5
5
|
import "./chunk-3UP6QL6A.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-VPBBCP3T.mjs";
|
|
7
7
|
import "./chunk-IJAAAKZQ.mjs";
|
|
8
8
|
export {
|
|
9
9
|
connect
|
package/dist/slider.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
|
getThumbId: (ctx: MachineContext) => string;
|
package/dist/slider.dom.js
CHANGED
|
@@ -47,7 +47,13 @@ function defineDomHelpers(helpers) {
|
|
|
47
47
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
48
48
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
49
49
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
50
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
50
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
51
|
+
queryById: (ctx, id) => {
|
|
52
|
+
const el = dom2.getById(ctx, id);
|
|
53
|
+
if (!el)
|
|
54
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
55
|
+
return el;
|
|
56
|
+
}
|
|
51
57
|
};
|
|
52
58
|
return {
|
|
53
59
|
...dom2,
|
package/dist/slider.dom.mjs
CHANGED
package/dist/slider.machine.js
CHANGED
|
@@ -85,7 +85,13 @@ function defineDomHelpers(helpers) {
|
|
|
85
85
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
86
86
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
87
87
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
88
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
88
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
89
|
+
queryById: (ctx, id) => {
|
|
90
|
+
const el = dom2.getById(ctx, id);
|
|
91
|
+
if (!el)
|
|
92
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
93
|
+
return el;
|
|
94
|
+
}
|
|
89
95
|
};
|
|
90
96
|
return {
|
|
91
97
|
...dom2,
|
package/dist/slider.machine.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/slider",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230221113221",
|
|
4
4
|
"description": "Core logic for the slider 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/element-size": "0.3.2",
|
|
32
32
|
"@zag-js/numeric-range": "0.1.1",
|
|
33
33
|
"@zag-js/types": "0.3.4"
|