@smilodon/core 1.10.1 → 1.11.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 +18 -0
- package/dist/index.cjs +47 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +47 -22
- 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 +47 -22
- 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 +1 -0
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -2610,14 +2610,13 @@
|
|
|
2610
2610
|
transition: var(--select-option-transition, background-color 0.2s ease);
|
|
2611
2611
|
}
|
|
2612
2612
|
|
|
2613
|
-
:host(:hover
|
|
2613
|
+
:host(:hover:not(.smilodon-option--disabled):not([aria-disabled="true"])),
|
|
2614
2614
|
:host(.smilodon-option--disabled-hoverable:hover) {
|
|
2615
2615
|
background: var(--select-option-hover-bg, #f0f0f0);
|
|
2616
2616
|
color: var(--select-option-hover-color, var(--select-option-color, var(--select-text-color, #1f2937)));
|
|
2617
|
-
|
|
2618
|
-
|
|
2617
|
+
outline: var(--select-option-hover-border, none);
|
|
2618
|
+
outline-offset: -1px;
|
|
2619
2619
|
box-shadow: var(--select-option-hover-shadow, var(--select-option-shadow, none));
|
|
2620
|
-
transform: var(--select-option-hover-transform, var(--select-option-transform, none));
|
|
2621
2620
|
}
|
|
2622
2621
|
|
|
2623
2622
|
/* Keep the visual surface on the host so external utility classes applied
|
|
@@ -2638,10 +2637,9 @@
|
|
|
2638
2637
|
:host(.smilodon-option--selected:hover) {
|
|
2639
2638
|
background: var(--select-option-selected-hover-bg, var(--select-option-selected-bg, #e3f2fd));
|
|
2640
2639
|
color: var(--select-option-selected-hover-color, var(--select-option-selected-color, #1976d2));
|
|
2641
|
-
|
|
2642
|
-
|
|
2640
|
+
outline: var(--select-option-selected-hover-border, var(--select-option-hover-border, none));
|
|
2641
|
+
outline-offset: -1px;
|
|
2643
2642
|
box-shadow: var(--select-option-selected-hover-shadow, var(--select-option-selected-shadow, var(--select-option-shadow, none)));
|
|
2644
|
-
transform: var(--select-option-selected-hover-transform, var(--select-option-selected-transform, var(--select-option-transform, none)));
|
|
2645
2643
|
}
|
|
2646
2644
|
|
|
2647
2645
|
:host(.smilodon-option--active):not(.smilodon-option--disabled):not([aria-disabled="true"]),
|
|
@@ -5498,10 +5496,21 @@
|
|
|
5498
5496
|
const container = document.createElement('div');
|
|
5499
5497
|
container.className = 'dropdown-arrow-container';
|
|
5500
5498
|
container.innerHTML = `
|
|
5501
|
-
<
|
|
5502
|
-
<
|
|
5503
|
-
|
|
5499
|
+
<slot name="arrow">
|
|
5500
|
+
<svg class="dropdown-arrow" part="arrow" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
5501
|
+
<path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5502
|
+
</svg>
|
|
5503
|
+
</slot>
|
|
5504
5504
|
`;
|
|
5505
|
+
const slot = container.querySelector('slot[name="arrow"]');
|
|
5506
|
+
slot?.addEventListener('slotchange', () => {
|
|
5507
|
+
if (slot.assignedElements({ flatten: true }).length > 0) {
|
|
5508
|
+
this.setAttribute('data-custom-arrow', 'true');
|
|
5509
|
+
}
|
|
5510
|
+
else {
|
|
5511
|
+
this.removeAttribute('data-custom-arrow');
|
|
5512
|
+
}
|
|
5513
|
+
});
|
|
5505
5514
|
return container;
|
|
5506
5515
|
}
|
|
5507
5516
|
_createClearControl() {
|
|
@@ -5657,7 +5666,7 @@
|
|
|
5657
5666
|
--select-scrollbar-width: 6px;
|
|
5658
5667
|
--select-scrollbar-thumb-radius: 3px;
|
|
5659
5668
|
--select-option-hover-enabled: 1;
|
|
5660
|
-
--select-option-hover-transform:
|
|
5669
|
+
--select-option-hover-transform: none;
|
|
5661
5670
|
--select-option-font-weight: 450;
|
|
5662
5671
|
--select-option-margin: 2px 0;
|
|
5663
5672
|
--select-input-font-size: inherit;
|
|
@@ -6216,6 +6225,10 @@
|
|
|
6216
6225
|
.dropdown-arrow-container:hover {
|
|
6217
6226
|
background-color: var(--select-arrow-hover-bg, rgba(15, 52, 96, 0.05));
|
|
6218
6227
|
}
|
|
6228
|
+
|
|
6229
|
+
:host([data-custom-arrow="true"]) .dropdown-arrow-container:hover {
|
|
6230
|
+
background-color: transparent;
|
|
6231
|
+
}
|
|
6219
6232
|
|
|
6220
6233
|
.dropdown-arrow {
|
|
6221
6234
|
width: var(--select-arrow-width, var(--select-arrow-size, 16px));
|
|
@@ -6437,8 +6450,7 @@
|
|
|
6437
6450
|
transition: var(--select-option-transition,
|
|
6438
6451
|
background var(--select-transition-fast),
|
|
6439
6452
|
color var(--select-transition-fast),
|
|
6440
|
-
|
|
6441
|
-
transform var(--select-transition-fast),
|
|
6453
|
+
outline-color var(--select-transition-fast),
|
|
6442
6454
|
box-shadow var(--select-transition-fast)
|
|
6443
6455
|
);
|
|
6444
6456
|
user-select: none;
|
|
@@ -6452,9 +6464,10 @@
|
|
|
6452
6464
|
.option:hover:not(.disabled):not(.smilodon-option--disabled),
|
|
6453
6465
|
.option.smilodon-option--disabled-hoverable:hover {
|
|
6454
6466
|
background: var(--select-option-hover-bg, var(--select-surface-elevated));
|
|
6455
|
-
|
|
6467
|
+
/* Hover decoration must not resize or translate the pointer hit target. */
|
|
6468
|
+
outline: var(--select-option-hover-border, none);
|
|
6469
|
+
outline-offset: -1px;
|
|
6456
6470
|
color: var(--select-option-hover-color, var(--select-text));
|
|
6457
|
-
transform: var(--select-option-hover-transform, none);
|
|
6458
6471
|
}
|
|
6459
6472
|
|
|
6460
6473
|
.option.selected {
|
|
@@ -6497,7 +6510,8 @@
|
|
|
6497
6510
|
|
|
6498
6511
|
.option.selected:hover {
|
|
6499
6512
|
background: var(--select-option-selected-hover-bg, var(--select-option-selected-bg, linear-gradient(135deg, rgba(15, 52, 96, 0.12) 0%, rgba(15, 52, 96, 0.06) 100%)));
|
|
6500
|
-
|
|
6513
|
+
outline: var(--select-option-selected-hover-border, var(--select-option-hover-border, none));
|
|
6514
|
+
outline-offset: -1px;
|
|
6501
6515
|
color: var(--select-option-selected-hover-color, var(--select-option-selected-color, var(--select-accent)));
|
|
6502
6516
|
}
|
|
6503
6517
|
|
|
@@ -7927,7 +7941,9 @@
|
|
|
7927
7941
|
_setInitialActiveOption() {
|
|
7928
7942
|
const selectableIndices = this._getSelectableOptionIndices();
|
|
7929
7943
|
const selected = Array.from(this._state.selectedIndices).sort((a, b) => a - b);
|
|
7930
|
-
|
|
7944
|
+
// Opening an empty select must not implicitly assign an active descendant.
|
|
7945
|
+
// Keyboard navigation and pointer interaction establish active identity.
|
|
7946
|
+
if (selectableIndices.length === 0 || selected.length === 0) {
|
|
7931
7947
|
this._dispatchActiveKey(null, 'open', 'initial active option');
|
|
7932
7948
|
return;
|
|
7933
7949
|
}
|
|
@@ -8153,6 +8169,11 @@
|
|
|
8153
8169
|
}
|
|
8154
8170
|
this._syncClearControlState();
|
|
8155
8171
|
}
|
|
8172
|
+
_isActivelyEditingSearchInput() {
|
|
8173
|
+
return this._config.searchable === true
|
|
8174
|
+
&& this._state.isOpen
|
|
8175
|
+
&& this._shadow.activeElement === this._input;
|
|
8176
|
+
}
|
|
8156
8177
|
_renderOptionsWithAnimation() {
|
|
8157
8178
|
// Add fade-out animation
|
|
8158
8179
|
this._optionsContainer.style.opacity = '0';
|
|
@@ -8462,7 +8483,7 @@
|
|
|
8462
8483
|
const previousLength = this._state.loadedItems.length;
|
|
8463
8484
|
this._rebuildItemRegistry(items);
|
|
8464
8485
|
this._state.groupedItems = this._groupItemsByProperty(items);
|
|
8465
|
-
if (!this._state.searchQuery)
|
|
8486
|
+
if (!this._state.searchQuery && !this._isActivelyEditingSearchInput())
|
|
8466
8487
|
this._updateInputDisplay();
|
|
8467
8488
|
const newLength = this._state.loadedItems.length;
|
|
8468
8489
|
if (this._dataRequestCoordinator) {
|
|
@@ -8543,7 +8564,7 @@
|
|
|
8543
8564
|
this._rebuildItemRegistry(groupedItems.flatMap(group => group.options));
|
|
8544
8565
|
this._state.groupedItems = groupedItems;
|
|
8545
8566
|
this._renderOptions();
|
|
8546
|
-
if (!this._state.searchQuery)
|
|
8567
|
+
if (!this._state.searchQuery && !this._isActivelyEditingSearchInput())
|
|
8547
8568
|
this._updateInputDisplay();
|
|
8548
8569
|
}
|
|
8549
8570
|
/**
|
|
@@ -8759,14 +8780,16 @@
|
|
|
8759
8780
|
// Re-initialize observers in case infinite scroll was enabled/disabled
|
|
8760
8781
|
this._initializeObservers();
|
|
8761
8782
|
this._syncClearControlState();
|
|
8762
|
-
this.
|
|
8783
|
+
if (!this._isActivelyEditingSearchInput())
|
|
8784
|
+
this._updateInputDisplay();
|
|
8763
8785
|
this._renderOptions();
|
|
8764
8786
|
}
|
|
8765
8787
|
else {
|
|
8766
8788
|
this._syncInputContainerMode();
|
|
8767
8789
|
this._syncMultiSelectDisplayConfig();
|
|
8768
8790
|
this._syncClearControlState();
|
|
8769
|
-
this.
|
|
8791
|
+
if (!this._isActivelyEditingSearchInput())
|
|
8792
|
+
this._updateInputDisplay();
|
|
8770
8793
|
}
|
|
8771
8794
|
this._acknowledgedSearchMode = this._dataLoadingConfig.searchMode;
|
|
8772
8795
|
if (this._dataLoadingConfig.protocol === 'legacy')
|
|
@@ -9579,7 +9602,9 @@
|
|
|
9579
9602
|
this._acknowledgedProjectionFailureStageForTest = null;
|
|
9580
9603
|
throw new Error('Injected acknowledged projection failure after publication');
|
|
9581
9604
|
}
|
|
9582
|
-
if (!this._state.searchQuery
|
|
9605
|
+
if (!this._state.searchQuery
|
|
9606
|
+
&& this._acknowledgedPendingSearchQuery === null
|
|
9607
|
+
&& !this._isActivelyEditingSearchInput()) {
|
|
9583
9608
|
this._updateInputDisplay();
|
|
9584
9609
|
}
|
|
9585
9610
|
this._syncListboxAccessibility();
|