mirror of
				https://github.com/jaandrle/deka-dom-el
				synced 2025-11-03 22:59:16 +01:00 
			
		
		
		
	🎉 ⚡
This commit is contained in:
		@@ -4,25 +4,32 @@ import { mnemonicUl } from "../mnemonicUl.html.js";
 | 
			
		||||
export function mnemonic(){
 | 
			
		||||
	return mnemonicUl().append(
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "customElementRender(<custom-element>, <connect-target>, <render-function>[, <properties>])"), " — use function to render DOM structure for given <custom-element>",
 | 
			
		||||
			el("code", "customElementRender(<custom-element>, <connect-target>, <render-function>[, <properties>])"),
 | 
			
		||||
			" — use function to render DOM structure for given <custom-element>",
 | 
			
		||||
		),
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "customElementWithDDE(<custom-element>)"), " — register <custom-element> to DDE library, see also `lifecyclesToEvents`, can be also used as decorator",
 | 
			
		||||
			el("code", "customElementWithDDE(<custom-element>)"),
 | 
			
		||||
			" — register <custom-element> to DDE library, see also `lifecyclesToEvents`, can be also used as decorator",
 | 
			
		||||
		),
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "observedAttributes(<custom-element>)"), " — returns record of observed attributes (keys uses camelCase)",
 | 
			
		||||
			el("code", "observedAttributes(<custom-element>)"),
 | 
			
		||||
			" — returns record of observed attributes (keys uses camelCase)",
 | 
			
		||||
		),
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "S.observedAttributes(<custom-element>)"), " — returns record of observed attributes (keys uses camelCase and values are signals)",
 | 
			
		||||
			el("code", "S.observedAttributes(<custom-element>)"),
 | 
			
		||||
			" — returns record of observed attributes (keys uses camelCase and values are signals)",
 | 
			
		||||
		),
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "lifecyclesToEvents(<class-declaration>)"), " — convert lifecycle methods to events, can be also used as decorator",
 | 
			
		||||
			el("code", "lifecyclesToEvents(<class-declaration>)"),
 | 
			
		||||
			" — convert lifecycle methods to events, can be also used as decorator",
 | 
			
		||||
		),
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "simulateSlots(<class-instance>, <body>[, <mapper>])"), " — simulate slots for Custom Elements without shadow DOM",
 | 
			
		||||
			el("code", "simulateSlots(<class-instance>, <body>[, <mapper>])"),
 | 
			
		||||
			" — simulate slots for Custom Elements without shadow DOM",
 | 
			
		||||
		),
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "simulateSlots(<dde-component>[, <mapper>])"), " — simulate slots for “dde”/functional components",
 | 
			
		||||
			el("code", "simulateSlots(<dde-component>[, <mapper>])"),
 | 
			
		||||
			" — simulate slots for “dde”/functional components",
 | 
			
		||||
		),
 | 
			
		||||
	);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -4,22 +4,28 @@ import { mnemonicUl } from "../mnemonicUl.html.js";
 | 
			
		||||
export function mnemonic(){
 | 
			
		||||
	return mnemonicUl().append(
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "assign(<element>, ...<idl-objects>): <element>"), " — assign properties to the element",
 | 
			
		||||
			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("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("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("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("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("code", "elNS(<namespace>)(<as-el-see-above>)[.append(...)]: <element-based-on-arguments>"),
 | 
			
		||||
			" — typically SVG elements",
 | 
			
		||||
		)
 | 
			
		||||
	);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -4,17 +4,21 @@ import { mnemonicUl } from "../mnemonicUl.html.js";
 | 
			
		||||
export function mnemonic(){
 | 
			
		||||
	return mnemonicUl().append(
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "on(<event>, <listener>[, <options>])(<element>)"), " — just ", el("code", "<element>.addEventListener(<event>, <listener>[, <options>])")
 | 
			
		||||
			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(...){...}"),
 | 
			
		||||
			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("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("code", "dispatchEvent(<event>[, <options>])(element, detail)"),
 | 
			
		||||
			" — just ", el("code", "<element>.dispatchEvent(new CustomEvent(<event>, { detail, ...<options> }))")
 | 
			
		||||
		),
 | 
			
		||||
	);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -4,13 +4,16 @@ import { mnemonicUl } from "../mnemonicUl.html.js";
 | 
			
		||||
export function mnemonic(){
 | 
			
		||||
	return mnemonicUl().append(
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "el(<function>, <function-argument(s)>)[.append(...)]: <element-returned-by-function>"), " — using component represented by function",
 | 
			
		||||
			el("code", "el(<function>, <function-argument(s)>)[.append(...)]: <element-returned-by-function>"),
 | 
			
		||||
			" — using component represented by function",
 | 
			
		||||
		),
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "scope.host()"), " — get current component reference"
 | 
			
		||||
			el("code", "scope.host()"),
 | 
			
		||||
			" — get current component reference"
 | 
			
		||||
		),
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "scope.host(...<addons>)"), " — use addons to current component",
 | 
			
		||||
			el("code", "scope.host(...<addons>)"),
 | 
			
		||||
			" — use addons to current component",
 | 
			
		||||
		)
 | 
			
		||||
	);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -7,22 +7,28 @@ export function mnemonic(){
 | 
			
		||||
			el("code", "S(<value>)"), " — signal: reactive value",
 | 
			
		||||
		),
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "S(()=> <computation>)"), " — read-only signal: reactive value dependent on calculation using other signals",
 | 
			
		||||
			el("code", "S(()=> <computation>)"),
 | 
			
		||||
			" — read-only signal: reactive value dependent on calculation using other signals",
 | 
			
		||||
		),
 | 
			
		||||
		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("code", "S.clear(...<signals>)"), " — off and clear signals",
 | 
			
		||||
			el("code", "S.clear(...<signals>)"),
 | 
			
		||||
			" — off and clear signals",
 | 
			
		||||
		),
 | 
			
		||||
		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("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"
 | 
			
		||||
		),
 | 
			
		||||
		el("li").append(
 | 
			
		||||
			el("code", "S.el(<signal>, <function-returning-dom>)"), " — render partial dom structure (template) based on the current signal value",
 | 
			
		||||
			el("code", "S.el(<signal>, <function-returning-dom>)"),
 | 
			
		||||
			" — render partial dom structure (template) based on the current signal value",
 | 
			
		||||
		)
 | 
			
		||||
	);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user