grav-svelte 0.0.52 → 0.0.53
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.
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
let localPageSizeStr = "50";
|
|
20
20
|
let showFilters = false;
|
|
21
21
|
let isLoading = false;
|
|
22
|
+
let clearKey = 0;
|
|
22
23
|
|
|
23
24
|
export let Filtros: FiltrosI[];
|
|
24
25
|
export let showAddButton: boolean = true;
|
|
@@ -44,8 +45,9 @@
|
|
|
44
45
|
|
|
45
46
|
Filtros = Filtros.map((filtro) => ({
|
|
46
47
|
...filtro,
|
|
47
|
-
value: filtro.tipo === "bool" ? false :
|
|
48
|
+
value: filtro.tipo === "bool" ? false : null,
|
|
48
49
|
}));
|
|
50
|
+
clearKey++; // Force re-render of select components
|
|
49
51
|
console.log(Filtros);
|
|
50
52
|
dispatch("filtrar", { filtros: Filtros }); // puedes pasar los filtros actualizados
|
|
51
53
|
}
|
|
@@ -73,13 +75,6 @@
|
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
function handlePageSizeInput(event: Event) {
|
|
77
|
-
const input = event.target as HTMLInputElement;
|
|
78
|
-
if (input) {
|
|
79
|
-
localPageSizeStr = input.value;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
78
|
let dataFetched: { value: any; label: string }[][] = [];
|
|
84
79
|
onMount(async () => {
|
|
85
80
|
console.log("Filtros", Filtros);
|
|
@@ -273,8 +268,7 @@
|
|
|
273
268
|
<div class="page-size-input">
|
|
274
269
|
<InputFormText
|
|
275
270
|
label="Mostrando:"
|
|
276
|
-
valueVar={localPageSizeStr}
|
|
277
|
-
on:input={handlePageSizeInput}
|
|
271
|
+
bind:valueVar={localPageSizeStr}
|
|
278
272
|
noMarginTop={true}
|
|
279
273
|
/>
|
|
280
274
|
</div>
|
|
@@ -321,18 +315,22 @@
|
|
|
321
315
|
<div class="spinner"></div>
|
|
322
316
|
</div>
|
|
323
317
|
{:else}
|
|
318
|
+
{#key clearKey}
|
|
319
|
+
<InputFormSelect
|
|
320
|
+
{label}
|
|
321
|
+
res={dataFetched[i]}
|
|
322
|
+
bind:justValue={Filtros[i].value}
|
|
323
|
+
/>
|
|
324
|
+
{/key}
|
|
325
|
+
{/if}
|
|
326
|
+
{:else}
|
|
327
|
+
{#key clearKey}
|
|
324
328
|
<InputFormSelect
|
|
325
329
|
{label}
|
|
326
|
-
res={
|
|
330
|
+
res={options}
|
|
327
331
|
bind:justValue={Filtros[i].value}
|
|
328
332
|
/>
|
|
329
|
-
{/
|
|
330
|
-
{:else}
|
|
331
|
-
<InputFormSelect
|
|
332
|
-
{label}
|
|
333
|
-
res={options}
|
|
334
|
-
bind:justValue={Filtros[i].value}
|
|
335
|
-
/>
|
|
333
|
+
{/key}
|
|
336
334
|
{/if}
|
|
337
335
|
</div>
|
|
338
336
|
{:else if tipo == "bool"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "./Grav_Modal.css";
|
|
3
3
|
|
|
4
4
|
// Define size type
|
|
5
|
-
type ModalSize = "lg" | "md" | "sm";
|
|
5
|
+
type ModalSize = "lg" | "md" | "sm" | "xs";
|
|
6
6
|
|
|
7
7
|
// Props interface
|
|
8
8
|
interface $$Props {
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
lg: "w-full min-h-screen",
|
|
34
34
|
md: "sm:w-3/4 w-7/8 min-h-[80vh]",
|
|
35
35
|
sm: "sm:w-1/3 w-3/4 min-h-[60vh]",
|
|
36
|
+
xs: "sm:w-1/4 w-3/4 min-h-[40vh]",
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
// Get the current size class
|