y200subcontrols 0.0.3331 → 0.0.3395
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/Breadcrumb.svelte +22 -0
- package/dist/components/Breadcrumb.svelte.d.ts +22 -0
- package/dist/components/ConfirmModalDialog.svelte +15 -8
- package/dist/components/ConfirmModalDialog.svelte.d.ts +3 -0
- package/dist/components/DataTable.svelte +67 -12
- package/dist/components/DataTableMenuButton.svelte +26 -4
- package/dist/components/DataTableMenuButton.svelte.d.ts +1 -0
- package/dist/components/DataTablePaginator.svelte +118 -0
- package/dist/components/DataTablePaginator.svelte.d.ts +23 -0
- package/dist/components/HyperlinkButton.svelte +25 -0
- package/dist/components/HyperlinkButton.svelte.d.ts +26 -0
- package/dist/components/LabeledDatePicker.svelte +5 -10
- package/dist/components/LabeledSelect.svelte +24 -10
- package/dist/components/LabeledSelect.svelte.d.ts +2 -0
- package/dist/components/SegmentedControl.svelte +75 -0
- package/dist/components/SegmentedControl.svelte.d.ts +26 -0
- package/dist/components/SideNav.svelte +12 -0
- package/dist/components/SideNav.svelte.d.ts +20 -0
- package/dist/components/SideNavItem.svelte +64 -0
- package/dist/components/SideNavItem.svelte.d.ts +24 -0
- package/dist/components/ToggleButton.svelte +6 -1
- package/dist/components/ToggleButton.svelte.d.ts +2 -0
- package/dist/components/types.d.ts +4 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +7 -1
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>import HyperLink from "./HyperLink.svelte";
|
|
2
|
+
export let breadcrumbs = [];
|
|
3
|
+
export let currentPage;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div
|
|
7
|
+
class="px-2 py-1.5 border border-slate-300 dark:border-slate-600 rounded bg-white dark:bg-slate-950"
|
|
8
|
+
>
|
|
9
|
+
<HyperLink href="/">
|
|
10
|
+
<i class="bi bi-house-fill" title="Home"></i>
|
|
11
|
+
</HyperLink>
|
|
12
|
+
<i class="bi bi-chevron-compact-right text-slate-300 dark:text-slate-600"></i>
|
|
13
|
+
{#each breadcrumbs as crumb (crumb.href)}
|
|
14
|
+
<HyperLink href={crumb.href}>
|
|
15
|
+
{crumb.title}
|
|
16
|
+
</HyperLink>
|
|
17
|
+
<i class="bi bi-chevron-compact-right text-slate-300 dark:text-slate-600"></i>
|
|
18
|
+
{/each}
|
|
19
|
+
<span class="text-teal-600 dark:text-teal-400">
|
|
20
|
+
{currentPage}
|
|
21
|
+
</span>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
breadcrumbs?: {
|
|
5
|
+
title: string;
|
|
6
|
+
href: string;
|
|
7
|
+
}[];
|
|
8
|
+
currentPage: string;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
exports?: {} | undefined;
|
|
15
|
+
bindings?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type BreadcrumbProps = typeof __propDef.props;
|
|
18
|
+
export type BreadcrumbEvents = typeof __propDef.events;
|
|
19
|
+
export type BreadcrumbSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Breadcrumb extends SvelteComponent<BreadcrumbProps, BreadcrumbEvents, BreadcrumbSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import { onMount } from "svelte";
|
|
2
|
+
import Button from "./Button.svelte";
|
|
2
3
|
import ModalDialog from "./ModalDialog.svelte";
|
|
3
4
|
export let message = "Message goes here";
|
|
4
5
|
export let style = "warning";
|
|
5
6
|
export let okButtonContent = "<span>Ok</span>";
|
|
6
|
-
export let cancelButtonContent = "<span>
|
|
7
|
+
export let cancelButtonContent = "<span>Cancel</span>";
|
|
7
8
|
let dialog;
|
|
9
|
+
let dialogId = "";
|
|
10
|
+
let buttonsContainer;
|
|
8
11
|
export async function showDialog() {
|
|
9
|
-
const okButton = document.getElementById(
|
|
10
|
-
const cancelButton = document.getElementById(
|
|
12
|
+
const okButton = document.getElementById(`okButtonDialog-${dialogId}`);
|
|
13
|
+
const cancelButton = document.getElementById(`cancelButtonDialog-${dialogId}`);
|
|
11
14
|
const p = new Promise((resolve) => {
|
|
12
15
|
function closeDialog(result) {
|
|
13
16
|
okButton?.removeEventListener("click", acceptDialog);
|
|
@@ -27,10 +30,14 @@ export async function showDialog() {
|
|
|
27
30
|
});
|
|
28
31
|
return p;
|
|
29
32
|
}
|
|
33
|
+
onMount(() => {
|
|
34
|
+
let r = (Math.random() + 1).toString(36).substring(2);
|
|
35
|
+
dialogId = `dialog-${r}`;
|
|
36
|
+
});
|
|
30
37
|
</script>
|
|
31
38
|
|
|
32
39
|
<ModalDialog bind:this={dialog} showCloseButton={false} allowSubmit={false}>
|
|
33
|
-
<slot slot="title" >Title goes here</slot>
|
|
40
|
+
<slot slot="title" name="title">Title goes here</slot>
|
|
34
41
|
<div
|
|
35
42
|
class="flex
|
|
36
43
|
{style === 'warning' ? 'text-amber-500' : ''}
|
|
@@ -98,11 +105,11 @@ export async function showDialog() {
|
|
|
98
105
|
{@html message}
|
|
99
106
|
</div>
|
|
100
107
|
</slot>
|
|
101
|
-
<div class="grid grid-cols-2 gap-2" slot="buttons">
|
|
102
|
-
<Button type="button" id="okButtonDialog">
|
|
108
|
+
<div class="grid grid-cols-2 gap-2" slot="buttons" bind:this={buttonsContainer}>
|
|
109
|
+
<Button type="button" id="okButtonDialog-{dialogId}">
|
|
103
110
|
{@html okButtonContent}
|
|
104
111
|
</Button>
|
|
105
|
-
<Button type="button" buttonStyle="dark" id="cancelButtonDialog">
|
|
112
|
+
<Button type="button" buttonStyle="dark" id="cancelButtonDialog-{dialogId}">
|
|
106
113
|
{@html cancelButtonContent}
|
|
107
114
|
</Button>
|
|
108
115
|
</div>
|
|
@@ -45,20 +45,35 @@ function closeAdvancedSearch() {
|
|
|
45
45
|
</h1>
|
|
46
46
|
<div class="ml-auto my-auto flex">
|
|
47
47
|
{#if showSearch}
|
|
48
|
-
<div class="relative">
|
|
48
|
+
<div class="relative ">
|
|
49
49
|
<input
|
|
50
50
|
disabled={!allowSearch || isBusy}
|
|
51
51
|
type="text"
|
|
52
52
|
class="border border-slate-300 rounded-md pl-2 pr-8 py-1.5
|
|
53
53
|
focus:border-indigo-500 focus:ring ring-indigo-500/30 focus:outline-none
|
|
54
54
|
md:min-w-[250px] lg:min-w-[300px]
|
|
55
|
-
rounded-r-none disabled:bg-slate-200 disabled:text-slate-400
|
|
55
|
+
rounded-r-none disabled:bg-slate-200 disabled:text-slate-400 h-full
|
|
56
56
|
"
|
|
57
57
|
placeholder={searchHint}
|
|
58
58
|
on:keyup={handleSearchRequested}
|
|
59
59
|
/>
|
|
60
60
|
<div class="absolute right-0 inset-y-0 w-8 flex">
|
|
61
|
-
<
|
|
61
|
+
<svg
|
|
62
|
+
class="w-5 h-5 text-slate-400 my-auto"
|
|
63
|
+
aria-hidden="true"
|
|
64
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
65
|
+
width="24"
|
|
66
|
+
height="24"
|
|
67
|
+
fill="none"
|
|
68
|
+
viewBox="0 0 24 24"
|
|
69
|
+
>
|
|
70
|
+
<path
|
|
71
|
+
stroke="currentColor"
|
|
72
|
+
stroke-linecap="round"
|
|
73
|
+
stroke-width="2"
|
|
74
|
+
d="m21 21-3.5-3.5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"
|
|
75
|
+
/>
|
|
76
|
+
</svg>
|
|
62
77
|
</div>
|
|
63
78
|
</div>
|
|
64
79
|
{/if}
|
|
@@ -72,7 +87,23 @@ function closeAdvancedSearch() {
|
|
|
72
87
|
last-of-type:rounded-r-md"
|
|
73
88
|
on:click={() => dispatch('refresh')}
|
|
74
89
|
>
|
|
75
|
-
<
|
|
90
|
+
<svg
|
|
91
|
+
class="w-4 h-4"
|
|
92
|
+
aria-hidden="true"
|
|
93
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
94
|
+
width="24"
|
|
95
|
+
height="24"
|
|
96
|
+
fill="none"
|
|
97
|
+
viewBox="0 0 24 24"
|
|
98
|
+
>
|
|
99
|
+
<path
|
|
100
|
+
stroke="currentColor"
|
|
101
|
+
stroke-linecap="round"
|
|
102
|
+
stroke-linejoin="round"
|
|
103
|
+
stroke-width="2"
|
|
104
|
+
d="M17.651 7.65a7.131 7.131 0 0 0-12.68 3.15M18.001 4v4h-4m-7.652 8.35a7.13 7.13 0 0 0 12.68-3.15M6 20v-4h4"
|
|
105
|
+
/>
|
|
106
|
+
</svg>
|
|
76
107
|
</button>
|
|
77
108
|
{#if allowAdd}
|
|
78
109
|
<button
|
|
@@ -85,7 +116,23 @@ function closeAdvancedSearch() {
|
|
|
85
116
|
last-of-type:rounded-r-md"
|
|
86
117
|
on:click={() => dispatch('addnew')}
|
|
87
118
|
>
|
|
88
|
-
<
|
|
119
|
+
<svg
|
|
120
|
+
class="w-4 h-4"
|
|
121
|
+
aria-hidden="true"
|
|
122
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
123
|
+
width="24"
|
|
124
|
+
height="24"
|
|
125
|
+
fill="none"
|
|
126
|
+
viewBox="0 0 24 24"
|
|
127
|
+
>
|
|
128
|
+
<path
|
|
129
|
+
stroke="currentColor"
|
|
130
|
+
stroke-linecap="round"
|
|
131
|
+
stroke-linejoin="round"
|
|
132
|
+
stroke-width="2"
|
|
133
|
+
d="M5 12h14m-7 7V5"
|
|
134
|
+
/>
|
|
135
|
+
</svg>
|
|
89
136
|
</button>
|
|
90
137
|
{/if}
|
|
91
138
|
{#if hasAdvancedSearch}
|
|
@@ -98,15 +145,23 @@ function closeAdvancedSearch() {
|
|
|
98
145
|
text-slate-500
|
|
99
146
|
hover:bg-slate-100 rounded-full my-auto
|
|
100
147
|
disabled:bg-slate-100 disabled:text-slate-300
|
|
101
|
-
transition-all ease-in-out duration-150"
|
|
148
|
+
transition-all ease-in-out duration-150 flex"
|
|
102
149
|
>
|
|
103
|
-
<
|
|
104
|
-
|
|
150
|
+
<svg
|
|
151
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
152
|
+
|
|
153
|
+
fill="currentColor"
|
|
154
|
+
class="w-3 h-3 pointer-events-none inline-block {isAdvancedSearchOpen
|
|
105
155
|
? 'rotate-0'
|
|
106
|
-
: 'rotate-180'}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
156
|
+
: 'rotate-180'} m-auto
|
|
157
|
+
transition-transform duration-150 ease-in-out"
|
|
158
|
+
viewBox="0 0 16 16"
|
|
159
|
+
>
|
|
160
|
+
<path
|
|
161
|
+
fill-rule="evenodd"
|
|
162
|
+
d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708"
|
|
163
|
+
/>
|
|
164
|
+
</svg>
|
|
110
165
|
</button>
|
|
111
166
|
</div>
|
|
112
167
|
{/if}
|
|
@@ -3,6 +3,7 @@ import ConfirmModalDialog from "./ConfirmModalDialog.svelte";
|
|
|
3
3
|
export let allowDelete = true;
|
|
4
4
|
export let showEdit = true;
|
|
5
5
|
export let showDelete = true;
|
|
6
|
+
export let isDisabled = false;
|
|
6
7
|
let deleteDialog;
|
|
7
8
|
let menuOpen = false;
|
|
8
9
|
let menuItemContainer;
|
|
@@ -42,10 +43,27 @@ onMount(() => {
|
|
|
42
43
|
<div class="relative">
|
|
43
44
|
<button
|
|
44
45
|
type="button"
|
|
45
|
-
class="px-3 py-1 rounded bg-emerald-500 text-emerald-50
|
|
46
|
+
class="px-3 py-1 rounded bg-emerald-500 text-emerald-50
|
|
47
|
+
disabled:bg-slate-100 disabled:text-slate-300"
|
|
48
|
+
disabled={isDisabled}
|
|
46
49
|
on:click={openMenu}
|
|
47
50
|
>
|
|
48
|
-
<
|
|
51
|
+
<svg
|
|
52
|
+
class="w-6 h-6 text-white"
|
|
53
|
+
aria-hidden="true"
|
|
54
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
55
|
+
width="24"
|
|
56
|
+
height="24"
|
|
57
|
+
fill="none"
|
|
58
|
+
viewBox="0 0 24 24"
|
|
59
|
+
>
|
|
60
|
+
<path
|
|
61
|
+
stroke="currentColor"
|
|
62
|
+
stroke-linecap="round"
|
|
63
|
+
stroke-width="3"
|
|
64
|
+
d="M12 6h.01M12 12h.01M12 18h.01"
|
|
65
|
+
/>
|
|
66
|
+
</svg>
|
|
49
67
|
</button>
|
|
50
68
|
{#if true}
|
|
51
69
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
@@ -106,7 +124,11 @@ onMount(() => {
|
|
|
106
124
|
<ConfirmModalDialog
|
|
107
125
|
bind:this={deleteDialog}
|
|
108
126
|
style="danger"
|
|
109
|
-
|
|
127
|
+
okButtonContent="Yes, delete"
|
|
128
|
+
cancelButtonContent="Cancel"
|
|
110
129
|
>
|
|
111
|
-
<span> Confirm Delete </span>
|
|
130
|
+
<span slot="title"> Confirm Delete </span>
|
|
131
|
+
<div class="text-center my-2">
|
|
132
|
+
<span class="text-lg"> Are you sure you want to delete this record ?</span>
|
|
133
|
+
</div>
|
|
112
134
|
</ConfirmModalDialog>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import LabeledFormInput from "./LabeledFormInput.svelte";
|
|
3
|
+
import LabeledSelect from "./LabeledSelect.svelte";
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
export let recordsPerPageArray = [10, 25, 50, 100];
|
|
6
|
+
export let recordsPerPage = 10;
|
|
7
|
+
export let currentPage;
|
|
8
|
+
export let totalRecords;
|
|
9
|
+
let pagesCount = 0;
|
|
10
|
+
let _currentPage = 0;
|
|
11
|
+
$: {
|
|
12
|
+
pagesCount = Math.ceil(totalRecords / recordsPerPage);
|
|
13
|
+
_currentPage = currentPage + 1;
|
|
14
|
+
}
|
|
15
|
+
function handlePageIndexChanged(factor) {
|
|
16
|
+
currentPage += factor;
|
|
17
|
+
handlePageChanged();
|
|
18
|
+
}
|
|
19
|
+
function handleCurrentPageChanged(event) {
|
|
20
|
+
currentPage = _currentPage - 1;
|
|
21
|
+
handlePageChanged();
|
|
22
|
+
}
|
|
23
|
+
function handleRecordsPerPageChanged(event) {
|
|
24
|
+
const target = event.target;
|
|
25
|
+
if (!target) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const value = Number(target.value);
|
|
29
|
+
recordsPerPage = value;
|
|
30
|
+
handlePageChanged();
|
|
31
|
+
}
|
|
32
|
+
function handlePageChanged() {
|
|
33
|
+
if (currentPage < 0) {
|
|
34
|
+
currentPage = 0;
|
|
35
|
+
}
|
|
36
|
+
if (currentPage > pagesCount - 1) {
|
|
37
|
+
currentPage = pagesCount - 1;
|
|
38
|
+
}
|
|
39
|
+
dispatch("pagechanged", {
|
|
40
|
+
currentPage,
|
|
41
|
+
recordsPerPage
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<div class="border border-slate-300 rounded flex p-2">
|
|
47
|
+
<div class="my-auto flex space-x-2">
|
|
48
|
+
<label for="recordsPerPageSelect" class="text-sm my-auto text-slate-600">
|
|
49
|
+
Records per page
|
|
50
|
+
</label>
|
|
51
|
+
<LabeledSelect
|
|
52
|
+
value={recordsPerPage}
|
|
53
|
+
id="recordsPerPageSelect"
|
|
54
|
+
on:change={handleRecordsPerPageChanged}
|
|
55
|
+
>
|
|
56
|
+
{#each recordsPerPageArray as recperPage (recperPage)}
|
|
57
|
+
<option value={recperPage}>{recperPage}</option>
|
|
58
|
+
{/each}
|
|
59
|
+
</LabeledSelect>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div class="ml-auto flex space-x-3">
|
|
63
|
+
<span class="inline-block my-auto text-sm text-slate-500"> Page </span>
|
|
64
|
+
<div class="w-14">
|
|
65
|
+
<LabeledFormInput
|
|
66
|
+
numeric={true}
|
|
67
|
+
bind:value={_currentPage}
|
|
68
|
+
on:change={handleCurrentPageChanged}
|
|
69
|
+
size="md"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
<span class="inline-block my-auto text-sm text-slate-500 mr-10">
|
|
73
|
+
of {pagesCount} ( {totalRecords} records )
|
|
74
|
+
</span>
|
|
75
|
+
|
|
76
|
+
<button
|
|
77
|
+
on:click={() => handlePageIndexChanged(-1)}
|
|
78
|
+
type="button"
|
|
79
|
+
class="px-3 py-2 border border-teal-600 rounded text-teal-600 hover:bg-teal-600/10 active:bg-teal-600 active:text-teal-50
|
|
80
|
+
outline-none focus:outline-none
|
|
81
|
+
transition-all ease-in-out duration-300"
|
|
82
|
+
>
|
|
83
|
+
<svg
|
|
84
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
85
|
+
width="16"
|
|
86
|
+
height="16"
|
|
87
|
+
fill="currentColor"
|
|
88
|
+
viewBox="0 0 16 16"
|
|
89
|
+
>
|
|
90
|
+
<path
|
|
91
|
+
fill-rule="evenodd"
|
|
92
|
+
d="M9.224 1.553a.5.5 0 0 1 .223.67L6.56 8l2.888 5.776a.5.5 0 1 1-.894.448l-3-6a.5.5 0 0 1 0-.448l3-6a.5.5 0 0 1 .67-.223"
|
|
93
|
+
/>
|
|
94
|
+
</svg>
|
|
95
|
+
</button>
|
|
96
|
+
|
|
97
|
+
<button
|
|
98
|
+
on:click={() => handlePageIndexChanged(1)}
|
|
99
|
+
type="button"
|
|
100
|
+
class="px-3 py-2 border border-teal-600 rounded text-teal-600 hover:bg-teal-600/10 active:bg-teal-600 active:text-teal-50
|
|
101
|
+
outline-none focus:outline-none
|
|
102
|
+
transition-all ease-in-out duration-300"
|
|
103
|
+
>
|
|
104
|
+
<svg
|
|
105
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
106
|
+
width="16"
|
|
107
|
+
height="16"
|
|
108
|
+
fill="currentColor"
|
|
109
|
+
viewBox="0 0 16 16"
|
|
110
|
+
>
|
|
111
|
+
<path
|
|
112
|
+
fill-rule="evenodd"
|
|
113
|
+
d="M6.776 1.553a.5.5 0 0 1 .671.223l3 6a.5.5 0 0 1 0 .448l-3 6a.5.5 0 1 1-.894-.448L9.44 8 6.553 2.224a.5.5 0 0 1 .223-.671"
|
|
114
|
+
/>
|
|
115
|
+
</svg>
|
|
116
|
+
</button>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
recordsPerPageArray?: number[];
|
|
5
|
+
recordsPerPage?: number;
|
|
6
|
+
currentPage: number;
|
|
7
|
+
totalRecords: number;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
pagechanged: CustomEvent<any>;
|
|
11
|
+
} & {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
exports?: {} | undefined;
|
|
16
|
+
bindings?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type DataTablePaginatorProps = typeof __propDef.props;
|
|
19
|
+
export type DataTablePaginatorEvents = typeof __propDef.events;
|
|
20
|
+
export type DataTablePaginatorSlots = typeof __propDef.slots;
|
|
21
|
+
export default class DataTablePaginator extends SvelteComponent<DataTablePaginatorProps, DataTablePaginatorEvents, DataTablePaginatorSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>export let linkStyle = "teal";
|
|
2
|
+
export let disabled = false;
|
|
3
|
+
export let id = void 0;
|
|
4
|
+
export let customCss = "";
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<button
|
|
10
|
+
on:click
|
|
11
|
+
type="button"
|
|
12
|
+
{disabled}
|
|
13
|
+
class="px-1 py-1 {customCss} text-slate-600 dark:text-slate-200
|
|
14
|
+
{id}
|
|
15
|
+
{linkStyle === 'blue' ? 'hover:text-blue-500 active:text-blue-600' : ''}
|
|
16
|
+
{linkStyle === 'red' ? 'hover:text-red-500 active:text-red-600' : ''}
|
|
17
|
+
{linkStyle === 'teal' ? 'hover:text-teal-500 active:text-teal-600' : ''}
|
|
18
|
+
{linkStyle === 'indigo' ? 'hover:text-indigo-500 active:text-indigo-600' : ''}
|
|
19
|
+
{linkStyle === 'purple' ? 'hover:text-purple-500 active:text-purple-600' : ''}
|
|
20
|
+
hover:underline underline-offset-4
|
|
21
|
+
disabled:text-slate-300 dark:disabled:text-slate-500
|
|
22
|
+
space-x-1 transition-colors ease-in-out duration-150"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</button>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ColorThemes } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
linkStyle?: ColorThemes;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
id?: string | undefined;
|
|
8
|
+
customCss?: string;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
click: MouseEvent;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {
|
|
16
|
+
default: {};
|
|
17
|
+
};
|
|
18
|
+
exports?: {} | undefined;
|
|
19
|
+
bindings?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type HyperlinkButtonProps = typeof __propDef.props;
|
|
22
|
+
export type HyperlinkButtonEvents = typeof __propDef.events;
|
|
23
|
+
export type HyperlinkButtonSlots = typeof __propDef.slots;
|
|
24
|
+
export default class HyperlinkButton extends SvelteComponent<HyperlinkButtonProps, HyperlinkButtonEvents, HyperlinkButtonSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -28,34 +28,29 @@ function setValueInternal(value2) {
|
|
|
28
28
|
const day = value2.getDate();
|
|
29
29
|
const hour = padZero(value2.getHours());
|
|
30
30
|
const minute = padZero(value2.getMinutes());
|
|
31
|
-
|
|
32
|
-
_value = `${year}-${padZero(month)}-${padZero(day)}T${hour}:${minute}:${second}`;
|
|
31
|
+
_value = `${year}-${padZero(month)}-${padZero(day)}T${hour}:${minute}`;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
const dispatch = createEventDispatcher();
|
|
36
35
|
export let isValid = true;
|
|
37
|
-
let inputContainer;
|
|
38
36
|
function validateElement(event) {
|
|
39
37
|
if (input.dataset.validated !== "true") {
|
|
40
38
|
return;
|
|
41
39
|
}
|
|
42
|
-
if (!required) {
|
|
43
|
-
dispatch("validated", true);
|
|
44
|
-
}
|
|
45
40
|
isValid = input.checkValidity();
|
|
46
41
|
dispatch("validated", isValid);
|
|
47
42
|
}
|
|
48
43
|
function handleChange(event) {
|
|
49
44
|
const target = event.target;
|
|
50
|
-
|
|
51
|
-
if (
|
|
45
|
+
let _value2 = target.value;
|
|
46
|
+
if (_value2 === "" || _value2 === void 0) {
|
|
52
47
|
value = void 0;
|
|
53
48
|
dispatch("dateChanged", {
|
|
54
49
|
date: void 0
|
|
55
50
|
});
|
|
56
51
|
return;
|
|
57
52
|
}
|
|
58
|
-
const parts =
|
|
53
|
+
const parts = _value2.split("T");
|
|
59
54
|
const datePart = parts[0].split("-");
|
|
60
55
|
const year = Number(datePart[0]);
|
|
61
56
|
const month = Number(datePart[1]);
|
|
@@ -99,10 +94,10 @@ onMount(() => {
|
|
|
99
94
|
type={inputType}
|
|
100
95
|
{required}
|
|
101
96
|
{autocomplete}
|
|
102
|
-
value={_value}
|
|
103
97
|
{placeholder}
|
|
104
98
|
{name}
|
|
105
99
|
on:change={handleChange}
|
|
106
100
|
{readonly}
|
|
101
|
+
value={_value}
|
|
107
102
|
/>
|
|
108
103
|
</LabeledFormInput>
|
|
@@ -6,6 +6,7 @@ export let value = void 0;
|
|
|
6
6
|
export let name = void 0;
|
|
7
7
|
export let placeholder = void 0;
|
|
8
8
|
export let validationText = void 0;
|
|
9
|
+
export let theme = "teal";
|
|
9
10
|
export let input = void 0;
|
|
10
11
|
export let visible = true;
|
|
11
12
|
export let disabled = false;
|
|
@@ -51,8 +52,7 @@ onMount(() => {
|
|
|
51
52
|
{#if labelText}
|
|
52
53
|
<label
|
|
53
54
|
for={id}
|
|
54
|
-
class="mb-1 inline-block text-slate-600 dark:text-neutral-200"
|
|
55
|
-
bind:this={inputContainer}
|
|
55
|
+
class="mb-1 inline-block text-slate-600 dark:text-neutral-200"
|
|
56
56
|
>
|
|
57
57
|
{labelText}
|
|
58
58
|
{#if required}
|
|
@@ -60,7 +60,7 @@ onMount(() => {
|
|
|
60
60
|
{/if}
|
|
61
61
|
</label>
|
|
62
62
|
{/if}
|
|
63
|
-
<div class="relative">
|
|
63
|
+
<div class="relative" bind:this={inputContainer}>
|
|
64
64
|
<select
|
|
65
65
|
bind:this={select}
|
|
66
66
|
{disabled}
|
|
@@ -70,26 +70,40 @@ onMount(() => {
|
|
|
70
70
|
{placeholder}
|
|
71
71
|
{name}
|
|
72
72
|
on:change
|
|
73
|
-
class="border peer block w-full py-1
|
|
73
|
+
class="border peer block w-full py-1 pl-2 pr-10 rounded-md shadow-sm bg-white text-neutral-900
|
|
74
74
|
focus:outline-none focus:ring
|
|
75
75
|
placeholder:text-sm placeholder:font-thin
|
|
76
76
|
dark:bg-slate-900 dark:text-neutral-100 appearance-none
|
|
77
|
+
|
|
77
78
|
{!isValid
|
|
78
79
|
? 'border-pink-600 dark:border-pink-500 focus:ring-pink-600/20 dark:focus:ring-pink-600/40'
|
|
79
|
-
: 'dark:border-slate-600 border-slate-300
|
|
80
|
+
: 'dark:border-slate-600 border-slate-300'}
|
|
81
|
+
{isValid && theme === 'teal' ? ' focus:ring-teal-600/20 dark:focus:ring-teal-600/30' : ''}
|
|
80
82
|
"
|
|
81
83
|
>
|
|
82
84
|
<slot />
|
|
83
85
|
</select>
|
|
84
86
|
<span
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
class="absolute right-0 inset-y-0 w-8 flex text-slate-500 pointer-events-none
|
|
88
|
+
{theme === 'teal' ? 'peer-hover:text-teal-600 peer-focus:text-teal-600' : ''}
|
|
89
|
+
{theme === 'blue' ? 'peer-hover:text-blue-500 peer-focus:text-blue-500' : ''}
|
|
90
|
+
"
|
|
88
91
|
>
|
|
89
|
-
<
|
|
92
|
+
<svg
|
|
93
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
94
|
+
width="16"
|
|
95
|
+
height="16"
|
|
96
|
+
fill="currentColor"
|
|
97
|
+
class="w-4 h-4 block m-auto"
|
|
98
|
+
viewBox="0 0 16 16"
|
|
99
|
+
>
|
|
100
|
+
<path
|
|
101
|
+
fill-rule="evenodd"
|
|
102
|
+
d="M1.553 6.776a.5.5 0 0 1 .67-.223L8 9.44l5.776-2.888a.5.5 0 1 1 .448.894l-6 3a.5.5 0 0 1-.448 0l-6-3a.5.5 0 0 1-.223-.67"
|
|
103
|
+
/>
|
|
104
|
+
</svg>
|
|
90
105
|
</span>
|
|
91
106
|
</div>
|
|
92
|
-
|
|
93
107
|
|
|
94
108
|
{#if validationText && !isValid}
|
|
95
109
|
<div class="text-sm text-pink-600 dark:text-pink-500 my-2">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ColorThemes } from './types.js';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
labelText?: string | undefined;
|
|
@@ -8,6 +9,7 @@ declare const __propDef: {
|
|
|
8
9
|
name?: string | undefined;
|
|
9
10
|
placeholder?: string | undefined;
|
|
10
11
|
validationText?: string | undefined;
|
|
12
|
+
theme?: ColorThemes;
|
|
11
13
|
input?: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | any | undefined;
|
|
12
14
|
visible?: boolean;
|
|
13
15
|
disabled?: boolean;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
const dispacth = createEventDispatcher();
|
|
3
|
+
export let value = void 0;
|
|
4
|
+
export let options = [];
|
|
5
|
+
export let labelText = void 0;
|
|
6
|
+
export let name = void 0;
|
|
7
|
+
export let disabled = false;
|
|
8
|
+
export let theme = "teal";
|
|
9
|
+
function handleValueChanged(newValue) {
|
|
10
|
+
value = newValue;
|
|
11
|
+
dispacth("change", {
|
|
12
|
+
value
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div>
|
|
18
|
+
{#if labelText}
|
|
19
|
+
<span class="mb-1 block text-slate-600 dark:text-neutral-200">
|
|
20
|
+
{labelText}
|
|
21
|
+
</span>
|
|
22
|
+
{/if}
|
|
23
|
+
<input type="hidden" {name} {value} />
|
|
24
|
+
<div class="grid" style="grid-template-columns: repeat({options.length}, minmax(0, 1fr));">
|
|
25
|
+
{#each options as option}
|
|
26
|
+
<!-- svelte-ignore a11y-role-supports-aria-props -->
|
|
27
|
+
<button
|
|
28
|
+
{disabled}
|
|
29
|
+
type="button"
|
|
30
|
+
data-selected={option.key === value ? 'true' : ''}
|
|
31
|
+
on:click={() => handleValueChanged(option.key)}
|
|
32
|
+
class="first:rounded-l-lg last-of-type:rounded-r-lg
|
|
33
|
+
border px-2 py-1 transition-all ease-in-out duration-150 enabled:active:ring
|
|
34
|
+
{theme === 'red'
|
|
35
|
+
? `border-red-500 text-red-500 dark:text-red-100
|
|
36
|
+
enabled:hover:bg-red-100 enabled:active:bg-red-500 enabled:active:text-red-50 ring-red-500/40
|
|
37
|
+
data-[selected='true']:bg-red-500 data-[selected='true']:text-red-50
|
|
38
|
+
hover:data-[selected='true']:bg-red-500 hover:data-[selected='true']:text-red-50
|
|
39
|
+
enabled:dark:hover:bg-red-100/20 enabled:dark:hover:data-[selected='true']:bg-red-500`
|
|
40
|
+
: ''}
|
|
41
|
+
{theme === 'indigo'
|
|
42
|
+
? `border-indigo-500 text-indigo-500 dark:text-indigo-100
|
|
43
|
+
enabled:hover:bg-indigo-100 enabled:active:bg-indigo-500 enabled:active:text-indigo-50 ring-indigo-500/40
|
|
44
|
+
data-[selected='true']:bg-indigo-500 data-[selected='true']:text-indigo-50
|
|
45
|
+
hover:data-[selected='true']:bg-indigo-500 hover:data-[selected='true']:text-indigo-50
|
|
46
|
+
enabled:dark:hover:bg-indigo-100/20 enabled:dark:hover:data-[selected='true']:bg-indigo-500`
|
|
47
|
+
: ''}
|
|
48
|
+
{theme === 'blue'
|
|
49
|
+
? `border-blue-500 text-blue-500 dark:text-blue-100
|
|
50
|
+
enabled:hover:bg-blue-100 enabled:active:bg-blue-500 enabled:active:text-blue-50 ring-blue-500/40
|
|
51
|
+
data-[selected='true']:bg-blue-500 data-[selected='true']:text-blue-50
|
|
52
|
+
hover:data-[selected='true']:bg-blue-500 hover:data-[selected='true']:text-blue-50
|
|
53
|
+
enabled:dark:hover:bg-blue-100/20 enabled:dark:hover:data-[selected='true']:bg-blue-500
|
|
54
|
+
`
|
|
55
|
+
: ''}
|
|
56
|
+
{theme === 'purple'
|
|
57
|
+
? `border-purple-500 text-purple-500 dark:text-purple-100
|
|
58
|
+
enabled:hover:bg-purple-100 enabled:active:bg-purple-500 enabled:active:text-purple-50 ring-purple-500/40
|
|
59
|
+
data-[selected='true']:bg-purple-500 data-[selected='true']:text-purple-50
|
|
60
|
+
hover:data-[selected='true']:bg-purple-500 hover:data-[selected='true']:text-purple-50
|
|
61
|
+
enabled:dark:hover:bg-purple-100/20 enabled:dark:hover:data-[selected='true']:bg-purple-500`
|
|
62
|
+
: ''}
|
|
63
|
+
|
|
64
|
+
disabled:border-slate-300 disabled:text-slate-300
|
|
65
|
+
disabled:data-[selected='true']:bg-slate-300 disabled:data-[selected='true']:text-slate-50
|
|
66
|
+
dark:disabled:data-[selected='true']:text-slate-950
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
"
|
|
70
|
+
>
|
|
71
|
+
{@html option.value}
|
|
72
|
+
</button>
|
|
73
|
+
{/each}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ColorThemes, KeyValue } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
value?: string | number | boolean | undefined;
|
|
6
|
+
options?: KeyValue<string | number | boolean, string>[];
|
|
7
|
+
labelText?: string | undefined;
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
theme?: ColorThemes;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
change: CustomEvent<any>;
|
|
14
|
+
} & {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {};
|
|
18
|
+
exports?: {} | undefined;
|
|
19
|
+
bindings?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type SegmentedControlProps = typeof __propDef.props;
|
|
22
|
+
export type SegmentedControlEvents = typeof __propDef.events;
|
|
23
|
+
export type SegmentedControlSlots = typeof __propDef.slots;
|
|
24
|
+
export default class SegmentedControl extends SvelteComponent<SegmentedControlProps, SegmentedControlEvents, SegmentedControlSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script>export let position = "left";
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<nav
|
|
5
|
+
class="w-96 md:w-[250px] bg-slate-50 dark:bg-slate-800
|
|
6
|
+
{position === 'left' ? 'border-r border-r-slate-200 dark:border-r-slate-600' : ''}
|
|
7
|
+
{position === 'right' ? 'border-l border-l-slate-200 dark:border-l-slate-600' : ''}
|
|
8
|
+
flex-shrink-0
|
|
9
|
+
p-1 md:p-2"
|
|
10
|
+
>
|
|
11
|
+
<slot />
|
|
12
|
+
</nav>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
position?: "left" | "right";
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {
|
|
10
|
+
default: {};
|
|
11
|
+
};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type SideNavProps = typeof __propDef.props;
|
|
16
|
+
export type SideNavEvents = typeof __propDef.events;
|
|
17
|
+
export type SideNavSlots = typeof __propDef.slots;
|
|
18
|
+
export default class SideNav extends SvelteComponent<SideNavProps, SideNavEvents, SideNavSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script>import { goto } from "$app/navigation";
|
|
2
|
+
export let href;
|
|
3
|
+
export let checked = "false";
|
|
4
|
+
export let theme = "teal";
|
|
5
|
+
let button;
|
|
6
|
+
function handleMenuButtonClicked(event) {
|
|
7
|
+
goto(href).then(() => {
|
|
8
|
+
checked = "true";
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<button
|
|
14
|
+
type="button"
|
|
15
|
+
bind:this={button}
|
|
16
|
+
data-destination={href}
|
|
17
|
+
aria-checked={checked}
|
|
18
|
+
class="w-full my-1 outline-none py-1.5 px-2 flex
|
|
19
|
+
{theme==='teal' ? 'text-teal-600 hover:bg-teal-600 hover:text-teal-50 active:bg-teal-700 aria-checked:bg-teal-700 aria-checked:text-teal-50 ring-teal-500/20' : ''}
|
|
20
|
+
{theme==='indigo' ? 'text-indigo-500 hover:bg-indigo-500 hover:text-indigo-50 active:bg-indigo-600 aria-checked:bg-indigo-600 aria-checked:text-indigo-50 ring-indigo-500/20' : ''}
|
|
21
|
+
{theme==='blue' ? 'text-blue-500 hover:bg-blue-500 hover:text-blue-50 active:bg-blue-600 aria-checked:bg-blue-600 aria-checked:text-blue-50 ring-blue-500/20' : ''}
|
|
22
|
+
{theme==='purple' ? 'text-purple-500 hover:bg-purple-500 hover:text-purple-50 active:bg-purple-600 aria-checked:bg-purple-600 aria-checked:text-purple-50 ring-purple-500/20' : ''}
|
|
23
|
+
{theme==='red' ? 'text-red-500 hover:bg-red-500 hover:text-red-50 active:bg-red-600 aria-checked:bg-red-600 aria-checked:text-red-50 ring-red-500/20' : ''}
|
|
24
|
+
{theme==='dark' ? 'text-slate-950 hover:bg-slate-800 hover:text-slate-50 active:bg-slate-900 aria-checked:bg-slate-950 aria-checked:text-slate-50 ring-slate-900/20' : ''}
|
|
25
|
+
rounded-lg
|
|
26
|
+
focus:outline-none active:ring focus:ring
|
|
27
|
+
dark:text-slate-200
|
|
28
|
+
transition-all ease-in-out duration-300
|
|
29
|
+
disabled:bg-slate-300 disabled:text-slate-50
|
|
30
|
+
aria-checked:disabled:bg-slate-300 aria-checked:disabled:text-slate-50 space-x-2
|
|
31
|
+
dark:disabled:text-slate-900
|
|
32
|
+
font-semibold
|
|
33
|
+
"
|
|
34
|
+
on:click={handleMenuButtonClicked}
|
|
35
|
+
>
|
|
36
|
+
<span class="my-auto inline-block">
|
|
37
|
+
<slot name="icon">
|
|
38
|
+
<svg
|
|
39
|
+
class="w-6 h-6"
|
|
40
|
+
aria-hidden="true"
|
|
41
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
42
|
+
width="24"
|
|
43
|
+
height="24"
|
|
44
|
+
fill="currentColor"
|
|
45
|
+
viewBox="0 0 24 24"
|
|
46
|
+
>
|
|
47
|
+
<path d="M11 9a1 1 0 1 1 2 0 1 1 0 0 1-2 0Z" />
|
|
48
|
+
<path
|
|
49
|
+
fill-rule="evenodd"
|
|
50
|
+
d="M9.896 3.051a2.681 2.681 0 0 1 4.208 0c.147.186.38.282.615.255a2.681 2.681 0 0 1 2.976 2.975.681.681 0 0 0 .254.615 2.681 2.681 0 0 1 0 4.208.682.682 0 0 0-.254.615 2.681 2.681 0 0 1-2.976 2.976.681.681 0 0 0-.615.254 2.682 2.682 0 0 1-4.208 0 .681.681 0 0 0-.614-.255 2.681 2.681 0 0 1-2.976-2.975.681.681 0 0 0-.255-.615 2.681 2.681 0 0 1 0-4.208.681.681 0 0 0 .255-.615 2.681 2.681 0 0 1 2.976-2.975.681.681 0 0 0 .614-.255ZM12 6a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z"
|
|
51
|
+
clip-rule="evenodd"
|
|
52
|
+
/>
|
|
53
|
+
<path
|
|
54
|
+
d="M5.395 15.055 4.07 19a1 1 0 0 0 1.264 1.267l1.95-.65 1.144 1.707A1 1 0 0 0 10.2 21.1l1.12-3.18a4.641 4.641 0 0 1-2.515-1.208 4.667 4.667 0 0 1-3.411-1.656Zm7.269 2.867 1.12 3.177a1 1 0 0 0 1.773.224l1.144-1.707 1.95.65A1 1 0 0 0 19.915 19l-1.32-3.93a4.667 4.667 0 0 1-3.4 1.642 4.643 4.643 0 0 1-2.53 1.21Z"
|
|
55
|
+
/>
|
|
56
|
+
</svg>
|
|
57
|
+
</slot>
|
|
58
|
+
</span>
|
|
59
|
+
<span class="my-auto inline-block">
|
|
60
|
+
<slot>
|
|
61
|
+
<span class="pointer-events-none"> Button Text </span>
|
|
62
|
+
</slot>
|
|
63
|
+
</span>
|
|
64
|
+
</button>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ColorThemes } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
href: string;
|
|
6
|
+
checked?: "true" | "false";
|
|
7
|
+
theme?: ColorThemes;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
icon: {};
|
|
14
|
+
default: {};
|
|
15
|
+
};
|
|
16
|
+
exports?: {} | undefined;
|
|
17
|
+
bindings?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type SideNavItemProps = typeof __propDef.props;
|
|
20
|
+
export type SideNavItemEvents = typeof __propDef.events;
|
|
21
|
+
export type SideNavItemSlots = typeof __propDef.slots;
|
|
22
|
+
export default class SideNavItem extends SvelteComponent<SideNavItemProps, SideNavItemEvents, SideNavItemSlots> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
export let label = "";
|
|
3
3
|
export let id = void 0;
|
|
4
4
|
export let name = void 0;
|
|
5
|
+
export let theme = "teal";
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
8
|
<label class="flex cursor-pointer">
|
|
8
9
|
<input type="checkbox" bind:checked class="hidden peer" {id} {name} />
|
|
9
10
|
<div
|
|
10
11
|
class=" rounded-full h-5 w-10 flex my-auto bg-slate-300
|
|
11
|
-
|
|
12
|
+
{theme==='teal' ? 'peer-checked:bg-teal-600' : ''}
|
|
13
|
+
{theme==='indigo' ? 'peer-checked:bg-indigo-600' : ''}
|
|
14
|
+
{theme==='blue' ? 'peer-blue:bg-indigo-600' : ''}
|
|
15
|
+
|
|
16
|
+
transition-all duration-300"
|
|
12
17
|
>
|
|
13
18
|
<div
|
|
14
19
|
class="w-5 h-5 rounded-full my-auto border border-slate-400 {!checked
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ColorThemes } from './types.js';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
checked?: boolean;
|
|
5
6
|
label?: string;
|
|
6
7
|
id?: string | undefined;
|
|
7
8
|
name?: string | undefined;
|
|
9
|
+
theme?: ColorThemes;
|
|
8
10
|
};
|
|
9
11
|
events: {
|
|
10
12
|
[evt: string]: CustomEvent<any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -18,4 +18,10 @@ import DataTableRow from "./components/DataTableRow.svelte";
|
|
|
18
18
|
import DataTableMenuButton from "./components/DataTableMenuButton.svelte";
|
|
19
19
|
import LabeledDatePicker from "./components/LabeledDatePicker.svelte";
|
|
20
20
|
import LabeledTextArea from "./components/LabeledTextArea.svelte";
|
|
21
|
-
|
|
21
|
+
import Breadcrumb from "./components/Breadcrumb.svelte";
|
|
22
|
+
import SegmentedControl from "./components/SegmentedControl.svelte";
|
|
23
|
+
import HyperlinkButton from "./components/HyperlinkButton.svelte";
|
|
24
|
+
import SideNav from "./components/SideNav.svelte";
|
|
25
|
+
import SideNavItem from "./components/SideNavItem.svelte";
|
|
26
|
+
import DataTablePaginator from "./components/DataTablePaginator.svelte";
|
|
27
|
+
export { Button, LoadingIndicator, Card, CardHeader, Form, ToggleButton, LabeledFormInput, LabeledPasswordInput, Alert, HyperLink, LabeledSelect, ModalDialog, BooleanPresenter, DataTable, DataTableCell, DataTableRow, DataTableMenuButton, DatePresenter, LabeledDatePicker, LabeledTextArea, Breadcrumb, SegmentedControl, HyperlinkButton, SideNav, SideNavItem, DataTablePaginator };
|
package/dist/index.js
CHANGED
|
@@ -19,4 +19,10 @@ import DataTableRow from "./components/DataTableRow.svelte";
|
|
|
19
19
|
import DataTableMenuButton from "./components/DataTableMenuButton.svelte";
|
|
20
20
|
import LabeledDatePicker from "./components/LabeledDatePicker.svelte";
|
|
21
21
|
import LabeledTextArea from "./components/LabeledTextArea.svelte";
|
|
22
|
-
|
|
22
|
+
import Breadcrumb from "./components/Breadcrumb.svelte";
|
|
23
|
+
import SegmentedControl from "./components/SegmentedControl.svelte";
|
|
24
|
+
import HyperlinkButton from "./components/HyperlinkButton.svelte";
|
|
25
|
+
import SideNav from "./components/SideNav.svelte";
|
|
26
|
+
import SideNavItem from "./components/SideNavItem.svelte";
|
|
27
|
+
import DataTablePaginator from "./components/DataTablePaginator.svelte";
|
|
28
|
+
export { Button, LoadingIndicator, Card, CardHeader, Form, ToggleButton, LabeledFormInput, LabeledPasswordInput, Alert, HyperLink, LabeledSelect, ModalDialog, BooleanPresenter, DataTable, DataTableCell, DataTableRow, DataTableMenuButton, DatePresenter, LabeledDatePicker, LabeledTextArea, Breadcrumb, SegmentedControl, HyperlinkButton, SideNav, SideNavItem, DataTablePaginator };
|