@keenmate/web-multiselect 1.12.0-rc08 → 2.0.0-rc02

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,52 @@ 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-rc02
25
+
26
+ **Form association restored for host frameworks (`el.form`).** Selecting inside a
27
+ `<web-multiselect>` that lives in a `<form>` again delivers changes to frameworks
28
+ that resolve the parent form via `event.target.form` — most notably Phoenix
29
+ LiveView's `phx-change` delegation, which silently dropped changes in rc01.
30
+ `<web-multiselect>` is a form-associated custom element, so it now exposes a real
31
+ `el.form` / `event.target.form` like a native control. (rc01 had hardened its
32
+ internal `ElementInternals` handle to a true `#private` field, which killed the
33
+ `.form` that host-framework wrappers read.) The fix lives upstream in
34
+ [`@keenmate/web-components-core`](https://www.npmjs.com/package/@keenmate/web-components-core)
35
+ 1.0.0-rc02 (the `el.form` getter), which this release pins.
36
+
37
+ See `CHANGELOG.md` for the full list.
38
+
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
+
24
70
  ## What's New in v1.12.0-rc08
25
71
 
26
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`.
@@ -29,12 +75,6 @@ Reads `--base-*` variables from the page if [`@keenmate/theme-designer`](https:/
29
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.
30
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.
31
77
 
32
- ## What's New in v1.12.0-rc07
33
-
34
- - **Selection — `setSelected(values, { notify: true })` announces programmatic changes** — `setSelected()` stays silent by default (restoring saved state, cascade/dependent resets, and server-authoritative corrections must not re-fire `change`, or they trip "the user changed it" handlers and can bounce in a feedback loop), but the new `{ notify: true }` option fires a **single aggregate `change`** — no per-item `select`/`deselect` flood — for when a programmatic change is a deliberate user gesture, e.g. a custom action button that sets the selection and should reach the same listeners a manual pick does. Threaded through both the internal picker and the web component's `setSelected`.
35
- - **Cascade mode — Select All now honours the value policy** — the built-in `select-all` action added every selectable node's value directly, bypassing the cascade projection, so with `checkbox-mode="cascade"` + `cascade-select-policy="rolled-up"` it emitted every node instead of the rolled-up roots (unlike a click, which rolls up). `selectAll()` is now cascade-aware — it fills the checked-atom set from the visible nodes and projects through the active policy via a shared `commitCascadeAtoms` helper — so Select All emits the same shape a click does. Shown in the new "Action Buttons" section of `examples-tree.html`.
36
- - **Options no longer text-select on click-drag** — clicking a row, or dragging across the dropdown, used to highlight the labels like selectable text, which reads as broken for a pure selection gesture (most visible on the denser tree rows). Options now set `user-select: none` (with the `-webkit-` prefix) on `.ms__option`. Purely presentational — no API or behaviour change.
37
-
38
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.
39
79
 
40
80
  ## Demos & docs
@@ -90,6 +130,32 @@ npm install @keenmate/web-multiselect
90
130
 
91
131
  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).
92
132
 
133
+ ## Editor IntelliSense
134
+
135
+ The package ships editor metadata so you get autocomplete and hover docs for the
136
+ element's attributes, events, and all `--ms-*` CSS custom properties. All of it is
137
+ generated from the component's source on every build, so it never drifts.
138
+
139
+ - **JetBrains** (WebStorm / IntelliJ) — works automatically. The IDE discovers
140
+ `web-types.json` via the `web-types` field in `package.json`; no setup needed.
141
+ - **VS Code** — the data files ship but VS Code doesn't auto-discover them from a
142
+ dependency, so point your workspace at them once in `.vscode/settings.json`:
143
+
144
+ ```json
145
+ {
146
+ "html.customData": [
147
+ "./node_modules/@keenmate/web-multiselect/vscode.html-custom-data.json"
148
+ ],
149
+ "css.customData": [
150
+ "./node_modules/@keenmate/web-multiselect/vscode.css-custom-data.json"
151
+ ]
152
+ }
153
+ ```
154
+
155
+ `html.customData` powers tag/attribute completion on `<web-multiselect>`;
156
+ `css.customData` powers completion for the `--ms-*` theming variables. Reload
157
+ the window after adding them.
158
+
93
159
  ## Browser support
94
160
 
95
161
  Modern evergreen browsers — anything with native `customElements`, Shadow DOM, and CSS `@layer` support: