@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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Redesigned with formal elegance, refined microinteractions, and polished UX
|
|
7
7
|
*/
|
|
8
8
|
import type { DataLoadingStateSnapshot, DataRequestCompletion, DataRequestCompletionResult, EnhancedSelectAcknowledgedSurface, SelectInstanceConfig } from '../data-loading/public-types.js';
|
|
9
|
-
import type { GroupedItem, ClassMap, SelectCapabilitiesReport, LimitationState, LimitationPolicyMap, TrackingSnapshot } from '../types.js';
|
|
9
|
+
import type { GroupedItem, ClassMap, SelectCapabilitiesReport, LimitationState, LimitationPolicyMap, TrackingSnapshot, EmptyStateContext } from '../types.js';
|
|
10
10
|
import type { OptionRenderer as OptionRendererFn } from '../renderers/contracts.js';
|
|
11
11
|
export declare class EnhancedSelect extends HTMLElement implements EnhancedSelectAcknowledgedSurface {
|
|
12
12
|
static get observedAttributes(): string[];
|
|
@@ -32,12 +32,18 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
|
|
|
32
32
|
private _loadMoreTrigger?;
|
|
33
33
|
private _acknowledgedSentinel?;
|
|
34
34
|
private _busyBucket?;
|
|
35
|
+
private _busyBucketContentObserver?;
|
|
36
|
+
private _busyPresentationVisible;
|
|
37
|
+
private _busyPresentationStartedAt;
|
|
38
|
+
private _busyPresentationGeneration;
|
|
39
|
+
private _busyPresentationHideTimer;
|
|
35
40
|
private _liveRegion?;
|
|
36
41
|
private _errorDescription?;
|
|
37
42
|
private _state;
|
|
38
43
|
private _engine;
|
|
39
44
|
private _virtualizationScope;
|
|
40
45
|
private _renderPlan;
|
|
46
|
+
private _emptyStateContext;
|
|
41
47
|
private _guardedVirtualWindow;
|
|
42
48
|
private _guardedVirtualizer;
|
|
43
49
|
private _guardedVirtualizationRequested;
|
|
@@ -97,6 +103,10 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
|
|
|
97
103
|
private _pendingFirstRenderMark;
|
|
98
104
|
private _pendingSearchRenderMark;
|
|
99
105
|
private _rangeAnchorIndex;
|
|
106
|
+
/** Chip identity is tracked independently of dropdown option positions. */
|
|
107
|
+
private _lastRenderedChipKeys;
|
|
108
|
+
private _latestChipScrollGeneration;
|
|
109
|
+
private _latestChipScrollFrame;
|
|
100
110
|
private _optionRenderer?;
|
|
101
111
|
private _groupHeaderRenderer?;
|
|
102
112
|
private _classMap?;
|
|
@@ -264,6 +274,8 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
|
|
|
264
274
|
private _handleSearch;
|
|
265
275
|
private _handleKeydown;
|
|
266
276
|
private _moveActive;
|
|
277
|
+
/** Return true only when boundary navigation is held for an in-flight/new page. */
|
|
278
|
+
private _requestKeyboardLoadMore;
|
|
267
279
|
private _setActive;
|
|
268
280
|
private _getOptionElementByIndex;
|
|
269
281
|
private _getSelectableOptions;
|
|
@@ -278,6 +290,8 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
|
|
|
278
290
|
private _selectOption;
|
|
279
291
|
private _handleOptionRemove;
|
|
280
292
|
private _updateInputDisplay;
|
|
293
|
+
private _cancelLatestChipScroll;
|
|
294
|
+
private _scheduleLatestChipScroll;
|
|
281
295
|
private _isActivelyEditingSearchInput;
|
|
282
296
|
private _renderOptionsWithAnimation;
|
|
283
297
|
private _scrollToSelected;
|
|
@@ -293,6 +307,10 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
|
|
|
293
307
|
getTrackingSnapshot(): TrackingSnapshot;
|
|
294
308
|
clearTracking(source?: 'event' | 'style' | 'limitation' | 'all'): void;
|
|
295
309
|
getCapabilities(): SelectCapabilitiesReport;
|
|
310
|
+
/** Return a detached immutable snapshot of the currently rendered empty state. */
|
|
311
|
+
getEmptyStateContext(): EmptyStateContext | null;
|
|
312
|
+
private _syncEmptyStateContext;
|
|
313
|
+
private _appendEmptyState;
|
|
296
314
|
private _emitChange;
|
|
297
315
|
get optionRenderer(): OptionRendererFn | undefined;
|
|
298
316
|
set optionRenderer(renderer: OptionRendererFn | undefined);
|
|
@@ -422,6 +440,15 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
|
|
|
422
440
|
private _teardownGuardedOptionResizeObserver;
|
|
423
441
|
private _materializeGuardedVirtualKey;
|
|
424
442
|
private _refreshVirtualizationScope;
|
|
443
|
+
private _clearBusyPresentationHideTimer;
|
|
444
|
+
private _beginBusyPresentation;
|
|
445
|
+
private _syncBusyPresentation;
|
|
446
|
+
private _clearBusyBucketContentObserver;
|
|
447
|
+
private _cancelBusyPresentation;
|
|
448
|
+
private _hasAccessibleBusyContent;
|
|
449
|
+
private _syncBusyBucketContent;
|
|
450
|
+
private _createBusyBucket;
|
|
451
|
+
private _appendBusyBucket;
|
|
425
452
|
private _renderOptions;
|
|
426
453
|
private _waitForRenderCycle;
|
|
427
454
|
private _resolveRenderCycle;
|
|
@@ -30,10 +30,14 @@ export interface BusyBucketConfig {
|
|
|
30
30
|
enabled: boolean;
|
|
31
31
|
/** Show spinner in bucket */
|
|
32
32
|
showSpinner?: boolean;
|
|
33
|
+
/** Show the built-in loading message */
|
|
34
|
+
showMessage?: boolean;
|
|
33
35
|
/** Custom loading message */
|
|
34
36
|
message?: string;
|
|
35
|
-
/** Minimum display time (ms)
|
|
37
|
+
/** Minimum visual display time (ms); does not delay request completion */
|
|
36
38
|
minDisplayTime?: number;
|
|
39
|
+
/** Append custom loading content or replace the built-in presentation */
|
|
40
|
+
contentMode?: 'append' | 'replace';
|
|
37
41
|
}
|
|
38
42
|
export interface ExpandableConfig {
|
|
39
43
|
/** Enable expandable dropdown height */
|
|
@@ -105,6 +109,10 @@ export interface MultiSelectDisplayConfig {
|
|
|
105
109
|
overflowY?: 'auto' | 'scroll' | 'hidden';
|
|
106
110
|
/** Enable drag-to-scroll interactions in horizontal mode */
|
|
107
111
|
dragScroll?: boolean;
|
|
112
|
+
/** Scroll the chip viewport to newly added selections, without moving it on removal. */
|
|
113
|
+
scrollToLatestChip?: boolean;
|
|
114
|
+
/** Scrolling behavior for a newly selected chip; reduced-motion users get instant movement. */
|
|
115
|
+
scrollToLatestChipBehavior?: 'auto' | 'smooth';
|
|
108
116
|
}
|
|
109
117
|
/**
|
|
110
118
|
* Plain CSS style object for component part configuration.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './types.js';
|
|
2
|
-
export type { SelectEventDetail, OpenEventDetail, CloseEventDetail, SearchEventDetail, ChangeEventDetail, LoadMoreEventDetail, RemoveEventDetail, ClearEventDetail, ErrorEventDetail, PageLoadedEventDetail, GroupedItem, RemoteConfig, Placement, Strategy, NativeSelectOptions, RendererHelpers, SelectEventsDetailMap, SelectEventName } from './types.js';
|
|
2
|
+
export type { SelectEventDetail, OpenEventDetail, CloseEventDetail, SearchEventDetail, ChangeEventDetail, LoadMoreEventDetail, RemoveEventDetail, ClearEventDetail, EmptyStateReason, EmptyStateContext, EmptyStateChangeDetail, ErrorEventDetail, PageLoadedEventDetail, GroupedItem, RemoteConfig, Placement, Strategy, NativeSelectOptions, RendererHelpers, SelectEventsDetailMap, SelectEventName } from './types.js';
|
|
3
3
|
export type { CustomOptionContract, CustomOptionContext, CustomOptionFactory, ExtendedSelectItem, OptionRendererMode, CustomOptionConfig, CustomOptionEvents } from './types/custom-option.js';
|
|
4
4
|
export * from './renderers/contracts.js';
|
|
5
5
|
export * from './engine/index.js';
|
|
@@ -66,6 +66,14 @@ export interface ClearEventDetail {
|
|
|
66
66
|
clearedSelection: boolean;
|
|
67
67
|
clearedSearch: boolean;
|
|
68
68
|
}
|
|
69
|
+
export type EmptyStateReason = 'no-options' | 'no-results';
|
|
70
|
+
export interface EmptyStateContext {
|
|
71
|
+
readonly query: string;
|
|
72
|
+
readonly reason: EmptyStateReason;
|
|
73
|
+
}
|
|
74
|
+
export interface EmptyStateChangeDetail {
|
|
75
|
+
readonly context: EmptyStateContext | null;
|
|
76
|
+
}
|
|
69
77
|
export type LimitationPolicyMap = Partial<Record<KnownLimitationId, LimitationPolicy>>;
|
|
70
78
|
export interface LimitationState {
|
|
71
79
|
id: KnownLimitationId;
|
|
@@ -91,6 +99,7 @@ export interface SelectCapabilitiesReport {
|
|
|
91
99
|
classMap: boolean;
|
|
92
100
|
optionRenderer: boolean;
|
|
93
101
|
groupHeaderRenderer: boolean;
|
|
102
|
+
emptyStateSlot: boolean;
|
|
94
103
|
cssCustomProperties: boolean;
|
|
95
104
|
shadowParts: boolean;
|
|
96
105
|
globalStyleMirroring: boolean;
|
|
@@ -128,6 +137,7 @@ export interface SelectEventsDetailMap {
|
|
|
128
137
|
loadMore: LoadMoreEventDetail;
|
|
129
138
|
remove: RemoveEventDetail;
|
|
130
139
|
clear: ClearEventDetail;
|
|
140
|
+
emptyStateChange: EmptyStateChangeDetail;
|
|
131
141
|
diagnostic: DiagnosticEventDetail;
|
|
132
142
|
}
|
|
133
143
|
export type SelectEventName = keyof SelectEventsDetailMap;
|
package/package.json
CHANGED