mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-26 18:29:51 +00:00
UBER-641: fixed DatePopup. (#3535)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
f7d68ee7da
commit
2781082f81
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user