@zag-js/dom-query
Advanced tools
Comparing version 0.82.2 to 1.0.0
@@ -64,4 +64,4 @@ import { JSX, Nullable, MaybeFn } from '@zag-js/types'; | ||
declare function setElementValue(el: HTMLElementWithValue, value: string, property?: "value" | "checked"): void; | ||
declare function setElementChecked(el: HTMLInputElement, checked: boolean): void; | ||
declare function setElementValue(el: HTMLElementWithValue | null, value: string, property?: "value" | "checked"): void; | ||
declare function setElementChecked(el: HTMLInputElement | null, checked: boolean): void; | ||
interface InputValueEventOptions { | ||
@@ -256,3 +256,3 @@ value: string | number; | ||
declare function nextTick(fn: VoidFunction): () => void; | ||
declare function raf(fn: VoidFunction): () => void; | ||
declare function raf(fn: VoidFunction | (() => VoidFunction)): () => void; | ||
declare function queueBeforeEvent(el: EventTarget, type: string, cb: () => void): () => void; | ||
@@ -259,0 +259,0 @@ |
@@ -289,2 +289,3 @@ 'use strict'; | ||
function setElementValue(el, value, property = "value") { | ||
if (!el) return; | ||
const type = getElementType(el); | ||
@@ -298,2 +299,3 @@ if (type) { | ||
function setElementChecked(el, checked) { | ||
if (!el) return; | ||
const descriptor = getDescriptor(el, { type: "HTMLInputElement", property: "checked" }); | ||
@@ -475,5 +477,9 @@ descriptor.set?.call(el, checked); | ||
function raf(fn) { | ||
const id = globalThis.requestAnimationFrame(fn); | ||
let cleanup; | ||
const id = globalThis.requestAnimationFrame(() => { | ||
cleanup = fn(); | ||
}); | ||
return () => { | ||
globalThis.cancelAnimationFrame(id); | ||
cleanup?.(); | ||
}; | ||
@@ -480,0 +486,0 @@ } |
{ | ||
"name": "@zag-js/dom-query", | ||
"version": "0.82.2", | ||
"version": "1.0.0", | ||
"description": "The dom helper library for zag.js machines", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/types": "0.82.2" | ||
"@zag-js/types": "1.0.0" | ||
}, | ||
@@ -38,5 +38,10 @@ "module": "dist/index.mjs", | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js" | ||
"import": { | ||
"types": "./dist/index.d.mts", | ||
"default": "./dist/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
} | ||
}, | ||
@@ -43,0 +48,0 @@ "./package.json": "./package.json" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
118588
2583
0
+ Added@zag-js/types@1.0.0(transitive)
- Removed@zag-js/types@0.82.2(transitive)
Updated@zag-js/types@1.0.0