@zag-js/radio-group
Advanced tools
Comparing version 0.56.0 to 0.56.1
@@ -69,4 +69,3 @@ "use strict"; | ||
getActiveRadioEl: (ctx) => { | ||
if (!ctx.value) | ||
return; | ||
if (!ctx.value) return; | ||
return dom.getById(ctx, dom.getItemId(ctx, ctx.value)); | ||
@@ -82,4 +81,3 @@ }, | ||
const radioEl = dom.getById(ctx, dom.getItemId(ctx, id)); | ||
if (!radioEl) | ||
return; | ||
if (!radioEl) return; | ||
return dom.resolveRect(dom.getOffsetRect(radioEl)); | ||
@@ -175,16 +173,12 @@ }, | ||
onPointerMove() { | ||
if (itemState.disabled) | ||
return; | ||
if (itemState.hovered) | ||
return; | ||
if (itemState.disabled) return; | ||
if (itemState.hovered) return; | ||
send({ type: "SET_HOVERED", value: props2.value, hovered: true }); | ||
}, | ||
onPointerLeave() { | ||
if (itemState.disabled) | ||
return; | ||
if (itemState.disabled) return; | ||
send({ type: "SET_HOVERED", value: null }); | ||
}, | ||
onPointerDown(event) { | ||
if (itemState.disabled) | ||
return; | ||
if (itemState.disabled) return; | ||
if (itemState.focused && event.pointerType === "mouse") { | ||
@@ -196,4 +190,3 @@ event.preventDefault(); | ||
onPointerUp() { | ||
if (itemState.disabled) | ||
return; | ||
if (itemState.disabled) return; | ||
send({ type: "SET_ACTIVE", value: null }); | ||
@@ -247,4 +240,3 @@ } | ||
onKeyDown(event) { | ||
if (event.defaultPrevented) | ||
return; | ||
if (event.defaultPrevented) return; | ||
if (event.key === " ") { | ||
@@ -255,4 +247,3 @@ send({ type: "SET_ACTIVE", value: props2.value, active: true }); | ||
onKeyUp(event) { | ||
if (event.defaultPrevented) | ||
return; | ||
if (event.defaultPrevented) return; | ||
if (event.key === " ") { | ||
@@ -398,4 +389,3 @@ send({ type: "SET_ACTIVE", value: null }); | ||
ctx2.indicatorCleanup?.(); | ||
if (!dom.getIndicatorEl(ctx2)) | ||
return; | ||
if (!dom.getIndicatorEl(ctx2)) return; | ||
const value = ctx2.value; | ||
@@ -423,4 +413,3 @@ const radioEl = dom.getActiveRadioEl(ctx2); | ||
const checked = inputEl.value === ctx2.value; | ||
if (checked === inputEl.checked) | ||
return; | ||
if (checked === inputEl.checked) return; | ||
(0, import_form_utils.dispatchInputCheckedEvent)(inputEl, { checked }); | ||
@@ -435,4 +424,3 @@ }); | ||
change: (ctx) => { | ||
if (ctx.value == null) | ||
return; | ||
if (ctx.value == null) return; | ||
ctx.onValueChange?.({ value: ctx.value }); | ||
@@ -443,4 +431,3 @@ } | ||
value: (ctx, value) => { | ||
if ((0, import_utils.isEqual)(ctx.value, value)) | ||
return; | ||
if ((0, import_utils.isEqual)(ctx.value, value)) return; | ||
ctx.value = value; | ||
@@ -447,0 +434,0 @@ invoke.change(ctx); |
{ | ||
"name": "@zag-js/radio-group", | ||
"version": "0.56.0", | ||
"version": "0.56.1", | ||
"description": "Core logic for the radio group widget implemented as a state machine", | ||
@@ -31,9 +31,9 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/anatomy": "0.56.0", | ||
"@zag-js/dom-query": "0.56.0", | ||
"@zag-js/element-rect": "0.56.0", | ||
"@zag-js/form-utils": "0.56.0", | ||
"@zag-js/core": "0.56.0", | ||
"@zag-js/utils": "0.56.0", | ||
"@zag-js/types": "0.56.0" | ||
"@zag-js/anatomy": "0.56.1", | ||
"@zag-js/dom-query": "0.56.1", | ||
"@zag-js/element-rect": "0.56.1", | ||
"@zag-js/form-utils": "0.56.1", | ||
"@zag-js/utils": "0.56.1", | ||
"@zag-js/core": "0.56.1", | ||
"@zag-js/types": "0.56.1" | ||
}, | ||
@@ -40,0 +40,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
111460
1610
+ Added@zag-js/anatomy@0.56.1(transitive)
+ Added@zag-js/core@0.56.1(transitive)
+ Added@zag-js/dom-query@0.56.1(transitive)
+ Added@zag-js/element-rect@0.56.1(transitive)
+ Added@zag-js/form-utils@0.56.1(transitive)
+ Added@zag-js/store@0.56.1(transitive)
+ Added@zag-js/types@0.56.1(transitive)
+ Added@zag-js/utils@0.56.1(transitive)
- Removed@zag-js/anatomy@0.56.0(transitive)
- Removed@zag-js/core@0.56.0(transitive)
- Removed@zag-js/dom-query@0.56.0(transitive)
- Removed@zag-js/element-rect@0.56.0(transitive)
- Removed@zag-js/form-utils@0.56.0(transitive)
- Removed@zag-js/store@0.56.0(transitive)
- Removed@zag-js/types@0.56.0(transitive)
- Removed@zag-js/utils@0.56.0(transitive)
Updated@zag-js/anatomy@0.56.1
Updated@zag-js/core@0.56.1
Updated@zag-js/dom-query@0.56.1
Updated@zag-js/element-rect@0.56.1
Updated@zag-js/form-utils@0.56.1
Updated@zag-js/types@0.56.1
Updated@zag-js/utils@0.56.1