@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSAppPicker } from '@elliemae/ds-app-picker';\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n getPropsPerSlotPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport { DSGlobalHeaderName, GLOBAL_HEADER_SLOTS } from './constants/index.js';\n\nconst noop = () => null;\n\nexport const defaultProps = {\n breadcrumb: [],\n toolbar: [],\n LogoWithBrand: noop,\n Logo: noop,\n};\n\nexport declare namespace DSGlobalHeaderT {\n export interface Context {\n showIconOnly: boolean;\n fontDetector: number;\n setShowIconOnly: React.Dispatch<React.SetStateAction<boolean>>;\n instanceUID: string;\n globalHeaderToolbarGrid: string[];\n props: InternalProps;\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n }\n /* *************************************************************************************\n \"Breadcrumb widget\" configuration types\n ****************************************************************************************\n The breadcrumb items ARE SPREADING GLOBAL PROPS!!!\n + The breadcrumb items have a logic that force the onClick to be invoked on spacebar/enter too\n forcing it even if not the standard browser behaviour as per our buttons too\n ************************************************************************************** */\n export interface BreadcrumbItemOptionals {\n hasNext?: boolean;\n isSelected?: boolean;\n onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;\n }\n export interface BreadcrumbItemRequired {\n label: string;\n }\n export interface BreadcrumbItemOptionalsGlobals extends Omit<\n GlobalAttributesT,\n keyof BreadcrumbItemOptionals | keyof BreadcrumbItemRequired\n > {}\n\n export interface BreadcrumbItem\n extends BreadcrumbItemRequired, BreadcrumbItemOptionals, BreadcrumbItemOptionalsGlobals {}\n /* *************************************************************************************\n \"Toolbar widget\" configuration types\n ****************************************************************************************\n The toolbar item can be mainly of 4 different types\n - app-picker \n more or less map to ds-app-picker interface\n - popup-menu\n should more less map to dropdownmenu-v2 but should be changed to menu-button when possible\n - search-toggle\n a custom ad hoc implementation that expands in place and expose an input text,\n kinda problematic and force-added due to unrestrained \"yes man\" attitude with PM/PO\n we will be suggesting against using it officially in the later releases and try to find a better solution.\n - custom\n a way to allow app to provide their own render props along other pre-configured widgets out of the box\n ************************************************************************************** */\n\n /* *************************************************************************************\n toolbar -> type === 'custom'\n ************************************************************************************** */\n export interface ToolbarCustomComponentProps {\n item: Record<string, unknown> & {\n type: 'custom';\n CustomComponent: React.ComponentType<ToolbarCustomComponentProps>;\n };\n setRef: (ref: HTMLElement | null) => void;\n }\n export interface ToolbarCustomItem extends Record<string, unknown> {\n type: 'custom';\n label: string;\n CustomComponent: React.ComponentType<ToolbarCustomComponentProps>;\n }\n /* *************************************************************************************\n toolbar -> type === 'ds-search-toggle'\n ************************************************************************************** */\n // this props are actually required for the out-of-the-box to actually do what it needs to do\n // it's meant to be provided from the application, so this is kind of a weird way to do controlled components\n export interface ToggleSearchComponentProps {\n onNext: () => void;\n onPrevious: () => void;\n currentResultIndex: number;\n totalResults: number;\n placeholder: string;\n value: string;\n onChange: (value: string) => void;\n onBlur?: () => void;\n onClear: () => void;\n isOpen: boolean;\n onKeyDown: (event: React.KeyboardEvent) => void;\n onClick: (event: React.MouseEvent) => void;\n triggerRef: React.MutableRefObject<HTMLButtonElement>;\n searchContainerRef: React.MutableRefObject<HTMLDivElement>;\n }\n // WE ARE SPREADING GLOBAL PROPS!!!\n export interface SearchToggleProps extends GlobalAttributesT {\n setRef: (ref: HTMLButtonElement | null) => void;\n label: string;\n componentProps: ToggleSearchComponentProps;\n // https://jira.elliemae.io/browse/PUI-17852\n // - Generic aria-labels\n // -> allows users to specify a custom aria-label when the search toggle is expanded\n // -> it's an incremental change, so its \"optional\", we fall back to the previous hardcoded \"Close search\" if not provided\n // but authors are encouraged to improve the Aria-label with context-specific information when possible, to improve the overall accessibility of the component.\n ariaLabelExpanded?: string;\n // aria-controls needs to point to a DOM id, we need to make sure there are no conflicts in case of multiple search toggles on the same page\n instanceUID: Context['instanceUID'];\n }\n export interface ToolbarSearchToggleItem {\n type: 'ds-search-toggle';\n label: string;\n componentProps: ToggleSearchComponentProps;\n }\n /* *************************************************************************************\n toolbar -> type === 'ds-popup-menu'\n ************************************************************************************** */\n\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupMenuContentItem extends Omit<GlobalAttributesT, 'type' | 'label' | 'onClick'> {\n type?: 'separator' | 'custom';\n Icon?: React.ComponentType<{ fill?: string; size?: string }>;\n label?: string;\n onClick?: (event: React.MouseEvent) => void;\n closeOnClick?: boolean;\n Content?: React.ComponentType;\n }\n export interface PopupMenuComponentProps {\n onClickOutside?: (e: MouseEvent | TouchEvent) => void;\n onKeyPress: (event: React.KeyboardEvent) => void;\n popupOnKeyPress: (event: React.KeyboardEvent) => void;\n isOpen: boolean;\n options: PopupMenuContentItem[];\n closeOnClick: boolean;\n }\n // this is the only type that was pre-existing (even if differently defined)\n // and that's why it doesn't include Toolbar at the start\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupMenuItem extends Omit<GlobalAttributesT, 'type' | 'label' | 'onClick'> {\n type: 'ds-popup-menu';\n Icon?: React.ComponentType<{ fill?: string; size?: string }>;\n label?: string;\n onClick?: (event: React.MouseEvent) => void;\n Content?: React.ComponentType;\n componentProps: PopupMenuComponentProps;\n }\n\n export interface PopupMenuContentProps {\n options: PopupMenuContentItem[];\n onItemClick: () => void;\n onClose: () => void;\n popupOnKeyPress: (event: React.KeyboardEvent) => void;\n setIsOpen: () => void;\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n }\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupProps extends Omit<GlobalAttributesT, 'title' | 'label' | 'onClick'> {\n Icon?: React.ComponentType<{ fill?: string; size?: string }>;\n onClick?: (event: React.MouseEvent) => void;\n setRef: (ref: HTMLElement) => void;\n componentProps: PopupMenuComponentProps;\n title?: string; // this was probably not intended, but removing this means the HTML will not print the title={label}\n // keeping this for now, if A11y says otherwise we will do the proper steps to remove it\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n }\n\n /* *************************************************************************************\n toolbar -> type === 'ds-app-picker'\n ************************************************************************************** */\n export type AppPickerComponentProps = React.ComponentProps<typeof DSAppPicker> & {\n triggerOnClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface AppPickerProps extends Omit<GlobalAttributesT, 'label'> {\n label: string;\n componentProps: AppPickerComponentProps;\n }\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface ToolbarAppPickerItem extends Omit<GlobalAttributesT, 'type' | 'label'> {\n type: 'ds-app-picker';\n label: string;\n componentProps: AppPickerComponentProps;\n }\n\n /* *************************************************************************************\n toolbar -> type === undefined (fallback default)\n ************************************************************************************** */\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface ToolbarItemTypelessDefault extends Omit<GlobalAttributesT, 'label'> {\n type?: undefined;\n label: string;\n Icon: React.ComponentType<{ fill?: string; size?: string }>;\n }\n\n export type ToolbarItem =\n | ToolbarCustomItem\n | ToolbarSearchToggleItem\n | ToolbarAppPickerItem\n | PopupMenuItem // this is the only type that was pre-existing and that's why it doesn't include Toolbar at the start\n | ToolbarItemTypelessDefault;\n\n export type SlotFunctionArguments = {\n dsGlobalheaderRoot: () => Record<string, never>;\n dsGlobalheaderLogoContainer: () => Record<string, never>;\n dsGlobalheaderBreadcrumbContainer: () => Record<string, never>;\n dsGlobalheaderBreadcrumbPipe: () => Record<string, never>;\n dsGlobalheaderBreadcrumbChevron: () => Record<string, never>;\n dsGlobalheaderBreadcrumbList: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItem: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItemLink: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItemLinkLabel: () => Record<string, never>;\n dsGlobalheaderMenubarContainer: () => Record<string, never>;\n dsGlobalheaderMenubarList: () => Record<string, never>;\n dsGlobalheaderMenubarItem: () => Record<string, never>;\n dsGlobalheaderMenubarItemButton: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuList: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItem: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItemButton: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuSeparator: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItemLabel: () => Record<string, never>;\n dsGlobalheaderMenubarItemSearchtoggleContainer: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonWrapper: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonText: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonSeparator: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonPrev: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonNext: () => Record<string, never>;\n dsGlobalheaderSearchtoggleTextinput: () => Record<string, never>;\n dsGlobalheaderSearchtoggleTriggerButton: () => Record<string, never>;\n dsGlobalheaderSearchtoggleExpandedContentWrapper: () => Record<string, never>;\n };\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n Logo: React.ComponentType;\n LogoWithBrand: React.ComponentType;\n breadcrumb: DSGlobalHeaderT.BreadcrumbItem[];\n toolbar: DSGlobalHeaderT.ToolbarItem[];\n CustomNavigation: React.ComponentType;\n }\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSGlobalHeaderName,\n typeof GLOBAL_HEADER_SLOTS\n > {}\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const DSGlobalHeaderPropTypes: DSPropTypesSchema<DSGlobalHeaderT.Props> = {\n ...getPropsPerSlotPropTypes(DSGlobalHeaderName, GLOBAL_HEADER_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n CustomNavigation: PropTypes.func\n .description(\n 'Component to use instead of the standard breadcrumb out of the box configuration for custom scenarios',\n )\n .defaultValue('() => JSX.Element'),\n Logo: PropTypes.func\n .description('Global Header Logo to render. Logo and LogoWithBrand are going to swap during window resizing.')\n .defaultValue('() => JSX.Element'),\n LogoWithBrand: PropTypes.func\n .description(\n 'Global Header Logo With Brand title to render. Logo and LogoWithBrand are going to swap during window resizing.',\n )\n .defaultValue('() => JSX.Element'),\n breadcrumb: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.description('breadrcrumb item label'),\n hasNext: PropTypes.bool.description('whether the item has a child or not'),\n isSelected: PropTypes.bool.description('whether the item is selected or not'),\n onClick: PropTypes.func.description('Callback executed on click'),\n }),\n )\n .description('Breadcrumb items to display. Max 3 levels. Compatible with GlobalAttributes.')\n .defaultValue('[]'),\n toolbar: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.description('title tag description'),\n type: PropTypes.oneOf(['ds-app-picker', 'ds-popup-menu', 'ds-search-toggle', 'custom']).description(\n 'use to select one of the out-of-the-box types of items',\n ),\n componentProps: PropTypes.object.description('props of out-of-the-box component'),\n Icon: PropTypes.func.description('Icon to display'),\n onClick: PropTypes.func.description('Callback executed on click'),\n }),\n )\n .description('Toolbar items. Compatible with GlobalAttributes.')\n .defaultValue('[]'),\n};\n// kept for legacy reasons, this is now named differently, but we want no breaking changes.\nexport const propTypes = DSGlobalHeaderPropTypes;\n\nexport const DSGlobalHeaderPropTypesSchema = DSGlobalHeaderPropTypes as unknown as ValidationMap<DSGlobalHeaderT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSAppPicker } from '@elliemae/ds-app-picker';\nimport type { DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport type { SvgIconT } from '@elliemae/ds-icons';\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n getPropsPerSlotPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport { DSGlobalHeaderName, GLOBAL_HEADER_SLOTS } from './constants/index.js';\n\nconst noop = () => null;\n\nexport const defaultProps = {\n breadcrumb: [],\n toolbar: [],\n LogoWithBrand: noop,\n Logo: noop,\n};\n\nexport declare namespace DSGlobalHeaderT {\n /* *************************************************************************************\n \"Breadcrumb widget\" configuration types\n ****************************************************************************************\n The breadcrumb items ARE SPREADING GLOBAL PROPS!!!\n + The breadcrumb items have a logic that force the onClick to be invoked on spacebar/enter too\n forcing it even if not the standard browser behaviour as per our buttons too\n ************************************************************************************** */\n export interface BreadcrumbItemOptionals {\n hasNext?: boolean;\n isSelected?: boolean;\n onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;\n }\n export interface BreadcrumbItemRequired {\n label: string;\n }\n export interface BreadcrumbItemOptionalsGlobals extends Omit<\n GlobalAttributesT,\n keyof BreadcrumbItemOptionals | keyof BreadcrumbItemRequired\n > {}\n\n export interface BreadcrumbItem\n extends BreadcrumbItemRequired, BreadcrumbItemOptionals, BreadcrumbItemOptionalsGlobals {}\n /* *************************************************************************************\n \"Toolbar widget\" configuration types\n ****************************************************************************************\n The toolbar item can be mainly of 4 different types\n - app-picker \n more or less map to ds-app-picker interface\n - popup-menu\n should more less map to dropdownmenu-v2 but should be changed to menu-button when possible\n - search-toggle\n a custom ad hoc implementation that expands in place and expose an input text,\n kinda problematic and force-added due to unrestrained \"yes man\" attitude with PM/PO\n we will be suggesting against using it officially in the later releases and try to find a better solution.\n - custom\n a way to allow app to provide their own render props along other pre-configured widgets out of the box\n ************************************************************************************** */\n\n /* *************************************************************************************\n toolbar -> type === 'custom'\n ************************************************************************************** */\n export interface ToolbarCustomComponentProps {\n item: Record<string, unknown> & {\n type: 'custom';\n CustomComponent: React.ComponentType<ToolbarCustomComponentProps>;\n };\n setRef: (ref: HTMLElement | null) => void;\n }\n export interface ToolbarCustomItem extends Record<string, unknown> {\n type: 'custom';\n label: string;\n CustomComponent: React.ComponentType<ToolbarCustomComponentProps>;\n }\n /* *************************************************************************************\n toolbar -> type === 'ds-search-toggle'\n ************************************************************************************** */\n // this props are actually required for the out-of-the-box to actually do what it needs to do\n // it's meant to be provided from the application, so this is kind of a weird way to do controlled components\n /**\n * Why the search region expanded or collapsed. Fired only for transitions this item drives itself \u2014\n * a controlled consumer flipping `isOpen` already knows, and detecting their flip would need an\n * effect watching state, which is not how this codebase reacts to state changes.\n */\n export type SearchToggleExpandChange = {\n reason: 'trigger' | 'escape';\n event: React.MouseEvent | React.KeyboardEvent;\n };\n\n export interface ToggleSearchComponentProps {\n /* Genuinely required: the search state and its transitions live in the application. */\n onNext: () => void;\n onPrevious: () => void;\n currentResultIndex: number;\n totalResults: number;\n value: string;\n onChange: (value: string) => void;\n onClear: () => void;\n onBlur?: () => void;\n /** Falls back to 'Search...'. */\n placeholder?: string;\n /** Supply to control the expanded state; omitted, the item manages it. */\n isOpen?: boolean;\n /*\n * Declared but not consumed by the part, which uses its own container keydown, toggle click and\n * trigger ref. Kept optional rather than removed because removing a declared key is a breaking type\n * change; do not add wiring for them without deciding what they should mean first.\n */\n onKeyDown?: (event: React.KeyboardEvent) => void;\n onClick?: (event: React.MouseEvent) => void;\n triggerRef?: React.MutableRefObject<HTMLButtonElement>;\n /** Merged with the part's own container ref when supplied. */\n searchContainerRef?: React.MutableRefObject<HTMLDivElement>;\n /**\n * Notified when the search region expands. PASSIVE \u2014 being told does not make you responsible: the\n * region still expands on its own unless you also supply `isOpen`.\n *\n * This is the disclosure-pattern counterpart to the `onOpen`/`onClose` the app-picker and popup-menu\n * items expose; the vocabulary differs because this item expands an inline region rather than opening\n * a dialog or a menu.\n */\n onExpand?: (info: SearchToggleExpandChange) => void;\n /** Notified when the search region collapses, on the same terms as `onExpand`. */\n onCollapse?: (info: SearchToggleExpandChange) => void;\n }\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface ToolbarSearchToggleItem extends Omit<GlobalAttributesT, 'type' | 'label'> {\n type: 'ds-search-toggle';\n label: string;\n /** Accessible name for the trigger once expanded. Defaults to a generic string. */\n ariaLabelExpanded?: string;\n componentProps: ToggleSearchComponentProps;\n }\n /* *************************************************************************************\n toolbar -> type === 'ds-popup-menu'\n ************************************************************************************** */\n\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupMenuContentItem extends Omit<GlobalAttributesT, 'type' | 'label' | 'onClick'> {\n type?: 'separator' | 'custom';\n /** Any `@elliemae/ds-icons` export. Typed from their own props so real icons satisfy it. */\n Icon?: React.ComponentType<SvgIconT.Props>;\n label?: string;\n onClick?: (event: React.MouseEvent) => void;\n closeOnClick?: boolean;\n Content?: React.ComponentType;\n }\n export interface PopupMenuComponentProps {\n onClickOutside?: (e: MouseEvent | TouchEvent) => void;\n /* Guarded at the call site (`if (onKeyPress)`), so optional. */\n onKeyPress?: (event: React.KeyboardEvent) => void;\n /* Guarded inside PopupMenuContent, whose own type already declares it optional. */\n popupOnKeyPress?: (event: React.KeyboardEvent) => void;\n /** Supply to control the menu; omitted, the item manages it. */\n isOpen?: boolean;\n /** The only genuinely required key \u2014 a menu with nothing to show has no purpose. */\n options: PopupMenuContentItem[];\n /** Close the menu when an option is clicked. */\n closeOnClick?: boolean;\n /**\n * Notified on every open transition. PASSIVE \u2014 being told does not make you responsible for the\n * transition: the menu opens and closes on its own unless you also supply `isOpen`.\n *\n * Every path reports: trigger click, ArrowDown, and a controlled flip of `isOpen`. Discriminate on\n * the payload's `reason` \u2014 `interaction` is the synchronous, event-carrying signal, `controlled-flip`\n * is the post-commit one that fires only when you own `isOpen`. A controlled consumer can see both\n * for one logical transition.\n */\n onOpen?: (info: DSHookFloatingContextT.OpenChange) => void;\n /**\n * Notified on every close transition, on the same terms as `onOpen`. Every path reports: click\n * outside, Escape inside the menu, an item click while `closeOnClick`, and a controlled flip.\n */\n onClose?: (info: DSHookFloatingContextT.OpenChange) => void;\n }\n // this is the only type that was pre-existing (even if differently defined)\n // and that's why it doesn't include Toolbar at the start\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupMenuItem extends Omit<GlobalAttributesT, 'type' | 'label' | 'onClick'> {\n type: 'ds-popup-menu';\n /** Any `@elliemae/ds-icons` export. Typed from their own props so real icons satisfy it. */\n Icon?: React.ComponentType<SvgIconT.Props>;\n label?: string;\n onClick?: (event: React.MouseEvent) => void;\n Content?: React.ComponentType;\n componentProps: PopupMenuComponentProps;\n }\n\n /* *************************************************************************************\n toolbar -> type === 'ds-app-picker'\n ************************************************************************************** */\n export type AppPickerComponentProps = React.ComponentProps<typeof DSAppPicker> & {\n triggerOnClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface ToolbarAppPickerItem extends Omit<GlobalAttributesT, 'type' | 'label'> {\n type: 'ds-app-picker';\n label: string;\n componentProps: AppPickerComponentProps;\n }\n\n /* *************************************************************************************\n toolbar -> type === undefined (fallback default)\n ************************************************************************************** */\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface ToolbarItemTypelessDefault extends Omit<GlobalAttributesT, 'label'> {\n type?: undefined;\n label: string;\n Icon: React.ComponentType<SvgIconT.Props>;\n }\n\n export type ToolbarItem =\n | ToolbarCustomItem\n | ToolbarSearchToggleItem\n | ToolbarAppPickerItem\n | PopupMenuItem // this is the only type that was pre-existing and that's why it doesn't include Toolbar at the start\n | ToolbarItemTypelessDefault;\n\n export type SlotFunctionArguments = {\n dsGlobalheaderRoot: () => Record<string, never>;\n dsGlobalheaderLogoContainer: () => Record<string, never>;\n dsGlobalheaderBreadcrumbContainer: () => Record<string, never>;\n dsGlobalheaderBreadcrumbPipe: () => Record<string, never>;\n dsGlobalheaderBreadcrumbChevron: () => Record<string, never>;\n dsGlobalheaderBreadcrumbList: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItem: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItemLink: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItemLinkLabel: () => Record<string, never>;\n dsGlobalheaderMenubarContainer: () => Record<string, never>;\n dsGlobalheaderMenubarList: () => Record<string, never>;\n dsGlobalheaderMenubarItem: () => Record<string, never>;\n dsGlobalheaderMenubarItemButton: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuContainer: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuList: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItem: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItemButton: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuSeparator: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItemLabel: () => Record<string, never>;\n dsGlobalheaderMenubarItemSearchtoggleContainer: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonWrapper: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonText: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonSeparator: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonPrev: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonNext: () => Record<string, never>;\n dsGlobalheaderSearchtoggleTextinput: () => Record<string, never>;\n dsGlobalheaderSearchtoggleTriggerButton: () => Record<string, never>;\n dsGlobalheaderSearchtoggleExpandedContentWrapper: () => Record<string, never>;\n };\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n Logo: React.ComponentType;\n LogoWithBrand: React.ComponentType;\n breadcrumb: DSGlobalHeaderT.BreadcrumbItem[];\n toolbar: DSGlobalHeaderT.ToolbarItem[];\n CustomNavigation: React.ComponentType;\n }\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSGlobalHeaderName,\n typeof GLOBAL_HEADER_SLOTS\n > {}\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const DSGlobalHeaderPropTypes: DSPropTypesSchema<DSGlobalHeaderT.Props> = {\n ...getPropsPerSlotPropTypes(DSGlobalHeaderName, GLOBAL_HEADER_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n CustomNavigation: PropTypes.func\n .description(\n 'Component to use instead of the standard breadcrumb out of the box configuration for custom scenarios',\n )\n .defaultValue('() => JSX.Element'),\n Logo: PropTypes.func\n .description('Global Header Logo to render. Logo and LogoWithBrand are going to swap during window resizing.')\n .defaultValue('() => JSX.Element'),\n LogoWithBrand: PropTypes.func\n .description(\n 'Global Header Logo With Brand title to render. Logo and LogoWithBrand are going to swap during window resizing.',\n )\n .defaultValue('() => JSX.Element'),\n breadcrumb: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.description('breadrcrumb item label'),\n hasNext: PropTypes.bool.description('whether the item has a child or not'),\n isSelected: PropTypes.bool.description('whether the item is selected or not'),\n onClick: PropTypes.func.description('Callback executed on click'),\n }),\n )\n .description('Breadcrumb items to display. Max 3 levels. Compatible with GlobalAttributes.')\n .defaultValue('[]'),\n toolbar: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.description('title tag description'),\n type: PropTypes.oneOf(['ds-app-picker', 'ds-popup-menu', 'ds-search-toggle', 'custom']).description(\n 'use to select one of the out-of-the-box types of items',\n ),\n componentProps: PropTypes.object.description('props of out-of-the-box component'),\n Icon: PropTypes.func.description('Icon to display'),\n onClick: PropTypes.func.description('Callback executed on click'),\n }),\n )\n .description('Toolbar items. Compatible with GlobalAttributes.')\n .defaultValue('[]'),\n};\n// kept for legacy reasons, this is now named differently, but we want no breaking changes.\nexport const propTypes = DSGlobalHeaderPropTypes;\n\nexport const DSGlobalHeaderPropTypesSchema = DSGlobalHeaderPropTypes as unknown as ValidationMap<DSGlobalHeaderT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,8BAKO;AAGP,uBAAwD;AAExD,MAAM,OAAO,MAAM;AAEZ,MAAM,eAAe;AAAA,EAC1B,YAAY,CAAC;AAAA,EACb,SAAS,CAAC;AAAA,EACV,eAAe;AAAA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ile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { DSGlobalHeaderT } from './react-desc-prop-types.js';\n\n/* ******************************************************************************\n KEPT AROUND FOR BACKWARD COMPATIBILITY, THIS IS LEGACY!\n*********************************************************************************\nthis should be code-modded away in code-bases in favour of the actual namespace.\n******************************************************************************* */\n\n/**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT` instead.\n */\nexport declare namespace DSGlobalHeaderInternalsT {\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.DefaultProps` instead.\n */\n export interface DefaultProps extends DSGlobalHeaderT.DefaultProps {}\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.InternalProps` instead.\n */\n export interface InternalProps extends DSGlobalHeaderT.InternalProps {}\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.BreadcrumbItem` instead.\n */\n export interface BreadcrumbItem extends DSGlobalHeaderT.BreadcrumbItem {}\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.ToolbarCustomComponentProps` instead.\n */\n export interface ToolbarCustomComponentProps extends DSGlobalHeaderT.ToolbarCustomComponentProps {}\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.ToolbarItem` instead.\n */\n export type ToolbarItem = DSGlobalHeaderT.ToolbarItem;\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.PopupMenuContentItem` instead.\n */\n export interface PopupMenuContentItem extends DSGlobalHeaderT.PopupMenuContentItem {}\n /**\n * @deprecated
|
|
4
|
+
"sourcesContent": ["import type { PopupMenuT } from './parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js';\nimport type { PopupMenuContentT } from './parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js';\nimport type { DSGlobalHeaderT } from './react-desc-prop-types.js';\nimport type { GlobalHeaderCTX } from './config/useGlobalHeader.js';\n\n/* ******************************************************************************\n KEPT AROUND FOR BACKWARD COMPATIBILITY, THIS IS LEGACY!\n*********************************************************************************\nthis should be code-modded away in code-bases in favour of the actual namespace.\n******************************************************************************* */\n\n/**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT` instead.\n */\nexport declare namespace DSGlobalHeaderInternalsT {\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.DefaultProps` instead.\n */\n export interface DefaultProps extends DSGlobalHeaderT.DefaultProps {}\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.InternalProps` instead.\n */\n export interface InternalProps extends DSGlobalHeaderT.InternalProps {}\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.BreadcrumbItem` instead.\n */\n export interface BreadcrumbItem extends DSGlobalHeaderT.BreadcrumbItem {}\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.ToolbarCustomComponentProps` instead.\n */\n export interface ToolbarCustomComponentProps extends DSGlobalHeaderT.ToolbarCustomComponentProps {}\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.ToolbarItem` instead.\n */\n export type ToolbarItem = DSGlobalHeaderT.ToolbarItem;\n /**\n * @deprecated This namespace is outdated. Use `DSGlobalHeaderT.PopupMenuContentItem` instead.\n */\n export interface PopupMenuContentItem extends DSGlobalHeaderT.PopupMenuContentItem {}\n /**\n * @deprecated Internal wrapper contract, not a shape an application authors. It moved to the part that\n * owns it \u2014 `PopupMenuContentT.Props` in\n * `parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.ts` \u2014 and this alias is kept\n * pointing at it only so the deprecation notice does not dangle. What you almost certainly want is\n * `DSGlobalHeaderT.PopupMenuComponentProps` or `DSGlobalHeaderT.PopupMenuContentItem`.\n */\n export interface PopupMenuContentProps extends PopupMenuContentT.Props {}\n /**\n * @deprecated Internal wrapper contract, not a shape an application authors. It moved to the part that\n * owns it \u2014 `PopupMenuT.Props` in `parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.ts` \u2014 and\n * this alias is kept pointing at it only so the deprecation notice does not dangle. What you almost\n * certainly want is `DSGlobalHeaderT.PopupMenuItem`.\n */\n export interface PopupProps extends PopupMenuT.Props {}\n /**\n * @deprecated This namespace is outdated. You should not need the internal shape of the context externally. Get in touch with the team if you think you do.\n */\n export interface Context extends GlobalHeaderCTX {}\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -48,6 +48,58 @@ const customToolbarItemAsSyntax = {
|
|
|
48
48
|
label: "Custom Toolbar Item",
|
|
49
49
|
CustomComponent: EmptyComponent
|
|
50
50
|
};
|
|
51
|
+
const searchToggleToolbarItemMinimum = {
|
|
52
|
+
type: "ds-search-toggle",
|
|
53
|
+
label: "Search",
|
|
54
|
+
componentProps: {
|
|
55
|
+
// No placeholder (falls back), no isOpen (self-managed), no onKeyDown / onClick / triggerRef /
|
|
56
|
+
// searchContainerRef (not consumed by the part).
|
|
57
|
+
onNext: () => {
|
|
58
|
+
},
|
|
59
|
+
onPrevious: () => {
|
|
60
|
+
},
|
|
61
|
+
currentResultIndex: 0,
|
|
62
|
+
totalResults: 0,
|
|
63
|
+
value: "",
|
|
64
|
+
onChange: () => {
|
|
65
|
+
},
|
|
66
|
+
onClear: () => {
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const searchToggleToolbarItemWithItemLevelAttributes = {
|
|
71
|
+
type: "ds-search-toggle",
|
|
72
|
+
label: "Search",
|
|
73
|
+
id: "search-toggle",
|
|
74
|
+
ariaLabelExpanded: "Collapse search",
|
|
75
|
+
"aria-label": "Search the page",
|
|
76
|
+
componentProps: {
|
|
77
|
+
onNext: () => {
|
|
78
|
+
},
|
|
79
|
+
onPrevious: () => {
|
|
80
|
+
},
|
|
81
|
+
currentResultIndex: 0,
|
|
82
|
+
totalResults: 0,
|
|
83
|
+
value: "",
|
|
84
|
+
onChange: () => {
|
|
85
|
+
},
|
|
86
|
+
onClear: () => {
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const popupMenuToolbarItemMinimum = {
|
|
91
|
+
type: "ds-popup-menu",
|
|
92
|
+
// No onKeyPress / popupOnKeyPress (both guarded), no isOpen (self-managed), no closeOnClick.
|
|
93
|
+
componentProps: { options: [{ label: "Only key that is genuinely required" }] }
|
|
94
|
+
};
|
|
95
|
+
const popupMenuToolbarItemNotified = {
|
|
96
|
+
type: "ds-popup-menu",
|
|
97
|
+
componentProps: {
|
|
98
|
+
options: [{ label: "Item" }],
|
|
99
|
+
onOpen: (info) => info.reason,
|
|
100
|
+
onClose: (info) => info.reason
|
|
101
|
+
}
|
|
102
|
+
};
|
|
51
103
|
const searchToggleToolbarItemStrict = {
|
|
52
104
|
type: "ds-search-toggle",
|
|
53
105
|
label: "Search",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/typescript-testing/typescript-global-header-toolbar-types.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React from 'react';\nimport type { DSGlobalHeaderT } from '../index.js';\n\nconst EmptyComponent: React.FC = () => null;\nconst IconPlaceholder: React.FC = () => null;\nconst divRef = React.createRef<HTMLDivElement>() as React.MutableRefObject<HTMLDivElement>;\nconst buttonRef = React.createRef<HTMLButtonElement>() as React.MutableRefObject<HTMLButtonElement>;\n\n/* *************************************************************************************\n TESTING INTERFACE FOR THE OUT OF THE BOX TOOLBAR WIDGET\n************************************************************************************** */\n\n/* *************************************************************************************\n Toolbar -> ToolbarCustomItem\n************************************************************************************** */\nconst customToolbarItemStrict: DSGlobalHeaderT.ToolbarCustomItem = {\n type: 'custom',\n label: 'Custom Toolbar Item',\n CustomComponent: EmptyComponent,\n};\nconst customToolbarItemAsSyntax = {\n type: 'custom',\n label: 'Custom Toolbar Item',\n CustomComponent: EmptyComponent,\n} as DSGlobalHeaderT.ToolbarCustomItem;\n/* *************************************************************************************\n Toolbar -> ToolbarSearchToggleItem\n************************************************************************************** */\nconst searchToggleToolbarItemStrict: DSGlobalHeaderT.ToolbarSearchToggleItem = {\n type: 'ds-search-toggle',\n label: 'Search',\n componentProps: {\n onNext: () => {},\n onPrevious: () => {},\n currentResultIndex: 0,\n totalResults: 0,\n placeholder: 'Search...',\n value: '',\n onChange: () => {},\n onBlur: () => {},\n onClear: () => {},\n isOpen: false,\n onKeyDown: (event: React.KeyboardEvent) => {},\n onClick: (event: React.MouseEvent) => {},\n triggerRef: buttonRef,\n searchContainerRef: divRef,\n },\n};\nconst searchToggleToolbarItemAsSyntax = {\n type: 'ds-search-toggle',\n label: 'Search',\n componentProps: {\n onNext: () => {},\n onPrevious: () => {},\n currentResultIndex: 0,\n totalResults: 0,\n placeholder: 'Search...',\n value: '',\n onChange: () => {},\n onBlur: () => {},\n onClear: () => {},\n isOpen: false,\n onKeyDown: (event: React.KeyboardEvent) => {},\n onClick: (event: React.MouseEvent) => {},\n triggerRef: buttonRef,\n searchContainerRef: divRef,\n },\n} as DSGlobalHeaderT.ToolbarSearchToggleItem;\n/* *************************************************************************************\n Toolbar -> ToolbarAppPickerItem\n************************************************************************************** */\nconst appPickerToolbarItemStrict: DSGlobalHeaderT.ToolbarAppPickerItem = {\n id: 'app-picker',\n type: 'ds-app-picker',\n label: 'Apps',\n componentProps: {\n sectionTitle: 'APPLICATIONS',\n apps: [\n {\n id: '0',\n label: 'Dashboard',\n icon: IconPlaceholder,\n onClick: () => {},\n selected: false,\n },\n ],\n customSectionTitle: 'RESOURCES',\n customApps: [\n {\n id: '7',\n label: 'Profile',\n icon: IconPlaceholder,\n onClick: () => {},\n selected: false,\n },\n ],\n },\n};\nconst appPickerToolbarItemAsSyntax = {\n id: 'app-picker',\n type: 'ds-app-picker',\n label: 'Apps',\n componentProps: {\n sectionTitle: 'APPLICATIONS',\n apps: [\n {\n id: '0',\n label: 'Dashboard',\n icon: IconPlaceholder,\n onClick: () => {},\n selected: false,\n },\n ],\n customSectionTitle: 'RESOURCES',\n customApps: [\n {\n id: '7',\n label: 'Profile',\n icon: IconPlaceholder,\n onClick: () => {},\n selected: false,\n },\n ],\n },\n} as DSGlobalHeaderT.ToolbarAppPickerItem;\n/* *************************************************************************************\n Toolbar -> PopupMenuItem\n************************************************************************************** */\nconst popupMenuToolbarItemStrict: DSGlobalHeaderT.PopupMenuItem = {\n type: 'ds-popup-menu',\n Icon: IconPlaceholder,\n label: 'Popup Menu',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n componentProps: {\n onClickOutside: (e: MouseEvent | TouchEvent) => {},\n onKeyPress: (event: React.KeyboardEvent) => {},\n popupOnKeyPress: (event: React.KeyboardEvent) => {},\n isOpen: true,\n options: [\n {\n type: 'custom',\n Icon: IconPlaceholder,\n label: 'Custom Option',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n },\n {\n type: 'separator',\n Icon: IconPlaceholder,\n label: 'Separator',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n },\n {\n label: 'Custom Option',\n onClick: (event: React.MouseEvent) => {},\n },\n ],\n closeOnClick: true,\n },\n};\nconst popupMenuToolbarItemAsSyntax = {\n type: 'ds-popup-menu',\n Icon: IconPlaceholder,\n label: 'Popup Menu',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n componentProps: {\n onClickOutside: (e: MouseEvent | TouchEvent) => {},\n onKeyPress: (event: React.KeyboardEvent) => {},\n popupOnKeyPress: (event: React.KeyboardEvent) => {},\n isOpen: true,\n options: [\n {\n type: 'custom',\n Icon: IconPlaceholder,\n label: 'Custom Option',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n },\n {\n type: 'separator',\n Icon: IconPlaceholder,\n label: 'Separator',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n },\n {\n label: 'Custom Option',\n onClick: (event: React.MouseEvent) => {},\n },\n ],\n closeOnClick: true,\n },\n} as DSGlobalHeaderT.PopupMenuItem;\n\n/* *************************************************************************************\n Toolbar -> ToolbarItemTypelessDefault\n************************************************************************************** */\nconst toolbarItemTypelessDefaultStrict: DSGlobalHeaderT.ToolbarItemTypelessDefault = {\n label: 'Default Label',\n Icon: IconPlaceholder,\n onClick: (event: React.MouseEvent) => {},\n};\n\nconst toolbarItemTypelessDefaultAsSyntax = {\n label: 'Default Label',\n Icon: IconPlaceholder,\n onClick: (event: React.MouseEvent) => {},\n} as DSGlobalHeaderT.ToolbarItemTypelessDefault;\nconst toolbarItemTypelessDefaultStrictExplicit: DSGlobalHeaderT.ToolbarItemTypelessDefault = {\n type: undefined,\n label: 'Default Label',\n Icon: IconPlaceholder,\n onClick: (event: React.MouseEvent) => {},\n};\n\nconst toolbarItemTypelessDefaultAsSyntaxExplicit = {\n type: undefined,\n label: 'Default Label',\n Icon: IconPlaceholder,\n onClick: (event: React.MouseEvent) => {},\n} as DSGlobalHeaderT.ToolbarItemTypelessDefault;\n\n/* *************************************************************************************\n <Globalheader toolbar={...}>\n************************************************************************************** */\nexport const toolbarItemsStrict: DSGlobalHeaderT.DefaultProps['toolbar'] = [\n customToolbarItemStrict,\n searchToggleToolbarItemStrict,\n appPickerToolbarItemStrict,\n popupMenuToolbarItemStrict,\n toolbarItemTypelessDefaultStrict,\n];\nexport const toolbarItemsAsSyntax = [\n customToolbarItemAsSyntax,\n searchToggleToolbarItemAsSyntax,\n appPickerToolbarItemAsSyntax,\n popupMenuToolbarItemAsSyntax,\n toolbarItemTypelessDefaultAsSyntax,\n] as DSGlobalHeaderT.DefaultProps['toolbar'];\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAkB;AAGlB,MAAM,iBAA2B,MAAM;AACvC,MAAM,kBAA4B,MAAM;AACxC,MAAM,SAAS,aAAAA,QAAM,UAA0B;AAC/C,MAAM,YAAY,aAAAA,QAAM,UAA6B;AASrD,MAAM,0BAA6D;AAAA,EACjE,MAAM;AAAA,EACN,OAAO;AAAA,EACP,iBAAiB;AACnB;AACA,MAAM,4BAA4B;AAAA,EAChC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,iBAAiB;AACnB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React from 'react';\nimport type { DSGlobalHeaderT } from '../index.js';\n\nconst EmptyComponent: React.FC = () => null;\nconst IconPlaceholder: React.FC = () => null;\nconst divRef = React.createRef<HTMLDivElement>() as React.MutableRefObject<HTMLDivElement>;\nconst buttonRef = React.createRef<HTMLButtonElement>() as React.MutableRefObject<HTMLButtonElement>;\n\n/* *************************************************************************************\n TESTING INTERFACE FOR THE OUT OF THE BOX TOOLBAR WIDGET\n************************************************************************************** */\n\n/* *************************************************************************************\n Toolbar -> ToolbarCustomItem\n************************************************************************************** */\nconst customToolbarItemStrict: DSGlobalHeaderT.ToolbarCustomItem = {\n type: 'custom',\n label: 'Custom Toolbar Item',\n CustomComponent: EmptyComponent,\n};\nconst customToolbarItemAsSyntax = {\n type: 'custom',\n label: 'Custom Toolbar Item',\n CustomComponent: EmptyComponent,\n} as DSGlobalHeaderT.ToolbarCustomItem;\n/* *************************************************************************************\n PUI-18647 \u2014 the MINIMUM each consumer-facing item type accepts.\n\n These pin the widening, and they are the half that regresses silently: the maximal cases below\n still compile if a key is wrongly required again, so only a minimum case catches it. Every key\n omitted here is one the runtime supplies or guards \u2014 re-requiring any of them forces correct\n consumer code to fail to type-check, which is what these exist to prevent.\n************************************************************************************** */\nconst searchToggleToolbarItemMinimum: DSGlobalHeaderT.ToolbarSearchToggleItem = {\n type: 'ds-search-toggle',\n label: 'Search',\n componentProps: {\n // No placeholder (falls back), no isOpen (self-managed), no onKeyDown / onClick / triggerRef /\n // searchContainerRef (not consumed by the part).\n onNext: () => {},\n onPrevious: () => {},\n currentResultIndex: 0,\n totalResults: 0,\n value: '',\n onChange: () => {},\n onClear: () => {},\n },\n};\n\n/*\n * Item-level global attributes and `ariaLabelExpanded` belong on the entry itself. The runtime forwards\n * them to the item's root container; before PUI-18647 this type extended no global-attribute surface at\n * all, so none of the keys below were admitted.\n *\n * Note what is NOT asserted here: a literal `data-public` key. `GlobalAttributesT` enumerates the HTML\n * global set and carries no index signature, so an arbitrary `data-*` written literally is an excess\n * property on EVERY toolbar item type, not just this one \u2014 consumers reach it by spreading an object\n * instead, which is what the stories do. That gap belongs to ds-props-helpers, not here.\n */\nconst searchToggleToolbarItemWithItemLevelAttributes: DSGlobalHeaderT.ToolbarSearchToggleItem = {\n type: 'ds-search-toggle',\n label: 'Search',\n id: 'search-toggle',\n ariaLabelExpanded: 'Collapse search',\n 'aria-label': 'Search the page',\n componentProps: {\n onNext: () => {},\n onPrevious: () => {},\n currentResultIndex: 0,\n totalResults: 0,\n value: '',\n onChange: () => {},\n onClear: () => {},\n },\n};\n\nconst popupMenuToolbarItemMinimum: DSGlobalHeaderT.PopupMenuItem = {\n type: 'ds-popup-menu',\n // No onKeyPress / popupOnKeyPress (both guarded), no isOpen (self-managed), no closeOnClick.\n componentProps: { options: [{ label: 'Only key that is genuinely required' }] },\n};\n\n// Passive open/close notification \u2014 being told must not require owning `isOpen`.\nconst popupMenuToolbarItemNotified: DSGlobalHeaderT.PopupMenuItem = {\n type: 'ds-popup-menu',\n componentProps: {\n options: [{ label: 'Item' }],\n onOpen: (info) => info.reason,\n onClose: (info) => info.reason,\n },\n};\n\n/* *************************************************************************************\n Toolbar -> ToolbarSearchToggleItem\n************************************************************************************** */\nconst searchToggleToolbarItemStrict: DSGlobalHeaderT.ToolbarSearchToggleItem = {\n type: 'ds-search-toggle',\n label: 'Search',\n componentProps: {\n onNext: () => {},\n onPrevious: () => {},\n currentResultIndex: 0,\n totalResults: 0,\n placeholder: 'Search...',\n value: '',\n onChange: () => {},\n onBlur: () => {},\n onClear: () => {},\n isOpen: false,\n onKeyDown: (event: React.KeyboardEvent) => {},\n onClick: (event: React.MouseEvent) => {},\n triggerRef: buttonRef,\n searchContainerRef: divRef,\n },\n};\nconst searchToggleToolbarItemAsSyntax = {\n type: 'ds-search-toggle',\n label: 'Search',\n componentProps: {\n onNext: () => {},\n onPrevious: () => {},\n currentResultIndex: 0,\n totalResults: 0,\n placeholder: 'Search...',\n value: '',\n onChange: () => {},\n onBlur: () => {},\n onClear: () => {},\n isOpen: false,\n onKeyDown: (event: React.KeyboardEvent) => {},\n onClick: (event: React.MouseEvent) => {},\n triggerRef: buttonRef,\n searchContainerRef: divRef,\n },\n} as DSGlobalHeaderT.ToolbarSearchToggleItem;\n/* *************************************************************************************\n Toolbar -> ToolbarAppPickerItem\n************************************************************************************** */\nconst appPickerToolbarItemStrict: DSGlobalHeaderT.ToolbarAppPickerItem = {\n id: 'app-picker',\n type: 'ds-app-picker',\n label: 'Apps',\n componentProps: {\n sectionTitle: 'APPLICATIONS',\n apps: [\n {\n id: '0',\n label: 'Dashboard',\n icon: IconPlaceholder,\n onClick: () => {},\n selected: false,\n },\n ],\n customSectionTitle: 'RESOURCES',\n customApps: [\n {\n id: '7',\n label: 'Profile',\n icon: IconPlaceholder,\n onClick: () => {},\n selected: false,\n },\n ],\n },\n};\nconst appPickerToolbarItemAsSyntax = {\n id: 'app-picker',\n type: 'ds-app-picker',\n label: 'Apps',\n componentProps: {\n sectionTitle: 'APPLICATIONS',\n apps: [\n {\n id: '0',\n label: 'Dashboard',\n icon: IconPlaceholder,\n onClick: () => {},\n selected: false,\n },\n ],\n customSectionTitle: 'RESOURCES',\n customApps: [\n {\n id: '7',\n label: 'Profile',\n icon: IconPlaceholder,\n onClick: () => {},\n selected: false,\n },\n ],\n },\n} as DSGlobalHeaderT.ToolbarAppPickerItem;\n/* *************************************************************************************\n Toolbar -> PopupMenuItem\n************************************************************************************** */\nconst popupMenuToolbarItemStrict: DSGlobalHeaderT.PopupMenuItem = {\n type: 'ds-popup-menu',\n Icon: IconPlaceholder,\n label: 'Popup Menu',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n componentProps: {\n onClickOutside: (e: MouseEvent | TouchEvent) => {},\n onKeyPress: (event: React.KeyboardEvent) => {},\n popupOnKeyPress: (event: React.KeyboardEvent) => {},\n isOpen: true,\n options: [\n {\n type: 'custom',\n Icon: IconPlaceholder,\n label: 'Custom Option',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n },\n {\n type: 'separator',\n Icon: IconPlaceholder,\n label: 'Separator',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n },\n {\n label: 'Custom Option',\n onClick: (event: React.MouseEvent) => {},\n },\n ],\n closeOnClick: true,\n },\n};\nconst popupMenuToolbarItemAsSyntax = {\n type: 'ds-popup-menu',\n Icon: IconPlaceholder,\n label: 'Popup Menu',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n componentProps: {\n onClickOutside: (e: MouseEvent | TouchEvent) => {},\n onKeyPress: (event: React.KeyboardEvent) => {},\n popupOnKeyPress: (event: React.KeyboardEvent) => {},\n isOpen: true,\n options: [\n {\n type: 'custom',\n Icon: IconPlaceholder,\n label: 'Custom Option',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n },\n {\n type: 'separator',\n Icon: IconPlaceholder,\n label: 'Separator',\n onClick: (event: React.MouseEvent) => {},\n Content: EmptyComponent,\n },\n {\n label: 'Custom Option',\n onClick: (event: React.MouseEvent) => {},\n },\n ],\n closeOnClick: true,\n },\n} as DSGlobalHeaderT.PopupMenuItem;\n\n/* *************************************************************************************\n Toolbar -> ToolbarItemTypelessDefault\n************************************************************************************** */\nconst toolbarItemTypelessDefaultStrict: DSGlobalHeaderT.ToolbarItemTypelessDefault = {\n label: 'Default Label',\n Icon: IconPlaceholder,\n onClick: (event: React.MouseEvent) => {},\n};\n\nconst toolbarItemTypelessDefaultAsSyntax = {\n label: 'Default Label',\n Icon: IconPlaceholder,\n onClick: (event: React.MouseEvent) => {},\n} as DSGlobalHeaderT.ToolbarItemTypelessDefault;\nconst toolbarItemTypelessDefaultStrictExplicit: DSGlobalHeaderT.ToolbarItemTypelessDefault = {\n type: undefined,\n label: 'Default Label',\n Icon: IconPlaceholder,\n onClick: (event: React.MouseEvent) => {},\n};\n\nconst toolbarItemTypelessDefaultAsSyntaxExplicit = {\n type: undefined,\n label: 'Default Label',\n Icon: IconPlaceholder,\n onClick: (event: React.MouseEvent) => {},\n} as DSGlobalHeaderT.ToolbarItemTypelessDefault;\n\n/* *************************************************************************************\n <Globalheader toolbar={...}>\n************************************************************************************** */\nexport const toolbarItemsStrict: DSGlobalHeaderT.DefaultProps['toolbar'] = [\n customToolbarItemStrict,\n searchToggleToolbarItemStrict,\n appPickerToolbarItemStrict,\n popupMenuToolbarItemStrict,\n toolbarItemTypelessDefaultStrict,\n];\nexport const toolbarItemsAsSyntax = [\n customToolbarItemAsSyntax,\n searchToggleToolbarItemAsSyntax,\n appPickerToolbarItemAsSyntax,\n popupMenuToolbarItemAsSyntax,\n toolbarItemTypelessDefaultAsSyntax,\n] as DSGlobalHeaderT.DefaultProps['toolbar'];\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAkB;AAGlB,MAAM,iBAA2B,MAAM;AACvC,MAAM,kBAA4B,MAAM;AACxC,MAAM,SAAS,aAAAA,QAAM,UAA0B;AAC/C,MAAM,YAAY,aAAAA,QAAM,UAA6B;AASrD,MAAM,0BAA6D;AAAA,EACjE,MAAM;AAAA,EACN,OAAO;AAAA,EACP,iBAAiB;AACnB;AACA,MAAM,4BAA4B;AAAA,EAChC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,i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7
7
|
}
|
|
@@ -18,7 +18,20 @@ const DSGlobalHeader = (props) => {
|
|
|
18
18
|
const ctx = useGlobalHeader(props);
|
|
19
19
|
const {
|
|
20
20
|
props: { toolbar },
|
|
21
|
-
|
|
21
|
+
/*
|
|
22
|
+
* The slot layer, split into its two genuinely separate halves.
|
|
23
|
+
*
|
|
24
|
+
* `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's
|
|
25
|
+
* slot prop, so it can only come from DSGlobalHeader — that is what the verbose drilled name says out
|
|
26
|
+
* loud when it reaches the out-of-the-box parts.
|
|
27
|
+
*
|
|
28
|
+
* `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,
|
|
29
|
+
* so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's
|
|
30
|
+
* own elements have render-time values worth passing. Stated rather than omitted, so "what arguments
|
|
31
|
+
* does this slot get?" always has a visible answer.
|
|
32
|
+
*/
|
|
33
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
34
|
+
noSlotArguments,
|
|
22
35
|
fontDetector
|
|
23
36
|
} = ctx;
|
|
24
37
|
const propsWithDefaults = ctx.props;
|
|
@@ -51,7 +64,8 @@ const DSGlobalHeader = (props) => {
|
|
|
51
64
|
{
|
|
52
65
|
...globalAttrs,
|
|
53
66
|
...xstyledAttrs,
|
|
54
|
-
|
|
67
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
68
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
55
69
|
forwardedAs: "header",
|
|
56
70
|
"data-testid": GLOBAL_HEADER_DATA_TESTID.CONTAINER,
|
|
57
71
|
cols: cols2,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSGlobalHeader.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0Ef,SACE,KADF;AA1ER,SAAuB,YAAY;AACnC,SAAS,UAAU,wBAAwB,0BAA0B;AACrE,SAAS,wBAAwB;AACjC,SAAS,eAAe;AACxB,SAAS,6BAA6B;AACtC,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,oBAAoB,eAAe,iCAAiC;AAC7E,SAAS,8BAA8B;AACvC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,iBAAiB;AAC1B,SAAS,qCAA2D;AAEpE,MAAM,iBAAiB,CAAC,UAA8C;AACpE,mBAAiB,KAAK;AACtB,QAAM,MAAM,gBAAgB,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,cAAc,uBAA6E,iBAAiB;AAClH,QAAM,eAAe,mBAAmB,iBAAiB;AACzD,QAAM,aAAa,iBAAiB;AAEpC,QAAM,QAAQ,QAAQ,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,cAAc,OAAO;AACtC,aAAO,CAAC,QAAQ,KAAK;AAAA,IACvB;AACA,WAAO,CAAC,OAAO,MAAM;AAAA,EACvB,GAAG,CAAC,cAAc,UAAU,CAAC;AAE7B,QAAM,OAAO,QAAQ,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,0BAA0B;AAAA,MACvC,MAAM;AAAA,MAEN,+BAAC,sBAAsB,UAAtB,EAA+B,OAAO,KACrC;AAAA,6BAAC,QAAK,MACJ;AAAA,8BAAC,oBAAiB;AAAA,UAClB,oBAAC,0BAAuB;AAAA,WAC1B;AAAA,QACC,QAAQ,SAAS,oBAAC,uBAAoB,IAAK;AAAA,SAC9C;AAAA;AAAA,EACF;AAEJ;AAEA,eAAe,cAAc;AAC7B,MAAM,2BAA2B,SAAS,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": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSGlobalHeaderContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;AAG9B,MAAM,iBAAiB,CAAC;AAEjB,MAAM,wBAAwB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type { GlobalHeaderCTX } from './config/useGlobalHeader.js';\n\nconst defaultContext = {} as GlobalHeaderCTX;\n\nexport const DSGlobalHeaderContext = createContext<GlobalHeaderCTX>(defaultContext);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;AAG9B,MAAM,iBAAiB,CAAC;AAEjB,MAAM,wBAAwB,cAA+B,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,6 +14,8 @@ const useGlobalHeader = (props) => {
|
|
|
14
14
|
[propsWithDefaults.toolbar]
|
|
15
15
|
);
|
|
16
16
|
const ownerProps = useOwnerProps(props);
|
|
17
|
+
const getOwnerPropsAwareOfPropsPassedToGlobalHeader = ownerProps.getOwnerProps;
|
|
18
|
+
const noSlotArguments = ownerProps.getOwnerPropsArguments;
|
|
17
19
|
const fontDetector = useFontsizeMedia({
|
|
18
20
|
largeFont: FONT_DETECTOR.LARGE,
|
|
19
21
|
mediumFont: FONT_DETECTOR.MEDIUM,
|
|
@@ -27,9 +29,18 @@ const useGlobalHeader = (props) => {
|
|
|
27
29
|
instanceUID,
|
|
28
30
|
globalHeaderToolbarGrid,
|
|
29
31
|
fontDetector,
|
|
30
|
-
|
|
32
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
33
|
+
noSlotArguments
|
|
31
34
|
}),
|
|
32
|
-
[
|
|
35
|
+
[
|
|
36
|
+
propsWithDefaults,
|
|
37
|
+
showIconOnly,
|
|
38
|
+
instanceUID,
|
|
39
|
+
globalHeaderToolbarGrid,
|
|
40
|
+
fontDetector,
|
|
41
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
42
|
+
noSlotArguments
|
|
43
|
+
]
|
|
33
44
|
);
|
|
34
45
|
};
|
|
35
46
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useGlobalHeader.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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,YAAY,WAAW;ACAvB,SAAS,wBAAwB;AACjC,SAAS,8BAA8B,qBAAqB;AAC5D,SAAS,SAAS,gBAAgB;AAClC,SAAS,WAAW;AACpB,SAAS,oBAA0C;AACnD,SAAS,qBAAqB;AAEvB,MAAM,kBAAkB,CAAC,UAAiC;AAC/D,QAAM,CAAC,cAAc,eAAe,IAAI,SAAkB,KAAK;AAE/D,QAAM,oBAAoB,6BAA4D,OAAO,YAAY;AAEzG,QAAM,cAAc,QAAQ,MAAM,oBAAoB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAElE,QAAM,0BAA0B;AAAA,IAC9B,MAAM,IAAI,MAAM,kBAAkB,QAAQ,MAAM,EAAE,KAAK,MAAM;AAAA,IAC7D,CAAC,kBAAkB,OAAO;AAAA,EAC5B;AAEA,QAAM,aAAa,cAAc,KAAK;AAEtC,QAAM,eAAe,iBAAiB;AAAA,IACpC,WAAW,cAAc;AAAA,IACzB,YAAY,cAAc;AAAA,IAC1B,WAAW,cAAc;AAAA,EAC3B,CAAC;AAED,SAAO;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 * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;AACjC,SAAS,8BAA8B,qBAAqB;AAC5D,SAAS,SAAS,gBAAgB;AAClC,SAAS,WAAW;AACpB,SAAS,oBAA0C;AACnD,SAAS,qBAAqB;AAEvB,MAAM,kBAAkB,CAAC,UAAiC;AAC/D,QAAM,CAAC,cAAc,eAAe,IAAI,SAAkB,KAAK;AAE/D,QAAM,oBAAoB,6BAA4D,OAAO,YAAY;AAEzG,QAAM,cAAc,QAAQ,MAAM,oBAAoB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAElE,QAAM,0BAA0B;AAAA,IAC9B,MAAM,IAAI,MAAM,kBAAkB,QAAQ,MAAM,EAAE,KAAK,MAAM;AAAA,IAC7D,CAAC,kBAAkB,OAAO;AAAA,EAC5B;AAEA,QAAM,aAAa,cAAc,KAAK;AAEtC,QAAM,gDAAgD,WAAW;AACjE,QAAM,kBAAkB,WAAW;AAEnC,QAAM,eAAe,iBAAiB;AAAA,IACpC,WAAW,cAAc;AAAA,IACzB,YAAY,cAAc;AAAA,IAC1B,WAAW,cAAc;AAAA,EAC3B,CAAC;AAED,SAAO;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
|
}
|
|
@@ -80,7 +80,6 @@ const DSGlobalHeaderDatatestid = {
|
|
|
80
80
|
SEPARATOR: "ds-global-header-menubar-item-popupmenu-separator"
|
|
81
81
|
},
|
|
82
82
|
SEARCH_TOGGLE: {
|
|
83
|
-
CONTAINER: "ds-global-header-menubar-item-searchtoggle-container",
|
|
84
83
|
ITEM_BUTTON: "gh-toolbar-item"
|
|
85
84
|
}
|
|
86
85
|
}
|
|
@@ -104,7 +103,6 @@ const DSGlobalHeaderDatatestidFlattened = {
|
|
|
104
103
|
MENUBAR_POPUP_MENU_ITEM_BUTTON: "ds-global-header-menubar-item-popupmenu-item-button",
|
|
105
104
|
MENUBAR_POPUP_MENU_ITEM_LABEL: "ds-global-header-menubar-item-popupmenu-item-label",
|
|
106
105
|
MENUBAR_POPUP_MENU_SEPARATOR: "ds-global-header-menubar-item-popupmenu-separator",
|
|
107
|
-
MENUBAR_SEARCH_TOGGLE_CONTAINER: "ds-global-header-menubar-item-searchtoggle-container",
|
|
108
106
|
MENUBAR_SEARCH_TOGGLE_ITEM_BUTTON: "gh-toolbar-item"
|
|
109
107
|
};
|
|
110
108
|
const FONT_DETECTOR = {
|
|
@@ -125,7 +123,10 @@ const GLOBAL_HEADER_SLOTS = {
|
|
|
125
123
|
SEARCH_TOGGLE_SPINBUTTON_NEXT: "searchtoggle-spinbutton-next",
|
|
126
124
|
SEARCH_TOGGLE_TEXTINPUT: "searchtoggle-textinput",
|
|
127
125
|
SEARCH_TOGGLE_TRIGGER_BUTTON: "searchtoggle-trigger-button",
|
|
128
|
-
SEARCH_TOGGLE_EXPANDED_CONTENT_WRAPPER: "searchtoggle-expanded-content-wrapper"
|
|
126
|
+
SEARCH_TOGGLE_EXPANDED_CONTENT_WRAPPER: "searchtoggle-expanded-content-wrapper",
|
|
127
|
+
// The popup menu item's own root — the element consumers target to reach the whole item, and the one
|
|
128
|
+
// that receives its xstyled props. Post-convention slot, so it carries no legacy data-testid override.
|
|
129
|
+
MENUBAR_ITEM_POPUPMENU_CONTAINER: "menubar-item-popupmenu-container"
|
|
129
130
|
};
|
|
130
131
|
const SEARCH_TOGGLE_DEFAULT_ARIA_LABEL = "Search. Press Tab twice to reach the result navigation.";
|
|
131
132
|
const GLOBAL_HEADER_DATA_TESTID = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,qBAAqB;AAY3B,MAAM,sBAAsB;AAAA,EACjC,WAAW;AAAA,EACX,MAAM;AAAA,IAC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AAW;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 * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,qBAAqB;AAY3B,MAAM,sBAAsB;AAAA,EACjC,WAAW;AAAA,EACX,MAAM;AAAA,IACJ,WAAW;AAAA,EACb;AAAA,EACA,YAAY;AAAA,IACV,WAAW;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,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
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { DSGlobalHeader } from "./DSGlobalHeader.js";
|
|
3
|
-
var index_default = DSGlobalHeader;
|
|
4
|
-
import { DSGlobalHeader as DSGlobalHeader2, DSGlobalHeaderWithSchema, GlobalHeader } from "./DSGlobalHeader.js";
|
|
2
|
+
import { DSGlobalHeader, DSGlobalHeaderWithSchema, GlobalHeader } from "./DSGlobalHeader.js";
|
|
5
3
|
import {
|
|
6
4
|
DSGlobalHeaderDatatestid,
|
|
7
5
|
DSGlobalHeaderDatatestidFlattened,
|
|
@@ -12,7 +10,7 @@ import {
|
|
|
12
10
|
GLOBAL_HEADER_DATA_TESTID
|
|
13
11
|
} from "./constants/index.js";
|
|
14
12
|
export {
|
|
15
|
-
|
|
13
|
+
DSGlobalHeader,
|
|
16
14
|
DSGlobalHeaderDatatestid,
|
|
17
15
|
DSGlobalHeaderDatatestidFlattened,
|
|
18
16
|
DSGlobalHeaderName,
|
|
@@ -21,7 +19,6 @@ export {
|
|
|
21
19
|
DSGlobalHeaderWithSchema,
|
|
22
20
|
GLOBAL_HEADER_DATA_TESTID,
|
|
23
21
|
GLOBAL_HEADER_SLOTS,
|
|
24
|
-
GlobalHeader
|
|
25
|
-
index_default as default
|
|
22
|
+
GlobalHeader
|
|
26
23
|
};
|
|
27
24
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,gBAAgB,0BAA0B,oBAAoB;AACvE;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useCallback, useContext, useEffect, useRef } from "react";
|
|
2
|
+
import { useMemo, useCallback, useContext, useEffect, useRef } from "react";
|
|
3
3
|
import { FONT_DETECTOR } from "../../constants/index.js";
|
|
4
4
|
import { DSGlobalHeaderContext } from "../../DSGlobalHeaderContext.js";
|
|
5
5
|
const useGlobalHeaderBreadcrumb = () => {
|
|
6
6
|
const {
|
|
7
7
|
props: { breadcrumb, CustomNavigation },
|
|
8
|
-
|
|
8
|
+
/*
|
|
9
|
+
* The slot layer, split into its two genuinely separate halves.
|
|
10
|
+
*
|
|
11
|
+
* `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's
|
|
12
|
+
* slot prop, so it can only come from DSGlobalHeader — that is what the verbose drilled name says out
|
|
13
|
+
* loud when it reaches the out-of-the-box parts.
|
|
14
|
+
*
|
|
15
|
+
* `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,
|
|
16
|
+
* so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's
|
|
17
|
+
* own elements have render-time values worth passing. Stated rather than omitted, so "what arguments
|
|
18
|
+
* does this slot get?" always has a visible answer.
|
|
19
|
+
*/
|
|
20
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
21
|
+
noSlotArguments,
|
|
9
22
|
instanceUID,
|
|
10
23
|
showIconOnly,
|
|
11
24
|
setShowIconOnly,
|
|
@@ -35,6 +48,25 @@ const useGlobalHeaderBreadcrumb = () => {
|
|
|
35
48
|
},
|
|
36
49
|
[]
|
|
37
50
|
);
|
|
51
|
+
const ownerProps = useMemo(
|
|
52
|
+
() => ({
|
|
53
|
+
/*
|
|
54
|
+
* The slot layer, split into its two genuinely separate halves.
|
|
55
|
+
*
|
|
56
|
+
* `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's
|
|
57
|
+
* slot prop, so it can only come from DSGlobalHeader — that is what the verbose drilled name says out
|
|
58
|
+
* loud when it reaches the out-of-the-box parts.
|
|
59
|
+
*
|
|
60
|
+
* `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,
|
|
61
|
+
* so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's
|
|
62
|
+
* own elements have render-time values worth passing. Stated rather than omitted, so "what arguments
|
|
63
|
+
* does this slot get?" always has a visible answer.
|
|
64
|
+
*/
|
|
65
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
66
|
+
getOwnerPropsArguments: noSlotArguments
|
|
67
|
+
}),
|
|
68
|
+
[getOwnerPropsAwareOfPropsPassedToGlobalHeader, noSlotArguments]
|
|
69
|
+
);
|
|
38
70
|
return {
|
|
39
71
|
breadcrumb,
|
|
40
72
|
CustomNavigation,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Breadcrumb/useGlobalHeaderBreadcrumb.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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,YAAY,WAAW;ACCvB,SAAS,aAAa,YAAY,WAAW,cAAc;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,SAAS,aAAa,YAAY,WAAW,cAAc;AACpE,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AAkB/B,MAAM,4BAA4B,MAAwC;AAC/E,QAAM;AAAA,IACJ,OAAO,EAAE,YAAY,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAatC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,qBAAqB;AAEpC,QAAM,gBAAgB,OAAsB,IAAI;AAChD,QAAM,gBAAgB,OAAuB,IAAI;AAEjD,YAAU,MAAM;AACd,UAAM,uBAAuB,MAAM;AACjC,UACG,cAAc,WAAW,cAAc,QAAQ,eAAe,KAAK,CAAC,cAAc,WACnF,iBAAiB,cAAc,SAC/B,iBAAiB,cAAc,QAC/B;AACA,wBAAgB,IAAI;AACpB,sBAAc,UAAU,OAAO;AAAA,MACjC,WAAW,cAAc,WAAW,OAAO,cAAc,cAAc,SAAS;AAC9E,wBAAgB,KAAK;AACrB,sBAAc,UAAU;AAA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