mountain-ui 1.0.122 → 1.0.123

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.122",
4
+ "version": "1.0.123",
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",
@@ -2,7 +2,7 @@
2
2
  import { onMount } from 'svelte';
3
3
  import Label from '../../../components/Label.svelte';
4
4
  import Line from '../../../components/Line.svelte';
5
- import { Button, Checkbox, Input, Tag } from 'hamzus-ui';
5
+ import { Button, Checkbox, IconButton, Input, Tag } from 'hamzus-ui';
6
6
 
7
7
  let {
8
8
  value = $bindable(null),
@@ -63,7 +63,7 @@
63
63
  if (!Array.isArray(parsed)) return;
64
64
 
65
65
  const knownValues = choices.map((c) => c.value);
66
-
66
+
67
67
  const unknown = parsed.filter((v) => !knownValues.includes(v));
68
68
  const known = parsed.filter((v) => knownValues.includes(v));
69
69
 
@@ -77,6 +77,12 @@
77
77
  // valeur invalide, on ignore
78
78
  }
79
79
  });
80
+
81
+ function handleDeleteFreeChoice(index) {
82
+ freeChoices = freeChoices.filter((v, i) => i !== index);
83
+
84
+ emitChange();
85
+ }
80
86
  </script>
81
87
 
82
88
  <Line {compact}>
@@ -104,7 +110,15 @@
104
110
  placeholder="mon choix {index + 1}"
105
111
  value={freeChoice}
106
112
  onChange={(newValue) => handleChangeFreeChoice(index, newValue)}
107
- />
113
+ >
114
+ <IconButton
115
+ slot="endContent"
116
+ variant="secondary"
117
+ onClick={() => {
118
+ handleDeleteFreeChoice(index);
119
+ }}
120
+ ></IconButton>
121
+ </Input>
108
122
  {/each}
109
123
  {/if}
110
124
  </div>