@keenmate/web-multiselect 2.0.0-rc01 → 2.0.0-rc03
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 +90 -33
- package/custom-elements.json +627 -14
- package/dist/index.d.ts +244 -7
- package/dist/multiselect.js +2232 -1527
- package/dist/multiselect.umd.js +23 -23
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/css/badges.css +14 -6
- package/src/css/base.css +13 -0
- package/src/css/controls.css +11 -6
- package/src/css/debug.css +1 -1
- package/src/css/floating.css +400 -0
- package/src/css/options.css +40 -20
- package/src/css/rtl.css +27 -140
- package/src/css/states.css +2 -2
- package/src/css/variables.css +101 -0
- package/vscode.html-custom-data.json +15 -1
- package/web-types.json +29 -6
package/README.md
CHANGED
|
@@ -21,46 +21,77 @@ Reads `--base-*` variables from the page if [`@keenmate/theme-designer`](https:/
|
|
|
21
21
|
- Custom rendering callbacks for options, badges, and group headers.
|
|
22
22
|
- Form integration via standard hidden inputs (FormData-compatible).
|
|
23
23
|
|
|
24
|
-
## What's New in v2.0.0-
|
|
24
|
+
## What's New in v2.0.0-rc03
|
|
25
|
+
|
|
26
|
+
**Full-screen dropdown on phones (`mobile-presentation`).** On a phone, a dropdown
|
|
27
|
+
that floats next to the input fights the on-screen keyboard. `<web-multiselect>`
|
|
28
|
+
now detects phones and, by default (`mobile-presentation="auto"`), presents the
|
|
29
|
+
open dropdown as a **full-screen overlay** with its own search field and close (✕)
|
|
30
|
+
button — while desktop and tablets keep the familiar floating panel, unchanged. A
|
|
31
|
+
"phone" is a touch-primary device whose **shorter** viewport side is `< 600px`
|
|
32
|
+
(the Material `sw600dp` line), so a phone in **landscape** still gets the overlay
|
|
33
|
+
and tablets never do. The **selected-items popover** goes full-screen on phones
|
|
34
|
+
too, with a matching header. The phone view is scaled up ~1.2× for comfortable
|
|
35
|
+
touch targets via the `--ms-fullscreen-rem` knob (default `12px` vs the base
|
|
36
|
+
`--ms-rem: 10px`) — one value grows rows, text, checkboxes, header and search
|
|
37
|
+
together. Override the mode per instance with `mobile-presentation="floating"`
|
|
38
|
+
(anchored panel everywhere) or `"fullscreen"` (force the overlay on any device —
|
|
39
|
+
handy for previews). Theme it with the new `--ms-fullscreen-*` CSS variables.
|
|
25
40
|
|
|
26
|
-
|
|
41
|
+
```html
|
|
42
|
+
<!-- auto (default): full-screen on phones, floating on desktop/tablet -->
|
|
43
|
+
<web-multiselect mobile-presentation="auto"></web-multiselect>
|
|
44
|
+
|
|
45
|
+
<!-- never go full-screen -->
|
|
46
|
+
<web-multiselect mobile-presentation="floating"></web-multiselect>
|
|
47
|
+
|
|
48
|
+
<!-- always full-screen (preview the mobile view on desktop) -->
|
|
49
|
+
<web-multiselect mobile-presentation="fullscreen"></web-multiselect>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
This is powered by device/viewport/orientation detection in
|
|
27
53
|
[`@keenmate/web-components-core`](https://www.npmjs.com/package/@keenmate/web-components-core)
|
|
28
|
-
(`BlissElement`
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
(via `BlissElement`'s `environmentChanged` hook), which this release pins at
|
|
55
|
+
**1.0.0-rc06** — rc04 also **dropped `loglevel`** as a transitive runtime
|
|
56
|
+
dependency. The floating dropdown additionally gains a viewport-width safety cap so
|
|
57
|
+
a wide panel can't overflow the screen edge.
|
|
58
|
+
|
|
59
|
+
**Right-to-left, done properly — including runtime switching.** Give the element (or
|
|
60
|
+
any ancestor) `dir="rtl"` and the whole component mirrors: the toggle and in-input
|
|
61
|
+
counter move to the left, checkboxes sit on the right of each row, badges reverse,
|
|
62
|
+
and the full-screen overlay mirrors too (search/close swap sides, the match
|
|
63
|
+
navigator flips). RTL is now built on CSS **logical properties** driven by the
|
|
64
|
+
inherited direction, which fixes cases that silently never worked before — the
|
|
65
|
+
dropdown, hint, and selected-popover live in the shadow root, so the old `.ms--rtl`
|
|
66
|
+
override rules never reached them. And flipping `dir` at runtime — an app-wide
|
|
67
|
+
language switch — re-mirrors the live picker without a rebuild (via core rc06's new
|
|
68
|
+
`directionChanged` hook).
|
|
69
|
+
|
|
70
|
+
**Friendlier phone browsing.** The full-screen sheet opens with the **keyboard
|
|
71
|
+
closed** by default, so you can scan long lists and reach the bottom action buttons
|
|
72
|
+
before typing (opt into immediate type-to-filter with `fullscreen-autofocus="true"`).
|
|
73
|
+
The phone **Back gesture** now closes the sheet instead of navigating the page away.
|
|
74
|
+
In `search-mode="navigate"`, an on-screen **match navigator** (an `N of M` count plus
|
|
75
|
+
prev/next buttons) stands in for the desktop `Ctrl`+`Arrow` match-stepping that touch
|
|
76
|
+
can't do — and the focused match now stays visible above the keyboard instead of
|
|
77
|
+
scrolling behind it. Tapping an option no longer pops the keyboard mid-browse.
|
|
52
78
|
|
|
53
79
|
See `CHANGELOG.md` for the full list.
|
|
54
80
|
|
|
55
|
-
## What's New in
|
|
81
|
+
## What's New in v2.0.0-rc02
|
|
56
82
|
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
83
|
+
**Form association restored for host frameworks (`el.form`).** Selecting inside a
|
|
84
|
+
`<web-multiselect>` that lives in a `<form>` again delivers changes to frameworks
|
|
85
|
+
that resolve the parent form via `event.target.form` — most notably Phoenix
|
|
86
|
+
LiveView's `phx-change` delegation, which silently dropped changes in rc01.
|
|
87
|
+
`<web-multiselect>` is a form-associated custom element, so it now exposes a real
|
|
88
|
+
`el.form` / `event.target.form` like a native control. (rc01 had hardened its
|
|
89
|
+
internal `ElementInternals` handle to a true `#private` field, which killed the
|
|
90
|
+
`.form` that host-framework wrappers read.) The fix lives upstream in
|
|
91
|
+
[`@keenmate/web-components-core`](https://www.npmjs.com/package/@keenmate/web-components-core)
|
|
92
|
+
1.0.0-rc02 (the `el.form` getter), which this release pins.
|
|
62
93
|
|
|
63
|
-
|
|
94
|
+
See `CHANGELOG.md` for the full list.
|
|
64
95
|
|
|
65
96
|
## Demos & docs
|
|
66
97
|
|
|
@@ -115,6 +146,32 @@ npm install @keenmate/web-multiselect
|
|
|
115
146
|
|
|
116
147
|
See [docs/usage.md](./docs/usage.md) for the full API and [docs/examples.md](./docs/examples.md) for advanced patterns (async data, virtual scrolling, custom rendering, form integration).
|
|
117
148
|
|
|
149
|
+
## Editor IntelliSense
|
|
150
|
+
|
|
151
|
+
The package ships editor metadata so you get autocomplete and hover docs for the
|
|
152
|
+
element's attributes, events, and all `--ms-*` CSS custom properties. All of it is
|
|
153
|
+
generated from the component's source on every build, so it never drifts.
|
|
154
|
+
|
|
155
|
+
- **JetBrains** (WebStorm / IntelliJ) — works automatically. The IDE discovers
|
|
156
|
+
`web-types.json` via the `web-types` field in `package.json`; no setup needed.
|
|
157
|
+
- **VS Code** — the data files ship but VS Code doesn't auto-discover them from a
|
|
158
|
+
dependency, so point your workspace at them once in `.vscode/settings.json`:
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"html.customData": [
|
|
163
|
+
"./node_modules/@keenmate/web-multiselect/vscode.html-custom-data.json"
|
|
164
|
+
],
|
|
165
|
+
"css.customData": [
|
|
166
|
+
"./node_modules/@keenmate/web-multiselect/vscode.css-custom-data.json"
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
`html.customData` powers tag/attribute completion on `<web-multiselect>`;
|
|
172
|
+
`css.customData` powers completion for the `--ms-*` theming variables. Reload
|
|
173
|
+
the window after adding them.
|
|
174
|
+
|
|
118
175
|
## Browser support
|
|
119
176
|
|
|
120
177
|
Modern evergreen browsers — anything with native `customElements`, Shadow DOM, and CSS `@layer` support:
|