From c1d2df932771af0ad822532d8d3a1c247d0d192b Mon Sep 17 00:00:00 2001 From: "Janus C. H. Knudsen" Date: Mon, 19 Jan 2026 14:23:41 +0100 Subject: [PATCH] Refactors UI components with new card header structure Replaces `swp-section-label` with standardized `swp-card-header` and `swp-card-title` Improves component consistency across multiple features: - Adds structured card headers - Introduces more semantic HTML elements - Enhances layout and readability of card components Updates CSS and component styles to support new structure --- .../Components/InvoiceHistory/Default.cshtml | 4 +- .../Components/CashApproval/Default.cshtml | 4 +- .../Components/CashBalance/Default.cshtml | 4 +- .../Components/PeriodInfo/Default.cshtml | 4 +- .../Components/PeriodRevenue/Default.cshtml | 4 +- .../ReconciliationNote/Default.cshtml | 4 +- .../ReconciliationTable/Default.cshtml | 2 +- .../Features/CashRegister/Pages/Index.cshtml | 12 ++-- .../Components/AttentionList/Default.cshtml | 4 +- .../Components/BookingList/Default.cshtml | 6 +- .../NotificationList/Default.cshtml | 6 +- .../Components/QuickStatList/Default.cshtml | 4 +- .../Features/Dashboard/Pages/Index.cshtml | 4 +- .../EmployeeDetailGeneral/Default.cshtml | 28 +++++++--- .../EmployeeDetailHR/Default.cshtml | 34 ++++++++---- .../EmployeeDetailSalary/Default.cshtml | 22 +++++--- .../EmployeeDetailServices/Default.cshtml | 4 +- .../EmployeeDetailStats/Default.cshtml | 8 ++- .../ServiceDetailAddons/Default.cshtml | 5 +- .../ServiceDetailDuration/Default.cshtml | 9 ++- .../ServiceDetailEmployees/Default.cshtml | 18 +++--- .../ServiceDetailGeneral/Default.cshtml | 20 ++++--- .../ServiceDetailPrices/Default.cshtml | 13 +++-- .../ServiceDetailRules/Default.cshtml | 12 +++- .../SettingsPayments/Default.cshtml | 4 +- .../SettingsReminders/Default.cshtml | 20 ++++--- .../wwwroot/css/COMPONENT-CATALOG.md | 55 +++++++++++++++---- PlanTempus.Application/wwwroot/css/cash.css | 30 +--------- .../wwwroot/css/components.css | 22 ++++---- PlanTempus.Application/wwwroot/css/stats.css | 2 + .../wwwroot/ts/modules/cash.ts | 31 ++++++++--- 31 files changed, 250 insertions(+), 149 deletions(-) diff --git a/PlanTempus.Application/Features/Account/Components/InvoiceHistory/Default.cshtml b/PlanTempus.Application/Features/Account/Components/InvoiceHistory/Default.cshtml index 8ec4b75..8796866 100644 --- a/PlanTempus.Application/Features/Account/Components/InvoiceHistory/Default.cshtml +++ b/PlanTempus.Application/Features/Account/Components/InvoiceHistory/Default.cshtml @@ -1,5 +1,7 @@ - Faktura-historik + + Faktura-historik + Dato diff --git a/PlanTempus.Application/Features/CashRegister/Components/CashApproval/Default.cshtml b/PlanTempus.Application/Features/CashRegister/Components/CashApproval/Default.cshtml index 109dfe5..1be609a 100644 --- a/PlanTempus.Application/Features/CashRegister/Components/CashApproval/Default.cshtml +++ b/PlanTempus.Application/Features/CashRegister/Components/CashApproval/Default.cshtml @@ -1,5 +1,7 @@ - Afslut dagen + + Afslut dagen + diff --git a/PlanTempus.Application/Features/CashRegister/Components/CashBalance/Default.cshtml b/PlanTempus.Application/Features/CashRegister/Components/CashBalance/Default.cshtml index beb8052..d6f3cc1 100644 --- a/PlanTempus.Application/Features/CashRegister/Components/CashBalance/Default.cshtml +++ b/PlanTempus.Application/Features/CashRegister/Components/CashBalance/Default.cshtml @@ -1,5 +1,7 @@ - Kontanter i kassen + + Kontanter i kassen + diff --git a/PlanTempus.Application/Features/CashRegister/Components/PeriodInfo/Default.cshtml b/PlanTempus.Application/Features/CashRegister/Components/PeriodInfo/Default.cshtml index 4571d8c..8956a97 100644 --- a/PlanTempus.Application/Features/CashRegister/Components/PeriodInfo/Default.cshtml +++ b/PlanTempus.Application/Features/CashRegister/Components/PeriodInfo/Default.cshtml @@ -1,5 +1,7 @@ - Periodeoplysninger + + Periodeoplysninger + Periode diff --git a/PlanTempus.Application/Features/CashRegister/Components/PeriodRevenue/Default.cshtml b/PlanTempus.Application/Features/CashRegister/Components/PeriodRevenue/Default.cshtml index b2a5cf0..39c3494 100644 --- a/PlanTempus.Application/Features/CashRegister/Components/PeriodRevenue/Default.cshtml +++ b/PlanTempus.Application/Features/CashRegister/Components/PeriodRevenue/Default.cshtml @@ -1,5 +1,7 @@ - Periodens omsætning + + Periodens omsætning + diff --git a/PlanTempus.Application/Features/CashRegister/Components/ReconciliationNote/Default.cshtml b/PlanTempus.Application/Features/CashRegister/Components/ReconciliationNote/Default.cshtml index b7d1936..bda7473 100644 --- a/PlanTempus.Application/Features/CashRegister/Components/ReconciliationNote/Default.cshtml +++ b/PlanTempus.Application/Features/CashRegister/Components/ReconciliationNote/Default.cshtml @@ -1,5 +1,7 @@ - Note til afstemning + + Note til afstemning + diff --git a/PlanTempus.Application/Features/CashRegister/Components/ReconciliationTable/Default.cshtml b/PlanTempus.Application/Features/CashRegister/Components/ReconciliationTable/Default.cshtml index e75ddf8..3a385e3 100644 --- a/PlanTempus.Application/Features/CashRegister/Components/ReconciliationTable/Default.cshtml +++ b/PlanTempus.Application/Features/CashRegister/Components/ReconciliationTable/Default.cshtml @@ -1,5 +1,5 @@ - + 0 valgt diff --git a/PlanTempus.Application/Features/CashRegister/Pages/Index.cshtml b/PlanTempus.Application/Features/CashRegister/Pages/Index.cshtml index d1e930d..9d227b2 100644 --- a/PlanTempus.Application/Features/CashRegister/Pages/Index.cshtml +++ b/PlanTempus.Application/Features/CashRegister/Pages/Index.cshtml @@ -74,19 +74,19 @@ - - + + @await Component.InvokeAsync("PeriodRevenue") @await Component.InvokeAsync("CashBalance") @await Component.InvokeAsync("CashDifference") - + - + @await Component.InvokeAsync("PeriodInfo") @await Component.InvokeAsync("ReconciliationNote") @await Component.InvokeAsync("CashApproval") - - + + Systemet gemmer hvornår og af hvem der er godkendt – enkelt kontrolspor. diff --git a/PlanTempus.Application/Features/Dashboard/Components/AttentionList/Default.cshtml b/PlanTempus.Application/Features/Dashboard/Components/AttentionList/Default.cshtml index 77f5360..22bcca1 100644 --- a/PlanTempus.Application/Features/Dashboard/Components/AttentionList/Default.cshtml +++ b/PlanTempus.Application/Features/Dashboard/Components/AttentionList/Default.cshtml @@ -1,7 +1,9 @@ @model PlanTempus.Application.Features.Dashboard.Components.AttentionListViewModel - @Model.Title + + @Model.Title + @foreach (var attentionKey in Model.AttentionKeys) diff --git a/PlanTempus.Application/Features/Dashboard/Components/BookingList/Default.cshtml b/PlanTempus.Application/Features/Dashboard/Components/BookingList/Default.cshtml index 3c46b91..573fea6 100644 --- a/PlanTempus.Application/Features/Dashboard/Components/BookingList/Default.cshtml +++ b/PlanTempus.Application/Features/Dashboard/Components/BookingList/Default.cshtml @@ -1,10 +1,10 @@ @model PlanTempus.Application.Features.Dashboard.Components.BookingListViewModel - - @Model.Title + + @Model.Title Se alle - + Nu: @Model.CurrentTime diff --git a/PlanTempus.Application/Features/Dashboard/Components/NotificationList/Default.cshtml b/PlanTempus.Application/Features/Dashboard/Components/NotificationList/Default.cshtml index 73a739d..2adfd1b 100644 --- a/PlanTempus.Application/Features/Dashboard/Components/NotificationList/Default.cshtml +++ b/PlanTempus.Application/Features/Dashboard/Components/NotificationList/Default.cshtml @@ -1,10 +1,10 @@ @model PlanTempus.Application.Features.Dashboard.Components.NotificationListViewModel - - @Model.Title + + @Model.Title @Model.ActionText - + @foreach (var notificationKey in Model.NotificationKeys) diff --git a/PlanTempus.Application/Features/Dashboard/Components/QuickStatList/Default.cshtml b/PlanTempus.Application/Features/Dashboard/Components/QuickStatList/Default.cshtml index c309c10..006edbe 100644 --- a/PlanTempus.Application/Features/Dashboard/Components/QuickStatList/Default.cshtml +++ b/PlanTempus.Application/Features/Dashboard/Components/QuickStatList/Default.cshtml @@ -1,7 +1,9 @@ @model PlanTempus.Application.Features.Dashboard.Components.QuickStatListViewModel - @Model.Title + + @Model.Title + @foreach (var statKey in Model.StatKeys) diff --git a/PlanTempus.Application/Features/Dashboard/Pages/Index.cshtml b/PlanTempus.Application/Features/Dashboard/Pages/Index.cshtml index fd12e17..ad4c940 100644 --- a/PlanTempus.Application/Features/Dashboard/Pages/Index.cshtml +++ b/PlanTempus.Application/Features/Dashboard/Pages/Index.cshtml @@ -50,7 +50,9 @@ - Hurtige handlinger + + Hurtige handlinger + diff --git a/PlanTempus.Application/Features/Employees/Components/EmployeeDetailGeneral/Default.cshtml b/PlanTempus.Application/Features/Employees/Components/EmployeeDetailGeneral/Default.cshtml index aa95640..74a7dce 100644 --- a/PlanTempus.Application/Features/Employees/Components/EmployeeDetailGeneral/Default.cshtml +++ b/PlanTempus.Application/Features/Employees/Components/EmployeeDetailGeneral/Default.cshtml @@ -2,10 +2,12 @@ -
+ - @Model.LabelContact + + @Model.LabelContact + @Model.LabelFullName @@ -32,7 +34,9 @@ - @Model.LabelPersonal + + @Model.LabelPersonal + @Model.LabelBirthDate @@ -48,13 +52,15 @@ -
+ -
+ - @Model.LabelEmployment + + @Model.LabelEmployment + @Model.LabelEmploymentDate @@ -77,7 +83,9 @@ - @Model.LabelSettings + + @Model.LabelSettings +
@Model.SettingShowInBooking @@ -102,7 +110,9 @@ - @Model.LabelNotifications + + @Model.LabelNotifications + @Model.NotificationsIntro @Model.SettingSmsReminders @@ -147,5 +157,5 @@ -
+
diff --git a/PlanTempus.Application/Features/Employees/Components/EmployeeDetailHR/Default.cshtml b/PlanTempus.Application/Features/Employees/Components/EmployeeDetailHR/Default.cshtml index 3fcbda2..23c38f5 100644 --- a/PlanTempus.Application/Features/Employees/Components/EmployeeDetailHR/Default.cshtml +++ b/PlanTempus.Application/Features/Employees/Components/EmployeeDetailHR/Default.cshtml @@ -2,11 +2,12 @@ -
+ - @Model.LabelContractDocuments - + + @Model.LabelContractDocuments + @Model.LabelContractType @@ -57,7 +58,9 @@ - @Model.LabelPlannedAbsence + + @Model.LabelPlannedAbsence + @foreach (var absence in Model.PlannedAbsences) { @@ -69,13 +72,15 @@ + @Model.LabelAddAbsence -
+ -
+ - @Model.LabelCertifications + + @Model.LabelCertifications + @foreach (var cert in Model.Certifications) { @@ -96,8 +101,9 @@ - @Model.LabelCourses - + + @Model.LabelCourses + @Model.LabelCompletedCourses @@ -136,13 +142,15 @@ + @Model.LabelAddCourse -
+
- @Model.LabelVacationBalance + + @Model.LabelVacationBalance + @Model.LabelVacationEarned @@ -160,7 +168,9 @@ - @Model.LabelAbsenceSickness + + @Model.LabelAbsenceSickness + @Model.LabelSickDays2025 diff --git a/PlanTempus.Application/Features/Employees/Components/EmployeeDetailSalary/Default.cshtml b/PlanTempus.Application/Features/Employees/Components/EmployeeDetailSalary/Default.cshtml index 7560c6d..3d1053b 100644 --- a/PlanTempus.Application/Features/Employees/Components/EmployeeDetailSalary/Default.cshtml +++ b/PlanTempus.Application/Features/Employees/Components/EmployeeDetailSalary/Default.cshtml @@ -1,13 +1,13 @@ @model PlanTempus.Application.Features.Employees.Components.EmployeeDetailSalaryViewModel -
+ - - @Model.LabelRates + + @Model.LabelRates @Model.LabelEdit - + @Model.LabelNormalRate @@ -54,7 +54,9 @@ - @Model.LabelSupplements + + @Model.LabelSupplements + @Model.LabelWeekdaySupplement @@ -73,7 +75,9 @@ - @Model.LabelCommission + + @Model.LabelCommission + @Model.LabelProductCommission @@ -85,10 +89,12 @@ -
+ - @Model.LabelSalaryHistory + + @Model.LabelSalaryHistory + @Model.LabelPeriod diff --git a/PlanTempus.Application/Features/Employees/Components/EmployeeDetailServices/Default.cshtml b/PlanTempus.Application/Features/Employees/Components/EmployeeDetailServices/Default.cshtml index f6f55f0..b206b0a 100644 --- a/PlanTempus.Application/Features/Employees/Components/EmployeeDetailServices/Default.cshtml +++ b/PlanTempus.Application/Features/Employees/Components/EmployeeDetailServices/Default.cshtml @@ -2,7 +2,9 @@ - @Model.LabelAssignedServices + + @Model.LabelAssignedServices + Dameklip diff --git a/PlanTempus.Application/Features/Employees/Components/EmployeeDetailStats/Default.cshtml b/PlanTempus.Application/Features/Employees/Components/EmployeeDetailStats/Default.cshtml index 433a8ce..b5a65be 100644 --- a/PlanTempus.Application/Features/Employees/Components/EmployeeDetailStats/Default.cshtml +++ b/PlanTempus.Application/Features/Employees/Components/EmployeeDetailStats/Default.cshtml @@ -2,7 +2,9 @@ - @Model.LabelPerformance + + @Model.LabelPerformance + @Model.BookingsThisYear @@ -24,7 +26,9 @@ - @Model.LabelCompletedBookings + + @Model.LabelCompletedBookings + @Model.LabelDate diff --git a/PlanTempus.Application/Features/Services/Components/ServiceDetailAddons/Default.cshtml b/PlanTempus.Application/Features/Services/Components/ServiceDetailAddons/Default.cshtml index f9ac741..1646d24 100644 --- a/PlanTempus.Application/Features/Services/Components/ServiceDetailAddons/Default.cshtml +++ b/PlanTempus.Application/Features/Services/Components/ServiceDetailAddons/Default.cshtml @@ -1,8 +1,9 @@ @model PlanTempus.Application.Features.Services.Components.ServiceDetailAddonsViewModel - @Model.LabelAddonsForService - + + @Model.LabelAddonsForService + @foreach (var addon in Model.Addons) { diff --git a/PlanTempus.Application/Features/Services/Components/ServiceDetailDuration/Default.cshtml b/PlanTempus.Application/Features/Services/Components/ServiceDetailDuration/Default.cshtml index 35864d7..3ba76f2 100644 --- a/PlanTempus.Application/Features/Services/Components/ServiceDetailDuration/Default.cshtml +++ b/PlanTempus.Application/Features/Services/Components/ServiceDetailDuration/Default.cshtml @@ -2,8 +2,9 @@ - @Model.LabelDurationVariants - + + @Model.LabelDurationVariants + @foreach (var variant in Model.DurationVariants) { @@ -27,7 +28,9 @@ - @Model.LabelBufferTimes + + @Model.LabelBufferTimes + @Model.LabelBufferBefore diff --git a/PlanTempus.Application/Features/Services/Components/ServiceDetailEmployees/Default.cshtml b/PlanTempus.Application/Features/Services/Components/ServiceDetailEmployees/Default.cshtml index 915c0ee..7d45334 100644 --- a/PlanTempus.Application/Features/Services/Components/ServiceDetailEmployees/Default.cshtml +++ b/PlanTempus.Application/Features/Services/Components/ServiceDetailEmployees/Default.cshtml @@ -1,10 +1,11 @@ @model PlanTempus.Application.Features.Services.Components.ServiceDetailEmployeesViewModel -
+ - @Model.LabelEmployeesForService - + + @Model.LabelEmployeesForService + @foreach (var employee in Model.Employees) { @@ -32,12 +33,13 @@ @Model.LabelSelectAll -
+ -
+ - @Model.LabelAvailability - + + @Model.LabelAvailability + @foreach (var day in Model.Availability) { @@ -62,5 +64,5 @@ } -
+
diff --git a/PlanTempus.Application/Features/Services/Components/ServiceDetailGeneral/Default.cshtml b/PlanTempus.Application/Features/Services/Components/ServiceDetailGeneral/Default.cshtml index 207805d..82e4563 100644 --- a/PlanTempus.Application/Features/Services/Components/ServiceDetailGeneral/Default.cshtml +++ b/PlanTempus.Application/Features/Services/Components/ServiceDetailGeneral/Default.cshtml @@ -2,10 +2,12 @@ -
+ - @Model.LabelBasic + + @Model.LabelBasic + @Model.LabelServiceName @@ -70,7 +72,9 @@ - @Model.LabelBookingType + + @Model.LabelBookingType +
@Model.LabelCanBookAsMain @@ -92,13 +96,15 @@ -
+
-
+ - @Model.LabelOnlineBooking + + @Model.LabelOnlineBooking +
@Model.LabelShowInOnlineBooking @@ -129,5 +135,5 @@ @Model.LabelUploadImage -
+
diff --git a/PlanTempus.Application/Features/Services/Components/ServiceDetailPrices/Default.cshtml b/PlanTempus.Application/Features/Services/Components/ServiceDetailPrices/Default.cshtml index 8075090..8ed8e70 100644 --- a/PlanTempus.Application/Features/Services/Components/ServiceDetailPrices/Default.cshtml +++ b/PlanTempus.Application/Features/Services/Components/ServiceDetailPrices/Default.cshtml @@ -1,8 +1,9 @@ @model PlanTempus.Application.Features.Services.Components.ServiceDetailPricesViewModel - @Model.LabelPriceStructure - + + @Model.LabelPriceStructure + @Model.LabelSimplePrice @Model.LabelMatrixPrice @@ -49,7 +50,9 @@ - @Model.LabelEconomy + + @Model.LabelEconomy + @Model.LabelVatRate @@ -86,7 +89,9 @@ - @Model.LabelDiscounts + + @Model.LabelDiscounts + @Model.LabelMemberDiscount diff --git a/PlanTempus.Application/Features/Services/Components/ServiceDetailRules/Default.cshtml b/PlanTempus.Application/Features/Services/Components/ServiceDetailRules/Default.cshtml index 57f6813..6c5b5d0 100644 --- a/PlanTempus.Application/Features/Services/Components/ServiceDetailRules/Default.cshtml +++ b/PlanTempus.Application/Features/Services/Components/ServiceDetailRules/Default.cshtml @@ -2,7 +2,9 @@ - @Model.LabelBookingRules + + @Model.LabelBookingRules + @Model.LabelMinNotice @@ -73,7 +75,9 @@ - @Model.LabelRequirements + + @Model.LabelRequirements +
@Model.LabelRequiresConsultation @@ -108,7 +112,9 @@ - @Model.LabelOnlineBookingSettings + + @Model.LabelOnlineBookingSettings + @Model.LabelShowInOnlineBooking diff --git a/PlanTempus.Application/Features/Settings/Components/SettingsPayments/Default.cshtml b/PlanTempus.Application/Features/Settings/Components/SettingsPayments/Default.cshtml index 6694493..24d7745 100644 --- a/PlanTempus.Application/Features/Settings/Components/SettingsPayments/Default.cshtml +++ b/PlanTempus.Application/Features/Settings/Components/SettingsPayments/Default.cshtml @@ -63,7 +63,7 @@ -
+ @@ -137,5 +137,5 @@ -
+ diff --git a/PlanTempus.Application/Features/Settings/Components/SettingsReminders/Default.cshtml b/PlanTempus.Application/Features/Settings/Components/SettingsReminders/Default.cshtml index 23f2804..e84b587 100644 --- a/PlanTempus.Application/Features/Settings/Components/SettingsReminders/Default.cshtml +++ b/PlanTempus.Application/Features/Settings/Components/SettingsReminders/Default.cshtml @@ -1,10 +1,12 @@ - - - Email - + + + + Email + +
Bekræftelse @@ -51,10 +53,12 @@ - - - SMS - + + + + SMS + +
Bekræftelse online (0,30 kr.) diff --git a/PlanTempus.Application/wwwroot/css/COMPONENT-CATALOG.md b/PlanTempus.Application/wwwroot/css/COMPONENT-CATALOG.md index aca7a8c..2f3d4e7 100644 --- a/PlanTempus.Application/wwwroot/css/COMPONENT-CATALOG.md +++ b/PlanTempus.Application/wwwroot/css/COMPONENT-CATALOG.md @@ -75,29 +75,58 @@ Standard icon wrapper (40×40px cirkel): | `swp-page-title` | Titel-wrapper med h1 og p | h1 + subtitle | | `swp-page-actions` | Action buttons i header | Flex gap | | `swp-card` | Standard card wrapper | Border, padding, rounded | -| `swp-section-label` | Card section label | Uppercase, 11px, border-bottom | -| `swp-section-header` | Wrapper for label + action | Flex, space-between | -| `swp-section-action` | Action link i section header | Teal, clickable | +| `swp-card-header` | Card header wrapper | Flex, space-between, border-bottom | +| `swp-card-title` | Card title med ikon | Flex, icon + text | +| `swp-section-action` | Action link i header | Teal, clickable | +| `swp-section-label` | Subsection label (inde i card) | Uppercase, 11px, border-bottom | | `swp-card-content` | Card indhold | Block | ### Card Header Eksempler -**Simpel label (uden action):** +**Standard card header (ANBEFALET):** ```html - Kontakter - ... + + Kontakter + + ``` -**Label med action:** +**Card header med ikon:** ```html - - Dagens bookinger + + + + Email + + + + +``` + +**Card header med action:** +```html + + + Dagens bookinger Se alle - - ... + + + +``` + +**Subsection label (inde i card):** +```html + + + Grundlæggende + + + + Interne noter + ``` @@ -434,7 +463,9 @@ Bruger `swp-data-table` med `.salary-history` context class. ```html - Lønhistorik + + Lønhistorik + Periode diff --git a/PlanTempus.Application/wwwroot/css/cash.css b/PlanTempus.Application/wwwroot/css/cash.css index 67ce439..9c0a355 100644 --- a/PlanTempus.Application/wwwroot/css/cash.css +++ b/PlanTempus.Application/wwwroot/css/cash.css @@ -57,15 +57,9 @@ swp-filter-spacer { /* =========================================== ACTION BAR (Table Header) =========================================== */ -swp-action-bar { - display: flex; - align-items: center; - justify-content: space-between; - padding: var(--spacing-6) var(--spacing-8); - background: var(--color-surface); - border: 1px solid var(--color-border); +swp-action-bar.grid-top { border-bottom: none; - border-radius: var(--radius-lg) var(--radius-lg) 0 0; + margin-bottom: 0; } swp-selection-info { @@ -279,20 +273,6 @@ swp-row-arrow { } } -/* =========================================== - TWO-COLUMN GRID (Detail View) - =========================================== */ -swp-cash-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: var(--spacing-12); -} - -swp-cash-column { - display: grid; - align-content: start; -} - /* =========================================== DATA TABLE (Dagens Tal) =========================================== */ @@ -690,12 +670,6 @@ swp-system-note { } } -@media (max-width: 900px) { - swp-cash-grid { - grid-template-columns: 1fr; - } -} - @media (max-width: 768px) { swp-filter-bar { flex-direction: column; diff --git a/PlanTempus.Application/wwwroot/css/components.css b/PlanTempus.Application/wwwroot/css/components.css index 01e40ec..3d1b08e 100644 --- a/PlanTempus.Application/wwwroot/css/components.css +++ b/PlanTempus.Application/wwwroot/css/components.css @@ -570,6 +570,7 @@ swp-card-title { gap: var(--spacing-3); font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); + text-transform: uppercase; color: var(--color-text); & i { @@ -1322,12 +1323,17 @@ swp-back-link { swp-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); - gap: var(--spacing-8); + gap: var(--card-gap); + align-items: start; +} - > div { - display: flex; - flex-direction: column; - } +/* =========================================== + CARD COLUMN (Stacked cards container) + =========================================== */ +swp-card-column { + display: grid; + gap: var(--card-gap); + align-content: start; } @media (max-width: 900px) { @@ -1582,9 +1588,3 @@ swp-two-column-grid { } } -/* Stacked cards in a grid column */ -.stacked-cards { - display: flex; - flex-direction: column; - gap: var(--card-gap); -} diff --git a/PlanTempus.Application/wwwroot/css/stats.css b/PlanTempus.Application/wwwroot/css/stats.css index 1a4e993..b38e800 100644 --- a/PlanTempus.Application/wwwroot/css/stats.css +++ b/PlanTempus.Application/wwwroot/css/stats.css @@ -12,6 +12,8 @@ swp-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--card-gap); + margin-bottom: var(--section-gap); + } swp-stats-row { diff --git a/PlanTempus.Application/wwwroot/ts/modules/cash.ts b/PlanTempus.Application/wwwroot/ts/modules/cash.ts index 519dde2..2892122 100644 --- a/PlanTempus.Application/wwwroot/ts/modules/cash.ts +++ b/PlanTempus.Application/wwwroot/ts/modules/cash.ts @@ -88,10 +88,31 @@ export class CashController { toBankInput.addEventListener('input', calculate); actualCashInput.addEventListener('input', calculate); + // Setup Enter key navigation between fields + this.setupEnterNavigation([payoutsInput, toBankInput, actualCashInput]); + // Initial calculation calculate(); } + /** + * Setup Enter key to move focus to next input field + */ + private setupEnterNavigation(inputs: HTMLInputElement[]): void { + inputs.forEach((input, index) => { + input.addEventListener('keydown', (e) => { + if (e.key === 'Enter') { + e.preventDefault(); + const nextIndex = index + 1; + if (nextIndex < inputs.length) { + inputs[nextIndex].focus(); + inputs[nextIndex].select(); + } + } + }); + }); + } + /** * Calculate expected cash and difference */ @@ -113,13 +134,13 @@ export class CashController { } // Calculate and display difference - this.updateDifference(actual, expectedCash, actualCashInput.value); + this.updateDifference(actual, expectedCash); } /** * Update difference box with color coding */ - private updateDifference(actual: number, expected: number, rawValue: string): void { + private updateDifference(actual: number, expected: number): void { const box = document.getElementById('differenceBox'); const value = document.getElementById('differenceValue'); if (!box || !value) return; @@ -129,11 +150,7 @@ export class CashController { // Remove all state classes box.classList.remove('positive', 'negative', 'neutral'); - if (actual === 0 && rawValue === '') { - // No input yet - value.textContent = '– kr'; - box.classList.add('neutral'); - } else if (diff > 0) { + if (diff > 0) { // More cash than expected value.textContent = '+' + this.formatNumber(diff) + ' kr'; box.classList.add('positive');