mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-07-01 12:22:15 +02:00
⚡ dispatch
This commit is contained in:
4
dist/dde-with-signals.js
vendored
4
dist/dde-with-signals.js
vendored
@ -594,6 +594,10 @@ function observedAttributes2(instance) {
|
|||||||
|
|
||||||
// src/events.js
|
// src/events.js
|
||||||
function dispatchEvent(name, options, host) {
|
function dispatchEvent(name, options, host) {
|
||||||
|
if (typeof options === "function") {
|
||||||
|
host = options;
|
||||||
|
options = null;
|
||||||
|
}
|
||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
return function dispatch(element, ...d) {
|
return function dispatch(element, ...d) {
|
||||||
if (host) {
|
if (host) {
|
||||||
|
4
dist/dde-with-signals.min.js
vendored
4
dist/dde-with-signals.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/dde.js
vendored
4
dist/dde.js
vendored
@ -571,6 +571,10 @@ function observedAttributes2(instance) {
|
|||||||
|
|
||||||
// src/events.js
|
// src/events.js
|
||||||
function dispatchEvent(name, options, host) {
|
function dispatchEvent(name, options, host) {
|
||||||
|
if (typeof options === "function") {
|
||||||
|
host = options;
|
||||||
|
options = null;
|
||||||
|
}
|
||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
return function dispatch(element, ...d) {
|
return function dispatch(element, ...d) {
|
||||||
if (host) {
|
if (host) {
|
||||||
|
4
dist/dde.min.js
vendored
4
dist/dde.min.js
vendored
File diff suppressed because one or more lines are too long
5
dist/esm-with-signals.d.min.ts
vendored
5
dist/esm-with-signals.d.min.ts
vendored
@ -54,7 +54,8 @@ type IsReadonly<T, K extends keyof T> =
|
|||||||
type ElementAttributes<T extends SupportedElement>= Partial<{
|
type ElementAttributes<T extends SupportedElement>= Partial<{
|
||||||
[K in keyof _fromElsInterfaces<T>]:
|
[K in keyof _fromElsInterfaces<T>]:
|
||||||
_fromElsInterfaces<T>[K] extends ((...p: any[])=> any)
|
_fromElsInterfaces<T>[K] extends ((...p: any[])=> any)
|
||||||
? _fromElsInterfaces<T>[K] | ((...p: Parameters<_fromElsInterfaces<T>[K]>)=> ddeSignal<ReturnType<_fromElsInterfaces<T>[K]>>)
|
? _fromElsInterfaces<T>[K] | ((...p: Parameters<_fromElsInterfaces<T>[K]>)=>
|
||||||
|
ddeSignal<ReturnType<_fromElsInterfaces<T>[K]>>)
|
||||||
: (IsReadonly<_fromElsInterfaces<T>, K> extends false
|
: (IsReadonly<_fromElsInterfaces<T>, K> extends false
|
||||||
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
||||||
: ddeStringable)
|
: ddeStringable)
|
||||||
@ -146,6 +147,8 @@ export function simulateSlots<EL extends SupportedElement | DocumentFragment>(
|
|||||||
body: EL,
|
body: EL,
|
||||||
): EL
|
): EL
|
||||||
|
|
||||||
|
export function dispatchEvent(name: keyof DocumentEventMap | string, element: SupportedElement):
|
||||||
|
(data?: any)=> void;
|
||||||
export function dispatchEvent(name: keyof DocumentEventMap | string, options?: EventInit):
|
export function dispatchEvent(name: keyof DocumentEventMap | string, options?: EventInit):
|
||||||
(element: SupportedElement, data?: any)=> void;
|
(element: SupportedElement, data?: any)=> void;
|
||||||
export function dispatchEvent(
|
export function dispatchEvent(
|
||||||
|
5
dist/esm-with-signals.d.ts
vendored
5
dist/esm-with-signals.d.ts
vendored
@ -54,7 +54,8 @@ type IsReadonly<T, K extends keyof T> =
|
|||||||
type ElementAttributes<T extends SupportedElement>= Partial<{
|
type ElementAttributes<T extends SupportedElement>= Partial<{
|
||||||
[K in keyof _fromElsInterfaces<T>]:
|
[K in keyof _fromElsInterfaces<T>]:
|
||||||
_fromElsInterfaces<T>[K] extends ((...p: any[])=> any)
|
_fromElsInterfaces<T>[K] extends ((...p: any[])=> any)
|
||||||
? _fromElsInterfaces<T>[K] | ((...p: Parameters<_fromElsInterfaces<T>[K]>)=> ddeSignal<ReturnType<_fromElsInterfaces<T>[K]>>)
|
? _fromElsInterfaces<T>[K] | ((...p: Parameters<_fromElsInterfaces<T>[K]>)=>
|
||||||
|
ddeSignal<ReturnType<_fromElsInterfaces<T>[K]>>)
|
||||||
: (IsReadonly<_fromElsInterfaces<T>, K> extends false
|
: (IsReadonly<_fromElsInterfaces<T>, K> extends false
|
||||||
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
||||||
: ddeStringable)
|
: ddeStringable)
|
||||||
@ -146,6 +147,8 @@ export function simulateSlots<EL extends SupportedElement | DocumentFragment>(
|
|||||||
body: EL,
|
body: EL,
|
||||||
): EL
|
): EL
|
||||||
|
|
||||||
|
export function dispatchEvent(name: keyof DocumentEventMap | string, element: SupportedElement):
|
||||||
|
(data?: any)=> void;
|
||||||
export function dispatchEvent(name: keyof DocumentEventMap | string, options?: EventInit):
|
export function dispatchEvent(name: keyof DocumentEventMap | string, options?: EventInit):
|
||||||
(element: SupportedElement, data?: any)=> void;
|
(element: SupportedElement, data?: any)=> void;
|
||||||
export function dispatchEvent(
|
export function dispatchEvent(
|
||||||
|
4
dist/esm-with-signals.js
vendored
4
dist/esm-with-signals.js
vendored
@ -592,6 +592,10 @@ function observedAttributes2(instance) {
|
|||||||
|
|
||||||
// src/events.js
|
// src/events.js
|
||||||
function dispatchEvent(name, options, host) {
|
function dispatchEvent(name, options, host) {
|
||||||
|
if (typeof options === "function") {
|
||||||
|
host = options;
|
||||||
|
options = null;
|
||||||
|
}
|
||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
return function dispatch(element, ...d) {
|
return function dispatch(element, ...d) {
|
||||||
if (host) {
|
if (host) {
|
||||||
|
4
dist/esm-with-signals.min.js
vendored
4
dist/esm-with-signals.min.js
vendored
File diff suppressed because one or more lines are too long
5
dist/esm.d.min.ts
vendored
5
dist/esm.d.min.ts
vendored
@ -54,7 +54,8 @@ type IsReadonly<T, K extends keyof T> =
|
|||||||
type ElementAttributes<T extends SupportedElement>= Partial<{
|
type ElementAttributes<T extends SupportedElement>= Partial<{
|
||||||
[K in keyof _fromElsInterfaces<T>]:
|
[K in keyof _fromElsInterfaces<T>]:
|
||||||
_fromElsInterfaces<T>[K] extends ((...p: any[])=> any)
|
_fromElsInterfaces<T>[K] extends ((...p: any[])=> any)
|
||||||
? _fromElsInterfaces<T>[K] | ((...p: Parameters<_fromElsInterfaces<T>[K]>)=> ddeSignal<ReturnType<_fromElsInterfaces<T>[K]>>)
|
? _fromElsInterfaces<T>[K] | ((...p: Parameters<_fromElsInterfaces<T>[K]>)=>
|
||||||
|
ddeSignal<ReturnType<_fromElsInterfaces<T>[K]>>)
|
||||||
: (IsReadonly<_fromElsInterfaces<T>, K> extends false
|
: (IsReadonly<_fromElsInterfaces<T>, K> extends false
|
||||||
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
||||||
: ddeStringable)
|
: ddeStringable)
|
||||||
@ -146,6 +147,8 @@ export function simulateSlots<EL extends SupportedElement | DocumentFragment>(
|
|||||||
body: EL,
|
body: EL,
|
||||||
): EL
|
): EL
|
||||||
|
|
||||||
|
export function dispatchEvent(name: keyof DocumentEventMap | string, element: SupportedElement):
|
||||||
|
(data?: any)=> void;
|
||||||
export function dispatchEvent(name: keyof DocumentEventMap | string, options?: EventInit):
|
export function dispatchEvent(name: keyof DocumentEventMap | string, options?: EventInit):
|
||||||
(element: SupportedElement, data?: any)=> void;
|
(element: SupportedElement, data?: any)=> void;
|
||||||
export function dispatchEvent(
|
export function dispatchEvent(
|
||||||
|
5
dist/esm.d.ts
vendored
5
dist/esm.d.ts
vendored
@ -54,7 +54,8 @@ type IsReadonly<T, K extends keyof T> =
|
|||||||
type ElementAttributes<T extends SupportedElement>= Partial<{
|
type ElementAttributes<T extends SupportedElement>= Partial<{
|
||||||
[K in keyof _fromElsInterfaces<T>]:
|
[K in keyof _fromElsInterfaces<T>]:
|
||||||
_fromElsInterfaces<T>[K] extends ((...p: any[])=> any)
|
_fromElsInterfaces<T>[K] extends ((...p: any[])=> any)
|
||||||
? _fromElsInterfaces<T>[K] | ((...p: Parameters<_fromElsInterfaces<T>[K]>)=> ddeSignal<ReturnType<_fromElsInterfaces<T>[K]>>)
|
? _fromElsInterfaces<T>[K] | ((...p: Parameters<_fromElsInterfaces<T>[K]>)=>
|
||||||
|
ddeSignal<ReturnType<_fromElsInterfaces<T>[K]>>)
|
||||||
: (IsReadonly<_fromElsInterfaces<T>, K> extends false
|
: (IsReadonly<_fromElsInterfaces<T>, K> extends false
|
||||||
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
||||||
: ddeStringable)
|
: ddeStringable)
|
||||||
@ -146,6 +147,8 @@ export function simulateSlots<EL extends SupportedElement | DocumentFragment>(
|
|||||||
body: EL,
|
body: EL,
|
||||||
): EL
|
): EL
|
||||||
|
|
||||||
|
export function dispatchEvent(name: keyof DocumentEventMap | string, element: SupportedElement):
|
||||||
|
(data?: any)=> void;
|
||||||
export function dispatchEvent(name: keyof DocumentEventMap | string, options?: EventInit):
|
export function dispatchEvent(name: keyof DocumentEventMap | string, options?: EventInit):
|
||||||
(element: SupportedElement, data?: any)=> void;
|
(element: SupportedElement, data?: any)=> void;
|
||||||
export function dispatchEvent(
|
export function dispatchEvent(
|
||||||
|
4
dist/esm.js
vendored
4
dist/esm.js
vendored
@ -569,6 +569,10 @@ function observedAttributes2(instance) {
|
|||||||
|
|
||||||
// src/events.js
|
// src/events.js
|
||||||
function dispatchEvent(name, options, host) {
|
function dispatchEvent(name, options, host) {
|
||||||
|
if (typeof options === "function") {
|
||||||
|
host = options;
|
||||||
|
options = null;
|
||||||
|
}
|
||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
return function dispatch(element, ...d) {
|
return function dispatch(element, ...d) {
|
||||||
if (host) {
|
if (host) {
|
||||||
|
2
dist/esm.min.js
vendored
2
dist/esm.min.js
vendored
File diff suppressed because one or more lines are too long
2
index.d.ts
vendored
2
index.d.ts
vendored
@ -147,6 +147,8 @@ export function simulateSlots<EL extends SupportedElement | DocumentFragment>(
|
|||||||
body: EL,
|
body: EL,
|
||||||
): EL
|
): EL
|
||||||
|
|
||||||
|
export function dispatchEvent(name: keyof DocumentEventMap | string, element: SupportedElement):
|
||||||
|
(data?: any)=> void;
|
||||||
export function dispatchEvent(name: keyof DocumentEventMap | string, options?: EventInit):
|
export function dispatchEvent(name: keyof DocumentEventMap | string, options?: EventInit):
|
||||||
(element: SupportedElement, data?: any)=> void;
|
(element: SupportedElement, data?: any)=> void;
|
||||||
export function dispatchEvent(
|
export function dispatchEvent(
|
||||||
|
@ -11,6 +11,7 @@ import { oAssign, onAbort } from './helpers.js';
|
|||||||
* @returns {Function} Function that dispatches the event
|
* @returns {Function} Function that dispatches the event
|
||||||
*/
|
*/
|
||||||
export function dispatchEvent(name, options, host){
|
export function dispatchEvent(name, options, host){
|
||||||
|
if(typeof options==="function"){ host= options; options= null; }
|
||||||
if(!options) options= {};
|
if(!options) options= {};
|
||||||
return function dispatch(element, ...d){
|
return function dispatch(element, ...d){
|
||||||
if(host){
|
if(host){
|
||||||
|
Reference in New Issue
Block a user