You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- dropped jQuery requirement and replaced necessary code with browser native code.
45
-
-written in TypeScript which also brings typings support
46
-
- revamped the UI to give it a more Modern Look by updating CSS and using SVG icons.
45
+
-rewritten in TypeScript to also add typings support (`d.ts`)
46
+
- revamped the UI to give it a more Modern Look by updating the CSS and using SVG icons (CSS/SASS variables are also availables)
47
47
- add extra features:
48
48
-`autoAdjustDropHeight` will automatically adjust the drop (up/down) height by available space (see [demo](https://ghiscoding.github.io/multiple-select-vanilla/#/options30))
49
49
-`autoAdjustDropPosition` will find best position (top/bottom) by its available space (see [demo](https://ghiscoding.github.io/multiple-select-vanilla/#/options29))
@@ -57,11 +57,11 @@ New Multiple-Select Options:
57
57
-`showOkButton` to add an "OK" button at the end of the multiple select option list (see [demo](https://ghiscoding.github.io/multiple-select-vanilla/#/options25))
58
58
-`showSearchClear` show a clear button on the search filter input (see [demo](https://ghiscoding.github.io/multiple-select-vanilla/#/options34))
59
59
-`diacriticParser` custom parser to normalize diacritic signs when filtering select list (see [demo](https://ghiscoding.github.io/multiple-select-vanilla/#/options35))
60
-
- replace tabIndex by arrow navigation highlight
61
-
-`darkMode` option for a **Dark Mode** Theme (see [demo](https://ghiscoding.github.io/multiple-select-vanilla/#/options38))
60
+
- replace tabIndex by a more intuitive navigation & highlight by using arrow keys (or mouse hover)
61
+
-`darkMode` option for a new **Dark Mode** Theme (see [demo](https://ghiscoding.github.io/multiple-select-vanilla/#/options38))
62
62
63
63
## CSP Compliance
64
-
The library is now CSP (Content Security Policy) compliant, however there are some exceptions to be aware of. When using any html string as template (with `textTemplate`, `labelTemplate`, `renderOptionLabelAsHtml` or `useSelectOptionLabelToHtml`), you will not be fully compliant unless you return `TrustedHTML`. You can achieve this by using the `sanitizer` method in combo with [DOMPurify](https://github.com/cure53/DOMPurify) to return `TrustedHTML` as shown below and with that in place you will be CSP compliant.
64
+
The library is now CSP (Content Security Policy) compliant, however there are some exceptions to be aware of. When using any HTML strings as template (when using `textTemplate`, `labelTemplate`, `renderOptionLabelAsHtml` or `useSelectOptionLabelToHtml`), you will not be fully compliant unless you return [`TrustedHTML`](https://developer.mozilla.org/en-US/docs/Web/API/TrustedHTML). You can achieve safety by using the `sanitizer` method in combo with an external library like[DOMPurify](https://github.com/cure53/DOMPurify) to return `TrustedHTML` as shown below and with that in place you will be CSP compliant.
65
65
66
66
```typescript
67
67
importDOMPurifyfrom'dompurify';
@@ -85,10 +85,10 @@ with this code in place, we can now use the following CSP meta tag (which is wha
85
85
> **Note** that in our demo we are actually adding `unsafe-inline` simply because we are using Vite (which is not CSP compliant in Dev mode), but the library should work nonetheless without `unsafe-inline`.
86
86
87
87
### Installation / Structure
88
-
There are multiple ways to use the library, you can see below the folder structure of the distribution files
88
+
There are multiple ways to install and use the library, you can see below the folder structure of the distribution files
89
89
1.`dist/browser`: Standalone build which assigns `multipleSelect` on the `window.multipleSelect` object
90
90
- browser standalone means that you can simply load it with `<script></script>` and then `multipleSelect('#mySelect')`
91
-
- 2 builds are available CJS (`.cjs`) and ESM (`.js`) and for ESM you will need to load it with `<script type="module">`
91
+
- 2 builds are available CJS (`.cjs`) and ESM (`.js`) and for the latter you will need to load it with `<script type="module">`
92
92
2.`cjs`: to use as CommonJS with `require('multiple-select-vanilla')`
93
93
3.`esm`: to use as ESM with `import from 'multiple-select-vanilla'`
0 commit comments