UBER-641: fixed DatePopup. (#3535)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov 2023-07-31 09:36:24 +03:00 committed by GitHub
parent f7d68ee7da
commit 2781082f81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@
import DateInputBox from './DateInputBox.svelte' import DateInputBox from './DateInputBox.svelte'
import MonthSquare from './MonthSquare.svelte' import MonthSquare from './MonthSquare.svelte'
import Shifts from './Shifts.svelte' import Shifts from './Shifts.svelte'
import { Scroller, deviceOptionsStore as deviceInfo } from '../..'
export let currentDate: Date | null export let currentDate: Date | null
export let withTime: boolean = false export let withTime: boolean = false
@ -35,6 +36,7 @@
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
const today: Date = new Date(Date.now()) const today: Date = new Date(Date.now())
$: docHeight = $deviceInfo.docHeight
let viewDate: Date = currentDate ?? today let viewDate: Date = currentDate ?? today
let viewDateSec: Date let viewDateSec: Date
@ -91,40 +93,42 @@
/> />
</div> </div>
<div class="content"> <div class="content">
<div class="label"> <Scroller padding={'1.5rem 2rem'} thinScrollBars>
<span class="bold"><Label {label} /></span> <div class="label">
{#if detail} <span class="bold"><Label {label} /></span>
<span class="divider">-</span> {#if detail}
<Label label={detail} /> <span class="divider">-</span>
{/if} <Label label={detail} />
</div> {/if}
</div>
<DateInputBox <DateInputBox
bind:this={dateInput} bind:this={dateInput}
bind:currentDate bind:currentDate
{withTime} {withTime}
on:close={() => closeDP(withTime)} on:close={() => closeDP(withTime)}
on:save={() => saveDate(withTime)} on:save={() => saveDate(withTime)}
/> />
<div class="month-group"> <div class="month-group">
<MonthSquare <MonthSquare
bind:currentDate bind:currentDate
{viewDate} {viewDate}
{mondayStart} {mondayStart}
viewUpdate={false} viewUpdate={false}
hideNavigator="all" hideNavigator="all"
on:update={(result) => updateDate(result.detail)} on:update={(result) => updateDate(result.detail)}
/> />
<MonthSquare <MonthSquare
bind:currentDate bind:currentDate
viewDate={viewDateSec} viewDate={viewDateSec}
{mondayStart} {mondayStart}
viewUpdate={false} viewUpdate={false}
on:update={(result) => updateDate(result.detail)} on:update={(result) => updateDate(result.detail)}
on:navigation={(result) => navigateMonth(result.detail)} on:navigation={(result) => navigateMonth(result.detail)}
/> />
</div> </div>
</Scroller>
</div> </div>
<div class="footer"> <div class="footer">
<Button <Button
@ -172,7 +176,6 @@
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 1.5rem 2rem;
min-height: 0; min-height: 0;
.label { .label {