@twobirds/microcomponents 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MC.js +1 -1
- package/dist/MC.min.js +34 -53
- package/dist/MC.ts +3 -3
- package/dist/elements.min.js +1 -1
- package/dist/formValues.min.js +1 -1
- package/dist/microcomponents.min.js +1 -1
- package/dist/observables.min.js +1 -1
- package/package.json +11 -2
- package/.gitlab-ci.yml +0 -18
- package/.vscode/settings.json +0 -3
- package/MicroComponents.svg +0 -15
- package/assets/documentation/MC.md +0 -547
- package/assets/documentation/MicroComponents.svg +0 -15
- package/assets/documentation/ajaxian-1.png +0 -0
- package/assets/documentation/ajaxian-2.png +0 -0
- package/assets/documentation/ajaxian-3.png +0 -0
- package/assets/documentation/elements.md +0 -277
- package/assets/documentation/formvalues.md +0 -25
- package/assets/documentation/functional_requirements.md +0 -8
- package/assets/documentation/history.md +0 -436
- package/assets/documentation/klemmstein.png +0 -0
- package/assets/documentation/magic.md +0 -29
- package/assets/documentation/observables.md +0 -187
- package/assets/documentation/rnd0023-1.jpg +0 -0
- package/assets/documentation/rnd0023-2.jpg +0 -0
- package/assets/documentation/rnd0023-3.jpg +0 -0
- package/assets/documentation/tB_react.md +0 -207
- package/assets/documentation/usage.md +0 -142
- package/assets/documentation/why.md +0 -25
- package/assets/fiddle/MicroComponents.svg +0 -15
- package/assets/fiddle/fiddle.css +0 -0
- package/assets/fiddle/fiddle.js +0 -0
- package/assets/fiddle/index.html +0 -0
- package/assets/test/MicroComponents.svg +0 -15
- package/assets/test/grandparent.css +0 -16
- package/assets/test/myButton.css +0 -19
- package/assets/test/style.css +0 -8
- package/assets/test/test.html +0 -29
- package/assets/test/testform.json +0 -27
- package/public/.nojekyll +0 -1
- package/public/MC.d.ts +0 -39
- package/public/MC.d.ts.map +0 -1
- package/public/MC.js +0 -287
- package/public/MC.js.map +0 -1
- package/public/MC.min.js +0 -348
- package/public/MC.ts +0 -431
- package/public/MicroComponents.svg +0 -15
- package/public/documentation/MC.md +0 -547
- package/public/documentation/MicroComponents.svg +0 -15
- package/public/documentation/ajaxian-1.png +0 -0
- package/public/documentation/ajaxian-2.png +0 -0
- package/public/documentation/ajaxian-3.png +0 -0
- package/public/documentation/elements.md +0 -277
- package/public/documentation/formvalues.md +0 -25
- package/public/documentation/functional_requirements.md +0 -8
- package/public/documentation/history.md +0 -436
- package/public/documentation/klemmstein.png +0 -0
- package/public/documentation/magic.md +0 -29
- package/public/documentation/observables.md +0 -187
- package/public/documentation/rnd0023-1.jpg +0 -0
- package/public/documentation/rnd0023-2.jpg +0 -0
- package/public/documentation/rnd0023-3.jpg +0 -0
- package/public/documentation/tB_react.md +0 -207
- package/public/documentation/usage.md +0 -142
- package/public/documentation/why.md +0 -25
- package/public/elements.d.ts +0 -5
- package/public/elements.d.ts.map +0 -1
- package/public/elements.js +0 -68
- package/public/elements.js.map +0 -1
- package/public/elements.min.js +0 -1
- package/public/elements.ts +0 -119
- package/public/fiddle/MicroComponents.svg +0 -15
- package/public/fiddle/fiddle.css +0 -0
- package/public/fiddle/fiddle.js +0 -0
- package/public/fiddle/index.html +0 -0
- package/public/formValues.d.ts +0 -3
- package/public/formValues.d.ts.map +0 -1
- package/public/formValues.js +0 -162
- package/public/formValues.js.map +0 -1
- package/public/formValues.min.js +0 -1
- package/public/formValues.ts +0 -225
- package/public/helpers.d.ts +0 -14
- package/public/helpers.d.ts.map +0 -1
- package/public/helpers.js +0 -113
- package/public/helpers.js.map +0 -1
- package/public/helpers.ts +0 -149
- package/public/microcomponents.d.ts +0 -6
- package/public/microcomponents.d.ts.map +0 -1
- package/public/microcomponents.js +0 -7
- package/public/microcomponents.js.map +0 -1
- package/public/microcomponents.min.js +0 -1
- package/public/microcomponents.ts +0 -8
- package/public/observables.d.ts +0 -11
- package/public/observables.d.ts.map +0 -1
- package/public/observables.js +0 -244
- package/public/observables.js.map +0 -1
- package/public/observables.min.js +0 -1
- package/public/observables.ts +0 -416
- package/public/selectors._ts +0 -1269
- package/public/src/MC.d.ts +0 -39
- package/public/src/MC.d.ts.map +0 -1
- package/public/src/MC.js +0 -287
- package/public/src/MC.js.map +0 -1
- package/public/src/MC.ts +0 -431
- package/public/src/elements.d.ts +0 -5
- package/public/src/elements.d.ts.map +0 -1
- package/public/src/elements.js +0 -68
- package/public/src/elements.js.map +0 -1
- package/public/src/elements.ts +0 -119
- package/public/src/formValues.d.ts +0 -3
- package/public/src/formValues.d.ts.map +0 -1
- package/public/src/formValues.js +0 -162
- package/public/src/formValues.js.map +0 -1
- package/public/src/formValues.ts +0 -225
- package/public/src/helpers.d.ts +0 -14
- package/public/src/helpers.d.ts.map +0 -1
- package/public/src/helpers.js +0 -113
- package/public/src/helpers.js.map +0 -1
- package/public/src/helpers.ts +0 -149
- package/public/src/microcomponents.d.ts +0 -6
- package/public/src/microcomponents.d.ts.map +0 -1
- package/public/src/microcomponents.js +0 -7
- package/public/src/microcomponents.js.map +0 -1
- package/public/src/microcomponents.ts +0 -8
- package/public/src/observables.d.ts +0 -11
- package/public/src/observables.d.ts.map +0 -1
- package/public/src/observables.js +0 -244
- package/public/src/observables.js.map +0 -1
- package/public/src/observables.ts +0 -416
- package/public/src/selectors._ts +0 -1269
- package/public/src/test/grandparent.css +0 -14
- package/public/src/test/test/child.d.ts +0 -2
- package/public/src/test/test/child.d.ts.map +0 -1
- package/public/src/test/test/child.js +0 -26
- package/public/src/test/test/child.js.map +0 -1
- package/public/src/test/test/child.ts +0 -36
- package/public/src/test/test/grandchild.d.ts +0 -2
- package/public/src/test/test/grandchild.d.ts.map +0 -1
- package/public/src/test/test/grandchild.js +0 -22
- package/public/src/test/test/grandchild.js.map +0 -1
- package/public/src/test/test/grandchild.ts +0 -31
- package/public/src/test/test/grandparent.d.ts +0 -2
- package/public/src/test/test/grandparent.d.ts.map +0 -1
- package/public/src/test/test/grandparent.js +0 -1
- package/public/src/test/test/grandparent.js.map +0 -1
- package/public/src/test/test/grandparent.ts +0 -43
- package/public/src/test/test/greatgrandchild.d.ts +0 -2
- package/public/src/test/test/greatgrandchild.d.ts.map +0 -1
- package/public/src/test/test/greatgrandchild.js +0 -36
- package/public/src/test/test/greatgrandchild.js.map +0 -1
- package/public/src/test/test/greatgrandchild.ts +0 -51
- package/public/src/test/test/parent.d.ts +0 -2
- package/public/src/test/test/parent.d.ts.map +0 -1
- package/public/src/test/test/parent.js +0 -25
- package/public/src/test/test/parent.js.map +0 -1
- package/public/src/test/test/parent.ts +0 -35
- package/public/src/test/test/testform.d.ts +0 -2
- package/public/src/test/test/testform.d.ts.map +0 -1
- package/public/src/test/test/testform.js +0 -1
- package/public/src/test/test/testform.js.map +0 -1
- package/public/src/test/test/testform.ts +0 -153
- package/public/src/test/test/testfunction.d.ts +0 -3
- package/public/src/test/test/testfunction.d.ts.map +0 -1
- package/public/src/test/test/testfunction.js +0 -7
- package/public/src/test/test/testfunction.js.map +0 -1
- package/public/src/test/test/testfunction.ts +0 -12
- package/public/src/test/test/testmc.d.ts +0 -3
- package/public/src/test/test/testmc.d.ts.map +0 -1
- package/public/src/test/test/testmc.js +0 -10
- package/public/src/test/test/testmc.js.map +0 -1
- package/public/src/test/test/testmc.ts +0 -16
- package/public/src/test/test/testsimpleclass.d.ts +0 -3
- package/public/src/test/test/testsimpleclass.d.ts.map +0 -1
- package/public/src/test/test/testsimpleclass.js +0 -9
- package/public/src/test/test/testsimpleclass.js.map +0 -1
- package/public/src/test/test/testsimpleclass.ts +0 -15
- package/public/src/test/test.d.ts +0 -2
- package/public/src/test/test.d.ts.map +0 -1
- package/public/src/test/test.js +0 -72
- package/public/src/test/test.js.map +0 -1
- package/public/src/test/test.ts +0 -176
- package/public/src/test/testform.css +0 -47
- package/public/src/test/testform.html +0 -56
- package/public/src/test/testform.json +0 -27
- package/public/test/MC.d.ts +0 -39
- package/public/test/MC.d.ts.map +0 -1
- package/public/test/MC.js +0 -287
- package/public/test/MC.min.js +0 -348
- package/public/test/MC.ts +0 -431
- package/public/test/MicroComponents.svg +0 -15
- package/public/test/elements.d.ts +0 -5
- package/public/test/elements.d.ts.map +0 -1
- package/public/test/elements.js +0 -68
- package/public/test/elements.min.js +0 -1
- package/public/test/elements.ts +0 -119
- package/public/test/formValues.d.ts +0 -3
- package/public/test/formValues.d.ts.map +0 -1
- package/public/test/formValues.js +0 -162
- package/public/test/formValues.min.js +0 -1
- package/public/test/formValues.ts +0 -225
- package/public/test/grandparent.css +0 -14
- package/public/test/helpers.d.ts +0 -14
- package/public/test/helpers.d.ts.map +0 -1
- package/public/test/helpers.js +0 -113
- package/public/test/helpers.ts +0 -149
- package/public/test/microcomponents.d.ts +0 -6
- package/public/test/microcomponents.d.ts.map +0 -1
- package/public/test/microcomponents.js +0 -7
- package/public/test/microcomponents.min.js +0 -1
- package/public/test/microcomponents.ts +0 -8
- package/public/test/myButton.css +0 -19
- package/public/test/observables.d.ts +0 -11
- package/public/test/observables.d.ts.map +0 -1
- package/public/test/observables.js +0 -244
- package/public/test/observables.min.js +0 -1
- package/public/test/observables.ts +0 -416
- package/public/test/style.css +0 -8
- package/public/test/test/child.d.ts +0 -2
- package/public/test/test/child.d.ts.map +0 -1
- package/public/test/test/child.js +0 -26
- package/public/test/test/child.js.map +0 -1
- package/public/test/test/child.ts +0 -36
- package/public/test/test/grandchild.d.ts +0 -2
- package/public/test/test/grandchild.d.ts.map +0 -1
- package/public/test/test/grandchild.js +0 -22
- package/public/test/test/grandchild.js.map +0 -1
- package/public/test/test/grandchild.ts +0 -31
- package/public/test/test/grandparent.d.ts +0 -2
- package/public/test/test/grandparent.d.ts.map +0 -1
- package/public/test/test/grandparent.js +0 -1
- package/public/test/test/grandparent.js.map +0 -1
- package/public/test/test/grandparent.ts +0 -43
- package/public/test/test/greatgrandchild.d.ts +0 -2
- package/public/test/test/greatgrandchild.d.ts.map +0 -1
- package/public/test/test/greatgrandchild.js +0 -36
- package/public/test/test/greatgrandchild.js.map +0 -1
- package/public/test/test/greatgrandchild.ts +0 -51
- package/public/test/test/parent.d.ts +0 -2
- package/public/test/test/parent.d.ts.map +0 -1
- package/public/test/test/parent.js +0 -25
- package/public/test/test/parent.js.map +0 -1
- package/public/test/test/parent.ts +0 -35
- package/public/test/test/testform.d.ts +0 -2
- package/public/test/test/testform.d.ts.map +0 -1
- package/public/test/test/testform.js +0 -1
- package/public/test/test/testform.js.map +0 -1
- package/public/test/test/testform.ts +0 -153
- package/public/test/test/testfunction.d.ts +0 -3
- package/public/test/test/testfunction.d.ts.map +0 -1
- package/public/test/test/testfunction.js +0 -7
- package/public/test/test/testfunction.js.map +0 -1
- package/public/test/test/testfunction.ts +0 -12
- package/public/test/test/testmc.d.ts +0 -3
- package/public/test/test/testmc.d.ts.map +0 -1
- package/public/test/test/testmc.js +0 -10
- package/public/test/test/testmc.js.map +0 -1
- package/public/test/test/testmc.ts +0 -16
- package/public/test/test/testsimpleclass.d.ts +0 -3
- package/public/test/test/testsimpleclass.d.ts.map +0 -1
- package/public/test/test/testsimpleclass.js +0 -9
- package/public/test/test/testsimpleclass.js.map +0 -1
- package/public/test/test/testsimpleclass.ts +0 -15
- package/public/test/test.d.ts +0 -2
- package/public/test/test.d.ts.map +0 -1
- package/public/test/test.html +0 -29
- package/public/test/test.js +0 -72
- package/public/test/test.js.map +0 -1
- package/public/test/test.ts +0 -176
- package/public/test/testform.css +0 -47
- package/public/test/testform.html +0 -56
- package/public/test/testform.json +0 -27
- package/public/typedoc/.nojekyll +0 -1
- package/public/typedoc/assets/highlight.css +0 -106
- package/public/typedoc/assets/icons.js +0 -18
- package/public/typedoc/assets/icons.svg +0 -1
- package/public/typedoc/assets/main.js +0 -60
- package/public/typedoc/assets/navigation.js +0 -1
- package/public/typedoc/assets/search.js +0 -1
- package/public/typedoc/assets/style.css +0 -1493
- package/public/typedoc/classes/MC.DC.html +0 -13
- package/public/typedoc/classes/MC.MC.html +0 -3
- package/public/typedoc/classes/MC.McBase.html +0 -3
- package/public/typedoc/functions/MC.autoload.html +0 -1
- package/public/typedoc/functions/MC.off.html +0 -1
- package/public/typedoc/functions/MC.on.html +0 -1
- package/public/typedoc/functions/MC.one.html +0 -1
- package/public/typedoc/functions/MC.trigger.html +0 -1
- package/public/typedoc/functions/elements.defineCE.html +0 -1
- package/public/typedoc/functions/elements.getCE.html +0 -1
- package/public/typedoc/functions/formValues.formValues.html +0 -1
- package/public/typedoc/functions/observables.observe.html +0 -1
- package/public/typedoc/hierarchy.html +0 -1
- package/public/typedoc/index.html +0 -122
- package/public/typedoc/interfaces/MC.HTMLMcElement.html +0 -758
- package/public/typedoc/media/MicroComponents.svg +0 -15
- package/public/typedoc/modules/MC.html +0 -10
- package/public/typedoc/modules/elements.html +0 -3
- package/public/typedoc/modules/formValues.html +0 -2
- package/public/typedoc/modules/observables.html +0 -3
- package/public/typedoc/modules.html +0 -5
- package/public/typedoc/types/observables.Observable.html +0 -1
- package/src/MC.ts +0 -431
- package/src/elements.ts +0 -119
- package/src/formValues.ts +0 -225
- package/src/helpers.ts +0 -149
- package/src/microcomponents.ts +0 -8
- package/src/observables.ts +0 -416
- package/src/selectors._ts +0 -1269
- package/src/test/grandparent.css +0 -14
- package/src/test/test/child.ts +0 -36
- package/src/test/test/grandchild.ts +0 -31
- package/src/test/test/grandparent.ts +0 -43
- package/src/test/test/greatgrandchild.ts +0 -51
- package/src/test/test/parent.ts +0 -35
- package/src/test/test/testform.ts +0 -153
- package/src/test/test/testfunction.ts +0 -12
- package/src/test/test/testmc.ts +0 -16
- package/src/test/test/testsimpleclass.ts +0 -15
- package/src/test/test.ts +0 -176
- package/src/test/testform.css +0 -47
- package/src/test/testform.html +0 -56
- package/src/test/testform.json +0 -27
- package/tasks.md +0 -36
- package/tsconfig.json +0 -107
- package/typedoc.json +0 -7
- package/webpack.config.js +0 -346
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineCE, getCE } from '../../microcomponents.js';
|
|
2
|
-
|
|
3
|
-
console.log( 'testfunction.ts' );
|
|
4
|
-
|
|
5
|
-
defineCE(
|
|
6
|
-
'test-testfunction',
|
|
7
|
-
function testfunction( a: number, b:number ){
|
|
8
|
-
return a + b;
|
|
9
|
-
}
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
export default getCE( 'test-testfunction' );
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testmc.d.ts","sourceRoot":"","sources":["../../../src/test/test/testmc.ts"],"names":[],"mappings":";AAeA,wBAAsC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineCE, getCE, DC } from '../../microcomponents.js';
|
|
2
|
-
defineCE('test-testmc', class TestMc extends DC {
|
|
3
|
-
constructor(target) {
|
|
4
|
-
super(target);
|
|
5
|
-
}
|
|
6
|
-
oneInit() {
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
export default getCE('test-testmc');
|
|
10
|
-
//# sourceMappingURL=testmc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testmc.js","sourceRoot":"","sources":["../../../src/test/test/testmc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE/D,QAAQ,CACJ,aAAa,EACb,MAAM,MAAO,SAAQ,EAAE;IACnB,YAAY,MAAmB;QAC3B,KAAK,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAED,OAAO;IAEP,CAAC;CACJ,CACJ,CAAC;AAEF,eAAe,KAAK,CAAE,aAAa,CAAE,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineCE, getCE, DC } from '../../microcomponents.js';
|
|
2
|
-
|
|
3
|
-
defineCE(
|
|
4
|
-
'test-testmc',
|
|
5
|
-
class TestMc extends DC {
|
|
6
|
-
constructor(target: HTMLElement) {
|
|
7
|
-
super(target);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
oneInit() {
|
|
11
|
-
// console.log('testmc connected to DOM');
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
export default getCE( 'test-testmc' );
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testsimpleclass.d.ts","sourceRoot":"","sources":["../../../src/test/test/testsimpleclass.ts"],"names":[],"mappings":";AAcA,wBAA+C"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineCE, getCE } from '../../microcomponents.js';
|
|
2
|
-
defineCE('test-testsimpleclass', class TestSimpleClass {
|
|
3
|
-
constructor(target) {
|
|
4
|
-
}
|
|
5
|
-
oneInit() {
|
|
6
|
-
}
|
|
7
|
-
});
|
|
8
|
-
export default getCE('test-testsimpleclass');
|
|
9
|
-
//# sourceMappingURL=testsimpleclass.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testsimpleclass.js","sourceRoot":"","sources":["../../../src/test/test/testsimpleclass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAM,MAAM,0BAA0B,CAAC;AAE/D,QAAQ,CACJ,sBAAsB,EACtB,MAAM,eAAe;IACjB,YAAY,MAAmB;IAC/B,CAAC;IAED,OAAO;IAEP,CAAC;CACJ,CACJ,CAAC;AAEF,eAAe,KAAK,CAAE,sBAAsB,CAAE,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineCE, getCE, DC } from '../../microcomponents.js';
|
|
2
|
-
|
|
3
|
-
defineCE(
|
|
4
|
-
'test-testsimpleclass',
|
|
5
|
-
class TestSimpleClass {
|
|
6
|
-
constructor(target: HTMLElement) {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
oneInit() {
|
|
10
|
-
// console.log('testmc connected to DOM');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
export default getCE( 'test-testsimpleclass' );
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/test/test.ts"],"names":[],"mappings":""}
|
package/public/src/test/test.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { DC, defineCE, getCE, observe, } from '../microcomponents.js';
|
|
2
|
-
class Translator extends DC {
|
|
3
|
-
#translations = {};
|
|
4
|
-
Language = 'en';
|
|
5
|
-
Translation = {};
|
|
6
|
-
constructor(target, translations, translationTargetObject) {
|
|
7
|
-
super(target);
|
|
8
|
-
let that = this;
|
|
9
|
-
that.Language = 'en';
|
|
10
|
-
that.Translation = {};
|
|
11
|
-
observe(that);
|
|
12
|
-
that.#translations = translations;
|
|
13
|
-
that.Language.observe((lang) => {
|
|
14
|
-
if (that.#translations.hasOwnProperty(lang)) {
|
|
15
|
-
that.Translation = { lang: that.#translations[lang] };
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
that.Translation.bind(translationTargetObject);
|
|
19
|
-
that.Language.notify();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
class MyButton extends DC {
|
|
23
|
-
#template = '{lang.click} {counter}';
|
|
24
|
-
#languages = {
|
|
25
|
-
en: {
|
|
26
|
-
click: 'click me',
|
|
27
|
-
},
|
|
28
|
-
de: {
|
|
29
|
-
click: 'klick mich',
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
Dom = {};
|
|
33
|
-
constructor(target) {
|
|
34
|
-
super(target);
|
|
35
|
-
target.innerHTML = this.#template;
|
|
36
|
-
this.Dom = { counter: 0 };
|
|
37
|
-
observe(this);
|
|
38
|
-
DC.add(target, 'Translator', new Translator(target, this.#languages, target));
|
|
39
|
-
this.Dom.bind(this.target);
|
|
40
|
-
}
|
|
41
|
-
onClick(ev) {
|
|
42
|
-
const c = this.Dom.counter++;
|
|
43
|
-
ev.stopPropagation();
|
|
44
|
-
this.target.classList.remove('clicked');
|
|
45
|
-
this.target.classList.add(this.Dom.counter > 9 ? 'overClicked' : 'clicked');
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
function makeButton() {
|
|
49
|
-
const button = document.createElement('button');
|
|
50
|
-
button.classList.add('myButton');
|
|
51
|
-
DC.add(button, 'MyButton', new MyButton(button));
|
|
52
|
-
return button;
|
|
53
|
-
}
|
|
54
|
-
defineCE('make-button', makeButton);
|
|
55
|
-
let fragment = new DocumentFragment();
|
|
56
|
-
let start = new Date().getTime(), max = 1000;
|
|
57
|
-
for (let x = 0; x < max; x++) {
|
|
58
|
-
fragment.append(getCE('make-button')());
|
|
59
|
-
}
|
|
60
|
-
let end = new Date().getTime();
|
|
61
|
-
document.body.appendChild(fragment);
|
|
62
|
-
setTimeout(() => {
|
|
63
|
-
console.log('%c \n\nStress Test:\n\n %cInstancing %s buttons containing %s MCs: %c %s ms.', 'font-weight: bold; color: black;', 'font-weight: normal;', max, max * 3, 'font-weight: bold; color: orange;', end - start);
|
|
64
|
-
let element = document.querySelector('button');
|
|
65
|
-
console.log("\n\n%cInspect this tag:%c \n( ...to see the inner structure in the '._mc' property )\n\n %O %c %s", 'font-weight: bold;', 'font-weight: normal;', element, 'font-weight: bold;', '\n\nLook up code in the debugger: test.js\n');
|
|
66
|
-
let form = document.querySelector('test-testform');
|
|
67
|
-
let formInstance = form._mc.TestTestform;
|
|
68
|
-
window.form = formInstance;
|
|
69
|
-
console.log("\n\n%cAttached a global variable 'form':%c \n\n %O %c %s %c %s %c %s", 'font-weight: bold;', 'font-weight: normal;', formInstance, 'font-weight: bold;', '\n\nYou can use it to change input values, e.g. \n\n', 'font-weight: normal;', ' form.data.textInput="other value"', 'font-weight: bold;', '\n\nChanges will be reflected in the form contents, same as vice versa.\n');
|
|
70
|
-
element._mc?.trigger('doSomething');
|
|
71
|
-
}, 1000);
|
|
72
|
-
//# sourceMappingURL=test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/test/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,EAAE,EACF,QAAQ,EACR,KAAK,EACL,OAA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js';
|
|
10
|
-
|
|
11
|
-
class Translator extends DC {
|
|
12
|
-
#translations: LooseObject = {};
|
|
13
|
-
|
|
14
|
-
Language: unknown = 'en';
|
|
15
|
-
Translation: unknown = {};
|
|
16
|
-
|
|
17
|
-
constructor(
|
|
18
|
-
target: HTMLElement | ShadowRoot | DocumentFragment,
|
|
19
|
-
translations: LooseObject,
|
|
20
|
-
translationTargetObject: HTMLElement
|
|
21
|
-
) {
|
|
22
|
-
super(target as HTMLElement);
|
|
23
|
-
let that = this; // minifier help
|
|
24
|
-
|
|
25
|
-
// state
|
|
26
|
-
that.Language = 'en';
|
|
27
|
-
that.Translation = {};
|
|
28
|
-
|
|
29
|
-
observe(that);
|
|
30
|
-
|
|
31
|
-
// setup
|
|
32
|
-
that.#translations = translations;
|
|
33
|
-
|
|
34
|
-
// on language change switch translation object
|
|
35
|
-
(that.Language as Observable).observe((lang) => {
|
|
36
|
-
if (that.#translations.hasOwnProperty(lang)) {
|
|
37
|
-
that.Translation = { lang: that.#translations[lang] }; // set translation
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
(that.Translation as Observable).bind(translationTargetObject);
|
|
42
|
-
|
|
43
|
-
(that.Language as Observable).notify();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
class MyButton extends DC {
|
|
49
|
-
#template: string = '{lang.click} {counter}';
|
|
50
|
-
|
|
51
|
-
#languages = {
|
|
52
|
-
en: {
|
|
53
|
-
click: 'click me',
|
|
54
|
-
},
|
|
55
|
-
de: {
|
|
56
|
-
click: 'klick mich',
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
Dom: LooseObject = {};
|
|
61
|
-
|
|
62
|
-
constructor(target: HTMLElement) {
|
|
63
|
-
super(target);
|
|
64
|
-
|
|
65
|
-
// render
|
|
66
|
-
target.innerHTML = this.#template;
|
|
67
|
-
|
|
68
|
-
// state
|
|
69
|
-
this.Dom = { counter: 0 };
|
|
70
|
-
|
|
71
|
-
// state: convert all props defined so far into observables
|
|
72
|
-
observe(this);
|
|
73
|
-
|
|
74
|
-
// add translator
|
|
75
|
-
DC.add(
|
|
76
|
-
target,
|
|
77
|
-
'Translator',
|
|
78
|
-
new Translator(target, this.#languages, target)
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
// bind Dom to target
|
|
82
|
-
(this.Dom as Observable).bind(this.target);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
onClick(ev: Event) {
|
|
86
|
-
// console.log('button.myButton onClick()');
|
|
87
|
-
const c = this.Dom.counter++;
|
|
88
|
-
ev.stopPropagation();
|
|
89
|
-
(this.target as HTMLElement).classList.remove('clicked');
|
|
90
|
-
(this.target as HTMLElement).classList.add( this.Dom.counter > 9 ? 'overClicked' : 'clicked' );
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function makeButton(): HTMLMcElement {
|
|
95
|
-
const button = document.createElement('button');
|
|
96
|
-
button.classList.add('myButton');
|
|
97
|
-
DC.add( button, 'MyButton', new MyButton(button) );
|
|
98
|
-
return button as unknown as HTMLMcElement;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
defineCE(
|
|
102
|
-
'make-button',
|
|
103
|
-
makeButton
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
let fragment = new DocumentFragment();
|
|
107
|
-
|
|
108
|
-
/*
|
|
109
|
-
stress test
|
|
110
|
-
*/
|
|
111
|
-
|
|
112
|
-
let start = new Date().getTime(),
|
|
113
|
-
max = 1000;
|
|
114
|
-
|
|
115
|
-
// create 1000 elements
|
|
116
|
-
for (let x = 0; x < max; x++) {
|
|
117
|
-
fragment.append( (getCE('make-button') as Function)());
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
let end = new Date().getTime();
|
|
121
|
-
|
|
122
|
-
// and put them into the DOM
|
|
123
|
-
document.body.appendChild(fragment);
|
|
124
|
-
|
|
125
|
-
//document.querySelectorAll('my-tag').forEach((e) => e.remove());
|
|
126
|
-
|
|
127
|
-
/*
|
|
128
|
-
console test
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
setTimeout(() => {
|
|
132
|
-
// console.clear();
|
|
133
|
-
|
|
134
|
-
console.log(
|
|
135
|
-
'%c \n\nStress Test:\n\n %cInstancing %s buttons containing %s MCs: %c %s ms.',
|
|
136
|
-
'font-weight: bold; color: black;',
|
|
137
|
-
'font-weight: normal;',
|
|
138
|
-
max,
|
|
139
|
-
max * 3,
|
|
140
|
-
'font-weight: bold; color: orange;',
|
|
141
|
-
end - start
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
//document.body.appendChild(new MyTag());
|
|
145
|
-
|
|
146
|
-
let element = document.querySelector('button');
|
|
147
|
-
|
|
148
|
-
console.log(
|
|
149
|
-
"\n\n%cInspect this tag:%c \n( ...to see the inner structure in the '._mc' property )\n\n %O %c %s",
|
|
150
|
-
'font-weight: bold;',
|
|
151
|
-
'font-weight: normal;',
|
|
152
|
-
element,
|
|
153
|
-
'font-weight: bold;',
|
|
154
|
-
'\n\nLook up code in the debugger: test.js\n'
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
let form = ( document.querySelector('test-testform') as any);
|
|
158
|
-
let formInstance = form._mc.TestTestform;
|
|
159
|
-
|
|
160
|
-
(window as any).form = formInstance;
|
|
161
|
-
console.log(
|
|
162
|
-
"\n\n%cAttached a global variable 'form':%c \n\n %O %c %s %c %s %c %s",
|
|
163
|
-
'font-weight: bold;',
|
|
164
|
-
'font-weight: normal;',
|
|
165
|
-
formInstance,
|
|
166
|
-
'font-weight: bold;',
|
|
167
|
-
'\n\nYou can use it to change input values, e.g. \n\n',
|
|
168
|
-
'font-weight: normal;',
|
|
169
|
-
' form.data.textInput="other value"',
|
|
170
|
-
'font-weight: bold;',
|
|
171
|
-
'\n\nChanges will be reflected in the form contents, same as vice versa.\n'
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
// will trigger the event on all micro components contained in <my-tag>
|
|
175
|
-
( element as unknown as HTMLMcElement )._mc?.trigger('doSomething');
|
|
176
|
-
}, 1000);
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
legend {
|
|
2
|
-
display: inherit;
|
|
3
|
-
margin: inherit;
|
|
4
|
-
vertical-align: inherit;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
label {
|
|
8
|
-
display: inline;
|
|
9
|
-
margin-top: 5px;
|
|
10
|
-
margin-left: 5px;
|
|
11
|
-
vertical-align: top;
|
|
12
|
-
width: 10em;
|
|
13
|
-
text-align: right;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
label::before {
|
|
17
|
-
content: ' ';
|
|
18
|
-
display: block;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
form input,
|
|
22
|
-
form select,
|
|
23
|
-
form textarea {
|
|
24
|
-
margin-left: 5px;
|
|
25
|
-
margin-top: 0px;
|
|
26
|
-
display: inline;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
form label + textarea {
|
|
30
|
-
display: inline-block;
|
|
31
|
-
margin-top: 3px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
form input + label {
|
|
35
|
-
width: inherit;
|
|
36
|
-
margin-top: 3px;
|
|
37
|
-
text-align: left;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
body > form {
|
|
41
|
-
display: block;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
form fieldset {
|
|
45
|
-
border: 1px solid darkslategrey;
|
|
46
|
-
border-radius: 3px;
|
|
47
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<!-- test form -->
|
|
2
|
-
<fieldset>
|
|
3
|
-
<legend>Inputs</legend>
|
|
4
|
-
<label>text</label><input type="text" name="textInput" value="" /> <strong>2wB: </strong>{textInput}
|
|
5
|
-
<label>color</label><input type="color" name="colorInput" value="" />
|
|
6
|
-
<label>date</label><input type="date" name="dateInput" value="" />
|
|
7
|
-
<label>datetime-local</label><input type="datetime-local" name="dtlInput" value="" />
|
|
8
|
-
<label>email</label><input type="email" name="email" value="" />
|
|
9
|
-
<label>file</label><input type="file" name="fileInput" value="" />
|
|
10
|
-
<label>hidden</label><input type="hidden" name="hiddenInput" value="hiddenVal" />
|
|
11
|
-
<label>month</label><input type="month" name="month" value="" />
|
|
12
|
-
<label>number</label><input type="number" name="number" value="" />
|
|
13
|
-
<label>password</label><input type="password" name="passInput" value="" />
|
|
14
|
-
<label>range</label><input type="range" name="rangeInput" value="" />
|
|
15
|
-
<label>search</label><input type="search" name="searchInput" value="" />
|
|
16
|
-
<label>tel</label><input type="tel" name="telInput" value="" />
|
|
17
|
-
<label>time</label><input type="time" name="timeInput" value="" />
|
|
18
|
-
<label>url</label><input type="url" name="urlInput" value="" />
|
|
19
|
-
<label>week</label><input type="week" name="weekInput" value="" />
|
|
20
|
-
</fieldset>
|
|
21
|
-
<fieldset>
|
|
22
|
-
<legend>Selects</legend>
|
|
23
|
-
<label>singleSelect</label>
|
|
24
|
-
<select name="singleSelect">
|
|
25
|
-
<option disabled selected value> -- select -- </option>
|
|
26
|
-
<option value="1">Option 1</option>
|
|
27
|
-
<option value="2">Option 2</option>
|
|
28
|
-
<option value="3">Option 3</option>
|
|
29
|
-
<option value="4">Option 4</option>
|
|
30
|
-
</select>
|
|
31
|
-
<label>multiSelect</label>
|
|
32
|
-
<select name="multiSelect" multiple="multiple" type="select-multiple">
|
|
33
|
-
<option value="1">Option 1</option>
|
|
34
|
-
<option value="2" selected=true>Option 2</option>
|
|
35
|
-
<option value="3">Option 3</option>
|
|
36
|
-
<option value="4" selected=true>Option 4</option>
|
|
37
|
-
</select>
|
|
38
|
-
</fieldset>
|
|
39
|
-
<fieldset>
|
|
40
|
-
<legend>Radiobuttons <strong>2wB: </strong>{myRadio}</legend>
|
|
41
|
-
<label>radio1</label><input type="radio" name="myRadio" value="radio1">
|
|
42
|
-
<label>radio2</label><input type="radio" name="myRadio" value="radio2">
|
|
43
|
-
<label>radio3</label><input type="radio" name="myRadio" value="radio3">
|
|
44
|
-
</fieldset>
|
|
45
|
-
<fieldset>
|
|
46
|
-
<legend>Checkboxes</legend>
|
|
47
|
-
<label>cb1</label><input type="checkbox" name="cb1">
|
|
48
|
-
<label>cb2</label><input type="checkbox" name="cb2">
|
|
49
|
-
<label>cb3</label><input type="checkbox" name="cb3">
|
|
50
|
-
<label>cb4</label><input type="checkbox" name="cb4">
|
|
51
|
-
<label>cb5</label><input type="checkbox" name="cb5">
|
|
52
|
-
</fieldset>
|
|
53
|
-
<fieldset>
|
|
54
|
-
<legend>TextArea</legend>
|
|
55
|
-
<label>textArea</label><textarea name="textArea"></textarea>
|
|
56
|
-
</fieldset>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"textInput":"Hallo Welt",
|
|
3
|
-
"colorInput":"#eaf8f8",
|
|
4
|
-
"dateInput":"",
|
|
5
|
-
"dtlInput":"",
|
|
6
|
-
"email":"",
|
|
7
|
-
"hiddenInput":"",
|
|
8
|
-
"hiddenVal":"",
|
|
9
|
-
"month":"",
|
|
10
|
-
"number":"",
|
|
11
|
-
"passInput":"",
|
|
12
|
-
"rangeInput":"30",
|
|
13
|
-
"searchInput":"",
|
|
14
|
-
"telInput":"",
|
|
15
|
-
"timeInput":"",
|
|
16
|
-
"urlInput":"",
|
|
17
|
-
"weekInput":"",
|
|
18
|
-
"myRadio":"radio3",
|
|
19
|
-
"cb1":true,
|
|
20
|
-
"cb2":false,
|
|
21
|
-
"cb3":true,
|
|
22
|
-
"cb4":false,
|
|
23
|
-
"cb5":false,
|
|
24
|
-
"singleSelect":"",
|
|
25
|
-
"multiSelect":["2","4"],
|
|
26
|
-
"textArea":"This is some example\rtext..."
|
|
27
|
-
}
|
package/public/test/MC.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { LooseObject } from './helpers.js';
|
|
2
|
-
export interface HTMLMcElement extends HTMLElement {
|
|
3
|
-
_mc: LooseObject;
|
|
4
|
-
}
|
|
5
|
-
declare function off(domNode: Node, eventName: string, handler: EventListenerOrEventListenerObject): void;
|
|
6
|
-
declare function on(domNode: Node, eventName: string, handler: EventListenerOrEventListenerObject, once?: boolean): EventListenerOrEventListenerObject;
|
|
7
|
-
declare function one(domNode: Node, eventName: string, handler: EventListenerOrEventListenerObject): EventListenerOrEventListenerObject;
|
|
8
|
-
declare class BubbleController {
|
|
9
|
-
stopped: boolean;
|
|
10
|
-
constructor();
|
|
11
|
-
stop(): void;
|
|
12
|
-
}
|
|
13
|
-
declare function trigger(domNode: HTMLElement, event: string, data?: any, bubble?: string, controller?: BubbleController): void;
|
|
14
|
-
declare class McBase {
|
|
15
|
-
private _target;
|
|
16
|
-
constructor(target?: {
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
});
|
|
19
|
-
get target(): any;
|
|
20
|
-
}
|
|
21
|
-
declare class MC extends McBase {
|
|
22
|
-
constructor(target?: any);
|
|
23
|
-
}
|
|
24
|
-
declare class DC extends McBase {
|
|
25
|
-
constructor(target: HTMLElement);
|
|
26
|
-
static add(target: HTMLElement, key: string, element?: any): HTMLMcElement;
|
|
27
|
-
static remove(target: HTMLElement, key: string): void;
|
|
28
|
-
off(eventName: string, handler: EventListenerOrEventListenerObject): void;
|
|
29
|
-
on(eventName: string, handler: EventListenerOrEventListenerObject): EventListenerOrEventListenerObject;
|
|
30
|
-
one(eventName: string, handler: EventListenerOrEventListenerObject): EventListenerOrEventListenerObject;
|
|
31
|
-
trigger(eventName: string, data?: any, bubble?: string, controller?: BubbleController): void;
|
|
32
|
-
ancestors(): DC[] | null;
|
|
33
|
-
closest(): DC | null;
|
|
34
|
-
children(): DC[] | null;
|
|
35
|
-
descendants(): DC[] | null;
|
|
36
|
-
}
|
|
37
|
-
declare function autoload(enable?: boolean): boolean;
|
|
38
|
-
export { McBase, MC, DC, autoload, on, one, off, trigger };
|
|
39
|
-
//# sourceMappingURL=MC.d.ts.map
|
package/public/test/MC.d.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