Socket
Socket
Sign inDemoInstall

@zag-js/dom-utils

Package Overview
Dependencies
Maintainers
1
Versions
227
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.1.1 to 0.1.2

dist/event-query.d.ts

2

dist/attrs.d.ts
declare type Booleanish = boolean | "true" | "false";
export declare const dataAttr: (guard: boolean | undefined) => Booleanish;
export declare const ariaAttr: (guard: boolean | undefined) => boolean;
export declare const ariaAttr: (guard: boolean | undefined) => string;
export declare const matchAttr: (el: Element) => {

@@ -5,0 +5,0 @@ get: (key: string) => string;

@@ -8,2 +8,3 @@ export * from "./attrs";

export * from "./dispatch-event";
export * from "./event-query";
export * from "./focus-event";

@@ -24,2 +25,3 @@ export * from "./focusable";

export * from "./text-selection";
export * from "./typeahead";
export * from "./visibility-event";

@@ -29,3 +31,2 @@ export * from "./visual-viewport";

export * from "./wait";
export * from "./typeahead";
//# sourceMappingURL=index.d.ts.map

@@ -69,2 +69,3 @@ var __create = Object.create;

isHidden: () => isHidden,
isKeyboardClick: () => isKeyboardClick,
isScrollParent: () => isScrollParent,

@@ -108,3 +109,3 @@ isTabbable: () => isTabbable,

var ariaAttr = (guard) => {
return guard ? true : void 0;
return guard ? "true" : void 0;
};

@@ -464,6 +465,2 @@ var matchAttr = (el) => {

};
function getNativeEvent(event) {
var _a;
return (_a = event.nativeEvent) != null ? _a : event;
}
function isElementEditable(el) {

@@ -666,2 +663,11 @@ if (el == null)

// src/event-query.ts
function isKeyboardClick(e) {
return e.detail === 0 || e.clientX === 0 && e.clientY === 0;
}
function getNativeEvent(event) {
var _a;
return (_a = event.nativeEvent) != null ? _a : event;
}
// src/focus-event.ts

@@ -1084,2 +1090,32 @@ function validateBlur(event, opts) {

// src/typeahead.ts
function findByTypeahead(_items, options) {
const { state: state2, activeId, key, timeout = 350 } = options;
const search = state2.keysSoFar + key;
const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
const query2 = isRepeated ? search[0] : search;
let items = _items.slice();
const next = findByText(items, query2, activeId);
function cleanup() {
clearTimeout(state2.timer);
state2.timer = -1;
}
function update(value) {
state2.keysSoFar = value;
cleanup();
if (value !== "") {
state2.timer = +setTimeout(() => {
update("");
cleanup();
}, timeout);
}
}
update(search);
return next;
}
findByTypeahead.defaultOptions = {
keysSoFar: "",
timer: -1
};
// src/visibility-event.ts

@@ -1137,32 +1173,2 @@ function trackDocumentVisibility(_doc, callback) {

}
// src/typeahead.ts
function findByTypeahead(_items, options) {
const { state: state2, activeId, key, timeout = 350 } = options;
const search = state2.keysSoFar + key;
const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
const query2 = isRepeated ? search[0] : search;
let items = _items.slice();
const next = findByText(items, query2, activeId);
function cleanup() {
clearTimeout(state2.timer);
state2.timer = -1;
}
function update(value) {
state2.keysSoFar = value;
cleanup();
if (value !== "") {
state2.timer = +setTimeout(() => {
update("");
cleanup();
}, timeout);
}
}
update(search);
return next;
}
findByTypeahead.defaultOptions = {
keysSoFar: "",
timer: -1
};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,1 @@

/// <reference types="react" />
export declare function getOwnerDocument(el: HTMLElement | Window): Document;

@@ -13,5 +12,4 @@ export declare function getOwnerWindow(el: HTMLElement): Window & typeof globalThis;

export declare const isDisabled: (el: HTMLElement | null) => boolean;
export declare function getNativeEvent<E>(event: E): React.ChangeEvent<any> extends E ? InputEvent : E extends React.SyntheticEvent<any, infer T> ? T : never;
export declare function isElementEditable(el: HTMLElement | null): boolean;
export {};
//# sourceMappingURL=query.d.ts.map
{
"name": "@zag-js/dom-utils",
"version": "0.1.1",
"version": "0.1.2",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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