@keenmate/web-multiselect 2.0.0-rc02 → 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 CHANGED
@@ -21,6 +21,63 @@ 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-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.
40
+
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
53
+ [`@keenmate/web-components-core`](https://www.npmjs.com/package/@keenmate/web-components-core)
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.
78
+
79
+ See `CHANGELOG.md` for the full list.
80
+
24
81
  ## What's New in v2.0.0-rc02
25
82
 
26
83
  **Form association restored for host frameworks (`el.form`).** Selecting inside a
@@ -36,47 +93,6 @@ internal `ElementInternals` handle to a true `#private` field, which killed the
36
93
 
37
94
  See `CHANGELOG.md` for the full list.
38
95
 
39
- ## What's New in v2.0.0-rc01
40
-
41
- **The core-adoption major.** `<web-multiselect>` is now built on
42
- [`@keenmate/web-components-core`](https://www.npmjs.com/package/@keenmate/web-components-core)
43
- (`BlissElement`) — shared, tested custom-element plumbing (attribute parsing,
44
- reactivity, reflection, event handling, logging, registration, positioning). The
45
- dropdown, tree, virtual scroll, theming, and every attribute behave the same; the
46
- change is under the hood, with three **breaking** API changes to be aware of:
47
-
48
- - **`onSelect` / `onDeselect` / `onChange` are event-handler properties now.** They
49
- receive the `CustomEvent` (like `el.onclick`), so read `e.detail.option` /
50
- `e.detail.selectedOptions` / `e.detail.selectedValues` instead of a bare
51
- argument — equivalent to `addEventListener('select', …)`. The bubbling
52
- `select` / `deselect` / `change` events are unchanged.
53
- - **`setAttributes()` takes typed property values by camelCase key.**
54
- `el.setAttributes({ searchPlaceholder: 'Search…', isCounterShown: true })`. To
55
- batch attribute **strings**, use `el.batch(() => { el.setAttribute('search-placeholder', 'Search…'); … })`.
56
- - **Property writes are async (coalesced).** Setting a property (e.g.
57
- `el.options = […]`) applies on a microtask; `await el.whenSettled()` before
58
- reading back rendered state. `setAttributes()` / `batch()` still flush
59
- synchronously.
60
- - **`data-options` gains CSV & plain formats.** The `data-options` attribute now
61
- takes `data-options-format="json|csv|plain"` (default `json`) — feed a CSV table
62
- (first row is a header; columns mapped via `*-member`) or a bare, newline-
63
- delimited value list without hand-writing JSON. Field and row delimiters are
64
- configurable via `data-options-splitter` / `data-options-row-splitter` (so TSV
65
- or a custom separator is expressible in the attribute), and `data-options` is
66
- now a fully reactive, shape-validated input — changing any of these re-renders.
67
-
68
- See `CHANGELOG.md` for the full list.
69
-
70
- ## What's New in v1.12.0-rc08
71
-
72
- - **Panel sizing — dropdown and popover are independently sizable via CSS variables** — The options dropdown and selected-items popover no longer inherit the input's width. `--ms-dropdown-width` (defaults to the live input width) and `--ms-selected-popover-width` (intrinsic 32rem) drive them, alongside the existing max-height variables. Set them at app level (`web-multiselect { --ms-dropdown-width: 60rem }`) or override a single instance with the new `dropdown-width` / `selected-popover-width` attributes, which write those variables inline on the element. This also fixes a latent bug where `--ms-selected-popover-width` was dead (an internal width-sync always overrode it), so the popover now honours its 32rem default. See section 14 of `examples-tree.html`.
73
- - **Tree rendering — the option render callback receives full tree context** — `renderOptionContentCallback(item, ctx)` gains `isTreeNode`, `isBranch`, `isLeaf`, `childCount`, `level`, `depth`, `path`, `isSelectable`, and the cascade `isIndeterminate` tristate. Rendering a child-count badge on branches or branch/leaf-specific markup is now a one-liner, without re-deriving the hierarchy yourself. All fields are optional (flat options report `isTreeNode: false`), so existing callbacks are untouched. Demoed as the new "Custom Node Rendering" section.
74
- - **Cascade counter — the `[N]` chip counts what you actually picked** — In cascade mode the counter used to show the emitted value count, which balloons under `cascade-select-policy="leaves"` / `"all"` (one branch click can emit five values) — jarring next to a couple of rolled-up badges. It now counts the rolled-up minimal cover — the branches you selected — regardless of emit policy, and gained a hover tooltip listing those items. Under the default `rolled-up` policy nothing changes.
75
- - **Theming cleanup — dead input size-variant surface removed from the bundle** — The unused `.ms__input--xs/sm/lg/xl` preset classes and their `--ms-input-size-*` variable chain were never wired to anything (no `size` attribute toggles them), so they've been commented out — kept for a possible future preset API but no longer shipped as dead CSS (the compiled stylesheet shrank ~2 kB). Input sizing still works through `--ms-rem` for proportional global scale or the individual `--ms-input-*` variables for targeted overrides.
76
- - **Fixes — badge hover and live cascade switching** — Badge hover no longer washes the chip to white (the hover background fell through to the white input background; it now deepens the accent tint, dark-mode aware). And switching `checkbox-mode` or `cascade-select-policy` live rebuilds the cascade index and silently re-projects the current selection, so badges, form value, and checkboxes all reflect the new mode instantly.
77
-
78
- > ⚠️ **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 [docs/examples.md → HTML Injection (XSS) notice](./docs/examples.md#html-injection-xss-notice) for the complete list of affected callbacks.
79
-
80
96
  ## Demos & docs
81
97
 
82
98
  - 🚀 [Live demo](https://web-multiselect.keenmate.dev)