@rcarls/rc-select 0.5.0 → 0.7.0
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/CHANGELOG.md +310 -0
- package/README.md +44 -14
- package/dist/custom-elements.json +444 -15
- package/dist/{rc-select-BRp1j-JD.js → rc-select-DX-fKYeR.js} +328 -282
- package/dist/rc-select-DX-fKYeR.js.map +1 -0
- package/dist/rc-select-define.js +3 -1
- package/dist/rc-select-define.js.map +1 -1
- package/dist/rc-select.js +3 -2
- package/dist/types/packages/rc-select/src/rc-select.d.ts +130 -15
- package/package.json +5 -3
- package/dist/rc-select-BRp1j-JD.js.map +0 -1
- package/dist/types/packages/rc-select/src/rc-select.test.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,315 @@
|
|
|
1
1
|
# @rcarls/rc-select
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 079e025: Standardize component styling contracts for the breaking 0.7 release.
|
|
8
|
+
|
|
9
|
+
BREAKING CHANGE: Rename the Markdown editor's `--rme-*` properties to
|
|
10
|
+
`--rc-markdown-editor-*`, `--rc-app-bar-background` to `--rc-app-bar-bg`,
|
|
11
|
+
`--rc-textarea-radius` to `--rc-textarea-border-radius`, the transfer-list
|
|
12
|
+
`--rc-transfer-list-panel-*` properties to `--rc-transfer-list-listbox-*`,
|
|
13
|
+
`--rc-chip-group-webkit-scrollbar-display` to
|
|
14
|
+
`--rc-chip-group-scrollbar-display`, and `--rc-text` to `--rc-field-text`.
|
|
15
|
+
Compatibility aliases are intentionally not provided.
|
|
16
|
+
|
|
17
|
+
BREAKING CHANGE: Replace `--rc-select-chip-padding-inline` and
|
|
18
|
+
`--rc-combobox-chip-padding-inline` with explicit `*-padding-inline-start` and
|
|
19
|
+
`*-padding-inline-end` tokens. Generated removable chips now reserve the full
|
|
20
|
+
remove target and its edge offset, so their indicator cannot overlap label text.
|
|
21
|
+
|
|
22
|
+
Add canonical app-bar elevation, transfer-list listbox radius, and textarea
|
|
23
|
+
line-action tokens. Add logical `rc-chip` inline-padding properties so themes
|
|
24
|
+
can implement Material's icon-aware spacing without overriding authored child
|
|
25
|
+
styles. Make `rc-field` consume the shared semantic token layer,
|
|
26
|
+
and place the `rc-chip` and `rc-search-bar` light-DOM structural styles in the
|
|
27
|
+
`rc-base` cascade layer so normal consumer rules override them.
|
|
28
|
+
|
|
29
|
+
Prevent decorative, `aria-hidden` trailing list content from intercepting a
|
|
30
|
+
whole-row action target, and keep segmented-list item geometry from leaking
|
|
31
|
+
into nested standard lists.
|
|
32
|
+
|
|
33
|
+
Remove unused Material navigation-rail toggle tokens and obsolete list-item
|
|
34
|
+
theme tokens. Register the segmented-button private theme seam and enforce
|
|
35
|
+
token ownership, documentation, removed-name, selector-budget, and cascade
|
|
36
|
+
layer contracts through the component architecture audit.
|
|
37
|
+
|
|
38
|
+
- 4341311: Add reusable fullscreen dialogs and declarative dialog popup mode to `rc-select` and
|
|
39
|
+
`rc-combobox`. Dialog selection and creation are staged until Done, while close and Escape
|
|
40
|
+
discard the draft. Fullscreen surfaces follow the visual viewport under browser zoom and
|
|
41
|
+
software keyboards, and anchored popups now clamp to the visual viewport.
|
|
42
|
+
- 54d9ead: Localize every component's built-in text. Button names, role
|
|
43
|
+
descriptions, announcements, and default labels now resolve per key from
|
|
44
|
+
the element's `messages` property, then from text registered with
|
|
45
|
+
`registerMessages(locale, catalog)` in `@rcarls/rc-common`, then from the
|
|
46
|
+
English defaults. The locale is the element's own `lang`, else
|
|
47
|
+
`<html lang>`; an ancestor's `lang` is ignored, because it usually marks
|
|
48
|
+
content rather than the interface. Components re-render when that locale
|
|
49
|
+
changes or new text is registered. `RcMessageCatalog` types the catalog,
|
|
50
|
+
and each package adds its scope to it.
|
|
51
|
+
|
|
52
|
+
Numbers a component formats as text follow the same locale:
|
|
53
|
+
`rc-progress`'s default percentage and `rc-splitter`'s `aria-valuetext`
|
|
54
|
+
use `Intl.NumberFormat`. `TypeaheadController` matches prefixes with an
|
|
55
|
+
`Intl.Collator`, so case and accents are ignored the way the locale
|
|
56
|
+
ignores them, and takes a `locale` option. `ItemsCollectionController`'s
|
|
57
|
+
`setCreateOption(text, label?)` takes the option's visible text from its
|
|
58
|
+
caller.
|
|
59
|
+
|
|
60
|
+
`rc-transfer-list`'s direction arrows are now decorative: screen readers
|
|
61
|
+
read only the action name, and the arrows turn over in RTL.
|
|
62
|
+
|
|
63
|
+
**Breaking:** chrome-text properties are replaced by `messages`. Migrate:
|
|
64
|
+
|
|
65
|
+
- `rc-search-bar` `clear-label` / `clearLabel` → `messages.clear`
|
|
66
|
+
- `rc-adaptive-menu` `overflow-label` / `overflowLabel` → `messages.overflow`
|
|
67
|
+
- `rc-chip-group` `show-all-label` / `showAllLabel` and `show-less-label` /
|
|
68
|
+
`showLessLabel` → `messages.showAll` and `messages.showLess`
|
|
69
|
+
- `rc-select` and `rc-combobox` `dialog-confirm-label` /
|
|
70
|
+
`dialogConfirmLabel` and `dialog-cancel-label` / `dialogCancelLabel` →
|
|
71
|
+
`messages.done` and `messages.cancel`
|
|
72
|
+
- `rc-editor-toolbar` `label` → `messages.toolbar`
|
|
73
|
+
|
|
74
|
+
Per-instance names stay attributes, but now default to `undefined` and fall
|
|
75
|
+
back to a message: `label` on `rc-adaptive-menu`, `rc-chip-group`,
|
|
76
|
+
`rc-menubar`, and `rc-splitter`; `available-label` and `selected-label`
|
|
77
|
+
on `rc-transfer-list`; `low-label` and `high-label` on `rc-range-slider`.
|
|
78
|
+
Read the resolved name from the rendered `aria-label` instead of the
|
|
79
|
+
property.
|
|
80
|
+
|
|
81
|
+
- 94dc987: `rc-menu-button`'s, `rc-select`'s, and `rc-combobox`'s popup/listbox now fade
|
|
82
|
+
in and out through CSS alone, using `@starting-style` and a discrete
|
|
83
|
+
`display`/`overlay` transition, driven by new `--rc-menu-button-popup-duration`,
|
|
84
|
+
`--rc-select-listbox-duration`, and `--rc-combobox-listbox-duration`
|
|
85
|
+
properties. `showPopover()`/`hidePopover()` (via `openPopup()`/`closePopup()`)
|
|
86
|
+
stay synchronous, and nothing waits on the transition finishing.
|
|
87
|
+
|
|
88
|
+
These animate opacity only, not a scale or slide transform: all three
|
|
89
|
+
position their popup with the shared `AnchorController`, which applies its
|
|
90
|
+
own viewport-clamping `translate` and reads `getBoundingClientRect()` to
|
|
91
|
+
compute the next correction. A second, CSS-driven transform on the same
|
|
92
|
+
element and property would fight that positioning math on every open, not
|
|
93
|
+
only during an edge case.
|
|
94
|
+
|
|
95
|
+
`rc-fab-menu` already had a scale-based entrance for its popup (verified safe
|
|
96
|
+
here: unlike the general `AnchorController` case, this popup isn't
|
|
97
|
+
collision-clamped), but no exit animation at all and no directional easing.
|
|
98
|
+
Both are added: the popup now fades and scales back out on close, and enter
|
|
99
|
+
uses a decelerating curve while exit uses an accelerating one.
|
|
100
|
+
|
|
101
|
+
- 687a9be: Add shared popup surface tokens: `--rc-popup-background`, `--rc-popup-color`,
|
|
102
|
+
`--rc-popup-border`, `--rc-popup-radius`, `--rc-popup-shadow`, and
|
|
103
|
+
`--rc-popup-padding-block`. Menus, adaptive-menu popups, and select and
|
|
104
|
+
combobox listboxes read them before their own fallbacks. Themes set them at the
|
|
105
|
+
theme root, so popups rendered inside other shadow roots keep the theme's
|
|
106
|
+
surface. Select and combobox add `--rc-*-listbox-background` and
|
|
107
|
+
`--rc-*-listbox-color`.
|
|
108
|
+
|
|
109
|
+
Breaking: popup surfaces no longer fall back to `--rc-control-radius`. Set
|
|
110
|
+
`--rc-popup-radius` (or the per-component radius token) to change popup
|
|
111
|
+
corners. The Material, Substrate, and Win31 themes no longer set per-component
|
|
112
|
+
popup surface tokens such as `--rc-menu-radius` or
|
|
113
|
+
`--rc-adaptive-menu-popup-background`; override the `--rc-popup-*` tokens
|
|
114
|
+
instead. Material select and combobox listboxes now use the menu container
|
|
115
|
+
color, Material forced-colors popups gain a border, and Substrate listboxes use
|
|
116
|
+
the menu shadow and padding. Material retains its two-layer adaptive-menu popup
|
|
117
|
+
shadow through a component token while other popups continue using the shared
|
|
118
|
+
shadow.
|
|
119
|
+
|
|
120
|
+
- 8a30e96: Support acting as an `rc-field` control provider: `focus()`/`blur()` forward to the shadow-DOM
|
|
121
|
+
trigger, a real user-driven selection now dispatches native `input` and `change` on the slotted
|
|
122
|
+
`<select>` (a programmatic `value`/`defaultValue` write does not, matching `rc-textarea`'s
|
|
123
|
+
controlled-value contract), and a new `required` property mirrors the slotted select's own
|
|
124
|
+
`required` onto `aria-required` on the trigger.
|
|
125
|
+
- f0d0fba: Load the select dialog popup and selected-value chips on first use.
|
|
126
|
+
`rc-select` and `rc-combobox` now import `rc-dialog` only for
|
|
127
|
+
`popup-mode="dialog"` and `rc-chip-group` only for `multiple`, so a popover
|
|
128
|
+
single select ships neither. The markdown editor toolbar picks the heading level
|
|
129
|
+
with a native `<select>`, styled by the existing
|
|
130
|
+
`--rc-markdown-editor-toolbar-select-*` properties, and no longer depends on
|
|
131
|
+
`rc-select`.
|
|
132
|
+
|
|
133
|
+
Breaking change and migration:
|
|
134
|
+
|
|
135
|
+
- Importing `@rcarls/rc-select/define` or `@rcarls/rc-combobox/define` no
|
|
136
|
+
longer registers `rc-dialog`, `rc-chip-group`, or `rc-chip`. Import their own
|
|
137
|
+
`define` entries where the page uses those elements directly.
|
|
138
|
+
|
|
139
|
+
### Patch Changes
|
|
140
|
+
|
|
141
|
+
- 9ee769c: Anchor popups in logical terms only. A placement is now `block-start`,
|
|
142
|
+
`block-end`, `inline-start`, or `inline-end`, each with an optional
|
|
143
|
+
`-start`/`-end` edge alignment, and all of them follow the writing mode and
|
|
144
|
+
direction. Block sides open above or below a row in horizontal text and
|
|
145
|
+
beside it in vertical text; inline sides open along the reading direction,
|
|
146
|
+
so `inline-end` opens to the left in RTL. `resolveAnchorPlacement` exposes
|
|
147
|
+
the resolution for other consumers.
|
|
148
|
+
|
|
149
|
+
**Breaking:** the physical placements `top*`, `bottom*`, `left*`, and
|
|
150
|
+
`right*` are removed from `AnchorPlacement`, `rc-menu-button`'s and
|
|
151
|
+
`rc-fab-menu`'s `placement`, and the React and Solid typings. Migrate:
|
|
152
|
+
|
|
153
|
+
- `bottom*` → `block-end*`
|
|
154
|
+
- `top*` → `block-start*`
|
|
155
|
+
- `right*` → `inline-end*` (in LTR)
|
|
156
|
+
- `left*` → `inline-start*` (in LTR)
|
|
157
|
+
|
|
158
|
+
Defaults move with them and render the same in horizontal LTR text:
|
|
159
|
+
`rc-menu-button`, `rc-select`, and `rc-combobox` open at `block-end-start`,
|
|
160
|
+
`rc-adaptive-menu`'s overflow menu at `block-end-end`, and `rc-fab-menu` at
|
|
161
|
+
`block-start-end`. In vertical text these popups now open beside their
|
|
162
|
+
trigger instead of over the next item. Vertical menubars and vertical
|
|
163
|
+
adaptive menus open submenus at `inline-end-start`. Open popups also
|
|
164
|
+
re-resolve their physical side and alignment when an ancestor's `dir`
|
|
165
|
+
changes, and `rc-fab-menu` keeps its corner-aware default even when nested in
|
|
166
|
+
a vertical menubar.
|
|
167
|
+
|
|
168
|
+
- 1179f24: Drop the `@oddbird/css-anchor-positioning` polyfill. Browsers without full
|
|
169
|
+
native anchor positioning now use `AnchorController`'s script positioning,
|
|
170
|
+
which applies the same placement and flip rules and re-positions when the page
|
|
171
|
+
scrolls or the viewport, anchor, or floating element resizes. Those browsers no
|
|
172
|
+
longer download the 41 kB polyfill the first time a popup opens.
|
|
173
|
+
- 3d050f1: Keep wrapped chip rows evenly spaced. Readonly chips in an `rc-chip-group`
|
|
174
|
+
keep the touch-target block size, so expanded rows share the disclosure
|
|
175
|
+
toggle's pitch. `rc-combobox` and `rc-select` return the chip touch-target
|
|
176
|
+
overlap tokens as row gap, so interior chip rows no longer collapse onto each
|
|
177
|
+
other inside a field. Material combobox and select input chips drop their
|
|
178
|
+
extra block padding to render at the 2rem chip height.
|
|
179
|
+
- 5c006de: Ship component CSS minified. Package builds now run the CSS in Lit `css` styles
|
|
180
|
+
and light-DOM structural styles through Lightning CSS, removing comments and
|
|
181
|
+
whitespace while keeping source maps that resolve to each template. Rendered
|
|
182
|
+
styles are unchanged.
|
|
183
|
+
|
|
184
|
+
`@rcarls/rc-common` adds `cssText`, an identity tag that marks a plain CSS
|
|
185
|
+
string for minification. `rc-chip`, `rc-disclosure`, and `rc-accordion` now
|
|
186
|
+
depend on `@rcarls/rc-common` for it.
|
|
187
|
+
|
|
188
|
+
- a6553ff: Batch layout sampling into a shared animation-frame read phase so mounting a
|
|
189
|
+
large component route no longer alternates forced layout reads with component
|
|
190
|
+
writes. Closed anchored popups now skip placement work until they open, while
|
|
191
|
+
scroller boundaries, carousel positioning, flow state, and opted-in initial
|
|
192
|
+
scroll observation settle before the next paint.
|
|
193
|
+
|
|
194
|
+
Add `RafScheduler.schedulePhased()`, live `AnchorController.disabled` getters,
|
|
195
|
+
and the `ScrollObserverController.initialEvaluation` timing option.
|
|
196
|
+
|
|
197
|
+
- ec6ebc6: Load dialog move and resize behavior on demand. `rc-dialog` now imports its
|
|
198
|
+
drag and resize controllers only the first time `movable`, `move-handle`, or
|
|
199
|
+
`resize` enables them, so dialogs that never move or resize, including the
|
|
200
|
+
popups inside `rc-select`, `rc-combobox`, and `rc-markdown-editor`, no longer
|
|
201
|
+
ship that code. The new `@rcarls/rc-dialog/geometry` entry exports
|
|
202
|
+
`DialogGeometry` for subclasses that always resize; `rc-bottom-sheet` uses it,
|
|
203
|
+
so its resize stays available immediately.
|
|
204
|
+
|
|
205
|
+
Breaking changes and migration:
|
|
206
|
+
|
|
207
|
+
- `rc-dialog` and `rc-bottom-sheet` remove `light-dismiss` / `lightDismiss`.
|
|
208
|
+
Use `closed-by="any"`, which closes on Escape or a backdrop click and now
|
|
209
|
+
falls back to a backdrop click listener where the browser has no native
|
|
210
|
+
`closedby`.
|
|
211
|
+
- `rc-bottom-sheet` now defaults `closed-by` to `any` instead of defaulting
|
|
212
|
+
`light-dismiss` to true. Set `closed-by="closerequest"` to keep backdrop
|
|
213
|
+
clicks from closing a sheet, or `closed-by="none"` to allow only explicit
|
|
214
|
+
actions.
|
|
215
|
+
|
|
216
|
+
- 51f6403: Arrow keys follow the reading direction everywhere. `keyNavigation` now also
|
|
217
|
+
flips the cross axis in RTL, so a vertical menu opens its submenu with
|
|
218
|
+
ArrowLeft, as the APG describes. A horizontal menubar and segmented button
|
|
219
|
+
advance with ArrowLeft in RTL, Alt+ArrowLeft moves items toward the selected
|
|
220
|
+
list of a transfer list in RTL, and the arrow toward the inline start reaches
|
|
221
|
+
the chips of a multiple select or combobox (ArrowRight in RTL).
|
|
222
|
+
|
|
223
|
+
Add `inlineArrowKeys(flow)` for content that runs along the inline axis, such
|
|
224
|
+
as chips or text.
|
|
225
|
+
|
|
226
|
+
- b764a3c: Observe interface locale changes through containing shadow roots and the host's own document.
|
|
227
|
+
An explicit empty `lang` now means an unknown locale rather than falling back to `<html lang>`.
|
|
228
|
+
Typeahead compares complete grapheme prefixes, including decomposed accents and collation
|
|
229
|
+
expansions. Default interpolating messages format numeric positions in the interface locale
|
|
230
|
+
while translation callbacks continue to receive numbers and can accept an optional locale.
|
|
231
|
+
Default messages isolate consumer text whose direction is unknown. Textarea content direction
|
|
232
|
+
uses the native LTR fallback for neutral `dir="auto"` content, recognizes Arabic Letter Mark and
|
|
233
|
+
isolate controls, and reruns plugins when the native textarea's `lang` or `dir` changes.
|
|
234
|
+
- cc0205d: Use logical CSS properties so layout follows the reading direction and
|
|
235
|
+
writing mode: the textarea gutter border and alignment, line-action and
|
|
236
|
+
diagnostic-message spacing, the markdown editor's block quote and list
|
|
237
|
+
indents, and block-axis scrolling for listbox, select, combobox, and markdown
|
|
238
|
+
panes, each keeping its physical declaration as a fallback.
|
|
239
|
+
- f1ca82d: Add an anchored, non-modal popover package with a Material rich-tooltip recipe. Share native Popover API visibility and fallback behavior across existing popup components.
|
|
240
|
+
- Updated dependencies [e3dfa59]
|
|
241
|
+
- Updated dependencies [50d5610]
|
|
242
|
+
- Updated dependencies [9ee769c]
|
|
243
|
+
- Updated dependencies [1179f24]
|
|
244
|
+
- Updated dependencies [9720b36]
|
|
245
|
+
- Updated dependencies [2934328]
|
|
246
|
+
- Updated dependencies [9059bce]
|
|
247
|
+
- Updated dependencies [3d050f1]
|
|
248
|
+
- Updated dependencies [595fe37]
|
|
249
|
+
- Updated dependencies [38cd00c]
|
|
250
|
+
- Updated dependencies [5c006de]
|
|
251
|
+
- Updated dependencies [079e025]
|
|
252
|
+
- Updated dependencies [a6553ff]
|
|
253
|
+
- Updated dependencies [8300209]
|
|
254
|
+
- Updated dependencies [2205478]
|
|
255
|
+
- Updated dependencies [8cbc627]
|
|
256
|
+
- Updated dependencies [ec6ebc6]
|
|
257
|
+
- Updated dependencies [4341311]
|
|
258
|
+
- Updated dependencies [899bb5e]
|
|
259
|
+
- Updated dependencies [5a7a1dd]
|
|
260
|
+
- Updated dependencies [2c7c80a]
|
|
261
|
+
- Updated dependencies [25fcfe0]
|
|
262
|
+
- Updated dependencies [75f1dbd]
|
|
263
|
+
- Updated dependencies [0de2332]
|
|
264
|
+
- Updated dependencies [51f6403]
|
|
265
|
+
- Updated dependencies [9caca6b]
|
|
266
|
+
- Updated dependencies [b764a3c]
|
|
267
|
+
- Updated dependencies [cc0205d]
|
|
268
|
+
- Updated dependencies [54d9ead]
|
|
269
|
+
- Updated dependencies [57338f5]
|
|
270
|
+
- Updated dependencies [b9175e9]
|
|
271
|
+
- Updated dependencies [c8b762b]
|
|
272
|
+
- Updated dependencies [55e1e7f]
|
|
273
|
+
- Updated dependencies [f1ca82d]
|
|
274
|
+
- Updated dependencies [3fe08cb]
|
|
275
|
+
- Updated dependencies [a86edce]
|
|
276
|
+
- Updated dependencies [b87f27b]
|
|
277
|
+
- Updated dependencies [32ebead]
|
|
278
|
+
- Updated dependencies [bfefedd]
|
|
279
|
+
- Updated dependencies [c130173]
|
|
280
|
+
- Updated dependencies [11680b6]
|
|
281
|
+
- Updated dependencies [223d36c]
|
|
282
|
+
- Updated dependencies [7b91a44]
|
|
283
|
+
- Updated dependencies [aa04ead]
|
|
284
|
+
- Updated dependencies [ac65b5b]
|
|
285
|
+
- Updated dependencies [6d126fd]
|
|
286
|
+
- Updated dependencies [afcfef8]
|
|
287
|
+
- Updated dependencies [11ef1ad]
|
|
288
|
+
- @rcarls/rc-common@0.7.0
|
|
289
|
+
- @rcarls/rc-chip-group@0.7.0
|
|
290
|
+
- @rcarls/rc-dialog@0.7.0
|
|
291
|
+
- @rcarls/rc-listbox@0.7.0
|
|
292
|
+
|
|
293
|
+
## 0.6.0
|
|
294
|
+
|
|
295
|
+
### Minor Changes
|
|
296
|
+
|
|
297
|
+
- ffcbf11: Add adaptive chip-group layouts, native-backed filter chips, and shared
|
|
298
|
+
input-chip rendering. Native-backed chips preserve controlled host state,
|
|
299
|
+
follow form resets when uncontrolled, and accept native link actions. Groups
|
|
300
|
+
restore author-owned chip variants when coordination ends. Keep search input
|
|
301
|
+
chrome inside the search surface and align contextual icon sizes with Material 3.
|
|
302
|
+
|
|
303
|
+
### Patch Changes
|
|
304
|
+
|
|
305
|
+
- Updated dependencies [ffcbf11]
|
|
306
|
+
- Updated dependencies [6683eb9]
|
|
307
|
+
- Updated dependencies [ee7ba6c]
|
|
308
|
+
- Updated dependencies [30eb232]
|
|
309
|
+
- @rcarls/rc-chip-group@0.6.0
|
|
310
|
+
- @rcarls/rc-common@0.6.0
|
|
311
|
+
- @rcarls/rc-listbox@0.6.0
|
|
312
|
+
|
|
3
313
|
## 0.5.0
|
|
4
314
|
|
|
5
315
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -40,26 +40,56 @@ import '@rcarls/rc-select/define';
|
|
|
40
40
|
</label>
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
## Dialog popup
|
|
44
|
+
|
|
45
|
+
Set `popup-mode="dialog"` when an anchored listbox would leave too little usable viewport. The
|
|
46
|
+
component manages a fullscreen native dialog with a leading close action, title, current chips,
|
|
47
|
+
option list, and trailing Done action.
|
|
48
|
+
|
|
49
|
+
Dialog selection is transactional: option and chip changes are staged until Done is activated.
|
|
50
|
+
Done updates the native `<select>` and fires one `rc-select-change`; the leading close action,
|
|
51
|
+
Escape, and imperative close discard the staged changes.
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<rc-select popup-mode="dialog" placeholder="Choose categories" multiple>
|
|
55
|
+
<select name="categories" multiple>
|
|
56
|
+
<option value="quick">Quick meal</option>
|
|
57
|
+
<option value="vegetarian">Vegetarian</option>
|
|
58
|
+
</select>
|
|
59
|
+
</rc-select>
|
|
60
|
+
```
|
|
61
|
+
|
|
43
62
|
## API
|
|
44
63
|
|
|
45
|
-
| Property / method
|
|
46
|
-
|
|
|
47
|
-
| `open`
|
|
48
|
-
| `multiple`
|
|
49
|
-
| `disabled`
|
|
50
|
-
| `placeholder`
|
|
51
|
-
| `display`
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
64
|
+
| Property / method | Type | Description |
|
|
65
|
+
| -------------------------- | -------------------------------- | --------------------------------------------------------- |
|
|
66
|
+
| `open` | `boolean` | Current popup state. |
|
|
67
|
+
| `multiple` | `boolean` | Mirrors the slotted `<select multiple>` state. |
|
|
68
|
+
| `disabled` | `boolean` | Mirrors the slotted `<select disabled>` state. |
|
|
69
|
+
| `placeholder` | `string` | Text shown when no value is selected. |
|
|
70
|
+
| `display` | `'auto' \| 'chips' \| 'compact'` | Controls multi-select display. |
|
|
71
|
+
| `popupMode` | `'popover' \| 'dialog'` | Chooses anchored or transactional dialog presentation. |
|
|
72
|
+
| `messages` | `Partial<RCSelectMessages>` | Built-in text overrides; see Localization. |
|
|
73
|
+
| `dialogCancelButton` | `'visible' \| 'hidden'` | Shows or hides the leading close action. |
|
|
74
|
+
| `value` | `string \| string[]` | Controlled selection. Programmatic writes apply silently. |
|
|
75
|
+
| `openPopup()` | `void` | Opens the listbox popover. |
|
|
76
|
+
| `closePopup(returnFocus?)` | `void` | Closes the listbox and optionally restores focus. |
|
|
77
|
+
|
|
78
|
+
## Localization
|
|
79
|
+
|
|
80
|
+
Built-in text follows the element's own `lang`, else `<html lang>`, and never an
|
|
81
|
+
ancestor's `lang`, which usually marks content. Override it per element with the
|
|
82
|
+
`messages` property, or for every instance with `registerMessages()` from
|
|
83
|
+
`@rcarls/rc-common` under `rc-select`. Keys: `options`, `selectedItems`, `remove`, `summary`, `done`, `cancel`. See the
|
|
84
|
+
[rc-common Localization section](https://github.com/richardcarls/rc-webcomponents/tree/develop/packages/rc-common#localization).
|
|
55
85
|
|
|
56
86
|
## Events
|
|
57
87
|
|
|
58
|
-
| Event
|
|
59
|
-
|
|
|
88
|
+
| Event | Detail | Description |
|
|
89
|
+
| ------------------ | ------------------------------- | ----------------------------- |
|
|
60
90
|
| `rc-select-change` | `{ value: string \| string[] }` | Fires when selection changes. |
|
|
61
|
-
| `rc-select-open`
|
|
62
|
-
| `rc-select-close`
|
|
91
|
+
| `rc-select-open` | none | Fires when the popup opens. |
|
|
92
|
+
| `rc-select-close` | none | Fires when the popup closes. |
|
|
63
93
|
|
|
64
94
|
## Accessibility
|
|
65
95
|
|