mountain-ui 1.0.77 → 1.0.78

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mountain-ui",
3
3
  "private": false,
4
- "version": "1.0.77",
4
+ "version": "1.0.78",
5
5
  "description": "A comprehensive UI component library for ERP systems with field types, entities, and registry management built with Svelte",
6
6
  "type": "module",
7
7
  "module": "index.js",
@@ -47,6 +47,16 @@
47
47
  };
48
48
  }
49
49
 
50
+ function recalculateAll(lineIndex) {
51
+ if (!calculations[lineIndex]) return;
52
+
53
+ for (const calc of Object.values(calculations[lineIndex])) {
54
+ calc.calculate(table[lineIndex].ctx);
55
+ }
56
+
57
+ table = [...table];
58
+ }
59
+
50
60
  function handleAddLine() {
51
61
  table = [...table, createLine()];
52
62
  }
@@ -85,6 +95,10 @@
85
95
  calculations[lineIndex][config.id] = config;
86
96
 
87
97
  calculations = { ...calculations };
98
+
99
+ // Les valeurs initiales de la ligne existent déjà,
100
+ // on lance donc les calculs après l'enregistrement.
101
+ recalculateAll(lineIndex);
88
102
  }
89
103
 
90
104
  function handleChange(lineIndex, fieldId, value) {