@zag-js/rating
Advanced tools
Comparing version 0.0.0-dev-20221118145623 to 0.0.0-dev-20221121143513
@@ -240,2 +240,17 @@ "use strict"; | ||
} | ||
function trackFormControl(el, options) { | ||
if (!el) | ||
return; | ||
const { onFieldsetDisabled, onFormReset } = options; | ||
const cleanups = [ | ||
trackFormReset(el, onFormReset), | ||
trackFieldsetDisabled(el, (disabled) => { | ||
if (disabled) | ||
onFieldsetDisabled(); | ||
}) | ||
]; | ||
return () => { | ||
cleanups.forEach((cleanup) => cleanup == null ? void 0 : cleanup()); | ||
}; | ||
} | ||
@@ -464,3 +479,3 @@ // src/rating.dom.ts | ||
}, | ||
activities: ["trackFormReset", "trackFieldsetDisabled"], | ||
activities: ["trackFormControlState"], | ||
states: { | ||
@@ -549,13 +564,11 @@ unknown: { | ||
activities: { | ||
trackFieldsetDisabled(ctx2) { | ||
return trackFieldsetDisabled(dom.getRootEl(ctx2), (disabled) => { | ||
if (disabled) { | ||
ctx2.disabled = disabled; | ||
trackFormControlState(ctx2) { | ||
return trackFormControl(dom.getInputEl(ctx2), { | ||
onFieldsetDisabled() { | ||
ctx2.disabled = true; | ||
}, | ||
onFormReset() { | ||
ctx2.value = ctx2.initialValue; | ||
} | ||
}); | ||
}, | ||
trackFormReset(ctx2) { | ||
return trackFormReset(dom.getInputEl(ctx2), () => { | ||
ctx2.value = ctx2.initialValue; | ||
}); | ||
} | ||
@@ -562,0 +575,0 @@ }, |
{ | ||
"name": "@zag-js/rating", | ||
"version": "0.0.0-dev-20221118145623", | ||
"version": "0.0.0-dev-20221121143513", | ||
"description": "Core logic for the rating widget implemented as a state machine", | ||
@@ -32,9 +32,9 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@zag-js/core": "0.0.0-dev-20221118145623", | ||
"@zag-js/types": "0.0.0-dev-20221118145623" | ||
"@zag-js/core": "0.2.2", | ||
"@zag-js/types": "0.3.1" | ||
}, | ||
"devDependencies": { | ||
"@zag-js/dom-utils": "0.0.0-dev-20221118145623", | ||
"@zag-js/form-utils": "0.0.0-dev-20221118145623", | ||
"@zag-js/utils": "0.0.0-dev-20221118145623" | ||
"@zag-js/dom-utils": "0.2.1", | ||
"@zag-js/form-utils": "0.0.0-dev-20221121143513", | ||
"@zag-js/utils": "0.3.1" | ||
}, | ||
@@ -41,0 +41,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44195
1346
+ Added@zag-js/core@0.2.2(transitive)
+ Added@zag-js/types@0.3.1(transitive)
- Removed@zag-js/core@0.0.0-dev-20221118145623(transitive)
- Removed@zag-js/types@0.0.0-dev-20221118145623(transitive)
Updated@zag-js/core@0.2.2
Updated@zag-js/types@0.3.1