Skip to content

Commit 329bfcb

Browse files
committed
2 parents 48c6fe9 + 9bd1101 commit 329bfcb

File tree

8 files changed

+3328
-2844
lines changed

8 files changed

+3328
-2844
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
if: |
105105
github.ref == 'refs/heads/main' &&
106106
(contains(github.event.head_commit.message, 'chore(release)') || contains(github.event.head_commit.message, '[refresh gh-pages]'))
107-
uses: peaceiris/actions-gh-pages@v3
107+
uses: peaceiris/actions-gh-pages@v4
108108
with:
109109
github_token: ${{ secrets.GITHUB_TOKEN }}
110110
publish_dir: ./packages/demo/dist

.github/workflows/publish-npm-latest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126

127127
- name: Deploy to gh-pages
128128
if: ${{ inputs.dryrun != true }}
129-
uses: peaceiris/actions-gh-pages@v3
129+
uses: peaceiris/actions-gh-pages@v4
130130
with:
131131
github_token: ${{ secrets.GITHUB_TOKEN }}
132132
publish_dir: ./packages/demo/dist

.github/workflows/publish-npm-prompt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
run: pnpm build:demo
116116

117117
- name: Deploy to gh-pages
118-
uses: peaceiris/actions-gh-pages@v3
118+
uses: peaceiris/actions-gh-pages@v4
119119
with:
120120
github_token: ${{ secrets.GITHUB_TOKEN }}
121121
publish_dir: ./packages/demo/dist

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ npm install multiple-select-vanilla
4242
## Changes vs Original lib (`multiple-select`)
4343
New Multiple-Select Options:
4444
- 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)
4747
- add extra features:
4848
- `autoAdjustDropHeight` will automatically adjust the drop (up/down) height by available space (see [demo](https://ghiscoding.github.io/multiple-select-vanilla/#/options30))
4949
- `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:
5757
- `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))
5858
- `showSearchClear` show a clear button on the search filter input (see [demo](https://ghiscoding.github.io/multiple-select-vanilla/#/options34))
5959
- `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))
6262

6363
## 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.
6565

6666
```typescript
6767
import DOMPurify from 'dompurify';
@@ -85,10 +85,10 @@ with this code in place, we can now use the following CSP meta tag (which is wha
8585
> **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`.
8686
8787
### 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
8989
1. `dist/browser`: Standalone build which assigns `multipleSelect` on the `window.multipleSelect` object
9090
- 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">`
9292
2. `cjs`: to use as CommonJS with `require('multiple-select-vanilla')`
9393
3. `esm`: to use as ESM with `import from 'multiple-select-vanilla'`
9494

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@
5555
"test:e2e:ui": "playwright test --config playwright/playwright.config.ts --ui",
5656
"test:report": "playwright show-report"
5757
},
58-
"packageManager": "pnpm@8.15.5",
58+
"packageManager": "pnpm@9.0.6",
5959
"devDependencies": {
60-
"@biomejs/biome": "^1.6.2",
61-
"@lerna-lite/cli": "^3.3.1",
62-
"@lerna-lite/publish": "^3.3.1",
63-
"@lerna-lite/watch": "^3.3.1",
64-
"@playwright/test": "^1.42.1",
65-
"@types/node": "^20.11.30",
60+
"@biomejs/biome": "^1.7.1",
61+
"@lerna-lite/cli": "^3.3.3",
62+
"@lerna-lite/publish": "^3.3.3",
63+
"@lerna-lite/watch": "^3.3.3",
64+
"@playwright/test": "^1.43.1",
65+
"@types/node": "^20.12.7",
6666
"conventional-changelog-conventionalcommits": "^7.0.2",
6767
"cross-env": "^7.0.3",
6868
"npm-run-all2": "^6.1.2",
69-
"pnpm": "^8.15.5",
69+
"pnpm": "^9.0.6",
7070
"rimraf": "^5.0.5",
71-
"typescript": "5.4.3"
71+
"typescript": "5.4.5"
7272
}
7373
}

packages/demo/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
"dependencies": {
2222
"@popperjs/core": "^2.11.8",
2323
"bootstrap": "^5.3.3",
24-
"dompurify": "^3.0.11",
24+
"dompurify": "^3.1.1",
2525
"font-awesome": "^4.7.0",
2626
"multiple-select-vanilla": "workspace:*"
2727
},
2828
"devDependencies": {
2929
"@types/dompurify": "^3.0.5",
30-
"sass": "^1.72.0",
31-
"typescript": "5.4.3",
32-
"vite": "^5.2.3"
30+
"sass": "^1.75.0",
31+
"typescript": "5.4.5",
32+
"vite": "^5.2.10"
3333
}
3434
}

packages/multiple-select-vanilla/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@
6666
"autoprefixer": "^10.4.19",
6767
"copyfiles": "^2.4.1",
6868
"cross-env": "^7.0.3",
69-
"cssnano": "^6.1.1",
69+
"cssnano": "^7.0.1",
7070
"esbuild": "^0.20.2",
7171
"fs-extra": "^11.2.0",
72-
"glob": "^10.3.10",
72+
"glob": "^10.3.12",
7373
"postcss": "^8.4.38",
7474
"postcss-cli": "^11.0.0",
75-
"sass": "^1.72.0",
76-
"typescript": "5.4.3"
75+
"sass": "^1.75.0",
76+
"typescript": "5.4.5"
7777
}
7878
}

0 commit comments

Comments
 (0)