@keenmate/web-multiselect 1.12.0-rc07 → 2.0.0-rc01
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 +38 -16
- package/component-variables.manifest.json +1 -0
- package/custom-elements.json +6591 -0
- package/dist/index.d.ts +220 -298
- package/dist/multiselect.js +2597 -2248
- package/dist/multiselect.umd.js +28 -24
- package/dist/style.css +1 -1
- package/docs/examples.md +2 -2
- package/docs/usage.md +396 -339
- package/package.json +16 -4
- package/src/css/controls.css +10 -2
- package/src/css/floating.css +1 -0
- package/src/css/variables.css +29 -10
- package/vscode.css-custom-data.json +1615 -0
- package/vscode.html-custom-data.json +443 -0
- package/web-types.json +2113 -0
package/README.md
CHANGED
|
@@ -21,22 +21,44 @@ 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
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
24
|
+
## What's New in v2.0.0-rc01
|
|
25
|
+
|
|
26
|
+
**The core-adoption major.** `<web-multiselect>` is now built on
|
|
27
|
+
[`@keenmate/web-components-core`](https://www.npmjs.com/package/@keenmate/web-components-core)
|
|
28
|
+
(`BlissElement`) — shared, tested custom-element plumbing (attribute parsing,
|
|
29
|
+
reactivity, reflection, event handling, logging, registration, positioning). The
|
|
30
|
+
dropdown, tree, virtual scroll, theming, and every attribute behave the same; the
|
|
31
|
+
change is under the hood, with three **breaking** API changes to be aware of:
|
|
32
|
+
|
|
33
|
+
- **`onSelect` / `onDeselect` / `onChange` are event-handler properties now.** They
|
|
34
|
+
receive the `CustomEvent` (like `el.onclick`), so read `e.detail.option` /
|
|
35
|
+
`e.detail.selectedOptions` / `e.detail.selectedValues` instead of a bare
|
|
36
|
+
argument — equivalent to `addEventListener('select', …)`. The bubbling
|
|
37
|
+
`select` / `deselect` / `change` events are unchanged.
|
|
38
|
+
- **`setAttributes()` takes typed property values by camelCase key.**
|
|
39
|
+
`el.setAttributes({ searchPlaceholder: 'Search…', isCounterShown: true })`. To
|
|
40
|
+
batch attribute **strings**, use `el.batch(() => { el.setAttribute('search-placeholder', 'Search…'); … })`.
|
|
41
|
+
- **Property writes are async (coalesced).** Setting a property (e.g.
|
|
42
|
+
`el.options = […]`) applies on a microtask; `await el.whenSettled()` before
|
|
43
|
+
reading back rendered state. `setAttributes()` / `batch()` still flush
|
|
44
|
+
synchronously.
|
|
45
|
+
- **`data-options` gains CSV & plain formats.** The `data-options` attribute now
|
|
46
|
+
takes `data-options-format="json|csv|plain"` (default `json`) — feed a CSV table
|
|
47
|
+
(first row is a header; columns mapped via `*-member`) or a bare, newline-
|
|
48
|
+
delimited value list without hand-writing JSON. Field and row delimiters are
|
|
49
|
+
configurable via `data-options-splitter` / `data-options-row-splitter` (so TSV
|
|
50
|
+
or a custom separator is expressible in the attribute), and `data-options` is
|
|
51
|
+
now a fully reactive, shape-validated input — changing any of these re-renders.
|
|
52
|
+
|
|
53
|
+
See `CHANGELOG.md` for the full list.
|
|
54
|
+
|
|
55
|
+
## What's New in v1.12.0-rc08
|
|
56
|
+
|
|
57
|
+
- **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`.
|
|
58
|
+
- **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.
|
|
59
|
+
- **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.
|
|
60
|
+
- **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.
|
|
61
|
+
- **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.
|
|
40
62
|
|
|
41
63
|
> ⚠️ **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.
|
|
42
64
|
|
|
@@ -147,6 +147,7 @@
|
|
|
147
147
|
{ "name": "ms-dropdown-border-radius", "category": "dropdown", "usage": "Dropdown border radius" },
|
|
148
148
|
{ "name": "ms-dropdown-box-shadow", "category": "dropdown", "usage": "Dropdown shadow" },
|
|
149
149
|
{ "name": "ms-dropdown-box-shadow-semantic", "category": "dropdown", "usage": "Dropdown semantic shadow" },
|
|
150
|
+
{ "name": "ms-dropdown-width", "category": "dropdown", "usage": "Options dropdown width (defaults to the input width; also set via the dropdown-width attribute)" },
|
|
150
151
|
{ "name": "ms-options-max-height", "category": "dropdown", "usage": "Options list max height" },
|
|
151
152
|
{ "name": "ms-z-index-dropdown", "category": "dropdown", "usage": "Dropdown z-index" },
|
|
152
153
|
{ "name": "ms-z-index-sticky", "category": "dropdown", "usage": "Sticky elements z-index" },
|