@react-spectrum/menu 3.11.1-nightly.3894 → 3.11.1-nightly.3901
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/dist/import.mjs +185 -325
- package/dist/main.css +1 -1
- package/dist/main.js +181 -322
- package/dist/main.js.map +1 -1
- package/dist/module.js +185 -325
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +4 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +28 -29
- package/src/Menu.tsx +35 -40
- package/src/MenuItem.tsx +18 -49
- package/src/MenuTrigger.tsx +0 -1
- package/src/context.ts +1 -26
- package/src/index.ts +2 -3
- package/src/MenuDialogTrigger.tsx +0 -87
package/dist/module.js
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import "./main.css";
|
|
2
2
|
import {Item as $5ae296f2d6923e14$re_export$Item, Section as $5ae296f2d6923e14$re_export$Section, getChildNodes as $9SHwR$getChildNodes} from "@react-stately/collections";
|
|
3
3
|
import {useDOMRef as $9SHwR$useDOMRef, useIsMobileDevice as $9SHwR$useIsMobileDevice, classNames as $9SHwR$classNames, SlotProvider as $9SHwR$SlotProvider, useStyleProps as $9SHwR$useStyleProps, ClearSlots as $9SHwR$ClearSlots, useSlotProps as $9SHwR$useSlotProps} from "@react-spectrum/utils";
|
|
4
|
-
import {Tray as $9SHwR$Tray, Popover as $9SHwR$Popover
|
|
5
|
-
import {PressResponder as $9SHwR$PressResponder} from "@react-aria/interactions";
|
|
4
|
+
import {Tray as $9SHwR$Tray, Popover as $9SHwR$Popover} from "@react-spectrum/overlays";
|
|
5
|
+
import {PressResponder as $9SHwR$PressResponder, useHover as $9SHwR$useHover} from "@react-aria/interactions";
|
|
6
6
|
import $9SHwR$react, {useRef as $9SHwR$useRef, Fragment as $9SHwR$Fragment, forwardRef as $9SHwR$forwardRef, useContext as $9SHwR$useContext} from "react";
|
|
7
7
|
import {useMenuTrigger as $9SHwR$useMenuTrigger, useMenu as $9SHwR$useMenu, useMenuItem as $9SHwR$useMenuItem, useMenuSection as $9SHwR$useMenuSection} from "@react-aria/menu";
|
|
8
8
|
import {useMenuTriggerState as $9SHwR$useMenuTriggerState} from "@react-stately/menu";
|
|
9
|
-
import {
|
|
10
|
-
import {mergeProps as $9SHwR$mergeProps, useSyncRef as $9SHwR$useSyncRef, filterDOMProps as $9SHwR$filterDOMProps, useSlotId as $9SHwR$useSlotId} from "@react-aria/utils";
|
|
9
|
+
import {mergeProps as $9SHwR$mergeProps, useSyncRef as $9SHwR$useSyncRef, filterDOMProps as $9SHwR$filterDOMProps} from "@react-aria/utils";
|
|
11
10
|
import {useTreeState as $9SHwR$useTreeState} from "@react-stately/tree";
|
|
12
11
|
import $9SHwR$spectrumiconsuiCheckmarkMedium from "@spectrum-icons/ui/CheckmarkMedium";
|
|
12
|
+
import {FocusRing as $9SHwR$FocusRing} from "@react-aria/focus";
|
|
13
13
|
import {Grid as $9SHwR$Grid} from "@react-spectrum/layout";
|
|
14
|
-
import $9SHwR$spectrumiconsworkflowInfoOutline from "@spectrum-icons/workflow/InfoOutline";
|
|
15
14
|
import {Text as $9SHwR$Text} from "@react-spectrum/text";
|
|
16
|
-
import {useLocalizedStringFormatter as $9SHwR$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
17
15
|
import {useSeparator as $9SHwR$useSeparator} from "@react-aria/separator";
|
|
18
16
|
import {ActionButton as $9SHwR$ActionButton} from "@react-spectrum/button";
|
|
19
17
|
import $9SHwR$spectrumiconsworkflowMore from "@spectrum-icons/workflow/More";
|
|
20
|
-
import {
|
|
21
|
-
import {useOverlayTriggerState as $9SHwR$useOverlayTriggerState} from "@react-stately/overlays";
|
|
18
|
+
import {useLocalizedStringFormatter as $9SHwR$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
22
19
|
|
|
23
20
|
function $parcel$interopDefault(a) {
|
|
24
21
|
return a && a.__esModule ? a.default : a;
|
|
@@ -63,14 +60,6 @@ const $d94604d52c3e3feb$export$c7e742effb1c51e2 = (0, $9SHwR$react).createContex
|
|
|
63
60
|
function $d94604d52c3e3feb$export$21c7ab35b39f78ec() {
|
|
64
61
|
return (0, $9SHwR$useContext)($d94604d52c3e3feb$export$c7e742effb1c51e2);
|
|
65
62
|
}
|
|
66
|
-
const $d94604d52c3e3feb$export$e239f1ef5b7afe1a = (0, $9SHwR$react).createContext(undefined);
|
|
67
|
-
function $d94604d52c3e3feb$export$4bbcd0ebecc48abd() {
|
|
68
|
-
return (0, $9SHwR$useContext)($d94604d52c3e3feb$export$e239f1ef5b7afe1a);
|
|
69
|
-
}
|
|
70
|
-
const $d94604d52c3e3feb$export$24aad8519b95b41b = (0, $9SHwR$react).createContext({});
|
|
71
|
-
function $d94604d52c3e3feb$export$efa3856fc0e85e7f() {
|
|
72
|
-
return (0, $9SHwR$useContext)($d94604d52c3e3feb$export$24aad8519b95b41b);
|
|
73
|
-
}
|
|
74
63
|
|
|
75
64
|
|
|
76
65
|
|
|
@@ -181,7 +170,6 @@ function $aa0b855f135b86e3$var$MenuTrigger(props, ref) {
|
|
|
181
170
|
let isMobile = (0, $9SHwR$useIsMobileDevice)();
|
|
182
171
|
let menuContext = {
|
|
183
172
|
...menuProps,
|
|
184
|
-
state: state,
|
|
185
173
|
ref: menuRef,
|
|
186
174
|
onClose: state.close,
|
|
187
175
|
closeOnSelect: closeOnSelect,
|
|
@@ -239,6 +227,91 @@ function $aa0b855f135b86e3$var$MenuTrigger(props, ref) {
|
|
|
239
227
|
* governing permissions and limitations under the License.
|
|
240
228
|
*/
|
|
241
229
|
|
|
230
|
+
/*
|
|
231
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
232
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
233
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
234
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
235
|
+
*
|
|
236
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
237
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
238
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
239
|
+
* governing permissions and limitations under the License.
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
function $48fb8f5e1202c980$export$2ce376c2cc3355c8(props) {
|
|
252
|
+
let { item: item , state: state , isVirtualized: isVirtualized , onAction: onAction } = props;
|
|
253
|
+
let { onClose: onClose , closeOnSelect: closeOnSelect } = (0, $d94604d52c3e3feb$export$21c7ab35b39f78ec)();
|
|
254
|
+
let { rendered: rendered , key: key } = item;
|
|
255
|
+
let isSelected = state.selectionManager.isSelected(key);
|
|
256
|
+
let isDisabled = state.disabledKeys.has(key);
|
|
257
|
+
let domProps = (0, $9SHwR$filterDOMProps)(item.props);
|
|
258
|
+
let ref = (0, $9SHwR$useRef)();
|
|
259
|
+
let { menuItemProps: menuItemProps , labelProps: labelProps , descriptionProps: descriptionProps , keyboardShortcutProps: keyboardShortcutProps } = (0, $9SHwR$useMenuItem)({
|
|
260
|
+
isSelected: isSelected,
|
|
261
|
+
isDisabled: isDisabled,
|
|
262
|
+
"aria-label": item["aria-label"],
|
|
263
|
+
key: key,
|
|
264
|
+
onClose: onClose,
|
|
265
|
+
closeOnSelect: closeOnSelect,
|
|
266
|
+
isVirtualized: isVirtualized,
|
|
267
|
+
onAction: onAction
|
|
268
|
+
}, state, ref);
|
|
269
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $9SHwR$useHover)({
|
|
270
|
+
isDisabled: isDisabled
|
|
271
|
+
});
|
|
272
|
+
let contents = typeof rendered === "string" ? /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$Text), null, rendered) : rendered;
|
|
273
|
+
return /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$FocusRing), {
|
|
274
|
+
focusRingClass: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "focus-ring")
|
|
275
|
+
}, /*#__PURE__*/ (0, $9SHwR$react).createElement("li", {
|
|
276
|
+
...(0, $9SHwR$mergeProps)(menuItemProps, domProps, hoverProps),
|
|
277
|
+
ref: ref,
|
|
278
|
+
className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-item", {
|
|
279
|
+
"is-disabled": isDisabled,
|
|
280
|
+
"is-selected": isSelected,
|
|
281
|
+
"is-selectable": state.selectionManager.selectionMode !== "none",
|
|
282
|
+
"is-hovered": isHovered
|
|
283
|
+
})
|
|
284
|
+
}, /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$Grid), {
|
|
285
|
+
UNSAFE_className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-itemGrid")
|
|
286
|
+
}, /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$ClearSlots), null, /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$SlotProvider), {
|
|
287
|
+
slots: {
|
|
288
|
+
text: {
|
|
289
|
+
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports)))["spectrum-Menu-itemLabel"],
|
|
290
|
+
...labelProps
|
|
291
|
+
},
|
|
292
|
+
end: {
|
|
293
|
+
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports)))["spectrum-Menu-end"],
|
|
294
|
+
...descriptionProps
|
|
295
|
+
},
|
|
296
|
+
icon: {
|
|
297
|
+
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports)))["spectrum-Menu-icon"],
|
|
298
|
+
size: "S"
|
|
299
|
+
},
|
|
300
|
+
description: {
|
|
301
|
+
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports)))["spectrum-Menu-description"],
|
|
302
|
+
...descriptionProps
|
|
303
|
+
},
|
|
304
|
+
keyboard: {
|
|
305
|
+
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports)))["spectrum-Menu-keyboard"],
|
|
306
|
+
...keyboardShortcutProps
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}, contents, isSelected && /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$spectrumiconsuiCheckmarkMedium), {
|
|
310
|
+
slot: "checkmark",
|
|
311
|
+
UNSAFE_className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-checkmark")
|
|
312
|
+
}))))));
|
|
313
|
+
}
|
|
314
|
+
|
|
242
315
|
|
|
243
316
|
/*
|
|
244
317
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -256,11 +329,102 @@ function $aa0b855f135b86e3$var$MenuTrigger(props, ref) {
|
|
|
256
329
|
|
|
257
330
|
|
|
258
331
|
|
|
332
|
+
|
|
333
|
+
function $b966e606890cc5ca$export$4b1545b4f2016d26(props) {
|
|
334
|
+
let { item: item , state: state , onAction: onAction } = props;
|
|
335
|
+
let { itemProps: itemProps , headingProps: headingProps , groupProps: groupProps } = (0, $9SHwR$useMenuSection)({
|
|
336
|
+
heading: item.rendered,
|
|
337
|
+
"aria-label": item["aria-label"]
|
|
338
|
+
});
|
|
339
|
+
let { separatorProps: separatorProps } = (0, $9SHwR$useSeparator)({
|
|
340
|
+
elementType: "li"
|
|
341
|
+
});
|
|
342
|
+
return /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$Fragment), null, item.key !== state.collection.getFirstKey() && /*#__PURE__*/ (0, $9SHwR$react).createElement("li", {
|
|
343
|
+
...separatorProps,
|
|
344
|
+
className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-divider")
|
|
345
|
+
}), /*#__PURE__*/ (0, $9SHwR$react).createElement("li", itemProps, item.rendered && /*#__PURE__*/ (0, $9SHwR$react).createElement("span", {
|
|
346
|
+
...headingProps,
|
|
347
|
+
className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-sectionHeading")
|
|
348
|
+
}, item.rendered), /*#__PURE__*/ (0, $9SHwR$react).createElement("ul", {
|
|
349
|
+
...groupProps,
|
|
350
|
+
className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu")
|
|
351
|
+
}, [
|
|
352
|
+
...(0, $9SHwR$getChildNodes)(item, state.collection)
|
|
353
|
+
].map((node)=>{
|
|
354
|
+
let item = /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $48fb8f5e1202c980$export$2ce376c2cc3355c8), {
|
|
355
|
+
key: node.key,
|
|
356
|
+
item: node,
|
|
357
|
+
state: state,
|
|
358
|
+
onAction: onAction
|
|
359
|
+
});
|
|
360
|
+
if (node.wrapper) item = node.wrapper(item);
|
|
361
|
+
return item;
|
|
362
|
+
}))));
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
function $49b26f4b606348f6$var$Menu(props, ref) {
|
|
372
|
+
let contextProps = (0, $9SHwR$useContext)((0, $d94604d52c3e3feb$export$c7e742effb1c51e2));
|
|
373
|
+
let completeProps = {
|
|
374
|
+
...(0, $9SHwR$mergeProps)(contextProps, props)
|
|
375
|
+
};
|
|
376
|
+
let domRef = (0, $9SHwR$useDOMRef)(ref);
|
|
377
|
+
let state = (0, $9SHwR$useTreeState)(completeProps);
|
|
378
|
+
let { menuProps: menuProps } = (0, $9SHwR$useMenu)(completeProps, state, domRef);
|
|
379
|
+
let { styleProps: styleProps } = (0, $9SHwR$useStyleProps)(completeProps);
|
|
380
|
+
(0, $9SHwR$useSyncRef)(contextProps, domRef);
|
|
381
|
+
return /*#__PURE__*/ (0, $9SHwR$react).createElement("ul", {
|
|
382
|
+
...menuProps,
|
|
383
|
+
...styleProps,
|
|
384
|
+
ref: domRef,
|
|
385
|
+
className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu", styleProps.className)
|
|
386
|
+
}, [
|
|
387
|
+
...state.collection
|
|
388
|
+
].map((item)=>{
|
|
389
|
+
if (item.type === "section") return /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $b966e606890cc5ca$export$4b1545b4f2016d26), {
|
|
390
|
+
key: item.key,
|
|
391
|
+
item: item,
|
|
392
|
+
state: state,
|
|
393
|
+
onAction: completeProps.onAction
|
|
394
|
+
});
|
|
395
|
+
let menuItem = /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $48fb8f5e1202c980$export$2ce376c2cc3355c8), {
|
|
396
|
+
key: item.key,
|
|
397
|
+
item: item,
|
|
398
|
+
state: state,
|
|
399
|
+
onAction: completeProps.onAction
|
|
400
|
+
});
|
|
401
|
+
if (item.wrapper) menuItem = item.wrapper(menuItem);
|
|
402
|
+
return menuItem;
|
|
403
|
+
}));
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Menus display a list of actions or options that a user can choose.
|
|
407
|
+
*/ // forwardRef doesn't support generic parameters, so cast the result to the correct type
|
|
408
|
+
// https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref
|
|
409
|
+
const $49b26f4b606348f6$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $9SHwR$react).forwardRef($49b26f4b606348f6$var$Menu);
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
/*
|
|
413
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
414
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
415
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
416
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
417
|
+
*
|
|
418
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
419
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
420
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
421
|
+
* governing permissions and limitations under the License.
|
|
422
|
+
*/
|
|
423
|
+
|
|
259
424
|
var $d01b612f05eb8a1a$exports = {};
|
|
260
425
|
var $9c47fa309a7d4d43$exports = {};
|
|
261
426
|
$9c47fa309a7d4d43$exports = {
|
|
262
|
-
"moreActions": `المزيد من
|
|
263
|
-
"unavailable": `Unavailable`
|
|
427
|
+
"moreActions": `المزيد من الإجراءات`
|
|
264
428
|
};
|
|
265
429
|
|
|
266
430
|
|
|
@@ -296,8 +460,7 @@ $055104befa589c0a$exports = {
|
|
|
296
460
|
|
|
297
461
|
var $de5da9cdd5bee12a$exports = {};
|
|
298
462
|
$de5da9cdd5bee12a$exports = {
|
|
299
|
-
"moreActions": `More actions
|
|
300
|
-
"unavailable": `Unavailable`
|
|
463
|
+
"moreActions": `More actions`
|
|
301
464
|
};
|
|
302
465
|
|
|
303
466
|
|
|
@@ -507,208 +670,6 @@ $d01b612f05eb8a1a$exports = {
|
|
|
507
670
|
|
|
508
671
|
|
|
509
672
|
|
|
510
|
-
function $48fb8f5e1202c980$export$2ce376c2cc3355c8(props) {
|
|
511
|
-
let { item: item , state: state , isVirtualized: isVirtualized , onAction: onAction } = props;
|
|
512
|
-
let stringFormatter = (0, $9SHwR$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($d01b612f05eb8a1a$exports))));
|
|
513
|
-
let menuDialogContext = (0, $d94604d52c3e3feb$export$4bbcd0ebecc48abd)();
|
|
514
|
-
let { triggerRef: triggerRef } = menuDialogContext || {};
|
|
515
|
-
let isMenuDialogTrigger = !!menuDialogContext;
|
|
516
|
-
let isUnavailable = false;
|
|
517
|
-
if (isMenuDialogTrigger) isUnavailable = menuDialogContext.isUnavailable;
|
|
518
|
-
let domProps = (0, $9SHwR$filterDOMProps)(item.props);
|
|
519
|
-
let { onClose: onClose , closeOnSelect: closeOnSelect } = (0, $d94604d52c3e3feb$export$21c7ab35b39f78ec)();
|
|
520
|
-
let { rendered: rendered , key: key } = item;
|
|
521
|
-
let isSelected = state.selectionManager.isSelected(key);
|
|
522
|
-
let isDisabled = state.disabledKeys.has(key);
|
|
523
|
-
let ref = (0, $9SHwR$useRef)(null);
|
|
524
|
-
if (triggerRef) ref = triggerRef;
|
|
525
|
-
let { menuItemProps: menuItemProps , labelProps: labelProps , descriptionProps: descriptionProps , keyboardShortcutProps: keyboardShortcutProps } = (0, $9SHwR$useMenuItem)({
|
|
526
|
-
isSelected: isSelected,
|
|
527
|
-
isDisabled: isDisabled,
|
|
528
|
-
"aria-label": item["aria-label"],
|
|
529
|
-
key: key,
|
|
530
|
-
onClose: onClose,
|
|
531
|
-
closeOnSelect: closeOnSelect,
|
|
532
|
-
isVirtualized: isVirtualized,
|
|
533
|
-
onAction: onAction,
|
|
534
|
-
"aria-haspopup": isMenuDialogTrigger ? "dialog" : undefined
|
|
535
|
-
}, state, ref);
|
|
536
|
-
let endId = (0, $9SHwR$useSlotId)();
|
|
537
|
-
let endProps = {};
|
|
538
|
-
if (endId) {
|
|
539
|
-
endProps.id = endId;
|
|
540
|
-
menuItemProps["aria-describedby"] = menuItemProps["aria-describedby"] + " " + endId;
|
|
541
|
-
}
|
|
542
|
-
let contents = typeof rendered === "string" ? /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$Text), null, rendered) : rendered;
|
|
543
|
-
return /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$FocusRing), {
|
|
544
|
-
focusRingClass: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "focus-ring")
|
|
545
|
-
}, /*#__PURE__*/ (0, $9SHwR$react).createElement("li", {
|
|
546
|
-
...(0, $9SHwR$mergeProps)(menuItemProps, domProps),
|
|
547
|
-
ref: ref,
|
|
548
|
-
className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-item", {
|
|
549
|
-
"is-disabled": isDisabled,
|
|
550
|
-
"is-selected": isSelected,
|
|
551
|
-
"is-selectable": state.selectionManager.selectionMode !== "none",
|
|
552
|
-
"is-open": state.expandedKeys.has(key)
|
|
553
|
-
})
|
|
554
|
-
}, /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$Grid), {
|
|
555
|
-
UNSAFE_className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-itemGrid")
|
|
556
|
-
}, /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$ClearSlots), null, /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$SlotProvider), {
|
|
557
|
-
slots: {
|
|
558
|
-
text: {
|
|
559
|
-
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports)))["spectrum-Menu-itemLabel"],
|
|
560
|
-
...labelProps
|
|
561
|
-
},
|
|
562
|
-
end: {
|
|
563
|
-
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports)))["spectrum-Menu-end"],
|
|
564
|
-
...endProps
|
|
565
|
-
},
|
|
566
|
-
icon: {
|
|
567
|
-
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports)))["spectrum-Menu-icon"],
|
|
568
|
-
size: "S"
|
|
569
|
-
},
|
|
570
|
-
description: {
|
|
571
|
-
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports)))["spectrum-Menu-description"],
|
|
572
|
-
...descriptionProps
|
|
573
|
-
},
|
|
574
|
-
keyboard: {
|
|
575
|
-
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports)))["spectrum-Menu-keyboard"],
|
|
576
|
-
...keyboardShortcutProps
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
}, contents, isSelected && /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$spectrumiconsuiCheckmarkMedium), {
|
|
580
|
-
slot: "checkmark",
|
|
581
|
-
UNSAFE_className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-checkmark")
|
|
582
|
-
}), isUnavailable && /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$spectrumiconsworkflowInfoOutline), {
|
|
583
|
-
slot: "end",
|
|
584
|
-
size: "XS",
|
|
585
|
-
alignSelf: "center",
|
|
586
|
-
"aria-label": stringFormatter.format("unavailable")
|
|
587
|
-
}))))));
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
/*
|
|
592
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
593
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
594
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
595
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
596
|
-
*
|
|
597
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
598
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
599
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
600
|
-
* governing permissions and limitations under the License.
|
|
601
|
-
*/
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
function $b966e606890cc5ca$export$4b1545b4f2016d26(props) {
|
|
609
|
-
let { item: item , state: state , onAction: onAction } = props;
|
|
610
|
-
let { itemProps: itemProps , headingProps: headingProps , groupProps: groupProps } = (0, $9SHwR$useMenuSection)({
|
|
611
|
-
heading: item.rendered,
|
|
612
|
-
"aria-label": item["aria-label"]
|
|
613
|
-
});
|
|
614
|
-
let { separatorProps: separatorProps } = (0, $9SHwR$useSeparator)({
|
|
615
|
-
elementType: "li"
|
|
616
|
-
});
|
|
617
|
-
return /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$Fragment), null, item.key !== state.collection.getFirstKey() && /*#__PURE__*/ (0, $9SHwR$react).createElement("li", {
|
|
618
|
-
...separatorProps,
|
|
619
|
-
className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-divider")
|
|
620
|
-
}), /*#__PURE__*/ (0, $9SHwR$react).createElement("li", itemProps, item.rendered && /*#__PURE__*/ (0, $9SHwR$react).createElement("span", {
|
|
621
|
-
...headingProps,
|
|
622
|
-
className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-sectionHeading")
|
|
623
|
-
}, item.rendered), /*#__PURE__*/ (0, $9SHwR$react).createElement("ul", {
|
|
624
|
-
...groupProps,
|
|
625
|
-
className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu")
|
|
626
|
-
}, [
|
|
627
|
-
...(0, $9SHwR$getChildNodes)(item, state.collection)
|
|
628
|
-
].map((node)=>{
|
|
629
|
-
let item = /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $48fb8f5e1202c980$export$2ce376c2cc3355c8), {
|
|
630
|
-
key: node.key,
|
|
631
|
-
item: node,
|
|
632
|
-
state: state,
|
|
633
|
-
onAction: onAction
|
|
634
|
-
});
|
|
635
|
-
if (node.wrapper) item = node.wrapper(item);
|
|
636
|
-
return item;
|
|
637
|
-
}))));
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
function $49b26f4b606348f6$var$Menu(props, ref) {
|
|
647
|
-
let contextProps = (0, $9SHwR$useContext)((0, $d94604d52c3e3feb$export$c7e742effb1c51e2));
|
|
648
|
-
let completeProps = {
|
|
649
|
-
...(0, $9SHwR$mergeProps)(contextProps, props)
|
|
650
|
-
};
|
|
651
|
-
let domRef = (0, $9SHwR$useDOMRef)(ref);
|
|
652
|
-
let state = (0, $9SHwR$useTreeState)(completeProps);
|
|
653
|
-
let { menuProps: menuProps } = (0, $9SHwR$useMenu)(completeProps, state, domRef);
|
|
654
|
-
let { styleProps: styleProps } = (0, $9SHwR$useStyleProps)(completeProps);
|
|
655
|
-
(0, $9SHwR$useSyncRef)(contextProps, domRef);
|
|
656
|
-
return /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $d94604d52c3e3feb$export$24aad8519b95b41b).Provider, {
|
|
657
|
-
value: {
|
|
658
|
-
state: state
|
|
659
|
-
}
|
|
660
|
-
}, /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$FocusScope), {
|
|
661
|
-
contain: state.expandedKeys.size > 0
|
|
662
|
-
}, /*#__PURE__*/ (0, $9SHwR$react).createElement("ul", {
|
|
663
|
-
...menuProps,
|
|
664
|
-
...styleProps,
|
|
665
|
-
ref: domRef,
|
|
666
|
-
className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu", styleProps.className)
|
|
667
|
-
}, [
|
|
668
|
-
...state.collection
|
|
669
|
-
].map((item)=>{
|
|
670
|
-
if (item.type === "section") return /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $b966e606890cc5ca$export$4b1545b4f2016d26), {
|
|
671
|
-
key: item.key,
|
|
672
|
-
item: item,
|
|
673
|
-
state: state,
|
|
674
|
-
onAction: completeProps.onAction
|
|
675
|
-
});
|
|
676
|
-
let menuItem = /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $48fb8f5e1202c980$export$2ce376c2cc3355c8), {
|
|
677
|
-
key: item.key,
|
|
678
|
-
item: item,
|
|
679
|
-
state: state,
|
|
680
|
-
onAction: completeProps.onAction
|
|
681
|
-
});
|
|
682
|
-
if (item.wrapper) menuItem = item.wrapper(menuItem);
|
|
683
|
-
return menuItem;
|
|
684
|
-
}))));
|
|
685
|
-
}
|
|
686
|
-
/**
|
|
687
|
-
* Menus display a list of actions or options that a user can choose.
|
|
688
|
-
*/ // forwardRef doesn't support generic parameters, so cast the result to the correct type
|
|
689
|
-
// https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref
|
|
690
|
-
const $49b26f4b606348f6$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $9SHwR$react).forwardRef($49b26f4b606348f6$var$Menu);
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
/*
|
|
694
|
-
* Copyright 2021 Adobe. All rights reserved.
|
|
695
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
696
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
697
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
698
|
-
*
|
|
699
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
700
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
701
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
702
|
-
* governing permissions and limitations under the License.
|
|
703
|
-
*/
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
673
|
function $43fa9949e6af393d$var$ActionMenu(props, ref) {
|
|
713
674
|
props = (0, $9SHwR$useSlotProps)(props, "actionMenu");
|
|
714
675
|
let stringFormatter = (0, $9SHwR$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($d01b612f05eb8a1a$exports))));
|
|
@@ -739,109 +700,8 @@ function $43fa9949e6af393d$var$ActionMenu(props, ref) {
|
|
|
739
700
|
*/ const $43fa9949e6af393d$export$ed57a210b9d13bb6 = /*#__PURE__*/ (0, $9SHwR$forwardRef)($43fa9949e6af393d$var$ActionMenu);
|
|
740
701
|
|
|
741
702
|
|
|
742
|
-
/*
|
|
743
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
744
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
745
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
746
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
747
|
-
*
|
|
748
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
749
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
750
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
751
|
-
* governing permissions and limitations under the License.
|
|
752
|
-
*/
|
|
753
|
-
|
|
754
|
-
var $c487b1d738ebeac2$exports = {};
|
|
755
|
-
|
|
756
|
-
$parcel$export($c487b1d738ebeac2$exports, "react-spectrum-ContextualHelp-button", () => $c487b1d738ebeac2$export$20d9583c9f1529c1, (v) => $c487b1d738ebeac2$export$20d9583c9f1529c1 = v);
|
|
757
|
-
$parcel$export($c487b1d738ebeac2$exports, "react-spectrum-ContextualHelp-dialog", () => $c487b1d738ebeac2$export$ab2d873674d20d28, (v) => $c487b1d738ebeac2$export$ab2d873674d20d28 = v);
|
|
758
|
-
$parcel$export($c487b1d738ebeac2$exports, "react-spectrum-ContextualHelp-content", () => $c487b1d738ebeac2$export$a1f805890cf58c4, (v) => $c487b1d738ebeac2$export$a1f805890cf58c4 = v);
|
|
759
|
-
$parcel$export($c487b1d738ebeac2$exports, "react-spectrum-ContextualHelp-footer", () => $c487b1d738ebeac2$export$d901bc3fa82b87a6, (v) => $c487b1d738ebeac2$export$d901bc3fa82b87a6 = v);
|
|
760
|
-
var $c487b1d738ebeac2$export$20d9583c9f1529c1;
|
|
761
|
-
var $c487b1d738ebeac2$export$ab2d873674d20d28;
|
|
762
|
-
var $c487b1d738ebeac2$export$a1f805890cf58c4;
|
|
763
|
-
var $c487b1d738ebeac2$export$d901bc3fa82b87a6;
|
|
764
|
-
$c487b1d738ebeac2$export$20d9583c9f1529c1 = "react-spectrum-ContextualHelp-button_0cd31c";
|
|
765
|
-
$c487b1d738ebeac2$export$ab2d873674d20d28 = "react-spectrum-ContextualHelp-dialog_0cd31c";
|
|
766
|
-
$c487b1d738ebeac2$export$a1f805890cf58c4 = "react-spectrum-ContextualHelp-content_0cd31c";
|
|
767
|
-
$c487b1d738ebeac2$export$d901bc3fa82b87a6 = "react-spectrum-ContextualHelp-footer_0cd31c";
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
function $81987f5f2bef0e97$var$MenuDialogTrigger(props) {
|
|
775
|
-
let { isUnavailable: isUnavailable } = props;
|
|
776
|
-
let { state: menuState } = (0, $d94604d52c3e3feb$export$efa3856fc0e85e7f)();
|
|
777
|
-
let state = (0, $9SHwR$useOverlayTriggerState)({
|
|
778
|
-
isOpen: menuState.expandedKeys.has(props.targetKey),
|
|
779
|
-
onOpenChange: (val)=>{
|
|
780
|
-
if (!val) {
|
|
781
|
-
if (menuState.expandedKeys.has(props.targetKey)) menuState.toggleKey(props.targetKey);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
});
|
|
785
|
-
let slots = {};
|
|
786
|
-
if (isUnavailable) slots = {
|
|
787
|
-
dialog: {
|
|
788
|
-
UNSAFE_className: (0, $9SHwR$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c487b1d738ebeac2$exports))), "react-spectrum-ContextualHelp-dialog")
|
|
789
|
-
},
|
|
790
|
-
content: {
|
|
791
|
-
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($c487b1d738ebeac2$exports)))["react-spectrum-ContextualHelp-content"]
|
|
792
|
-
},
|
|
793
|
-
footer: {
|
|
794
|
-
UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($c487b1d738ebeac2$exports)))["react-spectrum-ContextualHelp-footer"]
|
|
795
|
-
}
|
|
796
|
-
};
|
|
797
|
-
let [trigger] = (0, $9SHwR$react).Children.toArray(props.children);
|
|
798
|
-
let [, content] = props.children;
|
|
799
|
-
let isMobile = (0, $9SHwR$useIsMobileDevice)();
|
|
800
|
-
let triggerRef = (0, $9SHwR$useRef)(null);
|
|
801
|
-
return /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$react).Fragment, null, /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $d94604d52c3e3feb$export$e239f1ef5b7afe1a).Provider, {
|
|
802
|
-
value: {
|
|
803
|
-
isUnavailable: isUnavailable,
|
|
804
|
-
triggerRef: triggerRef
|
|
805
|
-
}
|
|
806
|
-
}, trigger), /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$SlotProvider), {
|
|
807
|
-
slots: slots
|
|
808
|
-
}, isMobile ? /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$Modal), {
|
|
809
|
-
state: state,
|
|
810
|
-
isDismissable: true
|
|
811
|
-
}, /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$DismissButton), {
|
|
812
|
-
onDismiss: state.close
|
|
813
|
-
}), content, /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$DismissButton), {
|
|
814
|
-
onDismiss: state.close
|
|
815
|
-
})) : /*#__PURE__*/ (0, $9SHwR$react).createElement((0, $9SHwR$Popover), {
|
|
816
|
-
state: state,
|
|
817
|
-
triggerRef: triggerRef,
|
|
818
|
-
placement: "end top",
|
|
819
|
-
hideArrow: true,
|
|
820
|
-
offset: -10,
|
|
821
|
-
isNonModal: true,
|
|
822
|
-
shouldContainFocus: false
|
|
823
|
-
}, content)));
|
|
824
|
-
}
|
|
825
|
-
$81987f5f2bef0e97$var$MenuDialogTrigger.getCollectionNode = function* getCollectionNode(props) {
|
|
826
|
-
let [trigger] = (0, $9SHwR$react).Children.toArray(props.children);
|
|
827
|
-
let [, content] = props.children;
|
|
828
|
-
yield {
|
|
829
|
-
element: /*#__PURE__*/ (0, $9SHwR$react).cloneElement(trigger, {
|
|
830
|
-
...trigger.props,
|
|
831
|
-
hasChildItems: true
|
|
832
|
-
}),
|
|
833
|
-
wrapper: (element)=>/*#__PURE__*/ (0, $9SHwR$react).createElement($81987f5f2bef0e97$var$MenuDialogTrigger, {
|
|
834
|
-
key: element.key,
|
|
835
|
-
targetKey: element.key,
|
|
836
|
-
...props
|
|
837
|
-
}, element, content)
|
|
838
|
-
};
|
|
839
|
-
};
|
|
840
|
-
let $81987f5f2bef0e97$export$5e604e335994e1d1 = $81987f5f2bef0e97$var$MenuDialogTrigger;
|
|
841
|
-
|
|
842
|
-
|
|
843
703
|
|
|
844
704
|
|
|
845
705
|
|
|
846
|
-
export {$aa0b855f135b86e3$export$27d2ad3c5815583e as MenuTrigger, $49b26f4b606348f6$export$d9b273488cd8ce6f as Menu, $43fa9949e6af393d$export$ed57a210b9d13bb6 as ActionMenu, $
|
|
706
|
+
export {$aa0b855f135b86e3$export$27d2ad3c5815583e as MenuTrigger, $49b26f4b606348f6$export$d9b273488cd8ce6f as Menu, $43fa9949e6af393d$export$ed57a210b9d13bb6 as ActionMenu, $5ae296f2d6923e14$re_export$Item as Item, $5ae296f2d6923e14$re_export$Section as Section};
|
|
847
707
|
//# sourceMappingURL=module.js.map
|