mountain-ui 1.0.57 → 1.0.58
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 +1 -1
- package/src/lib/registry/entryActionRegistry/components/EntryActionButton.svelte +1 -2
- package/src/lib/registry/entryActionRegistry/components/EntryActionsButtons.svelte +1 -1
- package/src/lib/registry/entryActionTypeRegistry/createEntryActionType.js +1 -1
- package/src/lib/registry/entryActionTypeRegistry/entryActionTypes/PrefillNewEntry/index.js +3 -4
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.58",
|
|
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",
|
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
const entity = $derived(entityRegistry.get(entityId))
|
|
12
12
|
const entryAction = $derived(entryActionRegistry.select(id))
|
|
13
13
|
const entryActionType = $derived($entryAction.type ? entryActionTypeRegistry.select($entryAction.type) : null)
|
|
14
|
-
console.log($entryActionType);
|
|
15
14
|
</script>
|
|
16
15
|
|
|
17
16
|
{#if entity && $entryAction && $entryActionType && $entryActionType.canPerformAction(entity, entry, $entryAction.props)}
|
|
18
|
-
<Button {variant} onClick={()=>{$entryActionType.action(entity, entry, $entryAction.props)}} {...props}>
|
|
17
|
+
<Button {variant} onClick={()=>{$entryActionType.action(entity, entry, $entryAction.props, props)}} {...props}>
|
|
19
18
|
<h5>{$entryAction.name}</h5>
|
|
20
19
|
</Button>
|
|
21
20
|
{/if}
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
{#if $allActions && entity}
|
|
15
15
|
{#each $allActions as action}
|
|
16
|
-
<EntryActionButton id={action.id} entityId={entity.id} {entry}></EntryActionButton>
|
|
16
|
+
<EntryActionButton id={action.id} entityId={entity.id} {entry} style="width:100%;"></EntryActionButton>
|
|
17
17
|
{/each}
|
|
18
18
|
{/if}
|
|
@@ -8,7 +8,7 @@ export function createEntryActionType(config = {}) {
|
|
|
8
8
|
defaultProps:{},
|
|
9
9
|
getEntityIdFromProps:(props)=>{},
|
|
10
10
|
canPerformAction:(entity, entry, props)=>{},
|
|
11
|
-
action:(entity, entry, props)=>{},
|
|
11
|
+
action:(entity, entry, props, componentProps)=>{},
|
|
12
12
|
components: {
|
|
13
13
|
button:null,
|
|
14
14
|
properties:null,
|
|
@@ -28,7 +28,7 @@ export default createEntryActionType({
|
|
|
28
28
|
canPerformAction: (entity, entry, props) => {
|
|
29
29
|
if (props.fromEntityId === entity.id) return true
|
|
30
30
|
},
|
|
31
|
-
action: (entity, entry, props) => {
|
|
31
|
+
action: (entity, entry, props, componentProps) => {
|
|
32
32
|
const toEntity = entityRegistry.get(props?.toEntityId ?? null)
|
|
33
33
|
if (!toEntity) {
|
|
34
34
|
return
|
|
@@ -37,9 +37,8 @@ export default createEntryActionType({
|
|
|
37
37
|
// ici il faut convertir l entrée avec les valeur binder
|
|
38
38
|
const newEntryCtx = createNewCtxFromBinding(entity, entry, props.bindings)
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
goto(
|
|
42
|
-
|
|
40
|
+
// calculer le href
|
|
41
|
+
goto(componentProps.getHref(entity, entry, props, componentProps))
|
|
43
42
|
},
|
|
44
43
|
components: {
|
|
45
44
|
card: Card,
|