@twobirds/microcomponents 0.0.20 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +1 -0
- package/README.md +33 -14
- package/assets/documentation/MicroComponents.md +228 -0
- package/assets/my-tag.css +4 -0
- package/assets/test.html +5 -1
- package/dist/MC.d.ts +32 -0
- package/dist/MC.d.ts.map +1 -0
- package/dist/MC.min.js +414 -0
- package/dist/MC.ts +350 -0
- package/dist/MCbundle.d.ts +8 -0
- package/dist/MCbundle.d.ts.map +1 -0
- package/dist/MCbundle.min.js +1 -0
- package/dist/MCbundle.ts +8 -0
- package/dist/McEvent.d.ts +15 -0
- package/dist/McEvent.d.ts.map +1 -0
- package/dist/McEvent.ts +96 -0
- package/dist/autoloader.d.ts +2 -0
- package/dist/autoloader.d.ts.map +1 -0
- package/dist/autoloader.ts +98 -0
- package/dist/customElements.d.ts +5 -0
- package/dist/customElements.d.ts.map +1 -0
- package/dist/customElements.min.js +1 -0
- package/dist/customElements.ts +67 -0
- package/dist/customObservables.d.ts +3 -0
- package/dist/customObservables.d.ts.map +1 -0
- package/dist/customObservables.min.js +1 -0
- package/dist/customObservables.ts +340 -0
- package/dist/customSelectors.d.ts +108 -0
- package/dist/customSelectors.d.ts.map +1 -0
- package/dist/customSelectors.min.js +1 -0
- package/dist/customSelectors.ts +1634 -0
- package/dist/formValues.d.ts +4 -0
- package/dist/formValues.d.ts.map +1 -0
- package/dist/formValues.ts +275 -0
- package/dist/formvValues.min.js +1 -0
- package/dist/helpers.d.ts +11 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.ts +173 -0
- package/dist/microcomponents.es3.d.ts +1 -20
- package/dist/microcomponents.es3.d.ts.map +1 -1
- package/dist/test.d.ts +2 -0
- package/dist/test.d.ts.map +1 -0
- package/package.json +11 -7
- package/public/MC.js +273 -0
- package/public/MC.min.js +414 -0
- package/public/MCbundle.js +8 -0
- package/public/MCbundle.min.js +1 -0
- package/public/McEvent.js +74 -0
- package/public/MicroComponents.svg +15 -0
- package/public/assets/search.js +1 -1
- package/public/autoloader.js +57 -0
- package/public/classes/MC.DC.html +247 -0
- package/public/classes/MC.MC.html +150 -0
- package/public/classes/MC.McBase.html +123 -0
- package/public/classes/MCbundle.McEvent.html +184 -0
- package/public/customElements.js +48 -0
- package/public/customElements.min.js +1 -0
- package/public/customObservables.js +255 -0
- package/public/customObservables.min.js +1 -0
- package/public/customSelectors.js +1088 -0
- package/public/customSelectors.min.js +1 -0
- package/public/documentation/MicroComponents.md +228 -0
- package/public/formValues.js +211 -0
- package/public/formvValues.min.js +1 -0
- package/public/functions/MC.addListener.html +73 -0
- package/public/functions/MC.removeListener.html +69 -0
- package/public/functions/MCbundle._d.html +85 -0
- package/public/functions/MCbundle._t.html +85 -0
- package/public/functions/MCbundle.debounce.html +85 -0
- package/public/functions/MCbundle.deepEqual.html +85 -0
- package/public/functions/MCbundle.defineCE.html +98 -0
- package/public/functions/MCbundle.formValues.html +89 -0
- package/public/functions/MCbundle.getCE.html +83 -0
- package/public/functions/MCbundle.htmlToElements.html +83 -0
- package/public/functions/MCbundle.isObject.html +83 -0
- package/public/functions/MCbundle.kebabToPascal.html +83 -0
- package/public/functions/MCbundle.makeCO.html +85 -0
- package/public/functions/MCbundle.nameSpace.html +89 -0
- package/public/functions/MCbundle.parse.html +85 -0
- package/public/helpers.js +128 -0
- package/public/index.html +22 -13
- package/public/interfaces/MC.HTMLMcElement.html +3605 -0
- package/public/interfaces/MCbundle.DSelector.html +1010 -0
- package/public/interfaces/MCbundle.LooseObject.html +80 -0
- package/public/interfaces/MCbundle.TSelector.html +709 -0
- package/public/microcomponents.es3.js +348 -0
- package/public/modules/MC.html +84 -0
- package/public/modules/MCbundle.html +133 -0
- package/public/modules.html +4 -4
- package/public/my-tag.css +4 -0
- package/public/test.html +5 -1
- package/public/test.js +100 -202
- package/public/types/MCbundle.selection.html +74 -0
- package/public/types/MCbundle.singleSelector.html +74 -0
- package/src/MC.ts +350 -0
- package/src/MCbundle.ts +8 -0
- package/src/McEvent.ts +96 -0
- package/src/autoloader.ts +98 -0
- package/src/customElements.ts +67 -0
- package/src/customObservables.ts +340 -0
- package/src/customSelectors.ts +1634 -0
- package/src/formValues.ts +275 -0
- package/src/helpers.ts +173 -0
- package/src/microcomponents.es3.js +353 -82
- package/src/test.js +137 -218
- package/tsconfig.json +2 -2
- package/typedoc.json +1 -1
- package/webpack.config.js +233 -0
- package/dist/microcomponents.d.ts +0 -26
- package/dist/microcomponents.d.ts.map +0 -1
- package/dist/microcomponents.es3.js +0 -96
- package/dist/microcomponents.es3.min.js +0 -15
- package/dist/microcomponents.js +0 -176
- package/dist/microcomponents.min.js +0 -38
- package/dist/microcomponents.ts +0 -216
- package/public/classes/microcomponents.MC.html +0 -313
- package/public/classes/microcomponents_es3.MC.html +0 -336
- package/public/functions/microcomponents_es3.__isEmpty.html +0 -60
- package/public/microcomponents.js +0 -176
- package/public/modules/microcomponents.html +0 -57
- package/public/modules/microcomponents_es3.html +0 -60
- package/src/microcomponents.ts +0 -216
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>nameSpace | Micro Components</title><meta name="description" content="Documentation for Micro Components"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
|
+
<div class="tsd-toolbar-contents container">
|
|
3
|
+
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
|
+
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
5
|
+
<div class="field">
|
|
6
|
+
<div id="tsd-toolbar-links"></div></div>
|
|
7
|
+
<ul class="results">
|
|
8
|
+
<li class="state loading">Preparing search index...</li>
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Micro Components</a></div>
|
|
10
|
+
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
|
+
<div class="container container-main">
|
|
12
|
+
<div class="col-8 col-content">
|
|
13
|
+
<div class="tsd-page-title">
|
|
14
|
+
<ul class="tsd-breadcrumb">
|
|
15
|
+
<li><a href="../modules.html">Micro Components</a></li>
|
|
16
|
+
<li><a href="../modules/MCbundle.html">MCbundle</a></li>
|
|
17
|
+
<li><a href="MCbundle.nameSpace.html">nameSpace</a></li></ul>
|
|
18
|
+
<h1>Function nameSpace</h1></div>
|
|
19
|
+
<section class="tsd-panel">
|
|
20
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
21
|
+
<li class="tsd-signature tsd-anchor-link" id="nameSpace">name<wbr/>Space<span class="tsd-signature-symbol">(</span>ns<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, obj<span class="tsd-signature-symbol">: </span><a href="../interfaces/MCbundle.LooseObject.html" class="tsd-signature-type" data-tsd-kind="Interface">LooseObject</a>, val<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span>, orig<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><a href="#nameSpace" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" id="icon-anchor-a"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" id="icon-anchor-b"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" id="icon-anchor-c"></path></svg></a></li>
|
|
22
|
+
<li class="tsd-description">
|
|
23
|
+
<div class="tsd-parameters">
|
|
24
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
25
|
+
<ul class="tsd-parameter-list">
|
|
26
|
+
<li>
|
|
27
|
+
<h5>ns: <span class="tsd-signature-type">string</span></h5></li>
|
|
28
|
+
<li>
|
|
29
|
+
<h5>obj: <a href="../interfaces/MCbundle.LooseObject.html" class="tsd-signature-type" data-tsd-kind="Interface">LooseObject</a></h5></li>
|
|
30
|
+
<li>
|
|
31
|
+
<h5>val: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = null</span></h5></li>
|
|
32
|
+
<li>
|
|
33
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> orig: <span class="tsd-signature-type">any</span></h5></li></ul></div>
|
|
34
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources">
|
|
35
|
+
<ul>
|
|
36
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/3ccde69/src/helpers.ts#L55">src/helpers.ts:55</a></li></ul></aside></li></ul></section></div>
|
|
37
|
+
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
38
|
+
<div class="tsd-navigation settings">
|
|
39
|
+
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
40
|
+
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Settings</h3></summary>
|
|
41
|
+
<div class="tsd-accordion-details">
|
|
42
|
+
<div class="tsd-filter-visibility">
|
|
43
|
+
<h4 class="uppercase">Member Visibility</h4><form>
|
|
44
|
+
<ul id="tsd-filter-options">
|
|
45
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
46
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
|
|
47
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
|
|
48
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
|
|
49
|
+
<div class="tsd-theme-toggle">
|
|
50
|
+
<h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
|
|
51
|
+
<nav class="tsd-navigation primary">
|
|
52
|
+
<details class="tsd-index-accordion" open><summary class="tsd-accordion-summary">
|
|
53
|
+
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
|
|
54
|
+
<div class="tsd-accordion-details">
|
|
55
|
+
<ul>
|
|
56
|
+
<li class="current"><a href="../modules.html">Micro <wbr/>Components</a>
|
|
57
|
+
<ul>
|
|
58
|
+
<li class="tsd-kind-module"><a href="../modules/MC.html">MC</a></li>
|
|
59
|
+
<li class="current tsd-kind-module"><a href="../modules/MCbundle.html">MCbundle</a></li></ul></li></ul></div></details></nav>
|
|
60
|
+
<nav class="tsd-navigation secondary menu-sticky">
|
|
61
|
+
<ul>
|
|
62
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#DC" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="#FF4D82" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12" id="icon-8388608-path"></rect><path d="M10.354 17V8.24H13.066C13.586 8.24 14.042 8.348 14.434 8.564C14.826 8.772 15.13 9.064 15.346 9.44C15.562 9.816 15.67 10.256 15.67 10.76C15.67 11.352 15.514 11.86 15.202 12.284C14.898 12.708 14.482 13 13.954 13.16L15.79 17H14.518L12.838 13.28H11.434V17H10.354ZM11.434 12.308H13.066C13.514 12.308 13.874 12.168 14.146 11.888C14.418 11.6 14.554 11.224 14.554 10.76C14.554 10.288 14.418 9.912 14.146 9.632C13.874 9.352 13.514 9.212 13.066 9.212H11.434V12.308Z" fill="var(--color-text)" id="icon-8388608-text"></path></svg>DC</a></li>
|
|
63
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#HTMLMcElement" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>HTMLMc<wbr/>Element</a></li>
|
|
64
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#MC" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>MC</a></li>
|
|
65
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#McBase" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Mc<wbr/>Base</a></li>
|
|
66
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#addListener" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>add<wbr/>Listener</a></li>
|
|
67
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#removeListener" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>remove<wbr/>Listener</a></li>
|
|
68
|
+
<li class="tsd-kind-class tsd-parent-kind-module"><a href="../classes/MCbundle.McEvent.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-128-path"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)" id="icon-128-text"></path></svg>Mc<wbr/>Event</a></li>
|
|
69
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/MCbundle.DSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-256-path"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)" id="icon-256-text"></path></svg>DSelector</a></li>
|
|
70
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/MCbundle.LooseObject.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Loose<wbr/>Object</a></li>
|
|
71
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/MCbundle.TSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>TSelector</a></li>
|
|
72
|
+
<li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="../types/MCbundle.selection.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-4194304-path"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)" id="icon-4194304-text"></path></svg>selection</a></li>
|
|
73
|
+
<li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="../types/MCbundle.singleSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>single<wbr/>Selector</a></li>
|
|
74
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle._d.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg>$d</a></li>
|
|
75
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle._t.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>$t</a></li>
|
|
76
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.debounce.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>debounce</a></li>
|
|
77
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.deepEqual.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>deep<wbr/>Equal</a></li>
|
|
78
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.defineCE.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>defineCE</a></li>
|
|
79
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.formValues.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>form<wbr/>Values</a></li>
|
|
80
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.getCE.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>getCE</a></li>
|
|
81
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.htmlToElements.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>html<wbr/>To<wbr/>Elements</a></li>
|
|
82
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.isObject.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>is<wbr/>Object</a></li>
|
|
83
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.kebabToPascal.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>kebab<wbr/>To<wbr/>Pascal</a></li>
|
|
84
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.makeCO.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>makeCO</a></li>
|
|
85
|
+
<li class="current tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.nameSpace.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>name<wbr/>Space</a></li>
|
|
86
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.parse.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>parse</a></li></ul></nav></div></div>
|
|
87
|
+
<div class="container tsd-generator">
|
|
88
|
+
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
89
|
+
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>parse | Micro Components</title><meta name="description" content="Documentation for Micro Components"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
|
+
<div class="tsd-toolbar-contents container">
|
|
3
|
+
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
|
+
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
5
|
+
<div class="field">
|
|
6
|
+
<div id="tsd-toolbar-links"></div></div>
|
|
7
|
+
<ul class="results">
|
|
8
|
+
<li class="state loading">Preparing search index...</li>
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Micro Components</a></div>
|
|
10
|
+
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
|
+
<div class="container container-main">
|
|
12
|
+
<div class="col-8 col-content">
|
|
13
|
+
<div class="tsd-page-title">
|
|
14
|
+
<ul class="tsd-breadcrumb">
|
|
15
|
+
<li><a href="../modules.html">Micro Components</a></li>
|
|
16
|
+
<li><a href="../modules/MCbundle.html">MCbundle</a></li>
|
|
17
|
+
<li><a href="MCbundle.parse.html">parse</a></li></ul>
|
|
18
|
+
<h1>Function parse</h1></div>
|
|
19
|
+
<section class="tsd-panel">
|
|
20
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
21
|
+
<li class="tsd-signature tsd-anchor-link" id="parse">parse<span class="tsd-signature-symbol">(</span>what<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Object</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span>, parseThis<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Object</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><a href="#parse" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" id="icon-anchor-a"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" id="icon-anchor-b"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" id="icon-anchor-c"></path></svg></a></li>
|
|
22
|
+
<li class="tsd-description">
|
|
23
|
+
<div class="tsd-parameters">
|
|
24
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
25
|
+
<ul class="tsd-parameter-list">
|
|
26
|
+
<li>
|
|
27
|
+
<h5>what: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Object</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li>
|
|
28
|
+
<li>
|
|
29
|
+
<h5>parseThis: <span class="tsd-signature-type">Object</span></h5></li></ul></div>
|
|
30
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources">
|
|
31
|
+
<ul>
|
|
32
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/3ccde69/src/helpers.ts#L100">src/helpers.ts:100</a></li></ul></aside></li></ul></section></div>
|
|
33
|
+
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
34
|
+
<div class="tsd-navigation settings">
|
|
35
|
+
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
36
|
+
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Settings</h3></summary>
|
|
37
|
+
<div class="tsd-accordion-details">
|
|
38
|
+
<div class="tsd-filter-visibility">
|
|
39
|
+
<h4 class="uppercase">Member Visibility</h4><form>
|
|
40
|
+
<ul id="tsd-filter-options">
|
|
41
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
42
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
|
|
43
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
|
|
44
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
|
|
45
|
+
<div class="tsd-theme-toggle">
|
|
46
|
+
<h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
|
|
47
|
+
<nav class="tsd-navigation primary">
|
|
48
|
+
<details class="tsd-index-accordion" open><summary class="tsd-accordion-summary">
|
|
49
|
+
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
|
|
50
|
+
<div class="tsd-accordion-details">
|
|
51
|
+
<ul>
|
|
52
|
+
<li class="current"><a href="../modules.html">Micro <wbr/>Components</a>
|
|
53
|
+
<ul>
|
|
54
|
+
<li class="tsd-kind-module"><a href="../modules/MC.html">MC</a></li>
|
|
55
|
+
<li class="current tsd-kind-module"><a href="../modules/MCbundle.html">MCbundle</a></li></ul></li></ul></div></details></nav>
|
|
56
|
+
<nav class="tsd-navigation secondary menu-sticky">
|
|
57
|
+
<ul>
|
|
58
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#DC" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="#FF4D82" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12" id="icon-8388608-path"></rect><path d="M10.354 17V8.24H13.066C13.586 8.24 14.042 8.348 14.434 8.564C14.826 8.772 15.13 9.064 15.346 9.44C15.562 9.816 15.67 10.256 15.67 10.76C15.67 11.352 15.514 11.86 15.202 12.284C14.898 12.708 14.482 13 13.954 13.16L15.79 17H14.518L12.838 13.28H11.434V17H10.354ZM11.434 12.308H13.066C13.514 12.308 13.874 12.168 14.146 11.888C14.418 11.6 14.554 11.224 14.554 10.76C14.554 10.288 14.418 9.912 14.146 9.632C13.874 9.352 13.514 9.212 13.066 9.212H11.434V12.308Z" fill="var(--color-text)" id="icon-8388608-text"></path></svg>DC</a></li>
|
|
59
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#HTMLMcElement" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>HTMLMc<wbr/>Element</a></li>
|
|
60
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#MC" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>MC</a></li>
|
|
61
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#McBase" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Mc<wbr/>Base</a></li>
|
|
62
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#addListener" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>add<wbr/>Listener</a></li>
|
|
63
|
+
<li class="tsd-kind-reference tsd-parent-kind-module"><a href="../modules/MCbundle.html#removeListener" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>remove<wbr/>Listener</a></li>
|
|
64
|
+
<li class="tsd-kind-class tsd-parent-kind-module"><a href="../classes/MCbundle.McEvent.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-128-path"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)" id="icon-128-text"></path></svg>Mc<wbr/>Event</a></li>
|
|
65
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/MCbundle.DSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-256-path"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)" id="icon-256-text"></path></svg>DSelector</a></li>
|
|
66
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/MCbundle.LooseObject.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Loose<wbr/>Object</a></li>
|
|
67
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/MCbundle.TSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>TSelector</a></li>
|
|
68
|
+
<li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="../types/MCbundle.selection.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-4194304-path"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)" id="icon-4194304-text"></path></svg>selection</a></li>
|
|
69
|
+
<li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="../types/MCbundle.singleSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>single<wbr/>Selector</a></li>
|
|
70
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle._d.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg>$d</a></li>
|
|
71
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle._t.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>$t</a></li>
|
|
72
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.debounce.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>debounce</a></li>
|
|
73
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.deepEqual.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>deep<wbr/>Equal</a></li>
|
|
74
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.defineCE.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>defineCE</a></li>
|
|
75
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.formValues.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>form<wbr/>Values</a></li>
|
|
76
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.getCE.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>getCE</a></li>
|
|
77
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.htmlToElements.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>html<wbr/>To<wbr/>Elements</a></li>
|
|
78
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.isObject.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>is<wbr/>Object</a></li>
|
|
79
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.kebabToPascal.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>kebab<wbr/>To<wbr/>Pascal</a></li>
|
|
80
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.makeCO.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>makeCO</a></li>
|
|
81
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.nameSpace.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>name<wbr/>Space</a></li>
|
|
82
|
+
<li class="current tsd-kind-function tsd-parent-kind-module"><a href="MCbundle.parse.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>parse</a></li></ul></nav></div></div>
|
|
83
|
+
<div class="container tsd-generator">
|
|
84
|
+
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
85
|
+
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
export function isObject(value) {
|
|
3
|
+
return value != null && typeof value === 'object';
|
|
4
|
+
}
|
|
5
|
+
export function kebabToPascal(str) {
|
|
6
|
+
return str
|
|
7
|
+
.split('-') // Split by hyphens
|
|
8
|
+
.map(word => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize each part
|
|
9
|
+
.join(''); // Join without spaces
|
|
10
|
+
}
|
|
11
|
+
export function debounce(func, milliseconds) {
|
|
12
|
+
let timeout;
|
|
13
|
+
return () => {
|
|
14
|
+
clearTimeout(timeout);
|
|
15
|
+
timeout = setTimeout(function () {
|
|
16
|
+
func(...arguments);
|
|
17
|
+
}, milliseconds);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
;
|
|
21
|
+
export function deepEqual(o1, o2) {
|
|
22
|
+
const k1 = Object.keys(o1);
|
|
23
|
+
const k2 = Object.keys(o2);
|
|
24
|
+
if (k1.length !== k2.length) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
for (const key of k1) {
|
|
28
|
+
const v1 = o1[key], v2 = o2[key], recurse = isObject(v1) && isObject(v2);
|
|
29
|
+
;
|
|
30
|
+
if ((recurse && !deepEqual(v1, v2))
|
|
31
|
+
|| (!recurse && v1 !== v2)) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
export function nameSpace(ns, obj, val = null, orig) {
|
|
38
|
+
let leftOver = ns.split('.');
|
|
39
|
+
if (!orig) {
|
|
40
|
+
orig = obj;
|
|
41
|
+
}
|
|
42
|
+
// console.log( 'start', ns, obj, val, leftOver );
|
|
43
|
+
let last = leftOver.shift(), // this property name
|
|
44
|
+
lns = leftOver.join('.') // the leftover namespace
|
|
45
|
+
;
|
|
46
|
+
if (val !== null && last.length && obj[last] === undefined) { // extend if val given and ns leftover...
|
|
47
|
+
// console.log( 'add prop', last );
|
|
48
|
+
obj[last] = {};
|
|
49
|
+
}
|
|
50
|
+
let lob = obj[last] // the leftover value or obj
|
|
51
|
+
;
|
|
52
|
+
// console.log( 'lob', lob, 'last:', last, 'lns:', lns, 'obj:', obj );
|
|
53
|
+
if (lns.length === 0) { // this should be the value to set or get
|
|
54
|
+
if (val !== null) {
|
|
55
|
+
obj[last] = val;
|
|
56
|
+
return orig;
|
|
57
|
+
}
|
|
58
|
+
return obj[last];
|
|
59
|
+
}
|
|
60
|
+
if (isObject(obj[last])) {
|
|
61
|
+
return nameSpace(lns, obj[last], val, orig);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
if (val) {
|
|
65
|
+
return orig;
|
|
66
|
+
}
|
|
67
|
+
return lob[last];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export function parse(what, parseThis) {
|
|
71
|
+
var args = Array.from(arguments);
|
|
72
|
+
if (!args.length) {
|
|
73
|
+
console.error('no arguments give to parse');
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (args.length === 1) {
|
|
77
|
+
return args[1];
|
|
78
|
+
}
|
|
79
|
+
else if (args.length > 2) {
|
|
80
|
+
while (args.length > 1) {
|
|
81
|
+
args[0] = parse(args[0], args[1]);
|
|
82
|
+
args.splice(1, 1);
|
|
83
|
+
}
|
|
84
|
+
return args[0];
|
|
85
|
+
}
|
|
86
|
+
// implicit else: exactly 2 arguments
|
|
87
|
+
if (typeof what === 'string') {
|
|
88
|
+
var vars = what.match(/\{[^\{\}]*\}/g);
|
|
89
|
+
if (!!vars) {
|
|
90
|
+
vars
|
|
91
|
+
.forEach(function (pPropname) {
|
|
92
|
+
var propname = pPropname.substr(1, pPropname.length - 2), value = nameSpace(propname, parseThis);
|
|
93
|
+
if (typeof value !== 'undefined') {
|
|
94
|
+
what = what.replace(pPropname, value);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else if (isObject(what)) {
|
|
100
|
+
switch (what.constructor) {
|
|
101
|
+
case Object:
|
|
102
|
+
Object
|
|
103
|
+
.keys(what)
|
|
104
|
+
.forEach(function (pKey) {
|
|
105
|
+
if (what.hasOwnProperty(pKey)) {
|
|
106
|
+
what[pKey] = parse(what[pKey], parseThis);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
break;
|
|
110
|
+
case Array:
|
|
111
|
+
what
|
|
112
|
+
.forEach(function (pValue, pKey, original) {
|
|
113
|
+
original[pKey] = parse(what[pKey], parseThis);
|
|
114
|
+
});
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return what;
|
|
119
|
+
}
|
|
120
|
+
;
|
|
121
|
+
export function htmlToElements(html) {
|
|
122
|
+
let template = document.createElement('template');
|
|
123
|
+
html = html
|
|
124
|
+
.replace(/<([A-Za-z0-9\-]*)([^>\/]*)(\/>)/gi, "<$1$2></$1>"); // replace XHTML closing tags by full closing tags
|
|
125
|
+
template.innerHTML = html;
|
|
126
|
+
template.content.normalize();
|
|
127
|
+
return Array.from(template.content.childNodes);
|
|
128
|
+
}
|
package/public/index.html
CHANGED
|
@@ -18,26 +18,35 @@
|
|
|
18
18
|
</a>
|
|
19
19
|
<p><img src="https://gitlab.com/twoBirds/microcomponents/-/raw/main/MicroComponents.svg" alt="Micro Components Logo"></p>
|
|
20
20
|
<p><strong>This code aims at improving Javascript modularity and encapsulation</strong>.</p>
|
|
21
|
-
<p>
|
|
22
|
-
<p>Using micro components enforces <strong>DRY, KISS and SOLID</strong> principles in Javascript programming. Read this <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/assets/documentation/proposal_draft.md?ref_type=heads">RFC</a> for the shortest info, and <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/assets/documentation/why.md?ref_type=heads">click here to see why you may want to use it</a>.</p>
|
|
21
|
+
<p>Using micro components enforces <strong>DRY, KISS and SOLID</strong> principles in Javascript programming.</p>
|
|
23
22
|
|
|
24
23
|
<a href="#status" id="status" style="color: inherit; text-decoration: none;">
|
|
25
24
|
<h2>Status</h2>
|
|
26
25
|
</a>
|
|
27
|
-
<p>WIP
|
|
26
|
+
<p><strong>WIP</strong>. Should be done soon. In <a href="http://twobirds.gitlab.io/microcomponents/test.html">manual testing</a>, also working a lot on the documentation.</p>
|
|
28
27
|
|
|
29
28
|
<a href="#disclaimer" id="disclaimer" style="color: inherit; text-decoration: none;">
|
|
30
29
|
<h2>Disclaimer</h2>
|
|
31
30
|
</a>
|
|
32
|
-
<p>I decided to extract this functionality from the <a href="https://www.npmjs.com/package/twobirds-core">twoBirds framework</a>,
|
|
33
|
-
<p>
|
|
31
|
+
<p>I decided to extract this functionality from the <a href="https://www.npmjs.com/package/twobirds-core">twoBirds framework</a>, because it is a useful tool in itself and it is framework agnostic. It relies solely on the standard DOM and native javascript or typescript.</p>
|
|
32
|
+
<p>Later this will be backported into twoBirds as a dependency, and twoBirds will become completely modularized on the base of MCs.</p>
|
|
33
|
+
<p>This is a massive undertaking. MCs are just the foundation of what I do. <strong>I am about to dump</strong> <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/assets/documentation/magic.md?ref_type=heads#things-i-already-did-with-this-in-my-own-framework-twobirds-or-in-apps-that-i-developed-with-it">20+ years of javascript programming</a> <strong>into open source libraries</strong>, so feel free to <a href="https://www.gofundme.com/f/nachhaltige-programmierung">fund this</a>. The better this is funded, the faster it will be done. Given enough resources, I will start a crowdfunded company that will develop a new open source ecosystem for javascript/typescript programming. By <strong>"Open Source"</strong> I mean <strong>really free and open</strong>, as <strong>you get all my inner source code with it</strong>. Once you understand the Micro Component principle, you are back in command of your software, no matter what MC functionality you import in your system. Since <strong>Micro Components</strong> are encapsuled, off-shoring and near-shoring is no problem, and reusability is guaranteed. Your external coders do not need to access your code repository or your toolchain. They only need to understand MCs.</p>
|
|
34
34
|
|
|
35
35
|
<a href="#general" id="general" style="color: inherit; text-decoration: none;">
|
|
36
36
|
<h2>General</h2>
|
|
37
37
|
</a>
|
|
38
|
-
<p>This is a low-level
|
|
39
|
-
<p>
|
|
40
|
-
<p>
|
|
38
|
+
<p><strong>This is a low-level vanilla OOP approach to Javascript programming.</strong></p>
|
|
39
|
+
<p>In its core it consists of a two classes named <strong>MC</strong> and <strong>DC</strong>. Your class code extends om one of these classes.</p>
|
|
40
|
+
<p>This repository exports 5 independent functionalities:</p>
|
|
41
|
+
<ol>
|
|
42
|
+
<li><strong><a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/assets/documentation/MicroComponents.md?ref_type=heads">Micro Components</a></strong> contains the <strong>MC</strong> and <strong>DC</strong> classes you can use as super classes.</li>
|
|
43
|
+
<li><strong>Custom Elements</strong> lets you define and retrieve your own custom elements based on the MC class.</li>
|
|
44
|
+
<li><strong>Form Values</strong> gives you 2-way binding between a HTML form and an observable.</li>
|
|
45
|
+
<li><strong>Convenience Observables</strong> adds observability and run time type safety to object properties.</li>
|
|
46
|
+
<li>(tbd) <strong>Convenience Selectors</strong> provide jQuery like selectors for both the DOM and micro components.</li>
|
|
47
|
+
</ol>
|
|
48
|
+
<p>Also there is a bundle file that contains all of the above.</p>
|
|
49
|
+
<p>Check the <a href="https://twobirds.gitlab.io/microcomponents/modules.html">typedoc API reference</a> if you want to drill into the source code.</p>
|
|
41
50
|
<p>To see what can be done, go to <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/assets/documentation/magic.md?ref_type=heads">additional concepts</a> which shows what it already has been used for.</p>
|
|
42
51
|
|
|
43
52
|
<a href="#simple-usage" id="simple-usage" style="color: inherit; text-decoration: none;">
|
|
@@ -48,20 +57,20 @@
|
|
|
48
57
|
<pre><code class="language-HTML"><span class="hl-0"><</span><span class="hl-1">div</span><span class="hl-0">></</span><span class="hl-1">div</span><span class="hl-0">></span>
|
|
49
58
|
</code></pre>
|
|
50
59
|
<p>code:</p>
|
|
51
|
-
<pre><code class="language-typescript"><span class="hl-2">// create a custom micro component class</span><br/><span class="hl-3">class</span><span class="hl-4"> </span><span class="hl-5">MyMC</span><span class="hl-4"> </span><span class="hl-3">extends</span><span class="hl-4"> </span><span class="hl-5">
|
|
60
|
+
<pre><code class="language-typescript"><span class="hl-2">// create a custom micro component class</span><br/><span class="hl-3">class</span><span class="hl-4"> </span><span class="hl-5">MyMC</span><span class="hl-4"> </span><span class="hl-3">extends</span><span class="hl-4"> </span><span class="hl-5">DC</span><span class="hl-4">{</span><br/><br/><span class="hl-4"> </span><span class="hl-3">constructor</span><span class="hl-4">( </span><span class="hl-6">target</span><span class="hl-4"> ){</span><br/><span class="hl-4"> </span><span class="hl-3">super</span><span class="hl-4">( </span><span class="hl-6">target</span><span class="hl-4"> );</span><br/><span class="hl-4"> }</span><br/><br/><span class="hl-4"> </span><span class="hl-7">helloWorld</span><span class="hl-4">(){</span><br/><span class="hl-4"> </span><span class="hl-6">console</span><span class="hl-4">.</span><span class="hl-7">log</span><span class="hl-4">( </span><span class="hl-8">'Hello World'</span><span class="hl-4"> );</span><br/><span class="hl-4"> }</span><br/><br/><span class="hl-4">}</span><br/><br/><span class="hl-2">// get some element from the DOM</span><br/><span class="hl-3">const</span><span class="hl-4"> </span><span class="hl-9">element</span><span class="hl-4"> = </span><span class="hl-6">document</span><span class="hl-4">.</span><span class="hl-7">querySelector</span><span class="hl-4">(</span><span class="hl-8">'div'</span><span class="hl-4">)</span><br/><br/><span class="hl-2">// Add the custom micro component instance to the target element</span><br/><span class="hl-9">DC</span><span class="hl-4">.</span><span class="hl-7">add</span><span class="hl-4">(</span><br/><span class="hl-4"> </span><span class="hl-6">element</span><span class="hl-4">,</span><br/><span class="hl-4"> </span><span class="hl-8">'myMC'</span><span class="hl-4">,</span><br/><span class="hl-4"> </span><span class="hl-3">new</span><span class="hl-4"> </span><span class="hl-7">MyMC</span><span class="hl-4">( </span><span class="hl-6">element</span><span class="hl-4"> )</span><br/><span class="hl-4">);</span><br/><br/><span class="hl-2">// Hello World</span><br/><span class="hl-6">element</span><br/><span class="hl-4"> .</span><span class="hl-6">_mc</span><br/><span class="hl-4"> .</span><span class="hl-6">myMC</span><br/><span class="hl-4"> .</span><span class="hl-7">helloWorld</span><span class="hl-4">();</span>
|
|
52
61
|
</code></pre>
|
|
53
62
|
<p>after:</p>
|
|
54
63
|
<pre><code class="language-HTML"><span class="hl-0"><</span><span class="hl-1">div</span><span class="hl-4"> </span><span class="hl-10">_mc</span><span class="hl-0">></</span><span class="hl-1">div</span><span class="hl-0">></span>
|
|
55
64
|
</code></pre>
|
|
56
65
|
<p>_mc indicates that this HTML element contains at least one micro component. This is needed for the selectors.</p>
|
|
57
|
-
<p>
|
|
66
|
+
<p>The _mc attribute and properties are the only interference with the DOM, so every other system should be happy to work with this.</p>
|
|
58
67
|
|
|
59
68
|
<a href="#contact" id="contact" style="color: inherit; text-decoration: none;">
|
|
60
69
|
<h2>Contact</h2>
|
|
61
70
|
</a>
|
|
62
71
|
<p>Feel free to contact me for any questions or inquiries:</p>
|
|
63
72
|
<p>email <a href="mailto:fthuerigen@gmail.com?subject=Micro%20Components">Frank Thürigen</a></p>
|
|
64
|
-
<p>And again, you can <a href="https://
|
|
73
|
+
<p>And again, you can <a href="https://www.gofundme.com/f/nachhaltige-programmierung">fund this</a>.</p>
|
|
65
74
|
</div></div>
|
|
66
75
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
67
76
|
<div class="tsd-navigation settings">
|
|
@@ -84,8 +93,8 @@
|
|
|
84
93
|
<ul>
|
|
85
94
|
<li class="current selected"><a href="modules.html">Micro <wbr/>Components</a>
|
|
86
95
|
<ul>
|
|
87
|
-
<li class="tsd-kind-module"><a href="modules/
|
|
88
|
-
<li class="tsd-kind-module"><a href="modules/
|
|
96
|
+
<li class="tsd-kind-module"><a href="modules/MC.html">MC</a></li>
|
|
97
|
+
<li class="tsd-kind-module"><a href="modules/MCbundle.html">MCbundle</a></li></ul></li></ul></div></details></nav></div></div>
|
|
89
98
|
<div class="container tsd-generator">
|
|
90
99
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
91
100
|
<div class="overlay"></div><script src="assets/main.js"></script></body></html>
|