Adds header sections to calendar week view
Improves calendar week view by adding header sections. This change introduces two new header sections, styled with an orange background, to the calendar week view. These sections are positioned in the second row of the week header, enhancing the visual organization and potentially providing space for additional information or actions related to the week view. The overall height of the header has also been adjusted to accommodate the new row.
This commit is contained in:
parent
a097b41def
commit
3691ebea85
3 changed files with 37 additions and 7 deletions
|
|
@ -254,6 +254,15 @@ export class GridManager {
|
||||||
|
|
||||||
weekHeader.appendChild(header);
|
weekHeader.appendChild(header);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add orange header sections in row 2
|
||||||
|
const headerSectionLeft = document.createElement('swp-header-section-left');
|
||||||
|
headerSectionLeft.textContent = 'Left Section';
|
||||||
|
weekHeader.appendChild(headerSectionLeft);
|
||||||
|
|
||||||
|
const headerSectionRight = document.createElement('swp-header-section-right');
|
||||||
|
headerSectionRight.textContent = 'Right Section';
|
||||||
|
weekHeader.appendChild(headerSectionRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ swp-calendar-nav {
|
||||||
swp-calendar-container {
|
swp-calendar-container {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 60px 1fr 20px;
|
grid-template-columns: 60px 1fr 20px;
|
||||||
grid-template-rows: 80px 1fr 20px;
|
grid-template-rows: 110px 1fr 20px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -50,7 +50,7 @@ swp-calendar-container {
|
||||||
swp-header-spacer {
|
swp-header-spacer {
|
||||||
grid-column: 1;
|
grid-column: 1;
|
||||||
grid-row: 1;
|
grid-row: 1;
|
||||||
height: 80px; /* Same as week header height */
|
height: 110px; /* Same as week header height */
|
||||||
background: var(--color-surface);
|
background: var(--color-surface);
|
||||||
border-right: 1px solid var(--color-border);
|
border-right: 1px solid var(--color-border);
|
||||||
border-bottom: 1px solid var(--color-border);
|
border-bottom: 1px solid var(--color-border);
|
||||||
|
|
@ -63,7 +63,7 @@ swp-header-spacer {
|
||||||
swp-right-header-spacer {
|
swp-right-header-spacer {
|
||||||
grid-column: 3;
|
grid-column: 3;
|
||||||
grid-row: 1;
|
grid-row: 1;
|
||||||
height: 80px; /* Same as week header height */
|
height: 110px; /* Same as week header height */
|
||||||
background: var(--color-surface);
|
background: var(--color-surface);
|
||||||
border-left: 1px solid var(--color-border);
|
border-left: 1px solid var(--color-border);
|
||||||
border-bottom: 1px solid var(--color-border);
|
border-bottom: 1px solid var(--color-border);
|
||||||
|
|
@ -76,7 +76,7 @@ swp-week-container {
|
||||||
grid-column: 2 / 3;
|
grid-column: 2 / 3;
|
||||||
grid-row: 1 / 3;
|
grid-row: 1 / 3;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-rows: 80px 1fr;
|
grid-template-rows: 110px 1fr;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
|
transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
|
@ -211,17 +211,18 @@ swp-hour-marker::after {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Week header */
|
/* Week header with 2 rows */
|
||||||
swp-week-header {
|
swp-week-header {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(7, minmax(var(--day-column-min-width), 1fr));
|
grid-template-columns: repeat(7, minmax(var(--day-column-min-width), 1fr));
|
||||||
|
grid-template-rows: 80px 30px; /* Row 1: day headers, Row 2: orange sections */
|
||||||
min-width: calc(var(--week-days) * var(--day-column-min-width)); /* Dynamic width */
|
min-width: calc(var(--week-days) * var(--day-column-min-width)); /* Dynamic width */
|
||||||
background: var(--color-surface);
|
background: var(--color-surface);
|
||||||
border-bottom: 1px solid var(--color-border);
|
border-bottom: 1px solid var(--color-border);
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 3; /* Lower than header-spacer so it slides under during horizontal scroll */
|
z-index: 3; /* Lower than header-spacer so it slides under during horizontal scroll */
|
||||||
height: 80px; /* Fixed height */
|
height: 110px; /* Updated height: 80px + 30px */
|
||||||
}
|
}
|
||||||
|
|
||||||
swp-day-header {
|
swp-day-header {
|
||||||
|
|
@ -264,6 +265,26 @@ swp-day-header[data-today="true"] swp-day-date {
|
||||||
margin: 4px auto 0;
|
margin: 4px auto 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Orange header sections in row 2 */
|
||||||
|
swp-header-section-left {
|
||||||
|
grid-column: 1 / 3; /* Span columns 1-2 */
|
||||||
|
grid-row: 2; /* Row 2 only */
|
||||||
|
background: #ff9800; /* Orange background */
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
swp-header-section-right {
|
||||||
|
grid-column: 3 / 8; /* Span columns 3-7 */
|
||||||
|
grid-row: 2; /* Row 2 only */
|
||||||
|
background: #ff9800; /* Orange background */
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
/* Scrollable content */
|
/* Scrollable content */
|
||||||
swp-scrollable-content {
|
swp-scrollable-content {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ swp-week-header {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
height: 80px; /* Fixed height */
|
height: 110px; /* Fixed height */
|
||||||
}
|
}
|
||||||
|
|
||||||
swp-day-header {
|
swp-day-header {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue