@selkit/dom 0.1.0 → 0.1.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 +46 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @selkit/dom
|
|
2
|
+
|
|
3
|
+
Vanilla-JS renderer for [Selkit](https://github.com/cluion/selkit) — the
|
|
4
|
+
framework-agnostic select toolkit. Mounts a fully-featured select (search,
|
|
5
|
+
multiple, tagging, keyboard, a11y, dropdown positioning) on top of
|
|
6
|
+
[`@selkit/core`](https://www.npmjs.com/package/@selkit/core), with no framework
|
|
7
|
+
required.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @selkit/dom @selkit/themes
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import { createSelkitDom } from '@selkit/dom'
|
|
19
|
+
import '@selkit/themes/base.css'
|
|
20
|
+
|
|
21
|
+
const instance = createSelkitDom(document.getElementById('host'), {
|
|
22
|
+
options: [
|
|
23
|
+
{ value: 'a', label: 'Apple' },
|
|
24
|
+
{ value: 'b', label: 'Banana' },
|
|
25
|
+
],
|
|
26
|
+
multiple: true,
|
|
27
|
+
placeholder: 'Pick fruits…',
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
instance.controller.on('change', ({ value }) => console.log(value))
|
|
31
|
+
|
|
32
|
+
// later
|
|
33
|
+
instance.destroy()
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
It can also enhance an existing native `<select>`. See the
|
|
37
|
+
[vanilla guide](https://cluion.github.io/selkit/guide/vanilla) for enhancement
|
|
38
|
+
mode, `dropdownParent`, virtual scroll, templates and more.
|
|
39
|
+
|
|
40
|
+
## Docs
|
|
41
|
+
|
|
42
|
+
📖 [cluion.github.io/selkit](https://cluion.github.io/selkit/) · [繁體中文](https://cluion.github.io/selkit/zh/)
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
[MIT](https://github.com/cluion/selkit/blob/main/LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selkit/dom",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Vanilla JS renderer for Selkit — DOM, events, a11y and default positioner.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
],
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@selkit/core": "0.1.
|
|
22
|
+
"@selkit/core": "0.1.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"axe-core": "^4.12.1",
|
|
26
26
|
"jsdom": "^24.1.0",
|
|
27
27
|
"tsup": "^8.0.0",
|
|
28
28
|
"typescript": "^5.4.0",
|
|
29
|
-
"vitest": "^
|
|
29
|
+
"vitest": "^3.2.6"
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://cluion.github.io/selkit/",
|
|
32
32
|
"repository": {
|