@hitachivantara/uikit-react-core 5.9.0 → 5.10.0
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/components/AppSwitcher/AppSwitcher.cjs +4 -0
- package/dist/cjs/components/AppSwitcher/AppSwitcher.cjs.map +1 -1
- package/dist/cjs/components/AppSwitcher/AppSwitcher.styles.cjs +9 -10
- package/dist/cjs/components/AppSwitcher/AppSwitcher.styles.cjs.map +1 -1
- package/dist/cjs/components/Button/Button.cjs +1 -0
- package/dist/cjs/components/Button/Button.cjs.map +1 -1
- package/dist/cjs/components/DropDownMenu/DropDownMenu.cjs +20 -26
- package/dist/cjs/components/DropDownMenu/DropDownMenu.cjs.map +1 -1
- package/dist/cjs/components/DropDownMenu/DropDownMenu.styles.cjs +27 -75
- package/dist/cjs/components/DropDownMenu/DropDownMenu.styles.cjs.map +1 -1
- package/dist/cjs/components/DropDownMenu/dropDownMenuClasses.cjs +1 -1
- package/dist/cjs/components/DropDownMenu/dropDownMenuClasses.cjs.map +1 -1
- package/dist/cjs/components/Table/TableCell/TableCell.cjs +4 -4
- package/dist/cjs/components/Table/TableCell/TableCell.cjs.map +1 -1
- package/dist/cjs/components/Table/TableCell/TableCell.styles.cjs +2 -14
- package/dist/cjs/components/Table/TableCell/TableCell.styles.cjs.map +1 -1
- package/dist/cjs/components/Table/TableRow/TableRow.cjs +6 -6
- package/dist/cjs/components/Table/TableRow/TableRow.cjs.map +1 -1
- package/dist/cjs/components/Table/utils/utils.cjs +0 -5
- package/dist/cjs/components/Table/utils/utils.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Actions/Actions.cjs +2 -2
- package/dist/cjs/components/VerticalNavigation/Actions/Actions.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Header/Header.cjs +2 -2
- package/dist/cjs/components/VerticalNavigation/Header/Header.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs +8 -8
- package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationPopup/NavigationPopup.cjs +1 -0
- package/dist/cjs/components/VerticalNavigation/NavigationPopup/NavigationPopup.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.cjs +5 -5
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/VerticalNavigation.cjs +6 -3
- package/dist/cjs/components/VerticalNavigation/VerticalNavigation.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/VerticalNavigationContext.cjs +1 -1
- package/dist/cjs/components/VerticalNavigation/VerticalNavigationContext.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/utils/checkValidHexColorValue.cjs +9 -0
- package/dist/cjs/utils/checkValidHexColorValue.cjs.map +1 -0
- package/dist/esm/components/AppSwitcher/AppSwitcher.js +4 -0
- package/dist/esm/components/AppSwitcher/AppSwitcher.js.map +1 -1
- package/dist/esm/components/AppSwitcher/AppSwitcher.styles.js +9 -10
- package/dist/esm/components/AppSwitcher/AppSwitcher.styles.js.map +1 -1
- package/dist/esm/components/Button/Button.js +1 -0
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/DropDownMenu/DropDownMenu.js +21 -27
- package/dist/esm/components/DropDownMenu/DropDownMenu.js.map +1 -1
- package/dist/esm/components/DropDownMenu/DropDownMenu.styles.js +27 -73
- package/dist/esm/components/DropDownMenu/DropDownMenu.styles.js.map +1 -1
- package/dist/esm/components/DropDownMenu/dropDownMenuClasses.js +1 -1
- package/dist/esm/components/DropDownMenu/dropDownMenuClasses.js.map +1 -1
- package/dist/esm/components/Table/TableCell/TableCell.js +2 -2
- package/dist/esm/components/Table/TableCell/TableCell.js.map +1 -1
- package/dist/esm/components/Table/TableCell/TableCell.styles.js +2 -14
- package/dist/esm/components/Table/TableCell/TableCell.styles.js.map +1 -1
- package/dist/esm/components/Table/TableRow/TableRow.js +2 -2
- package/dist/esm/components/Table/TableRow/TableRow.js.map +1 -1
- package/dist/esm/components/Table/utils/utils.js +0 -5
- package/dist/esm/components/Table/utils/utils.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Actions/Actions.js +2 -2
- package/dist/esm/components/VerticalNavigation/Actions/Actions.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Header/Header.js +2 -2
- package/dist/esm/components/VerticalNavigation/Header/Header.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js +8 -8
- package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationPopup/NavigationPopup.js +1 -0
- package/dist/esm/components/VerticalNavigation/NavigationPopup/NavigationPopup.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.js +5 -5
- package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/VerticalNavigation.js +6 -3
- package/dist/esm/components/VerticalNavigation/VerticalNavigation.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/VerticalNavigationContext.js +1 -1
- package/dist/esm/components/VerticalNavigation/VerticalNavigationContext.js.map +1 -1
- package/dist/esm/index.js +7 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/checkValidHexColorValue.js +9 -0
- package/dist/esm/utils/checkValidHexColorValue.js.map +1 -0
- package/dist/types/index.d.ts +15 -3
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigation.cjs","sources":["../../../../../src/components/VerticalNavigation/Navigation/Navigation.tsx"],"sourcesContent":["import {\n useCallback,\n useMemo,\n useContext,\n useEffect,\n useState,\n ComponentProps,\n} from \"react\";\nimport { clsx } from \"clsx\";\nimport uniqueId from \"lodash/uniqueId\";\nimport { setId, wrapperTooltip } from \"@core/utils\";\nimport { useControlled } from \"@core/hooks\";\nimport { HvBaseProps } from \"@core/types\";\nimport {\n HvVerticalNavigationTreeView,\n HvVerticalNavigationTreeViewItem,\n} from \"../TreeView\";\nimport verticalNavigationTreeClasses, {\n HvVerticalNavigationTreeClasses,\n} from \"./navigationClasses\";\nimport { StyledNav } from \"./Navigation.styles\";\nimport { HvVerticalNavigationSlider } from \"..\";\nimport { VerticalNavigationContext } from \"../VerticalNavigationContext\";\nimport { HvVerticalNavigationPopup } from \"../NavigationPopup/NavigationPopup\";\n\nexport type NavigationData<T extends React.ElementType = \"a\"> =\n ComponentProps<T> &\n Record<string, any> & {\n /** The id to be applied to the root element. */\n id: string;\n /** The label to be rendered on the menu item. */\n label: string;\n /** The icon to be rendered. */\n icon?: React.ReactNode;\n /** The Data children subset. */\n data?: NavigationData<T>[];\n /** Whether the item is disabled and not interactive. */\n disabled?: boolean;\n /** Whether the item has a selected state. */\n selectable?: boolean;\n };\n\nconst createListHierarchy = (\n items,\n id,\n classes?: HvVerticalNavigationTreeClasses,\n mouseEnterHandler?: (event, item) => void,\n disableTooltip = false\n) =>\n items.map((item) => {\n const {\n id: itemId,\n label: itemLabel,\n icon,\n data: children,\n selectable,\n disabled,\n href,\n target,\n } = item;\n\n const ItemText = wrapperTooltip(true, itemLabel, itemLabel);\n\n const itemMouseEnterHandler = (event) => {\n mouseEnterHandler?.(event, item);\n };\n\n return (\n <HvVerticalNavigationTreeViewItem\n id={setId(id, itemId)}\n className={classes?.listItem}\n href={href}\n target={target}\n key={itemId}\n nodeId={itemId}\n label={<ItemText />}\n icon={icon}\n payload={item}\n selectable={selectable}\n disabled={disabled}\n onMouseEnter={itemMouseEnterHandler}\n disableTooltip={disableTooltip}\n >\n {children\n ? createListHierarchy(\n children,\n id,\n classes,\n mouseEnterHandler,\n disableTooltip\n )\n : undefined}\n </HvVerticalNavigationTreeViewItem>\n );\n });\n\nconst getAllParents = (items) => {\n const parents = items.filter(\n (item) => item.data != null && item.data.length > 0\n );\n const childParents = parents.flatMap((item) => getAllParents(item.data));\n\n return [...parents, ...childParents];\n};\n\nfunction pathToElement(data, targetId) {\n const path: string[] = [];\n\n if (data != null && data.length > 0) {\n for (let i = 0; i !== data.length; ++i) {\n const item = data[i];\n if (item.id === targetId) {\n path.push(item.id);\n break;\n }\n\n const subPaths = pathToElement(item.data, targetId);\n if (subPaths.length > 0) {\n path.push(item.id);\n path.push(...subPaths);\n break;\n }\n }\n }\n\n return path;\n}\n\nexport const HvVerticalNavigationTree = ({\n id,\n\n className,\n classes,\n\n data,\n\n mode = \"navigation\",\n\n collapsible = false,\n expanded: expandedProp,\n defaultExpanded,\n onToggle,\n\n selected: selectedProp,\n defaultSelected,\n onChange,\n\n ...others\n}: HvVerticalNavigationTreeProps) => {\n const [selected, setSelected] = useControlled(selectedProp, defaultSelected);\n const [expanded, setExpanded] = useControlled(expandedProp, () => {\n if (defaultExpanded === true) {\n // all parent nodes will be expanded by default\n return getAllParents(data).map((item) => item.id);\n }\n\n if (defaultExpanded === false) {\n // all parent nodes will be collapsed by default\n return [];\n }\n\n if (defaultExpanded == null) {\n if (selected != null) {\n // the path to the selected node will be expanded (default behaviour)\n const path = pathToElement(data, selected);\n return path.slice(0, -1);\n }\n\n // nothing is expanded\n return [];\n }\n\n return defaultExpanded;\n });\n\n const {\n isOpen,\n collapsedMode,\n slider,\n\n parentItem,\n withParentData,\n navigateToChildHandler,\n\n setParentData,\n setParentSelected,\n } = useContext(VerticalNavigationContext);\n\n const [navigationPopup, setNavigationPopup] = useState<{\n // This value is needed to guarantee that the NavigationPopup is fully re-rendered with keeping any previous values\n uniqueKey: string;\n anchorEl: HTMLButtonElement | null;\n fixedMode: boolean;\n data: NavigationData[];\n } | null>(null);\n\n const handleChange = useCallback(\n (event, selectedId, selectedItem) => {\n if (collapsedMode === \"icon\" && !isOpen && selectedItem.data) {\n const currentEventTarget = event.currentTarget;\n setNavigationPopup((prevState) => {\n // We want to close the popup in case the clicked element is the same as the previous one\n return prevState?.anchorEl === currentEventTarget\n ? null\n : {\n uniqueKey: uniqueId(),\n anchorEl: currentEventTarget,\n fixedMode: true,\n data: selectedItem.data,\n };\n });\n\n // We need this stopPropagation or else the Popup will close due to the clickaway being triggered\n event.stopPropagation();\n } else {\n setSelected(selectedId);\n setExpanded((prevState) => {\n if (!isOpen) {\n return [...prevState, ...pathToElement(data, selectedId)];\n }\n return [...prevState];\n });\n setNavigationPopup(null);\n if (onChange) {\n onChange(event, selectedItem);\n }\n }\n },\n [onChange, setSelected]\n );\n\n const treeViewItemMouseEnterHandler = (event, item) => {\n const isCollapsedMode = collapsedMode === \"icon\" && !isOpen;\n\n if (isCollapsedMode && item.data && !navigationPopup?.fixedMode) {\n const currentEventTarget = event.currentTarget;\n\n setNavigationPopup?.({\n uniqueKey: uniqueId(),\n anchorEl: currentEventTarget,\n fixedMode: false,\n data: item.data,\n });\n } else if (isCollapsedMode && !item.data && !navigationPopup?.fixedMode) {\n setNavigationPopup(null);\n }\n };\n\n const handleToggle = useCallback(\n (event, newExpanded) => {\n setExpanded(newExpanded);\n\n if (onToggle) {\n onToggle(event, newExpanded);\n }\n },\n [onToggle, setExpanded]\n );\n\n const children = useMemo(\n () =>\n data &&\n createListHierarchy(\n data,\n id,\n classes,\n treeViewItemMouseEnterHandler,\n navigationPopup?.fixedMode\n ),\n [classes, data, id, navigationPopup, isOpen]\n );\n\n useEffect(() => {\n if (!isOpen) {\n setNavigationPopup?.(null);\n }\n }, [isOpen]);\n\n useEffect(() => {\n if (setParentSelected) setParentSelected(selected);\n }, [selected, setSelected]);\n\n useEffect(() => {\n if (setParentData) setParentData(data);\n }, [data]);\n\n // navigation slider\n const navigateToTargetHandler = (event, selectedItem) => {\n handleChange(event, selectedItem.id, selectedItem);\n };\n\n const handleNavigationPopupClose = () => {\n setNavigationPopup(null);\n };\n\n const handleStyledNavMouseLeave = () => {\n if (collapsedMode === \"icon\" && !isOpen && !navigationPopup?.fixedMode) {\n setNavigationPopup(null);\n }\n };\n\n return (\n <StyledNav\n id={id}\n className={clsx(\n className,\n verticalNavigationTreeClasses.root,\n classes?.root,\n !isOpen &&\n collapsedMode === \"simple\" &&\n clsx(verticalNavigationTreeClasses.collapsed, classes?.collapsed)\n )}\n onMouseLeave={handleStyledNavMouseLeave}\n {...others}\n >\n {slider ? (\n <HvVerticalNavigationSlider\n data={parentItem.data || withParentData}\n selected={selected}\n onNavigateToTarget={navigateToTargetHandler}\n onNavigateToChild={navigateToChildHandler}\n />\n ) : (\n <HvVerticalNavigationTreeView\n id={setId(id, \"tree\")}\n className={clsx(verticalNavigationTreeClasses.list, classes?.list)}\n selectable\n mode={mode}\n collapsible={collapsible}\n selected={selected}\n onChange={handleChange}\n expanded={expanded}\n onToggle={handleToggle}\n >\n {collapsedMode === \"icon\" && !isOpen && navigationPopup && (\n <HvVerticalNavigationPopup\n id={setId(id, \"navigation-popup\")}\n key={navigationPopup.uniqueKey}\n anchorEl={navigationPopup.anchorEl}\n selected={selected}\n fixedMode={navigationPopup.fixedMode}\n data={navigationPopup.data}\n onClose={handleNavigationPopupClose}\n onChange={handleChange}\n className={clsx(\n verticalNavigationTreeClasses.navigationPopup,\n classes?.navigationPopup\n )}\n />\n )}\n {children}\n </HvVerticalNavigationTreeView>\n )}\n </StyledNav>\n );\n};\n\nexport interface HvVerticalNavigationTreeProps\n extends HvBaseProps<HTMLDivElement, \"onChange\"> {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvVerticalNavigationTreeClasses;\n /**\n * Modus operandi (role) of the widget instance.\n */\n mode?: NavigationMode;\n /**\n * Can non-leaf nodes be collapsed / expanded.\n */\n collapsible?: boolean;\n /**\n * The ID of the selected page.\n */\n selected?: string;\n /**\n * When uncontrolled, defines the initial selected page ID.\n */\n defaultSelected?: string;\n /**\n * Callback fired when a navigation item is selected.\n *\n * @param {object} event The event source of the callback.\n * @param {object} page The data of the selected page.\n */\n onChange?: (event, page) => void;\n /**\n * Expanded nodes' ids.\n */\n expanded?: string[];\n /**\n * When uncontrolled, defines the initial expanded nodes' ids.\n *\n * It also supports `true` for starting with all nodes expanded.\n * With `false` all nodes will be collapsed.\n *\n * By default it expands the needed nodes to display the current selection, if any.\n */\n defaultExpanded?: string[] | boolean;\n /**\n * Callback fired when tree items are expanded/collapsed.\n *\n * @param {object} event The event source of the callback.\n * @param {array} nodeIds The ids of the expanded nodes (old and new).\n */\n onToggle?: (event, nodeIds) => void;\n /**\n * An array containing the data for each menu item.\n *\n * id - the id to be applied to the root element.\n * label - the label to be rendered on the menu item.\n * data - sub-menu items\n * href - the url used for navigation.\n * target - the behavior when opening an url.\n */\n data?: NavigationData[];\n}\n\nexport type NavigationMode = \"treeview\" | \"navigation\" | \"slider\";\n"],"names":["createListHierarchy","items","id","classes","mouseEnterHandler","disableTooltip","map","item","itemId","label","itemLabel","icon","data","children","selectable","disabled","href","target","ItemText","wrapperTooltip","itemMouseEnterHandler","event","HvVerticalNavigationTreeViewItem","setId","className","listItem","nodeId","_jsx","payload","onMouseEnter","undefined","getAllParents","parents","filter","length","childParents","flatMap","pathToElement","targetId","path","i","push","subPaths","HvVerticalNavigationTree","mode","collapsible","expanded","expandedProp","defaultExpanded","onToggle","selected","selectedProp","defaultSelected","onChange","others","setSelected","useControlled","setExpanded","slice","isOpen","collapsedMode","slider","parentItem","withParentData","navigateToChildHandler","setParentData","setParentSelected","useContext","VerticalNavigationContext","navigationPopup","setNavigationPopup","useState","handleChange","useCallback","selectedId","selectedItem","currentEventTarget","currentTarget","prevState","anchorEl","uniqueKey","uniqueId","fixedMode","stopPropagation","treeViewItemMouseEnterHandler","isCollapsedMode","handleToggle","newExpanded","useMemo","useEffect","navigateToTargetHandler","handleNavigationPopupClose","handleStyledNavMouseLeave","StyledNav","clsx","verticalNavigationTreeClasses","root","collapsed","onMouseLeave","HvVerticalNavigationSlider","onNavigateToTarget","onNavigateToChild","_jsxs","HvVerticalNavigationT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,MAC9B7F,mCAAS6F,MACT,CAACrC,UACCC,kBAAkB,YAClBkC,UAAKC,kBAAAA,QAA8BE,WAAW9F,mCAAS8F,SAAS,CAAC;AAAA,IAErEC,cAAcN;AAAAA,IAA0B,GACpCtC;AAAAA,IAAMzC,UAETgD,SACClC,2BAAAA,IAACwE,6CAA0B;AAAA,MACzBvF,MAAMkD,WAAWlD,QAAQmD;AAAAA,MACzBb;AAAAA,MACAkD,oBAAoBV;AAAAA,MACpBW,mBAAmBrC;AAAAA,IAAAA,CACnB,IAEFsC,2BAAAA,KAACC,uCAA4B;AAAA,MAC3BrG,IAAIqB,MAAAA,MAAMrB,IAAI,MAAM;AAAA,MACpBsB,WAAWsE,KAAAA,KAAKC,kBAAAA,QAA8BS,MAAMrG,mCAASqG,IAAI;AAAA,MACjE1F,YAAU;AAAA,MACV8B;AAAAA,MACAC;AAAAA,MACAK;AAAAA,MACAG,UAAUmB;AAAAA,MACV1B;AAAAA,MACAG,UAAUqC;AAAAA,MAAazE,UAEtB+C,CAAAA,kBAAkB,UAAU,CAACD,UAAUU,kDACrCoC,2CAAyB;AAAA,QACxBvG,IAAIqB,MAAAA,MAAMrB,IAAI,kBAAkB;AAAA,QAEhC6E,UAAUV,gBAAgBU;AAAAA,QAC1B7B;AAAAA,QACAgC,WAAWb,gBAAgBa;AAAAA,QAC3BtE,MAAMyD,gBAAgBzD;AAAAA,QACtB8F,SAASf;AAAAA,QACTtC,UAAUmB;AAAAA,QACVhD,WAAWsE,KAAAA,KACTC,kBAAAA,QAA8B1B,iBAC9BlE,mCAASkE,eAAe;AAAA,MAAA,GATrBA,gBAAgBW,SAAS,GAajCnE,QAAQ;AAAA,IAAA,CAAA;AAAA,EAAA,CAGH;AAEhB;;"}
|
|
1
|
+
{"version":3,"file":"Navigation.cjs","sources":["../../../../../src/components/VerticalNavigation/Navigation/Navigation.tsx"],"sourcesContent":["import {\n useCallback,\n useMemo,\n useContext,\n useEffect,\n useState,\n ComponentProps,\n} from \"react\";\nimport { clsx } from \"clsx\";\nimport uniqueId from \"lodash/uniqueId\";\nimport { setId, wrapperTooltip } from \"@core/utils\";\nimport { useControlled } from \"@core/hooks\";\nimport { HvBaseProps } from \"@core/types\";\nimport {\n HvVerticalNavigationTreeView,\n HvVerticalNavigationTreeViewItem,\n} from \"../TreeView\";\nimport verticalNavigationTreeClasses, {\n HvVerticalNavigationTreeClasses,\n} from \"./navigationClasses\";\nimport { StyledNav } from \"./Navigation.styles\";\nimport { HvVerticalNavigationSlider } from \"..\";\nimport { VerticalNavigationContext } from \"../VerticalNavigationContext\";\nimport { HvVerticalNavigationPopup } from \"../NavigationPopup/NavigationPopup\";\n\nexport type NavigationData<T extends React.ElementType = \"a\"> =\n ComponentProps<T> &\n Record<string, any> & {\n /** The id to be applied to the root element. */\n id: string;\n /** The label to be rendered on the menu item. */\n label: string;\n /** The icon to be rendered. */\n icon?: React.ReactNode;\n /** The Data children subset. */\n data?: NavigationData<T>[];\n /** Whether the item is disabled and not interactive. */\n disabled?: boolean;\n /** Whether the item has a selected state. */\n selectable?: boolean;\n };\n\nconst createListHierarchy = (\n items,\n id,\n classes?: HvVerticalNavigationTreeClasses,\n mouseEnterHandler?: (event, item) => void,\n disableTooltip = false\n) =>\n items.map((item) => {\n const {\n id: itemId,\n label: itemLabel,\n icon,\n data: children,\n selectable,\n disabled,\n href,\n target,\n } = item;\n\n const ItemText = wrapperTooltip(true, itemLabel, itemLabel);\n\n const itemMouseEnterHandler = (event) => {\n mouseEnterHandler?.(event, item);\n };\n\n return (\n <HvVerticalNavigationTreeViewItem\n id={setId(id, itemId)}\n className={classes?.listItem}\n href={href}\n target={target}\n key={itemId}\n nodeId={itemId}\n label={<ItemText />}\n icon={icon}\n payload={item}\n selectable={selectable}\n disabled={disabled}\n onMouseEnter={itemMouseEnterHandler}\n disableTooltip={disableTooltip}\n >\n {children\n ? createListHierarchy(\n children,\n id,\n classes,\n mouseEnterHandler,\n disableTooltip\n )\n : undefined}\n </HvVerticalNavigationTreeViewItem>\n );\n });\n\nconst getAllParents = (items) => {\n const parents = items.filter(\n (item) => item.data != null && item.data.length > 0\n );\n const childParents = parents.flatMap((item) => getAllParents(item.data));\n\n return [...parents, ...childParents];\n};\n\nfunction pathToElement(data, targetId) {\n const path: string[] = [];\n\n if (data != null && data.length > 0) {\n for (let i = 0; i !== data.length; ++i) {\n const item = data[i];\n if (item.id === targetId) {\n path.push(item.id);\n break;\n }\n\n const subPaths = pathToElement(item.data, targetId);\n if (subPaths.length > 0) {\n path.push(item.id);\n path.push(...subPaths);\n break;\n }\n }\n }\n\n return path;\n}\n\nexport const HvVerticalNavigationTree = ({\n id,\n\n className,\n classes,\n\n data,\n\n mode = \"navigation\",\n\n collapsible = false,\n expanded: expandedProp,\n defaultExpanded,\n onToggle,\n\n selected: selectedProp,\n defaultSelected,\n onChange,\n\n ...others\n}: HvVerticalNavigationTreeProps) => {\n const [selected, setSelected] = useControlled(selectedProp, defaultSelected);\n const [expanded, setExpanded] = useControlled(expandedProp, () => {\n if (defaultExpanded === true) {\n // all parent nodes will be expanded by default\n return getAllParents(data).map((item) => item.id);\n }\n\n if (defaultExpanded === false) {\n // all parent nodes will be collapsed by default\n return [];\n }\n\n if (defaultExpanded == null) {\n if (selected != null) {\n // the path to the selected node will be expanded (default behaviour)\n const path = pathToElement(data, selected);\n return path.slice(0, -1);\n }\n\n // nothing is expanded\n return [];\n }\n\n return defaultExpanded;\n });\n\n const {\n isOpen,\n useIcons,\n slider,\n\n parentItem,\n withParentData,\n navigateToChildHandler,\n\n setParentData,\n setParentSelected,\n } = useContext(VerticalNavigationContext);\n\n const [navigationPopup, setNavigationPopup] = useState<{\n // This value is needed to guarantee that the NavigationPopup is fully re-rendered with keeping any previous values\n uniqueKey: string;\n anchorEl: HTMLButtonElement | null;\n fixedMode: boolean;\n data: NavigationData[];\n } | null>(null);\n\n const handleChange = useCallback(\n (event, selectedId, selectedItem) => {\n if (useIcons && !isOpen && selectedItem.data) {\n const currentEventTarget = event.currentTarget;\n setNavigationPopup((prevState) => {\n // We want to close the popup in case the clicked element is the same as the previous one\n return prevState?.anchorEl === currentEventTarget\n ? null\n : {\n uniqueKey: uniqueId(),\n anchorEl: currentEventTarget,\n fixedMode: true,\n data: selectedItem.data,\n };\n });\n\n // We need this stopPropagation or else the Popup will close due to the clickaway being triggered\n event.stopPropagation();\n } else {\n setSelected(selectedId);\n setExpanded((prevState) => {\n if (!isOpen) {\n return [...prevState, ...pathToElement(data, selectedId)];\n }\n return [...prevState];\n });\n setNavigationPopup(null);\n if (onChange) {\n onChange(event, selectedItem);\n }\n }\n },\n [onChange, setSelected]\n );\n\n const treeViewItemMouseEnterHandler = (event, item) => {\n const isCollapsed = useIcons && !isOpen;\n\n if (isCollapsed && item.data && !navigationPopup?.fixedMode) {\n const currentEventTarget = event.currentTarget;\n\n setNavigationPopup?.({\n uniqueKey: uniqueId(),\n anchorEl: currentEventTarget,\n fixedMode: false,\n data: item.data,\n });\n } else if (isCollapsed && !item.data && !navigationPopup?.fixedMode) {\n setNavigationPopup(null);\n }\n };\n\n const handleToggle = useCallback(\n (event, newExpanded) => {\n setExpanded(newExpanded);\n\n if (onToggle) {\n onToggle(event, newExpanded);\n }\n },\n [onToggle, setExpanded]\n );\n\n const children = useMemo(\n () =>\n data &&\n createListHierarchy(\n data,\n id,\n classes,\n treeViewItemMouseEnterHandler,\n navigationPopup?.fixedMode\n ),\n [classes, data, id, navigationPopup, isOpen]\n );\n\n useEffect(() => {\n if (!isOpen) {\n setNavigationPopup?.(null);\n }\n }, [isOpen]);\n\n useEffect(() => {\n if (setParentSelected) setParentSelected(selected);\n }, [selected, setSelected]);\n\n useEffect(() => {\n if (setParentData) setParentData(data);\n }, [data]);\n\n // navigation slider\n const navigateToTargetHandler = (event, selectedItem) => {\n handleChange(event, selectedItem.id, selectedItem);\n };\n\n const handleNavigationPopupClose = () => {\n setNavigationPopup(null);\n };\n\n const handleStyledNavMouseLeave = () => {\n if (useIcons && !isOpen && !navigationPopup?.fixedMode) {\n setNavigationPopup(null);\n }\n };\n\n return (\n <StyledNav\n id={id}\n className={clsx(\n className,\n verticalNavigationTreeClasses.root,\n classes?.root,\n !isOpen &&\n !useIcons &&\n clsx(verticalNavigationTreeClasses.collapsed, classes?.collapsed)\n )}\n onMouseLeave={handleStyledNavMouseLeave}\n {...others}\n >\n {slider ? (\n <HvVerticalNavigationSlider\n data={parentItem.data || withParentData}\n selected={selected}\n onNavigateToTarget={navigateToTargetHandler}\n onNavigateToChild={navigateToChildHandler}\n />\n ) : (\n <HvVerticalNavigationTreeView\n id={setId(id, \"tree\")}\n className={clsx(verticalNavigationTreeClasses.list, classes?.list)}\n selectable\n mode={mode}\n collapsible={collapsible}\n selected={selected}\n onChange={handleChange}\n expanded={expanded}\n onToggle={handleToggle}\n >\n {useIcons && !isOpen && navigationPopup && (\n <HvVerticalNavigationPopup\n id={setId(id, \"navigation-popup\")}\n key={navigationPopup.uniqueKey}\n anchorEl={navigationPopup.anchorEl}\n selected={selected}\n fixedMode={navigationPopup.fixedMode}\n data={navigationPopup.data}\n onClose={handleNavigationPopupClose}\n onChange={handleChange}\n className={clsx(\n verticalNavigationTreeClasses.navigationPopup,\n classes?.navigationPopup\n )}\n />\n )}\n {children}\n </HvVerticalNavigationTreeView>\n )}\n </StyledNav>\n );\n};\n\nexport interface HvVerticalNavigationTreeProps\n extends HvBaseProps<HTMLDivElement, \"onChange\"> {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvVerticalNavigationTreeClasses;\n /**\n * Modus operandi (role) of the widget instance.\n */\n mode?: NavigationMode;\n /**\n * Can non-leaf nodes be collapsed / expanded.\n */\n collapsible?: boolean;\n /**\n * The ID of the selected page.\n */\n selected?: string;\n /**\n * When uncontrolled, defines the initial selected page ID.\n */\n defaultSelected?: string;\n /**\n * Callback fired when a navigation item is selected.\n *\n * @param {object} event The event source of the callback.\n * @param {object} page The data of the selected page.\n */\n onChange?: (event, page) => void;\n /**\n * Expanded nodes' ids.\n */\n expanded?: string[];\n /**\n * When uncontrolled, defines the initial expanded nodes' ids.\n *\n * It also supports `true` for starting with all nodes expanded.\n * With `false` all nodes will be collapsed.\n *\n * By default it expands the needed nodes to display the current selection, if any.\n */\n defaultExpanded?: string[] | boolean;\n /**\n * Callback fired when tree items are expanded/collapsed.\n *\n * @param {object} event The event source of the callback.\n * @param {array} nodeIds The ids of the expanded nodes (old and new).\n */\n onToggle?: (event, nodeIds) => void;\n /**\n * An array containing the data for each menu item.\n *\n * id - the id to be applied to the root element.\n * label - the label to be rendered on the menu item.\n * data - sub-menu items\n * href - the url used for navigation.\n * target - the behavior when opening an url.\n */\n data?: NavigationData[];\n}\n\nexport type NavigationMode = \"treeview\" | \"navigation\" | \"slider\";\n"],"names":["createListHierarchy","items","id","classes","mouseEnterHandler","disableTooltip","map","item","itemId","label","itemLabel","icon","data","children","selectable","disabled","href","target","ItemText","wrapperTooltip","itemMouseEnterHandler","event","HvVerticalNavigationTreeViewItem","setId","className","listItem","nodeId","_jsx","payload","onMouseEnter","undefined","getAllParents","parents","filter","length","childParents","flatMap","pathToElement","targetId","path","i","push","subPaths","HvVerticalNavigationTree","mode","collapsible","expanded","expandedProp","defaultExpanded","onToggle","selected","selectedProp","defaultSelected","onChange","others","setSelected","useControlled","setExpanded","slice","isOpen","useIcons","slider","parentItem","withParentData","navigateToChildHandler","setParentData","setParentSelected","useContext","VerticalNavigationContext","navigationPopup","setNavigationPopup","useState","handleChange","useCallback","selectedId","selectedItem","currentEventTarget","currentTarget","prevState","anchorEl","uniqueKey","uniqueId","fixedMode","stopPropagation","treeViewItemMouseEnterHandler","isCollapsed","handleToggle","newExpanded","useMemo","useEffect","navigateToTargetHandler","handleNavigationPopupClose","handleStyledNavMouseLeave","StyledNav","clsx","verticalNavigationTreeClasses","root","collapsed","onMouseLeave","HvVerticalNavigationSlider","onNavigateToTarget","onNavigateToChild","_jsxs","HvVertic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CAACrC,UACC,CAACC,YACDkC,KAAAA,KAAKC,kBAAAA,QAA8BE,WAAW9F,mCAAS8F,SAAS,CAAC;AAAA,IAErEC,cAAcN;AAAAA,IAA0B,GACpCtC;AAAAA,IAAMzC,UAETgD,SACClC,2BAAAA,IAACwE,6CAA0B;AAAA,MACzBvF,MAAMkD,WAAWlD,QAAQmD;AAAAA,MACzBb;AAAAA,MACAkD,oBAAoBV;AAAAA,MACpBW,mBAAmBrC;AAAAA,IAAAA,CACnB,IAEFsC,2BAAAA,KAACC,uCAA4B;AAAA,MAC3BrG,IAAIqB,MAAAA,MAAMrB,IAAI,MAAM;AAAA,MACpBsB,WAAWsE,KAAAA,KAAKC,kBAAAA,QAA8BS,MAAMrG,mCAASqG,IAAI;AAAA,MACjE1F,YAAU;AAAA,MACV8B;AAAAA,MACAC;AAAAA,MACAK;AAAAA,MACAG,UAAUmB;AAAAA,MACV1B;AAAAA,MACAG,UAAUqC;AAAAA,MAAazE,UAAA,CAEtB+C,YAAY,CAACD,UAAUU,kDACrBoC,2CAAyB;AAAA,QACxBvG,IAAIqB,MAAAA,MAAMrB,IAAI,kBAAkB;AAAA,QAEhC6E,UAAUV,gBAAgBU;AAAAA,QAC1B7B;AAAAA,QACAgC,WAAWb,gBAAgBa;AAAAA,QAC3BtE,MAAMyD,gBAAgBzD;AAAAA,QACtB8F,SAASf;AAAAA,QACTtC,UAAUmB;AAAAA,QACVhD,WAAWsE,KAAAA,KACTC,kBAAAA,QAA8B1B,iBAC9BlE,mCAASkE,eAAe;AAAA,MAAA,GATrBA,gBAAgBW,SAAS,GAajCnE,QAAQ;AAAA,IAAA,CAAA;AAAA,EAAA,CAGH;AAEhB;;"}
|
|
@@ -39,6 +39,7 @@ const HvVerticalNavigationPopup = ({
|
|
|
39
39
|
children: /* @__PURE__ */ jsxRuntime.jsx(NavigationPopup_styles.StyledPopupContainer, {
|
|
40
40
|
children: /* @__PURE__ */ jsxRuntime.jsx(VerticalNavigation.HvVerticalNavigation, {
|
|
41
41
|
open: true,
|
|
42
|
+
useIcons: true,
|
|
42
43
|
children: /* @__PURE__ */ jsxRuntime.jsx(Navigation.HvVerticalNavigationTree, {
|
|
43
44
|
className: clsx.clsx(navigationClasses.default.popup),
|
|
44
45
|
id: setId.setId(id, "tree"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationPopup.cjs","sources":["../../../../../src/components/VerticalNavigation/NavigationPopup/NavigationPopup.tsx"],"sourcesContent":["import { ClickAwayListener } from \"@mui/material\";\nimport { clsx } from \"clsx\";\n\nimport {\n NavigationData,\n HvVerticalNavigationTree,\n HvVerticalNavigation,\n verticalNavigationTreeClasses,\n} from \"@core/components\";\nimport { HvBaseProps } from \"@core/types\";\nimport { setId } from \"@core/utils\";\n\nimport { StyledPopper, StyledPopupContainer } from \"./NavigationPopup.styles\";\n\nexport interface HvVerticalNavigationPopupProps\n extends HvBaseProps<HTMLDivElement> {\n id?: string;\n anchorEl?: HTMLElement | null;\n fixedMode?: boolean;\n data?: NavigationData[];\n selected?: string;\n onClose?: () => void;\n onChange?: any;\n}\n\nexport const HvVerticalNavigationPopup = ({\n id,\n anchorEl,\n fixedMode,\n onClose,\n data,\n selected,\n onChange,\n\n ...others\n}: HvVerticalNavigationPopupProps) => {\n const handleClickAway = () => {\n onClose?.();\n };\n\n const handleChange = (event, selectedItem) => {\n onChange(event, selectedItem.id, selectedItem);\n };\n\n const handleMouseLeave = () => {\n if (!fixedMode) {\n onClose?.();\n }\n };\n\n return (\n <StyledPopper open anchorEl={anchorEl} placement=\"right-start\" {...others}>\n <ClickAwayListener onClickAway={handleClickAway}>\n <StyledPopupContainer>\n <HvVerticalNavigation open>\n <HvVerticalNavigationTree\n className={clsx(verticalNavigationTreeClasses.popup)}\n id={setId(id, \"tree\")}\n collapsible\n defaultExpanded\n selected={selected}\n onChange={handleChange}\n data={data}\n onMouseLeave={handleMouseLeave}\n />\n </HvVerticalNavigation>\n </StyledPopupContainer>\n </ClickAwayListener>\n </StyledPopper>\n );\n};\n"],"names":["HvVerticalNavigationPopup","id","anchorEl","fixedMode","onClose","data","selected","onChange","others","handleClickAway","handleChange","event","selectedItem","handleMouseLeave","StyledPopper","open","placement","children","ClickAwayListener","onClickAway","StyledPopupContainer","HvVerticalNavigation","HvVerticalNavigationTree","className","clsx","verticalNavigationTreeClasses","popup","setId","collapsible","defaultExpanded","onMouseLeave"],"mappings":";;;;;;;;;;AAyBO,MAAMA,4BAA4BA,CAAC;AAAA,EACxCC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EAEA,GAAGC;AAC2B,MAAM;AACpC,QAAMC,kBAAkBA,MAAM;AACjB;AAAA,EAAA;AAGPC,QAAAA,eAAeA,CAACC,OAAOC,iBAAiB;AACnCD,aAAAA,OAAOC,aAAaX,IAAIW,YAAY;AAAA,EAAA;AAG/C,QAAMC,mBAAmBA,MAAM;AAC7B,QAAI,CAACV,WAAW;AACH;AAAA,IACb;AAAA,EAAA;AAGF,wCACGW,uBAAAA,cAAY;AAAA,IAACC,MAAI;AAAA,IAACb;AAAAA,IAAoBc,WAAU;AAAA,IAAa,GAAKR;AAAAA,IAAMS,yCACtEC,4BAAiB;AAAA,MAACC,aAAaV;AAAAA,MAAgBQ,yCAC7CG,6CAAoB;AAAA,QAAAH,yCAClBI,yCAAoB;AAAA,UAACN,MAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"NavigationPopup.cjs","sources":["../../../../../src/components/VerticalNavigation/NavigationPopup/NavigationPopup.tsx"],"sourcesContent":["import { ClickAwayListener } from \"@mui/material\";\nimport { clsx } from \"clsx\";\n\nimport {\n NavigationData,\n HvVerticalNavigationTree,\n HvVerticalNavigation,\n verticalNavigationTreeClasses,\n} from \"@core/components\";\nimport { HvBaseProps } from \"@core/types\";\nimport { setId } from \"@core/utils\";\n\nimport { StyledPopper, StyledPopupContainer } from \"./NavigationPopup.styles\";\n\nexport interface HvVerticalNavigationPopupProps\n extends HvBaseProps<HTMLDivElement> {\n id?: string;\n anchorEl?: HTMLElement | null;\n fixedMode?: boolean;\n data?: NavigationData[];\n selected?: string;\n onClose?: () => void;\n onChange?: any;\n}\n\nexport const HvVerticalNavigationPopup = ({\n id,\n anchorEl,\n fixedMode,\n onClose,\n data,\n selected,\n onChange,\n\n ...others\n}: HvVerticalNavigationPopupProps) => {\n const handleClickAway = () => {\n onClose?.();\n };\n\n const handleChange = (event, selectedItem) => {\n onChange(event, selectedItem.id, selectedItem);\n };\n\n const handleMouseLeave = () => {\n if (!fixedMode) {\n onClose?.();\n }\n };\n\n return (\n <StyledPopper open anchorEl={anchorEl} placement=\"right-start\" {...others}>\n <ClickAwayListener onClickAway={handleClickAway}>\n <StyledPopupContainer>\n <HvVerticalNavigation open useIcons>\n <HvVerticalNavigationTree\n className={clsx(verticalNavigationTreeClasses.popup)}\n id={setId(id, \"tree\")}\n collapsible\n defaultExpanded\n selected={selected}\n onChange={handleChange}\n data={data}\n onMouseLeave={handleMouseLeave}\n />\n </HvVerticalNavigation>\n </StyledPopupContainer>\n </ClickAwayListener>\n </StyledPopper>\n );\n};\n"],"names":["HvVerticalNavigationPopup","id","anchorEl","fixedMode","onClose","data","selected","onChange","others","handleClickAway","handleChange","event","selectedItem","handleMouseLeave","StyledPopper","open","placement","children","ClickAwayListener","onClickAway","StyledPopupContainer","HvVerticalNavigation","useIcons","HvVerticalNavigationTree","className","clsx","verticalNavigationTreeClasses","popup","setId","collapsible","defaultExpanded","onMouseLeave"],"mappings":";;;;;;;;;;AAyBO,MAAMA,4BAA4BA,CAAC;AAAA,EACxCC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EAEA,GAAGC;AAC2B,MAAM;AACpC,QAAMC,kBAAkBA,MAAM;AACjB;AAAA,EAAA;AAGPC,QAAAA,eAAeA,CAACC,OAAOC,iBAAiB;AACnCD,aAAAA,OAAOC,aAAaX,IAAIW,YAAY;AAAA,EAAA;AAG/C,QAAMC,mBAAmBA,MAAM;AAC7B,QAAI,CAACV,WAAW;AACH;AAAA,IACb;AAAA,EAAA;AAGF,wCACGW,uBAAAA,cAAY;AAAA,IAACC,MAAI;AAAA,IAACb;AAAAA,IAAoBc,WAAU;AAAA,IAAa,GAAKR;AAAAA,IAAMS,yCACtEC,4BAAiB;AAAA,MAACC,aAAaV;AAAAA,MAAgBQ,yCAC7CG,6CAAoB;AAAA,QAAAH,yCAClBI,yCAAoB;AAAA,UAACN,MAAI;AAAA,UAACO,UAAQ;AAAA,UAAAL,yCAChCM,qCAAwB;AAAA,YACvBC,WAAWC,KAAAA,KAAKC,kBAAAA,QAA8BC,KAAK;AAAA,YACnD1B,IAAI2B,MAAAA,MAAM3B,IAAI,MAAM;AAAA,YACpB4B,aAAW;AAAA,YACXC,iBAAe;AAAA,YACfxB;AAAAA,YACAC,UAAUG;AAAAA,YACVL;AAAAA,YACA0B,cAAclB;AAAAA,UAAAA,CAAiB;AAAA,QAAA,CAC/B;AAAA,MAAA,CACmB;AAAA,IAAA,CACF;AAAA,EAAA,CAEZ;AAEnB;;"}
|
|
@@ -77,7 +77,7 @@ const HvVerticalNavigationTreeViewItem = React.forwardRef((props, ref) => {
|
|
|
77
77
|
}), [nodeId, treeitemElement]);
|
|
78
78
|
const {
|
|
79
79
|
isOpen,
|
|
80
|
-
|
|
80
|
+
useIcons
|
|
81
81
|
} = React.useContext(VerticalNavigationContext.VerticalNavigationContext);
|
|
82
82
|
const {
|
|
83
83
|
index,
|
|
@@ -222,7 +222,7 @@ const HvVerticalNavigationTreeViewItem = React.forwardRef((props, ref) => {
|
|
|
222
222
|
onClick: handleClick,
|
|
223
223
|
onMouseDown: handleMouseDown,
|
|
224
224
|
style: {
|
|
225
|
-
paddingLeft: (expandable ||
|
|
225
|
+
paddingLeft: (expandable || useIcons || !isOpen ? 0 : 10) + level * (collapsible ? 32 : 10)
|
|
226
226
|
},
|
|
227
227
|
role: href ? void 0 : "button",
|
|
228
228
|
...treeviewMode ? {
|
|
@@ -237,10 +237,10 @@ const HvVerticalNavigationTreeViewItem = React.forwardRef((props, ref) => {
|
|
|
237
237
|
"aria-label": payload == null ? void 0 : payload.label
|
|
238
238
|
},
|
|
239
239
|
children: [isOpen && expandable && (expanded ? /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropUpXS, {}) : /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropDownXS, {})), /* @__PURE__ */ jsxRuntime.jsx(IconWrapper.IconWrapper, {
|
|
240
|
-
icon,
|
|
240
|
+
icon: useIcons && icon,
|
|
241
241
|
label: payload == null ? void 0 : payload.label,
|
|
242
242
|
hasChildren: Boolean(children),
|
|
243
|
-
showAvatar: !icon &&
|
|
243
|
+
showAvatar: !icon && useIcons,
|
|
244
244
|
isOpen,
|
|
245
245
|
disableTooltip
|
|
246
246
|
}), isOpen && label]
|
|
@@ -254,7 +254,7 @@ const HvVerticalNavigationTreeViewItem = React.forwardRef((props, ref) => {
|
|
|
254
254
|
return /* @__PURE__ */ jsxRuntime.jsxs(TreeViewItem_styles.StyledNode, {
|
|
255
255
|
ref: handleRef,
|
|
256
256
|
id: id ?? void 0,
|
|
257
|
-
className: clsx.clsx((_a = treeViewItemClasses.default) == null ? void 0 : _a.node, classes == null ? void 0 : classes.node, className, disabled && clsx.clsx(treeViewItemClasses.default.disabled, classes == null ? void 0 : classes.disabled), expandable && clsx.clsx(treeViewItemClasses.default.expandable, classes == null ? void 0 : classes.expandable), expandable && !expanded && clsx.clsx(treeViewItemClasses.default.collapsed, classes == null ? void 0 : classes.collapsed), expandable && expanded && clsx.clsx(treeViewItemClasses.default.expanded, classes == null ? void 0 : classes.expanded), selectable && !disabled && clsx.clsx(treeViewItemClasses.default.selectable, classes == null ? void 0 : classes.selectable), !disabled && !selectable && clsx.clsx(treeViewItemClasses.default.unselectable, classes == null ? void 0 : classes.unselectable), !disabled && selectable && selected && clsx.clsx(treeViewItemClasses.default.selected, classes == null ? void 0 : classes.selected), !disabled && selectable && !selected && clsx.clsx(treeViewItemClasses.default.unselected, classes == null ? void 0 : classes.unselected), focused && clsx.clsx(treeViewItemClasses.default.focused, classes == null ? void 0 : classes.focused), !isOpen &&
|
|
257
|
+
className: clsx.clsx((_a = treeViewItemClasses.default) == null ? void 0 : _a.node, classes == null ? void 0 : classes.node, className, disabled && clsx.clsx(treeViewItemClasses.default.disabled, classes == null ? void 0 : classes.disabled), expandable && clsx.clsx(treeViewItemClasses.default.expandable, classes == null ? void 0 : classes.expandable), expandable && !expanded && clsx.clsx(treeViewItemClasses.default.collapsed, classes == null ? void 0 : classes.collapsed), expandable && expanded && clsx.clsx(treeViewItemClasses.default.expanded, classes == null ? void 0 : classes.expanded), selectable && !disabled && clsx.clsx(treeViewItemClasses.default.selectable, classes == null ? void 0 : classes.selectable), !disabled && !selectable && clsx.clsx(treeViewItemClasses.default.unselectable, classes == null ? void 0 : classes.unselectable), !disabled && selectable && selected && clsx.clsx(treeViewItemClasses.default.selected, classes == null ? void 0 : classes.selected), !disabled && selectable && !selected && clsx.clsx(treeViewItemClasses.default.unselected, classes == null ? void 0 : classes.unselected), focused && clsx.clsx(treeViewItemClasses.default.focused, classes == null ? void 0 : classes.focused), !isOpen && !useIcons && clsx.clsx(treeViewItemClasses.default.hide, classes == null ? void 0 : classes.hide), !isOpen && useIcons && isChildSelected && isChildSelected(nodeId) && clsx.clsx(treeViewItemClasses.default.selected, classes == null ? void 0 : classes.selected)),
|
|
258
258
|
"data-hasicon": icon != null ? true : void 0,
|
|
259
259
|
...mode === "treeview" && {
|
|
260
260
|
role: "treeitem",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeViewItem.cjs","sources":["../../../../../src/components/VerticalNavigation/TreeView/TreeViewItem.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { clsx } from \"clsx\";\nimport { DropDownXS, DropUpXS } from \"@hitachivantara/uikit-react-icons\";\nimport { useForkRef } from \"@core/hooks\";\nimport { setId } from \"@core/utils\";\nimport treeViewItemClasses, {\n HvVerticalNavigationTreeViewItemClasses,\n} from \"./treeViewItemClasses\";\nimport { StyledContent, StyledGroup, StyledNode } from \"./TreeViewItem.styles\";\nimport { DescendantProvider, useDescendant } from \"./descendants\";\nimport {\n TreeViewControlContext,\n TreeViewStateContext,\n} from \"./TreeViewContext\";\nimport { VerticalNavigationContext } from \"..\";\nimport { IconWrapper } from \"./IconWrapper\";\n\nexport interface HvVerticalNavigationTreeViewItemProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the Radio button.\n */\n classes?: HvVerticalNavigationTreeViewItemClasses;\n /**\n * Is the node disabled.\n */\n disabled?: boolean;\n /**\n * Can the node be selected.\n */\n selectable?: boolean;\n /**\n * The id of the node.\n */\n nodeId?: string;\n /**\n * The icon to display next to the node's label.\n */\n icon?: React.ReactNode;\n /**\n * The item label.\n */\n label?: React.ReactNode;\n /**\n * The url for the link.\n */\n href?: string;\n /**\n * The behavior when opening a link.\n */\n target?: string;\n /**\n * The node payload.\n */\n payload?: any;\n /**\n * @ignore\n */\n onClick?: any;\n /**\n * @ignore\n */\n onMouseDown?: any;\n /**\n * @ignore\n */\n onFocus?: any;\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n /**\n * @ignore\n */\n onMouseEnter?: any;\n /**\n * Disables the appearence of a tooltip on hovering an element ( Only applicable when the in collapsed mode)\n */\n disableTooltip?: boolean;\n}\n\nconst preventSelection = (event, disabled) => {\n if (event.shiftKey || event.ctrlKey || event.metaKey || disabled) {\n // Prevent text selection\n event.preventDefault();\n }\n};\n\nexport const HvVerticalNavigationTreeViewItem = forwardRef(\n (props: HvVerticalNavigationTreeViewItemProps, ref) => {\n const {\n id: idProp,\n className,\n classes,\n\n disabled: disabledProp = false,\n\n selectable: selectableProp,\n\n nodeId,\n icon = null,\n label,\n href,\n target,\n payload,\n\n onClick,\n onMouseDown,\n onFocus,\n\n children,\n\n disableTooltip,\n\n ...others\n } = props;\n\n const treeViewControlContext = useContext(TreeViewControlContext);\n const { isExpanded, isSelected, isFocused, isDisabled, isChildSelected } =\n useContext(TreeViewStateContext);\n\n const {\n treeId,\n mode,\n collapsible,\n toggleExpansion,\n multiSelect,\n selectNode,\n selectRange,\n disabledItemsFocusable,\n registerNode,\n unregisterNode,\n mapFirstChar,\n unMapFirstChar,\n focus,\n } = treeViewControlContext;\n\n const treeviewMode = mode === \"treeview\";\n\n let id: string | null = null;\n\n if (idProp != null) {\n id = idProp;\n } else if (treeId && nodeId) {\n id = `${treeId}-${nodeId}`;\n }\n\n const [treeitemElement, setTreeitemElement] = useState(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const handleRef = useForkRef(setTreeitemElement, ref);\n\n const descendant = useMemo(\n () => ({\n element: treeitemElement,\n id: nodeId,\n }),\n [nodeId, treeitemElement]\n );\n\n const { isOpen, collapsedMode } = useContext(VerticalNavigationContext);\n\n const { index, parentId, level } = useDescendant(descendant);\n\n const expandable = collapsible && Array.isArray(children);\n const expanded = isExpanded ? isExpanded(nodeId) : false;\n const focused = isFocused ? isFocused(nodeId) : false;\n const selected = isSelected ? isSelected(nodeId) : false;\n const disabled = isDisabled ? isDisabled(nodeId) : false;\n\n const selectable =\n selectableProp != null\n ? selectableProp\n : !collapsible || !expandable || !isOpen;\n\n useEffect(() => {\n // On the first render a node's index will be -1. We want to wait for the real index.\n if (registerNode && unregisterNode && index !== -1) {\n registerNode({\n id: nodeId,\n idAttribute: id,\n index,\n parentId,\n selectable,\n expandable,\n disabled: disabledProp,\n onFocus,\n payload,\n });\n\n return () => {\n unregisterNode(nodeId);\n };\n }\n\n return undefined;\n }, [\n registerNode,\n unregisterNode,\n parentId,\n index,\n nodeId,\n expandable,\n disabledProp,\n id,\n selectable,\n onFocus,\n payload,\n ]);\n\n useEffect(() => {\n if (\n mapFirstChar &&\n unMapFirstChar &&\n label &&\n contentRef.current?.textContent\n ) {\n mapFirstChar(\n nodeId,\n contentRef.current?.textContent.substring(0, 1).toLowerCase()\n );\n\n return () => {\n unMapFirstChar(nodeId);\n };\n }\n return undefined;\n }, [mapFirstChar, unMapFirstChar, nodeId, label]);\n\n let ariaSelected;\n if (multiSelect) {\n ariaSelected = selected;\n } else if (selected) {\n /* single-selection trees unset aria-selected on un-selected items.\n *\n * If the tree does not support multiple selection, aria-selected\n * is set to true for the selected node and it is not present on any other node in the tree.\n * Source: https://www.w3.org/TR/wai-aria-practices/#TreeView\n */\n ariaSelected = true;\n }\n\n const handleFocus = useCallback(\n (event) => {\n // DOM focus stays on the tree which manages focus with aria-activedescendant\n if (event.target === event.currentTarget) {\n (event.target.ownerDocument || document)\n .getElementById(treeId)\n .focus({ preventScroll: true });\n }\n\n const unfocusable = !disabledItemsFocusable && disabled;\n if (\n !focused &&\n event.currentTarget === event.target &&\n !unfocusable &&\n focus\n ) {\n focus(event, nodeId);\n }\n },\n [disabled, disabledItemsFocusable, focus, focused, nodeId, treeId]\n );\n\n const handleExpansion = useCallback(\n (event) => {\n if (!disabled) {\n if (treeviewMode && !focused && focus) {\n focus(event, nodeId);\n }\n\n const multiple =\n multiSelect && (event.shiftKey || event.ctrlKey || event.metaKey);\n\n // If already expanded and trying to toggle selection don't close\n if (\n expandable &&\n isOpen &&\n !(multiple && isExpanded && isExpanded(nodeId))\n ) {\n if (toggleExpansion) toggleExpansion(event, nodeId);\n }\n }\n },\n [\n disabled,\n expandable,\n focus,\n focused,\n isExpanded,\n multiSelect,\n nodeId,\n toggleExpansion,\n treeviewMode,\n ]\n );\n\n const handleSelection = useCallback(\n (event) => {\n if (selectable && !disabled) {\n if (treeviewMode && !focused && focus) {\n focus(event, nodeId);\n }\n\n const multiple =\n multiSelect && (event.shiftKey || event.ctrlKey || event.metaKey);\n\n if (multiple) {\n if (event.shiftKey) {\n if (selectRange) return selectRange(event, { end: nodeId });\n } else if (selectNode) return selectNode(event, nodeId, true);\n } else if (selectNode) return selectNode(event, nodeId);\n } else {\n return false;\n }\n },\n [\n disabled,\n focus,\n focused,\n multiSelect,\n nodeId,\n selectNode,\n selectRange,\n selectable,\n treeviewMode,\n ]\n );\n\n const handleMouseDown = useCallback(\n (event) => {\n preventSelection(event, disabled);\n\n if (onMouseDown) {\n onMouseDown(event);\n }\n },\n [disabled, onMouseDown]\n );\n\n const handleClick = useCallback(\n (event) => {\n if (!disabled) {\n if (expandable && isOpen) {\n handleExpansion(event);\n }\n\n if (selectable) {\n handleSelection(event);\n }\n }\n\n if (onClick) {\n onClick(event);\n }\n },\n [\n disabled,\n expandable,\n handleExpansion,\n handleSelection,\n onClick,\n selectable,\n ]\n );\n\n const handleKeyDown = useCallback(\n (event) => {\n let isEventHandled = false;\n const { key } = event;\n\n if (\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.currentTarget !== event.target\n ) {\n return;\n }\n if (contentRef.current === event.currentTarget) {\n if (key === \"Enter\" || key === \" \") {\n if (expandable && isOpen) {\n isEventHandled = handleExpansion(event) as unknown as boolean;\n }\n\n if (selectable) {\n isEventHandled = handleSelection(event) as boolean;\n }\n }\n\n if (isEventHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n },\n [expandable, handleExpansion, handleSelection, selectable]\n );\n\n const renderedContent = useMemo(\n () => (\n <StyledContent\n id={setId(id, \"button\")}\n component={href ? \"a\" : \"div\"}\n href={href}\n target={target}\n ref={contentRef}\n className={clsx(\n treeViewItemClasses.content,\n classes?.content,\n href != null && clsx(treeViewItemClasses.link, classes?.link),\n !isOpen && clsx(treeViewItemClasses.minimized, classes?.minimized)\n )}\n variant=\"body\"\n disabled={disabled}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n style={{\n paddingLeft:\n (expandable || icon != null || !isOpen ? 0 : 10) +\n level * (collapsible ? 32 : 10),\n }}\n role={href ? undefined : \"button\"}\n {...(treeviewMode\n ? {\n tabIndex: -1,\n onFocus: handleFocus,\n }\n : {\n tabIndex: selectable || expandable ? 0 : -1,\n onKeyDown: handleKeyDown,\n \"aria-current\":\n (selectable && selected) ||\n (!isOpen && isChildSelected?.(nodeId))\n ? href\n ? \"page\"\n : true\n : undefined,\n \"aria-expanded\": expandable ? expanded : undefined,\n \"aria-controls\": expandable ? setId(id, \"group\") : undefined,\n \"aria-label\": payload?.label,\n })}\n >\n {isOpen && expandable && (expanded ? <DropUpXS /> : <DropDownXS />)}\n\n <IconWrapper\n icon={icon}\n label={payload?.label}\n hasChildren={Boolean(children)}\n showAvatar={\n !icon && level === 0 && !isOpen && collapsedMode === \"icon\"\n }\n isOpen={isOpen}\n disableTooltip={disableTooltip}\n />\n\n {isOpen && label}\n </StyledContent>\n ),\n [\n id,\n href,\n target,\n classes?.content,\n treeViewItemClasses.content,\n classes?.link,\n treeViewItemClasses.link,\n classes?.minimized,\n treeViewItemClasses.minimized,\n disabled,\n handleClick,\n handleMouseDown,\n expandable,\n icon,\n level,\n collapsible,\n treeviewMode,\n handleFocus,\n selectable,\n handleKeyDown,\n selected,\n expanded,\n label,\n disableTooltip,\n ]\n );\n\n const renderedChildren = useMemo(\n () =>\n children && (\n <StyledGroup\n id={setId(id, \"group\")}\n className={clsx(treeViewItemClasses.group, classes?.group)}\n role={treeviewMode ? \"group\" : undefined}\n >\n {children}\n </StyledGroup>\n ),\n [children, treeViewItemClasses.group, classes?.group, id, treeviewMode]\n );\n\n return (\n <StyledNode\n ref={handleRef}\n id={id ?? undefined}\n className={clsx(\n treeViewItemClasses?.node,\n classes?.node,\n className,\n disabled && clsx(treeViewItemClasses.disabled, classes?.disabled),\n expandable &&\n clsx(treeViewItemClasses.expandable, classes?.expandable),\n expandable &&\n !expanded &&\n clsx(treeViewItemClasses.collapsed, classes?.collapsed),\n expandable &&\n expanded &&\n clsx(treeViewItemClasses.expanded, classes?.expanded),\n selectable &&\n !disabled &&\n clsx(treeViewItemClasses.selectable, classes?.selectable),\n !disabled &&\n !selectable &&\n clsx(treeViewItemClasses.unselectable, classes?.unselectable),\n !disabled &&\n selectable &&\n selected &&\n clsx(treeViewItemClasses.selected, classes?.selected),\n !disabled &&\n selectable &&\n !selected &&\n clsx(treeViewItemClasses.unselected, classes?.unselected),\n focused && clsx(treeViewItemClasses.focused, classes?.focused),\n !isOpen &&\n collapsedMode === \"simple\" &&\n clsx(treeViewItemClasses.hide, classes?.hide),\n !isOpen &&\n collapsedMode === \"icon\" &&\n isChildSelected &&\n isChildSelected(nodeId) &&\n clsx(treeViewItemClasses.selected, classes?.selected)\n )}\n data-hasicon={icon != null ? true : undefined}\n {...(mode === \"treeview\" && {\n role: \"treeitem\",\n \"aria-selected\": ariaSelected,\n \"aria-expanded\": expandable ? expanded : undefined,\n \"aria-disabled\": disabled ? true : undefined,\n })}\n {...others}\n >\n {renderedContent}\n {isOpen && (\n <DescendantProvider id={nodeId} level={level + 1}>\n {renderedChildren}\n </DescendantProvider>\n )}\n </StyledNode>\n );\n }\n);\n"],"names":["preventSelection","event","disabled","shiftKey","ctrlKey","metaKey","preventDefault","HvVerticalNavigationTreeViewItem","forwardRef","props","ref","id","idProp","className","classes","disabledProp","selectable","selectableProp","nodeId","icon","label","href","target","payload","onClick","onMouseDown","onFocus","children","disableTooltip","others","treeViewControlContext","useContext","TreeViewControlContext","isExpanded","isSelected","isFocused","isDisabled","isChildSelected","TreeViewStateContext","treeId","mode","collapsible","toggleExpansion","multiSelect","selectNode","selectRange","disabledItemsFocusable","registerNode","unregisterNode","mapFirstChar","unMapFirstChar","focus","treeviewMode","treeitemElement","setTreeitemElement","useState","contentRef","useRef","handleRef","useForkRef","descendant","useMemo","element","isOpen","collapsedMode","VerticalNavigationContext","index","parentId","level","useDescendant","expandable","Array","isArray","expanded","focused","selected","useEffect","idAttribute","undefined","current","textContent","substring","toLowerCase","ariaSelected","handleFocus","useCallback","currentTarget","ownerDocument","document","getElementById","preventScroll","unfocusable","handleExpansion","multiple","handleSelection","end","handleMouseDown","handleClick","handleKeyDown","isEventHandled","key","altKey","stopPropagation","renderedContent","_jsxs","StyledContent","setId","component","clsx","treeViewItemClasses","content","link","minimized","variant","style","paddingLeft","role","tabIndex","onKeyDown","DropUpXS","DropDownXS","IconWrapper","hasChildren","Boolean","showAvatar","renderedChildren","StyledGroup","group","StyledNode","node","collapsed","unselectable","unselected","hide","DescendantProvider"],"mappings":";;;;;;;;;;;;;;AAgGA,MAAMA,mBAAmBA,CAACC,OAAOC,aAAa;AAC5C,MAAID,MAAME,YAAYF,MAAMG,WAAWH,MAAMI,WAAWH,UAAU;AAEhED,UAAMK,eAAgB;AAAA,EACxB;AACF;AAEO,MAAMC,mCAAmCC,MAAAA,WAC9C,CAACC,OAA8CC,QAAQ;;AAC/C,QAAA;AAAA,IACJC,IAAIC;AAAAA,IACJC;AAAAA,IACAC;AAAAA,IAEAZ,UAAUa,eAAe;AAAA,IAEzBC,YAAYC;AAAAA,IAEZC;AAAAA,IACAC,OAAO;AAAA,IACPC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IAEAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IAEAC;AAAAA,IAEAC;AAAAA,IAEA,GAAGC;AAAAA,EACDpB,IAAAA;AAEEqB,QAAAA,yBAAyBC,iBAAWC,gBAAAA,sBAAsB;AAC1D,QAAA;AAAA,IAAEC;AAAAA,IAAYC;AAAAA,IAAYC;AAAAA,IAAWC;AAAAA,IAAYC;AAAAA,EAAAA,IACrDN,MAAAA,WAAWO,gBAAAA,oBAAoB;AAE3B,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,EACErB,IAAAA;AAEJ,QAAMsB,eAAeZ,SAAS;AAE9B,MAAI7B,KAAoB;AAExB,MAA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AAkB,UAClB3B,mBACAA,gBAAgBnB,MAAM,KACtB0F,UAAKC,4BAAoBlC,UAAU7D,mCAAS6D,QAAQ,CAAC;AAAA,IAEzD,gBAAcxD,QAAQ,OAAO,OAAO2D;AAAAA,IAAU,GACzCtC,SAAS,cAAc;AAAA,MAC1B4E,MAAM;AAAA,MACN,iBAAiBjC;AAAAA,MACjB,iBAAiBb,aAAaG,WAAWK;AAAAA,MACzC,iBAAiB5E,WAAW,OAAO4E;AAAAA,IACrC;AAAA,IAAC,GACGjD;AAAAA,IAAMF,WAET4E,iBACAxC,yCACEuE,YAAAA,oBAAkB;AAAA,MAAC3H,IAAIO;AAAAA,MAAQkD,OAAOA,QAAQ;AAAA,MAAEzC,UAC9CkG;AAAAA,IAAAA,CAEJ,CAAA;AAAA,EAAA,CACU;AAEjB,CAAC;;"}
|
|
1
|
+
{"version":3,"file":"TreeViewItem.cjs","sources":["../../../../../src/components/VerticalNavigation/TreeView/TreeViewItem.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { clsx } from \"clsx\";\nimport { DropDownXS, DropUpXS } from \"@hitachivantara/uikit-react-icons\";\nimport { useForkRef } from \"@core/hooks\";\nimport { setId } from \"@core/utils\";\nimport treeViewItemClasses, {\n HvVerticalNavigationTreeViewItemClasses,\n} from \"./treeViewItemClasses\";\nimport { StyledContent, StyledGroup, StyledNode } from \"./TreeViewItem.styles\";\nimport { DescendantProvider, useDescendant } from \"./descendants\";\nimport {\n TreeViewControlContext,\n TreeViewStateContext,\n} from \"./TreeViewContext\";\nimport { VerticalNavigationContext } from \"..\";\nimport { IconWrapper } from \"./IconWrapper\";\n\nexport interface HvVerticalNavigationTreeViewItemProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the Radio button.\n */\n classes?: HvVerticalNavigationTreeViewItemClasses;\n /**\n * Is the node disabled.\n */\n disabled?: boolean;\n /**\n * Can the node be selected.\n */\n selectable?: boolean;\n /**\n * The id of the node.\n */\n nodeId?: string;\n /**\n * The icon to display next to the node's label.\n */\n icon?: React.ReactNode;\n /**\n * The item label.\n */\n label?: React.ReactNode;\n /**\n * The url for the link.\n */\n href?: string;\n /**\n * The behavior when opening a link.\n */\n target?: string;\n /**\n * The node payload.\n */\n payload?: any;\n /**\n * @ignore\n */\n onClick?: any;\n /**\n * @ignore\n */\n onMouseDown?: any;\n /**\n * @ignore\n */\n onFocus?: any;\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n /**\n * @ignore\n */\n onMouseEnter?: any;\n /**\n * Disables the appearence of a tooltip on hovering an element ( Only applicable when the in collapsed mode)\n */\n disableTooltip?: boolean;\n}\n\nconst preventSelection = (event, disabled) => {\n if (event.shiftKey || event.ctrlKey || event.metaKey || disabled) {\n // Prevent text selection\n event.preventDefault();\n }\n};\n\nexport const HvVerticalNavigationTreeViewItem = forwardRef(\n (props: HvVerticalNavigationTreeViewItemProps, ref) => {\n const {\n id: idProp,\n className,\n classes,\n\n disabled: disabledProp = false,\n\n selectable: selectableProp,\n\n nodeId,\n icon = null,\n label,\n href,\n target,\n payload,\n\n onClick,\n onMouseDown,\n onFocus,\n\n children,\n\n disableTooltip,\n\n ...others\n } = props;\n\n const treeViewControlContext = useContext(TreeViewControlContext);\n const { isExpanded, isSelected, isFocused, isDisabled, isChildSelected } =\n useContext(TreeViewStateContext);\n\n const {\n treeId,\n mode,\n collapsible,\n toggleExpansion,\n multiSelect,\n selectNode,\n selectRange,\n disabledItemsFocusable,\n registerNode,\n unregisterNode,\n mapFirstChar,\n unMapFirstChar,\n focus,\n } = treeViewControlContext;\n\n const treeviewMode = mode === \"treeview\";\n\n let id: string | null = null;\n\n if (idProp != null) {\n id = idProp;\n } else if (treeId && nodeId) {\n id = `${treeId}-${nodeId}`;\n }\n\n const [treeitemElement, setTreeitemElement] = useState(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const handleRef = useForkRef(setTreeitemElement, ref);\n\n const descendant = useMemo(\n () => ({\n element: treeitemElement,\n id: nodeId,\n }),\n [nodeId, treeitemElement]\n );\n\n const { isOpen, useIcons } = useContext(VerticalNavigationContext);\n\n const { index, parentId, level } = useDescendant(descendant);\n\n const expandable = collapsible && Array.isArray(children);\n const expanded = isExpanded ? isExpanded(nodeId) : false;\n const focused = isFocused ? isFocused(nodeId) : false;\n const selected = isSelected ? isSelected(nodeId) : false;\n const disabled = isDisabled ? isDisabled(nodeId) : false;\n\n const selectable =\n selectableProp != null\n ? selectableProp\n : !collapsible || !expandable || !isOpen;\n\n useEffect(() => {\n // On the first render a node's index will be -1. We want to wait for the real index.\n if (registerNode && unregisterNode && index !== -1) {\n registerNode({\n id: nodeId,\n idAttribute: id,\n index,\n parentId,\n selectable,\n expandable,\n disabled: disabledProp,\n onFocus,\n payload,\n });\n\n return () => {\n unregisterNode(nodeId);\n };\n }\n\n return undefined;\n }, [\n registerNode,\n unregisterNode,\n parentId,\n index,\n nodeId,\n expandable,\n disabledProp,\n id,\n selectable,\n onFocus,\n payload,\n ]);\n\n useEffect(() => {\n if (\n mapFirstChar &&\n unMapFirstChar &&\n label &&\n contentRef.current?.textContent\n ) {\n mapFirstChar(\n nodeId,\n contentRef.current?.textContent.substring(0, 1).toLowerCase()\n );\n\n return () => {\n unMapFirstChar(nodeId);\n };\n }\n return undefined;\n }, [mapFirstChar, unMapFirstChar, nodeId, label]);\n\n let ariaSelected;\n if (multiSelect) {\n ariaSelected = selected;\n } else if (selected) {\n /* single-selection trees unset aria-selected on un-selected items.\n *\n * If the tree does not support multiple selection, aria-selected\n * is set to true for the selected node and it is not present on any other node in the tree.\n * Source: https://www.w3.org/TR/wai-aria-practices/#TreeView\n */\n ariaSelected = true;\n }\n\n const handleFocus = useCallback(\n (event) => {\n // DOM focus stays on the tree which manages focus with aria-activedescendant\n if (event.target === event.currentTarget) {\n (event.target.ownerDocument || document)\n .getElementById(treeId)\n .focus({ preventScroll: true });\n }\n\n const unfocusable = !disabledItemsFocusable && disabled;\n if (\n !focused &&\n event.currentTarget === event.target &&\n !unfocusable &&\n focus\n ) {\n focus(event, nodeId);\n }\n },\n [disabled, disabledItemsFocusable, focus, focused, nodeId, treeId]\n );\n\n const handleExpansion = useCallback(\n (event) => {\n if (!disabled) {\n if (treeviewMode && !focused && focus) {\n focus(event, nodeId);\n }\n\n const multiple =\n multiSelect && (event.shiftKey || event.ctrlKey || event.metaKey);\n\n // If already expanded and trying to toggle selection don't close\n if (\n expandable &&\n isOpen &&\n !(multiple && isExpanded && isExpanded(nodeId))\n ) {\n if (toggleExpansion) toggleExpansion(event, nodeId);\n }\n }\n },\n [\n disabled,\n expandable,\n focus,\n focused,\n isExpanded,\n multiSelect,\n nodeId,\n toggleExpansion,\n treeviewMode,\n ]\n );\n\n const handleSelection = useCallback(\n (event) => {\n if (selectable && !disabled) {\n if (treeviewMode && !focused && focus) {\n focus(event, nodeId);\n }\n\n const multiple =\n multiSelect && (event.shiftKey || event.ctrlKey || event.metaKey);\n\n if (multiple) {\n if (event.shiftKey) {\n if (selectRange) return selectRange(event, { end: nodeId });\n } else if (selectNode) return selectNode(event, nodeId, true);\n } else if (selectNode) return selectNode(event, nodeId);\n } else {\n return false;\n }\n },\n [\n disabled,\n focus,\n focused,\n multiSelect,\n nodeId,\n selectNode,\n selectRange,\n selectable,\n treeviewMode,\n ]\n );\n\n const handleMouseDown = useCallback(\n (event) => {\n preventSelection(event, disabled);\n\n if (onMouseDown) {\n onMouseDown(event);\n }\n },\n [disabled, onMouseDown]\n );\n\n const handleClick = useCallback(\n (event) => {\n if (!disabled) {\n if (expandable && isOpen) {\n handleExpansion(event);\n }\n\n if (selectable) {\n handleSelection(event);\n }\n }\n\n if (onClick) {\n onClick(event);\n }\n },\n [\n disabled,\n expandable,\n handleExpansion,\n handleSelection,\n onClick,\n selectable,\n ]\n );\n\n const handleKeyDown = useCallback(\n (event) => {\n let isEventHandled = false;\n const { key } = event;\n\n if (\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.currentTarget !== event.target\n ) {\n return;\n }\n if (contentRef.current === event.currentTarget) {\n if (key === \"Enter\" || key === \" \") {\n if (expandable && isOpen) {\n isEventHandled = handleExpansion(event) as unknown as boolean;\n }\n\n if (selectable) {\n isEventHandled = handleSelection(event) as boolean;\n }\n }\n\n if (isEventHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n },\n [expandable, handleExpansion, handleSelection, selectable]\n );\n\n const renderedContent = useMemo(\n () => (\n <StyledContent\n id={setId(id, \"button\")}\n component={href ? \"a\" : \"div\"}\n href={href}\n target={target}\n ref={contentRef}\n className={clsx(\n treeViewItemClasses.content,\n classes?.content,\n href != null && clsx(treeViewItemClasses.link, classes?.link),\n !isOpen && clsx(treeViewItemClasses.minimized, classes?.minimized)\n )}\n variant=\"body\"\n disabled={disabled}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n style={{\n paddingLeft:\n (expandable || useIcons || !isOpen ? 0 : 10) +\n level * (collapsible ? 32 : 10),\n }}\n role={href ? undefined : \"button\"}\n {...(treeviewMode\n ? {\n tabIndex: -1,\n onFocus: handleFocus,\n }\n : {\n tabIndex: selectable || expandable ? 0 : -1,\n onKeyDown: handleKeyDown,\n \"aria-current\":\n (selectable && selected) ||\n (!isOpen && isChildSelected?.(nodeId))\n ? href\n ? \"page\"\n : true\n : undefined,\n \"aria-expanded\": expandable ? expanded : undefined,\n \"aria-controls\": expandable ? setId(id, \"group\") : undefined,\n \"aria-label\": payload?.label,\n })}\n >\n {isOpen && expandable && (expanded ? <DropUpXS /> : <DropDownXS />)}\n\n <IconWrapper\n icon={useIcons && icon}\n label={payload?.label}\n hasChildren={Boolean(children)}\n showAvatar={!icon && useIcons}\n isOpen={isOpen}\n disableTooltip={disableTooltip}\n />\n\n {isOpen && label}\n </StyledContent>\n ),\n [\n id,\n href,\n target,\n classes?.content,\n treeViewItemClasses.content,\n classes?.link,\n treeViewItemClasses.link,\n classes?.minimized,\n treeViewItemClasses.minimized,\n disabled,\n handleClick,\n handleMouseDown,\n expandable,\n icon,\n level,\n collapsible,\n treeviewMode,\n handleFocus,\n selectable,\n handleKeyDown,\n selected,\n expanded,\n label,\n disableTooltip,\n ]\n );\n\n const renderedChildren = useMemo(\n () =>\n children && (\n <StyledGroup\n id={setId(id, \"group\")}\n className={clsx(treeViewItemClasses.group, classes?.group)}\n role={treeviewMode ? \"group\" : undefined}\n >\n {children}\n </StyledGroup>\n ),\n [children, treeViewItemClasses.group, classes?.group, id, treeviewMode]\n );\n\n return (\n <StyledNode\n ref={handleRef}\n id={id ?? undefined}\n className={clsx(\n treeViewItemClasses?.node,\n classes?.node,\n className,\n disabled && clsx(treeViewItemClasses.disabled, classes?.disabled),\n expandable &&\n clsx(treeViewItemClasses.expandable, classes?.expandable),\n expandable &&\n !expanded &&\n clsx(treeViewItemClasses.collapsed, classes?.collapsed),\n expandable &&\n expanded &&\n clsx(treeViewItemClasses.expanded, classes?.expanded),\n selectable &&\n !disabled &&\n clsx(treeViewItemClasses.selectable, classes?.selectable),\n !disabled &&\n !selectable &&\n clsx(treeViewItemClasses.unselectable, classes?.unselectable),\n !disabled &&\n selectable &&\n selected &&\n clsx(treeViewItemClasses.selected, classes?.selected),\n !disabled &&\n selectable &&\n !selected &&\n clsx(treeViewItemClasses.unselected, classes?.unselected),\n focused && clsx(treeViewItemClasses.focused, classes?.focused),\n !isOpen && !useIcons && clsx(treeViewItemClasses.hide, classes?.hide),\n !isOpen &&\n useIcons &&\n isChildSelected &&\n isChildSelected(nodeId) &&\n clsx(treeViewItemClasses.selected, classes?.selected)\n )}\n data-hasicon={icon != null ? true : undefined}\n {...(mode === \"treeview\" && {\n role: \"treeitem\",\n \"aria-selected\": ariaSelected,\n \"aria-expanded\": expandable ? expanded : undefined,\n \"aria-disabled\": disabled ? true : undefined,\n })}\n {...others}\n >\n {renderedContent}\n {isOpen && (\n <DescendantProvider id={nodeId} level={level + 1}>\n {renderedChildren}\n </DescendantProvider>\n )}\n </StyledNode>\n );\n }\n);\n"],"names":["preventSelection","event","disabled","shiftKey","ctrlKey","metaKey","preventDefault","HvVerticalNavigationTreeViewItem","forwardRef","props","ref","id","idProp","className","classes","disabledProp","selectable","selectableProp","nodeId","icon","label","href","target","payload","onClick","onMouseDown","onFocus","children","disableTooltip","others","treeViewControlContext","useContext","TreeViewControlContext","isExpanded","isSelected","isFocused","isDisabled","isChildSelected","TreeViewStateContext","treeId","mode","collapsible","toggleExpansion","multiSelect","selectNode","selectRange","disabledItemsFocusable","registerNode","unregisterNode","mapFirstChar","unMapFirstChar","focus","treeviewMode","treeitemElement","setTreeitemElement","useState","contentRef","useRef","handleRef","useForkRef","descendant","useMemo","element","isOpen","useIcons","VerticalNavigationContext","index","parentId","level","useDescendant","expandable","Array","isArray","expanded","focused","selected","useEffect","idAttribute","undefined","current","textContent","substring","toLowerCase","ariaSelected","handleFocus","useCallback","currentTarget","ownerDocument","document","getElementById","preventScroll","unfocusable","handleExpansion","multiple","handleSelection","end","handleMouseDown","handleClick","handleKeyDown","isEventHandled","key","altKey","stopPropagation","renderedContent","_jsxs","StyledContent","setId","component","clsx","treeViewItemClasses","content","link","minimized","variant","style","paddingLeft","role","tabIndex","onKeyDown","DropUpXS","DropDownXS","IconWrapper","hasChildren","Boolean","showAvatar","renderedChildren","StyledGroup","group","StyledNode","node","collapsed","unselectable","unselected","hide","DescendantProvider"],"mappings":";;;;;;;;;;;;;;AAgGA,MAAMA,mBAAmBA,CAACC,OAAOC,aAAa;AAC5C,MAAID,MAAME,YAAYF,MAAMG,WAAWH,MAAMI,WAAWH,UAAU;AAEhED,UAAMK,eAAgB;AAAA,EACxB;AACF;AAEO,MAAMC,mCAAmCC,MAAAA,WAC9C,CAACC,OAA8CC,QAAQ;;AAC/C,QAAA;AAAA,IACJC,IAAIC;AAAAA,IACJC;AAAAA,IACAC;AAAAA,IAEAZ,UAAUa,eAAe;AAAA,IAEzBC,YAAYC;AA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ode = "simple",
|
|
18
17
|
slider = false,
|
|
18
|
+
useIcons = false,
|
|
19
19
|
...others
|
|
20
20
|
}) => {
|
|
21
|
+
if (others.collapsedMode) {
|
|
22
|
+
console.warn("`collaspedMode` is deprecated. Please use 'useIcons'.");
|
|
23
|
+
}
|
|
21
24
|
const [parentData, setParentData] = React.useState([]);
|
|
22
25
|
const [parentSelected, setParentSelected] = React.useState();
|
|
23
26
|
const [headerTitle, setHeaderTitle] = React.useState();
|
|
@@ -35,7 +38,7 @@ const HvVerticalNavigation = ({
|
|
|
35
38
|
};
|
|
36
39
|
const value = React.useMemo(() => ({
|
|
37
40
|
isOpen: open,
|
|
38
|
-
|
|
41
|
+
useIcons,
|
|
39
42
|
slider,
|
|
40
43
|
headerTitle,
|
|
41
44
|
setHeaderTitle,
|
|
@@ -48,7 +51,7 @@ const HvVerticalNavigation = ({
|
|
|
48
51
|
parentSelected,
|
|
49
52
|
setParentSelected,
|
|
50
53
|
hasAnyChildWithData
|
|
51
|
-
}), [open,
|
|
54
|
+
}), [open, useIcons, slider, headerTitle, setHeaderTitle, parentItem, withParentData, navigateToChildHandler, navigateToParentHandler, hasAnyChildWithData]);
|
|
52
55
|
const content = /* @__PURE__ */ jsxRuntime.jsx(VerticalNavigationContext.VerticalNavigationContext.Provider, {
|
|
53
56
|
value,
|
|
54
57
|
children: /* @__PURE__ */ jsxRuntime.jsx(VerticalNavigation_styles.StyledRoot, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalNavigation.cjs","sources":["../../../../src/components/VerticalNavigation/VerticalNavigation.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { StyledRoot } from \"./VerticalNavigation.styles\";\nimport verticalNavigationClasses, {\n HvVerticalNavigationClasses,\n} from \"./verticalNavigationClasses\";\nimport { NavigationData, VerticalNavigationContext } from \".\";\nimport {\n fillDataWithParentId,\n getNavigationItemById,\n getParentItemById,\n} from \"./NavigationSlider/utils\";\nimport { hasChildNavigationItems } from \"./utils/VerticalNavigation.utils\";\n\nexport interface HvVerticalNavigationProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvVerticalNavigationClasses;\n /**\n * Current State of the Vertical Navigation Collapse\n */\n open?: boolean;\n /**\n *
|
|
1
|
+
{"version":3,"file":"VerticalNavigation.cjs","sources":["../../../../src/components/VerticalNavigation/VerticalNavigation.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { StyledRoot } from \"./VerticalNavigation.styles\";\nimport verticalNavigationClasses, {\n HvVerticalNavigationClasses,\n} from \"./verticalNavigationClasses\";\nimport { NavigationData, VerticalNavigationContext } from \".\";\nimport {\n fillDataWithParentId,\n getNavigationItemById,\n getParentItemById,\n} from \"./NavigationSlider/utils\";\nimport { hasChildNavigationItems } from \"./utils/VerticalNavigation.utils\";\n\nexport interface HvVerticalNavigationProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvVerticalNavigationClasses;\n /**\n * Current State of the Vertical Navigation Collapse\n */\n open?: boolean;\n /**\n * Collpased Mode for the Vertical Navigation, the default value is \"simple\".\n *\n * @deprecated - `useIcons` property should be used instead.\n */\n collapsedMode?: HvVerticalNavigationMode;\n /**\n * Boolean to determine if treeview is in slider mode (for mobile navigation), the default value is false.\n */\n slider?: boolean;\n /**\n * The content inside the actions container.\n */\n children?: React.ReactNode;\n /**\n * Boolean to determine if icons should be displayed in the navigation menu.\n * When `true` a icon will always be displayed, if no icon is provided the first letter of the label will be\n * displayed inside an Avatar component.\n * When `false` no icons will be shown, even if an icon is provided.\n */\n useIcons?: boolean;\n}\n\n/**\n * Navigation enables users to move through an app to complete tasks.\n *\n * It is recommended to use vertical navigation when your application requires global navigation that is displayed on the left.\n * While vertical navigation menus generally consume more space than their horizontal counterparts, they have become more popular as desktop monitors move to wide-screen formats.\n *\n * Although both the hierarchically organized data and the visual style resemble a treeview-like structure, the [Treeview Design Pattern](https://w3c.github.io/aria-practices/#TreeView)\n * isn't necessarily the most appropriate.\n *\n * The tree role provides complex functionality that is not needed for typical site navigation, and changes the most common keyboard navigation using TAB.\n *\n * The [Disclosure Design Pattern](https://w3c.github.io/aria-practices/#disclosure) is more suited for typical site navigation, with expandable groups of links.\n * However it can be tedious to TAB through all navigation items to reach the actions panel.\n *\n * Both modes are available via the `mode` property and each app should choose the most appropriate.\n */\nexport const HvVerticalNavigation = ({\n id,\n className,\n classes,\n\n children,\n\n open = true,\n\n slider = false,\n\n useIcons = false,\n\n ...others\n}: HvVerticalNavigationProps) => {\n if (others.collapsedMode) {\n console.warn(\"`collaspedMode` is deprecated. Please use 'useIcons'.\");\n }\n const [parentData, setParentData] = useState<NavigationData[]>([]);\n\n const [parentSelected, setParentSelected] = useState();\n\n const [headerTitle, setHeaderTitle] = useState<string | undefined>();\n\n // navigationSlider\n const withParentData = useMemo(\n () => fillDataWithParentId(parentData),\n [parentData]\n );\n\n const initialParentItem = useMemo(\n () => getParentItemById(withParentData, parentSelected),\n [withParentData, parentSelected]\n );\n\n const [parentItem, setParentItem] = useState(initialParentItem);\n\n const hasAnyChildWithData = useMemo(\n () => hasChildNavigationItems(parentData),\n [parentData]\n );\n\n useEffect(\n () => setHeaderTitle(parentItem?.label),\n [parentItem, setParentItem]\n );\n\n const navigateToParentHandler = () => {\n setParentItem(getParentItemById(withParentData, parentItem.id));\n };\n\n const navigateToChildHandler = (event, item) => {\n setParentItem(getNavigationItemById(withParentData, item.id));\n event.stopPropagation();\n };\n\n const value = useMemo(\n () => ({\n isOpen: open,\n useIcons,\n slider,\n headerTitle,\n setHeaderTitle,\n\n parentItem,\n withParentData,\n navigateToChildHandler,\n navigateToParentHandler,\n\n parentData,\n setParentData,\n parentSelected,\n setParentSelected,\n hasAnyChildWithData,\n }),\n [\n open,\n useIcons,\n slider,\n headerTitle,\n setHeaderTitle,\n parentItem,\n withParentData,\n navigateToChildHandler,\n navigateToParentHandler,\n hasAnyChildWithData,\n ]\n );\n\n const content = (\n <VerticalNavigationContext.Provider value={value}>\n <StyledRoot\n id={id}\n className={clsx(\n className,\n verticalNavigationClasses.root,\n classes?.root,\n !open && verticalNavigationClasses.collapsed,\n slider && verticalNavigationClasses.slider,\n classes?.collapsed\n )}\n hasAnyChildWithData={hasAnyChildWithData}\n {...others}\n >\n {children}\n </StyledRoot>\n </VerticalNavigationContext.Provider>\n );\n\n return content;\n};\n\nexport type HvVerticalNavigationMode = \"icon\" | \"simple\";\n\nexport type HvVerticalNavigationPosition =\n | \"static\"\n | \"relative\"\n | \"fixed\"\n | \"absolute\";\n"],"names":["HvVerticalNavigation","id","className","classes","children","open","slider","useIcons","others","collapsedMode","console","warn","parentData","setParentData","useState","parentSelected","setParentSelected","headerTitle","setHeaderTitle","withParentData","useMemo","fillDataWithParentId","initialParentItem","getParentItemById","parentItem","setParentItem","hasAnyChildWithData","hasChildNavigationItems","useEffect","label","navigateToParentHandler","navigateToChildHandler","event","item","getNavigationItemById","stopPropagation","value","isOpen","content","VerticalNavigationContext","Provider","StyledRoot","clsx","verticalNavigationClasses","root","collapsed"],"mappings":";;;;;;;;;;AAsEO,MAAMA,uBAAuBA,CAAC;AAAA,EACnCC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EAEAC;AAAAA,EAEAC,OAAO;AAAA,EAEPC,SAAS;AAAA,EAETC,WAAW;AAAA,EAEX,GAAGC;AACsB,MAAM;AAC/B,MAAIA,OAAOC,eAAe;AACxBC,YAAQC,KAAK,uDAAuD;AAAA,EACtE;AACA,QAAM,CAACC,YAAYC,aAAa,IAAIC,MAAAA,SAA2B,CAAE,CAAA;AAEjE,QAAM,CAACC,gBAAgBC,iBAAiB,IAAIF,MAAU,SAAA;AAEtD,QAAM,CAACG,aAAaC,cA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AASyC,MACT,CAACvC,QAAQsC,kCAA0BE,WACnCvC,UAAUqC,0BAA0BrC,QAAAA,QACpCH,mCAAS0C,SAAS;AAAA,MAEpBnB;AAAAA,MAAyC,GACrClB;AAAAA,MAAMJ;AAAAA,IAAAA,CAED;AAAA,EAAA,CAGd;AAEMkC,SAAAA;AACT;;"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const VerticalNavigationContext = React.createContext({
|
|
5
5
|
isOpen: true,
|
|
6
|
-
|
|
6
|
+
useIcons: false,
|
|
7
7
|
slider: false
|
|
8
8
|
});
|
|
9
9
|
exports.VerticalNavigationContext = VerticalNavigationContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalNavigationContext.cjs","sources":["../../../../src/components/VerticalNavigation/VerticalNavigationContext.tsx"],"sourcesContent":["import { createContext } from \"react\";\nimport { NavigationData
|
|
1
|
+
{"version":3,"file":"VerticalNavigationContext.cjs","sources":["../../../../src/components/VerticalNavigation/VerticalNavigationContext.tsx"],"sourcesContent":["import { createContext } from \"react\";\nimport { NavigationData } from \".\";\n\ninterface VerticalNavigationContextValue {\n isOpen: boolean;\n useIcons: boolean;\n slider?: boolean;\n headerTitle?: string;\n setHeaderTitle?: React.Dispatch<React.SetStateAction<string | undefined>>;\n\n parentItem?;\n withParentData?;\n navigateToChildHandler?: (event, item) => void;\n navigateToParentHandler?: () => void;\n\n parentData?: NavigationData[];\n setParentData?: React.Dispatch<React.SetStateAction<any>>;\n parentSelected?;\n setParentSelected?: React.Dispatch<React.SetStateAction<any>>;\n\n hasAnyChildWithData?: boolean;\n}\n\nconst VerticalNavigationContext = createContext<VerticalNavigationContextValue>(\n {\n isOpen: true,\n useIcons: false,\n slider: false,\n }\n);\n\nexport { VerticalNavigationContext };\n"],"names":["VerticalNavigationContext","createContext","isOpen","useIcons","slider"],"mappings":";;;AAuBA,MAAMA,4BAA4BC,MAAAA,cAChC;AAAA,EACEC,QAAQ;AAAA,EACRC,UAAU;AAAA,EACVC,QAAQ;AACV,CAAC;;"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -271,6 +271,7 @@ const hexToRgbA = require("./utils/hexToRgbA.cjs");
|
|
|
271
271
|
const browser = require("./utils/browser.cjs");
|
|
272
272
|
const multiSelectionEventHandler = require("./utils/multiSelectionEventHandler.cjs");
|
|
273
273
|
const getComponentName = require("./utils/getComponentName.cjs");
|
|
274
|
+
const checkValidHexColorValue = require("./utils/checkValidHexColorValue.cjs");
|
|
274
275
|
const focusUtils = require("./utils/focusUtils.cjs");
|
|
275
276
|
const keyboardCodes = require("./utils/keyboardUtils/keyboardCodes.cjs");
|
|
276
277
|
const keyCheck = require("./utils/keyboardUtils/keyCheck.cjs");
|
|
@@ -543,7 +544,6 @@ exports.HvSwitchColumnCell = SwitchColumnCell.default;
|
|
|
543
544
|
exports.hvNodeFallback = fallbacks.hvNodeFallback;
|
|
544
545
|
exports.hvNumberFallback = fallbacks.hvNumberFallback;
|
|
545
546
|
exports.hvStringFallback = fallbacks.hvStringFallback;
|
|
546
|
-
exports.checkValidHexColorValue = utils.checkValidHexColorValue;
|
|
547
547
|
exports.getBorderStyles = utils.getBorderStyles;
|
|
548
548
|
exports.loginClasses = loginClasses.default;
|
|
549
549
|
exports.HvLogin = Login.HvLogin;
|
|
@@ -619,6 +619,7 @@ exports.hexToRgbA = hexToRgbA.default;
|
|
|
619
619
|
exports.isBrowser = browser.default;
|
|
620
620
|
exports.multiSelectionEventHandler = multiSelectionEventHandler.default;
|
|
621
621
|
exports.getComponentName = getComponentName.default;
|
|
622
|
+
exports.checkValidHexColorValue = checkValidHexColorValue.default;
|
|
622
623
|
exports.outlineStyles = focusUtils.outlineStyles;
|
|
623
624
|
exports.keyboardCodes = keyboardCodes.keyboardCodes;
|
|
624
625
|
exports.getKeyCodeFromEvent = keyCheck.getKeyCodeFromEvent;
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const checkValidHexColorValue = (value) => {
|
|
4
|
+
const reg = /^#([0-9a-f]{3}){1,2}$/i;
|
|
5
|
+
return value ? reg.test(value) : false;
|
|
6
|
+
};
|
|
7
|
+
const checkValidHexColorValue$1 = checkValidHexColorValue;
|
|
8
|
+
exports.default = checkValidHexColorValue$1;
|
|
9
|
+
//# sourceMappingURL=checkValidHexColorValue.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkValidHexColorValue.cjs","sources":["../../../src/utils/checkValidHexColorValue.ts"],"sourcesContent":["const checkValidHexColorValue = (value?: string): boolean => {\n const reg = /^#([0-9a-f]{3}){1,2}$/i;\n return value ? reg.test(value) : false;\n};\n\nexport default checkValidHexColorValue;\n"],"names":["checkValidHexColorValue","value","reg","test"],"mappings":";;AAAA,MAAMA,0BAA0BA,CAACC,UAA4B;AAC3D,QAAMC,MAAM;AACZ,SAAOD,QAAQC,IAAIC,KAAKF,KAAK,IAAI;AACnC;AAEA,MAAA,4BAAeD;;"}
|
|
@@ -48,6 +48,8 @@ const HvAppSwitcher = ({
|
|
|
48
48
|
$closed: isOpen === false,
|
|
49
49
|
$layout: layout,
|
|
50
50
|
children: [header && /* @__PURE__ */ jsx(StyledTitle, {
|
|
51
|
+
component: "div",
|
|
52
|
+
variant: "label",
|
|
51
53
|
className: clsx(appSwitcherClasses.title, classes == null ? void 0 : classes.title),
|
|
52
54
|
children: header
|
|
53
55
|
}) || title && /* @__PURE__ */ jsx(TitleWithTooltip, {
|
|
@@ -59,6 +61,8 @@ const HvAppSwitcher = ({
|
|
|
59
61
|
className: clsx(appSwitcherClasses.actionsContainer, classes == null ? void 0 : classes.actionsContainer),
|
|
60
62
|
children: panelActions
|
|
61
63
|
}), footer && /* @__PURE__ */ jsx(StyledFooter, {
|
|
64
|
+
component: "div",
|
|
65
|
+
variant: "label",
|
|
62
66
|
className: clsx(appSwitcherClasses.footerContainer, classes == null ? void 0 : classes.footerContainer),
|
|
63
67
|
children: footer
|
|
64
68
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSwitcher.js","sources":["../../../../src/components/AppSwitcher/AppSwitcher.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useMemo } from \"react\";\nimport { HvBaseProps } from \"@core/types\";\nimport { HvAppSwitcherAction } from \"./Action\";\nimport {\n StyledRoot,\n StyledTitle,\n StyledActionsContainer,\n StyledFooter,\n} from \"./AppSwitcher.styles\";\nimport TitleWithTooltip from \"./TitleWithTooltip\";\nimport appSwitcherClasses, { HvAppSwitcherClasses } from \"./appSwitcherClasses\";\n\nexport interface HvAppSwitcherActionApplication {\n /** Id of the application. */\n id?: string;\n /** Name of the application, this is the value that will be displayed on the component. */\n name: string;\n /** URL with the icon location to be used to represent the application. iconUrl will only be used if no iconElement is provided. */\n iconUrl?: string;\n /** Element to be added as the icon representing the application. The iconElement will be the primary option to be displayed. */\n iconElement?: React.ReactElement;\n /** Small description of the application. */\n description?: string;\n /** URL where the application is accessible. */\n url?: string;\n /** Defines if the application should be opened in the same tab or in a new one. */\n target?: \"_top\" | \"_blank\";\n /** If true, the item will be disabled. */\n disabled?: boolean;\n /** True when the application is selected, false otherwise. */\n isSelected?: boolean;\n /** The color of the application. */\n color?: string;\n}\n\nexport interface HvAppSwitcherProps extends HvBaseProps {\n /** Number of columns to render. One, two, or whatever fits the component's width. */\n layout?: \"single\" | \"dual\" | \"fluid\";\n /** Title to be displayed on the header of the component. */\n title?: string;\n /** The list of applications to be used to render the actions on the component. */\n applications?: HvAppSwitcherActionApplication[];\n /** Triggered when an action is clicked. */\n onActionClickedCallback?: (\n event: React.MouseEvent,\n application: HvAppSwitcherActionApplication\n ) => void;\n /** Must return a boolean stating if the action element is selected or not. */\n isActionSelectedCallback?: (\n application: HvAppSwitcherActionApplication\n ) => boolean;\n /** Element to be added to the header container, if none is provided a label with the title will be added. */\n header?: React.ReactNode;\n /** Element to be added to the footer container. */\n footer?: React.ReactNode;\n /**\n * Flag stating if the panel is opened or closed.\n *\n * @deprecated This logic should be external, i.e. using the HvAppSwitcher inside a Drawer component.\n */\n isOpen?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAppSwitcherClasses;\n}\n\nexport const HvAppSwitcher = ({\n id,\n className,\n classes,\n layout = \"single\",\n title,\n applications,\n onActionClickedCallback = () => {},\n isActionSelectedCallback = () => false,\n header,\n footer,\n isOpen,\n}: HvAppSwitcherProps) => {\n const actionClicked = (\n event: React.MouseEvent,\n application: HvAppSwitcherActionApplication\n ) => {\n onActionClickedCallback?.(event, application);\n };\n\n const panelActions = useMemo(\n () =>\n applications &&\n applications?.map((application) => {\n if (application.name) {\n return (\n <HvAppSwitcherAction\n key={application.id || `${application.name}_${application.url}`}\n application={application}\n onClickCallback={actionClicked}\n isSelectedCallback={isActionSelectedCallback}\n classes={{\n root: clsx(classes?.item, appSwitcherClasses.item),\n selected: clsx(\n classes?.itemSelected,\n appSwitcherClasses.itemSelected\n ),\n disabled: clsx(\n classes?.itemDisabled,\n appSwitcherClasses.itemDisabled\n ),\n typography: clsx(\n classes?.itemTrigger,\n appSwitcherClasses.itemTrigger\n ),\n icon: clsx(classes?.itemIcon, appSwitcherClasses.itemIcon),\n title: clsx(classes?.itemTitle, appSwitcherClasses.itemTitle),\n iconInfo: clsx(\n classes?.itemInfoIcon,\n appSwitcherClasses.itemInfoIcon\n ),\n }}\n />\n );\n }\n\n return undefined;\n }),\n [applications]\n );\n\n return (\n <StyledRoot\n id={id}\n className={clsx(\n className,\n appSwitcherClasses.root,\n classes?.root,\n appSwitcherClasses[layout],\n classes?.[layout],\n isOpen && clsx(appSwitcherClasses.open, classes?.open),\n isOpen === false && clsx(appSwitcherClasses.closed, classes?.closed)\n )}\n $open={!!isOpen}\n $closed={isOpen === false}\n $layout={layout}\n >\n {(header && (\n <StyledTitle
|
|
1
|
+
{"version":3,"file":"AppSwitcher.js","sources":["../../../../src/components/AppSwitcher/AppSwitcher.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useMemo } from \"react\";\nimport { HvBaseProps } from \"@core/types\";\nimport { HvAppSwitcherAction } from \"./Action\";\nimport {\n StyledRoot,\n StyledTitle,\n StyledActionsContainer,\n StyledFooter,\n} from \"./AppSwitcher.styles\";\nimport TitleWithTooltip from \"./TitleWithTooltip\";\nimport appSwitcherClasses, { HvAppSwitcherClasses } from \"./appSwitcherClasses\";\n\nexport interface HvAppSwitcherActionApplication {\n /** Id of the application. */\n id?: string;\n /** Name of the application, this is the value that will be displayed on the component. */\n name: string;\n /** URL with the icon location to be used to represent the application. iconUrl will only be used if no iconElement is provided. */\n iconUrl?: string;\n /** Element to be added as the icon representing the application. The iconElement will be the primary option to be displayed. */\n iconElement?: React.ReactElement;\n /** Small description of the application. */\n description?: string;\n /** URL where the application is accessible. */\n url?: string;\n /** Defines if the application should be opened in the same tab or in a new one. */\n target?: \"_top\" | \"_blank\";\n /** If true, the item will be disabled. */\n disabled?: boolean;\n /** True when the application is selected, false otherwise. */\n isSelected?: boolean;\n /** The color of the application. */\n color?: string;\n}\n\nexport interface HvAppSwitcherProps extends HvBaseProps {\n /** Number of columns to render. One, two, or whatever fits the component's width. */\n layout?: \"single\" | \"dual\" | \"fluid\";\n /** Title to be displayed on the header of the component. */\n title?: string;\n /** The list of applications to be used to render the actions on the component. */\n applications?: HvAppSwitcherActionApplication[];\n /** Triggered when an action is clicked. */\n onActionClickedCallback?: (\n event: React.MouseEvent,\n application: HvAppSwitcherActionApplication\n ) => void;\n /** Must return a boolean stating if the action element is selected or not. */\n isActionSelectedCallback?: (\n application: HvAppSwitcherActionApplication\n ) => boolean;\n /** Element to be added to the header container, if none is provided a label with the title will be added. */\n header?: React.ReactNode;\n /** Element to be added to the footer container. */\n footer?: React.ReactNode;\n /**\n * Flag stating if the panel is opened or closed.\n *\n * @deprecated This logic should be external, i.e. using the HvAppSwitcher inside a Drawer component.\n */\n isOpen?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAppSwitcherClasses;\n}\n\nexport const HvAppSwitcher = ({\n id,\n className,\n classes,\n layout = \"single\",\n title,\n applications,\n onActionClickedCallback = () => {},\n isActionSelectedCallback = () => false,\n header,\n footer,\n isOpen,\n}: HvAppSwitcherProps) => {\n const actionClicked = (\n event: React.MouseEvent,\n application: HvAppSwitcherActionApplication\n ) => {\n onActionClickedCallback?.(event, application);\n };\n\n const panelActions = useMemo(\n () =>\n applications &&\n applications?.map((application) => {\n if (application.name) {\n return (\n <HvAppSwitcherAction\n key={application.id || `${application.name}_${application.url}`}\n application={application}\n onClickCallback={actionClicked}\n isSelectedCallback={isActionSelectedCallback}\n classes={{\n root: clsx(classes?.item, appSwitcherClasses.item),\n selected: clsx(\n classes?.itemSelected,\n appSwitcherClasses.itemSelected\n ),\n disabled: clsx(\n classes?.itemDisabled,\n appSwitcherClasses.itemDisabled\n ),\n typography: clsx(\n classes?.itemTrigger,\n appSwitcherClasses.itemTrigger\n ),\n icon: clsx(classes?.itemIcon, appSwitcherClasses.itemIcon),\n title: clsx(classes?.itemTitle, appSwitcherClasses.itemTitle),\n iconInfo: clsx(\n classes?.itemInfoIcon,\n appSwitcherClasses.itemInfoIcon\n ),\n }}\n />\n );\n }\n\n return undefined;\n }),\n [applications]\n );\n\n return (\n <StyledRoot\n id={id}\n className={clsx(\n className,\n appSwitcherClasses.root,\n classes?.root,\n appSwitcherClasses[layout],\n classes?.[layout],\n isOpen && clsx(appSwitcherClasses.open, classes?.open),\n isOpen === false && clsx(appSwitcherClasses.closed, classes?.closed)\n )}\n $open={!!isOpen}\n $closed={isOpen === false}\n $layout={layout}\n >\n {(header && (\n <StyledTitle\n component=\"div\"\n variant=\"label\"\n className={clsx(appSwitcherClasses.title, classes?.title)}\n >\n {header}\n </StyledTitle>\n )) ||\n (title && (\n <TitleWithTooltip\n className={clsx(appSwitcherClasses.title, classes?.title)}\n title={title}\n type=\"appSwitcher\"\n />\n ))}\n <StyledActionsContainer\n disableGutters\n className={clsx(\n appSwitcherClasses.actionsContainer,\n classes?.actionsContainer\n )}\n >\n {panelActions}\n </StyledActionsContainer>\n {footer && (\n <StyledFooter\n component=\"div\"\n variant=\"label\"\n className={clsx(\n appSwitcherClasses.footerContainer,\n classes?.footerContainer\n )}\n >\n {footer}\n </StyledFooter>\n )}\n </StyledRoot>\n );\n};\n"],"names":["HvAppSwitcher","id","className","classes","layout","title","applications","onActionClickedCallback","isActionSelectedCallback","header","footer","isOpen","actionClicked","event","application","panelActions","useMemo","map","name","HvAppSwitcherAction","onClickCallback","isSelectedCallback","root","clsx","item","appSwitcherClasses","selected","itemSelected","disabled","itemDisabled","typography","itemTrigger","icon","itemIcon","itemTitle","iconInfo","itemInfoIcon","url","undefined","StyledRoot","open","closed","$open","$closed","$layout","children","_jsx","StyledTitle","component","variant","TitleWithTooltip","type","StyledActionsContainer","disableGutters","actionsContainer","StyledFooter","footerContainer"],"mappings":";;;;;;;AAkEO,MAAMA,gBAAgBA,CAAC;AAAA,EAC5BC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,SAAS;AAAA,EACTC;AAAAA,EACAC;AAAAA,EACAC,0BAA0BA,MAAM;AAAA,EAAC;AAAA,EACjCC,2BAA2BA,MAAM;AAAA,EACjCC;AAAAA,EACAC;AAAAA,EACAC;AACkB,MAAM;AAClBC,QAAAA,gBAAgBA,CACpBC,OACAC,gBACG;AACHP,uEAA0BM,OAAOC;AAAAA,EAAW;AAG9C,QAAMC,eAAeC,QACnB,MACEV,iBACAA,6CAAcW,IAAKH,CAAgB,gBAAA;AACjC,QAAIA,YAAYI,MAAM;AACpB,iCACGC,qBAAmB;AAAA,QAElBL;AAAAA,QACAM,iBAAiBR;AAAAA,QACjBS,oBAAoBb;AAAAA,QACpBL,SAAS;AAAA,UACPmB,MAAMC,KAAKpB,mCAASqB,MAAMC,mBAAmBD,IAAI;AAAA,UACjDE,UAAUH,KACRpB,mCAASwB,cACTF,mBAAmBE,YAAY;AAAA,UAEjCC,UAAUL,KACRpB,mCAAS0B,cACTJ,mBAAmBI,YAAY;AAAA,UAEjCC,YAAYP,KACVpB,mCAAS4B,aACTN,mBAAmBM,WAAW;AAAA,UAEhCC,MAAMT,KAAKpB,mCAAS8B,UAAUR,mBAAmBQ,QAAQ;AAAA,UACzD5B,OAAOkB,K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