@twobirds/microcomponents 0.0.64 → 0.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/.vscode/settings.json +1 -1
  2. package/assets/documentation/MC.md +146 -28
  3. package/assets/documentation/elements.md +4 -2
  4. package/assets/documentation/observables.md +2 -0
  5. package/assets/test.html +1 -1
  6. package/dist/MC.d.ts.map +1 -1
  7. package/dist/MC.min.js +20 -15
  8. package/dist/MC.ts +23 -16
  9. package/dist/elements.min.js +1 -1
  10. package/dist/formvValues.min.js +1 -1
  11. package/dist/microcomponents.min.js +1 -1
  12. package/dist/observables.d.ts.map +1 -1
  13. package/dist/observables.min.js +1 -1
  14. package/dist/observables.ts +0 -3
  15. package/dist/selectors.min.js +1 -1
  16. package/package.json +4 -4
  17. package/public/MC.js +20 -15
  18. package/public/MC.js.map +1 -1
  19. package/public/MC.min.js +20 -15
  20. package/public/assets/highlight.css +99 -0
  21. package/public/assets/icons.js +18 -0
  22. package/public/assets/icons.svg +1 -0
  23. package/public/assets/main.js +60 -0
  24. package/public/assets/navigation.js +1 -0
  25. package/public/assets/search.js +1 -0
  26. package/public/assets/style.css +1493 -0
  27. package/public/classes/MC.DC.html +12 -0
  28. package/public/classes/MC.MC.html +6 -0
  29. package/public/classes/MC.McBase.html +3 -0
  30. package/public/classes/MC.McEvent.html +9 -0
  31. package/public/elements.min.js +1 -1
  32. package/public/formvValues.min.js +1 -1
  33. package/public/functions/MC.addListener.html +1 -0
  34. package/public/functions/MC.autoload.html +1 -0
  35. package/public/functions/MC.removeListener.html +1 -0
  36. package/public/functions/elements.defineCE.html +1 -0
  37. package/public/functions/elements.getCE.html +1 -0
  38. package/public/functions/formValues.formValues.html +1 -0
  39. package/public/functions/observables.observe.html +1 -0
  40. package/public/functions/selectors._d.html +1 -0
  41. package/public/functions/selectors._t.html +1 -0
  42. package/public/hierarchy.html +1 -0
  43. package/public/index.html +56 -0
  44. package/public/interfaces/MC.HTMLMcElement.html +758 -0
  45. package/public/interfaces/selectors.DSelector.html +50 -0
  46. package/public/interfaces/selectors.TSelector.html +34 -0
  47. package/public/microcomponents.min.js +1 -1
  48. package/public/modules/MC.html +9 -0
  49. package/public/modules/elements.html +3 -0
  50. package/public/modules/formValues.html +2 -0
  51. package/public/modules/observables.html +3 -0
  52. package/public/modules/selectors.html +7 -0
  53. package/public/modules.html +6 -0
  54. package/public/observables.js.map +1 -1
  55. package/public/observables.min.js +1 -1
  56. package/public/selectors.min.js +1 -1
  57. package/public/types/observables.Observable.html +1 -0
  58. package/public/types/selectors.selection.html +1 -0
  59. package/public/types/selectors.singleSelector.html +1 -0
  60. package/src/MC.ts +23 -16
  61. package/src/observables.ts +0 -3
  62. package/src/test/testmc.ts +7 -1
  63. package/webpack.config.js +2 -2
  64. package/assets/documentation/comparision.md +0 -0
  65. package/assets/documentation/how_tos.md +0 -0
  66. package/assets/documentation/introduction.md +0 -0
  67. package/assets/documentation/proposal_draft.md +0 -37
  68. package/public/3d.html +0 -42
  69. package/public/documentation/MC.md +0 -470
  70. package/public/documentation/ajaxian-1.png +0 -0
  71. package/public/documentation/ajaxian-2.png +0 -0
  72. package/public/documentation/ajaxian-3.png +0 -0
  73. package/public/documentation/comparision.md +0 -0
  74. package/public/documentation/elements.md +0 -276
  75. package/public/documentation/functional_requirements.md +0 -8
  76. package/public/documentation/history.md +0 -436
  77. package/public/documentation/how_tos.md +0 -0
  78. package/public/documentation/introduction.md +0 -0
  79. package/public/documentation/magic.md +0 -29
  80. package/public/documentation/observables.md +0 -105
  81. package/public/documentation/proposal_draft.md +0 -37
  82. package/public/documentation/rnd0023-1.jpg +0 -0
  83. package/public/documentation/rnd0023-2.jpg +0 -0
  84. package/public/documentation/rnd0023-3.jpg +0 -0
  85. package/public/documentation/tB_react.md +0 -207
  86. package/public/documentation/usage.md +0 -142
  87. package/public/documentation/why.md +0 -25
  88. package/public/fiddle/MicroComponents.svg +0 -15
  89. package/public/fiddle/fiddle.css +0 -0
  90. package/public/fiddle/fiddle.js +0 -0
  91. package/public/fiddle/index.html +0 -0
  92. package/public/grandparent.css +0 -13
  93. package/public/my-tag.css +0 -19
  94. package/public/src/MC.ts +0 -598
  95. package/public/src/McEvent.ts +0 -96
  96. package/public/src/autoloader.ts +0 -98
  97. package/public/src/elements.ts +0 -76
  98. package/public/src/formValues.ts +0 -233
  99. package/public/src/helpers.ts +0 -149
  100. package/public/src/microcomponents.ts +0 -8
  101. package/public/src/observables.ts +0 -404
  102. package/public/src/selectors.ts +0 -1634
  103. package/public/src/test.ts +0 -193
  104. package/public/test/child.js +0 -15
  105. package/public/test/child.js.map +0 -1
  106. package/public/test/grandchild.js +0 -15
  107. package/public/test/grandchild.js.map +0 -1
  108. package/public/test/grandparent.js +0 -15
  109. package/public/test/grandparent.js.map +0 -1
  110. package/public/test/greatgrandchild.js +0 -29
  111. package/public/test/greatgrandchild.js.map +0 -1
  112. package/public/test/parent.js +0 -15
  113. package/public/test/parent.js.map +0 -1
  114. package/public/test/testform.js +0 -141
  115. package/public/test/testform.js.map +0 -1
  116. package/public/test/testmc.js +0 -10
  117. package/public/test/testmc.js.map +0 -1
  118. package/public/test.html +0 -27
  119. /package/public/{MicroComponents.svg → media/MicroComponents.svg} +0 -0
@@ -1,193 +0,0 @@
1
- 'use strict';
2
-
3
- import {
4
- LooseObject,
5
- DC,
6
- McEvent,
7
- defineCE,
8
- getCE,
9
- observe,
10
- Observable,
11
- } from './microcomponents.js';
12
-
13
- class Translator extends DC {
14
- #translations: LooseObject = {};
15
-
16
- Language: unknown = 'en';
17
- Translation: unknown = {};
18
-
19
- constructor(
20
- target: HTMLElement | ShadowRoot | DocumentFragment,
21
- translations: LooseObject,
22
- translationTargetObject: HTMLElement
23
- ) {
24
- super(target as HTMLElement);
25
- let that = this; // minifier help
26
-
27
- // state
28
- that.Language = 'en';
29
- that.Translation = {};
30
-
31
- observe(that);
32
-
33
- // setup
34
- that.#translations = translations;
35
-
36
- // state
37
- (that.Language as Observable).observe((lang) => {
38
- if (that.#translations.hasOwnProperty(lang)) {
39
- that.Translation = { lang: that.#translations[lang] }; // set translation
40
- }
41
- });
42
-
43
- (that.Translation as Observable).bind(translationTargetObject);
44
-
45
- that.target.setAttribute('language', 'en');
46
-
47
- (that.Language as Observable).notify();
48
-
49
- delete that._mc; // cleanup, not needed
50
- }
51
-
52
- onAttributeChanged(ev: McEvent) {
53
- if (!ev.data.newValue) return;
54
- switch (ev.data.name) {
55
- case 'language':
56
- this.Language = ev.data.newValue;
57
- break;
58
- }
59
- }
60
- }
61
-
62
- defineCE(
63
- // equivalent to custom element registry .define()
64
- 'my-tag',
65
- class MyTag extends DC {
66
- #template: string = '<button>{lang.click} {counter}</button>';
67
-
68
- #languages = {
69
- en: {
70
- click: 'click me',
71
- },
72
- de: {
73
- click: 'klick mich',
74
- },
75
- };
76
-
77
- Dom: LooseObject = {};
78
-
79
- constructor(target: HTMLElement) {
80
- super(target);
81
-
82
- let that = this; // minifier help
83
-
84
- // render
85
- target.innerHTML = this.#template;
86
-
87
- // add translator
88
- DC.add(
89
- target,
90
- 'translator',
91
- new Translator(target, that.#languages, target)
92
- );
93
-
94
- delete that._mc; // cleanup, not needed
95
- }
96
-
97
- oneInit(ev: McEvent) {
98
- let that = this;
99
-
100
- // state
101
- that.Dom = { counter: 0 };
102
-
103
- // state: convert all props defined so far into observables
104
- observe(that);
105
-
106
- // bind Dom to target
107
- (that.Dom as Observable).bind(that.target);
108
- }
109
-
110
- onClick(ev: McEvent) {
111
- const that = this,
112
- c = that.Dom.counter++;
113
- (ev.data as PointerEvent).stopPropagation();
114
- (that.target as HTMLElement).classList.remove('clicked');
115
- (that.target as HTMLElement).classList.add(
116
- that.Dom.counter > 9 ? 'overClicked' : 'clicked'
117
- );
118
- }
119
- },
120
- ['language']
121
- );
122
-
123
- let MyTag: CustomElementConstructor = getCE('my-tag')!,
124
- fragment = new DocumentFragment();
125
-
126
- /*
127
- stress test
128
- */
129
-
130
- let start = new Date().getTime(),
131
- max = 1000;
132
-
133
- // create 1000 elements
134
- for (let x = 0; x < max; x++) {
135
- fragment.append(new MyTag());
136
- }
137
-
138
- let end = new Date().getTime();
139
-
140
- // and put them into the DOM
141
- document.body.appendChild(fragment);
142
-
143
- //document.querySelectorAll('my-tag').forEach((e) => e.remove());
144
-
145
- /*
146
- console test
147
- */
148
-
149
- setTimeout(() => {
150
- // console.clear();
151
-
152
- console.log(
153
- '%c \n\nStress Test:\n\n %cInstancing %s web components (%s classes): %c %s ms.',
154
- 'font-weight: bold; color: black;',
155
- 'font-weight: normal;',
156
- max,
157
- max * 3,
158
- 'font-weight: bold; color: blue;',
159
- end - start
160
- );
161
-
162
- //document.body.appendChild(new MyTag());
163
-
164
- let element = document.querySelector('my-tag');
165
-
166
- console.log(
167
- "\n\n%cInspect this tag:%c \n( ...to see the inner structure in the '._mc' property )\n\n %O %c %s",
168
- 'font-weight: bold;',
169
- 'font-weight: normal;',
170
- element,
171
- 'font-weight: bold;',
172
- '\n\nLook up code in the debugger: test.js\n'
173
- );
174
-
175
- let form = ( document.querySelector('test-testform') as any);
176
- let formData = form._mc.TestTestform.data;
177
-
178
- console.log(
179
- "\n\n%cRight-click this object and store it as a global variable:%c \n\n %O %c %s %c %s %c %s",
180
- 'font-weight: bold;',
181
- 'font-weight: normal;',
182
- formData,
183
- 'font-weight: bold;',
184
- '\n\nYou can then use e.g. \n\n',
185
- 'font-weight: normal;',
186
- ' temp0.textInput = "whatever"',
187
- 'font-weight: bold;',
188
- '\n\nto change the form contents.\n'
189
- );
190
-
191
- // will trigger the event on all micro components contained in <my-tag>
192
- DC.trigger(element, 'doSomething');
193
- }, 500);
@@ -1,15 +0,0 @@
1
- import { DC, defineCE, getCE } from '.././microcomponents.js';
2
- import { Grandchild } from './grandchild.js';
3
- defineCE('test-child', class TestChild extends DC {
4
- constructor(target) {
5
- super(target);
6
- }
7
- onConnected() {
8
- let that = this;
9
- for (let x = 0; x < 10; x++) {
10
- that.target.append(new Grandchild());
11
- }
12
- }
13
- });
14
- export const Child = getCE('test-child');
15
- //# sourceMappingURL=child.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"child.js","sourceRoot":"","sources":["../../src/test/child.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,QAAQ,CACP,YAAY,EAEZ,MAAM,SAAU,SAAQ,EAAE;IACzB,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAED,WAAW;QACV,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,UAAW,EAAE,CAAC,CAAC;QACvC,CAAC;IACF,CAAC;CACD,CACD,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { DC, defineCE, getCE } from '.././microcomponents.js';
2
- import { Greatgrandchild } from './greatgrandchild.js';
3
- defineCE('test-grandchild', class TestGrandchild extends DC {
4
- constructor(target) {
5
- super(target);
6
- }
7
- onConnected() {
8
- let that = this;
9
- for (let x = 0; x < 2; x++) {
10
- that.target.append(new Greatgrandchild());
11
- }
12
- }
13
- });
14
- export const Grandchild = getCE('test-grandchild');
15
- //# sourceMappingURL=grandchild.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grandchild.js","sourceRoot":"","sources":["../../src/test/grandchild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,QAAQ,CACP,iBAAiB,EAEjB,MAAM,cAAe,SAAQ,EAAE;IAC9B,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAED,WAAW;QACV,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,eAAgB,EAAE,CAAC,CAAC;QAC5C,CAAC;IACF,CAAC;CACD,CACD,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { DC, defineCE, getCE } from '.././microcomponents.js';
2
- import { Parent } from './parent.js';
3
- defineCE('test-grandparent', class TestGrandparent extends DC {
4
- constructor(target) {
5
- super(target);
6
- }
7
- onConnected() {
8
- let that = this;
9
- for (let x = 0; x < 5; x++) {
10
- that.target.append(new Parent());
11
- }
12
- }
13
- });
14
- export const GrandParent = getCE('test-grandparent');
15
- //# sourceMappingURL=grandparent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grandparent.js","sourceRoot":"","sources":["../../src/test/grandparent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,QAAQ,CACP,kBAAkB,EAElB,MAAM,eAAgB,SAAQ,EAAE;IAC/B,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAED,WAAW;QACV,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAO,EAAE,CAAC,CAAC;QACnC,CAAC;IACF,CAAC;CACD,CACD,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC"}
@@ -1,29 +0,0 @@
1
- import { DC, defineCE, getCE } from '.././microcomponents.js';
2
- function random(min, max) {
3
- var random = Math.floor(Math.random() * (max - min + 1) + min);
4
- return random;
5
- }
6
- defineCE('test-greatgrandchild', class TestGreatgrandchild extends DC {
7
- constructor(target) {
8
- super(target);
9
- }
10
- onConnected() {
11
- let that = this;
12
- that.updateStyle();
13
- }
14
- updateStyle() {
15
- var that = this;
16
- function randomBorderColor() {
17
- return ('rgb(' +
18
- random(0, 255) +
19
- ',' +
20
- random(0, 255) +
21
- ',' +
22
- random(0, 255) +
23
- ')');
24
- }
25
- that.target.setAttribute('style', 'border-color:' + randomBorderColor());
26
- }
27
- });
28
- export const Greatgrandchild = getCE('test-greatgrandchild');
29
- //# sourceMappingURL=greatgrandchild.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"greatgrandchild.js","sourceRoot":"","sources":["../../src/test/greatgrandchild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAE9D,SAAS,MAAM,CAAC,GAAW,EAAE,GAAW;IACvC,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC;AACf,CAAC;AAED,QAAQ,CACP,sBAAsB,EAEtB,MAAM,mBAAoB,SAAQ,EAAE;IACnC,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAED,WAAW;QACV,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,IAAI,CAAC,WAAW,EAAE,CAAC;IACpB,CAAC;IAED,WAAW;QACV,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,SAAS,iBAAiB;YACzB,OAAO,CACN,MAAM;gBACN,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC;gBACd,GAAG;gBACH,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC;gBACd,GAAG;gBACH,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC;gBACd,GAAG,CACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,iBAAiB,EAAE,CAAC,CAAC;IAC1E,CAAC;CACD,CACD,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,sBAAsB,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { DC, defineCE, getCE } from '.././microcomponents.js';
2
- import { Child } from './child.js';
3
- defineCE('test-parent', class Parent extends DC {
4
- constructor(target) {
5
- super(target);
6
- }
7
- onConnected() {
8
- let that = this;
9
- for (let x = 0; x < 5; x++) {
10
- that.target.append(new Child());
11
- }
12
- }
13
- });
14
- export const Parent = getCE('test-parent');
15
- //# sourceMappingURL=parent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parent.js","sourceRoot":"","sources":["../../src/test/parent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,QAAQ,CACP,aAAa,EAEb,MAAM,MAAO,SAAQ,EAAE;IACtB,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAED,WAAW;QACV,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAM,EAAE,CAAC,CAAC;QAClC,CAAC;IACF,CAAC;CACD,CACD,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC"}
@@ -1,141 +0,0 @@
1
- 'use strict';
2
- import { DC, defineCE, formValues } from '.././microcomponents.js';
3
- defineCE('test-testform', class TestTestForm extends DC {
4
- data;
5
- constructor(target) {
6
- super(target);
7
- const that = this;
8
- delete that._mc;
9
- let shadow = that.target.attachShadow({ mode: 'open' });
10
- shadow.innerHTML = `<style>${that.css}</style>${that.template}`;
11
- formValues(that, 'data', shadow);
12
- that.data.bind(shadow);
13
- }
14
- get template() {
15
- return `
16
- <form>
17
- <!-- sample form to start with -->
18
- <fieldset>
19
- <legend>Inputs</legend>
20
- <label>text</label><input type="text" name="textInput" value="Hallo" />&nbsp;<strong>2wB:&nbsp;</strong>{textInput}
21
- <label>color</label><input type="color" name="colorInput" value="" />
22
- <label>date</label><input type="date" name="dateInput" value="" />
23
- <label>datetime-local</label><input type="datetime-local" name="dtlInput" value="" />
24
- <label>email</label><input type="email" name="email" value="" />
25
- <label>file</label><input type="file" name="fileInput" value="" />
26
- <label>hidden</label><input type="hidden" name="hiddenInput" value="hiddenVal" />
27
- <label>month</label><input type="month" name="month" value="" />
28
- <label>number</label><input type="number" name="number" value="" />
29
- <label>password</label><input type="password" name="passInput" value="" />
30
- <label>range</label><input type="range" name="rangeInput" value="" />
31
- <label>search</label><input type="search" name="searchInput" value="" />
32
- <label>tel</label><input type="tel" name="telInput" value="" />
33
- <label>time</label><input type="time" name="timeInput" value="" />
34
- <label>url</label><input type="url" name="urlInput" value="" />
35
- <label>week</label><input type="week" name="weekInput" value="" />
36
- </fieldset>
37
-
38
- <fieldset>
39
- <legend>Selects</legend>
40
-
41
- <label>singleSelect</label>
42
- <select name="singleSelect">
43
- <option disabled selected value> -- select -- </option>
44
- <option value="1">Option 1</option>
45
- <option value="2">Option 2</option>
46
- <option value="3">Option 3</option>
47
- <option value="4">Option 4</option>
48
- </select>
49
-
50
- <label>multiSelect</label>
51
- <select name="multiSelect" multiple="multiple" type="select-multiple">
52
- <option value="1">Option 1</option>
53
- <option value="2" selected=true>Option 2</option>
54
- <option value="3">Option 3</option>
55
- <option value="4" selected=true>Option 4</option>
56
- </select>
57
-
58
- </fieldset>
59
-
60
- <fieldset>
61
- <legend>Radiobuttons&nbsp;<strong>2wB:&nbsp;</strong><span>{myRadio}</span></legend>
62
-
63
- <label>radio1</label><input type="radio" name="myRadio" value="radio1">
64
- <label>radio2</label><input type="radio" name="myRadio" value="radio2">
65
- <label>radio3</label><input type="radio" name="myRadio" value="radio3">
66
-
67
- </fieldset>
68
-
69
- <fieldset>
70
- <legend>Checkboxes</legend>
71
- <label>cb1</label><input type="checkbox" name="cb1">
72
- <label>cb2</label><input type="checkbox" name="cb2">
73
- <label>cb3</label><input type="checkbox" name="cb3">
74
- <label>cb4</label><input type="checkbox" name="cb4">
75
- <label>cb5</label><input type="checkbox" name="cb5">
76
-
77
- </fieldset>
78
-
79
- <fieldset>
80
- <legend>TextArea</legend>
81
- <label>textArea</label>
82
- <textarea name="textArea">abc</textarea>
83
- </fieldset>
84
-
85
- </form>
86
- `;
87
- }
88
- get css() {
89
- return `
90
- legend {
91
- display: inherit;
92
- margin: inherit;
93
- vertical-align: inherit;
94
- }
95
-
96
- label {
97
- display: inline;
98
- margin-top: 5px;
99
- margin-left: 5px;
100
- vertical-align: top;
101
- width: 10em;
102
- text-align: right;
103
- }
104
-
105
- label::before {
106
- content: ' ';
107
- display: block;
108
- }
109
-
110
- form input,
111
- form select,
112
- form textarea {
113
- margin-left: 5px;
114
- margin-top: 0px;
115
- display: inline;
116
- }
117
-
118
- form label + textarea {
119
- display: inline-block;
120
- margin-top: 3px;
121
- }
122
-
123
- form input + label {
124
- width: inherit;
125
- margin-top: 3px;
126
- text-align: left;
127
- }
128
-
129
- body > form {
130
- display: block;
131
- }
132
-
133
- form fieldset {
134
- border: 1px solid darkslategrey;
135
- border-radius: 3px;
136
- margin: 0.5em 0;
137
- }
138
- `;
139
- }
140
- });
141
- //# sourceMappingURL=testform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testform.js","sourceRoot":"","sources":["../../src/test/testform.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAc,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE/E,QAAQ,CACP,eAAe,EAEf,MAAM,YAAa,SAAQ,EAAE;IAC5B,IAAI,CAAU;IAEd,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,OAAO,IAAI,CAAC,GAAG,CAAC;QAEhB,IAAI,MAAM,GAAI,IAAW,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAChE,MAAM,CAAC,SAAS,GAAG,UAAU,IAAI,CAAC,GAAG,WAAW,IAAI,CAAC,QAAQ,EAAE,CAAC;QAEhE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAEhC,IAAI,CAAC,IAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,QAAQ;QACX,OAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAuEN,CAAC;IACZ,CAAC;IAED,IAAI,GAAG;QACN,OAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAiDL,CAAC;IACZ,CAAC;CACD,CACD,CAAC"}
@@ -1,10 +0,0 @@
1
- import { DC } from '../microcomponents.js';
2
- export default class testmc extends DC {
3
- constructor(target) {
4
- super(target);
5
- delete this._mc;
6
- }
7
- oneInit() {
8
- }
9
- }
10
- //# sourceMappingURL=testmc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testmc.js","sourceRoot":"","sources":["../../src/test/testmc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAe,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,EAAE;IAClC,YAAY,MAAmB;QAC3B,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,OAAO;IAEP,CAAC;CACJ"}
package/public/test.html DELETED
@@ -1,27 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Micro Components Manual Test</title>
7
- <link
8
- rel="icon"
9
- type="image/svg+xml"
10
- sizes="any"
11
- href="MicroComponents.svg"
12
- />
13
- <link href="./my-tag.css" rel="stylesheet" />
14
- <link href="./grandparent.css" rel="stylesheet" />
15
- <script src="./microcomponents.min.js"></script>
16
- <script>
17
- Object.assign(window, microcomponents); // make system global, for debugging
18
- autoload(true); // automatically load web components that are undefined
19
- </script>
20
- <script type="module" src="./test.js"></script>
21
- </head>
22
- <body>
23
- <test-grandparent></test-grandparent>
24
- <test-testform _mc="test-testmc"></test-testform>
25
- Open the debugger, read console, then:<br />
26
- </body>
27
- </html>