@smilodon/svelte 1.9.2 → 1.10.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 +14 -15
- package/README.md +240 -198
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +185 -160
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +3 -3
package/COMPLETE-GUIDE.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
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
|
+
> 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).
|
|
8
|
+
>
|
|
9
|
+
> 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.
|
|
10
|
+
|
|
7
11
|
---
|
|
8
12
|
|
|
9
13
|
## Table of Contents
|
|
@@ -136,7 +140,7 @@ The Svelte adapter is designed for browser hydration around the shared custom el
|
|
|
136
140
|
1. Fetch server data in `load()` or browser-only data in `onMount()`.
|
|
137
141
|
2. Avoid direct custom-element mutation before mount.
|
|
138
142
|
3. Keep large `items` arrays stable where possible.
|
|
139
|
-
4.
|
|
143
|
+
4. `virtualized` enables incremental chunk rendering only; use host-controlled paging when the full dataset should not be loaded.
|
|
140
144
|
5. Style through CSS variables and `:global(enhanced-select::part(...))` selectors.
|
|
141
145
|
|
|
142
146
|
---
|
|
@@ -201,14 +205,13 @@ interface SelectProps {
|
|
|
201
205
|
|
|
202
206
|
// Display
|
|
203
207
|
maxHeight?: number;
|
|
204
|
-
estimatedItemHeight?: number;
|
|
205
208
|
|
|
206
209
|
// Styling
|
|
207
210
|
class?: string;
|
|
208
211
|
style?: string;
|
|
209
212
|
|
|
210
213
|
// Advanced
|
|
211
|
-
|
|
214
|
+
virtualized?: boolean;
|
|
212
215
|
customRenderer?: (item: SelectItem, index: number) => string;
|
|
213
216
|
}
|
|
214
217
|
```
|
|
@@ -224,10 +227,9 @@ interface SelectProps {
|
|
|
224
227
|
| `disabled` | `boolean` | `false` | Disable the select |
|
|
225
228
|
| `placeholder` | `string` | `'Select...'` | Placeholder text |
|
|
226
229
|
| `maxHeight` | `number` | `300` | Max dropdown height (px) |
|
|
227
|
-
| `estimatedItemHeight` | `number` | `48` | Estimated item height for virtualization |
|
|
228
230
|
| `class` | `string` | `undefined` | CSS class name |
|
|
229
231
|
| `style` | `string` | `undefined` | Inline styles (CSS variables) |
|
|
230
|
-
| `
|
|
232
|
+
| `virtualized` | `boolean` | `true` | Enable incremental chunk rendering for large flat lists; not viewport windowing |
|
|
231
233
|
| `customRenderer` | `function` | `undefined` | Custom option renderer |
|
|
232
234
|
|
|
233
235
|
### Events
|
|
@@ -945,7 +947,6 @@ Automatically converted to:
|
|
|
945
947
|
bind:value={selectedUser}
|
|
946
948
|
{customRenderer}
|
|
947
949
|
placeholder="Select a user"
|
|
948
|
-
estimatedItemHeight={60}
|
|
949
950
|
/>
|
|
950
951
|
```
|
|
951
952
|
|
|
@@ -971,8 +972,7 @@ Automatically converted to:
|
|
|
971
972
|
<Select
|
|
972
973
|
{items}
|
|
973
974
|
bind:value
|
|
974
|
-
|
|
975
|
-
estimatedItemHeight={48}
|
|
975
|
+
virtualized={true}
|
|
976
976
|
placeholder="Search 100k items..."
|
|
977
977
|
searchable
|
|
978
978
|
/>
|
|
@@ -1093,7 +1093,7 @@ export const selectedItem = derived(
|
|
|
1093
1093
|
|
|
1094
1094
|
## Accessibility
|
|
1095
1095
|
|
|
1096
|
-
Smilodon
|
|
1096
|
+
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
1097
|
|
|
1098
1098
|
### Keyboard Navigation
|
|
1099
1099
|
|
|
@@ -1110,7 +1110,7 @@ The component automatically includes:
|
|
|
1110
1110
|
- `role="combobox"`
|
|
1111
1111
|
- `aria-expanded`
|
|
1112
1112
|
- `aria-haspopup`
|
|
1113
|
-
- `aria-label` / `aria-
|
|
1113
|
+
- `aria-label` / `aria-description` (literal host attributes are forwarded)
|
|
1114
1114
|
- `aria-activedescendant`
|
|
1115
1115
|
- `aria-multiselectable` (when `multiple`)
|
|
1116
1116
|
|
|
@@ -1290,9 +1290,9 @@ The component automatically includes:
|
|
|
1290
1290
|
|
|
1291
1291
|
If you experience slow rendering with large datasets:
|
|
1292
1292
|
|
|
1293
|
-
1.
|
|
1293
|
+
1. Use `virtualized` only for incremental chunk rendering; it does not bound mounted DOM.
|
|
1294
1294
|
2. Use reactive statements (`$:`) for computed items
|
|
1295
|
-
3.
|
|
1295
|
+
3. Use host-controlled paging/search when not all results should be loaded at once.
|
|
1296
1296
|
|
|
1297
1297
|
```svelte
|
|
1298
1298
|
<script lang="ts">
|
|
@@ -1302,8 +1302,7 @@ If you experience slow rendering with large datasets:
|
|
|
1302
1302
|
<Select
|
|
1303
1303
|
{items}
|
|
1304
1304
|
bind:value
|
|
1305
|
-
|
|
1306
|
-
estimatedItemHeight={48}
|
|
1305
|
+
virtualized={true}
|
|
1307
1306
|
/>
|
|
1308
1307
|
```
|
|
1309
1308
|
|