@zag-js/slider 1.24.2 → 1.25.0
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.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +14 -1
- package/dist/index.mjs +13 -2
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -303,5 +303,7 @@ declare const props: (keyof SliderProps)[];
|
|
|
303
303
|
declare const splitProps: <Props extends Partial<SliderProps>>(props: Props) => [Partial<SliderProps>, Omit<Props, keyof SliderProps>];
|
|
304
304
|
declare const thumbProps: (keyof ThumbProps)[];
|
|
305
305
|
declare const splitThumbProps: <Props extends ThumbProps>(props: Props) => [ThumbProps, Omit<Props, keyof ThumbProps>];
|
|
306
|
+
declare const markerProps: "value"[];
|
|
307
|
+
declare const splitMarkerProps: <Props extends MarkerProps>(props: Props) => [MarkerProps, Omit<Props, "value">];
|
|
306
308
|
|
|
307
|
-
export { type SliderApi as Api, type DraggingIndicatorProps, type ElementIds, type FocusChangeDetails, type SliderMachine as Machine, type MarkerProps, type SliderProps as Props, type SliderService as Service, type ThumbProps, type ValueChangeDetails, type ValueTextDetails, anatomy, connect, machine, props, splitProps, splitThumbProps, thumbProps };
|
|
309
|
+
export { type SliderApi as Api, type DraggingIndicatorProps, type ElementIds, type FocusChangeDetails, type SliderMachine as Machine, type MarkerProps, type SliderProps as Props, type SliderService as Service, type ThumbProps, type ValueChangeDetails, type ValueTextDetails, anatomy, connect, machine, markerProps, props, splitMarkerProps, splitProps, splitThumbProps, thumbProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -303,5 +303,7 @@ declare const props: (keyof SliderProps)[];
|
|
|
303
303
|
declare const splitProps: <Props extends Partial<SliderProps>>(props: Props) => [Partial<SliderProps>, Omit<Props, keyof SliderProps>];
|
|
304
304
|
declare const thumbProps: (keyof ThumbProps)[];
|
|
305
305
|
declare const splitThumbProps: <Props extends ThumbProps>(props: Props) => [ThumbProps, Omit<Props, keyof ThumbProps>];
|
|
306
|
+
declare const markerProps: "value"[];
|
|
307
|
+
declare const splitMarkerProps: <Props extends MarkerProps>(props: Props) => [MarkerProps, Omit<Props, "value">];
|
|
306
308
|
|
|
307
|
-
export { type SliderApi as Api, type DraggingIndicatorProps, type ElementIds, type FocusChangeDetails, type SliderMachine as Machine, type MarkerProps, type SliderProps as Props, type SliderService as Service, type ThumbProps, type ValueChangeDetails, type ValueTextDetails, anatomy, connect, machine, props, splitProps, splitThumbProps, thumbProps };
|
|
309
|
+
export { type SliderApi as Api, type DraggingIndicatorProps, type ElementIds, type FocusChangeDetails, type SliderMachine as Machine, type MarkerProps, type SliderProps as Props, type SliderService as Service, type ThumbProps, type ValueChangeDetails, type ValueTextDetails, anatomy, connect, machine, markerProps, props, splitMarkerProps, splitProps, splitThumbProps, thumbProps };
|
package/dist/index.js
CHANGED
|
@@ -620,10 +620,15 @@ var machine = core.createMachine({
|
|
|
620
620
|
([value, min, max]) => value.map((value2) => 100 * utils.getValuePercent(value2, min, max))
|
|
621
621
|
)
|
|
622
622
|
},
|
|
623
|
-
watch({ track, action, context }) {
|
|
623
|
+
watch({ track, action, context, computed, send }) {
|
|
624
624
|
track([() => context.hash("value")], () => {
|
|
625
625
|
action(["syncInputElements", "dispatchChangeEvent"]);
|
|
626
626
|
});
|
|
627
|
+
track([() => computed("isDisabled")], () => {
|
|
628
|
+
if (computed("isDisabled")) {
|
|
629
|
+
send({ type: "BLUR" });
|
|
630
|
+
}
|
|
631
|
+
});
|
|
627
632
|
},
|
|
628
633
|
effects: ["trackFormControlState", "trackThumbSize"],
|
|
629
634
|
on: {
|
|
@@ -699,6 +704,10 @@ var machine = core.createMachine({
|
|
|
699
704
|
},
|
|
700
705
|
POINTER_MOVE: {
|
|
701
706
|
actions: ["setPointerValue"]
|
|
707
|
+
},
|
|
708
|
+
BLUR: {
|
|
709
|
+
target: "idle",
|
|
710
|
+
actions: ["clearFocusedIndex"]
|
|
702
711
|
}
|
|
703
712
|
}
|
|
704
713
|
}
|
|
@@ -854,11 +863,15 @@ var props = types.createProps()([
|
|
|
854
863
|
var splitProps = utils.createSplitProps(props);
|
|
855
864
|
var thumbProps = types.createProps()(["index", "name"]);
|
|
856
865
|
var splitThumbProps = utils.createSplitProps(thumbProps);
|
|
866
|
+
var markerProps = types.createProps()(["value"]);
|
|
867
|
+
var splitMarkerProps = utils.createSplitProps(markerProps);
|
|
857
868
|
|
|
858
869
|
exports.anatomy = anatomy;
|
|
859
870
|
exports.connect = connect;
|
|
860
871
|
exports.machine = machine;
|
|
872
|
+
exports.markerProps = markerProps;
|
|
861
873
|
exports.props = props;
|
|
874
|
+
exports.splitMarkerProps = splitMarkerProps;
|
|
862
875
|
exports.splitProps = splitProps;
|
|
863
876
|
exports.splitThumbProps = splitThumbProps;
|
|
864
877
|
exports.thumbProps = thumbProps;
|
package/dist/index.mjs
CHANGED
|
@@ -618,10 +618,15 @@ var machine = createMachine({
|
|
|
618
618
|
([value, min, max]) => value.map((value2) => 100 * getValuePercent(value2, min, max))
|
|
619
619
|
)
|
|
620
620
|
},
|
|
621
|
-
watch({ track, action, context }) {
|
|
621
|
+
watch({ track, action, context, computed, send }) {
|
|
622
622
|
track([() => context.hash("value")], () => {
|
|
623
623
|
action(["syncInputElements", "dispatchChangeEvent"]);
|
|
624
624
|
});
|
|
625
|
+
track([() => computed("isDisabled")], () => {
|
|
626
|
+
if (computed("isDisabled")) {
|
|
627
|
+
send({ type: "BLUR" });
|
|
628
|
+
}
|
|
629
|
+
});
|
|
625
630
|
},
|
|
626
631
|
effects: ["trackFormControlState", "trackThumbSize"],
|
|
627
632
|
on: {
|
|
@@ -697,6 +702,10 @@ var machine = createMachine({
|
|
|
697
702
|
},
|
|
698
703
|
POINTER_MOVE: {
|
|
699
704
|
actions: ["setPointerValue"]
|
|
705
|
+
},
|
|
706
|
+
BLUR: {
|
|
707
|
+
target: "idle",
|
|
708
|
+
actions: ["clearFocusedIndex"]
|
|
700
709
|
}
|
|
701
710
|
}
|
|
702
711
|
}
|
|
@@ -852,5 +861,7 @@ var props = createProps()([
|
|
|
852
861
|
var splitProps = createSplitProps(props);
|
|
853
862
|
var thumbProps = createProps()(["index", "name"]);
|
|
854
863
|
var splitThumbProps = createSplitProps(thumbProps);
|
|
864
|
+
var markerProps = createProps()(["value"]);
|
|
865
|
+
var splitMarkerProps = createSplitProps(markerProps);
|
|
855
866
|
|
|
856
|
-
export { anatomy, connect, machine, props, splitProps, splitThumbProps, thumbProps };
|
|
867
|
+
export { anatomy, connect, machine, markerProps, props, splitMarkerProps, splitProps, splitThumbProps, thumbProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/slider",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "Core logic for the slider widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@zag-js/anatomy": "1.
|
|
31
|
-
"@zag-js/core": "1.
|
|
32
|
-
"@zag-js/dom-query": "1.
|
|
33
|
-
"@zag-js/utils": "1.
|
|
34
|
-
"@zag-js/types": "1.
|
|
30
|
+
"@zag-js/anatomy": "1.25.0",
|
|
31
|
+
"@zag-js/core": "1.25.0",
|
|
32
|
+
"@zag-js/dom-query": "1.25.0",
|
|
33
|
+
"@zag-js/utils": "1.25.0",
|
|
34
|
+
"@zag-js/types": "1.25.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"clean-package": "2.2.0"
|