@likable-hair/svelte 0.0.77 → 1.0.0
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/README.md +1 -1
- package/dist/buttons/Button.svelte +142 -0
- package/dist/buttons/Button.svelte.d.ts +54 -0
- package/dist/common/Card.svelte +37 -0
- package/dist/common/Card.svelte.d.ts +40 -0
- package/dist/common/Gesture.svelte +57 -0
- package/{common → dist/common}/Gesture.svelte.d.ts +5 -5
- package/dist/common/IntersectionObserver.svelte +47 -0
- package/dist/common/IntersectionObserver.svelte.d.ts +24 -0
- package/dist/common/MediaQuery.svelte +40 -0
- package/{common → dist/common}/MediaQuery.svelte.d.ts +4 -4
- package/dist/common/Menu.svelte +120 -0
- package/dist/common/Menu.svelte.d.ts +36 -0
- package/{common → dist/common}/SimpleTable.svelte +3 -3
- package/{common → dist/common}/SimpleTable.svelte.d.ts +15 -15
- package/{common → dist/common}/materialDesign.css +1 -1
- package/{common → dist/common}/scroller.js +4 -2
- package/dist/dates/Calendar.svelte +115 -0
- package/dist/dates/Calendar.svelte.d.ts +48 -0
- package/{dates → dist/dates}/DatePicker.svelte +42 -38
- package/dist/dates/DatePicker.svelte.d.ts +38 -0
- package/{dates → dist/dates}/MonthSelector.svelte +11 -15
- package/{dates → dist/dates}/MonthSelector.svelte.d.ts +10 -10
- package/dist/dates/TimePickerTextField.svelte +78 -0
- package/dist/dates/TimePickerTextField.svelte.d.ts +26 -0
- package/dist/dates/YearSelector.svelte +53 -0
- package/{dates → dist/dates}/YearSelector.svelte.d.ts +7 -7
- package/{dates → dist/dates}/utils.d.ts +5 -5
- package/{dates → dist/dates}/utils.js +68 -48
- package/{dialogs → dist/dialogs}/Dialog.svelte +37 -34
- package/{dialogs → dist/dialogs}/Dialog.svelte.d.ts +7 -6
- package/dist/forms/Autocomplete.svelte +225 -0
- package/dist/forms/Autocomplete.svelte.d.ts +70 -0
- package/{forms → dist/forms}/Checkbox.svelte +4 -5
- package/dist/forms/Checkbox.svelte.d.ts +28 -0
- package/dist/forms/FileInput.svelte +92 -0
- package/dist/forms/FileInput.svelte.d.ts +37 -0
- package/dist/forms/FileInputList.svelte +135 -0
- package/dist/forms/FileInputList.svelte.d.ts +30 -0
- package/{forms → dist/forms}/Switch.svelte +18 -15
- package/dist/forms/Switch.svelte.d.ts +27 -0
- package/{forms → dist/forms}/Textarea.svelte +14 -18
- package/dist/forms/Textarea.svelte.d.ts +39 -0
- package/dist/forms/Textfield.svelte +324 -0
- package/dist/forms/Textfield.svelte.d.ts +54 -0
- package/{forms → dist/forms}/VerticalSwitch.svelte +14 -25
- package/dist/forms/VerticalSwitch.svelte.d.ts +30 -0
- package/{forms → dist/forms}/VerticalTextSwitch.svelte +19 -10
- package/dist/forms/VerticalTextSwitch.svelte.d.ts +28 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +44 -0
- package/{loaders → dist/loaders}/CircularLoader.svelte +24 -24
- package/dist/loaders/CircularLoader.svelte.d.ts +19 -0
- package/{loaders → dist/loaders}/Skeleton.svelte +27 -19
- package/dist/loaders/Skeleton.svelte.d.ts +28 -0
- package/dist/media/AttachmentDownloader.svelte +47 -0
- package/dist/media/AttachmentDownloader.svelte.d.ts +30 -0
- package/dist/media/Avatar.svelte +32 -0
- package/dist/media/Avatar.svelte.d.ts +26 -0
- package/{media → dist/media}/Carousel.svelte +16 -19
- package/dist/media/Carousel.svelte.d.ts +26 -0
- package/dist/media/DescriptiveAvatar.svelte +86 -0
- package/dist/media/DescriptiveAvatar.svelte.d.ts +35 -0
- package/{media → dist/media}/Gallery.svelte +39 -44
- package/dist/media/Gallery.svelte.d.ts +26 -0
- package/{media → dist/media}/Icon.svelte +1 -0
- package/{media → dist/media}/Icon.svelte.d.ts +8 -7
- package/{media → dist/media}/Image.svelte +56 -54
- package/dist/media/Image.svelte.d.ts +35 -0
- package/{media → dist/media}/ImageGrid.svelte +15 -17
- package/dist/media/ImageGrid.svelte.d.ts +35 -0
- package/{navigation → dist/navigation}/Breadcrumb.svelte +23 -22
- package/{navigation → dist/navigation}/Breadcrumb.svelte.d.ts +9 -9
- package/{navigation → dist/navigation}/Chip.svelte +19 -25
- package/dist/navigation/Chip.svelte.d.ts +30 -0
- package/dist/navigation/Drawer.svelte +139 -0
- package/dist/navigation/Drawer.svelte.d.ts +36 -0
- package/{navigation → dist/navigation}/HeaderMenu.svelte +38 -55
- package/dist/navigation/HeaderMenu.svelte.d.ts +42 -0
- package/{navigation → dist/navigation}/Navigator.svelte +9 -11
- package/{navigation → dist/navigation}/Navigator.svelte.d.ts +8 -8
- package/{navigation → dist/navigation}/TabSwitcher.svelte +46 -36
- package/dist/navigation/TabSwitcher.svelte.d.ts +39 -0
- package/dist/progress/ProgressBar.svelte +37 -0
- package/dist/progress/ProgressBar.svelte.d.ts +22 -0
- package/{shop → dist/shop}/ProductCard.svelte +44 -51
- package/dist/shop/ProductCard.svelte.d.ts +30 -0
- package/{shop → dist/shop}/ProductsGrid.svelte +15 -13
- package/dist/shop/ProductsGrid.svelte.d.ts +44 -0
- package/{stores → dist/stores}/mediaQuery.d.ts +1 -1
- package/{stores → dist/stores}/mediaQuery.js +23 -23
- package/{timeline → dist/timeline}/SimpleTimeLine.svelte +73 -60
- package/{timeline → dist/timeline}/SimpleTimeLine.svelte.d.ts +17 -17
- package/package.json +192 -108
- package/buttons/Button.svelte +0 -131
- package/buttons/Button.svelte.d.ts +0 -51
- package/buttons/ToggleButton.svelte +0 -0
- package/buttons/ToggleButton.svelte.d.ts +0 -19
- package/common/Card.svelte +0 -46
- package/common/Card.svelte.d.ts +0 -39
- package/common/Gesture.svelte +0 -65
- package/common/IntersectionObserver.svelte +0 -58
- package/common/IntersectionObserver.svelte.d.ts +0 -39
- package/common/MediaQuery.svelte +0 -30
- package/common/Menu.svelte +0 -112
- package/common/Menu.svelte.d.ts +0 -36
- package/dates/Calendar.svelte +0 -119
- package/dates/Calendar.svelte.d.ts +0 -48
- package/dates/DatePicker.svelte.d.ts +0 -38
- package/dates/TimePickerTextField.svelte +0 -90
- package/dates/TimePickerTextField.svelte.d.ts +0 -26
- package/dates/YearSelector.svelte +0 -63
- package/forms/Autocomplete.svelte +0 -236
- package/forms/Autocomplete.svelte.d.ts +0 -70
- package/forms/Checkbox.svelte.d.ts +0 -28
- package/forms/FileInput.svelte +0 -90
- package/forms/FileInput.svelte.d.ts +0 -43
- package/forms/FileInputList.svelte +0 -123
- package/forms/FileInputList.svelte.d.ts +0 -30
- package/forms/Switch.svelte.d.ts +0 -27
- package/forms/Textarea.svelte.d.ts +0 -39
- package/forms/Textfield.svelte +0 -319
- package/forms/Textfield.svelte.d.ts +0 -54
- package/forms/VerticalSwitch.svelte.d.ts +0 -30
- package/forms/VerticalTextSwitch.svelte.d.ts +0 -28
- package/loaders/CircularLoader.svelte.d.ts +0 -19
- package/loaders/Skeleton.svelte.d.ts +0 -28
- package/loaders/sectionType.d.ts +0 -4
- package/loaders/sectionType.js +0 -5
- package/media/AttachmentDownloader.svelte +0 -60
- package/media/AttachmentDownloader.svelte.d.ts +0 -30
- package/media/Avatar.svelte +0 -32
- package/media/Avatar.svelte.d.ts +0 -26
- package/media/Carousel.svelte.d.ts +0 -26
- package/media/DescriptiveAvatar.svelte +0 -81
- package/media/DescriptiveAvatar.svelte.d.ts +0 -32
- package/media/Gallery.svelte.d.ts +0 -26
- package/media/Image.svelte.d.ts +0 -34
- package/media/ImageGrid.svelte.d.ts +0 -35
- package/navigation/Chip.svelte.d.ts +0 -30
- package/navigation/Drawer.svelte +0 -140
- package/navigation/Drawer.svelte.d.ts +0 -37
- package/navigation/HeaderMenu.svelte.d.ts +0 -42
- package/navigation/TabSwitcher.svelte.d.ts +0 -35
- package/progress/ProgressBar.svelte +0 -36
- package/progress/ProgressBar.svelte.d.ts +0 -22
- package/shop/ProductCard.svelte.d.ts +0 -30
- package/shop/ProductsGrid.svelte.d.ts +0 -44
- package/timeline/ScrollTimeLine.svelte +0 -82
- package/timeline/ScrollTimeLine.svelte.d.ts +0 -31
- /package/{common → dist/common}/scroller.d.ts +0 -0
package/README.md
CHANGED
|
@@ -23,4 +23,4 @@ To publish the package make the following steps:
|
|
|
23
23
|
|
|
24
24
|
- edit the package.json version, then commit all the changes
|
|
25
25
|
- run `npm run package`, svelte will generate a package folder with all the necessary stuff inside
|
|
26
|
-
- make sure you're logged in with your npm account, then run `npm publish ./package --access=public`
|
|
26
|
+
- make sure you're logged in with your npm account, then run `npm publish ./package --access=public`
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<script>export let type = "default", active = false, loading = false, icon = void 0, iconSize = 15, clazz = "", maxWidth = void 0, maxHeight = void 0, minWidth = void 0, minHeight = void 0, width = void 0, height = void 0, textAlign = "center", cursor = "pointer", padding = "5px", fontSize = void 0, color = void 0, display = void 0, justifyContent = void 0, alignItems = void 0, backgroundColor = void 0, hoverBackgroundColor = "#88888847", activeBackgroundColor = hoverBackgroundColor, borderRadius = void 0, border = void 0, boxShadow = void 0, loaderHeight = void 0, loaderWidth = void 0, disabled = false;
|
|
2
|
+
export { clazz as class };
|
|
3
|
+
import { createEventDispatcher } from "svelte";
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
function handleClick(event) {
|
|
6
|
+
if (disabled)
|
|
7
|
+
return;
|
|
8
|
+
dispatch("click", {
|
|
9
|
+
nativeEvent: event
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function handleKeyPress(event) {
|
|
13
|
+
if (disabled)
|
|
14
|
+
return;
|
|
15
|
+
dispatch("keypress", {
|
|
16
|
+
nativeEvent: event
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
$:
|
|
20
|
+
defaultBorderRadius = type == "icon" ? "50%" : "5px";
|
|
21
|
+
$:
|
|
22
|
+
position = $$slots.append ? "relative" : void 0;
|
|
23
|
+
import Icon from "../media/Icon.svelte";
|
|
24
|
+
import CircularLoader from "../loaders/CircularLoader.svelte";
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
style:width
|
|
29
|
+
style:max-width={maxWidth}
|
|
30
|
+
style:min-width={minWidth}
|
|
31
|
+
style:height
|
|
32
|
+
style:max-height={maxHeight}
|
|
33
|
+
style:min-height={minHeight}
|
|
34
|
+
style:text-align={textAlign}
|
|
35
|
+
style:position
|
|
36
|
+
style:cursor
|
|
37
|
+
style:padding
|
|
38
|
+
style:font-size={fontSize}
|
|
39
|
+
style:color
|
|
40
|
+
style:display
|
|
41
|
+
style:justify-content={justifyContent}
|
|
42
|
+
style:align-items={alignItems}
|
|
43
|
+
style:--button-border={border}
|
|
44
|
+
style:--button-border-radius={borderRadius
|
|
45
|
+
? borderRadius
|
|
46
|
+
: defaultBorderRadius}
|
|
47
|
+
style:--button-background-color={active
|
|
48
|
+
? activeBackgroundColor
|
|
49
|
+
: backgroundColor}
|
|
50
|
+
style:--button-hover-background-color={hoverBackgroundColor}
|
|
51
|
+
style:--button-box-shadow={boxShadow}
|
|
52
|
+
style:--button-icon-height={iconSize + 5 + "pt"}
|
|
53
|
+
style:--button-icon-width={iconSize + 5 + "pt"}
|
|
54
|
+
class="button no-select {clazz}"
|
|
55
|
+
class:button-default={type === "default"}
|
|
56
|
+
class:button-text={type === "text"}
|
|
57
|
+
class:button-icon={type === "icon"}
|
|
58
|
+
on:click={handleClick}
|
|
59
|
+
on:keypress={handleKeyPress}
|
|
60
|
+
>
|
|
61
|
+
{#if loading}
|
|
62
|
+
<CircularLoader {color} height={loaderHeight} width={loaderWidth} />
|
|
63
|
+
{:else}
|
|
64
|
+
{#if !!icon}
|
|
65
|
+
<Icon name={icon} size={iconSize} />
|
|
66
|
+
{:else}
|
|
67
|
+
<slot />
|
|
68
|
+
{/if}
|
|
69
|
+
{#if $$slots.append}
|
|
70
|
+
<span class="append-item">
|
|
71
|
+
<slot name="append" />
|
|
72
|
+
</span>
|
|
73
|
+
{/if}
|
|
74
|
+
{/if}
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<style>
|
|
78
|
+
.append-item {
|
|
79
|
+
position: absolute;
|
|
80
|
+
right: 0px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.button {
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.button-default {
|
|
89
|
+
transition: background-color 200ms;
|
|
90
|
+
background-color: var(--button-background-color);
|
|
91
|
+
outline: 0;
|
|
92
|
+
border: var(--button-border);
|
|
93
|
+
border-radius: var(--button-border-radius, 0.25rem);
|
|
94
|
+
box-shadow: var(--button-box-shadow, 0 0 0.5rem rgba(0, 0, 0, 0.3));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.button-default:hover {
|
|
98
|
+
background-color: var(
|
|
99
|
+
--button-hover-background-color,
|
|
100
|
+
var(--button-background-color)
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.button-text {
|
|
105
|
+
transition: background-color 200ms;
|
|
106
|
+
text-transform: uppercase;
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
outline: 0;
|
|
109
|
+
border: var(--button-border);
|
|
110
|
+
border-radius: var(--button-border-radius, 0.25rem);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.button-text:hover {
|
|
114
|
+
background-color: var(--button-hover-background-color, transparent);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.button-icon {
|
|
118
|
+
transition: background-color 200ms;
|
|
119
|
+
outline: 0;
|
|
120
|
+
border: var(--button-border);
|
|
121
|
+
border-radius: var(--button-border-radius, 50%);
|
|
122
|
+
height: var(--button-icon-height) !important;
|
|
123
|
+
width: var(--button-icon-width) !important;
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.button-icon:hover {
|
|
130
|
+
background-color: var(--button-hover-background-color, transparent);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.no-select {
|
|
134
|
+
-webkit-touch-callout: none; /* iOS Safari */
|
|
135
|
+
-webkit-user-select: none; /* Safari */
|
|
136
|
+
-khtml-user-select: none; /* Konqueror HTML */
|
|
137
|
+
-moz-user-select: none; /* Old versions of Firefox */
|
|
138
|
+
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
139
|
+
user-select: none; /* Non-prefixed version, currently
|
|
140
|
+
supported by Chrome, Edge, Opera and Firefox */
|
|
141
|
+
}
|
|
142
|
+
</style>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
type?: "default" | "text" | "icon" | undefined;
|
|
5
|
+
active?: boolean | undefined;
|
|
6
|
+
loading?: boolean | undefined;
|
|
7
|
+
icon?: string | undefined;
|
|
8
|
+
iconSize?: number | undefined;
|
|
9
|
+
class?: string | undefined;
|
|
10
|
+
maxWidth?: string | undefined;
|
|
11
|
+
maxHeight?: string | undefined;
|
|
12
|
+
minWidth?: string | undefined;
|
|
13
|
+
minHeight?: string | undefined;
|
|
14
|
+
width?: string | undefined;
|
|
15
|
+
height?: string | undefined;
|
|
16
|
+
textAlign?: string | undefined;
|
|
17
|
+
cursor?: string | undefined;
|
|
18
|
+
padding?: string | undefined;
|
|
19
|
+
fontSize?: string | undefined;
|
|
20
|
+
color?: string | null | undefined;
|
|
21
|
+
display?: string | undefined;
|
|
22
|
+
justifyContent?: string | undefined;
|
|
23
|
+
alignItems?: string | undefined;
|
|
24
|
+
backgroundColor?: string | undefined;
|
|
25
|
+
hoverBackgroundColor?: string | undefined;
|
|
26
|
+
activeBackgroundColor?: string | undefined;
|
|
27
|
+
borderRadius?: string | undefined;
|
|
28
|
+
border?: string | undefined;
|
|
29
|
+
boxShadow?: string | undefined;
|
|
30
|
+
loaderHeight?: string | undefined;
|
|
31
|
+
loaderWidth?: string | undefined;
|
|
32
|
+
disabled?: boolean | undefined;
|
|
33
|
+
};
|
|
34
|
+
events: {
|
|
35
|
+
click: CustomEvent<{
|
|
36
|
+
nativeEvent: MouseEvent;
|
|
37
|
+
}>;
|
|
38
|
+
keypress: CustomEvent<{
|
|
39
|
+
nativeEvent: KeyboardEvent;
|
|
40
|
+
}>;
|
|
41
|
+
} & {
|
|
42
|
+
[evt: string]: CustomEvent<any>;
|
|
43
|
+
};
|
|
44
|
+
slots: {
|
|
45
|
+
default: {};
|
|
46
|
+
append: {};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export type ButtonProps = typeof __propDef.props;
|
|
50
|
+
export type ButtonEvents = typeof __propDef.events;
|
|
51
|
+
export type ButtonSlots = typeof __propDef.slots;
|
|
52
|
+
export default class Button extends SvelteComponentTyped<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script>export let outlined = false, maxWidth = void 0, maxHeight = void 0, minWidth = void 0, minHeight = void 0, width = "fit-content", height = void 0, padding = "5px", borderRadius = "5px", backgroundColor = "rgb(252, 252, 252)", color = void 0, borderColor = void 0, borderWidth = void 0, marginBottom = void 0, marginTop = void 0, marginLeft = void 0, marginRight = void 0, boxShadow = "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<div
|
|
5
|
+
style:width
|
|
6
|
+
style:max-width={maxWidth}
|
|
7
|
+
style:min-width={minWidth}
|
|
8
|
+
style:height
|
|
9
|
+
style:max-height={maxHeight}
|
|
10
|
+
style:min-height={minHeight}
|
|
11
|
+
style:padding
|
|
12
|
+
style:border-radius={borderRadius}
|
|
13
|
+
style:background-color={backgroundColor}
|
|
14
|
+
style:color
|
|
15
|
+
style:border-color={borderColor}
|
|
16
|
+
style:border-width={borderWidth}
|
|
17
|
+
style:margin-bottom={marginBottom}
|
|
18
|
+
style:margin-top={marginTop}
|
|
19
|
+
style:margin-left={marginLeft}
|
|
20
|
+
style:margin-right={marginRight}
|
|
21
|
+
style:box-shadow={boxShadow}
|
|
22
|
+
style:display="flex"
|
|
23
|
+
style:flex-direction="column"
|
|
24
|
+
on:click
|
|
25
|
+
on:keypress
|
|
26
|
+
class:border-solid={outlined}
|
|
27
|
+
>
|
|
28
|
+
<div style:flex="none" class="header">
|
|
29
|
+
<slot name="header" />
|
|
30
|
+
</div>
|
|
31
|
+
<div style:flex-shrink="1" style:overflow-y="auto" class="body">
|
|
32
|
+
<slot />
|
|
33
|
+
</div>
|
|
34
|
+
<div style:flex="none" class="footer flex-none">
|
|
35
|
+
<slot name="footer" />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
outlined?: boolean | undefined;
|
|
5
|
+
maxWidth?: string | undefined;
|
|
6
|
+
maxHeight?: string | undefined;
|
|
7
|
+
minWidth?: string | undefined;
|
|
8
|
+
minHeight?: string | undefined;
|
|
9
|
+
width?: string | undefined;
|
|
10
|
+
height?: string | undefined;
|
|
11
|
+
padding?: string | undefined;
|
|
12
|
+
borderRadius?: string | undefined;
|
|
13
|
+
backgroundColor?: string | undefined;
|
|
14
|
+
color?: string | undefined;
|
|
15
|
+
borderColor?: string | undefined;
|
|
16
|
+
borderWidth?: string | undefined;
|
|
17
|
+
marginBottom?: string | undefined;
|
|
18
|
+
marginTop?: string | undefined;
|
|
19
|
+
marginLeft?: string | undefined;
|
|
20
|
+
marginRight?: string | undefined;
|
|
21
|
+
boxShadow?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
events: {
|
|
24
|
+
click: MouseEvent;
|
|
25
|
+
keypress: KeyboardEvent;
|
|
26
|
+
} & {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
};
|
|
29
|
+
slots: {
|
|
30
|
+
header: {};
|
|
31
|
+
default: {};
|
|
32
|
+
footer: {};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type CardProps = typeof __propDef.props;
|
|
36
|
+
export type CardEvents = typeof __propDef.events;
|
|
37
|
+
export type CardSlots = typeof __propDef.slots;
|
|
38
|
+
export default class Card extends SvelteComponentTyped<CardProps, CardEvents, CardSlots> {
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
const dispatch = createEventDispatcher();
|
|
3
|
+
export let timeThreshold = 200, diagonalThreshold = 100;
|
|
4
|
+
let lastTouch, startTouch, endTouch, startTime, endTime;
|
|
5
|
+
function handleTouchStart(event) {
|
|
6
|
+
lastTouch = event.touches[0];
|
|
7
|
+
startTouch = event.touches[0];
|
|
8
|
+
startTime = new Date();
|
|
9
|
+
}
|
|
10
|
+
function handleTouchEnd(event) {
|
|
11
|
+
endTouch = event.changedTouches[0];
|
|
12
|
+
endTime = new Date();
|
|
13
|
+
let timeDifference = endTime.getTime() - startTime.getTime();
|
|
14
|
+
if (timeDifference < timeThreshold) {
|
|
15
|
+
let direction;
|
|
16
|
+
let xDifference = endTouch.clientX - startTouch.clientX;
|
|
17
|
+
let yDifference = endTouch.clientY - startTouch.clientY;
|
|
18
|
+
if (Math.abs(Math.abs(xDifference) - Math.abs(yDifference)) < diagonalThreshold)
|
|
19
|
+
return;
|
|
20
|
+
if (Math.abs(xDifference) > Math.abs(yDifference)) {
|
|
21
|
+
if (xDifference > 0) {
|
|
22
|
+
direction = "right";
|
|
23
|
+
} else {
|
|
24
|
+
direction = "left";
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
if (yDifference > 0) {
|
|
28
|
+
direction = "down";
|
|
29
|
+
} else {
|
|
30
|
+
direction = "up";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
dispatch("swipe-" + direction, {
|
|
34
|
+
direction,
|
|
35
|
+
timeDifference,
|
|
36
|
+
xDifference,
|
|
37
|
+
yDifference
|
|
38
|
+
});
|
|
39
|
+
dispatch("swipe", {
|
|
40
|
+
direction,
|
|
41
|
+
timeDifference,
|
|
42
|
+
xDifference,
|
|
43
|
+
yDifference
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function handleTouchMove(event) {
|
|
48
|
+
let currentTouch = event.changedTouches[0];
|
|
49
|
+
lastTouch = currentTouch;
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<svelte:window
|
|
54
|
+
on:touchstart={handleTouchStart}
|
|
55
|
+
on:touchend={handleTouchEnd}
|
|
56
|
+
on:touchmove={handleTouchMove}
|
|
57
|
+
/>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
timeThreshold?: number;
|
|
5
|
-
diagonalThreshold?: number;
|
|
4
|
+
timeThreshold?: number | undefined;
|
|
5
|
+
diagonalThreshold?: number | undefined;
|
|
6
6
|
};
|
|
7
7
|
events: {
|
|
8
8
|
swipe: CustomEvent<any>;
|
|
@@ -11,9 +11,9 @@ declare const __propDef: {
|
|
|
11
11
|
};
|
|
12
12
|
slots: {};
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type GestureProps = typeof __propDef.props;
|
|
15
|
+
export type GestureEvents = typeof __propDef.events;
|
|
16
|
+
export type GestureSlots = typeof __propDef.slots;
|
|
17
17
|
export default class Gesture extends SvelteComponentTyped<GestureProps, GestureEvents, GestureSlots> {
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script>import { onMount } from "svelte";
|
|
2
|
+
export let once = false;
|
|
3
|
+
export let top = 0;
|
|
4
|
+
export let bottom = 0;
|
|
5
|
+
export let left = 0;
|
|
6
|
+
export let right = 0;
|
|
7
|
+
let intersecting = false;
|
|
8
|
+
let container;
|
|
9
|
+
onMount(() => {
|
|
10
|
+
if (typeof IntersectionObserver !== "undefined") {
|
|
11
|
+
const rootMargin = `${bottom}px ${left}px ${top}px ${right}px`;
|
|
12
|
+
const observer = new IntersectionObserver(
|
|
13
|
+
(entries) => {
|
|
14
|
+
intersecting = entries[0].isIntersecting;
|
|
15
|
+
if (intersecting && once) {
|
|
16
|
+
observer.unobserve(container);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
rootMargin
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
observer.observe(container);
|
|
24
|
+
return () => observer.unobserve(container);
|
|
25
|
+
}
|
|
26
|
+
function handler() {
|
|
27
|
+
const bcr = container.getBoundingClientRect();
|
|
28
|
+
intersecting = bcr.bottom + bottom > 0 && bcr.right + right > 0 && bcr.top - top < window.innerHeight && bcr.left - left < window.innerWidth;
|
|
29
|
+
if (intersecting && once) {
|
|
30
|
+
window.removeEventListener("scroll", handler);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
window.addEventListener("scroll", handler);
|
|
34
|
+
return () => window.removeEventListener("scroll", handler);
|
|
35
|
+
});
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<div bind:this={container}>
|
|
39
|
+
<slot {intersecting} />
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<style>
|
|
43
|
+
div {
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
once?: boolean | undefined;
|
|
5
|
+
top?: number | undefined;
|
|
6
|
+
bottom?: number | undefined;
|
|
7
|
+
left?: number | undefined;
|
|
8
|
+
right?: number | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {
|
|
14
|
+
default: {
|
|
15
|
+
intersecting: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type IntersectionObserverProps = typeof __propDef.props;
|
|
20
|
+
export type IntersectionObserverEvents = typeof __propDef.events;
|
|
21
|
+
export type IntersectionObserverSlots = typeof __propDef.slots;
|
|
22
|
+
export default class IntersectionObserver extends SvelteComponentTyped<IntersectionObserverProps, IntersectionObserverEvents, IntersectionObserverSlots> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script>import mediaQuery from "../stores/mediaQuery";
|
|
2
|
+
$:
|
|
3
|
+
xsAndDown = $mediaQuery.xs;
|
|
4
|
+
$:
|
|
5
|
+
sAndDown = $mediaQuery.s || $mediaQuery.xs;
|
|
6
|
+
$:
|
|
7
|
+
mAndDown = $mediaQuery.s || $mediaQuery.xs || $mediaQuery.m;
|
|
8
|
+
$:
|
|
9
|
+
lAndDown = $mediaQuery.s || $mediaQuery.xs || $mediaQuery.m || $mediaQuery.l;
|
|
10
|
+
$:
|
|
11
|
+
xlAndDown = $mediaQuery.s || $mediaQuery.xs || $mediaQuery.m || $mediaQuery.l || $mediaQuery.xl;
|
|
12
|
+
$:
|
|
13
|
+
xlAndUp = $mediaQuery.xl;
|
|
14
|
+
$:
|
|
15
|
+
lAndUp = $mediaQuery.xl || $mediaQuery.l;
|
|
16
|
+
$:
|
|
17
|
+
mAndUp = $mediaQuery.xl || $mediaQuery.l || $mediaQuery.m;
|
|
18
|
+
$:
|
|
19
|
+
sAndUp = $mediaQuery.xl || $mediaQuery.l || $mediaQuery.m || $mediaQuery.s || $mediaQuery.xs;
|
|
20
|
+
$:
|
|
21
|
+
xsAndUp = $mediaQuery.xl || $mediaQuery.l || $mediaQuery.m || $mediaQuery.s || $mediaQuery.xs;
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<slot
|
|
25
|
+
xs={$mediaQuery.xs}
|
|
26
|
+
s={$mediaQuery.s}
|
|
27
|
+
m={$mediaQuery.m}
|
|
28
|
+
l={$mediaQuery.l}
|
|
29
|
+
xl={$mediaQuery.xl}
|
|
30
|
+
{xsAndDown}
|
|
31
|
+
{sAndDown}
|
|
32
|
+
{mAndDown}
|
|
33
|
+
{lAndDown}
|
|
34
|
+
{xlAndDown}
|
|
35
|
+
{xlAndUp}
|
|
36
|
+
{lAndUp}
|
|
37
|
+
{mAndUp}
|
|
38
|
+
{sAndUp}
|
|
39
|
+
{xsAndUp}
|
|
40
|
+
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
|
-
props:
|
|
3
|
+
props: Record<string, never>;
|
|
4
4
|
events: {
|
|
5
5
|
[evt: string]: CustomEvent<any>;
|
|
6
6
|
};
|
|
@@ -24,9 +24,9 @@ declare const __propDef: {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
27
|
+
export type MediaQueryProps = typeof __propDef.props;
|
|
28
|
+
export type MediaQueryEvents = typeof __propDef.events;
|
|
29
|
+
export type MediaQuerySlots = typeof __propDef.slots;
|
|
30
30
|
export default class MediaQuery extends SvelteComponentTyped<MediaQueryProps, MediaQueryEvents, MediaQuerySlots> {
|
|
31
31
|
}
|
|
32
32
|
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script>import { v4 as uuidv4 } from "uuid";
|
|
2
|
+
import {
|
|
3
|
+
fly
|
|
4
|
+
} from "svelte/transition";
|
|
5
|
+
export let open = false, top = void 0, left = void 0, width, height, maxHeight = void 0, overflow = "auto", refreshPosition = false, boxShadow = void 0, borderRadius = void 0, activator = void 0, anchor = "bottom", closeOnClickOutside = false, inAnimation = fly, inAnimationConfig = {
|
|
6
|
+
duration: 100,
|
|
7
|
+
y: 10
|
|
8
|
+
}, outAnimation = fly, outAnimationConfig = {
|
|
9
|
+
duration: 100,
|
|
10
|
+
y: 10
|
|
11
|
+
}, menuElement = void 0;
|
|
12
|
+
let zIndex = 50, currentUid = uuidv4();
|
|
13
|
+
function calculateMenuPosition(params) {
|
|
14
|
+
if (params.menuElement) {
|
|
15
|
+
if (params.activator) {
|
|
16
|
+
if (anchor == "bottom") {
|
|
17
|
+
let { left: activatorLeft, top: activatorTop } = params.activator.getBoundingClientRect();
|
|
18
|
+
let activatorHeight = params.activator.offsetHeight;
|
|
19
|
+
top = activatorTop + window.scrollY + activatorHeight;
|
|
20
|
+
left = activatorLeft + window.scrollX;
|
|
21
|
+
} else if (anchor == "bottom-center") {
|
|
22
|
+
let { left: activatorLeft, top: activatorTop } = params.activator.getBoundingClientRect();
|
|
23
|
+
let activatorHeight = params.activator.offsetHeight;
|
|
24
|
+
let activatorWidth = params.activator.offsetWidth;
|
|
25
|
+
let menuWidth = params.menuElement.offsetWidth;
|
|
26
|
+
top = activatorTop + window.scrollY + activatorHeight;
|
|
27
|
+
left = activatorLeft + window.scrollX;
|
|
28
|
+
if (menuWidth > activatorWidth) {
|
|
29
|
+
left = left - (menuWidth - activatorWidth) / 2;
|
|
30
|
+
} else {
|
|
31
|
+
left = left - (activatorWidth - menuWidth) / 2;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (window.innerWidth + window.scrollX < (left || 0) + (menuElement?.offsetWidth || 0)) {
|
|
36
|
+
left = Math.max(
|
|
37
|
+
window.innerWidth + window.scrollX - (menuElement?.offsetWidth || 0),
|
|
38
|
+
0
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
$:
|
|
44
|
+
if (open) {
|
|
45
|
+
let otherMenus = document.querySelectorAll("[data-menu=true]");
|
|
46
|
+
let otherDialogs = document.querySelectorAll("[data-dialog=true]");
|
|
47
|
+
let maxZIndex = void 0;
|
|
48
|
+
if (otherDialogs.length > 0) {
|
|
49
|
+
otherDialogs.forEach((dialog) => {
|
|
50
|
+
if (!maxZIndex || maxZIndex < Number(dialog.style.zIndex))
|
|
51
|
+
maxZIndex = Number(dialog.style.zIndex);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (otherMenus.length > 0) {
|
|
55
|
+
let maxZIndex2;
|
|
56
|
+
otherMenus.forEach((menu) => {
|
|
57
|
+
if (!maxZIndex2 || maxZIndex2 < Number(menu.style.zIndex))
|
|
58
|
+
maxZIndex2 = Number(menu.style.zIndex);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (!!activator && !!menuElement)
|
|
62
|
+
calculateMenuPosition({ activator, menuElement });
|
|
63
|
+
if (maxZIndex)
|
|
64
|
+
zIndex = maxZIndex + 2;
|
|
65
|
+
}
|
|
66
|
+
$:
|
|
67
|
+
if (!!width && !!activator && !!menuElement) {
|
|
68
|
+
calculateMenuPosition({ activator, menuElement });
|
|
69
|
+
}
|
|
70
|
+
$:
|
|
71
|
+
if (refreshPosition && !!activator && !!menuElement) {
|
|
72
|
+
calculateMenuPosition({ activator, menuElement });
|
|
73
|
+
refreshPosition = false;
|
|
74
|
+
}
|
|
75
|
+
$:
|
|
76
|
+
if (closeOnClickOutside && !!menuElement) {
|
|
77
|
+
window.addEventListener("click", () => {
|
|
78
|
+
open = false;
|
|
79
|
+
});
|
|
80
|
+
window.addEventListener("touchstart", () => {
|
|
81
|
+
open = false;
|
|
82
|
+
});
|
|
83
|
+
if (activator) {
|
|
84
|
+
activator.addEventListener("click", (event) => {
|
|
85
|
+
event.stopPropagation();
|
|
86
|
+
});
|
|
87
|
+
activator.addEventListener("touchstart", (event) => {
|
|
88
|
+
event.stopPropagation();
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
menuElement.addEventListener("click", (event) => {
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
});
|
|
94
|
+
menuElement.addEventListener("touchstart", (event) => {
|
|
95
|
+
event.stopPropagation();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
{#if open}
|
|
101
|
+
<div
|
|
102
|
+
bind:this={menuElement}
|
|
103
|
+
data-menu
|
|
104
|
+
data-uid={currentUid}
|
|
105
|
+
style:z-index={zIndex}
|
|
106
|
+
style:position="absolute"
|
|
107
|
+
style:top={top + "px"}
|
|
108
|
+
style:box-shadow={boxShadow}
|
|
109
|
+
style:border-radius={borderRadius}
|
|
110
|
+
style:left={left + "px"}
|
|
111
|
+
style:height
|
|
112
|
+
style:max-height={maxHeight}
|
|
113
|
+
style:width
|
|
114
|
+
style:overflow
|
|
115
|
+
in:inAnimation={inAnimationConfig}
|
|
116
|
+
out:outAnimation={outAnimationConfig}
|
|
117
|
+
>
|
|
118
|
+
<slot />
|
|
119
|
+
</div>
|
|
120
|
+
{/if}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { type FadeParams, type FlyParams, type SlideParams, type TransitionConfig } from "svelte/transition";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
open?: boolean | undefined;
|
|
6
|
+
top?: number | undefined;
|
|
7
|
+
left?: number | undefined;
|
|
8
|
+
width: string;
|
|
9
|
+
height: string;
|
|
10
|
+
maxHeight?: string | undefined;
|
|
11
|
+
overflow?: string | undefined;
|
|
12
|
+
refreshPosition?: boolean | undefined;
|
|
13
|
+
boxShadow?: string | undefined;
|
|
14
|
+
borderRadius?: string | undefined;
|
|
15
|
+
activator?: HTMLElement | undefined;
|
|
16
|
+
anchor?: "bottom" | "bottom-center" | undefined;
|
|
17
|
+
closeOnClickOutside?: boolean | undefined;
|
|
18
|
+
inAnimation?: ((node: Element, params?: SlideParams | FlyParams | FadeParams) => TransitionConfig) | undefined;
|
|
19
|
+
inAnimationConfig?: SlideParams | FlyParams | FadeParams | undefined;
|
|
20
|
+
outAnimation?: ((node: Element, params?: SlideParams | FlyParams | FadeParams) => TransitionConfig) | undefined;
|
|
21
|
+
outAnimationConfig?: SlideParams | FlyParams | FadeParams | undefined;
|
|
22
|
+
menuElement?: HTMLElement | undefined;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
};
|
|
27
|
+
slots: {
|
|
28
|
+
default: {};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type MenuProps = typeof __propDef.props;
|
|
32
|
+
export type MenuEvents = typeof __propDef.events;
|
|
33
|
+
export type MenuSlots = typeof __propDef.slots;
|
|
34
|
+
export default class Menu extends SvelteComponentTyped<MenuProps, MenuEvents, MenuSlots> {
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import { dateToString } from "../dates/utils";
|
|
4
|
-
export let headers =
|
|
4
|
+
export let headers = [], items = [], backgroundColor = "rgba(255,255,255,0)", headerColor = "rgba(0,0,0,0.05)", rowSeparatorColor = headerColor, headerHeight = "30px", headerBorderRadius = "5px", rowHeight = "70px", minWidth = void 0, height = "100%", width = "100%";
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
{#if !!items && Array.isArray(items)}
|
|
@@ -11,8 +11,8 @@ 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
|
|
15
|
-
style:background-color={headerColor}
|
|
14
|
+
<thead
|
|
15
|
+
style:background-color={headerColor}
|
|
16
16
|
style:height={headerHeight}
|
|
17
17
|
style:border-radius={headerBorderRadius}
|
|
18
18
|
>
|