Skip to content

Commit 11f0f76

Browse files
committed
enable bindings now used
1 parent fbeef1e commit 11f0f76

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/DeclaritiveBaseCustomWebcomponent.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ function camelToDashCase(text: string) {
77
class BaseDeclaritiveWebcomponent extends BaseCustomWebComponentConstructorAppend {
88
constructor() {
99
super();
10-
this._bindingsParse(null, true);
10+
//@ts-ignore
11+
if (this.constructor._enableBindings)
12+
this._bindingsParse(null, true);
1113
}
1214

1315
async connectedCallback() {
1416
this._parseAttributesToProperties();
15-
this._bindingsRefresh();
17+
//@ts-ignore
18+
if (this.constructor._enableBindings)
19+
this._bindingsRefresh();
1620
}
1721
}
1822

@@ -59,7 +63,9 @@ class DeclaritiveBaseCustomWebcomponent extends BaseCustomWebComponentNoAttached
5963
set(newValue) {
6064
if (this['_' + p] !== newValue) {
6165
this['_' + p] = newValue;
62-
this._bindingsRefresh(p);
66+
//@ts-ignore
67+
if (this.constructor._enableBindings)
68+
this._bindingsRefresh(p);
6369
instance.dispatchEvent(new CustomEvent(camelToDashCase(p) + '-changed', { detail: { newValue } }));
6470
}
6571
},
@@ -76,6 +82,7 @@ class DeclaritiveBaseCustomWebcomponent extends BaseCustomWebComponentNoAttached
7682
//window[name].style = style;
7783
window[name].properties = props;
7884
window[name]._propertiesDictionary = null;
85+
window[name]._enableBindings = this.enableBindings;
7986
window[name].prototype = Object.create(BaseDeclaritiveWebcomponent.prototype, { constructor: { value: window[name] } })
8087
if (!customElements.get(name))
8188
customElements.define(name, window[name]);

0 commit comments

Comments
 (0)