@smilodon/core 1.12.0 → 1.17.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/README.md +70 -4
- package/dist/index.cjs +420 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +420 -46
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.js +420 -46
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/components/enhanced-select.d.ts +28 -1
- package/dist/types/src/config/global-config.d.ts +9 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/types.d.ts +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,6 +12,39 @@
|
|
|
12
12
|
|
|
13
13
|
> **Verification status:** `EnhancedSelect`'s public `virtualize` setting chunks large-list rendering but does not bound the final option DOM. Viewport-windowed rendering remains behind a private test seam and is not production-activated. ARIA and keyboard behaviors have automated coverage in progress; WCAG conformance and manual assistive-technology review have not been certified. See [known limitations](../../docs/KNOWN-LIMITATIONS.md#viewport-virtualization-status) and the [Phase 4 certification record](../../docs/architecture/PHASE-4-CERTIFICATION.md).
|
|
14
14
|
|
|
15
|
+
> **Issue #100 availability:** `multiSelectDisplay.scrollToLatestChip` is documented in [Multi-Select Display Modes](#multi-select-display-modes) and is included in the Core `1.17.0` release candidate. npm currently provides Core `1.13.0`; do not expect this option from the published package until the [release checklist](../../docs/releases/WEB-1.17.0-RELEASE.md) records successful publication and registry verification.
|
|
16
|
+
|
|
17
|
+
## Custom busy bucket (Core 1.13.0)
|
|
18
|
+
|
|
19
|
+
Introduced in `@smilodon/core@1.13.0` (Issue #90), the busy bucket keeps request state in Core and lets the host customize its presentation. Use the native slots with the Web Component or Vanilla API:
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<enhanced-select>
|
|
23
|
+
<span slot="loading-icon" aria-hidden="true">⏳</span>
|
|
24
|
+
<div slot="loading-content">
|
|
25
|
+
<strong>Loading more products…</strong>
|
|
26
|
+
<span>Please wait.</span>
|
|
27
|
+
</div>
|
|
28
|
+
</enhanced-select>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
select.updateConfig({
|
|
33
|
+
busyBucket: {
|
|
34
|
+
enabled: true,
|
|
35
|
+
showSpinner: false,
|
|
36
|
+
showMessage: true,
|
|
37
|
+
message: 'Loading…',
|
|
38
|
+
minDisplayTime: 200,
|
|
39
|
+
contentMode: 'append', // or 'replace'
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`append` keeps the built-in spinner/message with custom slot content. `replace` shows only accessible custom content and hides the icon and message regions; if no accessible replacement is supplied, Core keeps a “Loading…” fallback. `showSpinner` affects only the built-in spinner, so a supplied `loading-icon` remains visible in append mode when the fallback spinner is disabled. The existing `Searching...` state remains separate from the busy bucket.
|
|
45
|
+
|
|
46
|
+
The bucket exposes `::part(loading)`, `::part(loading-icon)`, `::part(loading-spinner)`, `::part(loading-message)`, and `::part(loading-content)`. Layout can be adjusted with `--select-busy-gap`, `--select-busy-padding`, `--select-busy-color`, `--select-busy-bg`, and the existing `--select-spinner-size` token. `minDisplayTime` is a visual minimum after request completion; it does not delay acceptance, pagination, or `aria-busy` updates.
|
|
47
|
+
|
|
15
48
|
## Acknowledged data loading (Phase 2F-D development candidate)
|
|
16
49
|
|
|
17
50
|
The local Phase 2F-D candidate adds a public, per-instance data-loading configuration and completion surface to `EnhancedSelect`. This API is not included in the published `1.10.0` package. The legacy protocol remains the default; remote and hybrid search or cursor pagination require explicit acknowledged-protocol opt-in. There is no global acknowledged-loading default. Cross-browser certification and independent review remain pending, so these examples are illustrative and have not been certified for release.
|
|
@@ -69,6 +102,20 @@ select.startDataLoading()
|
|
|
69
102
|
|
|
70
103
|
For a paginated response, use `status: 'succeeded'` with `hasMore: true` and the next cursor when cursor pagination is configured. Use `status: 'exhausted'` with `hasMore: false` when the server reports end-of-data. On cancellation, abort the host request and do not complete it as a success. A stale completion result is not a signal to retry the old request.
|
|
71
104
|
|
|
105
|
+
When an exhausted response contains no items, Core renders the terminal no-results message automatically after the accepted snapshot finishes projection. `completeDataRequest()` returning `accepted` only means the response passed coordinator validation; it does not mean the DOM has settled. Observe `dataProjection` and wait for `status: 'complete'` before reading projected DOM. A remote search uses its current query in the no-results message; an exhausted empty query displays “No options available.”
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
select.completeDataRequest({
|
|
109
|
+
requestId: request.requestId,
|
|
110
|
+
queryGeneration: request.queryGeneration,
|
|
111
|
+
status: 'exhausted',
|
|
112
|
+
items: [],
|
|
113
|
+
hasMore: false,
|
|
114
|
+
})
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
An empty page with `status: 'empty'`, `hasMore: true`, and `advance: 'next'` is nonterminal and does not mean the search has no matches. It advances pagination; only an exhausted response establishes terminal absence of results.
|
|
118
|
+
|
|
72
119
|
## 📖 Documentation
|
|
73
120
|
|
|
74
121
|
**Live documentation & interactive examples:** [navidrezadoost.github.io/Smilodon](https://navidrezadoost.github.io/Smilodon/)
|
|
@@ -170,6 +217,21 @@ The default chevron remains in place unless a light-DOM child is assigned to the
|
|
|
170
217
|
|
|
171
218
|
The custom node is decorative and Core keeps ownership of the arrow click behavior. The built-in arrow rotates with the popup; a custom node does not rotate unless the consumer styles it using the host's `data-open="true"` state. Core does not impose its arrow color or hover background on assigned custom content.
|
|
172
219
|
|
|
220
|
+
### Custom empty-state content (unreleased)
|
|
221
|
+
|
|
222
|
+
Core keeps the built-in no-options/no-results message as the slot fallback. Assign a light-DOM child to `empty-state` to render custom text, markup, or an icon while the result set is terminally empty:
|
|
223
|
+
|
|
224
|
+
```html
|
|
225
|
+
<enhanced-select id="products" searchable>
|
|
226
|
+
<div slot="empty-state" role="status">
|
|
227
|
+
<svg aria-hidden="true" viewBox="0 0 24 24"><!-- decorative icon --></svg>
|
|
228
|
+
<span>No matching products. Try a different search.</span>
|
|
229
|
+
</div>
|
|
230
|
+
</enhanced-select>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
`emptyStateChange` fires when the effective context changes. Its detail is `{ context: { query, reason } }`, or `{ context: null }` when the terminal empty state clears. `reason` is `no-options` for an empty option collection and `no-results` when a non-empty collection has no matches for the current query. `getEmptyStateContext()` returns the current detached, readonly snapshot or `null`. The slot is presentation-only: Core continues to own result state, selection, and accessibility synchronization. Provide suitable semantics for custom content (for example, `role="status"` for a concise announcement) and avoid duplicating announcements already made by the host application.
|
|
234
|
+
|
|
173
235
|
### Framework Usage
|
|
174
236
|
|
|
175
237
|
**In browser DOM frameworks, `@smilodon/core` can be used directly** as a Web Component; framework adapters are available for framework-specific APIs.
|
|
@@ -389,7 +451,7 @@ const selectedItems = select.getSelectedItems();
|
|
|
389
451
|
|
|
390
452
|
## Advanced Usage
|
|
391
453
|
|
|
392
|
-
### Dropdown enter and exit animations (Core 1.12.0
|
|
454
|
+
### Dropdown enter and exit animations (Core 1.12.0)
|
|
393
455
|
|
|
394
456
|
The default entry animation uses `--select-dropdown-animation`. The new exit animation mirrors that control through `--select-dropdown-exit-animation`, defaulting to `dropdownExit 160ms cubic-bezier(0.4, 0, 1, 1) forwards`.
|
|
395
457
|
|
|
@@ -408,9 +470,9 @@ enhanced-select.instant {
|
|
|
408
470
|
|
|
409
471
|
Opacity and starting transform can be adjusted using `--select-dropdown-exit-from-opacity`, `--select-dropdown-exit-to-opacity`, and `--select-dropdown-exit-from-transform`. Closing updates engine and ARIA immediately; the panel is inert and hidden from assistive technology while exiting. Reopening cancels the exit. Reduced-motion preferences are respected.
|
|
410
472
|
|
|
411
|
-
**
|
|
473
|
+
**Release:** available as `@smilodon/core@1.12.0` from npm. Qualification was recorded on Chrome 156 (8/8 focused Core tests, 4/4 browser scenarios, 723 passed/7 skipped in the full suite, as reported for PR #86). The repository's pinned Playwright Chromium 147 run remains unverified. See [implementation and qualification notes](../../docs/architecture/DROPDOWN-EXIT-ANIMATION.md) and the [release record](../../docs/releases/CORE-1.12.0-RELEASE.md).
|
|
412
474
|
|
|
413
|
-
For the related fixes, stable option-hover geometry shipped
|
|
475
|
+
For the related fixes, stable option-hover geometry shipped in Core `1.11.0` ([Issue #77](https://github.com/navidrezadoost/Smilodon/issues/77)) and custom active-class reconciliation shipped in `1.11.1` ([Issue #82](https://github.com/navidrezadoost/Smilodon/issues/82)). Both remain in `1.12.0`; the exit animation is the new feature in that version. See the [release record](../../docs/releases/CORE-1.12.0-RELEASE.md).
|
|
414
476
|
|
|
415
477
|
### Custom Styling
|
|
416
478
|
|
|
@@ -597,11 +659,15 @@ Control badge scrolling behavior in multi-select mode with `multiSelectDisplay`
|
|
|
597
659
|
maxHeight: '160px', // used by vertical / horizontal modes
|
|
598
660
|
overflowX: 'hidden',
|
|
599
661
|
overflowY: 'hidden',
|
|
600
|
-
dragScroll: true
|
|
662
|
+
dragScroll: true, // Enable drag-to-scroll (horizontal mode)
|
|
663
|
+
scrollToLatestChip: false, // Opt in to revealing newly selected chips
|
|
664
|
+
scrollToLatestChipBehavior: 'smooth' // 'auto' | 'smooth'
|
|
601
665
|
}
|
|
602
666
|
}
|
|
603
667
|
```
|
|
604
668
|
|
|
669
|
+
**Auto-scroll newly selected chips:** In `horizontal` mode, enable `scrollToLatestChip: true` to reveal a newly selected chip without scrolling the option list. The default is `false`. The viewport is not repositioned when an item is removed, the data is reloaded, or the component rerenders with unchanged selections. The default behavior is smooth (respects reduced motion); set `scrollToLatestChipBehavior: 'auto'` for instant movement. The setting is available through the shared Core `multiSelectDisplay` configuration in web adapters.
|
|
670
|
+
|
|
605
671
|
**Display Modes:**
|
|
606
672
|
- **`wrap`** (default) - Badges wrap naturally and the input shell grows with them; no internal chip scrollbar by default
|
|
607
673
|
- **`horizontal`** - Single row, stable trigger height, horizontal scroll, drag-to-scroll enabled, and action-area spacing reserved automatically
|