mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-24 01:29:36 +01:00
💥 simulateSlots
This commit is contained in:
parent
6a293d75a6
commit
fb02635d24
29
dist/dde-with-signals.js
vendored
29
dist/dde-with-signals.js
vendored
File diff suppressed because one or more lines are too long
27
dist/dde.js
vendored
27
dist/dde.js
vendored
File diff suppressed because one or more lines are too long
587
dist/esm-with-signals.d.ts
vendored
587
dist/esm-with-signals.d.ts
vendored
@ -46,7 +46,7 @@ export function classListDeclarative<El extends SupportedElement>(element: El, c
|
|||||||
export function assign<El extends SupportedElement>(element: El, ...attrs_array: Partial<ElementAttributes<El>>[]): El
|
export function assign<El extends SupportedElement>(element: El, ...attrs_array: Partial<ElementAttributes<El>>[]): El
|
||||||
export function assignAttribute<El extends SupportedElement, ATT extends keyof ElementAttributes<El>>(element: El, attr: ATT, value: ElementAttributes<El>[ATT]): ElementAttributes<El>[ATT]
|
export function assignAttribute<El extends SupportedElement, ATT extends keyof ElementAttributes<El>>(element: El, attr: ATT, value: ElementAttributes<El>[ATT]): ElementAttributes<El>[ATT]
|
||||||
|
|
||||||
type ExtendedHTMLElementTagNameMap= HTMLElementTagNameMap & CustomElementTagNameMap & ddePublicElementTagNameMap
|
type ExtendedHTMLElementTagNameMap= ddeHTMLElementTagNameMap & CustomElementTagNameMap & ddePublicElementTagNameMap
|
||||||
export function el<TAG extends keyof ExtendedHTMLElementTagNameMap>(
|
export function el<TAG extends keyof ExtendedHTMLElementTagNameMap>(
|
||||||
tag_name: TAG,
|
tag_name: TAG,
|
||||||
attrs?: string | Partial<ElementAttributes<ExtendedHTMLElementTagNameMap[TAG]>>,
|
attrs?: string | Partial<ElementAttributes<ExtendedHTMLElementTagNameMap[TAG]>>,
|
||||||
@ -54,7 +54,7 @@ export function el<TAG extends keyof ExtendedHTMLElementTagNameMap>(
|
|||||||
): ExtendedHTMLElementTagNameMap[TAG]
|
): ExtendedHTMLElementTagNameMap[TAG]
|
||||||
export function el<T>(
|
export function el<T>(
|
||||||
tag_name?: "<>",
|
tag_name?: "<>",
|
||||||
): DocumentFragment
|
): ddeDocumentFragment
|
||||||
|
|
||||||
export function el<
|
export function el<
|
||||||
A extends ddeComponentAttributes,
|
A extends ddeComponentAttributes,
|
||||||
@ -68,22 +68,22 @@ export function el(
|
|||||||
tag_name: string,
|
tag_name: string,
|
||||||
attrs?: string | Record<string, any>,
|
attrs?: string | Record<string, any>,
|
||||||
...addons: ddeElementAddon<HTMLElement>[]
|
...addons: ddeElementAddon<HTMLElement>[]
|
||||||
): HTMLElement
|
): ddeHTMLElement
|
||||||
|
|
||||||
export function elNS(
|
export function elNS(
|
||||||
namespace: "http://www.w3.org/2000/svg"
|
namespace: "http://www.w3.org/2000/svg"
|
||||||
): <TAG extends keyof SVGElementTagNameMap, KEYS extends keyof SVGElementTagNameMap[TAG] & { d: string }>(
|
): <TAG, EL extends ( TAG extends keyof ddeSVGElementTagNameMap ? ddeSVGElementTagNameMap[TAG] : ddeSVGElement ), KEYS extends keyof EL & { d: string }>(
|
||||||
tag_name: TAG,
|
tag_name: TAG,
|
||||||
attrs?: string | Partial<{ [key in KEYS]: SVGElementTagNameMap[TAG][key] | string | number | boolean }>,
|
attrs?: string | Partial<{ [key in KEYS]: EL[key] | string | number | boolean }>,
|
||||||
...addons: ddeElementAddon<SVGElementTagNameMap[TAG]>[]
|
...addons: ddeElementAddon<EL>[]
|
||||||
)=> SVGElementTagNameMap[TAG]
|
)=> EL
|
||||||
export function elNS(
|
export function elNS(
|
||||||
namespace: "http://www.w3.org/1998/Math/MathML"
|
namespace: "http://www.w3.org/1998/Math/MathML"
|
||||||
): <TAG extends keyof MathMLElementTagNameMap, KEYS extends keyof MathMLElementTagNameMap[TAG] & { d: string }>(
|
): <TAG extends keyof MathMLElementTagNameMap, KEYS extends keyof MathMLElementTagNameMap[TAG] & { d: string }>(
|
||||||
tag_name: TAG,
|
tag_name: TAG,
|
||||||
attrs?: string | Partial<{ [key in KEYS]: MathMLElementTagNameMap[TAG][key] | string | number | boolean }>,
|
attrs?: string | Partial<{ [key in KEYS]: MathMLElementTagNameMap[TAG][key] | string | number | boolean }>,
|
||||||
...addons: ddeElementAddon<MathMLElementTagNameMap[TAG]>[]
|
...addons: ddeElementAddon<MathMLElementTagNameMap[TAG]>[]
|
||||||
)=> MathMLElementTagNameMap[TAG]
|
)=> ddeMathMLElement
|
||||||
export function elNS(
|
export function elNS(
|
||||||
namespace: string
|
namespace: string
|
||||||
): (
|
): (
|
||||||
@ -93,6 +93,7 @@ export function elNS(
|
|||||||
)=> SupportedElement
|
)=> SupportedElement
|
||||||
|
|
||||||
export function chainableAppend<EL extends SupportedElement>(el: EL): EL;
|
export function chainableAppend<EL extends SupportedElement>(el: EL): EL;
|
||||||
|
export function simulateSlots<EL extends SupportedElement | DocumentFragment>(el: EL): EL
|
||||||
|
|
||||||
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;
|
||||||
@ -166,304 +167,282 @@ export const scope: {
|
|||||||
pop(): ReturnType<Array<Scope>["pop"]>,
|
pop(): ReturnType<Array<Scope>["pop"]>,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/* TypeScript MEH // TODO for SVG */
|
||||||
* TODO TypeScript HACK (better way?)
|
|
||||||
* this doesnt works
|
|
||||||
* ```ts
|
|
||||||
* interface element<el> extends Node{
|
|
||||||
* prototype: el;
|
|
||||||
* append(...els: (SupportedElement | DocumentFragment | string | element<SupportedElement | DocumentFragment>)[]): el
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
export function el<T>(
|
|
||||||
* tag_name?: "<>",
|
|
||||||
* ): element<DocumentFragment>
|
|
||||||
* ```
|
|
||||||
* …as its complains here
|
|
||||||
* ```
|
|
||||||
ts
|
|
||||||
*
|
|
||||||
const d= el("div");
|
|
||||||
*
|
|
||||||
const f= (a: HTMLDivElement)=> a;
|
|
||||||
* f(d);
|
|
||||||
//←
|
|
||||||
* document.head.append( //←
|
|
||||||
* el("script", { src: "https://flems.io/flems.html", type: "text/javascript", charset: "utf-8" }),
|
|
||||||
* );
|
|
||||||
* ```
|
|
||||||
* TODO for SVG
|
|
||||||
* */
|
|
||||||
type ddeAppend<el>= (...nodes: (Node | string)[])=> el;
|
type ddeAppend<el>= (...nodes: (Node | string)[])=> el;
|
||||||
declare global{
|
declare global{
|
||||||
interface HTMLAnchorElement{
|
interface ddeDocumentFragment extends DocumentFragment{ append: ddeAppend<ddeDocumentFragment>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLElement extends HTMLElement{ append: ddeAppend<ddeHTMLElement>; }
|
||||||
append: ddeAppend<HTMLAnchorElement>;
|
interface ddeSVGElement extends SVGElement{ append: ddeAppend<ddeSVGElement>; }
|
||||||
}
|
interface ddeMathMLElement extends MathMLElement{ append: ddeAppend<ddeMathMLElement>; }
|
||||||
interface HTMLElement{
|
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLElementTagNameMap {
|
||||||
append: ddeAppend<HTMLElement>;
|
"a": ddeHTMLAnchorElement;
|
||||||
}
|
"area": ddeHTMLAreaElement;
|
||||||
interface HTMLAreaElement{
|
"audio": ddeHTMLAudioElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"base": ddeHTMLBaseElement;
|
||||||
append: ddeAppend<HTMLAreaElement>;
|
"blockquote": ddeHTMLQuoteElement;
|
||||||
}
|
"body": ddeHTMLBodyElement;
|
||||||
interface HTMLAudioElement{
|
"br": ddeHTMLBRElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"button": ddeHTMLButtonElement;
|
||||||
append: ddeAppend<HTMLAudioElement>;
|
"canvas": ddeHTMLCanvasElement;
|
||||||
}
|
"caption": ddeHTMLTableCaptionElement;
|
||||||
interface HTMLBaseElement{
|
"col": ddeHTMLTableColElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"colgroup": ddeHTMLTableColElement;
|
||||||
append: ddeAppend<HTMLBaseElement>;
|
"data": ddeHTMLDataElement;
|
||||||
}
|
"datalist": ddeHTMLDataListElement;
|
||||||
interface HTMLQuoteElement{
|
"del": ddeHTMLModElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"details": ddeHTMLDetailsElement;
|
||||||
append: ddeAppend<HTMLQuoteElement>;
|
"dialog": ddeHTMLDialogElement;
|
||||||
}
|
"div": ddeHTMLDivElement;
|
||||||
interface HTMLBodyElement{
|
"dl": ddeHTMLDListElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"embed": ddeHTMLEmbedElement;
|
||||||
append: ddeAppend<HTMLBodyElement>;
|
"fieldset": ddeHTMLFieldSetElement;
|
||||||
}
|
"form": ddeHTMLFormElement;
|
||||||
interface HTMLBRElement{
|
"h1": ddeHTMLHeadingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"h2": ddeHTMLHeadingElement;
|
||||||
append: ddeAppend<HTMLBRElement>;
|
"h3": ddeHTMLHeadingElement;
|
||||||
}
|
"h4": ddeHTMLHeadingElement;
|
||||||
interface HTMLButtonElement{
|
"h5": ddeHTMLHeadingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"h6": ddeHTMLHeadingElement;
|
||||||
append: ddeAppend<HTMLButtonElement>;
|
"head": ddeHTMLHeadElement;
|
||||||
}
|
"hr": ddeHTMLHRElement;
|
||||||
interface HTMLCanvasElement{
|
"html": ddeHTMLHtmlElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"iframe": ddeHTMLIFrameElement;
|
||||||
append: ddeAppend<HTMLCanvasElement>;
|
"img": ddeHTMLImageElement;
|
||||||
}
|
"input": ddeHTMLInputElement;
|
||||||
interface HTMLTableCaptionElement{
|
"ins": ddeHTMLModElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"label": ddeHTMLLabelElement;
|
||||||
append: ddeAppend<HTMLTableCaptionElement>;
|
"legend": ddeHTMLLegendElement;
|
||||||
}
|
"li": ddeHTMLLIElement;
|
||||||
interface HTMLTableColElement{
|
"link": ddeHTMLLinkElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"map": ddeHTMLMapElement;
|
||||||
append: ddeAppend<HTMLTableColElement>;
|
"menu": ddeHTMLMenuElement;
|
||||||
}
|
"meta": ddeHTMLMetaElement;
|
||||||
interface HTMLTableColElement{
|
"meter": ddeHTMLMeterElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"object": ddeHTMLObjectElement;
|
||||||
append: ddeAppend<HTMLTableColElement>;
|
"ol": ddeHTMLOListElement;
|
||||||
}
|
"optgroup": ddeHTMLOptGroupElement;
|
||||||
interface HTMLDataElement{
|
"option": ddeHTMLOptionElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"output": ddeHTMLOutputElement;
|
||||||
append: ddeAppend<HTMLDataElement>;
|
"p": ddeHTMLParagraphElement;
|
||||||
}
|
"picture": ddeHTMLPictureElement;
|
||||||
interface HTMLDataListElement{
|
"pre": ddeHTMLPreElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"progress": ddeHTMLProgressElement;
|
||||||
append: ddeAppend<HTMLDataListElement>;
|
"q": ddeHTMLQuoteElement;
|
||||||
}
|
"script": ddeHTMLScriptElement;
|
||||||
interface HTMLModElement{
|
"select": ddeHTMLSelectElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"slot": ddeHTMLSlotElement;
|
||||||
append: ddeAppend<HTMLModElement>;
|
"source": ddeHTMLSourceElement;
|
||||||
}
|
"span": ddeHTMLSpanElement;
|
||||||
interface HTMLDetailsElement{
|
"style": ddeHTMLStyleElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"table": ddeHTMLTableElement;
|
||||||
append: ddeAppend<HTMLDetailsElement>;
|
"tbody": ddeHTMLTableSectionElement;
|
||||||
}
|
"td": ddeHTMLTableCellElement;
|
||||||
interface HTMLDialogElement{
|
"template": ddeHTMLTemplateElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"textarea": ddeHTMLTextAreaElement;
|
||||||
append: ddeAppend<HTMLDialogElement>;
|
"tfoot": ddeHTMLTableSectionElement;
|
||||||
}
|
"th": ddeHTMLTableCellElement;
|
||||||
interface HTMLDivElement{
|
"thead": ddeHTMLTableSectionElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"time": ddeHTMLTimeElement;
|
||||||
append: ddeAppend<HTMLDivElement>;
|
"title": ddeHTMLTitleElement;
|
||||||
}
|
"tr": ddeHTMLTableRowElement;
|
||||||
interface HTMLDListElement{
|
"track": ddeHTMLTrackElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"ul": ddeHTMLUListElement;
|
||||||
append: ddeAppend<HTMLDListElement>;
|
"video": ddeHTMLVideoElement;
|
||||||
}
|
}
|
||||||
interface HTMLEmbedElement{
|
interface ddeHTMLAnchorElement extends HTMLAnchorElement{ append: ddeAppend<ddeHTMLAnchorElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLAreaElement extends HTMLAreaElement{ append: ddeAppend<ddeHTMLAreaElement>; }
|
||||||
append: ddeAppend<HTMLEmbedElement>;
|
interface ddeHTMLAudioElement extends HTMLAudioElement{ append: ddeAppend<ddeHTMLAudioElement>; }
|
||||||
}
|
interface ddeHTMLBaseElement extends HTMLBaseElement{ append: ddeAppend<ddeHTMLBaseElement>; }
|
||||||
interface HTMLFieldSetElement{
|
interface ddeHTMLQuoteElement extends HTMLQuoteElement{ append: ddeAppend<ddeHTMLQuoteElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLBodyElement extends HTMLBodyElement{ append: ddeAppend<ddeHTMLBodyElement>; }
|
||||||
append: ddeAppend<HTMLFieldSetElement>;
|
interface ddeHTMLBRElement extends HTMLBRElement{ append: ddeAppend<ddeHTMLBRElement>; }
|
||||||
}
|
interface ddeHTMLButtonElement extends HTMLButtonElement{ append: ddeAppend<ddeHTMLButtonElement>; }
|
||||||
interface HTMLFormElement{
|
interface ddeHTMLCanvasElement extends HTMLCanvasElement{ append: ddeAppend<ddeHTMLCanvasElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTableCaptionElement extends HTMLTableCaptionElement{ append: ddeAppend<ddeHTMLTableCaptionElement>; }
|
||||||
append: ddeAppend<HTMLFormElement>;
|
interface ddeHTMLTableColElement extends HTMLTableColElement{ append: ddeAppend<ddeHTMLTableColElement>; }
|
||||||
}
|
interface ddeHTMLTableColElement extends HTMLTableColElement{ append: ddeAppend<ddeHTMLTableColElement>; }
|
||||||
interface HTMLHeadingElement{
|
interface ddeHTMLDataElement extends HTMLDataElement{ append: ddeAppend<ddeHTMLDataElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLDataListElement extends HTMLDataListElement{ append: ddeAppend<ddeHTMLDataListElement>; }
|
||||||
append: ddeAppend<HTMLHeadingElement>;
|
interface ddeHTMLModElement extends HTMLModElement{ append: ddeAppend<ddeHTMLModElement>; }
|
||||||
}
|
interface ddeHTMLDetailsElement extends HTMLDetailsElement{ append: ddeAppend<ddeHTMLDetailsElement>; }
|
||||||
interface HTMLHeadElement{
|
interface ddeHTMLDialogElement extends HTMLDialogElement{ append: ddeAppend<ddeHTMLDialogElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLDivElement extends HTMLDivElement{ append: ddeAppend<ddeHTMLDivElement>; }
|
||||||
append: ddeAppend<HTMLHeadElement>;
|
interface ddeHTMLDListElement extends HTMLDListElement{ append: ddeAppend<ddeHTMLDListElement>; }
|
||||||
}
|
interface ddeHTMLEmbedElement extends HTMLEmbedElement{ append: ddeAppend<ddeHTMLEmbedElement>; }
|
||||||
interface HTMLHRElement{
|
interface ddeHTMLFieldSetElement extends HTMLFieldSetElement{ append: ddeAppend<ddeHTMLFieldSetElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLFormElement extends HTMLFormElement{ append: ddeAppend<ddeHTMLFormElement>; }
|
||||||
append: ddeAppend<HTMLHRElement>;
|
interface ddeHTMLHeadingElement extends HTMLHeadingElement{ append: ddeAppend<ddeHTMLHeadingElement>; }
|
||||||
}
|
interface ddeHTMLHeadElement extends HTMLHeadElement{ append: ddeAppend<ddeHTMLHeadElement>; }
|
||||||
interface HTMLHtmlElement{
|
interface ddeHTMLHRElement extends HTMLHRElement{ append: ddeAppend<ddeHTMLHRElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLHtmlElement extends HTMLHtmlElement{ append: ddeAppend<ddeHTMLHtmlElement>; }
|
||||||
append: ddeAppend<HTMLHtmlElement>;
|
interface ddeHTMLIFrameElement extends HTMLIFrameElement{ append: ddeAppend<ddeHTMLIFrameElement>; }
|
||||||
}
|
interface ddeHTMLImageElement extends HTMLImageElement{ append: ddeAppend<ddeHTMLImageElement>; }
|
||||||
interface HTMLIFrameElement{
|
interface ddeHTMLInputElement extends HTMLInputElement{ append: ddeAppend<ddeHTMLInputElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLLabelElement extends HTMLLabelElement{ append: ddeAppend<ddeHTMLLabelElement>; }
|
||||||
append: ddeAppend<HTMLIFrameElement>;
|
interface ddeHTMLLegendElement extends HTMLLegendElement{ append: ddeAppend<ddeHTMLLegendElement>; }
|
||||||
}
|
interface ddeHTMLLIElement extends HTMLLIElement{ append: ddeAppend<ddeHTMLLIElement>; }
|
||||||
interface HTMLImageElement{
|
interface ddeHTMLLinkElement extends HTMLLinkElement{ append: ddeAppend<ddeHTMLLinkElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLMapElement extends HTMLMapElement{ append: ddeAppend<ddeHTMLMapElement>; }
|
||||||
append: ddeAppend<HTMLImageElement>;
|
interface ddeHTMLMenuElement extends HTMLMenuElement{ append: ddeAppend<ddeHTMLMenuElement>; }
|
||||||
}
|
interface ddeHTMLMetaElement extends HTMLMetaElement{ append: ddeAppend<ddeHTMLMetaElement>; }
|
||||||
interface HTMLInputElement{
|
interface ddeHTMLMeterElement extends HTMLMeterElement{ append: ddeAppend<ddeHTMLMeterElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLObjectElement extends HTMLObjectElement{ append: ddeAppend<ddeHTMLObjectElement>; }
|
||||||
append: ddeAppend<HTMLInputElement>;
|
interface ddeHTMLOListElement extends HTMLOListElement{ append: ddeAppend<ddeHTMLOListElement>; }
|
||||||
}
|
interface ddeHTMLOptGroupElement extends HTMLOptGroupElement{ append: ddeAppend<ddeHTMLOptGroupElement>; }
|
||||||
interface HTMLLabelElement{
|
interface ddeHTMLOptionElement extends HTMLOptionElement{ append: ddeAppend<ddeHTMLOptionElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLOutputElement extends HTMLOutputElement{ append: ddeAppend<ddeHTMLOutputElement>; }
|
||||||
append: ddeAppend<HTMLLabelElement>;
|
interface ddeHTMLParagraphElement extends HTMLParagraphElement{ append: ddeAppend<ddeHTMLParagraphElement>; }
|
||||||
}
|
interface ddeHTMLPictureElement extends HTMLPictureElement{ append: ddeAppend<ddeHTMLPictureElement>; }
|
||||||
interface HTMLLegendElement{
|
interface ddeHTMLPreElement extends HTMLPreElement{ append: ddeAppend<ddeHTMLPreElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLProgressElement extends HTMLProgressElement{ append: ddeAppend<ddeHTMLProgressElement>; }
|
||||||
append: ddeAppend<HTMLLegendElement>;
|
interface ddeHTMLScriptElement extends HTMLScriptElement{ append: ddeAppend<ddeHTMLScriptElement>; }
|
||||||
}
|
interface ddeHTMLSelectElement extends HTMLSelectElement{ append: ddeAppend<ddeHTMLSelectElement>; }
|
||||||
interface HTMLLIElement{
|
interface ddeHTMLSlotElement extends HTMLSlotElement{ append: ddeAppend<ddeHTMLSlotElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLSourceElement extends HTMLSourceElement{ append: ddeAppend<ddeHTMLSourceElement>; }
|
||||||
append: ddeAppend<HTMLLIElement>;
|
interface ddeHTMLSpanElement extends HTMLSpanElement{ append: ddeAppend<ddeHTMLSpanElement>; }
|
||||||
}
|
interface ddeHTMLStyleElement extends HTMLStyleElement{ append: ddeAppend<ddeHTMLStyleElement>; }
|
||||||
interface HTMLLinkElement{
|
interface ddeHTMLTableElement extends HTMLTableElement{ append: ddeAppend<ddeHTMLTableElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTableSectionElement extends HTMLTableSectionElement{ append: ddeAppend<ddeHTMLTableSectionElement>; }
|
||||||
append: ddeAppend<HTMLLinkElement>;
|
interface ddeHTMLTableCellElement extends HTMLTableCellElement{ append: ddeAppend<ddeHTMLTableCellElement>; }
|
||||||
}
|
interface ddeHTMLTemplateElement extends HTMLTemplateElement{ append: ddeAppend<ddeHTMLTemplateElement>; }
|
||||||
interface HTMLMapElement{
|
interface ddeHTMLTextAreaElement extends HTMLTextAreaElement{ append: ddeAppend<ddeHTMLTextAreaElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTableCellElement extends HTMLTableCellElement{ append: ddeAppend<ddeHTMLTableCellElement>; }
|
||||||
append: ddeAppend<HTMLMapElement>;
|
interface ddeHTMLTimeElement extends HTMLTimeElement{ append: ddeAppend<ddeHTMLTimeElement>; }
|
||||||
}
|
interface ddeHTMLTitleElement extends HTMLTitleElement{ append: ddeAppend<ddeHTMLTitleElement>; }
|
||||||
interface HTMLMenuElement{
|
interface ddeHTMLTableRowElement extends HTMLTableRowElement{ append: ddeAppend<ddeHTMLTableRowElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTrackElement extends HTMLTrackElement{ append: ddeAppend<ddeHTMLTrackElement>; }
|
||||||
append: ddeAppend<HTMLMenuElement>;
|
interface ddeHTMLUListElement extends HTMLUListElement{ append: ddeAppend<ddeHTMLUListElement>; }
|
||||||
}
|
interface ddeHTMLVideoElement extends HTMLVideoElement{ append: ddeAppend<ddeHTMLVideoElement>; }
|
||||||
interface HTMLMetaElement{
|
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGElementTagNameMap {
|
||||||
append: ddeAppend<HTMLMetaElement>;
|
"a": ddeSVGAElement;
|
||||||
}
|
"animate": ddeSVGAnimateElement;
|
||||||
interface HTMLMeterElement{
|
"animateMotion": ddeSVGAnimateMotionElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"animateTransform": ddeSVGAnimateTransformElement;
|
||||||
append: ddeAppend<HTMLMeterElement>;
|
"circle": ddeSVGCircleElement;
|
||||||
}
|
"clipPath": ddeSVGClipPathElement;
|
||||||
interface HTMLObjectElement{
|
"defs": ddeSVGDefsElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"desc": ddeSVGDescElement;
|
||||||
append: ddeAppend<HTMLObjectElement>;
|
"ellipse": ddeSVGEllipseElement;
|
||||||
}
|
"feBlend": ddeSVGFEBlendElement;
|
||||||
interface HTMLOListElement{
|
"feColorMatrix": ddeSVGFEColorMatrixElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feComponentTransfer": ddeSVGFEComponentTransferElement;
|
||||||
append: ddeAppend<HTMLOListElement>;
|
"feComposite": ddeSVGFECompositeElement;
|
||||||
}
|
"feConvolveMatrix": ddeSVGFEConvolveMatrixElement;
|
||||||
interface HTMLOptGroupElement{
|
"feDiffuseLighting": ddeSVGFEDiffuseLightingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feDisplacementMap": ddeSVGFEDisplacementMapElement;
|
||||||
append: ddeAppend<HTMLOptGroupElement>;
|
"feDistantLight": ddeSVGFEDistantLightElement;
|
||||||
}
|
"feDropShadow": ddeSVGFEDropShadowElement;
|
||||||
interface HTMLOptionElement{
|
"feFlood": ddeSVGFEFloodElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feFuncA": ddeSVGFEFuncAElement;
|
||||||
append: ddeAppend<HTMLOptionElement>;
|
"feFuncB": ddeSVGFEFuncBElement;
|
||||||
}
|
"feFuncG": ddeSVGFEFuncGElement;
|
||||||
interface HTMLOutputElement{
|
"feFuncR": ddeSVGFEFuncRElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feGaussianBlur": ddeSVGFEGaussianBlurElement;
|
||||||
append: ddeAppend<HTMLOutputElement>;
|
"feImage": ddeSVGFEImageElement;
|
||||||
}
|
"feMerge": ddeSVGFEMergeElement;
|
||||||
interface HTMLParagraphElement{
|
"feMergeNode": ddeSVGFEMergeNodeElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feMorphology": ddeSVGFEMorphologyElement;
|
||||||
append: ddeAppend<HTMLParagraphElement>;
|
"feOffset": ddeSVGFEOffsetElement;
|
||||||
}
|
"fePointLight": ddeSVGFEPointLightElement;
|
||||||
interface HTMLPictureElement{
|
"feSpecularLighting": ddeSVGFESpecularLightingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feSpotLight": ddeSVGFESpotLightElement;
|
||||||
append: ddeAppend<HTMLPictureElement>;
|
"feTile": ddeSVGFETileElement;
|
||||||
}
|
"feTurbulence": ddeSVGFETurbulenceElement;
|
||||||
interface HTMLPreElement{
|
"filter": ddeSVGFilterElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"foreignObject": ddeSVGForeignObjectElement;
|
||||||
append: ddeAppend<HTMLPreElement>;
|
"g": ddeSVGGElement;
|
||||||
}
|
"image": ddeSVGImageElement;
|
||||||
interface HTMLProgressElement{
|
"line": ddeSVGLineElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"linearGradient": ddeSVGLinearGradientElement;
|
||||||
append: ddeAppend<HTMLProgressElement>;
|
"marker": ddeSVGMarkerElement;
|
||||||
}
|
"mask": ddeSVGMaskElement;
|
||||||
interface HTMLScriptElement{
|
"metadata": ddeSVGMetadataElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"mpath": ddeSVGMPathElement;
|
||||||
append: ddeAppend<HTMLScriptElement>;
|
"path": ddeSVGPathElement;
|
||||||
}
|
"pattern": ddeSVGPatternElement;
|
||||||
interface HTMLSelectElement{
|
"polygon": ddeSVGPolygonElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"polyline": ddeSVGPolylineElement;
|
||||||
append: ddeAppend<HTMLSelectElement>;
|
"radialGradient": ddeSVGRadialGradientElement;
|
||||||
}
|
"rect": ddeSVGRectElement;
|
||||||
interface HTMLSlotElement{
|
"script": ddeSVGScriptElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"set": ddeSVGSetElement;
|
||||||
append: ddeAppend<HTMLSlotElement>;
|
"stop": ddeSVGStopElement;
|
||||||
}
|
"style": ddeSVGStyleElement;
|
||||||
interface HTMLSourceElement{
|
"svg": ddeSVGSVGElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"switch": ddeSVGSwitchElement;
|
||||||
append: ddeAppend<HTMLSourceElement>;
|
"symbol": ddeSVGSymbolElement;
|
||||||
}
|
"text": ddeSVGTextElement;
|
||||||
interface HTMLSpanElement{
|
"textPath": ddeSVGTextPathElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"title": ddeSVGTitleElement;
|
||||||
append: ddeAppend<HTMLSpanElement>;
|
"tspan": ddeSVGTSpanElement;
|
||||||
}
|
"use": ddeSVGUseElement;
|
||||||
interface HTMLStyleElement{
|
"view": ddeSVGViewElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
}
|
||||||
append: ddeAppend<HTMLStyleElement>;
|
interface ddeSVGAElement extends SVGAElement{ append: ddeAppend<ddeSVGAElement>; }
|
||||||
}
|
interface ddeSVGAnimateElement extends SVGAnimateElement{ append: ddeAppend<ddeSVGAnimateElement>; }
|
||||||
interface HTMLTableElement{
|
interface ddeSVGAnimateMotionElement extends SVGAnimateMotionElement{ append: ddeAppend<ddeSVGAnimateMotionElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGAnimateTransformElement extends SVGAnimateTransformElement{ append: ddeAppend<ddeSVGAnimateTransformElement>; }
|
||||||
append: ddeAppend<HTMLTableElement>;
|
interface ddeSVGCircleElement extends SVGCircleElement{ append: ddeAppend<ddeSVGCircleElement>; }
|
||||||
}
|
interface ddeSVGClipPathElement extends SVGClipPathElement{ append: ddeAppend<ddeSVGClipPathElement>; }
|
||||||
interface HTMLTableSectionElement{
|
interface ddeSVGDefsElement extends SVGDefsElement{ append: ddeAppend<ddeSVGDefsElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGDescElement extends SVGDescElement{ append: ddeAppend<ddeSVGDescElement>; }
|
||||||
append: ddeAppend<HTMLTableSectionElement>;
|
interface ddeSVGEllipseElement extends SVGEllipseElement{ append: ddeAppend<ddeSVGEllipseElement>; }
|
||||||
}
|
interface ddeSVGFEBlendElement extends SVGFEBlendElement{ append: ddeAppend<ddeSVGFEBlendElement>; }
|
||||||
interface HTMLTableCellElement{
|
interface ddeSVGFEColorMatrixElement extends SVGFEColorMatrixElement{ append: ddeAppend<ddeSVGFEColorMatrixElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEComponentTransferElement extends SVGFEComponentTransferElement{ append: ddeAppend<ddeSVGFEComponentTransferElement>; }
|
||||||
append: ddeAppend<HTMLTableCellElement>;
|
interface ddeSVGFECompositeElement extends SVGFECompositeElement{ append: ddeAppend<ddeSVGFECompositeElement>; }
|
||||||
}
|
interface ddeSVGFEConvolveMatrixElement extends SVGFEConvolveMatrixElement{ append: ddeAppend<ddeSVGFEConvolveMatrixElement>; }
|
||||||
interface HTMLTemplateElement{
|
interface ddeSVGFEDiffuseLightingElement extends SVGFEDiffuseLightingElement{ append: ddeAppend<ddeSVGFEDiffuseLightingElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEDisplacementMapElement extends SVGFEDisplacementMapElement{ append: ddeAppend<ddeSVGFEDisplacementMapElement>; }
|
||||||
append: ddeAppend<HTMLTemplateElement>;
|
interface ddeSVGFEDistantLightElement extends SVGFEDistantLightElement{ append: ddeAppend<ddeSVGFEDistantLightElement>; }
|
||||||
}
|
interface ddeSVGFEDropShadowElement extends SVGFEDropShadowElement{ append: ddeAppend<ddeSVGFEDropShadowElement>; }
|
||||||
interface HTMLTextAreaElement{
|
interface ddeSVGFEFloodElement extends SVGFEFloodElement{ append: ddeAppend<ddeSVGFEFloodElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEFuncAElement extends SVGFEFuncAElement{ append: ddeAppend<ddeSVGFEFuncAElement>; }
|
||||||
append: ddeAppend<HTMLTextAreaElement>;
|
interface ddeSVGFEFuncBElement extends SVGFEFuncBElement{ append: ddeAppend<ddeSVGFEFuncBElement>; }
|
||||||
}
|
interface ddeSVGFEFuncGElement extends SVGFEFuncGElement{ append: ddeAppend<ddeSVGFEFuncGElement>; }
|
||||||
interface HTMLTableCellElement{
|
interface ddeSVGFEFuncRElement extends SVGFEFuncRElement{ append: ddeAppend<ddeSVGFEFuncRElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEGaussianBlurElement extends SVGFEGaussianBlurElement{ append: ddeAppend<ddeSVGFEGaussianBlurElement>; }
|
||||||
append: ddeAppend<HTMLTableCellElement>;
|
interface ddeSVGFEImageElement extends SVGFEImageElement{ append: ddeAppend<ddeSVGFEImageElement>; }
|
||||||
}
|
interface ddeSVGFEMergeElement extends SVGFEMergeElement{ append: ddeAppend<ddeSVGFEMergeElement>; }
|
||||||
interface HTMLTimeElement{
|
interface ddeSVGFEMergeNodeElement extends SVGFEMergeNodeElement{ append: ddeAppend<ddeSVGFEMergeNodeElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEMorphologyElement extends SVGFEMorphologyElement{ append: ddeAppend<ddeSVGFEMorphologyElement>; }
|
||||||
append: ddeAppend<HTMLTimeElement>;
|
interface ddeSVGFEOffsetElement extends SVGFEOffsetElement{ append: ddeAppend<ddeSVGFEOffsetElement>; }
|
||||||
}
|
interface ddeSVGFEPointLightElement extends SVGFEPointLightElement{ append: ddeAppend<ddeSVGFEPointLightElement>; }
|
||||||
interface HTMLTitleElement{
|
interface ddeSVGFESpecularLightingElement extends SVGFESpecularLightingElement{ append: ddeAppend<ddeSVGFESpecularLightingElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFESpotLightElement extends SVGFESpotLightElement{ append: ddeAppend<ddeSVGFESpotLightElement>; }
|
||||||
append: ddeAppend<HTMLTitleElement>;
|
interface ddeSVGFETileElement extends SVGFETileElement{ append: ddeAppend<ddeSVGFETileElement>; }
|
||||||
}
|
interface ddeSVGFETurbulenceElement extends SVGFETurbulenceElement{ append: ddeAppend<ddeSVGFETurbulenceElement>; }
|
||||||
interface HTMLTableRowElement{
|
interface ddeSVGFilterElement extends SVGFilterElement{ append: ddeAppend<ddeSVGFilterElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGForeignObjectElement extends SVGForeignObjectElement{ append: ddeAppend<ddeSVGForeignObjectElement>; }
|
||||||
append: ddeAppend<HTMLTableRowElement>;
|
interface ddeSVGGElement extends SVGGElement{ append: ddeAppend<ddeSVGGElement>; }
|
||||||
}
|
interface ddeSVGImageElement extends SVGImageElement{ append: ddeAppend<ddeSVGImageElement>; }
|
||||||
interface HTMLTrackElement{
|
interface ddeSVGLineElement extends SVGLineElement{ append: ddeAppend<ddeSVGLineElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGLinearGradientElement extends SVGLinearGradientElement{ append: ddeAppend<ddeSVGLinearGradientElement>; }
|
||||||
append: ddeAppend<HTMLTrackElement>;
|
interface ddeSVGMarkerElement extends SVGMarkerElement{ append: ddeAppend<ddeSVGMarkerElement>; }
|
||||||
}
|
interface ddeSVGMaskElement extends SVGMaskElement{ append: ddeAppend<ddeSVGMaskElement>; }
|
||||||
interface HTMLUListElement{
|
interface ddeSVGMetadataElement extends SVGMetadataElement{ append: ddeAppend<ddeSVGMetadataElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGMPathElement extends SVGMPathElement{ append: ddeAppend<ddeSVGMPathElement>; }
|
||||||
append: ddeAppend<HTMLUListElement>;
|
interface ddeSVGPathElement extends SVGPathElement{ append: ddeAppend<ddeSVGPathElement>; }
|
||||||
}
|
interface ddeSVGPatternElement extends SVGPatternElement{ append: ddeAppend<ddeSVGPatternElement>; }
|
||||||
interface HTMLVideoElement{
|
interface ddeSVGPolygonElement extends SVGPolygonElement{ append: ddeAppend<ddeSVGPolygonElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGPolylineElement extends SVGPolylineElement{ append: ddeAppend<ddeSVGPolylineElement>; }
|
||||||
append: ddeAppend<HTMLVideoElement>;
|
interface ddeSVGRadialGradientElement extends SVGRadialGradientElement{ append: ddeAppend<ddeSVGRadialGradientElement>; }
|
||||||
}
|
interface ddeSVGRectElement extends SVGRectElement{ append: ddeAppend<ddeSVGRectElement>; }
|
||||||
interface DocumentFragment{
|
interface ddeSVGScriptElement extends SVGScriptElement{ append: ddeAppend<ddeSVGScriptElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGSetElement extends SVGSetElement{ append: ddeAppend<ddeSVGSetElement>; }
|
||||||
append: ddeAppend<DocumentFragment>;
|
interface ddeSVGStopElement extends SVGStopElement{ append: ddeAppend<ddeSVGStopElement>; }
|
||||||
}
|
interface ddeSVGStyleElement extends SVGStyleElement{ append: ddeAppend<ddeSVGStyleElement>; }
|
||||||
interface SVGElement{
|
interface ddeSVGSVGElement extends SVGSVGElement{ append: ddeAppend<ddeSVGSVGElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGSwitchElement extends SVGSwitchElement{ append: ddeAppend<ddeSVGSwitchElement>; }
|
||||||
append: ddeAppend<SVGElement>;
|
interface ddeSVGSymbolElement extends SVGSymbolElement{ append: ddeAppend<ddeSVGSymbolElement>; }
|
||||||
}
|
interface ddeSVGTextElement extends SVGTextElement{ append: ddeAppend<ddeSVGTextElement>; }
|
||||||
|
interface ddeSVGTextPathElement extends SVGTextPathElement{ append: ddeAppend<ddeSVGTextPathElement>; }
|
||||||
|
interface ddeSVGTitleElement extends SVGTitleElement{ append: ddeAppend<ddeSVGTitleElement>; }
|
||||||
|
interface ddeSVGTSpanElement extends SVGTSpanElement{ append: ddeAppend<ddeSVGTSpanElement>; }
|
||||||
|
interface ddeSVGUseElement extends SVGUseElement{ append: ddeAppend<ddeSVGUseElement>; }
|
||||||
|
interface ddeSVGViewElement extends SVGViewElement{ append: ddeAppend<ddeSVGViewElement>; }
|
||||||
}
|
}
|
||||||
export type Signal<V, A>= (set?: V)=> V & A;
|
export type Signal<V, A>= (set?: V)=> V & A;
|
||||||
type Action<V>= (this: { value: V }, ...a: any[])=> typeof S._ | void;
|
type Action<V>= (this: { value: V }, ...a: any[])=> typeof S._ | void;
|
||||||
|
8
dist/esm-with-signals.js
vendored
8
dist/esm-with-signals.js
vendored
File diff suppressed because one or more lines are too long
587
dist/esm.d.ts
vendored
587
dist/esm.d.ts
vendored
@ -46,7 +46,7 @@ export function classListDeclarative<El extends SupportedElement>(element: El, c
|
|||||||
export function assign<El extends SupportedElement>(element: El, ...attrs_array: Partial<ElementAttributes<El>>[]): El
|
export function assign<El extends SupportedElement>(element: El, ...attrs_array: Partial<ElementAttributes<El>>[]): El
|
||||||
export function assignAttribute<El extends SupportedElement, ATT extends keyof ElementAttributes<El>>(element: El, attr: ATT, value: ElementAttributes<El>[ATT]): ElementAttributes<El>[ATT]
|
export function assignAttribute<El extends SupportedElement, ATT extends keyof ElementAttributes<El>>(element: El, attr: ATT, value: ElementAttributes<El>[ATT]): ElementAttributes<El>[ATT]
|
||||||
|
|
||||||
type ExtendedHTMLElementTagNameMap= HTMLElementTagNameMap & CustomElementTagNameMap & ddePublicElementTagNameMap
|
type ExtendedHTMLElementTagNameMap= ddeHTMLElementTagNameMap & CustomElementTagNameMap & ddePublicElementTagNameMap
|
||||||
export function el<TAG extends keyof ExtendedHTMLElementTagNameMap>(
|
export function el<TAG extends keyof ExtendedHTMLElementTagNameMap>(
|
||||||
tag_name: TAG,
|
tag_name: TAG,
|
||||||
attrs?: string | Partial<ElementAttributes<ExtendedHTMLElementTagNameMap[TAG]>>,
|
attrs?: string | Partial<ElementAttributes<ExtendedHTMLElementTagNameMap[TAG]>>,
|
||||||
@ -54,7 +54,7 @@ export function el<TAG extends keyof ExtendedHTMLElementTagNameMap>(
|
|||||||
): ExtendedHTMLElementTagNameMap[TAG]
|
): ExtendedHTMLElementTagNameMap[TAG]
|
||||||
export function el<T>(
|
export function el<T>(
|
||||||
tag_name?: "<>",
|
tag_name?: "<>",
|
||||||
): DocumentFragment
|
): ddeDocumentFragment
|
||||||
|
|
||||||
export function el<
|
export function el<
|
||||||
A extends ddeComponentAttributes,
|
A extends ddeComponentAttributes,
|
||||||
@ -68,22 +68,22 @@ export function el(
|
|||||||
tag_name: string,
|
tag_name: string,
|
||||||
attrs?: string | Record<string, any>,
|
attrs?: string | Record<string, any>,
|
||||||
...addons: ddeElementAddon<HTMLElement>[]
|
...addons: ddeElementAddon<HTMLElement>[]
|
||||||
): HTMLElement
|
): ddeHTMLElement
|
||||||
|
|
||||||
export function elNS(
|
export function elNS(
|
||||||
namespace: "http://www.w3.org/2000/svg"
|
namespace: "http://www.w3.org/2000/svg"
|
||||||
): <TAG extends keyof SVGElementTagNameMap, KEYS extends keyof SVGElementTagNameMap[TAG] & { d: string }>(
|
): <TAG, EL extends ( TAG extends keyof ddeSVGElementTagNameMap ? ddeSVGElementTagNameMap[TAG] : ddeSVGElement ), KEYS extends keyof EL & { d: string }>(
|
||||||
tag_name: TAG,
|
tag_name: TAG,
|
||||||
attrs?: string | Partial<{ [key in KEYS]: SVGElementTagNameMap[TAG][key] | string | number | boolean }>,
|
attrs?: string | Partial<{ [key in KEYS]: EL[key] | string | number | boolean }>,
|
||||||
...addons: ddeElementAddon<SVGElementTagNameMap[TAG]>[]
|
...addons: ddeElementAddon<EL>[]
|
||||||
)=> SVGElementTagNameMap[TAG]
|
)=> EL
|
||||||
export function elNS(
|
export function elNS(
|
||||||
namespace: "http://www.w3.org/1998/Math/MathML"
|
namespace: "http://www.w3.org/1998/Math/MathML"
|
||||||
): <TAG extends keyof MathMLElementTagNameMap, KEYS extends keyof MathMLElementTagNameMap[TAG] & { d: string }>(
|
): <TAG extends keyof MathMLElementTagNameMap, KEYS extends keyof MathMLElementTagNameMap[TAG] & { d: string }>(
|
||||||
tag_name: TAG,
|
tag_name: TAG,
|
||||||
attrs?: string | Partial<{ [key in KEYS]: MathMLElementTagNameMap[TAG][key] | string | number | boolean }>,
|
attrs?: string | Partial<{ [key in KEYS]: MathMLElementTagNameMap[TAG][key] | string | number | boolean }>,
|
||||||
...addons: ddeElementAddon<MathMLElementTagNameMap[TAG]>[]
|
...addons: ddeElementAddon<MathMLElementTagNameMap[TAG]>[]
|
||||||
)=> MathMLElementTagNameMap[TAG]
|
)=> ddeMathMLElement
|
||||||
export function elNS(
|
export function elNS(
|
||||||
namespace: string
|
namespace: string
|
||||||
): (
|
): (
|
||||||
@ -93,6 +93,7 @@ export function elNS(
|
|||||||
)=> SupportedElement
|
)=> SupportedElement
|
||||||
|
|
||||||
export function chainableAppend<EL extends SupportedElement>(el: EL): EL;
|
export function chainableAppend<EL extends SupportedElement>(el: EL): EL;
|
||||||
|
export function simulateSlots<EL extends SupportedElement | DocumentFragment>(el: EL): EL
|
||||||
|
|
||||||
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;
|
||||||
@ -166,302 +167,280 @@ export const scope: {
|
|||||||
pop(): ReturnType<Array<Scope>["pop"]>,
|
pop(): ReturnType<Array<Scope>["pop"]>,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/* TypeScript MEH // TODO for SVG */
|
||||||
* TODO TypeScript HACK (better way?)
|
|
||||||
* this doesnt works
|
|
||||||
* ```ts
|
|
||||||
* interface element<el> extends Node{
|
|
||||||
* prototype: el;
|
|
||||||
* append(...els: (SupportedElement | DocumentFragment | string | element<SupportedElement | DocumentFragment>)[]): el
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
export function el<T>(
|
|
||||||
* tag_name?: "<>",
|
|
||||||
* ): element<DocumentFragment>
|
|
||||||
* ```
|
|
||||||
* …as its complains here
|
|
||||||
* ```
|
|
||||||
ts
|
|
||||||
*
|
|
||||||
const d= el("div");
|
|
||||||
*
|
|
||||||
const f= (a: HTMLDivElement)=> a;
|
|
||||||
* f(d);
|
|
||||||
//←
|
|
||||||
* document.head.append( //←
|
|
||||||
* el("script", { src: "https://flems.io/flems.html", type: "text/javascript", charset: "utf-8" }),
|
|
||||||
* );
|
|
||||||
* ```
|
|
||||||
* TODO for SVG
|
|
||||||
* */
|
|
||||||
type ddeAppend<el>= (...nodes: (Node | string)[])=> el;
|
type ddeAppend<el>= (...nodes: (Node | string)[])=> el;
|
||||||
declare global{
|
declare global{
|
||||||
interface HTMLAnchorElement{
|
interface ddeDocumentFragment extends DocumentFragment{ append: ddeAppend<ddeDocumentFragment>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLElement extends HTMLElement{ append: ddeAppend<ddeHTMLElement>; }
|
||||||
append: ddeAppend<HTMLAnchorElement>;
|
interface ddeSVGElement extends SVGElement{ append: ddeAppend<ddeSVGElement>; }
|
||||||
}
|
interface ddeMathMLElement extends MathMLElement{ append: ddeAppend<ddeMathMLElement>; }
|
||||||
interface HTMLElement{
|
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLElementTagNameMap {
|
||||||
append: ddeAppend<HTMLElement>;
|
"a": ddeHTMLAnchorElement;
|
||||||
}
|
"area": ddeHTMLAreaElement;
|
||||||
interface HTMLAreaElement{
|
"audio": ddeHTMLAudioElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"base": ddeHTMLBaseElement;
|
||||||
append: ddeAppend<HTMLAreaElement>;
|
"blockquote": ddeHTMLQuoteElement;
|
||||||
}
|
"body": ddeHTMLBodyElement;
|
||||||
interface HTMLAudioElement{
|
"br": ddeHTMLBRElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"button": ddeHTMLButtonElement;
|
||||||
append: ddeAppend<HTMLAudioElement>;
|
"canvas": ddeHTMLCanvasElement;
|
||||||
}
|
"caption": ddeHTMLTableCaptionElement;
|
||||||
interface HTMLBaseElement{
|
"col": ddeHTMLTableColElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"colgroup": ddeHTMLTableColElement;
|
||||||
append: ddeAppend<HTMLBaseElement>;
|
"data": ddeHTMLDataElement;
|
||||||
}
|
"datalist": ddeHTMLDataListElement;
|
||||||
interface HTMLQuoteElement{
|
"del": ddeHTMLModElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"details": ddeHTMLDetailsElement;
|
||||||
append: ddeAppend<HTMLQuoteElement>;
|
"dialog": ddeHTMLDialogElement;
|
||||||
}
|
"div": ddeHTMLDivElement;
|
||||||
interface HTMLBodyElement{
|
"dl": ddeHTMLDListElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"embed": ddeHTMLEmbedElement;
|
||||||
append: ddeAppend<HTMLBodyElement>;
|
"fieldset": ddeHTMLFieldSetElement;
|
||||||
}
|
"form": ddeHTMLFormElement;
|
||||||
interface HTMLBRElement{
|
"h1": ddeHTMLHeadingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"h2": ddeHTMLHeadingElement;
|
||||||
append: ddeAppend<HTMLBRElement>;
|
"h3": ddeHTMLHeadingElement;
|
||||||
}
|
"h4": ddeHTMLHeadingElement;
|
||||||
interface HTMLButtonElement{
|
"h5": ddeHTMLHeadingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"h6": ddeHTMLHeadingElement;
|
||||||
append: ddeAppend<HTMLButtonElement>;
|
"head": ddeHTMLHeadElement;
|
||||||
}
|
"hr": ddeHTMLHRElement;
|
||||||
interface HTMLCanvasElement{
|
"html": ddeHTMLHtmlElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"iframe": ddeHTMLIFrameElement;
|
||||||
append: ddeAppend<HTMLCanvasElement>;
|
"img": ddeHTMLImageElement;
|
||||||
}
|
"input": ddeHTMLInputElement;
|
||||||
interface HTMLTableCaptionElement{
|
"ins": ddeHTMLModElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"label": ddeHTMLLabelElement;
|
||||||
append: ddeAppend<HTMLTableCaptionElement>;
|
"legend": ddeHTMLLegendElement;
|
||||||
}
|
"li": ddeHTMLLIElement;
|
||||||
interface HTMLTableColElement{
|
"link": ddeHTMLLinkElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"map": ddeHTMLMapElement;
|
||||||
append: ddeAppend<HTMLTableColElement>;
|
"menu": ddeHTMLMenuElement;
|
||||||
}
|
"meta": ddeHTMLMetaElement;
|
||||||
interface HTMLTableColElement{
|
"meter": ddeHTMLMeterElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"object": ddeHTMLObjectElement;
|
||||||
append: ddeAppend<HTMLTableColElement>;
|
"ol": ddeHTMLOListElement;
|
||||||
}
|
"optgroup": ddeHTMLOptGroupElement;
|
||||||
interface HTMLDataElement{
|
"option": ddeHTMLOptionElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"output": ddeHTMLOutputElement;
|
||||||
append: ddeAppend<HTMLDataElement>;
|
"p": ddeHTMLParagraphElement;
|
||||||
}
|
"picture": ddeHTMLPictureElement;
|
||||||
interface HTMLDataListElement{
|
"pre": ddeHTMLPreElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"progress": ddeHTMLProgressElement;
|
||||||
append: ddeAppend<HTMLDataListElement>;
|
"q": ddeHTMLQuoteElement;
|
||||||
}
|
"script": ddeHTMLScriptElement;
|
||||||
interface HTMLModElement{
|
"select": ddeHTMLSelectElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"slot": ddeHTMLSlotElement;
|
||||||
append: ddeAppend<HTMLModElement>;
|
"source": ddeHTMLSourceElement;
|
||||||
}
|
"span": ddeHTMLSpanElement;
|
||||||
interface HTMLDetailsElement{
|
"style": ddeHTMLStyleElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"table": ddeHTMLTableElement;
|
||||||
append: ddeAppend<HTMLDetailsElement>;
|
"tbody": ddeHTMLTableSectionElement;
|
||||||
}
|
"td": ddeHTMLTableCellElement;
|
||||||
interface HTMLDialogElement{
|
"template": ddeHTMLTemplateElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"textarea": ddeHTMLTextAreaElement;
|
||||||
append: ddeAppend<HTMLDialogElement>;
|
"tfoot": ddeHTMLTableSectionElement;
|
||||||
}
|
"th": ddeHTMLTableCellElement;
|
||||||
interface HTMLDivElement{
|
"thead": ddeHTMLTableSectionElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"time": ddeHTMLTimeElement;
|
||||||
append: ddeAppend<HTMLDivElement>;
|
"title": ddeHTMLTitleElement;
|
||||||
}
|
"tr": ddeHTMLTableRowElement;
|
||||||
interface HTMLDListElement{
|
"track": ddeHTMLTrackElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"ul": ddeHTMLUListElement;
|
||||||
append: ddeAppend<HTMLDListElement>;
|
"video": ddeHTMLVideoElement;
|
||||||
}
|
}
|
||||||
interface HTMLEmbedElement{
|
interface ddeHTMLAnchorElement extends HTMLAnchorElement{ append: ddeAppend<ddeHTMLAnchorElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLAreaElement extends HTMLAreaElement{ append: ddeAppend<ddeHTMLAreaElement>; }
|
||||||
append: ddeAppend<HTMLEmbedElement>;
|
interface ddeHTMLAudioElement extends HTMLAudioElement{ append: ddeAppend<ddeHTMLAudioElement>; }
|
||||||
}
|
interface ddeHTMLBaseElement extends HTMLBaseElement{ append: ddeAppend<ddeHTMLBaseElement>; }
|
||||||
interface HTMLFieldSetElement{
|
interface ddeHTMLQuoteElement extends HTMLQuoteElement{ append: ddeAppend<ddeHTMLQuoteElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLBodyElement extends HTMLBodyElement{ append: ddeAppend<ddeHTMLBodyElement>; }
|
||||||
append: ddeAppend<HTMLFieldSetElement>;
|
interface ddeHTMLBRElement extends HTMLBRElement{ append: ddeAppend<ddeHTMLBRElement>; }
|
||||||
}
|
interface ddeHTMLButtonElement extends HTMLButtonElement{ append: ddeAppend<ddeHTMLButtonElement>; }
|
||||||
interface HTMLFormElement{
|
interface ddeHTMLCanvasElement extends HTMLCanvasElement{ append: ddeAppend<ddeHTMLCanvasElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTableCaptionElement extends HTMLTableCaptionElement{ append: ddeAppend<ddeHTMLTableCaptionElement>; }
|
||||||
append: ddeAppend<HTMLFormElement>;
|
interface ddeHTMLTableColElement extends HTMLTableColElement{ append: ddeAppend<ddeHTMLTableColElement>; }
|
||||||
}
|
interface ddeHTMLTableColElement extends HTMLTableColElement{ append: ddeAppend<ddeHTMLTableColElement>; }
|
||||||
interface HTMLHeadingElement{
|
interface ddeHTMLDataElement extends HTMLDataElement{ append: ddeAppend<ddeHTMLDataElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLDataListElement extends HTMLDataListElement{ append: ddeAppend<ddeHTMLDataListElement>; }
|
||||||
append: ddeAppend<HTMLHeadingElement>;
|
interface ddeHTMLModElement extends HTMLModElement{ append: ddeAppend<ddeHTMLModElement>; }
|
||||||
}
|
interface ddeHTMLDetailsElement extends HTMLDetailsElement{ append: ddeAppend<ddeHTMLDetailsElement>; }
|
||||||
interface HTMLHeadElement{
|
interface ddeHTMLDialogElement extends HTMLDialogElement{ append: ddeAppend<ddeHTMLDialogElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLDivElement extends HTMLDivElement{ append: ddeAppend<ddeHTMLDivElement>; }
|
||||||
append: ddeAppend<HTMLHeadElement>;
|
interface ddeHTMLDListElement extends HTMLDListElement{ append: ddeAppend<ddeHTMLDListElement>; }
|
||||||
}
|
interface ddeHTMLEmbedElement extends HTMLEmbedElement{ append: ddeAppend<ddeHTMLEmbedElement>; }
|
||||||
interface HTMLHRElement{
|
interface ddeHTMLFieldSetElement extends HTMLFieldSetElement{ append: ddeAppend<ddeHTMLFieldSetElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLFormElement extends HTMLFormElement{ append: ddeAppend<ddeHTMLFormElement>; }
|
||||||
append: ddeAppend<HTMLHRElement>;
|
interface ddeHTMLHeadingElement extends HTMLHeadingElement{ append: ddeAppend<ddeHTMLHeadingElement>; }
|
||||||
}
|
interface ddeHTMLHeadElement extends HTMLHeadElement{ append: ddeAppend<ddeHTMLHeadElement>; }
|
||||||
interface HTMLHtmlElement{
|
interface ddeHTMLHRElement extends HTMLHRElement{ append: ddeAppend<ddeHTMLHRElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLHtmlElement extends HTMLHtmlElement{ append: ddeAppend<ddeHTMLHtmlElement>; }
|
||||||
append: ddeAppend<HTMLHtmlElement>;
|
interface ddeHTMLIFrameElement extends HTMLIFrameElement{ append: ddeAppend<ddeHTMLIFrameElement>; }
|
||||||
}
|
interface ddeHTMLImageElement extends HTMLImageElement{ append: ddeAppend<ddeHTMLImageElement>; }
|
||||||
interface HTMLIFrameElement{
|
interface ddeHTMLInputElement extends HTMLInputElement{ append: ddeAppend<ddeHTMLInputElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLLabelElement extends HTMLLabelElement{ append: ddeAppend<ddeHTMLLabelElement>; }
|
||||||
append: ddeAppend<HTMLIFrameElement>;
|
interface ddeHTMLLegendElement extends HTMLLegendElement{ append: ddeAppend<ddeHTMLLegendElement>; }
|
||||||
}
|
interface ddeHTMLLIElement extends HTMLLIElement{ append: ddeAppend<ddeHTMLLIElement>; }
|
||||||
interface HTMLImageElement{
|
interface ddeHTMLLinkElement extends HTMLLinkElement{ append: ddeAppend<ddeHTMLLinkElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLMapElement extends HTMLMapElement{ append: ddeAppend<ddeHTMLMapElement>; }
|
||||||
append: ddeAppend<HTMLImageElement>;
|
interface ddeHTMLMenuElement extends HTMLMenuElement{ append: ddeAppend<ddeHTMLMenuElement>; }
|
||||||
}
|
interface ddeHTMLMetaElement extends HTMLMetaElement{ append: ddeAppend<ddeHTMLMetaElement>; }
|
||||||
interface HTMLInputElement{
|
interface ddeHTMLMeterElement extends HTMLMeterElement{ append: ddeAppend<ddeHTMLMeterElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLObjectElement extends HTMLObjectElement{ append: ddeAppend<ddeHTMLObjectElement>; }
|
||||||
append: ddeAppend<HTMLInputElement>;
|
interface ddeHTMLOListElement extends HTMLOListElement{ append: ddeAppend<ddeHTMLOListElement>; }
|
||||||
}
|
interface ddeHTMLOptGroupElement extends HTMLOptGroupElement{ append: ddeAppend<ddeHTMLOptGroupElement>; }
|
||||||
interface HTMLLabelElement{
|
interface ddeHTMLOptionElement extends HTMLOptionElement{ append: ddeAppend<ddeHTMLOptionElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLOutputElement extends HTMLOutputElement{ append: ddeAppend<ddeHTMLOutputElement>; }
|
||||||
append: ddeAppend<HTMLLabelElement>;
|
interface ddeHTMLParagraphElement extends HTMLParagraphElement{ append: ddeAppend<ddeHTMLParagraphElement>; }
|
||||||
}
|
interface ddeHTMLPictureElement extends HTMLPictureElement{ append: ddeAppend<ddeHTMLPictureElement>; }
|
||||||
interface HTMLLegendElement{
|
interface ddeHTMLPreElement extends HTMLPreElement{ append: ddeAppend<ddeHTMLPreElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLProgressElement extends HTMLProgressElement{ append: ddeAppend<ddeHTMLProgressElement>; }
|
||||||
append: ddeAppend<HTMLLegendElement>;
|
interface ddeHTMLScriptElement extends HTMLScriptElement{ append: ddeAppend<ddeHTMLScriptElement>; }
|
||||||
}
|
interface ddeHTMLSelectElement extends HTMLSelectElement{ append: ddeAppend<ddeHTMLSelectElement>; }
|
||||||
interface HTMLLIElement{
|
interface ddeHTMLSlotElement extends HTMLSlotElement{ append: ddeAppend<ddeHTMLSlotElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLSourceElement extends HTMLSourceElement{ append: ddeAppend<ddeHTMLSourceElement>; }
|
||||||
append: ddeAppend<HTMLLIElement>;
|
interface ddeHTMLSpanElement extends HTMLSpanElement{ append: ddeAppend<ddeHTMLSpanElement>; }
|
||||||
}
|
interface ddeHTMLStyleElement extends HTMLStyleElement{ append: ddeAppend<ddeHTMLStyleElement>; }
|
||||||
interface HTMLLinkElement{
|
interface ddeHTMLTableElement extends HTMLTableElement{ append: ddeAppend<ddeHTMLTableElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTableSectionElement extends HTMLTableSectionElement{ append: ddeAppend<ddeHTMLTableSectionElement>; }
|
||||||
append: ddeAppend<HTMLLinkElement>;
|
interface ddeHTMLTableCellElement extends HTMLTableCellElement{ append: ddeAppend<ddeHTMLTableCellElement>; }
|
||||||
}
|
interface ddeHTMLTemplateElement extends HTMLTemplateElement{ append: ddeAppend<ddeHTMLTemplateElement>; }
|
||||||
interface HTMLMapElement{
|
interface ddeHTMLTextAreaElement extends HTMLTextAreaElement{ append: ddeAppend<ddeHTMLTextAreaElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTableCellElement extends HTMLTableCellElement{ append: ddeAppend<ddeHTMLTableCellElement>; }
|
||||||
append: ddeAppend<HTMLMapElement>;
|
interface ddeHTMLTimeElement extends HTMLTimeElement{ append: ddeAppend<ddeHTMLTimeElement>; }
|
||||||
}
|
interface ddeHTMLTitleElement extends HTMLTitleElement{ append: ddeAppend<ddeHTMLTitleElement>; }
|
||||||
interface HTMLMenuElement{
|
interface ddeHTMLTableRowElement extends HTMLTableRowElement{ append: ddeAppend<ddeHTMLTableRowElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTrackElement extends HTMLTrackElement{ append: ddeAppend<ddeHTMLTrackElement>; }
|
||||||
append: ddeAppend<HTMLMenuElement>;
|
interface ddeHTMLUListElement extends HTMLUListElement{ append: ddeAppend<ddeHTMLUListElement>; }
|
||||||
}
|
interface ddeHTMLVideoElement extends HTMLVideoElement{ append: ddeAppend<ddeHTMLVideoElement>; }
|
||||||
interface HTMLMetaElement{
|
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGElementTagNameMap {
|
||||||
append: ddeAppend<HTMLMetaElement>;
|
"a": ddeSVGAElement;
|
||||||
}
|
"animate": ddeSVGAnimateElement;
|
||||||
interface HTMLMeterElement{
|
"animateMotion": ddeSVGAnimateMotionElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"animateTransform": ddeSVGAnimateTransformElement;
|
||||||
append: ddeAppend<HTMLMeterElement>;
|
"circle": ddeSVGCircleElement;
|
||||||
}
|
"clipPath": ddeSVGClipPathElement;
|
||||||
interface HTMLObjectElement{
|
"defs": ddeSVGDefsElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"desc": ddeSVGDescElement;
|
||||||
append: ddeAppend<HTMLObjectElement>;
|
"ellipse": ddeSVGEllipseElement;
|
||||||
}
|
"feBlend": ddeSVGFEBlendElement;
|
||||||
interface HTMLOListElement{
|
"feColorMatrix": ddeSVGFEColorMatrixElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feComponentTransfer": ddeSVGFEComponentTransferElement;
|
||||||
append: ddeAppend<HTMLOListElement>;
|
"feComposite": ddeSVGFECompositeElement;
|
||||||
}
|
"feConvolveMatrix": ddeSVGFEConvolveMatrixElement;
|
||||||
interface HTMLOptGroupElement{
|
"feDiffuseLighting": ddeSVGFEDiffuseLightingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feDisplacementMap": ddeSVGFEDisplacementMapElement;
|
||||||
append: ddeAppend<HTMLOptGroupElement>;
|
"feDistantLight": ddeSVGFEDistantLightElement;
|
||||||
}
|
"feDropShadow": ddeSVGFEDropShadowElement;
|
||||||
interface HTMLOptionElement{
|
"feFlood": ddeSVGFEFloodElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feFuncA": ddeSVGFEFuncAElement;
|
||||||
append: ddeAppend<HTMLOptionElement>;
|
"feFuncB": ddeSVGFEFuncBElement;
|
||||||
}
|
"feFuncG": ddeSVGFEFuncGElement;
|
||||||
interface HTMLOutputElement{
|
"feFuncR": ddeSVGFEFuncRElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feGaussianBlur": ddeSVGFEGaussianBlurElement;
|
||||||
append: ddeAppend<HTMLOutputElement>;
|
"feImage": ddeSVGFEImageElement;
|
||||||
}
|
"feMerge": ddeSVGFEMergeElement;
|
||||||
interface HTMLParagraphElement{
|
"feMergeNode": ddeSVGFEMergeNodeElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feMorphology": ddeSVGFEMorphologyElement;
|
||||||
append: ddeAppend<HTMLParagraphElement>;
|
"feOffset": ddeSVGFEOffsetElement;
|
||||||
}
|
"fePointLight": ddeSVGFEPointLightElement;
|
||||||
interface HTMLPictureElement{
|
"feSpecularLighting": ddeSVGFESpecularLightingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feSpotLight": ddeSVGFESpotLightElement;
|
||||||
append: ddeAppend<HTMLPictureElement>;
|
"feTile": ddeSVGFETileElement;
|
||||||
}
|
"feTurbulence": ddeSVGFETurbulenceElement;
|
||||||
interface HTMLPreElement{
|
"filter": ddeSVGFilterElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"foreignObject": ddeSVGForeignObjectElement;
|
||||||
append: ddeAppend<HTMLPreElement>;
|
"g": ddeSVGGElement;
|
||||||
}
|
"image": ddeSVGImageElement;
|
||||||
interface HTMLProgressElement{
|
"line": ddeSVGLineElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"linearGradient": ddeSVGLinearGradientElement;
|
||||||
append: ddeAppend<HTMLProgressElement>;
|
"marker": ddeSVGMarkerElement;
|
||||||
}
|
"mask": ddeSVGMaskElement;
|
||||||
interface HTMLScriptElement{
|
"metadata": ddeSVGMetadataElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"mpath": ddeSVGMPathElement;
|
||||||
append: ddeAppend<HTMLScriptElement>;
|
"path": ddeSVGPathElement;
|
||||||
}
|
"pattern": ddeSVGPatternElement;
|
||||||
interface HTMLSelectElement{
|
"polygon": ddeSVGPolygonElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"polyline": ddeSVGPolylineElement;
|
||||||
append: ddeAppend<HTMLSelectElement>;
|
"radialGradient": ddeSVGRadialGradientElement;
|
||||||
}
|
"rect": ddeSVGRectElement;
|
||||||
interface HTMLSlotElement{
|
"script": ddeSVGScriptElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"set": ddeSVGSetElement;
|
||||||
append: ddeAppend<HTMLSlotElement>;
|
"stop": ddeSVGStopElement;
|
||||||
}
|
"style": ddeSVGStyleElement;
|
||||||
interface HTMLSourceElement{
|
"svg": ddeSVGSVGElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"switch": ddeSVGSwitchElement;
|
||||||
append: ddeAppend<HTMLSourceElement>;
|
"symbol": ddeSVGSymbolElement;
|
||||||
}
|
"text": ddeSVGTextElement;
|
||||||
interface HTMLSpanElement{
|
"textPath": ddeSVGTextPathElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"title": ddeSVGTitleElement;
|
||||||
append: ddeAppend<HTMLSpanElement>;
|
"tspan": ddeSVGTSpanElement;
|
||||||
}
|
"use": ddeSVGUseElement;
|
||||||
interface HTMLStyleElement{
|
"view": ddeSVGViewElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
}
|
||||||
append: ddeAppend<HTMLStyleElement>;
|
interface ddeSVGAElement extends SVGAElement{ append: ddeAppend<ddeSVGAElement>; }
|
||||||
}
|
interface ddeSVGAnimateElement extends SVGAnimateElement{ append: ddeAppend<ddeSVGAnimateElement>; }
|
||||||
interface HTMLTableElement{
|
interface ddeSVGAnimateMotionElement extends SVGAnimateMotionElement{ append: ddeAppend<ddeSVGAnimateMotionElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGAnimateTransformElement extends SVGAnimateTransformElement{ append: ddeAppend<ddeSVGAnimateTransformElement>; }
|
||||||
append: ddeAppend<HTMLTableElement>;
|
interface ddeSVGCircleElement extends SVGCircleElement{ append: ddeAppend<ddeSVGCircleElement>; }
|
||||||
}
|
interface ddeSVGClipPathElement extends SVGClipPathElement{ append: ddeAppend<ddeSVGClipPathElement>; }
|
||||||
interface HTMLTableSectionElement{
|
interface ddeSVGDefsElement extends SVGDefsElement{ append: ddeAppend<ddeSVGDefsElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGDescElement extends SVGDescElement{ append: ddeAppend<ddeSVGDescElement>; }
|
||||||
append: ddeAppend<HTMLTableSectionElement>;
|
interface ddeSVGEllipseElement extends SVGEllipseElement{ append: ddeAppend<ddeSVGEllipseElement>; }
|
||||||
}
|
interface ddeSVGFEBlendElement extends SVGFEBlendElement{ append: ddeAppend<ddeSVGFEBlendElement>; }
|
||||||
interface HTMLTableCellElement{
|
interface ddeSVGFEColorMatrixElement extends SVGFEColorMatrixElement{ append: ddeAppend<ddeSVGFEColorMatrixElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEComponentTransferElement extends SVGFEComponentTransferElement{ append: ddeAppend<ddeSVGFEComponentTransferElement>; }
|
||||||
append: ddeAppend<HTMLTableCellElement>;
|
interface ddeSVGFECompositeElement extends SVGFECompositeElement{ append: ddeAppend<ddeSVGFECompositeElement>; }
|
||||||
}
|
interface ddeSVGFEConvolveMatrixElement extends SVGFEConvolveMatrixElement{ append: ddeAppend<ddeSVGFEConvolveMatrixElement>; }
|
||||||
interface HTMLTemplateElement{
|
interface ddeSVGFEDiffuseLightingElement extends SVGFEDiffuseLightingElement{ append: ddeAppend<ddeSVGFEDiffuseLightingElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEDisplacementMapElement extends SVGFEDisplacementMapElement{ append: ddeAppend<ddeSVGFEDisplacementMapElement>; }
|
||||||
append: ddeAppend<HTMLTemplateElement>;
|
interface ddeSVGFEDistantLightElement extends SVGFEDistantLightElement{ append: ddeAppend<ddeSVGFEDistantLightElement>; }
|
||||||
}
|
interface ddeSVGFEDropShadowElement extends SVGFEDropShadowElement{ append: ddeAppend<ddeSVGFEDropShadowElement>; }
|
||||||
interface HTMLTextAreaElement{
|
interface ddeSVGFEFloodElement extends SVGFEFloodElement{ append: ddeAppend<ddeSVGFEFloodElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEFuncAElement extends SVGFEFuncAElement{ append: ddeAppend<ddeSVGFEFuncAElement>; }
|
||||||
append: ddeAppend<HTMLTextAreaElement>;
|
interface ddeSVGFEFuncBElement extends SVGFEFuncBElement{ append: ddeAppend<ddeSVGFEFuncBElement>; }
|
||||||
}
|
interface ddeSVGFEFuncGElement extends SVGFEFuncGElement{ append: ddeAppend<ddeSVGFEFuncGElement>; }
|
||||||
interface HTMLTableCellElement{
|
interface ddeSVGFEFuncRElement extends SVGFEFuncRElement{ append: ddeAppend<ddeSVGFEFuncRElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEGaussianBlurElement extends SVGFEGaussianBlurElement{ append: ddeAppend<ddeSVGFEGaussianBlurElement>; }
|
||||||
append: ddeAppend<HTMLTableCellElement>;
|
interface ddeSVGFEImageElement extends SVGFEImageElement{ append: ddeAppend<ddeSVGFEImageElement>; }
|
||||||
}
|
interface ddeSVGFEMergeElement extends SVGFEMergeElement{ append: ddeAppend<ddeSVGFEMergeElement>; }
|
||||||
interface HTMLTimeElement{
|
interface ddeSVGFEMergeNodeElement extends SVGFEMergeNodeElement{ append: ddeAppend<ddeSVGFEMergeNodeElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEMorphologyElement extends SVGFEMorphologyElement{ append: ddeAppend<ddeSVGFEMorphologyElement>; }
|
||||||
append: ddeAppend<HTMLTimeElement>;
|
interface ddeSVGFEOffsetElement extends SVGFEOffsetElement{ append: ddeAppend<ddeSVGFEOffsetElement>; }
|
||||||
}
|
interface ddeSVGFEPointLightElement extends SVGFEPointLightElement{ append: ddeAppend<ddeSVGFEPointLightElement>; }
|
||||||
interface HTMLTitleElement{
|
interface ddeSVGFESpecularLightingElement extends SVGFESpecularLightingElement{ append: ddeAppend<ddeSVGFESpecularLightingElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFESpotLightElement extends SVGFESpotLightElement{ append: ddeAppend<ddeSVGFESpotLightElement>; }
|
||||||
append: ddeAppend<HTMLTitleElement>;
|
interface ddeSVGFETileElement extends SVGFETileElement{ append: ddeAppend<ddeSVGFETileElement>; }
|
||||||
}
|
interface ddeSVGFETurbulenceElement extends SVGFETurbulenceElement{ append: ddeAppend<ddeSVGFETurbulenceElement>; }
|
||||||
interface HTMLTableRowElement{
|
interface ddeSVGFilterElement extends SVGFilterElement{ append: ddeAppend<ddeSVGFilterElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGForeignObjectElement extends SVGForeignObjectElement{ append: ddeAppend<ddeSVGForeignObjectElement>; }
|
||||||
append: ddeAppend<HTMLTableRowElement>;
|
interface ddeSVGGElement extends SVGGElement{ append: ddeAppend<ddeSVGGElement>; }
|
||||||
}
|
interface ddeSVGImageElement extends SVGImageElement{ append: ddeAppend<ddeSVGImageElement>; }
|
||||||
interface HTMLTrackElement{
|
interface ddeSVGLineElement extends SVGLineElement{ append: ddeAppend<ddeSVGLineElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGLinearGradientElement extends SVGLinearGradientElement{ append: ddeAppend<ddeSVGLinearGradientElement>; }
|
||||||
append: ddeAppend<HTMLTrackElement>;
|
interface ddeSVGMarkerElement extends SVGMarkerElement{ append: ddeAppend<ddeSVGMarkerElement>; }
|
||||||
}
|
interface ddeSVGMaskElement extends SVGMaskElement{ append: ddeAppend<ddeSVGMaskElement>; }
|
||||||
interface HTMLUListElement{
|
interface ddeSVGMetadataElement extends SVGMetadataElement{ append: ddeAppend<ddeSVGMetadataElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGMPathElement extends SVGMPathElement{ append: ddeAppend<ddeSVGMPathElement>; }
|
||||||
append: ddeAppend<HTMLUListElement>;
|
interface ddeSVGPathElement extends SVGPathElement{ append: ddeAppend<ddeSVGPathElement>; }
|
||||||
}
|
interface ddeSVGPatternElement extends SVGPatternElement{ append: ddeAppend<ddeSVGPatternElement>; }
|
||||||
interface HTMLVideoElement{
|
interface ddeSVGPolygonElement extends SVGPolygonElement{ append: ddeAppend<ddeSVGPolygonElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGPolylineElement extends SVGPolylineElement{ append: ddeAppend<ddeSVGPolylineElement>; }
|
||||||
append: ddeAppend<HTMLVideoElement>;
|
interface ddeSVGRadialGradientElement extends SVGRadialGradientElement{ append: ddeAppend<ddeSVGRadialGradientElement>; }
|
||||||
}
|
interface ddeSVGRectElement extends SVGRectElement{ append: ddeAppend<ddeSVGRectElement>; }
|
||||||
interface DocumentFragment{
|
interface ddeSVGScriptElement extends SVGScriptElement{ append: ddeAppend<ddeSVGScriptElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGSetElement extends SVGSetElement{ append: ddeAppend<ddeSVGSetElement>; }
|
||||||
append: ddeAppend<DocumentFragment>;
|
interface ddeSVGStopElement extends SVGStopElement{ append: ddeAppend<ddeSVGStopElement>; }
|
||||||
}
|
interface ddeSVGStyleElement extends SVGStyleElement{ append: ddeAppend<ddeSVGStyleElement>; }
|
||||||
interface SVGElement{
|
interface ddeSVGSVGElement extends SVGSVGElement{ append: ddeAppend<ddeSVGSVGElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGSwitchElement extends SVGSwitchElement{ append: ddeAppend<ddeSVGSwitchElement>; }
|
||||||
append: ddeAppend<SVGElement>;
|
interface ddeSVGSymbolElement extends SVGSymbolElement{ append: ddeAppend<ddeSVGSymbolElement>; }
|
||||||
}
|
interface ddeSVGTextElement extends SVGTextElement{ append: ddeAppend<ddeSVGTextElement>; }
|
||||||
|
interface ddeSVGTextPathElement extends SVGTextPathElement{ append: ddeAppend<ddeSVGTextPathElement>; }
|
||||||
|
interface ddeSVGTitleElement extends SVGTitleElement{ append: ddeAppend<ddeSVGTitleElement>; }
|
||||||
|
interface ddeSVGTSpanElement extends SVGTSpanElement{ append: ddeAppend<ddeSVGTSpanElement>; }
|
||||||
|
interface ddeSVGUseElement extends SVGUseElement{ append: ddeAppend<ddeSVGUseElement>; }
|
||||||
|
interface ddeSVGViewElement extends SVGViewElement{ append: ddeAppend<ddeSVGViewElement>; }
|
||||||
}
|
}
|
2
dist/esm.js
vendored
2
dist/esm.js
vendored
File diff suppressed because one or more lines are too long
@ -119,6 +119,19 @@ main > *{
|
|||||||
font-size: .9rem;
|
font-size: .9rem;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
.prevNext{
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 2fr 1fr;
|
||||||
|
margin-top: 1rem;
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
.prevNext [rel=prev]{
|
||||||
|
grid-column: 1;
|
||||||
|
}
|
||||||
|
.prevNext [rel=next]{
|
||||||
|
grid-column: 3;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
.code{
|
.code{
|
||||||
--shiki-color-text: #e9eded;
|
--shiki-color-text: #e9eded;
|
||||||
--shiki-color-background: #212121;
|
--shiki-color-background: #212121;
|
||||||
@ -152,16 +165,3 @@ main > *{
|
|||||||
background: #212121 !important;
|
background: #212121 !important;
|
||||||
border: 1px solid white;
|
border: 1px solid white;
|
||||||
}
|
}
|
||||||
.prevNext{
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 2fr 1fr;
|
|
||||||
margin-top: 1rem;
|
|
||||||
border-top: 1px solid var(--border);
|
|
||||||
}
|
|
||||||
.prevNext [rel=prev]{
|
|
||||||
grid-column: 1;
|
|
||||||
}
|
|
||||||
.prevNext [rel=next]{
|
|
||||||
grid-column: 3;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Introducing a library."><title>`deka-dom-el` — Introduction</title><!--<dde:mark type="component" name="metaAuthor" host="this" ssr/>--><meta name="author" content="Jan Andrle"><link type="text/plain" rel="author" href="https://jaandrle.github.io/humans.txt"><meta name="generator" content="deka-dom-el"><!--<dde:mark type="component" name="metaTwitter" host="this" ssr/>--><meta name="twitter:card" content="summary_large_image"><meta name="twitter:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="twitter:title" content="deka-dom-el"><meta name="twitter:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="twitter:creator" content="@jaandrle"><!--<dde:mark type="component" name="metaFacebook" host="this" ssr/>--><meta name="og:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="og:title" content="deka-dom-el"><meta name="og:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="og:creator" content="@jaandrle"><script src="https://flems.io/flems.html" type="text/javascript" charset="utf-8"></script><link rel="stylesheet" href="global.css"></head><body><!--<dde:mark type="component" name="page" host="this" ssr/>--><!--<dde:mark type="component" name="header" host="this" ssr/>--><header><h1>`deka-dom-el` — Introduction</h1><p>Introducing a library.</p></header><nav><a href="https://github.com/jaandrle/deka-dom-el"><svg class="icon" viewBox="0 0 32 32"><!--<dde:mark type="component" name="iconGitHub" host="parentElement" ssr/>--><path d="M 16,0.395c -8.836,0 -16,7.163 -16,16c 0,7.069 4.585,13.067 10.942,15.182c 0.8,0.148 1.094,-0.347 1.094,-0.77c 0,-0.381 -0.015,-1.642 -0.022,-2.979c -4.452,0.968 -5.391,-1.888 -5.391,-1.888c -0.728,-1.849 -1.776,-2.341 -1.776,-2.341c -1.452,-0.993 0.11,-0.973 0.11,-0.973c 1.606,0.113 2.452,1.649 2.452,1.649c 1.427,2.446 3.743,1.739 4.656,1.33c 0.143,-1.034 0.558,-1.74 1.016,-2.14c -3.554,-0.404 -7.29,-1.777 -7.29,-7.907c 0,-1.747 0.625,-3.174 1.649,-4.295c -0.166,-0.403 -0.714,-2.03 0.155,-4.234c 0,0 1.344,-0.43 4.401,1.64c 1.276,-0.355 2.645,-0.532 4.005,-0.539c 1.359,0.006 2.729,0.184 4.008,0.539c 3.054,-2.07 4.395,-1.64 4.395,-1.64c 0.871,2.204 0.323,3.831 0.157,4.234c 1.026,1.12 1.647,2.548 1.647,4.295c 0,6.145 -3.743,7.498 -7.306,7.895c 0.574,0.497 1.085,1.47 1.085,2.963c 0,2.141 -0.019,3.864 -0.019,4.391c 0,0.426 0.288,0.925 1.099,0.768c 6.354,-2.118 10.933,-8.113 10.933,-15.18c 0,-8.837 -7.164,-16 -16,-16Z"></path></svg>GitHub</a><a href="./" title="Introducing a library." class="current">1. Introduction</a><a href="p02-elements" title="Basic concepts of elements modifications and creations.">2. Elements</a><a href="p03-events" title="Using not only events in UI declaratively.">3. Events and Addons</a><a href="p04-signals" title="Handling reactivity in UI via signals.">4. Signals and reactivity</a></nav><main><p>The library tries to provide pure JavaScript tool(s) to create reactive interfaces.</p><p>We start with creating and modifying a static elements and end up with UI templates. <i>From <code>document.createElement</code> to <code>el</code>.</i> Then we go through the native events system and the way to include it declaratively in UI templates. <i>From <code>element.addEventListener</code> to <code>on</code>.</i></p><p>Next step is providing interactivity not only for our UI templates. We introduce signals (<code>S</code>) and how them incorporate to UI templates.</p><p>Now we will clarify how the signals are incorporated into our templates with regard to application performance. This is not the only reason the library uses <code>scope</code>s. We will look at how they work in components represented in JavaScript by functions.</p><!--<dde:mark type="component" name="example" host="this" ssr/>--><div id="code-example-1-exquzbx4inc" class="example"><!--<dde:mark type="component" name="code" host="parentElement" ssr/>--><code class="language-js">import { el } from "https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js";
|
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Introducing a library."><title>`deka-dom-el` — Introduction</title><!--<dde:mark type="component" name="metaAuthor" host="this" ssr/>--><meta name="author" content="Jan Andrle"><link type="text/plain" rel="author" href="https://jaandrle.github.io/humans.txt"><meta name="generator" content="deka-dom-el"><!--<dde:mark type="component" name="metaTwitter" host="this" ssr/>--><meta name="twitter:card" content="summary_large_image"><meta name="twitter:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="twitter:title" content="deka-dom-el"><meta name="twitter:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="twitter:creator" content="@jaandrle"><!--<dde:mark type="component" name="metaFacebook" host="this" ssr/>--><meta name="og:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="og:title" content="deka-dom-el"><meta name="og:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="og:creator" content="@jaandrle"><script src="https://flems.io/flems.html" type="text/javascript" charset="utf-8"></script><link rel="stylesheet" href="global.css"></head><body><!--<dde:mark type="component" name="page" host="this" ssr/>--><!--<dde:mark type="component" name="simplePage" host="this" ssr/>--><!--<dde:mark type="component" name="header" host="this" ssr/>--><header><h1>`deka-dom-el` — Introduction</h1><p>Introducing a library.</p></header><nav><a href="https://github.com/jaandrle/deka-dom-el"><svg class="icon" viewBox="0 0 32 32"><!--<dde:mark type="component" name="iconGitHub" host="parentElement" ssr/>--><path d="M 16,0.395c -8.836,0 -16,7.163 -16,16c 0,7.069 4.585,13.067 10.942,15.182c 0.8,0.148 1.094,-0.347 1.094,-0.77c 0,-0.381 -0.015,-1.642 -0.022,-2.979c -4.452,0.968 -5.391,-1.888 -5.391,-1.888c -0.728,-1.849 -1.776,-2.341 -1.776,-2.341c -1.452,-0.993 0.11,-0.973 0.11,-0.973c 1.606,0.113 2.452,1.649 2.452,1.649c 1.427,2.446 3.743,1.739 4.656,1.33c 0.143,-1.034 0.558,-1.74 1.016,-2.14c -3.554,-0.404 -7.29,-1.777 -7.29,-7.907c 0,-1.747 0.625,-3.174 1.649,-4.295c -0.166,-0.403 -0.714,-2.03 0.155,-4.234c 0,0 1.344,-0.43 4.401,1.64c 1.276,-0.355 2.645,-0.532 4.005,-0.539c 1.359,0.006 2.729,0.184 4.008,0.539c 3.054,-2.07 4.395,-1.64 4.395,-1.64c 0.871,2.204 0.323,3.831 0.157,4.234c 1.026,1.12 1.647,2.548 1.647,4.295c 0,6.145 -3.743,7.498 -7.306,7.895c 0.574,0.497 1.085,1.47 1.085,2.963c 0,2.141 -0.019,3.864 -0.019,4.391c 0,0.426 0.288,0.925 1.099,0.768c 6.354,-2.118 10.933,-8.113 10.933,-15.18c 0,-8.837 -7.164,-16 -16,-16Z"></path></svg>GitHub</a><a href="./" title="Introducing a library." class="current">1. Introduction</a><a href="p02-elements" title="Basic concepts of elements modifications and creations.">2. Elements</a><a href="p03-events" title="Using not only events in UI declaratively.">3. Events and Addons</a><a href="p04-signals" title="Handling reactivity in UI via signals.">4. Signals and reactivity</a></nav><main><p>The library tries to provide pure JavaScript tool(s) to create reactive interfaces.</p><p>We start with creating and modifying a static elements and end up with UI templates. <i>From <code>document.createElement</code> to <code>el</code>.</i> Then we go through the native events system and the way to include it declaratively in UI templates. <i>From <code>element.addEventListener</code> to <code>on</code>.</i></p><p>Next step is providing interactivity not only for our UI templates. We introduce signals (<code>S</code>) and how them incorporate to UI templates.</p><p>Now we will clarify how the signals are incorporated into our templates with regard to application performance. This is not the only reason the library uses <code>scope</code>s. We will look at how they work in components represented in JavaScript by functions.</p><!--<dde:mark type="component" name="example" host="this" ssr/>--><div id="code-example-1-exquzbx4inc" class="example"><!--<dde:mark type="component" name="code" host="parentElement" ssr/>--><code class="language-js">import { el } from "https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js";
|
||||||
import { S } from "https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js";
|
import { S } from "https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js";
|
||||||
const clicks= S(0);
|
const clicks= S(0);
|
||||||
document.body.append(
|
document.body.append(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Basic concepts of elements modifications and creations."><title>`deka-dom-el` — Elements</title><!--<dde:mark type="component" name="metaAuthor" host="this" ssr/>--><meta name="author" content="Jan Andrle"><link type="text/plain" rel="author" href="https://jaandrle.github.io/humans.txt"><meta name="generator" content="deka-dom-el"><!--<dde:mark type="component" name="metaTwitter" host="this" ssr/>--><meta name="twitter:card" content="summary_large_image"><meta name="twitter:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="twitter:title" content="deka-dom-el"><meta name="twitter:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="twitter:creator" content="@jaandrle"><!--<dde:mark type="component" name="metaFacebook" host="this" ssr/>--><meta name="og:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="og:title" content="deka-dom-el"><meta name="og:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="og:creator" content="@jaandrle"><script src="https://flems.io/flems.html" type="text/javascript" charset="utf-8"></script><link rel="stylesheet" href="global.css"></head><body><!--<dde:mark type="component" name="page" host="this" ssr/>--><!--<dde:mark type="component" name="header" host="this" ssr/>--><header><h1>`deka-dom-el` — Elements</h1><p>Basic concepts of elements modifications and creations.</p></header><nav><a href="https://github.com/jaandrle/deka-dom-el"><svg class="icon" viewBox="0 0 32 32"><!--<dde:mark type="component" name="iconGitHub" host="parentElement" ssr/>--><path d="M 16,0.395c -8.836,0 -16,7.163 -16,16c 0,7.069 4.585,13.067 10.942,15.182c 0.8,0.148 1.094,-0.347 1.094,-0.77c 0,-0.381 -0.015,-1.642 -0.022,-2.979c -4.452,0.968 -5.391,-1.888 -5.391,-1.888c -0.728,-1.849 -1.776,-2.341 -1.776,-2.341c -1.452,-0.993 0.11,-0.973 0.11,-0.973c 1.606,0.113 2.452,1.649 2.452,1.649c 1.427,2.446 3.743,1.739 4.656,1.33c 0.143,-1.034 0.558,-1.74 1.016,-2.14c -3.554,-0.404 -7.29,-1.777 -7.29,-7.907c 0,-1.747 0.625,-3.174 1.649,-4.295c -0.166,-0.403 -0.714,-2.03 0.155,-4.234c 0,0 1.344,-0.43 4.401,1.64c 1.276,-0.355 2.645,-0.532 4.005,-0.539c 1.359,0.006 2.729,0.184 4.008,0.539c 3.054,-2.07 4.395,-1.64 4.395,-1.64c 0.871,2.204 0.323,3.831 0.157,4.234c 1.026,1.12 1.647,2.548 1.647,4.295c 0,6.145 -3.743,7.498 -7.306,7.895c 0.574,0.497 1.085,1.47 1.085,2.963c 0,2.141 -0.019,3.864 -0.019,4.391c 0,0.426 0.288,0.925 1.099,0.768c 6.354,-2.118 10.933,-8.113 10.933,-15.18c 0,-8.837 -7.164,-16 -16,-16Z"></path></svg>GitHub</a><a href="./" title="Introducing a library.">1. Introduction</a><a href="p02-elements" title="Basic concepts of elements modifications and creations." class="current">2. Elements</a><a href="p03-events" title="Using not only events in UI declaratively.">3. Events and Addons</a><a href="p04-signals" title="Handling reactivity in UI via signals.">4. Signals and reactivity</a></nav><main><h2>Native JavaScript DOM elements creations</h2><p>Let’s go through all patterns we would like to use and what needs to be improved for better experience.</p><h3 id="h-creating-elements-with-custom-attributes"><!--<dde:mark type="component" name="h3" host="parentElement" ssr/>--><a href="#h-creating-elements-with-custom-attributes" tabindex="-1">#</a> Creating element(s) (with custom attributes)</h3><p>You can create a native DOM element by using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement" title="MDN documentation for document.createElement()"><code>document.createElement()</code></a>. It is also possible to provide a some attribute(s) declaratively using <code>Object.assign()</code>. More precisely, this way you can sets some <a href="https://developer.mozilla.org/en-US/docs/Glossary/IDL" title="MDN page about Interface Description Language"><abbr title="Interface Description Language">IDL</abbr></a> also known as a JavaScript property.</p><!--<dde:mark type="component" name="example" host="this" ssr/>--><div id="code-example-1-nkz9lcdhykg" class="example"><!--<dde:mark type="component" name="code" host="parentElement" ssr/>--><code class="language-js">document.body.append(
|
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Basic concepts of elements modifications and creations."><title>`deka-dom-el` — Elements</title><!--<dde:mark type="component" name="metaAuthor" host="this" ssr/>--><meta name="author" content="Jan Andrle"><link type="text/plain" rel="author" href="https://jaandrle.github.io/humans.txt"><meta name="generator" content="deka-dom-el"><!--<dde:mark type="component" name="metaTwitter" host="this" ssr/>--><meta name="twitter:card" content="summary_large_image"><meta name="twitter:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="twitter:title" content="deka-dom-el"><meta name="twitter:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="twitter:creator" content="@jaandrle"><!--<dde:mark type="component" name="metaFacebook" host="this" ssr/>--><meta name="og:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="og:title" content="deka-dom-el"><meta name="og:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="og:creator" content="@jaandrle"><script src="https://flems.io/flems.html" type="text/javascript" charset="utf-8"></script><link rel="stylesheet" href="global.css"></head><body><!--<dde:mark type="component" name="page" host="this" ssr/>--><!--<dde:mark type="component" name="simplePage" host="this" ssr/>--><!--<dde:mark type="component" name="header" host="this" ssr/>--><header><h1>`deka-dom-el` — Elements</h1><p>Basic concepts of elements modifications and creations.</p></header><nav><a href="https://github.com/jaandrle/deka-dom-el"><svg class="icon" viewBox="0 0 32 32"><!--<dde:mark type="component" name="iconGitHub" host="parentElement" ssr/>--><path d="M 16,0.395c -8.836,0 -16,7.163 -16,16c 0,7.069 4.585,13.067 10.942,15.182c 0.8,0.148 1.094,-0.347 1.094,-0.77c 0,-0.381 -0.015,-1.642 -0.022,-2.979c -4.452,0.968 -5.391,-1.888 -5.391,-1.888c -0.728,-1.849 -1.776,-2.341 -1.776,-2.341c -1.452,-0.993 0.11,-0.973 0.11,-0.973c 1.606,0.113 2.452,1.649 2.452,1.649c 1.427,2.446 3.743,1.739 4.656,1.33c 0.143,-1.034 0.558,-1.74 1.016,-2.14c -3.554,-0.404 -7.29,-1.777 -7.29,-7.907c 0,-1.747 0.625,-3.174 1.649,-4.295c -0.166,-0.403 -0.714,-2.03 0.155,-4.234c 0,0 1.344,-0.43 4.401,1.64c 1.276,-0.355 2.645,-0.532 4.005,-0.539c 1.359,0.006 2.729,0.184 4.008,0.539c 3.054,-2.07 4.395,-1.64 4.395,-1.64c 0.871,2.204 0.323,3.831 0.157,4.234c 1.026,1.12 1.647,2.548 1.647,4.295c 0,6.145 -3.743,7.498 -7.306,7.895c 0.574,0.497 1.085,1.47 1.085,2.963c 0,2.141 -0.019,3.864 -0.019,4.391c 0,0.426 0.288,0.925 1.099,0.768c 6.354,-2.118 10.933,-8.113 10.933,-15.18c 0,-8.837 -7.164,-16 -16,-16Z"></path></svg>GitHub</a><a href="./" title="Introducing a library.">1. Introduction</a><a href="p02-elements" title="Basic concepts of elements modifications and creations." class="current">2. Elements</a><a href="p03-events" title="Using not only events in UI declaratively.">3. Events and Addons</a><a href="p04-signals" title="Handling reactivity in UI via signals.">4. Signals and reactivity</a></nav><main><h2>Native JavaScript DOM elements creations</h2><p>Let’s go through all patterns we would like to use and what needs to be improved for better experience.</p><h3 id="h-creating-elements-with-custom-attributes"><!--<dde:mark type="component" name="h3" host="parentElement" ssr/>--><a href="#h-creating-elements-with-custom-attributes" tabindex="-1">#</a> Creating element(s) (with custom attributes)</h3><p>You can create a native DOM element by using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement" title="MDN documentation for document.createElement()"><code>document.createElement()</code></a>. It is also possible to provide a some attribute(s) declaratively using <code>Object.assign()</code>. More precisely, this way you can sets some <a href="https://developer.mozilla.org/en-US/docs/Glossary/IDL" title="MDN page about Interface Description Language"><abbr title="Interface Description Language">IDL</abbr></a> also known as a JavaScript property.</p><!--<dde:mark type="component" name="example" host="this" ssr/>--><div id="code-example-1-nkz9lcdhykg" class="example"><!--<dde:mark type="component" name="code" host="parentElement" ssr/>--><code class="language-js">document.body.append(
|
||||||
document.createElement("div")
|
document.createElement("div")
|
||||||
);
|
);
|
||||||
console.log(
|
console.log(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Using not only events in UI declaratively."><title>`deka-dom-el` — Events and Addons</title><!--<dde:mark type="component" name="metaAuthor" host="this" ssr/>--><meta name="author" content="Jan Andrle"><link type="text/plain" rel="author" href="https://jaandrle.github.io/humans.txt"><meta name="generator" content="deka-dom-el"><!--<dde:mark type="component" name="metaTwitter" host="this" ssr/>--><meta name="twitter:card" content="summary_large_image"><meta name="twitter:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="twitter:title" content="deka-dom-el"><meta name="twitter:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="twitter:creator" content="@jaandrle"><!--<dde:mark type="component" name="metaFacebook" host="this" ssr/>--><meta name="og:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="og:title" content="deka-dom-el"><meta name="og:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="og:creator" content="@jaandrle"><script src="https://flems.io/flems.html" type="text/javascript" charset="utf-8"></script><link rel="stylesheet" href="global.css"></head><body><!--<dde:mark type="component" name="page" host="this" ssr/>--><!--<dde:mark type="component" name="header" host="this" ssr/>--><header><h1>`deka-dom-el` — Events and Addons</h1><p>Using not only events in UI declaratively.</p></header><nav><a href="https://github.com/jaandrle/deka-dom-el"><svg class="icon" viewBox="0 0 32 32"><!--<dde:mark type="component" name="iconGitHub" host="parentElement" ssr/>--><path d="M 16,0.395c -8.836,0 -16,7.163 -16,16c 0,7.069 4.585,13.067 10.942,15.182c 0.8,0.148 1.094,-0.347 1.094,-0.77c 0,-0.381 -0.015,-1.642 -0.022,-2.979c -4.452,0.968 -5.391,-1.888 -5.391,-1.888c -0.728,-1.849 -1.776,-2.341 -1.776,-2.341c -1.452,-0.993 0.11,-0.973 0.11,-0.973c 1.606,0.113 2.452,1.649 2.452,1.649c 1.427,2.446 3.743,1.739 4.656,1.33c 0.143,-1.034 0.558,-1.74 1.016,-2.14c -3.554,-0.404 -7.29,-1.777 -7.29,-7.907c 0,-1.747 0.625,-3.174 1.649,-4.295c -0.166,-0.403 -0.714,-2.03 0.155,-4.234c 0,0 1.344,-0.43 4.401,1.64c 1.276,-0.355 2.645,-0.532 4.005,-0.539c 1.359,0.006 2.729,0.184 4.008,0.539c 3.054,-2.07 4.395,-1.64 4.395,-1.64c 0.871,2.204 0.323,3.831 0.157,4.234c 1.026,1.12 1.647,2.548 1.647,4.295c 0,6.145 -3.743,7.498 -7.306,7.895c 0.574,0.497 1.085,1.47 1.085,2.963c 0,2.141 -0.019,3.864 -0.019,4.391c 0,0.426 0.288,0.925 1.099,0.768c 6.354,-2.118 10.933,-8.113 10.933,-15.18c 0,-8.837 -7.164,-16 -16,-16Z"></path></svg>GitHub</a><a href="./" title="Introducing a library.">1. Introduction</a><a href="p02-elements" title="Basic concepts of elements modifications and creations.">2. Elements</a><a href="p03-events" title="Using not only events in UI declaratively." class="current">3. Events and Addons</a><a href="p04-signals" title="Handling reactivity in UI via signals.">4. Signals and reactivity</a></nav><main><h2>Listenning to the native DOM events and other Addons</h2><p>We quickly introduce helper to listening to the native DOM events. And library syntax/pattern so-called <em>Addon</em> to incorporate not only this in UI templates declaratively.</p><h3 id="h-events-and-listenners"><!--<dde:mark type="component" name="h3" host="parentElement" ssr/>--><a href="#h-events-and-listenners" tabindex="-1">#</a> Events and listenners</h3><p>In JavaScript you can listen to the native DOM events of the given element by using <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener" title="addEventListener on MDN"><code>element.addEventListener(type, listener, options)</code></a>. The library provides an alternative (<code>on</code>) accepting the differen order of the arguments:</p><!--<dde:mark type="component" name="example" host="this" ssr/>--><div id="code-example-1-1wmddlo83w68" class="example"><!--<dde:mark type="component" name="code" host="parentElement" ssr/>--><code class="language-js">import { el, on } from "https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js";
|
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Using not only events in UI declaratively."><title>`deka-dom-el` — Events and Addons</title><!--<dde:mark type="component" name="metaAuthor" host="this" ssr/>--><meta name="author" content="Jan Andrle"><link type="text/plain" rel="author" href="https://jaandrle.github.io/humans.txt"><meta name="generator" content="deka-dom-el"><!--<dde:mark type="component" name="metaTwitter" host="this" ssr/>--><meta name="twitter:card" content="summary_large_image"><meta name="twitter:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="twitter:title" content="deka-dom-el"><meta name="twitter:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="twitter:creator" content="@jaandrle"><!--<dde:mark type="component" name="metaFacebook" host="this" ssr/>--><meta name="og:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="og:title" content="deka-dom-el"><meta name="og:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="og:creator" content="@jaandrle"><script src="https://flems.io/flems.html" type="text/javascript" charset="utf-8"></script><link rel="stylesheet" href="global.css"></head><body><!--<dde:mark type="component" name="page" host="this" ssr/>--><!--<dde:mark type="component" name="simplePage" host="this" ssr/>--><!--<dde:mark type="component" name="header" host="this" ssr/>--><header><h1>`deka-dom-el` — Events and Addons</h1><p>Using not only events in UI declaratively.</p></header><nav><a href="https://github.com/jaandrle/deka-dom-el"><svg class="icon" viewBox="0 0 32 32"><!--<dde:mark type="component" name="iconGitHub" host="parentElement" ssr/>--><path d="M 16,0.395c -8.836,0 -16,7.163 -16,16c 0,7.069 4.585,13.067 10.942,15.182c 0.8,0.148 1.094,-0.347 1.094,-0.77c 0,-0.381 -0.015,-1.642 -0.022,-2.979c -4.452,0.968 -5.391,-1.888 -5.391,-1.888c -0.728,-1.849 -1.776,-2.341 -1.776,-2.341c -1.452,-0.993 0.11,-0.973 0.11,-0.973c 1.606,0.113 2.452,1.649 2.452,1.649c 1.427,2.446 3.743,1.739 4.656,1.33c 0.143,-1.034 0.558,-1.74 1.016,-2.14c -3.554,-0.404 -7.29,-1.777 -7.29,-7.907c 0,-1.747 0.625,-3.174 1.649,-4.295c -0.166,-0.403 -0.714,-2.03 0.155,-4.234c 0,0 1.344,-0.43 4.401,1.64c 1.276,-0.355 2.645,-0.532 4.005,-0.539c 1.359,0.006 2.729,0.184 4.008,0.539c 3.054,-2.07 4.395,-1.64 4.395,-1.64c 0.871,2.204 0.323,3.831 0.157,4.234c 1.026,1.12 1.647,2.548 1.647,4.295c 0,6.145 -3.743,7.498 -7.306,7.895c 0.574,0.497 1.085,1.47 1.085,2.963c 0,2.141 -0.019,3.864 -0.019,4.391c 0,0.426 0.288,0.925 1.099,0.768c 6.354,-2.118 10.933,-8.113 10.933,-15.18c 0,-8.837 -7.164,-16 -16,-16Z"></path></svg>GitHub</a><a href="./" title="Introducing a library.">1. Introduction</a><a href="p02-elements" title="Basic concepts of elements modifications and creations.">2. Elements</a><a href="p03-events" title="Using not only events in UI declaratively." class="current">3. Events and Addons</a><a href="p04-signals" title="Handling reactivity in UI via signals.">4. Signals and reactivity</a></nav><main><h2>Listenning to the native DOM events and other Addons</h2><p>We quickly introduce helper to listening to the native DOM events. And library syntax/pattern so-called <em>Addon</em> to incorporate not only this in UI templates declaratively.</p><h3 id="h-events-and-listenners"><!--<dde:mark type="component" name="h3" host="parentElement" ssr/>--><a href="#h-events-and-listenners" tabindex="-1">#</a> Events and listenners</h3><p>In JavaScript you can listen to the native DOM events of the given element by using <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener" title="addEventListener on MDN"><code>element.addEventListener(type, listener, options)</code></a>. The library provides an alternative (<code>on</code>) accepting the differen order of the arguments:</p><!--<dde:mark type="component" name="example" host="this" ssr/>--><div id="code-example-1-1wmddlo83w68" class="example"><!--<dde:mark type="component" name="code" host="parentElement" ssr/>--><code class="language-js">import { el, on } from "https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js";
|
||||||
const log= mark=> console.log.bind(console, mark);
|
const log= mark=> console.log.bind(console, mark);
|
||||||
|
|
||||||
const button= el("button", "Test click");
|
const button= el("button", "Test click");
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Handling reactivity in UI via signals."><title>`deka-dom-el` — Signals and reactivity</title><!--<dde:mark type="component" name="metaAuthor" host="this" ssr/>--><meta name="author" content="Jan Andrle"><link type="text/plain" rel="author" href="https://jaandrle.github.io/humans.txt"><meta name="generator" content="deka-dom-el"><!--<dde:mark type="component" name="metaTwitter" host="this" ssr/>--><meta name="twitter:card" content="summary_large_image"><meta name="twitter:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="twitter:title" content="deka-dom-el"><meta name="twitter:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="twitter:creator" content="@jaandrle"><!--<dde:mark type="component" name="metaFacebook" host="this" ssr/>--><meta name="og:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="og:title" content="deka-dom-el"><meta name="og:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="og:creator" content="@jaandrle"><script src="https://flems.io/flems.html" type="text/javascript" charset="utf-8"></script><link rel="stylesheet" href="global.css"></head><body><!--<dde:mark type="component" name="page" host="this" ssr/>--><!--<dde:mark type="component" name="header" host="this" ssr/>--><header><h1>`deka-dom-el` — Signals and reactivity</h1><p>Handling reactivity in UI via signals.</p></header><nav><a href="https://github.com/jaandrle/deka-dom-el"><svg class="icon" viewBox="0 0 32 32"><!--<dde:mark type="component" name="iconGitHub" host="parentElement" ssr/>--><path d="M 16,0.395c -8.836,0 -16,7.163 -16,16c 0,7.069 4.585,13.067 10.942,15.182c 0.8,0.148 1.094,-0.347 1.094,-0.77c 0,-0.381 -0.015,-1.642 -0.022,-2.979c -4.452,0.968 -5.391,-1.888 -5.391,-1.888c -0.728,-1.849 -1.776,-2.341 -1.776,-2.341c -1.452,-0.993 0.11,-0.973 0.11,-0.973c 1.606,0.113 2.452,1.649 2.452,1.649c 1.427,2.446 3.743,1.739 4.656,1.33c 0.143,-1.034 0.558,-1.74 1.016,-2.14c -3.554,-0.404 -7.29,-1.777 -7.29,-7.907c 0,-1.747 0.625,-3.174 1.649,-4.295c -0.166,-0.403 -0.714,-2.03 0.155,-4.234c 0,0 1.344,-0.43 4.401,1.64c 1.276,-0.355 2.645,-0.532 4.005,-0.539c 1.359,0.006 2.729,0.184 4.008,0.539c 3.054,-2.07 4.395,-1.64 4.395,-1.64c 0.871,2.204 0.323,3.831 0.157,4.234c 1.026,1.12 1.647,2.548 1.647,4.295c 0,6.145 -3.743,7.498 -7.306,7.895c 0.574,0.497 1.085,1.47 1.085,2.963c 0,2.141 -0.019,3.864 -0.019,4.391c 0,0.426 0.288,0.925 1.099,0.768c 6.354,-2.118 10.933,-8.113 10.933,-15.18c 0,-8.837 -7.164,-16 -16,-16Z"></path></svg>GitHub</a><a href="./" title="Introducing a library.">1. Introduction</a><a href="p02-elements" title="Basic concepts of elements modifications and creations.">2. Elements</a><a href="p03-events" title="Using not only events in UI declaratively.">3. Events and Addons</a><a href="p04-signals" title="Handling reactivity in UI via signals." class="current">4. Signals and reactivity</a></nav><main><h2>Using signals to manage reactivity</h2><p>How a program responds to variable data or user interactions is one of the fundamental problems of programming. If we desire to solve the issue in a declarative manner, signals may be a viable approach.</p><!--<dde:mark type="component" name="example" host="this" ssr/>--><div id="code-example-1-opc0krfvn3k" class="example"><!--<dde:mark type="component" name="code" host="parentElement" ssr/>--><code class="language-js">import { S } from "https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js";
|
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Handling reactivity in UI via signals."><title>`deka-dom-el` — Signals and reactivity</title><!--<dde:mark type="component" name="metaAuthor" host="this" ssr/>--><meta name="author" content="Jan Andrle"><link type="text/plain" rel="author" href="https://jaandrle.github.io/humans.txt"><meta name="generator" content="deka-dom-el"><!--<dde:mark type="component" name="metaTwitter" host="this" ssr/>--><meta name="twitter:card" content="summary_large_image"><meta name="twitter:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="twitter:title" content="deka-dom-el"><meta name="twitter:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="twitter:creator" content="@jaandrle"><!--<dde:mark type="component" name="metaFacebook" host="this" ssr/>--><meta name="og:url" content="https://github.com/jaandrle/deka-dom-el"><meta name="og:title" content="deka-dom-el"><meta name="og:description" content="A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks."><meta name="og:creator" content="@jaandrle"><script src="https://flems.io/flems.html" type="text/javascript" charset="utf-8"></script><link rel="stylesheet" href="global.css"></head><body><!--<dde:mark type="component" name="page" host="this" ssr/>--><!--<dde:mark type="component" name="simplePage" host="this" ssr/>--><!--<dde:mark type="component" name="header" host="this" ssr/>--><header><h1>`deka-dom-el` — Signals and reactivity</h1><p>Handling reactivity in UI via signals.</p></header><nav><a href="https://github.com/jaandrle/deka-dom-el"><svg class="icon" viewBox="0 0 32 32"><!--<dde:mark type="component" name="iconGitHub" host="parentElement" ssr/>--><path d="M 16,0.395c -8.836,0 -16,7.163 -16,16c 0,7.069 4.585,13.067 10.942,15.182c 0.8,0.148 1.094,-0.347 1.094,-0.77c 0,-0.381 -0.015,-1.642 -0.022,-2.979c -4.452,0.968 -5.391,-1.888 -5.391,-1.888c -0.728,-1.849 -1.776,-2.341 -1.776,-2.341c -1.452,-0.993 0.11,-0.973 0.11,-0.973c 1.606,0.113 2.452,1.649 2.452,1.649c 1.427,2.446 3.743,1.739 4.656,1.33c 0.143,-1.034 0.558,-1.74 1.016,-2.14c -3.554,-0.404 -7.29,-1.777 -7.29,-7.907c 0,-1.747 0.625,-3.174 1.649,-4.295c -0.166,-0.403 -0.714,-2.03 0.155,-4.234c 0,0 1.344,-0.43 4.401,1.64c 1.276,-0.355 2.645,-0.532 4.005,-0.539c 1.359,0.006 2.729,0.184 4.008,0.539c 3.054,-2.07 4.395,-1.64 4.395,-1.64c 0.871,2.204 0.323,3.831 0.157,4.234c 1.026,1.12 1.647,2.548 1.647,4.295c 0,6.145 -3.743,7.498 -7.306,7.895c 0.574,0.497 1.085,1.47 1.085,2.963c 0,2.141 -0.019,3.864 -0.019,4.391c 0,0.426 0.288,0.925 1.099,0.768c 6.354,-2.118 10.933,-8.113 10.933,-15.18c 0,-8.837 -7.164,-16 -16,-16Z"></path></svg>GitHub</a><a href="./" title="Introducing a library.">1. Introduction</a><a href="p02-elements" title="Basic concepts of elements modifications and creations.">2. Elements</a><a href="p03-events" title="Using not only events in UI declaratively.">3. Events and Addons</a><a href="p04-signals" title="Handling reactivity in UI via signals." class="current">4. Signals and reactivity</a></nav><main><h2>Using signals to manage reactivity</h2><p>How a program responds to variable data or user interactions is one of the fundamental problems of programming. If we desire to solve the issue in a declarative manner, signals may be a viable approach.</p><!--<dde:mark type="component" name="example" host="this" ssr/>--><div id="code-example-1-opc0krfvn3k" class="example"><!--<dde:mark type="component" name="code" host="parentElement" ssr/>--><code class="language-js">import { S } from "https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js";
|
||||||
// α — `signal` represents a reactive value
|
// α — `signal` represents a reactive value
|
||||||
const signal= S(0);
|
const signal= S(0);
|
||||||
// β — just reacts on signal changes
|
// β — just reacts on signal changes
|
||||||
@ -22,4 +22,4 @@ ac.signal.addEventListener("abort",
|
|||||||
()=> setTimeout(()=> clearInterval(id), 2*interval));
|
()=> setTimeout(()=> clearInterval(id), 2*interval));
|
||||||
|
|
||||||
setTimeout(()=> ac.abort(), 3*interval)
|
setTimeout(()=> ac.abort(), 3*interval)
|
||||||
</code></div><script>Flems(document.getElementById("code-example-1-e9cfsaeb64o"), JSON.parse("{\"files\":[{\"name\":\".js\",\"content\":\"import { S } from \\\"https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js\\\";\\nconst signal= S(0);\\n// computation pattern\\nconst double= S(()=> 2*signal());\\n\\nconst ac= new AbortController();\\nS.on(signal, v=> console.log(\\\"signal\\\", v), { signal: ac.signal });\\nS.on(double, v=> console.log(\\\"double\\\", v), { signal: ac.signal });\\n\\nsignal(signal()+1);\\nconst interval= 5000;\\nconst id= setInterval(()=> signal(signal()+1), interval);\\nac.signal.addEventListener(\\\"abort\\\",\\n\\t()=> setTimeout(()=> clearInterval(id), 2*interval));\\n\\nsetTimeout(()=> ac.abort(), 3*interval)\\n\"}],\"toolbar\":false}"));</script><div class="notice"><p>Mnemonic</p><ul><li><code>S(<value>)</code> — signal: reactive value</li><li><code>S(()=> <computation>)</code> — signal: reactive value dependent on calculation using other signals</li><li><code>S.on(<signal>, <listener>[, <options>])</code> — listen to the signal value changes</li><li><code>S.clear(...<signals>)</code> — off and clear signals</li><li><code>S(<value>, <actions>)</code> — signal: pattern to create complex reactive objects/arrays</li><li><code>S.action(<signal>, <action-name>, ...<action-arguments>)</code> — invoke an action for given signal</li></ul></div></main></body></html>
|
</code></div><script>Flems(document.getElementById("code-example-1-e9cfsaeb64o"), JSON.parse("{\"files\":[{\"name\":\".js\",\"content\":\"import { S } from \\\"https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js\\\";\\nconst signal= S(0);\\n// computation pattern\\nconst double= S(()=> 2*signal());\\n\\nconst ac= new AbortController();\\nS.on(signal, v=> console.log(\\\"signal\\\", v), { signal: ac.signal });\\nS.on(double, v=> console.log(\\\"double\\\", v), { signal: ac.signal });\\n\\nsignal(signal()+1);\\nconst interval= 5000;\\nconst id= setInterval(()=> signal(signal()+1), interval);\\nac.signal.addEventListener(\\\"abort\\\",\\n\\t()=> setTimeout(()=> clearInterval(id), 2*interval));\\n\\nsetTimeout(()=> ac.abort(), 3*interval)\\n\"}],\"toolbar\":false}"));</script><div class="notice"><p>Mnemonic</p><ul><li><code>S(<value>)</code> — signal: reactive value</li><li><code>S(()=> <computation>)</code> — signal: reactive value dependent on calculation using other signals</li><li><code>S.on(<signal>, <listener>[, <options>])</code> — listen to the signal value changes</li><li><code>S.clear(...<signals>)</code> — off and clear signals</li><li><code>S(<value>, <actions>)</code> — signal: pattern to create complex reactive objects/arrays</li><li><code>S.action(<signal>, <action-name>, ...<action-arguments>)</code> — invoke an action for given signal</li></ul></div><div class="prevNext"><!--<dde:mark type="component" name="prevNext" host="parentElement" ssr/>--><a rel="prev" href="p03-events" title="Using not only events in UI declaratively."><!--<dde:mark type="component" name="pageLink" host="parentElement" ssr/>-->Events and Addons (previous)</a><!--<dde:mark type="component" name="pageLink" host="this" ssr/>--></div></main></body></html>
|
@ -1,43 +1,36 @@
|
|||||||
import "./global.css.js";
|
import { simplePage } from "./layout/simplePage.html.js";
|
||||||
|
|
||||||
import { el } from "deka-dom-el";
|
import { el } from "deka-dom-el";
|
||||||
|
|
||||||
import { header } from "./layout/head.html.js";
|
|
||||||
import { example } from "./components/example.html.js";
|
import { example } from "./components/example.html.js";
|
||||||
import { prevNext } from "./components/pageUtils.html.js";
|
|
||||||
|
|
||||||
/** @param {import("./types.d.ts").PageAttrs} attrs */
|
/** @param {import("./types.d.ts").PageAttrs} attrs */
|
||||||
export function page({ pkg, info }){
|
export function page({ pkg, info }){
|
||||||
const page_id= info.id;
|
const page_id= info.id;
|
||||||
return el().append(
|
return el(simplePage, { info, pkg }).append(
|
||||||
el(header, { info, pkg }),
|
el("p", "The library tries to provide pure JavaScript tool(s) to create reactive interfaces."),
|
||||||
el("main").append(
|
el("p").append(
|
||||||
el("p", "The library tries to provide pure JavaScript tool(s) to create reactive interfaces."),
|
"We start with creating and modifying a static elements and end up with UI templates.",
|
||||||
el("p").append(
|
" ",
|
||||||
"We start with creating and modifying a static elements and end up with UI templates.",
|
el("i").append(
|
||||||
" ",
|
"From ", el("code", "document.createElement"), " to ", el("code", "el"), "."
|
||||||
el("i").append(
|
|
||||||
"From ", el("code", "document.createElement"), " to ", el("code", "el"), "."
|
|
||||||
),
|
|
||||||
" ",
|
|
||||||
"Then we go through the native events system and the way to include it declaratively in UI templates.",
|
|
||||||
" ",
|
|
||||||
el("i").append(
|
|
||||||
"From ", el("code", "element.addEventListener"), " to ", el("code", "on"), "."
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
el("p").append(
|
" ",
|
||||||
"Next step is providing interactivity not only for our UI templates.",
|
"Then we go through the native events system and the way to include it declaratively in UI templates.",
|
||||||
" ",
|
" ",
|
||||||
"We introduce signals (", el("code", "S"), ") and how them incorporate to UI templates.",
|
el("i").append(
|
||||||
|
"From ", el("code", "element.addEventListener"), " to ", el("code", "on"), "."
|
||||||
),
|
),
|
||||||
el("p").append(
|
),
|
||||||
"Now we will clarify how the signals are incorporated into our templates with regard ",
|
el("p").append(
|
||||||
"to application performance. This is not the only reason the library uses ",
|
"Next step is providing interactivity not only for our UI templates.",
|
||||||
el("code", "scope"), "s. We will look at how they work in components represented ",
|
" ",
|
||||||
"in JavaScript by functions."
|
"We introduce signals (", el("code", "S"), ") and how them incorporate to UI templates.",
|
||||||
),
|
),
|
||||||
el(example, { src: new URL("./components/examples/helloWorld.js", import.meta.url), page_id }),
|
el("p").append(
|
||||||
el(prevNext, info)
|
"Now we will clarify how the signals are incorporated into our templates with regard ",
|
||||||
)
|
"to application performance. This is not the only reason the library uses ",
|
||||||
|
el("code", "scope"), "s. We will look at how they work in components represented ",
|
||||||
|
"in JavaScript by functions."
|
||||||
|
),
|
||||||
|
el(example, { src: new URL("./components/examples/helloWorld.js", import.meta.url), page_id }),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
16
docs_src/layout/simplePage.html.js
Normal file
16
docs_src/layout/simplePage.html.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import "../global.css.js";
|
||||||
|
import { el, simulateSlots } from "deka-dom-el";
|
||||||
|
|
||||||
|
import { header } from "./head.html.js";
|
||||||
|
import { prevNext } from "../components/pageUtils.html.js";
|
||||||
|
|
||||||
|
/** @param {import("../types.d.ts").PageAttrs} attrs */
|
||||||
|
export function simplePage({ pkg, info }){
|
||||||
|
return simulateSlots(el().append(
|
||||||
|
el(header, { info, pkg }),
|
||||||
|
el("main").append(
|
||||||
|
el("slot"),
|
||||||
|
el(prevNext, info)
|
||||||
|
)
|
||||||
|
));
|
||||||
|
}
|
@ -1,147 +1,139 @@
|
|||||||
import "./global.css.js";
|
import { simplePage } from "./layout/simplePage.html.js";
|
||||||
|
|
||||||
import { el } from "deka-dom-el";
|
import { el } from "deka-dom-el";
|
||||||
|
|
||||||
import { header } from "./layout/head.html.js";
|
|
||||||
import { example } from "./components/example.html.js";
|
import { example } from "./components/example.html.js";
|
||||||
import { h3, prevNext } from "./components/pageUtils.html.js";
|
import { h3 } from "./components/pageUtils.html.js";
|
||||||
|
|
||||||
/** @param {string} url */
|
/** @param {string} url */
|
||||||
const fileURL= url=> new URL(url, import.meta.url);
|
const fileURL= url=> new URL(url, import.meta.url);
|
||||||
|
|
||||||
/** @param {import("./types.d.ts").PageAttrs} attrs */
|
/** @param {import("./types.d.ts").PageAttrs} attrs */
|
||||||
export function page({ pkg, info }){
|
export function page({ pkg, info }){
|
||||||
const page_id= info.id;
|
const page_id= info.id;
|
||||||
return el().append(
|
return el(simplePage, { info, pkg }).append(
|
||||||
el(header, { info, pkg }),
|
el("h2", "Native JavaScript DOM elements creations"),
|
||||||
el("main").append(
|
el("p", "Let’s go through all patterns we would like to use and what needs to be improved for better experience."),
|
||||||
el("h2", "Native JavaScript DOM elements creations"),
|
|
||||||
el("p", "Let’s go through all patterns we would like to use and what needs to be improved for better experience."),
|
|
||||||
|
|
||||||
el(h3, "Creating element(s) (with custom attributes)"),
|
el(h3, "Creating element(s) (with custom attributes)"),
|
||||||
el("p").append(
|
el("p").append(
|
||||||
"You can create a native DOM element by using the ",
|
"You can create a native DOM element by using the ",
|
||||||
el("a", { href: "https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement", title: "MDN documentation for document.createElement()" }).append(
|
el("a", { href: "https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement", title: "MDN documentation for document.createElement()" }).append(
|
||||||
el("code", "document.createElement()")
|
el("code", "document.createElement()")
|
||||||
), ". ",
|
), ". ",
|
||||||
"It is also possible to provide a some attribute(s) declaratively using ", el("code", "Object.assign()"), ". ",
|
"It is also possible to provide a some attribute(s) declaratively using ", el("code", "Object.assign()"), ". ",
|
||||||
"More precisely, this way you can sets some ",
|
"More precisely, this way you can sets some ",
|
||||||
el("a", {
|
el("a", {
|
||||||
href: "https://developer.mozilla.org/en-US/docs/Glossary/IDL",
|
href: "https://developer.mozilla.org/en-US/docs/Glossary/IDL",
|
||||||
title: "MDN page about Interface Description Language"
|
title: "MDN page about Interface Description Language"
|
||||||
}).append(
|
}).append(
|
||||||
el("abbr", { textContent: "IDL", title: "Interface Description Language" })
|
el("abbr", { textContent: "IDL", title: "Interface Description Language" })
|
||||||
), " also known as a JavaScript property."
|
), " also known as a JavaScript property."
|
||||||
|
),
|
||||||
|
el(example, { src: fileURL("./components/examples/elements/nativeCreateElement.js"), page_id }),
|
||||||
|
el("p").append(
|
||||||
|
"To make this easier, you can use the ", el("code", "el"), " function. ",
|
||||||
|
"Internally in basic examples, it is wrapper around ", el("code", "assign(document.createElement(…), { … })"), "."
|
||||||
|
),
|
||||||
|
el(example, { src: fileURL("./components/examples/elements/dekaCreateElement.js"), page_id }),
|
||||||
|
el("p").append(
|
||||||
|
"The ", el("code", "assign"), " function provides improved behaviour of ", el("code", "Object.assign()"), ". ",
|
||||||
|
"You can declaratively sets any IDL and attribute of the given element. ",
|
||||||
|
"Function prefers IDL and fallback to the ", el("code", "element.setAttribute"), " if there is no writable property in the element prototype."
|
||||||
|
),
|
||||||
|
el("p").append(
|
||||||
|
"You can study all JavaScript elements interfaces to the corresponding HTML elements. ",
|
||||||
|
"All HTML elements inherits from ", el("a", { textContent: "HTMLElement", href: "https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement" }), ". ",
|
||||||
|
"To see all available IDLs for example for paragraphs, see ", el("a", { textContent: "HTMLParagraphElement", href: "https://developer.mozilla.org/en-US/docs/Web/API/HTMLParagraphElement" }), ". ",
|
||||||
|
"Moreover, the ", el("code", "assign"), " provides a way to sets declaratively some convenient properties:"
|
||||||
|
),
|
||||||
|
el("ul").append(
|
||||||
|
el("li").append(
|
||||||
|
"It is possible to sets ", el("code", "data-*"), "/", el("code", "aria-*"), " attributes using object notation."
|
||||||
),
|
),
|
||||||
el(example, { src: fileURL("./components/examples/elements/nativeCreateElement.js"), page_id }),
|
el("li").append(
|
||||||
el("p").append(
|
"In opposite, it is also possible to sets ", el("code", "data-*"), "/", el("code", "aria-*"), " attribute using camelCase notation."
|
||||||
"To make this easier, you can use the ", el("code", "el"), " function. ",
|
|
||||||
"Internally in basic examples, it is wrapper around ", el("code", "assign(document.createElement(…), { … })"), "."
|
|
||||||
),
|
),
|
||||||
el(example, { src: fileURL("./components/examples/elements/dekaCreateElement.js"), page_id }),
|
el("li").append(
|
||||||
el("p").append(
|
"You can use string or object as a value for ", el("code", "style"), " property."
|
||||||
"The ", el("code", "assign"), " function provides improved behaviour of ", el("code", "Object.assign()"), ". ",
|
|
||||||
"You can declaratively sets any IDL and attribute of the given element. ",
|
|
||||||
"Function prefers IDL and fallback to the ", el("code", "element.setAttribute"), " if there is no writable property in the element prototype."
|
|
||||||
),
|
),
|
||||||
el("p").append(
|
el("li").append(
|
||||||
"You can study all JavaScript elements interfaces to the corresponding HTML elements. ",
|
el("code", "className"), " (IDL – preffered)/", el("code", "class"), " are ways to add CSS class to the element. ",
|
||||||
"All HTML elements inherits from ", el("a", { textContent: "HTMLElement", href: "https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement" }), ". ",
|
"You can use string (similarly to ", el("code", "class=\"…\"") ," syntax in HTML) or array of strings. ",
|
||||||
"To see all available IDLs for example for paragraphs, see ", el("a", { textContent: "HTMLParagraphElement", href: "https://developer.mozilla.org/en-US/docs/Web/API/HTMLParagraphElement" }), ". ",
|
"This is handy to concat conditional classes."
|
||||||
"Moreover, the ", el("code", "assign"), " provides a way to sets declaratively some convenient properties:"
|
|
||||||
),
|
),
|
||||||
|
el("li").append(
|
||||||
|
"Use ", el("code", "classList"), " to toggle specific classes. This will be handy later when the reactivity via signals is beeing introduced.",
|
||||||
|
),
|
||||||
|
el("li").append(
|
||||||
|
"The ", el("code", "assign"), " also accepts the ", el("code", "undefined"), " as a value for any property to remove it from the element declaratively. ",
|
||||||
|
"Also for some IDL the corresponding attribute is removed as it can be confusing. ",
|
||||||
|
el("em").append(
|
||||||
|
"For example, natievly the element’s ", el("code", "id"), " is removed by setting the IDL to an empty string."
|
||||||
|
)
|
||||||
|
),
|
||||||
|
el("li").append(
|
||||||
|
"You can use ", el("code", "="), " or ", el("code", "."), " to force processing given key as attribute/property of the element."
|
||||||
|
)
|
||||||
|
),
|
||||||
|
el("p").append(
|
||||||
|
"For processing, the ", el("code", "assign"), " internally uses ", el("code", "assignAttribute"), " and ", el("code", "classListDeclarative"), "."
|
||||||
|
),
|
||||||
|
el(example, { src: fileURL("./components/examples/elements/dekaAssign.js"), page_id }),
|
||||||
|
|
||||||
|
el(h3, "Native JavaScript templating"),
|
||||||
|
el("p", "By default, the native JS has no good way to define HTML template using DOM API:"),
|
||||||
|
el(example, { src: fileURL("./components/examples/elements/nativeAppend.js"), page_id }),
|
||||||
|
el("p").append(
|
||||||
|
"This library therefore overwrites the ", el("code", "append"), " method of created elements to always return parent element."
|
||||||
|
),
|
||||||
|
el(example, { src: fileURL("./components/examples/elements/dekaAppend.js"), page_id }),
|
||||||
|
|
||||||
|
|
||||||
|
el(h3, "Basic (state-less) components"),
|
||||||
|
el("p").append(
|
||||||
|
"You can use functions for encapsulation (repeating) logic. ",
|
||||||
|
"The ", el("code", "el"), " accepts function as first argument. ",
|
||||||
|
"In that case, the function should return dom elements and the second argument for ", el("code", "el"), " is argument for given element."
|
||||||
|
),
|
||||||
|
el(example, { src: fileURL("./components/examples/elements/dekaBasicComponent.js"), page_id }),
|
||||||
|
el("p").append(
|
||||||
|
"As you can see, in case of state-less/basic components there is no difference",
|
||||||
|
" between calling component function directly or using ", el("code", "el"), " function.",
|
||||||
|
),
|
||||||
|
el("p", { className: "notice" }).append(
|
||||||
|
"It is nice to use similar naming convention as native DOM API. ",
|
||||||
|
"This allows us to use ", el("a", { textContent: "the destructuring assignment syntax", href: "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment", title: "Destructuring assignment | MDN" }),
|
||||||
|
" and keep track of the native API (things are best remembered through regular use).",
|
||||||
|
),
|
||||||
|
|
||||||
|
el(h3, "Creating non-HTML elements"),
|
||||||
|
el("p").append(
|
||||||
|
"Similarly to the native DOM API (", el("a", { href: "https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS", title: "MDN" }).append(el("code", "document.createElementNS")), ") for non-HTML elements",
|
||||||
|
" we need to tell JavaScript which kind of the element to create.",
|
||||||
|
" We can use the ", el("code", "elNS"), " function:"
|
||||||
|
),
|
||||||
|
el(example, { src: fileURL("./components/examples/elements/dekaElNS.js"), page_id }),
|
||||||
|
|
||||||
|
el("div", { className: "notice" }).append(
|
||||||
|
el("p", "Mnemonic"),
|
||||||
el("ul").append(
|
el("ul").append(
|
||||||
el("li").append(
|
el("li").append(
|
||||||
"It is possible to sets ", el("code", "data-*"), "/", el("code", "aria-*"), " attributes using object notation."
|
el("code", "assign(<element>, ...<idl-objects>): <element>"), " — assign properties to the element",
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
"In opposite, it is also possible to sets ", el("code", "data-*"), "/", el("code", "aria-*"), " attribute using camelCase notation."
|
el("code", "el(<tag-name>, <primitive>)[.append(...)]: <element-from-tag-name>"), " — simple element containing only text",
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
"You can use string or object as a value for ", el("code", "style"), " property."
|
el("code", "el(<tag-name>, <idl-object>)[.append(...)]: <element-from-tag-name>"), " — element with more properties",
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
el("code", "className"), " (IDL – preffered)/", el("code", "class"), " are ways to add CSS class to the element. ",
|
el("code", "el(<function>, <function-argument(s)>)[.append(...)]: <element-returned-by-function>"), " — using component represented by function",
|
||||||
"You can use string (similarly to ", el("code", "class=\"…\"") ," syntax in HTML) or array of strings. ",
|
|
||||||
"This is handy to concat conditional classes."
|
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
"Use ", el("code", "classList"), " to toggle specific classes. This will be handy later when the reactivity via signals is beeing introduced.",
|
el("code", "el(<...>, <...>, ...<addons>)"), " — see following page"
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
"The ", el("code", "assign"), " also accepts the ", el("code", "undefined"), " as a value for any property to remove it from the element declaratively. ",
|
el("code", "elNS(<namespace>)(<as-el-see-above>)[.append(...)]: <element-based-on-arguments>"), " — typically SVG elements",
|
||||||
"Also for some IDL the corresponding attribute is removed as it can be confusing. ",
|
|
||||||
el("em").append(
|
|
||||||
"For example, natievly the element’s ", el("code", "id"), " is removed by setting the IDL to an empty string."
|
|
||||||
)
|
|
||||||
),
|
|
||||||
el("li").append(
|
|
||||||
"You can use ", el("code", "="), " or ", el("code", "."), " to force processing given key as attribute/property of the element."
|
|
||||||
)
|
)
|
||||||
),
|
)
|
||||||
el("p").append(
|
),
|
||||||
"For processing, the ", el("code", "assign"), " internally uses ", el("code", "assignAttribute"), " and ", el("code", "classListDeclarative"), "."
|
|
||||||
),
|
|
||||||
el(example, { src: fileURL("./components/examples/elements/dekaAssign.js"), page_id }),
|
|
||||||
|
|
||||||
el(h3, "Native JavaScript templating"),
|
|
||||||
el("p", "By default, the native JS has no good way to define HTML template using DOM API:"),
|
|
||||||
el(example, { src: fileURL("./components/examples/elements/nativeAppend.js"), page_id }),
|
|
||||||
el("p").append(
|
|
||||||
"This library therefore overwrites the ", el("code", "append"), " method of created elements to always return parent element."
|
|
||||||
),
|
|
||||||
el(example, { src: fileURL("./components/examples/elements/dekaAppend.js"), page_id }),
|
|
||||||
|
|
||||||
|
|
||||||
el(h3, "Basic (state-less) components"),
|
|
||||||
el("p").append(
|
|
||||||
"You can use functions for encapsulation (repeating) logic. ",
|
|
||||||
"The ", el("code", "el"), " accepts function as first argument. ",
|
|
||||||
"In that case, the function should return dom elements and the second argument for ", el("code", "el"), " is argument for given element."
|
|
||||||
),
|
|
||||||
el(example, { src: fileURL("./components/examples/elements/dekaBasicComponent.js"), page_id }),
|
|
||||||
el("p").append(
|
|
||||||
"As you can see, in case of state-less/basic components there is no difference",
|
|
||||||
" between calling component function directly or using ", el("code", "el"), " function.",
|
|
||||||
),
|
|
||||||
el("p", { className: "notice" }).append(
|
|
||||||
"It is nice to use similar naming convention as native DOM API. ",
|
|
||||||
"This allows us to use ", el("a", { textContent: "the destructuring assignment syntax", href: "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment", title: "Destructuring assignment | MDN" }),
|
|
||||||
" and keep track of the native API (things are best remembered through regular use).",
|
|
||||||
),
|
|
||||||
|
|
||||||
el(h3, "Creating non-HTML elements"),
|
|
||||||
el("p").append(
|
|
||||||
"Similarly to the native DOM API (", el("a", { href: "https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS", title: "MDN" }).append(el("code", "document.createElementNS")), ") for non-HTML elements",
|
|
||||||
" we need to tell JavaScript which kind of the element to create.",
|
|
||||||
" We can use the ", el("code", "elNS"), " function:"
|
|
||||||
),
|
|
||||||
el(example, { src: fileURL("./components/examples/elements/dekaElNS.js"), page_id }),
|
|
||||||
|
|
||||||
el("div", { className: "notice" }).append(
|
|
||||||
el("p", "Mnemonic"),
|
|
||||||
el("ul").append(
|
|
||||||
el("li").append(
|
|
||||||
el("code", "assign(<element>, ...<idl-objects>): <element>"), " — assign properties to the element",
|
|
||||||
),
|
|
||||||
el("li").append(
|
|
||||||
el("code", "el(<tag-name>, <primitive>)[.append(...)]: <element-from-tag-name>"), " — simple element containing only text",
|
|
||||||
),
|
|
||||||
el("li").append(
|
|
||||||
el("code", "el(<tag-name>, <idl-object>)[.append(...)]: <element-from-tag-name>"), " — element with more properties",
|
|
||||||
),
|
|
||||||
el("li").append(
|
|
||||||
el("code", "el(<function>, <function-argument(s)>)[.append(...)]: <element-returned-by-function>"), " — using component represented by function",
|
|
||||||
),
|
|
||||||
el("li").append(
|
|
||||||
el("code", "el(<...>, <...>, ...<addons>)"), " — see following page"
|
|
||||||
),
|
|
||||||
el("li").append(
|
|
||||||
el("code", "elNS(<namespace>)(<as-el-see-above>)[.append(...)]: <element-based-on-arguments>"), " — typically SVG elements",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
|
|
||||||
el(prevNext, info)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,139 +1,131 @@
|
|||||||
import "./global.css.js";
|
import { simplePage } from "./layout/simplePage.html.js";
|
||||||
|
|
||||||
import { el } from "deka-dom-el";
|
import { el } from "deka-dom-el";
|
||||||
|
|
||||||
import { header } from "./layout/head.html.js";
|
|
||||||
import { example } from "./components/example.html.js";
|
import { example } from "./components/example.html.js";
|
||||||
import { h3, prevNext } from "./components/pageUtils.html.js";
|
import { h3 } from "./components/pageUtils.html.js";
|
||||||
|
|
||||||
/** @param {string} url */
|
/** @param {string} url */
|
||||||
const fileURL= url=> new URL(url, import.meta.url);
|
const fileURL= url=> new URL(url, import.meta.url);
|
||||||
|
|
||||||
/** @param {import("./types.d.ts").PageAttrs} attrs */
|
/** @param {import("./types.d.ts").PageAttrs} attrs */
|
||||||
export function page({ pkg, info }){
|
export function page({ pkg, info }){
|
||||||
const page_id= info.id;
|
const page_id= info.id;
|
||||||
return el().append(
|
return el(simplePage, { info, pkg }).append(
|
||||||
el(header, { info, pkg }),
|
el("h2", "Listenning to the native DOM events and other Addons"),
|
||||||
el("main").append(
|
el("p").append(
|
||||||
el("h2", "Listenning to the native DOM events and other Addons"),
|
"We quickly introduce helper to listening to the native DOM events.",
|
||||||
el("p").append(
|
" ",
|
||||||
"We quickly introduce helper to listening to the native DOM events.",
|
"And library syntax/pattern so-called ", el("em", "Addon"), " to",
|
||||||
" ",
|
" incorporate not only this in UI templates declaratively."
|
||||||
"And library syntax/pattern so-called ", el("em", "Addon"), " to",
|
),
|
||||||
" incorporate not only this in UI templates declaratively."
|
|
||||||
),
|
|
||||||
|
|
||||||
el(h3, "Events and listenners"),
|
el(h3, "Events and listenners"),
|
||||||
|
el("p").append(
|
||||||
|
"In JavaScript you can listen to the native DOM events of the given element by using ",
|
||||||
|
el("a", { href: "https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener", title: "addEventListener on MDN" }).append(
|
||||||
|
el("code", "element.addEventListener(type, listener, options)")
|
||||||
|
), ".",
|
||||||
|
" ",
|
||||||
|
"The library provides an alternative (", el("code", "on"), ") accepting the differen order",
|
||||||
|
" of the arguments:"
|
||||||
|
),
|
||||||
|
el(example, { src: fileURL("./components/examples/events/compare.js"), page_id }),
|
||||||
|
el("p").append(
|
||||||
|
"…this is actually one of the two differences. The another one is that ", el("code", "on"),
|
||||||
|
" accepts only object as the ", el("code", "options"), " (but it is still optional)."
|
||||||
|
),
|
||||||
|
el("p", { className: "notice" }).append(
|
||||||
|
"The other difference is that there is ", el("strong", "no"), " ", el("code", "off"), " function.",
|
||||||
|
" ",
|
||||||
|
"You can remove listener declaratively using ", el("a", { textContent: "AbortSignal", href: "https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#signal", title: "part of addEventListener on MDN" }),
|
||||||
|
":"
|
||||||
|
),
|
||||||
|
el(example, { src: fileURL("./components/examples/events/abortSignal.js"), page_id }),
|
||||||
|
el("div", { className: "notice" }).append(
|
||||||
|
el("p", "So, there are (typically) three ways to handle events. You can use:"),
|
||||||
|
el("ul").append(
|
||||||
|
el("li").append( el("code", `el("button", { textContent: "click me", "=onclick": "console.log(event)" })`)),
|
||||||
|
el("li").append( el("code", `el("button", { textContent: "click me", onclick: console.log })`)),
|
||||||
|
el("li").append( el("code", `el("button", { textContent: "click me" }, on("click", console.log))`))
|
||||||
|
),
|
||||||
el("p").append(
|
el("p").append(
|
||||||
"In JavaScript you can listen to the native DOM events of the given element by using ",
|
"In the first example we force to use HTML attribute (it corresponds to ", el("code", `<button onclick="console.log(event)">click me</button>`), ").",
|
||||||
el("a", { href: "https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener", title: "addEventListener on MDN" }).append(
|
|
||||||
el("code", "element.addEventListener(type, listener, options)")
|
|
||||||
), ".",
|
|
||||||
" ",
|
" ",
|
||||||
"The library provides an alternative (", el("code", "on"), ") accepting the differen order",
|
el("em", "Side note: this can be useful in case of SSR."),
|
||||||
" of the arguments:"
|
|
||||||
),
|
|
||||||
el(example, { src: fileURL("./components/examples/events/compare.js"), page_id }),
|
|
||||||
el("p").append(
|
|
||||||
"…this is actually one of the two differences. The another one is that ", el("code", "on"),
|
|
||||||
" accepts only object as the ", el("code", "options"), " (but it is still optional)."
|
|
||||||
),
|
|
||||||
el("p", { className: "notice" }).append(
|
|
||||||
"The other difference is that there is ", el("strong", "no"), " ", el("code", "off"), " function.",
|
|
||||||
" ",
|
" ",
|
||||||
"You can remove listener declaratively using ", el("a", { textContent: "AbortSignal", href: "https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#signal", title: "part of addEventListener on MDN" }),
|
"To study difference, you can read a nice summary here: ", el("a", { href: "https://gist.github.com/WebReflection/b404c36f46371e3b1173bf5492acc944", textContent: "GIST @WebReflection/web_events.md" }), "."
|
||||||
":"
|
)
|
||||||
),
|
),
|
||||||
el(example, { src: fileURL("./components/examples/events/abortSignal.js"), page_id }),
|
|
||||||
el("div", { className: "notice" }).append(
|
|
||||||
el("p", "So, there are (typically) three ways to handle events. You can use:"),
|
|
||||||
el("ul").append(
|
|
||||||
el("li").append( el("code", `el("button", { textContent: "click me", "=onclick": "console.log(event)" })`)),
|
|
||||||
el("li").append( el("code", `el("button", { textContent: "click me", onclick: console.log })`)),
|
|
||||||
el("li").append( el("code", `el("button", { textContent: "click me" }, on("click", console.log))`))
|
|
||||||
),
|
|
||||||
el("p").append(
|
|
||||||
"In the first example we force to use HTML attribute (it corresponds to ", el("code", `<button onclick="console.log(event)">click me</button>`), ").",
|
|
||||||
" ",
|
|
||||||
el("em", "Side note: this can be useful in case of SSR."),
|
|
||||||
" ",
|
|
||||||
"To study difference, you can read a nice summary here: ", el("a", { href: "https://gist.github.com/WebReflection/b404c36f46371e3b1173bf5492acc944", textContent: "GIST @WebReflection/web_events.md" }), "."
|
|
||||||
)
|
|
||||||
),
|
|
||||||
|
|
||||||
el(h3, "Addons"),
|
el(h3, "Addons"),
|
||||||
el("p").append(
|
el("p").append(
|
||||||
"From practical point of view, ", el("em", "Addons"), " are just functions that accept any html element",
|
"From practical point of view, ", el("em", "Addons"), " are just functions that accept any html element",
|
||||||
" as their first parameter. You can see that the ", el("code", "on(…)"), " fullfills this requirement."
|
" as their first parameter. You can see that the ", el("code", "on(…)"), " fullfills this requirement."
|
||||||
|
),
|
||||||
|
el("p").append(
|
||||||
|
"You can use Addons as ≥3rd argument of ", el("code", "el"), " function. This way is possible to extends",
|
||||||
|
" you templates by additional (3rd party) functionalities. But for now mainly, you can add events listeners:"
|
||||||
|
),
|
||||||
|
el(example, { src: fileURL("./components/examples/events/templateWithListeners.js"), page_id }),
|
||||||
|
el("p").append(
|
||||||
|
"As the example shows, you can also provide types in JSDoc+TypeScript by using global type ", el("code", "ddeElementAddon"), ".",
|
||||||
|
" ",
|
||||||
|
"Also notice, you can use Addons to get element reference.",
|
||||||
|
),
|
||||||
|
el(h3, "Life-cycle events"),
|
||||||
|
el("p").append(
|
||||||
|
"Addons are called immediately when the element is created, even it is not connected to live DOM yet.",
|
||||||
|
" ",
|
||||||
|
"Therefore, you can understand the Addon to be “oncreate” event."
|
||||||
|
),
|
||||||
|
el("p").append(
|
||||||
|
"The library provide three additional live-cycle events corresponding to how they are named in",
|
||||||
|
" a case of custom elements: ", el("code", "on.connected"), ", ", el("code", "on.disconnected"),
|
||||||
|
" and ", el("code", "on.attributeChanged"), "."
|
||||||
|
),
|
||||||
|
el(example, { src: fileURL("./components/examples/events/live-cycle.js"), page_id }),
|
||||||
|
el("p").append(
|
||||||
|
"For Custom elements, we will later introduce a way to replace ", el("code", "*Callback"),
|
||||||
|
" syntax with ", el("code", "dde:*"), " events. The ", el("code", "on.*"), " functions then",
|
||||||
|
" listen to the appropriate Custom Elements events (see ", el("a", { textContent: "Custom element lifecycle callbacks | MDN", href: "https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#custom_element_lifecycle_callbacks" }), ")."
|
||||||
|
),
|
||||||
|
el("p").append(
|
||||||
|
"But, in case of regular elemnets the ", el("a", { href: "https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver" }).append(el("code", "MutationObserver"), " | MDN"),
|
||||||
|
" is internaly used to track these events. Therefore, there are some drawbacks:",
|
||||||
|
),
|
||||||
|
el("ul").append(
|
||||||
|
el("li").append(
|
||||||
|
"To proper listener registration, you need to use ", el("code", "on.*"), " not `on(\"dde:*\", …)`!"
|
||||||
),
|
),
|
||||||
el("p").append(
|
el("li").append(
|
||||||
"You can use Addons as ≥3rd argument of ", el("code", "el"), " function. This way is possible to extends",
|
"Use sparingly! Internally, library must loop of all registered events and fires event properly.",
|
||||||
" you templates by additional (3rd party) functionalities. But for now mainly, you can add events listeners:"
|
|
||||||
),
|
|
||||||
el(example, { src: fileURL("./components/examples/events/templateWithListeners.js"), page_id }),
|
|
||||||
el("p").append(
|
|
||||||
"As the example shows, you can also provide types in JSDoc+TypeScript by using global type ", el("code", "ddeElementAddon"), ".",
|
|
||||||
" ",
|
" ",
|
||||||
"Also notice, you can use Addons to get element reference.",
|
el("strong", "It is good practice to use the fact that if an element is removed, its children are also removed!"),
|
||||||
),
|
|
||||||
el(h3, "Life-cycle events"),
|
|
||||||
el("p").append(
|
|
||||||
"Addons are called immediately when the element is created, even it is not connected to live DOM yet.",
|
|
||||||
" ",
|
" ",
|
||||||
"Therefore, you can understand the Addon to be “oncreate” event."
|
"In this spirit, we will introduce later the ", el("strong", "host"), " syntax to register",
|
||||||
),
|
" clean up procedures when the component is removed from the app."
|
||||||
el("p").append(
|
|
||||||
"The library provide three additional live-cycle events corresponding to how they are named in",
|
|
||||||
" a case of custom elements: ", el("code", "on.connected"), ", ", el("code", "on.disconnected"),
|
|
||||||
" and ", el("code", "on.attributeChanged"), "."
|
|
||||||
),
|
|
||||||
el(example, { src: fileURL("./components/examples/events/live-cycle.js"), page_id }),
|
|
||||||
el("p").append(
|
|
||||||
"For Custom elements, we will later introduce a way to replace ", el("code", "*Callback"),
|
|
||||||
" syntax with ", el("code", "dde:*"), " events. The ", el("code", "on.*"), " functions then",
|
|
||||||
" listen to the appropriate Custom Elements events (see ", el("a", { textContent: "Custom element lifecycle callbacks | MDN", href: "https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#custom_element_lifecycle_callbacks" }), ")."
|
|
||||||
),
|
|
||||||
el("p").append(
|
|
||||||
"But, in case of regular elemnets the ", el("a", { href: "https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver" }).append(el("code", "MutationObserver"), " | MDN"),
|
|
||||||
" is internaly used to track these events. Therefore, there are some drawbacks:",
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
el(h3, "Final notes"),
|
||||||
|
el("p", "The library also provides a method to dispatch the events."),
|
||||||
|
el(example, { src: fileURL("./components/examples/events/compareDispatch.js"), page_id }),
|
||||||
|
|
||||||
|
el("div", { className: "notice" }).append(
|
||||||
|
el("p", "Mnemonic"),
|
||||||
el("ul").append(
|
el("ul").append(
|
||||||
el("li").append(
|
el("li").append(
|
||||||
"To proper listener registration, you need to use ", el("code", "on.*"), " not `on(\"dde:*\", …)`!"
|
el("code", "on(<event>, <listener>[, <options>])(<element>)"), " — just ", el("code", "<element>.addEventListener(<event>, <listener>[, <options>])")
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
"Use sparingly! Internally, library must loop of all registered events and fires event properly.",
|
el("code", "on.<live-cycle>(<event>, <listener>[, <options>])(<element>)"), " — corresponds to custom elemnets callbacks ", el("code", "<live-cycle>Callback(...){...}"),
|
||||||
" ",
|
". To connect to custom element see following page, else it is simulated by MutationObserver."
|
||||||
el("strong", "It is good practice to use the fact that if an element is removed, its children are also removed!"),
|
|
||||||
" ",
|
|
||||||
"In this spirit, we will introduce later the ", el("strong", "host"), " syntax to register",
|
|
||||||
" clean up procedures when the component is removed from the app."
|
|
||||||
),
|
),
|
||||||
),
|
el("li").append(
|
||||||
|
el("code", "dispatchEvent(<event>[, <options>])(element)"), " — just ", el("code", "<element>.dispatchEvent(new Event(<event>[, <options>]))")
|
||||||
el(h3, "Final notes"),
|
),
|
||||||
el("p", "The library also provides a method to dispatch the events."),
|
el("li").append(
|
||||||
el(example, { src: fileURL("./components/examples/events/compareDispatch.js"), page_id }),
|
el("code", "dispatchEvent(<event>[, <options>])(element, detail)"), " — just ", el("code", "<element>.dispatchEvent(new CustomEvent(<event>, { detail, ...<options> }))")
|
||||||
|
),
|
||||||
el("div", { className: "notice" }).append(
|
)
|
||||||
el("p", "Mnemonic"),
|
),
|
||||||
el("ul").append(
|
|
||||||
el("li").append(
|
|
||||||
el("code", "on(<event>, <listener>[, <options>])(<element>)"), " — just ", el("code", "<element>.addEventListener(<event>, <listener>[, <options>])")
|
|
||||||
),
|
|
||||||
el("li").append(
|
|
||||||
el("code", "on.<live-cycle>(<event>, <listener>[, <options>])(<element>)"), " — corresponds to custom elemnets callbacks ", el("code", "<live-cycle>Callback(...){...}"),
|
|
||||||
". To connect to custom element see following page, else it is simulated by MutationObserver."
|
|
||||||
),
|
|
||||||
el("li").append(
|
|
||||||
el("code", "dispatchEvent(<event>[, <options>])(element)"), " — just ", el("code", "<element>.dispatchEvent(new Event(<event>[, <options>]))")
|
|
||||||
),
|
|
||||||
el("li").append(
|
|
||||||
el("code", "dispatchEvent(<event>[, <options>])(element, detail)"), " — just ", el("code", "<element>.dispatchEvent(new CustomEvent(<event>, { detail, ...<options> }))")
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
|
|
||||||
el(prevNext, info)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,80 +1,75 @@
|
|||||||
import "./global.css.js";
|
import { simplePage } from "./layout/simplePage.html.js";
|
||||||
|
|
||||||
import { el } from "deka-dom-el";
|
import { el } from "deka-dom-el";
|
||||||
|
|
||||||
import { header } from "./layout/head.html.js";
|
|
||||||
import { example } from "./components/example.html.js";
|
import { example } from "./components/example.html.js";
|
||||||
import { h3, prevNext } from "./components/pageUtils.html.js";
|
import { h3 } from "./components/pageUtils.html.js";
|
||||||
|
|
||||||
/** @param {string} url */
|
/** @param {string} url */
|
||||||
const fileURL= url=> new URL(url, import.meta.url);
|
const fileURL= url=> new URL(url, import.meta.url);
|
||||||
|
|
||||||
/** @param {import("./types.d.ts").PageAttrs} attrs */
|
/** @param {import("./types.d.ts").PageAttrs} attrs */
|
||||||
export function page({ pkg, info }){
|
export function page({ pkg, info }){
|
||||||
const page_id= info.id;
|
const page_id= info.id;
|
||||||
return el().append(
|
return el(simplePage, { info, pkg }).append(
|
||||||
el(header, { info, pkg }),
|
el("h2", "Using signals to manage reactivity"),
|
||||||
el("main").append(
|
el("p").append(
|
||||||
el("h2", "Using signals to manage reactivity"),
|
"How a program responds to variable data or user",
|
||||||
el("p").append(
|
" interactions is one of the fundamental problems of programming.",
|
||||||
"How a program responds to variable data or user",
|
" If we desire to solve the issue in a declarative manner,",
|
||||||
" interactions is one of the fundamental problems of programming.",
|
" signals may be a viable approach.",
|
||||||
" If we desire to solve the issue in a declarative manner,",
|
),
|
||||||
" signals may be a viable approach.",
|
el(example, { src: fileURL("./components/examples/signals/intro.js"), page_id }),
|
||||||
),
|
|
||||||
el(example, { src: fileURL("./components/examples/signals/intro.js"), page_id }),
|
|
||||||
|
|
||||||
el(h3, "Introducing signals"),
|
el(h3, "Introducing signals"),
|
||||||
el("p").append(
|
el("p").append(
|
||||||
"Using signals, we split program logic into the three parts.",
|
"Using signals, we split program logic into the three parts.",
|
||||||
" Firstly (α), we create a variable (constant) representing reactive",
|
" Firstly (α), we create a variable (constant) representing reactive",
|
||||||
" value. Somewhere later, we can register (β) a logic reacting",
|
" value. Somewhere later, we can register (β) a logic reacting",
|
||||||
" to the signal value changes. Similarly, in a remaining part (γ), we",
|
" to the signal value changes. Similarly, in a remaining part (γ), we",
|
||||||
" can update the signal value."
|
" can update the signal value."
|
||||||
),
|
),
|
||||||
el("p").append(
|
el("p").append(
|
||||||
"All this is just an example of ",
|
"All this is just an example of ",
|
||||||
el("a", { textContent: "Event-driven programming", href: "https://en.wikipedia.org/wiki/Event-driven_programming", title: "Wikipedia: Event-driven programming" }),
|
el("a", { textContent: "Event-driven programming", href: "https://en.wikipedia.org/wiki/Event-driven_programming", title: "Wikipedia: Event-driven programming" }),
|
||||||
" and ",
|
" and ",
|
||||||
el("a", { textContent: "Publish–subscribe pattern", href: "https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern", title: "Wikipedia: Publish–subscribe pattern" }),
|
el("a", { textContent: "Publish–subscribe pattern", href: "https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern", title: "Wikipedia: Publish–subscribe pattern" }),
|
||||||
" (compare for example with ", el("a", { textContent: "fpubsub library", href: "https://www.npmjs.com/package/fpubsub", title: "NPM package: fpubsub" }), ").",
|
" (compare for example with ", el("a", { textContent: "fpubsub library", href: "https://www.npmjs.com/package/fpubsub", title: "NPM package: fpubsub" }), ").",
|
||||||
" All three parts can be in some manner independent and still connected",
|
" All three parts can be in some manner independent and still connected",
|
||||||
" to the same reactive entity."
|
" to the same reactive entity."
|
||||||
),
|
),
|
||||||
el("p").append(
|
el("p").append(
|
||||||
"Signals are implemented in the library as functions. To see current value",
|
"Signals are implemented in the library as functions. To see current value",
|
||||||
" of signal, just call it without any arguments ", el("code", "console.log(signal())"), ".",
|
" of signal, just call it without any arguments ", el("code", "console.log(signal())"), ".",
|
||||||
" To update the signal value, pass any argument ", el("code", "signal('a new value')"), ".",
|
" To update the signal value, pass any argument ", el("code", "signal('a new value')"), ".",
|
||||||
" For listenning the signal value changes, use ", el("code", "S.on(signal, console.log)"), "."
|
" For listenning the signal value changes, use ", el("code", "S.on(signal, console.log)"), "."
|
||||||
),
|
),
|
||||||
el("p").append(
|
el("p").append(
|
||||||
"Similarly to the ", el("code", "on"), " function to register DOM events listener.",
|
"Similarly to the ", el("code", "on"), " function to register DOM events listener.",
|
||||||
" You can use ", el("code", "AbortController"), "/", el("code", "AbortSignal"), " to",
|
" You can use ", el("code", "AbortController"), "/", el("code", "AbortSignal"), " to",
|
||||||
" ", el("em", "off"), "/stop listenning. For representing “live” piece of code computation pattern:"
|
" ", el("em", "off"), "/stop listenning. For representing “live” piece of code computation pattern:"
|
||||||
),
|
),
|
||||||
el(example, { src: fileURL("./components/examples/signals/computations-abort.js"), page_id }),
|
el(example, { src: fileURL("./components/examples/signals/computations-abort.js"), page_id }),
|
||||||
el("div", { className: "notice" }).append(
|
el("div", { className: "notice" }).append(
|
||||||
el("p", "Mnemonic"),
|
el("p", "Mnemonic"),
|
||||||
el("ul").append(
|
el("ul").append(
|
||||||
el("li").append(
|
el("li").append(
|
||||||
el("code", "S(<value>)"), " — signal: reactive value",
|
el("code", "S(<value>)"), " — signal: reactive value",
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
el("code", "S(()=> <computation>)"), " — signal: reactive value dependent on calculation using other signals",
|
el("code", "S(()=> <computation>)"), " — signal: reactive value dependent on calculation using other signals",
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
el("code", "S.on(<signal>, <listener>[, <options>])"), " — listen to the signal value changes",
|
el("code", "S.on(<signal>, <listener>[, <options>])"), " — listen to the signal value changes",
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
el("code", "S.clear(...<signals>)"), " — off and clear signals",
|
el("code", "S.clear(...<signals>)"), " — off and clear signals",
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
el("code", "S(<value>, <actions>)"), " — signal: pattern to create complex reactive objects/arrays",
|
el("code", "S(<value>, <actions>)"), " — signal: pattern to create complex reactive objects/arrays",
|
||||||
),
|
),
|
||||||
el("li").append(
|
el("li").append(
|
||||||
el("code", "S.action(<signal>, <action-name>, ...<action-arguments>)"), " — invoke an action for given signal"
|
el("code", "S.action(<signal>, <action-name>, ...<action-arguments>)"), " — invoke an action for given signal"
|
||||||
)
|
|
||||||
)
|
)
|
||||||
),
|
)
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
1
docs_src/types.d.ts
vendored
1
docs_src/types.d.ts
vendored
@ -25,4 +25,5 @@ declare global{
|
|||||||
interface ddePublicElementTagNameMap{
|
interface ddePublicElementTagNameMap{
|
||||||
["custom-test"]: CustomHTMLTestElement;
|
["custom-test"]: CustomHTMLTestElement;
|
||||||
}
|
}
|
||||||
|
function test(): ddeHTMLParagraphElement
|
||||||
}
|
}
|
||||||
|
582
index.d.ts
vendored
582
index.d.ts
vendored
@ -45,7 +45,7 @@ export function classListDeclarative<El extends SupportedElement>(element: El, c
|
|||||||
export function assign<El extends SupportedElement>(element: El, ...attrs_array: Partial<ElementAttributes<El>>[]): El
|
export function assign<El extends SupportedElement>(element: El, ...attrs_array: Partial<ElementAttributes<El>>[]): El
|
||||||
export function assignAttribute<El extends SupportedElement, ATT extends keyof ElementAttributes<El>>(element: El, attr: ATT, value: ElementAttributes<El>[ATT]): ElementAttributes<El>[ATT]
|
export function assignAttribute<El extends SupportedElement, ATT extends keyof ElementAttributes<El>>(element: El, attr: ATT, value: ElementAttributes<El>[ATT]): ElementAttributes<El>[ATT]
|
||||||
|
|
||||||
type ExtendedHTMLElementTagNameMap= HTMLElementTagNameMap & CustomElementTagNameMap & ddePublicElementTagNameMap
|
type ExtendedHTMLElementTagNameMap= ddeHTMLElementTagNameMap & CustomElementTagNameMap & ddePublicElementTagNameMap
|
||||||
export function el<TAG extends keyof ExtendedHTMLElementTagNameMap>(
|
export function el<TAG extends keyof ExtendedHTMLElementTagNameMap>(
|
||||||
tag_name: TAG,
|
tag_name: TAG,
|
||||||
attrs?: string | Partial<ElementAttributes<ExtendedHTMLElementTagNameMap[TAG]>>,
|
attrs?: string | Partial<ElementAttributes<ExtendedHTMLElementTagNameMap[TAG]>>,
|
||||||
@ -53,7 +53,7 @@ export function el<TAG extends keyof ExtendedHTMLElementTagNameMap>(
|
|||||||
): ExtendedHTMLElementTagNameMap[TAG]
|
): ExtendedHTMLElementTagNameMap[TAG]
|
||||||
export function el<T>(
|
export function el<T>(
|
||||||
tag_name?: "<>",
|
tag_name?: "<>",
|
||||||
): DocumentFragment
|
): ddeDocumentFragment
|
||||||
|
|
||||||
export function el<
|
export function el<
|
||||||
A extends ddeComponentAttributes,
|
A extends ddeComponentAttributes,
|
||||||
@ -67,22 +67,22 @@ export function el(
|
|||||||
tag_name: string,
|
tag_name: string,
|
||||||
attrs?: string | Record<string, any>,
|
attrs?: string | Record<string, any>,
|
||||||
...addons: ddeElementAddon<HTMLElement>[]
|
...addons: ddeElementAddon<HTMLElement>[]
|
||||||
): HTMLElement
|
): ddeHTMLElement
|
||||||
|
|
||||||
export function elNS(
|
export function elNS(
|
||||||
namespace: "http://www.w3.org/2000/svg"
|
namespace: "http://www.w3.org/2000/svg"
|
||||||
): <TAG extends keyof SVGElementTagNameMap, KEYS extends keyof SVGElementTagNameMap[TAG] & { d: string }>(
|
): <TAG, EL extends ( TAG extends keyof ddeSVGElementTagNameMap ? ddeSVGElementTagNameMap[TAG] : ddeSVGElement ), KEYS extends keyof EL & { d: string }>(
|
||||||
tag_name: TAG,
|
tag_name: TAG,
|
||||||
attrs?: string | Partial<{ [key in KEYS]: SVGElementTagNameMap[TAG][key] | string | number | boolean }>,
|
attrs?: string | Partial<{ [key in KEYS]: EL[key] | string | number | boolean }>,
|
||||||
...addons: ddeElementAddon<SVGElementTagNameMap[TAG]>[]
|
...addons: ddeElementAddon<EL>[]
|
||||||
)=> SVGElementTagNameMap[TAG]
|
)=> EL
|
||||||
export function elNS(
|
export function elNS(
|
||||||
namespace: "http://www.w3.org/1998/Math/MathML"
|
namespace: "http://www.w3.org/1998/Math/MathML"
|
||||||
): <TAG extends keyof MathMLElementTagNameMap, KEYS extends keyof MathMLElementTagNameMap[TAG] & { d: string }>(
|
): <TAG extends keyof MathMLElementTagNameMap, KEYS extends keyof MathMLElementTagNameMap[TAG] & { d: string }>(
|
||||||
tag_name: TAG,
|
tag_name: TAG,
|
||||||
attrs?: string | Partial<{ [key in KEYS]: MathMLElementTagNameMap[TAG][key] | string | number | boolean }>,
|
attrs?: string | Partial<{ [key in KEYS]: MathMLElementTagNameMap[TAG][key] | string | number | boolean }>,
|
||||||
...addons: ddeElementAddon<MathMLElementTagNameMap[TAG]>[]
|
...addons: ddeElementAddon<MathMLElementTagNameMap[TAG]>[]
|
||||||
)=> MathMLElementTagNameMap[TAG]
|
)=> ddeMathMLElement
|
||||||
export function elNS(
|
export function elNS(
|
||||||
namespace: string
|
namespace: string
|
||||||
): (
|
): (
|
||||||
@ -92,6 +92,7 @@ export function elNS(
|
|||||||
)=> SupportedElement
|
)=> SupportedElement
|
||||||
|
|
||||||
export function chainableAppend<EL extends SupportedElement>(el: EL): EL;
|
export function chainableAppend<EL extends SupportedElement>(el: EL): EL;
|
||||||
|
export function simulateSlots<EL extends SupportedElement | DocumentFragment>(el: EL): EL
|
||||||
|
|
||||||
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;
|
||||||
@ -165,297 +166,280 @@ export const scope: {
|
|||||||
pop(): ReturnType<Array<Scope>["pop"]>,
|
pop(): ReturnType<Array<Scope>["pop"]>,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/* TypeScript MEH // TODO for SVG */
|
||||||
* TODO TypeScript HACK (better way?)
|
|
||||||
* this doesnt works
|
|
||||||
* ```ts
|
|
||||||
* interface element<el> extends Node{
|
|
||||||
* prototype: el;
|
|
||||||
* append(...els: (SupportedElement | DocumentFragment | string | element<SupportedElement | DocumentFragment>)[]): el
|
|
||||||
* }
|
|
||||||
* export function el<T>(
|
|
||||||
* tag_name?: "<>",
|
|
||||||
* ): element<DocumentFragment>
|
|
||||||
* ```
|
|
||||||
* …as its complains here
|
|
||||||
* ```ts
|
|
||||||
* const d= el("div");
|
|
||||||
* const f= (a: HTMLDivElement)=> a;
|
|
||||||
* f(d); //←
|
|
||||||
* document.head.append( //←
|
|
||||||
* el("script", { src: "https://flems.io/flems.html", type: "text/javascript", charset: "utf-8" }),
|
|
||||||
* );
|
|
||||||
* ```
|
|
||||||
* TODO for SVG
|
|
||||||
* */
|
|
||||||
type ddeAppend<el>= (...nodes: (Node | string)[])=> el;
|
type ddeAppend<el>= (...nodes: (Node | string)[])=> el;
|
||||||
declare global{
|
declare global{
|
||||||
interface HTMLAnchorElement{
|
interface ddeDocumentFragment extends DocumentFragment{ append: ddeAppend<ddeDocumentFragment>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLElement extends HTMLElement{ append: ddeAppend<ddeHTMLElement>; }
|
||||||
append: ddeAppend<HTMLAnchorElement>;
|
interface ddeSVGElement extends SVGElement{ append: ddeAppend<ddeSVGElement>; }
|
||||||
}
|
interface ddeMathMLElement extends MathMLElement{ append: ddeAppend<ddeMathMLElement>; }
|
||||||
interface HTMLElement{
|
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLElementTagNameMap {
|
||||||
append: ddeAppend<HTMLElement>;
|
"a": ddeHTMLAnchorElement;
|
||||||
}
|
"area": ddeHTMLAreaElement;
|
||||||
interface HTMLAreaElement{
|
"audio": ddeHTMLAudioElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"base": ddeHTMLBaseElement;
|
||||||
append: ddeAppend<HTMLAreaElement>;
|
"blockquote": ddeHTMLQuoteElement;
|
||||||
}
|
"body": ddeHTMLBodyElement;
|
||||||
interface HTMLAudioElement{
|
"br": ddeHTMLBRElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"button": ddeHTMLButtonElement;
|
||||||
append: ddeAppend<HTMLAudioElement>;
|
"canvas": ddeHTMLCanvasElement;
|
||||||
}
|
"caption": ddeHTMLTableCaptionElement;
|
||||||
interface HTMLBaseElement{
|
"col": ddeHTMLTableColElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"colgroup": ddeHTMLTableColElement;
|
||||||
append: ddeAppend<HTMLBaseElement>;
|
"data": ddeHTMLDataElement;
|
||||||
}
|
"datalist": ddeHTMLDataListElement;
|
||||||
interface HTMLQuoteElement{
|
"del": ddeHTMLModElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"details": ddeHTMLDetailsElement;
|
||||||
append: ddeAppend<HTMLQuoteElement>;
|
"dialog": ddeHTMLDialogElement;
|
||||||
}
|
"div": ddeHTMLDivElement;
|
||||||
interface HTMLBodyElement{
|
"dl": ddeHTMLDListElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"embed": ddeHTMLEmbedElement;
|
||||||
append: ddeAppend<HTMLBodyElement>;
|
"fieldset": ddeHTMLFieldSetElement;
|
||||||
}
|
"form": ddeHTMLFormElement;
|
||||||
interface HTMLBRElement{
|
"h1": ddeHTMLHeadingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"h2": ddeHTMLHeadingElement;
|
||||||
append: ddeAppend<HTMLBRElement>;
|
"h3": ddeHTMLHeadingElement;
|
||||||
}
|
"h4": ddeHTMLHeadingElement;
|
||||||
interface HTMLButtonElement{
|
"h5": ddeHTMLHeadingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"h6": ddeHTMLHeadingElement;
|
||||||
append: ddeAppend<HTMLButtonElement>;
|
"head": ddeHTMLHeadElement;
|
||||||
}
|
"hr": ddeHTMLHRElement;
|
||||||
interface HTMLCanvasElement{
|
"html": ddeHTMLHtmlElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"iframe": ddeHTMLIFrameElement;
|
||||||
append: ddeAppend<HTMLCanvasElement>;
|
"img": ddeHTMLImageElement;
|
||||||
}
|
"input": ddeHTMLInputElement;
|
||||||
interface HTMLTableCaptionElement{
|
"ins": ddeHTMLModElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"label": ddeHTMLLabelElement;
|
||||||
append: ddeAppend<HTMLTableCaptionElement>;
|
"legend": ddeHTMLLegendElement;
|
||||||
}
|
"li": ddeHTMLLIElement;
|
||||||
interface HTMLTableColElement{
|
"link": ddeHTMLLinkElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"map": ddeHTMLMapElement;
|
||||||
append: ddeAppend<HTMLTableColElement>;
|
"menu": ddeHTMLMenuElement;
|
||||||
}
|
"meta": ddeHTMLMetaElement;
|
||||||
interface HTMLTableColElement{
|
"meter": ddeHTMLMeterElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"object": ddeHTMLObjectElement;
|
||||||
append: ddeAppend<HTMLTableColElement>;
|
"ol": ddeHTMLOListElement;
|
||||||
}
|
"optgroup": ddeHTMLOptGroupElement;
|
||||||
interface HTMLDataElement{
|
"option": ddeHTMLOptionElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"output": ddeHTMLOutputElement;
|
||||||
append: ddeAppend<HTMLDataElement>;
|
"p": ddeHTMLParagraphElement;
|
||||||
}
|
"picture": ddeHTMLPictureElement;
|
||||||
interface HTMLDataListElement{
|
"pre": ddeHTMLPreElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"progress": ddeHTMLProgressElement;
|
||||||
append: ddeAppend<HTMLDataListElement>;
|
"q": ddeHTMLQuoteElement;
|
||||||
}
|
"script": ddeHTMLScriptElement;
|
||||||
interface HTMLModElement{
|
"select": ddeHTMLSelectElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"slot": ddeHTMLSlotElement;
|
||||||
append: ddeAppend<HTMLModElement>;
|
"source": ddeHTMLSourceElement;
|
||||||
}
|
"span": ddeHTMLSpanElement;
|
||||||
interface HTMLDetailsElement{
|
"style": ddeHTMLStyleElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"table": ddeHTMLTableElement;
|
||||||
append: ddeAppend<HTMLDetailsElement>;
|
"tbody": ddeHTMLTableSectionElement;
|
||||||
}
|
"td": ddeHTMLTableCellElement;
|
||||||
interface HTMLDialogElement{
|
"template": ddeHTMLTemplateElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"textarea": ddeHTMLTextAreaElement;
|
||||||
append: ddeAppend<HTMLDialogElement>;
|
"tfoot": ddeHTMLTableSectionElement;
|
||||||
}
|
"th": ddeHTMLTableCellElement;
|
||||||
interface HTMLDivElement{
|
"thead": ddeHTMLTableSectionElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"time": ddeHTMLTimeElement;
|
||||||
append: ddeAppend<HTMLDivElement>;
|
"title": ddeHTMLTitleElement;
|
||||||
}
|
"tr": ddeHTMLTableRowElement;
|
||||||
interface HTMLDListElement{
|
"track": ddeHTMLTrackElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"ul": ddeHTMLUListElement;
|
||||||
append: ddeAppend<HTMLDListElement>;
|
"video": ddeHTMLVideoElement;
|
||||||
}
|
}
|
||||||
interface HTMLEmbedElement{
|
interface ddeHTMLAnchorElement extends HTMLAnchorElement{ append: ddeAppend<ddeHTMLAnchorElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLAreaElement extends HTMLAreaElement{ append: ddeAppend<ddeHTMLAreaElement>; }
|
||||||
append: ddeAppend<HTMLEmbedElement>;
|
interface ddeHTMLAudioElement extends HTMLAudioElement{ append: ddeAppend<ddeHTMLAudioElement>; }
|
||||||
}
|
interface ddeHTMLBaseElement extends HTMLBaseElement{ append: ddeAppend<ddeHTMLBaseElement>; }
|
||||||
interface HTMLFieldSetElement{
|
interface ddeHTMLQuoteElement extends HTMLQuoteElement{ append: ddeAppend<ddeHTMLQuoteElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLBodyElement extends HTMLBodyElement{ append: ddeAppend<ddeHTMLBodyElement>; }
|
||||||
append: ddeAppend<HTMLFieldSetElement>;
|
interface ddeHTMLBRElement extends HTMLBRElement{ append: ddeAppend<ddeHTMLBRElement>; }
|
||||||
}
|
interface ddeHTMLButtonElement extends HTMLButtonElement{ append: ddeAppend<ddeHTMLButtonElement>; }
|
||||||
interface HTMLFormElement{
|
interface ddeHTMLCanvasElement extends HTMLCanvasElement{ append: ddeAppend<ddeHTMLCanvasElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTableCaptionElement extends HTMLTableCaptionElement{ append: ddeAppend<ddeHTMLTableCaptionElement>; }
|
||||||
append: ddeAppend<HTMLFormElement>;
|
interface ddeHTMLTableColElement extends HTMLTableColElement{ append: ddeAppend<ddeHTMLTableColElement>; }
|
||||||
}
|
interface ddeHTMLTableColElement extends HTMLTableColElement{ append: ddeAppend<ddeHTMLTableColElement>; }
|
||||||
interface HTMLHeadingElement{
|
interface ddeHTMLDataElement extends HTMLDataElement{ append: ddeAppend<ddeHTMLDataElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLDataListElement extends HTMLDataListElement{ append: ddeAppend<ddeHTMLDataListElement>; }
|
||||||
append: ddeAppend<HTMLHeadingElement>;
|
interface ddeHTMLModElement extends HTMLModElement{ append: ddeAppend<ddeHTMLModElement>; }
|
||||||
}
|
interface ddeHTMLDetailsElement extends HTMLDetailsElement{ append: ddeAppend<ddeHTMLDetailsElement>; }
|
||||||
interface HTMLHeadElement{
|
interface ddeHTMLDialogElement extends HTMLDialogElement{ append: ddeAppend<ddeHTMLDialogElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLDivElement extends HTMLDivElement{ append: ddeAppend<ddeHTMLDivElement>; }
|
||||||
append: ddeAppend<HTMLHeadElement>;
|
interface ddeHTMLDListElement extends HTMLDListElement{ append: ddeAppend<ddeHTMLDListElement>; }
|
||||||
}
|
interface ddeHTMLEmbedElement extends HTMLEmbedElement{ append: ddeAppend<ddeHTMLEmbedElement>; }
|
||||||
interface HTMLHRElement{
|
interface ddeHTMLFieldSetElement extends HTMLFieldSetElement{ append: ddeAppend<ddeHTMLFieldSetElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLFormElement extends HTMLFormElement{ append: ddeAppend<ddeHTMLFormElement>; }
|
||||||
append: ddeAppend<HTMLHRElement>;
|
interface ddeHTMLHeadingElement extends HTMLHeadingElement{ append: ddeAppend<ddeHTMLHeadingElement>; }
|
||||||
}
|
interface ddeHTMLHeadElement extends HTMLHeadElement{ append: ddeAppend<ddeHTMLHeadElement>; }
|
||||||
interface HTMLHtmlElement{
|
interface ddeHTMLHRElement extends HTMLHRElement{ append: ddeAppend<ddeHTMLHRElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLHtmlElement extends HTMLHtmlElement{ append: ddeAppend<ddeHTMLHtmlElement>; }
|
||||||
append: ddeAppend<HTMLHtmlElement>;
|
interface ddeHTMLIFrameElement extends HTMLIFrameElement{ append: ddeAppend<ddeHTMLIFrameElement>; }
|
||||||
}
|
interface ddeHTMLImageElement extends HTMLImageElement{ append: ddeAppend<ddeHTMLImageElement>; }
|
||||||
interface HTMLIFrameElement{
|
interface ddeHTMLInputElement extends HTMLInputElement{ append: ddeAppend<ddeHTMLInputElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLLabelElement extends HTMLLabelElement{ append: ddeAppend<ddeHTMLLabelElement>; }
|
||||||
append: ddeAppend<HTMLIFrameElement>;
|
interface ddeHTMLLegendElement extends HTMLLegendElement{ append: ddeAppend<ddeHTMLLegendElement>; }
|
||||||
}
|
interface ddeHTMLLIElement extends HTMLLIElement{ append: ddeAppend<ddeHTMLLIElement>; }
|
||||||
interface HTMLImageElement{
|
interface ddeHTMLLinkElement extends HTMLLinkElement{ append: ddeAppend<ddeHTMLLinkElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLMapElement extends HTMLMapElement{ append: ddeAppend<ddeHTMLMapElement>; }
|
||||||
append: ddeAppend<HTMLImageElement>;
|
interface ddeHTMLMenuElement extends HTMLMenuElement{ append: ddeAppend<ddeHTMLMenuElement>; }
|
||||||
}
|
interface ddeHTMLMetaElement extends HTMLMetaElement{ append: ddeAppend<ddeHTMLMetaElement>; }
|
||||||
interface HTMLInputElement{
|
interface ddeHTMLMeterElement extends HTMLMeterElement{ append: ddeAppend<ddeHTMLMeterElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLObjectElement extends HTMLObjectElement{ append: ddeAppend<ddeHTMLObjectElement>; }
|
||||||
append: ddeAppend<HTMLInputElement>;
|
interface ddeHTMLOListElement extends HTMLOListElement{ append: ddeAppend<ddeHTMLOListElement>; }
|
||||||
}
|
interface ddeHTMLOptGroupElement extends HTMLOptGroupElement{ append: ddeAppend<ddeHTMLOptGroupElement>; }
|
||||||
interface HTMLLabelElement{
|
interface ddeHTMLOptionElement extends HTMLOptionElement{ append: ddeAppend<ddeHTMLOptionElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLOutputElement extends HTMLOutputElement{ append: ddeAppend<ddeHTMLOutputElement>; }
|
||||||
append: ddeAppend<HTMLLabelElement>;
|
interface ddeHTMLParagraphElement extends HTMLParagraphElement{ append: ddeAppend<ddeHTMLParagraphElement>; }
|
||||||
}
|
interface ddeHTMLPictureElement extends HTMLPictureElement{ append: ddeAppend<ddeHTMLPictureElement>; }
|
||||||
interface HTMLLegendElement{
|
interface ddeHTMLPreElement extends HTMLPreElement{ append: ddeAppend<ddeHTMLPreElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLProgressElement extends HTMLProgressElement{ append: ddeAppend<ddeHTMLProgressElement>; }
|
||||||
append: ddeAppend<HTMLLegendElement>;
|
interface ddeHTMLScriptElement extends HTMLScriptElement{ append: ddeAppend<ddeHTMLScriptElement>; }
|
||||||
}
|
interface ddeHTMLSelectElement extends HTMLSelectElement{ append: ddeAppend<ddeHTMLSelectElement>; }
|
||||||
interface HTMLLIElement{
|
interface ddeHTMLSlotElement extends HTMLSlotElement{ append: ddeAppend<ddeHTMLSlotElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLSourceElement extends HTMLSourceElement{ append: ddeAppend<ddeHTMLSourceElement>; }
|
||||||
append: ddeAppend<HTMLLIElement>;
|
interface ddeHTMLSpanElement extends HTMLSpanElement{ append: ddeAppend<ddeHTMLSpanElement>; }
|
||||||
}
|
interface ddeHTMLStyleElement extends HTMLStyleElement{ append: ddeAppend<ddeHTMLStyleElement>; }
|
||||||
interface HTMLLinkElement{
|
interface ddeHTMLTableElement extends HTMLTableElement{ append: ddeAppend<ddeHTMLTableElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTableSectionElement extends HTMLTableSectionElement{ append: ddeAppend<ddeHTMLTableSectionElement>; }
|
||||||
append: ddeAppend<HTMLLinkElement>;
|
interface ddeHTMLTableCellElement extends HTMLTableCellElement{ append: ddeAppend<ddeHTMLTableCellElement>; }
|
||||||
}
|
interface ddeHTMLTemplateElement extends HTMLTemplateElement{ append: ddeAppend<ddeHTMLTemplateElement>; }
|
||||||
interface HTMLMapElement{
|
interface ddeHTMLTextAreaElement extends HTMLTextAreaElement{ append: ddeAppend<ddeHTMLTextAreaElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTableCellElement extends HTMLTableCellElement{ append: ddeAppend<ddeHTMLTableCellElement>; }
|
||||||
append: ddeAppend<HTMLMapElement>;
|
interface ddeHTMLTimeElement extends HTMLTimeElement{ append: ddeAppend<ddeHTMLTimeElement>; }
|
||||||
}
|
interface ddeHTMLTitleElement extends HTMLTitleElement{ append: ddeAppend<ddeHTMLTitleElement>; }
|
||||||
interface HTMLMenuElement{
|
interface ddeHTMLTableRowElement extends HTMLTableRowElement{ append: ddeAppend<ddeHTMLTableRowElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeHTMLTrackElement extends HTMLTrackElement{ append: ddeAppend<ddeHTMLTrackElement>; }
|
||||||
append: ddeAppend<HTMLMenuElement>;
|
interface ddeHTMLUListElement extends HTMLUListElement{ append: ddeAppend<ddeHTMLUListElement>; }
|
||||||
}
|
interface ddeHTMLVideoElement extends HTMLVideoElement{ append: ddeAppend<ddeHTMLVideoElement>; }
|
||||||
interface HTMLMetaElement{
|
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGElementTagNameMap {
|
||||||
append: ddeAppend<HTMLMetaElement>;
|
"a": ddeSVGAElement;
|
||||||
}
|
"animate": ddeSVGAnimateElement;
|
||||||
interface HTMLMeterElement{
|
"animateMotion": ddeSVGAnimateMotionElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"animateTransform": ddeSVGAnimateTransformElement;
|
||||||
append: ddeAppend<HTMLMeterElement>;
|
"circle": ddeSVGCircleElement;
|
||||||
}
|
"clipPath": ddeSVGClipPathElement;
|
||||||
interface HTMLObjectElement{
|
"defs": ddeSVGDefsElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"desc": ddeSVGDescElement;
|
||||||
append: ddeAppend<HTMLObjectElement>;
|
"ellipse": ddeSVGEllipseElement;
|
||||||
}
|
"feBlend": ddeSVGFEBlendElement;
|
||||||
interface HTMLOListElement{
|
"feColorMatrix": ddeSVGFEColorMatrixElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feComponentTransfer": ddeSVGFEComponentTransferElement;
|
||||||
append: ddeAppend<HTMLOListElement>;
|
"feComposite": ddeSVGFECompositeElement;
|
||||||
}
|
"feConvolveMatrix": ddeSVGFEConvolveMatrixElement;
|
||||||
interface HTMLOptGroupElement{
|
"feDiffuseLighting": ddeSVGFEDiffuseLightingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feDisplacementMap": ddeSVGFEDisplacementMapElement;
|
||||||
append: ddeAppend<HTMLOptGroupElement>;
|
"feDistantLight": ddeSVGFEDistantLightElement;
|
||||||
}
|
"feDropShadow": ddeSVGFEDropShadowElement;
|
||||||
interface HTMLOptionElement{
|
"feFlood": ddeSVGFEFloodElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feFuncA": ddeSVGFEFuncAElement;
|
||||||
append: ddeAppend<HTMLOptionElement>;
|
"feFuncB": ddeSVGFEFuncBElement;
|
||||||
}
|
"feFuncG": ddeSVGFEFuncGElement;
|
||||||
interface HTMLOutputElement{
|
"feFuncR": ddeSVGFEFuncRElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feGaussianBlur": ddeSVGFEGaussianBlurElement;
|
||||||
append: ddeAppend<HTMLOutputElement>;
|
"feImage": ddeSVGFEImageElement;
|
||||||
}
|
"feMerge": ddeSVGFEMergeElement;
|
||||||
interface HTMLParagraphElement{
|
"feMergeNode": ddeSVGFEMergeNodeElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feMorphology": ddeSVGFEMorphologyElement;
|
||||||
append: ddeAppend<HTMLParagraphElement>;
|
"feOffset": ddeSVGFEOffsetElement;
|
||||||
}
|
"fePointLight": ddeSVGFEPointLightElement;
|
||||||
interface HTMLPictureElement{
|
"feSpecularLighting": ddeSVGFESpecularLightingElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"feSpotLight": ddeSVGFESpotLightElement;
|
||||||
append: ddeAppend<HTMLPictureElement>;
|
"feTile": ddeSVGFETileElement;
|
||||||
}
|
"feTurbulence": ddeSVGFETurbulenceElement;
|
||||||
interface HTMLPreElement{
|
"filter": ddeSVGFilterElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"foreignObject": ddeSVGForeignObjectElement;
|
||||||
append: ddeAppend<HTMLPreElement>;
|
"g": ddeSVGGElement;
|
||||||
}
|
"image": ddeSVGImageElement;
|
||||||
interface HTMLProgressElement{
|
"line": ddeSVGLineElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"linearGradient": ddeSVGLinearGradientElement;
|
||||||
append: ddeAppend<HTMLProgressElement>;
|
"marker": ddeSVGMarkerElement;
|
||||||
}
|
"mask": ddeSVGMaskElement;
|
||||||
interface HTMLScriptElement{
|
"metadata": ddeSVGMetadataElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"mpath": ddeSVGMPathElement;
|
||||||
append: ddeAppend<HTMLScriptElement>;
|
"path": ddeSVGPathElement;
|
||||||
}
|
"pattern": ddeSVGPatternElement;
|
||||||
interface HTMLSelectElement{
|
"polygon": ddeSVGPolygonElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"polyline": ddeSVGPolylineElement;
|
||||||
append: ddeAppend<HTMLSelectElement>;
|
"radialGradient": ddeSVGRadialGradientElement;
|
||||||
}
|
"rect": ddeSVGRectElement;
|
||||||
interface HTMLSlotElement{
|
"script": ddeSVGScriptElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"set": ddeSVGSetElement;
|
||||||
append: ddeAppend<HTMLSlotElement>;
|
"stop": ddeSVGStopElement;
|
||||||
}
|
"style": ddeSVGStyleElement;
|
||||||
interface HTMLSourceElement{
|
"svg": ddeSVGSVGElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"switch": ddeSVGSwitchElement;
|
||||||
append: ddeAppend<HTMLSourceElement>;
|
"symbol": ddeSVGSymbolElement;
|
||||||
}
|
"text": ddeSVGTextElement;
|
||||||
interface HTMLSpanElement{
|
"textPath": ddeSVGTextPathElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
"title": ddeSVGTitleElement;
|
||||||
append: ddeAppend<HTMLSpanElement>;
|
"tspan": ddeSVGTSpanElement;
|
||||||
}
|
"use": ddeSVGUseElement;
|
||||||
interface HTMLStyleElement{
|
"view": ddeSVGViewElement;
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
}
|
||||||
append: ddeAppend<HTMLStyleElement>;
|
interface ddeSVGAElement extends SVGAElement{ append: ddeAppend<ddeSVGAElement>; }
|
||||||
}
|
interface ddeSVGAnimateElement extends SVGAnimateElement{ append: ddeAppend<ddeSVGAnimateElement>; }
|
||||||
interface HTMLTableElement{
|
interface ddeSVGAnimateMotionElement extends SVGAnimateMotionElement{ append: ddeAppend<ddeSVGAnimateMotionElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGAnimateTransformElement extends SVGAnimateTransformElement{ append: ddeAppend<ddeSVGAnimateTransformElement>; }
|
||||||
append: ddeAppend<HTMLTableElement>;
|
interface ddeSVGCircleElement extends SVGCircleElement{ append: ddeAppend<ddeSVGCircleElement>; }
|
||||||
}
|
interface ddeSVGClipPathElement extends SVGClipPathElement{ append: ddeAppend<ddeSVGClipPathElement>; }
|
||||||
interface HTMLTableSectionElement{
|
interface ddeSVGDefsElement extends SVGDefsElement{ append: ddeAppend<ddeSVGDefsElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGDescElement extends SVGDescElement{ append: ddeAppend<ddeSVGDescElement>; }
|
||||||
append: ddeAppend<HTMLTableSectionElement>;
|
interface ddeSVGEllipseElement extends SVGEllipseElement{ append: ddeAppend<ddeSVGEllipseElement>; }
|
||||||
}
|
interface ddeSVGFEBlendElement extends SVGFEBlendElement{ append: ddeAppend<ddeSVGFEBlendElement>; }
|
||||||
interface HTMLTableCellElement{
|
interface ddeSVGFEColorMatrixElement extends SVGFEColorMatrixElement{ append: ddeAppend<ddeSVGFEColorMatrixElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEComponentTransferElement extends SVGFEComponentTransferElement{ append: ddeAppend<ddeSVGFEComponentTransferElement>; }
|
||||||
append: ddeAppend<HTMLTableCellElement>;
|
interface ddeSVGFECompositeElement extends SVGFECompositeElement{ append: ddeAppend<ddeSVGFECompositeElement>; }
|
||||||
}
|
interface ddeSVGFEConvolveMatrixElement extends SVGFEConvolveMatrixElement{ append: ddeAppend<ddeSVGFEConvolveMatrixElement>; }
|
||||||
interface HTMLTemplateElement{
|
interface ddeSVGFEDiffuseLightingElement extends SVGFEDiffuseLightingElement{ append: ddeAppend<ddeSVGFEDiffuseLightingElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEDisplacementMapElement extends SVGFEDisplacementMapElement{ append: ddeAppend<ddeSVGFEDisplacementMapElement>; }
|
||||||
append: ddeAppend<HTMLTemplateElement>;
|
interface ddeSVGFEDistantLightElement extends SVGFEDistantLightElement{ append: ddeAppend<ddeSVGFEDistantLightElement>; }
|
||||||
}
|
interface ddeSVGFEDropShadowElement extends SVGFEDropShadowElement{ append: ddeAppend<ddeSVGFEDropShadowElement>; }
|
||||||
interface HTMLTextAreaElement{
|
interface ddeSVGFEFloodElement extends SVGFEFloodElement{ append: ddeAppend<ddeSVGFEFloodElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEFuncAElement extends SVGFEFuncAElement{ append: ddeAppend<ddeSVGFEFuncAElement>; }
|
||||||
append: ddeAppend<HTMLTextAreaElement>;
|
interface ddeSVGFEFuncBElement extends SVGFEFuncBElement{ append: ddeAppend<ddeSVGFEFuncBElement>; }
|
||||||
}
|
interface ddeSVGFEFuncGElement extends SVGFEFuncGElement{ append: ddeAppend<ddeSVGFEFuncGElement>; }
|
||||||
interface HTMLTableCellElement{
|
interface ddeSVGFEFuncRElement extends SVGFEFuncRElement{ append: ddeAppend<ddeSVGFEFuncRElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEGaussianBlurElement extends SVGFEGaussianBlurElement{ append: ddeAppend<ddeSVGFEGaussianBlurElement>; }
|
||||||
append: ddeAppend<HTMLTableCellElement>;
|
interface ddeSVGFEImageElement extends SVGFEImageElement{ append: ddeAppend<ddeSVGFEImageElement>; }
|
||||||
}
|
interface ddeSVGFEMergeElement extends SVGFEMergeElement{ append: ddeAppend<ddeSVGFEMergeElement>; }
|
||||||
interface HTMLTimeElement{
|
interface ddeSVGFEMergeNodeElement extends SVGFEMergeNodeElement{ append: ddeAppend<ddeSVGFEMergeNodeElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFEMorphologyElement extends SVGFEMorphologyElement{ append: ddeAppend<ddeSVGFEMorphologyElement>; }
|
||||||
append: ddeAppend<HTMLTimeElement>;
|
interface ddeSVGFEOffsetElement extends SVGFEOffsetElement{ append: ddeAppend<ddeSVGFEOffsetElement>; }
|
||||||
}
|
interface ddeSVGFEPointLightElement extends SVGFEPointLightElement{ append: ddeAppend<ddeSVGFEPointLightElement>; }
|
||||||
interface HTMLTitleElement{
|
interface ddeSVGFESpecularLightingElement extends SVGFESpecularLightingElement{ append: ddeAppend<ddeSVGFESpecularLightingElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGFESpotLightElement extends SVGFESpotLightElement{ append: ddeAppend<ddeSVGFESpotLightElement>; }
|
||||||
append: ddeAppend<HTMLTitleElement>;
|
interface ddeSVGFETileElement extends SVGFETileElement{ append: ddeAppend<ddeSVGFETileElement>; }
|
||||||
}
|
interface ddeSVGFETurbulenceElement extends SVGFETurbulenceElement{ append: ddeAppend<ddeSVGFETurbulenceElement>; }
|
||||||
interface HTMLTableRowElement{
|
interface ddeSVGFilterElement extends SVGFilterElement{ append: ddeAppend<ddeSVGFilterElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGForeignObjectElement extends SVGForeignObjectElement{ append: ddeAppend<ddeSVGForeignObjectElement>; }
|
||||||
append: ddeAppend<HTMLTableRowElement>;
|
interface ddeSVGGElement extends SVGGElement{ append: ddeAppend<ddeSVGGElement>; }
|
||||||
}
|
interface ddeSVGImageElement extends SVGImageElement{ append: ddeAppend<ddeSVGImageElement>; }
|
||||||
interface HTMLTrackElement{
|
interface ddeSVGLineElement extends SVGLineElement{ append: ddeAppend<ddeSVGLineElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGLinearGradientElement extends SVGLinearGradientElement{ append: ddeAppend<ddeSVGLinearGradientElement>; }
|
||||||
append: ddeAppend<HTMLTrackElement>;
|
interface ddeSVGMarkerElement extends SVGMarkerElement{ append: ddeAppend<ddeSVGMarkerElement>; }
|
||||||
}
|
interface ddeSVGMaskElement extends SVGMaskElement{ append: ddeAppend<ddeSVGMaskElement>; }
|
||||||
interface HTMLUListElement{
|
interface ddeSVGMetadataElement extends SVGMetadataElement{ append: ddeAppend<ddeSVGMetadataElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGMPathElement extends SVGMPathElement{ append: ddeAppend<ddeSVGMPathElement>; }
|
||||||
append: ddeAppend<HTMLUListElement>;
|
interface ddeSVGPathElement extends SVGPathElement{ append: ddeAppend<ddeSVGPathElement>; }
|
||||||
}
|
interface ddeSVGPatternElement extends SVGPatternElement{ append: ddeAppend<ddeSVGPatternElement>; }
|
||||||
interface HTMLVideoElement{
|
interface ddeSVGPolygonElement extends SVGPolygonElement{ append: ddeAppend<ddeSVGPolygonElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGPolylineElement extends SVGPolylineElement{ append: ddeAppend<ddeSVGPolylineElement>; }
|
||||||
append: ddeAppend<HTMLVideoElement>;
|
interface ddeSVGRadialGradientElement extends SVGRadialGradientElement{ append: ddeAppend<ddeSVGRadialGradientElement>; }
|
||||||
}
|
interface ddeSVGRectElement extends SVGRectElement{ append: ddeAppend<ddeSVGRectElement>; }
|
||||||
interface DocumentFragment{
|
interface ddeSVGScriptElement extends SVGScriptElement{ append: ddeAppend<ddeSVGScriptElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGSetElement extends SVGSetElement{ append: ddeAppend<ddeSVGSetElement>; }
|
||||||
append: ddeAppend<DocumentFragment>;
|
interface ddeSVGStopElement extends SVGStopElement{ append: ddeAppend<ddeSVGStopElement>; }
|
||||||
}
|
interface ddeSVGStyleElement extends SVGStyleElement{ append: ddeAppend<ddeSVGStyleElement>; }
|
||||||
interface SVGElement{
|
interface ddeSVGSVGElement extends SVGSVGElement{ append: ddeAppend<ddeSVGSVGElement>; }
|
||||||
/** Elements returned by {@link el} return parent element for `.append` method. **Regullarly created elements are untouched.** */
|
interface ddeSVGSwitchElement extends SVGSwitchElement{ append: ddeAppend<ddeSVGSwitchElement>; }
|
||||||
append: ddeAppend<SVGElement>;
|
interface ddeSVGSymbolElement extends SVGSymbolElement{ append: ddeAppend<ddeSVGSymbolElement>; }
|
||||||
}
|
interface ddeSVGTextElement extends SVGTextElement{ append: ddeAppend<ddeSVGTextElement>; }
|
||||||
|
interface ddeSVGTextPathElement extends SVGTextPathElement{ append: ddeAppend<ddeSVGTextPathElement>; }
|
||||||
|
interface ddeSVGTitleElement extends SVGTitleElement{ append: ddeAppend<ddeSVGTitleElement>; }
|
||||||
|
interface ddeSVGTSpanElement extends SVGTSpanElement{ append: ddeAppend<ddeSVGTSpanElement>; }
|
||||||
|
interface ddeSVGUseElement extends SVGUseElement{ append: ddeAppend<ddeSVGUseElement>; }
|
||||||
|
interface ddeSVGViewElement extends SVGViewElement{ append: ddeAppend<ddeSVGViewElement>; }
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
"size-limit": [
|
"size-limit": [
|
||||||
{
|
{
|
||||||
"path": "./index.js",
|
"path": "./index.js",
|
||||||
"limit": "8.5 kB",
|
"limit": "9 kB",
|
||||||
"gzip": false
|
"gzip": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
31
src/dom.js
31
src/dom.js
@ -66,6 +66,37 @@ export function createElement(tag, attributes, ...addons){
|
|||||||
scoped= 2;
|
scoped= 2;
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
/** @param {HTMLElement} element */
|
||||||
|
export function simulateSlots(element){
|
||||||
|
const _default= Symbol.for("default");
|
||||||
|
const slots= Array.from(element.querySelectorAll("slot"))
|
||||||
|
.reduce((out, curr)=> Reflect.set(out, curr.name || _default, curr) && out, {});
|
||||||
|
const has_d= Reflect.has(slots, _default);
|
||||||
|
element.append= new Proxy(element.append, {
|
||||||
|
apply(_1, _2, els){
|
||||||
|
if(!els.length) return element;
|
||||||
|
|
||||||
|
const d= document.createDocumentFragment();
|
||||||
|
for(const el of els){
|
||||||
|
if(!el || !el.slot){ if(has_d) d.appendChild(el); continue; }
|
||||||
|
const name= el.slot;
|
||||||
|
const slot= slots[name];
|
||||||
|
elementAttribute(el, "remove", "slot");
|
||||||
|
if(!slot) continue;
|
||||||
|
slot.replaceWith(el);
|
||||||
|
Reflect.deleteProperty(slots, name);
|
||||||
|
}
|
||||||
|
if(has_d){
|
||||||
|
slots[_default].replaceWith(d);
|
||||||
|
Reflect.deleteProperty(slots, _default);
|
||||||
|
}
|
||||||
|
Object.values(slots)
|
||||||
|
.forEach(slot=> slot.replaceWith(createElement().append(...Array.from(slot.childNodes))));
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return element;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @param { { type: "component", name: string, host: "this" | "parentElement" } | { type: "reactive" | "later" } } attrs
|
* @param { { type: "component", name: string, host: "this" | "parentElement" } | { type: "reactive" | "later" } } attrs
|
||||||
* @param {boolean} [is_open=false]
|
* @param {boolean} [is_open=false]
|
||||||
|
Loading…
Reference in New Issue
Block a user