feat: Refactor dashboard layout with new DashboardSection and DashboardTile components for improved responsiveness and organization
This commit is contained in:
1 parent
d51bfd3daa
commit
422a117026
5 files changed
+390
-167
No files matched your search
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Gemeinsames Raster für Dashboard-Kacheln (Mobile 2 / Desktop 4 Spalten).
|
||||
* Optional Mobile 4: mobile auf 4 setzen + Klasse dashboard-tile-grid--mobile-4col.
|
||||
*/
|
||||
export const DASHBOARD_TILE_GRID_COLS = { mobile: 2, desktop: 4 }
|
||||
|
||||
/** @param {number} span @param {number} maxCols */
|
||||
export function clampTileSpan(span, maxCols) {
|
||||
const n = Number(span)
|
||||
if (!Number.isFinite(n)) return 1
|
||||
return Math.min(maxCols, Math.max(1, Math.round(n)))
|
||||
}
|
||||
|
||||
/** @param {number} [mobileCols] 2 oder 4 */
|
||||
export function dashboardTileGridClassName(mobileCols = DASHBOARD_TILE_GRID_COLS.mobile) {
|
||||
let c = 'dashboard-tile-grid'
|
||||
if (mobileCols === 4) c += ' dashboard-tile-grid--mobile-4col'
|
||||
return c
|
||||
}
|
||||
|
||||
/** KPI-Raster: dieselben Regeln wie `dashboard-tile-grid`, plus Legacy-Klasse `dashboard-stat-grid`. */
|
||||
export function dashboardStatGridClassName(mobileCols = DASHBOARD_TILE_GRID_COLS.mobile) {
|
||||
let c = 'dashboard-stat-grid dashboard-tile-grid'
|
||||
if (mobileCols === 4) c += ' dashboard-stat-grid--mobile-4col dashboard-tile-grid--mobile-4col'
|
||||
return c
|
||||
}
|
||||
Reference in new issue
Block a user