mountain-ui 1.0.66 → 1.0.68

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
@@ -73,5 +73,6 @@ export { entryActionRegistry } from './src/lib/registry/entryActionRegistry/regi
73
73
  export { createEntryAction } from './src/lib/registry/entryActionRegistry/createEntryAction.js';
74
74
 
75
75
  export { default as EntryActionCard } from './src/lib/registry/entryActionRegistry/components/EntryActionCard.svelte';
76
+ export { default as EntryActionForm } from './src/lib/registry/entryActionRegistry/components/EntryActionForm.svelte';
76
77
  export { default as EntryActionButton } from './src/lib/registry/entryActionRegistry/components/EntryActionButton.svelte';
77
78
  export { default as EntryActionsButtons } from './src/lib/registry/entryActionRegistry/components/EntryActionsButtons.svelte';
package/index.js CHANGED
@@ -73,5 +73,6 @@ export { entryActionRegistry } from './src/lib/registry/entryActionRegistry/regi
73
73
  export { createEntryAction } from './src/lib/registry/entryActionRegistry/createEntryAction.js';
74
74
 
75
75
  export { default as EntryActionCard } from './src/lib/registry/entryActionRegistry/components/EntryActionCard.svelte';
76
+ export { default as EntryActionForm } from './src/lib/registry/entryActionRegistry/components/EntryActionForm.svelte';
76
77
  export { default as EntryActionButton } from './src/lib/registry/entryActionRegistry/components/EntryActionButton.svelte';
77
78
  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.66",
4
+ "version": "1.0.68",
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",
@@ -0,0 +1,42 @@
1
+ <script>
2
+ import EntryActionProperties from '../../entryActionTypeRegistry/components/EntryActionProperties.svelte';
3
+ import { Button } from 'hamzus-ui';
4
+ import { entryActionRegistry } from '../registry.svelte';
5
+
6
+ let {
7
+ entryActionId = null,
8
+ entryActionType = null,
9
+ onSubmit = (data) => {},
10
+ ...restProps
11
+ } = $props();
12
+
13
+ const entryAction = $derived(entryActionId ? entryActionRegistry.get(entryActionId) : null);
14
+
15
+ let name = $derived(entryAction?.name ?? '');
16
+ let props = $derived(entryAction?.props ?? null);
17
+
18
+ function handleSubmit() {
19
+ let data = {
20
+ name: name,
21
+ props: props
22
+ };
23
+ if (entryActionId) {
24
+ data.id = entryActionId;
25
+ }
26
+ onSubmit(data);
27
+ }
28
+ </script>
29
+
30
+ {#if entryAction}
31
+ <EntryActionProperties entryActionType={entryAction.type} bind:name bind:props {...restProps}
32
+ ></EntryActionProperties>
33
+ <Button onClick={handleSubmit}>
34
+ <h5>éditer</h5>
35
+ </Button>
36
+ {:else}
37
+ <EntryActionProperties {entryActionType} bind:name bind:props {...restProps}
38
+ ></EntryActionProperties>
39
+ <Button onClick={handleSubmit}>
40
+ <h5>créée</h5>
41
+ </Button>
42
+ {/if}
@@ -17,6 +17,7 @@
17
17
  });
18
18
  $effect(() => {
19
19
  if (!$entryActionTypeData) return;
20
+ if (props !== undefined && props !== null) return
20
21
  props = {
21
22
  ...$entryActionTypeData.defaultProps
22
23
  };