mountain-ui 1.0.56 → 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/index.d.ts CHANGED
@@ -53,3 +53,24 @@ export { registerDefaultViewEntriesTypes } from './src/lib/registry/viewEntriesT
53
53
 
54
54
  export { default as ViewEntriesTypeButton } from './src/lib/registry/viewEntriesTypeRegistry/components/ViewEntriesTypeButton.svelte';
55
55
  export { default as ViewEntriesTypeComponent } from './src/lib/registry/viewEntriesTypeRegistry/components/ViewEntriesTypeComponent.svelte';
56
+
57
+ // ============================================
58
+ // EntryActionType Registry
59
+ // ============================================
60
+
61
+ export { entryActionTypeRegistry } from './src/lib/registry/entryActionTypeRegistry/registry.svelte.js';
62
+ export { createEntryActionType } from './src/lib/registry/entryActionTypeRegistry/createEntryActionType.js';
63
+ export { registerDefaultEntryActionTypes } from './src/lib/registry/entryActionTypeRegistry/registerDefaultEntryActionTypes.js';
64
+
65
+ export { default as EntryActionProperties } from './src/lib/registry/entryActionTypeRegistry/components/EntryActionProperties.svelte';
66
+ export { default as EntryActionTypeCard } from './src/lib/registry/entryActionTypeRegistry/components/EntryActionTypeCard.svelte';
67
+
68
+ // ============================================
69
+ // EntryAction Registry
70
+ // ============================================
71
+
72
+ export { entryActionRegistry } from './src/lib/registry/entryActionRegistry/registry.svelte.js';
73
+ export { createEntryAction } from './src/lib/registry/entryActionRegistry/createEntryAction.js';
74
+
75
+ export { default as EntryActionButton } from './src/lib/registry/entryActionRegistry/components/EntryActionButton.svelte';
76
+ export { default as EntryActionsButtons } from './src/lib/registry/entryActionRegistry/components/EntryActionsButtons.svelte';
package/index.js CHANGED
@@ -53,3 +53,24 @@ export { registerDefaultViewEntriesTypes } from './src/lib/registry/viewEntriesT
53
53
 
54
54
  export { default as ViewEntriesTypeButton } from './src/lib/registry/viewEntriesTypeRegistry/components/ViewEntriesTypeButton.svelte';
55
55
  export { default as ViewEntriesTypeComponent } from './src/lib/registry/viewEntriesTypeRegistry/components/ViewEntriesTypeComponent.svelte';
56
+
57
+ // ============================================
58
+ // EntryActionType Registry
59
+ // ============================================
60
+
61
+ export { entryActionTypeRegistry } from './src/lib/registry/entryActionTypeRegistry/registry.svelte.js';
62
+ export { createEntryActionType } from './src/lib/registry/entryActionTypeRegistry/createEntryActionType.js';
63
+ export { registerDefaultEntryActionTypes } from './src/lib/registry/entryActionTypeRegistry/registerDefaultEntryActionTypes.js';
64
+
65
+ export { default as EntryActionProperties } from './src/lib/registry/entryActionTypeRegistry/components/EntryActionProperties.svelte';
66
+ export { default as EntryActionTypeCard } from './src/lib/registry/entryActionTypeRegistry/components/EntryActionTypeCard.svelte';
67
+
68
+ // ============================================
69
+ // EntryAction Registry
70
+ // ============================================
71
+
72
+ export { entryActionRegistry } from './src/lib/registry/entryActionRegistry/registry.svelte.js';
73
+ export { createEntryAction } from './src/lib/registry/entryActionRegistry/createEntryAction.js';
74
+
75
+ export { default as EntryActionButton } from './src/lib/registry/entryActionRegistry/components/EntryActionButton.svelte';
76
+ export { default as EntryActionsButtons } from './src/lib/registry/entryActionRegistry/components/EntryActionsButtons.svelte';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mountain-ui",
3
3
  "private": false,
4
- "version": "1.0.56",
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(`/exemple/${page.params.project_normalized_name}/${toEntity.slug}/create?prefill=${JSON.stringify(newEntryCtx)}`)
42
-
40
+ // calculer le href
41
+ goto(componentProps.getHref(entity, entry, props, componentProps))
43
42
  },
44
43
  components: {
45
44
  card: Card,
@@ -3,7 +3,7 @@
3
3
  import EntryPage from '$lib/registry/entityRegistry/components/EntryPage.svelte';
4
4
  import { entityRegistry } from '$lib/registry/entityRegistry/registry.svelte';
5
5
  import EntryActionsButtons from '$lib/registry/entryActionRegistry/components/EntryActionsButtons.svelte';
6
- import { createEntryAction } from '$lib/registry/entryActionRegistry/createEntryActionType';
6
+ import { createEntryAction } from '$lib/registry/entryActionRegistry/createEntryAction
7
7
  import { entryActionRegistry } from '$lib/registry/entryActionRegistry/registry.svelte';
8
8
  import { registerDefaultEntryActionTypes } from '$lib/registry/entryActionTypeRegistry/registerDefaultEntryActionTypes';
9
9
  import { entryActionTypeRegistry } from '$lib/registry/entryActionTypeRegistry/registry.svelte';