@keenmate/web-multiselect 2.0.0-rc03 → 2.0.0-rc05

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,75 +21,35 @@ 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
- buttonwhile 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
-
81
- ## What's New in v2.0.0-rc02
82
-
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.
24
+ ## What's New in v2.0.0-rc05
25
+
26
+ - **Full-screen overlays — content no longer clipped under landscape system bars** — Rotating a phone to landscape with the full-screen dropdown (or the selected-items popover) open used to push the search field and option rows *under* the Android navigation bar and camera cutout — the field looked "too wide for the screen" and each row's leading edge was hidden. Cause: the sheets are `width: 100vw` (the full physical width) with no safe-area handling. They now set `box-sizing: border-box` and inset their content box by `env(safe-area-inset-{top,right,bottom,left})` on all four edges — the background stays edge-to-edge (full-bleed, no corner gaps) while the header · list · actions column is pulled into the visible region, and the fullscreen toast lifts above the bottom safe area. `env()` resolves to `0` unless the host page opts into edge-to-edge, so this is a no-op on non-cutout / letterboxed pages — a fix where needed, never a regression. Consumer note: for the insets to engage the host page must set `<meta name="viewport" content="… viewport-fit=cover">` (the mobile examples/tests now do).
27
+
28
+ ## What's New in v2.0.0-rc04
29
+
30
+ **Phone search one-tap clear and a keyboard that gets out of the way** — The
31
+ full-screen search sheet gained the two things it was missing on touch. A clear button
32
+ now sits at the trailing edge of the search field (a distinct Lucide `search-x` glyph,
33
+ so it doesn't read as a second close ✕) to wipe the term in one tap and restore the full
34
+ list. And the soft keyboard, which used to stay pinned open once you focused the field,
35
+ now tucks away on the three natural "done typing" gestures — scrolling the list, tapping
36
+ an option, or pressing Enter/Search while never dismissing itself mid-type from a
37
+ programmatic scroll-to-match.
38
+
39
+ **A close button you can make your own** — The full-screen close ✕ is now a themeable
40
+ chip: the new `--ms-fullscreen-close-bg`, `--ms-fullscreen-close-border`, and
41
+ `--ms-fullscreen-close-border-radius` variables turn the bare glyph into a bordered
42
+ button (à la a command-palette close) while the defaults keep it a plain round ✕. Its
43
+ tap target was also fixed — the previously-dead padding around the button in the sheet's
44
+ top-trailing corner (the natural place to reach) now dismisses the sheet, without ever
45
+ stealing taps from the first option row or the search field.
46
+
47
+ **Right presentation on every device, via core rc07** — This release pins
48
+ `@keenmate/web-components-core` at `1.0.0-rc07` and adopts its reworked
49
+ `resolvePresentation` / `classifyDevice` API. Behavior is unchanged — full-screen on
50
+ phones, floating on tablet and desktop — with one refinement from the new capability
51
+ gate: a narrowed desktop window (fine pointer, hover) now stays `desktop` and keeps its
52
+ floating dropdown at any width, instead of ever flipping to the full-screen sheet.
93
53
 
94
54
  See `CHANGELOG.md` for the full list.
95
55
 
@@ -487,6 +487,15 @@
487
487
  "privacy": "private",
488
488
  "default": "null"
489
489
  },
490
+ {
491
+ "kind": "field",
492
+ "name": "fullscreenSearchClear",
493
+ "type": {
494
+ "text": "HTMLButtonElement | null"
495
+ },
496
+ "privacy": "private",
497
+ "default": "null"
498
+ },
490
499
  {
491
500
  "kind": "field",
492
501
  "name": "fullscreenNav",
@@ -2132,6 +2141,28 @@
2132
2141
  },
2133
2142
  "description": "Sync the fullscreen match navigator (navigate mode only) with the current search\r\nstate: hide it until there's a term, then show \"N of M\" while a match is focused\r\n(or \"M matches\" / \"No matches\"), and disable the prev/next buttons when there's\r\nnothing to step through. No-op when the navigator isn't built (floating panel,\r\nfilter mode, or search disabled)."
2134
2143
  },
2144
+ {
2145
+ "kind": "method",
2146
+ "name": "updateFullscreenSearchClear",
2147
+ "privacy": "private",
2148
+ "return": {
2149
+ "type": {
2150
+ "text": "void"
2151
+ }
2152
+ },
2153
+ "description": "Show the fullscreen search's inline clear (✕) only while the field has text.\r\nNo-op when the button isn't built (floating panel, readonly/hidden search)."
2154
+ },
2155
+ {
2156
+ "kind": "method",
2157
+ "name": "clearFullscreenSearch",
2158
+ "privacy": "private",
2159
+ "return": {
2160
+ "type": {
2161
+ "text": "void"
2162
+ }
2163
+ },
2164
+ "description": "Clear the fullscreen search term via the same path a keystroke takes, then\r\nrefocus the field so the user can keep typing. Touch has no keyboard Escape,\r\nso this button is the on-screen way to reset a search."
2165
+ },
2135
2166
  {
2136
2167
  "kind": "method",
2137
2168
  "name": "positionHint",
package/dist/index.d.ts CHANGED
@@ -777,6 +777,7 @@ export declare class WebMultiSelect<T = any> {
777
777
  private presentationMode;
778
778
  private fullscreenHeader;
779
779
  private fullscreenSearchInput;
780
+ private fullscreenSearchClear;
780
781
  private fullscreenNav;
781
782
  private fullscreenNavCount;
782
783
  private fullscreenNavPrev;
@@ -1175,6 +1176,17 @@ export declare class WebMultiSelect<T = any> {
1175
1176
  * filter mode, or search disabled).
1176
1177
  */
1177
1178
  private updateFullscreenNav;
1179
+ /**
1180
+ * Show the fullscreen search's inline clear (✕) only while the field has text.
1181
+ * No-op when the button isn't built (floating panel, readonly/hidden search).
1182
+ */
1183
+ private updateFullscreenSearchClear;
1184
+ /**
1185
+ * Clear the fullscreen search term via the same path a keystroke takes, then
1186
+ * refocus the field so the user can keep typing. Touch has no keyboard Escape,
1187
+ * so this button is the on-screen way to reset a search.
1188
+ */
1189
+ private clearFullscreenSearch;
1178
1190
  private positionHint;
1179
1191
  private parseInitialSelection;
1180
1192
  /**