Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zag-js/form-utils

Package Overview
Dependencies
Maintainers
1
Versions
710
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/form-utils - npm Package Compare versions

Comparing version 0.0.0-dev-20221117154049 to 0.0.0-dev-20221117183651

7

dist/index.d.ts
declare type DescriptorOptions = {
type: "HTMLInputElement" | "HTMLTextAreaElement" | "HTMLSelectElement";
property: "value" | "checked";
property?: "value" | "checked";
};

@@ -8,5 +8,2 @@ declare function setElementValue(el: HTMLElement, value: string, option: DescriptorOptions): void;

declare function dispatchInputCheckedEvent(el: HTMLElement | null, checked: boolean): void;
declare function trackInputPropertyMutation(el: HTMLInputElement | null, options: DescriptorOptions & {
fn?: (value: string) => void;
}): (() => void) | undefined;

@@ -18,2 +15,2 @@ declare function getClosestForm(el: HTMLElement): HTMLFormElement | null;

export { dispatchInputCheckedEvent, dispatchInputValueEvent, getClosestForm, isNativeDisabled, setElementValue, trackFieldsetDisabled, trackFormReset, trackInputPropertyMutation };
export { dispatchInputCheckedEvent, dispatchInputValueEvent, getClosestForm, isNativeDisabled, setElementValue, trackFieldsetDisabled, trackFormReset };

@@ -29,4 +29,3 @@ "use strict";

trackFieldsetDisabled: () => trackFieldsetDisabled,
trackFormReset: () => trackFormReset,
trackInputPropertyMutation: () => trackInputPropertyMutation
trackFormReset: () => trackFormReset
});

@@ -59,3 +58,3 @@ module.exports = __toCommonJS(src_exports);

var _a;
const { type, property } = options;
const { type, property = "value" } = options;
const proto = getWindow(el)[type].prototype;

@@ -93,22 +92,2 @@ return (_a = Object.getOwnPropertyDescriptor(proto, property)) != null ? _a : {};

}
function trackInputPropertyMutation(el, options) {
const { fn, property, type } = options;
if (!fn || !el)
return;
const { get, set } = getDescriptor(el, { property, type });
let run = true;
Object.defineProperty(el, property, {
get() {
return get == null ? void 0 : get.call(this);
},
set(value) {
if (run)
fn(value);
return set == null ? void 0 : set.call(this, value);
}
});
return () => {
run = false;
};
}

@@ -152,4 +131,3 @@ // src/form.ts

trackFieldsetDisabled,
trackFormReset,
trackInputPropertyMutation
trackFormReset
});
{
"name": "@zag-js/form-utils",
"version": "0.0.0-dev-20221117154049",
"version": "0.0.0-dev-20221117183651",
"description": "",

@@ -22,3 +22,3 @@ "main": "dist/index.js",

"devDependencies": {
"@zag-js/dom-utils": "0.0.0-dev-20221117154049"
"@zag-js/dom-utils": "0.0.0-dev-20221117183651"
},

@@ -25,0 +25,0 @@ "publishConfig": {

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