@react-spectrum/menu 3.18.2-nightly.4552 → 3.18.2-nightly.4558
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/ActionMenu.main.js +70 -0
- package/dist/ActionMenu.main.js.map +1 -0
- package/dist/ActionMenu.mjs +65 -0
- package/dist/ActionMenu.module.js +65 -0
- package/dist/ActionMenu.module.js.map +1 -0
- package/dist/ContextualHelpTrigger.main.js +206 -0
- package/dist/ContextualHelpTrigger.main.js.map +1 -0
- package/dist/ContextualHelpTrigger.mjs +201 -0
- package/dist/ContextualHelpTrigger.module.js +201 -0
- package/dist/ContextualHelpTrigger.module.js.map +1 -0
- package/dist/Menu.main.js +224 -0
- package/dist/Menu.main.js.map +1 -0
- package/dist/Menu.mjs +218 -0
- package/dist/Menu.module.js +218 -0
- package/dist/Menu.module.js.map +1 -0
- package/dist/MenuItem.main.js +149 -0
- package/dist/MenuItem.main.js.map +1 -0
- package/dist/MenuItem.mjs +144 -0
- package/dist/MenuItem.module.js +144 -0
- package/dist/MenuItem.module.js.map +1 -0
- package/dist/MenuSection.main.js +81 -0
- package/dist/MenuSection.main.js.map +1 -0
- package/dist/MenuSection.mjs +76 -0
- package/dist/MenuSection.module.js +76 -0
- package/dist/MenuSection.module.js.map +1 -0
- package/dist/MenuTrigger.main.js +119 -0
- package/dist/MenuTrigger.main.js.map +1 -0
- package/dist/MenuTrigger.mjs +114 -0
- package/dist/MenuTrigger.module.js +114 -0
- package/dist/MenuTrigger.module.js.map +1 -0
- package/dist/SubmenuTrigger.main.js +166 -0
- package/dist/SubmenuTrigger.main.js.map +1 -0
- package/dist/SubmenuTrigger.mjs +161 -0
- package/dist/SubmenuTrigger.module.js +161 -0
- package/dist/SubmenuTrigger.module.js.map +1 -0
- package/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/context.main.js +43 -0
- package/dist/context.main.js.map +1 -0
- package/dist/context.mjs +29 -0
- package/dist/context.module.js +29 -0
- package/dist/context.module.js.map +1 -0
- package/dist/contextualhelp_vars_css.main.js +23 -0
- package/dist/contextualhelp_vars_css.main.js.map +1 -0
- package/dist/contextualhelp_vars_css.mjs +25 -0
- package/dist/contextualhelp_vars_css.module.js +25 -0
- package/dist/contextualhelp_vars_css.module.js.map +1 -0
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/import.mjs +6 -1190
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/main.js +10 -1190
- package/dist/main.js.map +1 -1
- package/dist/menu_vars_css.main.js +177 -0
- package/dist/menu_vars_css.main.js.map +1 -0
- package/dist/menu_vars_css.mjs +179 -0
- package/dist/menu_vars_css.module.js +179 -0
- package/dist/menu_vars_css.module.js.map +1 -0
- package/dist/module.js +6 -1190
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/{main.css → vars.b6dfdac4.css} +1 -31
- package/dist/vars.b6dfdac4.css.map +1 -0
- package/dist/vars.c9740d19.css +30 -0
- package/dist/vars.c9740d19.css.map +1 -0
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +24 -24
- package/dist/main.css.map +0 -1
- package/dist/module.css +0 -593
- package/dist/module.css.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var $2f9ceea24fba5443$exports = require("./intlStrings.main.js");
|
|
2
|
+
var $63a7dff9cbe2d046$exports = require("./Menu.main.js");
|
|
3
|
+
var $e56311f7204399c7$exports = require("./MenuTrigger.main.js");
|
|
4
|
+
var $5FAEG$reactspectrumbutton = require("@react-spectrum/button");
|
|
5
|
+
var $5FAEG$reactariautils = require("@react-aria/utils");
|
|
6
|
+
var $5FAEG$spectrumiconsworkflowMore = require("@spectrum-icons/workflow/More");
|
|
7
|
+
var $5FAEG$react = require("react");
|
|
8
|
+
var $5FAEG$reactariai18n = require("@react-aria/i18n");
|
|
9
|
+
var $5FAEG$reactspectrumutils = require("@react-spectrum/utils");
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function $parcel$export(e, n, v, s) {
|
|
17
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
$parcel$export(module.exports, "ActionMenu", () => $53a2f2636c97a561$export$ed57a210b9d13bb6);
|
|
21
|
+
/*
|
|
22
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
23
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
24
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
25
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
28
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
29
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
30
|
+
* governing permissions and limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
function $53a2f2636c97a561$var$ActionMenu(props, ref) {
|
|
41
|
+
props = (0, $5FAEG$reactspectrumutils.useSlotProps)(props, "actionMenu");
|
|
42
|
+
let stringFormatter = (0, $5FAEG$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($2f9ceea24fba5443$exports))), "@react-spectrum/menu");
|
|
43
|
+
let buttonProps = (0, $5FAEG$reactariautils.filterDOMProps)(props, {
|
|
44
|
+
labelable: true
|
|
45
|
+
});
|
|
46
|
+
if (buttonProps["aria-label"] === undefined) buttonProps["aria-label"] = stringFormatter.format("moreActions");
|
|
47
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($5FAEG$react))).createElement((0, $e56311f7204399c7$exports.MenuTrigger), {
|
|
48
|
+
isOpen: props.isOpen,
|
|
49
|
+
defaultOpen: props.defaultOpen,
|
|
50
|
+
onOpenChange: props.onOpenChange,
|
|
51
|
+
align: props.align,
|
|
52
|
+
direction: props.direction,
|
|
53
|
+
shouldFlip: props.shouldFlip
|
|
54
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5FAEG$react))).createElement((0, $5FAEG$reactspectrumbutton.ActionButton), {
|
|
55
|
+
ref: ref,
|
|
56
|
+
...props,
|
|
57
|
+
...buttonProps
|
|
58
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5FAEG$react))).createElement((0, ($parcel$interopDefault($5FAEG$spectrumiconsworkflowMore))), null)), /*#__PURE__*/ (0, ($parcel$interopDefault($5FAEG$react))).createElement((0, $63a7dff9cbe2d046$exports.Menu), {
|
|
59
|
+
children: props.children,
|
|
60
|
+
items: props.items,
|
|
61
|
+
disabledKeys: props.disabledKeys,
|
|
62
|
+
onAction: props.onAction
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* ActionMenu combines an ActionButton with a Menu for simple "more actions" use cases.
|
|
67
|
+
*/ const $53a2f2636c97a561$export$ed57a210b9d13bb6 = /*#__PURE__*/ (0, $5FAEG$react.forwardRef)($53a2f2636c97a561$var$ActionMenu);
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=ActionMenu.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAeD,SAAS,iCAA6B,KAAiC,EAAE,GAAoC;IAC3G,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,cAAc,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACxD,IAAI,WAAW,CAAC,aAAa,KAAK,WAChC,WAAW,CAAC,aAAa,GAAG,gBAAgB,MAAM,CAAC;IAGrD,qBACE,0DAAC,CAAA,GAAA,qCAAU;QACT,QAAQ,MAAM,MAAM;QACpB,aAAa,MAAM,WAAW;QAC9B,cAAc,MAAM,YAAY;QAChC,OAAO,MAAM,KAAK;QAClB,WAAW,MAAM,SAAS;QAC1B,YAAY,MAAM,UAAU;qBAC5B,0DAAC,CAAA,GAAA,uCAAW;QACV,KAAK;QACJ,GAAG,KAAK;QACR,GAAG,WAAW;qBACf,0DAAC,CAAA,GAAA,0DAAG,yBAEN,0DAAC,CAAA,GAAA,8BAAG;QACF,UAAU,MAAM,QAAQ;QACxB,OAAO,MAAM,KAAK;QAClB,cAAc,MAAM,YAAY;QAChC,UAAU,MAAM,QAAQ;;AAGhC;AAEA;;CAEC,GACD,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/menu/src/ActionMenu.tsx"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FocusableRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Menu} from './Menu';\nimport {MenuTrigger} from './MenuTrigger';\nimport More from '@spectrum-icons/workflow/More';\nimport React, {forwardRef, ReactElement} from 'react';\nimport {SpectrumActionMenuProps} from '@react-types/menu';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSlotProps} from '@react-spectrum/utils';\n\nfunction ActionMenu<T extends object>(props: SpectrumActionMenuProps<T>, ref: FocusableRef<HTMLButtonElement>) {\n props = useSlotProps(props, 'actionMenu');\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/menu');\n let buttonProps = filterDOMProps(props, {labelable: true});\n if (buttonProps['aria-label'] === undefined) {\n buttonProps['aria-label'] = stringFormatter.format('moreActions');\n }\n\n return (\n <MenuTrigger\n isOpen={props.isOpen}\n defaultOpen={props.defaultOpen}\n onOpenChange={props.onOpenChange}\n align={props.align}\n direction={props.direction}\n shouldFlip={props.shouldFlip}>\n <ActionButton\n ref={ref}\n {...props}\n {...buttonProps}>\n <More />\n </ActionButton>\n <Menu\n children={props.children}\n items={props.items}\n disabledKeys={props.disabledKeys}\n onAction={props.onAction} />\n </MenuTrigger>\n );\n}\n\n/**\n * ActionMenu combines an ActionButton with a Menu for simple \"more actions\" use cases.\n */\nconst _ActionMenu = forwardRef(ActionMenu) as <T>(props: SpectrumActionMenuProps<T> & {ref?: FocusableRef<HTMLButtonElement>}) => ReactElement;\nexport {_ActionMenu as ActionMenu};\n"],"names":[],"version":3,"file":"ActionMenu.main.js.map"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import $4ZPCG$intlStringsmodulejs from "./intlStrings.mjs";
|
|
2
|
+
import {Menu as $49b26f4b606348f6$export$d9b273488cd8ce6f} from "./Menu.mjs";
|
|
3
|
+
import {MenuTrigger as $aa0b855f135b86e3$export$27d2ad3c5815583e} from "./MenuTrigger.mjs";
|
|
4
|
+
import {ActionButton as $4ZPCG$ActionButton} from "@react-spectrum/button";
|
|
5
|
+
import {filterDOMProps as $4ZPCG$filterDOMProps} from "@react-aria/utils";
|
|
6
|
+
import $4ZPCG$spectrumiconsworkflowMore from "@spectrum-icons/workflow/More";
|
|
7
|
+
import $4ZPCG$react, {forwardRef as $4ZPCG$forwardRef} from "react";
|
|
8
|
+
import {useLocalizedStringFormatter as $4ZPCG$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
9
|
+
import {useSlotProps as $4ZPCG$useSlotProps} from "@react-spectrum/utils";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
/*
|
|
16
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
17
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
19
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
22
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
23
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
24
|
+
* governing permissions and limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
function $43fa9949e6af393d$var$ActionMenu(props, ref) {
|
|
35
|
+
props = (0, $4ZPCG$useSlotProps)(props, "actionMenu");
|
|
36
|
+
let stringFormatter = (0, $4ZPCG$useLocalizedStringFormatter)((0, ($parcel$interopDefault($4ZPCG$intlStringsmodulejs))), "@react-spectrum/menu");
|
|
37
|
+
let buttonProps = (0, $4ZPCG$filterDOMProps)(props, {
|
|
38
|
+
labelable: true
|
|
39
|
+
});
|
|
40
|
+
if (buttonProps["aria-label"] === undefined) buttonProps["aria-label"] = stringFormatter.format("moreActions");
|
|
41
|
+
return /*#__PURE__*/ (0, $4ZPCG$react).createElement((0, $aa0b855f135b86e3$export$27d2ad3c5815583e), {
|
|
42
|
+
isOpen: props.isOpen,
|
|
43
|
+
defaultOpen: props.defaultOpen,
|
|
44
|
+
onOpenChange: props.onOpenChange,
|
|
45
|
+
align: props.align,
|
|
46
|
+
direction: props.direction,
|
|
47
|
+
shouldFlip: props.shouldFlip
|
|
48
|
+
}, /*#__PURE__*/ (0, $4ZPCG$react).createElement((0, $4ZPCG$ActionButton), {
|
|
49
|
+
ref: ref,
|
|
50
|
+
...props,
|
|
51
|
+
...buttonProps
|
|
52
|
+
}, /*#__PURE__*/ (0, $4ZPCG$react).createElement((0, $4ZPCG$spectrumiconsworkflowMore), null)), /*#__PURE__*/ (0, $4ZPCG$react).createElement((0, $49b26f4b606348f6$export$d9b273488cd8ce6f), {
|
|
53
|
+
children: props.children,
|
|
54
|
+
items: props.items,
|
|
55
|
+
disabledKeys: props.disabledKeys,
|
|
56
|
+
onAction: props.onAction
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* ActionMenu combines an ActionButton with a Menu for simple "more actions" use cases.
|
|
61
|
+
*/ const $43fa9949e6af393d$export$ed57a210b9d13bb6 = /*#__PURE__*/ (0, $4ZPCG$forwardRef)($43fa9949e6af393d$var$ActionMenu);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export {$43fa9949e6af393d$export$ed57a210b9d13bb6 as ActionMenu};
|
|
65
|
+
//# sourceMappingURL=ActionMenu.mjs.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import $4ZPCG$intlStringsmodulejs from "./intlStrings.module.js";
|
|
2
|
+
import {Menu as $49b26f4b606348f6$export$d9b273488cd8ce6f} from "./Menu.module.js";
|
|
3
|
+
import {MenuTrigger as $aa0b855f135b86e3$export$27d2ad3c5815583e} from "./MenuTrigger.module.js";
|
|
4
|
+
import {ActionButton as $4ZPCG$ActionButton} from "@react-spectrum/button";
|
|
5
|
+
import {filterDOMProps as $4ZPCG$filterDOMProps} from "@react-aria/utils";
|
|
6
|
+
import $4ZPCG$spectrumiconsworkflowMore from "@spectrum-icons/workflow/More";
|
|
7
|
+
import $4ZPCG$react, {forwardRef as $4ZPCG$forwardRef} from "react";
|
|
8
|
+
import {useLocalizedStringFormatter as $4ZPCG$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
9
|
+
import {useSlotProps as $4ZPCG$useSlotProps} from "@react-spectrum/utils";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
/*
|
|
16
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
17
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
19
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
22
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
23
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
24
|
+
* governing permissions and limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
function $43fa9949e6af393d$var$ActionMenu(props, ref) {
|
|
35
|
+
props = (0, $4ZPCG$useSlotProps)(props, "actionMenu");
|
|
36
|
+
let stringFormatter = (0, $4ZPCG$useLocalizedStringFormatter)((0, ($parcel$interopDefault($4ZPCG$intlStringsmodulejs))), "@react-spectrum/menu");
|
|
37
|
+
let buttonProps = (0, $4ZPCG$filterDOMProps)(props, {
|
|
38
|
+
labelable: true
|
|
39
|
+
});
|
|
40
|
+
if (buttonProps["aria-label"] === undefined) buttonProps["aria-label"] = stringFormatter.format("moreActions");
|
|
41
|
+
return /*#__PURE__*/ (0, $4ZPCG$react).createElement((0, $aa0b855f135b86e3$export$27d2ad3c5815583e), {
|
|
42
|
+
isOpen: props.isOpen,
|
|
43
|
+
defaultOpen: props.defaultOpen,
|
|
44
|
+
onOpenChange: props.onOpenChange,
|
|
45
|
+
align: props.align,
|
|
46
|
+
direction: props.direction,
|
|
47
|
+
shouldFlip: props.shouldFlip
|
|
48
|
+
}, /*#__PURE__*/ (0, $4ZPCG$react).createElement((0, $4ZPCG$ActionButton), {
|
|
49
|
+
ref: ref,
|
|
50
|
+
...props,
|
|
51
|
+
...buttonProps
|
|
52
|
+
}, /*#__PURE__*/ (0, $4ZPCG$react).createElement((0, $4ZPCG$spectrumiconsworkflowMore), null)), /*#__PURE__*/ (0, $4ZPCG$react).createElement((0, $49b26f4b606348f6$export$d9b273488cd8ce6f), {
|
|
53
|
+
children: props.children,
|
|
54
|
+
items: props.items,
|
|
55
|
+
disabledKeys: props.disabledKeys,
|
|
56
|
+
onAction: props.onAction
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* ActionMenu combines an ActionButton with a Menu for simple "more actions" use cases.
|
|
61
|
+
*/ const $43fa9949e6af393d$export$ed57a210b9d13bb6 = /*#__PURE__*/ (0, $4ZPCG$forwardRef)($43fa9949e6af393d$var$ActionMenu);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export {$43fa9949e6af393d$export$ed57a210b9d13bb6 as ActionMenu};
|
|
65
|
+
//# sourceMappingURL=ActionMenu.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAeD,SAAS,iCAA6B,KAAiC,EAAE,GAAoC;IAC3G,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,cAAc,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACxD,IAAI,WAAW,CAAC,aAAa,KAAK,WAChC,WAAW,CAAC,aAAa,GAAG,gBAAgB,MAAM,CAAC;IAGrD,qBACE,gCAAC,CAAA,GAAA,yCAAU;QACT,QAAQ,MAAM,MAAM;QACpB,aAAa,MAAM,WAAW;QAC9B,cAAc,MAAM,YAAY;QAChC,OAAO,MAAM,KAAK;QAClB,WAAW,MAAM,SAAS;QAC1B,YAAY,MAAM,UAAU;qBAC5B,gCAAC,CAAA,GAAA,mBAAW;QACV,KAAK;QACJ,GAAG,KAAK;QACR,GAAG,WAAW;qBACf,gCAAC,CAAA,GAAA,gCAAG,yBAEN,gCAAC,CAAA,GAAA,yCAAG;QACF,UAAU,MAAM,QAAQ;QACxB,OAAO,MAAM,KAAK;QAClB,cAAc,MAAM,YAAY;QAChC,UAAU,MAAM,QAAQ;;AAGhC;AAEA;;CAEC,GACD,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/menu/src/ActionMenu.tsx"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FocusableRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Menu} from './Menu';\nimport {MenuTrigger} from './MenuTrigger';\nimport More from '@spectrum-icons/workflow/More';\nimport React, {forwardRef, ReactElement} from 'react';\nimport {SpectrumActionMenuProps} from '@react-types/menu';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSlotProps} from '@react-spectrum/utils';\n\nfunction ActionMenu<T extends object>(props: SpectrumActionMenuProps<T>, ref: FocusableRef<HTMLButtonElement>) {\n props = useSlotProps(props, 'actionMenu');\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/menu');\n let buttonProps = filterDOMProps(props, {labelable: true});\n if (buttonProps['aria-label'] === undefined) {\n buttonProps['aria-label'] = stringFormatter.format('moreActions');\n }\n\n return (\n <MenuTrigger\n isOpen={props.isOpen}\n defaultOpen={props.defaultOpen}\n onOpenChange={props.onOpenChange}\n align={props.align}\n direction={props.direction}\n shouldFlip={props.shouldFlip}>\n <ActionButton\n ref={ref}\n {...props}\n {...buttonProps}>\n <More />\n </ActionButton>\n <Menu\n children={props.children}\n items={props.items}\n disabledKeys={props.disabledKeys}\n onAction={props.onAction} />\n </MenuTrigger>\n );\n}\n\n/**\n * ActionMenu combines an ActionButton with a Menu for simple \"more actions\" use cases.\n */\nconst _ActionMenu = forwardRef(ActionMenu) as <T>(props: SpectrumActionMenuProps<T> & {ref?: FocusableRef<HTMLButtonElement>}) => ReactElement;\nexport {_ActionMenu as ActionMenu};\n"],"names":[],"version":3,"file":"ActionMenu.module.js.map"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
require("./vars.c9740d19.css");
|
|
2
|
+
var $a10e565ec42bcf96$exports = require("./contextualhelp_vars_css.main.js");
|
|
3
|
+
require("./vars.b6dfdac4.css");
|
|
4
|
+
var $3deee0fd2b46e64f$exports = require("./menu_vars_css.main.js");
|
|
5
|
+
var $cac834c4bc0a51d3$exports = require("./context.main.js");
|
|
6
|
+
var $63a7dff9cbe2d046$exports = require("./Menu.main.js");
|
|
7
|
+
var $hdb2e$reactspectrumutils = require("@react-spectrum/utils");
|
|
8
|
+
var $hdb2e$reactariafocus = require("@react-aria/focus");
|
|
9
|
+
var $hdb2e$reactariainteractions = require("@react-aria/interactions");
|
|
10
|
+
var $hdb2e$reactspectrumoverlays = require("@react-spectrum/overlays");
|
|
11
|
+
var $hdb2e$react = require("react");
|
|
12
|
+
var $hdb2e$reactdom = require("react-dom");
|
|
13
|
+
var $hdb2e$reactariamenu = require("@react-aria/menu");
|
|
14
|
+
var $hdb2e$reactstatelymenu = require("@react-stately/menu");
|
|
15
|
+
var $hdb2e$reactariautils = require("@react-aria/utils");
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
function $parcel$interopDefault(a) {
|
|
19
|
+
return a && a.__esModule ? a.default : a;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function $parcel$export(e, n, v, s) {
|
|
23
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
$parcel$export(module.exports, "ContextualHelpTrigger", () => $db380858d398b658$export$5413b169fff83e61);
|
|
27
|
+
/*
|
|
28
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
29
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
30
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
31
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
32
|
+
*
|
|
33
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
34
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
35
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
36
|
+
* governing permissions and limitations under the License.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
function $db380858d398b658$var$ContextualHelpTrigger(props) {
|
|
51
|
+
let { isUnavailable: isUnavailable = false, targetKey: targetKey } = props;
|
|
52
|
+
let triggerRef = (0, $hdb2e$react.useRef)(null);
|
|
53
|
+
let popoverRef = (0, $hdb2e$react.useRef)(null);
|
|
54
|
+
let { popoverContainer: popoverContainer, trayContainerRef: trayContainerRef, rootMenuTriggerState: rootMenuTriggerState, menu: parentMenuRef, state: state } = (0, $cac834c4bc0a51d3$exports.useMenuStateContext)();
|
|
55
|
+
let triggerNode = state.collection.getItem(targetKey);
|
|
56
|
+
let submenuTriggerState = (0, $hdb2e$reactstatelymenu.UNSTABLE_useSubmenuTriggerState)({
|
|
57
|
+
triggerKey: targetKey
|
|
58
|
+
}, {
|
|
59
|
+
...rootMenuTriggerState,
|
|
60
|
+
...state
|
|
61
|
+
});
|
|
62
|
+
let submenuRef = (0, $hdb2e$reactspectrumutils.unwrapDOMRef)(popoverRef);
|
|
63
|
+
let { submenuTriggerProps: submenuTriggerProps, popoverProps: popoverProps } = (0, $hdb2e$reactariamenu.UNSTABLE_useSubmenuTrigger)({
|
|
64
|
+
node: triggerNode,
|
|
65
|
+
parentMenuRef: parentMenuRef,
|
|
66
|
+
submenuRef: submenuRef,
|
|
67
|
+
type: "dialog",
|
|
68
|
+
isDisabled: !isUnavailable
|
|
69
|
+
}, submenuTriggerState, triggerRef);
|
|
70
|
+
let isMobile = (0, $hdb2e$reactspectrumutils.useIsMobileDevice)();
|
|
71
|
+
let [traySubmenuAnimation, setTraySubmenuAnimation] = (0, $hdb2e$react.useState)("");
|
|
72
|
+
(0, $hdb2e$react.useEffect)(()=>{
|
|
73
|
+
if (submenuTriggerState.isOpen) setTraySubmenuAnimation("spectrum-TraySubmenu-enter");
|
|
74
|
+
}, [
|
|
75
|
+
submenuTriggerState.isOpen
|
|
76
|
+
]);
|
|
77
|
+
let slots = {};
|
|
78
|
+
if (isUnavailable) slots = {
|
|
79
|
+
dialog: {
|
|
80
|
+
UNSAFE_className: (0, $hdb2e$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a10e565ec42bcf96$exports))), "react-spectrum-ContextualHelp-dialog", {
|
|
81
|
+
"react-spectrum-ContextualHelp-dialog--isMobile": isMobile
|
|
82
|
+
}, (0, $hdb2e$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3deee0fd2b46e64f$exports))), {
|
|
83
|
+
"spectrum-Menu-subdialog": !isMobile,
|
|
84
|
+
[traySubmenuAnimation]: isMobile
|
|
85
|
+
}))
|
|
86
|
+
},
|
|
87
|
+
content: {
|
|
88
|
+
UNSAFE_className: (0, ($parcel$interopDefault($a10e565ec42bcf96$exports)))["react-spectrum-ContextualHelp-content"]
|
|
89
|
+
},
|
|
90
|
+
footer: {
|
|
91
|
+
UNSAFE_className: (0, ($parcel$interopDefault($a10e565ec42bcf96$exports)))["react-spectrum-ContextualHelp-footer"]
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
let [trigger] = (0, ($parcel$interopDefault($hdb2e$react))).Children.toArray(props.children);
|
|
95
|
+
let [, content] = props.children;
|
|
96
|
+
let onBlurWithin = (e)=>{
|
|
97
|
+
var _popoverRef_current_UNSAFE_getDOMNode, _popoverRef_current;
|
|
98
|
+
if (e.relatedTarget && popoverRef.current && !(popoverRef === null || popoverRef === void 0 ? void 0 : (_popoverRef_current = popoverRef.current) === null || _popoverRef_current === void 0 ? void 0 : (_popoverRef_current_UNSAFE_getDOMNode = _popoverRef_current.UNSAFE_getDOMNode()) === null || _popoverRef_current_UNSAFE_getDOMNode === void 0 ? void 0 : _popoverRef_current_UNSAFE_getDOMNode.contains(e.relatedTarget)) && !(e.relatedTarget === triggerRef.current && (0, $hdb2e$reactariainteractions.getInteractionModality)() === "pointer")) {
|
|
99
|
+
if (submenuTriggerState.isOpen) submenuTriggerState.close();
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
let overlay;
|
|
103
|
+
let tray;
|
|
104
|
+
let onBackButtonPress = ()=>{
|
|
105
|
+
setTraySubmenuAnimation("spectrum-TraySubmenu-exit");
|
|
106
|
+
setTimeout(()=>{
|
|
107
|
+
submenuTriggerState.close();
|
|
108
|
+
if (parentMenuRef.current && !parentMenuRef.current.contains(document.activeElement)) parentMenuRef.current.focus();
|
|
109
|
+
}, 220); // Matches transition duration
|
|
110
|
+
};
|
|
111
|
+
let [offset, setOffset] = (0, $hdb2e$react.useState)(0);
|
|
112
|
+
(0, $hdb2e$reactariautils.useLayoutEffect)(()=>{
|
|
113
|
+
if (parentMenuRef.current) {
|
|
114
|
+
var _window_getComputedStyle, _window;
|
|
115
|
+
let offset = (_window = window) === null || _window === void 0 ? void 0 : (_window_getComputedStyle = _window.getComputedStyle(parentMenuRef === null || parentMenuRef === void 0 ? void 0 : parentMenuRef.current)) === null || _window_getComputedStyle === void 0 ? void 0 : _window_getComputedStyle.getPropertyValue("--spectrum-submenu-offset-distance");
|
|
116
|
+
if (offset !== "") setOffset(-1 * parseInt(offset, 10));
|
|
117
|
+
}
|
|
118
|
+
}, [
|
|
119
|
+
parentMenuRef
|
|
120
|
+
]);
|
|
121
|
+
if (isMobile) {
|
|
122
|
+
delete submenuTriggerProps.onBlur;
|
|
123
|
+
delete submenuTriggerProps.onHoverChange;
|
|
124
|
+
if (trayContainerRef.current && submenuTriggerState.isOpen) {
|
|
125
|
+
let subDialogKeyDown = (e)=>{
|
|
126
|
+
switch(e.key){
|
|
127
|
+
case "Escape":
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
onBackButtonPress();
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
tray = /*#__PURE__*/ (0, ($parcel$interopDefault($hdb2e$react))).createElement((0, $63a7dff9cbe2d046$exports.TrayHeaderWrapper), {
|
|
134
|
+
isSubmenu: true,
|
|
135
|
+
parentMenuTreeState: state,
|
|
136
|
+
rootMenuTriggerState: rootMenuTriggerState,
|
|
137
|
+
wrapperKeyDown: subDialogKeyDown,
|
|
138
|
+
onBackButtonPress: onBackButtonPress
|
|
139
|
+
}, content);
|
|
140
|
+
overlay = /*#__PURE__*/ (0, ($parcel$interopDefault($hdb2e$reactdom))).createPortal(tray, trayContainerRef.current);
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
let onDismissButtonPress = ()=>{
|
|
144
|
+
var _parentMenuRef_current;
|
|
145
|
+
submenuTriggerState.close();
|
|
146
|
+
(_parentMenuRef_current = parentMenuRef.current) === null || _parentMenuRef_current === void 0 ? void 0 : _parentMenuRef_current.focus();
|
|
147
|
+
};
|
|
148
|
+
overlay = /*#__PURE__*/ (0, ($parcel$interopDefault($hdb2e$react))).createElement((0, $hdb2e$reactspectrumoverlays.Popover), {
|
|
149
|
+
...popoverProps,
|
|
150
|
+
UNSAFE_style: {
|
|
151
|
+
clipPath: "unset",
|
|
152
|
+
overflow: "visible",
|
|
153
|
+
filter: "unset",
|
|
154
|
+
borderWidth: "0px"
|
|
155
|
+
},
|
|
156
|
+
UNSAFE_className: (0, $hdb2e$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3deee0fd2b46e64f$exports))), "spectrum-Submenu-popover"),
|
|
157
|
+
onDismissButtonPress: onDismissButtonPress,
|
|
158
|
+
onBlurWithin: onBlurWithin,
|
|
159
|
+
container: popoverContainer,
|
|
160
|
+
state: submenuTriggerState,
|
|
161
|
+
ref: popoverRef,
|
|
162
|
+
triggerRef: triggerRef,
|
|
163
|
+
placement: "end top",
|
|
164
|
+
containerPadding: 0,
|
|
165
|
+
crossOffset: offset,
|
|
166
|
+
offset: offset,
|
|
167
|
+
hideArrow: true,
|
|
168
|
+
enableBothDismissButtons: true
|
|
169
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hdb2e$react))).createElement((0, $hdb2e$reactariafocus.FocusScope), {
|
|
170
|
+
restoreFocus: true
|
|
171
|
+
}, content));
|
|
172
|
+
}
|
|
173
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($hdb2e$react))).createElement((0, ($parcel$interopDefault($hdb2e$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($hdb2e$react))).createElement((0, $cac834c4bc0a51d3$exports.SubmenuTriggerContext).Provider, {
|
|
174
|
+
value: {
|
|
175
|
+
isUnavailable: isUnavailable,
|
|
176
|
+
triggerRef: triggerRef,
|
|
177
|
+
...submenuTriggerProps
|
|
178
|
+
}
|
|
179
|
+
}, trigger), /*#__PURE__*/ (0, ($parcel$interopDefault($hdb2e$react))).createElement((0, $hdb2e$reactspectrumutils.SlotProvider), {
|
|
180
|
+
slots: slots
|
|
181
|
+
}, submenuTriggerState.isOpen && overlay));
|
|
182
|
+
}
|
|
183
|
+
$db380858d398b658$var$ContextualHelpTrigger.getCollectionNode = function* getCollectionNode(props) {
|
|
184
|
+
let childArray = [];
|
|
185
|
+
(0, ($parcel$interopDefault($hdb2e$react))).Children.forEach(props.children, (child)=>{
|
|
186
|
+
if (/*#__PURE__*/ (0, ($parcel$interopDefault($hdb2e$react))).isValidElement(child)) childArray.push(child);
|
|
187
|
+
});
|
|
188
|
+
let [trigger] = childArray;
|
|
189
|
+
let [, content] = props.children;
|
|
190
|
+
yield {
|
|
191
|
+
element: /*#__PURE__*/ (0, ($parcel$interopDefault($hdb2e$react))).cloneElement(trigger, {
|
|
192
|
+
...trigger.props,
|
|
193
|
+
hasChildItems: true,
|
|
194
|
+
isTrigger: true
|
|
195
|
+
}),
|
|
196
|
+
wrapper: (element)=>/*#__PURE__*/ (0, ($parcel$interopDefault($hdb2e$react))).createElement($db380858d398b658$var$ContextualHelpTrigger, {
|
|
197
|
+
key: element.key,
|
|
198
|
+
targetKey: element.key,
|
|
199
|
+
...props
|
|
200
|
+
}, element, content)
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
let $db380858d398b658$export$5413b169fff83e61 = $db380858d398b658$var$ContextualHelpTrigger;
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
//# sourceMappingURL=ContextualHelpTrigger.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"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","sources":["packages/@react-spectrum/menu/src/ContextualHelpTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, unwrapDOMRef, useIsMobileDevice} from '@react-spectrum/utils';\nimport {FocusScope} from '@react-aria/focus';\nimport {getInteractionModality} from '@react-aria/interactions';\nimport helpStyles from '@adobe/spectrum-css-temp/components/contextualhelp/vars.css';\nimport {ItemProps, Key} from '@react-types/shared';\nimport {Popover} from '@react-spectrum/overlays';\nimport React, {JSX, ReactElement, useEffect, useRef, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {SubmenuTriggerContext, useMenuStateContext} from './context';\nimport {TrayHeaderWrapper} from './Menu';\nimport {UNSTABLE_useSubmenuTrigger} from '@react-aria/menu';\nimport {UNSTABLE_useSubmenuTriggerState} from '@react-stately/menu';\nimport {useLayoutEffect} from '@react-aria/utils';\n\ninterface MenuDialogTriggerProps {\n /** Whether the menu item is currently unavailable. */\n isUnavailable?: boolean,\n /** The triggering Item and the Dialog, respectively. */\n children: [ReactElement, ReactElement]\n}\n\ninterface InternalMenuDialogTriggerProps extends MenuDialogTriggerProps {\n targetKey: Key\n}\n\nexport interface SpectrumMenuDialogTriggerProps extends MenuDialogTriggerProps {}\n\nfunction ContextualHelpTrigger(props: InternalMenuDialogTriggerProps): ReactElement {\n let {isUnavailable = false, targetKey} = props;\n\n let triggerRef = useRef<HTMLLIElement>(null);\n let popoverRef = useRef(null);\n let {popoverContainer, trayContainerRef, rootMenuTriggerState, menu: parentMenuRef, state} = useMenuStateContext();\n let triggerNode = state.collection.getItem(targetKey);\n let submenuTriggerState = UNSTABLE_useSubmenuTriggerState({triggerKey: targetKey}, {...rootMenuTriggerState, ...state});\n let submenuRef = unwrapDOMRef(popoverRef);\n let {submenuTriggerProps, popoverProps} = UNSTABLE_useSubmenuTrigger({\n node: triggerNode,\n parentMenuRef,\n submenuRef,\n type: 'dialog',\n isDisabled: !isUnavailable\n }, submenuTriggerState, triggerRef);\n let isMobile = useIsMobileDevice();\n let [traySubmenuAnimation, setTraySubmenuAnimation] = useState('');\n useEffect(() => {\n if (submenuTriggerState.isOpen) {\n setTraySubmenuAnimation('spectrum-TraySubmenu-enter');\n }\n }, [submenuTriggerState.isOpen]);\n let slots = {};\n if (isUnavailable) {\n slots = {\n dialog: {\n UNSAFE_className: classNames(\n helpStyles,\n 'react-spectrum-ContextualHelp-dialog',\n {\n 'react-spectrum-ContextualHelp-dialog--isMobile': isMobile\n },\n classNames(\n styles,\n {\n 'spectrum-Menu-subdialog': !isMobile,\n [traySubmenuAnimation]: isMobile\n }\n )\n )\n },\n content: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-content']},\n footer: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-footer']}\n };\n }\n let [trigger] = React.Children.toArray(props.children);\n let [, content] = props.children as [ReactElement, ReactElement];\n\n let onBlurWithin = (e) => {\n if (e.relatedTarget && popoverRef.current && (!popoverRef?.current?.UNSAFE_getDOMNode()?.contains(e.relatedTarget) && !(e.relatedTarget === triggerRef.current && getInteractionModality() === 'pointer'))) {\n if (submenuTriggerState.isOpen) {\n submenuTriggerState.close();\n }\n }\n };\n\n let overlay;\n let tray;\n let onBackButtonPress = () => {\n setTraySubmenuAnimation('spectrum-TraySubmenu-exit');\n setTimeout(() => {\n submenuTriggerState.close();\n if (parentMenuRef.current && !parentMenuRef.current.contains(document.activeElement)) {\n parentMenuRef.current.focus();\n }\n }, 220); // Matches transition duration\n };\n let [offset, setOffset] = useState(0);\n useLayoutEffect(() => {\n if (parentMenuRef.current) {\n let offset = window?.getComputedStyle(parentMenuRef?.current)?.getPropertyValue('--spectrum-submenu-offset-distance');\n if (offset !== '') {\n setOffset(-1 * parseInt(offset, 10));\n }\n }\n }, [parentMenuRef]);\n\n if (isMobile) {\n delete submenuTriggerProps.onBlur;\n delete submenuTriggerProps.onHoverChange;\n if (trayContainerRef.current && submenuTriggerState.isOpen) {\n let subDialogKeyDown = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'Escape':\n e.stopPropagation();\n onBackButtonPress();\n break;\n }\n };\n\n tray = (\n <TrayHeaderWrapper\n isSubmenu\n parentMenuTreeState={state}\n rootMenuTriggerState={rootMenuTriggerState}\n wrapperKeyDown={subDialogKeyDown}\n onBackButtonPress={onBackButtonPress}>\n {content}\n </TrayHeaderWrapper>\n );\n\n overlay = ReactDOM.createPortal(tray, trayContainerRef.current);\n }\n } else {\n let onDismissButtonPress = () => {\n submenuTriggerState.close();\n parentMenuRef.current?.focus();\n };\n\n overlay = (\n <Popover\n {...popoverProps}\n UNSAFE_style={{clipPath: 'unset', overflow: 'visible', filter: 'unset', borderWidth: '0px'}}\n UNSAFE_className={classNames(styles, 'spectrum-Submenu-popover')}\n onDismissButtonPress={onDismissButtonPress}\n onBlurWithin={onBlurWithin}\n container={popoverContainer}\n state={submenuTriggerState}\n ref={popoverRef}\n triggerRef={triggerRef}\n placement=\"end top\"\n containerPadding={0}\n crossOffset={offset}\n offset={offset}\n hideArrow\n enableBothDismissButtons>\n <FocusScope restoreFocus>\n {content}\n </FocusScope>\n </Popover>\n );\n }\n\n return (\n <>\n <SubmenuTriggerContext.Provider value={{isUnavailable, triggerRef, ...submenuTriggerProps}}>{trigger}</SubmenuTriggerContext.Provider>\n <SlotProvider slots={slots}>\n {submenuTriggerState.isOpen && overlay}\n </SlotProvider>\n </>\n );\n}\n\nContextualHelpTrigger.getCollectionNode = function* getCollectionNode<T>(props: ItemProps<T>) {\n let childArray: ReactElement[] = [];\n React.Children.forEach(props.children, child => {\n if (React.isValidElement(child)) {\n childArray.push(child);\n }\n });\n let [trigger] = childArray;\n let [, content] = props.children as [ReactElement, ReactElement];\n\n yield {\n element: React.cloneElement(trigger, {...trigger.props, hasChildItems: true, isTrigger: true}),\n wrapper: (element) => (\n <ContextualHelpTrigger key={element.key} targetKey={element.key} {...props}>\n {element}\n {content}\n </ContextualHelpTrigger>\n )\n };\n};\n\nlet _Item = ContextualHelpTrigger as (props: SpectrumMenuDialogTriggerProps) => JSX.Element;\nexport {_Item as ContextualHelpTrigger};\n"],"names":[],"version":3,"file":"ContextualHelpTrigger.main.js.map"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import "./vars.c9740d19.css";
|
|
2
|
+
import $7Y1uy$contextualhelp_vars_cssmodulejs from "./contextualhelp_vars_css.mjs";
|
|
3
|
+
import "./vars.b6dfdac4.css";
|
|
4
|
+
import $7Y1uy$menu_vars_cssmodulejs from "./menu_vars_css.mjs";
|
|
5
|
+
import {SubmenuTriggerContext as $d94604d52c3e3feb$export$8d97fe02339fc0e3, useMenuStateContext as $d94604d52c3e3feb$export$efa3856fc0e85e7f} from "./context.mjs";
|
|
6
|
+
import {TrayHeaderWrapper as $49b26f4b606348f6$export$3dfe97b5c32d8d8c} from "./Menu.mjs";
|
|
7
|
+
import {unwrapDOMRef as $7Y1uy$unwrapDOMRef, useIsMobileDevice as $7Y1uy$useIsMobileDevice, classNames as $7Y1uy$classNames, SlotProvider as $7Y1uy$SlotProvider} from "@react-spectrum/utils";
|
|
8
|
+
import {FocusScope as $7Y1uy$FocusScope} from "@react-aria/focus";
|
|
9
|
+
import {getInteractionModality as $7Y1uy$getInteractionModality} from "@react-aria/interactions";
|
|
10
|
+
import {Popover as $7Y1uy$Popover} from "@react-spectrum/overlays";
|
|
11
|
+
import $7Y1uy$react, {useRef as $7Y1uy$useRef, useState as $7Y1uy$useState, useEffect as $7Y1uy$useEffect} from "react";
|
|
12
|
+
import $7Y1uy$reactdom from "react-dom";
|
|
13
|
+
import {UNSTABLE_useSubmenuTrigger as $7Y1uy$UNSTABLE_useSubmenuTrigger} from "@react-aria/menu";
|
|
14
|
+
import {UNSTABLE_useSubmenuTriggerState as $7Y1uy$UNSTABLE_useSubmenuTriggerState} from "@react-stately/menu";
|
|
15
|
+
import {useLayoutEffect as $7Y1uy$useLayoutEffect} from "@react-aria/utils";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
function $parcel$interopDefault(a) {
|
|
19
|
+
return a && a.__esModule ? a.default : a;
|
|
20
|
+
}
|
|
21
|
+
/*
|
|
22
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
23
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
24
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
25
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
28
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
29
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
30
|
+
* governing permissions and limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
function $726fb1b478e356bf$var$ContextualHelpTrigger(props) {
|
|
45
|
+
let { isUnavailable: isUnavailable = false, targetKey: targetKey } = props;
|
|
46
|
+
let triggerRef = (0, $7Y1uy$useRef)(null);
|
|
47
|
+
let popoverRef = (0, $7Y1uy$useRef)(null);
|
|
48
|
+
let { popoverContainer: popoverContainer, trayContainerRef: trayContainerRef, rootMenuTriggerState: rootMenuTriggerState, menu: parentMenuRef, state: state } = (0, $d94604d52c3e3feb$export$efa3856fc0e85e7f)();
|
|
49
|
+
let triggerNode = state.collection.getItem(targetKey);
|
|
50
|
+
let submenuTriggerState = (0, $7Y1uy$UNSTABLE_useSubmenuTriggerState)({
|
|
51
|
+
triggerKey: targetKey
|
|
52
|
+
}, {
|
|
53
|
+
...rootMenuTriggerState,
|
|
54
|
+
...state
|
|
55
|
+
});
|
|
56
|
+
let submenuRef = (0, $7Y1uy$unwrapDOMRef)(popoverRef);
|
|
57
|
+
let { submenuTriggerProps: submenuTriggerProps, popoverProps: popoverProps } = (0, $7Y1uy$UNSTABLE_useSubmenuTrigger)({
|
|
58
|
+
node: triggerNode,
|
|
59
|
+
parentMenuRef: parentMenuRef,
|
|
60
|
+
submenuRef: submenuRef,
|
|
61
|
+
type: "dialog",
|
|
62
|
+
isDisabled: !isUnavailable
|
|
63
|
+
}, submenuTriggerState, triggerRef);
|
|
64
|
+
let isMobile = (0, $7Y1uy$useIsMobileDevice)();
|
|
65
|
+
let [traySubmenuAnimation, setTraySubmenuAnimation] = (0, $7Y1uy$useState)("");
|
|
66
|
+
(0, $7Y1uy$useEffect)(()=>{
|
|
67
|
+
if (submenuTriggerState.isOpen) setTraySubmenuAnimation("spectrum-TraySubmenu-enter");
|
|
68
|
+
}, [
|
|
69
|
+
submenuTriggerState.isOpen
|
|
70
|
+
]);
|
|
71
|
+
let slots = {};
|
|
72
|
+
if (isUnavailable) slots = {
|
|
73
|
+
dialog: {
|
|
74
|
+
UNSAFE_className: (0, $7Y1uy$classNames)((0, ($parcel$interopDefault($7Y1uy$contextualhelp_vars_cssmodulejs))), "react-spectrum-ContextualHelp-dialog", {
|
|
75
|
+
"react-spectrum-ContextualHelp-dialog--isMobile": isMobile
|
|
76
|
+
}, (0, $7Y1uy$classNames)((0, ($parcel$interopDefault($7Y1uy$menu_vars_cssmodulejs))), {
|
|
77
|
+
"spectrum-Menu-subdialog": !isMobile,
|
|
78
|
+
[traySubmenuAnimation]: isMobile
|
|
79
|
+
}))
|
|
80
|
+
},
|
|
81
|
+
content: {
|
|
82
|
+
UNSAFE_className: (0, ($parcel$interopDefault($7Y1uy$contextualhelp_vars_cssmodulejs)))["react-spectrum-ContextualHelp-content"]
|
|
83
|
+
},
|
|
84
|
+
footer: {
|
|
85
|
+
UNSAFE_className: (0, ($parcel$interopDefault($7Y1uy$contextualhelp_vars_cssmodulejs)))["react-spectrum-ContextualHelp-footer"]
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
let [trigger] = (0, $7Y1uy$react).Children.toArray(props.children);
|
|
89
|
+
let [, content] = props.children;
|
|
90
|
+
let onBlurWithin = (e)=>{
|
|
91
|
+
var _popoverRef_current_UNSAFE_getDOMNode, _popoverRef_current;
|
|
92
|
+
if (e.relatedTarget && popoverRef.current && !(popoverRef === null || popoverRef === void 0 ? void 0 : (_popoverRef_current = popoverRef.current) === null || _popoverRef_current === void 0 ? void 0 : (_popoverRef_current_UNSAFE_getDOMNode = _popoverRef_current.UNSAFE_getDOMNode()) === null || _popoverRef_current_UNSAFE_getDOMNode === void 0 ? void 0 : _popoverRef_current_UNSAFE_getDOMNode.contains(e.relatedTarget)) && !(e.relatedTarget === triggerRef.current && (0, $7Y1uy$getInteractionModality)() === "pointer")) {
|
|
93
|
+
if (submenuTriggerState.isOpen) submenuTriggerState.close();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
let overlay;
|
|
97
|
+
let tray;
|
|
98
|
+
let onBackButtonPress = ()=>{
|
|
99
|
+
setTraySubmenuAnimation("spectrum-TraySubmenu-exit");
|
|
100
|
+
setTimeout(()=>{
|
|
101
|
+
submenuTriggerState.close();
|
|
102
|
+
if (parentMenuRef.current && !parentMenuRef.current.contains(document.activeElement)) parentMenuRef.current.focus();
|
|
103
|
+
}, 220); // Matches transition duration
|
|
104
|
+
};
|
|
105
|
+
let [offset, setOffset] = (0, $7Y1uy$useState)(0);
|
|
106
|
+
(0, $7Y1uy$useLayoutEffect)(()=>{
|
|
107
|
+
if (parentMenuRef.current) {
|
|
108
|
+
var _window_getComputedStyle, _window;
|
|
109
|
+
let offset = (_window = window) === null || _window === void 0 ? void 0 : (_window_getComputedStyle = _window.getComputedStyle(parentMenuRef === null || parentMenuRef === void 0 ? void 0 : parentMenuRef.current)) === null || _window_getComputedStyle === void 0 ? void 0 : _window_getComputedStyle.getPropertyValue("--spectrum-submenu-offset-distance");
|
|
110
|
+
if (offset !== "") setOffset(-1 * parseInt(offset, 10));
|
|
111
|
+
}
|
|
112
|
+
}, [
|
|
113
|
+
parentMenuRef
|
|
114
|
+
]);
|
|
115
|
+
if (isMobile) {
|
|
116
|
+
delete submenuTriggerProps.onBlur;
|
|
117
|
+
delete submenuTriggerProps.onHoverChange;
|
|
118
|
+
if (trayContainerRef.current && submenuTriggerState.isOpen) {
|
|
119
|
+
let subDialogKeyDown = (e)=>{
|
|
120
|
+
switch(e.key){
|
|
121
|
+
case "Escape":
|
|
122
|
+
e.stopPropagation();
|
|
123
|
+
onBackButtonPress();
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
tray = /*#__PURE__*/ (0, $7Y1uy$react).createElement((0, $49b26f4b606348f6$export$3dfe97b5c32d8d8c), {
|
|
128
|
+
isSubmenu: true,
|
|
129
|
+
parentMenuTreeState: state,
|
|
130
|
+
rootMenuTriggerState: rootMenuTriggerState,
|
|
131
|
+
wrapperKeyDown: subDialogKeyDown,
|
|
132
|
+
onBackButtonPress: onBackButtonPress
|
|
133
|
+
}, content);
|
|
134
|
+
overlay = /*#__PURE__*/ (0, $7Y1uy$reactdom).createPortal(tray, trayContainerRef.current);
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
let onDismissButtonPress = ()=>{
|
|
138
|
+
var _parentMenuRef_current;
|
|
139
|
+
submenuTriggerState.close();
|
|
140
|
+
(_parentMenuRef_current = parentMenuRef.current) === null || _parentMenuRef_current === void 0 ? void 0 : _parentMenuRef_current.focus();
|
|
141
|
+
};
|
|
142
|
+
overlay = /*#__PURE__*/ (0, $7Y1uy$react).createElement((0, $7Y1uy$Popover), {
|
|
143
|
+
...popoverProps,
|
|
144
|
+
UNSAFE_style: {
|
|
145
|
+
clipPath: "unset",
|
|
146
|
+
overflow: "visible",
|
|
147
|
+
filter: "unset",
|
|
148
|
+
borderWidth: "0px"
|
|
149
|
+
},
|
|
150
|
+
UNSAFE_className: (0, $7Y1uy$classNames)((0, ($parcel$interopDefault($7Y1uy$menu_vars_cssmodulejs))), "spectrum-Submenu-popover"),
|
|
151
|
+
onDismissButtonPress: onDismissButtonPress,
|
|
152
|
+
onBlurWithin: onBlurWithin,
|
|
153
|
+
container: popoverContainer,
|
|
154
|
+
state: submenuTriggerState,
|
|
155
|
+
ref: popoverRef,
|
|
156
|
+
triggerRef: triggerRef,
|
|
157
|
+
placement: "end top",
|
|
158
|
+
containerPadding: 0,
|
|
159
|
+
crossOffset: offset,
|
|
160
|
+
offset: offset,
|
|
161
|
+
hideArrow: true,
|
|
162
|
+
enableBothDismissButtons: true
|
|
163
|
+
}, /*#__PURE__*/ (0, $7Y1uy$react).createElement((0, $7Y1uy$FocusScope), {
|
|
164
|
+
restoreFocus: true
|
|
165
|
+
}, content));
|
|
166
|
+
}
|
|
167
|
+
return /*#__PURE__*/ (0, $7Y1uy$react).createElement((0, $7Y1uy$react).Fragment, null, /*#__PURE__*/ (0, $7Y1uy$react).createElement((0, $d94604d52c3e3feb$export$8d97fe02339fc0e3).Provider, {
|
|
168
|
+
value: {
|
|
169
|
+
isUnavailable: isUnavailable,
|
|
170
|
+
triggerRef: triggerRef,
|
|
171
|
+
...submenuTriggerProps
|
|
172
|
+
}
|
|
173
|
+
}, trigger), /*#__PURE__*/ (0, $7Y1uy$react).createElement((0, $7Y1uy$SlotProvider), {
|
|
174
|
+
slots: slots
|
|
175
|
+
}, submenuTriggerState.isOpen && overlay));
|
|
176
|
+
}
|
|
177
|
+
$726fb1b478e356bf$var$ContextualHelpTrigger.getCollectionNode = function* getCollectionNode(props) {
|
|
178
|
+
let childArray = [];
|
|
179
|
+
(0, $7Y1uy$react).Children.forEach(props.children, (child)=>{
|
|
180
|
+
if (/*#__PURE__*/ (0, $7Y1uy$react).isValidElement(child)) childArray.push(child);
|
|
181
|
+
});
|
|
182
|
+
let [trigger] = childArray;
|
|
183
|
+
let [, content] = props.children;
|
|
184
|
+
yield {
|
|
185
|
+
element: /*#__PURE__*/ (0, $7Y1uy$react).cloneElement(trigger, {
|
|
186
|
+
...trigger.props,
|
|
187
|
+
hasChildItems: true,
|
|
188
|
+
isTrigger: true
|
|
189
|
+
}),
|
|
190
|
+
wrapper: (element)=>/*#__PURE__*/ (0, $7Y1uy$react).createElement($726fb1b478e356bf$var$ContextualHelpTrigger, {
|
|
191
|
+
key: element.key,
|
|
192
|
+
targetKey: element.key,
|
|
193
|
+
...props
|
|
194
|
+
}, element, content)
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
let $726fb1b478e356bf$export$5413b169fff83e61 = $726fb1b478e356bf$var$ContextualHelpTrigger;
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
export {$726fb1b478e356bf$export$5413b169fff83e61 as ContextualHelpTrigger};
|
|
201
|
+
//# sourceMappingURL=ContextualHelpTrigger.mjs.map
|