@likable-hair/svelte 3.0.17 → 3.0.19
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/dist/components/composed/search/GlobalSearchTextField.css +3 -3
- package/dist/components/composed/search/GlobalSearchTextField.svelte +1 -1
- package/dist/components/layouts/StableDividedSideBarLayout.css +2 -2
- package/dist/components/layouts/UnstableDividedSideBarLayout.css +3 -3
- package/dist/components/layouts/UnstableDividedSideBarLayout.svelte +77 -12
- package/dist/components/layouts/UnstableDividedSideBarLayout.svelte.d.ts +16 -1
- package/dist/components/simple/buttons/Button.css +2 -0
- package/dist/components/simple/buttons/Button.svelte +16 -3
- package/dist/components/simple/charts/GanymedeLineChart.svelte +85 -0
- package/dist/components/simple/charts/GanymedeLineChart.svelte.d.ts +32 -0
- package/dist/components/simple/forms/SimpleTextField.svelte +1 -1
- package/dist/components/simple/lists/ColorInvertedSelector.css +6 -1
- package/dist/components/simple/lists/ColorInvertedSelector.svelte +105 -26
- package/dist/components/simple/lists/ColorInvertedSelector.svelte.d.ts +8 -2
- package/dist/components/simple/lists/SimpleTable.svelte +7 -5
- package/dist/components/simple/lists/SimpleTable.svelte.d.ts +6 -0
- package/package.json +3 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--global-search-text-field-default-ring-color: rgb(var(--global-color-contrast-
|
|
3
|
-
--global-search-text-field-default-hover-ring-color: rgb(var(--global-color-contrast-300));
|
|
4
|
-
--global-search-text-field-default-color: rgb(var(--global-color-contrast-600));
|
|
2
|
+
--global-search-text-field-default-ring-color: rgb(var(--global-color-contrast-200), .5);
|
|
3
|
+
--global-search-text-field-default-hover-ring-color: rgb(var(--global-color-contrast-300));
|
|
4
|
+
--global-search-text-field-default-color: rgb(var(--global-color-contrast-600));
|
|
5
5
|
--global-search-text-field-default-width: 100%;
|
|
6
6
|
--global-search-text-field-default-max-width: 28rem;
|
|
7
7
|
--global-search-text-field-default-height: 2rem;
|
|
@@ -168,7 +168,7 @@ async function search() {
|
|
|
168
168
|
--global-search-text-field-padding,
|
|
169
169
|
var(--global-search-text-field-default-padding)
|
|
170
170
|
);
|
|
171
|
-
border: 0 solid
|
|
171
|
+
border: 0 solid white;
|
|
172
172
|
cursor: pointer;
|
|
173
173
|
transition-property: box-shadow;
|
|
174
174
|
transition-timing-function: cubic-bezier(0.075, 0.82, 0.165, 1);
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
--stable-divided-side-bar-layout-default-content-padding: 1rem 2rem 1rem 2rem;
|
|
3
3
|
--stable-divided-side-bar-layout-default-side-bar-width: 18rem;
|
|
4
4
|
--stable-divided-side-bar-layout-default-side-bar-border-color:
|
|
5
|
-
rgb(var(--global-color-grey-500));
|
|
5
|
+
rgb(var(--global-color-grey-500), .3);
|
|
6
6
|
--stable-divided-side-bar-layout-default-side-bar-padding: 1rem 1.5rem 2rem 1.5rem;
|
|
7
7
|
--stable-divided-side-bar-layout-default-header-menu-height: 3.5rem;
|
|
8
8
|
--stable-divided-side-bar-layout-default-header-menu-border-color:
|
|
9
|
-
rgb(var(--global-color-grey-500));
|
|
9
|
+
rgb(var(--global-color-grey-500), .3);
|
|
10
10
|
--stable-divided-side-bar-layout-default-header-menu-padding: 0rem 2rem 0rem 2rem;
|
|
11
11
|
--stable-divided-side-bar-layout-default-inner-header-menu-background-color:
|
|
12
12
|
rgb(var(--global-color-background-100), .5);
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
--unstable-divided-side-bar-layout-default-content-padding: 1rem 2rem 1rem 2rem;
|
|
3
3
|
--unstable-divided-side-bar-layout-default-side-bar-width: 4rem;
|
|
4
4
|
--unstable-divided-side-bar-layout-default-side-bar-hover-width: 18rem;
|
|
5
|
-
--unstable-divided-side-bar-layout-default-side-bar-border
|
|
5
|
+
--unstable-divided-side-bar-layout-default-side-bar-border: none;
|
|
6
6
|
--unstable-divided-side-bar-layout-default-side-bar-padding: 0rem;
|
|
7
7
|
--unstable-divided-side-bar-layout-default-header-menu-height: 3.5rem;
|
|
8
|
-
--unstable-divided-side-bar-layout-default-header-menu-border
|
|
8
|
+
--unstable-divided-side-bar-layout-default-header-menu-border: none;
|
|
9
9
|
--unstable-divided-side-bar-layout-default-header-menu-padding: 0rem 2rem 0rem 2rem;
|
|
10
10
|
--unstable-divided-side-bar-layout-default-inner-header-menu-background-color: rgb(var(--global-color-background-100), .5);
|
|
11
|
-
--unstable-divided-side-bar-layout-default-drawer-background-color: rgb(var(--global-color-background-
|
|
11
|
+
--unstable-divided-side-bar-layout-default-drawer-background-color: rgb(var(--global-color-background-100));
|
|
12
12
|
--unstable-divided-side-bar-layout-default-drawer-width: 24rem;
|
|
13
13
|
}
|
|
@@ -4,9 +4,10 @@ import MediaQuery from "../simple/common/MediaQuery.svelte";
|
|
|
4
4
|
import Icon from "../simple/media/Icon.svelte";
|
|
5
5
|
import { createEventDispatcher } from "svelte";
|
|
6
6
|
import { clickOutside } from "../../utils/clickOutside";
|
|
7
|
+
import ColorInvertedSelector, {} from "../simple/lists/ColorInvertedSelector.svelte";
|
|
7
8
|
let clazz = {};
|
|
8
9
|
export { clazz as class };
|
|
9
|
-
export let drawerOpened = false, expandOn = "hover";
|
|
10
|
+
export let drawerOpened = false, expandOn = "hover", options = [], selectedIndex = void 0;
|
|
10
11
|
let dispatch = createEventDispatcher();
|
|
11
12
|
function toggleMenu() {
|
|
12
13
|
drawerOpened = !drawerOpened;
|
|
@@ -46,7 +47,7 @@ let sidebarExpanded = false;
|
|
|
46
47
|
</slot>
|
|
47
48
|
</nav>
|
|
48
49
|
<header
|
|
49
|
-
class:opened={drawerOpened || sidebarExpanded}
|
|
50
|
+
class:opened={(mAndDown && drawerOpened) || sidebarExpanded}
|
|
50
51
|
on:mouseleave={() => {if(expandOn == 'hover') sidebarExpanded = false}}
|
|
51
52
|
on:mouseenter={() => {if(expandOn == 'hover') sidebarExpanded = true}}
|
|
52
53
|
on:click={() => {if(expandOn == 'click') sidebarExpanded = true}}
|
|
@@ -56,8 +57,36 @@ let sidebarExpanded = false;
|
|
|
56
57
|
class="side-bar {clazz.header}"
|
|
57
58
|
>
|
|
58
59
|
<div class="side-bar-content">
|
|
59
|
-
<slot name="sidebar" hamburgerVisible={mAndDown}>
|
|
60
|
-
|
|
60
|
+
<slot name="sidebar" hamburgerVisible={mAndDown} {sidebarExpanded}>
|
|
61
|
+
<div class="sidebar-container">
|
|
62
|
+
<div class="logo-and-menu">
|
|
63
|
+
<slot name="logo" hamburgerVisible={mAndDown} {sidebarExpanded}>
|
|
64
|
+
<div class="logo">logo</div>
|
|
65
|
+
</slot>
|
|
66
|
+
<slot name="menu" hamburgerVisible={mAndDown} {sidebarExpanded}>
|
|
67
|
+
<div
|
|
68
|
+
class="menu-container"
|
|
69
|
+
class:expanded={sidebarExpanded}
|
|
70
|
+
>
|
|
71
|
+
<ColorInvertedSelector
|
|
72
|
+
options={options}
|
|
73
|
+
selectedIndex={selectedIndex}
|
|
74
|
+
--color-inverted-selector-default-background-color="transparent"
|
|
75
|
+
--color-inverted-selector-default-font-size="1.2rem"
|
|
76
|
+
--color-inverted-selector-default-icon-gap="1.2rem"
|
|
77
|
+
--color-inverted-selector-default-element-height="3rem"
|
|
78
|
+
--color-inverted-selector-default-element-padding="8px 8px 8px 11px"
|
|
79
|
+
--color-inverted-selector-default-element-border-radius="16px"
|
|
80
|
+
--color-inverted-selector-default-selected-font-weight="400"
|
|
81
|
+
--icon-default-size="1.3rem"
|
|
82
|
+
deletable={false}
|
|
83
|
+
></ColorInvertedSelector>
|
|
84
|
+
</div>
|
|
85
|
+
</slot>
|
|
86
|
+
</div>
|
|
87
|
+
<slot name="user" hamburgerVisible={mAndDown} {sidebarExpanded}>
|
|
88
|
+
</slot>
|
|
89
|
+
</div>
|
|
61
90
|
</slot>
|
|
62
91
|
</div>
|
|
63
92
|
</header>
|
|
@@ -89,9 +118,9 @@ let sidebarExpanded = false;
|
|
|
89
118
|
--unstable-divided-side-bar-layout-side-bar-width,
|
|
90
119
|
var(--unstable-divided-side-bar-layout-default-side-bar-width)
|
|
91
120
|
);
|
|
92
|
-
border-right:
|
|
93
|
-
--unstable-divided-side-bar-layout-side-bar-border
|
|
94
|
-
var(--unstable-divided-side-bar-layout-default-side-bar-border
|
|
121
|
+
border-right: var(
|
|
122
|
+
--unstable-divided-side-bar-layout-side-bar-border,
|
|
123
|
+
var(--unstable-divided-side-bar-layout-default-side-bar-border)
|
|
95
124
|
);
|
|
96
125
|
top: 0;
|
|
97
126
|
bottom: 0;
|
|
@@ -167,14 +196,14 @@ let sidebarExpanded = false;
|
|
|
167
196
|
bottom: 0;
|
|
168
197
|
right: 0;
|
|
169
198
|
z-index: -100;
|
|
170
|
-
transition-property:
|
|
199
|
+
transition-property: all;
|
|
171
200
|
transition-timing-function: cubic-bezier(.4,0,.2,1);
|
|
172
201
|
transition-duration: .15s;
|
|
173
202
|
display: block;
|
|
174
203
|
}
|
|
175
204
|
|
|
176
205
|
.overlay.visible {
|
|
177
|
-
background-color:
|
|
206
|
+
background-color: rgb(var(--global-color-grey-900), .5);
|
|
178
207
|
backdrop-filter: blur(4px);
|
|
179
208
|
z-index: 20;
|
|
180
209
|
}
|
|
@@ -190,9 +219,9 @@ let sidebarExpanded = false;
|
|
|
190
219
|
--unstable-divided-side-bar-layout-side-bar-width,
|
|
191
220
|
var(--unstable-divided-side-bar-layout-default-side-bar-width)
|
|
192
221
|
);
|
|
193
|
-
border-bottom:
|
|
194
|
-
--unstable-divided-side-bar-layout-header-menu-border
|
|
195
|
-
var(--unstable-divided-side-bar-layout-default-header-menu-border
|
|
222
|
+
border-bottom: var(
|
|
223
|
+
--unstable-divided-side-bar-layout-header-menu-border,
|
|
224
|
+
var(--unstable-divided-side-bar-layout-default-header-menu-border)
|
|
196
225
|
);
|
|
197
226
|
backdrop-filter: blur(4px);
|
|
198
227
|
background-color: var(
|
|
@@ -242,6 +271,10 @@ let sidebarExpanded = false;
|
|
|
242
271
|
transition: all .2s cubic-bezier(.4,0,.2,1);
|
|
243
272
|
}
|
|
244
273
|
|
|
274
|
+
.menu-container {
|
|
275
|
+
transition: padding .2s cubic-bezier(0.075, 0.82, 0.165, 1);
|
|
276
|
+
}
|
|
277
|
+
|
|
245
278
|
@media (max-width: 1024px) {
|
|
246
279
|
.main-section {
|
|
247
280
|
padding-left: 0;
|
|
@@ -250,6 +283,14 @@ let sidebarExpanded = false;
|
|
|
250
283
|
.blurred {
|
|
251
284
|
backdrop-filter: blur(4px);
|
|
252
285
|
}
|
|
286
|
+
|
|
287
|
+
.sidebar-container {
|
|
288
|
+
height: calc(100dvh - 3.5rem);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.logo {
|
|
292
|
+
display: none;
|
|
293
|
+
}
|
|
253
294
|
}
|
|
254
295
|
|
|
255
296
|
@media (min-width: 1024.1px) {
|
|
@@ -259,6 +300,14 @@ let sidebarExpanded = false;
|
|
|
259
300
|
var(--unstable-divided-side-bar-layout-default-side-bar-hover-width)
|
|
260
301
|
);
|
|
261
302
|
}
|
|
303
|
+
|
|
304
|
+
.menu-container.expanded {
|
|
305
|
+
padding: 1rem;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.sidebar-container {
|
|
309
|
+
height: 100dvh;
|
|
310
|
+
}
|
|
262
311
|
}
|
|
263
312
|
|
|
264
313
|
.inner-menu {
|
|
@@ -281,4 +330,20 @@ let sidebarExpanded = false;
|
|
|
281
330
|
border: 0 solid #e5e7eb;
|
|
282
331
|
}
|
|
283
332
|
|
|
333
|
+
.sidebar-container {
|
|
334
|
+
display: flex;
|
|
335
|
+
flex-direction: column;
|
|
336
|
+
gap: 10px;
|
|
337
|
+
justify-content: space-between;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.logo-and-menu {
|
|
341
|
+
display: flex;
|
|
342
|
+
flex-direction: column;
|
|
343
|
+
gap: 10px;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.logo {
|
|
347
|
+
height: 3.5rem;
|
|
348
|
+
}
|
|
284
349
|
</style>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import '../../css/main.css';
|
|
3
3
|
import './UnstableDividedSideBarLayout.css';
|
|
4
|
+
import { type Option } from '../simple/lists/ColorInvertedSelector.svelte';
|
|
4
5
|
declare const __propDef: {
|
|
5
6
|
props: {
|
|
6
7
|
class?: {
|
|
@@ -11,6 +12,8 @@ declare const __propDef: {
|
|
|
11
12
|
} | undefined;
|
|
12
13
|
drawerOpened?: boolean | undefined;
|
|
13
14
|
expandOn?: "click" | "none" | "hover" | undefined;
|
|
15
|
+
options?: Option[] | undefined;
|
|
16
|
+
selectedIndex?: number | undefined;
|
|
14
17
|
};
|
|
15
18
|
events: {
|
|
16
19
|
'drawer-change': CustomEvent<{
|
|
@@ -20,12 +23,24 @@ declare const __propDef: {
|
|
|
20
23
|
[evt: string]: CustomEvent<any>;
|
|
21
24
|
};
|
|
22
25
|
slots: {
|
|
23
|
-
menu: {
|
|
26
|
+
menu: {
|
|
27
|
+
hamburgerVisible: boolean;
|
|
28
|
+
sidebarExpanded: boolean;
|
|
29
|
+
};
|
|
24
30
|
'inner-menu': {
|
|
25
31
|
hamburgerVisible: boolean;
|
|
26
32
|
};
|
|
27
33
|
sidebar: {
|
|
28
34
|
hamburgerVisible: boolean;
|
|
35
|
+
sidebarExpanded: boolean;
|
|
36
|
+
};
|
|
37
|
+
logo: {
|
|
38
|
+
hamburgerVisible: boolean;
|
|
39
|
+
sidebarExpanded: boolean;
|
|
40
|
+
};
|
|
41
|
+
user: {
|
|
42
|
+
hamburgerVisible: boolean;
|
|
43
|
+
sidebarExpanded: boolean;
|
|
29
44
|
};
|
|
30
45
|
default: {};
|
|
31
46
|
};
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
--button-default-text-hover-background-color: rgb(var(--global-color-primary-500), 0.2);
|
|
15
15
|
--button-default-active-background-color: rgb(var(--global-color-primary-500));
|
|
16
16
|
--button-default-focus-background-color: rgb(var(--global-color-primary-500));
|
|
17
|
+
--button-default-disabled-background-color: rgb(var(--global-color-primary-500), .6);
|
|
18
|
+
--button-default-disabled-color: rgb(var(--global-color-grey-50), .6);
|
|
17
19
|
--button-default-text-active-background-color: rgb(var(--global-color-primary-500), 0.4);
|
|
18
20
|
--button-default-box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.3);
|
|
19
21
|
--button-default-text-font-weight: 600;
|
|
@@ -38,6 +38,7 @@ import CircularLoader from "../loaders/CircularLoader.svelte";
|
|
|
38
38
|
class:button-default={buttonType === "default"}
|
|
39
39
|
class:button-text={buttonType === "text"}
|
|
40
40
|
class:button-icon={buttonType === "icon"}
|
|
41
|
+
class:disabled={disabled}
|
|
41
42
|
on:click={handleClick}
|
|
42
43
|
on:keypress={handleKeyPress}
|
|
43
44
|
on:keydown={handleKeyDown}
|
|
@@ -163,7 +164,19 @@ import CircularLoader from "../loaders/CircularLoader.svelte";
|
|
|
163
164
|
);
|
|
164
165
|
}
|
|
165
166
|
|
|
166
|
-
.button-default
|
|
167
|
+
.button-default.disabled {
|
|
168
|
+
cursor: not-allowed;
|
|
169
|
+
background-color: var(
|
|
170
|
+
--button-disabled-background-color,
|
|
171
|
+
var(--button-default-disabled-background-color)
|
|
172
|
+
);
|
|
173
|
+
color: var(
|
|
174
|
+
--button-disabled-color,
|
|
175
|
+
var(--button-default-disabled-color)
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.button-default:hover:not(.disabled) {
|
|
167
180
|
background-color: var(
|
|
168
181
|
--button-hover-background-color,
|
|
169
182
|
var(--button-default-hover-background-color)
|
|
@@ -174,14 +187,14 @@ import CircularLoader from "../loaders/CircularLoader.svelte";
|
|
|
174
187
|
);
|
|
175
188
|
}
|
|
176
189
|
|
|
177
|
-
.button-default:active {
|
|
190
|
+
.button-default:active:not(.disabled) {
|
|
178
191
|
background-color: var(
|
|
179
192
|
--button-active-background-color,
|
|
180
193
|
var(--button-default-active-background-color)
|
|
181
194
|
);
|
|
182
195
|
}
|
|
183
196
|
|
|
184
|
-
.button-default:focus {
|
|
197
|
+
.button-default:focus:not(.disabled) {
|
|
185
198
|
background-color: var(
|
|
186
199
|
--button-focus-background-color,
|
|
187
200
|
var(--button-default-focus-background-color)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script>import { Line } from "svelte-chartjs";
|
|
2
|
+
let background = void 0;
|
|
3
|
+
onMount(() => {
|
|
4
|
+
let style = getComputedStyle(document.body);
|
|
5
|
+
background = style.getPropertyValue("--global-color-background-200");
|
|
6
|
+
});
|
|
7
|
+
import {
|
|
8
|
+
Chart as ChartJS,
|
|
9
|
+
Title,
|
|
10
|
+
Tooltip,
|
|
11
|
+
Legend,
|
|
12
|
+
LineElement,
|
|
13
|
+
LinearScale,
|
|
14
|
+
PointElement,
|
|
15
|
+
CategoryScale
|
|
16
|
+
} from "chart.js";
|
|
17
|
+
import { onMount } from "svelte";
|
|
18
|
+
ChartJS.register(
|
|
19
|
+
Title,
|
|
20
|
+
Tooltip,
|
|
21
|
+
Legend,
|
|
22
|
+
LineElement,
|
|
23
|
+
LinearScale,
|
|
24
|
+
PointElement,
|
|
25
|
+
CategoryScale
|
|
26
|
+
);
|
|
27
|
+
export let data = {
|
|
28
|
+
labels: [],
|
|
29
|
+
datasets: []
|
|
30
|
+
}, horizontal = false, responsive = true, maintainAspectRatio = true, showLegend = true, showYTicks = false, showXTicks = false;
|
|
31
|
+
$:
|
|
32
|
+
gridColor = "rgb(" + (background || "200, 200, 200") + ", .3)";
|
|
33
|
+
$:
|
|
34
|
+
console.log(gridColor);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<Line
|
|
38
|
+
bind:data={data}
|
|
39
|
+
options={{
|
|
40
|
+
indexAxis: horizontal ? 'y' : 'x',
|
|
41
|
+
responsive: responsive,
|
|
42
|
+
maintainAspectRatio: maintainAspectRatio,
|
|
43
|
+
plugins: {
|
|
44
|
+
legend: {
|
|
45
|
+
display: showLegend
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
interaction: {
|
|
49
|
+
intersect: false,
|
|
50
|
+
},
|
|
51
|
+
scales: {
|
|
52
|
+
x: {
|
|
53
|
+
display: true,
|
|
54
|
+
title: {
|
|
55
|
+
display: true
|
|
56
|
+
},
|
|
57
|
+
grid: {
|
|
58
|
+
display: false
|
|
59
|
+
},
|
|
60
|
+
border: {
|
|
61
|
+
display: false
|
|
62
|
+
},
|
|
63
|
+
ticks: {
|
|
64
|
+
display: showYTicks
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
y: {
|
|
68
|
+
display: true,
|
|
69
|
+
title: {
|
|
70
|
+
},
|
|
71
|
+
grid: {
|
|
72
|
+
lineWidth: 1,
|
|
73
|
+
color: gridColor
|
|
74
|
+
},
|
|
75
|
+
border: {
|
|
76
|
+
dash: [10,10],
|
|
77
|
+
display: false
|
|
78
|
+
},
|
|
79
|
+
ticks: {
|
|
80
|
+
display: showXTicks
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}}
|
|
85
|
+
></Line>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
data?: {
|
|
5
|
+
labels: string[];
|
|
6
|
+
datasets: {
|
|
7
|
+
label: string;
|
|
8
|
+
data: number[];
|
|
9
|
+
backgroundColor?: string | undefined;
|
|
10
|
+
borderColor?: string | undefined;
|
|
11
|
+
hoverBackgroundColor?: string[] | undefined;
|
|
12
|
+
tension?: number | undefined;
|
|
13
|
+
}[];
|
|
14
|
+
} | undefined;
|
|
15
|
+
horizontal?: boolean | undefined;
|
|
16
|
+
responsive?: boolean | undefined;
|
|
17
|
+
maintainAspectRatio?: boolean | undefined;
|
|
18
|
+
showLegend?: boolean | undefined;
|
|
19
|
+
showYTicks?: boolean | undefined;
|
|
20
|
+
showXTicks?: boolean | undefined;
|
|
21
|
+
};
|
|
22
|
+
events: {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
};
|
|
25
|
+
slots: {};
|
|
26
|
+
};
|
|
27
|
+
export type GanymedeLineChartProps = typeof __propDef.props;
|
|
28
|
+
export type GanymedeLineChartEvents = typeof __propDef.events;
|
|
29
|
+
export type GanymedeLineChartSlots = typeof __propDef.slots;
|
|
30
|
+
export default class GanymedeLineChart extends SvelteComponentTyped<GanymedeLineChartProps, GanymedeLineChartEvents, GanymedeLineChartSlots> {
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -9,7 +9,7 @@ export let value = void 0, type = "text", placeholder = void 0, disabled = false
|
|
|
9
9
|
<div
|
|
10
10
|
class="textfield-container {clazz.container || ''}"
|
|
11
11
|
>
|
|
12
|
-
<div class="row {clazz.row}">
|
|
12
|
+
<div class="row {clazz.row || ''}">
|
|
13
13
|
<slot name="prepend" {prependIcon} {iconSize}>
|
|
14
14
|
{#if !!prependIcon}
|
|
15
15
|
<Icon name={prependIcon} --icon-size={iconSize}></Icon>
|
|
@@ -2,5 +2,10 @@
|
|
|
2
2
|
--color-inverted-selector-default-background-color: rgb(var(--global-color-background-200));
|
|
3
3
|
--color-inverted-selector-default-selected-background-color: rgb(var(--global-color-primary-400));
|
|
4
4
|
--color-inverted-selector-default-selected-color: rgb(var(--global-color-grey-50));
|
|
5
|
-
--color-inverted-selector-default-vertical-gap:
|
|
5
|
+
--color-inverted-selector-default-vertical-gap: 8px;
|
|
6
|
+
--color-inverted-selector-default-icon-gap: 8px;
|
|
7
|
+
--color-inverted-selector-default-selected-font-weight: 700;
|
|
8
|
+
--color-inverted-selector-default-element-padding: 8px 8px 8px 16px;
|
|
9
|
+
--color-inverted-selector-default-element-border-radius: 5px;
|
|
10
|
+
--color-inverted-selector-default-hover-background-color: rgb(var(--global-color-primary-500), .3)
|
|
6
11
|
}
|
|
@@ -7,7 +7,7 @@ import { createEventDispatcher } from "svelte";
|
|
|
7
7
|
let clazz = {};
|
|
8
8
|
export { clazz as class };
|
|
9
9
|
let dispatch = createEventDispatcher();
|
|
10
|
-
export let options, selectedIndex;
|
|
10
|
+
export let options, selectedIndex, deletable = true;
|
|
11
11
|
function handleOptionClick(option, index) {
|
|
12
12
|
dispatch("select", {
|
|
13
13
|
option,
|
|
@@ -23,33 +23,57 @@ function handleClickClose(option, index) {
|
|
|
23
23
|
}
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
<
|
|
26
|
+
<ul
|
|
27
|
+
class="selector-container {clazz?.container || ''}"
|
|
28
|
+
role="listbox"
|
|
29
|
+
>
|
|
27
30
|
{#each options as option, index}
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
>
|
|
34
|
-
<div>
|
|
35
|
-
<slot name="option" {option}>{option.name}</slot>
|
|
36
|
-
</div>
|
|
37
|
-
<div
|
|
38
|
-
on:click|stopPropagation={() => { }}
|
|
31
|
+
<li>
|
|
32
|
+
<button
|
|
33
|
+
class:selected={selectedIndex == index}
|
|
34
|
+
class="element {clazz?.element || ''} {selectedIndex == index ? clazz.selected : ''}"
|
|
35
|
+
on:click={() => handleOptionClick(option, index)}
|
|
39
36
|
on:keydown={() => { }}
|
|
40
37
|
>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
<div class="icon-and-title">
|
|
39
|
+
{#if !!$$slots.prepend || !!option.icon}
|
|
40
|
+
<div>
|
|
41
|
+
<slot name="prepend" {option} {handleClickClose}>
|
|
42
|
+
{#if !!option.icon}
|
|
43
|
+
<Icon
|
|
44
|
+
name={option.icon}
|
|
45
|
+
></Icon>
|
|
46
|
+
{/if}
|
|
47
|
+
</slot>
|
|
48
|
+
</div>
|
|
49
|
+
{/if}
|
|
50
|
+
<slot name="option" {option}>
|
|
51
|
+
<div class="label">
|
|
52
|
+
{option.label}
|
|
53
|
+
</div>
|
|
54
|
+
</slot>
|
|
55
|
+
</div>
|
|
56
|
+
{#if !!$$slots.append || deletable}
|
|
57
|
+
<div
|
|
58
|
+
on:click|stopPropagation={() => { }}
|
|
46
59
|
on:keydown={() => { }}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
>
|
|
61
|
+
<slot name="append" {option} {handleClickClose}>
|
|
62
|
+
{#if deletable}
|
|
63
|
+
<Icon
|
|
64
|
+
name="mdi-close"
|
|
65
|
+
click
|
|
66
|
+
on:click={() => handleClickClose(option, index)}
|
|
67
|
+
on:keydown={() => { }}
|
|
68
|
+
></Icon>
|
|
69
|
+
{/if}
|
|
70
|
+
</slot>
|
|
71
|
+
</div>
|
|
72
|
+
{/if}
|
|
73
|
+
</button>
|
|
74
|
+
</li>
|
|
51
75
|
{/each}
|
|
52
|
-
</
|
|
76
|
+
</ul>
|
|
53
77
|
|
|
54
78
|
<style>
|
|
55
79
|
.selector-container {
|
|
@@ -73,16 +97,68 @@ function handleClickClose(option, index) {
|
|
|
73
97
|
--color-inverted-selector-vertical-gap,
|
|
74
98
|
var(--color-inverted-selector-default-vertical-gap)
|
|
75
99
|
);
|
|
100
|
+
list-style: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.icon-and-title {
|
|
104
|
+
display: flex;
|
|
105
|
+
gap: var(
|
|
106
|
+
--color-inverted-selector-icon-gap,
|
|
107
|
+
var(--color-inverted-selector-default-icon-gap)
|
|
108
|
+
);
|
|
109
|
+
align-items: center;
|
|
110
|
+
font-size: var(
|
|
111
|
+
--color-inverted-selector-font-size,
|
|
112
|
+
var(--color-inverted-selector-default-font-size)
|
|
113
|
+
);
|
|
114
|
+
max-width: 100%;
|
|
76
115
|
}
|
|
77
116
|
|
|
78
117
|
.element {
|
|
79
|
-
padding:
|
|
118
|
+
padding: var(
|
|
119
|
+
--color-inverted-selector-element-padding,
|
|
120
|
+
var(--color-inverted-selector-default-element-padding)
|
|
121
|
+
);
|
|
122
|
+
height: var(
|
|
123
|
+
--color-inverted-selector-element-height,
|
|
124
|
+
var(--color-inverted-selector-default-element-height)
|
|
125
|
+
);
|
|
80
126
|
cursor: pointer;
|
|
81
127
|
transition: all .1s ease-in;
|
|
82
|
-
border-radius:
|
|
128
|
+
border-radius: var(
|
|
129
|
+
--color-inverted-selector-element-border-radius,
|
|
130
|
+
var(--color-inverted-selector-default-element-border-radius)
|
|
131
|
+
);
|
|
83
132
|
display: flex;
|
|
84
133
|
align-items: center;
|
|
85
134
|
justify-content: space-between;
|
|
135
|
+
width: 100%;
|
|
136
|
+
border: none;
|
|
137
|
+
background-color: transparent;
|
|
138
|
+
font-size: inherit;
|
|
139
|
+
color: inherit;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.label {
|
|
143
|
+
white-space: nowrap;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
text-overflow: ellipsis;
|
|
146
|
+
flex: 1;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.element:not(.selected):hover {
|
|
150
|
+
color: var(
|
|
151
|
+
--color-inverted-selector-hover-color,
|
|
152
|
+
var(--color-inverted-selector-default-hover-color)
|
|
153
|
+
);
|
|
154
|
+
background-color: var(
|
|
155
|
+
--color-inverted-selector-hover-background-color,
|
|
156
|
+
var(--color-inverted-selector-default-hover-background-color)
|
|
157
|
+
);
|
|
158
|
+
font-weight: var(
|
|
159
|
+
--color-inverted-selector-hover-font-weight,
|
|
160
|
+
var(--color-inverted-selector-default-hover-font-weight)
|
|
161
|
+
);
|
|
86
162
|
}
|
|
87
163
|
|
|
88
164
|
.selected {
|
|
@@ -94,6 +170,9 @@ function handleClickClose(option, index) {
|
|
|
94
170
|
--color-inverted-selector-selected-background-color,
|
|
95
171
|
var(--color-inverted-selector-default-selected-background-color)
|
|
96
172
|
);
|
|
97
|
-
font-weight:
|
|
173
|
+
font-weight: var(
|
|
174
|
+
--color-inverted-selector-selected-font-weight,
|
|
175
|
+
var(--color-inverted-selector-default-selected-font-weight)
|
|
176
|
+
);
|
|
98
177
|
}
|
|
99
178
|
</style>
|
|
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
export type Option = {
|
|
3
3
|
label: string;
|
|
4
4
|
name: string;
|
|
5
|
+
icon?: string;
|
|
5
6
|
};
|
|
6
7
|
import '../../../css/main.css';
|
|
7
8
|
import './ColorInvertedSelector.css';
|
|
@@ -13,12 +14,13 @@ declare const __propDef: {
|
|
|
13
14
|
selected?: string | undefined;
|
|
14
15
|
} | undefined;
|
|
15
16
|
options: Option[];
|
|
16
|
-
selectedIndex: number;
|
|
17
|
+
selectedIndex: number | undefined;
|
|
18
|
+
deletable?: boolean | undefined;
|
|
17
19
|
};
|
|
18
20
|
events: {
|
|
19
21
|
select: CustomEvent<{
|
|
20
22
|
option: Option;
|
|
21
|
-
selectedIndex: number;
|
|
23
|
+
selectedIndex: number | undefined;
|
|
22
24
|
}>;
|
|
23
25
|
delete: CustomEvent<{
|
|
24
26
|
option: Option;
|
|
@@ -28,6 +30,10 @@ declare const __propDef: {
|
|
|
28
30
|
[evt: string]: CustomEvent<any>;
|
|
29
31
|
};
|
|
30
32
|
slots: {
|
|
33
|
+
prepend: {
|
|
34
|
+
option: Option;
|
|
35
|
+
handleClickClose: (option: Option, index: number) => void;
|
|
36
|
+
};
|
|
31
37
|
option: {
|
|
32
38
|
option: Option;
|
|
33
39
|
};
|
|
@@ -5,6 +5,8 @@ import "./SimpleTable.css";
|
|
|
5
5
|
import { dateToString } from "../dates/utils";
|
|
6
6
|
import Icon from "../media/Icon.svelte";
|
|
7
7
|
import { createEventDispatcher } from "svelte";
|
|
8
|
+
let clazz = {};
|
|
9
|
+
export { clazz as class };
|
|
8
10
|
const dispatch = createEventDispatcher();
|
|
9
11
|
export let headers = [], items = [], sortedBy = void 0, sortDirection = "asc";
|
|
10
12
|
function handleHeaderClick(header) {
|
|
@@ -26,9 +28,9 @@ function handleHeaderClick(header) {
|
|
|
26
28
|
</script>
|
|
27
29
|
|
|
28
30
|
{#if !!items && Array.isArray(items)}
|
|
29
|
-
<div class="simple-table-container" >
|
|
31
|
+
<div class="simple-table-container {clazz.container || ''}" >
|
|
30
32
|
<table class="table">
|
|
31
|
-
<thead class="thead">
|
|
33
|
+
<thead class="thead {clazz.header || ''}">
|
|
32
34
|
<tr>
|
|
33
35
|
{#each headers as head}
|
|
34
36
|
<th
|
|
@@ -69,9 +71,9 @@ function handleHeaderClick(header) {
|
|
|
69
71
|
</thead>
|
|
70
72
|
<tbody>
|
|
71
73
|
{#each items as item, i}
|
|
72
|
-
<tr class="item-tr">
|
|
74
|
+
<tr class="item-tr {clazz.row || ''}">
|
|
73
75
|
{#each headers as header, j}
|
|
74
|
-
<td>
|
|
76
|
+
<td class="{clazz.cell || ''}">
|
|
75
77
|
{#if header.type == "custom"}
|
|
76
78
|
<slot
|
|
77
79
|
name="custom"
|
|
@@ -88,7 +90,7 @@ function handleHeaderClick(header) {
|
|
|
88
90
|
</td>
|
|
89
91
|
{/each}
|
|
90
92
|
{#if $$slots.rowActions || $$slots.append}
|
|
91
|
-
<td>
|
|
93
|
+
<td class="{clazz.cell || ''}">
|
|
92
94
|
<slot name="rowActions" index={i} {item} />
|
|
93
95
|
<slot name="append" index={i} {item} />
|
|
94
96
|
</td>
|
|
@@ -14,6 +14,12 @@ import '../../../css/main.css';
|
|
|
14
14
|
import './SimpleTable.css';
|
|
15
15
|
declare const __propDef: {
|
|
16
16
|
props: {
|
|
17
|
+
class?: {
|
|
18
|
+
container?: string | undefined;
|
|
19
|
+
header?: string | undefined;
|
|
20
|
+
row?: string | undefined;
|
|
21
|
+
cell?: string | undefined;
|
|
22
|
+
} | undefined;
|
|
17
23
|
headers?: Header[] | undefined;
|
|
18
24
|
items?: {
|
|
19
25
|
[key: string]: any;
|
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": "3.0.
|
|
4
|
+
"version": "3.0.19",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
7
7
|
"build": "vite build && npm run package",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"highlightjs-svelte": "^1.0.6",
|
|
63
63
|
"imask": "^7.1.0-alpha.0",
|
|
64
64
|
"lodash": "^4.17.21",
|
|
65
|
-
"luxon": "^3.3.0"
|
|
65
|
+
"luxon": "^3.3.0",
|
|
66
|
+
"svelte-chartjs": "^3.1.2"
|
|
66
67
|
}
|
|
67
68
|
}
|