@keenmate/web-multiselect 1.5.1 → 1.6.1
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 +70 -51
- package/dist/multiselect.js +944 -900
- package/dist/multiselect.umd.js +12 -12
- package/dist/style.css +1 -1
- package/package.json +4 -5
- package/src/css/_badges-display.css +251 -0
- package/src/css/_base.css +43 -0
- package/src/css/_debug.css +57 -0
- package/src/css/_input-dropdown.css +263 -0
- package/src/css/_modifiers.css +32 -0
- package/src/css/_options.css +365 -0
- package/src/css/_rtl.css +150 -0
- package/src/css/_tooltips-popover.css +173 -0
- package/src/css/_variables.css +586 -0
- package/src/css/main.css +27 -0
- package/src/scss/_badges-display.scss +0 -247
- package/src/scss/_base.scss +0 -42
- package/src/scss/_css-variables.scss +0 -612
- package/src/scss/_debug.scss +0 -60
- package/src/scss/_input-dropdown.scss +0 -259
- package/src/scss/_modifiers.scss +0 -36
- package/src/scss/_options.scss +0 -358
- package/src/scss/_rtl.scss +0 -144
- package/src/scss/_tooltips-popover.scss +0 -172
- package/src/scss/_variables.scss +0 -520
- package/src/scss/main.scss +0 -28
package/README.md
CHANGED
|
@@ -129,6 +129,7 @@ multiselect.setSelected(['js', 'ts']);
|
|
|
129
129
|
| `loading-message` | `string` | `'Loading...'` | Message while loading async data |
|
|
130
130
|
| `min-search-length` | `number` | `0` | Minimum search length for async |
|
|
131
131
|
| `keep-options-on-search` | `boolean` | `true` | Keep initial options visible when searchCallback is active (hybrid search) |
|
|
132
|
+
| `should-keep-search-on-close` | `boolean` | `true` | Preserve search text and filtered results when dropdown closes |
|
|
132
133
|
| `sticky-actions` | `boolean` | `true` | Keep action buttons fixed at top while scrolling |
|
|
133
134
|
| `actions-layout` | `'nowrap' \| 'wrap'` | `'nowrap'` | Layout mode for action buttons: 'nowrap' (single row) or 'wrap' (multi-row) |
|
|
134
135
|
| `lock-placement` | `boolean` | `true` | Lock dropdown placement after first open to prevent flipping |
|
|
@@ -932,21 +933,21 @@ Then style with CSS:
|
|
|
932
933
|
```css
|
|
933
934
|
/* Target specific badges with custom classes */
|
|
934
935
|
.badge-urgent {
|
|
935
|
-
--ms-badge-text-
|
|
936
|
+
--ms-badge-text-background: #fee2e2;
|
|
936
937
|
--ms-badge-text-color: #dc2626;
|
|
937
|
-
--ms-badge-remove-
|
|
938
|
+
--ms-badge-remove-background: #dc2626;
|
|
938
939
|
}
|
|
939
940
|
|
|
940
941
|
.badge-normal {
|
|
941
|
-
--ms-badge-text-
|
|
942
|
+
--ms-badge-text-background: #dbeafe;
|
|
942
943
|
--ms-badge-text-color: #2563eb;
|
|
943
|
-
--ms-badge-remove-
|
|
944
|
+
--ms-badge-remove-background: #2563eb;
|
|
944
945
|
}
|
|
945
946
|
|
|
946
947
|
.badge-low {
|
|
947
|
-
--ms-badge-text-
|
|
948
|
+
--ms-badge-text-background: #d1fae5;
|
|
948
949
|
--ms-badge-text-color: #059669;
|
|
949
|
-
--ms-badge-remove-
|
|
950
|
+
--ms-badge-remove-background: #059669;
|
|
950
951
|
}
|
|
951
952
|
```
|
|
952
953
|
|
|
@@ -993,21 +994,21 @@ select.getBadgeClassCallback = (item) => {
|
|
|
993
994
|
// Inject CSS into Shadow DOM to style those classes
|
|
994
995
|
select.customStylesCallback = () => `
|
|
995
996
|
.badge-urgent {
|
|
996
|
-
--ms-badge-text-
|
|
997
|
+
--ms-badge-text-background: #fee2e2;
|
|
997
998
|
--ms-badge-text-color: #dc2626;
|
|
998
|
-
--ms-badge-remove-
|
|
999
|
+
--ms-badge-remove-background: #dc2626;
|
|
999
1000
|
}
|
|
1000
1001
|
|
|
1001
1002
|
.badge-normal {
|
|
1002
|
-
--ms-badge-text-
|
|
1003
|
+
--ms-badge-text-background: #dbeafe;
|
|
1003
1004
|
--ms-badge-text-color: #2563eb;
|
|
1004
|
-
--ms-badge-remove-
|
|
1005
|
+
--ms-badge-remove-background: #2563eb;
|
|
1005
1006
|
}
|
|
1006
1007
|
|
|
1007
1008
|
.badge-low {
|
|
1008
|
-
--ms-badge-text-
|
|
1009
|
+
--ms-badge-text-background: #d1fae5;
|
|
1009
1010
|
--ms-badge-text-color: #059669;
|
|
1010
|
-
--ms-badge-remove-
|
|
1011
|
+
--ms-badge-remove-background: #059669;
|
|
1011
1012
|
}
|
|
1012
1013
|
`;
|
|
1013
1014
|
```
|
|
@@ -1533,12 +1534,32 @@ web-multiselect.large { --ms-rem: 12px; }
|
|
|
1533
1534
|
|
|
1534
1535
|
**Fine-grained Control:**
|
|
1535
1536
|
Override individual sizing variables for specific adjustments:
|
|
1536
|
-
- `--ms-input-height` - Input field height
|
|
1537
|
+
- `--ms-input-height` - Input field height (default: 35px)
|
|
1537
1538
|
- `--ms-input-font-size` - Input font size
|
|
1538
1539
|
- `--ms-input-padding` - Input padding
|
|
1539
1540
|
- `--ms-badge-height` - Badge height
|
|
1540
1541
|
- `--ms-option-height` - Option height in dropdown
|
|
1541
1542
|
|
|
1543
|
+
**Input Size Variants:**
|
|
1544
|
+
Five size variants for consistent input sizing across KeenMate components:
|
|
1545
|
+
|
|
1546
|
+
| Size | Variable | Height | Base Variable |
|
|
1547
|
+
|------|----------|--------|---------------|
|
|
1548
|
+
| XS | `--ms-input-size-xs-height` | 31px | `--base-input-size-xs-height` |
|
|
1549
|
+
| SM | `--ms-input-size-sm-height` | 33px | `--base-input-size-sm-height` |
|
|
1550
|
+
| MD | `--ms-input-size-md-height` | 35px | `--base-input-size-md-height` |
|
|
1551
|
+
| LG | `--ms-input-size-lg-height` | 38px | `--base-input-size-lg-height` |
|
|
1552
|
+
| XL | `--ms-input-size-xl-height` | 41px | `--base-input-size-xl-height` |
|
|
1553
|
+
|
|
1554
|
+
Heights reference `--base-input-size-*-height` from the [Theme Designer](https://theme-designer.keenmate.dev), ensuring consistent input heights across all KeenMate components.
|
|
1555
|
+
|
|
1556
|
+
```css
|
|
1557
|
+
/* Set consistent input heights across all components */
|
|
1558
|
+
:root {
|
|
1559
|
+
--base-input-size-md-height: 4.0; /* All components: 40px at 10px rem */
|
|
1560
|
+
}
|
|
1561
|
+
```
|
|
1562
|
+
|
|
1542
1563
|
### Theme Designer
|
|
1543
1564
|
|
|
1544
1565
|
The easiest way to customize the appearance of this component is using the **KeenMate Theme Designer** at:
|
|
@@ -1605,7 +1626,7 @@ You can customize the component using CSS variables even with just a `<script>`
|
|
|
1605
1626
|
<style>
|
|
1606
1627
|
/* Override tooltip appearance */
|
|
1607
1628
|
web-multiselect {
|
|
1608
|
-
--ms-tooltip-
|
|
1629
|
+
--ms-tooltip-background: #1f2937;
|
|
1609
1630
|
--ms-tooltip-color: #f9fafb;
|
|
1610
1631
|
--ms-tooltip-padding: 0.625rem 0.875rem;
|
|
1611
1632
|
--ms-tooltip-border-radius: 0.5rem;
|
|
@@ -1656,8 +1677,7 @@ All CSS custom properties are now defined at the `:host` level in the compiled C
|
|
|
1656
1677
|
```
|
|
1657
1678
|
|
|
1658
1679
|
For the complete list of all available CSS variables, see:
|
|
1659
|
-
- [
|
|
1660
|
-
- [_variables.scss](./src/scss/_variables.scss) - Foundation SCSS variables (colors, spacing, typography)
|
|
1680
|
+
- [_variables.css](./src/css/_variables.css) - All 150+ CSS custom properties at `:host` level
|
|
1661
1681
|
|
|
1662
1682
|
#### Colors
|
|
1663
1683
|
|
|
@@ -1674,7 +1694,7 @@ For the complete list of all available CSS variables, see:
|
|
|
1674
1694
|
|
|
1675
1695
|
| Variable | Default | Description |
|
|
1676
1696
|
|----------|---------|-------------|
|
|
1677
|
-
| `--ms-input-
|
|
1697
|
+
| `--ms-input-background` | `var(--base-input-background, #ffffff)` | Input background |
|
|
1678
1698
|
| `--ms-input-text` | `#111827` | Input text color |
|
|
1679
1699
|
| `--ms-input-border` | `#d1d5db` | Input border color |
|
|
1680
1700
|
| `--ms-input-focus-border-color` | `#3b82f6` | Border color when focused |
|
|
@@ -1688,8 +1708,8 @@ For the complete list of all available CSS variables, see:
|
|
|
1688
1708
|
|
|
1689
1709
|
| Variable | Default | Description |
|
|
1690
1710
|
|----------|---------|-------------|
|
|
1691
|
-
| `--ms-dropdown-
|
|
1692
|
-
| `--ms-dropdown-border` |
|
|
1711
|
+
| `--ms-dropdown-background` | `var(--base-dropdown-background, #ffffff)` | Dropdown background |
|
|
1712
|
+
| `--ms-dropdown-border` | `var(--ms-border-color)` | Dropdown border color |
|
|
1693
1713
|
| `--ms-dropdown-shadow` | (box shadow) | Dropdown shadow |
|
|
1694
1714
|
| `--ms-dropdown-max-height` | `20rem` | Max height of dropdown |
|
|
1695
1715
|
| `--ms-option-padding-v` | `0.5rem` | Option vertical padding |
|
|
@@ -1697,8 +1717,6 @@ For the complete list of all available CSS variables, see:
|
|
|
1697
1717
|
| `--ms-option-hover-bg` | `#f9fafb` | Option background on hover |
|
|
1698
1718
|
| `--ms-option-color-hover` | `inherit` | Option text color on hover |
|
|
1699
1719
|
| `--ms-option-bg-selected` | (rgba accent) | Selected option background |
|
|
1700
|
-
| `--ms-option-color-selected` | `inherit` | Selected option text color |
|
|
1701
|
-
| `--ms-option-color-selected-hover` | (inherits selected) | Text color when hovering selected option |
|
|
1702
1720
|
| `--ms-option-bg-focused` | `#f9fafb` | Focused option background (keyboard) |
|
|
1703
1721
|
| `--ms-option-color-focused` | `inherit` | Focused option text color |
|
|
1704
1722
|
| `--ms-option-bg-matched` | (accent 8%) | Matched option background (navigate mode) |
|
|
@@ -1708,34 +1726,34 @@ For the complete list of all available CSS variables, see:
|
|
|
1708
1726
|
|
|
1709
1727
|
| Variable | Default | Description |
|
|
1710
1728
|
|----------|---------|-------------|
|
|
1711
|
-
| `--ms-badge-text-
|
|
1712
|
-
| `--ms-badge-text-color` |
|
|
1729
|
+
| `--ms-badge-text-background` | `var(--ms-accent-color-light)` | Badge background color |
|
|
1730
|
+
| `--ms-badge-text-color` | `var(--ms-accent-color)` | Badge text color |
|
|
1713
1731
|
| `--ms-badge-gap` | `0.5rem` | Gap between badges |
|
|
1714
1732
|
| `--ms-badge-height` | `1.5rem` | Height of badges |
|
|
1715
1733
|
| `--ms-badge-font-size` | `0.75rem` | Badge font size |
|
|
1716
1734
|
| `--ms-badge-border-radius` | `0.375rem` | Badge border radius |
|
|
1717
|
-
| `--ms-badge-remove-
|
|
1718
|
-
| `--ms-badge-remove-color` |
|
|
1719
|
-
| `--ms-badge-counter-text-
|
|
1720
|
-
| `--ms-badge-counter-text-color` |
|
|
1721
|
-
| `--ms-badge-counter-remove-
|
|
1722
|
-
| `--ms-badge-counter-remove-color` |
|
|
1723
|
-
| `--ms-badge-counter-border` | `1px solid
|
|
1735
|
+
| `--ms-badge-remove-background` | `var(--ms-accent-color)` | Remove button background |
|
|
1736
|
+
| `--ms-badge-remove-color` | `var(--ms-text-on-accent)` | Remove button color |
|
|
1737
|
+
| `--ms-badge-counter-text-background` | `var(--ms-primary-bg)` | BadgeCounter text background ("+X more") |
|
|
1738
|
+
| `--ms-badge-counter-text-color` | `var(--ms-text-color-3)` | BadgeCounter text color |
|
|
1739
|
+
| `--ms-badge-counter-remove-background` | `var(--ms-text-color-3)` | BadgeCounter remove button background |
|
|
1740
|
+
| `--ms-badge-counter-remove-color` | `var(--ms-text-on-accent)` | BadgeCounter remove button color |
|
|
1741
|
+
| `--ms-badge-counter-border` | `1px solid var(--ms-border-color)` | BadgeCounter border |
|
|
1724
1742
|
| `--ms-badge-border` | `none` | Badge border (e.g., `1px solid #3b82f6`) |
|
|
1725
1743
|
|
|
1726
1744
|
#### Checkboxes
|
|
1727
1745
|
|
|
1728
1746
|
| Variable | Default | Description |
|
|
1729
1747
|
|----------|---------|-------------|
|
|
1730
|
-
| `--ms-checkbox-bg` |
|
|
1731
|
-
| `--ms-checkbox-border` | `1px solid
|
|
1748
|
+
| `--ms-checkbox-bg` | `var(--ms-input-background)` | Checkbox background |
|
|
1749
|
+
| `--ms-checkbox-border` | `1px solid var(--ms-border-color)` | Checkbox border |
|
|
1732
1750
|
| `--ms-checkbox-border-radius` | `0.3rem` | Checkbox border radius |
|
|
1733
|
-
| `--ms-checkbox-checked-bg` | (accent
|
|
1734
|
-
| `--ms-checkbox-checked-border` | `1px solid (accent)` | Border when checked |
|
|
1735
|
-
| `--ms-checkbox-checkmark-color` |
|
|
1736
|
-
| `--ms-checkbox-hover-border-color` | (accent
|
|
1737
|
-
| `--ms-checkbox-disabled-bg` |
|
|
1738
|
-
| `--ms-checkbox-disabled-border` | `1px solid
|
|
1751
|
+
| `--ms-checkbox-checked-bg` | `var(--ms-accent-color)` | Background when checked |
|
|
1752
|
+
| `--ms-checkbox-checked-border` | `1px solid var(--ms-accent-color)` | Border when checked |
|
|
1753
|
+
| `--ms-checkbox-checkmark-color` | `var(--ms-text-on-accent)` | Checkmark color |
|
|
1754
|
+
| `--ms-checkbox-hover-border-color` | `var(--ms-accent-color)` | Border on hover |
|
|
1755
|
+
| `--ms-checkbox-disabled-bg` | `var(--ms-primary-bg)` | Disabled background |
|
|
1756
|
+
| `--ms-checkbox-disabled-border` | `1px solid var(--ms-border-color)` | Disabled border |
|
|
1739
1757
|
|
|
1740
1758
|
#### Scrollbar
|
|
1741
1759
|
|
|
@@ -1743,8 +1761,8 @@ For the complete list of all available CSS variables, see:
|
|
|
1743
1761
|
|----------|---------|-------------|
|
|
1744
1762
|
| `--ms-scrollbar-width` | `8px` | Scrollbar width |
|
|
1745
1763
|
| `--ms-scrollbar-track-bg` | `transparent` | Track background |
|
|
1746
|
-
| `--ms-scrollbar-thumb-bg` |
|
|
1747
|
-
| `--ms-scrollbar-thumb-bg-hover` |
|
|
1764
|
+
| `--ms-scrollbar-thumb-bg` | `var(--ms-border-color)` | Thumb color |
|
|
1765
|
+
| `--ms-scrollbar-thumb-bg-hover` | `var(--ms-text-color-3)` | Thumb hover color |
|
|
1748
1766
|
| `--ms-scrollbar-thumb-border-radius` | `4px` | Thumb border radius |
|
|
1749
1767
|
|
|
1750
1768
|
#### Counter (in input)
|
|
@@ -1760,8 +1778,8 @@ For the complete list of all available CSS variables, see:
|
|
|
1760
1778
|
|
|
1761
1779
|
| Variable | Default | Description |
|
|
1762
1780
|
|----------|---------|-------------|
|
|
1763
|
-
| `--ms-tooltip-
|
|
1764
|
-
| `--ms-tooltip-color` |
|
|
1781
|
+
| `--ms-tooltip-background` | `var(--base-tooltip-background, #333333)` | Tooltip background color |
|
|
1782
|
+
| `--ms-tooltip-color` | `var(--ms-tooltip-text-color)` | Tooltip text color |
|
|
1765
1783
|
| `--ms-tooltip-padding` | `0.5rem 0.75rem` | Tooltip padding |
|
|
1766
1784
|
| `--ms-tooltip-border-radius` | `0.375rem` | Tooltip border radius |
|
|
1767
1785
|
| `--ms-tooltip-font-size` | `0.875rem` | Tooltip font size |
|
|
@@ -1790,17 +1808,18 @@ For the complete list of all available CSS variables, see:
|
|
|
1790
1808
|
| `--ms-shadow-xl` | (box shadow) | Extra large shadow |
|
|
1791
1809
|
| `--ms-disabled-opacity` | `0.5` | Opacity for disabled state |
|
|
1792
1810
|
|
|
1793
|
-
### Advanced:
|
|
1811
|
+
### Advanced: Direct CSS Import
|
|
1794
1812
|
|
|
1795
|
-
For users
|
|
1813
|
+
For users who want to import the raw CSS source files:
|
|
1814
|
+
|
|
1815
|
+
```css
|
|
1816
|
+
/* Import component CSS directly */
|
|
1817
|
+
@import '@keenmate/web-multiselect/css';
|
|
1796
1818
|
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
@
|
|
1800
|
-
|
|
1801
|
-
$ms-border-radius: 0.5rem,
|
|
1802
|
-
$ms-font-size-base: 1rem
|
|
1803
|
-
);
|
|
1819
|
+
/* Or import individual partials */
|
|
1820
|
+
@import '@keenmate/web-multiselect/src/css/_variables.css';
|
|
1821
|
+
@import '@keenmate/web-multiselect/src/css/_base.css';
|
|
1822
|
+
/* ... etc */
|
|
1804
1823
|
```
|
|
1805
1824
|
|
|
1806
1825
|
## Browser Support
|