@mintjamsinc/ichigojs 0.1.45 → 0.1.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/dist/ichigo.cjs +18 -16
- package/dist/ichigo.cjs.map +1 -1
- package/dist/ichigo.esm.js +18 -16
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -1
- package/dist/ichigo.min.cjs +1 -1
- package/dist/ichigo.umd.js +18 -16
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/ichigo.cjs
CHANGED
|
@@ -7501,13 +7501,15 @@
|
|
|
7501
7501
|
}
|
|
7502
7502
|
else if (typeof cls === 'object' && cls !== null) {
|
|
7503
7503
|
// Handle object format within array: { className: condition }
|
|
7504
|
-
|
|
7504
|
+
// Keys may contain space-separated class names
|
|
7505
|
+
return Object.keys(cls).filter(key => cls[key]).flatMap(key => key.split(/\s+/).filter(Boolean));
|
|
7505
7506
|
}
|
|
7506
7507
|
return [];
|
|
7507
7508
|
});
|
|
7508
7509
|
}
|
|
7509
7510
|
else if (typeof value === 'object' && value !== null) {
|
|
7510
|
-
|
|
7511
|
+
// Keys may contain space-separated class names
|
|
7512
|
+
newClasses = Object.keys(value).filter(key => value[key]).flatMap(key => key.split(/\s+/).filter(Boolean));
|
|
7511
7513
|
}
|
|
7512
7514
|
// Remove previously managed classes
|
|
7513
7515
|
this.#managedClasses.forEach(cls => element.classList.remove(cls));
|
|
@@ -12626,7 +12628,7 @@
|
|
|
12626
12628
|
#initializeBindings() {
|
|
12627
12629
|
// Create bindings with change tracking
|
|
12628
12630
|
this.#bindings = new VBindings({
|
|
12629
|
-
onChange: (
|
|
12631
|
+
onChange: () => {
|
|
12630
12632
|
this.#scheduleUpdate();
|
|
12631
12633
|
},
|
|
12632
12634
|
vApplication: this
|
|
@@ -12804,17 +12806,20 @@
|
|
|
12804
12806
|
processing.add(key);
|
|
12805
12807
|
// Get the dependencies for this computed property
|
|
12806
12808
|
const deps = this.#computedDependencies[key] || [];
|
|
12807
|
-
//
|
|
12808
|
-
|
|
12809
|
-
|
|
12810
|
-
return;
|
|
12811
|
-
}
|
|
12812
|
-
// First, recursively compute any dependent computed properties
|
|
12809
|
+
// First, recursively compute any dependent computed properties.
|
|
12810
|
+
// This must happen before the change check so that computed→computed
|
|
12811
|
+
// dependency chains are resolved and allChanges is up-to-date.
|
|
12813
12812
|
for (const dep of deps) {
|
|
12814
12813
|
if (this.#options.computed[dep]) {
|
|
12815
12814
|
compute(dep);
|
|
12816
12815
|
}
|
|
12817
12816
|
}
|
|
12817
|
+
// If none of the dependencies have changed, skip recomputation (unless it's initialization).
|
|
12818
|
+
// Checked after recursive computation to detect transitive changes through computed properties.
|
|
12819
|
+
if (!isInitialization && !deps.some(dep => allChanges.has(dep))) {
|
|
12820
|
+
computed.add(key);
|
|
12821
|
+
return;
|
|
12822
|
+
}
|
|
12818
12823
|
// Now compute this property
|
|
12819
12824
|
const computedFn = this.#options.computed[key];
|
|
12820
12825
|
try {
|
|
@@ -12856,13 +12861,10 @@
|
|
|
12856
12861
|
computed.add(key);
|
|
12857
12862
|
processing.delete(key);
|
|
12858
12863
|
};
|
|
12859
|
-
//
|
|
12860
|
-
|
|
12861
|
-
|
|
12862
|
-
|
|
12863
|
-
if (isInitialization || deps.some(dep => allChanges.has(dep))) {
|
|
12864
|
-
compute(key);
|
|
12865
|
-
}
|
|
12864
|
+
// Compute all properties; the recursive logic inside compute() handles
|
|
12865
|
+
// dependency ordering and skips properties whose dependencies did not change.
|
|
12866
|
+
for (const key of Object.keys(this.#computedDependencies)) {
|
|
12867
|
+
compute(key);
|
|
12866
12868
|
}
|
|
12867
12869
|
}
|
|
12868
12870
|
/**
|