@smilodon/core 1.5.0 → 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 +116 -0
- package/dist/index.cjs +96 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +96 -27
- 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 +96 -27
- 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,8 +2773,13 @@
|
|
|
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);
|
|
2779
|
+
--select-separator-width: 1px;
|
|
2780
|
+
--select-separator-inset-block: 10px;
|
|
2781
|
+
--select-separator-height: auto;
|
|
2782
|
+
--select-separator-display: block;
|
|
2778
2783
|
--select-separator-opacity: 0.6;
|
|
2779
2784
|
--select-separator-active-opacity: 1;
|
|
2780
2785
|
--select-separator-position: var(--select-arrow-width, 42px);
|
|
@@ -2805,9 +2810,16 @@
|
|
|
2805
2810
|
--select-dropdown-transform-origin: top center;
|
|
2806
2811
|
--select-scrollbar-width: 6px;
|
|
2807
2812
|
--select-scrollbar-thumb-radius: 3px;
|
|
2813
|
+
--select-option-hover-enabled: 1;
|
|
2808
2814
|
--select-option-hover-transform: translateX(2px);
|
|
2809
2815
|
--select-option-font-weight: 450;
|
|
2810
2816
|
--select-option-margin: 2px 0;
|
|
2817
|
+
--select-input-font-size: inherit;
|
|
2818
|
+
--select-input-font-weight: 400;
|
|
2819
|
+
--select-multi-container-padding: 6px;
|
|
2820
|
+
--select-input-font-size: inherit;
|
|
2821
|
+
--select-input-font-weight: 400;
|
|
2822
|
+
--select-multi-container-padding: 6px;
|
|
2811
2823
|
--select-option-disabled-opacity: 0.5;
|
|
2812
2824
|
--select-option-disabled-cursor: not-allowed;
|
|
2813
2825
|
--select-option-active-outline-offset: -2px;
|
|
@@ -2840,9 +2852,9 @@
|
|
|
2840
2852
|
--select-searching-spinner-size: 24px;
|
|
2841
2853
|
--select-searching-spinner-border: 2px solid var(--select-border);
|
|
2842
2854
|
--select-searching-spinner-animation: var(--select-spinner-animation);
|
|
2843
|
-
--select-group-header-separator-margin-top:
|
|
2844
|
-
--select-group-header-separator-padding-top:
|
|
2845
|
-
--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;
|
|
2846
2858
|
--select-reduced-motion-duration: 0.01ms;
|
|
2847
2859
|
--select-reduced-motion-iteration-count: 1;
|
|
2848
2860
|
--select-high-contrast-border-width: 2px;
|
|
@@ -3044,9 +3056,13 @@
|
|
|
3044
3056
|
min-height: var(--select-input-min-height, 48px);
|
|
3045
3057
|
max-height: var(--select-input-max-height, 160px);
|
|
3046
3058
|
overflow: hidden;
|
|
3059
|
+
padding: var(--select-multi-container-padding, 6px);
|
|
3047
3060
|
align-content: var(--select-input-align-content, center);
|
|
3048
3061
|
text-align: var(--select-input-text-align, start);
|
|
3049
3062
|
background: var(--select-input-bg, var(--select-surface));
|
|
3063
|
+
font-size: var(--select-input-font-size, inherit);
|
|
3064
|
+
font-weight: var(--select-input-font-weight, 400);
|
|
3065
|
+
font-weight: var(--select-input-font-weight, 400);
|
|
3050
3066
|
border: var(--select-input-border, 1.5px solid var(--select-border));
|
|
3051
3067
|
border-radius: var(--select-input-border-radius, var(--select-radius-md));
|
|
3052
3068
|
box-shadow: var(--select-shadow-sm);
|
|
@@ -3098,10 +3114,9 @@
|
|
|
3098
3114
|
}
|
|
3099
3115
|
|
|
3100
3116
|
.input-container.input-container--multi::after {
|
|
3101
|
-
top: var(--select-multi-separator-inset-block, 10px);
|
|
3102
|
-
bottom: var(--select-multi-separator-inset-block, 10px);
|
|
3103
|
-
height: auto;
|
|
3104
|
-
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);
|
|
3105
3120
|
}
|
|
3106
3121
|
|
|
3107
3122
|
.input-container.input-container--multi[data-multi-scroll-mode="horizontal"] {
|
|
@@ -3166,12 +3181,13 @@
|
|
|
3166
3181
|
/* Elegant separator line before arrow */
|
|
3167
3182
|
.input-container::after {
|
|
3168
3183
|
content: '';
|
|
3184
|
+
display: var(--select-separator-display, block);
|
|
3169
3185
|
position: absolute;
|
|
3170
|
-
top:
|
|
3186
|
+
top: var(--select-separator-inset-block, 10px);
|
|
3187
|
+
bottom: var(--select-separator-inset-block, 10px);
|
|
3171
3188
|
right: var(--select-separator-position, var(--select-arrow-width, 42px));
|
|
3172
|
-
transform: translateY(-50%);
|
|
3173
3189
|
width: var(--select-separator-width, 1px);
|
|
3174
|
-
height: var(--select-separator-height,
|
|
3190
|
+
height: var(--select-separator-height, auto);
|
|
3175
3191
|
background: var(--select-separator-bg, linear-gradient(
|
|
3176
3192
|
to bottom,
|
|
3177
3193
|
transparent 0%,
|
|
@@ -3482,22 +3498,26 @@
|
|
|
3482
3498
|
───────────────────────────────────────────────────────────────────────── */
|
|
3483
3499
|
|
|
3484
3500
|
.group-header {
|
|
3485
|
-
padding: var(--select-group-header-padding, 10px 12px
|
|
3486
|
-
margin: var(--select-group-header-margin, 0);
|
|
3501
|
+
padding: var(--select-group-header-padding, 10px 12px 8px 12px);
|
|
3502
|
+
margin: var(--select-group-header-margin, 0 calc(var(--select-options-padding, 6px) * -1));
|
|
3487
3503
|
font-weight: var(--select-group-header-weight, 600);
|
|
3488
3504
|
color: var(--select-group-header-color, var(--select-text-muted));
|
|
3489
|
-
background
|
|
3505
|
+
background: var(--select-group-header-bg, #ffffff);
|
|
3490
3506
|
text-align: var(--select-group-header-text-align, left);
|
|
3491
3507
|
font-size: var(--select-group-header-font-size, 0.7333em);
|
|
3492
3508
|
text-transform: var(--select-group-header-text-transform, uppercase);
|
|
3493
3509
|
letter-spacing: var(--select-group-header-letter-spacing, 0.08em);
|
|
3494
3510
|
position: sticky;
|
|
3495
|
-
top:
|
|
3496
|
-
|
|
3511
|
+
top: calc(var(--select-options-padding, 6px) * -1);
|
|
3512
|
+
left: 0;
|
|
3513
|
+
right: 0;
|
|
3514
|
+
z-index: 100;
|
|
3497
3515
|
border: var(--select-group-header-border, none);
|
|
3498
|
-
border-bottom: var(--select-group-header-border-bottom,
|
|
3516
|
+
border-bottom: var(--select-group-header-border-bottom, 1px solid rgba(0, 0, 0, 0.08));
|
|
3499
3517
|
border-radius: var(--select-group-header-border-radius, 0);
|
|
3500
|
-
box-shadow: var(--select-group-header-shadow,
|
|
3518
|
+
box-shadow: var(--select-group-header-shadow, 0 1px 2px rgba(0, 0, 0, 0.04));
|
|
3519
|
+
/* Force solid background to prevent option bleed-through */
|
|
3520
|
+
isolation: isolate;
|
|
3501
3521
|
}
|
|
3502
3522
|
|
|
3503
3523
|
.group-header:not(:first-child) {
|
|
@@ -3517,13 +3537,15 @@
|
|
|
3517
3537
|
color: var(--select-option-color, var(--select-text));
|
|
3518
3538
|
background: var(--select-option-bg, transparent);
|
|
3519
3539
|
border: var(--select-option-border, none);
|
|
3540
|
+
box-sizing: border-box;
|
|
3520
3541
|
text-align: var(--select-option-text-align, start);
|
|
3521
|
-
transition:
|
|
3542
|
+
transition: var(--select-option-transition,
|
|
3522
3543
|
background var(--select-transition-fast),
|
|
3523
3544
|
color var(--select-transition-fast),
|
|
3524
|
-
border
|
|
3545
|
+
border var(--select-transition-fast),
|
|
3525
3546
|
transform var(--select-transition-fast),
|
|
3526
|
-
box-shadow var(--select-transition-fast)
|
|
3547
|
+
box-shadow var(--select-transition-fast)
|
|
3548
|
+
);
|
|
3527
3549
|
user-select: none;
|
|
3528
3550
|
font-size: var(--select-option-font-size, inherit);
|
|
3529
3551
|
font-weight: var(--select-option-font-weight);
|
|
@@ -3536,7 +3558,7 @@
|
|
|
3536
3558
|
background: var(--select-option-hover-bg, var(--select-surface-elevated));
|
|
3537
3559
|
border: var(--select-option-hover-border, var(--select-option-border, none));
|
|
3538
3560
|
color: var(--select-option-hover-color, var(--select-text));
|
|
3539
|
-
transform: var(--select-option-hover-transform);
|
|
3561
|
+
transform: var(--select-option-hover-transform, none);
|
|
3540
3562
|
}
|
|
3541
3563
|
|
|
3542
3564
|
.option.selected {
|
|
@@ -3800,14 +3822,34 @@
|
|
|
3800
3822
|
|
|
3801
3823
|
--select-dropdown-bg: var(--select-dark-dropdown-bg, var(--select-surface));
|
|
3802
3824
|
|
|
3825
|
+
--select-arrow-color: var(--select-dark-arrow-color, #9ca3af);
|
|
3826
|
+
--select-arrow-hover-color: var(--select-dark-arrow-hover-color, #f5f5f5);
|
|
3827
|
+
--select-arrow-bg: var(--select-dark-arrow-bg, transparent);
|
|
3828
|
+
--select-arrow-hover-bg: var(--select-dark-arrow-hover-bg, rgba(156, 163, 175, 0.15));
|
|
3829
|
+
|
|
3830
|
+
--select-separator-bg: var(--select-dark-separator-bg, var(--select-separator-dark-bg));
|
|
3831
|
+
--select-separator-width: var(--select-dark-separator-width, 1px);
|
|
3832
|
+
|
|
3833
|
+
--select-badge-bg: var(--select-dark-badge-bg, rgba(99, 102, 241, 0.2));
|
|
3834
|
+
--select-badge-color: var(--select-dark-badge-color, #e0e7ff);
|
|
3835
|
+
|
|
3836
|
+
--select-group-header-bg: var(--select-group-header-dark-bg, #1a1a2e);
|
|
3837
|
+
--select-group-header-color: var(--select-group-header-dark-color, #9ca3af);
|
|
3838
|
+
|
|
3839
|
+
--select-empty-color: var(--select-dark-empty-color, #9ca3af);
|
|
3840
|
+
|
|
3803
3841
|
--select-option-bg: var(--select-dark-option-bg, transparent);
|
|
3804
3842
|
--select-option-color: var(--select-dark-option-color, var(--select-text));
|
|
3843
|
+
--select-option-border: var(--select-dark-option-border, none);
|
|
3805
3844
|
--select-option-hover-bg: var(--select-dark-option-hover-bg, var(--select-surface-elevated));
|
|
3806
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));
|
|
3807
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%));
|
|
3808
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));
|
|
3809
3850
|
--select-option-selected-hover-bg: var(--select-dark-option-selected-hover-bg, var(--select-option-selected-bg));
|
|
3810
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))));
|
|
3811
3853
|
}
|
|
3812
3854
|
|
|
3813
3855
|
:host(.dark-mode) .input-container,
|
|
@@ -3897,6 +3939,22 @@
|
|
|
3897
3939
|
border-top-color: var(--select-border);
|
|
3898
3940
|
}
|
|
3899
3941
|
|
|
3942
|
+
:host(.dark-mode) .group-header,
|
|
3943
|
+
:host([dark-mode]) .group-header,
|
|
3944
|
+
:host([darkmode]) .group-header,
|
|
3945
|
+
:host([data-theme="dark"]) .group-header,
|
|
3946
|
+
:host([theme="dark"]) .group-header,
|
|
3947
|
+
:host-context(.dark-mode) .group-header,
|
|
3948
|
+
:host-context(.dark) .group-header,
|
|
3949
|
+
:host-context([dark-mode]) .group-header,
|
|
3950
|
+
:host-context([darkmode]) .group-header,
|
|
3951
|
+
:host-context([data-theme="dark"]) .group-header,
|
|
3952
|
+
:host-context([theme="dark"]) .group-header {
|
|
3953
|
+
background: var(--select-group-header-bg, #1a1a2e);
|
|
3954
|
+
border-bottom: var(--select-group-header-border-bottom, 1px solid rgba(255, 255, 255, 0.08));
|
|
3955
|
+
box-shadow: var(--select-group-header-shadow, 0 1px 2px rgba(0, 0, 0, 0.3));
|
|
3956
|
+
}
|
|
3957
|
+
|
|
3900
3958
|
:host(.dark-mode) .option.selected::before,
|
|
3901
3959
|
:host([dark-mode]) .option.selected::before,
|
|
3902
3960
|
:host([darkmode]) .option.selected::before,
|
|
@@ -4470,7 +4528,7 @@
|
|
|
4470
4528
|
case 'End':
|
|
4471
4529
|
e.preventDefault();
|
|
4472
4530
|
if (this._state.isOpen) {
|
|
4473
|
-
const options =
|
|
4531
|
+
const options = this._getSelectableOptions();
|
|
4474
4532
|
const lastIndex = Math.max(0, options.length - 1);
|
|
4475
4533
|
this._setActive(lastIndex);
|
|
4476
4534
|
if (this._config.selection.mode === 'multi' && e.shiftKey) {
|
|
@@ -4491,8 +4549,12 @@
|
|
|
4491
4549
|
}
|
|
4492
4550
|
break;
|
|
4493
4551
|
case 'Enter':
|
|
4552
|
+
case ' ':
|
|
4494
4553
|
e.preventDefault();
|
|
4495
|
-
if (this._state.
|
|
4554
|
+
if (!this._state.isOpen) {
|
|
4555
|
+
this._handleOpen();
|
|
4556
|
+
}
|
|
4557
|
+
else if (this._state.activeIndex >= 0) {
|
|
4496
4558
|
this._selectOption(this._state.activeIndex, { shiftKey: e.shiftKey, toggleKey: e.ctrlKey || e.metaKey });
|
|
4497
4559
|
}
|
|
4498
4560
|
break;
|
|
@@ -4521,7 +4583,7 @@
|
|
|
4521
4583
|
}
|
|
4522
4584
|
}
|
|
4523
4585
|
_moveActive(delta, opts) {
|
|
4524
|
-
const options =
|
|
4586
|
+
const options = this._getSelectableOptions();
|
|
4525
4587
|
const next = Math.max(0, Math.min(options.length - 1, this._state.activeIndex + delta));
|
|
4526
4588
|
this._setActive(next);
|
|
4527
4589
|
if (this._config.selection.mode === 'multi' && opts?.shiftKey) {
|
|
@@ -4575,6 +4637,13 @@
|
|
|
4575
4637
|
_getOptionElementByIndex(index) {
|
|
4576
4638
|
return this._optionsContainer.querySelector(`[data-index="${index}"]`);
|
|
4577
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
|
+
}
|
|
4578
4647
|
_buildRendererHelpers() {
|
|
4579
4648
|
return {
|
|
4580
4649
|
onSelect: (_item, index) => this._selectOption(index),
|
|
@@ -4609,7 +4678,7 @@
|
|
|
4609
4678
|
_selectAll() {
|
|
4610
4679
|
if (this._config.selection.mode !== 'multi')
|
|
4611
4680
|
return;
|
|
4612
|
-
const options =
|
|
4681
|
+
const options = this._getSelectableOptions();
|
|
4613
4682
|
const maxSelections = this._config.selection.maxSelections || 0;
|
|
4614
4683
|
options.forEach((option, index) => {
|
|
4615
4684
|
if (maxSelections > 0 && this._state.selectedIndices.size >= maxSelections) {
|
|
@@ -4663,7 +4732,7 @@
|
|
|
4663
4732
|
this._announce(`${this._state.selectedIndices.size} items selected`);
|
|
4664
4733
|
}
|
|
4665
4734
|
_setInitialActiveOption() {
|
|
4666
|
-
const options =
|
|
4735
|
+
const options = this._getSelectableOptions();
|
|
4667
4736
|
if (options.length === 0)
|
|
4668
4737
|
return;
|
|
4669
4738
|
const selected = Array.from(this._state.selectedIndices).sort((a, b) => a - b);
|