@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.js
CHANGED
|
@@ -2719,7 +2719,7 @@ class EnhancedSelect extends HTMLElement {
|
|
|
2719
2719
|
--select-accent: #0f3460;
|
|
2720
2720
|
--select-accent-hover: #e94560;
|
|
2721
2721
|
--select-surface: #ffffff;
|
|
2722
|
-
--select-surface-elevated:
|
|
2722
|
+
--select-surface-elevated: rgba(0, 0, 0, 0.04);
|
|
2723
2723
|
--select-border: #e1e5eb;
|
|
2724
2724
|
--select-border-focus: #0f3460;
|
|
2725
2725
|
--select-text: #1a1a2e;
|
|
@@ -2767,16 +2767,15 @@ class EnhancedSelect extends HTMLElement {
|
|
|
2767
2767
|
--select-multi-input-horizontal-cursor: grab;
|
|
2768
2768
|
--select-multi-input-horizontal-active-cursor: grabbing;
|
|
2769
2769
|
--select-multi-separator-inset-block: 10px;
|
|
2770
|
+
--select-multi-separator-height: auto;
|
|
2770
2771
|
--select-multi-action-surface-bg: var(--select-input-bg, var(--select-surface));
|
|
2771
2772
|
--select-multi-action-divider: 1px solid var(--select-border);
|
|
2772
2773
|
--select-separator-width: 1px;
|
|
2773
|
-
--select-separator-
|
|
2774
|
+
--select-separator-inset-block: 10px;
|
|
2775
|
+
--select-separator-height: auto;
|
|
2774
2776
|
--select-separator-display: block;
|
|
2775
2777
|
--select-separator-opacity: 0.6;
|
|
2776
2778
|
--select-separator-active-opacity: 1;
|
|
2777
|
-
--select-separator-width: 1px;
|
|
2778
|
-
--select-separator-height: 50%;
|
|
2779
|
-
--select-separator-display: block;
|
|
2780
2779
|
--select-separator-position: var(--select-arrow-width, 42px);
|
|
2781
2780
|
--select-separator-position-with-clear: calc(var(--select-arrow-right-with-clear, 34px) + var(--select-arrow-width, 42px));
|
|
2782
2781
|
--select-separator-dark-bg: linear-gradient(
|
|
@@ -2847,9 +2846,9 @@ class EnhancedSelect extends HTMLElement {
|
|
|
2847
2846
|
--select-searching-spinner-size: 24px;
|
|
2848
2847
|
--select-searching-spinner-border: 2px solid var(--select-border);
|
|
2849
2848
|
--select-searching-spinner-animation: var(--select-spinner-animation);
|
|
2850
|
-
--select-group-header-separator-margin-top:
|
|
2851
|
-
--select-group-header-separator-padding-top:
|
|
2852
|
-
--select-group-header-separator-border-top:
|
|
2849
|
+
--select-group-header-separator-margin-top: 0;
|
|
2850
|
+
--select-group-header-separator-padding-top: 0;
|
|
2851
|
+
--select-group-header-separator-border-top: none;
|
|
2853
2852
|
--select-reduced-motion-duration: 0.01ms;
|
|
2854
2853
|
--select-reduced-motion-iteration-count: 1;
|
|
2855
2854
|
--select-high-contrast-border-width: 2px;
|
|
@@ -3109,10 +3108,9 @@ class EnhancedSelect extends HTMLElement {
|
|
|
3109
3108
|
}
|
|
3110
3109
|
|
|
3111
3110
|
.input-container.input-container--multi::after {
|
|
3112
|
-
top: var(--select-multi-separator-inset-block, 10px);
|
|
3113
|
-
bottom: var(--select-multi-separator-inset-block, 10px);
|
|
3114
|
-
height: auto;
|
|
3115
|
-
transform: none;
|
|
3111
|
+
top: var(--select-multi-separator-inset-block, var(--select-separator-inset-block, 10px));
|
|
3112
|
+
bottom: var(--select-multi-separator-inset-block, var(--select-separator-inset-block, 10px));
|
|
3113
|
+
height: var(--select-multi-separator-height, auto);
|
|
3116
3114
|
}
|
|
3117
3115
|
|
|
3118
3116
|
.input-container.input-container--multi[data-multi-scroll-mode="horizontal"] {
|
|
@@ -3179,11 +3177,11 @@ class EnhancedSelect extends HTMLElement {
|
|
|
3179
3177
|
content: '';
|
|
3180
3178
|
display: var(--select-separator-display, block);
|
|
3181
3179
|
position: absolute;
|
|
3182
|
-
top:
|
|
3180
|
+
top: var(--select-separator-inset-block, 10px);
|
|
3181
|
+
bottom: var(--select-separator-inset-block, 10px);
|
|
3183
3182
|
right: var(--select-separator-position, var(--select-arrow-width, 42px));
|
|
3184
|
-
transform: translateY(-50%);
|
|
3185
3183
|
width: var(--select-separator-width, 1px);
|
|
3186
|
-
height: var(--select-separator-height,
|
|
3184
|
+
height: var(--select-separator-height, auto);
|
|
3187
3185
|
background: var(--select-separator-bg, linear-gradient(
|
|
3188
3186
|
to bottom,
|
|
3189
3187
|
transparent 0%,
|
|
@@ -3533,13 +3531,15 @@ class EnhancedSelect extends HTMLElement {
|
|
|
3533
3531
|
color: var(--select-option-color, var(--select-text));
|
|
3534
3532
|
background: var(--select-option-bg, transparent);
|
|
3535
3533
|
border: var(--select-option-border, none);
|
|
3534
|
+
box-sizing: border-box;
|
|
3536
3535
|
text-align: var(--select-option-text-align, start);
|
|
3537
|
-
transition:
|
|
3536
|
+
transition: var(--select-option-transition,
|
|
3538
3537
|
background var(--select-transition-fast),
|
|
3539
3538
|
color var(--select-transition-fast),
|
|
3540
|
-
border
|
|
3539
|
+
border var(--select-transition-fast),
|
|
3541
3540
|
transform var(--select-transition-fast),
|
|
3542
|
-
box-shadow var(--select-transition-fast)
|
|
3541
|
+
box-shadow var(--select-transition-fast)
|
|
3542
|
+
);
|
|
3543
3543
|
user-select: none;
|
|
3544
3544
|
font-size: var(--select-option-font-size, inherit);
|
|
3545
3545
|
font-weight: var(--select-option-font-weight);
|
|
@@ -3549,10 +3549,10 @@ class EnhancedSelect extends HTMLElement {
|
|
|
3549
3549
|
}
|
|
3550
3550
|
|
|
3551
3551
|
.option:hover {
|
|
3552
|
-
background:
|
|
3553
|
-
border:
|
|
3554
|
-
color:
|
|
3555
|
-
transform:
|
|
3552
|
+
background: var(--select-option-hover-bg, var(--select-surface-elevated));
|
|
3553
|
+
border: var(--select-option-hover-border, var(--select-option-border, none));
|
|
3554
|
+
color: var(--select-option-hover-color, var(--select-text));
|
|
3555
|
+
transform: var(--select-option-hover-transform, none);
|
|
3556
3556
|
}
|
|
3557
3557
|
|
|
3558
3558
|
.option.selected {
|
|
@@ -3834,12 +3834,16 @@ class EnhancedSelect extends HTMLElement {
|
|
|
3834
3834
|
|
|
3835
3835
|
--select-option-bg: var(--select-dark-option-bg, transparent);
|
|
3836
3836
|
--select-option-color: var(--select-dark-option-color, var(--select-text));
|
|
3837
|
+
--select-option-border: var(--select-dark-option-border, none);
|
|
3837
3838
|
--select-option-hover-bg: var(--select-dark-option-hover-bg, var(--select-surface-elevated));
|
|
3838
3839
|
--select-option-hover-color: var(--select-dark-option-hover-color, var(--select-text));
|
|
3840
|
+
--select-option-hover-border: var(--select-dark-option-hover-border, var(--select-option-border, none));
|
|
3839
3841
|
--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%));
|
|
3840
3842
|
--select-option-selected-color: var(--select-dark-option-selected-color, #a5b4fc);
|
|
3843
|
+
--select-option-selected-border: var(--select-dark-option-selected-border, var(--select-option-border, none));
|
|
3841
3844
|
--select-option-selected-hover-bg: var(--select-dark-option-selected-hover-bg, var(--select-option-selected-bg));
|
|
3842
3845
|
--select-option-selected-hover-color: var(--select-dark-option-selected-hover-color, var(--select-option-selected-color));
|
|
3846
|
+
--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))));
|
|
3843
3847
|
}
|
|
3844
3848
|
|
|
3845
3849
|
:host(.dark-mode) .input-container,
|
|
@@ -4518,7 +4522,7 @@ class EnhancedSelect extends HTMLElement {
|
|
|
4518
4522
|
case 'End':
|
|
4519
4523
|
e.preventDefault();
|
|
4520
4524
|
if (this._state.isOpen) {
|
|
4521
|
-
const options =
|
|
4525
|
+
const options = this._getSelectableOptions();
|
|
4522
4526
|
const lastIndex = Math.max(0, options.length - 1);
|
|
4523
4527
|
this._setActive(lastIndex);
|
|
4524
4528
|
if (this._config.selection.mode === 'multi' && e.shiftKey) {
|
|
@@ -4573,7 +4577,7 @@ class EnhancedSelect extends HTMLElement {
|
|
|
4573
4577
|
}
|
|
4574
4578
|
}
|
|
4575
4579
|
_moveActive(delta, opts) {
|
|
4576
|
-
const options =
|
|
4580
|
+
const options = this._getSelectableOptions();
|
|
4577
4581
|
const next = Math.max(0, Math.min(options.length - 1, this._state.activeIndex + delta));
|
|
4578
4582
|
this._setActive(next);
|
|
4579
4583
|
if (this._config.selection.mode === 'multi' && opts?.shiftKey) {
|
|
@@ -4627,6 +4631,13 @@ class EnhancedSelect extends HTMLElement {
|
|
|
4627
4631
|
_getOptionElementByIndex(index) {
|
|
4628
4632
|
return this._optionsContainer.querySelector(`[data-index="${index}"]`);
|
|
4629
4633
|
}
|
|
4634
|
+
_getSelectableOptions() {
|
|
4635
|
+
// Filter out group headers and other non-selectable elements
|
|
4636
|
+
// Only return elements with data-index or data-sm-selectable attributes
|
|
4637
|
+
return Array.from(this._optionsContainer.children).filter((child) => {
|
|
4638
|
+
return child.hasAttribute('data-index') || child.hasAttribute('data-sm-selectable');
|
|
4639
|
+
});
|
|
4640
|
+
}
|
|
4630
4641
|
_buildRendererHelpers() {
|
|
4631
4642
|
return {
|
|
4632
4643
|
onSelect: (_item, index) => this._selectOption(index),
|
|
@@ -4661,7 +4672,7 @@ class EnhancedSelect extends HTMLElement {
|
|
|
4661
4672
|
_selectAll() {
|
|
4662
4673
|
if (this._config.selection.mode !== 'multi')
|
|
4663
4674
|
return;
|
|
4664
|
-
const options =
|
|
4675
|
+
const options = this._getSelectableOptions();
|
|
4665
4676
|
const maxSelections = this._config.selection.maxSelections || 0;
|
|
4666
4677
|
options.forEach((option, index) => {
|
|
4667
4678
|
if (maxSelections > 0 && this._state.selectedIndices.size >= maxSelections) {
|
|
@@ -4715,7 +4726,7 @@ class EnhancedSelect extends HTMLElement {
|
|
|
4715
4726
|
this._announce(`${this._state.selectedIndices.size} items selected`);
|
|
4716
4727
|
}
|
|
4717
4728
|
_setInitialActiveOption() {
|
|
4718
|
-
const options =
|
|
4729
|
+
const options = this._getSelectableOptions();
|
|
4719
4730
|
if (options.length === 0)
|
|
4720
4731
|
return;
|
|
4721
4732
|
const selected = Array.from(this._state.selectedIndices).sort((a, b) => a - b);
|