@zag-js/checkbox
Advanced tools
Comparing version 0.0.0-dev-20220625180418 to 0.0.0-dev-20220626173054
@@ -76,7 +76,2 @@ import type { StateMachine as S } from "@zag-js/core"; | ||
readonly isInteractive: boolean; | ||
/** | ||
* @computed | ||
* Whether the writing direction is RTL | ||
*/ | ||
readonly isRtl: boolean; | ||
}>; | ||
@@ -103,2 +98,3 @@ declare type PrivateContext = Context<{ | ||
value: "unknown" | "checked" | "unchecked"; | ||
tags: "checked" | "unchecked"; | ||
}; | ||
@@ -105,0 +101,0 @@ export declare type State = S.State<MachineContext, MachineState>; |
@@ -118,5 +118,3 @@ "use strict"; | ||
const { type, property } = options; | ||
const win = getOwnerWindow(el); | ||
const _type = type === "input" ? "HTMLInputElement" : "HTMLTextAreaElement"; | ||
const proto = win[_type].prototype; | ||
const proto = getOwnerWindow(el)[type].prototype; | ||
return (_a = Object.getOwnPropertyDescriptor(proto, property)) != null ? _a : {}; | ||
@@ -129,3 +127,3 @@ } | ||
return; | ||
const desc = getDescriptor(el, { type: "input", property: "checked" }); | ||
const desc = getDescriptor(el, { type: "HTMLInputElement", property: "checked" }); | ||
(_a = desc.set) == null ? void 0 : _a.call(el, checked); | ||
@@ -207,3 +205,3 @@ const event = new win.Event("click", { bubbles: true }); | ||
const trulyDisabled = isDisabled && !isFocusable; | ||
const stateView = state.value && state.value !== "unknown" ? state.value : "unchecked"; | ||
const stateView = state.hasTag("checked") ? "checked" : "unchecked"; | ||
const view = state.context.indeterminate ? "mixed" : stateView; | ||
@@ -289,3 +287,3 @@ return { | ||
required: isRequired, | ||
checked: isChecked, | ||
defaultChecked: isChecked, | ||
disabled: trulyDisabled, | ||
@@ -342,4 +340,4 @@ "data-disabled": dataAttr(isDisabled), | ||
watch: { | ||
indeterminate: ["syncInputIndeterminate"], | ||
disabled: ["removeFocusIfNeeded"] | ||
indeterminate: "syncInputIndeterminate", | ||
disabled: "removeFocusIfNeeded" | ||
}, | ||
@@ -378,2 +376,3 @@ computed: { | ||
unknown: { | ||
tags: ["unchecked"], | ||
on: { | ||
@@ -387,2 +386,3 @@ SETUP: { | ||
checked: { | ||
tags: ["checked"], | ||
on: { | ||
@@ -397,2 +397,3 @@ TOGGLE: { | ||
unchecked: { | ||
tags: ["unchecked"], | ||
on: { | ||
@@ -399,0 +400,0 @@ TOGGLE: { |
{ | ||
"name": "@zag-js/checkbox", | ||
"version": "0.0.0-dev-20220625180418", | ||
"version": "0.0.0-dev-20220626173054", | ||
"description": "Core logic for the checkbox widget implemented as a state machine", | ||
@@ -41,9 +41,9 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/core": "0.0.0-dev-20220625180418", | ||
"@zag-js/core": "0.0.0-dev-20220626173054", | ||
"@zag-js/types": "0.2.0" | ||
}, | ||
"devDependencies": { | ||
"@zag-js/dom-utils": "0.1.5", | ||
"@zag-js/dom-utils": "0.0.0-dev-20220626173054", | ||
"@zag-js/utils": "0.1.2" | ||
} | ||
} |
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
34622
1057
+ Added@zag-js/core@0.0.0-dev-20220626173054(transitive)
+ Added@zag-js/store@0.0.0-dev-20220626173054(transitive)
- Removed@zag-js/core@0.0.0-dev-20220625180418(transitive)
- Removed@zag-js/store@0.0.0-dev-20220625180418(transitive)