@smilodon/core 1.19.0 → 1.20.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 +50 -4
- package/dist/index.cjs +807 -109
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +805 -110
- 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 +807 -109
- 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 +21 -3
- package/dist/types/src/config/public-config.d.ts +21 -0
- package/dist/types/src/data-loading/public-types.d.ts +4 -2
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/native-types.d.ts +1 -1
- package/dist/types/src/utils/selected-options-projection.d.ts +18 -0
- package/dist/types/src/utils/selected-target-resolver.d.ts +2 -0
- package/dist/types/src/utils/visual-navigation.d.ts +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,20 @@
|
|
|
14
14
|
|
|
15
15
|
> **Issue #100:** `multiSelectDisplay.scrollToLatestChip` is available in `@smilodon/core@1.17.0`. See [Multi-Select Display Modes](#multi-select-display-modes) and the [release verification](../../docs/releases/WEB-1.17.0-REGISTRY-VERIFICATION.json).
|
|
16
16
|
|
|
17
|
-
> **
|
|
17
|
+
> **Core 1.20.0:** Adds selected-first option presentation and selected-option open positioning through `selectedOptions` and `scrollToSelected`. It also includes Core 1.19.0's styling fixes and search threshold. See [selected-option configuration](#selected-option-presentation-and-opening-scroll), [arrow container positioning](#custom-arrow-slot), and the [release record](../../docs/releases/WEB-1.20.0-RELEASE.md).
|
|
18
|
+
|
|
19
|
+
## Selected-option presentation and opening scroll
|
|
20
|
+
|
|
21
|
+
The opt-in `selectedOptions.placement: 'selected-first'` setting stably promotes selected options for each dropdown opening. Grouped options remain within their original groups. `scrollToSelected` controls whether the selected target is preserved, revealed, or aligned when opening; the defaults remain original option order and the existing reveal behavior. Both settings are available through `updateConfig()` and accept partial nested updates that preserve sibling values. See the [selected-options projection and adapter qualification record](../../docs/architecture/SELECTED-OPTIONS-PROJECTION.md) for lifecycle, keyboard, virtualization, and qualification boundaries.
|
|
22
|
+
|
|
23
|
+
This configuration is available in `@smilodon/core@1.20.0`. The release browser and native-platform limits are recorded in the [release qualification](../../docs/releases/WEB-1.20.0-RELEASE.md).
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
select.updateConfig({
|
|
27
|
+
selectedOptions: { placement: 'selected-first' },
|
|
28
|
+
scrollToSelected: { onOpen: 'align', block: 'center' },
|
|
29
|
+
})
|
|
30
|
+
```
|
|
18
31
|
|
|
19
32
|
## Custom busy bucket (Core 1.13.0)
|
|
20
33
|
|
|
@@ -47,9 +60,9 @@ select.updateConfig({
|
|
|
47
60
|
|
|
48
61
|
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.
|
|
49
62
|
|
|
50
|
-
## Acknowledged data loading
|
|
63
|
+
## Acknowledged data loading
|
|
51
64
|
|
|
52
|
-
The
|
|
65
|
+
The acknowledged protocol provides per-instance data-loading configuration and request completion on `EnhancedSelect`. It is included in the published Core 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. See the [Core 1.19.0 release record](../../docs/releases/WEB-1.19.0-RELEASE.md) for the tested scope and browser limitations.
|
|
53
66
|
|
|
54
67
|
The host owns transport, cancellation, and retry decisions. `completeDataRequest()` accepts a response only when its request identity and query generation are current. A return value of `accepted` means the canonical response was accepted; DOM projection completes separately and is reported by `dataProjection`.
|
|
55
68
|
|
|
@@ -72,7 +85,7 @@ The default is `0`, which preserves existing behavior. The threshold applies to
|
|
|
72
85
|
|
|
73
86
|
Below the threshold, the current text remains visible while Core displays the unfiltered browsing dataset. Search requests are suppressed, but explicit unfiltered pagination still uses `loadMore`. When input crosses into eligible search, Core starts at the configured first page and retains the independent browse items and continuation. Returning below threshold or calling `clearSearch()` cancels an active qualifying search and restores that browse state; completions from the canceled query are stale. An accepted runtime threshold update also projects a changed restored snapshot into the visible options, including when the update is deferred until an in-progress result projection settles. Page-mode browsing treats nonempty initial items as the configured `initialPage` and continues at the next page; with no initial items, the first unfiltered request starts at `initialPage`. The host must complete load-more requests with `hasMore: true` or `status: 'exhausted'`/`hasMore: false` to advance or end browsing; Core does not infer server exhaustion from the item count.
|
|
74
87
|
|
|
75
|
-
This
|
|
88
|
+
This opt-in behavior is available in `@smilodon/core@1.19.0`. See [the Issue #109 qualification record](../../docs/architecture/ISSUE-109-MIN-SEARCH-CHARACTERS.md) and [release record](../../docs/releases/WEB-1.19.0-RELEASE.md).
|
|
76
89
|
|
|
77
90
|
```ts
|
|
78
91
|
import { EnhancedSelect } from '@smilodon/core'
|
|
@@ -681,6 +694,39 @@ The component implements keyboard interaction paths including:
|
|
|
681
694
|
|
|
682
695
|
When an empty single-select opens, it has no active option and does not expose `aria-activedescendant` until keyboard navigation begins. Press `ArrowDown` to activate the first selectable option. If a value is already selected, opening the list activates that selected option.
|
|
683
696
|
|
|
697
|
+
When `scrollToSelected.enabled` is on, active and ARIA state are updated immediately on open. Core waits for the dropdown's finite entrance animation to settle before applying the opening policy. The default `onOpen: 'reveal'` moves the internal options scroller only when the selected target is not fully visible. Use `onOpen: 'align'` to apply `block: 'start' | 'center' | 'end' | 'nearest'` even when the target is visible, subject to scroll bounds. Use `onOpen: 'preserve'` to retain the viewport; when selected-first ordering changes between openings, Core anchors the first visible option by stable key and restores its viewport offset. If the anchor disappears, the previous scroll position is clamped to the new bounds. Disabling the setting or keyboard and deliberate pointer/scroll input cancel pending automatic movement.
|
|
698
|
+
|
|
699
|
+
```ts
|
|
700
|
+
select.updateConfig({
|
|
701
|
+
scrollToSelected: {
|
|
702
|
+
enabled: true,
|
|
703
|
+
onOpen: 'align', // 'preserve' | 'reveal' | 'align'; default: 'reveal'
|
|
704
|
+
multiSelectTarget: 'first',
|
|
705
|
+
behavior: 'smooth', // 'auto' | 'instant' | 'smooth'
|
|
706
|
+
block: 'center', // 'start' | 'center' | 'end' | 'nearest'
|
|
707
|
+
},
|
|
708
|
+
})
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
The policy is snapshotted for each opening; changing it while the entrance operation is pending does not start a competing transaction. Only the internal options scroller is moved. See the [Issue #116 implementation record](../../docs/architecture/ISSUE-116-DROPDOWN-OPEN-SCROLL.md) and [selected-options projection record](../../docs/architecture/SELECTED-OPTIONS-PROJECTION.md).
|
|
712
|
+
|
|
713
|
+
### Selected option presentation order
|
|
714
|
+
|
|
715
|
+
Core can optionally present selected options before unselected options while preserving each partition's original order. The default is `original`, so existing consumers keep source order. For grouped options, `selected-first` promotes selected options only within their current groups; group order and identity do not change.
|
|
716
|
+
|
|
717
|
+
```ts
|
|
718
|
+
import { configureSelect } from '@smilodon/core';
|
|
719
|
+
|
|
720
|
+
configureSelect({
|
|
721
|
+
selectedOptions: {
|
|
722
|
+
placement: 'selected-first', // 'original' | 'selected-first'
|
|
723
|
+
groupedPlacement: 'within-group',
|
|
724
|
+
},
|
|
725
|
+
});
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
The same partial setting can be applied to an instance with `select.updateConfig({ selectedOptions: { placement: 'selected-first' } })`. Core snapshots the policy and selected membership when the dropdown opens. Changing the setting or selection while the list is open does not reshuffle that opening; close and reopen to apply the current values. Selection styling and events still reflect current selection immediately. Web adapter forwarding is included in the `1.20.0` release; React Native runtime behavior is not qualified. See the [selected-options projection record](../../docs/architecture/SELECTED-OPTIONS-PROJECTION.md).
|
|
729
|
+
|
|
684
730
|
**Multi-Select Range Selection:**
|
|
685
731
|
- `Shift + ↑/↓` - Range selection
|
|
686
732
|
- `Ctrl/Cmd + Click` - Toggle individual items
|