From c94627f51e61534ba559e9c9d615fa85a8cf37ce Mon Sep 17 00:00:00 2001 From: Svyatoslav Zaytsev Date: Thu, 1 Aug 2024 16:52:20 +0500 Subject: [PATCH] fix(addon-mobile): fix mobile-calendar size without header --- .../mobile-calendar/mobile-calendar.component.ts | 6 +++++- .../mobile-calendar/mobile-calendar.style.less | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/projects/addon-mobile/components/mobile-calendar/mobile-calendar.component.ts b/projects/addon-mobile/components/mobile-calendar/mobile-calendar.component.ts index 364ea2b009701..ba7d24c193e91 100644 --- a/projects/addon-mobile/components/mobile-calendar/mobile-calendar.component.ts +++ b/projects/addon-mobile/components/mobile-calendar/mobile-calendar.component.ts @@ -73,7 +73,11 @@ import { styleUrls: ['./mobile-calendar.style.less'], changeDetection: ChangeDetectionStrategy.OnPush, providers: TUI_MOBILE_CALENDAR_PROVIDERS, - host: {'[class._ios]': 'isIOS', '[class._initialized]': 'initialized'}, + host: { + '[class._ios]': 'isIOS', + '[class._initialized]': 'initialized', + '[class._without_header]': '!chooseDayOrRangeTexts$', + }, }) export class TuiMobileCalendarComponent implements AfterViewInit { @ViewChild('yearsScrollRef') diff --git a/projects/addon-mobile/components/mobile-calendar/mobile-calendar.style.less b/projects/addon-mobile/components/mobile-calendar/mobile-calendar.style.less index 7565b4a51dd5a..8f3a83682a76a 100644 --- a/projects/addon-mobile/components/mobile-calendar/mobile-calendar.style.less +++ b/projects/addon-mobile/components/mobile-calendar/mobile-calendar.style.less @@ -6,6 +6,7 @@ @background: var(--tui-base-01); :host { + --tui-mobile-calendar-header-height: 3.5rem; display: block; height: 100%; font-family: -apple-system, BlinkMacSystemFont, Roboto, sans-serif; @@ -13,11 +14,15 @@ -webkit-tap-highlight-color: transparent; } +:host(._without_header) { + --tui-mobile-calendar-header-height: 0rem; +} + .t-header { position: relative; display: flex; align-items: center; - height: 3.5rem; + height: var(--tui-mobile-calendar-header-height); padding: 0 1rem; // TODO: research if it can be used in rem units /* stylelint-disable-next-line */ @@ -164,7 +169,7 @@ .t-months { .scrollbar-hidden(); - height: ~'calc(100% - 9.5rem)'; + height: ~'calc(100% - 6rem - var(--tui-mobile-calendar-header-height))'; box-shadow: 0 -1px @border; overflow-x: hidden;