@smilodon/svelte 1.9.3 → 2.0.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/COMPLETE-GUIDE.md +16 -15
- package/README.md +246 -198
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +581 -513
- package/dist/index.mjs.map +1 -1
- package/dist/svelte.css +0 -0
- package/dist/types/index.d.ts +4 -1
- package/package.json +7 -7
package/COMPLETE-GUIDE.md
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# @smilodon/svelte - Complete Guide
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Select component guide for Svelte applications**
|
|
4
4
|
|
|
5
5
|
This guide provides comprehensive documentation for using Smilodon Select in Svelte applications, covering all features, styling options, and advanced use cases.
|
|
6
6
|
|
|
7
|
+
**Supported peer:** Svelte 5.x. Svelte 3 and 4 are outside this package's published compatibility range.
|
|
8
|
+
|
|
9
|
+
> Capability caveat: the public `virtualized` prop enables chunked rendering for large flat lists, not viewport-windowed virtualization. Older examples below that say “only visible rows” or imply bounded DOM are not current release guarantees. See [Known Limitations](../../docs/KNOWN-LIMITATIONS.md#viewport-virtualization-status).
|
|
10
|
+
>
|
|
11
|
+
> Accessibility status: selected keyboard and ARIA behaviors are implemented, but pinned cross-browser verification and manual assistive-technology assessment are pending. This guide is not a WCAG conformance statement. For the maintained public API, use the [API reference](../../docs/API-REFERENCE.md) and the adapter's exported TypeScript types.
|
|
12
|
+
|
|
7
13
|
---
|
|
8
14
|
|
|
9
15
|
## Table of Contents
|
|
@@ -136,7 +142,7 @@ The Svelte adapter is designed for browser hydration around the shared custom el
|
|
|
136
142
|
1. Fetch server data in `load()` or browser-only data in `onMount()`.
|
|
137
143
|
2. Avoid direct custom-element mutation before mount.
|
|
138
144
|
3. Keep large `items` arrays stable where possible.
|
|
139
|
-
4.
|
|
145
|
+
4. `virtualized` enables incremental chunk rendering only; use host-controlled paging when the full dataset should not be loaded.
|
|
140
146
|
5. Style through CSS variables and `:global(enhanced-select::part(...))` selectors.
|
|
141
147
|
|
|
142
148
|
---
|
|
@@ -201,14 +207,13 @@ interface SelectProps {
|
|
|
201
207
|
|
|
202
208
|
// Display
|
|
203
209
|
maxHeight?: number;
|
|
204
|
-
estimatedItemHeight?: number;
|
|
205
210
|
|
|
206
211
|
// Styling
|
|
207
212
|
class?: string;
|
|
208
213
|
style?: string;
|
|
209
214
|
|
|
210
215
|
// Advanced
|
|
211
|
-
|
|
216
|
+
virtualized?: boolean;
|
|
212
217
|
customRenderer?: (item: SelectItem, index: number) => string;
|
|
213
218
|
}
|
|
214
219
|
```
|
|
@@ -224,10 +229,9 @@ interface SelectProps {
|
|
|
224
229
|
| `disabled` | `boolean` | `false` | Disable the select |
|
|
225
230
|
| `placeholder` | `string` | `'Select...'` | Placeholder text |
|
|
226
231
|
| `maxHeight` | `number` | `300` | Max dropdown height (px) |
|
|
227
|
-
| `estimatedItemHeight` | `number` | `48` | Estimated item height for virtualization |
|
|
228
232
|
| `class` | `string` | `undefined` | CSS class name |
|
|
229
233
|
| `style` | `string` | `undefined` | Inline styles (CSS variables) |
|
|
230
|
-
| `
|
|
234
|
+
| `virtualized` | `boolean` | `true` | Enable incremental chunk rendering for large flat lists; not viewport windowing |
|
|
231
235
|
| `customRenderer` | `function` | `undefined` | Custom option renderer |
|
|
232
236
|
|
|
233
237
|
### Events
|
|
@@ -945,7 +949,6 @@ Automatically converted to:
|
|
|
945
949
|
bind:value={selectedUser}
|
|
946
950
|
{customRenderer}
|
|
947
951
|
placeholder="Select a user"
|
|
948
|
-
estimatedItemHeight={60}
|
|
949
952
|
/>
|
|
950
953
|
```
|
|
951
954
|
|
|
@@ -971,8 +974,7 @@ Automatically converted to:
|
|
|
971
974
|
<Select
|
|
972
975
|
{items}
|
|
973
976
|
bind:value
|
|
974
|
-
|
|
975
|
-
estimatedItemHeight={48}
|
|
977
|
+
virtualized={true}
|
|
976
978
|
placeholder="Search 100k items..."
|
|
977
979
|
searchable
|
|
978
980
|
/>
|
|
@@ -1093,7 +1095,7 @@ export const selectedItem = derived(
|
|
|
1093
1095
|
|
|
1094
1096
|
## Accessibility
|
|
1095
1097
|
|
|
1096
|
-
Smilodon
|
|
1098
|
+
Smilodon implements selected keyboard and ARIA behavior. Pinned cross-browser verification and manual assistive-technology assessment remain pending; this is not a WCAG conformance claim.
|
|
1097
1099
|
|
|
1098
1100
|
### Keyboard Navigation
|
|
1099
1101
|
|
|
@@ -1110,7 +1112,7 @@ The component automatically includes:
|
|
|
1110
1112
|
- `role="combobox"`
|
|
1111
1113
|
- `aria-expanded`
|
|
1112
1114
|
- `aria-haspopup`
|
|
1113
|
-
- `aria-label` / `aria-
|
|
1115
|
+
- `aria-label` / `aria-description` (literal host attributes are forwarded)
|
|
1114
1116
|
- `aria-activedescendant`
|
|
1115
1117
|
- `aria-multiselectable` (when `multiple`)
|
|
1116
1118
|
|
|
@@ -1290,9 +1292,9 @@ The component automatically includes:
|
|
|
1290
1292
|
|
|
1291
1293
|
If you experience slow rendering with large datasets:
|
|
1292
1294
|
|
|
1293
|
-
1.
|
|
1295
|
+
1. Use `virtualized` only for incremental chunk rendering; it does not bound mounted DOM.
|
|
1294
1296
|
2. Use reactive statements (`$:`) for computed items
|
|
1295
|
-
3.
|
|
1297
|
+
3. Use host-controlled paging/search when not all results should be loaded at once.
|
|
1296
1298
|
|
|
1297
1299
|
```svelte
|
|
1298
1300
|
<script lang="ts">
|
|
@@ -1302,8 +1304,7 @@ If you experience slow rendering with large datasets:
|
|
|
1302
1304
|
<Select
|
|
1303
1305
|
{items}
|
|
1304
1306
|
bind:value
|
|
1305
|
-
|
|
1306
|
-
estimatedItemHeight={48}
|
|
1307
|
+
virtualized={true}
|
|
1307
1308
|
/>
|
|
1308
1309
|
```
|
|
1309
1310
|
|