@likable-hair/svelte 0.0.63 → 0.0.64
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/common/Menu.svelte
CHANGED
|
@@ -69,14 +69,23 @@ $: if (closeOnClickOutside && !!menuElement) {
|
|
|
69
69
|
window.addEventListener('click', (event) => {
|
|
70
70
|
open = false;
|
|
71
71
|
});
|
|
72
|
+
window.addEventListener('touchstart', (event) => {
|
|
73
|
+
open = false;
|
|
74
|
+
});
|
|
72
75
|
if (!!activator) {
|
|
73
76
|
activator.addEventListener('click', (event) => {
|
|
74
77
|
event.stopPropagation();
|
|
75
78
|
});
|
|
79
|
+
activator.addEventListener('touchstart', (event) => {
|
|
80
|
+
event.stopPropagation();
|
|
81
|
+
});
|
|
76
82
|
}
|
|
77
83
|
menuElement.addEventListener('click', (event) => {
|
|
78
84
|
event.stopPropagation();
|
|
79
85
|
});
|
|
86
|
+
menuElement.addEventListener('touchstart', (event) => {
|
|
87
|
+
event.stopPropagation();
|
|
88
|
+
});
|
|
80
89
|
}
|
|
81
90
|
</script>
|
|
82
91
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import { dateToString } from "../dates/utils";
|
|
4
|
-
export let headers = undefined, items = undefined, backgroundColor = "rgba(255,255,255,0)", headerColor = "rgba(0,0,0,0.05)", rowSeparatorColor = headerColor, headerHeight = "30px", rowHeight = "70px", minWidth = undefined, height = "100%", width = "100%";
|
|
4
|
+
export let headers = undefined, items = undefined, backgroundColor = "rgba(255,255,255,0)", headerColor = "rgba(0,0,0,0.05)", rowSeparatorColor = headerColor, headerHeight = "30px", headerBorderRadius = "5px", rowHeight = "70px", minWidth = undefined, height = "100%", width = "100%";
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
{#if !!items && Array.isArray(items)}
|
|
@@ -11,7 +11,11 @@ export let headers = undefined, items = undefined, backgroundColor = "rgba(255,2
|
|
|
11
11
|
style:width="100%"
|
|
12
12
|
style:min-width={minWidth}
|
|
13
13
|
>
|
|
14
|
-
<thead
|
|
14
|
+
<thead
|
|
15
|
+
style:background-color={headerColor}
|
|
16
|
+
style:height={headerHeight}
|
|
17
|
+
style:border-radius={headerBorderRadius}
|
|
18
|
+
>
|
|
15
19
|
{#each headers as head}
|
|
16
20
|
<th style:width={head.width} style:min-width={head.minWidth}>
|
|
17
21
|
{head.label}
|
|
@@ -66,8 +66,13 @@ function handleWindowKeyDown(event) {
|
|
|
66
66
|
}
|
|
67
67
|
let input;
|
|
68
68
|
function handleContainerClick() {
|
|
69
|
-
if (!menuOpened)
|
|
69
|
+
if (!menuOpened) {
|
|
70
70
|
input.focus();
|
|
71
|
+
// had to timeout because it was catching click outside
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
openMenu();
|
|
74
|
+
}, 50);
|
|
75
|
+
}
|
|
71
76
|
}
|
|
72
77
|
let searchText, filteredItems = items;
|
|
73
78
|
$: if (!!searchText) {
|