@web-atoms/web-controls 2.3.308 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,90 +0,0 @@
1
- System.register(["@web-atoms/core/dist/core/AtomBridge", "@web-atoms/core/dist/web/controls/AtomControl"], function (_export, _context) {
2
- "use strict";
3
-
4
- var AtomBridge, AtomControl;
5
- function setupBridge() {}
6
- _export("default", setupBridge);
7
- return {
8
- setters: [function (_webAtomsCoreDistCoreAtomBridge) {
9
- AtomBridge = _webAtomsCoreDistCoreAtomBridge.AtomBridge;
10
- }, function (_webAtomsCoreDistWebControlsAtomControl) {
11
- AtomControl = _webAtomsCoreDistWebControlsAtomControl.AtomControl;
12
- }],
13
- execute: function () {
14
- AtomBridge.instance.createNode = function (target, node, binder, xNodeClass, creator) {
15
- let parent = null;
16
- const app = target.app;
17
- let e = null;
18
- if (typeof node.name === "string") {
19
- e = document.createElement(node.name);
20
- parent = e;
21
- } else {
22
- target = new node.name(app);
23
- e = target.element;
24
- parent = target;
25
- }
26
- const a = node.attributes;
27
- if (a) {
28
- for (const key in a) {
29
- if (a.hasOwnProperty(key)) {
30
- let element = a[key];
31
- if (element instanceof binder) {
32
- if (/^event/.test(key)) {
33
- let ev = key.substr(5);
34
- if (ev.startsWith("-")) {
35
- ev = ev.split("-").map(s => s[0].toLowerCase() + s.substr(1)).join("");
36
- } else {
37
- ev = ev[0].toLowerCase() + ev.substr(1);
38
- }
39
- element.setupFunction(ev, element, target, e);
40
- } else {
41
- element.setupFunction(key, element, target, e);
42
- }
43
- } else {
44
- if (element instanceof xNodeClass) {
45
- const templateNode = element;
46
- const name = templateNode.name;
47
- if (typeof name === "string") {
48
- element = ((bx, n) => class extends bx {
49
- create() {
50
- this.render(n);
51
- }
52
- })(creator, templateNode.children[0]);
53
- } else {
54
- element = ((base, n) => class extends base {
55
- create() {
56
- this.render(n);
57
- }
58
- })(name, templateNode.children[0]);
59
- }
60
- }
61
- target.setLocalValue(e, key, element);
62
- }
63
- }
64
- }
65
- }
66
- const children = node.children;
67
- if (children) {
68
- for (const iterator of children) {
69
- if (typeof iterator === "string") {
70
- e.appendChild(document.createTextNode(iterator));
71
- continue;
72
- }
73
- if (typeof iterator.name === "string") {
74
- e.appendChild(this.createNode(target, iterator, binder, xNodeClass, creator));
75
- } else {
76
- const child = this.createNode(target, iterator, binder, xNodeClass, creator);
77
- if (parent instanceof AtomControl) {
78
- parent.append(child.atomControl || child);
79
- } else {
80
- parent.appendChild(child);
81
- }
82
- }
83
- }
84
- }
85
- return e;
86
- };
87
- }
88
- };
89
- });
90
- //# sourceMappingURL=setupBridge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["setupBridge","_export","setters","_webAtomsCoreDistCoreAtomBridge","AtomBridge","_webAtomsCoreDistWebControlsAtomControl","AtomControl","execute","instance","createNode","target","node","binder","xNodeClass","creator","parent","app","e","name","document","createElement","element","a","attributes","key","hasOwnProperty","test","ev","substr","startsWith","split","map","s","toLowerCase","join","setupFunction","templateNode","bx","n","create","render","children","base","setLocalValue","iterator","appendChild","createTextNode","child","append","atomControl"],"sources":["../src/setupBridge.ts"],"sourcesContent":[null],"mappings":";;;;EAIc,SAAUA,WAAWA,CAAA,GAEnC;EAACC,OAAA,YAFuBD,WAAW;EAAA;IAAAE,OAAA,aAAAC,+BAAA;MAJ1BC,UAAU,GAAAD,+BAAA,CAAVC,UAAU;IAAA,aAAAC,uCAAA;MAEVC,WAAW,GAAAD,uCAAA,CAAXC,WAAW;IAAA;IAAAC,OAAA,WAAAA,CAAA;MAMpBH,UAAU,CAACI,QAAQ,CAACC,UAAU,GAAI,UACjCC,MAAW,EACXC,IAAW,EAEXC,MAAgB,EAEhBC,UAAoB,EAEpBC,OAAiB;QAEjB,IAAIC,MAAM,GAAG,IAAI;QAEjB,MAAMC,GAAG,GAAGN,MAAM,CAACM,GAAG;QACtB,IAAIC,CAAC,GAAgB,IAAI;QACzB,IAAI,OAAON,IAAI,CAAC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QAAQ,EAAEhC,MAAM,EAAEC,UAAU,EAAEC,OAAO,CAAC;cAC5E,IAAIC,MAAM,YAAYT,WAAW,EAAE;gBAClCS,MAAM,CAACiC,MAAM,CAACD,KAAK,CAACE,WAAW,IAAIF,KAAK,CAAC;eACzC,MAAM;gBACNhC,MAAM,CAAC8B,WAAW,CAACE,KAAK,CAAC;;;;;QAK7B,OAAO9B,CAAC;MACT,CAAC;IAAC;EAAA;AAAA"}
@@ -1,108 +0,0 @@
1
- import { AtomBridge } from "@web-atoms/core/dist/core/AtomBridge";
2
- import XNode from "@web-atoms/core/dist/core/XNode";
3
- import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl";
4
-
5
- export default function setupBridge() {
6
- // bridge is setup..
7
- }
8
-
9
- AtomBridge.instance.createNode = function(
10
- target: any,
11
- node: XNode,
12
- // tslint:disable-next-line: ban-types
13
- binder: Function,
14
- // tslint:disable-next-line: ban-types
15
- xNodeClass: Function,
16
- // tslint:disable-next-line: ban-types
17
- creator: Function): any {
18
-
19
- let parent = null;
20
-
21
- const app = target.app;
22
- let e: HTMLElement = null;
23
- if (typeof node.name === "string") {
24
- // it is simple node..
25
- e = document.createElement(node.name);
26
- parent = e;
27
- } else {
28
- target = new (node.name as any)(app);
29
- e = target.element;
30
- parent = target;
31
- // target.append(child);
32
- // const firstChild = node.children ? node.children[0] : null;
33
- // if (firstChild) {
34
- // const n = this.createNode(child, firstChild, binder, xNodeClass, creator);
35
- // child.append(n.atomControl || n);
36
- // }
37
- // return child.element;
38
- }
39
-
40
- const a = node.attributes;
41
- if (a) {
42
- for (const key in a) {
43
- if (a.hasOwnProperty(key)) {
44
- let element = a[key] as any;
45
- if (element instanceof binder) {
46
- if (/^event/.test(key)) {
47
- let ev = key.substr(5);
48
- if (ev.startsWith("-")) {
49
- ev = ev.split("-").map((s) => s[0].toLowerCase() + s.substr(1)).join("");
50
- } else {
51
- ev = ev[0].toLowerCase() + ev.substr(1);
52
- }
53
- (element as any).setupFunction(ev, element, target, e);
54
- } else {
55
- (element as any).setupFunction(key, element, target, e);
56
- }
57
- } else {
58
-
59
- // this is template...
60
- if (element instanceof xNodeClass) {
61
- const templateNode = element as any;
62
- const name = templateNode.name;
63
- if (typeof name === "string") {
64
- element = ((bx, n) => class extends bx {
65
-
66
- public create(): void {
67
- this.render(n);
68
- }
69
-
70
- })(creator as any, templateNode.children[0]);
71
-
72
- } else {
73
- element = ((base, n) => class extends base {
74
-
75
- public create(): void {
76
- this.render(n);
77
- }
78
-
79
- })(name, templateNode.children[0]);
80
- }
81
- }
82
- target.setLocalValue(e, key, element);
83
- }
84
- }
85
- }
86
- }
87
-
88
- const children = node.children;
89
- if (children) {
90
- for (const iterator of children) {
91
- if (typeof iterator === "string") {
92
- e.appendChild(document.createTextNode(iterator));
93
- continue;
94
- }
95
- if (typeof iterator.name === "string") {
96
- e.appendChild(this.createNode(target, iterator, binder, xNodeClass, creator));
97
- } else {
98
- const child = this.createNode(target, iterator, binder, xNodeClass, creator);
99
- if (parent instanceof AtomControl) {
100
- parent.append(child.atomControl || child);
101
- } else {
102
- parent.appendChild(child);
103
- }
104
- }
105
- }
106
- }
107
- return e;
108
- };