@likable-hair/svelte 0.0.57 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dates/Calendar.svelte +3 -2
- package/dates/Calendar.svelte.d.ts +1 -0
- package/dates/utils.js +0 -1
- package/dialogs/Dialog.svelte +13 -3
- package/package.json +1 -1
package/dates/Calendar.svelte
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script >import { onMount } from 'svelte';
|
|
2
2
|
import { fly } from 'svelte/transition';
|
|
3
3
|
import { getDateRowsStats, getDaysNames } from './utils';
|
|
4
|
-
export let selectedDate = undefined, visibleMonth = new Date().getMonth(), visibleYear = new Date().getFullYear(), locale = 'it', showExtraMonthDays = true, showHeader = true, height = "100%", width = "100%", dayWidth = '30px', dayHeight = '30px', dayHoverColor = '#c9c8c873', daySelectedColor = '#adadad', selectedTextColor = "black", dayBackgroundColor = undefined, animationDuration = 200;
|
|
4
|
+
export let selectedDate = undefined, visibleMonth = new Date().getMonth(), visibleYear = new Date().getFullYear(), locale = 'it', showExtraMonthDays = true, showHeader = true, height = "100%", width = "100%", dayWidth = '30px', dayHeight = '30px', dayHoverColor = '#c9c8c873', daySelectedColor = '#adadad', selectedTextColor = "black", gridGap = "1px", dayBackgroundColor = undefined, animationDuration = 200;
|
|
5
5
|
onMount(() => {
|
|
6
6
|
});
|
|
7
7
|
import { createEventDispatcher } from 'svelte';
|
|
@@ -26,6 +26,7 @@ function handleDayClick(dateStat, extraMonth) {
|
|
|
26
26
|
<div
|
|
27
27
|
in:fly="{{delay: animationDuration, duration: animationDuration, y: 30}}"
|
|
28
28
|
out:fly|local="{{duration: animationDuration, y: -30}}"
|
|
29
|
+
style:gap={gridGap}
|
|
29
30
|
class="grid-layout"
|
|
30
31
|
>
|
|
31
32
|
{#if showHeader}
|
|
@@ -80,7 +81,7 @@ function handleDayClick(dateStat, extraMonth) {
|
|
|
80
81
|
.grid-layout {
|
|
81
82
|
display: grid;
|
|
82
83
|
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
|
83
|
-
|
|
84
|
+
height: 100%;
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
.day-slot {
|
package/dates/utils.js
CHANGED
package/dialogs/Dialog.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script >import {
|
|
1
|
+
<script >import { browser } from "$app/env";
|
|
2
|
+
import { beforeUpdate } from "svelte";
|
|
2
3
|
export let open = false, overlayOpacity = "30%", overlayColor = "#282828";
|
|
3
4
|
let zIndex = 50, localOpen = open;
|
|
4
5
|
beforeUpdate(() => {
|
|
@@ -12,6 +13,15 @@ beforeUpdate(() => {
|
|
|
12
13
|
});
|
|
13
14
|
zIndex = maxZIndex + 2;
|
|
14
15
|
}
|
|
16
|
+
document.body.style.overflow = 'hidden';
|
|
17
|
+
}
|
|
18
|
+
else if (!open) {
|
|
19
|
+
if (browser) {
|
|
20
|
+
let otherDialogs = document.querySelectorAll("[data-dialog=true]");
|
|
21
|
+
if (otherDialogs.length <= 1) {
|
|
22
|
+
document.body.style.overflow = 'auto';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
15
25
|
}
|
|
16
26
|
localOpen = open;
|
|
17
27
|
});
|
|
@@ -33,14 +43,14 @@ function handleOverlayClick() {
|
|
|
33
43
|
style:justify-content="space-between"
|
|
34
44
|
class="overlay-container"
|
|
35
45
|
class:overlay-container-active={localOpen}
|
|
36
|
-
on:touchmove|preventDefault={() => {}}
|
|
37
|
-
on:wheel|preventDefault={() => {}}
|
|
38
46
|
>
|
|
39
47
|
<div
|
|
40
48
|
style:background-color={overlayColor}
|
|
41
49
|
class="overlay"
|
|
42
50
|
class:overlay-active={localOpen}
|
|
43
51
|
on:click={handleOverlayClick}
|
|
52
|
+
on:touchmove|preventDefault={() => {}}
|
|
53
|
+
on:wheel|preventDefault={() => {}}
|
|
44
54
|
></div>
|
|
45
55
|
{#if localOpen }
|
|
46
56
|
<div
|