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