mountain-ui 1.0.76 → 1.0.77
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.
|
|
4
|
+
"version": "1.0.77",
|
|
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",
|
|
@@ -10,6 +10,23 @@
|
|
|
10
10
|
|
|
11
11
|
const entity = $derived(entityRegistry.select(entityId));
|
|
12
12
|
|
|
13
|
+
let initialized = $state(false);
|
|
14
|
+
|
|
15
|
+
$effect(() => {
|
|
16
|
+
if (!initialized && Object.keys(calculations).length > 0) {
|
|
17
|
+
initialized = true;
|
|
18
|
+
recalculateAll();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
function recalculateAll() {
|
|
23
|
+
for (const calc of Object.values(calculations)) {
|
|
24
|
+
calc.calculate(ctx);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
ctx = { ...ctx };
|
|
28
|
+
}
|
|
29
|
+
|
|
13
30
|
function handleSubmit() {
|
|
14
31
|
onSubmit({ ...ctx });
|
|
15
32
|
}
|
|
@@ -33,14 +50,14 @@
|
|
|
33
50
|
function handleChangeDetails(fieldId, value) {
|
|
34
51
|
detailsCtx[fieldId] = value;
|
|
35
52
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
53
|
+
// si c est un type lien alors on parcour ses champs enfant et on reagis
|
|
54
|
+
const field = entityRegistry.getField(fieldId, entity.id);
|
|
55
|
+
if (field.type === 'link') {
|
|
56
|
+
const entity = entityRegistry.get(field.props.linkId);
|
|
57
|
+
for (const linkedFields of entity.fields) {
|
|
58
|
+
recalculate(linkedFields.id);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
44
61
|
|
|
45
62
|
detailsCtx = { ...detailsCtx };
|
|
46
63
|
}
|
|
@@ -89,7 +106,7 @@
|
|
|
89
106
|
display: flex;
|
|
90
107
|
flex-direction: column;
|
|
91
108
|
align-items: center;
|
|
92
|
-
|
|
109
|
+
width: 100%;
|
|
93
110
|
}
|
|
94
111
|
|
|
95
112
|
.button {
|