@mintjamsinc/ichigojs 0.1.14 → 0.1.16
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/dist/ichigo.esm.js +37 -38
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -1
- package/dist/ichigo.esm.min.js.map +1 -1
- package/dist/ichigo.umd.js +37 -38
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -1
- package/dist/ichigo.umd.min.js.map +1 -1
- package/dist/types/ichigo/directives/VComponentDirective.d.ts +5 -0
- package/package.json +1 -1
package/dist/ichigo.umd.js
CHANGED
@@ -6962,14 +6962,13 @@
|
|
6962
6962
|
*/
|
6963
6963
|
get domUpdater() {
|
6964
6964
|
const identifiers = this.#dependentIdentifiers ?? [];
|
6965
|
-
const render = () => this.#render();
|
6966
6965
|
// Create an updater that handles the attribute binding
|
6967
6966
|
const updater = {
|
6968
6967
|
get dependentIdentifiers() {
|
6969
6968
|
return identifiers;
|
6970
6969
|
},
|
6971
|
-
applyToDOM() {
|
6972
|
-
render();
|
6970
|
+
applyToDOM: () => {
|
6971
|
+
this.#render();
|
6973
6972
|
}
|
6974
6973
|
};
|
6975
6974
|
return updater;
|
@@ -7233,13 +7232,9 @@
|
|
7233
7232
|
*/
|
7234
7233
|
#componentId;
|
7235
7234
|
/**
|
7236
|
-
* The
|
7237
|
-
*/
|
7238
|
-
#childApp;
|
7239
|
-
/**
|
7240
|
-
* Whether the component has been activated.
|
7235
|
+
* The application instance for the component.
|
7241
7236
|
*/
|
7242
|
-
#
|
7237
|
+
#componentApp;
|
7243
7238
|
constructor(context) {
|
7244
7239
|
this.#vNode = context.vNode;
|
7245
7240
|
this.#componentId = context.attribute.value.trim();
|
@@ -7280,9 +7275,7 @@
|
|
7280
7275
|
return [];
|
7281
7276
|
},
|
7282
7277
|
applyToDOM: () => {
|
7283
|
-
|
7284
|
-
this.#renderComponent();
|
7285
|
-
}
|
7278
|
+
this.#render();
|
7286
7279
|
}
|
7287
7280
|
};
|
7288
7281
|
return updater;
|
@@ -7291,7 +7284,7 @@
|
|
7291
7284
|
* @inheritdoc
|
7292
7285
|
*/
|
7293
7286
|
get templatize() {
|
7294
|
-
return
|
7287
|
+
return true;
|
7295
7288
|
}
|
7296
7289
|
/**
|
7297
7290
|
* @inheritdoc
|
@@ -7327,7 +7320,7 @@
|
|
7327
7320
|
* @inheritdoc
|
7328
7321
|
*/
|
7329
7322
|
get onUnmount() {
|
7330
|
-
return
|
7323
|
+
return undefined;
|
7331
7324
|
}
|
7332
7325
|
/**
|
7333
7326
|
* @inheritdoc
|
@@ -7335,6 +7328,11 @@
|
|
7335
7328
|
get onUnmounted() {
|
7336
7329
|
return undefined;
|
7337
7330
|
}
|
7331
|
+
/**
|
7332
|
+
* Clones the component's template and returns the root element.
|
7333
|
+
* @returns The cloned root HTMLElement of the component.
|
7334
|
+
* @throws Error if the component or its template is not found.
|
7335
|
+
*/
|
7338
7336
|
cloneNode() {
|
7339
7337
|
// Get component definition from the application's component registry
|
7340
7338
|
const component = this.#vNode.vApplication.componentRegistry.get(this.#componentId);
|
@@ -7362,12 +7360,27 @@
|
|
7362
7360
|
* @inheritdoc
|
7363
7361
|
*/
|
7364
7362
|
destroy() {
|
7365
|
-
this.#
|
7363
|
+
if (!this.#componentApp) {
|
7364
|
+
// Not rendered, no action needed
|
7365
|
+
return;
|
7366
|
+
}
|
7367
|
+
// Destroy component application first (calls @unmount hooks while DOM is still accessible)
|
7368
|
+
this.#componentApp.unmount();
|
7369
|
+
// Then remove from DOM
|
7370
|
+
const componentVNode = this.#componentApp.rootVNode;
|
7371
|
+
if (componentVNode?.node.parentNode) {
|
7372
|
+
componentVNode.node.parentNode.removeChild(componentVNode.node);
|
7373
|
+
}
|
7374
|
+
this.#componentApp = undefined;
|
7366
7375
|
}
|
7367
7376
|
/**
|
7368
7377
|
* Renders the component.
|
7369
7378
|
*/
|
7370
|
-
#
|
7379
|
+
#render() {
|
7380
|
+
if (this.#componentApp) {
|
7381
|
+
// Already rendered, no action needed
|
7382
|
+
return;
|
7383
|
+
}
|
7371
7384
|
// Get properties from :options or :options.component directive
|
7372
7385
|
let properties = {};
|
7373
7386
|
const optionsDirective = this.#vNode.directiveManager?.optionsDirective('component');
|
@@ -7391,19 +7404,8 @@
|
|
7391
7404
|
// Create component instance
|
7392
7405
|
const instance = component.createInstance(properties);
|
7393
7406
|
// Create and mount child application using the parent application's registries
|
7394
|
-
this.#
|
7395
|
-
this.#
|
7396
|
-
this.#isActivated = true;
|
7397
|
-
}
|
7398
|
-
/**
|
7399
|
-
* Cleans up the component.
|
7400
|
-
*/
|
7401
|
-
#cleanupComponent() {
|
7402
|
-
if (this.#childApp) {
|
7403
|
-
this.#childApp.unmount();
|
7404
|
-
this.#childApp = undefined;
|
7405
|
-
}
|
7406
|
-
this.#isActivated = false;
|
7407
|
+
this.#componentApp = this.#vNode.vApplication.createChildApp(instance);
|
7408
|
+
this.#componentApp.mount(this.#vNode.node);
|
7407
7409
|
}
|
7408
7410
|
}
|
7409
7411
|
|
@@ -8711,14 +8713,13 @@
|
|
8711
8713
|
*/
|
8712
8714
|
get domUpdater() {
|
8713
8715
|
const identifiers = this.#conditionalContext.allDependentIdentifiers;
|
8714
|
-
const render = () => this.#render();
|
8715
8716
|
// Create an updater that handles the conditional rendering
|
8716
8717
|
const updater = {
|
8717
8718
|
get dependentIdentifiers() {
|
8718
8719
|
return identifiers;
|
8719
8720
|
},
|
8720
|
-
applyToDOM() {
|
8721
|
-
render();
|
8721
|
+
applyToDOM: () => {
|
8722
|
+
this.#render();
|
8722
8723
|
}
|
8723
8724
|
};
|
8724
8725
|
return updater;
|
@@ -9058,14 +9059,13 @@
|
|
9058
9059
|
*/
|
9059
9060
|
get domUpdater() {
|
9060
9061
|
const identifiers = this.#dependentIdentifiers ?? [];
|
9061
|
-
const render = () => this.#render();
|
9062
9062
|
// Create and return the DOM updater
|
9063
9063
|
const updater = {
|
9064
9064
|
get dependentIdentifiers() {
|
9065
9065
|
return identifiers;
|
9066
9066
|
},
|
9067
|
-
applyToDOM() {
|
9068
|
-
render();
|
9067
|
+
applyToDOM: () => {
|
9068
|
+
this.#render();
|
9069
9069
|
}
|
9070
9070
|
};
|
9071
9071
|
return updater;
|
@@ -9700,14 +9700,13 @@
|
|
9700
9700
|
*/
|
9701
9701
|
get domUpdater() {
|
9702
9702
|
const identifiers = this.#dependentIdentifiers ?? [];
|
9703
|
-
const render = () => this.#render();
|
9704
9703
|
// Create and return the DOM updater
|
9705
9704
|
const updater = {
|
9706
9705
|
get dependentIdentifiers() {
|
9707
9706
|
return identifiers;
|
9708
9707
|
},
|
9709
|
-
applyToDOM() {
|
9710
|
-
render();
|
9708
|
+
applyToDOM: () => {
|
9709
|
+
this.#render();
|
9711
9710
|
}
|
9712
9711
|
};
|
9713
9712
|
return updater;
|