mountain-ui 1.0.168 → 1.0.170

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.168",
4
+ "version": "1.0.170",
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",
@@ -20,9 +20,14 @@
20
20
  });
21
21
 
22
22
  function recalculateAll() {
23
+ console.log("before calc");
24
+ console.log(JSON.stringify(ctx));
25
+
23
26
  for (const calc of Object.values(calculations)) {
24
- calc.calculate(ctx);
27
+ calc.calculate(ctx);
25
28
  }
29
+ console.log("after calc");
30
+ console.log(JSON.stringify(ctx));
26
31
 
27
32
  ctx = { ...ctx };
28
33
  }
@@ -1,9 +1,18 @@
1
1
  <script>
2
+ import { onMount } from 'svelte';
2
3
  import Label from '../../../components/Label.svelte';
3
4
  import Line from '../../../components/Line.svelte';
4
5
  import { Input } from 'hamzus-ui';
5
6
 
6
- let { label, unique = false, secret = false, compact = false, required, placeholder="un nombre entier", ...props } = $props();
7
+ let { label, unique = false, secret = false, compact = false, required, placeholder="un nombre entier", value="", defaultValue = "", ...props } = $props();
8
+
9
+ onMount(()=>{
10
+ // si la valeur est pas set on verifie si il y a uen defaultValue
11
+ if (!value && defaultValue) {
12
+ value = defaultValue
13
+ onChange(value);
14
+ }
15
+ })
7
16
  </script>
8
17
 
9
18
  <Line {compact}>
@@ -9,14 +9,16 @@
9
9
  symbol = '',
10
10
 
11
11
  onChange = (val) => {},
12
- value = defaultValue,
12
+ value = "",
13
13
  ...props
14
14
  } = $props();
15
15
 
16
16
  onMount(() => {
17
- if (defaultValue) {
18
- onChange(value);
19
- }
17
+ // si la valeur est pas set on verifie si il y a uen defaultValue
18
+ if (!value && defaultValue) {
19
+ value = defaultValue
20
+ onChange(value);
21
+ }
20
22
  });
21
23
 
22
24
  function handleCheckMinMax() {
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import { onMount } from 'svelte';
2
3
  import Label from '../../../components/Label.svelte';
3
4
  import Line from '../../../components/Line.svelte';
4
5
  import { TextArea } from 'hamzus-ui';
@@ -10,15 +11,28 @@
10
11
  compact = false,
11
12
  required,
12
13
  defaultValue = '',
13
- value = defaultValue,
14
+ value = "",
14
15
  placeholder = "votre texte",
16
+ onChange=(val)=>{},
15
17
  ...props
16
18
  } = $props();
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
+ });
27
+
28
+ function handleChange() {
29
+ onChange(value)
30
+ }
17
31
  </script>
18
32
 
19
33
  <Line {compact}>
20
34
  {#if label}
21
35
  <Label {unique} {secret} {label} {required}></Label>
22
36
  {/if}
23
- <TextArea {...props} {placeholder} bind:value {required}></TextArea>
37
+ <TextArea onChange={handleChange} {...props} {placeholder} bind:value {required}></TextArea>
24
38
  </Line>
@@ -1,10 +1,29 @@
1
1
  <script>
2
2
  import { Input } from 'hamzus-ui';
3
+ import { onMount } from 'svelte';
3
4
 
4
- let { defaultValue = '', symbol = '', value = defaultValue, ...props } = $props();
5
+ let {
6
+ defaultValue = '',
7
+ symbol = '',
8
+ value = '',
9
+ onChange = (val) => {},
10
+ ...props
11
+ } = $props();
12
+
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
+ });
20
+
21
+ function handleChange() {
22
+ onChange(value)
23
+ }
5
24
  </script>
6
25
 
7
- <Input {...props} bind:value>
26
+ <Input {...props} onChange={handleChange} bind:value>
8
27
  <div slot="endContent">
9
28
  {#if symbol}
10
29
  <h4>{symbol}</h4>