@twobirds/microcomponents 0.0.1 → 0.0.2
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 +16 -0
- package/README.md +10 -6
- package/assets/fiddle/MicroComponents.svg +15 -0
- package/assets/fiddle/fiddle.css +0 -0
- package/assets/fiddle/fiddle.js +0 -0
- package/assets/fiddle/index.html +0 -0
- package/assets/index.html +11 -0
- package/dist/microcomponents.d.ts +2 -1
- package/dist/microcomponents.d.ts.map +1 -1
- package/dist/microcomponents.js +47 -22
- package/dist/microcomponents.min.js +18 -11
- package/dist/microcomponents.ts +196 -0
- package/package.json +27 -6
- package/public/docs/assets/search.js +1 -0
- package/{docs → public/docs}/classes/microcomponents.MC.html +38 -23
- package/{docs → public/docs}/classes/microcomponents_es3.MC.html +16 -16
- package/{docs → public/docs}/functions/microcomponents_es3.__isEmpty.html +5 -5
- package/{docs → public/docs}/index.html +14 -9
- package/{docs → public/docs}/interfaces/microcomponents.HTMLElementMc.html +6 -6
- package/{docs → public/docs}/modules/microcomponents.html +5 -5
- package/{docs → public/docs}/modules/microcomponents_es3.html +4 -4
- package/{docs → public/docs}/modules.html +5 -5
- package/public/fiddle/MicroComponents.svg +15 -0
- package/public/fiddle/fiddle.css +0 -0
- package/public/fiddle/fiddle.js +0 -0
- package/public/fiddle/index.html +0 -0
- package/public/index.html +11 -0
- package/src/microcomponents.ts +53 -26
- package/typedoc.json +3 -3
- package/docs/assets/search.js +0 -1
- /package/{docs → public/docs}/.nojekyll +0 -0
- /package/{docs → public/docs}/assets/highlight.css +0 -0
- /package/{docs → public/docs}/assets/main.js +0 -0
- /package/{docs → public/docs}/assets/style.css +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HTMLElementMc |
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HTMLElementMc | 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
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
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>
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
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">
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Micro Components</a></div>
|
|
10
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
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-8 col-content">
|
|
13
13
|
<div class="tsd-page-title">
|
|
14
14
|
<ul class="tsd-breadcrumb">
|
|
15
|
-
<li><a href="../modules.html">
|
|
15
|
+
<li><a href="../modules.html">Micro Components</a></li>
|
|
16
16
|
<li><a href="../modules/microcomponents.html">microcomponents</a></li>
|
|
17
17
|
<li><a href="microcomponents.HTMLElementMc.html">HTMLElementMc</a></li></ul>
|
|
18
18
|
<h1>Interface HTMLElementMc</h1></div>
|
|
@@ -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/
|
|
26
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/727e2de/src/microcomponents.ts#L194">src/microcomponents.ts:194</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/
|
|
472
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/727e2de/src/microcomponents.ts#L195">src/microcomponents.ts:195</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">
|
|
@@ -3298,7 +3298,7 @@
|
|
|
3298
3298
|
<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>
|
|
3299
3299
|
<div class="tsd-accordion-details">
|
|
3300
3300
|
<ul>
|
|
3301
|
-
<li class="current"><a href="../modules.html">
|
|
3301
|
+
<li class="current"><a href="../modules.html">Micro <wbr/>Components</a>
|
|
3302
3302
|
<ul>
|
|
3303
3303
|
<li class="current tsd-kind-module"><a href="../modules/microcomponents.html">microcomponents</a></li>
|
|
3304
3304
|
<li class="tsd-kind-module"><a href="../modules/microcomponents_es3.html">microcomponents.es3</a></li></ul></li></ul></div></details></nav>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>microcomponents</title><meta name="description" content="Documentation for
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>microcomponents | 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
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
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>
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
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">
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Micro Components</a></div>
|
|
10
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
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-8 col-content">
|
|
13
13
|
<div class="tsd-page-title">
|
|
14
14
|
<ul class="tsd-breadcrumb">
|
|
15
|
-
<li><a href="../modules.html">
|
|
15
|
+
<li><a href="../modules.html">Micro Components</a></li>
|
|
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/
|
|
19
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/727e2de/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">
|
|
@@ -49,7 +49,7 @@
|
|
|
49
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
50
|
<div class="tsd-accordion-details">
|
|
51
51
|
<ul>
|
|
52
|
-
<li class="current"><a href="../modules.html">
|
|
52
|
+
<li class="current"><a href="../modules.html">Micro <wbr/>Components</a>
|
|
53
53
|
<ul>
|
|
54
54
|
<li class="current selected tsd-kind-module"><a href="microcomponents.html">microcomponents</a></li>
|
|
55
55
|
<li class="tsd-kind-module"><a href="microcomponents_es3.html">microcomponents.es3</a></li></ul></li></ul></div></details></nav>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>microcomponents.es3 |
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>microcomponents.es3 | 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
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
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>
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
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">
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Micro Components</a></div>
|
|
10
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
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-8 col-content">
|
|
13
13
|
<div class="tsd-page-title">
|
|
14
14
|
<ul class="tsd-breadcrumb">
|
|
15
|
-
<li><a href="../modules.html">
|
|
15
|
+
<li><a href="../modules.html">Micro Components</a></li>
|
|
16
16
|
<li><a href="microcomponents_es3.html">microcomponents.es3</a></li></ul>
|
|
17
17
|
<h1>Module microcomponents.es3</h1></div>
|
|
18
18
|
<section class="tsd-panel-group">
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<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>
|
|
48
48
|
<div class="tsd-accordion-details">
|
|
49
49
|
<ul>
|
|
50
|
-
<li class="current"><a href="../modules.html">
|
|
50
|
+
<li class="current"><a href="../modules.html">Micro <wbr/>Components</a>
|
|
51
51
|
<ul>
|
|
52
52
|
<li class="tsd-kind-module"><a href="microcomponents.html">microcomponents</a></li>
|
|
53
53
|
<li class="current selected tsd-kind-module"><a href="microcomponents_es3.html">microcomponents.es3</a></li></ul></li></ul></div></details></nav>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>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
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base=".">
|
|
4
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>
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
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">
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">Micro Components</a></div>
|
|
10
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
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-8 col-content">
|
|
13
13
|
<div class="tsd-page-title">
|
|
14
|
-
<h2>
|
|
14
|
+
<h2>Micro Components</h2></div>
|
|
15
15
|
<section class="tsd-panel-group tsd-index-group">
|
|
16
16
|
<section class="tsd-panel tsd-index-panel">
|
|
17
17
|
<h3 class="tsd-index-heading uppercase">Index</h3>
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
<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>
|
|
40
40
|
<div class="tsd-accordion-details">
|
|
41
41
|
<ul>
|
|
42
|
-
<li class="current selected"><a href="modules.html">
|
|
42
|
+
<li class="current selected"><a href="modules.html">Micro <wbr/>Components</a>
|
|
43
43
|
<ul>
|
|
44
|
-
<li class="
|
|
44
|
+
<li class="tsd-kind-module"><a href="modules/microcomponents.html">microcomponents</a></li>
|
|
45
45
|
<li class="tsd-kind-module"><a href="modules/microcomponents_es3.html">microcomponents.es3</a></li></ul></li></ul></div></details></nav></div></div>
|
|
46
46
|
<div class="container tsd-generator">
|
|
47
47
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
|
2
|
+
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
|
|
3
|
+
<title>test</title>
|
|
4
|
+
<rect fill="transparent" x="0" y="0" width="200" height="200" fill-opacity="1"/>
|
|
5
|
+
<g style="fill:transparent">
|
|
6
|
+
<title>first bird</title>
|
|
7
|
+
<path fill="#18829c" d="
|
|
8
|
+
m15,160
|
|
9
|
+
a30,75 45 1 0 160,-150
|
|
10
|
+
a20,50 225 1 1 -110,100
|
|
11
|
+
a12,25 45 1 1 60,-50
|
|
12
|
+
a20,50 225 1 0 -110,100
|
|
13
|
+
" />
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Micro Components</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<a href="http://twobirds.gitlab.io/microcomponents/docs/modules.html" target="_blank">API</a>
|
|
10
|
+
</body>
|
|
11
|
+
</html>
|
package/src/microcomponents.ts
CHANGED
|
@@ -13,25 +13,23 @@ export class MC {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// add a microcomponent to a target DOM node
|
|
16
|
-
static add( element: any = {}, key
|
|
16
|
+
static add( element: any = {}, key: string, target: HTMLElement ): any {
|
|
17
17
|
|
|
18
18
|
const mc = target as any;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
mc._mc = new MC();
|
|
25
|
-
}
|
|
20
|
+
// create the _mc property if necessary
|
|
21
|
+
if ( !mc._mc ){
|
|
22
|
+
mc._mc = new MC();
|
|
23
|
+
}
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
25
|
+
// add the element with the given property key to the _mc property object
|
|
26
|
+
if ( key && !mc._mc[ key ] ){
|
|
27
|
+
mc._mc[ key ] = element;
|
|
28
|
+
if ( target ) {
|
|
29
|
+
target.setAttribute('_mc', '' );
|
|
33
30
|
}
|
|
34
31
|
}
|
|
32
|
+
|
|
35
33
|
return element;
|
|
36
34
|
}
|
|
37
35
|
|
|
@@ -41,8 +39,10 @@ export class MC {
|
|
|
41
39
|
// add the element
|
|
42
40
|
if ( target && key ){
|
|
43
41
|
// ...to the DOM
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
this.privateMCs[key] = element; // also the first element in the private MC collection
|
|
43
|
+
return MC.add( element, key, target );
|
|
44
|
+
}
|
|
45
|
+
if ( key && !element ){
|
|
46
46
|
// ... to the private element collection
|
|
47
47
|
this.privateMCs[key] = element;
|
|
48
48
|
}
|
|
@@ -90,11 +90,19 @@ export class MC {
|
|
|
90
90
|
let mcValues: any[] = [];
|
|
91
91
|
|
|
92
92
|
elements.forEach(e => {
|
|
93
|
-
if (e){
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
if ( e ){
|
|
94
|
+
if ( e instanceof HTMLElement ){
|
|
95
|
+
if (!search && (e as HTMLElementMc)._mc) {
|
|
96
|
+
mcValues = mcValues.concat(Object.values((e as any)._mc));
|
|
97
|
+
} else if (search && (e as HTMLElementMc)._mc && (e as any)._mc[search]) {
|
|
98
|
+
mcValues.push((e as any)._mc[search]);
|
|
99
|
+
}
|
|
100
|
+
} else if (e instanceof MC ){
|
|
101
|
+
if ( !search ) {
|
|
102
|
+
mcValues = mcValues.concat(Object.values( this.privateMCs ));
|
|
103
|
+
} else if (search && this.privateMCs[search]) {
|
|
104
|
+
mcValues.push((e as any)._mc[search]);
|
|
105
|
+
}
|
|
98
106
|
}
|
|
99
107
|
}
|
|
100
108
|
});
|
|
@@ -122,33 +130,49 @@ export class MC {
|
|
|
122
130
|
return mcValues;
|
|
123
131
|
}
|
|
124
132
|
|
|
133
|
+
private isDOM( element: any ): boolean {
|
|
134
|
+
return element && element instanceof HTMLElement;
|
|
135
|
+
}
|
|
136
|
+
|
|
125
137
|
/*
|
|
126
138
|
selector methods, non-chainable
|
|
127
139
|
*/
|
|
128
140
|
|
|
129
141
|
// all public _mc members and private collection members
|
|
130
142
|
siblings(search?: string): any[] {
|
|
131
|
-
|
|
143
|
+
if ( this.target ){
|
|
144
|
+
if ( this.target instanceof HTMLElement === true ){
|
|
145
|
+
return this.getMicroComponents( [ this.target ], search );
|
|
146
|
+
} else {
|
|
147
|
+
const result = this.privateMCs[search || ''];
|
|
148
|
+
return search && result ? [ result ] : Object.entries( this.privateMCs );
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return []
|
|
132
152
|
}
|
|
133
153
|
|
|
134
|
-
|
|
154
|
+
|
|
155
|
+
// first anchestor DOM node, all public MCs
|
|
135
156
|
parent(search?: string): any[] {
|
|
136
157
|
|
|
137
|
-
if ( !this.target ) return [];
|
|
158
|
+
if ( !this.isDOM( this.target) ) return [];
|
|
138
159
|
|
|
139
160
|
return this.traverseNodes( ( this.target as HTMLElement).parentNode, search, true);
|
|
140
161
|
}
|
|
141
162
|
|
|
142
|
-
// all anchestor DOM nodes, beginning with the closest, all
|
|
163
|
+
// all anchestor DOM nodes, beginning with the closest, all public MCs
|
|
143
164
|
parents(search?: string): any[] {
|
|
144
165
|
|
|
145
|
-
if ( !this.target ) return [];
|
|
166
|
+
if ( !this.isDOM( this.target) ) return [];
|
|
146
167
|
|
|
147
|
-
return this.traverseNodes(this.target.parentNode, search, false);
|
|
168
|
+
return this.traverseNodes( (this.target as HTMLElement ).parentNode, search, false);
|
|
148
169
|
}
|
|
149
170
|
|
|
150
171
|
// nearest child DOM nodes, all puclic MCs
|
|
151
172
|
children(search?: string): any[] {
|
|
173
|
+
|
|
174
|
+
if ( !this.isDOM( this.target) ) return [];
|
|
175
|
+
|
|
152
176
|
const id = crypto.randomUUID();
|
|
153
177
|
(this.target as HTMLElement).setAttribute('temp-id', id);
|
|
154
178
|
const myDomElements = (this.target as HTMLElement).querySelectorAll(`*[_mc]:not([temp-id="${id}"] [_mc] [_mc])`);
|
|
@@ -159,6 +183,9 @@ export class MC {
|
|
|
159
183
|
|
|
160
184
|
// all descendant DOM nodes, all puclic MCs
|
|
161
185
|
descendants(search?: string): any[] {
|
|
186
|
+
|
|
187
|
+
if ( !this.isDOM( this.target) ) return [];
|
|
188
|
+
|
|
162
189
|
const myDomElements = (this.target as HTMLElement).querySelectorAll('*[_mc]');
|
|
163
190
|
return this.getMicroComponents( [ ...myDomElements ], search);
|
|
164
191
|
}
|
package/typedoc.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entryPoints": ["src/microcomponents.ts","src/microcomponents.es3.js"],
|
|
3
|
-
"out": "docs/",
|
|
4
|
-
"readme": "
|
|
5
|
-
"name": "
|
|
3
|
+
"out": "./public/docs/",
|
|
4
|
+
"readme": "README.md",
|
|
5
|
+
"name": "Micro Components",
|
|
6
6
|
"tsconfig": "./tsconfig.json"
|
|
7
7
|
}
|
package/docs/assets/search.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
window.searchData = JSON.parse("{\"kinds\":{\"2\":\"Module\",\"64\":\"Function\",\"128\":\"Class\",\"256\":\"Interface\",\"512\":\"Constructor\",\"1024\":\"Property\",\"2048\":\"Method\",\"65536\":\"Type literal\"},\"rows\":[{\"kind\":2,\"name\":\"microcomponents\",\"url\":\"modules/microcomponents.html\",\"classes\":\"tsd-kind-module\"},{\"kind\":128,\"name\":\"MC\",\"url\":\"classes/microcomponents.MC.html\",\"classes\":\"tsd-kind-class tsd-parent-kind-module\",\"parent\":\"microcomponents\"},{\"kind\":1024,\"name\":\"debug\",\"url\":\"classes/microcomponents.MC.html#debug\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":2048,\"name\":\"add\",\"url\":\"classes/microcomponents.MC.html#add-2\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":2048,\"name\":\"remove\",\"url\":\"classes/microcomponents.MC.html#remove-2\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/microcomponents.MC.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":1024,\"name\":\"target\",\"url\":\"classes/microcomponents.MC.html#target\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-private\",\"parent\":\"microcomponents.MC\"},{\"kind\":1024,\"name\":\"privateMCs\",\"url\":\"classes/microcomponents.MC.html#privateMCs\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-private\",\"parent\":\"microcomponents.MC\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/microcomponents.MC.html#privateMCs.__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-property\",\"parent\":\"microcomponents.MC.privateMCs\"},{\"kind\":2048,\"name\":\"add\",\"url\":\"classes/microcomponents.MC.html#add\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":2048,\"name\":\"remove\",\"url\":\"classes/microcomponents.MC.html#remove\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":2048,\"name\":\"getMicroComponents\",\"url\":\"classes/microcomponents.MC.html#getMicroComponents\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-private\",\"parent\":\"microcomponents.MC\"},{\"kind\":2048,\"name\":\"traverseNodes\",\"url\":\"classes/microcomponents.MC.html#traverseNodes\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-private\",\"parent\":\"microcomponents.MC\"},{\"kind\":2048,\"name\":\"siblings\",\"url\":\"classes/microcomponents.MC.html#siblings\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":2048,\"name\":\"parent\",\"url\":\"classes/microcomponents.MC.html#parent\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":2048,\"name\":\"parents\",\"url\":\"classes/microcomponents.MC.html#parents\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":2048,\"name\":\"children\",\"url\":\"classes/microcomponents.MC.html#children\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":2048,\"name\":\"descendants\",\"url\":\"classes/microcomponents.MC.html#descendants\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":256,\"name\":\"HTMLElementMc\",\"url\":\"interfaces/microcomponents.HTMLElementMc.html\",\"classes\":\"tsd-kind-interface tsd-parent-kind-module\",\"parent\":\"microcomponents\"},{\"kind\":1024,\"name\":\"_mc\",\"url\":\"interfaces/microcomponents.HTMLElementMc.html#_mc\",\"classes\":\"tsd-kind-property tsd-parent-kind-interface\",\"parent\":\"microcomponents.HTMLElementMc\"},{\"kind\":2,\"name\":\"microcomponents.es3\",\"url\":\"modules/microcomponents_es3.html\",\"classes\":\"tsd-kind-module\"},{\"kind\":64,\"name\":\"__isEmpty\",\"url\":\"functions/microcomponents_es3.__isEmpty.html\",\"classes\":\"tsd-kind-function tsd-parent-kind-module\",\"parent\":\"microcomponents.es3\"},{\"kind\":128,\"name\":\"MC\",\"url\":\"classes/microcomponents_es3.MC.html\",\"classes\":\"tsd-kind-class tsd-parent-kind-module\",\"parent\":\"microcomponents.es3\"},{\"kind\":2048,\"name\":\"add\",\"url\":\"classes/microcomponents_es3.MC.html#add\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.es3.MC\"},{\"kind\":2048,\"name\":\"remove\",\"url\":\"classes/microcomponents_es3.MC.html#remove\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.es3.MC\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/microcomponents_es3.MC.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"microcomponents.es3.MC\"},{\"kind\":1024,\"name\":\"_target\",\"url\":\"classes/microcomponents_es3.MC.html#_target\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"microcomponents.es3.MC\"},{\"kind\":2048,\"name\":\"siblings\",\"url\":\"classes/microcomponents_es3.MC.html#siblings\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.es3.MC\"},{\"kind\":2048,\"name\":\"parent\",\"url\":\"classes/microcomponents_es3.MC.html#parent\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.es3.MC\"},{\"kind\":2048,\"name\":\"parents\",\"url\":\"classes/microcomponents_es3.MC.html#parents\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.es3.MC\"},{\"kind\":2048,\"name\":\"children\",\"url\":\"classes/microcomponents_es3.MC.html#children\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.es3.MC\"},{\"kind\":2048,\"name\":\"descendants\",\"url\":\"classes/microcomponents_es3.MC.html#descendants\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"microcomponents.es3.MC\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,30.91]],[\"comment/0\",[]],[\"name/1\",[1,25.802]],[\"comment/1\",[]],[\"name/2\",[2,30.91]],[\"comment/2\",[]],[\"name/3\",[3,22.437]],[\"comment/3\",[]],[\"name/4\",[4,22.437]],[\"comment/4\",[]],[\"name/5\",[5,25.802]],[\"comment/5\",[]],[\"name/6\",[6,30.91]],[\"comment/6\",[]],[\"name/7\",[7,30.91]],[\"comment/7\",[]],[\"name/8\",[8,30.91]],[\"comment/8\",[]],[\"name/9\",[3,22.437]],[\"comment/9\",[]],[\"name/10\",[4,22.437]],[\"comment/10\",[]],[\"name/11\",[9,30.91]],[\"comment/11\",[]],[\"name/12\",[10,30.91]],[\"comment/12\",[]],[\"name/13\",[11,25.802]],[\"comment/13\",[]],[\"name/14\",[12,25.802]],[\"comment/14\",[]],[\"name/15\",[13,25.802]],[\"comment/15\",[]],[\"name/16\",[14,25.802]],[\"comment/16\",[]],[\"name/17\",[15,25.802]],[\"comment/17\",[]],[\"name/18\",[16,30.91]],[\"comment/18\",[]],[\"name/19\",[17,30.91]],[\"comment/19\",[]],[\"name/20\",[18,30.91]],[\"comment/20\",[]],[\"name/21\",[19,30.91]],[\"comment/21\",[]],[\"name/22\",[1,25.802]],[\"comment/22\",[]],[\"name/23\",[3,22.437]],[\"comment/23\",[]],[\"name/24\",[4,22.437]],[\"comment/24\",[]],[\"name/25\",[5,25.802]],[\"comment/25\",[]],[\"name/26\",[20,30.91]],[\"comment/26\",[]],[\"name/27\",[11,25.802]],[\"comment/27\",[]],[\"name/28\",[12,25.802]],[\"comment/28\",[]],[\"name/29\",[13,25.802]],[\"comment/29\",[]],[\"name/30\",[14,25.802]],[\"comment/30\",[]],[\"name/31\",[15,25.802]],[\"comment/31\",[]]],\"invertedIndex\":[[\"__isempty\",{\"_index\":19,\"name\":{\"21\":{}},\"comment\":{}}],[\"__type\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"_mc\",{\"_index\":17,\"name\":{\"19\":{}},\"comment\":{}}],[\"_target\",{\"_index\":20,\"name\":{\"26\":{}},\"comment\":{}}],[\"add\",{\"_index\":3,\"name\":{\"3\":{},\"9\":{},\"23\":{}},\"comment\":{}}],[\"children\",{\"_index\":14,\"name\":{\"16\":{},\"30\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":5,\"name\":{\"5\":{},\"25\":{}},\"comment\":{}}],[\"debug\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"descendants\",{\"_index\":15,\"name\":{\"17\":{},\"31\":{}},\"comment\":{}}],[\"getmicrocomponents\",{\"_index\":9,\"name\":{\"11\":{}},\"comment\":{}}],[\"htmlelementmc\",{\"_index\":16,\"name\":{\"18\":{}},\"comment\":{}}],[\"mc\",{\"_index\":1,\"name\":{\"1\":{},\"22\":{}},\"comment\":{}}],[\"microcomponents\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"microcomponents.es3\",{\"_index\":18,\"name\":{\"20\":{}},\"comment\":{}}],[\"parent\",{\"_index\":12,\"name\":{\"14\":{},\"28\":{}},\"comment\":{}}],[\"parents\",{\"_index\":13,\"name\":{\"15\":{},\"29\":{}},\"comment\":{}}],[\"privatemcs\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"remove\",{\"_index\":4,\"name\":{\"4\":{},\"10\":{},\"24\":{}},\"comment\":{}}],[\"siblings\",{\"_index\":11,\"name\":{\"13\":{},\"27\":{}},\"comment\":{}}],[\"target\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"traversenodes\",{\"_index\":10,\"name\":{\"12\":{}},\"comment\":{}}]],\"pipeline\":[]}}");
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|