y200subcontrols 0.0.3332 → 0.0.3541
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 +27 -0
- package/dist/components/Breadcrumb.svelte.d.ts +24 -0
- package/dist/components/ConfirmModalDialog.svelte +13 -6
- package/dist/components/DataTable.svelte +69 -14
- package/dist/components/DataTable.svelte.d.ts +1 -0
- package/dist/components/DataTableCell.svelte +11 -2
- package/dist/components/DataTableCell.svelte.d.ts +1 -0
- package/dist/components/DataTableMenuButton.svelte +8 -5
- 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/LabeledPasswordInput.svelte +1 -1
- package/dist/components/LabeledSelect.svelte +31 -10
- package/dist/components/LabeledSelect.svelte.d.ts +4 -0
- package/dist/components/SegmentedControl.svelte +83 -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 +7 -2
- package/dist/components/ToggleButton.svelte.d.ts +4 -0
- package/dist/components/types.d.ts +5 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +7 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
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 flex flex-row"
|
|
8
|
+
>
|
|
9
|
+
<div class="my-auto">
|
|
10
|
+
<HyperLink href="/">
|
|
11
|
+
<i class="bi bi-house-fill" title="Home"></i>
|
|
12
|
+
</HyperLink>
|
|
13
|
+
<i class="bi bi-chevron-compact-right text-slate-300 dark:text-slate-600"></i>
|
|
14
|
+
{#each breadcrumbs as crumb (crumb.href)}
|
|
15
|
+
<HyperLink href={crumb.href}>
|
|
16
|
+
{crumb.title}
|
|
17
|
+
</HyperLink>
|
|
18
|
+
<i class="bi bi-chevron-compact-right text-slate-300 dark:text-slate-600"></i>
|
|
19
|
+
{/each}
|
|
20
|
+
<span class="text-teal-600 dark:text-teal-400">
|
|
21
|
+
{currentPage}
|
|
22
|
+
</span>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="ml-auto my-auto">
|
|
25
|
+
<slot />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
default: {};
|
|
15
|
+
};
|
|
16
|
+
exports?: {} | undefined;
|
|
17
|
+
bindings?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type BreadcrumbProps = typeof __propDef.props;
|
|
20
|
+
export type BreadcrumbEvents = typeof __propDef.events;
|
|
21
|
+
export type BreadcrumbSlots = typeof __propDef.slots;
|
|
22
|
+
export default class Breadcrumb extends SvelteComponent<BreadcrumbProps, BreadcrumbEvents, BreadcrumbSlots> {
|
|
23
|
+
}
|
|
24
|
+
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
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,6 +30,10 @@ 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}>
|
|
@@ -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>
|
|
@@ -6,8 +6,8 @@ export let isBusy = false;
|
|
|
6
6
|
export let popupMenuItems = void 0;
|
|
7
7
|
export let hasAdvancedSearch = false;
|
|
8
8
|
export let searchHint = "Search";
|
|
9
|
+
export let isAdvancedSearchOpen = false;
|
|
9
10
|
let isMenuOpen = false;
|
|
10
|
-
let isAdvancedSearchOpen = false;
|
|
11
11
|
const dispatch = createEventDispatcher();
|
|
12
12
|
function handleSearchRequested(event) {
|
|
13
13
|
const target = event.target;
|
|
@@ -52,13 +52,28 @@ function closeAdvancedSearch() {
|
|
|
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,22 @@ 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
|
+
fill="currentColor"
|
|
153
|
+
class="w-3 h-3 pointer-events-none inline-block {isAdvancedSearchOpen
|
|
105
154
|
? 'rotate-0'
|
|
106
|
-
: 'rotate-180'}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
155
|
+
: 'rotate-180'} m-auto
|
|
156
|
+
transition-transform duration-150 ease-in-out"
|
|
157
|
+
viewBox="0 0 16 16"
|
|
158
|
+
>
|
|
159
|
+
<path
|
|
160
|
+
fill-rule="evenodd"
|
|
161
|
+
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"
|
|
162
|
+
/>
|
|
163
|
+
</svg>
|
|
110
164
|
</button>
|
|
111
165
|
</div>
|
|
112
166
|
{/if}
|
|
@@ -116,9 +170,10 @@ function closeAdvancedSearch() {
|
|
|
116
170
|
<button
|
|
117
171
|
type="button"
|
|
118
172
|
class="px-3 py-1.5 text-blue-500 border border-blue-500 rounded
|
|
119
|
-
|
|
120
|
-
|
|
173
|
+
hover:bg-blue-50 active:bg-blue-500 active:text-blue-50 outline-blue-600 h-full
|
|
174
|
+
disabled:text-slate-300 disabled:bg-slate-100 disabled:border-slate-400 disabled:outline-none"
|
|
121
175
|
on:click={() => (isMenuOpen = true)}
|
|
176
|
+
disabled={isBusy}
|
|
122
177
|
>
|
|
123
178
|
<i class="bi bi-three-dots"></i>
|
|
124
179
|
</button>
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
<script>export let isHeader = false;
|
|
2
2
|
export let width = void 0;
|
|
3
|
+
export let breakpoint = void 0;
|
|
3
4
|
</script>
|
|
4
5
|
|
|
5
6
|
{#if isHeader}
|
|
6
7
|
<th
|
|
7
|
-
class="px-2 py-1.5 border-r border-r-slate-300 last-of-type:border-r-0 text-left
|
|
8
|
+
class="px-2 py-1.5 border-r border-r-slate-300 last-of-type:border-r-0 text-left table-cell
|
|
9
|
+
{breakpoint === 'sm' ? 'sm:hidden' : ''}
|
|
10
|
+
{breakpoint === 'md' ? 'md:hidden' : ''}
|
|
11
|
+
{breakpoint === 'lg' ? 'lg:hidden' : ''}
|
|
12
|
+
"
|
|
8
13
|
style={width === undefined ? '' : `width:${width}px`}
|
|
9
14
|
>
|
|
10
15
|
<slot />
|
|
11
16
|
</th>
|
|
12
17
|
{:else}
|
|
13
18
|
<td
|
|
14
|
-
class="px-2 py-1.5 border-r border-r-slate-300 last-of-type:border-r-0
|
|
19
|
+
class="px-2 py-1.5 border-r border-r-slate-300 last-of-type:border-r-0 table-cell
|
|
20
|
+
{breakpoint === 'sm' ? 'sm:hidden' : ''}
|
|
21
|
+
{breakpoint === 'md' ? 'md:hidden' : ''}
|
|
22
|
+
{breakpoint === 'lg' ? 'lg:hidden' : ''}
|
|
23
|
+
"
|
|
15
24
|
style={width === undefined ? '' : `width:${width}px`}
|
|
16
25
|
>
|
|
17
26
|
<slot />
|
|
@@ -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;
|
|
@@ -13,7 +14,7 @@ const menuButtonStyle = `space-x-1 px-2 text-slate-600 hover:bg-slate-500/20
|
|
|
13
14
|
disabled:text-slate-300 disabled:hover:bg-transparent
|
|
14
15
|
`;
|
|
15
16
|
export let menuWidth = 200;
|
|
16
|
-
function openMenu() {
|
|
17
|
+
function openMenu(event) {
|
|
17
18
|
menuOpen = true;
|
|
18
19
|
}
|
|
19
20
|
function closeMenu() {
|
|
@@ -42,11 +43,13 @@ 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
|
|
49
|
-
class="w-6 h-6 text-white"
|
|
52
|
+
class="w-6 h-6 text-white pointer-events-none"
|
|
50
53
|
aria-hidden="true"
|
|
51
54
|
xmlns="http://www.w3.org/2000/svg"
|
|
52
55
|
width="24"
|
|
@@ -125,7 +128,7 @@ onMount(() => {
|
|
|
125
128
|
cancelButtonContent="Cancel"
|
|
126
129
|
>
|
|
127
130
|
<span slot="title"> Confirm Delete </span>
|
|
128
|
-
<div class="text-center">
|
|
129
|
-
<span> Are you sure you want to delete this record
|
|
131
|
+
<div class="text-center my-2">
|
|
132
|
+
<span class="text-lg"> Are you sure you want to delete this record ?</span>
|
|
130
133
|
</div>
|
|
131
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>
|
|
@@ -62,7 +62,7 @@ onMount(() => {
|
|
|
62
62
|
{!isValid
|
|
63
63
|
? 'border-pink-600 dark:border-pink-500 focus:ring-pink-600/20 dark:focus:ring-pink-600/40'
|
|
64
64
|
: 'dark:border-slate-600 border-slate-300 focus:ring-teal-500/20 dark:focus:ring-teal-500/30'}
|
|
65
|
-
{customCss}"
|
|
65
|
+
{customCss} pr-8"
|
|
66
66
|
{placeholder}
|
|
67
67
|
{id}
|
|
68
68
|
{name}
|
|
@@ -6,6 +6,8 @@ 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";
|
|
10
|
+
export let size = "lg";
|
|
9
11
|
export let input = void 0;
|
|
10
12
|
export let visible = true;
|
|
11
13
|
export let disabled = false;
|
|
@@ -51,8 +53,7 @@ onMount(() => {
|
|
|
51
53
|
{#if labelText}
|
|
52
54
|
<label
|
|
53
55
|
for={id}
|
|
54
|
-
class="mb-1
|
|
55
|
-
bind:this={inputContainer}
|
|
56
|
+
class="inline-block mb-1 text-slate-600 dark:text-neutral-200 font-thin text-lg"
|
|
56
57
|
>
|
|
57
58
|
{labelText}
|
|
58
59
|
{#if required}
|
|
@@ -60,7 +61,7 @@ onMount(() => {
|
|
|
60
61
|
{/if}
|
|
61
62
|
</label>
|
|
62
63
|
{/if}
|
|
63
|
-
<div class="relative">
|
|
64
|
+
<div class="relative" bind:this={inputContainer}>
|
|
64
65
|
<select
|
|
65
66
|
bind:this={select}
|
|
66
67
|
{disabled}
|
|
@@ -70,26 +71,46 @@ onMount(() => {
|
|
|
70
71
|
{placeholder}
|
|
71
72
|
{name}
|
|
72
73
|
on:change
|
|
73
|
-
class="border peer block w-full
|
|
74
|
+
class="border peer block w-full rounded-md shadow-sm bg-white text-neutral-900
|
|
74
75
|
focus:outline-none focus:ring
|
|
75
76
|
placeholder:text-sm placeholder:font-thin
|
|
76
77
|
dark:bg-slate-900 dark:text-neutral-100 appearance-none
|
|
78
|
+
{size === 'sm' ? 'py-1 px-2 text-sm' : ''}
|
|
79
|
+
{size === 'md' ? 'py-1.5 px-2 text-base' : ''}
|
|
80
|
+
{size === 'lg' ? 'py-2 px-2 text-lg' : ''}
|
|
81
|
+
pr-10
|
|
77
82
|
{!isValid
|
|
78
83
|
? '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
|
|
84
|
+
: 'dark:border-slate-600 border-slate-300'}
|
|
85
|
+
{isValid && theme === 'teal' ? ' focus:ring-teal-600/20 dark:focus:ring-teal-600/30' : ''}
|
|
86
|
+
disabled:bg-neutral-100 disabled:text-slate-500 dark:disabled:bg-neutral-800
|
|
80
87
|
"
|
|
81
88
|
>
|
|
89
|
+
|
|
82
90
|
<slot />
|
|
83
91
|
</select>
|
|
84
92
|
<span
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
93
|
+
class="absolute right-0 inset-y-0 w-8 flex text-slate-500 pointer-events-none
|
|
94
|
+
{theme === 'teal' ? 'peer-hover:text-teal-600 peer-focus:text-teal-600' : ''}
|
|
95
|
+
{theme === 'blue' ? 'peer-hover:text-blue-500 peer-focus:text-blue-500' : ''}
|
|
96
|
+
peer-disabled:text-slate-500
|
|
97
|
+
"
|
|
88
98
|
>
|
|
89
|
-
<
|
|
99
|
+
<svg
|
|
100
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
101
|
+
width="16"
|
|
102
|
+
height="16"
|
|
103
|
+
fill="currentColor"
|
|
104
|
+
class="w-4 h-4 block m-auto"
|
|
105
|
+
viewBox="0 0 16 16"
|
|
106
|
+
>
|
|
107
|
+
<path
|
|
108
|
+
fill-rule="evenodd"
|
|
109
|
+
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"
|
|
110
|
+
/>
|
|
111
|
+
</svg>
|
|
90
112
|
</span>
|
|
91
113
|
</div>
|
|
92
|
-
|
|
93
114
|
|
|
94
115
|
{#if validationText && !isValid}
|
|
95
116
|
<div class="text-sm text-pink-600 dark:text-pink-500 my-2">
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ColorThemes } from './types.js';
|
|
3
|
+
import type { Size } from './types.js';
|
|
2
4
|
declare const __propDef: {
|
|
3
5
|
props: {
|
|
4
6
|
labelText?: string | undefined;
|
|
@@ -8,6 +10,8 @@ declare const __propDef: {
|
|
|
8
10
|
name?: string | undefined;
|
|
9
11
|
placeholder?: string | undefined;
|
|
10
12
|
validationText?: string | undefined;
|
|
13
|
+
theme?: ColorThemes;
|
|
14
|
+
size?: Size;
|
|
11
15
|
input?: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | any | undefined;
|
|
12
16
|
visible?: boolean;
|
|
13
17
|
disabled?: boolean;
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
|
|
20
|
+
<span class="inline-block mb-1 text-slate-600 dark:text-neutral-200 font-thin text-lg">
|
|
21
|
+
{labelText}
|
|
22
|
+
</span>
|
|
23
|
+
{/if}
|
|
24
|
+
<input type="hidden" {name} {value} />
|
|
25
|
+
<div class="grid" style="grid-template-columns: repeat({options.length}, minmax(0, 1fr));">
|
|
26
|
+
{#each options as option}
|
|
27
|
+
<!-- svelte-ignore a11y-role-supports-aria-props -->
|
|
28
|
+
<button
|
|
29
|
+
{disabled}
|
|
30
|
+
type="button"
|
|
31
|
+
data-selected={option.key === value ? 'true' : ''}
|
|
32
|
+
on:click={() => handleValueChanged(option.key)}
|
|
33
|
+
class="first:rounded-l-lg last-of-type:rounded-r-lg
|
|
34
|
+
border px-2 py-1 transition-all ease-in-out duration-150 enabled:active:ring
|
|
35
|
+
{theme === 'teal'
|
|
36
|
+
? `border-teal-500 text-teal-500 dark:text-teal-100
|
|
37
|
+
enabled:hover:bg-teal-100 enabled:active:bg-teal-500 enabled:active:text-teal-50 ring-teal-500/40
|
|
38
|
+
data-[selected='true']:bg-teal-500 data-[selected='true']:text-teal-50
|
|
39
|
+
hover:data-[selected='true']:bg-teal-500 hover:data-[selected='true']:text-teal-50
|
|
40
|
+
enabled:dark:hover:bg-teal-100/20 enabled:dark:hover:data-[selected='true']:bg-teal-500`
|
|
41
|
+
: ''}
|
|
42
|
+
{theme === 'red'
|
|
43
|
+
? `border-red-500 text-red-500 dark:text-red-100
|
|
44
|
+
enabled:hover:bg-red-100 enabled:active:bg-red-500 enabled:active:text-red-50 ring-red-500/40
|
|
45
|
+
data-[selected='true']:bg-red-500 data-[selected='true']:text-red-50
|
|
46
|
+
hover:data-[selected='true']:bg-red-500 hover:data-[selected='true']:text-red-50
|
|
47
|
+
enabled:dark:hover:bg-red-100/20 enabled:dark:hover:data-[selected='true']:bg-red-500`
|
|
48
|
+
: ''}
|
|
49
|
+
{theme === 'indigo'
|
|
50
|
+
? `border-indigo-500 text-indigo-500 dark:text-indigo-100
|
|
51
|
+
enabled:hover:bg-indigo-100 enabled:active:bg-indigo-500 enabled:active:text-indigo-50 ring-indigo-500/40
|
|
52
|
+
data-[selected='true']:bg-indigo-500 data-[selected='true']:text-indigo-50
|
|
53
|
+
hover:data-[selected='true']:bg-indigo-500 hover:data-[selected='true']:text-indigo-50
|
|
54
|
+
enabled:dark:hover:bg-indigo-100/20 enabled:dark:hover:data-[selected='true']:bg-indigo-500`
|
|
55
|
+
: ''}
|
|
56
|
+
{theme === 'blue'
|
|
57
|
+
? `border-blue-500 text-blue-500 dark:text-blue-100
|
|
58
|
+
enabled:hover:bg-blue-100 enabled:active:bg-blue-500 enabled:active:text-blue-50 ring-blue-500/40
|
|
59
|
+
data-[selected='true']:bg-blue-500 data-[selected='true']:text-blue-50
|
|
60
|
+
hover:data-[selected='true']:bg-blue-500 hover:data-[selected='true']:text-blue-50
|
|
61
|
+
enabled:dark:hover:bg-blue-100/20 enabled:dark:hover:data-[selected='true']:bg-blue-500
|
|
62
|
+
`
|
|
63
|
+
: ''}
|
|
64
|
+
{theme === 'purple'
|
|
65
|
+
? `border-purple-500 text-purple-500 dark:text-purple-100
|
|
66
|
+
enabled:hover:bg-purple-100 enabled:active:bg-purple-500 enabled:active:text-purple-50 ring-purple-500/40
|
|
67
|
+
data-[selected='true']:bg-purple-500 data-[selected='true']:text-purple-50
|
|
68
|
+
hover:data-[selected='true']:bg-purple-500 hover:data-[selected='true']:text-purple-50
|
|
69
|
+
enabled:dark:hover:bg-purple-100/20 enabled:dark:hover:data-[selected='true']:bg-purple-500`
|
|
70
|
+
: ''}
|
|
71
|
+
|
|
72
|
+
disabled:border-slate-300 disabled:text-slate-300
|
|
73
|
+
disabled:data-[selected='true']:bg-slate-300 disabled:data-[selected='true']:text-slate-50
|
|
74
|
+
dark:disabled:data-[selected='true']:text-slate-950
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
"
|
|
78
|
+
>
|
|
79
|
+
{@html option.value}
|
|
80
|
+
</button>
|
|
81
|
+
{/each}
|
|
82
|
+
</div>
|
|
83
|
+
</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
|
-
<input type="checkbox" bind:checked class="hidden peer" {id} {name} />
|
|
9
|
+
<input type="checkbox" bind:checked class="hidden peer" {id} {name} on:change />
|
|
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,12 +1,16 @@
|
|
|
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: {
|
|
12
|
+
change: Event;
|
|
13
|
+
} & {
|
|
10
14
|
[evt: string]: CustomEvent<any>;
|
|
11
15
|
};
|
|
12
16
|
slots: {};
|
|
@@ -3,6 +3,10 @@ export type ColorThemes = 'red' | 'dark' | 'indigo' | 'teal' | 'blue' | 'purple'
|
|
|
3
3
|
export type PopupMenuItem = {
|
|
4
4
|
id: number;
|
|
5
5
|
content: string;
|
|
6
|
-
action: (param?: any | undefined) => {};
|
|
6
|
+
action: (param?: any | undefined) => {} | void;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
};
|
|
9
|
+
export type KeyValue<TKey, T> = {
|
|
10
|
+
key: TKey;
|
|
11
|
+
value: T;
|
|
12
|
+
};
|
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 };
|