@keenmate/web-multiselect 1.8.4 → 1.8.6

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 CHANGED
@@ -5,6 +5,8 @@
5
5
 
6
6
  A lightweight, accessible multiselect web component with typeahead search, RTL language support, rich content, and excellent keyboard navigation.
7
7
 
8
+ > **⚠️ Security Notice:** This component intentionally allows raw HTML in rendering callbacks to give developers full control over content display. If you display user-generated content, you must sanitize it yourself. See [HTML Injection (XSS) Notice](#html-injection-xss-notice) for the complete list of affected callbacks.
9
+
8
10
  ## Features
9
11
 
10
12
  - 📝 **Declarative HTML** - Use standard `<option>` and `<optgroup>` elements - no JavaScript required for simple cases!
@@ -678,6 +680,19 @@ Control where selected item badges appear relative to the input:
678
680
  <web-multiselect badges-position="right"></web-multiselect>
679
681
  ```
680
682
 
683
+ **Inline Vertical Alignment:** For left/right positioning, control vertical alignment with `--ms-inline-align`:
684
+
685
+ ```html
686
+ <!-- Center aligned (default) -->
687
+ <web-multiselect badges-position="right" style="--ms-inline-align: center;"></web-multiselect>
688
+
689
+ <!-- Top aligned -->
690
+ <web-multiselect badges-position="right" style="--ms-inline-align: flex-start;"></web-multiselect>
691
+
692
+ <!-- Bottom aligned -->
693
+ <web-multiselect badges-position="left" style="--ms-inline-align: flex-end;"></web-multiselect>
694
+ ```
695
+
681
696
  **Note:** In RTL mode, left/right positions are automatically mirrored - `badges-position="left"` will appear on the physical right side in RTL languages.
682
697
 
683
698
  ### Badge Tooltips
@@ -774,6 +789,34 @@ Three rendering callbacks are available:
774
789
 
775
790
  All callbacks can return either **HTML strings** or **HTMLElement** objects (except `renderSelectedContentCallback` which returns plain text).
776
791
 
792
+ #### HTML Injection (XSS) Notice
793
+
794
+ The following callbacks allow **raw HTML injection** and are intentionally **NOT XSS-safe**. This gives developers full control over rendering but requires sanitizing untrusted data:
795
+
796
+ | Callback | Output Used In | Risk Level |
797
+ |----------|---------------|------------|
798
+ | `renderOptionContentCallback` | Dropdown options (innerHTML) | HTML injection |
799
+ | `renderBadgeContentCallback` | Badges (innerHTML) | HTML injection |
800
+ | `renderSelectedItemContentCallback` | Selected items popover (innerHTML) | HTML injection |
801
+ | `renderGroupLabelContentCallback` | Group headers (innerHTML) | HTML injection |
802
+ | `getIconCallback` | Option icons (innerHTML) | HTML injection |
803
+ | `getSubtitleCallback` | Option subtitles (innerHTML) | HTML injection |
804
+ | `getDisplayValueCallback` | Option titles, badges (innerHTML) | HTML injection |
805
+ | `getBadgeDisplayCallback` | Badge text (innerHTML) | HTML injection |
806
+ | `getCounterCallback` | Count badges (innerHTML) | HTML injection |
807
+ | `getBadgeTooltipCallback` | Tooltips (innerHTML if HTMLElement) | HTML injection |
808
+ | `customStylesCallback` | Style tag (textContent) | CSS injection |
809
+
810
+ **Safe callbacks** (output is escaped or used as data):
811
+ - `getValueCallback`, `getSearchValueCallback`, `getGroupCallback`, `getDisabledCallback`
812
+ - `getBadgeClassCallback`, `getSelectedItemClassCallback` (CSS class names only)
813
+ - `beforeSearchCallback`, `searchCallback`, `addNewCallback`
814
+ - `selectCallback`, `deselectCallback`, `changeCallback`
815
+ - `getRemoveButtonTooltipCallback` (used as title attribute)
816
+ - `getValueFormatCallback` (form value)
817
+
818
+ **If displaying user-generated content**, sanitize it before returning from these callbacks.
819
+
777
820
  #### Custom Option Rendering
778
821
 
779
822
  Customize how options appear in the dropdown: