@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/README.md
CHANGED
|
@@ -794,13 +794,16 @@ Full control over the vertical separator line (works in all modes):
|
|
|
794
794
|
```css
|
|
795
795
|
enhanced-select {
|
|
796
796
|
--select-separator-width: 2px; /* Line thickness */
|
|
797
|
-
--select-separator-height: 60%; /* Line height (% of container) */
|
|
797
|
+
--select-separator-height: 60%; /* Line height for single-select (% of container) */
|
|
798
|
+
--select-multi-separator-height: 40px; /* Fixed height for multi-select (default: auto) */
|
|
798
799
|
--select-separator-display: none; /* Hide separator completely */
|
|
799
800
|
--select-separator-bg: #e5e7eb; /* Custom color/gradient */
|
|
800
801
|
--select-separator-opacity: 0.8; /* Line opacity */
|
|
801
802
|
}
|
|
802
803
|
```
|
|
803
804
|
|
|
805
|
+
**Note:** Multi-select uses `--select-multi-separator-height` (default: `auto` to stretch with container). Set a fixed pixel value like `40px` to maintain consistent separator height regardless of how many items are selected.
|
|
806
|
+
|
|
804
807
|
#### Input & Badge Typography
|
|
805
808
|
|
|
806
809
|
```css
|
package/dist/index.cjs
CHANGED
|
@@ -2721,7 +2721,7 @@ class EnhancedSelect extends HTMLElement {
|
|
|
2721
2721
|
--select-accent: #0f3460;
|
|
2722
2722
|
--select-accent-hover: #e94560;
|
|
2723
2723
|
--select-surface: #ffffff;
|
|
2724
|
-
--select-surface-elevated:
|
|
2724
|
+
--select-surface-elevated: rgba(0, 0, 0, 0.04);
|
|
2725
2725
|
--select-border: #e1e5eb;
|
|
2726
2726
|
--select-border-focus: #0f3460;
|
|
2727
2727
|
--select-text: #1a1a2e;
|
|
@@ -2769,16 +2769,15 @@ class EnhancedSelect extends HTMLElement {
|
|
|
2769
2769
|
--select-multi-input-horizontal-cursor: grab;
|
|
2770
2770
|
--select-multi-input-horizontal-active-cursor: grabbing;
|
|
2771
2771
|
--select-multi-separator-inset-block: 10px;
|
|
2772
|
+
--select-multi-separator-height: auto;
|
|
2772
2773
|
--select-multi-action-surface-bg: var(--select-input-bg, var(--select-surface));
|
|
2773
2774
|
--select-multi-action-divider: 1px solid var(--select-border);
|
|
2774
2775
|
--select-separator-width: 1px;
|
|
2775
|
-
--select-separator-
|
|
2776
|
+
--select-separator-inset-block: 10px;
|
|
2777
|
+
--select-separator-height: auto;
|
|
2776
2778
|
--select-separator-display: block;
|
|
2777
2779
|
--select-separator-opacity: 0.6;
|
|
2778
2780
|
--select-separator-active-opacity: 1;
|
|
2779
|
-
--select-separator-width: 1px;
|
|
2780
|
-
--select-separator-height: 50%;
|
|
2781
|
-
--select-separator-display: block;
|
|
2782
2781
|
--select-separator-position: var(--select-arrow-width, 42px);
|
|
2783
2782
|
--select-separator-position-with-clear: calc(var(--select-arrow-right-with-clear, 34px) + var(--select-arrow-width, 42px));
|
|
2784
2783
|
--select-separator-dark-bg: linear-gradient(
|
|
@@ -2849,9 +2848,9 @@ class EnhancedSelect extends HTMLElement {
|
|
|
2849
2848
|
--select-searching-spinner-size: 24px;
|
|
2850
2849
|
--select-searching-spinner-border: 2px solid var(--select-border);
|
|
2851
2850
|
--select-searching-spinner-animation: var(--select-spinner-animation);
|
|
2852
|
-
--select-group-header-separator-margin-top:
|
|
2853
|
-
--select-group-header-separator-padding-top:
|
|
2854
|
-
--select-group-header-separator-border-top:
|
|
2851
|
+
--select-group-header-separator-margin-top: 0;
|
|
2852
|
+
--select-group-header-separator-padding-top: 0;
|
|
2853
|
+
--select-group-header-separator-border-top: none;
|
|
2855
2854
|
--select-reduced-motion-duration: 0.01ms;
|
|
2856
2855
|
--select-reduced-motion-iteration-count: 1;
|
|
2857
2856
|
--select-high-contrast-border-width: 2px;
|
|
@@ -3111,10 +3110,9 @@ class EnhancedSelect extends HTMLElement {
|
|
|
3111
3110
|
}
|
|
3112
3111
|
|
|
3113
3112
|
.input-container.input-container--multi::after {
|
|
3114
|
-
top: var(--select-multi-separator-inset-block, 10px);
|
|
3115
|
-
bottom: var(--select-multi-separator-inset-block, 10px);
|
|
3116
|
-
height: auto;
|
|
3117
|
-
transform: none;
|
|
3113
|
+
top: var(--select-multi-separator-inset-block, var(--select-separator-inset-block, 10px));
|
|
3114
|
+
bottom: var(--select-multi-separator-inset-block, var(--select-separator-inset-block, 10px));
|
|
3115
|
+
height: var(--select-multi-separator-height, auto);
|
|
3118
3116
|
}
|
|
3119
3117
|
|
|
3120
3118
|
.input-container.input-container--multi[data-multi-scroll-mode="horizontal"] {
|
|
@@ -3181,11 +3179,11 @@ class EnhancedSelect extends HTMLElement {
|
|
|
3181
3179
|
content: '';
|
|
3182
3180
|
display: var(--select-separator-display, block);
|
|
3183
3181
|
position: absolute;
|
|
3184
|
-
top:
|
|
3182
|
+
top: var(--select-separator-inset-block, 10px);
|
|
3183
|
+
bottom: var(--select-separator-inset-block, 10px);
|
|
3185
3184
|
right: var(--select-separator-position, var(--select-arrow-width, 42px));
|
|
3186
|
-
transform: translateY(-50%);
|
|
3187
3185
|
width: var(--select-separator-width, 1px);
|
|
3188
|
-
height: var(--select-separator-height,
|
|
3186
|
+
height: var(--select-separator-height, auto);
|
|
3189
3187
|
background: var(--select-separator-bg, linear-gradient(
|
|
3190
3188
|
to bottom,
|
|
3191
3189
|
transparent 0%,
|
|
@@ -3535,13 +3533,15 @@ class EnhancedSelect extends HTMLElement {
|
|
|
3535
3533
|
color: var(--select-option-color, var(--select-text));
|
|
3536
3534
|
background: var(--select-option-bg, transparent);
|
|
3537
3535
|
border: var(--select-option-border, none);
|
|
3536
|
+
box-sizing: border-box;
|
|
3538
3537
|
text-align: var(--select-option-text-align, start);
|
|
3539
|
-
transition:
|
|
3538
|
+
transition: var(--select-option-transition,
|
|
3540
3539
|
background var(--select-transition-fast),
|
|
3541
3540
|
color var(--select-transition-fast),
|
|
3542
|
-
border
|
|
3541
|
+
border var(--select-transition-fast),
|
|
3543
3542
|
transform var(--select-transition-fast),
|
|
3544
|
-
box-shadow var(--select-transition-fast)
|
|
3543
|
+
box-shadow var(--select-transition-fast)
|
|
3544
|
+
);
|
|
3545
3545
|
user-select: none;
|
|
3546
3546
|
font-size: var(--select-option-font-size, inherit);
|
|
3547
3547
|
font-weight: var(--select-option-font-weight);
|
|
@@ -3551,10 +3551,10 @@ class EnhancedSelect extends HTMLElement {
|
|
|
3551
3551
|
}
|
|
3552
3552
|
|
|
3553
3553
|
.option:hover {
|
|
3554
|
-
background:
|
|
3555
|
-
border:
|
|
3556
|
-
color:
|
|
3557
|
-
transform:
|
|
3554
|
+
background: var(--select-option-hover-bg, var(--select-surface-elevated));
|
|
3555
|
+
border: var(--select-option-hover-border, var(--select-option-border, none));
|
|
3556
|
+
color: var(--select-option-hover-color, var(--select-text));
|
|
3557
|
+
transform: var(--select-option-hover-transform, none);
|
|
3558
3558
|
}
|
|
3559
3559
|
|
|
3560
3560
|
.option.selected {
|
|
@@ -3836,12 +3836,16 @@ class EnhancedSelect extends HTMLElement {
|
|
|
3836
3836
|
|
|
3837
3837
|
--select-option-bg: var(--select-dark-option-bg, transparent);
|
|
3838
3838
|
--select-option-color: var(--select-dark-option-color, var(--select-text));
|
|
3839
|
+
--select-option-border: var(--select-dark-option-border, none);
|
|
3839
3840
|
--select-option-hover-bg: var(--select-dark-option-hover-bg, var(--select-surface-elevated));
|
|
3840
3841
|
--select-option-hover-color: var(--select-dark-option-hover-color, var(--select-text));
|
|
3842
|
+
--select-option-hover-border: var(--select-dark-option-hover-border, var(--select-option-border, none));
|
|
3841
3843
|
--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%));
|
|
3842
3844
|
--select-option-selected-color: var(--select-dark-option-selected-color, #a5b4fc);
|
|
3845
|
+
--select-option-selected-border: var(--select-dark-option-selected-border, var(--select-option-border, none));
|
|
3843
3846
|
--select-option-selected-hover-bg: var(--select-dark-option-selected-hover-bg, var(--select-option-selected-bg));
|
|
3844
3847
|
--select-option-selected-hover-color: var(--select-dark-option-selected-hover-color, var(--select-option-selected-color));
|
|
3848
|
+
--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))));
|
|
3845
3849
|
}
|
|
3846
3850
|
|
|
3847
3851
|
:host(.dark-mode) .input-container,
|
|
@@ -4520,7 +4524,7 @@ class EnhancedSelect extends HTMLElement {
|
|
|
4520
4524
|
case 'End':
|
|
4521
4525
|
e.preventDefault();
|
|
4522
4526
|
if (this._state.isOpen) {
|
|
4523
|
-
const options =
|
|
4527
|
+
const options = this._getSelectableOptions();
|
|
4524
4528
|
const lastIndex = Math.max(0, options.length - 1);
|
|
4525
4529
|
this._setActive(lastIndex);
|
|
4526
4530
|
if (this._config.selection.mode === 'multi' && e.shiftKey) {
|
|
@@ -4575,7 +4579,7 @@ class EnhancedSelect extends HTMLElement {
|
|
|
4575
4579
|
}
|
|
4576
4580
|
}
|
|
4577
4581
|
_moveActive(delta, opts) {
|
|
4578
|
-
const options =
|
|
4582
|
+
const options = this._getSelectableOptions();
|
|
4579
4583
|
const next = Math.max(0, Math.min(options.length - 1, this._state.activeIndex + delta));
|
|
4580
4584
|
this._setActive(next);
|
|
4581
4585
|
if (this._config.selection.mode === 'multi' && opts?.shiftKey) {
|
|
@@ -4629,6 +4633,13 @@ class EnhancedSelect extends HTMLElement {
|
|
|
4629
4633
|
_getOptionElementByIndex(index) {
|
|
4630
4634
|
return this._optionsContainer.querySelector(`[data-index="${index}"]`);
|
|
4631
4635
|
}
|
|
4636
|
+
_getSelectableOptions() {
|
|
4637
|
+
// Filter out group headers and other non-selectable elements
|
|
4638
|
+
// Only return elements with data-index or data-sm-selectable attributes
|
|
4639
|
+
return Array.from(this._optionsContainer.children).filter((child) => {
|
|
4640
|
+
return child.hasAttribute('data-index') || child.hasAttribute('data-sm-selectable');
|
|
4641
|
+
});
|
|
4642
|
+
}
|
|
4632
4643
|
_buildRendererHelpers() {
|
|
4633
4644
|
return {
|
|
4634
4645
|
onSelect: (_item, index) => this._selectOption(index),
|
|
@@ -4663,7 +4674,7 @@ class EnhancedSelect extends HTMLElement {
|
|
|
4663
4674
|
_selectAll() {
|
|
4664
4675
|
if (this._config.selection.mode !== 'multi')
|
|
4665
4676
|
return;
|
|
4666
|
-
const options =
|
|
4677
|
+
const options = this._getSelectableOptions();
|
|
4667
4678
|
const maxSelections = this._config.selection.maxSelections || 0;
|
|
4668
4679
|
options.forEach((option, index) => {
|
|
4669
4680
|
if (maxSelections > 0 && this._state.selectedIndices.size >= maxSelections) {
|
|
@@ -4717,7 +4728,7 @@ class EnhancedSelect extends HTMLElement {
|
|
|
4717
4728
|
this._announce(`${this._state.selectedIndices.size} items selected`);
|
|
4718
4729
|
}
|
|
4719
4730
|
_setInitialActiveOption() {
|
|
4720
|
-
const options =
|
|
4731
|
+
const options = this._getSelectableOptions();
|
|
4721
4732
|
if (options.length === 0)
|
|
4722
4733
|
return;
|
|
4723
4734
|
const selected = Array.from(this._state.selectedIndices).sort((a, b) => a - b);
|