@elliemae/ds-global-header 3.70.0-next.61 → 3.70.0-next.63
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/cjs/DSGlobalHeader.js +16 -2
- package/dist/cjs/DSGlobalHeader.js.map +2 -2
- package/dist/cjs/DSGlobalHeaderContext.js.map +2 -2
- package/dist/cjs/config/useGlobalHeader.js +13 -2
- package/dist/cjs/config/useGlobalHeader.js.map +2 -2
- package/dist/cjs/constants/index.js +4 -3
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/index.js +3 -6
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js +33 -1
- package/dist/cjs/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js.map +2 -2
- package/dist/cjs/parts/Logo/GlobalHeaderLogo.js +16 -2
- package/dist/cjs/parts/Logo/GlobalHeaderLogo.js.map +2 -2
- package/dist/cjs/parts/Toolbar/GlobalHeaderToolbar.js +54 -16
- package/dist/cjs/parts/Toolbar/GlobalHeaderToolbar.js.map +2 -2
- package/dist/cjs/{utils/useCallbackAfterRender.js → parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js} +7 -16
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js +43 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js +52 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js +84 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js +50 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js +64 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +106 -55
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +3 -3
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js +27 -11
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js.map +2 -2
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js +52 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js +23 -15
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js.map +2 -2
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js +54 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js +26 -16
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js.map +2 -2
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js +60 -50
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js.map +2 -2
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js +58 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js +33 -25
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js.map +2 -2
- package/dist/cjs/parts/Toolbar/outOfTheBox/index.js +12 -4
- package/dist/cjs/parts/Toolbar/outOfTheBox/index.js.map +2 -2
- package/dist/cjs/parts/Toolbar/styles.js +6 -1
- package/dist/cjs/parts/Toolbar/styles.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/sharedTypes.js.map +1 -1
- package/dist/cjs/typescript-testing/typescript-global-header-toolbar-types.js +52 -0
- package/dist/cjs/typescript-testing/typescript-global-header-toolbar-types.js.map +2 -2
- package/dist/esm/DSGlobalHeader.js +16 -2
- package/dist/esm/DSGlobalHeader.js.map +2 -2
- package/dist/esm/DSGlobalHeaderContext.js.map +2 -2
- package/dist/esm/config/useGlobalHeader.js +13 -2
- package/dist/esm/config/useGlobalHeader.js.map +2 -2
- package/dist/esm/constants/index.js +4 -3
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/index.js +3 -6
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js +34 -2
- package/dist/esm/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js.map +2 -2
- package/dist/esm/parts/Logo/GlobalHeaderLogo.js +16 -2
- package/dist/esm/parts/Logo/GlobalHeaderLogo.js.map +2 -2
- package/dist/esm/parts/Toolbar/GlobalHeaderToolbar.js +55 -17
- package/dist/esm/parts/Toolbar/GlobalHeaderToolbar.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js +8 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js +13 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js +22 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js +54 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js +20 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js +34 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +108 -57
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js +28 -12
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js +22 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js +24 -16
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js +24 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js +26 -16
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js +60 -50
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js +28 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js +33 -25
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/index.js +8 -3
- package/dist/esm/parts/Toolbar/outOfTheBox/index.js.map +2 -2
- package/dist/esm/parts/Toolbar/styles.js +6 -1
- package/dist/esm/parts/Toolbar/styles.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/typescript-global-header-toolbar-types.js +52 -0
- package/dist/esm/typescript-testing/typescript-global-header-toolbar-types.js.map +2 -2
- package/dist/types/DSGlobalHeaderContext.d.ts +10 -2
- package/dist/types/config/useGlobalHeader.d.ts +3 -4
- package/dist/types/constants/index.d.ts +3 -3
- package/dist/types/index.d.ts +0 -2
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.d.ts +4 -0
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.d.ts +2 -0
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.d.ts +1 -0
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.d.ts +2 -0
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.d.ts +23 -0
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.d.ts +456 -0
- package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.d.ts +2 -2
- package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.d.ts +2 -2
- package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.d.ts +28 -0
- package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.d.ts +9 -1
- package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.d.ts +26 -0
- package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.d.ts +2 -2
- package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.d.ts +2 -0
- package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.d.ts +26 -0
- package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.d.ts +2 -3
- package/dist/types/parts/Toolbar/outOfTheBox/index.d.ts +3 -3
- package/dist/types/parts/Toolbar/styles.d.ts +1 -0
- package/dist/types/react-desc-prop-types.d.ts +63 -72
- package/dist/types/sharedTypes.d.ts +16 -6
- package/package.json +16 -13
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js +0 -127
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js.map +0 -7
- package/dist/cjs/utils/useCallbackAfterRender.js.map +0 -7
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js +0 -97
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js.map +0 -7
- package/dist/esm/utils/useCallbackAfterRender.js +0 -17
- package/dist/esm/utils/useCallbackAfterRender.js.map +0 -7
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.d.ts +0 -6
- package/dist/types/utils/useCallbackAfterRender.d.ts +0 -3
|
@@ -26,22 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
29
|
+
var AppPickerCTX_exports = {};
|
|
30
|
+
__export(AppPickerCTX_exports, {
|
|
31
|
+
AppPickerCtx: () => AppPickerCtx
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(AppPickerCTX_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_react = require("react");
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
effect(() => {
|
|
40
|
-
lastRun.current?.();
|
|
41
|
-
lastRun.current = null;
|
|
42
|
-
});
|
|
43
|
-
return (callback) => {
|
|
44
|
-
lastRun.current = callback;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=useCallbackAfterRender.js.map
|
|
36
|
+
const defaultContext = {};
|
|
37
|
+
const AppPickerCtx = (0, import_react.createContext)(defaultContext);
|
|
38
|
+
//# sourceMappingURL=AppPickerCTX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react';\nimport type { useAppPickerCTX } from './useAppPickerCTX.js';\n\nexport interface AppPickerCTX extends ReturnType<typeof useAppPickerCTX> {}\n\n// `{} as AppPickerCTX` rather than `null`, matching DSAppPickerContext and DSGlobalHeaderContext: the\n// provider always wraps the consumers, so a nullable context would only buy every reader a null check\n// that can never be true.\nconst defaultContext = {} as AppPickerCTX;\n\nexport const AppPickerCtx = createContext<AppPickerCTX>(defaultContext);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAQ9B,MAAM,iBAAiB,CAAC;AAEjB,MAAM,mBAAe,4BAA4B,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var AppPickerCTXRenderer_exports = {};
|
|
30
|
+
__export(AppPickerCTXRenderer_exports, {
|
|
31
|
+
AppPickerCTXRenderer: () => AppPickerCTXRenderer
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(AppPickerCTXRenderer_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_AppPickerRenderer = require("./AppPickerRenderer.js");
|
|
37
|
+
var import_useAppPickerCTX = require("./useAppPickerCTX.js");
|
|
38
|
+
var import_AppPickerCTX = require("./AppPickerCTX.js");
|
|
39
|
+
const AppPickerCTXRenderer = (appPickerProps) => {
|
|
40
|
+
const appPickerCTX = (0, import_useAppPickerCTX.useAppPickerCTX)(appPickerProps);
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AppPickerCTX.AppPickerCtx.Provider, { value: appPickerCTX, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AppPickerRenderer.AppPickerRenderer, {}) });
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=AppPickerCTXRenderer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { AppPickerRenderer } from './AppPickerRenderer.js';\nimport type { AppPickerT } from './react-desc-prop-types.js';\nimport { useAppPickerCTX } from './useAppPickerCTX.js';\nimport { AppPickerCtx } from './AppPickerCTX.js';\n\nexport const AppPickerCTXRenderer = (appPickerProps: AppPickerT.Props): JSX.Element => {\n const appPickerCTX = useAppPickerCTX(appPickerProps);\n\n return (\n <AppPickerCtx.Provider value={appPickerCTX}>\n <AppPickerRenderer />\n </AppPickerCtx.Provider>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADUjB;AAVN,+BAAkC;AAElC,6BAAgC;AAChC,0BAA6B;AAEtB,MAAM,uBAAuB,CAAC,mBAAkD;AACrF,QAAM,mBAAe,wCAAgB,cAAc;AAEnD,SACE,4CAAC,iCAAa,UAAb,EAAsB,OAAO,cAC5B,sDAAC,8CAAkB,GACrB;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var AppPickerRenderer_exports = {};
|
|
30
|
+
__export(AppPickerRenderer_exports, {
|
|
31
|
+
AppPickerRenderer: () => AppPickerRenderer
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(AppPickerRenderer_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_ds_app_picker = require("@elliemae/ds-app-picker");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_AppPickerCTX = require("./AppPickerCTX.js");
|
|
39
|
+
var import_TriggerDefaultComponent = require("./TriggerDefaultComponent.js");
|
|
40
|
+
const AppPickerRenderer = () => {
|
|
41
|
+
const { contractProps } = import_react.default.useContext(import_AppPickerCTX.AppPickerCtx);
|
|
42
|
+
const consumerOwnsTheTrigger = Boolean(contractProps.renderTrigger || contractProps.TriggerComponent);
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
import_ds_app_picker.DSAppPicker,
|
|
45
|
+
{
|
|
46
|
+
openAndFocusOnArrowKeys: true,
|
|
47
|
+
...consumerOwnsTheTrigger ? {} : { TriggerComponent: import_TriggerDefaultComponent.TriggerDefaultComponent },
|
|
48
|
+
...contractProps
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=AppPickerRenderer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { DSAppPicker } from '@elliemae/ds-app-picker';\nimport React from 'react';\nimport { AppPickerCtx } from './AppPickerCTX.js';\nimport { TriggerDefaultComponent } from './TriggerDefaultComponent.js';\n\nexport const AppPickerRenderer = (): JSX.Element => {\n const { contractProps } = React.useContext(AppPickerCtx);\n\n /*\n * Our default trigger applies only when the consumer supplied neither trigger API.\n *\n * This one cannot be expressed by spread order, unlike every other default below. DSAppPicker's\n * Trigger gives `TriggerComponent` precedence over `renderTrigger` (Trigger.tsx: \"TriggerComponent\n * wins when both custom APIs are supplied\"), so passing ours unconditionally would silently discard a\n * consumer's `renderTrigger` no matter where `contractProps` is spread \u2014 the spread would forward\n * their prop faithfully and DSAppPicker would then ignore it. Deciding here instead keeps both custom\n * trigger APIs working through the toolbar config.\n */\n const consumerOwnsTheTrigger = Boolean(contractProps.renderTrigger || contractProps.TriggerComponent);\n\n return (\n <DSAppPicker\n // Dimsum IoC direction: our default renders first and the consumer's contract props are spread over\n // it, so anything they put in `componentProps` wins and becomes theirs to own.\n // `getDSAppPickerContractProps` drops keys explicitly set to undefined, so an unset key in the config\n // never erases a default here.\n //\n // Note what is NOT passed: no `isOpen`, no `onKeyDown`, no `onClickOutside`. Passing `isOpen` makes\n // the picker controlled and passing `onKeyDown` switches off its Escape routing and focus return \u2014\n // either way this part would owe a reimplementation of behaviour DSAppPicker already has. See\n // useAppPickerCTX for the full statement.\n //\n // The toolbar is a menubar, so ArrowDown/ArrowUp on a toolbar item open it \u2014 that is this widget's\n // keyboard contract, not an application-level choice, which is why it is opted in here rather than\n // left to each consumer. The picker owns the whole flow: it records the arrow-key activation and\n // seeds focus on the selected app (first for ArrowDown, last for ArrowUp). Spread order still lets a\n // consumer turn it off through `componentProps`.\n openAndFocusOnArrowKeys\n // `TriggerComponent`, not the deprecated `renderTrigger`: DSAppPicker renders this one as JSX so it\n // gets its own fiber and may use hooks, and it is the only trigger API that receives the id the\n // panel's aria-labelledby points at. See TriggerDefaultComponent for the full reasoning.\n {...(consumerOwnsTheTrigger ? {} : { TriggerComponent: TriggerDefaultComponent })}\n {...contractProps}\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqBnB;AArBJ,2BAA4B;AAC5B,mBAAkB;AAClB,0BAA6B;AAC7B,qCAAwC;AAEjC,MAAM,oBAAoB,MAAmB;AAClD,QAAM,EAAE,cAAc,IAAI,aAAAA,QAAM,WAAW,gCAAY;AAYvD,QAAM,yBAAyB,QAAQ,cAAc,iBAAiB,cAAc,gBAAgB;AAEpG,SACE;AAAA,IAAC;AAAA;AAAA,MAgBC,yBAAuB;AAAA,MAItB,GAAI,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,uDAAwB;AAAA,MAC9E,GAAG;AAAA;AAAA,EACN;AAEJ;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var TriggerDefaultComponent_exports = {};
|
|
30
|
+
__export(TriggerDefaultComponent_exports, {
|
|
31
|
+
TriggerDefaultComponent: () => TriggerDefaultComponent
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(TriggerDefaultComponent_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_ds_icons = require("@elliemae/ds-icons");
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
+
var import_react = __toESM(require("react"));
|
|
40
|
+
var import_constants = require("../../../../constants/index.js");
|
|
41
|
+
var import_styles = require("../../../styles.js");
|
|
42
|
+
var import_AppPickerCTX = require("./AppPickerCTX.js");
|
|
43
|
+
const TriggerDefaultComponent = ({
|
|
44
|
+
innerRef,
|
|
45
|
+
id,
|
|
46
|
+
onClick: appPickerOnClick,
|
|
47
|
+
onKeyDown: appPickerOnKeyDown,
|
|
48
|
+
"aria-haspopup": ariaHasPopup
|
|
49
|
+
}) => {
|
|
50
|
+
const { triggerOnClick, setRef, triggerRef, label, otherProps, getOwnerPropsAwareOfPropsPassedToGlobalHeader } = import_react.default.useContext(import_AppPickerCTX.AppPickerCtx);
|
|
51
|
+
const handleTriggerRefs = import_react.default.useCallback(
|
|
52
|
+
(buttonRef) => {
|
|
53
|
+
setRef(buttonRef);
|
|
54
|
+
(0, import_ds_system.mergeRefs)(triggerRef, innerRef)(buttonRef);
|
|
55
|
+
},
|
|
56
|
+
[setRef, triggerRef, innerRef]
|
|
57
|
+
);
|
|
58
|
+
const handleOnClickComposed = import_react.default.useCallback(
|
|
59
|
+
(e) => {
|
|
60
|
+
appPickerOnClick(e);
|
|
61
|
+
triggerOnClick?.(e);
|
|
62
|
+
},
|
|
63
|
+
[appPickerOnClick, triggerOnClick]
|
|
64
|
+
);
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
import_styles.StyledButton,
|
|
67
|
+
{
|
|
68
|
+
id,
|
|
69
|
+
onClick: handleOnClickComposed,
|
|
70
|
+
onKeyDown: appPickerOnKeyDown,
|
|
71
|
+
innerRef: handleTriggerRefs,
|
|
72
|
+
"aria-label": label,
|
|
73
|
+
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON,
|
|
74
|
+
"aria-haspopup": ariaHasPopup,
|
|
75
|
+
...(0, import_ds_props_helpers.getGlobalAttributes)(otherProps),
|
|
76
|
+
...(0, import_ds_props_helpers.getXstyledProps)(otherProps),
|
|
77
|
+
type: "button",
|
|
78
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
79
|
+
getOwnerPropsArguments: () => ({}),
|
|
80
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MenuPicker, { width: 20.73, height: 20.73 })
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=TriggerDefaultComponent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { DSAppPickerT } from '@elliemae/ds-app-picker';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport { getGlobalAttributes, getXstyledProps } from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport React from 'react';\nimport { GLOBAL_HEADER_DATA_TESTID } from '../../../../constants/index.js';\nimport { StyledButton } from '../../../styles.js';\nimport { AppPickerCtx } from './AppPickerCTX.js';\n\n/*\n * The toolbar's default App Picker trigger, as a real component with its own module.\n *\n * MUST be handed to DSAppPicker as `TriggerComponent`, never `renderTrigger`. Two reasons, both hard:\n *\n * 1. This component uses `useContext`. DSAppPicker renders `TriggerComponent` as JSX so React creates a\n * fiber for it, which is what makes hooks here legal. `renderTrigger` is invoked as a plain function\n * (`renderTrigger({ ref })`) to honour the legacy DSPopover render-prop contract, so any hook inside\n * it registers against DSAppPicker's Trigger fiber instead \u2014 a rules-of-hooks violation React cannot\n * detect at runtime.\n * 2. Only `TriggerComponent` receives `dialogLabelId`, the id the panel's `aria-labelledby` points at.\n * It arrives as `id` and is applied below; drop it and the dialog has no accessible name.\n */\nexport const TriggerDefaultComponent = ({\n innerRef,\n id,\n onClick: appPickerOnClick,\n onKeyDown: appPickerOnKeyDown,\n 'aria-haspopup': ariaHasPopup,\n}: DSAppPickerT.TriggerComponentProps): JSX.Element => {\n const { triggerOnClick, setRef, triggerRef, label, otherProps, getOwnerPropsAwareOfPropsPassedToGlobalHeader } =\n React.useContext(AppPickerCtx);\n\n /*\n * Three refs on one node: the toolbar's arrow-key roving registration, a consumer-supplied `triggerRef`,\n * and DSAppPicker's own \u2014 the last is what its focus return targets after a scoped Escape, so dropping\n * `innerRef` here silently strands focus when the panel closes.\n *\n * No focus logic beyond that. Returning focus to this trigger is DSAppPicker's job and it does it, which\n * is only true while this part supplies no `onKeyDown` to it \u2014 see useAppPickerCTX.\n */\n const handleTriggerRefs = React.useCallback(\n (buttonRef: HTMLButtonElement) => {\n setRef(buttonRef);\n mergeRefs(triggerRef, innerRef)(buttonRef);\n },\n [setRef, triggerRef, innerRef],\n );\n\n /*\n * DSAppPicker's `onClick` does the opening AND records whether the activation came from the keyboard\n * (`e.detail === 0`), which is what lets it land focus on the selected app rather than the panel. It must\n * always run.\n *\n * `triggerOnClick` is the consumer's own click callback and runs alongside it. It does not suppress the\n * open: a consumer who needs to own the transition supplies `componentProps.isOpen`, which makes the\n * picker controlled and renders its internal flip inert.\n */\n const handleOnClickComposed = React.useCallback(\n (e: React.MouseEvent | React.KeyboardEvent) => {\n appPickerOnClick(e);\n triggerOnClick?.(e as React.MouseEvent<HTMLButtonElement>);\n },\n [appPickerOnClick, triggerOnClick],\n );\n\n return (\n <StyledButton\n id={id}\n onClick={handleOnClickComposed}\n onKeyDown={appPickerOnKeyDown}\n innerRef={handleTriggerRefs}\n aria-label={label}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON}\n aria-haspopup={ariaHasPopup}\n // No `aria-expanded`, matching DSAppPicker's own trigger. This one opens a `role=\"dialog\"`, and in\n // the dialog pattern the open state is conveyed by the dialog's presence, not by an attribute on the\n // control. The sibling toolbar items DO carry it correctly \u2014 `ds-popup-menu` opens a `role=\"menu\"`\n // and `ds-search-toggle` expands an inline region, which are the patterns the attribute belongs to.\n // Item-level global attributes land here, AFTER the handlers above, so an `onKeyDown` or `onClick`\n // set directly on the toolbar entry replaces the one this trigger wired. That is the documented\n // item-level override and `WithControlledAppPicker` relies on it \u2014 but note what an `onKeyDown`\n // override costs now: it takes over `openAndFocusOnArrowKeys`, so the arrow keys stop opening the\n // picker unless the consumer opens it themselves.\n {...getGlobalAttributes(otherProps)}\n // The part-level xstyled layer, which the contract advertises \u2014 this is the element that serves it.\n {...getXstyledProps(otherProps)}\n type=\"button\"\n // Exposes the dsGlobalheaderMenubarItemButton slot on this trigger. Drop either prop and the slot\n // goes silently inert \u2014 getPartProps returns {} without the lookup table and generates no\n // data-dimsum-slot.\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n // Explicit and empty: no render-time values worth handing to a function-form slot prop. Stated so\n // \"what arguments does this slot get?\" always has a visible answer at the call site.\n getOwnerPropsArguments={() => ({})}\n >\n <MenuPicker width={20.73} height={20.73} />\n </StyledButton>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+FjB;AA9FN,sBAA2B;AAC3B,8BAAqD;AACrD,uBAA0B;AAC1B,mBAAkB;AAClB,uBAA0C;AAC1C,oBAA6B;AAC7B,0BAA6B;AAetB,MAAM,0BAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,WAAW;AAAA,EACX,iBAAiB;AACnB,MAAuD;AACrD,QAAM,EAAE,gBAAgB,QAAQ,YAAY,OAAO,YAAY,8CAA8C,IAC3G,aAAAA,QAAM,WAAW,gCAAY;AAU/B,QAAM,oBAAoB,aAAAA,QAAM;AAAA,IAC9B,CAAC,cAAiC;AAChC,aAAO,SAAS;AAChB,sCAAU,YAAY,QAAQ,EAAE,SAAS;AAAA,IAC3C;AAAA,IACA,CAAC,QAAQ,YAAY,QAAQ;AAAA,EAC/B;AAWA,QAAM,wBAAwB,aAAAA,QAAM;AAAA,IAClC,CAAC,MAA8C;AAC7C,uBAAiB,CAAC;AAClB,uBAAiB,CAAwC;AAAA,IAC3D;AAAA,IACA,CAAC,kBAAkB,cAAc;AAAA,EACnC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAS;AAAA,MACT,WAAW;AAAA,MACX,UAAU;AAAA,MACV,cAAY;AAAA,MACZ,eAAa,2CAA0B;AAAA,MACvC,iBAAe;AAAA,MAUd,OAAG,6CAAoB,UAAU;AAAA,MAEjC,OAAG,yCAAgB,UAAU;AAAA,MAC9B,MAAK;AAAA,MAIL,eAAe;AAAA,MAGf,wBAAwB,OAAO,CAAC;AAAA,MAEhC,sDAAC,8BAAW,OAAO,OAAO,QAAQ,OAAO;AAAA;AAAA,EAC3C;AAEJ;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
AppPickerPropTypes: () => AppPickerPropTypes,
|
|
32
|
+
AppPickerPropTypesSchema: () => AppPickerPropTypesSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
const AppPickerPropTypes = {
|
|
38
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
39
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
40
|
+
label: import_ds_props_helpers.PropTypes.string.description("Accessible name for the trigger button, and the toolbar label").isRequired,
|
|
41
|
+
componentProps: import_ds_props_helpers.PropTypes.object.description(
|
|
42
|
+
"The consumer-authored DSAppPicker configuration; forwarded per DSAppPicker own contract via getDSAppPickerContractProps"
|
|
43
|
+
).isRequired,
|
|
44
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader: import_ds_props_helpers.PropTypes.func.description(
|
|
45
|
+
"Returns the props passed to DSGlobalHeader, so getPartProps can look up this slot consumer-supplied props. Must come from DSGlobalHeader; the function-form hydrator is supplied per slot render site instead"
|
|
46
|
+
).signature("(() => Partial<DSGlobalHeaderT.DefaultProps> )").isRequired,
|
|
47
|
+
setRef: import_ds_props_helpers.PropTypes.func.description("Registers the trigger node with the toolbar focus management for arrow-key navigation").signature("(( ref: HTMLElement ) => void )").isRequired
|
|
48
|
+
};
|
|
49
|
+
const AppPickerPropTypesSchema = AppPickerPropTypes;
|
|
50
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.ts", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\n\n/*\n * Relocated here from DSGlobalHeaderT.AppPickerProps, per the convention every other part in the repo\n * follows. Consumed by useAppPickerCTX / AppPickerCTXRenderer.\n *\n * This namespace describes what DSGlobalHeader passes DOWN to its own out-of-the-box App Picker\n * wrapper. It is NOT the shape an application developer authors \u2014 that is\n * DSGlobalHeaderT.ToolbarAppPickerItem (the toolbar config entry) and, inside it,\n * DSGlobalHeaderT.AppPickerComponentProps. The wrapper is an opinionated pre-configuration that\n * offloads work from the app developer onto Dimsum, so it generates props the developer never sees\n * (`setRef`, `getOwnerPropsAwareOfPropsPassedToGlobalHeader`) and is not meant to know about unless they\n * drop to atomic composition and render DSAppPicker themselves.\n *\n * The three IoC layers an out-of-the-box item is meant to expose are all present here:\n * 1. item-level global attributes, forwarded onto the rendered trigger\n * 2. the slot layer, via `getOwnerPropsAwareOfPropsPassedToGlobalHeader` (parent-owned slots \u2014 see the\n * no-slots note below)\n * 3. `componentProps`, the wrapped component's own contract\n *\n * No slots of its own: every styled element this part renders is declared under the PARENT's name and\n * GLOBAL_HEADER_SLOTS, and those slot values are a published data-dimsum-slot / data-testid surface \u2014\n * re-declaring them here would change them, which the QA stability rule forbids. So, as with\n * ds-data-table-filters' FilterPopover, this file carries no PropsForGlobalOnSlots and no\n * getPropsPerSlotPropTypes. Consumers reach these slots through DSGlobalHeader, where they already do.\n *\n * KNOWN GAP (shared by all four out-of-the-box parts, no decision pending on this file) \u2014 `XstyledProps`\n * is declared below and `xstyledPropTypes` is spread into the schema, but no part forwards xstyled props\n * to any element. Global attributes ARE forwarded, via getGlobalAttributes in TriggerDefaultComponent.\n * The declaration comes from the part-generator template and the FilterPopover precedent; making it true\n * needs a styled target per part, which PopupMenu's bare-<div> root does not currently have.\n */\nexport declare namespace AppPickerT {\n export interface RequiredProps {\n /** Accessible name for the trigger, and the toolbar item's label. */\n label: string;\n /** The consumer-authored configuration object. Forwarded to DSAppPicker by its own contract. */\n componentProps: DSGlobalHeaderT.AppPickerComponentProps;\n /*\n * The slot IoC layer, and the ONLY half of it that may be drilled down.\n *\n * `getPartProps` uses this as the lookup table: it indexes the returned object by the styled\n * element's `data-dimsum-slot` (falling back to `data-testid`) to find the consumer's slot prop.\n * That table can therefore only come from DSGlobalHeader, because only DSGlobalHeader holds the\n * props the consumer passed \u2014 hence the deliberately verbose name. It is also what gates slot\n * generation at all: `styledFunction` sets `didDefinedGetOwnerProps: !!getOwnerProps`, and\n * `getPartProps` short-circuits to `{}` without it.\n *\n * Its former companion `getOwnerPropsArguments` is deliberately NOT here. That one is the hydrator\n * for function-form slot props \u2014 `getPartProps` calls `elementProps(getOwnerPropsArguments())` and\n * uses it for nothing else \u2014 so it must be defined by whichever element is rendering the slot,\n * which is the only place that knows the render-time values worth passing. Bundling the two forced\n * every slot in the package to share one hydrator; see ds-chat-bubble's ChatBubbleArrow and\n * ds-fast-list's List for what per-site hydration is actually for.\n */\n getOwnerPropsAwareOfPropsPassedToGlobalHeader: () => Partial<DSGlobalHeaderT.DefaultProps>;\n /** Focus-management registration, supplied by useGlobalHeaderToolbar for arrow-key navigation. */\n setRef: (ref: HTMLElement) => void;\n }\n\n /*\n * Intentionally empty, and intentionally still declared: `never` is a statement, not an oversight \u2014\n * \"this part has no default props, do not expect them\". Keeping the member present preserves\n * at-a-glance parity with every other part's namespace and makes adding a default a one-line change.\n */\n export interface DefaultProps {}\n\n export interface OptionalProps {}\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n keyof RequiredProps | keyof DefaultProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n keyof RequiredProps | keyof DefaultProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const AppPickerPropTypes: DSPropTypesSchema<AppPickerT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n label: PropTypes.string.description('Accessible name for the trigger button, and the toolbar label').isRequired,\n componentProps: PropTypes.object.description(\n 'The consumer-authored DSAppPicker configuration; forwarded per DSAppPicker own contract via getDSAppPickerContractProps',\n ).isRequired,\n getOwnerPropsAwareOfPropsPassedToGlobalHeader: PropTypes.func\n .description(\n 'Returns the props passed to DSGlobalHeader, so getPartProps can look up this slot consumer-supplied props. Must come from DSGlobalHeader; the function-form hydrator is supplied per slot render site instead',\n )\n .signature('(() => Partial<DSGlobalHeaderT.DefaultProps> )').isRequired,\n setRef: PropTypes.func\n .description('Registers the trigger node with the toolbar focus management for arrow-key navigation')\n .signature('(( ref: HTMLElement ) => void )').isRequired,\n};\n\nexport const AppPickerPropTypesSchema = AppPickerPropTypes as unknown as ValidationMap<AppPickerT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;AA+FhE,MAAM,qBAA0D;AAAA,EACrE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO,kCAAU,OAAO,YAAY,+DAA+D,EAAE;AAAA,EACrG,gBAAgB,kCAAU,OAAO;AAAA,IAC/B;AAAA,EACF,EAAE;AAAA,EACF,+CAA+C,kCAAU,KACtD;AAAA,IACC;AAAA,EACF,EACC,UAAU,gDAAgD,EAAE;AAAA,EAC/D,QAAQ,kCAAU,KACf,YAAY,uFAAuF,EACnG,UAAU,iCAAiC,EAAE;AAClD;AAEO,MAAM,2BAA2B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useAppPickerCTX_exports = {};
|
|
30
|
+
__export(useAppPickerCTX_exports, {
|
|
31
|
+
useAppPickerCTX: () => useAppPickerCTX
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useAppPickerCTX_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_app_picker = require("@elliemae/ds-app-picker");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
const useAppPickerCTX = (config) => {
|
|
38
|
+
const { label, componentProps, getOwnerPropsAwareOfPropsPassedToGlobalHeader, setRef, ...otherProps } = config;
|
|
39
|
+
const { triggerRef, triggerOnClick } = componentProps;
|
|
40
|
+
const contractProps = import_react.default.useMemo(() => (0, import_ds_app_picker.getDSAppPickerContractProps)(componentProps), [componentProps]);
|
|
41
|
+
return import_react.default.useMemo(
|
|
42
|
+
() => ({
|
|
43
|
+
label,
|
|
44
|
+
componentProps,
|
|
45
|
+
otherProps,
|
|
46
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
47
|
+
setRef,
|
|
48
|
+
contractProps,
|
|
49
|
+
triggerRef,
|
|
50
|
+
triggerOnClick
|
|
51
|
+
}),
|
|
52
|
+
[
|
|
53
|
+
label,
|
|
54
|
+
componentProps,
|
|
55
|
+
otherProps,
|
|
56
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
57
|
+
setRef,
|
|
58
|
+
contractProps,
|
|
59
|
+
triggerRef,
|
|
60
|
+
triggerOnClick
|
|
61
|
+
]
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=useAppPickerCTX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { getDSAppPickerContractProps } from '@elliemae/ds-app-picker';\nimport React from 'react';\nimport type { AppPickerT } from './react-desc-prop-types.js';\n\n/*\n * This part owns NO open/close state, and that is deliberate.\n *\n * DSAppPicker owns the whole flow: its trigger click toggles the panel, `openAndFocusOnArrowKeys` gives\n * it ArrowDown/ArrowUp, a scoped Escape closes it and returns focus to the trigger, and a click outside\n * closes it. Lifting `isOpen` into this part would make the picker CONTROLLED, which switches every one\n * of those off \u2014 they would then have to be reimplemented here, against a component that already has\n * them and is tested for them.\n *\n * Two knock-on effects, worth knowing before adding state back:\n * - there is no `aria-expanded` on this item's trigger, so no open state is needed to feed one. The\n * picker opens a `role=\"dialog\"`, and that pattern conveys open state by the dialog's presence. The\n * sibling items keep the attribute because a menu and a disclosure region are what it is for.\n * - supplying `onKeyDown` to DSAppPicker sets `closeOnEscape: !onKeyDown`, i.e. it switches OFF the\n * picker's Escape routing AND its focus return. That is why this part supplies none, and why it needs\n * no focus tracker of its own.\n *\n * A consumer can still drive it: `componentProps.isOpen` reaches DSAppPicker through the contract\n * passthrough and makes it controlled for them, which is the supported way to own the transition.\n */\nexport const useAppPickerCTX = (config: AppPickerT.Props) => {\n // Read by name: only what this part needs for its own behaviour. `otherProps` is the item-level global\n // attributes, which reach the trigger via getGlobalAttributes. Everything a consumer put in\n // `componentProps` reaches DSAppPicker through `contractProps` instead \u2014 do not cherry-pick from\n // componentProps here, that is what the contract filter is for.\n const { label, componentProps, getOwnerPropsAwareOfPropsPassedToGlobalHeader, setRef, ...otherProps } = config;\n const { triggerRef, triggerOnClick } = componentProps;\n\n // `componentProps` is declared as DSAppPicker's own props plus this part's `triggerOnClick`, so every\n // DSAppPicker prop a consumer puts there is part of the contract \u2014 including all nine slot props.\n // Deriving the forwardable set from DSAppPicker's own contract is what keeps the two from drifting, and\n // it strips the one key in that object that belongs to this part rather than to DSAppPicker:\n // `triggerOnClick`. (`setRef` is a sibling field of `componentProps`, not inside it, so it never\n // reaches the filter.)\n const contractProps = React.useMemo(() => getDSAppPickerContractProps(componentProps), [componentProps]);\n\n return React.useMemo(\n () => ({\n label,\n componentProps,\n otherProps,\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n setRef,\n contractProps,\n triggerRef,\n triggerOnClick,\n }),\n [\n label,\n componentProps,\n otherProps,\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n setRef,\n contractProps,\n triggerRef,\n triggerOnClick,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAA4C;AAC5C,mBAAkB;AAuBX,MAAM,kBAAkB,CAAC,WAA6B;AAK3D,QAAM,EAAE,OAAO,gBAAgB,+CAA+C,QAAQ,GAAG,WAAW,IAAI;AACxG,QAAM,EAAE,YAAY,eAAe,IAAI;AAQvC,QAAM,gBAAgB,aAAAA,QAAM,QAAQ,UAAM,kDAA4B,cAAc,GAAG,CAAC,cAAc,CAAC;AAEvG,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -38,13 +38,14 @@ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
|
38
38
|
var import_react = require("react");
|
|
39
39
|
var import_constants = require("../../../../constants/index.js");
|
|
40
40
|
var import_styles = require("../../../styles.js");
|
|
41
|
+
var import_styles2 = require("../../styles.js");
|
|
41
42
|
var import_PopupMenuContent = require("./menuContent/PopupMenuContent.js");
|
|
42
43
|
const PopupMenu = ({
|
|
43
44
|
Icon,
|
|
44
45
|
onClick,
|
|
45
46
|
setRef,
|
|
46
47
|
componentProps,
|
|
47
|
-
|
|
48
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
48
49
|
...otherProps
|
|
49
50
|
}) => {
|
|
50
51
|
const {
|
|
@@ -53,7 +54,9 @@ const PopupMenu = ({
|
|
|
53
54
|
popupOnKeyPress,
|
|
54
55
|
isOpen: userIsOpen,
|
|
55
56
|
options,
|
|
56
|
-
closeOnClick
|
|
57
|
+
closeOnClick,
|
|
58
|
+
onOpen,
|
|
59
|
+
onClose
|
|
57
60
|
} = componentProps;
|
|
58
61
|
const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = (0, import_ds_floating_context.useFloatingContext)({
|
|
59
62
|
externallyControlledIsOpen: componentProps.isOpen,
|
|
@@ -65,29 +68,66 @@ const PopupMenu = ({
|
|
|
65
68
|
// Gated internally on `isOpen`, so it only fires while open.
|
|
66
69
|
onClickOutside: (event) => {
|
|
67
70
|
onClickOutside(event);
|
|
68
|
-
if (userIsOpen === void 0)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
if (userIsOpen === void 0) hideTooltip();
|
|
72
|
+
},
|
|
73
|
+
/*
|
|
74
|
+
* Passive notification, straight through from the floating context. Handed over rather than
|
|
75
|
+
* reimplemented because the hook is the only place that sees every transition: the trigger click and
|
|
76
|
+
* ArrowDown both go through `showTooltip`, and click-outside, Escape inside the menu and a
|
|
77
|
+
* closeOnClick item all go through `hideTooltip` — plus a controlled flip of `isOpen`, which no
|
|
78
|
+
* handler in this file observes at all.
|
|
79
|
+
*
|
|
80
|
+
* Notifying does NOT make the consumer responsible for the transition: this stays uncontrolled unless
|
|
81
|
+
* they also supply `isOpen`.
|
|
82
|
+
*
|
|
83
|
+
* The scoped-Escape caveat in the hook's docs does not apply here. A scoped Escape would route to
|
|
84
|
+
* `onEscape` instead of `onClose`, but that path needs `closeOnEscape`, which defaults to false and is
|
|
85
|
+
* not passed — Escape is handled inside PopupMenuContent and closes via `hideTooltip`, so it surfaces
|
|
86
|
+
* as a normal 'interaction' close. Passing `closeOnEscape` here later would silently punch a hole in
|
|
87
|
+
* `onClose` unless `onEscape` is wired at the same time.
|
|
88
|
+
*/
|
|
89
|
+
/*
|
|
90
|
+
* Escape is the floating context's, not this part's. `closeOnEscape` closes the menu and
|
|
91
|
+
* `returnFocusToReference` puts focus back on the trigger — both were hand-rolled here before, in
|
|
92
|
+
* PopupMenuContent's per-item keydown and in a manual `.focus()`.
|
|
93
|
+
*
|
|
94
|
+
* Gated on being UNCONTROLLED, and that gate is load-bearing rather than tidy: the hook applies
|
|
95
|
+
* `returnFocusToReference` on a scoped Escape whichever side owns the open state. For a controlled
|
|
96
|
+
* consumer the close below is inert, so leaving it on would move focus to the trigger while their
|
|
97
|
+
* menu is still open — focus outside an open menu. A controlled consumer owns the close, so they own
|
|
98
|
+
* the Escape and the refocus with it.
|
|
99
|
+
*/
|
|
100
|
+
closeOnEscape: userIsOpen === void 0,
|
|
101
|
+
returnFocusToReference: true,
|
|
102
|
+
/*
|
|
103
|
+
* A scoped Escape routes HERE and not to `onClose`, so the consumer's close notification has to be
|
|
104
|
+
* re-emitted or it silently stops reporting the most common keyboard close.
|
|
105
|
+
*/
|
|
106
|
+
onEscape: (event) => {
|
|
107
|
+
hideTooltip();
|
|
108
|
+
onClose?.({ reason: "interaction", event, isControlled: userIsOpen !== void 0 });
|
|
109
|
+
},
|
|
110
|
+
onOpen,
|
|
111
|
+
onClose
|
|
73
112
|
});
|
|
113
|
+
const openIntentRef = (0, import_react.useRef)("first");
|
|
74
114
|
const handleOnKeyDown = (0, import_react.useCallback)(
|
|
75
115
|
(e) => {
|
|
76
|
-
if (e.code === "ArrowDown") {
|
|
77
|
-
|
|
116
|
+
if (e.code === "ArrowDown" || e.code === "ArrowUp") {
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
openIntentRef.current = e.code === "ArrowUp" ? "last" : "first";
|
|
119
|
+
if (userIsOpen === void 0) showTooltip();
|
|
78
120
|
}
|
|
79
121
|
if (onKeyPress) onKeyPress(e);
|
|
80
122
|
},
|
|
81
|
-
[onKeyPress, showTooltip]
|
|
123
|
+
[onKeyPress, showTooltip, userIsOpen]
|
|
82
124
|
);
|
|
83
125
|
const handleOnClose = (0, import_react.useCallback)(() => {
|
|
84
|
-
if (userIsOpen === void 0)
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
refs.reference?.focus();
|
|
88
|
-
}, [hideTooltip, refs.reference, userIsOpen]);
|
|
126
|
+
if (userIsOpen === void 0) hideTooltip();
|
|
127
|
+
}, [hideTooltip, userIsOpen]);
|
|
89
128
|
const handleTriggerOnClick = (0, import_react.useCallback)(
|
|
90
129
|
(e) => {
|
|
130
|
+
openIntentRef.current = "first";
|
|
91
131
|
if (userIsOpen === void 0) showTooltip(e);
|
|
92
132
|
if (onClick) onClick(e);
|
|
93
133
|
},
|
|
@@ -103,45 +143,56 @@ const PopupMenu = ({
|
|
|
103
143
|
},
|
|
104
144
|
[refs, setRef]
|
|
105
145
|
);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
const noSlotArguments = (0, import_react.useCallback)(() => ({}), []);
|
|
147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
148
|
+
import_styles2.StyledPopupMenuContainer,
|
|
149
|
+
{
|
|
150
|
+
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_POPUPMENU_CONTAINER,
|
|
151
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
152
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
153
|
+
...(0, import_ds_props_helpers.useGetXstyledProps)(otherProps),
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
156
|
+
import_styles.StyledButton,
|
|
157
|
+
{
|
|
158
|
+
onClick: handleTriggerOnClick,
|
|
159
|
+
onKeyDown: handleOnKeyDown,
|
|
160
|
+
innerRef: handleRefs,
|
|
161
|
+
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON,
|
|
162
|
+
"aria-haspopup": true,
|
|
163
|
+
"aria-expanded": userIsOpen ?? isOpen,
|
|
164
|
+
...(0, import_ds_props_helpers.useGetGlobalAttributes)(otherProps),
|
|
165
|
+
type: "button",
|
|
166
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
167
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
168
|
+
children: Icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: "m" })
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
refs.reference ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
172
|
+
import_ds_floating_context.FloatingWrapper,
|
|
173
|
+
{
|
|
174
|
+
innerRef: refs.setFloating,
|
|
175
|
+
isOpen: userIsOpen ?? isOpen,
|
|
176
|
+
floatingStyles,
|
|
177
|
+
context,
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
180
|
+
import_PopupMenuContent.PopupMenuContent,
|
|
181
|
+
{
|
|
182
|
+
options,
|
|
183
|
+
onItemClick: handleItemClick,
|
|
184
|
+
openIntent: openIntentRef.current,
|
|
185
|
+
setIsOpen: hideTooltip,
|
|
186
|
+
popupOnKeyPress,
|
|
187
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_floating_context.PopoverArrow, { ...arrowStyles })
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
) : null
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
);
|
|
146
197
|
};
|
|
147
198
|
//# sourceMappingURL=PopupMenu.js.map
|