y200subcontrols 0.0.3945 → 0.1.1
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/CodePresenter.svelte +8 -21
- package/dist/components/CodePresenter.svelte.d.ts +2 -1
- package/dist/components/DataTablePaginator.svelte +3 -4
- package/dist/components/DatePresenter.svelte +3 -1
- package/dist/components/DatePresenter.svelte.d.ts +2 -0
- package/dist/components/Divider.svelte +8 -0
- package/dist/components/Divider.svelte.d.ts +18 -0
- package/dist/components/DropDownButton.svelte +60 -46
- package/dist/components/DropDownButton.svelte.d.ts +1 -0
- package/dist/components/DropDownSearch.svelte +193 -0
- package/dist/components/DropDownSearch.svelte.d.ts +30 -0
- package/dist/components/ListBox.svelte +4 -1
- package/dist/components/ListBox.svelte.d.ts +3 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>export let code;
|
|
2
|
-
export let
|
|
2
|
+
export let readonly = false;
|
|
3
3
|
export let formatCode = void 0;
|
|
4
4
|
export const buttonStyle = `px-3 py-1 text-sm bg-slate-500 hover:bg-slate-600
|
|
5
5
|
first-of-type:rounded-bl-md
|
|
@@ -47,15 +47,14 @@ async function pasteCode(event) {
|
|
|
47
47
|
}
|
|
48
48
|
</script>
|
|
49
49
|
|
|
50
|
-
<div>
|
|
50
|
+
<div class="flex flex-col">
|
|
51
51
|
<h3 class="text-slate-700 px-2 text-xl">
|
|
52
|
-
<i class="bi bi-braces-asterisk"></i>
|
|
53
52
|
<span>
|
|
54
53
|
<slot name="title">Code Presenter</slot>
|
|
55
54
|
</span>
|
|
56
55
|
</h3>
|
|
57
56
|
|
|
58
|
-
<div class="relative">
|
|
57
|
+
<div class="relative flex-grow flex-shrink-0 grid">
|
|
59
58
|
<div class="absolute right-0 top-0 left-0 h-8 flex">
|
|
60
59
|
<div class="ml-auto flex">
|
|
61
60
|
<button type="button" class={buttonStyle} on:click={copyCode}>
|
|
@@ -98,7 +97,7 @@ async function pasteCode(event) {
|
|
|
98
97
|
|
|
99
98
|
<span class="pointer-events-none"> Copy </span>
|
|
100
99
|
</button>
|
|
101
|
-
{#if
|
|
100
|
+
{#if !readonly}
|
|
102
101
|
<button type="button" class={buttonStyle} on:click={pasteCode}>
|
|
103
102
|
<svg
|
|
104
103
|
class="w-5 h-5 pointer-events-none inline-block"
|
|
@@ -119,29 +118,17 @@ async function pasteCode(event) {
|
|
|
119
118
|
</svg>
|
|
120
119
|
|
|
121
120
|
<span> Paste </span>
|
|
122
|
-
</button>
|
|
123
|
-
<!-- {:else} -->
|
|
124
|
-
<!-- <button
|
|
125
|
-
disabled={isBusy}
|
|
126
|
-
type="button"
|
|
127
|
-
class="px-3 py-1 text-sm bg-slate-500 hover:bg-slate-600 rounded-tr-md
|
|
128
|
-
disabled:bg-slate-300
|
|
129
|
-
text-slate-50 space-x-2 transition-all ease-in-out duration-150 w-32"
|
|
130
|
-
on:click={refreshPayload}
|
|
131
|
-
>
|
|
132
|
-
<i class="bi bi-arrow-clockwise"></i>
|
|
133
|
-
|
|
134
|
-
<span> Refresh Json </span>
|
|
135
|
-
</button> -->
|
|
121
|
+
</button>
|
|
136
122
|
{/if}
|
|
123
|
+
<slot name="buttons"></slot>
|
|
137
124
|
</div>
|
|
138
125
|
</div>
|
|
139
126
|
<div class=" grid">
|
|
140
127
|
<textarea
|
|
141
128
|
bind:value={code}
|
|
142
|
-
readonly
|
|
129
|
+
{readonly}
|
|
143
130
|
{rows}
|
|
144
|
-
class=" p-2 py-4 md:px-4 pt-10 border border-slate-500 focus:ring focus:ring-blue-500/60 bg-stone-700 rounded-md text-yellow-
|
|
131
|
+
class=" p-2 py-4 md:px-4 pt-10 border border-slate-500 focus:ring focus:ring-blue-500/60 bg-stone-700 rounded-md text-yellow-100"
|
|
145
132
|
/>
|
|
146
133
|
</div>
|
|
147
134
|
</div>
|
|
@@ -2,7 +2,7 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
code: string;
|
|
5
|
-
|
|
5
|
+
readonly?: boolean;
|
|
6
6
|
formatCode?: (() => void) | undefined;
|
|
7
7
|
buttonStyle?: "px-3 py-1 text-sm bg-slate-500 hover:bg-slate-600\n first-of-type:rounded-bl-md \n text-slate-50 space-x-1 transition-all ease-in-out duration-150 w-32 \n border-r border-r-slate-600 last-of-type:border-r-0 last-of-type:rounded-br-md\n flex items-center justify-center space-x-1\n ";
|
|
8
8
|
minRows?: number;
|
|
@@ -12,6 +12,7 @@ declare const __propDef: {
|
|
|
12
12
|
};
|
|
13
13
|
slots: {
|
|
14
14
|
title: {};
|
|
15
|
+
buttons: {};
|
|
15
16
|
};
|
|
16
17
|
exports?: {} | undefined;
|
|
17
18
|
bindings?: string | undefined;
|
|
@@ -61,7 +61,7 @@ function handlePageChanged() {
|
|
|
61
61
|
|
|
62
62
|
<div class="ml-auto flex space-x-3">
|
|
63
63
|
<span class="inline-block my-auto text-sm text-slate-500"> Page </span>
|
|
64
|
-
<div class="w-
|
|
64
|
+
<div class="w-24">
|
|
65
65
|
<LabeledFormInput
|
|
66
66
|
numeric={true}
|
|
67
67
|
bind:value={_currentPage}
|
|
@@ -77,8 +77,8 @@ function handlePageChanged() {
|
|
|
77
77
|
on:click={() => handlePageIndexChanged(-1)}
|
|
78
78
|
type="button"
|
|
79
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
|
-
|
|
81
|
-
|
|
80
|
+
outline-none focus:outline-none
|
|
81
|
+
transition-all ease-in-out duration-300"
|
|
82
82
|
>
|
|
83
83
|
<svg
|
|
84
84
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -93,7 +93,6 @@ function handlePageChanged() {
|
|
|
93
93
|
/>
|
|
94
94
|
</svg>
|
|
95
95
|
</button>
|
|
96
|
-
|
|
97
96
|
<button
|
|
98
97
|
on:click={() => handlePageIndexChanged(1)}
|
|
99
98
|
type="button"
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script>import { formatDateTime } from "../date-utils.js";
|
|
2
2
|
export let date;
|
|
3
3
|
export let showTimeStamp = true;
|
|
4
|
+
export let timeStyle = "short";
|
|
5
|
+
export let dateStyle = "short";
|
|
4
6
|
let dateFormatted = "";
|
|
5
7
|
$: {
|
|
6
8
|
if (typeof date === "string") {
|
|
7
9
|
date = new Date(date);
|
|
8
10
|
}
|
|
9
|
-
dateFormatted = formatDateTime(date, showTimeStamp);
|
|
11
|
+
dateFormatted = formatDateTime(date, showTimeStamp, timeStyle, dateStyle);
|
|
10
12
|
}
|
|
11
13
|
</script>
|
|
12
14
|
|
|
@@ -3,6 +3,8 @@ declare const __propDef: {
|
|
|
3
3
|
props: {
|
|
4
4
|
date: Date | string;
|
|
5
5
|
showTimeStamp?: boolean;
|
|
6
|
+
timeStyle?: "full" | "long" | "medium" | "short" | undefined;
|
|
7
|
+
dateStyle?: "full" | "long" | "medium" | "short" | undefined;
|
|
6
8
|
};
|
|
7
9
|
events: {
|
|
8
10
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
direction?: "horizontal" | "vertical";
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
exports?: {} | undefined;
|
|
11
|
+
bindings?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
export type DividerProps = typeof __propDef.props;
|
|
14
|
+
export type DividerEvents = typeof __propDef.events;
|
|
15
|
+
export type DividerSlots = typeof __propDef.slots;
|
|
16
|
+
export default class Divider extends SvelteComponent<DividerProps, DividerEvents, DividerSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -4,6 +4,7 @@ export let buttonStyle = "teal";
|
|
|
4
4
|
export let buttonSize = "md";
|
|
5
5
|
export let id = void 0;
|
|
6
6
|
export let disabled = false;
|
|
7
|
+
export let labelText = "";
|
|
7
8
|
let isMenuOpen = false;
|
|
8
9
|
let menuItemContainer;
|
|
9
10
|
export const dataPrefix = 'data-menu-item="true"';
|
|
@@ -29,54 +30,67 @@ onMount(() => {
|
|
|
29
30
|
});
|
|
30
31
|
</script>
|
|
31
32
|
|
|
32
|
-
<div
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
33
|
+
<div>
|
|
34
|
+
{#if labelText}
|
|
35
|
+
<label
|
|
36
|
+
for={id}
|
|
37
|
+
class="inline-block mb-1 text-slate-600 dark:text-neutral-200 font-thin text-lg"
|
|
38
|
+
>
|
|
39
|
+
{labelText}
|
|
40
|
+
</label>
|
|
41
|
+
{/if}
|
|
42
|
+
|
|
43
|
+
<div class="relative grid">
|
|
44
|
+
<Button type="button" {disabled} {buttonStyle} {id} {buttonSize} on:click={openMenu}>
|
|
45
|
+
<div class="w-full flex">
|
|
46
|
+
<div class="flex-grow">
|
|
47
|
+
<slot name="title" />
|
|
48
|
+
</div>
|
|
49
|
+
<div class="w-5 flex-shrink-0 ml-auto my-auto">
|
|
50
|
+
<svg
|
|
51
|
+
class="w-5 h-5 block rotate-0 {isMenuOpen
|
|
52
|
+
? 'rotate-180'
|
|
53
|
+
: ''} transition-all duration-300"
|
|
54
|
+
aria-hidden="true"
|
|
55
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
56
|
+
width="24"
|
|
57
|
+
height="24"
|
|
58
|
+
fill="none"
|
|
59
|
+
viewBox="0 0 24 24"
|
|
60
|
+
>
|
|
61
|
+
<path
|
|
62
|
+
stroke="currentColor"
|
|
63
|
+
stroke-linecap="round"
|
|
64
|
+
stroke-linejoin="round"
|
|
65
|
+
stroke-width="2"
|
|
66
|
+
d="m19 9-7 7-7-7"
|
|
67
|
+
/>
|
|
68
|
+
</svg>
|
|
69
|
+
</div>
|
|
56
70
|
</div>
|
|
57
|
-
</
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/>
|
|
71
|
+
</Button>
|
|
72
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
73
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
74
|
+
<div
|
|
75
|
+
class="fixed {isMenuOpen ? 'block' : 'hidden'} inset-0 bg-black/10 z-[1000]"
|
|
76
|
+
on:click={closeMenu}
|
|
77
|
+
/>
|
|
65
78
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
<div
|
|
80
|
+
class="absolute right-0 left-0 top-[100%]
|
|
81
|
+
bg-white border border-slate-300 shadow-md rounded z-[1001]
|
|
82
|
+
transition-all ease-linear duration-300
|
|
83
|
+
grid
|
|
84
|
+
"
|
|
85
|
+
style="visibility: {isMenuOpen ? 'visible' : 'hidden'};grid-template-rows:{isMenuOpen
|
|
86
|
+
? '1fr'
|
|
87
|
+
: '0fr'}; top:calc(100% + 5px)"
|
|
88
|
+
>
|
|
89
|
+
<div class="overflow-hidden">
|
|
90
|
+
<ul class="py-2" bind:this={menuItemContainer}>
|
|
91
|
+
<slot />
|
|
92
|
+
</ul>
|
|
93
|
+
</div>
|
|
80
94
|
</div>
|
|
81
95
|
</div>
|
|
82
96
|
</div>
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
<script>import { createEventDispatcher, onMount } from "svelte";
|
|
2
|
+
import LabeledFormInput from "./LabeledFormInput.svelte";
|
|
3
|
+
export let id = void 0;
|
|
4
|
+
export let disabled = false;
|
|
5
|
+
export let labelText = "";
|
|
6
|
+
export let menuItems;
|
|
7
|
+
export let placeholder = "Search...";
|
|
8
|
+
export let size = "md";
|
|
9
|
+
let menuItemContainer;
|
|
10
|
+
let selectedItems = [];
|
|
11
|
+
let filter = "";
|
|
12
|
+
let menuItemsFiltered = [];
|
|
13
|
+
const dispatch = createEventDispatcher();
|
|
14
|
+
let isMenuOpen = false;
|
|
15
|
+
function updateSelection() {
|
|
16
|
+
selectedItems = menuItems.filter((item) => item.isSelected);
|
|
17
|
+
dispatch("selectionchanged", selectedItems);
|
|
18
|
+
}
|
|
19
|
+
function openMenu() {
|
|
20
|
+
isMenuOpen = true;
|
|
21
|
+
}
|
|
22
|
+
function closeMenu() {
|
|
23
|
+
isMenuOpen = false;
|
|
24
|
+
}
|
|
25
|
+
function toggleSelect(menuItem) {
|
|
26
|
+
menuItem.isSelected = !menuItem.isSelected;
|
|
27
|
+
filterItems();
|
|
28
|
+
updateSelection();
|
|
29
|
+
}
|
|
30
|
+
function filterItems() {
|
|
31
|
+
menuItemsFiltered = menuItems.filter(
|
|
32
|
+
(item) => item.label.toLowerCase().includes(filter.toLowerCase())
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
onMount(() => {
|
|
36
|
+
if (!id) {
|
|
37
|
+
let r = (Math.random() + 1).toString(36).substring(2);
|
|
38
|
+
id = `select${r}`;
|
|
39
|
+
}
|
|
40
|
+
filterItems();
|
|
41
|
+
updateSelection();
|
|
42
|
+
});
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<div>
|
|
46
|
+
{#if labelText}
|
|
47
|
+
<label
|
|
48
|
+
for={id}
|
|
49
|
+
class="inline-block mb-1 text-slate-600 dark:text-neutral-200 font-thin text-lg"
|
|
50
|
+
>
|
|
51
|
+
{labelText}
|
|
52
|
+
</label>
|
|
53
|
+
{/if}
|
|
54
|
+
|
|
55
|
+
<div class="relative">
|
|
56
|
+
<div
|
|
57
|
+
class="border peer block w-full rounded-md shadow-sm bg-white text-neutral-900
|
|
58
|
+
dark:bg-slate-900 dark:text-neutral-100 appearance-none
|
|
59
|
+
{size === 'sm' ? 'py-1 px-2 text-sm' : ''}
|
|
60
|
+
{size === 'md' ? 'py-1.5 px-2 text-base' : ''}
|
|
61
|
+
{size === 'lg' ? 'py-2 px-2 text-lg' : ''}
|
|
62
|
+
{isMenuOpen ? 'ring' : ''} ring-teal-500/20
|
|
63
|
+
"
|
|
64
|
+
>
|
|
65
|
+
<label class="flex cursor-pointer" for={id}>
|
|
66
|
+
{#if selectedItems.length > 0}
|
|
67
|
+
{#each selectedItems as item (item.key)}
|
|
68
|
+
<button
|
|
69
|
+
type="button"
|
|
70
|
+
class="bg-teal-500 border space-x-[1px] flex hover:bg-teal-600
|
|
71
|
+
text-teal-50 text-xs pl-2 pr-1 py-1 rounded-xl mr-1"
|
|
72
|
+
on:click={(event) => {
|
|
73
|
+
event.stopPropagation();
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
toggleSelect(item);
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
<span class="my-auto">
|
|
79
|
+
{@html item.label}
|
|
80
|
+
</span>
|
|
81
|
+
<svg
|
|
82
|
+
class="w-4 h-4 my-auto"
|
|
83
|
+
aria-hidden="true"
|
|
84
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
85
|
+
width="24"
|
|
86
|
+
height="24"
|
|
87
|
+
fill="none"
|
|
88
|
+
viewBox="0 0 24 24"
|
|
89
|
+
>
|
|
90
|
+
<path
|
|
91
|
+
stroke="currentColor"
|
|
92
|
+
stroke-linecap="round"
|
|
93
|
+
stroke-linejoin="round"
|
|
94
|
+
stroke-width="2"
|
|
95
|
+
d="m15 9-6 6m0-6 6 6m6-3a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
|
|
96
|
+
/>
|
|
97
|
+
</svg>
|
|
98
|
+
</button>
|
|
99
|
+
{/each}
|
|
100
|
+
{:else}
|
|
101
|
+
<span class="text-slate-500">{placeholder}</span>
|
|
102
|
+
{/if}
|
|
103
|
+
|
|
104
|
+
<button
|
|
105
|
+
{id}
|
|
106
|
+
{disabled}
|
|
107
|
+
type="button"
|
|
108
|
+
class="w-5 flex-shrink-0 ml-auto my-auto text-teal-500 disabled:text-slate-300"
|
|
109
|
+
on:click={openMenu}
|
|
110
|
+
>
|
|
111
|
+
<svg
|
|
112
|
+
class="w-5 h-5 block rotate-0 {isMenuOpen
|
|
113
|
+
? 'rotate-180 '
|
|
114
|
+
: ''} transition-all duration-300"
|
|
115
|
+
aria-hidden="true"
|
|
116
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
117
|
+
width="24"
|
|
118
|
+
height="24"
|
|
119
|
+
fill="none"
|
|
120
|
+
viewBox="0 0 24 24"
|
|
121
|
+
>
|
|
122
|
+
<path
|
|
123
|
+
stroke="currentColor"
|
|
124
|
+
stroke-linecap="round"
|
|
125
|
+
stroke-linejoin="round"
|
|
126
|
+
stroke-width="2"
|
|
127
|
+
d="m19 9-7 7-7-7"
|
|
128
|
+
/>
|
|
129
|
+
</svg>
|
|
130
|
+
</button>
|
|
131
|
+
</label>
|
|
132
|
+
</div>
|
|
133
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
134
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
135
|
+
<div
|
|
136
|
+
class="fixed {isMenuOpen ? 'block' : 'hidden'} inset-0 bg-black/10 z-[1000]"
|
|
137
|
+
on:click={closeMenu}
|
|
138
|
+
/>
|
|
139
|
+
<div
|
|
140
|
+
class="absolute right-0 left-0 top-[100%]
|
|
141
|
+
bg-white border border-slate-300 shadow-md rounded z-[1001]
|
|
142
|
+
transition-all ease-linear duration-300
|
|
143
|
+
grid
|
|
144
|
+
"
|
|
145
|
+
style="visibility: {isMenuOpen ? 'visible' : 'hidden'};grid-template-rows:{isMenuOpen
|
|
146
|
+
? '1fr'
|
|
147
|
+
: '0fr'}; top:calc(100% + 5px)"
|
|
148
|
+
>
|
|
149
|
+
<div class="overflow-hidden">
|
|
150
|
+
<div class="px-2 mt-2">
|
|
151
|
+
<LabeledFormInput on:change={filterItems} bind:value={filter} {placeholder} size="sm" />
|
|
152
|
+
</div>
|
|
153
|
+
<ul class="py-1" bind:this={menuItemContainer}>
|
|
154
|
+
{#each menuItemsFiltered as menuItem (menuItem.key)}
|
|
155
|
+
<li>
|
|
156
|
+
<button
|
|
157
|
+
type="button"
|
|
158
|
+
class="px-2 text-slate-600 hover:bg-slate-500/20
|
|
159
|
+
block w-full py-1 text-left active:text-slate-50 active:bg-slate-500
|
|
160
|
+
transition-all ease-in-out duration-300 focus:outline-none outline-none
|
|
161
|
+
disabled:text-slate-300 disabled:hover:bg-transparent"
|
|
162
|
+
on:click={() => toggleSelect(menuItem)}
|
|
163
|
+
>
|
|
164
|
+
<svg
|
|
165
|
+
class="w-4 h-4 text-slate-500 my-auto inline-block
|
|
166
|
+
{menuItem.isSelected ? 'visible' : 'invisible'}"
|
|
167
|
+
aria-hidden="true"
|
|
168
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
169
|
+
width="24"
|
|
170
|
+
height="24"
|
|
171
|
+
fill="none"
|
|
172
|
+
viewBox="0 0 24 24"
|
|
173
|
+
>
|
|
174
|
+
<path
|
|
175
|
+
stroke="currentColor"
|
|
176
|
+
stroke-linecap="round"
|
|
177
|
+
stroke-linejoin="round"
|
|
178
|
+
stroke-width="2"
|
|
179
|
+
d="M5 11.917 9.724 16.5 19 7.5"
|
|
180
|
+
/>
|
|
181
|
+
</svg>
|
|
182
|
+
|
|
183
|
+
<span class="text-sm">
|
|
184
|
+
{@html menuItem.label}
|
|
185
|
+
</span>
|
|
186
|
+
</button>
|
|
187
|
+
</li>
|
|
188
|
+
{/each}
|
|
189
|
+
</ul>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Size } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id?: string | undefined;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
labelText?: string;
|
|
8
|
+
menuItems: {
|
|
9
|
+
key: string | number;
|
|
10
|
+
label: string;
|
|
11
|
+
isSelected: boolean;
|
|
12
|
+
}[];
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
size?: Size;
|
|
15
|
+
};
|
|
16
|
+
events: {
|
|
17
|
+
selectionchanged: CustomEvent<any>;
|
|
18
|
+
} & {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
exports?: {} | undefined;
|
|
23
|
+
bindings?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
export type DropDownSearchProps = typeof __propDef.props;
|
|
26
|
+
export type DropDownSearchEvents = typeof __propDef.events;
|
|
27
|
+
export type DropDownSearchSlots = typeof __propDef.slots;
|
|
28
|
+
export default class DropDownSearch extends SvelteComponent<DropDownSearchProps, DropDownSearchEvents, DropDownSearchSlots> {
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export let value = "";
|
|
3
3
|
export let name = void 0;
|
|
4
4
|
export let searchQuery = "";
|
|
5
|
+
export let placeholder = "Search...";
|
|
5
6
|
const dispatch = createEventDispatcher();
|
|
6
7
|
let list;
|
|
7
8
|
let select;
|
|
@@ -44,6 +45,7 @@ onMount(() => {
|
|
|
44
45
|
</script>
|
|
45
46
|
|
|
46
47
|
<div class="w-full h-full py-2 flex flex-col">
|
|
48
|
+
<slot name="header" />
|
|
47
49
|
<select
|
|
48
50
|
bind:this={select}
|
|
49
51
|
class="hidden"
|
|
@@ -66,7 +68,7 @@ onMount(() => {
|
|
|
66
68
|
dark:bg-slate-900
|
|
67
69
|
dark:border-slate-600 border-slate-300 focus:ring-teal-500/20 dark:focus:ring-teal-500/30
|
|
68
70
|
"
|
|
69
|
-
placeholder=
|
|
71
|
+
placeholder={placeholder}
|
|
70
72
|
bind:value={searchQuery}
|
|
71
73
|
on:keydown={handleKeyDown}
|
|
72
74
|
/>
|
|
@@ -132,4 +134,5 @@ onMount(() => {
|
|
|
132
134
|
</li>
|
|
133
135
|
{/each}
|
|
134
136
|
</ul>
|
|
137
|
+
<slot name="footer" />
|
|
135
138
|
</div>
|
|
@@ -4,6 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
value?: string;
|
|
5
5
|
name?: string | undefined;
|
|
6
6
|
searchQuery?: string;
|
|
7
|
+
placeholder?: string;
|
|
7
8
|
};
|
|
8
9
|
events: {
|
|
9
10
|
change: CustomEvent<any>;
|
|
@@ -11,7 +12,9 @@ declare const __propDef: {
|
|
|
11
12
|
[evt: string]: CustomEvent<any>;
|
|
12
13
|
};
|
|
13
14
|
slots: {
|
|
15
|
+
header: {};
|
|
14
16
|
default: {};
|
|
17
|
+
footer: {};
|
|
15
18
|
};
|
|
16
19
|
exports?: {} | undefined;
|
|
17
20
|
bindings?: string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -36,4 +36,7 @@ import ListBox from "./components/ListBox.svelte";
|
|
|
36
36
|
import HeadlessMenu from "./components/HeadlessMenu.svelte";
|
|
37
37
|
import CodePresenter from "./components/CodePresenter.svelte";
|
|
38
38
|
import Drawer from "./components/Drawer.svelte";
|
|
39
|
-
|
|
39
|
+
import Divider from "./components/Divider.svelte";
|
|
40
|
+
import ConfirmModalDialog from "./components/ConfirmModalDialog.svelte";
|
|
41
|
+
import DropDownSearch from "./components/DropDownSearch.svelte";
|
|
42
|
+
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, TabControl, TabItem, Pill, PillBoolean, DropDownButton, DropDownSearch, Table, ListBox, HeadlessMenu, Drawer, CodePresenter, Divider, ConfirmModalDialog, formatDateTime, getMonthLimits, formatNumber, };
|
package/dist/index.js
CHANGED
|
@@ -37,4 +37,7 @@ import ListBox from "./components/ListBox.svelte";
|
|
|
37
37
|
import HeadlessMenu from "./components/HeadlessMenu.svelte";
|
|
38
38
|
import CodePresenter from "./components/CodePresenter.svelte";
|
|
39
39
|
import Drawer from "./components/Drawer.svelte";
|
|
40
|
-
|
|
40
|
+
import Divider from "./components/Divider.svelte";
|
|
41
|
+
import ConfirmModalDialog from "./components/ConfirmModalDialog.svelte";
|
|
42
|
+
import DropDownSearch from "./components/DropDownSearch.svelte";
|
|
43
|
+
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, TabControl, TabItem, Pill, PillBoolean, DropDownButton, DropDownSearch, Table, ListBox, HeadlessMenu, Drawer, CodePresenter, Divider, ConfirmModalDialog, formatDateTime, getMonthLimits, formatNumber, };
|