@twobirds/microcomponents 0.0.3 → 0.0.6

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.
Files changed (30) hide show
  1. package/MicroComponentProposal_draft.md +1 -1
  2. package/README.md +43 -58
  3. package/dist/microcomponents.d.ts +218 -2
  4. package/dist/microcomponents.d.ts.map +1 -1
  5. package/dist/microcomponents.js +237 -43
  6. package/dist/microcomponents.min.js +7 -6
  7. package/dist/microcomponents.ts +391 -201
  8. package/jsdoc.conf.json +19 -0
  9. package/microcomponents_usage.md +56 -24
  10. package/microcomponents_why.md +25 -0
  11. package/package.json +13 -2
  12. package/public/docs/assets/highlight.css +14 -14
  13. package/public/docs/assets/search.js +1 -1
  14. package/public/docs/classes/microcomponents.MC.html +179 -41
  15. package/public/docs/classes/microcomponents_es3.MC.html +12 -12
  16. package/public/docs/functions/microcomponents_es3.__isEmpty.html +1 -1
  17. package/public/docs/index.html +15 -59
  18. package/public/docs/interfaces/microcomponents.HTMLElementMc.html +2 -2
  19. package/public/docs/modules/microcomponents.html +1 -1
  20. package/public/jsdoc/es3/files.html +216 -0
  21. package/public/jsdoc/es3/index.html +210 -0
  22. package/public/jsdoc/es3/symbols/_global_.html +368 -0
  23. package/public/jsdoc/es3/symbols/src/build_microcomponents.es3.js.html +104 -0
  24. package/public/jsdoc/es5+/files.html +218 -0
  25. package/public/jsdoc/es5+/index.html +218 -0
  26. package/public/jsdoc/es5+/symbols/MC.html +621 -0
  27. package/public/jsdoc/es5+/symbols/_global_.html +720 -0
  28. package/public/jsdoc/es5+/symbols/microcomponents.MC.html +323 -0
  29. package/public/jsdoc/es5+/symbols/src/build_microcomponents.js.html +375 -0
  30. package/src/microcomponents.ts +391 -201
@@ -21,9 +21,9 @@
21
21
  <ul class="tsd-hierarchy">
22
22
  <li><span class="target">MC</span></li></ul></section><aside class="tsd-sources">
23
23
  <ul>
24
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L13">src/microcomponents.es3.js:13</a></li>
25
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L18">src/microcomponents.es3.js:18</a></li>
26
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L26">src/microcomponents.es3.js:26</a></li></ul></aside>
24
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L13">src/microcomponents.es3.js:13</a></li>
25
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L18">src/microcomponents.es3.js:18</a></li>
26
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L26">src/microcomponents.es3.js:26</a></li></ul></aside>
27
27
  <section class="tsd-panel-group tsd-index-group">
28
28
  <section class="tsd-panel tsd-index-panel">
29
29
  <details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
@@ -61,14 +61,14 @@
61
61
  <h5>target: <span class="tsd-signature-type">any</span></h5></li></ul></div>
62
62
  <h4 class="tsd-returns-title">Returns <a href="microcomponents_es3.MC.html" class="tsd-signature-type" data-tsd-kind="Class">MC</a></h4><aside class="tsd-sources">
63
63
  <ul>
64
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L13">src/microcomponents.es3.js:13</a></li></ul></aside></li></ul></section></section>
64
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L13">src/microcomponents.es3.js:13</a></li></ul></aside></li></ul></section></section>
65
65
  <section class="tsd-panel-group tsd-member-group">
66
66
  <h2>Properties</h2>
67
67
  <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="_target" class="tsd-anchor"></a>
68
68
  <h3 class="tsd-anchor-link"><span>_target</span><a href="#_target" 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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
69
69
  <div class="tsd-signature">_target<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div><aside class="tsd-sources">
70
70
  <ul>
71
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L14">src/microcomponents.es3.js:14</a></li></ul></aside></section></section>
71
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L14">src/microcomponents.es3.js:14</a></li></ul></aside></section></section>
72
72
  <section class="tsd-panel-group tsd-member-group">
73
73
  <h2>Methods</h2>
74
74
  <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="children" class="tsd-anchor"></a>
@@ -83,7 +83,7 @@
83
83
  <h5>search: <span class="tsd-signature-type">any</span></h5></li></ul></div>
84
84
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
85
85
  <ul>
86
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L75">src/microcomponents.es3.js:75</a></li></ul></aside></li></ul></section>
86
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L75">src/microcomponents.es3.js:75</a></li></ul></aside></li></ul></section>
87
87
  <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="descendants" class="tsd-anchor"></a>
88
88
  <h3 class="tsd-anchor-link"><span>descendants</span><a href="#descendants" 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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
89
89
  <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
@@ -96,7 +96,7 @@
96
96
  <h5>search: <span class="tsd-signature-type">any</span></h5></li></ul></div>
97
97
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
98
98
  <ul>
99
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L92">src/microcomponents.es3.js:92</a></li></ul></aside></li></ul></section>
99
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L92">src/microcomponents.es3.js:92</a></li></ul></aside></li></ul></section>
100
100
  <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="parent" class="tsd-anchor"></a>
101
101
  <h3 class="tsd-anchor-link"><span>parent</span><a href="#parent" 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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
102
102
  <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
@@ -109,7 +109,7 @@
109
109
  <h5>search: <span class="tsd-signature-type">any</span></h5></li></ul></div>
110
110
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources">
111
111
  <ul>
112
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L51">src/microcomponents.es3.js:51</a></li></ul></aside></li></ul></section>
112
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L51">src/microcomponents.es3.js:51</a></li></ul></aside></li></ul></section>
113
113
  <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="parents" class="tsd-anchor"></a>
114
114
  <h3 class="tsd-anchor-link"><span>parents</span><a href="#parents" 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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
115
115
  <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
@@ -122,7 +122,7 @@
122
122
  <h5>search: <span class="tsd-signature-type">any</span></h5></li></ul></div>
123
123
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
124
124
  <ul>
125
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L63">src/microcomponents.es3.js:63</a></li></ul></aside></li></ul></section>
125
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L63">src/microcomponents.es3.js:63</a></li></ul></aside></li></ul></section>
126
126
  <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="siblings" class="tsd-anchor"></a>
127
127
  <h3 class="tsd-anchor-link"><span>siblings</span><a href="#siblings" 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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
128
128
  <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
@@ -135,7 +135,7 @@
135
135
  <h5>search: <span class="tsd-signature-type">any</span></h5></li></ul></div>
136
136
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
137
137
  <ul>
138
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L35">src/microcomponents.es3.js:35</a></li></ul></aside></li></ul></section>
138
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L35">src/microcomponents.es3.js:35</a></li></ul></aside></li></ul></section>
139
139
  <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="add" class="tsd-anchor"></a>
140
140
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>add</span><a href="#add" 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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
141
141
  <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
@@ -152,7 +152,7 @@
152
152
  <h5>element: <span class="tsd-signature-type">any</span></h5></li></ul></div>
153
153
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">typeof </span><a href="microcomponents_es3.MC.html" class="tsd-signature-type" data-tsd-kind="Class">MC</a></h4><aside class="tsd-sources">
154
154
  <ul>
155
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L18">src/microcomponents.es3.js:18</a></li></ul></aside></li></ul></section>
155
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L18">src/microcomponents.es3.js:18</a></li></ul></aside></li></ul></section>
156
156
  <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="remove" class="tsd-anchor"></a>
157
157
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>remove</span><a href="#remove" 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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
158
158
  <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
@@ -167,7 +167,7 @@
167
167
  <h5>key: <span class="tsd-signature-type">any</span></h5></li></ul></div>
168
168
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">typeof </span><a href="microcomponents_es3.MC.html" class="tsd-signature-type" data-tsd-kind="Class">MC</a></h4><aside class="tsd-sources">
169
169
  <ul>
170
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L26">src/microcomponents.es3.js:26</a></li></ul></aside></li></ul></section></section></div>
170
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L26">src/microcomponents.es3.js:26</a></li></ul></aside></li></ul></section></section></div>
171
171
  <div class="col-4 col-menu menu-sticky-wrap menu-highlight">
172
172
  <div class="tsd-navigation settings">
173
173
  <details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
@@ -27,7 +27,7 @@
27
27
  <h5>obj: <span class="tsd-signature-type">any</span></h5></li></ul></div>
28
28
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources">
29
29
  <ul>
30
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.es3.js#L3">src/microcomponents.es3.js:3</a></li></ul></aside></li></ul></section></div>
30
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.es3.js#L3">src/microcomponents.es3.js:3</a></li></ul></aside></li></ul></section></div>
31
31
  <div class="col-4 col-menu menu-sticky-wrap menu-highlight">
32
32
  <div class="tsd-navigation settings">
33
33
  <details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
@@ -17,46 +17,22 @@
17
17
  <h2>MICRO COMPONENTS</h2>
18
18
  </a>
19
19
  <p><img src="https://gitlab.com/twoBirds/microcomponents/-/raw/main/MicroComponents.svg" alt="Micro Components Logo"></p>
20
- <p>This code aims at <strong>improving Javascript modularity</strong>. It does not describe a specific Micro Component itself but rather describes they way they are <strong>organized</strong>. A typical example of a <strong>Micro Component</strong> can be found in &quot;additional concepts&quot; below.</p>
21
- <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/MicroComponentProposal_draft.md?ref_type=heads">RFC</a> for the shortest info.</p>
22
- <p>This is a low-level approach. It consists of a single class with 3 static methods and 5 selector methods, and weights in at ~2 kB. Also there is an ES3 version to help e.g. <a href="https://en.wikipedia.org/wiki/Hybrid_Broadcast_Broadband_TV">hbbtv</a> modular JS coding, or any other device that relies on ES3.</p>
23
- <p>For an overview, continue reading.</p>
24
- <p>For a detailed functional description goto <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_usage.md?ref_type=heads">Micro Component Usage</a> and check the <a href="http://twobirds.gitlab.io/microcomponents/docs/modules.html">typedoc API documentation</a>.</p>
25
- <p>To see what can be done, go to <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_magic.md?ref_type=heads">additional concepts</a> which delve a little deeper into how to use it, and what it already has been used for.</p>
26
20
 
27
- <a href="#why-would-i-give-this-a-try-in-my-company" id="why-would-i-give-this-a-try-in-my-company" style="color: inherit; text-decoration: none;">
28
- <h2>Why would I give this a try in my company?</h2>
21
+ <a href="#status" id="status" style="color: inherit; text-decoration: none;">
22
+ <h2>Status</h2>
29
23
  </a>
30
- <p>It is lightweight, proven and can yield positive results immediatly.</p>
24
+ <p>WIP. Should be tested and done soon.</p>
31
25
 
32
- <a href="#as-the-cto" id="as-the-cto" style="color: inherit; text-decoration: none;">
33
- <h3><strong>As the CTO</strong>:</h3>
26
+ <a href="#general" id="general" style="color: inherit; text-decoration: none;">
27
+ <h2>General</h2>
34
28
  </a>
35
- <ul>
36
- <li><strong>Reusability</strong>: this works with every Javascript framework that allows for DOM access, and it will work as long as the DOM exists in browsers. That is, forever.</li>
37
- <li><strong>Scalability</strong>: scales perfectly by design.</li>
38
- <li><strong>Interoperability</strong>: where many teams in different projects should share specific business or UI logic, you want to have something that works in any JS framework you use.</li>
39
- </ul>
40
-
41
- <a href="#as-a-project-manager" id="as-a-project-manager" style="color: inherit; text-decoration: none;">
42
- <h3><strong>As a Project Manager</strong>:</h3>
43
- </a>
44
- <ul>
45
- <li><strong>Separation of Concerns</strong>: since this is a modular approach you can <strong>split UI logic from Business logic</strong> and let diffent teams work on each.</li>
46
- <li>using this, you can <strong>work with external developers without the need to give them access to your projects code repository</strong>.</li>
47
- <li>you will find out that this allows your project to <strong>become independent from the &quot;tools hell&quot;</strong>. You tend to use <strong>DIY</strong> modules where you had tools before.</li>
48
- </ul>
49
-
50
- <a href="#as-a-javascript-developer" id="as-a-javascript-developer" style="color: inherit; text-decoration: none;">
51
- <h3><strong>As a Javascript Developer</strong>:</h3>
52
- </a>
53
- <ul>
54
- <li>The learning curve to use this is more than shallow. 1 hour should be enough.</li>
55
- <li>This is based on <strong>plain Javascript/Typescript, HTML and CSS</strong>. There is no abstraction layer.</li>
56
- <li>From the very start <strong>it is fun to work with</strong>. You are back in control of your code without bigger frameworks, but you are able to interact with them.</li>
57
- <li>You can <strong>work for any customer right away</strong>. <strong>No training on their system required</strong>, just fulfill their micro component requirements.</li>
58
- <li>Over time, you can <strong>build your own framework or functional libraries</strong> from scratch.</li>
59
- </ul>
29
+ <p>This code aims at improving Javascript modularity. It does not describe a specific Micro Component itself but rather describes they way they are <strong>organized</strong>.</p>
30
+ <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/MicroComponentProposal_draft.md?ref_type=heads">RFC</a> for the shortest info, and <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_why.md?ref_type=heads">click here to see why you may want to use it</a>.</p>
31
+ <p>This is a low-level approach. It consists of a single class with 3 static methods and 5 selector methods, and weights in at ~2 kB. Also there is an ES3 version to help e.g. <a href="https://en.wikipedia.org/wiki/Hybrid_Broadcast_Broadband_TV">hbbtv</a> modular JS coding, or any other device that relies on ES3. The latter is WIP, backporting is currently last on my list.</p>
32
+ <p>For a short usage description goto <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_usage.md?ref_type=heads">Micro Component Usage</a>.</p>
33
+ <p>Check the <a href="http://twobirds.gitlab.io/microcomponents/docs/modules.html">typedoc API reference</a> if you want to drill into the source code.</p>
34
+ <p>Or read the more detailed <a href="http://twobirds.gitlab.io/microcomponents/jsdoc/es5+/index.html">jsdoc API documentation</a> which contains <strong>examples</strong>.</p>
35
+ <p>To see what can be done, go to <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_magic.md?ref_type=heads">additional concepts</a> which shows what it already has been used for.</p>
60
36
 
61
37
  <a href="#functional-requirements" id="functional-requirements" style="color: inherit; text-decoration: none;">
62
38
  <h2>Functional Requirements</h2>
@@ -78,33 +54,13 @@
78
54
  <pre><code class="language-HTML"><span class="hl-0">&lt;</span><span class="hl-1">button</span><span class="hl-0">&gt;&lt;/</span><span class="hl-1">button</span><span class="hl-0">&gt;</span>
79
55
  </code></pre>
80
56
  <p>code: (assume &quot;Button&quot; is some class in a library)</p>
81
- <pre><code class="language-javascript"><span class="hl-2">import</span><span class="hl-3"> </span><span class="hl-4">&#39;MC&#39;</span><span class="hl-3"> </span><span class="hl-2">from</span><span class="hl-3"> </span><span class="hl-4">&#39;@twobirds/microcomponents&#39;</span><span class="hl-3">;</span><br/><span class="hl-2">import</span><span class="hl-3"> </span><span class="hl-4">&#39;Button&#39;</span><span class="hl-3"> </span><span class="hl-2">from</span><span class="hl-3"> </span><span class="hl-4">&#39;tb/ui&#39;</span><span class="hl-3">; </span><span class="hl-5">// made-up example library</span><br/><br/><span class="hl-5">// select first button element in DOM</span><br/><span class="hl-6">let</span><span class="hl-3"> </span><span class="hl-7">myButton</span><span class="hl-3"> = </span><span class="hl-7">document</span><span class="hl-3">.</span><span class="hl-8">querySelector</span><span class="hl-3">(</span><span class="hl-4">&#39;button&#39;</span><span class="hl-3">);</span><br/><br/><span class="hl-5">// this will add the micro component to the myButton._mc property:</span><br/><span class="hl-9">MC</span><span class="hl-3">.</span><span class="hl-8">add</span><span class="hl-3">( </span><span class="hl-7">myButton</span><span class="hl-3">, </span><span class="hl-4">&#39;tb_ui_button&#39;</span><span class="hl-3">, </span><span class="hl-6">new</span><span class="hl-3"> </span><span class="hl-8">Button</span><span class="hl-3">( </span><span class="hl-7">myButton</span><span class="hl-3">, { ...</span><span class="hl-7">config</span><span class="hl-3"> </span><span class="hl-7">data</span><span class="hl-3"> } ) );</span>
57
+ <pre><code class="language-javascript"><span class="hl-2">// create the 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">MC</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><span class="hl-3">this</span><span class="hl-4">.</span><span class="hl-6">target</span><span class="hl-4"> = </span><span class="hl-6">target</span><span class="hl-4">;</span><br/><span class="hl-4"> }</span><br/><span class="hl-4">}</span><br/><br/><span class="hl-3">const</span><span class="hl-4"> </span><span class="hl-7">element</span><span class="hl-4"> = </span><span class="hl-6">document</span><span class="hl-4">.</span><span class="hl-8">querySelector</span><span class="hl-4">(</span><span class="hl-9">&#39;div&#39;</span><span class="hl-4">)</span><br/><br/><span class="hl-2">// Add the top level microcomponent to the target element</span><br/><span class="hl-3">let</span><span class="hl-4"> </span><span class="hl-6">mcc</span><span class="hl-4"> = </span><span class="hl-7">MC</span><span class="hl-4">.</span><span class="hl-8">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-9">&#39;myMC&#39;</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-8">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">// Add an inner (private) microcomponent to mcc</span><br/><span class="hl-3">let</span><span class="hl-4"> </span><span class="hl-6">mcc</span><span class="hl-4">.add(</span><br/><span class="hl-4"> </span><span class="hl-9">&#39;myInnerMC&#39;</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-8">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-6">console</span><span class="hl-4">.</span><span class="hl-8">log</span><span class="hl-4">( </span><span class="hl-6">element</span><span class="hl-4">.</span><span class="hl-6">_mc</span><span class="hl-4"> );</span><br/><span class="hl-2">// { &#39;myMC&#39;: { target: (element) } }</span><br/><br/><span class="hl-6">console</span><span class="hl-4">.</span><span class="hl-8">log</span><span class="hl-4">( </span><span class="hl-6">element</span><span class="hl-4">.</span><span class="hl-6">_mc</span><span class="hl-4">.</span><span class="hl-6">myMC</span><span class="hl-4"> );</span><br/><span class="hl-2">// { target: (element) }</span><br/><br/><span class="hl-6">console</span><span class="hl-4">.</span><span class="hl-8">log</span><span class="hl-4">( </span><span class="hl-6">mcc</span><span class="hl-4">.</span><span class="hl-8">siblings</span><span class="hl-4">() );</span><br/><span class="hl-2">// [ { target: (element) } ]</span>
82
58
  </code></pre>
83
59
  <p>after:</p>
84
- <pre><code class="language-HTML"><span class="hl-0">&lt;</span><span class="hl-1">button</span><span class="hl-3"> </span><span class="hl-10">_mc</span><span class="hl-0">&gt;&lt;/</span><span class="hl-1">button</span><span class="hl-0">&gt;</span>
60
+ <pre><code class="language-HTML"><span class="hl-0">&lt;</span><span class="hl-1">button</span><span class="hl-4"> </span><span class="hl-10">_mc</span><span class="hl-0">&gt;&lt;/</span><span class="hl-1">button</span><span class="hl-0">&gt;</span>
85
61
  </code></pre>
86
62
  <p>_mc indicates that this HTML element contains at least one micro component. This is needed for the <strong>selectors</strong>.</p>
87
- <pre><code class="language-javascript"><span class="hl-7">console</span><span class="hl-3">.</span><span class="hl-8">log</span><span class="hl-3">( </span><span class="hl-7">myButton</span><span class="hl-3">.</span><span class="hl-7">_mc</span><span class="hl-3"> );</span><br/><span class="hl-5">// { tb_ui_button: { target: &lt;button&gt;, onClick: &lt;function&gt; } }</span>
88
- </code></pre>
89
- <p>For detailed information jump to <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_usage.md?ref_type=heads">Micro Component Usage</a>;</p>
90
-
91
- <a href="#history" id="history" style="color: inherit; text-decoration: none;">
92
- <h2>History</h2>
93
- </a>
94
- <p>I have been working with this since 2004. I used this as core principle inside my twoBirds framework.</p>
95
- <p>This functionality has been used in very big and complicated data processing projects:</p>
96
- <ul>
97
- <li>to allow for web component like programming (as early as 2004)</li>
98
- <li>to encapsule UI handling</li>
99
- <li>to represent business processes and their tasks</li>
100
- <li>and lately to compose very complex native web components from distinct modular functionality.</li>
101
- </ul>
102
- <p>I decided to extract this functionality from the <a href="https://www.npmjs.com/package/twobirds-core">twoBirds framework</a>, since it is framework agnostic, and relies solely on the standard DOM and native javascript or typescript, and is a useful tool in itself.</p>
103
-
104
- <a href="#useful-links" id="useful-links" style="color: inherit; text-decoration: none;">
105
- <h2>Useful Links</h2>
106
- </a>
107
- <p><a href="http://twobirds.gitlab.io/microcomponents/docs/modules.html">API documentation</a></p>
63
+ <p>I decided to extract this functionality from the <a href="https://www.npmjs.com/package/twobirds-core">twoBirds framework</a>, since it is framework agnostic, and relies solely on the standard DOM and native javascript or typescript, and is a useful tool in itself. Also this will be a dependency in twoBirds then.</p>
108
64
 
109
65
  <a href="#contact" id="contact" style="color: inherit; text-decoration: none;">
110
66
  <h2>Contact</h2>
@@ -23,7 +23,7 @@
23
23
  <ul class="tsd-hierarchy">
24
24
  <li><span class="target">HTMLElementMc</span></li></ul></li></ul></section><aside class="tsd-sources">
25
25
  <ul>
26
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.ts#L210">src/microcomponents.ts:210</a></li></ul></aside>
26
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.ts#L398">src/microcomponents.ts:398</a></li></ul></aside>
27
27
  <section class="tsd-panel-group tsd-index-group">
28
28
  <section class="tsd-panel tsd-index-panel">
29
29
  <details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
@@ -469,7 +469,7 @@
469
469
  <h3 class="tsd-anchor-link"><span>_mc</span><a href="#_mc" 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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
470
470
  <div class="tsd-signature">_mc<span class="tsd-signature-symbol">:</span> <a href="../classes/microcomponents.MC.html" class="tsd-signature-type" data-tsd-kind="Class">MC</a></div><aside class="tsd-sources">
471
471
  <ul>
472
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.ts#L211">src/microcomponents.ts:211</a></li></ul></aside></section>
472
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.ts#L399">src/microcomponents.ts:399</a></li></ul></aside></section>
473
473
  <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a id="accessKey" class="tsd-anchor"></a>
474
474
  <h3 class="tsd-anchor-link"><span>access<wbr/>Key</span><a href="#accessKey" 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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
475
475
  <div class="tsd-signature">access<wbr/>Key<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
@@ -16,7 +16,7 @@
16
16
  <li><a href="microcomponents.html">microcomponents</a></li></ul>
17
17
  <h1>Module microcomponents</h1></div><aside class="tsd-sources">
18
18
  <ul>
19
- <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/e2e23f7/src/microcomponents.ts#L1">src/microcomponents.ts:1</a></li></ul></aside>
19
+ <li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/cb1aec4/src/microcomponents.ts#L1">src/microcomponents.ts:1</a></li></ul></aside>
20
20
  <section class="tsd-panel-group">
21
21
  <section class="tsd-panel tsd-typography"></section></section>
22
22
  <section class="tsd-panel-group tsd-index-group">
@@ -0,0 +1,216 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+
7
+ <title>JsDoc Reference - File Index</title>
8
+ <meta name="generator" content="JsDoc Toolkit" />
9
+
10
+ <style type="text/css">
11
+ /* default.css */
12
+ body
13
+ {
14
+ font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
15
+ width: 800px;
16
+ }
17
+
18
+ .header
19
+ {
20
+ clear: both;
21
+ background-color: #ccc;
22
+ padding: 8px;
23
+ }
24
+
25
+ h1
26
+ {
27
+ font-size: 150%;
28
+ font-weight: bold;
29
+ padding: 0;
30
+ margin: 1em 0 0 .3em;
31
+ }
32
+
33
+ hr
34
+ {
35
+ border: none 0;
36
+ border-top: 1px solid #7F8FB1;
37
+ height: 1px;
38
+ }
39
+
40
+ pre.code
41
+ {
42
+ display: block;
43
+ padding: 8px;
44
+ border: 1px dashed #ccc;
45
+ }
46
+
47
+ #index
48
+ {
49
+ margin-top: 24px;
50
+ float: left;
51
+ width: 160px;
52
+ position: absolute;
53
+ left: 8px;
54
+ background-color: #F3F3F3;
55
+ padding: 8px;
56
+ }
57
+
58
+ #content
59
+ {
60
+ margin-left: 190px;
61
+ width: 600px;
62
+ }
63
+
64
+ .classList
65
+ {
66
+ list-style-type: none;
67
+ padding: 0;
68
+ margin: 0 0 0 8px;
69
+ font-family: arial, sans-serif;
70
+ font-size: 1em;
71
+ overflow: auto;
72
+ }
73
+
74
+ .classList li
75
+ {
76
+ padding: 0;
77
+ margin: 0 0 8px 0;
78
+ }
79
+
80
+ .summaryTable { width: 100%; }
81
+
82
+ h1.classTitle
83
+ {
84
+ font-size:170%;
85
+ line-height:130%;
86
+ }
87
+
88
+ h2 { font-size: 110%; }
89
+ caption, div.sectionTitle
90
+ {
91
+ background-color: #7F8FB1;
92
+ color: #fff;
93
+ font-size:130%;
94
+ text-align: left;
95
+ padding: 2px 6px 2px 6px;
96
+ border: 1px #7F8FB1 solid;
97
+ }
98
+
99
+ div.sectionTitle { margin-bottom: 8px; }
100
+ .summaryTable thead { display: none; }
101
+
102
+ .summaryTable td
103
+ {
104
+ vertical-align: top;
105
+ padding: 4px;
106
+ border-bottom: 1px #7F8FB1 solid;
107
+ border-right: 1px #7F8FB1 solid;
108
+ }
109
+
110
+ /*col#summaryAttributes {}*/
111
+ .summaryTable td.attributes
112
+ {
113
+ border-left: 1px #7F8FB1 solid;
114
+ width: 140px;
115
+ text-align: right;
116
+ }
117
+
118
+ td.attributes, .fixedFont
119
+ {
120
+ line-height: 15px;
121
+ color: #002EBE;
122
+ font-family: "Courier New",Courier,monospace;
123
+ font-size: 13px;
124
+ }
125
+
126
+ .summaryTable td.nameDescription
127
+ {
128
+ text-align: left;
129
+ font-size: 13px;
130
+ line-height: 15px;
131
+ }
132
+
133
+ .summaryTable td.nameDescription, .description
134
+ {
135
+ line-height: 15px;
136
+ padding: 4px;
137
+ padding-left: 4px;
138
+ }
139
+
140
+ .summaryTable { margin-bottom: 8px; }
141
+
142
+ ul.inheritsList
143
+ {
144
+ list-style: square;
145
+ margin-left: 20px;
146
+ padding-left: 0;
147
+ }
148
+
149
+ .detailList {
150
+ margin-left: 20px;
151
+ line-height: 15px;
152
+ }
153
+ .detailList dt { margin-left: 20px; }
154
+
155
+ .detailList .heading
156
+ {
157
+ font-weight: bold;
158
+ padding-bottom: 6px;
159
+ margin-left: 0;
160
+ }
161
+
162
+ .light, td.attributes, .light a:link, .light a:visited
163
+ {
164
+ color: #777;
165
+ font-style: italic;
166
+ }
167
+
168
+ .fineprint
169
+ {
170
+ text-align: right;
171
+ font-size: 10px;
172
+ }
173
+ </style>
174
+ </head>
175
+
176
+ <body>
177
+ <div id="header">
178
+ </div>
179
+
180
+ <div id="index">
181
+ <div align="center"><a href="index.html">Class Index</a>
182
+ | <a href="files.html">File Index</a></div>
183
+ <hr />
184
+ <h2>Classes</h2>
185
+ <ul class="classList">
186
+
187
+ <li><i><a href="symbols/_global_.html">_global_</a></i></li>
188
+
189
+ </ul>
190
+ <hr />
191
+ </div>
192
+
193
+ <div id="content">
194
+ <h1 class="classTitle">File Index</h1>
195
+
196
+
197
+ <div>
198
+ <h2><a href="symbols/src/build_microcomponents.es3.js.html">./build/microcomponents.es3.js</a></h2>
199
+
200
+ <dl>
201
+
202
+
203
+
204
+
205
+ </dl>
206
+ </div>
207
+ <hr />
208
+
209
+
210
+ </div>
211
+ <div class="fineprint" style="clear:both">
212
+
213
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Wed Oct 30 2024 23:18:46 GMT+0100 (MEZ)
214
+ </div>
215
+ </body>
216
+ </html>