@mintjamsinc/ichigojs 0.1.15 → 0.1.17
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 +39 -8
- 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 +39 -8
- 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 +6 -0
- package/dist/types/ichigo/directives/VDirectiveManager.d.ts +6 -0
- package/package.json +1 -1
package/dist/ichigo.esm.js
CHANGED
@@ -7322,7 +7322,12 @@ class VComponentDirective {
|
|
7322
7322
|
get onUnmounted() {
|
7323
7323
|
return undefined;
|
7324
7324
|
}
|
7325
|
-
|
7325
|
+
/**
|
7326
|
+
* Clones the component's template and returns the root element.
|
7327
|
+
* @returns The cloned root HTMLElement of the component.
|
7328
|
+
* @throws Error if the component or its template is not found.
|
7329
|
+
*/
|
7330
|
+
cloneNode() {
|
7326
7331
|
// Get component definition from the application's component registry
|
7327
7332
|
const component = this.#vNode.vApplication.componentRegistry.get(this.#componentId);
|
7328
7333
|
if (!component) {
|
@@ -7370,8 +7375,6 @@ class VComponentDirective {
|
|
7370
7375
|
// Already rendered, no action needed
|
7371
7376
|
return;
|
7372
7377
|
}
|
7373
|
-
const clone = this.#cloneNode();
|
7374
|
-
this.#vNode.anchorNode?.parentNode?.insertBefore(clone, this.#vNode.anchorNode.nextSibling);
|
7375
7378
|
// Get properties from :options or :options.component directive
|
7376
7379
|
let properties = {};
|
7377
7380
|
const optionsDirective = this.#vNode.directiveManager?.optionsDirective('component');
|
@@ -7396,7 +7399,7 @@ class VComponentDirective {
|
|
7396
7399
|
const instance = component.createInstance(properties);
|
7397
7400
|
// Create and mount child application using the parent application's registries
|
7398
7401
|
this.#componentApp = this.#vNode.vApplication.createChildApp(instance);
|
7399
|
-
this.#componentApp.mount(
|
7402
|
+
this.#componentApp.mount(this.#vNode.node);
|
7400
7403
|
}
|
7401
7404
|
}
|
7402
7405
|
|
@@ -7731,6 +7734,11 @@ class VDirectiveManager {
|
|
7731
7734
|
* The keys are directive names (e.g., 'options', 'options.intersection').
|
7732
7735
|
*/
|
7733
7736
|
#optionsDirectives = {};
|
7737
|
+
/**
|
7738
|
+
* The v-component directive associated with this node, if any.
|
7739
|
+
* This may be undefined if there is no v-component directive.
|
7740
|
+
*/
|
7741
|
+
#componentDirective;
|
7734
7742
|
constructor(vNode) {
|
7735
7743
|
// Directives can only be associated with element nodes
|
7736
7744
|
if (vNode.nodeType !== Node.ELEMENT_NODE) {
|
@@ -7788,6 +7796,13 @@ class VDirectiveManager {
|
|
7788
7796
|
get keyDirective() {
|
7789
7797
|
return this.#keyDirective;
|
7790
7798
|
}
|
7799
|
+
/**
|
7800
|
+
* Gets the v-component directive associated with this node, if any.
|
7801
|
+
* This may be undefined if there is no v-component directive.
|
7802
|
+
*/
|
7803
|
+
get componentDirective() {
|
7804
|
+
return this.#componentDirective;
|
7805
|
+
}
|
7791
7806
|
/**
|
7792
7807
|
* Gets the VBindDirective for options specific to the given directive name.
|
7793
7808
|
* Searches in order: `:options.{directive}` -> `:options`
|
@@ -7877,6 +7892,10 @@ class VDirectiveManager {
|
|
7877
7892
|
this.#optionsDirectives[attrName] = bindDirective;
|
7878
7893
|
}
|
7879
7894
|
}
|
7895
|
+
// If this is a v-component directive, store it separately
|
7896
|
+
if (directive.name === StandardDirectiveName.V_COMPONENT) {
|
7897
|
+
this.#componentDirective = directive;
|
7898
|
+
}
|
7880
7899
|
}
|
7881
7900
|
}
|
7882
7901
|
// Sort directives by priority: v-for > v-if > v-else-if > v-else > v-show > others
|
@@ -8830,8 +8849,14 @@ class VConditionalDirective {
|
|
8830
8849
|
*/
|
8831
8850
|
#cloneTemplate() {
|
8832
8851
|
// Clone the original element
|
8833
|
-
|
8834
|
-
|
8852
|
+
let clone;
|
8853
|
+
if (this.vNode.directiveManager?.componentDirective) {
|
8854
|
+
clone = this.vNode.directiveManager.componentDirective.cloneNode();
|
8855
|
+
}
|
8856
|
+
else {
|
8857
|
+
const element = this.#vNode.node;
|
8858
|
+
clone = element.cloneNode(true);
|
8859
|
+
}
|
8835
8860
|
// Create a new VNode for the cloned element
|
8836
8861
|
const vNode = new VNode({
|
8837
8862
|
node: clone,
|
@@ -9266,8 +9291,14 @@ class VForDirective {
|
|
9266
9291
|
*/
|
9267
9292
|
#cloneTemplate(context) {
|
9268
9293
|
// Clone the original element
|
9269
|
-
|
9270
|
-
|
9294
|
+
let clone;
|
9295
|
+
if (this.vNode.directiveManager?.componentDirective) {
|
9296
|
+
clone = this.vNode.directiveManager.componentDirective.cloneNode();
|
9297
|
+
}
|
9298
|
+
else {
|
9299
|
+
const element = this.#vNode.node;
|
9300
|
+
clone = element.cloneNode(true);
|
9301
|
+
}
|
9271
9302
|
// Prepare identifiers for the item
|
9272
9303
|
this.#itemName;
|
9273
9304
|
this.#indexName;
|