@smilodon/core 1.5.1 → 1.5.3
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 +4 -1
- package/dist/index.cjs +37 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -26
- 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 +37 -26
- 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
|
@@ -2725,7 +2725,7 @@
|
|
|
2725
2725
|
--select-accent: #0f3460;
|
|
2726
2726
|
--select-accent-hover: #e94560;
|
|
2727
2727
|
--select-surface: #ffffff;
|
|
2728
|
-
--select-surface-elevated:
|
|
2728
|
+
--select-surface-elevated: rgba(0, 0, 0, 0.04);
|
|
2729
2729
|
--select-border: #e1e5eb;
|
|
2730
2730
|
--select-border-focus: #0f3460;
|
|
2731
2731
|
--select-text: #1a1a2e;
|
|
@@ -2773,16 +2773,15 @@
|
|
|
2773
2773
|
--select-multi-input-horizontal-cursor: grab;
|
|
2774
2774
|
--select-multi-input-horizontal-active-cursor: grabbing;
|
|
2775
2775
|
--select-multi-separator-inset-block: 10px;
|
|
2776
|
+
--select-multi-separator-height: auto;
|
|
2776
2777
|
--select-multi-action-surface-bg: var(--select-input-bg, var(--select-surface));
|
|
2777
2778
|
--select-multi-action-divider: 1px solid var(--select-border);
|
|
2778
2779
|
--select-separator-width: 1px;
|
|
2779
|
-
--select-separator-
|
|
2780
|
+
--select-separator-inset-block: 10px;
|
|
2781
|
+
--select-separator-height: auto;
|
|
2780
2782
|
--select-separator-display: block;
|
|
2781
2783
|
--select-separator-opacity: 0.6;
|
|
2782
2784
|
--select-separator-active-opacity: 1;
|
|
2783
|
-
--select-separator-width: 1px;
|
|
2784
|
-
--select-separator-height: 50%;
|
|
2785
|
-
--select-separator-display: block;
|
|
2786
2785
|
--select-separator-position: var(--select-arrow-width, 42px);
|
|
2787
2786
|
--select-separator-position-with-clear: calc(var(--select-arrow-right-with-clear, 34px) + var(--select-arrow-width, 42px));
|
|
2788
2787
|
--select-separator-dark-bg: linear-gradient(
|
|
@@ -2853,9 +2852,9 @@
|
|
|
2853
2852
|
--select-searching-spinner-size: 24px;
|
|
2854
2853
|
--select-searching-spinner-border: 2px solid var(--select-border);
|
|
2855
2854
|
--select-searching-spinner-animation: var(--select-spinner-animation);
|
|
2856
|
-
--select-group-header-separator-margin-top:
|
|
2857
|
-
--select-group-header-separator-padding-top:
|
|
2858
|
-
--select-group-header-separator-border-top:
|
|
2855
|
+
--select-group-header-separator-margin-top: 0;
|
|
2856
|
+
--select-group-header-separator-padding-top: 0;
|
|
2857
|
+
--select-group-header-separator-border-top: none;
|
|
2859
2858
|
--select-reduced-motion-duration: 0.01ms;
|
|
2860
2859
|
--select-reduced-motion-iteration-count: 1;
|
|
2861
2860
|
--select-high-contrast-border-width: 2px;
|
|
@@ -3115,10 +3114,9 @@
|
|
|
3115
3114
|
}
|
|
3116
3115
|
|
|
3117
3116
|
.input-container.input-container--multi::after {
|
|
3118
|
-
top: var(--select-multi-separator-inset-block, 10px);
|
|
3119
|
-
bottom: var(--select-multi-separator-inset-block, 10px);
|
|
3120
|
-
height: auto;
|
|
3121
|
-
transform: none;
|
|
3117
|
+
top: var(--select-multi-separator-inset-block, var(--select-separator-inset-block, 10px));
|
|
3118
|
+
bottom: var(--select-multi-separator-inset-block, var(--select-separator-inset-block, 10px));
|
|
3119
|
+
height: var(--select-multi-separator-height, auto);
|
|
3122
3120
|
}
|
|
3123
3121
|
|
|
3124
3122
|
.input-container.input-container--multi[data-multi-scroll-mode="horizontal"] {
|
|
@@ -3185,11 +3183,11 @@
|
|
|
3185
3183
|
content: '';
|
|
3186
3184
|
display: var(--select-separator-display, block);
|
|
3187
3185
|
position: absolute;
|
|
3188
|
-
top:
|
|
3186
|
+
top: var(--select-separator-inset-block, 10px);
|
|
3187
|
+
bottom: var(--select-separator-inset-block, 10px);
|
|
3189
3188
|
right: var(--select-separator-position, var(--select-arrow-width, 42px));
|
|
3190
|
-
transform: translateY(-50%);
|
|
3191
3189
|
width: var(--select-separator-width, 1px);
|
|
3192
|
-
height: var(--select-separator-height,
|
|
3190
|
+
height: var(--select-separator-height, auto);
|
|
3193
3191
|
background: var(--select-separator-bg, linear-gradient(
|
|
3194
3192
|
to bottom,
|
|
3195
3193
|
transparent 0%,
|
|
@@ -3539,13 +3537,15 @@
|
|
|
3539
3537
|
color: var(--select-option-color, var(--select-text));
|
|
3540
3538
|
background: var(--select-option-bg, transparent);
|
|
3541
3539
|
border: var(--select-option-border, none);
|
|
3540
|
+
box-sizing: border-box;
|
|
3542
3541
|
text-align: var(--select-option-text-align, start);
|
|
3543
|
-
transition:
|
|
3542
|
+
transition: var(--select-option-transition,
|
|
3544
3543
|
background var(--select-transition-fast),
|
|
3545
3544
|
color var(--select-transition-fast),
|
|
3546
|
-
border
|
|
3545
|
+
border var(--select-transition-fast),
|
|
3547
3546
|
transform var(--select-transition-fast),
|
|
3548
|
-
box-shadow var(--select-transition-fast)
|
|
3547
|
+
box-shadow var(--select-transition-fast)
|
|
3548
|
+
);
|
|
3549
3549
|
user-select: none;
|
|
3550
3550
|
font-size: var(--select-option-font-size, inherit);
|
|
3551
3551
|
font-weight: var(--select-option-font-weight);
|
|
@@ -3555,10 +3555,10 @@
|
|
|
3555
3555
|
}
|
|
3556
3556
|
|
|
3557
3557
|
.option:hover {
|
|
3558
|
-
background:
|
|
3559
|
-
border:
|
|
3560
|
-
color:
|
|
3561
|
-
transform:
|
|
3558
|
+
background: var(--select-option-hover-bg, var(--select-surface-elevated));
|
|
3559
|
+
border: var(--select-option-hover-border, var(--select-option-border, none));
|
|
3560
|
+
color: var(--select-option-hover-color, var(--select-text));
|
|
3561
|
+
transform: var(--select-option-hover-transform, none);
|
|
3562
3562
|
}
|
|
3563
3563
|
|
|
3564
3564
|
.option.selected {
|
|
@@ -3840,12 +3840,16 @@
|
|
|
3840
3840
|
|
|
3841
3841
|
--select-option-bg: var(--select-dark-option-bg, transparent);
|
|
3842
3842
|
--select-option-color: var(--select-dark-option-color, var(--select-text));
|
|
3843
|
+
--select-option-border: var(--select-dark-option-border, none);
|
|
3843
3844
|
--select-option-hover-bg: var(--select-dark-option-hover-bg, var(--select-surface-elevated));
|
|
3844
3845
|
--select-option-hover-color: var(--select-dark-option-hover-color, var(--select-text));
|
|
3846
|
+
--select-option-hover-border: var(--select-dark-option-hover-border, var(--select-option-border, none));
|
|
3845
3847
|
--select-option-selected-bg: var(--select-dark-option-selected-bg, linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.08) 100%));
|
|
3846
3848
|
--select-option-selected-color: var(--select-dark-option-selected-color, #a5b4fc);
|
|
3849
|
+
--select-option-selected-border: var(--select-dark-option-selected-border, var(--select-option-border, none));
|
|
3847
3850
|
--select-option-selected-hover-bg: var(--select-dark-option-selected-hover-bg, var(--select-option-selected-bg));
|
|
3848
3851
|
--select-option-selected-hover-color: var(--select-dark-option-selected-hover-color, var(--select-option-selected-color));
|
|
3852
|
+
--select-option-selected-hover-border: var(--select-dark-option-selected-hover-border, var(--select-option-selected-border, var(--select-option-hover-border, var(--select-option-border, none))));
|
|
3849
3853
|
}
|
|
3850
3854
|
|
|
3851
3855
|
:host(.dark-mode) .input-container,
|
|
@@ -4524,7 +4528,7 @@
|
|
|
4524
4528
|
case 'End':
|
|
4525
4529
|
e.preventDefault();
|
|
4526
4530
|
if (this._state.isOpen) {
|
|
4527
|
-
const options =
|
|
4531
|
+
const options = this._getSelectableOptions();
|
|
4528
4532
|
const lastIndex = Math.max(0, options.length - 1);
|
|
4529
4533
|
this._setActive(lastIndex);
|
|
4530
4534
|
if (this._config.selection.mode === 'multi' && e.shiftKey) {
|
|
@@ -4579,7 +4583,7 @@
|
|
|
4579
4583
|
}
|
|
4580
4584
|
}
|
|
4581
4585
|
_moveActive(delta, opts) {
|
|
4582
|
-
const options =
|
|
4586
|
+
const options = this._getSelectableOptions();
|
|
4583
4587
|
const next = Math.max(0, Math.min(options.length - 1, this._state.activeIndex + delta));
|
|
4584
4588
|
this._setActive(next);
|
|
4585
4589
|
if (this._config.selection.mode === 'multi' && opts?.shiftKey) {
|
|
@@ -4633,6 +4637,13 @@
|
|
|
4633
4637
|
_getOptionElementByIndex(index) {
|
|
4634
4638
|
return this._optionsContainer.querySelector(`[data-index="${index}"]`);
|
|
4635
4639
|
}
|
|
4640
|
+
_getSelectableOptions() {
|
|
4641
|
+
// Filter out group headers and other non-selectable elements
|
|
4642
|
+
// Only return elements with data-index or data-sm-selectable attributes
|
|
4643
|
+
return Array.from(this._optionsContainer.children).filter((child) => {
|
|
4644
|
+
return child.hasAttribute('data-index') || child.hasAttribute('data-sm-selectable');
|
|
4645
|
+
});
|
|
4646
|
+
}
|
|
4636
4647
|
_buildRendererHelpers() {
|
|
4637
4648
|
return {
|
|
4638
4649
|
onSelect: (_item, index) => this._selectOption(index),
|
|
@@ -4667,7 +4678,7 @@
|
|
|
4667
4678
|
_selectAll() {
|
|
4668
4679
|
if (this._config.selection.mode !== 'multi')
|
|
4669
4680
|
return;
|
|
4670
|
-
const options =
|
|
4681
|
+
const options = this._getSelectableOptions();
|
|
4671
4682
|
const maxSelections = this._config.selection.maxSelections || 0;
|
|
4672
4683
|
options.forEach((option, index) => {
|
|
4673
4684
|
if (maxSelections > 0 && this._state.selectedIndices.size >= maxSelections) {
|
|
@@ -4721,7 +4732,7 @@
|
|
|
4721
4732
|
this._announce(`${this._state.selectedIndices.size} items selected`);
|
|
4722
4733
|
}
|
|
4723
4734
|
_setInitialActiveOption() {
|
|
4724
|
-
const options =
|
|
4735
|
+
const options = this._getSelectableOptions();
|
|
4725
4736
|
if (options.length === 0)
|
|
4726
4737
|
return;
|
|
4727
4738
|
const selected = Array.from(this._state.selectedIndices).sort((a, b) => a - b);
|