@edc-motor/admin-kit 0.4.12 → 0.4.14
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 +2 -2
- package/scss/components/_grid.scss +15 -0
- package/src/crud/BaseGrid.vue +7 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edc-motor/admin-kit",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.14",
|
|
4
4
|
"description": "EdC Motor — kit del panel de administración: layout, gestores CRUD, imágenes, PDF, páginas, configuración, usuarios y copias (paquete fuente: lo compila el consumidor con Vite)",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@edc-motor/ui": "^0.4.
|
|
36
|
+
"@edc-motor/ui": "^0.4.14",
|
|
37
37
|
"axios": "^1.7.0",
|
|
38
38
|
"vue-draggable-plus": "^0.6.1"
|
|
39
39
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Grid responsive (portado de kontuan). Columnas por breakpoint del contenedor
|
|
4
4
|
// `content` para que coincida con el ancho real disponible.
|
|
5
|
+
|
|
5
6
|
.grid {
|
|
6
7
|
display: grid;
|
|
7
8
|
grid-template-columns: 1fr;
|
|
@@ -28,4 +29,18 @@
|
|
|
28
29
|
@container content (min-width: #{$bp-lg}) { grid-template-columns: repeat(#{$i}, 1fr); }
|
|
29
30
|
}
|
|
30
31
|
}
|
|
32
|
+
@for $i from 1 through 6 {
|
|
33
|
+
&--xl-#{$i} {
|
|
34
|
+
@container content (min-width: #{$bp-xl}) { grid-template-columns: repeat(#{$i}, 1fr); }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Preset `cards` (índices de entidades): 1 → 2 → 3 → 4 → 5 con los
|
|
39
|
+
// breakpoints canónicos del contenedor `content` (480/768/1024/1280).
|
|
40
|
+
&--cards {
|
|
41
|
+
@container content (min-width: #{$bp-sm}) { grid-template-columns: repeat(2, 1fr); }
|
|
42
|
+
@container content (min-width: #{$bp-md}) { grid-template-columns: repeat(3, 1fr); }
|
|
43
|
+
@container content (min-width: #{$bp-lg}) { grid-template-columns: repeat(4, 1fr); }
|
|
44
|
+
@container content (min-width: #{$bp-xl}) { grid-template-columns: repeat(5, 1fr); }
|
|
45
|
+
}
|
|
31
46
|
}
|
package/src/crud/BaseGrid.vue
CHANGED
|
@@ -3,7 +3,7 @@ import { computed } from 'vue'
|
|
|
3
3
|
|
|
4
4
|
// Grid responsive de tarjetas (portado de kontuan). Responde al ancho del
|
|
5
5
|
// contenedor `content` (no al viewport), así coincide con el espacio real.
|
|
6
|
-
type Breakpoint = 'base' | 'sm' | 'md' | 'lg'
|
|
6
|
+
type Breakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl'
|
|
7
7
|
type ResponsiveCols = Partial<Record<Breakpoint, number>>
|
|
8
8
|
|
|
9
9
|
const props = withDefaults(
|
|
@@ -16,9 +16,6 @@ const props = withDefaults(
|
|
|
16
16
|
)
|
|
17
17
|
|
|
18
18
|
const presetCols: Record<string, ResponsiveCols> = {
|
|
19
|
-
// Los index de entidades escalan 1 → 2 → 3 → 4 con el ancho REAL del
|
|
20
|
-
// contenedor `content` (en pantallas anchas llegan a cuatro columnas).
|
|
21
|
-
cards: { base: 1, sm: 2, md: 3, lg: 4 },
|
|
22
19
|
'cards-wide': { base: 1, sm: 2, lg: 4 },
|
|
23
20
|
'cards-narrow': { base: 1, sm: 2 },
|
|
24
21
|
'cards-full': { base: 1, sm: 2, md: 3, lg: 4 },
|
|
@@ -28,6 +25,12 @@ const presetCols: Record<string, ResponsiveCols> = {
|
|
|
28
25
|
|
|
29
26
|
const gridClasses = computed(() => {
|
|
30
27
|
const classes = ['grid', `grid--gap-${props.gap}`]
|
|
28
|
+
// Los index de entidades escalan 1 → 2 → 3 → 4 → 5 con los breakpoints
|
|
29
|
+
// canónicos del contenedor `content` (ver .grid--cards en _grid.scss).
|
|
30
|
+
if (props.preset === 'cards') {
|
|
31
|
+
classes.push('grid--cards')
|
|
32
|
+
return classes
|
|
33
|
+
}
|
|
31
34
|
const cols = props.preset ? presetCols[props.preset] : props.cols
|
|
32
35
|
if (typeof cols === 'number') classes.push(`grid--base-${cols}`)
|
|
33
36
|
else for (const [bp, n] of Object.entries(cols ?? {})) classes.push(`grid--${bp}-${n}`)
|