@edc-motor/ui 0.4.34 → 0.4.35
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edc-motor/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.35",
|
|
4
4
|
"description": "EdC Motor — componentes públicos Vue 3 + tokens SCSS para webs de juegos de mesa (paquete fuente: lo compila el consumidor con Vite)",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -6,12 +6,13 @@ import type { SelectOption } from './BaseSelect.vue'
|
|
|
6
6
|
|
|
7
7
|
// Select MÚLTIPLE de formulario: el hermano de BaseSelect para filtros y
|
|
8
8
|
// campos de varios valores. Mismo trigger (.form-field__select) y mismo
|
|
9
|
-
// panel en la top layer (useDropdownPanel)
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
9
|
+
// panel en la top layer (useDropdownPanel); cada opción es un toggle con
|
|
10
|
+
// marca de check y el panel SE CIERRA al elegir (como el simple: un valor
|
|
11
|
+
// por apertura — para añadir otro se reabre y las marcas siguen ahí). El
|
|
12
|
+
// valor viaja como array de strings (mismo criterio String() que
|
|
13
|
+
// BaseSelect). El trigger pinta las etiquetas elegidas unidas por comas
|
|
14
|
+
// (el CSS las trunca con elipsis) — así no hace falta ningún texto
|
|
15
|
+
// "N seleccionadas" que traducir.
|
|
15
16
|
const props = withDefaults(
|
|
16
17
|
defineProps<{
|
|
17
18
|
modelValue?: (string | number)[]
|
|
@@ -71,7 +72,7 @@ function toggle() {
|
|
|
71
72
|
else void openPanel()
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
/** Marca/desmarca la opción
|
|
75
|
+
/** Marca/desmarca la opción y CIERRA el panel (como el select simple). */
|
|
75
76
|
function toggleOption(option: SelectOption) {
|
|
76
77
|
const value = String(option.value)
|
|
77
78
|
const next = props.modelValue.map((v) => String(v))
|
|
@@ -79,6 +80,7 @@ function toggleOption(option: SelectOption) {
|
|
|
79
80
|
if (at === -1) next.push(value)
|
|
80
81
|
else next.splice(at, 1)
|
|
81
82
|
emit('update:modelValue', next)
|
|
83
|
+
close()
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
function highlight(index: number) {
|