svelte-5-select 1.0.0-beta.0
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/LICENSE +9 -0
- package/README.md +320 -0
- package/dist/ChevronIcon.svelte +22 -0
- package/dist/ChevronIcon.svelte.d.ts +26 -0
- package/dist/ClearIcon.svelte +22 -0
- package/dist/ClearIcon.svelte.d.ts +26 -0
- package/dist/LoadingIcon.svelte +33 -0
- package/dist/LoadingIcon.svelte.d.ts +26 -0
- package/dist/Select.svelte +1461 -0
- package/dist/Select.svelte.d.ts +4 -0
- package/dist/aria-handlers.svelte.d.ts +19 -0
- package/dist/aria-handlers.svelte.js +36 -0
- package/dist/filter.d.ts +2 -0
- package/dist/filter.js +30 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10 -0
- package/dist/keyboard-navigation.svelte.d.ts +12 -0
- package/dist/keyboard-navigation.svelte.js +124 -0
- package/dist/styles/default.css +387 -0
- package/dist/tailwind.css +130 -0
- package/dist/types.d.ts +134 -0
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +10 -0
- package/dist/utils.js +28 -0
- package/package.json +86 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Copyright (c) 2019 Robert Balfre
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted by the authors of this software, to any person, to use the software for any purpose, free of charge, including the rights to run, read, copy, change, distribute and sell it, and including usage rights to any patents the authors may hold on it, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
This license, or a link to its text, must be included with all copies of the software and any derivative works.
|
|
6
|
+
|
|
7
|
+
Any modification to the software submitted to the authors may be incorporated into the software under the terms of this license.
|
|
8
|
+
|
|
9
|
+
The software is provided "as is", without warranty of any kind, including but not limited to the warranties of title, fitness, merchantability and non-infringement. The authors have no obligation to provide support or updates for the software, and may not be held liable for any damages, claims or other liability arising from its use.
|
package/README.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
<div style="text-align: center;">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/rob-balfre/svelte-select/master/svelte-select.png" alt="Svelte Select" width="150" />
|
|
3
|
+
<h1>Svelte 5 Select</h1>
|
|
4
|
+
</div>
|
|
5
|
+
<div style="text-align: center;">
|
|
6
|
+
<a href="https://npmjs.org/package/svelte-5-select">
|
|
7
|
+
<img src="https://badgen.now.sh/npm/v/svelte-5-select" alt="version" />
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://npmjs.org/package/svelte-5-select">
|
|
10
|
+
<img src="https://badgen.now.sh/npm/dm/svelte-5-select" alt="downloads" />
|
|
11
|
+
</a>
|
|
12
|
+
</div>
|
|
13
|
+
<div style="text-align: center;">A select/autocomplete/typeahead Svelte 5 component.</div>
|
|
14
|
+
|
|
15
|
+
## Demos
|
|
16
|
+
|
|
17
|
+
[💥 Examples of every prop, event, slot and more 💥](https://svelte-5-select-examples.vercel.app)
|
|
18
|
+
|
|
19
|
+
[✨ REPL: Simple ✨] Doesn't exist yet
|
|
20
|
+
|
|
21
|
+
[💃 REPL: Show me everything 🕺]Doesn't exist yet
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install svelte-5-select
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Svelte 5
|
|
30
|
+
This work is forked from <a href="https://github.com/kodaicoder/svelte-5-select">kodaicoder/svelte-5-select</a> which itself was forked from <a href="https://github.com/rob-balfre/svelte-select">rob-balfre/svelte-select</a>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## Rollup and low/no-build setups
|
|
34
|
+
List position and floating is powered by `floating-ui`, see their [package-entry-points](https://github.com/floating-ui/floating-ui#package-entry-points) docs if you encounter build errors.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Props
|
|
38
|
+
|
|
39
|
+
| Prop | Type | Default | Description |
|
|
40
|
+
| ---------------------- | --------- | --------------- | -------------------------------------------------------------- |
|
|
41
|
+
| items | `any[]` | `[]` | Array of items available to display / filter |
|
|
42
|
+
| value | `any` | `null` | Selected value(s) |
|
|
43
|
+
| justValue | `any` | `null` | **READ-ONLY** Selected value(s) excluding container object |
|
|
44
|
+
| itemId | `string` | `value` | Override default identifier |
|
|
45
|
+
| label | `string` | `label` | Override default label |
|
|
46
|
+
| id | `string` | `null` | id attr for input field |
|
|
47
|
+
| filterText | `string` | `''` | Text to filter `items` by |
|
|
48
|
+
| placeholder | `string` | `Please select` | Placeholder text |
|
|
49
|
+
| hideEmptyState | `boolean` | `false` | When no items hide list |
|
|
50
|
+
| listOpen | `boolean` | `false` | Open/close list |
|
|
51
|
+
| class | `string` | `''` | container classes |
|
|
52
|
+
| containerStyles | `string` | `''` | Add inline styles to container |
|
|
53
|
+
| clearable | `boolean` | `true` | Enable clearing of value(s) |
|
|
54
|
+
| disabled | `boolean` | `false` | Disable select |
|
|
55
|
+
| multiple | `boolean` | `false` | Enable multi-select |
|
|
56
|
+
| searchable | `boolean` | `true` | If `false` search/filtering is disabled |
|
|
57
|
+
| groupHeaderSelectable | `boolean` | `false` | Enable selectable group headers |
|
|
58
|
+
| focused | `boolean` | `false` | Controls input focus |
|
|
59
|
+
| listAutoWidth | `boolean` | `true` | If `false` will ignore width of select |
|
|
60
|
+
| showChevron | `boolean` | `false` | Show chevron |
|
|
61
|
+
| inputAttributes | `object` | `{}` | Pass in HTML attributes to Select's input |
|
|
62
|
+
| placeholderAlwaysShow | `boolean` | `false` | When `multiple` placeholder text will always show |
|
|
63
|
+
| loading | `boolean` | `false` | Shows `loading-icon`. `loadOptions` will override this |
|
|
64
|
+
| listOffset | `number` | `5` | `px` space between select and list |
|
|
65
|
+
| debounceWait | `number` | `300` | `milliseconds` debounce wait |
|
|
66
|
+
| floatingConfig | `object` | `{}` | [Floating UI Config](https://floating-ui.com/) |
|
|
67
|
+
| hasError | `boolean` | `false` | If `true` sets error class and styles |
|
|
68
|
+
| name | `string` | `null` | Name attribute of hidden input, helpful for form actions |
|
|
69
|
+
| required | `boolean` | `false` | If `Select` is within a `<form>` will restrict form submission |
|
|
70
|
+
| multiFullItemClearable | `boolean` | `false` | When `multiple` selected items will clear on click |
|
|
71
|
+
| closeListOnChange | `boolean` | `true` | After `on:change` list will close |
|
|
72
|
+
| clearFilterTextOnBlur | `boolean` | `true` | If `false`, `filterText` value is preserved on:blur |
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
## Named slots
|
|
76
|
+
|
|
77
|
+
```svelte
|
|
78
|
+
<Select>
|
|
79
|
+
<div slot="prepend" />
|
|
80
|
+
<div slot="selection" let:selection let:index /> <!-- index only available when multiple -->
|
|
81
|
+
<div slot="clear-icon" />
|
|
82
|
+
<div slot="multi-clear-icon" />
|
|
83
|
+
<div slot="loading-icon" />
|
|
84
|
+
<div slot="chevron-icon" />
|
|
85
|
+
<div slot="list-prepend" />
|
|
86
|
+
<div slot="list" let:filteredItems />
|
|
87
|
+
<div slot="list-append" />
|
|
88
|
+
<div slot="item" let:item let:index />
|
|
89
|
+
<div slot="input-hidden" let:value />
|
|
90
|
+
<div slot="required" let:value />
|
|
91
|
+
<!-- Remember you can also use `svelte:fragment` to avoid a container DOM element. -->
|
|
92
|
+
<svelte:fragment slot="empty" />
|
|
93
|
+
</Select>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## Events
|
|
98
|
+
|
|
99
|
+
| Event Name | Callback | Description |
|
|
100
|
+
| ---------- | ----------------- | -------------------------------------------------------------------------- |
|
|
101
|
+
| change | { detail } | fires when the user selects an option |
|
|
102
|
+
| input | { detail } | fires when the value has been changed |
|
|
103
|
+
| focus | { detail } | fires when select > input on:focus |
|
|
104
|
+
| blur | { detail } | fires when select > input on:blur |
|
|
105
|
+
| clear | { detail } | fires when clear is invoked or item is removed (by user) from multi select |
|
|
106
|
+
| loaded | { options } | fires when `loadOptions` resolves |
|
|
107
|
+
| error | { type, details } | fires when error is caught |
|
|
108
|
+
| filter | { detail } | fires when `listOpen: true` and items are filtered |
|
|
109
|
+
| hoverItem | { detail } | fires when hoverItemIndex changes |
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Items
|
|
113
|
+
|
|
114
|
+
`items` can be simple arrays or collections.
|
|
115
|
+
|
|
116
|
+
```html
|
|
117
|
+
<script>
|
|
118
|
+
import Select from 'svelte-5-select';
|
|
119
|
+
|
|
120
|
+
let simple = ['one', 'two', 'three'];
|
|
121
|
+
|
|
122
|
+
let collection = [
|
|
123
|
+
{ value: 1, label: 'one' },
|
|
124
|
+
{ value: 2, label: 'two' },
|
|
125
|
+
{ value: 3, label: 'three' },
|
|
126
|
+
];
|
|
127
|
+
</script>
|
|
128
|
+
|
|
129
|
+
<Select items={simple} />
|
|
130
|
+
|
|
131
|
+
<Select items={collection} />
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
They can also be grouped and include non-selectable items.
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<script>
|
|
138
|
+
import Select from 'svelte-5-select';
|
|
139
|
+
|
|
140
|
+
const items = [
|
|
141
|
+
{value: 'chocolate', label: 'Chocolate', group: 'Sweet'},
|
|
142
|
+
{value: 'pizza', label: 'Pizza', group: 'Savory'},
|
|
143
|
+
{value: 'cake', label: 'Cake', group: 'Sweet', selectable: false},
|
|
144
|
+
{value: 'chips', label: 'Chips', group: 'Savory'},
|
|
145
|
+
{value: 'ice-cream', label: 'Ice Cream', group: 'Sweet'}
|
|
146
|
+
];
|
|
147
|
+
|
|
148
|
+
const groupBy = (item) => item.group;
|
|
149
|
+
</script>
|
|
150
|
+
|
|
151
|
+
<Select {items} {groupBy} />
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
You can also use custom collections.
|
|
155
|
+
|
|
156
|
+
```html
|
|
157
|
+
<script>
|
|
158
|
+
import Select from 'svelte-5-select';
|
|
159
|
+
|
|
160
|
+
const itemId = 'id';
|
|
161
|
+
const label = 'title';
|
|
162
|
+
|
|
163
|
+
const items = [
|
|
164
|
+
{id: 0, title: 'Foo'},
|
|
165
|
+
{id: 1, title: 'Bar'},
|
|
166
|
+
];
|
|
167
|
+
</script>
|
|
168
|
+
|
|
169
|
+
<Select {itemId} {label} {items} />
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Async Items
|
|
173
|
+
|
|
174
|
+
To load items asynchronously then `loadOptions` is the simplest solution. Supply a function that returns a `Promise` that resolves with a list of items. `loadOptions` has debounce baked in and fires each time `filterText` is updated.
|
|
175
|
+
|
|
176
|
+
```html
|
|
177
|
+
<script>
|
|
178
|
+
import Select from 'svelte-5-select';
|
|
179
|
+
|
|
180
|
+
import { someApiCall } from './services';
|
|
181
|
+
|
|
182
|
+
async function examplePromise(filterText) {
|
|
183
|
+
// Put your async code here...
|
|
184
|
+
// For example call an API using filterText as your search params
|
|
185
|
+
// When your API responds resolve your Promise
|
|
186
|
+
let res = await someApiCall(filterText);
|
|
187
|
+
return res;
|
|
188
|
+
}
|
|
189
|
+
</script>
|
|
190
|
+
|
|
191
|
+
<Select loadOptions={examplePromise} />
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
### Advanced List Positioning / Floating
|
|
196
|
+
|
|
197
|
+
`svelte-5-select` uses [floating-ui](https://floating-ui.com/) to control the list floating. See their docs and pass in your config via the `floatingConfig` prop.
|
|
198
|
+
|
|
199
|
+
```html
|
|
200
|
+
<script>
|
|
201
|
+
import Select from 'svelte-5-select';
|
|
202
|
+
|
|
203
|
+
let floatingConfig = {
|
|
204
|
+
strategy: 'fixed'
|
|
205
|
+
}
|
|
206
|
+
</script>
|
|
207
|
+
|
|
208
|
+
<Select {floatingConfig} />
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Exposed methods
|
|
212
|
+
These internal functions are exposed to override if needed. Look through the test file (test/src/index.js) for examples.
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
export let itemFilter = (label, filterText, option) => label.toLowerCase().includes(filterText.toLowerCase());
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
```js
|
|
219
|
+
export let groupBy = undefined;
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
```js
|
|
223
|
+
export let groupFilter = groups => groups;
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
```js
|
|
227
|
+
export let createGroupHeaderItem = groupValue => {
|
|
228
|
+
return {
|
|
229
|
+
value: groupValue,
|
|
230
|
+
label: groupValue
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
```js
|
|
236
|
+
export function handleClear() {
|
|
237
|
+
value = undefined;
|
|
238
|
+
listOpen = false;
|
|
239
|
+
onClear(value);
|
|
240
|
+
handleFocus();
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
```js
|
|
245
|
+
export let loadOptions = undefined; // if used must return a Promise that updates 'items'
|
|
246
|
+
/* Return an object with { cancelled: true } to keep the loading state as active. */
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
```js
|
|
250
|
+
export const getFilteredItems = () => {
|
|
251
|
+
return filteredItems;
|
|
252
|
+
};
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
```js
|
|
256
|
+
export let debounce = (fn, wait = 1) => {
|
|
257
|
+
clearTimeout(timeout);
|
|
258
|
+
timeout = setTimeout(fn, wait);
|
|
259
|
+
};
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Override core functionality at your own risk! See ([get-items.js](/src/lib/get-items.js) & [filter.js](/src/lib/filter.js))
|
|
263
|
+
|
|
264
|
+
```js
|
|
265
|
+
// core replaceable methods...
|
|
266
|
+
<Select
|
|
267
|
+
filter={...}
|
|
268
|
+
getItems={...}
|
|
269
|
+
/>
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## A11y (Accessibility)
|
|
273
|
+
|
|
274
|
+
Override these methods to change the `aria-context` and `aria-selection` text.
|
|
275
|
+
|
|
276
|
+
```js
|
|
277
|
+
export let ariaValues = (values) => {
|
|
278
|
+
return `Option ${values}, selected.`;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export let ariaListOpen = (label, count) => {
|
|
282
|
+
return `You are currently focused on option ${label}. There are ${count} results available.`;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export let ariaFocused = () => {
|
|
286
|
+
return `Select is focused, type to refine list, press down to open the menu.`;
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## CSS custom properties (variables)
|
|
291
|
+
|
|
292
|
+
You can style a component by overriding [the available CSS custom properties](/docs/theming_variables.md).
|
|
293
|
+
|
|
294
|
+
```html
|
|
295
|
+
<script>
|
|
296
|
+
import Select from 'svelte-5-select';
|
|
297
|
+
</script>
|
|
298
|
+
|
|
299
|
+
<Select --border-radius= "10px" --placeholder-color="blue" />
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
You can also use the `inputStyles` prop to write in any override styles needed for the input.
|
|
303
|
+
|
|
304
|
+
```html
|
|
305
|
+
<script>
|
|
306
|
+
import Select from 'svelte-5-select';
|
|
307
|
+
|
|
308
|
+
const items = ['One', 'Two', 'Three'];
|
|
309
|
+
</script>
|
|
310
|
+
|
|
311
|
+
<Select {items} inputStyles="box-sizing: border-box;"></Select>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### 🧪 Experimental: Replace styles (Tailwind, Bootstrap, Bulma etc)
|
|
315
|
+
If you'd like to supply your own styles use: `import Select from 'svelte-5-select/no-styles/Select.svelte'`. Then somewhere in your code or build pipeline add your own. There is a tailwind stylesheet via `import 'svelte-5-select/tailwind.css'`. It uses `@extend` so PostCSS is required.
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
## License
|
|
319
|
+
|
|
320
|
+
[LIL](LICENSE)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
width="100%"
|
|
3
|
+
height="100%"
|
|
4
|
+
viewBox="0 0 20 20"
|
|
5
|
+
focusable="false"
|
|
6
|
+
aria-hidden="true">
|
|
7
|
+
<path
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747
|
|
10
|
+
3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0
|
|
11
|
+
1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502
|
|
12
|
+
0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0
|
|
13
|
+
0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" />
|
|
14
|
+
</svg>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
svg {
|
|
18
|
+
width: var(--chevron-icon-width, 20px);
|
|
19
|
+
height: var(--chevron-icon-width, 20px);
|
|
20
|
+
color: var(--chevron-icon-colour, currentColor);
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default ChevronIcon;
|
|
2
|
+
type ChevronIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const ChevronIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
width="100%"
|
|
3
|
+
height="100%"
|
|
4
|
+
viewBox="-2 -2 50 50"
|
|
5
|
+
focusable="false"
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
role="presentation"
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
fill="currentColor"
|
|
11
|
+
d="M34.923,37.251L24,26.328L13.077,37.251L9.436,33.61l10.923-10.923L9.436,11.765l3.641-3.641L24,19.047L34.923,8.124
|
|
12
|
+
l3.641,3.641L27.641,22.688L38.564,33.61L34.923,37.251z"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
svg {
|
|
18
|
+
width: var(--clear-icon-width, 20px);
|
|
19
|
+
height: var(--clear-icon-width, 20px);
|
|
20
|
+
color: var(--clear-icon-color, currentColor);
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default ClearIcon;
|
|
2
|
+
type ClearIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const ClearIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<svg class="loading" viewBox="25 25 50 50">
|
|
2
|
+
<circle
|
|
3
|
+
class="circle_path"
|
|
4
|
+
cx="50"
|
|
5
|
+
cy="50"
|
|
6
|
+
r="20"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="5"
|
|
10
|
+
stroke-miterlimit="10" />
|
|
11
|
+
</svg>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
.loading {
|
|
15
|
+
width: var(--spinner-width, 20px);
|
|
16
|
+
height: var(--spinner-height, 20px);
|
|
17
|
+
color: var(--spinner-color, var(--icons-color));
|
|
18
|
+
animation: rotate 0.75s linear infinite;
|
|
19
|
+
transform-origin: center center;
|
|
20
|
+
transform: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.circle_path {
|
|
24
|
+
stroke-dasharray: 90;
|
|
25
|
+
stroke-linecap: round;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@keyframes rotate {
|
|
29
|
+
100% {
|
|
30
|
+
transform: rotate(360deg);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default LoadingIcon;
|
|
2
|
+
type LoadingIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const LoadingIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|