Socket
Socket
Sign inDemoInstall

@zag-js/checkbox

Package Overview
Dependencies
Maintainers
1
Versions
935
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/checkbox - npm Package Compare versions

Comparing version 0.0.0-dev-20220617101836 to 0.0.0-dev-20220625180418

68

dist/index.js

@@ -218,3 +218,3 @@ "use strict";

setIndeterminate(indeterminate) {
send({ type: "SET_INDETERMINATE", indeterminate });
send({ type: "SET_INDETERMINATE", value: indeterminate });
},

@@ -233,3 +233,3 @@ rootProps: normalize.element({

return;
send({ type: "SET_HOVERED", hovered: true });
send({ type: "SET_HOVERED", value: true });
},

@@ -239,3 +239,3 @@ onPointerLeave() {

return;
send({ type: "SET_HOVERED", hovered: false });
send({ type: "SET_HOVERED", value: false });
},

@@ -245,6 +245,5 @@ onPointerDown(event) {

return;
if (isFocused) {
if (isFocused)
event.preventDefault();
}
send({ type: "SET_ACTIVE", active: true });
send({ type: "SET_ACTIVE", value: true });
},

@@ -254,3 +253,3 @@ onPointerUp() {

return;
send({ type: "SET_ACTIVE", active: false });
send({ type: "SET_ACTIVE", value: false });
}

@@ -305,14 +304,14 @@ }),

style: visuallyHiddenStyle,
onChange(event) {
send({ type: "TOGGLE", event });
onChange() {
send({ type: "TOGGLE" });
},
onBlur() {
send({ type: "SET_FOCUSED", focused: false });
send({ type: "SET_FOCUSED", value: false });
},
onFocus() {
send({ type: "SET_FOCUSED", focused: true });
send({ type: "SET_FOCUSED", value: true });
},
onKeyDown(event) {
if (event.key === " ") {
send({ type: "SET_ACTIVE", active: true });
send({ type: "SET_ACTIVE", value: true });
}

@@ -322,3 +321,3 @@ },

if (event.key === " ") {
send({ type: "SET_ACTIVE", active: false });
send({ type: "SET_ACTIVE", value: false });
}

@@ -350,4 +349,3 @@ }

computed: {
isInteractive: (ctx2) => !(ctx2.readonly || ctx2.disabled),
isRtl: (ctx2) => ctx2.dir === "rtl"
isInteractive: (ctx2) => !(ctx2.readonly || ctx2.disabled)
},

@@ -358,10 +356,10 @@ activities: ["trackFormReset", "trackFieldsetDisabled"],

{
guard: and("shouldCheck", "canToggle"),
guard: and("shouldCheck", "isInteractive"),
target: "checked",
actions: ["dispatchChangeEvent"]
actions: "dispatchChangeEvent"
},
{
guard: "canToggle",
guard: "isInteractive",
target: "unchecked",
actions: ["dispatchChangeEvent"]
actions: "dispatchChangeEvent"
}

@@ -395,3 +393,3 @@ ],

target: "unchecked",
guard: "canToggle",
guard: "isInteractive",
actions: ["invokeOnChange"]

@@ -405,3 +403,3 @@ }

target: "checked",
guard: "canToggle",
guard: "isInteractive",
actions: ["invokeOnChange"]

@@ -415,3 +413,3 @@ }

shouldCheck: (_, evt) => evt.checked,
canToggle: (ctx2) => !ctx2.readonly
isInteractive: (ctx2) => ctx2.isInteractive
},

@@ -456,24 +454,18 @@ activities: {

setActive(ctx2, evt) {
ctx2.active = evt.active;
ctx2.active = evt.value;
},
setDisabled(ctx2, evt) {
ctx2.disabled = evt.disabled;
},
setHovered(ctx2, evt) {
ctx2.hovered = evt.hovered;
ctx2.hovered = evt.value;
},
setFocused(ctx2, evt) {
ctx2.focused = evt.focused;
ctx2.focused = evt.value;
},
setIndeterminate(ctx2, evt) {
ctx2.indeterminate = evt.indeterminate;
ctx2.indeterminate = evt.value;
},
setReadOnly(ctx2, evt) {
ctx2.readonly = evt.readonly;
},
syncInputIndeterminate(ctx2) {
const inputEl = dom.getInputEl(ctx2);
if (!inputEl)
const el = dom.getInputEl(ctx2);
if (!el)
return;
inputEl.indeterminate = Boolean(ctx2.indeterminate);
el.indeterminate = Boolean(ctx2.indeterminate);
},

@@ -483,6 +475,6 @@ dispatchChangeEvent(ctx2, evt) {

return;
const inputEl = dom.getInputEl(ctx2);
if (!inputEl)
const el = dom.getInputEl(ctx2);
if (!el)
return;
dispatchInputCheckedEvent(inputEl, evt.checked);
dispatchInputCheckedEvent(el, evt.checked);
},

@@ -489,0 +481,0 @@ removeFocusIfNeeded(ctx2) {

{
"name": "@zag-js/checkbox",
"version": "0.0.0-dev-20220617101836",
"version": "0.0.0-dev-20220625180418",
"description": "Core logic for the checkbox widget implemented as a state machine",

@@ -41,7 +41,9 @@ "keywords": [

"dependencies": {
"@zag-js/core": "0.1.6",
"@zag-js/dom-utils": "0.0.0-dev-20220617101836",
"@zag-js/types": "0.0.0-dev-20220617101836",
"@zag-js/core": "0.0.0-dev-20220625180418",
"@zag-js/types": "0.2.0"
},
"devDependencies": {
"@zag-js/dom-utils": "0.1.5",
"@zag-js/utils": "0.1.2"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc