Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(NcDateTimePicker): improve design and make it consistent with Nc 30 #6125

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/components/NcDateTimePicker/NcDateTimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ export default {
// 0 = sunday, 1 = monday
firstDayOfWeek: getFirstDay(),
},
monthFormat: 'MMM',
monthFormat: 'MMMM',
months: getMonthNames(), // Use long month names in month picker
}
},

Expand Down Expand Up @@ -419,8 +420,17 @@ export default {
</script>

<style lang="scss" scoped>
.mx-datepicker :deep(.mx-input-wrapper .mx-input) {
background-clip: border-box;
.mx-datepicker {
:deep(.mx-input-wrapper .mx-input) {
background-clip: border-box;
}

:deep(.mx-calendar-panel-date) {
.mx-btn-icon-double-left,
.mx-btn-icon-double-right {
display: none;
}
}
}

.datetime-picker-inline-icon {
Expand Down
35 changes: 21 additions & 14 deletions src/components/NcDateTimePicker/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,13 @@

.mx-datepicker-btn-confirm {
background-color: var(--color-primary-element);
border-color: var(--color-primary-element);
color: var(--color-primary-element-text) !important;
opacity: 1 !important;
}

.mx-datepicker-btn-confirm:hover {
background-color: var(--color-primary-element-light) !important;
border-color: var(--color-primary-element-light) !important;
background-color: var(--color-primary-element-hover) !important;
border-color: var(--color-primary-element-hover) !important;
}

// default popup styles
Expand Down Expand Up @@ -140,8 +139,8 @@
.cell {
transition: all 100ms ease-in-out;
text-align: center;
opacity: $opacity_normal;
border-radius: 50px;
opacity: $opacity_full;
border-radius: var(--border-radius-element);

// force pointer on all content
> * {
Expand All @@ -166,9 +165,11 @@
&.in-range {
opacity: $opacity_normal;
}
&.disabled,
&.not-current-month {
color: var(--color-text-maxcontrast);
}
&.not-current-month {
opacity: $opacity_disabled;
color: var(--color-text-lighter);
&:hover,
&:focus {
opacity: $opacity_full;
Expand Down Expand Up @@ -197,7 +198,7 @@
.mx-week-number {
text-align: center;
opacity: $opacity_normal;
border-radius: 50px;
border-radius: var(--border-radius-element)
}

// cell that are not in a table
Expand Down Expand Up @@ -248,9 +249,15 @@
&.mx-table-date {
tr th,
tr td {
font-size: unset;

// only two rows in year panel
flex-basis: $cell_height;
}

tr th {
color: var(--color-text-maxcontrast);
}
}
}

Expand All @@ -264,7 +271,7 @@
text-decoration: none;
opacity: $opacity_disabled;
color: var(--color-text-lighter);
border-radius: $cell_height;
border-radius: var(--border-radius-element);
line-height: $cell_height - 12px; // padding minus 2px for better visual
// Mouse feedback
&:hover,
Expand All @@ -291,17 +298,17 @@
cursor: pointer;
text-align: center;
text-decoration: none;
opacity: $opacity_normal;
opacity: $opacity_full;
color: var(--color-main-text);
border-radius: $cell_height;
background-color: transparent;
border-radius: var(--border-radius-element);
line-height: $cell_height - 12px; // padding minus 2px for better visual

// Mouse feedback
&:hover,
&:focus {
opacity: $opacity_full;
color: var(--color-main-text);
background-color: var(--color-background-darker);
background-color: var(--color-background-hover);
}

// Header arrows
Expand Down Expand Up @@ -371,7 +378,7 @@
&:hover,
&.mx-active-week {
opacity: $opacity_full;
border-radius: 50px;
border-radius: var(--border-radius-element);
background-color: var(--color-background-dark);
td {
background-color: transparent;
Expand Down
Loading