@twobirds/microcomponents 0.0.2 → 0.0.4
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/MicroComponentProposal_draft.md +10 -7
- package/README.md +3 -36
- package/dist/microcomponents.d.ts +7 -3
- package/dist/microcomponents.d.ts.map +1 -1
- package/dist/microcomponents.js +43 -28
- package/dist/microcomponents.min.js +8 -8
- package/dist/microcomponents.ts +49 -33
- package/microcomponents_why.md +25 -0
- package/package.json +1 -1
- package/public/docs/assets/search.js +1 -1
- package/public/docs/classes/microcomponents.MC.html +54 -27
- package/public/docs/classes/microcomponents_es3.MC.html +12 -12
- package/public/docs/functions/microcomponents_es3.__isEmpty.html +1 -1
- package/public/docs/index.html +7 -53
- package/public/docs/interfaces/microcomponents.HTMLElementMc.html +2 -2
- package/public/docs/modules/microcomponents.html +1 -1
- package/src/microcomponents.ts +49 -33
|
@@ -13,15 +13,18 @@ Microcomponents provide a way to encapsulate functionality and state within a ta
|
|
|
13
13
|
**Proposed API:**
|
|
14
14
|
|
|
15
15
|
- **Static Methods:**
|
|
16
|
-
- `MC.add(
|
|
17
|
-
- `MC.remove(target, key)`: Detach a micro component.
|
|
16
|
+
- `MC.add( taarget, key, element)`: Attach a top level micro component to an HTMLElement.
|
|
17
|
+
- `MC.remove( target, key )`: Detach a top level micro component from an HTMLElement.
|
|
18
|
+
- `MC.siblings( target )`: get top level micro components from an HTMLElement.
|
|
18
19
|
|
|
19
20
|
- **Instance Methods:**
|
|
20
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
21
|
+
- `add( key, element )`: Attach a private Micro Component to a Micro Component.
|
|
22
|
+
- `remove( key )`: Detach a private Micro Component from a Micro Component.
|
|
23
|
+
- `siblings(search?)`: Retrieve sibling micro components.
|
|
24
|
+
- `parent(search?)`: Get parent top level micro components.
|
|
25
|
+
- `parents(search?)`: Get all ancestor top level micro components.
|
|
26
|
+
- `children(search?)`: Retrieve child top level micro components.
|
|
27
|
+
- `descendants(search?)`: Get all descendant top level micro components.
|
|
25
28
|
|
|
26
29
|
**Use Cases:**
|
|
27
30
|
1. Modular web applications.
|
package/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
This code aims at
|
|
5
|
+
This code aims at [improving Javascript modularity](https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_why.md?ref_type=heads). It does not describe a specific Micro Component itself but rather describes they way they are **organized**. A typical example of a **Micro Component** can be found in "additional concepts" below.
|
|
6
6
|
|
|
7
7
|
Using micro components enforces **DRY, KISS and SOLID** principles in Javascript programming. Read this [RFC](https://gitlab.com/twoBirds/microcomponents/-/blob/main/MicroComponentProposal_draft.md?ref_type=heads) for the shortest info.
|
|
8
8
|
|
|
9
|
-
This is a low-level approach. It consists of a single class with
|
|
9
|
+
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. [hbbtv](https://en.wikipedia.org/wiki/Hybrid_Broadcast_Broadband_TV) modular JS coding, or any other device that relies on ES3.
|
|
10
10
|
|
|
11
11
|
For an overview, continue reading.
|
|
12
12
|
|
|
@@ -15,29 +15,6 @@ For a detailed functional description goto [Micro Component Usage](https://gitla
|
|
|
15
15
|
To see what can be done, go to [additional concepts](https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_magic.md?ref_type=heads) which delve a little deeper into how to use it, and what it already has been used for.
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
## Why would I give this a try in my company?
|
|
19
|
-
|
|
20
|
-
It is lightweight, proven and can yield positive results immediatly.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### **As the CTO**:
|
|
24
|
-
- **Reusability**: 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.
|
|
25
|
-
- **Scalability**: scales perfectly by design.
|
|
26
|
-
- **Interoperability**: 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.
|
|
27
|
-
|
|
28
|
-
### **As a Project Manager**:
|
|
29
|
-
- **Separation of Concerns**: since this is a modular approach you can **split UI logic from Business logic** and let diffent teams work on each.
|
|
30
|
-
- using this, you can **work with external developers without the need to give them access to your projects code repository**.
|
|
31
|
-
- you will find out that this allows your project to **become independent from the "tools hell"**. You tend to use **DIY** modules where you had tools before.
|
|
32
|
-
|
|
33
|
-
### **As a Javascript Developer**:
|
|
34
|
-
- The learning curve to use this is more than shallow. 1 hour should be enough.
|
|
35
|
-
- This is based on **plain Javascript/Typescript, HTML and CSS**. There is no abstraction layer.
|
|
36
|
-
- From the very start **it is fun to work with**. You are back in control of your code without bigger frameworks, but you are able to interact with them.
|
|
37
|
-
- You can **work for any customer right away**. **No training on their system required**, just fulfill their micro component requirements.
|
|
38
|
-
- Over time, you can **build your own framework or functional libraries** from scratch.
|
|
39
|
-
|
|
40
|
-
|
|
41
18
|
## Functional Requirements
|
|
42
19
|
|
|
43
20
|
- I want to **enrich a standard HTMLElement instance with encapsuled and modular javascript**, without having to resort to web components or big frameworks.
|
|
@@ -83,17 +60,7 @@ console.log( myButton._mc );
|
|
|
83
60
|
|
|
84
61
|
For detailed information jump to [Micro Component Usage](https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_usage.md?ref_type=heads);
|
|
85
62
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
I have been working with this since 2004. I used this as core principle inside my twoBirds framework.
|
|
89
|
-
|
|
90
|
-
This functionality has been used in very big and complicated data processing projects:
|
|
91
|
-
- to allow for web component like programming (as early as 2004)
|
|
92
|
-
- to encapsule UI handling
|
|
93
|
-
- to represent business processes and their tasks
|
|
94
|
-
- and lately to compose very complex native web components from distinct modular functionality.
|
|
95
|
-
|
|
96
|
-
I decided to extract this functionality from the [twoBirds framework](https://www.npmjs.com/package/twobirds-core), since it is framework agnostic, and relies solely on the standard DOM and native javascript or typescript, and is a useful tool in itself.
|
|
63
|
+
I decided to extract this functionality from the [twoBirds framework](https://www.npmjs.com/package/twobirds-core), 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.
|
|
97
64
|
|
|
98
65
|
## Useful Links
|
|
99
66
|
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
export declare class MC {
|
|
2
2
|
private target;
|
|
3
3
|
private privateMCs;
|
|
4
|
+
_mc?: {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
4
7
|
static debug: boolean;
|
|
5
8
|
constructor(target?: HTMLElement | null);
|
|
6
|
-
static
|
|
7
|
-
add(
|
|
9
|
+
static siblings(target: HTMLElement, search?: string): any[];
|
|
10
|
+
static add(target: HTMLElement, key: string, element?: any): any[];
|
|
8
11
|
static remove(target: HTMLElement, key: string): void;
|
|
9
|
-
remove(key: string): void;
|
|
10
12
|
private getMicroComponents;
|
|
11
13
|
private traverseNodes;
|
|
12
14
|
private isDOM;
|
|
15
|
+
add(key?: string, element?: any): any;
|
|
16
|
+
remove(key: string): void;
|
|
13
17
|
siblings(search?: string): any[];
|
|
14
18
|
parent(search?: string): any[];
|
|
15
19
|
parents(search?: string): any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microcomponents.d.ts","sourceRoot":"","sources":["../src/microcomponents.ts"],"names":[],"mappings":"AACA,qBAAa,EAAE;IAEd,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,CAAC,UAAU,CAA8B;IAEhD,MAAM,CAAC,KAAK,EAAE,OAAO,CAAS;gBAElB,MAAM,GAAE,WAAW,GAAG,IAAW;
|
|
1
|
+
{"version":3,"file":"microcomponents.d.ts","sourceRoot":"","sources":["../src/microcomponents.ts"],"names":[],"mappings":"AACA,qBAAa,EAAE;IAEd,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,CAAC,UAAU,CAA8B;IAEhD,GAAG,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAM;IAElC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAS;gBAElB,MAAM,GAAE,WAAW,GAAG,IAAW;IAS7C,MAAM,CAAC,QAAQ,CAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,MAAM,GAAI,GAAG,EAAE;IAQ9D,MAAM,CAAC,GAAG,CAAE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,GAAQ,GAAI,GAAG,EAAE;IAqBxE,MAAM,CAAC,MAAM,CAAE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAI,IAAI;IA8BvD,OAAO,CAAC,kBAAkB;IA0B1B,OAAO,CAAC,aAAa;IAmBrB,OAAO,CAAC,KAAK;IASb,GAAG,CAAE,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,GAAQ,GAAI,GAAG;IAU3C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAczB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,EAAE;IAchC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,EAAE;IAQ9B,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,EAAE;IAQ/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,EAAE;IAahC,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,EAAE;CAOnC;AAED,MAAM,WAAW,aAAc,SAAQ,WAAW;IACjD,GAAG,EAAE,EAAE,CAAC;CACR"}
|
package/dist/microcomponents.js
CHANGED
|
@@ -2,13 +2,26 @@
|
|
|
2
2
|
export class MC {
|
|
3
3
|
target;
|
|
4
4
|
privateMCs = {};
|
|
5
|
+
_mc = {};
|
|
5
6
|
static debug = false;
|
|
6
7
|
constructor(target = null) {
|
|
7
8
|
this.target = target;
|
|
8
9
|
this.privateMCs = {};
|
|
10
|
+
if (MC?.debug) {
|
|
11
|
+
this._mc = this.privateMCs;
|
|
12
|
+
}
|
|
13
|
+
;
|
|
14
|
+
}
|
|
15
|
+
// return all top-level micro components from an HTMLElement
|
|
16
|
+
static siblings(target, search) {
|
|
17
|
+
let t = target;
|
|
18
|
+
if (!t?._mc)
|
|
19
|
+
return [];
|
|
20
|
+
let mc = t._mc;
|
|
21
|
+
return search ? mc[search] ? [mc[search]] : [] : [...Object.entries(t._mc)];
|
|
9
22
|
}
|
|
10
23
|
// add a microcomponent to a target DOM node
|
|
11
|
-
static add(element = {}
|
|
24
|
+
static add(target, key, element = {}) {
|
|
12
25
|
const mc = target;
|
|
13
26
|
// create the _mc property if necessary
|
|
14
27
|
if (!mc._mc) {
|
|
@@ -23,24 +36,18 @@ export class MC {
|
|
|
23
36
|
}
|
|
24
37
|
return element;
|
|
25
38
|
}
|
|
26
|
-
//
|
|
27
|
-
add(element = {}, key, target) {
|
|
28
|
-
// add the element
|
|
29
|
-
if (target && key) {
|
|
30
|
-
// ...to the DOM
|
|
31
|
-
this.privateMCs[key] = element; // also the first element in the private MC collection
|
|
32
|
-
return MC.add(element, key, target);
|
|
33
|
-
}
|
|
34
|
-
if (key && !element) {
|
|
35
|
-
// ... to the private element collection
|
|
36
|
-
this.privateMCs[key] = element;
|
|
37
|
-
}
|
|
38
|
-
return element;
|
|
39
|
-
}
|
|
40
|
-
// remove a micro component from the DOM
|
|
39
|
+
// remove a micro component from the target DOM node
|
|
41
40
|
static remove(target, key) {
|
|
41
|
+
if ( //silent fail
|
|
42
|
+
!key
|
|
43
|
+
|| typeof key !== 'string'
|
|
44
|
+
|| !target
|
|
45
|
+
|| target instanceof HTMLElement === false) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
;
|
|
42
49
|
const mc = target;
|
|
43
|
-
// delete the property from the
|
|
50
|
+
// delete the property from the HTMLElement _mc collection
|
|
44
51
|
if (mc._mc && mc._mc[key]) {
|
|
45
52
|
delete mc._mc[key];
|
|
46
53
|
}
|
|
@@ -50,16 +57,6 @@ export class MC {
|
|
|
50
57
|
}
|
|
51
58
|
return;
|
|
52
59
|
}
|
|
53
|
-
// remove a micro component from the DOM or the private microcomponent collection
|
|
54
|
-
remove(key) {
|
|
55
|
-
// remove the component from the private collection
|
|
56
|
-
if (key in this.privateMCs) {
|
|
57
|
-
delete this.privateMCs[key];
|
|
58
|
-
}
|
|
59
|
-
if (MC.debug && this.target) {
|
|
60
|
-
MC.remove(this.target, key);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
60
|
/*
|
|
64
61
|
helper methods
|
|
65
62
|
*/
|
|
@@ -110,9 +107,27 @@ export class MC {
|
|
|
110
107
|
return element && element instanceof HTMLElement;
|
|
111
108
|
}
|
|
112
109
|
/*
|
|
110
|
+
Methods to handle private MCs
|
|
111
|
+
*/
|
|
112
|
+
// add a microcomponent to the private microcomponent collection
|
|
113
|
+
add(key, element = {}) {
|
|
114
|
+
// add the element
|
|
115
|
+
if (key) {
|
|
116
|
+
this.privateMCs[key] = element; // also the first element in the private MC collection
|
|
117
|
+
}
|
|
118
|
+
return element;
|
|
119
|
+
}
|
|
120
|
+
// remove a micro component from the private microcomponent collection
|
|
121
|
+
remove(key) {
|
|
122
|
+
// remove the component from the private collection
|
|
123
|
+
if (key in this.privateMCs) {
|
|
124
|
+
delete this.privateMCs[key];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/*
|
|
113
128
|
selector methods, non-chainable
|
|
114
129
|
*/
|
|
115
|
-
// all
|
|
130
|
+
// all private collection members
|
|
116
131
|
siblings(search) {
|
|
117
132
|
if (this.target) {
|
|
118
133
|
if (this.target instanceof HTMLElement === true) {
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
'use strict';export class MC{target;privateMCs={};static debug=false;constructor(target=null){this.target=target;this.privateMCs={};}
|
|
2
|
-
static
|
|
1
|
+
'use strict';export class MC{target;privateMCs={};_mc={};static debug=false;constructor(target=null){this.target=target;this.privateMCs={};if(MC?.debug){this._mc=this.privateMCs;};}
|
|
2
|
+
static siblings(target,search){let t=target;if(!t?._mc)
|
|
3
|
+
return[];let mc=t._mc;return search?mc[search]?[mc[search]]:[]:[...Object.entries(t._mc)];}
|
|
4
|
+
static add(target,key,element={}){const mc=target;if(!mc._mc){mc._mc=new MC();}
|
|
3
5
|
if(key&&!mc._mc[key]){mc._mc[key]=element;if(target){target.setAttribute('_mc','');}}
|
|
4
6
|
return element;}
|
|
5
|
-
|
|
6
|
-
if(key&&!element){this.privateMCs[key]=element;}
|
|
7
|
-
return element;}
|
|
8
|
-
static remove(target,key){const mc=target;if(mc._mc&&mc._mc[key]){delete mc._mc[key];}
|
|
7
|
+
static remove(target,key){if(!key||typeof key!=='string'||!target||target instanceof HTMLElement===false){return;};const mc=target;if(mc._mc&&mc._mc[key]){delete mc._mc[key];}
|
|
9
8
|
if(!Object.keys(mc._mc).length&&target.hasAttribute('_mc')){target.removeAttribute('_mc');}
|
|
10
9
|
return;}
|
|
11
|
-
remove(key){if(key in this.privateMCs){delete this.privateMCs[key];}
|
|
12
|
-
if(MC.debug&&this.target){MC.remove(this.target,key);}}
|
|
13
10
|
getMicroComponents(elements,search){let mcValues=[];elements.forEach(e=>{if(e){if(e instanceof HTMLElement){if(!search&&e._mc){mcValues=mcValues.concat(Object.values(e._mc));}
|
|
14
11
|
else if(search&&e._mc&&e._mc[search]){mcValues.push(e._mc[search]);}}
|
|
15
12
|
else if(e instanceof MC){if(!search){mcValues=mcValues.concat(Object.values(this.privateMCs));}
|
|
@@ -21,6 +18,9 @@ return mcValues;}
|
|
|
21
18
|
node=node.parentNode;}
|
|
22
19
|
return mcValues;}
|
|
23
20
|
isDOM(element){return element&&element instanceof HTMLElement;}
|
|
21
|
+
add(key,element={}){if(key){this.privateMCs[key]=element;}
|
|
22
|
+
return element;}
|
|
23
|
+
remove(key){if(key in this.privateMCs){delete this.privateMCs[key];}}
|
|
24
24
|
siblings(search){if(this.target){if(this.target instanceof HTMLElement===true){return this.getMicroComponents([this.target],search);}
|
|
25
25
|
else{const result=this.privateMCs[search||''];return search&&result?[result]:Object.entries(this.privateMCs);}}
|
|
26
26
|
return[];}
|
package/dist/microcomponents.ts
CHANGED
|
@@ -5,15 +5,28 @@ export class MC {
|
|
|
5
5
|
|
|
6
6
|
private privateMCs: { [key: string]: any } = {};
|
|
7
7
|
|
|
8
|
+
_mc?: { [key: string]: any } = {};
|
|
9
|
+
|
|
8
10
|
static debug: boolean = false;
|
|
9
11
|
|
|
10
12
|
constructor(target: HTMLElement | null = null) {
|
|
11
13
|
this.target = target;
|
|
12
14
|
this.privateMCs = {};
|
|
15
|
+
if ( MC?.debug ) {
|
|
16
|
+
this._mc = this.privateMCs;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// return all top-level micro components from an HTMLElement
|
|
21
|
+
static siblings( target: HTMLElement, search?: string ): any[] {
|
|
22
|
+
let t = target as HTMLElementMc;
|
|
23
|
+
if ( !t?._mc ) return [];
|
|
24
|
+
let mc: { [key: string]: any } = t._mc;
|
|
25
|
+
return search ? mc[search] ? [ mc[search] ] : [] : [ ...Object.entries( t._mc ) ];
|
|
13
26
|
}
|
|
14
27
|
|
|
15
28
|
// add a microcomponent to a target DOM node
|
|
16
|
-
static add(
|
|
29
|
+
static add( target: HTMLElement, key: string, element: any = {} ): any[] {
|
|
17
30
|
|
|
18
31
|
const mc = target as any;
|
|
19
32
|
|
|
@@ -33,28 +46,20 @@ export class MC {
|
|
|
33
46
|
return element;
|
|
34
47
|
}
|
|
35
48
|
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// add the element
|
|
40
|
-
if ( target && key ){
|
|
41
|
-
// ...to the DOM
|
|
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
|
-
// ... to the private element collection
|
|
47
|
-
this.privateMCs[key] = element;
|
|
48
|
-
}
|
|
49
|
-
return element;
|
|
50
|
-
}
|
|
49
|
+
// remove a micro component from the target DOM node
|
|
50
|
+
static remove( target: HTMLElement, key: string ): void {
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
if ( //silent fail
|
|
53
|
+
!key
|
|
54
|
+
|| typeof key !== 'string'
|
|
55
|
+
|| !target
|
|
56
|
+
|| target instanceof HTMLElement === false ) {
|
|
57
|
+
return;
|
|
58
|
+
};
|
|
54
59
|
|
|
55
60
|
const mc = target as any;
|
|
56
61
|
|
|
57
|
-
// delete the property from the
|
|
62
|
+
// delete the property from the HTMLElement _mc collection
|
|
58
63
|
if (mc._mc && mc._mc[key]) {
|
|
59
64
|
delete mc._mc[key];
|
|
60
65
|
}
|
|
@@ -67,19 +72,6 @@ export class MC {
|
|
|
67
72
|
return;
|
|
68
73
|
}
|
|
69
74
|
|
|
70
|
-
// remove a micro component from the DOM or the private microcomponent collection
|
|
71
|
-
remove(key: string): void {
|
|
72
|
-
|
|
73
|
-
// remove the component from the private collection
|
|
74
|
-
if (key in this.privateMCs) {
|
|
75
|
-
delete this.privateMCs[key];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if ( MC.debug && this.target ){
|
|
79
|
-
MC.remove(this.target, key);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
75
|
/*
|
|
84
76
|
helper methods
|
|
85
77
|
*/
|
|
@@ -134,11 +126,35 @@ export class MC {
|
|
|
134
126
|
return element && element instanceof HTMLElement;
|
|
135
127
|
}
|
|
136
128
|
|
|
129
|
+
/*
|
|
130
|
+
Methods to handle private MCs
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
// add a microcomponent to the private microcomponent collection
|
|
134
|
+
add( key?: string, element: any = {} ): any {
|
|
135
|
+
|
|
136
|
+
// add the element
|
|
137
|
+
if ( key ){
|
|
138
|
+
this.privateMCs[key] = element; // also the first element in the private MC collection
|
|
139
|
+
}
|
|
140
|
+
return element;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// remove a micro component from the private microcomponent collection
|
|
144
|
+
remove(key: string): void {
|
|
145
|
+
|
|
146
|
+
// remove the component from the private collection
|
|
147
|
+
if (key in this.privateMCs) {
|
|
148
|
+
delete this.privateMCs[key];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
|
|
137
153
|
/*
|
|
138
154
|
selector methods, non-chainable
|
|
139
155
|
*/
|
|
140
156
|
|
|
141
|
-
// all
|
|
157
|
+
// all private collection members
|
|
142
158
|
siblings(search?: string): any[] {
|
|
143
159
|
if ( this.target ){
|
|
144
160
|
if ( this.target instanceof HTMLElement === true ){
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
## Why would I give this a try?
|
|
3
|
+
|
|
4
|
+
It is lightweight, proven and can yield positive results immediatly.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### **As the CTO**:
|
|
8
|
+
|
|
9
|
+
- **Reusability**: 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.
|
|
10
|
+
- **Scalability**: scales perfectly by design.
|
|
11
|
+
- **Interoperability**: 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.
|
|
12
|
+
|
|
13
|
+
### **As a Project Manager**:
|
|
14
|
+
|
|
15
|
+
- **Separation of Concerns**: since this is a modular approach you can **split UI logic from Business logic** and let diffent teams work on each.
|
|
16
|
+
- using this, you can **work with external developers without the need to give them access to your projects code repository**.
|
|
17
|
+
- you will find out that this allows your project to **become independent from the "tools hell"**. You tend to use **DIY** modules where you had tools before.
|
|
18
|
+
|
|
19
|
+
### **As a Javascript Developer**:
|
|
20
|
+
|
|
21
|
+
- The learning curve to use this is more than shallow. 1 hour should be enough.
|
|
22
|
+
- This is based on **plain Javascript/Typescript, HTML and CSS**. There is no abstraction layer.
|
|
23
|
+
- From the very start **it is fun to work with**. You are back in control of your code without bigger frameworks, but you are able to interact with them.
|
|
24
|
+
- You can **work for any customer right away**. **No training on their system required**, just fulfill their micro component requirements.
|
|
25
|
+
- Over time, you can **build your own framework or functional libraries** from scratch.
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
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\":\"isDOM\",\"url\":\"classes/microcomponents.MC.html#isDOM\",\"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,31.209]],[\"comment/0\",[]],[\"name/1\",[1,26.101]],[\"comment/1\",[]],[\"name/2\",[2,31.209]],[\"comment/2\",[]],[\"name/3\",[3,22.736]],[\"comment/3\",[]],[\"name/4\",[4,22.736]],[\"comment/4\",[]],[\"name/5\",[5,26.101]],[\"comment/5\",[]],[\"name/6\",[6,31.209]],[\"comment/6\",[]],[\"name/7\",[7,31.209]],[\"comment/7\",[]],[\"name/8\",[8,31.209]],[\"comment/8\",[]],[\"name/9\",[3,22.736]],[\"comment/9\",[]],[\"name/10\",[4,22.736]],[\"comment/10\",[]],[\"name/11\",[9,31.209]],[\"comment/11\",[]],[\"name/12\",[10,31.209]],[\"comment/12\",[]],[\"name/13\",[11,31.209]],[\"comment/13\",[]],[\"name/14\",[12,26.101]],[\"comment/14\",[]],[\"name/15\",[13,26.101]],[\"comment/15\",[]],[\"name/16\",[14,26.101]],[\"comment/16\",[]],[\"name/17\",[15,26.101]],[\"comment/17\",[]],[\"name/18\",[16,26.101]],[\"comment/18\",[]],[\"name/19\",[17,31.209]],[\"comment/19\",[]],[\"name/20\",[18,31.209]],[\"comment/20\",[]],[\"name/21\",[19,31.209]],[\"comment/21\",[]],[\"name/22\",[20,31.209]],[\"comment/22\",[]],[\"name/23\",[1,26.101]],[\"comment/23\",[]],[\"name/24\",[3,22.736]],[\"comment/24\",[]],[\"name/25\",[4,22.736]],[\"comment/25\",[]],[\"name/26\",[5,26.101]],[\"comment/26\",[]],[\"name/27\",[21,31.209]],[\"comment/27\",[]],[\"name/28\",[12,26.101]],[\"comment/28\",[]],[\"name/29\",[13,26.101]],[\"comment/29\",[]],[\"name/30\",[14,26.101]],[\"comment/30\",[]],[\"name/31\",[15,26.101]],[\"comment/31\",[]],[\"name/32\",[16,26.101]],[\"comment/32\",[]]],\"invertedIndex\":[[\"__isempty\",{\"_index\":20,\"name\":{\"22\":{}},\"comment\":{}}],[\"__type\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"_mc\",{\"_index\":18,\"name\":{\"20\":{}},\"comment\":{}}],[\"_target\",{\"_index\":21,\"name\":{\"27\":{}},\"comment\":{}}],[\"add\",{\"_index\":3,\"name\":{\"3\":{},\"9\":{},\"24\":{}},\"comment\":{}}],[\"children\",{\"_index\":15,\"name\":{\"17\":{},\"31\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":5,\"name\":{\"5\":{},\"26\":{}},\"comment\":{}}],[\"debug\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"descendants\",{\"_index\":16,\"name\":{\"18\":{},\"32\":{}},\"comment\":{}}],[\"getmicrocomponents\",{\"_index\":9,\"name\":{\"11\":{}},\"comment\":{}}],[\"htmlelementmc\",{\"_index\":17,\"name\":{\"19\":{}},\"comment\":{}}],[\"isdom\",{\"_index\":11,\"name\":{\"13\":{}},\"comment\":{}}],[\"mc\",{\"_index\":1,\"name\":{\"1\":{},\"23\":{}},\"comment\":{}}],[\"microcomponents\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"microcomponents.es3\",{\"_index\":19,\"name\":{\"21\":{}},\"comment\":{}}],[\"parent\",{\"_index\":13,\"name\":{\"15\":{},\"29\":{}},\"comment\":{}}],[\"parents\",{\"_index\":14,\"name\":{\"16\":{},\"30\":{}},\"comment\":{}}],[\"privatemcs\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"remove\",{\"_index\":4,\"name\":{\"4\":{},\"10\":{},\"25\":{}},\"comment\":{}}],[\"siblings\",{\"_index\":12,\"name\":{\"14\":{},\"28\":{}},\"comment\":{}}],[\"target\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"traversenodes\",{\"_index\":10,\"name\":{\"12\":{}},\"comment\":{}}]],\"pipeline\":[]}}");
|
|
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\":\"siblings\",\"url\":\"classes/microcomponents.MC.html#siblings-2\",\"classes\":\"tsd-kind-method 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-1\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-property\",\"parent\":\"microcomponents.MC.privateMCs\"},{\"kind\":1024,\"name\":\"_mc\",\"url\":\"classes/microcomponents.MC.html#_mc\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"microcomponents.MC\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/microcomponents.MC.html#_mc.__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-property\",\"parent\":\"microcomponents.MC._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\":\"isDOM\",\"url\":\"classes/microcomponents.MC.html#isDOM\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-private\",\"parent\":\"microcomponents.MC\"},{\"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\":\"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,32.055]],[\"comment/0\",[]],[\"name/1\",[1,26.946]],[\"comment/1\",[]],[\"name/2\",[2,32.055]],[\"comment/2\",[]],[\"name/3\",[3,23.582]],[\"comment/3\",[]],[\"name/4\",[4,23.582]],[\"comment/4\",[]],[\"name/5\",[5,23.582]],[\"comment/5\",[]],[\"name/6\",[6,26.946]],[\"comment/6\",[]],[\"name/7\",[7,32.055]],[\"comment/7\",[]],[\"name/8\",[8,32.055]],[\"comment/8\",[]],[\"name/9\",[9,26.946]],[\"comment/9\",[]],[\"name/10\",[10,26.946]],[\"comment/10\",[]],[\"name/11\",[9,26.946]],[\"comment/11\",[]],[\"name/12\",[11,32.055]],[\"comment/12\",[]],[\"name/13\",[12,32.055]],[\"comment/13\",[]],[\"name/14\",[13,32.055]],[\"comment/14\",[]],[\"name/15\",[4,23.582]],[\"comment/15\",[]],[\"name/16\",[5,23.582]],[\"comment/16\",[]],[\"name/17\",[3,23.582]],[\"comment/17\",[]],[\"name/18\",[14,26.946]],[\"comment/18\",[]],[\"name/19\",[15,26.946]],[\"comment/19\",[]],[\"name/20\",[16,26.946]],[\"comment/20\",[]],[\"name/21\",[17,26.946]],[\"comment/21\",[]],[\"name/22\",[18,32.055]],[\"comment/22\",[]],[\"name/23\",[10,26.946]],[\"comment/23\",[]],[\"name/24\",[19,32.055]],[\"comment/24\",[]],[\"name/25\",[20,32.055]],[\"comment/25\",[]],[\"name/26\",[1,26.946]],[\"comment/26\",[]],[\"name/27\",[4,23.582]],[\"comment/27\",[]],[\"name/28\",[5,23.582]],[\"comment/28\",[]],[\"name/29\",[6,26.946]],[\"comment/29\",[]],[\"name/30\",[21,32.055]],[\"comment/30\",[]],[\"name/31\",[3,23.582]],[\"comment/31\",[]],[\"name/32\",[14,26.946]],[\"comment/32\",[]],[\"name/33\",[15,26.946]],[\"comment/33\",[]],[\"name/34\",[16,26.946]],[\"comment/34\",[]],[\"name/35\",[17,26.946]],[\"comment/35\",[]]],\"invertedIndex\":[[\"__isempty\",{\"_index\":20,\"name\":{\"25\":{}},\"comment\":{}}],[\"__type\",{\"_index\":9,\"name\":{\"9\":{},\"11\":{}},\"comment\":{}}],[\"_mc\",{\"_index\":10,\"name\":{\"10\":{},\"23\":{}},\"comment\":{}}],[\"_target\",{\"_index\":21,\"name\":{\"30\":{}},\"comment\":{}}],[\"add\",{\"_index\":4,\"name\":{\"4\":{},\"15\":{},\"27\":{}},\"comment\":{}}],[\"children\",{\"_index\":16,\"name\":{\"20\":{},\"34\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":6,\"name\":{\"6\":{},\"29\":{}},\"comment\":{}}],[\"debug\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"descendants\",{\"_index\":17,\"name\":{\"21\":{},\"35\":{}},\"comment\":{}}],[\"getmicrocomponents\",{\"_index\":11,\"name\":{\"12\":{}},\"comment\":{}}],[\"htmlelementmc\",{\"_index\":18,\"name\":{\"22\":{}},\"comment\":{}}],[\"isdom\",{\"_index\":13,\"name\":{\"14\":{}},\"comment\":{}}],[\"mc\",{\"_index\":1,\"name\":{\"1\":{},\"26\":{}},\"comment\":{}}],[\"microcomponents\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"microcomponents.es3\",{\"_index\":19,\"name\":{\"24\":{}},\"comment\":{}}],[\"parent\",{\"_index\":14,\"name\":{\"18\":{},\"32\":{}},\"comment\":{}}],[\"parents\",{\"_index\":15,\"name\":{\"19\":{},\"33\":{}},\"comment\":{}}],[\"privatemcs\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"remove\",{\"_index\":5,\"name\":{\"5\":{},\"16\":{},\"28\":{}},\"comment\":{}}],[\"siblings\",{\"_index\":3,\"name\":{\"3\":{},\"17\":{},\"31\":{}},\"comment\":{}}],[\"target\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"traversenodes\",{\"_index\":12,\"name\":{\"13\":{}},\"comment\":{}}]],\"pipeline\":[]}}");
|
|
@@ -21,7 +21,7 @@
|
|
|
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/
|
|
24
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L2">src/microcomponents.ts:2</a></li></ul></aside>
|
|
25
25
|
<section class="tsd-panel-group tsd-index-group">
|
|
26
26
|
<section class="tsd-panel tsd-index-panel">
|
|
27
27
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
</div></section>
|
|
34
34
|
<section class="tsd-index-section">
|
|
35
35
|
<h3 class="tsd-index-heading">Properties</h3>
|
|
36
|
-
<div class="tsd-index-list"><a href="microcomponents.MC.html#
|
|
36
|
+
<div class="tsd-index-list"><a href="microcomponents.MC.html#_mc" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12" id="icon-1024-path"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)" id="icon-1024-text"></path></svg><span>_mc?</span></a>
|
|
37
|
+
<a href="microcomponents.MC.html#privateMCs" class="tsd-index-link tsd-kind-property tsd-parent-kind-class tsd-is-private"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>privateMCs</span></a>
|
|
37
38
|
<a href="microcomponents.MC.html#target" class="tsd-index-link tsd-kind-property tsd-parent-kind-class tsd-is-private"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>target</span></a>
|
|
38
39
|
<a href="microcomponents.MC.html#debug" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>debug</span></a>
|
|
39
40
|
</div></section>
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
<a href="microcomponents.MC.html#traverseNodes" class="tsd-index-link tsd-kind-method tsd-parent-kind-class tsd-is-private"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>traverse<wbr/>Nodes</span></a>
|
|
52
53
|
<a href="microcomponents.MC.html#add-2" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>add</span></a>
|
|
53
54
|
<a href="microcomponents.MC.html#remove-2" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>remove</span></a>
|
|
55
|
+
<a href="microcomponents.MC.html#siblings-2" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>siblings</span></a>
|
|
54
56
|
</div></section></div></details></section></section>
|
|
55
57
|
<section class="tsd-panel-group tsd-member-group">
|
|
56
58
|
<h2>Constructors</h2>
|
|
@@ -66,9 +68,19 @@
|
|
|
66
68
|
<h5>target: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span><span class="tsd-signature-symbol"> = null</span></h5></li></ul></div>
|
|
67
69
|
<h4 class="tsd-returns-title">Returns <a href="microcomponents.MC.html" class="tsd-signature-type" data-tsd-kind="Class">MC</a></h4><aside class="tsd-sources">
|
|
68
70
|
<ul>
|
|
69
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
71
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L12">src/microcomponents.ts:12</a></li></ul></aside></li></ul></section></section>
|
|
70
72
|
<section class="tsd-panel-group tsd-member-group">
|
|
71
73
|
<h2>Properties</h2>
|
|
74
|
+
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="_mc" class="tsd-anchor"></a>
|
|
75
|
+
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <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>
|
|
76
|
+
<div class="tsd-signature">_mc<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span>[key: <span class="tsd-signature-type">string</span>]<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = {}</span></div>
|
|
77
|
+
<div class="tsd-type-declaration">
|
|
78
|
+
<h4>Type declaration</h4>
|
|
79
|
+
<ul class="tsd-parameters">
|
|
80
|
+
<li class="tsd-parameter-index-signature">
|
|
81
|
+
<h5><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-type">any</span></h5></li></ul></div><aside class="tsd-sources">
|
|
82
|
+
<ul>
|
|
83
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L8">src/microcomponents.ts:8</a></li></ul></aside></section>
|
|
72
84
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a id="privateMCs" class="tsd-anchor"></a>
|
|
73
85
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>privateMCs</span><a href="#privateMCs" 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>
|
|
74
86
|
<div class="tsd-signature">privateMCs<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span>[key: <span class="tsd-signature-type">string</span>]<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = {}</span></div>
|
|
@@ -78,36 +90,34 @@
|
|
|
78
90
|
<li class="tsd-parameter-index-signature">
|
|
79
91
|
<h5><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-type">any</span></h5></li></ul></div><aside class="tsd-sources">
|
|
80
92
|
<ul>
|
|
81
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
93
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L6">src/microcomponents.ts:6</a></li></ul></aside></section>
|
|
82
94
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a id="target" class="tsd-anchor"></a>
|
|
83
95
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <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>
|
|
84
96
|
<div class="tsd-signature">target<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></div><aside class="tsd-sources">
|
|
85
97
|
<ul>
|
|
86
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
98
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L4">src/microcomponents.ts:4</a></li></ul></aside></section>
|
|
87
99
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="debug" class="tsd-anchor"></a>
|
|
88
100
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>debug</span><a href="#debug" 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
101
|
<div class="tsd-signature">debug<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></div><aside class="tsd-sources">
|
|
90
102
|
<ul>
|
|
91
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
103
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L10">src/microcomponents.ts:10</a></li></ul></aside></section></section>
|
|
92
104
|
<section class="tsd-panel-group tsd-member-group">
|
|
93
105
|
<h2>Methods</h2>
|
|
94
106
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="add" class="tsd-anchor"></a>
|
|
95
107
|
<h3 class="tsd-anchor-link"><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>
|
|
96
108
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
97
|
-
<li class="tsd-signature tsd-anchor-link" id="add.add-1">add<span class="tsd-signature-symbol">(</span>
|
|
109
|
+
<li class="tsd-signature tsd-anchor-link" id="add.add-1">add<span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, element<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="#add.add-1" 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></li>
|
|
98
110
|
<li class="tsd-description">
|
|
99
111
|
<div class="tsd-parameters">
|
|
100
112
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
101
113
|
<ul class="tsd-parameter-list">
|
|
102
114
|
<li>
|
|
103
|
-
<h5>element: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = {}</span></h5></li>
|
|
104
|
-
<li>
|
|
105
115
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> key: <span class="tsd-signature-type">string</span></h5></li>
|
|
106
116
|
<li>
|
|
107
|
-
<h5
|
|
117
|
+
<h5>element: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = {}</span></h5></li></ul></div>
|
|
108
118
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources">
|
|
109
119
|
<ul>
|
|
110
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
120
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L134">src/microcomponents.ts:134</a></li></ul></aside></li></ul></section>
|
|
111
121
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="children" class="tsd-anchor"></a>
|
|
112
122
|
<h3 class="tsd-anchor-link"><span>children</span><a href="#children" 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>
|
|
113
123
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
@@ -120,7 +130,7 @@
|
|
|
120
130
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> search: <span class="tsd-signature-type">string</span></h5></li></ul></div>
|
|
121
131
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
122
132
|
<ul>
|
|
123
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
133
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L188">src/microcomponents.ts:188</a></li></ul></aside></li></ul></section>
|
|
124
134
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="descendants" class="tsd-anchor"></a>
|
|
125
135
|
<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>
|
|
126
136
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
@@ -133,7 +143,7 @@
|
|
|
133
143
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> search: <span class="tsd-signature-type">string</span></h5></li></ul></div>
|
|
134
144
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
135
145
|
<ul>
|
|
136
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
146
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L201">src/microcomponents.ts:201</a></li></ul></aside></li></ul></section>
|
|
137
147
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"><a id="getMicroComponents" class="tsd-anchor"></a>
|
|
138
148
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>get<wbr/>Micro<wbr/>Components</span><a href="#getMicroComponents" 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>
|
|
139
149
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private">
|
|
@@ -148,7 +158,7 @@
|
|
|
148
158
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> search: <span class="tsd-signature-type">string</span></h5></li></ul></div>
|
|
149
159
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
150
160
|
<ul>
|
|
151
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
161
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L80">src/microcomponents.ts:80</a></li></ul></aside></li></ul></section>
|
|
152
162
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"><a id="isDOM" class="tsd-anchor"></a>
|
|
153
163
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>isDOM</span><a href="#isDOM" 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>
|
|
154
164
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private">
|
|
@@ -161,7 +171,7 @@
|
|
|
161
171
|
<h5>element: <span class="tsd-signature-type">any</span></h5></li></ul></div>
|
|
162
172
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources">
|
|
163
173
|
<ul>
|
|
164
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
174
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L125">src/microcomponents.ts:125</a></li></ul></aside></li></ul></section>
|
|
165
175
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="parent" class="tsd-anchor"></a>
|
|
166
176
|
<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>
|
|
167
177
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
@@ -174,7 +184,7 @@
|
|
|
174
184
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> search: <span class="tsd-signature-type">string</span></h5></li></ul></div>
|
|
175
185
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
176
186
|
<ul>
|
|
177
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
187
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L172">src/microcomponents.ts:172</a></li></ul></aside></li></ul></section>
|
|
178
188
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="parents" class="tsd-anchor"></a>
|
|
179
189
|
<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>
|
|
180
190
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
@@ -187,7 +197,7 @@
|
|
|
187
197
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> search: <span class="tsd-signature-type">string</span></h5></li></ul></div>
|
|
188
198
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
189
199
|
<ul>
|
|
190
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
200
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L180">src/microcomponents.ts:180</a></li></ul></aside></li></ul></section>
|
|
191
201
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="remove" class="tsd-anchor"></a>
|
|
192
202
|
<h3 class="tsd-anchor-link"><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>
|
|
193
203
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
@@ -200,7 +210,7 @@
|
|
|
200
210
|
<h5>key: <span class="tsd-signature-type">string</span></h5></li></ul></div>
|
|
201
211
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
|
|
202
212
|
<ul>
|
|
203
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
213
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L144">src/microcomponents.ts:144</a></li></ul></aside></li></ul></section>
|
|
204
214
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="siblings" class="tsd-anchor"></a>
|
|
205
215
|
<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>
|
|
206
216
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
@@ -213,7 +223,7 @@
|
|
|
213
223
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> search: <span class="tsd-signature-type">string</span></h5></li></ul></div>
|
|
214
224
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
215
225
|
<ul>
|
|
216
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
226
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L158">src/microcomponents.ts:158</a></li></ul></aside></li></ul></section>
|
|
217
227
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"><a id="traverseNodes" class="tsd-anchor"></a>
|
|
218
228
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>traverse<wbr/>Nodes</span><a href="#traverseNodes" 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>
|
|
219
229
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private">
|
|
@@ -230,24 +240,24 @@
|
|
|
230
240
|
<h5>firstonly: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></h5></li></ul></div>
|
|
231
241
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
232
242
|
<ul>
|
|
233
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
243
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L106">src/microcomponents.ts:106</a></li></ul></aside></li></ul></section>
|
|
234
244
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="add-2" class="tsd-anchor"></a>
|
|
235
245
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>add</span><a href="#add-2" 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>
|
|
236
246
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
237
|
-
<li class="tsd-signature tsd-anchor-link" id="add-2.add-3">add<span class="tsd-signature-symbol">(</span>
|
|
247
|
+
<li class="tsd-signature tsd-anchor-link" id="add-2.add-3">add<span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLElement</span>, key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, element<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><span class="tsd-signature-symbol">[]</span><a href="#add-2.add-3" 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></li>
|
|
238
248
|
<li class="tsd-description">
|
|
239
249
|
<div class="tsd-parameters">
|
|
240
250
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
241
251
|
<ul class="tsd-parameter-list">
|
|
242
252
|
<li>
|
|
243
|
-
<h5>
|
|
253
|
+
<h5>target: <span class="tsd-signature-type">HTMLElement</span></h5></li>
|
|
244
254
|
<li>
|
|
245
255
|
<h5>key: <span class="tsd-signature-type">string</span></h5></li>
|
|
246
256
|
<li>
|
|
247
|
-
<h5>
|
|
248
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources">
|
|
257
|
+
<h5>element: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = {}</span></h5></li></ul></div>
|
|
258
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
249
259
|
<ul>
|
|
250
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
260
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L29">src/microcomponents.ts:29</a></li></ul></aside></li></ul></section>
|
|
251
261
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="remove-2" class="tsd-anchor"></a>
|
|
252
262
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>remove</span><a href="#remove-2" 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>
|
|
253
263
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
@@ -262,7 +272,22 @@
|
|
|
262
272
|
<h5>key: <span class="tsd-signature-type">string</span></h5></li></ul></div>
|
|
263
273
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
|
|
264
274
|
<ul>
|
|
265
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
275
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L50">src/microcomponents.ts:50</a></li></ul></aside></li></ul></section>
|
|
276
|
+
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="siblings-2" class="tsd-anchor"></a>
|
|
277
|
+
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>siblings</span><a href="#siblings-2" 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>
|
|
278
|
+
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
279
|
+
<li class="tsd-signature tsd-anchor-link" id="siblings-2.siblings-3">siblings<span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLElement</span>, search<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><a href="#siblings-2.siblings-3" 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></li>
|
|
280
|
+
<li class="tsd-description">
|
|
281
|
+
<div class="tsd-parameters">
|
|
282
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
283
|
+
<ul class="tsd-parameter-list">
|
|
284
|
+
<li>
|
|
285
|
+
<h5>target: <span class="tsd-signature-type">HTMLElement</span></h5></li>
|
|
286
|
+
<li>
|
|
287
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> search: <span class="tsd-signature-type">string</span></h5></li></ul></div>
|
|
288
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
289
|
+
<ul>
|
|
290
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L21">src/microcomponents.ts:21</a></li></ul></aside></li></ul></section></section></div>
|
|
266
291
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
267
292
|
<div class="tsd-navigation settings">
|
|
268
293
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -291,6 +316,7 @@
|
|
|
291
316
|
<li class="current tsd-kind-class tsd-parent-kind-module"><a href="microcomponents.MC.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><span>MC</span></a>
|
|
292
317
|
<ul>
|
|
293
318
|
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="microcomponents.MC.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-512-path"></use><use href="#icon-512-text"></use></svg>constructor</a></li>
|
|
319
|
+
<li class="tsd-kind-property tsd-parent-kind-class"><a href="microcomponents.MC.html#_mc" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>_mc?</a></li>
|
|
294
320
|
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="microcomponents.MC.html#privateMCs" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>privateMCs</a></li>
|
|
295
321
|
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="microcomponents.MC.html#target" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>target</a></li>
|
|
296
322
|
<li class="tsd-kind-property tsd-parent-kind-class"><a href="microcomponents.MC.html#debug" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>debug</a></li>
|
|
@@ -305,7 +331,8 @@
|
|
|
305
331
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="microcomponents.MC.html#siblings" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>siblings</a></li>
|
|
306
332
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="microcomponents.MC.html#traverseNodes" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>traverse<wbr/>Nodes</a></li>
|
|
307
333
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="microcomponents.MC.html#add-2" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>add</a></li>
|
|
308
|
-
<li class="tsd-kind-method tsd-parent-kind-class"><a href="microcomponents.MC.html#remove-2" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>remove</a></li
|
|
334
|
+
<li class="tsd-kind-method tsd-parent-kind-class"><a href="microcomponents.MC.html#remove-2" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>remove</a></li>
|
|
335
|
+
<li class="tsd-kind-method tsd-parent-kind-class"><a href="microcomponents.MC.html#siblings-2" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>siblings</a></li></ul></li></ul></nav></div></div>
|
|
309
336
|
<div class="container tsd-generator">
|
|
310
337
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
311
338
|
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
|
@@ -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/
|
|
25
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
26
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/
|
|
24
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.es3.js#L13">src/microcomponents.es3.js:13</a></li>
|
|
25
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.es3.js#L18">src/microcomponents.es3.js:18</a></li>
|
|
26
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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/
|
|
64
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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/
|
|
71
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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/
|
|
86
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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/
|
|
99
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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/
|
|
112
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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/
|
|
125
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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/
|
|
138
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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/
|
|
155
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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/
|
|
170
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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/
|
|
30
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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">
|
package/public/docs/index.html
CHANGED
|
@@ -16,48 +16,14 @@
|
|
|
16
16
|
<a href="#micro-components" id="micro-components" style="color: inherit; text-decoration: none;">
|
|
17
17
|
<h2>MICRO COMPONENTS</h2>
|
|
18
18
|
</a>
|
|
19
|
-
<p><img src="
|
|
20
|
-
<p>This code aims at <
|
|
21
|
-
<p>Using micro components enforces <strong>DRY, KISS and SOLID</strong> principles in Javascript programming. Read this <a href="
|
|
22
|
-
<p>This is a low-level approach. It consists of a single class with
|
|
19
|
+
<p><img src="https://gitlab.com/twoBirds/microcomponents/-/raw/main/MicroComponents.svg" alt="Micro Components Logo"></p>
|
|
20
|
+
<p>This code aims at <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_why.md?ref_type=heads">improving Javascript modularity</a>. 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 "additional concepts" 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
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
|
|
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
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
26
|
|
|
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>
|
|
29
|
-
</a>
|
|
30
|
-
<p>It is lightweight, proven and can yield positive results immediatly.</p>
|
|
31
|
-
|
|
32
|
-
<a href="#as-the-cto" id="as-the-cto" style="color: inherit; text-decoration: none;">
|
|
33
|
-
<h3><strong>As the CTO</strong>:</h3>
|
|
34
|
-
</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 "tools hell"</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>
|
|
60
|
-
|
|
61
27
|
<a href="#functional-requirements" id="functional-requirements" style="color: inherit; text-decoration: none;">
|
|
62
28
|
<h2>Functional Requirements</h2>
|
|
63
29
|
</a>
|
|
@@ -87,24 +53,12 @@
|
|
|
87
53
|
<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: <button>, onClick: <function> } }</span>
|
|
88
54
|
</code></pre>
|
|
89
55
|
<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 extract this 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.</p>
|
|
56
|
+
<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>
|
|
103
57
|
|
|
104
58
|
<a href="#useful-links" id="useful-links" style="color: inherit; text-decoration: none;">
|
|
105
59
|
<h2>Useful Links</h2>
|
|
106
60
|
</a>
|
|
107
|
-
<p><a href="http://twobirds.gitlab.io/
|
|
61
|
+
<p><a href="http://twobirds.gitlab.io/microcomponents/docs/modules.html">API documentation</a></p>
|
|
108
62
|
|
|
109
63
|
<a href="#contact" id="contact" style="color: inherit; text-decoration: none;">
|
|
110
64
|
<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/
|
|
26
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/src/microcomponents.ts#L210">src/microcomponents.ts:210</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/0bbe59f/src/microcomponents.ts#L211">src/microcomponents.ts:211</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/
|
|
19
|
+
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/0bbe59f/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">
|
package/src/microcomponents.ts
CHANGED
|
@@ -5,15 +5,28 @@ export class MC {
|
|
|
5
5
|
|
|
6
6
|
private privateMCs: { [key: string]: any } = {};
|
|
7
7
|
|
|
8
|
+
_mc?: { [key: string]: any } = {};
|
|
9
|
+
|
|
8
10
|
static debug: boolean = false;
|
|
9
11
|
|
|
10
12
|
constructor(target: HTMLElement | null = null) {
|
|
11
13
|
this.target = target;
|
|
12
14
|
this.privateMCs = {};
|
|
15
|
+
if ( MC?.debug ) {
|
|
16
|
+
this._mc = this.privateMCs;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// return all top-level micro components from an HTMLElement
|
|
21
|
+
static siblings( target: HTMLElement, search?: string ): any[] {
|
|
22
|
+
let t = target as HTMLElementMc;
|
|
23
|
+
if ( !t?._mc ) return [];
|
|
24
|
+
let mc: { [key: string]: any } = t._mc;
|
|
25
|
+
return search ? mc[search] ? [ mc[search] ] : [] : [ ...Object.entries( t._mc ) ];
|
|
13
26
|
}
|
|
14
27
|
|
|
15
28
|
// add a microcomponent to a target DOM node
|
|
16
|
-
static add(
|
|
29
|
+
static add( target: HTMLElement, key: string, element: any = {} ): any[] {
|
|
17
30
|
|
|
18
31
|
const mc = target as any;
|
|
19
32
|
|
|
@@ -33,28 +46,20 @@ export class MC {
|
|
|
33
46
|
return element;
|
|
34
47
|
}
|
|
35
48
|
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// add the element
|
|
40
|
-
if ( target && key ){
|
|
41
|
-
// ...to the DOM
|
|
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
|
-
// ... to the private element collection
|
|
47
|
-
this.privateMCs[key] = element;
|
|
48
|
-
}
|
|
49
|
-
return element;
|
|
50
|
-
}
|
|
49
|
+
// remove a micro component from the target DOM node
|
|
50
|
+
static remove( target: HTMLElement, key: string ): void {
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
if ( //silent fail
|
|
53
|
+
!key
|
|
54
|
+
|| typeof key !== 'string'
|
|
55
|
+
|| !target
|
|
56
|
+
|| target instanceof HTMLElement === false ) {
|
|
57
|
+
return;
|
|
58
|
+
};
|
|
54
59
|
|
|
55
60
|
const mc = target as any;
|
|
56
61
|
|
|
57
|
-
// delete the property from the
|
|
62
|
+
// delete the property from the HTMLElement _mc collection
|
|
58
63
|
if (mc._mc && mc._mc[key]) {
|
|
59
64
|
delete mc._mc[key];
|
|
60
65
|
}
|
|
@@ -67,19 +72,6 @@ export class MC {
|
|
|
67
72
|
return;
|
|
68
73
|
}
|
|
69
74
|
|
|
70
|
-
// remove a micro component from the DOM or the private microcomponent collection
|
|
71
|
-
remove(key: string): void {
|
|
72
|
-
|
|
73
|
-
// remove the component from the private collection
|
|
74
|
-
if (key in this.privateMCs) {
|
|
75
|
-
delete this.privateMCs[key];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if ( MC.debug && this.target ){
|
|
79
|
-
MC.remove(this.target, key);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
75
|
/*
|
|
84
76
|
helper methods
|
|
85
77
|
*/
|
|
@@ -134,11 +126,35 @@ export class MC {
|
|
|
134
126
|
return element && element instanceof HTMLElement;
|
|
135
127
|
}
|
|
136
128
|
|
|
129
|
+
/*
|
|
130
|
+
Methods to handle private MCs
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
// add a microcomponent to the private microcomponent collection
|
|
134
|
+
add( key?: string, element: any = {} ): any {
|
|
135
|
+
|
|
136
|
+
// add the element
|
|
137
|
+
if ( key ){
|
|
138
|
+
this.privateMCs[key] = element; // also the first element in the private MC collection
|
|
139
|
+
}
|
|
140
|
+
return element;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// remove a micro component from the private microcomponent collection
|
|
144
|
+
remove(key: string): void {
|
|
145
|
+
|
|
146
|
+
// remove the component from the private collection
|
|
147
|
+
if (key in this.privateMCs) {
|
|
148
|
+
delete this.privateMCs[key];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
|
|
137
153
|
/*
|
|
138
154
|
selector methods, non-chainable
|
|
139
155
|
*/
|
|
140
156
|
|
|
141
|
-
// all
|
|
157
|
+
// all private collection members
|
|
142
158
|
siblings(search?: string): any[] {
|
|
143
159
|
if ( this.target ){
|
|
144
160
|
if ( this.target instanceof HTMLElement === true ){
|