mountain-ui 1.0.65 → 1.0.67

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.65",
4
+ "version": "1.0.67",
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",
@@ -3,14 +3,14 @@
3
3
  import { entryActionRegistry } from "../registry.svelte";
4
4
  import { entryActionTypeRegistry } from "../../entryActionTypeRegistry/registry.svelte";
5
5
 
6
- let {id, variant="ghost", ...props} = $props()
6
+ let {id, variant="outline", style, ...props} = $props()
7
7
 
8
8
  const entryAction = $derived(entryActionRegistry.select(id))
9
9
  const entryActionType = $derived($entryAction.type ? entryActionTypeRegistry.select($entryAction.type) : null)
10
10
  </script>
11
11
 
12
12
  {#if $entryAction && $entryActionType}
13
- <Button {variant} {...props}>
13
+ <Button {variant} {...props} style="width:100%;padding:var(--pad-xl);{style}">
14
14
  <div class="btn">
15
15
  <h4>{$entryAction.name}</h4>
16
16
  <h6>{$entryActionType.name}</h6>
@@ -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
  };