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-20220625180418 to 0.0.0-dev-20220626173054

6

dist/checkbox.types.d.ts

@@ -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>;

17

dist/index.js

@@ -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

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