mountain-ui 1.0.72 → 1.0.73
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.73",
|
|
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",
|
package/src/lib/registry/entryActionTypeRegistry/entryActionTypes/PrefillNewEntry/Properties.svelte
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
props = $bindable({
|
|
14
14
|
fromEntityId: null,
|
|
15
15
|
toEntityId: null,
|
|
16
|
-
bindings:
|
|
16
|
+
bindings: [] //[
|
|
17
17
|
// {
|
|
18
18
|
// fromFieldId:null,
|
|
19
19
|
// toFieldId:null,
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
onChange = (props) => {}
|
|
36
36
|
} = $props();
|
|
37
37
|
|
|
38
|
+
|
|
38
39
|
let fromEntityId = $derived(props.fromEntityId);
|
|
39
40
|
let toEntityId = $derived(props.toEntityId);
|
|
40
41
|
|
|
@@ -43,29 +44,13 @@
|
|
|
43
44
|
|
|
44
45
|
let isMounted = $state(false);
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
isMounted = true
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
$effect(() => {
|
|
51
|
-
const newProps = getProps(fromEntityId, toEntityId);
|
|
52
|
-
|
|
53
|
-
if (newProps === null) return
|
|
54
|
-
|
|
55
|
-
props = {...newProps}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
function getProps() {
|
|
59
|
-
if (!isMounted && props.bindings !== null) {
|
|
60
|
-
return props
|
|
61
|
-
}
|
|
62
|
-
|
|
47
|
+
function updateBindings() {
|
|
63
48
|
let newProps = {
|
|
64
49
|
fromEntityId: fromEntityId,
|
|
65
50
|
toEntityId: toEntityId
|
|
66
51
|
};
|
|
67
52
|
if (!fromEntity) {
|
|
68
|
-
|
|
53
|
+
props = {
|
|
69
54
|
...newProps,
|
|
70
55
|
bindings: []
|
|
71
56
|
};
|
|
@@ -81,7 +66,7 @@
|
|
|
81
66
|
});
|
|
82
67
|
}
|
|
83
68
|
|
|
84
|
-
|
|
69
|
+
props = {
|
|
85
70
|
...newProps,
|
|
86
71
|
bindings: [...newBindings]
|
|
87
72
|
};
|
|
@@ -90,11 +75,29 @@
|
|
|
90
75
|
function getBinding(fieldId) {
|
|
91
76
|
return props.bindings?.find((binding) => binding?.fromFieldId === fieldId);
|
|
92
77
|
}
|
|
78
|
+
|
|
79
|
+
function handleChangeFromEntityId(entity) {
|
|
80
|
+
props = {
|
|
81
|
+
...props,
|
|
82
|
+
fromEntityId: entity.id
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
updateBindings();
|
|
86
|
+
}
|
|
87
|
+
function handleChangeToEntityId(entity) {
|
|
88
|
+
props = {
|
|
89
|
+
...props,
|
|
90
|
+
toEntityId: entity.id
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
updateBindings();
|
|
94
|
+
}
|
|
93
95
|
</script>
|
|
94
96
|
|
|
95
97
|
<div class="props">
|
|
96
98
|
<div class="transfer">
|
|
97
|
-
<EntitiesSelector
|
|
99
|
+
<EntitiesSelector activeEntityId={fromEntityId} onChange={handleChangeFromEntityId}
|
|
100
|
+
></EntitiesSelector>
|
|
98
101
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
99
102
|
<path
|
|
100
103
|
d="M14.4291 18.8201C14.2391 18.8201 14.0491 18.7501 13.8991 18.6001C13.6091 18.3101 13.6091 17.8301 13.8991 17.5401L19.4391 12.0001L13.8991 6.46012C13.6091 6.17012 13.6091 5.69012 13.8991 5.40012C14.1891 5.11012 14.6691 5.11012 14.9591 5.40012L21.0291 11.4701C21.3191 11.7601 21.3191 12.2401 21.0291 12.5301L14.9591 18.6001C14.8091 18.7501 14.6191 18.8201 14.4291 18.8201Z"
|
|
@@ -106,7 +109,8 @@
|
|
|
106
109
|
/>
|
|
107
110
|
</svg>
|
|
108
111
|
|
|
109
|
-
<EntitiesSelector
|
|
112
|
+
<EntitiesSelector activeEntityId={toEntityId} onChange={handleChangeToEntityId}
|
|
113
|
+
></EntitiesSelector>
|
|
110
114
|
</div>
|
|
111
115
|
|
|
112
116
|
{#if fromEntity && toEntity}
|