y200subcontrols 0.0.335 → 0.0.338
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/DataTable.svelte +66 -11
- package/dist/components/DataTableMenuButton.svelte +4 -1
- package/dist/components/DataTableMenuButton.svelte.d.ts +1 -0
- package/dist/components/DataTablePaginator.svelte +93 -0
- package/dist/components/DataTablePaginator.svelte.d.ts +22 -0
- package/dist/components/LabeledDatePicker.svelte +0 -1
- package/dist/components/SegmentedControl.svelte +32 -7
- package/dist/components/SegmentedControl.svelte.d.ts +2 -1
- 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/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
|
@@ -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}
|
|
@@ -94,19 +141,27 @@ function closeAdvancedSearch() {
|
|
|
94
141
|
disabled={isBusy}
|
|
95
142
|
on:click={toggleAdvancedSearch}
|
|
96
143
|
type="button"
|
|
97
|
-
class="mx-1 w-
|
|
144
|
+
class="mx-1 w-10 h-10 bg-white border border-slate-300
|
|
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
148
|
transition-all ease-in-out duration-150"
|
|
102
149
|
>
|
|
103
|
-
<
|
|
104
|
-
|
|
150
|
+
<svg
|
|
151
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
152
|
+
|
|
153
|
+
fill="currentColor"
|
|
154
|
+
class="w-4 h-4 pointer-events-none inline-block {isAdvancedSearchOpen
|
|
105
155
|
? 'rotate-0'
|
|
106
156
|
: 'rotate-180'}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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,7 +43,9 @@ 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
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import LabeledFormInput from "./LabeledFormInput.svelte";
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
export let recordsPerPage;
|
|
5
|
+
export let currentPage;
|
|
6
|
+
export let totalRecords;
|
|
7
|
+
let pagesCount = 0;
|
|
8
|
+
let _currentPage = 0;
|
|
9
|
+
$: {
|
|
10
|
+
pagesCount = totalRecords / recordsPerPage;
|
|
11
|
+
_currentPage = currentPage + 1;
|
|
12
|
+
}
|
|
13
|
+
function handlePageIndexChanged(factor) {
|
|
14
|
+
currentPage += factor;
|
|
15
|
+
handlePageChanged();
|
|
16
|
+
}
|
|
17
|
+
function handleCurrentPageChanged(event) {
|
|
18
|
+
currentPage = _currentPage - 1;
|
|
19
|
+
handlePageChanged();
|
|
20
|
+
}
|
|
21
|
+
function handlePageChanged() {
|
|
22
|
+
if (currentPage < 0) {
|
|
23
|
+
currentPage = 0;
|
|
24
|
+
}
|
|
25
|
+
if (currentPage > pagesCount - 1) {
|
|
26
|
+
currentPage = pagesCount - 1;
|
|
27
|
+
}
|
|
28
|
+
dispatch("pagechanged", currentPage);
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<div class="border border-slate-300 rounded flex p-2">
|
|
33
|
+
<div></div>
|
|
34
|
+
|
|
35
|
+
<div class="ml-auto flex space-x-3">
|
|
36
|
+
<span class="inline-block my-auto text-sm text-slate-500">
|
|
37
|
+
Page
|
|
38
|
+
</span>
|
|
39
|
+
<div class="w-14">
|
|
40
|
+
<LabeledFormInput
|
|
41
|
+
numeric={true}
|
|
42
|
+
bind:value={_currentPage}
|
|
43
|
+
on:change={handleCurrentPageChanged}
|
|
44
|
+
size="md"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
<span class="inline-block my-auto text-sm text-slate-500 mr-10">
|
|
48
|
+
of {pagesCount} ( {totalRecords} records )
|
|
49
|
+
</span>
|
|
50
|
+
|
|
51
|
+
<button
|
|
52
|
+
on:click={() => handlePageIndexChanged(-1)}
|
|
53
|
+
type="button"
|
|
54
|
+
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
|
|
55
|
+
outline-none focus:outline-none
|
|
56
|
+
transition-all ease-in-out duration-300"
|
|
57
|
+
>
|
|
58
|
+
<svg
|
|
59
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
60
|
+
width="16"
|
|
61
|
+
height="16"
|
|
62
|
+
fill="currentColor"
|
|
63
|
+
viewBox="0 0 16 16"
|
|
64
|
+
>
|
|
65
|
+
<path
|
|
66
|
+
fill-rule="evenodd"
|
|
67
|
+
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"
|
|
68
|
+
/>
|
|
69
|
+
</svg>
|
|
70
|
+
</button>
|
|
71
|
+
|
|
72
|
+
<button
|
|
73
|
+
on:click={() => handlePageIndexChanged(1)}
|
|
74
|
+
type="button"
|
|
75
|
+
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
|
|
76
|
+
outline-none focus:outline-none
|
|
77
|
+
transition-all ease-in-out duration-300"
|
|
78
|
+
>
|
|
79
|
+
<svg
|
|
80
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
81
|
+
width="16"
|
|
82
|
+
height="16"
|
|
83
|
+
fill="currentColor"
|
|
84
|
+
viewBox="0 0 16 16"
|
|
85
|
+
>
|
|
86
|
+
<path
|
|
87
|
+
fill-rule="evenodd"
|
|
88
|
+
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"
|
|
89
|
+
/>
|
|
90
|
+
</svg>
|
|
91
|
+
</button>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
recordsPerPage: number;
|
|
5
|
+
currentPage: number;
|
|
6
|
+
totalRecords: number;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
pagechanged: CustomEvent<any>;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
exports?: {} | undefined;
|
|
15
|
+
bindings?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type DataTablePaginatorProps = typeof __propDef.props;
|
|
18
|
+
export type DataTablePaginatorEvents = typeof __propDef.events;
|
|
19
|
+
export type DataTablePaginatorSlots = typeof __propDef.slots;
|
|
20
|
+
export default class DataTablePaginator extends SvelteComponent<DataTablePaginatorProps, DataTablePaginatorEvents, DataTablePaginatorSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -5,6 +5,7 @@ export let options = [];
|
|
|
5
5
|
export let labelText = void 0;
|
|
6
6
|
export let name = void 0;
|
|
7
7
|
export let disabled = false;
|
|
8
|
+
export let theme = "teal";
|
|
8
9
|
function handleValueChanged(newValue) {
|
|
9
10
|
value = newValue;
|
|
10
11
|
dispacth("change", {
|
|
@@ -29,18 +30,42 @@ function handleValueChanged(newValue) {
|
|
|
29
30
|
data-selected={option.key === value ? 'true' : ''}
|
|
30
31
|
on:click={() => handleValueChanged(option.key)}
|
|
31
32
|
class="first:rounded-l-lg last-of-type:rounded-r-lg
|
|
32
|
-
border
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
enabled:hover:bg-
|
|
36
|
-
|
|
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
|
|
37
51
|
data-[selected='true']:bg-blue-500 data-[selected='true']:text-blue-50
|
|
38
52
|
hover:data-[selected='true']:bg-blue-500 hover:data-[selected='true']:text-blue-50
|
|
39
|
-
|
|
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
|
+
|
|
40
64
|
disabled:border-slate-300 disabled:text-slate-300
|
|
41
65
|
disabled:data-[selected='true']:bg-slate-300 disabled:data-[selected='true']:text-slate-50
|
|
42
66
|
dark:disabled:data-[selected='true']:text-slate-950
|
|
43
|
-
|
|
67
|
+
|
|
68
|
+
|
|
44
69
|
"
|
|
45
70
|
>
|
|
46
71
|
{@html option.value}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { KeyValue } from './types.js';
|
|
2
|
+
import type { ColorThemes, KeyValue } from './types.js';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
value?: string | number | boolean | undefined;
|
|
@@ -7,6 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
labelText?: string | undefined;
|
|
8
8
|
name?: string | undefined;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
+
theme?: ColorThemes;
|
|
10
11
|
};
|
|
11
12
|
events: {
|
|
12
13
|
change: CustomEvent<any>;
|
|
@@ -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
|
@@ -21,4 +21,7 @@ import LabeledTextArea from "./components/LabeledTextArea.svelte";
|
|
|
21
21
|
import Breadcrumb from "./components/Breadcrumb.svelte";
|
|
22
22
|
import SegmentedControl from "./components/SegmentedControl.svelte";
|
|
23
23
|
import HyperlinkButton from "./components/HyperlinkButton.svelte";
|
|
24
|
-
|
|
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
|
@@ -22,4 +22,7 @@ import LabeledTextArea from "./components/LabeledTextArea.svelte";
|
|
|
22
22
|
import Breadcrumb from "./components/Breadcrumb.svelte";
|
|
23
23
|
import SegmentedControl from "./components/SegmentedControl.svelte";
|
|
24
24
|
import HyperlinkButton from "./components/HyperlinkButton.svelte";
|
|
25
|
-
|
|
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 };
|