@zag-js/slider 0.0.0-dev-20220510084727 → 0.0.0-dev-20220514160702
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 +9 -3
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +2 -2
- package/dist/slider.dom.d.ts +1 -0
- package/dist/slider.dom.d.ts.map +1 -1
- package/dist/slider.machine.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -588,6 +588,10 @@ var dom = {
|
|
|
588
588
|
var _a;
|
|
589
589
|
return (_a = ctx.doc) != null ? _a : document;
|
|
590
590
|
},
|
|
591
|
+
getRootNode: (ctx) => {
|
|
592
|
+
var _a;
|
|
593
|
+
return (_a = ctx.rootNode) != null ? _a : dom.getDoc(ctx);
|
|
594
|
+
},
|
|
591
595
|
getRootId: (ctx) => {
|
|
592
596
|
var _a, _b;
|
|
593
597
|
return (_b = (_a = ctx.ids) == null ? void 0 : _a.root) != null ? _b : `slider:${ctx.uid}`;
|
|
@@ -618,9 +622,9 @@ var dom = {
|
|
|
618
622
|
return (_b = (_a = ctx.ids) == null ? void 0 : _a.label) != null ? _b : `slider:${ctx.uid}:label`;
|
|
619
623
|
},
|
|
620
624
|
getMarkerId: (ctx, value) => `slider:${ctx.uid}:marker:${value}`,
|
|
621
|
-
getThumbEl: (ctx) => dom.
|
|
622
|
-
getControlEl: (ctx) => dom.
|
|
623
|
-
getInputEl: (ctx) => dom.
|
|
625
|
+
getThumbEl: (ctx) => dom.getRootNode(ctx).getElementById(dom.getThumbId(ctx)),
|
|
626
|
+
getControlEl: (ctx) => dom.getRootNode(ctx).getElementById(dom.getControlId(ctx)),
|
|
627
|
+
getInputEl: (ctx) => dom.getRootNode(ctx).getElementById(dom.getInputId(ctx)),
|
|
624
628
|
getControlStyle,
|
|
625
629
|
getThumbStyle,
|
|
626
630
|
getRangeStyle,
|
|
@@ -1043,6 +1047,8 @@ function machine(ctx = {}) {
|
|
|
1043
1047
|
setupDocument(ctx2, evt) {
|
|
1044
1048
|
if (evt.doc)
|
|
1045
1049
|
ctx2.doc = (0, import_core.ref)(evt.doc);
|
|
1050
|
+
if (evt.root)
|
|
1051
|
+
ctx2.rootNode = (0, import_core.ref)(evt.root);
|
|
1046
1052
|
ctx2.uid = evt.id;
|
|
1047
1053
|
},
|
|
1048
1054
|
checkValue(ctx2) {
|