@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.
@@ -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
- gap: 1px;
84
+ height: 100%;
84
85
  }
85
86
 
86
87
  .day-slot {
@@ -15,6 +15,7 @@ declare const __propDef: {
15
15
  dayHoverColor?: string;
16
16
  daySelectedColor?: string;
17
17
  selectedTextColor?: string;
18
+ gridGap?: string;
18
19
  dayBackgroundColor?: string;
19
20
  animationDuration?: number;
20
21
  };
package/dates/utils.js CHANGED
@@ -90,7 +90,6 @@ export const getDateRows = (monthIndex, year, locale = 'it') => {
90
90
  else
91
91
  startIndex -= 1;
92
92
  }
93
- console.log(startIndex);
94
93
  let lastIndex = new Date(year, monthIndex + 1, 0).getDay();
95
94
  if (locale == 'it') {
96
95
  if (lastIndex === 0)
@@ -1,4 +1,5 @@
1
- <script >import { beforeUpdate } from "svelte";
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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likable-hair/svelte",
3
3
  "description": "A Svelte component for likablehair",
4
- "version": "0.0.57",
4
+ "version": "0.0.58",
5
5
  "devDependencies": {
6
6
  "@sveltejs/adapter-auto": "next",
7
7
  "@sveltejs/kit": "next",