@twobirds/microcomponents 0.0.82 → 0.0.83

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 (233) hide show
  1. package/assets/documentation/MC.md +0 -1
  2. package/dist/MC.d.ts +3 -3
  3. package/dist/MC.d.ts.map +1 -1
  4. package/dist/MC.js +43 -74
  5. package/dist/MC.min.js +43 -74
  6. package/dist/MC.ts +67 -143
  7. package/dist/elements.d.ts +1 -1
  8. package/dist/elements.d.ts.map +1 -1
  9. package/dist/elements.js +16 -2
  10. package/dist/elements.min.js +1 -1
  11. package/dist/elements.ts +33 -3
  12. package/dist/formValues.min.js +1 -1
  13. package/dist/microcomponents.min.js +1 -1
  14. package/dist/observables.d.ts.map +1 -1
  15. package/dist/observables.js +40 -47
  16. package/dist/observables.min.js +1 -1
  17. package/dist/observables.ts +54 -59
  18. package/dist/selectors.d.ts +2 -4
  19. package/dist/selectors.d.ts.map +1 -1
  20. package/dist/selectors.js +2 -214
  21. package/dist/selectors.min.js +1 -1
  22. package/dist/selectors.ts +2 -367
  23. package/package.json +6 -5
  24. package/public/MC.d.ts +3 -3
  25. package/public/MC.d.ts.map +1 -1
  26. package/public/MC.js +43 -74
  27. package/public/MC.js.map +1 -1
  28. package/public/MC.min.js +43 -74
  29. package/public/MC.ts +67 -143
  30. package/public/documentation/MC.md +0 -1
  31. package/public/elements.d.ts +1 -1
  32. package/public/elements.d.ts.map +1 -1
  33. package/public/elements.js +16 -2
  34. package/public/elements.js.map +1 -1
  35. package/public/elements.min.js +1 -1
  36. package/public/elements.ts +33 -3
  37. package/public/formValues.min.js +1 -1
  38. package/public/microcomponents.min.js +1 -1
  39. package/public/observables.d.ts.map +1 -1
  40. package/public/observables.js +40 -47
  41. package/public/observables.js.map +1 -1
  42. package/public/observables.min.js +1 -1
  43. package/public/observables.ts +54 -59
  44. package/public/selectors.d.ts +2 -4
  45. package/public/selectors.d.ts.map +1 -1
  46. package/public/selectors.js +2 -214
  47. package/public/selectors.js.map +1 -1
  48. package/public/selectors.min.js +1 -1
  49. package/public/selectors.ts +2 -367
  50. package/public/src/MC.d.ts +36 -0
  51. package/public/src/MC.d.ts.map +1 -0
  52. package/public/src/MC.js +348 -0
  53. package/public/src/MC.js.map +1 -0
  54. package/public/src/MC.ts +67 -143
  55. package/public/src/McEvent.d.ts +15 -0
  56. package/public/src/McEvent.d.ts.map +1 -0
  57. package/public/src/McEvent.js +71 -0
  58. package/public/src/elements.d.ts +5 -0
  59. package/public/src/elements.d.ts.map +1 -0
  60. package/public/src/elements.js +62 -0
  61. package/public/src/elements.js.map +1 -0
  62. package/public/src/elements.ts +33 -3
  63. package/public/src/formValues.d.ts +3 -0
  64. package/public/src/formValues.d.ts.map +1 -0
  65. package/public/src/formValues.js +162 -0
  66. package/public/src/helpers.d.ts +14 -0
  67. package/public/src/helpers.d.ts.map +1 -0
  68. package/public/src/helpers.js +113 -0
  69. package/public/src/microcomponents.d.ts +7 -0
  70. package/public/src/microcomponents.d.ts.map +1 -0
  71. package/public/src/microcomponents.js +8 -0
  72. package/public/src/observables.d.ts +11 -0
  73. package/public/src/observables.d.ts.map +1 -0
  74. package/public/src/observables.js +242 -0
  75. package/public/src/observables.js.map +1 -0
  76. package/public/src/observables.ts +54 -59
  77. package/public/src/selectors.d.ts +106 -0
  78. package/public/src/selectors.d.ts.map +1 -0
  79. package/public/src/selectors.js +759 -0
  80. package/public/src/selectors.js.map +1 -0
  81. package/public/src/selectors.ts +2 -367
  82. package/public/src/test/grandparent.css +11 -0
  83. package/public/src/test/test/child.d.ts +2 -0
  84. package/public/src/test/test/child.d.ts.map +1 -0
  85. package/public/src/test/test/child.js +15 -0
  86. package/public/src/test/test/child.js.map +1 -0
  87. package/public/src/test/test/child.ts +21 -0
  88. package/public/src/test/test/grandchild.d.ts +2 -0
  89. package/public/src/test/test/grandchild.d.ts.map +1 -0
  90. package/public/src/test/test/grandchild.js +15 -0
  91. package/public/src/test/test/grandchild.js.map +1 -0
  92. package/public/src/test/test/grandchild.ts +21 -0
  93. package/public/src/test/test/grandparent.d.ts +2 -0
  94. package/public/src/test/test/grandparent.d.ts.map +1 -0
  95. package/public/src/test/test/grandparent.js +1 -0
  96. package/public/src/test/test/grandparent.js.map +1 -0
  97. package/public/src/test/test/grandparent.ts +21 -0
  98. package/public/src/test/test/greatgrandchild.d.ts +2 -0
  99. package/public/src/test/test/greatgrandchild.d.ts.map +1 -0
  100. package/public/src/test/test/greatgrandchild.js +29 -0
  101. package/public/src/test/test/greatgrandchild.js.map +1 -0
  102. package/public/src/test/test/greatgrandchild.ts +42 -0
  103. package/public/src/test/test/parent.d.ts +2 -0
  104. package/public/src/test/test/parent.d.ts.map +1 -0
  105. package/public/src/test/test/parent.js +15 -0
  106. package/public/src/test/test/parent.js.map +1 -0
  107. package/public/src/test/test/parent.ts +21 -0
  108. package/public/src/test/test/testform.d.ts +2 -0
  109. package/public/src/test/test/testform.d.ts.map +1 -0
  110. package/public/src/test/test/testform.js +1 -0
  111. package/public/src/test/test/testform.js.map +1 -0
  112. package/public/src/test/test/testform.ts +155 -0
  113. package/public/src/test/test/testfunction.d.ts +3 -0
  114. package/public/src/test/test/testfunction.d.ts.map +1 -0
  115. package/public/src/test/test/testfunction.js +7 -0
  116. package/public/src/test/test/testfunction.js.map +1 -0
  117. package/public/src/test/test/testfunction.ts +12 -0
  118. package/public/src/test/test/testmc.d.ts +3 -0
  119. package/public/src/test/test/testmc.d.ts.map +1 -0
  120. package/public/src/test/test/testmc.js +10 -0
  121. package/public/src/test/test/testmc.js.map +1 -0
  122. package/public/src/test/test/testmc.ts +16 -0
  123. package/public/src/test/test/testsimpleclass.d.ts +3 -0
  124. package/public/src/test/test/testsimpleclass.d.ts.map +1 -0
  125. package/public/src/test/test/testsimpleclass.js +9 -0
  126. package/public/src/test/test/testsimpleclass.js.map +1 -0
  127. package/public/src/test/test/testsimpleclass.ts +15 -0
  128. package/public/src/test/test.d.ts +2 -0
  129. package/public/src/test/test.d.ts.map +1 -0
  130. package/public/src/test/test.js +79 -0
  131. package/public/src/test/test.js.map +1 -0
  132. package/public/src/test/test.ts +188 -0
  133. package/public/src/test/testform.css +47 -0
  134. package/public/src/test/testform.html +56 -0
  135. package/public/src/test/testform.json +27 -0
  136. package/public/test/MC.d.ts +3 -3
  137. package/public/test/MC.d.ts.map +1 -1
  138. package/public/test/MC.js +43 -74
  139. package/public/test/MC.min.js +485 -0
  140. package/public/test/MC.ts +67 -143
  141. package/public/test/elements.d.ts +1 -1
  142. package/public/test/elements.d.ts.map +1 -1
  143. package/public/test/elements.js +16 -2
  144. package/public/test/elements.min.js +1 -0
  145. package/public/test/elements.ts +33 -3
  146. package/public/test/formValues.min.js +1 -0
  147. package/public/test/grandparent.css +1 -3
  148. package/public/test/microcomponents.min.js +1 -1
  149. package/public/test/observables.d.ts.map +1 -1
  150. package/public/test/observables.js +40 -47
  151. package/public/test/observables.min.js +1 -0
  152. package/public/test/observables.ts +54 -59
  153. package/public/test/selectors.d.ts +2 -4
  154. package/public/test/selectors.d.ts.map +1 -1
  155. package/public/test/selectors.js +2 -214
  156. package/public/test/selectors.min.js +1 -0
  157. package/public/test/selectors.ts +2 -367
  158. package/public/test/test/child.ts +21 -0
  159. package/public/test/test/grandchild.ts +21 -0
  160. package/public/test/test/grandparent.js +1 -1
  161. package/public/test/test/grandparent.ts +21 -0
  162. package/public/test/test/greatgrandchild.ts +42 -0
  163. package/public/test/test/parent.ts +21 -0
  164. package/public/test/test/testform.js +1 -1
  165. package/public/test/test/testform.js.map +1 -1
  166. package/public/test/test/testform.ts +155 -0
  167. package/public/test/test/testfunction.d.ts +3 -0
  168. package/public/test/test/testfunction.d.ts.map +1 -0
  169. package/public/test/test/testfunction.js +7 -0
  170. package/public/test/test/testfunction.js.map +1 -0
  171. package/public/test/test/testfunction.ts +12 -0
  172. package/public/test/test/testmc.d.ts +2 -5
  173. package/public/test/test/testmc.d.ts.map +1 -1
  174. package/public/test/test/testmc.js +4 -4
  175. package/public/test/test/testmc.js.map +1 -1
  176. package/public/test/test/testmc.ts +16 -0
  177. package/public/test/test/testsimpleclass.d.ts +3 -0
  178. package/public/test/test/testsimpleclass.d.ts.map +1 -0
  179. package/public/test/test/testsimpleclass.js +9 -0
  180. package/public/test/test/testsimpleclass.js.map +1 -0
  181. package/public/test/test/testsimpleclass.ts +15 -0
  182. package/public/test/test.js +0 -2
  183. package/public/test/test.js.map +1 -1
  184. package/public/test/test.ts +188 -0
  185. package/public/test/testform.css +47 -0
  186. package/public/test/testform.html +56 -0
  187. package/public/test/testform.json +3 -3
  188. package/public/typedoc/assets/navigation.js +1 -1
  189. package/public/typedoc/assets/search.js +1 -1
  190. package/public/typedoc/classes/MC.DC.html +5 -5
  191. package/public/typedoc/classes/MC.MC.html +5 -5
  192. package/public/typedoc/classes/MC.McBase.html +4 -3
  193. package/public/typedoc/classes/MC.McEvent.html +2 -2
  194. package/public/typedoc/functions/MC.addListener.html +1 -1
  195. package/public/typedoc/functions/MC.autoload.html +1 -1
  196. package/public/typedoc/functions/MC.removeListener.html +1 -1
  197. package/public/typedoc/functions/elements.defineCE.html +1 -1
  198. package/public/typedoc/functions/elements.getCE.html +1 -1
  199. package/public/typedoc/functions/formValues.formValues.html +1 -1
  200. package/public/typedoc/functions/observables.observe.html +1 -1
  201. package/public/typedoc/functions/selectors._d.html +1 -0
  202. package/public/typedoc/functions/selectors._t.html +1 -0
  203. package/public/typedoc/interfaces/MC.HTMLMcElement.html +2 -2
  204. package/public/typedoc/interfaces/selectors.DSelector.html +48 -0
  205. package/public/typedoc/interfaces/selectors.TSelector.html +34 -0
  206. package/public/typedoc/modules/MC.html +1 -1
  207. package/public/typedoc/modules/elements.html +1 -1
  208. package/public/typedoc/modules/formValues.html +1 -1
  209. package/public/typedoc/modules/observables.html +1 -1
  210. package/public/typedoc/modules/selectors.html +7 -0
  211. package/public/typedoc/modules.html +1 -0
  212. package/public/typedoc/types/observables.Observable.html +1 -1
  213. package/public/typedoc/types/selectors.selection.html +1 -0
  214. package/public/typedoc/types/selectors.singleSelector.html +1 -0
  215. package/src/MC.ts +67 -143
  216. package/src/elements.ts +33 -3
  217. package/src/observables.ts +54 -59
  218. package/src/selectors.ts +2 -367
  219. package/src/test/test/testform.ts +7 -3
  220. package/src/test/test/testfunction.ts +12 -0
  221. package/src/test/test/testmc.ts +13 -9
  222. package/src/test/test/testsimpleclass.ts +15 -0
  223. package/src/test/test.ts +0 -12
  224. package/tasks.md +36 -0
  225. package/typedoc.json +1 -1
  226. package/public/test/MC.js.map +0 -1
  227. package/public/test/elements.js.map +0 -1
  228. package/public/test/observables.js.map +0 -1
  229. package/public/test/selectors.js.map +0 -1
  230. /package/public/{test → src}/McEvent.js.map +0 -0
  231. /package/public/{test → src}/formValues.js.map +0 -0
  232. /package/public/{test → src}/helpers.js.map +0 -0
  233. /package/public/{test → src}/microcomponents.js.map +0 -0
@@ -0,0 +1,21 @@
1
+ import { DC, defineCE, getCE } from '../../microcomponents.js';
2
+ import { Greatgrandchild } from './greatgrandchild.js';
3
+ defineCE(
4
+ 'test-grandchild',
5
+
6
+ class TestGrandchild extends DC {
7
+ constructor(target: HTMLElement) {
8
+ super(target);
9
+ }
10
+
11
+ onConnected() {
12
+ let that = this;
13
+
14
+ for (let x = 0; x < 2; x++) {
15
+ that.target.append(new Greatgrandchild!());
16
+ }
17
+ }
18
+ }
19
+ );
20
+
21
+ export const Grandchild = getCE('test-grandchild');
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.grandparent=e():t.grandparent=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{GrandParent:()=>N});var n=new Function("try {return this===window;}catch(e){ return false;}");let r=new Set;n()&&Object.keys(HTMLElement.prototype).filter((t=>/^on/.test(t))).forEach((t=>r.add(t)));class o{#t;#e=!1;#n=!1;constructor(t,e={},n="l"){this.#t=t,this.data=e,this.bubble=n}get type(){return this.#t}get stopped(){return this.#e}get immediateStopped(){return this.#n}stopPropagation(){this.#e=!0}stopImmediatePropagation(){this.stopPropagation(),this.#n=!0}}var s=new Function("try {return this===window;}catch(e){ return false;}");let c=new Set;function a(t,e){let n=[];return t.forEach((t=>{if(t&&t instanceof HTMLElement){const r=t?._mc;!e&&r?n=n.concat(Object.values(t._mc)):e&&r&&r[e]&&n.push(r[e])}})),n}function i(t,e,n=!0){let r=[];for(;t;){if(t._mc&&(e?e&&t._mc[e]&&r.push(t._mc[e]):r=r.concat(Object.values(t._mc)),n))return r;t=t.parentNode}return r}function l(t){return t&&t instanceof HTMLElement}function u(t,e,n,r=!1,o=!1){let s={once:!1};r&&(s.capture=r),o&&(s.once=o),t.addEventListener(e,n,s)}function d(t,e,n={}){let r=t;if(!r._mc){let e=h?.debug;h.debug=!1,r._mc=new h(t),h.debug=e,delete r._mc._mc}const o=r._mc;return e.length&&!o[e]&&(o[e]=n,t instanceof HTMLElement&&!t.getAttribute("_mc")&&t.setAttribute("_mc","")),n}function m(t,e){if(!e)return;const n=t?._mc||{};n&&n[e]&&delete n[e],!Object.keys(n).length&&t instanceof HTMLElement&&t.hasAttribute("_mc")&&t.removeAttribute("_mc")}function p(t,e,n={},r="l"){let s=t?._mc;if(!s)return;let c=e instanceof o?new o(e.type,e.data,"l"):new o(e,n,"l"),a="string"!=typeof e?e:new o(e,n,r);[...Object.values(s)].forEach((t=>{t?.trigger&&"function"==typeof t?.trigger&&t?.trigger(c)})),/[ud]/.test(a.bubble)&&g(t,a)}function g(t,e){/[ud]/.test(e.bubble)&&setTimeout((()=>{if(-1===e.bubble.indexOf("l")&&(e.bubble+="l"),e.bubble.indexOf("u")>-1){let n=i(t,"",!0)?.[0].target;n&&h.trigger(n,e)}e.bubble.indexOf("d")>-1&&new Set(t._mc.children().map((t=>t?.target))).forEach((t=>{t&&h.trigger(t,e)}))}),0)}s()&&Object.keys(HTMLElement.prototype).filter((t=>/^on/.test(t))).forEach((t=>c.add(t)));class f{#r;constructor(t,e=!1){var n;this.#r=new WeakRef(t||{}),(n=this).constructor!==h&&setTimeout((()=>{n.trigger("Init")}),0),function(t){if(!s()||t.constructor===h)return;const e=t.target;if(e instanceof HTMLElement){let n=t;Object.getOwnPropertyNames(n.constructor.prototype).filter((t=>/^on[A-Z]|one[A-Z]/.test(t)&&"function"==typeof n.constructor.prototype[t])).forEach((r=>{let o=/^one/.test(r),s=r.replace(/^on[e]{0,1}/,""),a=s.toLowerCase();o&&Object.defineProperty(t,"on"+s,{configurable:!0,enumerable:!1,writable:!0,value:t=>{n.constructor.prototype[r].bind(n)(t)}}),c.has("on"+a)&&u(e,a,(t=>{n.trigger(s,t)}),!1,o)}))}}(this)}get target(){return this.#r.deref()}}class b extends f{_mc={};constructor(t){super(t)}static trigger=p;trigger(t,e={},n="l"){let r=this;if(r.constructor===b||r.constructor===h){let s=t instanceof o?new o(t.type,t.data,"l"):new o(t,e,"l"),c="string"!=typeof t?t:new o(t,e,n);return[...Object.getOwnPropertyNames(r)].forEach((t=>{r[t]?.trigger&&"function"==typeof r[t]?.trigger&&r[t]?.trigger(s)})),void(/[ud]/.test(c.bubble)&&g(r.target,c))}if(r instanceof b||r instanceof h){const r=this,s="string"!=typeof t?t:new o(t,e,n),c="on"+s.type[0].toUpperCase()+s.type.slice(1);if(s.bubble.indexOf("l")>-1&&(s.immediateStopped||"function"!=typeof r[c]||(r[c](s),r.hasOwnProperty(c)&&delete r[c])),s.stopped||"l"===s.bubble)return r;/[ud]/.test(s.bubble)&&g(r.target,s)}}}class h extends f{_mc={};constructor(t,e=!1){super(t)}static add=d;static remove=m;static trigger=p;trigger(t,e={},n){b.prototype.trigger.call(this,t,e,n)}parent(t=""){let e=this.target;return l(e)?i(e.parentNode,t,!0):[]}ancestors(t=""){let e=this?.target;return l(e)?i(this.target.parentNode,t,!1):[]}children(t=""){let e=this?.target;if(!l(e))return[];const n=Math.random().toString().replace(".",""),r='[_mc]:not([temp_id="'+n+'"] [_mc] [_mc])';e.setAttribute("temp_id",n);const o=a([...e.querySelectorAll(r)],t);return e.removeAttribute("temp_id"),o}descendants(t=""){let e=this?.target;return l(e)?a([...e.querySelectorAll("*[_mc]")],t):[]}}const y=new Map,w=new Map;function _(t){const e="./"+t.split("-").join("/")+".js",n=document.createElement("script");return n.setAttribute("src",e),n.setAttribute("blocking","render"),n.async=!0,n.setAttribute("type","module"),n.setAttribute("name",t),n.setAttribute("loading",""),u(n,"load",(t=>{n.removeAttribute("loading"),n.setAttribute("loaded","")})),u(n,"error",(t=>{console.error("could not load Custom Element code from",e)})),n}function E(){[...document.querySelectorAll(":not(:defined)")].filter((t=>!!t&&!customElements.get(t.tagName.toLowerCase())&&!y.has(t.tagName.toLowerCase()))).forEach((t=>{const e=t.tagName.toLowerCase(),n=(e.split("-").join("/"),_(e));u(n,"load",(()=>{y.set(e,customElements.get(t.tagName.toLowerCase()))})),y.set(e,"loading"),document.head.append(n)})),[...document.querySelectorAll('[_mc]:not([_mc=""]')].filter((t=>!!t)).forEach((t=>{const e=t.getAttribute("_mc")?.split(" ").filter((t=>!!t))||[],n=e.filter((t=>!w.has(t)));n?.forEach((t=>{const e=_(t);u(e,"load",(()=>{return e=document.head.querySelector(`script[name="${t}"]`),void setTimeout((function(){const t=e.getAttribute("src"),n=e.getAttribute("name"),r=document.createElement("script");r.async=!0,r.setAttribute("type","module");const o=`\n\n\t\t\timport _ from "${t}";\n\t\t\timport { DC } from "./microcomponents.js";\n\n\t\t\tconst elements = Array.from(document.querySelectorAll('[_mc*="${n}"]')).filter( element => element instanceof HTMLElement );\n\n\t\t\telements.forEach((element) => {\n\t\t\t\t// add class to MCs repository\n\t\t\t\tautoload.state.MCs.set( '${n}', _ );\n\t\t\t\t// add instance to HTMLElement \n\t\t\t\tDC.add(element, _.name, new _(element));\n\t\t\t\t// remove instance name from elements "_mc" attribute\n\t\t\t\telement.setAttribute('_mc', element.getAttribute('_mc').replace('${n}', '').replace( /ww/g, ' ').trim()); \n\t\t\t});\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tdocument.body.querySelector('script[name="${n}]"')?.remove();\n\t\t\t},0);\n\n\t\t`;r.innerHTML=o,document.body.append(r)}),0);var e})),w.set(t,"loading"),document.head.append(e)}));const r=e.filter((t=>w.has(t)&&!w.get(t).length));r?.forEach((e=>{setTimeout((()=>{h.add(t,e,new(v.state.MCs.get(e))(t)),t.getAttribute("_mc").replace("${elementName}","").replace(/\w\w/g," ").trim(),t.setAttribute("_mc")}),5)}))}))}let A=!1,C=null;function v(t=!0){return t?(A=t,C=new MutationObserver(E),setTimeout((()=>{C.observe(document.body,{childList:!0,subtree:!0}),E()}),5),window.autoload=window.autoload||v,A):(C?.disconnect(),C=null,A)}v.state={CEs:y,MCs:w};class O extends HTMLElement{constructor(){super()}connectedCallback(){h.trigger(this,"Connected")}disconnectedCallback(){h.trigger(this,"Disconnected")}adoptedCallback(){h.trigger(this,"Adopted")}attributeChangedCallback(t,e,n){h.trigger(this,"AttributeChanged",{name:t,oldValue:e,newValue:n})}}function M(t,e,n=[]){if(customElements.get(t))return void console.warn(`IGNORED: Custom element "${t}" is already defined!`);if(!t.includes("-"))throw new Error('createCustomElement: tagName must contain at least one hyphen ("-").');let r=t.split("-").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join("");customElements.define(t,function(t,e){return Object.defineProperty(e,"name",{value:t})}(r,class extends O{instance;constructor(t){super();let n=new e(this,t);h.add(this,r,n)}static get observedAttributes(){return n}}))}function S(t){return customElements.get(t)}function j(t,e){return Math.floor(Math.random()*(e-t+1)+t)}M("test-greatgrandchild",class extends h{constructor(t){super(t)}onConnected(){this.updateStyle()}updateStyle(){this.target.setAttribute("style","border-color:rgb("+j(0,255)+","+j(0,255)+","+j(0,255)+")")}});const T=S("test-greatgrandchild");M("test-grandchild",class extends h{constructor(t){super(t)}onConnected(){let t=this;for(let e=0;e<2;e++)t.target.append(new T)}});const L=S("test-grandchild");M("test-child",class extends h{constructor(t){super(t)}onConnected(){let t=this;for(let e=0;e<10;e++)t.target.append(new L)}});const x=S("test-child");M("test-parent",class extends h{constructor(t){super(t)}onConnected(){let t=this;for(let e=0;e<5;e++)t.target.append(new x)}});const P=S("test-parent");M("test-grandparent",class extends h{constructor(t){super(t)}onConnected(){let t=this;for(let e=0;e<5;e++)t.target.append(new P)}});const N=S("test-grandparent");return e})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.grandparent=e():t.grandparent=e()}(self,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{GrandParent:()=>x});var r=new Function("try {return this===window;}catch(e){ return false;}");let n=new Set;r()&&Object.keys(HTMLElement.prototype).filter((t=>/^on/.test(t))).forEach((t=>n.add(t)));class o{#t;#e=!1;#r=!1;constructor(t,e={},r="l"){this.#t=t,this.data=e,this.bubble=r}get type(){return this.#t}get stopped(){return this.#e}get immediateStopped(){return this.#r}stopPropagation(){this.#e=!0}stopImmediatePropagation(){this.stopPropagation(),this.#r=!0}}var s=new Function("try {return this===window;}catch(e){ return false;}");let c=new Set;function i(t,e){let r=[];return t.forEach((t=>{if(t&&t instanceof HTMLElement){const n=t?._mc;!e&&n?r=r.concat(Object.values(t._mc)):e&&n&&n[e]&&r.push(n[e])}})),r}function a(t,e,r=!0){let n=[];for(;t;){if(t._mc&&(e?e&&t._mc[e]&&n.push(t._mc[e]):n=n.concat(Object.values(t._mc)),r))return n;t=t.parentNode}return n}function l(t){return t&&t instanceof HTMLElement}function u(t,e,r={}){let n=t;if(!n._mc){let e=b?.debug;b.debug=!1,n._mc=new b(t),b.debug=e,delete n._mc._mc}const o=n._mc;return e.length&&!o[e]&&(o[e]=r,t instanceof HTMLElement&&!t.getAttribute("_mc")&&t.setAttribute("_mc","")),r}function d(t,e){if(!e)return;const r=t?._mc||{};r&&r[e]&&delete r[e],!Object.keys(r).length&&t instanceof HTMLElement&&t.hasAttribute("_mc")&&t.removeAttribute("_mc")}function p(t,e,r={},n="l"){let s=t?._mc;if(!s)return;let c=e instanceof o?new o(e.type,e.data,"l"):new o(e,r,"l"),i="string"!=typeof e?e:new o(e,r,n);[...Object.values(s)].forEach((t=>{t?.trigger&&"function"==typeof t?.trigger&&t?.trigger(c)})),/[ud]/.test(i.bubble)&&g(t,i)}function g(t,e){/[ud]/.test(e.bubble)&&setTimeout((()=>{if(-1===e.bubble.indexOf("l")&&(e.bubble+="l"),e.bubble.indexOf("u")>-1){let r=a(t,"",!0)?.[0].target;r&&b.trigger(r,e)}e.bubble.indexOf("d")>-1&&new Set(t._mc.children().map((t=>t?.target))).forEach((t=>{t&&b.trigger(t,e)}))}),0)}s()&&Object.keys(HTMLElement.prototype).filter((t=>/^on/.test(t))).forEach((t=>c.add(t)));class f{_target;__mc={};constructor(t,e=!1){var r;this._target=new WeakRef(t||{}),(r=this).constructor!==b&&setTimeout((()=>{r.trigger("Init")}),0),function(t){if(!s()||t.constructor===b)return;const e=t.target;if(e instanceof HTMLElement){let r=t;Object.getOwnPropertyNames(r.constructor.prototype).filter((t=>/^on[A-Z]|one[A-Z]/.test(t)&&"function"==typeof r.constructor.prototype[t])).forEach((n=>{let o=/^one/.test(n),s=n.replace(/^on[e]{0,1}/,""),i=s.toLowerCase();o&&Object.defineProperty(t,"on"+s,{configurable:!0,enumerable:!1,writable:!0,value:t=>{r.constructor.prototype[n].bind(r)(t)}}),c.has("on"+i)&&function(t,e,r,n=!1,o=!1){let s={once:!1};n&&(s.capture=n),o&&(s.once=o),t.addEventListener(e,r,s)}(e,i,(t=>{r.trigger(s,t)}),!1,o)}))}}(this)}get target(){return this._target.deref()}get _mc(){return this.__mc}}class m extends f{constructor(t){super(t)}static trigger=p;trigger(t,e={},r="l"){let n=this;if(n.constructor===m||n.constructor===b){let s=t instanceof o?new o(t.type,t.data,"l"):new o(t,e,"l"),c="string"!=typeof t?t:new o(t,e,r);return[...Object.getOwnPropertyNames(n)].forEach((t=>{n[t]?.trigger&&"function"==typeof n[t]?.trigger&&n[t]?.trigger(s)})),void(/[ud]/.test(c.bubble)&&g(n.target,c))}if(n instanceof m||n instanceof b){const n=this,s="string"!=typeof t?t:new o(t,e,r),c="on"+s.type[0].toUpperCase()+s.type.slice(1);if(s.bubble.indexOf("l")>-1&&(s.immediateStopped||"function"!=typeof n[c]||(n[c](s),n.hasOwnProperty(c)&&delete n[c])),s.stopped||"l"===s.bubble)return n;/[ud]/.test(s.bubble)&&g(n.target,s)}}}class b extends f{constructor(t,e=!1){super(t)}static add=u;static remove=d;static trigger=p;trigger(t,e={},r){m.prototype.trigger.call(this,t,e,r)}parent(t=""){let e=this.target;return l(e)?a(e.parentNode,t,!0):[]}ancestors(t=""){let e=this?.target;return l(e)?a(this.target.parentNode,t,!1):[]}children(t=""){let e=this?.target;if(!l(e))return[];const r=Math.random().toString().replace(".",""),n='[_mc]:not([temp_id="'+r+'"] [_mc] [_mc])';e.setAttribute("temp_id",r);const o=i([...e.querySelectorAll(n)],t);return e.removeAttribute("temp_id"),o}descendants(t=""){let e=this?.target;return l(e)?i([...e.querySelectorAll("*[_mc]")],t):[]}}new Set;class h extends HTMLElement{constructor(){super()}connectedCallback(){b.trigger(this,"Connected")}disconnectedCallback(){b.trigger(this,"Disconnected")}adoptedCallback(){b.trigger(this,"Adopted")}attributeChangedCallback(t,e,r){b.trigger(this,"AttributeChanged",{name:t,oldValue:e,newValue:r})}}function y(t){return"function"==typeof t&&/^class\s/.test(Function.prototype.toString.call(t))}function _(t,e,r=[]){if(customElements.get(t))return void console.warn(`IGNORED: Custom element "${t}" is already defined!`);if(!t.includes("-"))throw new Error('createCustomElement: tagName must contain at least one hyphen ("-").');let n=t.split("-").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join("");y(e.prototype.constructor)&&e.prototype instanceof f?customElements.define(t,function(t,e){return Object.defineProperty(e,"name",{value:t})}(n,class extends h{instance;constructor(t){super();const r=y(e)?new e(this,t):e;b.add(this,n,r)}static get observedAttributes(){return r}})):customElements.define(t,e)}function w(t){return customElements.get(t)}function E(t,e){return Math.floor(Math.random()*(e-t+1)+t)}_("test-greatgrandchild",class extends b{constructor(t){super(t)}onConnected(){this.updateStyle()}updateStyle(){this.target.setAttribute("style","border-color:rgb("+E(0,255)+","+E(0,255)+","+E(0,255)+")")}});const O=w("test-greatgrandchild");_("test-grandchild",class extends b{constructor(t){super(t)}onConnected(){let t=this;for(let e=0;e<2;e++)t.target.append(new O)}});const S=w("test-grandchild");_("test-child",class extends b{constructor(t){super(t)}onConnected(){let t=this;for(let e=0;e<10;e++)t.target.append(new S)}});const v=w("test-child");_("test-parent",class extends b{constructor(t){super(t)}onConnected(){let t=this;for(let e=0;e<5;e++)t.target.append(new v)}});const j=w("test-parent");_("test-grandparent",class extends b{constructor(t){super(t)}onConnected(){let t=this;for(let e=0;e<5;e++)t.target.append(new j)}});const x=w("test-grandparent");return e})()));
@@ -0,0 +1,21 @@
1
+ import { DC, defineCE, getCE } from '../../microcomponents.js';
2
+ import { Parent } from './parent.js';
3
+ defineCE(
4
+ 'test-grandparent',
5
+
6
+ class TestGrandparent extends DC {
7
+ constructor(target: HTMLElement) {
8
+ super(target);
9
+ }
10
+
11
+ onConnected() {
12
+ let that = this;
13
+
14
+ for (let x = 0; x < 5; x++) {
15
+ that.target.append(new Parent!());
16
+ }
17
+ }
18
+ }
19
+ );
20
+
21
+ export const GrandParent = getCE('test-grandparent');
@@ -0,0 +1,42 @@
1
+ import { DC, defineCE, getCE } from '../../microcomponents.js';
2
+
3
+ function random(min: number, max: number) {
4
+ var random = Math.floor(Math.random() * (max - min + 1) + min);
5
+ return random;
6
+ }
7
+
8
+ defineCE(
9
+ 'test-greatgrandchild',
10
+
11
+ class TestGreatgrandchild extends DC {
12
+ constructor(target: HTMLElement) {
13
+ super(target);
14
+ }
15
+
16
+ onConnected() {
17
+ let that = this;
18
+
19
+ that.updateStyle();
20
+ }
21
+
22
+ updateStyle() {
23
+ var that = this;
24
+
25
+ function randomBorderColor() {
26
+ return (
27
+ 'rgb(' +
28
+ random(0, 255) +
29
+ ',' +
30
+ random(0, 255) +
31
+ ',' +
32
+ random(0, 255) +
33
+ ')'
34
+ );
35
+ }
36
+
37
+ that.target.setAttribute('style', 'border-color:' + randomBorderColor());
38
+ }
39
+ }
40
+ );
41
+
42
+ export const Greatgrandchild = getCE('test-greatgrandchild');
@@ -0,0 +1,21 @@
1
+ import { DC, defineCE, getCE } from '../../microcomponents.js';
2
+ import { Child } from './child.js';
3
+ defineCE(
4
+ 'test-parent',
5
+
6
+ class Parent extends DC {
7
+ constructor(target: HTMLElement) {
8
+ super(target);
9
+ }
10
+
11
+ onConnected() {
12
+ let that = this;
13
+
14
+ for (let x = 0; x < 5; x++) {
15
+ that.target.append(new Child!());
16
+ }
17
+ }
18
+ }
19
+ );
20
+
21
+ export const Parent = getCE('test-parent');
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TestTestform=t():e.TestTestform=t()}(self,(()=>(()=>{"use strict";var e=new Function("try {return this===window;}catch(e){ return false;}");let t=new Set;e()&&Object.keys(HTMLElement.prototype).filter((e=>/^on/.test(e))).forEach((e=>t.add(e)));class n{#e;#t=!1;#n=!1;constructor(e,t={},n="l"){this.#e=e,this.data=t,this.bubble=n}get type(){return this.#e}get stopped(){return this.#t}get immediateStopped(){return this.#n}stopPropagation(){this.#t=!0}stopImmediatePropagation(){this.stopPropagation(),this.#n=!0}}var r=new Function("try {return this===window;}catch(e){ return false;}");let a=new Set;function l(e,t){let n=[];return e.forEach((e=>{if(e&&e instanceof HTMLElement){const r=e?._mc;!t&&r?n=n.concat(Object.values(e._mc)):t&&r&&r[t]&&n.push(r[t])}})),n}function o(e,t,n=!0){let r=[];for(;e;){if(e._mc&&(t?t&&e._mc[t]&&r.push(e._mc[t]):r=r.concat(Object.values(e._mc)),n))return r;e=e.parentNode}return r}function s(e){return e&&e instanceof HTMLElement}function i(e,t,n,r=!1,a=!1){let l={once:!1};r&&(l.capture=r),a&&(l.once=a),e.addEventListener(t,n,l)}function c(e,t,n={}){let r=e;if(!r._mc){let t=f?.debug;f.debug=!1,r._mc=new f(e),f.debug=t,delete r._mc._mc}const a=r._mc;return t.length&&!a[t]&&(a[t]=n,e instanceof HTMLElement&&!e.getAttribute("_mc")&&e.setAttribute("_mc","")),n}function u(e,t){if(!t)return;const n=e?._mc||{};n&&n[t]&&delete n[t],!Object.keys(n).length&&e instanceof HTMLElement&&e.hasAttribute("_mc")&&e.removeAttribute("_mc")}function p(e,t,r={},a="l"){let l=e?._mc;if(!l)return;let o=t instanceof n?new n(t.type,t.data,"l"):new n(t,r,"l"),s="string"!=typeof t?t:new n(t,r,a);[...Object.values(l)].forEach((e=>{e?.trigger&&"function"==typeof e?.trigger&&e?.trigger(o)})),/[ud]/.test(s.bubble)&&d(e,s)}function d(e,t){/[ud]/.test(t.bubble)&&setTimeout((()=>{if(-1===t.bubble.indexOf("l")&&(t.bubble+="l"),t.bubble.indexOf("u")>-1){let n=o(e,"",!0)?.[0].target;n&&f.trigger(n,t)}t.bubble.indexOf("d")>-1&&new Set(e._mc.children().map((e=>e?.target))).forEach((e=>{e&&f.trigger(e,t)}))}),0)}r()&&Object.keys(HTMLElement.prototype).filter((e=>/^on/.test(e))).forEach((e=>a.add(e)));class m{#r;constructor(e,t=!1){var n;this.#r=new WeakRef(e||{}),(n=this).constructor!==f&&setTimeout((()=>{n.trigger("Init")}),0),function(e){if(!r()||e.constructor===f)return;const t=e.target;if(t instanceof HTMLElement){let n=e;Object.getOwnPropertyNames(n.constructor.prototype).filter((e=>/^on[A-Z]|one[A-Z]/.test(e)&&"function"==typeof n.constructor.prototype[e])).forEach((r=>{let l=/^one/.test(r),o=r.replace(/^on[e]{0,1}/,""),s=o.toLowerCase();l&&Object.defineProperty(e,"on"+o,{configurable:!0,enumerable:!1,writable:!0,value:e=>{n.constructor.prototype[r].bind(n)(e)}}),a.has("on"+s)&&i(t,s,(e=>{n.trigger(o,e)}),!1,l)}))}}(this)}get target(){return this.#r.deref()}}class b extends m{_mc={};constructor(e){super(e)}static trigger=p;trigger(e,t={},r="l"){let a=this;if(a.constructor===b||a.constructor===f){let l=e instanceof n?new n(e.type,e.data,"l"):new n(e,t,"l"),o="string"!=typeof e?e:new n(e,t,r);return[...Object.getOwnPropertyNames(a)].forEach((e=>{a[e]?.trigger&&"function"==typeof a[e]?.trigger&&a[e]?.trigger(l)})),void(/[ud]/.test(o.bubble)&&d(a.target,o))}if(a instanceof b||a instanceof f){const a=this,l="string"!=typeof e?e:new n(e,t,r),o="on"+l.type[0].toUpperCase()+l.type.slice(1);if(l.bubble.indexOf("l")>-1&&(l.immediateStopped||"function"!=typeof a[o]||(a[o](l),a.hasOwnProperty(o)&&delete a[o])),l.stopped||"l"===l.bubble)return a;/[ud]/.test(l.bubble)&&d(a.target,l)}}}class f extends m{_mc={};constructor(e,t=!1){super(e)}static add=c;static remove=u;static trigger=p;trigger(e,t={},n){b.prototype.trigger.call(this,e,t,n)}parent(e=""){let t=this.target;return s(t)?o(t.parentNode,e,!0):[]}ancestors(e=""){let t=this?.target;return s(t)?o(this.target.parentNode,e,!1):[]}children(e=""){let t=this?.target;if(!s(t))return[];const n=Math.random().toString().replace(".",""),r='[_mc]:not([temp_id="'+n+'"] [_mc] [_mc])';t.setAttribute("temp_id",n);const a=l([...t.querySelectorAll(r)],e);return t.removeAttribute("temp_id"),a}descendants(e=""){let t=this?.target;return s(t)?l([...t.querySelectorAll("*[_mc]")],e):[]}}const g=new Map,h=new Map;function y(e){const t="./"+e.split("-").join("/")+".js",n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("blocking","render"),n.async=!0,n.setAttribute("type","module"),n.setAttribute("name",e),n.setAttribute("loading",""),i(n,"load",(e=>{n.removeAttribute("loading"),n.setAttribute("loaded","")})),i(n,"error",(e=>{console.error("could not load Custom Element code from",t)})),n}function v(){[...document.querySelectorAll(":not(:defined)")].filter((e=>!!e&&!customElements.get(e.tagName.toLowerCase())&&!g.has(e.tagName.toLowerCase()))).forEach((e=>{const t=e.tagName.toLowerCase(),n=(t.split("-").join("/"),y(t));i(n,"load",(()=>{g.set(t,customElements.get(e.tagName.toLowerCase()))})),g.set(t,"loading"),document.head.append(n)})),[...document.querySelectorAll('[_mc]:not([_mc=""]')].filter((e=>!!e)).forEach((e=>{const t=e.getAttribute("_mc")?.split(" ").filter((e=>!!e))||[],n=t.filter((e=>!h.has(e)));n?.forEach((e=>{const t=y(e);i(t,"load",(()=>{return t=document.head.querySelector(`script[name="${e}"]`),void setTimeout((function(){const e=t.getAttribute("src"),n=t.getAttribute("name"),r=document.createElement("script");r.async=!0,r.setAttribute("type","module");const a=`\n\n\t\t\timport _ from "${e}";\n\t\t\timport { DC } from "./microcomponents.js";\n\n\t\t\tconst elements = Array.from(document.querySelectorAll('[_mc*="${n}"]')).filter( element => element instanceof HTMLElement );\n\n\t\t\telements.forEach((element) => {\n\t\t\t\t// add class to MCs repository\n\t\t\t\tautoload.state.MCs.set( '${n}', _ );\n\t\t\t\t// add instance to HTMLElement \n\t\t\t\tDC.add(element, _.name, new _(element));\n\t\t\t\t// remove instance name from elements "_mc" attribute\n\t\t\t\telement.setAttribute('_mc', element.getAttribute('_mc').replace('${n}', '').replace( /ww/g, ' ').trim()); \n\t\t\t});\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tdocument.body.querySelector('script[name="${n}]"')?.remove();\n\t\t\t},0);\n\n\t\t`;r.innerHTML=a,document.body.append(r)}),0);var t})),h.set(e,"loading"),document.head.append(t)}));const r=t.filter((e=>h.has(e)&&!h.get(e).length));r?.forEach((t=>{setTimeout((()=>{f.add(e,t,new(E.state.MCs.get(t))(e)),e.getAttribute("_mc").replace("${elementName}","").replace(/\w\w/g," ").trim(),e.setAttribute("_mc")}),5)}))}))}let w=!1,O=null;function E(e=!0){return e?(w=e,O=new MutationObserver(v),setTimeout((()=>{O.observe(document.body,{childList:!0,subtree:!0}),v()}),5),window.autoload=window.autoload||E,w):(O?.disconnect(),O=null,w)}function A(e){let t={};return[...Object.keys(e)].sort().forEach((n=>{var r;(r=e[n])&&r.constructor&&r.constructor===Object?t[n]=A(e[n]):t[n]=e[n]})),t}function x(e,t=!0){let n={};return[...Object.getOwnPropertyNames(e)].forEach((t=>{if(e[t]&&e[t].constructor&&e[t].constructor===Object){const r=x(e[t],!1);for(const e in r)n[t+"."+e]=r[e]}else n[t]=e[t]})),t?A(n):n}function _(e,t){return JSON.stringify(x(e))===JSON.stringify(x(t))}function k(e,t){let n;return()=>{clearTimeout(n),n=setTimeout((function(){e(...arguments)}),t)}}function j(e,t){const n=Object.getOwnPropertyDescriptors(e);for(const[e,r]of Object.entries(n))("get"in r||"set"in r)&&Object.defineProperty(t,e,r)}E.state={CEs:g,MCs:h};class S extends HTMLElement{constructor(){super()}connectedCallback(){f.trigger(this,"Connected")}disconnectedCallback(){f.trigger(this,"Disconnected")}adoptedCallback(){f.trigger(this,"Adopted")}attributeChangedCallback(e,t,n){f.trigger(this,"AttributeChanged",{name:e,oldValue:t,newValue:n})}}function C(e){return null!=e&&"object"==typeof e}function T(e){let t=new Set,n=/\{[^\{\}]*\}/g;return e.getAttributeNames().filter((t=>e.getAttribute(t)?.match(n))).forEach((r=>{new Set(e.getAttribute(r)?.match(n)).forEach((e=>t.add(e.replace(/[\{\}]/g,""))))})),[...e.childNodes].filter((e=>3===e.nodeType&&(e.nodeValue||"").match(n))).forEach((e=>{(e.nodeValue||"").match(n).forEach((e=>{t.add(e.replace(/[\{\}]/g,""))}))})),[...t].map((e=>e.replace(/[\{\}]/g,"")))}const N=[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement];class L extends f{data={};oldDisplay="";constructor(e){super(e);let t=this;T(e).forEach((e=>t.data[e]="")),H(t),t.#a(),delete t._mc}#a(){let e=this,t=e.target,n=!1;t.getAttributeNames().filter((e=>t.getAttribute(e)?.match(/\{[^\{\}]*\}/g))).forEach((n=>{let r=new Set(t.getAttribute(n)?.match(/\{[^\{\}]*\}/g));var a;e.data.observe((a=t.getAttribute(n),e=>{let l=a;r.forEach((t=>{l=l.replace(t,e[t.replace(/[\{\}]/g,"")])})),t.setAttribute(n,l)}))})),[...t.childNodes].filter((e=>3===e.nodeType&&(e.nodeValue||"").match(/\{[^\{\}]*\}/g))).forEach((r=>{n=!0;let a=new Set(r.nodeValue.match(/\{[^\{\}]*\}/g));var l;e.data.observe((l=r.nodeValue,n=>{let o=l;a.forEach((e=>{o=o.replace(e,n[e.replace(/[\{\}]/g,"")])})),Object.keys(n).some((e=>!!n[e]))&&(e.oldDisplay?t.style=e.oldDisplay:t.removeAttribute("style"),delete e.oldDisplay),r.nodeValue=o})),e.oldDisplay=t.getAttribute("style)")||"",n&&!N.includes(t.constructor)&&"FIELDSET"!==t.tagName&&(t.style.display="none")}))}onData(e){let t=this,n={};Object.keys(e.data).forEach((r=>{t.data.hasOwnProperty(r)&&(n[r]=e.data[r])})),JSON.stringify(n)!==JSON.stringify(t.data)&&Object.assign(t.data,n)}}const M={};function I(e){let t=e.constructor.name;return M[t]||function(e){const t=e.constructor,n=t.name;let r=class extends t{#l=!0;#o=[];constructor(e){super(e),this.constructor.callbacks=[],C(e)&&Object.getOwnPropertyNames(e).forEach((t=>{this[t]=e[t]}))}get callbacks(){return this.#o}set callbacks(e){this.#o=e}observe(e){return this.#o.push(e),this}bind(e){const t=this;if(C(t.valueOf())){!function(e){var t;(t=e,(t instanceof HTMLElement?[t]:[]).concat([...t.querySelectorAll("*")]).filter((e=>!!T(e).length)).filter((e=>"STYLE"!==e.tagName))).forEach((e=>{e?._mc?._placeholders||f.add(e,"_placeholders",new L(e))}))}(e);const n=[...e.querySelectorAll("[_mc]")].filter((e=>!!e?._mc?._placeholders)),r=function(e){let t=x(e);n.forEach((e=>{e&&e._mc.trigger("data",t)}))};t.#o.push(r),t.notify()}else console.warn("IGNORED - cannot bind a non-Object to the dom, IS:",typeof t.valueOf(),t);return this}notify(e){let t=this,n=C(t.valueOf())&&t.valueOf()instanceof Array==0?structuredClone(Object.assign({},t)):t.valueOf();return void 0!==e&&(t.#l=e),t.#o.forEach((e=>{e(n)})),t}};return M[n]=r,r}(e)}const H=(e,t)=>((t?[t]:[...Object.getOwnPropertyNames(e)]).forEach((t=>{if(e.hasOwnProperty(t)&&"function"!=typeof e[t]&&!e?.[t]?.constructor?.prototype?.observe){if("_"===t[0]||void 0===e?.[t])return e;let n=e[t],r=new(I(n))(n);Object.defineProperty(e,t,{enumerable:!0,get(){if(C(r.valueOf())){let e=structuredClone(Object.assign({},r));setTimeout(k((function(){_(structuredClone(Object.assign({},r)),e)||r.notify()}),0),0)}return r},set(e){if(typeof e==typeof r.valueOf())if(C(r.valueOf())&&r.valueOf()instanceof Array==0){let t=structuredClone(Object.assign({},r));void 0===r?.constructor?.prototype?.observe&&(r=new(I(e))(structuredClone(Object.assign({},e))),j(e,r),r.seal()),Object.assign(r,e),setTimeout(k((function(){_(structuredClone(Object.assign({},r)),t)||r.notify()}),0),0)}else{let t=r.valueOf(),n=r.callbacks;e!==t&&(r=new(I(e))(e),r.callbacks=n,r.notify())}else console.warn("IGNORED - cannot change observable types, IS:",typeof r.valueOf(),r,"- CANNOT BECOME:",typeof e)}}),e[t]=n}})),e);class P{constructor(e){}}class D extends P{#s;constructor(e){super(e),this.#s=e}get val(){return new FormData(this.#s.form).get(this.#s.name)}set val(e){[...this.#s.form.querySelectorAll(`input[type="radio"][name="${this.#s.name}"]`)].filter((t=>t.getAttribute("value")===e)).shift().checked=!0}}class q extends P{#s;constructor(e){super(e),this.#s=e}get val(){return this.#s.checked}set val(e){this.#s.checked=e}}class $ extends P{#s;constructor(e){super(e),this.#s=e}get val(){return this.#s.value}set val(e){this.#s.value=e}}class R extends P{#s;#i=!1;constructor(e){super(e),this.#s=e,this.#i=e.multiple}get val(){const e=[];return[...this.#s.querySelectorAll("option")].filter((e=>e.selected)).forEach((t=>{e.push(t.value)})),this.#i?e:e.length?e[0]:""}set val(e){e="string"==typeof e?[e]:e,[...this.#s.querySelectorAll("option")].forEach((t=>{e.indexOf(t.value)>-1?t.selected=!0:t.selected=!1}))}}class V extends P{#s;constructor(e){super(e),this.#s=e}get val(){return this.#s.value||""}set val(e){this.#s.value=e}}return function(e,t,n=[]){if(customElements.get(e))return void console.warn(`IGNORED: Custom element "${e}" is already defined!`);if(!e.includes("-"))throw new Error('createCustomElement: tagName must contain at least one hyphen ("-").');let r=e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("");customElements.define(e,function(e,t){return Object.defineProperty(t,"name",{value:e})}(r,class extends S{instance;constructor(e){super();let n=new t(this,e);f.add(this,r,n)}static get observedAttributes(){return n}}))}("test-testform",class extends f{data;constructor(e){super(e);const t=this;delete t._mc;let n=t.target.attachShadow({mode:"open"});n.innerHTML=`<style>${t.css}</style>${t.template}`,function(e,t,n){let r=(e=>{let t=[...(e||document).querySelectorAll("input,select,textarea")],n={};return t.forEach((e=>{const t=e.getAttribute("name");if(t){let r=!1;switch((e=>e.tagName.toLowerCase())(e)){case"input":switch(e.type){case"radio":r=new D(e);break;case"checkbox":r=new q(e);break;default:r=new $(e)}break;case"select":r=new R(e);break;case"textarea":r=new V(e);break;default:console.warn("handler missing:",t,"for",e.tagName.toLowerCase(),e)}r&&(f.add(e,t,r),Object.defineProperty(n,t,{enumerable:!0,configurable:!0,get:()=>r.val,set:e=>{r.val!==e&&(r.val=e)}}))}})),n})(n);e[t]=Object.assign({},r),H(e,t),j(r,e[t]),[...n.querySelectorAll("input, textarea, select")].forEach((n=>{i(n,"input",(n=>{e[t].notify()}))}))}(t,"data",n),t.data.bind(n),fetch("./testform.json").then((e=>e.json())).then((e=>{t.data=e}))}get template(){return'\n <form>\n \x3c!-- sample form to start with --\x3e\n <fieldset>\n <legend>Inputs</legend>\n <label>text</label><input type="text" name="textInput" value="Hallo" />&nbsp;<strong>2wB:&nbsp;</strong>{textInput}<br />\n <label>color</label><input type="color" name="colorInput" value="#000000" /><br />\n <label>date</label><input type="date" name="dateInput" value="" /><br />\n <label>datetime-local</label><input type="datetime-local" name="dtlInput" value="" /><br />\n <label>email</label><input type="email" name="email" value="" /><br />\n <label>file</label><input type="file" name="fileInput" value="" /><br />\n <label>hidden</label><input type="hidden" name="hiddenInput" value="hiddenVal" /><br />\n <label>month</label><input type="month" name="month" value="" /><br />\n <label>number</label><input type="number" name="number" value="" /><br />\n <label>password</label><input type="password" name="passInput" value="" /><br />\n <label>range</label><input type="range" name="rangeInput" value="" /><br />\n <label>search</label><input type="search" name="searchInput" value="" /><br />\n <label>tel</label><input type="tel" name="telInput" value="" /><br />\n <label>time</label><input type="time" name="timeInput" value="" /><br />\n <label>url</label><input type="url" name="urlInput" value="" /><br />\n <label>week</label><input type="week" name="weekInput" value="" /><br />\n </fieldset>\n\n <fieldset>\n <legend>Selects&nbsp;<strong>2wB:&nbsp;</strong>&nbsp;<span>"{singleSelect}"</span>&nbsp;<span>[{multiSelect}]</span></legend>\n\n <label>singleSelect</label>\n <select name="singleSelect">\n <option disabled selected value> -- select -- </option>\n <option value="1">Option 1</option>\n <option value="2">Option 2</option>\n <option value="3">Option 3</option>\n <option value="4">Option 4</option>\n </select><br />\n\n <label>multiSelect</label>\n <select name="multiSelect" multiple="multiple" type="select-multiple">\n <option value="1">Option 1</option>\n <option value="2" selected=true>Option 2</option>\n <option value="3">Option 3</option>\n <option value="4" selected=true>Option 4</option>\n </select>\n\n </fieldset>\n\n <fieldset>\n <legend>Radiobuttons&nbsp;<strong>2wB:&nbsp;</strong><span>"{myRadio}"</span></legend>\n\n <label>radio1</label><input type="radio" name="myRadio" value="radio1"><br />\n <label>radio2</label><input type="radio" name="myRadio" value="radio2"><br />\n <label>radio3</label><input type="radio" name="myRadio" value="radio3"><br />\n\n </fieldset>\n\n <fieldset>\n <legend>Checkboxes</legend>\n <label>cb1</label><input type="checkbox" name="cb1"><br />\n <label>cb2</label><input type="checkbox" name="cb2"><br />\n <label>cb3</label><input type="checkbox" name="cb3"><br />\n <label>cb4</label><input type="checkbox" name="cb4"><br />\n <label>cb5</label><input type="checkbox" name="cb5"><br />\n\n </fieldset>\n\n <fieldset>\n <legend>TextArea</legend>\n <label>textArea</label>\n <textarea name="textArea">abc</textarea>\n </fieldset>\n\n </form>\n '}get css(){return'\nlegend {\n display: inherit;\n margin: inherit;\n vertical-align: inherit;\n font-weight: bold;\n}\n\nlabel {\n display: inline-block;\n margin-top: 1em;\n margin-left: 5px;\n vertical-align: top;\n min-width:10em;\n text-align: right;\n}\n\nform input,\nform select,\nform textarea {\n display: inline-block;\n margin-left: 5px;\n margin-top: 1.1em;\n}\n\ninput[type="radio"],\ninput[type="checkbox"] {\n margin-top: 1.3em;\n}\n\nbody > form {\n display: block;\n}\n\nform fieldset {\n border: 1px solid #aaaaaa;\n border-radius: 3px;\n margin: 0.5em 0;\n}\n '}}),{}})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TestTestform=t():e.TestTestform=t()}(self,(()=>(()=>{"use strict";var e=new Function("try {return this===window;}catch(e){ return false;}");let t=new Set;e()&&Object.keys(HTMLElement.prototype).filter((e=>/^on/.test(e))).forEach((e=>t.add(e)));class n{#e;#t=!1;#n=!1;constructor(e,t={},n="l"){this.#e=e,this.data=t,this.bubble=n}get type(){return this.#e}get stopped(){return this.#t}get immediateStopped(){return this.#n}stopPropagation(){this.#t=!0}stopImmediatePropagation(){this.stopPropagation(),this.#n=!0}}var r=new Function("try {return this===window;}catch(e){ return false;}");let a=new Set;function l(e,t){let n=[];return e.forEach((e=>{if(e&&e instanceof HTMLElement){const r=e?._mc;!t&&r?n=n.concat(Object.values(e._mc)):t&&r&&r[t]&&n.push(r[t])}})),n}function o(e,t,n=!0){let r=[];for(;e;){if(e._mc&&(t?t&&e._mc[t]&&r.push(e._mc[t]):r=r.concat(Object.values(e._mc)),n))return r;e=e.parentNode}return r}function s(e){return e&&e instanceof HTMLElement}function i(e,t,n,r=!1,a=!1){let l={once:!1};r&&(l.capture=r),a&&(l.once=a),e.addEventListener(t,n,l)}function c(e,t,n={}){let r=e;if(!r._mc){let t=m?.debug;m.debug=!1,r._mc=new m(e),m.debug=t,delete r._mc._mc}const a=r._mc;return t.length&&!a[t]&&(a[t]=n,e instanceof HTMLElement&&!e.getAttribute("_mc")&&e.setAttribute("_mc","")),n}function u(e,t){if(!t)return;const n=e?._mc||{};n&&n[t]&&delete n[t],!Object.keys(n).length&&e instanceof HTMLElement&&e.hasAttribute("_mc")&&e.removeAttribute("_mc")}function p(e,t,r={},a="l"){let l=e?._mc;if(!l)return;let o=t instanceof n?new n(t.type,t.data,"l"):new n(t,r,"l"),s="string"!=typeof t?t:new n(t,r,a);[...Object.values(l)].forEach((e=>{e?.trigger&&"function"==typeof e?.trigger&&e?.trigger(o)})),/[ud]/.test(s.bubble)&&b(e,s)}function b(e,t){/[ud]/.test(t.bubble)&&setTimeout((()=>{if(-1===t.bubble.indexOf("l")&&(t.bubble+="l"),t.bubble.indexOf("u")>-1){let n=o(e,"",!0)?.[0].target;n&&m.trigger(n,t)}t.bubble.indexOf("d")>-1&&new Set(e._mc.children().map((e=>e?.target))).forEach((e=>{e&&m.trigger(e,t)}))}),0)}r()&&Object.keys(HTMLElement.prototype).filter((e=>/^on/.test(e))).forEach((e=>a.add(e)));class d{_target;__mc={};constructor(e,t=!1){var n;this._target=new WeakRef(e||{}),(n=this).constructor!==m&&setTimeout((()=>{n.trigger("Init")}),0),function(e){if(!r()||e.constructor===m)return;const t=e.target;if(t instanceof HTMLElement){let n=e;Object.getOwnPropertyNames(n.constructor.prototype).filter((e=>/^on[A-Z]|one[A-Z]/.test(e)&&"function"==typeof n.constructor.prototype[e])).forEach((r=>{let l=/^one/.test(r),o=r.replace(/^on[e]{0,1}/,""),s=o.toLowerCase();l&&Object.defineProperty(e,"on"+o,{configurable:!0,enumerable:!1,writable:!0,value:e=>{n.constructor.prototype[r].bind(n)(e)}}),a.has("on"+s)&&i(t,s,(e=>{n.trigger(o,e)}),!1,l)}))}}(this)}get target(){return this._target.deref()}get _mc(){return this.__mc}}class f extends d{constructor(e){super(e)}static trigger=p;trigger(e,t={},r="l"){let a=this;if(a.constructor===f||a.constructor===m){let l=e instanceof n?new n(e.type,e.data,"l"):new n(e,t,"l"),o="string"!=typeof e?e:new n(e,t,r);return[...Object.getOwnPropertyNames(a)].forEach((e=>{a[e]?.trigger&&"function"==typeof a[e]?.trigger&&a[e]?.trigger(l)})),void(/[ud]/.test(o.bubble)&&b(a.target,o))}if(a instanceof f||a instanceof m){const a=this,l="string"!=typeof e?e:new n(e,t,r),o="on"+l.type[0].toUpperCase()+l.type.slice(1);if(l.bubble.indexOf("l")>-1&&(l.immediateStopped||"function"!=typeof a[o]||(a[o](l),a.hasOwnProperty(o)&&delete a[o])),l.stopped||"l"===l.bubble)return a;/[ud]/.test(l.bubble)&&b(a.target,l)}}}class m extends d{constructor(e,t=!1){super(e)}static add=c;static remove=u;static trigger=p;trigger(e,t={},n){f.prototype.trigger.call(this,e,t,n)}parent(e=""){let t=this.target;return s(t)?o(t.parentNode,e,!0):[]}ancestors(e=""){let t=this?.target;return s(t)?o(this.target.parentNode,e,!1):[]}children(e=""){let t=this?.target;if(!s(t))return[];const n=Math.random().toString().replace(".",""),r='[_mc]:not([temp_id="'+n+'"] [_mc] [_mc])';t.setAttribute("temp_id",n);const a=l([...t.querySelectorAll(r)],e);return t.removeAttribute("temp_id"),a}descendants(e=""){let t=this?.target;return s(t)?l([...t.querySelectorAll("*[_mc]")],e):[]}}function h(e){let t={};return[...Object.keys(e)].sort().forEach((n=>{var r;(r=e[n])&&r.constructor&&r.constructor===Object?t[n]=h(e[n]):t[n]=e[n]})),t}function g(e,t=!0){let n={};return[...Object.getOwnPropertyNames(e)].forEach((t=>{if(e[t]&&e[t].constructor&&e[t].constructor===Object){const r=g(e[t],!1);for(const e in r)n[t+"."+e]=r[e]}else n[t]=e[t]})),t?h(n):n}function y(e,t){return JSON.stringify(g(e))===JSON.stringify(g(t))}function v(e,t){let n;return()=>{clearTimeout(n),n=setTimeout((function(){e(...arguments)}),t)}}function O(e,t){const n=Object.getOwnPropertyDescriptors(e);for(const[e,r]of Object.entries(n))("get"in r||"set"in r)&&Object.defineProperty(t,e,r)}new Set;class w extends HTMLElement{constructor(){super()}connectedCallback(){m.trigger(this,"Connected")}disconnectedCallback(){m.trigger(this,"Disconnected")}adoptedCallback(){m.trigger(this,"Adopted")}attributeChangedCallback(e,t,n){m.trigger(this,"AttributeChanged",{name:e,oldValue:t,newValue:n})}}function E(e){return"function"==typeof e&&/^class\s/.test(Function.prototype.toString.call(e))}function x(e){return null!=e&&"object"==typeof e}function k(e){let t=new Set,n=/\{[^\{\}]*\}/g;return(e.getAttributeNames?e.getAttributeNames():[]).filter((t=>e.getAttribute(t)?.match(n))).forEach((t=>{let r=new Set(e.getAttribute(t)?.match(n));r.forEach((e=>r.add(e.replace(/[\{\}]/g,""))))})),[...e.childNodes].filter((e=>3===e.nodeType&&(e.nodeValue||"").match(n))).forEach((e=>{(e.nodeValue||"").match(n).forEach((e=>{t.add(e.replace(/[\{\}]/g,""))}))})),[...t].map((e=>e.replace(/[\{\}]/g,"")))}const A=[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement];class S extends m{data={};oldDisplay="";constructor(e){super(e),k(e).forEach((e=>this.data[e]="")),T(this),this.#r()}#r(){let e=this.target,t=!1;(e.getAttributeNames?e.getAttributeNames():[]).filter((t=>e.getAttribute(t)?.match(/\{[^\{\}]*\}/g))).forEach((t=>{let n=new Set(e.getAttribute(t)?.match(/\{[^\{\}]*\}/g));var r;this.data.observe((r=e.getAttribute(t),a=>{let l=r;n.forEach((e=>{l=l.replace(e,a[e.replace(/[\{\}]/g,"")])})),e.setAttribute(t,l)}))})),[...e.childNodes].filter((e=>3===e.nodeType&&(e.nodeValue||"").match(/\{[^\{\}]*\}/g))).forEach((n=>{t=!0;let r=new Set(n.nodeValue.match(/\{[^\{\}]*\}/g));this.data.observe((t=>a=>{let l=t;r.forEach((e=>{l=l.replace(e,a[e.replace(/[\{\}]/g,"")])})),this.oldDisplay?e.style=this.oldDisplay:e.removeAttribute("style"),delete this.oldDisplay,n.nodeValue=l})(n.nodeValue)),this.oldDisplay=e.getAttribute("style)")||"",t&&!A.includes(e.constructor)&&"FIELDSET"!==e.tagName&&(e.style.display="none")}))}onData(e){let t={};Object.keys(e.data).forEach((n=>{this.data.hasOwnProperty(n)&&(t[n]=e.data[n])})),JSON.stringify(t)!==JSON.stringify(this.data)&&Object.assign(this.data,t)}}const _={};function j(e){let t=e.constructor.name;return _[t]||function(e){const t=e.constructor,n=t.name;let r=class extends t{#a=!0;#l=[];constructor(e){super(e),this.constructor.callbacks=[],x(e)&&Object.getOwnPropertyNames(e).forEach((t=>{this[t]=e[t]}))}get callbacks(){return this.#l}set callbacks(e){this.#l=e}observe(e){return this.#l.push(e),this}bind(e){if(x(this.valueOf())){!function(e){var t;(t=e,[t].concat([...t.querySelectorAll("*")]).filter((e=>!!k(e).length)).filter((e=>"STYLE"!==e?.tagName)).reverse()).forEach((e=>{e?._mc?._placeholders||m.add(e,"_placeholders",new S(e))}))}(e);const t=[e,...e.querySelectorAll("[_mc]")].filter((e=>!!e?._mc?._placeholders)),n=function(e){let n=g(e);t.forEach((e=>{e&&e._mc.trigger("data",n)}))};this.#l.push(n),this.notify()}else console.warn("IGNORED - cannot bind a non-Object to the dom, IS:",typeof this.valueOf(),this);return this}notify(e){let t=x(this.valueOf())&&this.valueOf()instanceof Array==0?structuredClone(Object.assign({},this)):this.valueOf();return void 0!==e&&(this.#a=e),this.#l.forEach((e=>{e(t)})),this}};return _[n]=r,r}(e)}const T=(e,t)=>((t?[t]:[...Object.getOwnPropertyNames(e)]).forEach((t=>{if(e.hasOwnProperty(t)&&"function"!=typeof e[t]&&!e?.[t]?.constructor?.prototype?.observe){if("_"===t[0]||void 0===e?.[t])return e;let n=e[t],r=new(j(n))(n);Object.defineProperty(e,t,{enumerable:!0,get(){if(x(r.valueOf())){let e=structuredClone(Object.assign({},r));setTimeout(v((function(){y(structuredClone(Object.assign({},r)),e)||r.notify()}),0),0)}return r},set(e){if(typeof e==typeof r.valueOf())if(x(r.valueOf())&&r.valueOf()instanceof Array==0){let t=structuredClone(Object.assign({},r));void 0===r?.constructor?.prototype?.observe&&(r=new(j(e))(structuredClone(Object.assign({},e))),O(e,r),r.seal()),Object.assign(r,e),setTimeout(v((function(){y(structuredClone(Object.assign({},r)),t)||r.notify()}),0),0)}else{let t=r.valueOf(),n=r.callbacks;e!==t&&(r=new(j(e))(e),r.callbacks=n,r.notify())}else console.warn("IGNORED - cannot change observable types, IS:",typeof r.valueOf(),r,"- CANNOT BECOME:",typeof e)}}),e[t]=n}})),e);class N{constructor(e){}}class C extends N{#o;constructor(e){super(e),this.#o=e}get val(){return new FormData(this.#o.form).get(this.#o.name)}set val(e){[...this.#o.form.querySelectorAll(`input[type="radio"][name="${this.#o.name}"]`)].filter((t=>t.getAttribute("value")===e)).shift().checked=!0}}class I extends N{#o;constructor(e){super(e),this.#o=e}get val(){return this.#o.checked}set val(e){this.#o.checked=e}}class L extends N{#o;constructor(e){super(e),this.#o=e}get val(){return this.#o.value}set val(e){this.#o.value=e}}class P extends N{#o;#s=!1;constructor(e){super(e),this.#o=e,this.#s=e.multiple}get val(){const e=[];return[...this.#o.querySelectorAll("option")].filter((e=>e.selected)).forEach((t=>{e.push(t.value)})),this.#s?e:e.length?e[0]:""}set val(e){e="string"==typeof e?[e]:e,[...this.#o.querySelectorAll("option")].forEach((t=>{e.indexOf(t.value)>-1?t.selected=!0:t.selected=!1}))}}class M extends N{#o;constructor(e){super(e),this.#o=e}get val(){return this.#o.value||""}set val(e){this.#o.value=e}}return function(e,t,n=[]){if(customElements.get(e))return void console.warn(`IGNORED: Custom element "${e}" is already defined!`);if(!e.includes("-"))throw new Error('createCustomElement: tagName must contain at least one hyphen ("-").');let r=e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("");E(t.prototype.constructor)&&t.prototype instanceof d?customElements.define(e,function(e,t){return Object.defineProperty(t,"name",{value:e})}(r,class extends w{instance;constructor(e){super();const n=E(t)?new t(this,e):t;m.add(this,r,n)}static get observedAttributes(){return n}})):customElements.define(e,t)}("test-testform",class extends m{data;constructor(e){super(e);const t=this;let n=t.target.attachShadow({mode:"open"});n.innerHTML=`<style>${t.css}</style>${t.template}`,function(e,t,n){let r=(e=>{let t=[...(e||document).querySelectorAll("input,select,textarea")],n={};return t.forEach((e=>{const t=e.getAttribute("name");if(t){let r=!1;switch((e=>e.tagName.toLowerCase())(e)){case"input":switch(e.type){case"radio":r=new C(e);break;case"checkbox":r=new I(e);break;default:r=new L(e)}break;case"select":r=new P(e);break;case"textarea":r=new M(e);break;default:console.warn("handler missing:",t,"for",e.tagName.toLowerCase(),e)}r&&(m.add(e,t,r),Object.defineProperty(n,t,{enumerable:!0,configurable:!0,get:()=>r.val,set:e=>{r.val!==e&&(r.val=e)}}))}})),n})(n);e[t]=Object.assign({},r),T(e,t),O(r,e[t]),[...n.querySelectorAll("input, textarea, select")].forEach((n=>{i(n,"input",(n=>{e[t].notify()}))}))}(t,"data",n),t.data.bind(n),fetch("./testform.json").then((e=>e.json())).then((e=>{t.data=e}))}get template(){return'\n <form>\n \x3c!-- sample form to start with --\x3e\n <fieldset>\n <legend>Inputs</legend>\n <label>text</label><input type="text" name="textInput" value="Hallo" />&nbsp;<strong>2wB:&nbsp;</strong>{textInput}<br />\n <label>color</label><input type="color" name="colorInput" value="#000000" /><br />\n <label>date</label><input type="date" name="dateInput" value="" /><br />\n <label>datetime-local</label><input type="datetime-local" name="dtlInput" value="" /><br />\n <label>email</label><input type="email" name="email" value="" /><br />\n <label>file</label><input type="file" name="fileInput" value="" /><br />\n <label>hidden</label><input type="hidden" name="hiddenInput" value="hiddenVal" /><br />\n <label>month</label><input type="month" name="month" value="" /><br />\n <label>number</label><input type="number" name="number" value="" /><br />\n <label>password</label><input type="password" name="passInput" value="" /><br />\n <label>range</label><input type="range" name="rangeInput" value="" /><br />\n <label>search</label><input type="search" name="searchInput" value="" /><br />\n <label>tel</label><input type="tel" name="telInput" value="" /><br />\n <label>time</label><input type="time" name="timeInput" value="" /><br />\n <label>url</label><input type="url" name="urlInput" value="" /><br />\n <label>week</label><input type="week" name="weekInput" value="" /><br />\n </fieldset>\n\n <fieldset>\n <legend>Selects&nbsp;<strong>2wB:&nbsp;</strong>&nbsp;<span>"{singleSelect}"</span>&nbsp;<span>[{multiSelect}]</span></legend>\n\n <label>singleSelect</label>\n <select name="singleSelect">\n <option disabled selected value> -- select -- </option>\n <option value="1">Option 1</option>\n <option value="2">Option 2</option>\n <option value="3">Option 3</option>\n <option value="4">Option 4</option>\n </select><br />\n\n <label>multiSelect</label>\n <select name="multiSelect" multiple="multiple" type="select-multiple">\n <option value="1">Option 1</option>\n <option value="2" selected=true>Option 2</option>\n <option value="3">Option 3</option>\n <option value="4" selected=true>Option 4</option>\n </select>\n\n </fieldset>\n\n <fieldset>\n <legend>Radiobuttons&nbsp;<strong>2wB:&nbsp;</strong><span>"{myRadio}"</span></legend>\n\n <label>radio1</label><input type="radio" name="myRadio" value="radio1"><br />\n <label>radio2</label><input type="radio" name="myRadio" value="radio2"><br />\n <label>radio3</label><input type="radio" name="myRadio" value="radio3"><br />\n\n </fieldset>\n\n <fieldset>\n <legend>Checkboxes</legend>\n <label>cb1</label><input type="checkbox" name="cb1"><br />\n <label>cb2</label><input type="checkbox" name="cb2"><br />\n <label>cb3</label><input type="checkbox" name="cb3"><br />\n <label>cb4</label><input type="checkbox" name="cb4"><br />\n <label>cb5</label><input type="checkbox" name="cb5"><br />\n\n </fieldset>\n\n <fieldset>\n <legend>TextArea</legend>\n <label>textArea</label>\n <textarea name="textArea">abc</textarea>\n </fieldset>\n\n </form>\n '}get css(){return'\nlegend {\n display: inherit;\n margin: inherit;\n vertical-align: inherit;\n font-weight: bold;\n}\n\nlabel {\n display: inline-block;\n margin-top: 1em;\n margin-left: 5px;\n vertical-align: top;\n min-width:10em;\n text-align: right;\n}\n\nform input,\nform select,\nform textarea {\n display: inline-block;\n margin-left: 5px;\n margin-top: 1.1em;\n}\n\ninput[type="radio"],\ninput[type="checkbox"] {\n margin-top: 1.3em;\n}\n\nbody > form {\n display: block;\n}\n\nform fieldset {\n border: 1px solid #aaaaaa;\n border-radius: 3px;\n margin: 0.5em 0;\n}\n '}}),{}})()));
@@ -1 +1 @@
1
- {"version":3,"file":"testform.js","sourceRoot":"","sources":["../../../src/test/test/testform.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAc,UAAU,EAAe,MAAM,4BAA4B,CAAC;AAE/F,QAAQ,CACP,eAAe,EAEf,MAAM,QAAS,SAAQ,EAAE;IACxB,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,UAA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;QAG9B,KAAK,CAAC,iBAAiB,CAAC;aACnB,IAAI,CAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;aACxB,IAAI,CAAE,IAAI,CAAC,EAAE;YACV,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,CAAC,CAAC,CAAC;IAEjB,CAAC;IAED,IAAI,QAAQ;QACX,OAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAuEN,CAAC;IACZ,CAAC;IAED,IAAI,GAAG;QACN,OAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAuCL,CAAC;IACZ,CAAC;CACD,CACD,CAAC"}
@@ -0,0 +1,155 @@
1
+ 'use strict';
2
+ import {
3
+ DC,
4
+ defineCE,
5
+ Observable,
6
+ formValues,
7
+ LooseObject
8
+ } from '../../microcomponents.js';
9
+
10
+ defineCE(
11
+ 'test-testform',
12
+
13
+ class TestForm extends DC {
14
+ data: unknown;
15
+
16
+ constructor(target: HTMLElement) {
17
+ super(target);
18
+
19
+ const that = this;
20
+
21
+ let shadow = (that as DC).target.attachShadow({ mode: 'open' });
22
+ shadow.innerHTML = `<style>${that.css}</style>${that.template}`;
23
+
24
+ formValues(that, 'data', shadow); // create this.data formdata observable
25
+
26
+ (that.data as Observable).bind(shadow); // 1 way bind formdata to the form DOM
27
+
28
+ // load and display data
29
+ fetch('./testform.json')
30
+ .then( res => res.json())
31
+ .then( data => {
32
+ that.data = data;
33
+ });
34
+
35
+ }
36
+
37
+ get template() {
38
+ return /*html*/ `
39
+ <form>
40
+ <!-- sample form to start with -->
41
+ <fieldset>
42
+ <legend>Inputs</legend>
43
+ <label>text</label><input type="text" name="textInput" value="Hallo" />&nbsp;<strong>2wB:&nbsp;</strong>{textInput}<br />
44
+ <label>color</label><input type="color" name="colorInput" value="#000000" /><br />
45
+ <label>date</label><input type="date" name="dateInput" value="" /><br />
46
+ <label>datetime-local</label><input type="datetime-local" name="dtlInput" value="" /><br />
47
+ <label>email</label><input type="email" name="email" value="" /><br />
48
+ <label>file</label><input type="file" name="fileInput" value="" /><br />
49
+ <label>hidden</label><input type="hidden" name="hiddenInput" value="hiddenVal" /><br />
50
+ <label>month</label><input type="month" name="month" value="" /><br />
51
+ <label>number</label><input type="number" name="number" value="" /><br />
52
+ <label>password</label><input type="password" name="passInput" value="" /><br />
53
+ <label>range</label><input type="range" name="rangeInput" value="" /><br />
54
+ <label>search</label><input type="search" name="searchInput" value="" /><br />
55
+ <label>tel</label><input type="tel" name="telInput" value="" /><br />
56
+ <label>time</label><input type="time" name="timeInput" value="" /><br />
57
+ <label>url</label><input type="url" name="urlInput" value="" /><br />
58
+ <label>week</label><input type="week" name="weekInput" value="" /><br />
59
+ </fieldset>
60
+
61
+ <fieldset>
62
+ <legend>Selects&nbsp;<strong>2wB:&nbsp;</strong>&nbsp;<span>"{singleSelect}"</span>&nbsp;<span>[{multiSelect}]</span></legend>
63
+
64
+ <label>singleSelect</label>
65
+ <select name="singleSelect">
66
+ <option disabled selected value> -- select -- </option>
67
+ <option value="1">Option 1</option>
68
+ <option value="2">Option 2</option>
69
+ <option value="3">Option 3</option>
70
+ <option value="4">Option 4</option>
71
+ </select><br />
72
+
73
+ <label>multiSelect</label>
74
+ <select name="multiSelect" multiple="multiple" type="select-multiple">
75
+ <option value="1">Option 1</option>
76
+ <option value="2" selected=true>Option 2</option>
77
+ <option value="3">Option 3</option>
78
+ <option value="4" selected=true>Option 4</option>
79
+ </select>
80
+
81
+ </fieldset>
82
+
83
+ <fieldset>
84
+ <legend>Radiobuttons&nbsp;<strong>2wB:&nbsp;</strong><span>"{myRadio}"</span></legend>
85
+
86
+ <label>radio1</label><input type="radio" name="myRadio" value="radio1"><br />
87
+ <label>radio2</label><input type="radio" name="myRadio" value="radio2"><br />
88
+ <label>radio3</label><input type="radio" name="myRadio" value="radio3"><br />
89
+
90
+ </fieldset>
91
+
92
+ <fieldset>
93
+ <legend>Checkboxes</legend>
94
+ <label>cb1</label><input type="checkbox" name="cb1"><br />
95
+ <label>cb2</label><input type="checkbox" name="cb2"><br />
96
+ <label>cb3</label><input type="checkbox" name="cb3"><br />
97
+ <label>cb4</label><input type="checkbox" name="cb4"><br />
98
+ <label>cb5</label><input type="checkbox" name="cb5"><br />
99
+
100
+ </fieldset>
101
+
102
+ <fieldset>
103
+ <legend>TextArea</legend>
104
+ <label>textArea</label>
105
+ <textarea name="textArea">abc</textarea>
106
+ </fieldset>
107
+
108
+ </form>
109
+ `;
110
+ }
111
+
112
+ get css() {
113
+ return /*css*/ `
114
+ legend {
115
+ display: inherit;
116
+ margin: inherit;
117
+ vertical-align: inherit;
118
+ font-weight: bold;
119
+ }
120
+
121
+ label {
122
+ display: inline-block;
123
+ margin-top: 1em;
124
+ margin-left: 5px;
125
+ vertical-align: top;
126
+ min-width:10em;
127
+ text-align: right;
128
+ }
129
+
130
+ form input,
131
+ form select,
132
+ form textarea {
133
+ display: inline-block;
134
+ margin-left: 5px;
135
+ margin-top: 1.1em;
136
+ }
137
+
138
+ input[type="radio"],
139
+ input[type="checkbox"] {
140
+ margin-top: 1.3em;
141
+ }
142
+
143
+ body > form {
144
+ display: block;
145
+ }
146
+
147
+ form fieldset {
148
+ border: 1px solid #aaaaaa;
149
+ border-radius: 3px;
150
+ margin: 0.5em 0;
151
+ }
152
+ `;
153
+ }
154
+ }
155
+ );
@@ -0,0 +1,3 @@
1
+ declare const _default: CustomElementConstructor | undefined;
2
+ export default _default;
3
+ //# sourceMappingURL=testfunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testfunction.d.ts","sourceRoot":"","sources":["../../../src/test/test/testfunction.ts"],"names":[],"mappings":";AAWA,wBAA4C"}
@@ -0,0 +1,7 @@
1
+ import { defineCE, getCE } from '../../microcomponents.js';
2
+ console.log('testfunction.ts');
3
+ defineCE('test-testfunction', function testfunction(a, b) {
4
+ return a + b;
5
+ });
6
+ export default getCE('test-testfunction');
7
+ //# sourceMappingURL=testfunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testfunction.js","sourceRoot":"","sources":["../../../src/test/test/testfunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,CAAC,GAAG,CAAE,iBAAiB,CAAE,CAAC;AAEjC,QAAQ,CACJ,mBAAmB,EACnB,SAAS,YAAY,CAAE,CAAS,EAAE,CAAQ;IACtC,OAAO,CAAC,GAAG,CAAC,CAAC;AACjB,CAAC,CACJ,CAAC;AAEF,eAAe,KAAK,CAAE,mBAAmB,CAAE,CAAC"}
@@ -0,0 +1,12 @@
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,6 +1,3 @@
1
- import { DC } from './../../microcomponents.js';
2
- export default class testmc extends DC {
3
- constructor(target: HTMLElement);
4
- oneInit(): void;
5
- }
1
+ declare const _default: CustomElementConstructor | undefined;
2
+ export default _default;
6
3
  //# sourceMappingURL=testmc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"testmc.d.ts","sourceRoot":"","sources":["../../../src/test/test/testmc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,4BAA4B,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,EAAE;gBACtB,MAAM,EAAE,WAAW;IAK/B,OAAO;CAGV"}
1
+ {"version":3,"file":"testmc.d.ts","sourceRoot":"","sources":["../../../src/test/test/testmc.ts"],"names":[],"mappings":";AAeA,wBAAsC"}
@@ -1,10 +1,10 @@
1
- import { DC } from './../../microcomponents.js';
2
- export default class testmc extends DC {
1
+ import { defineCE, getCE, DC } from '../../microcomponents.js';
2
+ defineCE('test-testmc', class TestMc extends DC {
3
3
  constructor(target) {
4
4
  super(target);
5
- delete this._mc;
6
5
  }
7
6
  oneInit() {
8
7
  }
9
- }
8
+ });
9
+ export default getCE('test-testmc');
10
10
  //# sourceMappingURL=testmc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"testmc.js","sourceRoot":"","sources":["../../../src/test/test/testmc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,4BAA4B,CAAC;AAEhD,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"}
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"}
@@ -0,0 +1,16 @@
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' );
@@ -0,0 +1,3 @@
1
+ declare const _default: CustomElementConstructor | undefined;
2
+ export default _default;
3
+ //# sourceMappingURL=testsimpleclass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testsimpleclass.d.ts","sourceRoot":"","sources":["../../../src/test/test/testsimpleclass.ts"],"names":[],"mappings":";AAcA,wBAA+C"}
@@ -0,0 +1,9 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,15 @@
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' );
@@ -18,7 +18,6 @@ class Translator extends DC {
18
18
  that.Translation.bind(translationTargetObject);
19
19
  that.target.setAttribute('language', 'en');
20
20
  that.Language.notify();
21
- delete that._mc;
22
21
  }
23
22
  onAttributeChanged(ev) {
24
23
  if (!ev.data.newValue)
@@ -46,7 +45,6 @@ defineCE('my-tag', class MyTag extends DC {
46
45
  let that = this;
47
46
  target.innerHTML = this.#template;
48
47
  DC.add(target, 'translator', new Translator(target, that.#languages, target));
49
- delete that._mc;
50
48
  }
51
49
  oneInit(ev) {
52
50
  let that = this;
@@ -1 +1 @@
1
- {"version":3,"file":"test.js","sour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