neo.mjs 4.0.46 → 4.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/component/Base.mjs
CHANGED
|
@@ -1007,7 +1007,7 @@ class Base extends CoreBase {
|
|
|
1007
1007
|
* @returns {Promise<*>}
|
|
1008
1008
|
*/
|
|
1009
1009
|
getDomRect(id=this.id, appName=this.appName) {
|
|
1010
|
-
return Neo.main.DomAccess.getBoundingClientRect({
|
|
1010
|
+
return Neo.main.DomAccess.getBoundingClientRect({appName, id});
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
1013
|
/**
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Base from '../../core/Base.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Addon to register WebComponents
|
|
5
|
+
* @class Neo.main.addon.WebComponent
|
|
6
|
+
* @extends Neo.core.Base
|
|
7
|
+
* @singleton
|
|
8
|
+
*/
|
|
9
|
+
class WebComponent extends Base {
|
|
10
|
+
static getConfig() {return {
|
|
11
|
+
/**
|
|
12
|
+
* @member {String} className='Neo.main.addon.WebComponent'
|
|
13
|
+
* @protected
|
|
14
|
+
*/
|
|
15
|
+
className: 'Neo.main.addon.WebComponent',
|
|
16
|
+
/**
|
|
17
|
+
* @member {Boolean} singleton=true
|
|
18
|
+
* @protected
|
|
19
|
+
*/
|
|
20
|
+
singleton: true
|
|
21
|
+
}}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param {Object} config
|
|
25
|
+
*/
|
|
26
|
+
construct(config) {
|
|
27
|
+
super.construct(config);
|
|
28
|
+
|
|
29
|
+
this.registerElementLoader();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
registerElementLoader() {
|
|
36
|
+
customElements.define('element-loader', class extends HTMLElement {
|
|
37
|
+
async connectedCallback() {
|
|
38
|
+
let me = this,
|
|
39
|
+
content = await (await fetch(me.getAttribute('src'))).text();
|
|
40
|
+
|
|
41
|
+
me.attachShadow({mode: 'open'}).innerHTML = content;
|
|
42
|
+
me.shadowRoot.append(me.querySelector('style'));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Neo.applyClassConfig(WebComponent);
|
|
49
|
+
|
|
50
|
+
let instance = Neo.create(WebComponent);
|
|
51
|
+
|
|
52
|
+
Neo.applyToGlobalNs(instance);
|
|
53
|
+
|
|
54
|
+
export default instance;
|