mountain-ui 1.0.173 → 1.0.175

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.173",
4
+ "version": "1.0.175",
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",
@@ -6,6 +6,8 @@
6
6
 
7
7
  let { ctx = {}, entityId, onSubmit = () => {}, type = 'create' } = $props();
8
8
 
9
+
10
+
9
11
  let detailsCtx = $state({});
10
12
 
11
13
  const entity = $derived(entityRegistry.select(entityId));
@@ -20,14 +22,10 @@
20
22
  });
21
23
 
22
24
  function recalculateAll() {
23
- console.log("before calc");
24
- console.log(JSON.stringify(ctx));
25
25
 
26
26
  for (const calc of Object.values(calculations)) {
27
27
  calc.calculate(ctx);
28
28
  }
29
- console.log("after calc");
30
- console.log(JSON.stringify(ctx));
31
29
 
32
30
  ctx = { ...ctx };
33
31
  }
@@ -24,15 +24,17 @@
24
24
  ...props
25
25
  } = $props();
26
26
 
27
- let table = $state([createLine()]);
27
+ let table = $state(null);
28
28
 
29
29
  let isHidden = $state(false);
30
30
 
31
31
  onMount(() => {
32
- if (value === null) return;
32
+ if (value === null) {
33
+ table = [createLine()]
34
+ return
35
+ };
33
36
 
34
37
  const decodedValue = JSON.parse(value);
35
- console.log(value);
36
38
 
37
39
  let newLines = [];
38
40
 
@@ -43,8 +45,6 @@
43
45
  newLines.push(newLine);
44
46
  }
45
47
 
46
- console.log(JSON.stringify(newLines));
47
-
48
48
 
49
49
  table = [...newLines];
50
50
  });
@@ -220,7 +220,7 @@
220
220
  </div>
221
221
  {/if}
222
222
  <div class="body">
223
- {#if $entity}
223
+ {#if $entity && table}
224
224
  {#each table as line, lineIndex (line.id)}
225
225
  <div class="line">
226
226
  {#each columns as column, columnIndex}
@@ -6,13 +6,11 @@
6
6
 
7
7
  let { label, unique = false, secret = false, compact = false, required, placeholder="un nombre entier", value="", defaultValue = "", ...props } = $props();
8
8
 
9
- onMount(()=>{
10
- // si la valeur est pas set on verifie si il y a uen defaultValue
9
+ // si la valeur est pas set on verifie si il y a uen defaultValue
11
10
  if (!value && defaultValue) {
12
11
  value = defaultValue
13
12
  onChange(value);
14
13
  }
15
- })
16
14
  </script>
17
15
 
18
16
  <Line {compact}>
@@ -13,13 +13,15 @@
13
13
  ...props
14
14
  } = $props();
15
15
 
16
- onMount(() => {
17
- // si la valeur est pas set on verifie si il y a uen defaultValue
16
+ console.log(value);
17
+
18
+ console.log(defaultValue);
19
+
20
+ // si la valeur est pas set on verifie si il y a uen defaultValue
18
21
  if (!value && defaultValue) {
19
22
  value = defaultValue
20
23
  onChange(value);
21
24
  }
22
- });
23
25
 
24
26
  function handleCheckMinMax() {
25
27
  let inputValue = value;
@@ -11,28 +11,26 @@
11
11
  compact = false,
12
12
  required,
13
13
  defaultValue = '',
14
- value = "",
15
- placeholder = "votre texte",
16
- onChange=(val)=>{},
14
+ value = '',
15
+ placeholder = 'votre texte',
16
+ onChange = (val) => {},
17
17
  ...props
18
18
  } = $props();
19
19
 
20
- onMount(() => {
21
- // si la valeur est pas set on verifie si il y a uen defaultValue
22
- if (!value && defaultValue) {
23
- value = defaultValue;
24
- handleChange();
25
- }
26
- });
20
+ // si la valeur est pas set on verifie si il y a uen defaultValue
21
+ if (!value && defaultValue) {
22
+ value = defaultValue;
23
+ handleChange();
24
+ }
27
25
 
28
- function handleChange() {
29
- onChange(value)
30
- }
26
+ function handleChange() {
27
+ onChange(value);
28
+ }
31
29
  </script>
32
30
 
33
31
  <Line {compact}>
34
32
  {#if label}
35
- <Label {unique} {secret} {label} {required}></Label>
36
- {/if}
33
+ <Label {unique} {secret} {label} {required}></Label>
34
+ {/if}
37
35
  <TextArea onChange={handleChange} {...props} {placeholder} bind:value {required}></TextArea>
38
36
  </Line>
@@ -2,25 +2,17 @@
2
2
  import { Input } from 'hamzus-ui';
3
3
  import { onMount } from 'svelte';
4
4
 
5
- let {
6
- defaultValue = '',
7
- symbol = '',
8
- value = '',
9
- onChange = (val) => {},
10
- ...props
11
- } = $props();
5
+ let { defaultValue = '', symbol = '', value = '', onChange = (val) => {}, ...props } = $props();
12
6
 
13
- onMount(() => {
14
- // si la valeur est pas set on verifie si il y a uen defaultValue
15
- if (!value && defaultValue) {
16
- value = defaultValue;
17
- handleChange();
18
- }
19
- });
7
+ // si la valeur est pas set on verifie si il y a uen defaultValue
8
+ if (!value && defaultValue) {
9
+ value = defaultValue;
10
+ handleChange();
11
+ }
20
12
 
21
- function handleChange() {
22
- onChange(value)
23
- }
13
+ function handleChange() {
14
+ onChange(value);
15
+ }
24
16
  </script>
25
17
 
26
18
  <Input {...props} onChange={handleChange} bind:value>
@@ -40,7 +40,7 @@ function createWebComponentRegistry() {
40
40
  },
41
41
 
42
42
  setActive(webComponentId) {
43
- console.log(webComponentId);
43
+ // console.log(webComponentId);
44
44
 
45
45
  targetWebComponentId.set(webComponentId)
46
46
  },
@@ -65,7 +65,7 @@ function createWebPageRegistry() {
65
65
 
66
66
  addChildTo(path, id, newChild) {
67
67
  store.update((webPages) => {
68
- console.log(webPages[path]);
68
+ // console.log(webPages[path]);
69
69
 
70
70
  const el = webPages[path].children_index[id]
71
71