@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
|
@@ -53,7 +53,20 @@ const DSGlobalHeader = (props) => {
|
|
|
53
53
|
const ctx = (0, import_useGlobalHeader.useGlobalHeader)(props);
|
|
54
54
|
const {
|
|
55
55
|
props: { toolbar },
|
|
56
|
-
|
|
56
|
+
/*
|
|
57
|
+
* The slot layer, split into its two genuinely separate halves.
|
|
58
|
+
*
|
|
59
|
+
* `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's
|
|
60
|
+
* slot prop, so it can only come from DSGlobalHeader — that is what the verbose drilled name says out
|
|
61
|
+
* loud when it reaches the out-of-the-box parts.
|
|
62
|
+
*
|
|
63
|
+
* `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,
|
|
64
|
+
* so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's
|
|
65
|
+
* own elements have render-time values worth passing. Stated rather than omitted, so "what arguments
|
|
66
|
+
* does this slot get?" always has a visible answer.
|
|
67
|
+
*/
|
|
68
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
69
|
+
noSlotArguments,
|
|
57
70
|
fontDetector
|
|
58
71
|
} = ctx;
|
|
59
72
|
const propsWithDefaults = ctx.props;
|
|
@@ -86,7 +99,8 @@ const DSGlobalHeader = (props) => {
|
|
|
86
99
|
{
|
|
87
100
|
...globalAttrs,
|
|
88
101
|
...xstyledAttrs,
|
|
89
|
-
|
|
102
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
103
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
90
104
|
forwardedAs: "header",
|
|
91
105
|
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.CONTAINER,
|
|
92
106
|
cols: cols2,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSGlobalHeader.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { type DSGridT, Grid } from '@elliemae/ds-grid';\nimport { describe, useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetLayoutMode } from '@elliemae/ds-system';\nimport { useMemo } from 'react';\nimport { DSGlobalHeaderContext } from './DSGlobalHeaderContext.js';\nimport { useGlobalHeader } from './config/useGlobalHeader.js';\nimport { useValidateProps } from './config/useValidateProps.js';\nimport { DSGlobalHeaderName, FONT_DETECTOR, GLOBAL_HEADER_DATA_TESTID } from './constants/index.js';\nimport { GlobalHeaderBreadcrumb } from './parts/Breadcrumb/GlobalHeaderBreadcrumb.js';\nimport { GlobalHeaderLogo } from './parts/Logo/GlobalHeaderLogo.js';\nimport { GlobalHeaderToolbar } from './parts/Toolbar/GlobalHeaderToolbar.js';\nimport { Container } from './parts/styles.js';\nimport { DSGlobalHeaderPropTypesSchema, type DSGlobalHeaderT } from './react-desc-prop-types.js';\n\nconst DSGlobalHeader = (props: DSGlobalHeaderT.Props): JSX.Element => {\n useValidateProps(props);\n const ctx = useGlobalHeader(props);\n const {\n props: { toolbar },\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { type DSGridT, Grid } from '@elliemae/ds-grid';\nimport { describe, useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetLayoutMode } from '@elliemae/ds-system';\nimport { useMemo } from 'react';\nimport { DSGlobalHeaderContext } from './DSGlobalHeaderContext.js';\nimport { useGlobalHeader } from './config/useGlobalHeader.js';\nimport { useValidateProps } from './config/useValidateProps.js';\nimport { DSGlobalHeaderName, FONT_DETECTOR, GLOBAL_HEADER_DATA_TESTID } from './constants/index.js';\nimport { GlobalHeaderBreadcrumb } from './parts/Breadcrumb/GlobalHeaderBreadcrumb.js';\nimport { GlobalHeaderLogo } from './parts/Logo/GlobalHeaderLogo.js';\nimport { GlobalHeaderToolbar } from './parts/Toolbar/GlobalHeaderToolbar.js';\nimport { Container } from './parts/styles.js';\nimport { DSGlobalHeaderPropTypesSchema, type DSGlobalHeaderT } from './react-desc-prop-types.js';\n\nconst DSGlobalHeader = (props: DSGlobalHeaderT.Props): JSX.Element => {\n useValidateProps(props);\n const ctx = useGlobalHeader(props);\n const {\n props: { toolbar },\n /*\n * The slot layer, split into its two genuinely separate halves.\n *\n * `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's\n * slot prop, so it can only come from DSGlobalHeader \u2014 that is what the verbose drilled name says out\n * loud when it reaches the out-of-the-box parts.\n *\n * `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,\n * so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's\n * own elements have render-time values worth passing. Stated rather than omitted, so \"what arguments\n * does this slot get?\" always has a visible answer.\n */\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n noSlotArguments,\n fontDetector,\n } = ctx;\n const propsWithDefaults = ctx.props;\n const globalAttrs = useGetGlobalAttributes<DSGlobalHeaderT.Props, HTMLDivElement, DSGridT.Props>(propsWithDefaults);\n const xstyledAttrs = useGetXstyledProps(propsWithDefaults);\n const layoutMode = useGetLayoutMode();\n\n const cols2 = useMemo(() => {\n if (['l'].includes(layoutMode!)) {\n return ['1fr', 'auto'];\n }\n if (['m', 's'].includes(layoutMode!)) {\n return ['1fr'];\n }\n if (['xs'].includes(layoutMode!)) {\n return ['auto'];\n }\n if (fontDetector > FONT_DETECTOR.SMALL) {\n return ['auto', '1fr'];\n }\n return ['1fr', 'auto'];\n }, [fontDetector, layoutMode]);\n\n const cols = useMemo(() => {\n if (['xs'].includes(layoutMode!)) {\n return ['auto'];\n }\n return ['auto', '1fr'];\n }, [layoutMode]);\n\n return (\n <Container\n {...globalAttrs}\n {...xstyledAttrs}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n forwardedAs=\"header\"\n data-testid={GLOBAL_HEADER_DATA_TESTID.CONTAINER}\n cols={cols2}\n >\n <DSGlobalHeaderContext.Provider value={ctx}>\n <Grid cols={cols}>\n <GlobalHeaderLogo />\n <GlobalHeaderBreadcrumb />\n </Grid>\n {toolbar.length ? <GlobalHeaderToolbar /> : null}\n </DSGlobalHeaderContext.Provider>\n </Container>\n );\n};\n\nDSGlobalHeader.displayName = DSGlobalHeaderName;\nconst DSGlobalHeaderWithSchema = describe(DSGlobalHeader).description('DSGlobalHeader');\nDSGlobalHeaderWithSchema.propTypes = DSGlobalHeaderPropTypesSchema;\n\nconst GlobalHeader = DSGlobalHeader;\n\nexport { DSGlobalHeader, DSGlobalHeaderWithSchema, GlobalHeader };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0Ef;AA1ER,qBAAmC;AACnC,8BAAqE;AACrE,uBAAiC;AACjC,mBAAwB;AACxB,mCAAsC;AACtC,6BAAgC;AAChC,8BAAiC;AACjC,uBAA6E;AAC7E,oCAAuC;AACvC,8BAAiC;AACjC,iCAAoC;AACpC,oBAA0B;AAC1B,mCAAoE;AAEpE,MAAM,iBAAiB,CAAC,UAA8C;AACpE,gDAAiB,KAAK;AACtB,QAAM,UAAM,wCAAgB,KAAK;AACjC,QAAM;AAAA,IACJ,OAAO,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAajB;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,oBAAoB,IAAI;AAC9B,QAAM,kBAAc,gDAA6E,iBAAiB;AAClH,QAAM,mBAAe,4CAAmB,iBAAiB;AACzD,QAAM,iBAAa,mCAAiB;AAEpC,QAAM,YAAQ,sBAAQ,MAAM;AAC1B,QAAI,CAAC,GAAG,EAAE,SAAS,UAAW,GAAG;AAC/B,aAAO,CAAC,OAAO,MAAM;AAAA,IACvB;AACA,QAAI,CAAC,KAAK,GAAG,EAAE,SAAS,UAAW,GAAG;AACpC,aAAO,CAAC,KAAK;AAAA,IACf;AACA,QAAI,CAAC,IAAI,EAAE,SAAS,UAAW,GAAG;AAChC,aAAO,CAAC,MAAM;AAAA,IAChB;AACA,QAAI,eAAe,+BAAc,OAAO;AACtC,aAAO,CAAC,QAAQ,KAAK;AAAA,IACvB;AACA,WAAO,CAAC,OAAO,MAAM;AAAA,EACvB,GAAG,CAAC,cAAc,UAAU,CAAC;AAE7B,QAAM,WAAO,sBAAQ,MAAM;AACzB,QAAI,CAAC,IAAI,EAAE,SAAS,UAAW,GAAG;AAChC,aAAO,CAAC,MAAM;AAAA,IAChB;AACA,WAAO,CAAC,QAAQ,KAAK;AAAA,EACvB,GAAG,CAAC,UAAU,CAAC;AAEf,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,eAAe;AAAA,MACf,wBAAwB;AAAA,MACxB,aAAY;AAAA,MACZ,eAAa,2CAA0B;AAAA,MACvC,MAAM;AAAA,MAEN,uDAAC,mDAAsB,UAAtB,EAA+B,OAAO,KACrC;AAAA,qDAAC,uBAAK,MACJ;AAAA,sDAAC,4CAAiB;AAAA,UAClB,4CAAC,wDAAuB;AAAA,WAC1B;AAAA,QACC,QAAQ,SAAS,4CAAC,kDAAoB,IAAK;AAAA,SAC9C;AAAA;AAAA,EACF;AAEJ;AAEA,eAAe,cAAc;AAC7B,MAAM,+BAA2B,kCAAS,cAAc,EAAE,YAAY,gBAAgB;AACtF,yBAAyB,YAAY;AAErC,MAAM,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSGlobalHeaderContext.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { createContext } from 'react';\nimport type {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,iBAAiB,CAAC;AAEjB,MAAM,4BAAwB,
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react';\nimport type { GlobalHeaderCTX } from './config/useGlobalHeader.js';\n\nconst defaultContext = {} as GlobalHeaderCTX;\n\nexport const DSGlobalHeaderContext = createContext<GlobalHeaderCTX>(defaultContext);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,iBAAiB,CAAC;AAEjB,MAAM,4BAAwB,4BAA+B,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -47,6 +47,8 @@ const useGlobalHeader = (props) => {
|
|
|
47
47
|
[propsWithDefaults.toolbar]
|
|
48
48
|
);
|
|
49
49
|
const ownerProps = (0, import_ds_props_helpers.useOwnerProps)(props);
|
|
50
|
+
const getOwnerPropsAwareOfPropsPassedToGlobalHeader = ownerProps.getOwnerProps;
|
|
51
|
+
const noSlotArguments = ownerProps.getOwnerPropsArguments;
|
|
50
52
|
const fontDetector = (0, import_ds_hooks_fontsize_media.useFontsizeMedia)({
|
|
51
53
|
largeFont: import_constants.FONT_DETECTOR.LARGE,
|
|
52
54
|
mediumFont: import_constants.FONT_DETECTOR.MEDIUM,
|
|
@@ -60,9 +62,18 @@ const useGlobalHeader = (props) => {
|
|
|
60
62
|
instanceUID,
|
|
61
63
|
globalHeaderToolbarGrid,
|
|
62
64
|
fontDetector,
|
|
63
|
-
|
|
65
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
66
|
+
noSlotArguments
|
|
64
67
|
}),
|
|
65
|
-
[
|
|
68
|
+
[
|
|
69
|
+
propsWithDefaults,
|
|
70
|
+
showIconOnly,
|
|
71
|
+
instanceUID,
|
|
72
|
+
globalHeaderToolbarGrid,
|
|
73
|
+
fontDetector,
|
|
74
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
75
|
+
noSlotArguments
|
|
76
|
+
]
|
|
66
77
|
);
|
|
67
78
|
};
|
|
68
79
|
//# sourceMappingURL=useGlobalHeader.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGlobalHeader.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport { useMemoMergePropsWithDefault, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { useMemo, useState } from 'react';\nimport { uid } from 'uid';\nimport { defaultProps, type DSGlobalHeaderT } from '../react-desc-prop-types.js';\nimport { FONT_DETECTOR } from '../constants/index.js';\n\nexport const useGlobalHeader = (props: DSGlobalHeaderT.Props) => {\n const [showIconOnly, setShowIconOnly] = useState<boolean>(false);\n\n const propsWithDefaults = useMemoMergePropsWithDefault<DSGlobalHeaderT.InternalProps>(props, defaultProps);\n\n const instanceUID = useMemo(() => `ds-global-header-${uid(5)}`, []);\n\n const globalHeaderToolbarGrid = useMemo(\n () => new Array(propsWithDefaults.toolbar.length).fill('auto') as string[],\n [propsWithDefaults.toolbar],\n );\n\n const ownerProps = useOwnerProps(props);\n\n const fontDetector = useFontsizeMedia({\n largeFont: FONT_DETECTOR.LARGE,\n mediumFont: FONT_DETECTOR.MEDIUM,\n smallFont: FONT_DETECTOR.SMALL,\n });\n\n return useMemo(\n () => ({\n props: propsWithDefaults,\n showIconOnly,\n setShowIconOnly,\n instanceUID,\n globalHeaderToolbarGrid,\n fontDetector,\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qCAAiC;AACjC,8BAA4D;AAC5D,mBAAkC;AAClC,iBAAoB;AACpB,mCAAmD;AACnD,uBAA8B;AAEvB,MAAM,kBAAkB,CAAC,UAAiC;AAC/D,QAAM,CAAC,cAAc,eAAe,QAAI,uBAAkB,KAAK;AAE/D,QAAM,wBAAoB,sDAA4D,OAAO,yCAAY;AAEzG,QAAM,kBAAc,sBAAQ,MAAM,wBAAoB,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAElE,QAAM,8BAA0B;AAAA,IAC9B,MAAM,IAAI,MAAM,kBAAkB,QAAQ,MAAM,EAAE,KAAK,MAAM;AAAA,IAC7D,CAAC,kBAAkB,OAAO;AAAA,EAC5B;AAEA,QAAM,iBAAa,uCAAc,KAAK;AAEtC,QAAM,mBAAe,iDAAiB;AAAA,IACpC,WAAW,+BAAc;AAAA,IACzB,YAAY,+BAAc;AAAA,IAC1B,WAAW,+BAAc;AAAA,EAC3B,CAAC;AAED,aAAO;AAAA,IACL,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,
|
|
4
|
+
"sourcesContent": ["import { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport { useMemoMergePropsWithDefault, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { useMemo, useState } from 'react';\nimport { uid } from 'uid';\nimport { defaultProps, type DSGlobalHeaderT } from '../react-desc-prop-types.js';\nimport { FONT_DETECTOR } from '../constants/index.js';\n\nexport const useGlobalHeader = (props: DSGlobalHeaderT.Props) => {\n const [showIconOnly, setShowIconOnly] = useState<boolean>(false);\n\n const propsWithDefaults = useMemoMergePropsWithDefault<DSGlobalHeaderT.InternalProps>(props, defaultProps);\n\n const instanceUID = useMemo(() => `ds-global-header-${uid(5)}`, []);\n\n const globalHeaderToolbarGrid = useMemo(\n () => new Array(propsWithDefaults.toolbar.length).fill('auto') as string[],\n [propsWithDefaults.toolbar],\n );\n\n const ownerProps = useOwnerProps(props);\n\n const getOwnerPropsAwareOfPropsPassedToGlobalHeader = ownerProps.getOwnerProps;\n const noSlotArguments = ownerProps.getOwnerPropsArguments;\n\n const fontDetector = useFontsizeMedia({\n largeFont: FONT_DETECTOR.LARGE,\n mediumFont: FONT_DETECTOR.MEDIUM,\n smallFont: FONT_DETECTOR.SMALL,\n });\n\n return useMemo(\n () => ({\n props: propsWithDefaults,\n showIconOnly,\n setShowIconOnly,\n instanceUID,\n globalHeaderToolbarGrid,\n fontDetector,\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n noSlotArguments,\n }),\n [\n propsWithDefaults,\n showIconOnly,\n instanceUID,\n globalHeaderToolbarGrid,\n fontDetector,\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n noSlotArguments,\n ],\n );\n};\n\nexport type GlobalHeaderCTX = ReturnType<typeof useGlobalHeader>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qCAAiC;AACjC,8BAA4D;AAC5D,mBAAkC;AAClC,iBAAoB;AACpB,mCAAmD;AACnD,uBAA8B;AAEvB,MAAM,kBAAkB,CAAC,UAAiC;AAC/D,QAAM,CAAC,cAAc,eAAe,QAAI,uBAAkB,KAAK;AAE/D,QAAM,wBAAoB,sDAA4D,OAAO,yCAAY;AAEzG,QAAM,kBAAc,sBAAQ,MAAM,wBAAoB,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAElE,QAAM,8BAA0B;AAAA,IAC9B,MAAM,IAAI,MAAM,kBAAkB,QAAQ,MAAM,EAAE,KAAK,MAAM;AAAA,IAC7D,CAAC,kBAAkB,OAAO;AAAA,EAC5B;AAEA,QAAM,iBAAa,uCAAc,KAAK;AAEtC,QAAM,gDAAgD,WAAW;AACjE,QAAM,kBAAkB,WAAW;AAEnC,QAAM,mBAAe,iDAAiB;AAAA,IACpC,WAAW,+BAAc;AAAA,IACzB,YAAY,+BAAc;AAAA,IAC1B,WAAW,+BAAc;AAAA,EAC3B,CAAC;AAED,aAAO;AAAA,IACL,OAAO;AAAA,MACL,OAAO;AAAA,MACP;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,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -121,7 +121,6 @@ const DSGlobalHeaderDatatestid = {
|
|
|
121
121
|
SEPARATOR: "ds-global-header-menubar-item-popupmenu-separator"
|
|
122
122
|
},
|
|
123
123
|
SEARCH_TOGGLE: {
|
|
124
|
-
CONTAINER: "ds-global-header-menubar-item-searchtoggle-container",
|
|
125
124
|
ITEM_BUTTON: "gh-toolbar-item"
|
|
126
125
|
}
|
|
127
126
|
}
|
|
@@ -145,7 +144,6 @@ const DSGlobalHeaderDatatestidFlattened = {
|
|
|
145
144
|
MENUBAR_POPUP_MENU_ITEM_BUTTON: "ds-global-header-menubar-item-popupmenu-item-button",
|
|
146
145
|
MENUBAR_POPUP_MENU_ITEM_LABEL: "ds-global-header-menubar-item-popupmenu-item-label",
|
|
147
146
|
MENUBAR_POPUP_MENU_SEPARATOR: "ds-global-header-menubar-item-popupmenu-separator",
|
|
148
|
-
MENUBAR_SEARCH_TOGGLE_CONTAINER: "ds-global-header-menubar-item-searchtoggle-container",
|
|
149
147
|
MENUBAR_SEARCH_TOGGLE_ITEM_BUTTON: "gh-toolbar-item"
|
|
150
148
|
};
|
|
151
149
|
const FONT_DETECTOR = {
|
|
@@ -166,7 +164,10 @@ const GLOBAL_HEADER_SLOTS = {
|
|
|
166
164
|
SEARCH_TOGGLE_SPINBUTTON_NEXT: "searchtoggle-spinbutton-next",
|
|
167
165
|
SEARCH_TOGGLE_TEXTINPUT: "searchtoggle-textinput",
|
|
168
166
|
SEARCH_TOGGLE_TRIGGER_BUTTON: "searchtoggle-trigger-button",
|
|
169
|
-
SEARCH_TOGGLE_EXPANDED_CONTENT_WRAPPER: "searchtoggle-expanded-content-wrapper"
|
|
167
|
+
SEARCH_TOGGLE_EXPANDED_CONTENT_WRAPPER: "searchtoggle-expanded-content-wrapper",
|
|
168
|
+
// The popup menu item's own root — the element consumers target to reach the whole item, and the one
|
|
169
|
+
// that receives its xstyled props. Post-convention slot, so it carries no legacy data-testid override.
|
|
170
|
+
MENUBAR_ITEM_POPUPMENU_CONTAINER: "menubar-item-popupmenu-container"
|
|
170
171
|
};
|
|
171
172
|
const SEARCH_TOGGLE_DEFAULT_ARIA_LABEL = "Search. Press Tab twice to reach the result navigation.";
|
|
172
173
|
const GLOBAL_HEADER_DATA_TESTID = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSGlobalHeaderName = 'DSGlobalheader';\n\n/* ************************************************************************************************\n * LEGACY VARIABLES\n * ************************************************************************************************\n * WE KEEP THIS AROUND TO AVOID BREAKING CHANGES\n * THE NEW VARIABLES INHERIT FROM THIS TO AVOID BREAKING CHANGES!!!\n ************************************************************************************************ */\n\n/**\n * @deprecated - use GLOBAL_HEADER_SLOTS instead, it containse the full list and is flat.\n */\nexport const DSGlobalHeaderSlots = {\n CONTAINER: 'root',\n LOGO: {\n CONTAINER: 'logo-container',\n },\n BREADCRUMB: {\n CONTAINER: 'breadcrumb-container',\n PIPE: 'breadcrumb-pipe',\n CHEVRON: 'breadcrumb-chevron',\n LIST: 'breadcrumb-list',\n ITEM: 'breadcrumb-item',\n ITEM_LINK: 'breadcrumb-item-link',\n ITEM_LINK_LABEL: 'breadcrumb-item-link-label',\n },\n MENUBAR: {\n CONTAINER: 'menubar-container',\n LIST: 'menubar-list',\n ITEM: 'menubar-item',\n ITEM_BUTTON: 'menubar-item-button',\n POPUP_MENU: {\n LIST: 'menubar-item-popupmenu-list',\n ITEM: 'menubar-item-popupmenu-item',\n ITEM_BUTTON: 'menubar-item-popupmenu-item-button',\n SEPARATOR: 'menubar-item-popupmenu-separator',\n ITEM_BUTTON_LABEL: 'menubar-item-popupmenu-item-label',\n },\n SEARCH_TOGGLE: {\n CONTAINER: 'menubar-item-searchtoggle-container',\n },\n },\n};\n/**\n * @deprecated - use GLOBAL_HEADER_SLOTS instead, it containse the full list.\n */\nexport const DSGlobalHeaderSlotsFlattened = {\n CONTAINER: DSGlobalHeaderSlots.CONTAINER,\n LOGO_CONTAINER: DSGlobalHeaderSlots.LOGO.CONTAINER,\n BREADCRUMB_CONTAINER: DSGlobalHeaderSlots.BREADCRUMB.CONTAINER,\n BREADCRUMB_PIPE: DSGlobalHeaderSlots.BREADCRUMB.PIPE,\n BREADCRUMB_CHEVRON: DSGlobalHeaderSlots.BREADCRUMB.CHEVRON,\n BREADCRUMB_LIST: DSGlobalHeaderSlots.BREADCRUMB.LIST,\n BREADCRUMB_ITEM: DSGlobalHeaderSlots.BREADCRUMB.ITEM,\n BREADCRUMB_ITEM_LINK: DSGlobalHeaderSlots.BREADCRUMB.ITEM_LINK,\n BREADCRUMB_ITEM_LINK_LABEL: DSGlobalHeaderSlots.BREADCRUMB.ITEM_LINK_LABEL,\n MENUBAR_CONTAINER: DSGlobalHeaderSlots.MENUBAR.CONTAINER,\n MENUBAR_LIST: DSGlobalHeaderSlots.MENUBAR.LIST,\n MENUBAR_ITEM: DSGlobalHeaderSlots.MENUBAR.ITEM,\n MENUBAR_ITEM_BUTTON: DSGlobalHeaderSlots.MENUBAR.ITEM_BUTTON,\n MENUBAR_POPUP_MENU_LIST: DSGlobalHeaderSlots.MENUBAR.POPUP_MENU.LIST,\n MENUBAR_POPUP_MENU_ITEM: DSGlobalHeaderSlots.MENUBAR.POPUP_MENU.ITEM,\n MENUBAR_POPUP_MENU_ITEM_BUTTON: DSGlobalHeaderSlots.MENUBAR.POPUP_MENU.ITEM_BUTTON,\n MENUBAR_POPUP_MENU_SEPARATOR: DSGlobalHeaderSlots.MENUBAR.POPUP_MENU.SEPARATOR,\n MENUBAR_POPUP_MENU_ITEM_BUTTON_LABEL: DSGlobalHeaderSlots.MENUBAR.POPUP_MENU.ITEM_BUTTON_LABEL,\n MENUBAR_SEARCH_TOGGLE_CONTAINER: DSGlobalHeaderSlots.MENUBAR.SEARCH_TOGGLE.CONTAINER,\n};\n// maintain the same order as the original object\n// for slots showcase purpose\n/**\n * @deprecated - use GLOBAL_HEADER_DATA_TESTID instead, it containse the full list and is flat.\n */\nexport const DSGlobalHeaderDatatestid = {\n CONTAINER: 'ds-global-header',\n LOGO: {\n CONTAINER: 'ds-global-header-logo-container',\n },\n BREADCRUMB: {\n CHEVRON: 'ds-globalheader-breadcrumb-chevron',\n CONTAINER: 'ds-global-header-breadcrumb-container',\n PIPE: 'ds-global-header-breadcrumb-pipe',\n LIST: 'ds-global-header-breadcrumb-list',\n ITEM: 'ds-global-header-breadcrumb-item',\n ITEM_LINK: 'gh-breadcrumb-btn',\n ITEM_LINK_LABEL: 'ds-global-header-breadcrumb-item-link-label',\n },\n MENUBAR: {\n CONTAINER: 'ds-global-header-menubar-container',\n LIST: 'ds-global-header-menubar-list',\n ITEM: 'ds-global-header-menubar-item',\n ITEM_BUTTON: 'gh-toolbar-item',\n POPUP_MENU: {\n LIST: 'ds-global-header-menubar-item-popupmenu-list',\n ITEM: 'ds-global-header-menubar-item-popupmenu-item',\n ITEM_BUTTON: 'ds-global-header-menubar-item-popupmenu-item-button',\n ITEM_BUTTON_LABEL: 'ds-global-header-menubar-item-popupmenu-item-label',\n SEPARATOR: 'ds-global-header-menubar-item-popupmenu-separator',\n },\n SEARCH_TOGGLE: {\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;A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,8BAA8B,oBAAoB,QAAQ,WAAW;AAAA,EACrE,sCAAsC,oBAAoB,QAAQ,WAAW;AAAA,EAC7E,iCAAiC,oBAAoB,QAAQ,cAAc;AAC7E;AAMO,MAAM,2BAA2B;AAAA,EACtC,WAAW;AAAA,EACX,MAAM;AAAA,IACJ,WAAW;AAAA,EACb;AAAA,EACA,YAAY;AAAA,IACV,SAAS;AAAA,IACT,WAAW;AAAA,IACX,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,WAAW;AAAA,IACX,iBAAiB;AAAA,EACnB;AAAA,EACA,SAAS;AAAA,IACP,WAAW;AAAA,IACX,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,YAAY;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,MACb,mBAAmB;AAAA,MACnB,WAAW;AAAA,IACb;AAAA,IACA,eAAe;AAAA,MACb,
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSGlobalHeaderName = 'DSGlobalheader';\n\n/* ************************************************************************************************\n * LEGACY VARIABLES\n * ************************************************************************************************\n * WE KEEP THIS AROUND TO AVOID BREAKING CHANGES\n * THE NEW VARIABLES INHERIT FROM THIS TO AVOID BREAKING CHANGES!!!\n ************************************************************************************************ */\n\n/**\n * @deprecated - use GLOBAL_HEADER_SLOTS instead, it containse the full list and is flat.\n */\nexport const DSGlobalHeaderSlots = {\n CONTAINER: 'root',\n LOGO: {\n CONTAINER: 'logo-container',\n },\n BREADCRUMB: {\n CONTAINER: 'breadcrumb-container',\n PIPE: 'breadcrumb-pipe',\n CHEVRON: 'breadcrumb-chevron',\n LIST: 'breadcrumb-list',\n ITEM: 'breadcrumb-item',\n ITEM_LINK: 'breadcrumb-item-link',\n ITEM_LINK_LABEL: 'breadcrumb-item-link-label',\n },\n MENUBAR: {\n CONTAINER: 'menubar-container',\n LIST: 'menubar-list',\n ITEM: 'menubar-item',\n ITEM_BUTTON: 'menubar-item-button',\n POPUP_MENU: {\n LIST: 'menubar-item-popupmenu-list',\n ITEM: 'menubar-item-popupmenu-item',\n ITEM_BUTTON: 'menubar-item-popupmenu-item-button',\n SEPARATOR: 'menubar-item-popupmenu-separator',\n ITEM_BUTTON_LABEL: 'menubar-item-popupmenu-item-label',\n },\n SEARCH_TOGGLE: {\n CONTAINER: 'menubar-item-searchtoggle-container',\n },\n },\n};\n/**\n * @deprecated - use GLOBAL_HEADER_SLOTS instead, it containse the full list.\n */\nexport const DSGlobalHeaderSlotsFlattened = {\n CONTAINER: DSGlobalHeaderSlots.CONTAINER,\n LOGO_CONTAINER: DSGlobalHeaderSlots.LOGO.CONTAINER,\n BREADCRUMB_CONTAINER: DSGlobalHeaderSlots.BREADCRUMB.CONTAINER,\n BREADCRUMB_PIPE: DSGlobalHeaderSlots.BREADCRUMB.PIPE,\n BREADCRUMB_CHEVRON: DSGlobalHeaderSlots.BREADCRUMB.CHEVRON,\n BREADCRUMB_LIST: DSGlobalHeaderSlots.BREADCRUMB.LIST,\n BREADCRUMB_ITEM: DSGlobalHeaderSlots.BREADCRUMB.ITEM,\n BREADCRUMB_ITEM_LINK: DSGlobalHeaderSlots.BREADCRUMB.ITEM_LINK,\n BREADCRUMB_ITEM_LINK_LABEL: DSGlobalHeaderSlots.BREADCRUMB.ITEM_LINK_LABEL,\n MENUBAR_CONTAINER: DSGlobalHeaderSlots.MENUBAR.CONTAINER,\n MENUBAR_LIST: DSGlobalHeaderSlots.MENUBAR.LIST,\n MENUBAR_ITEM: DSGlobalHeaderSlots.MENUBAR.ITEM,\n MENUBAR_ITEM_BUTTON: DSGlobalHeaderSlots.MENUBAR.ITEM_BUTTON,\n MENUBAR_POPUP_MENU_LIST: DSGlobalHeaderSlots.MENUBAR.POPUP_MENU.LIST,\n MENUBAR_POPUP_MENU_ITEM: DSGlobalHeaderSlots.MENUBAR.POPUP_MENU.ITEM,\n MENUBAR_POPUP_MENU_ITEM_BUTTON: DSGlobalHeaderSlots.MENUBAR.POPUP_MENU.ITEM_BUTTON,\n MENUBAR_POPUP_MENU_SEPARATOR: DSGlobalHeaderSlots.MENUBAR.POPUP_MENU.SEPARATOR,\n MENUBAR_POPUP_MENU_ITEM_BUTTON_LABEL: DSGlobalHeaderSlots.MENUBAR.POPUP_MENU.ITEM_BUTTON_LABEL,\n MENUBAR_SEARCH_TOGGLE_CONTAINER: DSGlobalHeaderSlots.MENUBAR.SEARCH_TOGGLE.CONTAINER,\n};\n// maintain the same order as the original object\n// for slots showcase purpose\n/**\n * @deprecated - use GLOBAL_HEADER_DATA_TESTID instead, it containse the full list and is flat.\n */\nexport const DSGlobalHeaderDatatestid = {\n CONTAINER: 'ds-global-header',\n LOGO: {\n CONTAINER: 'ds-global-header-logo-container',\n },\n BREADCRUMB: {\n CHEVRON: 'ds-globalheader-breadcrumb-chevron',\n CONTAINER: 'ds-global-header-breadcrumb-container',\n PIPE: 'ds-global-header-breadcrumb-pipe',\n LIST: 'ds-global-header-breadcrumb-list',\n ITEM: 'ds-global-header-breadcrumb-item',\n ITEM_LINK: 'gh-breadcrumb-btn',\n ITEM_LINK_LABEL: 'ds-global-header-breadcrumb-item-link-label',\n },\n MENUBAR: {\n CONTAINER: 'ds-global-header-menubar-container',\n LIST: 'ds-global-header-menubar-list',\n ITEM: 'ds-global-header-menubar-item',\n ITEM_BUTTON: 'gh-toolbar-item',\n POPUP_MENU: {\n LIST: 'ds-global-header-menubar-item-popupmenu-list',\n ITEM: 'ds-global-header-menubar-item-popupmenu-item',\n ITEM_BUTTON: 'ds-global-header-menubar-item-popupmenu-item-button',\n ITEM_BUTTON_LABEL: 'ds-global-header-menubar-item-popupmenu-item-label',\n SEPARATOR: 'ds-global-header-menubar-item-popupmenu-separator',\n },\n SEARCH_TOGGLE: {\n ITEM_BUTTON: 'gh-toolbar-item',\n },\n },\n};\n\n// maintain the same order as the original object\n// for slots showcase purpose\n/**\n * @deprecated - use GLOBAL_HEADER_DATA_TESTID instead, it containse the full list\n */\nexport const DSGlobalHeaderDatatestidFlattened = {\n CONTAINER: 'ds-global-header',\n LOGO_CONTAINER: 'ds-global-header-logo-container',\n BREADCRUMB_CONTAINER: 'ds-global-header-breadcrumb-container',\n BREADCRUMB_PIPE: 'ds-global-header-breadcrumb-pipe',\n BREADCRUMB_LIST: 'ds-global-header-breadcrumb-list',\n BREADCRUMB_ITEM: 'ds-global-header-breadcrumb-item',\n BREADCRUMB_ITEM_LINK: 'gh-breadcrumb-btn',\n BREADCRUMB_ITEM_LINK_LABEL: 'ds-global-header-breadcrumb-item-link-label',\n BREADCRUMB_CHEVRON: 'ds-globalheader-breadcrumb-chevron',\n MENUBAR_CONTAINER: 'ds-global-header-menubar-container',\n MENUBAR_LIST: 'ds-global-header-menubar-list',\n MENUBAR_ITEM: 'ds-global-header-menubar-item',\n MENUBAR_ITEM_BUTTON: 'gh-toolbar-item',\n MENUBAR_POPUP_MENU_LIST: 'ds-global-header-menubar-item-popupmenu-list',\n MENUBAR_POPUP_MENU_ITEM: 'ds-global-header-menubar-item-popupmenu-item',\n MENUBAR_POPUP_MENU_ITEM_BUTTON: 'ds-global-header-menubar-item-popupmenu-item-button',\n MENUBAR_POPUP_MENU_ITEM_LABEL: 'ds-global-header-menubar-item-popupmenu-item-label',\n MENUBAR_POPUP_MENU_SEPARATOR: 'ds-global-header-menubar-item-popupmenu-separator',\n MENUBAR_SEARCH_TOGGLE_ITEM_BUTTON: 'gh-toolbar-item',\n};\n\n/* ************************************************************************************************\n * From here on our it's the \"new\" convention, but adapted to inherit from the legacy variables\n ************************************************************************************************ */\nexport const FONT_DETECTOR = {\n SMALL: 1,\n MEDIUM: 2,\n LARGE: 3,\n} as const;\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const GLOBAL_HEADER_SLOTS = {\n ...DSGlobalHeaderSlotsFlattened,\n // the following slots are completely new, added to the component post BREAKING CHANGES\n // https://confluence.ice.com/x/6SqFPQ\n // [Breaking Changes] Global Header - Search Toggle\n // hence, given they are new, we are not adding them to the legacy variables, we are not going to overwrite the auto-generation pattern.\n SEARCH_TOGGLE_SPINBUTTON_WRAPPER: 'searchtoggle-spinbutton-wrapper',\n SEARCH_TOGGLE_SPINBUTTON_TEXT: 'searchtoggle-spinbutton-text',\n SEARCH_TOGGLE_SPINBUTTON_SEPARATOR: 'searchtoggle-spinbutton-separator',\n SEARCH_TOGGLE_SPINBUTTON_PREV: 'searchtoggle-spinbutton-prev',\n SEARCH_TOGGLE_SPINBUTTON_NEXT: 'searchtoggle-spinbutton-next',\n SEARCH_TOGGLE_TEXTINPUT: 'searchtoggle-textinput',\n SEARCH_TOGGLE_TRIGGER_BUTTON: 'searchtoggle-trigger-button',\n SEARCH_TOGGLE_EXPANDED_CONTENT_WRAPPER: 'searchtoggle-expanded-content-wrapper',\n // The popup menu item's own root \u2014 the element consumers target to reach the whole item, and the one\n // that receives its xstyled props. Post-convention slot, so it carries no legacy data-testid override.\n MENUBAR_ITEM_POPUPMENU_CONTAINER: 'menubar-item-popupmenu-container',\n} as const;\n\n// PUI-17973 \u2014 default accessible name for the search input, applied when the consumer does not\n// supply their own aria-label (a consumer aria-label overrides it). Guides screen-reader users to\n// the result navigation (the spinbutton), which announces the result count/position natively.\nexport const SEARCH_TOGGLE_DEFAULT_ARIA_LABEL = 'Search. Press Tab twice to reach the result navigation.';\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const GLOBAL_HEADER_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSGlobalHeaderName, GLOBAL_HEADER_SLOTS),\n // this are the \"hardcoded\" data-testid that maps to the slots in the component that we keep as they were for backwards compatibility\n ...DSGlobalHeaderDatatestidFlattened,\n SEARCH_TOGGLE_TRIGGER_BUTTON: 'gh-toolbar-item',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA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,+BAA+B;AAAA,EAC/B,+BAA+B;AAAA,EAC/B,yBAAyB;AAAA,EACzB,8BAA8B;AAAA,EAC9B,wCAAwC;AAAA;AAAA;AAAA,EAGxC,kCAAkC;AACpC;AAKO,MAAM,mCAAmC;AAEzC,MAAM,4BAA4B;AAAA,EACvC,OAAG,0CAAwB,oBAAoB,mBAAmB;AAAA;AAAA,EAElE,GAAG;AAAA,EACH,8BAA8B;AAChC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -28,22 +28,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var index_exports = {};
|
|
30
30
|
__export(index_exports, {
|
|
31
|
-
DSGlobalHeader: () =>
|
|
31
|
+
DSGlobalHeader: () => import_DSGlobalHeader.DSGlobalHeader,
|
|
32
32
|
DSGlobalHeaderDatatestid: () => import_constants.DSGlobalHeaderDatatestid,
|
|
33
33
|
DSGlobalHeaderDatatestidFlattened: () => import_constants.DSGlobalHeaderDatatestidFlattened,
|
|
34
34
|
DSGlobalHeaderName: () => import_constants.DSGlobalHeaderName,
|
|
35
35
|
DSGlobalHeaderSlots: () => import_constants.DSGlobalHeaderSlots,
|
|
36
36
|
DSGlobalHeaderSlotsFlattened: () => import_constants.DSGlobalHeaderSlotsFlattened,
|
|
37
|
-
DSGlobalHeaderWithSchema: () =>
|
|
37
|
+
DSGlobalHeaderWithSchema: () => import_DSGlobalHeader.DSGlobalHeaderWithSchema,
|
|
38
38
|
GLOBAL_HEADER_DATA_TESTID: () => import_constants.GLOBAL_HEADER_DATA_TESTID,
|
|
39
39
|
GLOBAL_HEADER_SLOTS: () => import_constants.GLOBAL_HEADER_SLOTS,
|
|
40
|
-
GlobalHeader: () =>
|
|
41
|
-
default: () => index_default
|
|
40
|
+
GlobalHeader: () => import_DSGlobalHeader.GlobalHeader
|
|
42
41
|
});
|
|
43
42
|
module.exports = __toCommonJS(index_exports);
|
|
44
43
|
var React = __toESM(require("react"));
|
|
45
44
|
var import_DSGlobalHeader = require("./DSGlobalHeader.js");
|
|
46
|
-
var import_DSGlobalHeader2 = require("./DSGlobalHeader.js");
|
|
47
45
|
var import_constants = require("./constants/index.js");
|
|
48
|
-
var index_default = import_DSGlobalHeader.DSGlobalHeader;
|
|
49
46
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["export { DSGlobalHeader, DSGlobalHeaderWithSchema, GlobalHeader } from './DSGlobalHeader.js';\nexport {\n // LEGACY VARIABLES\n DSGlobalHeaderDatatestid,\n DSGlobalHeaderDatatestidFlattened,\n DSGlobalHeaderSlots,\n DSGlobalHeaderSlotsFlattened,\n // NEW PATTERNS INHERITING FROM THE LEGACY VARIABLES:\n DSGlobalHeaderName,\n GLOBAL_HEADER_SLOTS,\n GLOBAL_HEADER_DATA_TESTID,\n} from './constants/index.js';\nexport type { DSGlobalHeaderT } from './react-desc-prop-types.js';\nexport type { DSGlobalHeaderInternalsT } from './sharedTypes.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,4BAAuE;AACvE,uBAUO;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -38,7 +38,20 @@ var import_DSGlobalHeaderContext = require("../../DSGlobalHeaderContext.js");
|
|
|
38
38
|
const useGlobalHeaderBreadcrumb = () => {
|
|
39
39
|
const {
|
|
40
40
|
props: { breadcrumb, CustomNavigation },
|
|
41
|
-
|
|
41
|
+
/*
|
|
42
|
+
* The slot layer, split into its two genuinely separate halves.
|
|
43
|
+
*
|
|
44
|
+
* `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's
|
|
45
|
+
* slot prop, so it can only come from DSGlobalHeader — that is what the verbose drilled name says out
|
|
46
|
+
* loud when it reaches the out-of-the-box parts.
|
|
47
|
+
*
|
|
48
|
+
* `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,
|
|
49
|
+
* so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's
|
|
50
|
+
* own elements have render-time values worth passing. Stated rather than omitted, so "what arguments
|
|
51
|
+
* does this slot get?" always has a visible answer.
|
|
52
|
+
*/
|
|
53
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
54
|
+
noSlotArguments,
|
|
42
55
|
instanceUID,
|
|
43
56
|
showIconOnly,
|
|
44
57
|
setShowIconOnly,
|
|
@@ -68,6 +81,25 @@ const useGlobalHeaderBreadcrumb = () => {
|
|
|
68
81
|
},
|
|
69
82
|
[]
|
|
70
83
|
);
|
|
84
|
+
const ownerProps = (0, import_react.useMemo)(
|
|
85
|
+
() => ({
|
|
86
|
+
/*
|
|
87
|
+
* The slot layer, split into its two genuinely separate halves.
|
|
88
|
+
*
|
|
89
|
+
* `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's
|
|
90
|
+
* slot prop, so it can only come from DSGlobalHeader — that is what the verbose drilled name says out
|
|
91
|
+
* loud when it reaches the out-of-the-box parts.
|
|
92
|
+
*
|
|
93
|
+
* `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,
|
|
94
|
+
* so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's
|
|
95
|
+
* own elements have render-time values worth passing. Stated rather than omitted, so "what arguments
|
|
96
|
+
* does this slot get?" always has a visible answer.
|
|
97
|
+
*/
|
|
98
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
99
|
+
getOwnerPropsArguments: noSlotArguments
|
|
100
|
+
}),
|
|
101
|
+
[getOwnerPropsAwareOfPropsPassedToGlobalHeader, noSlotArguments]
|
|
102
|
+
);
|
|
71
103
|
return {
|
|
72
104
|
breadcrumb,
|
|
73
105
|
CustomNavigation,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Breadcrumb/useGlobalHeaderBreadcrumb.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type React from 'react';\nimport { useCallback, useContext, useEffect, useRef } from 'react';\nimport { FONT_DETECTOR } from '../../constants/index.js';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport type { DSGlobalHeaderT } from '../../react-desc-prop-types.js';\n\ninterface UseGlobalHeaderBreadcrumbReturnT {\n breadcrumb: DSGlobalHeaderT.BreadcrumbItem[];\n CustomNavigation: React.ComponentType;\n showIconOnly: boolean;\n flexRegionRef: React.MutableRefObject<HTMLDivElement | null>;\n handleOnKeyDown: (\n onClick: (event: React.MouseEvent | React.KeyboardEvent) => void,\n ) => (event: React.KeyboardEvent) => void;\n instanceUID: string;\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n}\n\nexport const useGlobalHeaderBreadcrumb = (): UseGlobalHeaderBreadcrumbReturnT => {\n const {\n props: { breadcrumb, CustomNavigation },\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,
|
|
4
|
+
"sourcesContent": ["import type React from 'react';\nimport { useMemo, useCallback, useContext, useEffect, useRef } from 'react';\nimport { FONT_DETECTOR } from '../../constants/index.js';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport type { DSGlobalHeaderT } from '../../react-desc-prop-types.js';\n\ninterface UseGlobalHeaderBreadcrumbReturnT {\n breadcrumb: DSGlobalHeaderT.BreadcrumbItem[];\n CustomNavigation: React.ComponentType;\n showIconOnly: boolean;\n flexRegionRef: React.MutableRefObject<HTMLDivElement | null>;\n handleOnKeyDown: (\n onClick: (event: React.MouseEvent | React.KeyboardEvent) => void,\n ) => (event: React.KeyboardEvent) => void;\n instanceUID: string;\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n}\n\nexport const useGlobalHeaderBreadcrumb = (): UseGlobalHeaderBreadcrumbReturnT => {\n const {\n props: { breadcrumb, CustomNavigation },\n /*\n * The slot layer, split into its two genuinely separate halves.\n *\n * `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's\n * slot prop, so it can only come from DSGlobalHeader \u2014 that is what the verbose drilled name says out\n * loud when it reaches the out-of-the-box parts.\n *\n * `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,\n * so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's\n * own elements have render-time values worth passing. Stated rather than omitted, so \"what arguments\n * does this slot get?\" always has a visible answer.\n */\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n noSlotArguments,\n instanceUID,\n showIconOnly,\n setShowIconOnly,\n fontDetector,\n } = useContext(DSGlobalHeaderContext);\n\n const breakpointRef = useRef<number | null>(null);\n const flexRegionRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const evaluateShowIconOnly = () => {\n if (\n (flexRegionRef.current && flexRegionRef.current.offsetWidth <= 0 && !breakpointRef.current) ||\n fontDetector === FONT_DETECTOR.LARGE ||\n fontDetector === FONT_DETECTOR.MEDIUM\n ) {\n setShowIconOnly(true);\n breakpointRef.current = window.innerWidth;\n } else if (breakpointRef.current && window.innerWidth >= breakpointRef.current) {\n setShowIconOnly(false);\n breakpointRef.current = null;\n }\n };\n\n evaluateShowIconOnly();\n\n window.addEventListener('resize', evaluateShowIconOnly);\n return () => window.removeEventListener('resize', evaluateShowIconOnly);\n }, [breakpointRef, flexRegionRef, setShowIconOnly, fontDetector]);\n\n const handleOnKeyDown = useCallback(\n (onClick: (event: React.MouseEvent | React.KeyboardEvent) => void) => (e: React.KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n onClick(e);\n }\n },\n [],\n );\n\n const ownerProps = useMemo(\n () => ({\n /*\n * The slot layer, split into its two genuinely separate halves.\n *\n * `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's\n * slot prop, so it can only come from DSGlobalHeader \u2014 that is what the verbose drilled name says out\n * loud when it reaches the out-of-the-box parts.\n *\n * `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,\n * so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's\n * own elements have render-time values worth passing. Stated rather than omitted, so \"what arguments\n * does this slot get?\" always has a visible answer.\n */\n getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n getOwnerPropsArguments: noSlotArguments,\n }),\n [getOwnerPropsAwareOfPropsPassedToGlobalHeader, noSlotArguments],\n );\n\n return {\n breadcrumb,\n CustomNavigation,\n showIconOnly,\n flexRegionRef,\n handleOnKeyDown,\n instanceUID,\n ownerProps,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAoE;AACpE,uBAA8B;AAC9B,mCAAsC;AAkB/B,MAAM,4BAA4B,MAAwC;AAC/E,QAAM;AAAA,IACJ,O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
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -42,7 +42,20 @@ const GlobalHeaderLogo = () => {
|
|
|
42
42
|
const {
|
|
43
43
|
props: { Logo, LogoWithBrand },
|
|
44
44
|
showIconOnly,
|
|
45
|
-
|
|
45
|
+
/*
|
|
46
|
+
* The slot layer, split into its two genuinely separate halves.
|
|
47
|
+
*
|
|
48
|
+
* `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's
|
|
49
|
+
* slot prop, so it can only come from DSGlobalHeader — that is what the verbose drilled name says out
|
|
50
|
+
* loud when it reaches the out-of-the-box parts.
|
|
51
|
+
*
|
|
52
|
+
* `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,
|
|
53
|
+
* so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's
|
|
54
|
+
* own elements have render-time values worth passing. Stated rather than omitted, so "what arguments
|
|
55
|
+
* does this slot get?" always has a visible answer.
|
|
56
|
+
*/
|
|
57
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
58
|
+
noSlotArguments
|
|
46
59
|
} = (0, import_react.useContext)(import_DSGlobalHeaderContext.DSGlobalHeaderContext);
|
|
47
60
|
const layoutMode = (0, import_ds_system.useGetLayoutMode)();
|
|
48
61
|
const smalScreen = import_react.default.useMemo(() => {
|
|
@@ -57,7 +70,8 @@ const GlobalHeaderLogo = () => {
|
|
|
57
70
|
alignItems: "center",
|
|
58
71
|
pr: smalScreen ? "0px" : "36px",
|
|
59
72
|
cols: smalScreen ? ["auto"] : ["auto", "1fr"],
|
|
60
|
-
|
|
73
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
74
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
61
75
|
children: [
|
|
62
76
|
Logo && smalScreen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Logo, {}),
|
|
63
77
|
LogoWithBrand && !smalScreen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogoWithBrand, {})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Logo/GlobalHeaderLogo.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { useGetLayoutMode } from '@elliemae/ds-system';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport { StyledLogoContainer } from './styles.js';\nimport { GLOBAL_HEADER_DATA_TESTID } from '../../constants/index.js';\n\nexport const GlobalHeaderLogo = (): JSX.Element => {\n const {\n props: { Logo, LogoWithBrand },\n showIconOnly,\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { useGetLayoutMode } from '@elliemae/ds-system';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport { StyledLogoContainer } from './styles.js';\nimport { GLOBAL_HEADER_DATA_TESTID } from '../../constants/index.js';\n\nexport const GlobalHeaderLogo = (): JSX.Element => {\n const {\n props: { Logo, LogoWithBrand },\n showIconOnly,\n /*\n * The slot layer, split into its two genuinely separate halves.\n *\n * `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's\n * slot prop, so it can only come from DSGlobalHeader \u2014 that is what the verbose drilled name says out\n * loud when it reaches the out-of-the-box parts.\n *\n * `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,\n * so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's\n * own elements have render-time values worth passing. Stated rather than omitted, so \"what arguments\n * does this slot get?\" always has a visible answer.\n */\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n noSlotArguments,\n } = useContext(DSGlobalHeaderContext);\n const layoutMode = useGetLayoutMode();\n\n const smalScreen = React.useMemo(() => {\n if (!layoutMode) return showIconOnly;\n if (layoutMode === 'xs' || layoutMode === 's') return true;\n return false;\n }, [layoutMode, showIconOnly]);\n\n return (\n <StyledLogoContainer\n data-testid={GLOBAL_HEADER_DATA_TESTID.LOGO_CONTAINER}\n alignItems=\"center\"\n pr={smalScreen ? '0px' : '36px'}\n cols={smalScreen ? ['auto'] : ['auto', '1fr']}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n {Logo && smalScreen && <Logo />}\n {LogoWithBrand && !smalScreen && <LogoWithBrand />}\n </StyledLogoContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCnB;AAlCJ,mBAAkC;AAClC,uBAAiC;AACjC,mCAAsC;AACtC,oBAAoC;AACpC,uBAA0C;AAEnC,MAAM,mBAAmB,MAAmB;AACjD,QAAM;AAAA,IACJ,OAAO,EAAE,MAAM,cAAc;AAAA,IAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kDAAqB;AACpC,QAAM,iBAAa,mCAAiB;AAEpC,QAAM,aAAa,aAAAA,QAAM,QAAQ,MAAM;AACrC,QAAI,CAAC,WAAY,QAAO;AACxB,QAAI,eAAe,QAAQ,eAAe,IAAK,QAAO;AACtD,WAAO;AAAA,EACT,GAAG,CAAC,YAAY,YAAY,CAAC;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,2CAA0B;AAAA,MACvC,YAAW;AAAA,MACX,IAAI,aAAa,QAAQ;AAAA,MACzB,MAAM,aAAa,CAAC,MAAM,IAAI,CAAC,QAAQ,KAAK;AAAA,MAC5C,eAAe;AAAA,MACf,wBAAwB;AAAA,MAEvB;AAAA,gBAAQ,cAAc,4CAAC,QAAK;AAAA,QAC5B,iBAAiB,CAAC,cAAc,4CAAC,iBAAc;AAAA;AAAA;AAAA,EAClD;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -44,10 +44,23 @@ var import_useGlobalHeaderToolbar = require("./useGlobalHeaderToolbar.js");
|
|
|
44
44
|
const GlobalHeaderToolbar = () => {
|
|
45
45
|
const {
|
|
46
46
|
props: { toolbar },
|
|
47
|
-
ownerProps,
|
|
48
47
|
instanceUID,
|
|
49
48
|
globalHeaderToolbarGrid,
|
|
50
|
-
fontDetector
|
|
49
|
+
fontDetector,
|
|
50
|
+
/*
|
|
51
|
+
* The slot layer, split into its two genuinely separate halves.
|
|
52
|
+
*
|
|
53
|
+
* `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's
|
|
54
|
+
* slot prop, so it can only come from DSGlobalHeader — that is what the verbose drilled name says out
|
|
55
|
+
* loud when it reaches the out-of-the-box parts.
|
|
56
|
+
*
|
|
57
|
+
* `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,
|
|
58
|
+
* so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's
|
|
59
|
+
* own elements have render-time values worth passing. Stated rather than omitted, so "what arguments
|
|
60
|
+
* does this slot get?" always has a visible answer.
|
|
61
|
+
*/
|
|
62
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
63
|
+
noSlotArguments
|
|
51
64
|
} = (0, import_react.useContext)(import_DSGlobalHeaderContext.DSGlobalHeaderContext);
|
|
52
65
|
const { listRef, setRef, keyboardNavigation } = (0, import_useGlobalHeaderToolbar.useGlobalHeaderToolbar)();
|
|
53
66
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -56,7 +69,8 @@ const GlobalHeaderToolbar = () => {
|
|
|
56
69
|
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_CONTAINER,
|
|
57
70
|
"aria-label": "menubar",
|
|
58
71
|
withSpan: fontDetector > import_constants.FONT_DETECTOR.SMALL,
|
|
59
|
-
|
|
72
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
73
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
60
74
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
75
|
import_styles2.StyledList,
|
|
62
76
|
{
|
|
@@ -69,25 +83,27 @@ const GlobalHeaderToolbar = () => {
|
|
|
69
83
|
onKeyDown: keyboardNavigation,
|
|
70
84
|
innerRef: listRef,
|
|
71
85
|
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_LIST,
|
|
72
|
-
|
|
86
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
87
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
73
88
|
children: toolbar.map((item, index) => {
|
|
74
89
|
const { type } = item;
|
|
75
90
|
const setRefIndex = setRef(index);
|
|
76
91
|
if (type === "ds-popup-menu") {
|
|
77
|
-
const { label: label2, ...otherProps2 } = item;
|
|
92
|
+
const { label: label2, type: strippedDiscriminator, ...otherProps2 } = item;
|
|
78
93
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
94
|
import_styles2.StyledToolbarItem,
|
|
80
95
|
{
|
|
81
96
|
role: "menuitem",
|
|
82
97
|
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM,
|
|
83
|
-
|
|
98
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
99
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
84
100
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
101
|
import_outOfTheBox.PopupMenu,
|
|
86
102
|
{
|
|
87
103
|
title: label2,
|
|
88
104
|
setRef: setRefIndex,
|
|
89
105
|
...otherProps2,
|
|
90
|
-
|
|
106
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader
|
|
91
107
|
}
|
|
92
108
|
)
|
|
93
109
|
},
|
|
@@ -95,27 +111,46 @@ const GlobalHeaderToolbar = () => {
|
|
|
95
111
|
);
|
|
96
112
|
}
|
|
97
113
|
if (type === "ds-app-picker") {
|
|
98
|
-
const { label: label2, ...otherProps2 } = item;
|
|
114
|
+
const { label: label2, type: strippedDiscriminator, ...otherProps2 } = item;
|
|
99
115
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
100
116
|
import_styles2.StyledToolbarItem,
|
|
101
117
|
{
|
|
102
118
|
role: "menuitem",
|
|
103
119
|
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM,
|
|
104
|
-
|
|
105
|
-
|
|
120
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
121
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
123
|
+
import_outOfTheBox.AppPickerCTXRenderer,
|
|
124
|
+
{
|
|
125
|
+
label: label2,
|
|
126
|
+
setRef: setRefIndex,
|
|
127
|
+
...otherProps2,
|
|
128
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader
|
|
129
|
+
}
|
|
130
|
+
)
|
|
106
131
|
},
|
|
107
132
|
`${instanceUID}-ds-toolbar-item-${label2}`
|
|
108
133
|
);
|
|
109
134
|
}
|
|
110
135
|
if (type === "ds-search-toggle") {
|
|
111
|
-
const { label: label2, ...otherProps2 } = item;
|
|
136
|
+
const { label: label2, type: strippedDiscriminator, ...otherProps2 } = item;
|
|
112
137
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
113
138
|
import_styles2.StyledToolbarItem,
|
|
114
139
|
{
|
|
115
140
|
role: "menuitem",
|
|
116
141
|
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM,
|
|
117
|
-
|
|
118
|
-
|
|
142
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
143
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
144
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
145
|
+
import_outOfTheBox.SearchToggle,
|
|
146
|
+
{
|
|
147
|
+
instanceUID,
|
|
148
|
+
label: label2,
|
|
149
|
+
setRef: setRefIndex,
|
|
150
|
+
...otherProps2,
|
|
151
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader
|
|
152
|
+
}
|
|
153
|
+
)
|
|
119
154
|
},
|
|
120
155
|
`${instanceUID}-ds-toolbar-item-${label2}`
|
|
121
156
|
);
|
|
@@ -128,7 +163,8 @@ const GlobalHeaderToolbar = () => {
|
|
|
128
163
|
{
|
|
129
164
|
role: "menuitem",
|
|
130
165
|
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM,
|
|
131
|
-
|
|
166
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
167
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
132
168
|
children: CustomComponent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CustomComponent, { item, setRef: setRefIndex })
|
|
133
169
|
},
|
|
134
170
|
`${instanceUID}-ds-toolbar-item-${label2}`
|
|
@@ -140,7 +176,8 @@ const GlobalHeaderToolbar = () => {
|
|
|
140
176
|
{
|
|
141
177
|
role: "menuitem",
|
|
142
178
|
"data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM,
|
|
143
|
-
|
|
179
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
180
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
144
181
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
145
182
|
import_styles.StyledButton,
|
|
146
183
|
{
|
|
@@ -149,7 +186,8 @@ const GlobalHeaderToolbar = () => {
|
|
|
149
186
|
innerRef: setRefIndex,
|
|
150
187
|
...(0, import_ds_props_helpers.getGlobalAttributes)(otherProps),
|
|
151
188
|
type: "button",
|
|
152
|
-
|
|
189
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
190
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
153
191
|
children: Icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: "m" })
|
|
154
192
|
}
|
|
155
193
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Toolbar/GlobalHeaderToolbar.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { getGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { useContext } from 'react';\nimport { FONT_DETECTOR, GLOBAL_HEADER_DATA_TESTID } from '../../constants/index.js';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport { StyledButton } from '../styles.js';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { getGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { useContext } from 'react';\nimport { FONT_DETECTOR, GLOBAL_HEADER_DATA_TESTID } from '../../constants/index.js';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport { StyledButton } from '../styles.js';\nimport { AppPickerCTXRenderer, PopupMenu, SearchToggle } from './outOfTheBox/index.js';\nimport { StyledList, StyledMenubarContainer, StyledToolbarItem } from './styles.js';\nimport { useGlobalHeaderToolbar } from './useGlobalHeaderToolbar.js';\n\nexport const GlobalHeaderToolbar = (): JSX.Element => {\n const {\n props: { toolbar },\n instanceUID,\n globalHeaderToolbarGrid,\n fontDetector,\n /*\n * The slot layer, split into its two genuinely separate halves.\n *\n * `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's\n * slot prop, so it can only come from DSGlobalHeader \u2014 that is what the verbose drilled name says out\n * loud when it reaches the out-of-the-box parts.\n *\n * `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,\n * so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's\n * own elements have render-time values worth passing. Stated rather than omitted, so \"what arguments\n * does this slot get?\" always has a visible answer.\n */\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n noSlotArguments,\n } = useContext(DSGlobalHeaderContext);\n\n const { listRef, setRef, keyboardNavigation } = useGlobalHeaderToolbar();\n\n return (\n <StyledMenubarContainer\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_CONTAINER}\n aria-label=\"menubar\"\n withSpan={fontDetector > FONT_DETECTOR.SMALL}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n <StyledList\n height=\"100%\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gutter=\"xxs\"\n cols={globalHeaderToolbarGrid}\n role=\"menubar\"\n onKeyDown={keyboardNavigation}\n innerRef={listRef}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_LIST}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n {toolbar.map((item, index) => {\n const { type } = item;\n /*\n * Each branch below strips `type` rather than forwarding it. It is toolbar configuration, but it\n * is ALSO a member of GlobalAttributesT \u2014 so any part that spreads item-level global attributes\n * onto a non-button element renders `type=\"ds-search-toggle\"` into the DOM. The button-rooted\n * parts escape that only incidentally, by re-declaring `type=\"button\"` after their spread.\n * Stripping here is what stops the outcome depending on that accident.\n */\n // inside a toolbar items needs to be navigable via arrow keys.\n // this setRef(index) is generating an index of references that can be \"focused\" when user is navigating with arrows\n // NOTE:\n // focus management based on DOM nodes.focus() in react is problematic due to unpredictable timing of refs assignment and react rendering\n // we should be using the \"focus tracker\" approach where we keep track of \"what we want to focuse\",\n // then have the ref callback functions invoke the focus to the element AFTER the LAST element is rendered, not tracking the DOM nodes directly.\n // We aren't changing this right now, but let's keep this in mind.\n const setRefIndex = setRef(index);\n\n if (type === 'ds-popup-menu') {\n const { label, type: strippedDiscriminator, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n <PopupMenu\n title={label} // this is captured as the standard HTML \"title\" attribute and is printed in output HTML\n setRef={setRefIndex}\n {...otherProps}\n getOwnerPropsAwareOfPropsPassedToGlobalHeader={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n />\n </StyledToolbarItem>\n );\n }\n if (type === 'ds-app-picker') {\n const { label, type: strippedDiscriminator, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n <AppPickerCTXRenderer\n label={label}\n setRef={setRefIndex}\n {...otherProps}\n getOwnerPropsAwareOfPropsPassedToGlobalHeader={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n />\n </StyledToolbarItem>\n );\n }\n if (type === 'ds-search-toggle') {\n const { label, type: strippedDiscriminator, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n <SearchToggle\n instanceUID={instanceUID}\n label={label}\n setRef={setRefIndex}\n {...otherProps}\n getOwnerPropsAwareOfPropsPassedToGlobalHeader={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n />\n </StyledToolbarItem>\n );\n }\n if (type === 'custom') {\n const { label, CustomComponent } = item;\n if (!CustomComponent) return null;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n {CustomComponent && <CustomComponent item={item} setRef={setRefIndex} />}\n </StyledToolbarItem>\n );\n }\n\n const { label, Icon, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n <StyledButton\n title={label} // this is captured as the standard HTML \"title\" attribute and is printed in output HTML\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON}\n innerRef={setRefIndex}\n {...getGlobalAttributes(otherProps)}\n type=\"button\"\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n {Icon && <Icon size=\"m\" />}\n </StyledButton>\n </StyledToolbarItem>\n );\n })}\n </StyledList>\n </StyledMenubarContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkFP;AAlFhB,8BAAoC;AACpC,mBAA2B;AAC3B,uBAAyD;AACzD,mCAAsC;AACtC,oBAA6B;AAC7B,yBAA8D;AAC9D,IAAAA,iBAAs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