@zag-js/dom-utils
Advanced tools
Comparing version 0.0.0-dev-20221015064943 to 0.0.0-dev-20221015071051
@@ -209,3 +209,3 @@ import { JSX } from '@zag-js/types'; | ||
getById: <T_1 = HTMLElement>(ctx: Ctx, id: string) => T_1 | null; | ||
createEmitter: (ctx: Ctx, ns: string, target: HTMLElement | null) => (evt: string, detail: Record<string, any>, options?: Omit<CustomEventInit<EventInit>, "detail">) => void; | ||
createEmitter: (ctx: Ctx, ns: string, target: HTMLElement | null) => (evt: string, detail: Record<string, any>, options?: EventInit) => void; | ||
} & T; | ||
@@ -212,0 +212,0 @@ declare function contains(parent: HTMLElement | EventTarget | null | undefined, child: HTMLElement | EventTarget | null): boolean; |
@@ -304,6 +304,9 @@ "use strict"; | ||
return (evt, detail, options) => { | ||
const event = new win.CustomEvent(`zag:${ns}:${evt}`, { | ||
const { bubbles = true, cancelable } = options ?? {}; | ||
const eventName = `zag:${ns}:${evt}`; | ||
const event = new win.CustomEvent(eventName, { | ||
detail, | ||
bubbles: (options == null ? void 0 : options.bubbles) || true, | ||
cancelable: options == null ? void 0 : options.cancelable | ||
bubbles, | ||
cancelable, | ||
composed: true | ||
}); | ||
@@ -310,0 +313,0 @@ target.dispatchEvent(event); |
{ | ||
"name": "@zag-js/dom-utils", | ||
"version": "0.0.0-dev-20221015064943", | ||
"version": "0.0.0-dev-20221015071051", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83961
2431