@rcarls/rc-menu-button 0.0.0-next-20260921045401
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 +165 -0
- package/README.md +169 -0
- package/dist/custom-elements.json +648 -0
- package/dist/rc-menu-button-CbxrW9fi.js +524 -0
- package/dist/rc-menu-button-CbxrW9fi.js.map +1 -0
- package/dist/rc-menu-button-define.js +7 -0
- package/dist/rc-menu-button-define.js.map +1 -0
- package/dist/rc-menu-button.js +5 -0
- package/dist/rc-menu-button.js.map +1 -0
- package/dist/types/packages/rc-menu-button/src/define.d.ts +1 -0
- package/dist/types/packages/rc-menu-button/src/index.d.ts +1 -0
- package/dist/types/packages/rc-menu-button/src/rc-menu-button.d.ts +222 -0
- package/dist/types/packages/rc-menu-button/src/rc-menu-button.styles.d.ts +2 -0
- package/package.json +67 -0
|
@@ -0,0 +1,648 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/define.ts",
|
|
8
|
+
"declarations": [],
|
|
9
|
+
"exports": [
|
|
10
|
+
{
|
|
11
|
+
"kind": "custom-element-definition",
|
|
12
|
+
"name": "rc-menu-button",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "RCMenuButton",
|
|
15
|
+
"module": "/src/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "js",
|
|
20
|
+
"name": "*",
|
|
21
|
+
"declaration": {
|
|
22
|
+
"name": "*",
|
|
23
|
+
"module": "src/index.js"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"kind": "javascript-module",
|
|
30
|
+
"path": "src/index.ts",
|
|
31
|
+
"declarations": [],
|
|
32
|
+
"exports": [
|
|
33
|
+
{
|
|
34
|
+
"kind": "js",
|
|
35
|
+
"name": "*",
|
|
36
|
+
"declaration": {
|
|
37
|
+
"name": "*",
|
|
38
|
+
"module": "src/rc-menu-button.js"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"kind": "javascript-module",
|
|
45
|
+
"path": "src/rc-menu-button.ts",
|
|
46
|
+
"declarations": [
|
|
47
|
+
{
|
|
48
|
+
"kind": "class",
|
|
49
|
+
"description": "Trigger button that opens an rc-menu popup, following the WAI-ARIA Menu Button pattern.",
|
|
50
|
+
"name": "RCMenuButton",
|
|
51
|
+
"cssProperties": [
|
|
52
|
+
{
|
|
53
|
+
"description": "Minimum block size of the trigger",
|
|
54
|
+
"name": "--rc-menu-button-trigger-block-size",
|
|
55
|
+
"default": "var(--rc-control-block-size)"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"description": "Trigger block-axis padding",
|
|
59
|
+
"name": "--rc-menu-button-trigger-padding-block",
|
|
60
|
+
"default": "var(--rc-control-padding-block)"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"description": "Trigger inline-axis padding",
|
|
64
|
+
"name": "--rc-menu-button-trigger-padding-inline",
|
|
65
|
+
"default": "var(--rc-control-padding-inline)"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"description": "Gap between flex children in the trigger",
|
|
69
|
+
"name": "--rc-menu-button-trigger-gap",
|
|
70
|
+
"default": "var(--rc-item-gap)"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"description": "Trigger border",
|
|
74
|
+
"name": "--rc-menu-button-trigger-border",
|
|
75
|
+
"default": "var(--rc-border)"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"description": "Trigger border radius",
|
|
79
|
+
"name": "--rc-menu-button-trigger-radius",
|
|
80
|
+
"default": "var(--rc-control-radius)"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"description": "Trigger background",
|
|
84
|
+
"name": "--rc-menu-button-trigger-background",
|
|
85
|
+
"default": "var(--rc-button-bg)"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"description": "Trigger text color",
|
|
89
|
+
"name": "--rc-menu-button-trigger-color",
|
|
90
|
+
"default": "var(--rc-button-text)"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"description": "CSS transition applied to the trigger",
|
|
94
|
+
"name": "--rc-menu-button-trigger-transition"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"description": "Trigger hover background",
|
|
98
|
+
"name": "--rc-menu-button-trigger-hover-background",
|
|
99
|
+
"default": "color-mix(in srgb, Highlight 8%, transparent)"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"description": "Trigger hover text color",
|
|
103
|
+
"name": "--rc-menu-button-trigger-hover-color",
|
|
104
|
+
"default": "inherit"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"description": "Trigger hover border color",
|
|
108
|
+
"name": "--rc-menu-button-trigger-hover-border-color",
|
|
109
|
+
"default": "currentColor"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"description": "Trigger background when the menu is open",
|
|
113
|
+
"name": "--rc-menu-button-trigger-open-background",
|
|
114
|
+
"default": "color-mix(in srgb, Highlight 12%, transparent)"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"description": "Trigger text color when the menu is open",
|
|
118
|
+
"name": "--rc-menu-button-trigger-open-color",
|
|
119
|
+
"default": "inherit"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"description": "Trigger border color when the menu is open",
|
|
123
|
+
"name": "--rc-menu-button-trigger-open-border-color",
|
|
124
|
+
"default": "currentColor"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"description": "Inline and block size of the slotted indicator",
|
|
128
|
+
"name": "--rc-menu-button-indicator-size",
|
|
129
|
+
"default": "1em"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"description": "Color of the slotted indicator",
|
|
133
|
+
"name": "--rc-menu-button-indicator-color",
|
|
134
|
+
"default": "currentColor"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"description": "Indicator distance from the trigger's inline end",
|
|
138
|
+
"name": "--rc-menu-button-indicator-inset",
|
|
139
|
+
"default": "var(--rc-menu-button-trigger-padding-inline)"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"description": "Inline size of an `icon-only` trigger's visible box. Square by default (equal to `--rc-menu-button-trigger-block-size`); set narrower or wider to change only the trigger's width, independent of its height.",
|
|
143
|
+
"name": "--rc-menu-button-icon-size"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"description": "Minimum accessible touch target block size for an `icon-only` trigger. A floor, not a fixed size: has no effect once `--rc-menu-button-trigger-block-size` already meets or exceeds it. Grows the shadow-DOM trigger wrapper (reserving layout space) and the light-DOM hit-slop (the actual larger clickable region) together; the visible trigger itself stays at its own size, centered.",
|
|
147
|
+
"name": "--rc-menu-button-touch-target-block-size",
|
|
148
|
+
"default": "3rem"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"description": "Minimum accessible touch target inline size for an `icon-only` trigger. Defers to `--rc-menu-button-touch-target-block-size` when unset.",
|
|
152
|
+
"name": "--rc-menu-button-touch-target-inline-size"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"description": "Zero by default. A theme or consumer sets this on an `icon-only` trigger that sits at a real leading edge (no neighbor on that side) to let its touch-target inflation overlap into whatever sits just outside the host, such as a container's own edge padding, instead of also reserving layout space there.",
|
|
156
|
+
"name": "--rc-menu-button-touch-target-overlap-inline-start",
|
|
157
|
+
"default": "0px"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"description": "The trailing-edge counterpart to `--rc-menu-button-touch-target-overlap-inline-start`.",
|
|
161
|
+
"name": "--rc-menu-button-touch-target-overlap-inline-end",
|
|
162
|
+
"default": "0px"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"description": "Popup open/close fade transition duration.",
|
|
166
|
+
"name": "--rc-menu-button-popup-duration",
|
|
167
|
+
"default": "150ms"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"cssParts": [
|
|
171
|
+
{
|
|
172
|
+
"description": "The root container element",
|
|
173
|
+
"name": "root"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"description": "The popup container element",
|
|
177
|
+
"name": "popup"
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
"slots": [
|
|
181
|
+
{
|
|
182
|
+
"description": "The button element that triggers the menu",
|
|
183
|
+
"name": "trigger"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"description": "Optional decorative indicator rendered at the trigger's inline end",
|
|
187
|
+
"name": "indicator"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"description": "The rc-menu element to display as popup",
|
|
191
|
+
"name": "default"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"members": [
|
|
195
|
+
{
|
|
196
|
+
"kind": "field",
|
|
197
|
+
"name": "shadowRootOptions",
|
|
198
|
+
"type": {
|
|
199
|
+
"text": "ShadowRootInit"
|
|
200
|
+
},
|
|
201
|
+
"static": true,
|
|
202
|
+
"default": "{ ...LitElement.shadowRootOptions, delegatesFocus: true, }",
|
|
203
|
+
"description": "Enables delegatesFocus so the browser routes focus() on the host element\nto the slotted trigger button."
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"kind": "field",
|
|
207
|
+
"name": "_styledRoots",
|
|
208
|
+
"privacy": "protected",
|
|
209
|
+
"static": true,
|
|
210
|
+
"readonly": true,
|
|
211
|
+
"default": "new Set<Document | ShadowRoot>()"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"kind": "method",
|
|
215
|
+
"name": "_ensureBaseStyles",
|
|
216
|
+
"privacy": "protected",
|
|
217
|
+
"static": true,
|
|
218
|
+
"return": {
|
|
219
|
+
"type": {
|
|
220
|
+
"text": "void"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"parameters": [
|
|
224
|
+
{
|
|
225
|
+
"name": "root",
|
|
226
|
+
"type": {
|
|
227
|
+
"text": "Document | ShadowRoot"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"kind": "field",
|
|
234
|
+
"name": "_defaultOpen",
|
|
235
|
+
"type": {
|
|
236
|
+
"text": "boolean"
|
|
237
|
+
},
|
|
238
|
+
"privacy": "private",
|
|
239
|
+
"default": "false"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"kind": "field",
|
|
243
|
+
"name": "_open",
|
|
244
|
+
"type": {
|
|
245
|
+
"text": "boolean | undefined"
|
|
246
|
+
},
|
|
247
|
+
"privacy": "private"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"kind": "field",
|
|
251
|
+
"name": "_uncontrolledOpen",
|
|
252
|
+
"type": {
|
|
253
|
+
"text": "boolean | undefined"
|
|
254
|
+
},
|
|
255
|
+
"privacy": "private"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"kind": "field",
|
|
259
|
+
"name": "_openInitialized",
|
|
260
|
+
"type": {
|
|
261
|
+
"text": "boolean"
|
|
262
|
+
},
|
|
263
|
+
"privacy": "private",
|
|
264
|
+
"default": "false"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"kind": "field",
|
|
268
|
+
"name": "open",
|
|
269
|
+
"type": {
|
|
270
|
+
"text": "boolean"
|
|
271
|
+
},
|
|
272
|
+
"description": "Applies open state in controlled mode without dispatching an event.",
|
|
273
|
+
"attribute": "open",
|
|
274
|
+
"reflects": true
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"kind": "field",
|
|
278
|
+
"name": "defaultOpen",
|
|
279
|
+
"type": {
|
|
280
|
+
"text": "boolean"
|
|
281
|
+
},
|
|
282
|
+
"description": "Applies the uncontrolled default before any controlled write occurs.",
|
|
283
|
+
"attribute": "default-open"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"kind": "field",
|
|
287
|
+
"name": "orientation",
|
|
288
|
+
"type": {
|
|
289
|
+
"text": "'horizontal' | 'vertical' | undefined"
|
|
290
|
+
},
|
|
291
|
+
"description": "Orientation of this menu button, affects which arrow keys open/close the menu.\n\nIf not set, inherits from a parent rc-menubar or element with role=\"menubar\".",
|
|
292
|
+
"attribute": "orientation",
|
|
293
|
+
"reflects": true
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"kind": "field",
|
|
297
|
+
"name": "placement",
|
|
298
|
+
"type": {
|
|
299
|
+
"text": "AnchorPlacement"
|
|
300
|
+
},
|
|
301
|
+
"default": "'bottom-start'",
|
|
302
|
+
"description": "Preferred placement of the popup relative to the trigger button.",
|
|
303
|
+
"attribute": "placement",
|
|
304
|
+
"reflects": true
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"kind": "field",
|
|
308
|
+
"name": "_effectivePlacement",
|
|
309
|
+
"type": {
|
|
310
|
+
"text": "AnchorPlacement"
|
|
311
|
+
},
|
|
312
|
+
"privacy": "protected",
|
|
313
|
+
"description": "Popup placement adjusted for orientation.\n\nSwitches from `bottom-start` to `right-start` when the resolved orientation\nis `vertical`, so vertical menubars open submenus to the side.",
|
|
314
|
+
"readonly": true
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"kind": "field",
|
|
318
|
+
"name": "_resolvedOrientation",
|
|
319
|
+
"type": {
|
|
320
|
+
"text": "'horizontal' | 'vertical'"
|
|
321
|
+
},
|
|
322
|
+
"privacy": "protected",
|
|
323
|
+
"description": "Resolved orientation, considering inheritance from parent menubar.\nFalls back to 'horizontal' if no orientation is set or inherited.",
|
|
324
|
+
"readonly": true
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"kind": "field",
|
|
328
|
+
"name": "_$root",
|
|
329
|
+
"type": {
|
|
330
|
+
"text": "HTMLElement"
|
|
331
|
+
},
|
|
332
|
+
"privacy": "protected",
|
|
333
|
+
"description": "Shadow DOM root container. Serves as the anchor element for `_anchorCtrl`."
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"kind": "field",
|
|
337
|
+
"name": "_$popup",
|
|
338
|
+
"type": {
|
|
339
|
+
"text": "HTMLElement"
|
|
340
|
+
},
|
|
341
|
+
"privacy": "protected",
|
|
342
|
+
"description": "Shadow DOM popup container. Hidden when `open` is `false`."
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"kind": "field",
|
|
346
|
+
"name": "_$trigger",
|
|
347
|
+
"type": {
|
|
348
|
+
"text": "WeakRef<HTMLElement> | undefined"
|
|
349
|
+
},
|
|
350
|
+
"privacy": "protected",
|
|
351
|
+
"description": "Weak reference to the slotted trigger button."
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"kind": "field",
|
|
355
|
+
"name": "_$menu",
|
|
356
|
+
"type": {
|
|
357
|
+
"text": "WeakRef<RCMenu> | undefined"
|
|
358
|
+
},
|
|
359
|
+
"privacy": "protected",
|
|
360
|
+
"description": "Weak reference to the slotted `rc-menu` element."
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"kind": "field",
|
|
364
|
+
"name": "_anchorCtrl",
|
|
365
|
+
"privacy": "protected",
|
|
366
|
+
"default": "new AnchorController(this, { anchor: () => this._$root ?? null, floating: () => this._$popup ?? null, shadowHost: () => this, placement: 'bottom-start', offset: 2, })",
|
|
367
|
+
"description": "Positions the popup relative to the trigger using CSS anchor positioning."
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"kind": "field",
|
|
371
|
+
"name": "_boundHandleDocumentClick",
|
|
372
|
+
"privacy": "protected",
|
|
373
|
+
"description": "Bound handler for document click (light dismiss). Stored for `removeEventListener` pairing."
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"kind": "field",
|
|
377
|
+
"name": "_tabObserver",
|
|
378
|
+
"type": {
|
|
379
|
+
"text": "MutationObserver | undefined"
|
|
380
|
+
},
|
|
381
|
+
"privacy": "protected",
|
|
382
|
+
"description": "Watches the host's own `tabindex` attribute so the trigger button's\ntabindex can be kept in sync.\n\nWhen a parent (e.g. rc-toolbar) places the\nhost under roving-tabindex management it sets/removes tabindex on the\nhost; we mirror that to the trigger so it doesn't become an independent\ntab stop. When the host has no tabindex the trigger keeps its natural\ntabindex=0 for standalone usage."
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"kind": "method",
|
|
386
|
+
"name": "openMenu",
|
|
387
|
+
"parameters": [
|
|
388
|
+
{
|
|
389
|
+
"name": "focusTarget",
|
|
390
|
+
"default": "'first'",
|
|
391
|
+
"type": {
|
|
392
|
+
"text": "'first' | 'last'"
|
|
393
|
+
},
|
|
394
|
+
"description": "which item receives initial focus when the menu opens"
|
|
395
|
+
}
|
|
396
|
+
],
|
|
397
|
+
"description": "Opens the menu and moves focus into it."
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"kind": "method",
|
|
401
|
+
"name": "closeMenu",
|
|
402
|
+
"parameters": [
|
|
403
|
+
{
|
|
404
|
+
"name": "returnFocus",
|
|
405
|
+
"default": "true",
|
|
406
|
+
"description": "when `true`, returns focus to the trigger button after closing"
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
"description": "Closes the menu."
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"kind": "method",
|
|
413
|
+
"name": "toggleMenu",
|
|
414
|
+
"description": "Toggles the menu between open and closed."
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"kind": "method",
|
|
418
|
+
"name": "_dispatchToggle",
|
|
419
|
+
"privacy": "protected",
|
|
420
|
+
"parameters": [
|
|
421
|
+
{
|
|
422
|
+
"name": "open",
|
|
423
|
+
"default": "this.open"
|
|
424
|
+
}
|
|
425
|
+
],
|
|
426
|
+
"description": "Dispatches the `rc-menu-button-toggle` bubbling composed event with the requested open state."
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"kind": "method",
|
|
430
|
+
"name": "_handleTriggerSlotChange",
|
|
431
|
+
"privacy": "protected",
|
|
432
|
+
"parameters": [
|
|
433
|
+
{
|
|
434
|
+
"name": "e",
|
|
435
|
+
"type": {
|
|
436
|
+
"text": "Event"
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
],
|
|
440
|
+
"description": "Caches a weak reference to the first assigned trigger element and syncs its ARIA and tabindex state."
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"kind": "method",
|
|
444
|
+
"name": "_handleIndicatorSlotChange",
|
|
445
|
+
"privacy": "protected",
|
|
446
|
+
"parameters": [
|
|
447
|
+
{
|
|
448
|
+
"name": "e",
|
|
449
|
+
"type": {
|
|
450
|
+
"text": "Event"
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
],
|
|
454
|
+
"description": "Tracks optional indicator content so the trigger reserves its inline-end space."
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"kind": "method",
|
|
458
|
+
"name": "_syncTriggerTabindex",
|
|
459
|
+
"privacy": "protected",
|
|
460
|
+
"description": "Mirrors the host's `tabindex` attribute to the trigger button.\n\nWhen a roving-tabindex parent (e.g. rc-toolbar) marks this host inactive\nwith `tabindex=\"-1\"`, the trigger must also be suppressed so it does not\nbecome an independent tab stop. When the host is the active item\n(`tabindex=\"0\"`) or standalone (no tabindex), the trigger retains its\nnatural focusability so that Chrome's delegatesFocus can route sequential\nTab navigation through the host to the trigger."
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"kind": "method",
|
|
464
|
+
"name": "focus",
|
|
465
|
+
"parameters": [
|
|
466
|
+
{
|
|
467
|
+
"name": "options",
|
|
468
|
+
"optional": true,
|
|
469
|
+
"type": {
|
|
470
|
+
"text": "FocusOptions"
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
],
|
|
474
|
+
"description": "Overrides the default focus() so that programmatic focus calls (e.g. from\na roving-tabindex parent navigating back to this element via arrow keys)\nalways reach the trigger.\n\nChrome's delegatesFocus will not delegate to a tabindex=\"-1\" element, so\nwhen the toolbar marks this host inactive it suppresses the trigger — and\nthe next focusItem() call silently fails. Lifting the suppression here and\ndirectly calling trigger.focus() bypasses that restriction."
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"kind": "method",
|
|
478
|
+
"name": "_handleMenuSlotChange",
|
|
479
|
+
"privacy": "protected",
|
|
480
|
+
"parameters": [
|
|
481
|
+
{
|
|
482
|
+
"name": "e",
|
|
483
|
+
"type": {
|
|
484
|
+
"text": "Event"
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
],
|
|
488
|
+
"description": "Caches a weak reference to the first assigned `rc-menu` element."
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"kind": "field",
|
|
492
|
+
"name": "_onNavigate",
|
|
493
|
+
"privacy": "protected",
|
|
494
|
+
"description": "Keyboard navigation handler.\n\nOpens or closes the menu in response to arrow/Enter/Escape keys."
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"kind": "method",
|
|
498
|
+
"name": "_handleTriggerClick",
|
|
499
|
+
"privacy": "protected",
|
|
500
|
+
"parameters": [
|
|
501
|
+
{
|
|
502
|
+
"name": "e",
|
|
503
|
+
"type": {
|
|
504
|
+
"text": "MouseEvent"
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
],
|
|
508
|
+
"description": "Prevents the default button action and delegates to `toggleMenu`."
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"kind": "method",
|
|
512
|
+
"name": "_handleMenuClose",
|
|
513
|
+
"privacy": "protected",
|
|
514
|
+
"description": "Closes the menu when an `rc-menu-close` event bubbles up from the popup."
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"kind": "method",
|
|
518
|
+
"name": "_handleMenuActivate",
|
|
519
|
+
"privacy": "protected",
|
|
520
|
+
"description": "Closes the menu when an `rc-menu-activate` event bubbles up from the popup."
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
"kind": "method",
|
|
524
|
+
"name": "_handleDocumentClick",
|
|
525
|
+
"privacy": "protected",
|
|
526
|
+
"parameters": [
|
|
527
|
+
{
|
|
528
|
+
"name": "e",
|
|
529
|
+
"type": {
|
|
530
|
+
"text": "MouseEvent"
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
],
|
|
534
|
+
"description": "Closes the menu on clicks outside this component (light dismiss)."
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"kind": "method",
|
|
538
|
+
"name": "_setOpen",
|
|
539
|
+
"privacy": "protected",
|
|
540
|
+
"return": {
|
|
541
|
+
"type": {
|
|
542
|
+
"text": "void"
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"parameters": [
|
|
546
|
+
{
|
|
547
|
+
"name": "open",
|
|
548
|
+
"type": {
|
|
549
|
+
"text": "boolean"
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"name": "dispatch",
|
|
554
|
+
"type": {
|
|
555
|
+
"text": "boolean"
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
]
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"kind": "method",
|
|
562
|
+
"name": "_syncTriggerAria",
|
|
563
|
+
"privacy": "protected",
|
|
564
|
+
"return": {
|
|
565
|
+
"type": {
|
|
566
|
+
"text": "void"
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
"description": "Writes `aria-haspopup` and `aria-expanded` to the trigger button to match the current open state."
|
|
570
|
+
}
|
|
571
|
+
],
|
|
572
|
+
"events": [
|
|
573
|
+
{
|
|
574
|
+
"name": "rc-menu-button-toggle",
|
|
575
|
+
"type": {
|
|
576
|
+
"text": "CustomEvent"
|
|
577
|
+
},
|
|
578
|
+
"description": "Fired when the menu opens or closes"
|
|
579
|
+
}
|
|
580
|
+
],
|
|
581
|
+
"attributes": [
|
|
582
|
+
{
|
|
583
|
+
"description": "Applies open state in controlled mode without dispatching an event.",
|
|
584
|
+
"name": "open",
|
|
585
|
+
"type": {
|
|
586
|
+
"text": "boolean"
|
|
587
|
+
},
|
|
588
|
+
"fieldName": "open"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"description": "Applies the uncontrolled default before any controlled write occurs.",
|
|
592
|
+
"name": "default-open",
|
|
593
|
+
"type": {
|
|
594
|
+
"text": "boolean"
|
|
595
|
+
},
|
|
596
|
+
"fieldName": "defaultOpen"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"description": "Orientation of this menu button, affects which arrow keys open/close the menu.\n\nIf not set, inherits from a parent rc-menubar or element with role=\"menubar\".",
|
|
600
|
+
"name": "orientation",
|
|
601
|
+
"type": {
|
|
602
|
+
"text": "'horizontal' | 'vertical' | undefined"
|
|
603
|
+
},
|
|
604
|
+
"fieldName": "orientation"
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
"description": "Preferred placement of the popup relative to the trigger button.",
|
|
608
|
+
"name": "placement",
|
|
609
|
+
"type": {
|
|
610
|
+
"text": "AnchorPlacement"
|
|
611
|
+
},
|
|
612
|
+
"default": "'bottom-start'",
|
|
613
|
+
"fieldName": "placement"
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
"description": "Hints that the slotted trigger has no visible label, so themes can size it and its touch target as an icon button (see `--rc-menu-button-icon-size` and `--rc-menu-button-touch-target-*` above). Purely a styling hook; RCMenuButton does not read or derive it — set it whenever the trigger is rendered icon-only.",
|
|
617
|
+
"name": "icon-only"
|
|
618
|
+
}
|
|
619
|
+
],
|
|
620
|
+
"superclass": {
|
|
621
|
+
"name": "LitElement",
|
|
622
|
+
"package": "lit"
|
|
623
|
+
},
|
|
624
|
+
"tagName": "rc-menu-button",
|
|
625
|
+
"customElement": true
|
|
626
|
+
}
|
|
627
|
+
],
|
|
628
|
+
"exports": [
|
|
629
|
+
{
|
|
630
|
+
"kind": "js",
|
|
631
|
+
"name": "RCMenuButton",
|
|
632
|
+
"declaration": {
|
|
633
|
+
"name": "RCMenuButton",
|
|
634
|
+
"module": "src/rc-menu-button.ts"
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"kind": "js",
|
|
639
|
+
"name": "default",
|
|
640
|
+
"declaration": {
|
|
641
|
+
"name": "RCMenuButton",
|
|
642
|
+
"module": "src/rc-menu-button.ts"
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
]
|
|
646
|
+
}
|
|
647
|
+
]
|
|
648
|
+
}
|