element-vir 9.2.1 → 9.2.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.
|
@@ -54,6 +54,7 @@ export function defineElementNoInputs(initInput) {
|
|
|
54
54
|
!elementOptions[IgnoreInputsNotBeenSetBeforeRenderWarningSymbol]) {
|
|
55
55
|
console.warn(this, `${initInput.tagName} got rendered before its input object was set. This was most likely caused by forgetting to use the "${assign.name}" directive on it. If no inputs are intended, use "${defineElementNoInputs.name}" to define ${initInput.tagName}.`);
|
|
56
56
|
}
|
|
57
|
+
this.hasRendered = true;
|
|
57
58
|
const renderParams = this.createRenderParams();
|
|
58
59
|
if (!this.initCalled && initInput.initCallback) {
|
|
59
60
|
this.initCalled = true;
|
|
@@ -69,6 +70,14 @@ export function defineElementNoInputs(initInput) {
|
|
|
69
70
|
});
|
|
70
71
|
return renderResult;
|
|
71
72
|
}
|
|
73
|
+
connectedCallback() {
|
|
74
|
+
super.connectedCallback();
|
|
75
|
+
if (this.hasRendered && !this.initCalled && initInput.initCallback) {
|
|
76
|
+
this.initCalled = true;
|
|
77
|
+
const renderParams = this.createRenderParams();
|
|
78
|
+
initInput.initCallback(renderParams);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
72
81
|
disconnectedCallback() {
|
|
73
82
|
super.disconnectedCallback();
|
|
74
83
|
if (initInput.cleanupCallback) {
|
|
@@ -87,6 +96,7 @@ export function defineElementNoInputs(initInput) {
|
|
|
87
96
|
constructor() {
|
|
88
97
|
super();
|
|
89
98
|
this.initCalled = false;
|
|
99
|
+
this.hasRendered = false;
|
|
90
100
|
this.haveInputsBeenSet = false;
|
|
91
101
|
// this is set below in Object.defineProperties
|
|
92
102
|
this.definition = {};
|