@semcore/dropdown-menu 16.1.14-prerelease.1 → 16.2.0-prerelease.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/CHANGELOG.md +10 -0
- package/lib/cjs/DropdownMenu.js +107 -67
- package/lib/cjs/DropdownMenu.js.map +1 -1
- package/lib/cjs/components/Context.js +16 -0
- package/lib/cjs/components/Context.js.map +1 -0
- package/lib/cjs/components/VirtualList.js +141 -0
- package/lib/cjs/components/VirtualList.js.map +1 -0
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/es6/DropdownMenu.js +102 -62
- package/lib/es6/DropdownMenu.js.map +1 -1
- package/lib/es6/components/Context.js +9 -0
- package/lib/es6/components/Context.js.map +1 -0
- package/lib/es6/components/VirtualList.js +136 -0
- package/lib/es6/components/VirtualList.js.map +1 -0
- package/lib/es6/index.d.js.map +1 -1
- package/lib/esm/DropdownMenu.mjs +82 -50
- package/lib/esm/components/Context.mjs +11 -0
- package/lib/esm/components/VirtualList.mjs +132 -0
- package/lib/types/components/Context.d.ts +2 -0
- package/lib/types/components/VirtualList.d.ts +25 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +42 -0
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":["ButtonComponent","createComponent","sstyled","Root","lastInteraction","callAllEventHandlers","isAdvanceMode","isFocusInside","setFocus","forkRef","useUID","Dropdown","AbstractDropdown","selectedIndexContext","enhance","Flex","Box","ScrollAreaComponent","hideScrollBarsFromScreenReadersContext","Text","React","style","_sstyled","insert","localizedMessages","ListBoxContextProvider","_ref22","children","createElement","Provider","value","menuItemContext","createContext","DropdownMenuRoot","_AbstractDropdown","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","createRef","_inherits","_createClass","key","uncontrolledProps","_this2","_objectSpread","_superPropGet","visible","setTimeout","focusAndScrollToSelected","get","menuElement","menuRef","current","selected","options","querySelectorAll","querySelector","_this3","_this$menuElements","menuElements","isFocusAlreadyInPopper","popperRef","asProps","itemsCount","undefined","scrollToNodeAsync","then","focus","preventScroll","selectedIndex","from","indexOf","handlers","highlightedIndex","afterOpenPopper","_this$menuElements2","itemRef","props","index","node","document","activeElement","getTriggerProps","_this$asProps","Children","uid","hasMenu","DropdownMenu","Menu","displayName","ariaControls","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","getListProps","onKeyDown","handleArrowKeyDown","getPopperProps","handlePreventPopperKeyDown","getActionsProps","ref","actionsRef","handlePreventTabOnActions","getItemProps","_props$index","_this4","_this$asProps2","realIndex","isHighlighted","itemProps","tabIndex","tag","_props$use","_props$theme","_props$size","use","theme","size","innerOutline","onClick","place","_this5","e","_this5$menuRef$curren","_e$target$getAttribut","_this5$asProps","placement","inlineActions","contains","target","stopPropagation","show","startsWith","hide","isMenuItem","getAttribute","_this5$itemRefs$highl","itemRefs","preventDefault","triggerRef","render","_ref","_this$asProps3","interaction","timeout","_assignProps","Object","values","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","locale","trigger","popper","List","_ref23","_ref2","arguments[0]","_ref13","styles","SDropdownMenuList","SBar","Bar","cn","_assignProps2","Container","Actions","_ref24","_ref3","_ref14","SDropdownMenuActions","_assignProps3","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends","role","_assignProps4","Item","_ref25","_ref5","_ref15","id","disabled","forwardRef","ariaChecked","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray","highlighted","setHighlighted","menuItemContextValue","contentId","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","_assignProps5","isKeyboard","Addon","_ref6","_ref16","SDropdownMenuItemAddon","_assignProps6","Trigger","_ref7","_assignProps7","ItemContent","_ref26","_ref8","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_assignProps8","_toConsumableArray","join","ItemContentText","_ref27","_ref9","_ref18","SItemContentText","_assignProps9","ItemHint","_ref28","_ref0","_ref19","SItemHint","_React$useContext","_assignProps0","_ref1","_ref20","_assignProps1","Title","_ref10","_ref21","_assignProps10","Nesting","_ref29","_ref11","_assignProps11","NestingTrigger","_ref30","_ref12","_assignProps12","ItemTitle","Group"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import ButtonComponent from '@semcore/button';\nimport { createComponent, sstyled, Root, lastInteraction } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport { isAdvanceMode } from '@semcore/core/lib/utils/findComponent';\nimport { isFocusInside } from '@semcore/core/lib/utils/focus-lock/isFocusInside';\nimport { setFocus } from '@semcore/core/lib/utils/focus-lock/setFocus';\nimport { forkRef } from '@semcore/core/lib/utils/ref';\nimport { useUID } from '@semcore/core/lib/utils/uniqueID';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, Box } from '@semcore/flex-box';\nimport ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport { Text } from '@semcore/typography';\nimport React from 'react';\n\nimport style from './style/dropdown-menu.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\nconst ListBoxContextProvider = ({ children }) => (\n <hideScrollBarsFromScreenReadersContext.Provider value={true}>\n {children}\n </hideScrollBarsFromScreenReadersContext.Provider>\n);\n\nconst menuItemContext = React.createContext({});\n\nclass DropdownMenuRoot extends AbstractDropdown {\n static displayName = 'DropdownMenu';\n static style = style;\n static enhance = Object.values(enhance);\n\n static defaultProps = {\n size: 'm',\n defaultVisible: false,\n defaultHighlightedIndex: 0,\n defaultSelectedIndex: 0,\n i18n: localizedMessages,\n locale: 'en',\n interaction: 'click',\n inlineActions: false,\n placement: 'bottom-start',\n timeout: 0,\n };\n\n static nestedMenuInteraction = {\n trigger: [\n ['onClick', 'onMouseEnter'],\n ['onClick', 'onMouseLeave'],\n ],\n popper: [['onMouseEnter'], ['onMouseLeave']],\n };\n\n actionsRef = React.createRef();\n role = 'menu';\n\n uncontrolledProps() {\n return {\n ...super.uncontrolledProps(),\n visible: [\n null,\n (visible) => {\n if (visible === true) {\n setTimeout(() => {\n this.focusAndScrollToSelected();\n // for some reason, Google Chrome optimizes this timeout with 0 value with previous render (when we set aria-selected)\n // and that's why its skip scrollToNodes. We selected the appropriate timeout manually.\n }, 30);\n }\n },\n ],\n };\n }\n\n get menuElements() {\n const menuElement = this.menuRef.current;\n\n if (!menuElement) {\n return { selected: null, options: null };\n }\n\n const options = menuElement.querySelectorAll(\n '[role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]',\n );\n const selected = menuElement.querySelector('[aria-checked=\"true\"]');\n\n return { selected, options };\n }\n\n focusAndScrollToSelected() {\n const { selected, options } = this.menuElements;\n\n const isFocusAlreadyInPopper = isFocusInside(this.popperRef.current);\n\n if (!selected || !options || this.asProps.itemsCount !== undefined || isFocusAlreadyInPopper) return;\n\n this.scrollToNodeAsync(selected, true).then(() => {\n if (this.asProps.visible) {\n selected.focus({ preventScroll: true });\n }\n });\n\n const selectedIndex = Array.from(options).indexOf(selected);\n\n if (selectedIndex !== -1) {\n this.handlers.highlightedIndex(selectedIndex);\n }\n }\n\n afterOpenPopper() {\n const { selected, options } = this.menuElements;\n\n // this case is handled slightly differently on line 63.\n if (selected && options && this.asProps.itemsCount === undefined) return;\n\n super.afterOpenPopper();\n }\n\n itemRef(props, index, node) {\n super.itemRef(props, index, node);\n\n if (node === document.activeElement) {\n super.scrollToNode(node);\n }\n }\n\n getTriggerProps() {\n const { Children, uid, visible } = this.asProps;\n const hasMenu = isAdvanceMode(Children, [DropdownMenu.Menu.displayName]);\n const ariaControls = hasMenu ? `igc-${uid}-list` : `igc-${uid}-popper`;\n\n return {\n ...super.getTriggerProps(),\n 'onKeyDown': callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleOpenKeyDown.bind(this),\n this.handleKeyDownForMenu('trigger'),\n ),\n 'aria-controls': visible ? ariaControls : undefined,\n 'aria-haspopup': hasMenu ? 'true' : 'dialog',\n };\n }\n\n getListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getPopperProps() {\n return {\n ...super.getPopperProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handlePreventPopperKeyDown.bind(this),\n ),\n };\n }\n\n getActionsProps() {\n return {\n ...this.getListProps(),\n ref: this.actionsRef,\n onKeyDown: callAllEventHandlers(\n this.handlePreventTabOnActions.bind(this),\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getItemProps(props, index) {\n const { highlightedIndex, visible } = this.asProps;\n const realIndex = props.index ?? index;\n const isHighlighted = realIndex === highlightedIndex;\n const itemProps = {\n ...super.getItemProps(props, realIndex),\n tabIndex: isHighlighted && visible ? 0 : -1,\n ref: (node) => this.itemRef(props, realIndex, node),\n actionsRef: this.actionsRef,\n };\n\n if (props.tag === ButtonComponent) {\n itemProps.use = props.use ?? 'tertiary';\n itemProps.theme = props.theme ?? 'muted';\n itemProps.size = props.size ?? 's';\n itemProps.innerOutline = false;\n }\n\n if (props.selected) {\n itemProps['aria-checked'] = true;\n }\n\n if (super.childRole === 'menuitemradio') {\n itemProps.onClick = () => {\n this.handlers.visible(false);\n };\n }\n\n return itemProps;\n }\n\n handleKeyDownForMenu(place) {\n return (e) => {\n const { visible, placement, inlineActions } = this.asProps;\n\n // stop propagation keyboard events if it calls not on DropdownMenu.Items\n if (place === 'list' && !this.menuRef.current?.contains(e.target) && !inlineActions) {\n e.stopPropagation();\n return false;\n }\n\n const show =\n (e.key === 'ArrowRight' && placement?.startsWith('right')) ||\n (e.key === 'ArrowLeft' && placement?.startsWith('left')) ||\n ((e.key === 'Enter' || e.key === ' ') && !inlineActions);\n const hide =\n (e.key === 'ArrowLeft' && placement?.startsWith('right')) ||\n (e.key === 'ArrowRight' && placement?.startsWith('left')) ||\n e.key === 'Escape';\n const isMenuItem = e.target.getAttribute('role')?.startsWith(super.childRole);\n\n if (place === 'trigger' && show && isMenuItem) {\n this.handlers.visible(true);\n this.handlers.highlightedIndex(0);\n setTimeout(() => {\n const { highlightedIndex } = this.asProps;\n this.itemRefs[highlightedIndex]?.focus();\n }, 0);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n if (place === 'list' && visible && hide && isMenuItem) {\n if (\n !inlineActions ||\n (inlineActions && (e.key === 'Escape' || this.asProps.highlightedIndex === 0))\n ) {\n this.handlers.visible(false);\n if (this.triggerRef.current) {\n setFocus(this.triggerRef.current);\n }\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n };\n }\n\n handlePreventTabOnActions(e) {\n if (e.key === 'Tab') {\n e.stopPropagation();\n e.preventDefault();\n return false;\n }\n }\n\n render() {\n const { Children, selectedIndex, interaction, timeout } = this.asProps;\n\n this.itemProps = [];\n\n return (\n <selectedIndexContext.Provider value={selectedIndex}>\n <Root\n render={Dropdown}\n timeout={timeout || (interaction === 'hover' ? [0, 100] : undefined)}\n >\n <Children />\n </Root>\n </selectedIndexContext.Provider>\n );\n }\n}\n\nfunction List({ styles, Children }) {\n const SDropdownMenuList = Root;\n const SBar = ScrollAreaComponent.Bar;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true} shadowSize={16} shadowTheme='light'>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <SBar orientation='horizontal' />\n <SBar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n}\nfunction Actions({ styles }) {\n const SDropdownMenuActions = Root;\n\n return sstyled(styles)(<SDropdownMenuActions render={Flex} />);\n}\n\nfunction Menu(props) {\n const {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n } = props;\n const popperProps = {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n };\n return (\n <ListBoxContextProvider>\n <DropdownMenu.Popper {...popperProps} role={null}>\n <Root render={DropdownMenu.List} />\n </DropdownMenu.Popper>\n </ListBoxContextProvider>\n );\n}\n\nfunction Item({\n id,\n styles,\n disabled,\n Children,\n forwardRef,\n role,\n tabIndex,\n actionsRef,\n 'aria-checked': ariaChecked,\n}) {\n const SDropdownMenuItemContainer = Root;\n const itemRef = React.useRef();\n\n const [highlighted, setHighlighted] = React.useState(false);\n\n const menuItemContextValue = {\n contentId: id,\n ref: forkRef(forwardRef, itemRef),\n role,\n tabIndex,\n ariaChecked,\n };\n const ariaDescribes = [];\n\n const hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);\n const hasHint = isAdvanceMode(Children, [DropdownMenu.Item.Hint.displayName], true);\n const advancedMode =\n isAdvanceMode(Children, [DropdownMenu.Item.Content.displayName], true) || hasSubMenu || hasHint;\n\n if (hasHint) {\n const hintId = `igc-${useUID()}-option-hint`;\n\n menuItemContextValue.hintId = hintId;\n ariaDescribes.push(hintId);\n }\n\n if (hasSubMenu) {\n menuItemContextValue.hasSubMenu = true;\n }\n\n menuItemContextValue.ariaDescribes = ariaDescribes;\n\n React.useEffect(() => {\n const onFocus = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(true);\n\n if (hasSubMenu) {\n e.stopPropagation();\n }\n }\n };\n const onBlur = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(false);\n\n if (actionsRef.current) {\n itemRef.current.tabIndex = -1;\n }\n }\n };\n\n document.addEventListener('focus', onFocus, { capture: true });\n document.addEventListener('blur', onBlur, { capture: true });\n\n return () => {\n document.removeEventListener('focus', onFocus, { capture: true });\n document.removeEventListener('blur', onBlur, { capture: true });\n };\n }, [itemRef.current]);\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : menuItemContextValue.ref}\n use:highlighted={!disabled && highlighted && lastInteraction.isKeyboard()}\n use:role={advancedMode ? undefined : role}\n use:id={advancedMode ? undefined : id}\n use:tabIndex={advancedMode ? undefined : tabIndex}\n use:aria-checked={advancedMode ? undefined : ariaChecked}\n >\n <Children />\n </SDropdownMenuItemContainer>\n </menuItemContext.Provider>,\n );\n}\n\nfunction Addon(props) {\n const SDropdownMenuItemAddon = Root;\n return sstyled(props.styles)(<SDropdownMenuItemAddon render={Box} />);\n}\n\nfunction Trigger() {\n return <Root render={Dropdown.Trigger} />;\n}\n\nfunction ItemContent({ styles }) {\n const SItemContent = Root;\n const ref = React.useRef();\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n let subMenu = undefined;\n\n if (menuItemCtxValue.hasSubMenu) {\n subMenu = 'true';\n }\n\n const [describedby, setDescribedby] = React.useState(new Set(menuItemCtxValue.ariaDescribes));\n\n React.useEffect(() => {\n const element = ref.current;\n const parent = element?.parentElement;\n\n if (\n parent.getAttribute('aria-haspopup') === 'true' &&\n parent.getAttribute('aria-describedby')\n ) {\n setDescribedby((prev) => {\n prev.add(parent.getAttribute('aria-describedby'));\n\n return new Set(prev);\n });\n }\n }, [menuItemCtxValue.ariaDescribes]);\n\n return sstyled(styles)(\n <SItemContent\n render={Flex}\n role={menuItemCtxValue.role}\n id={menuItemCtxValue.contentId}\n tabIndex={menuItemCtxValue.tabIndex}\n ref={forkRef(menuItemCtxValue.ref, ref)}\n use:aria-describedby={[...describedby].join(' ')}\n aria-haspopup={menuItemCtxValue.hasSubMenu ? 'true' : undefined}\n aria-expanded={subMenu}\n aria-checked={menuItemCtxValue.ariaChecked}\n alignItems='center'\n justifyContent={menuItemCtxValue.hasSubMenu ? 'space-between' : undefined}\n />,\n );\n}\n\nfunction ItemContentText({ styles }) {\n const SItemContentText = Root;\n return sstyled(styles)(<SItemContentText render={Text} />);\n}\n\nfunction ItemHint({ styles }) {\n const SItemHint = Root;\n const { hintId } = React.useContext(menuItemContext);\n\n return sstyled(styles)(<SItemHint render={Flex} id={hintId} aria-hidden='true' />);\n}\n\n/**\n * @deprecated Use Item hint\n */\nfunction Hint(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='hint' />,\n );\n}\n/**\n * @deprecated Use Group with title prop\n */\nfunction Title(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='title' />,\n );\n}\n\n/**\n * @deprecated\n */\nfunction Nesting({ forwardRef }) {\n return <Root render={DropdownMenu.Item} ref={forwardRef} />;\n}\n\n/**\n * @deprecated\n */\nfunction NestingTrigger({ forwardRef }) {\n return (\n <Root\n render={DropdownMenu.Item.Content}\n tag={DropdownMenu.Trigger}\n ref={forwardRef}\n use:role='menuitem'\n />\n );\n}\n\nconst DropdownMenu = createComponent(\n DropdownMenuRoot,\n {\n Trigger,\n Popper: Dropdown.Popper,\n List,\n Actions,\n Menu,\n Item: [Item, { Addon, Content: ItemContent, Text: ItemContentText, Hint: ItemHint }],\n /**\n * @deprecated. Use just Item. See examples on\n */\n Nesting: [Nesting, { Trigger: NestingTrigger, Addon }],\n ItemTitle: Title,\n ItemHint: Hint,\n Group: Dropdown.Group,\n },\n {\n parent: [Dropdown],\n },\n);\n\nDropdownMenu.selectedIndexContext = selectedIndexContext;\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,eAAe,MAAM,iBAAiB;AAC7C,SAASC,eAAe,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,KAAK,EAAElR,QAAQ,CAACkR;AAClB,CAAC,EACD;EACEpC,MAAM,EAAE,CAAC9O,QAAQ;AACnB,CACF,CAAC;AAEDoF,YAAY,CAAClF,oBAAoB,GAAGA,oBAAoB;AAExD,eAAekF,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","names":["ButtonComponent","createComponent","sstyled","Root","lastInteraction","callAllEventHandlers","isAdvanceMode","isFocusInside","setFocus","forkRef","useUID","Dropdown","AbstractDropdown","selectedIndexContext","enhance","Flex","Box","ScrollAreaComponent","Text","React","ListBoxContextProvider","VirtualList","style","_sstyled","insert","localizedMessages","menuItemContext","createContext","DropdownMenuRoot","_AbstractDropdown","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","createRef","_inherits","_createClass","key","value","uncontrolledProps","_this2","_objectSpread","_superPropGet","visible","setTimeout","focusAndScrollToSelected","get","menuElement","menuRef","current","selected","options","querySelectorAll","querySelector","_this$menuRef$current","_this3","_this$menuElements","menuElements","isFocusAlreadyInPopper","popperRef","dataset","isVirtual","scrollToNodeAsync","then","asProps","focus","preventScroll","selectedIndex","from","indexOf","handlers","highlightedIndex","afterOpenPopper","_this$menuRef$current2","_this$menuElements2","itemRef","props","index","node","document","activeElement","getTriggerProps","_this$asProps","Children","uid","hasMenu","DropdownMenu","Menu","displayName","ariaControls","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","undefined","getListProps","onKeyDown","handleArrowKeyDown","getVirtualListProps","getPopperProps","handlePreventPopperKeyDown","getActionsProps","ref","actionsRef","handlePreventTabOnActions","getItemTabIndex","itemIndex","disabled","_this$asProps2","isHighlighted","shouldRecalculateItemTabIndex","getItemProps","_props$index","_this4","realIndex","itemProps","tabIndex","tag","_props$use","_props$theme","_props$size","use","theme","size","innerOutline","onClick","place","_this5","e","_this5$menuRef$curren","_e$target$getAttribut","_this5$asProps","placement","inlineActions","contains","target","stopPropagation","show","startsWith","hide","isMenuItem","getAttribute","_this5$itemRefs$highl","highlightedIndexProps","findIndex","p","itemRefs","preventDefault","triggerRef","render","_ref","_this$asProps3","interaction","timeout","createElement","Provider","_assignProps","Object","values","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","locale","trigger","popper","List","_ref22","_ref2","arguments[0]","_ref13","styles","SDropdownMenuList","SBar","Bar","cn","_assignProps2","Container","Actions","_ref23","_ref3","_ref14","SDropdownMenuActions","_assignProps3","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends","role","_assignProps4","Item","_ref24","_ref5","_ref15","id","forwardRef","ariaChecked","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray","highlighted","setHighlighted","menuItemContextValue","contentId","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","_assignProps5","isKeyboard","Addon","_ref6","_ref16","SDropdownMenuItemAddon","_assignProps6","Trigger","_ref7","_assignProps7","ItemContent","_ref25","_ref8","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_assignProps8","_toConsumableArray","join","ItemContentText","_ref26","_ref9","_ref18","SItemContentText","_assignProps9","ItemHint","_ref27","_ref0","_ref19","SItemHint","_React$useContext","_assignProps0","_ref1","_ref20","_assignProps1","Title","_ref10","_ref21","_assignProps10","Nesting","_ref28","_ref11","_assignProps11","NestingTrigger","_ref29","_ref12","_assignProps12","ItemTitle","Group"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import ButtonComponent from '@semcore/button';\nimport { createComponent, sstyled, Root, lastInteraction } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport { isAdvanceMode } from '@semcore/core/lib/utils/findComponent';\nimport { isFocusInside } from '@semcore/core/lib/utils/focus-lock/isFocusInside';\nimport { setFocus } from '@semcore/core/lib/utils/focus-lock/setFocus';\nimport { forkRef } from '@semcore/core/lib/utils/ref';\nimport { useUID } from '@semcore/core/lib/utils/uniqueID';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, Box } from '@semcore/flex-box';\nimport ScrollAreaComponent from '@semcore/scroll-area';\nimport { Text } from '@semcore/typography';\nimport React from 'react';\n\nimport { ListBoxContextProvider } from './components/Context';\nimport { VirtualList } from './components/VirtualList';\nimport style from './style/dropdown-menu.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\nconst menuItemContext = React.createContext({});\n\nclass DropdownMenuRoot extends AbstractDropdown {\n static displayName = 'DropdownMenu';\n static style = style;\n static enhance = Object.values(enhance);\n\n static defaultProps = {\n size: 'm',\n defaultVisible: false,\n defaultHighlightedIndex: 0,\n defaultSelectedIndex: 0,\n i18n: localizedMessages,\n locale: 'en',\n interaction: 'click',\n inlineActions: false,\n placement: 'bottom-start',\n timeout: 0,\n };\n\n static nestedMenuInteraction = {\n trigger: [\n ['onClick', 'onMouseEnter'],\n ['onClick', 'onMouseLeave'],\n ],\n popper: [['onMouseEnter'], ['onMouseLeave']],\n };\n\n actionsRef = React.createRef();\n role = 'menu';\n\n /**\n * TODO: It needs to be reconsidered in a future implementation so that component accepts items as a prop instead of JSX.\n * Tab index recalculation flag.\n *\n * When an item becomes disabled while highlighted, we need to transfer focus\n * to the next available focusable item. This flag ensures the focus lock\n * remains within proper boundaries during the initial render cycle.\n */\n shouldRecalculateItemTabIndex = false;\n\n uncontrolledProps() {\n return {\n ...super.uncontrolledProps(),\n visible: [\n null,\n (visible) => {\n if (visible === true) {\n setTimeout(() => {\n this.focusAndScrollToSelected();\n // for some reason, Google Chrome optimizes this timeout with 0 value with previous render (when we set aria-selected)\n // and that's why its skip scrollToNodes. We selected the appropriate timeout manually.\n }, 50);\n }\n },\n ],\n };\n }\n\n get menuElements() {\n const menuElement = this.menuRef.current;\n\n if (!menuElement) {\n return { selected: null, options: null };\n }\n\n const options = menuElement.querySelectorAll(\n '[role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]',\n );\n const selected = menuElement.querySelector('[aria-checked=\"true\"]:not([disabled])');\n\n return { selected, options };\n }\n\n focusAndScrollToSelected() {\n let { selected, options } = this.menuElements;\n\n const isFocusAlreadyInPopper = isFocusInside(this.popperRef.current);\n\n if (!selected || !options || this.menuRef.current?.dataset.isVirtual || isFocusAlreadyInPopper) return;\n\n this.scrollToNodeAsync(selected, true).then(() => {\n if (this.asProps.visible) {\n selected.focus({ preventScroll: true });\n }\n });\n\n const selectedIndex = Array.from(options).indexOf(selected);\n\n if (selectedIndex !== -1) {\n this.handlers.highlightedIndex(selectedIndex);\n }\n }\n\n afterOpenPopper() {\n const { selected, options } = this.menuElements;\n\n if (selected && options && !this.menuRef.current?.dataset.isVirtual) return;\n\n super.afterOpenPopper();\n }\n\n itemRef(props, index, node) {\n super.itemRef(props, index, node);\n\n if (node === document.activeElement) {\n super.scrollToNode(node);\n }\n }\n\n getTriggerProps() {\n const { Children, uid, visible } = this.asProps;\n const hasMenu = isAdvanceMode(Children, [DropdownMenu.Menu.displayName]);\n const ariaControls = hasMenu ? `igc-${uid}-list` : `igc-${uid}-popper`;\n\n return {\n ...super.getTriggerProps(),\n 'onKeyDown': callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleOpenKeyDown.bind(this),\n this.handleKeyDownForMenu('trigger'),\n ),\n 'aria-controls': visible ? ariaControls : undefined,\n 'aria-haspopup': hasMenu ? 'true' : 'dialog',\n };\n }\n\n getListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getVirtualListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getPopperProps() {\n return {\n ...super.getPopperProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handlePreventPopperKeyDown.bind(this),\n ),\n };\n }\n\n getActionsProps() {\n return {\n ...this.getListProps(),\n ref: this.actionsRef,\n onKeyDown: callAllEventHandlers(\n this.handlePreventTabOnActions.bind(this),\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getItemTabIndex(props, itemIndex) {\n const { disabled, index } = props;\n const { highlightedIndex, visible } = this.asProps;\n\n if (!visible) return -1;\n\n const isHighlighted = (index ?? itemIndex) === highlightedIndex;\n if (isHighlighted && !disabled) {\n return 0;\n }\n\n if (disabled && isHighlighted) {\n this.shouldRecalculateItemTabIndex = true;\n }\n\n if (!isHighlighted && !disabled && this.shouldRecalculateItemTabIndex) {\n this.shouldRecalculateItemTabIndex = false;\n return 0;\n }\n\n return -1;\n }\n\n getItemProps(props, index) {\n const realIndex = props.index ?? index;\n const itemProps = {\n ...super.getItemProps(props, realIndex),\n tabIndex: this.getItemTabIndex(props, index),\n ref: (node) => this.itemRef(props, realIndex, node),\n actionsRef: this.actionsRef,\n };\n\n if (props.tag === ButtonComponent) {\n itemProps.use = props.use ?? 'tertiary';\n itemProps.theme = props.theme ?? 'muted';\n itemProps.size = props.size ?? 's';\n itemProps.innerOutline = false;\n }\n\n if (props.selected) {\n itemProps['aria-checked'] = true;\n }\n\n if (super.childRole === 'menuitemradio') {\n itemProps.onClick = () => {\n this.handlers.visible(false);\n };\n }\n\n return itemProps;\n }\n\n handleKeyDownForMenu(place) {\n return (e) => {\n const { visible, placement, inlineActions } = this.asProps;\n\n // stop propagation keyboard events if it calls not on DropdownMenu.Items\n if (place === 'list' && !this.menuRef.current?.contains(e.target) && !inlineActions) {\n e.stopPropagation();\n return false;\n }\n\n const show =\n (e.key === 'ArrowRight' && placement?.startsWith('right')) ||\n (e.key === 'ArrowLeft' && placement?.startsWith('left')) ||\n ((e.key === 'Enter' || e.key === ' ') && !inlineActions);\n const hide =\n (e.key === 'ArrowLeft' && placement?.startsWith('right')) ||\n (e.key === 'ArrowRight' && placement?.startsWith('left')) ||\n e.key === 'Escape';\n const isMenuItem = e.target.getAttribute('role')?.startsWith(super.childRole);\n\n if (place === 'trigger' && show && isMenuItem) {\n this.handlers.visible(true);\n this.handlers.highlightedIndex(0);\n setTimeout(() => {\n let { highlightedIndex } = this.asProps;\n const highlightedIndexProps = this.itemProps[highlightedIndex];\n\n if (highlightedIndexProps?.disabled) {\n highlightedIndex = this.itemProps.findIndex((p) => !p.disabled);\n }\n\n if (highlightedIndex === -1) return;\n\n this.itemRefs[highlightedIndex]?.focus();\n }, 0);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n if (place === 'list' && visible && hide && isMenuItem) {\n if (\n !inlineActions ||\n (inlineActions && (e.key === 'Escape' || this.asProps.highlightedIndex === 0))\n ) {\n this.handlers.visible(false);\n if (this.triggerRef.current) {\n setFocus(this.triggerRef.current);\n }\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n };\n }\n\n handlePreventTabOnActions(e) {\n if (e.key === 'Tab') {\n e.stopPropagation();\n e.preventDefault();\n return false;\n }\n }\n\n render() {\n const { Children, selectedIndex, interaction, timeout } = this.asProps;\n\n this.itemProps = [];\n\n return (\n <selectedIndexContext.Provider value={selectedIndex}>\n <Root\n render={Dropdown}\n timeout={timeout || (interaction === 'hover' ? [0, 100] : undefined)}\n >\n <Children />\n </Root>\n </selectedIndexContext.Provider>\n );\n }\n}\n\nfunction List({ styles, Children }) {\n const SDropdownMenuList = Root;\n const SBar = ScrollAreaComponent.Bar;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true} shadowSize={16} shadowTheme='light'>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <SBar orientation='horizontal' />\n <SBar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n}\nfunction Actions({ styles }) {\n const SDropdownMenuActions = Root;\n\n return sstyled(styles)(<SDropdownMenuActions render={Flex} />);\n}\n\nfunction Menu(props) {\n const {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n } = props;\n const popperProps = {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n };\n return (\n <ListBoxContextProvider>\n <DropdownMenu.Popper {...popperProps} role={null}>\n <Root render={DropdownMenu.List} />\n </DropdownMenu.Popper>\n </ListBoxContextProvider>\n );\n}\n\nfunction Item({\n id,\n styles,\n disabled,\n Children,\n forwardRef,\n role,\n tabIndex,\n actionsRef,\n 'aria-checked': ariaChecked,\n}) {\n const SDropdownMenuItemContainer = Root;\n const itemRef = React.useRef();\n\n const [highlighted, setHighlighted] = React.useState(false);\n\n const menuItemContextValue = {\n contentId: id,\n ref: forkRef(forwardRef, itemRef),\n role,\n tabIndex,\n ariaChecked,\n disabled,\n };\n const ariaDescribes = [];\n\n const hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);\n const hasHint = isAdvanceMode(Children, [DropdownMenu.Item.Hint.displayName], true);\n const advancedMode =\n isAdvanceMode(Children, [DropdownMenu.Item.Content.displayName], true) || hasSubMenu || hasHint;\n\n if (hasHint) {\n const hintId = `igc-${useUID()}-option-hint`;\n\n menuItemContextValue.hintId = hintId;\n ariaDescribes.push(hintId);\n }\n\n if (hasSubMenu) {\n menuItemContextValue.hasSubMenu = true;\n }\n\n menuItemContextValue.ariaDescribes = ariaDescribes;\n\n React.useEffect(() => {\n const onFocus = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(true);\n\n if (hasSubMenu) {\n e.stopPropagation();\n }\n }\n };\n const onBlur = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(false);\n\n if (actionsRef.current) {\n itemRef.current.tabIndex = -1;\n }\n }\n };\n\n document.addEventListener('focus', onFocus, { capture: true });\n document.addEventListener('blur', onBlur, { capture: true });\n\n return () => {\n document.removeEventListener('focus', onFocus, { capture: true });\n document.removeEventListener('blur', onBlur, { capture: true });\n };\n }, [itemRef.current]);\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : menuItemContextValue.ref}\n use:highlighted={!disabled && highlighted && lastInteraction.isKeyboard()}\n use:role={advancedMode ? undefined : role}\n use:id={advancedMode ? undefined : id}\n use:tabIndex={advancedMode ? undefined : tabIndex}\n use:aria-checked={advancedMode ? undefined : ariaChecked}\n >\n <Children />\n </SDropdownMenuItemContainer>\n </menuItemContext.Provider>,\n );\n}\n\nfunction Addon(props) {\n const SDropdownMenuItemAddon = Root;\n return sstyled(props.styles)(<SDropdownMenuItemAddon render={Box} />);\n}\n\nfunction Trigger() {\n return <Root render={Dropdown.Trigger} />;\n}\n\nfunction ItemContent({ styles }) {\n const SItemContent = Root;\n const ref = React.useRef();\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n let subMenu = undefined;\n\n if (menuItemCtxValue.hasSubMenu) {\n subMenu = 'true';\n }\n\n const [describedby, setDescribedby] = React.useState(new Set(menuItemCtxValue.ariaDescribes));\n\n React.useEffect(() => {\n const element = ref.current;\n const parent = element?.parentElement;\n\n if (\n parent.getAttribute('aria-haspopup') === 'true' &&\n parent.getAttribute('aria-describedby')\n ) {\n setDescribedby((prev) => {\n prev.add(parent.getAttribute('aria-describedby'));\n\n return new Set(prev);\n });\n }\n }, [menuItemCtxValue.ariaDescribes]);\n\n return sstyled(styles)(\n <SItemContent\n render={Flex}\n role={menuItemCtxValue.role}\n id={menuItemCtxValue.contentId}\n tabIndex={menuItemCtxValue.tabIndex}\n ref={forkRef(menuItemCtxValue.ref, ref)}\n use:aria-describedby={[...describedby].join(' ')}\n aria-haspopup={menuItemCtxValue.hasSubMenu ? 'true' : undefined}\n aria-expanded={subMenu}\n aria-checked={menuItemCtxValue.ariaChecked}\n alignItems='center'\n justifyContent={menuItemCtxValue.hasSubMenu ? 'space-between' : undefined}\n disabled={menuItemCtxValue.disabled}\n />,\n );\n}\n\nfunction ItemContentText({ styles }) {\n const SItemContentText = Root;\n return sstyled(styles)(<SItemContentText render={Text} />);\n}\n\nfunction ItemHint({ styles }) {\n const SItemHint = Root;\n const { hintId } = React.useContext(menuItemContext);\n\n return sstyled(styles)(<SItemHint render={Flex} id={hintId} aria-hidden='true' />);\n}\n\n/**\n * @deprecated Use Item hint\n */\nfunction Hint(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='hint' />,\n );\n}\n/**\n * @deprecated Use Group with title prop\n */\nfunction Title(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='title' />,\n );\n}\n\n/**\n * @deprecated\n */\nfunction Nesting({ forwardRef }) {\n return <Root render={DropdownMenu.Item} ref={forwardRef} />;\n}\n\n/**\n * @deprecated\n */\nfunction NestingTrigger({ forwardRef }) {\n return (\n <Root\n render={DropdownMenu.Item.Content}\n tag={DropdownMenu.Trigger}\n ref={forwardRef}\n use:role='menuitem'\n />\n );\n}\n\nconst DropdownMenu = createComponent(\n DropdownMenuRoot,\n {\n Trigger,\n Popper: Dropdown.Popper,\n List,\n VirtualList,\n Actions,\n Menu,\n Item: [Item, { Addon, Content: ItemContent, Text: ItemContentText, Hint: ItemHint }],\n /**\n * @deprecated. Use just Item. See examples on\n */\n Nesting: [Nesting, { Trigger: NestingTrigger, Addon }],\n ItemTitle: Title,\n ItemHint: Hint,\n Group: Dropdown.Group,\n },\n {\n parent: [Dropdown],\n },\n);\n\nDropdownMenu.selectedIndexContext = selectedIndexContext;\n\nexport default D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AAE,CAACA,IAAI,EAAE;IAAEiC,KAAK,EAALA,KAAK;IAAEX,OAAO,EAAEmB,WAAW;IAAEjO,IAAI,EAAEsP,eAAe;IAAE1C,IAAI,EAAEgD;EAAS,CAAC,CAAC;EACpF;AACJ;AACA;EACIc,OAAO,EAAE,CAACA,OAAO,EAAE;IAAE5C,OAAO,EAAEgD,cAAc;IAAErD,KAAK,EAALA;EAAM,CAAC,CAAC;EACtDyD,SAAS,EAAEZ,KAAK;EAChBV,QAAQ,EAAEhD,IAAI;EACduE,KAAK,EAAE1R,QAAQ,CAAC0R;AAClB,CAAC,EACD;EACEpC,MAAM,EAAE,CAACtP,QAAQ;AACnB,CACF,CAAC;AAEDkF,YAAY,CAAChF,oBAAoB,GAAGA,oBAAoB;AAExD,eAAegF,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export var ListBoxContextProvider = function ListBoxContextProvider(_ref) {
|
|
4
|
+
var children = _ref.children;
|
|
5
|
+
return /*#__PURE__*/React.createElement(hideScrollBarsFromScreenReadersContext.Provider, {
|
|
6
|
+
value: true
|
|
7
|
+
}, children);
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=Context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.js","names":["hideScrollBarsFromScreenReadersContext","React","ListBoxContextProvider","_ref","children","createElement","Provider","value"],"sources":["../../../src/components/Context.tsx"],"sourcesContent":["import { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport React from 'react';\n\nexport const ListBoxContextProvider = ({ children }: React.PropsWithChildren) => (\n <hideScrollBarsFromScreenReadersContext.Provider value={true}>\n {children}\n </hideScrollBarsFromScreenReadersContext.Provider>\n);\n"],"mappings":"AAAA,SAASA,sCAAsC,QAAQ,sBAAsB;AAC7E,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAO,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAAC,IAAA;EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EAAA,oBAC/CH,KAAA,CAAAI,aAAA,CAACL,sCAAsC,CAACM,QAAQ;IAACC,KAAK,EAAE;EAAK,GAC1DH,QAC8C,CAAC;AAAA,CACnD","ignoreList":[]}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
+
import { sstyled as _sstyled } from "@semcore/core";
|
|
8
|
+
import { assignProps as _assignProps } from "@semcore/core";
|
|
9
|
+
import { Box } from '@semcore/base-components';
|
|
10
|
+
import { Root, Component, createComponent, sstyled } from '@semcore/core';
|
|
11
|
+
import ScrollAreaComponent from '@semcore/scroll-area';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { ListBoxContextProvider } from './Context';
|
|
14
|
+
/*!__reshadow-styles__:"../style/dropdown-menu.shadow.css"*/
|
|
15
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SDropdownMenuList_1d1ud_gg_{max-height:240px;padding:var(--intergalactic-spacing-1x, 4px)0;position:relative;min-height:26px;min-width:32px;box-sizing:content-box;z-index:0;color:var(--intergalactic-text-primary, #191b23)}.___SDropdownMenuList_1d1ud_gg_ .___SBar_1d1ud_gg_{z-index:3}.___SDropdownMenuList_1d1ud_gg_ .___SShadowHorizontal_1d1ud_gg_:after,.___SDropdownMenuList_1d1ud_gg_ .___SShadowHorizontal_1d1ud_gg_:before,.___SDropdownMenuList_1d1ud_gg_ .___SShadowVertical_1d1ud_gg_:after,.___SDropdownMenuList_1d1ud_gg_ .___SShadowVertical_1d1ud_gg_:before{border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuItemContainer_1d1ud_gg_ .___SItemContent_1d1ud_gg_:focus-visible{outline:0}.___SDropdownMenuItemContainer_1d1ud_gg_.__nesting-trigger_1d1ud_gg_{justify-content:space-between}.___SDropdownMenuItemAddon_1d1ud_gg_,.___SItemContentText_1d1ud_gg_{display:inline-flex;margin-left:var(--intergalactic-spacing-1x, 4px);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SDropdownMenuItemAddon_1d1ud_gg_:first-child,.___SItemContentText_1d1ud_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_1d1ud_gg_:last-child,.___SItemContentText_1d1ud_gg_:last-child{margin-right:0}.___SDropdownMenuNesting_1d1ud_gg_,.___SDropdownMenuNesting_1d1ud_gg_._size_l_1d1ud_gg_,.___SDropdownMenuNesting_1d1ud_gg_._size_m_1d1ud_gg_{padding:0}.___SDropdownMenuNesting_1d1ud_gg_.__highlighted_1d1ud_gg_{z-index:1;outline-color:var(--intergalactic-keyboard-focus-outline, #008ff8);outline-style:solid;outline-width:2px;outline-offset:-2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset}.___SDropdownNestingItem_1d1ud_gg_._size_l_1d1ud_gg_,.___SDropdownNestingItem_1d1ud_gg_._size_m_1d1ud_gg_{padding-right:0}.___SDropdownNestingItem_1d1ud_gg_ .___SDropdownMenuItemContainer_1d1ud_gg_{width:auto;padding-top:0;padding-bottom:0;padding-left:0;min-height:auto}.___SItemHint_1d1ud_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}", /*__inner_css_end__*/"1d1ud_gg_"),
|
|
16
|
+
/*__reshadow_css_end__*/
|
|
17
|
+
{
|
|
18
|
+
"__SDropdownMenuItemContainer": "___SDropdownMenuItemContainer_1d1ud_gg_",
|
|
19
|
+
"_nesting-trigger": "__nesting-trigger_1d1ud_gg_",
|
|
20
|
+
"__SDropdownMenuNesting": "___SDropdownMenuNesting_1d1ud_gg_",
|
|
21
|
+
"_size_l": "_size_l_1d1ud_gg_",
|
|
22
|
+
"_size_m": "_size_m_1d1ud_gg_",
|
|
23
|
+
"_highlighted": "__highlighted_1d1ud_gg_",
|
|
24
|
+
"__SDropdownNestingItem": "___SDropdownNestingItem_1d1ud_gg_",
|
|
25
|
+
"__SItemHint": "___SItemHint_1d1ud_gg_",
|
|
26
|
+
"__SDropdownMenuList": "___SDropdownMenuList_1d1ud_gg_",
|
|
27
|
+
"__SBar": "___SBar_1d1ud_gg_",
|
|
28
|
+
"__SShadowHorizontal": "___SShadowHorizontal_1d1ud_gg_",
|
|
29
|
+
"__SShadowVertical": "___SShadowVertical_1d1ud_gg_",
|
|
30
|
+
"__SItemContent": "___SItemContent_1d1ud_gg_",
|
|
31
|
+
"__SDropdownMenuItemAddon": "___SDropdownMenuItemAddon_1d1ud_gg_",
|
|
32
|
+
"__SItemContentText": "___SItemContentText_1d1ud_gg_"
|
|
33
|
+
});
|
|
34
|
+
var VirtualListRoot = /*#__PURE__*/function (_Component) {
|
|
35
|
+
function VirtualListRoot() {
|
|
36
|
+
var _this;
|
|
37
|
+
_classCallCheck(this, VirtualListRoot);
|
|
38
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
39
|
+
args[_key] = arguments[_key];
|
|
40
|
+
}
|
|
41
|
+
_this = _callSuper(this, VirtualListRoot, [].concat(args));
|
|
42
|
+
_defineProperty(_this, "containerRef", /*#__PURE__*/React.createRef());
|
|
43
|
+
_defineProperty(_this, "listRef", /*#__PURE__*/React.createRef());
|
|
44
|
+
_defineProperty(_this, "state", {
|
|
45
|
+
scrollTop: 0,
|
|
46
|
+
scrollDirection: 'down'
|
|
47
|
+
});
|
|
48
|
+
_defineProperty(_this, "handleScroll", function (e) {
|
|
49
|
+
if (e.target instanceof HTMLElement) {
|
|
50
|
+
var scrollDirection = e.target.scrollTop > _this.state.scrollTop ? 'down' : 'up';
|
|
51
|
+
_this.setState({
|
|
52
|
+
scrollDirection: scrollDirection,
|
|
53
|
+
scrollTop: e.target.scrollTop
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return _this;
|
|
58
|
+
}
|
|
59
|
+
_inherits(VirtualListRoot, _Component);
|
|
60
|
+
return _createClass(VirtualListRoot, [{
|
|
61
|
+
key: "componentDidMount",
|
|
62
|
+
value: function componentDidMount() {
|
|
63
|
+
var _this2 = this;
|
|
64
|
+
var _this$asProps = this.asProps,
|
|
65
|
+
index = _this$asProps.index,
|
|
66
|
+
rowHeight = _this$asProps.rowHeight;
|
|
67
|
+
setTimeout(function () {
|
|
68
|
+
var _this2$listRef$curren, _this2$listRef$curren2, _this2$containerRef$c;
|
|
69
|
+
var listHeight = ((_this2$listRef$curren = (_this2$listRef$curren2 = _this2.listRef.current) === null || _this2$listRef$curren2 === void 0 ? void 0 : _this2$listRef$curren2.getBoundingClientRect().height) !== null && _this2$listRef$curren !== void 0 ? _this2$listRef$curren : 0) / 2;
|
|
70
|
+
(_this2$containerRef$c = _this2.containerRef.current) === null || _this2$containerRef$c === void 0 || _this2$containerRef$c.scrollTo({
|
|
71
|
+
top: index * rowHeight - listHeight + rowHeight / 2
|
|
72
|
+
});
|
|
73
|
+
}, 10); // 10 for correct work in safari
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "render",
|
|
77
|
+
value: function render() {
|
|
78
|
+
var _ref = this.asProps,
|
|
79
|
+
_ref2;
|
|
80
|
+
var SDropdownMenuList = ScrollAreaComponent;
|
|
81
|
+
var SBar = ScrollAreaComponent.Bar;
|
|
82
|
+
var _this$state = this.state,
|
|
83
|
+
scrollDirection = _this$state.scrollDirection,
|
|
84
|
+
scrollTop = _this$state.scrollTop;
|
|
85
|
+
var _this$asProps2 = this.asProps,
|
|
86
|
+
rows = _this$asProps2.rows,
|
|
87
|
+
rowHeight = _this$asProps2.rowHeight,
|
|
88
|
+
rowsBuffer = _this$asProps2.rowsBuffer,
|
|
89
|
+
styles = _this$asProps2.styles,
|
|
90
|
+
RenderRow = _this$asProps2.renderRow,
|
|
91
|
+
customData = _this$asProps2.customData;
|
|
92
|
+
var offsetHeight = 0;
|
|
93
|
+
var prevPrepared = scrollDirection === 'up' ? rowsBuffer : 6;
|
|
94
|
+
var nextPrepared = scrollDirection === 'up' ? 6 : rowsBuffer;
|
|
95
|
+
var startIndex = Math.max(Math.floor(scrollTop / rowHeight) - prevPrepared, 0);
|
|
96
|
+
var lastIndex = scrollDirection === 'up' && scrollTop === 0 ? rowsBuffer : Math.min(Math.ceil((scrollTop + offsetHeight) / rowHeight) + nextPrepared, rows.length);
|
|
97
|
+
var rowsToRender = rows.slice(startIndex, lastIndex);
|
|
98
|
+
var rowMarginTop = rowHeight * startIndex;
|
|
99
|
+
var rowMarginBottom = rowHeight * (rows.length - lastIndex);
|
|
100
|
+
return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(ListBoxContextProvider, _ref2.cn("ListBoxContextProvider", {}), /*#__PURE__*/React.createElement(SDropdownMenuList, _ref2.cn("SDropdownMenuList", _objectSpread({}, _assignProps({
|
|
101
|
+
"shadow": true,
|
|
102
|
+
"shadowSize": 16,
|
|
103
|
+
"shadowTheme": 'light',
|
|
104
|
+
"onScroll": this.handleScroll,
|
|
105
|
+
"data-is-virtual": 'true',
|
|
106
|
+
"ref": this.listRef
|
|
107
|
+
}, _ref))), /*#__PURE__*/React.createElement(ScrollAreaComponent.Container, {
|
|
108
|
+
ref: this.containerRef,
|
|
109
|
+
tabIndex: undefined,
|
|
110
|
+
h: rows.length * rowHeight
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Box, _ref2.cn("Box", {
|
|
112
|
+
"h": rowMarginTop
|
|
113
|
+
})), rowsToRender.map(function (item, index) {
|
|
114
|
+
return /*#__PURE__*/React.createElement(RenderRow, {
|
|
115
|
+
key: startIndex + index,
|
|
116
|
+
row: item,
|
|
117
|
+
index: startIndex + index,
|
|
118
|
+
data: customData
|
|
119
|
+
});
|
|
120
|
+
}), /*#__PURE__*/React.createElement(Box, _ref2.cn("Box", {
|
|
121
|
+
"h": rowMarginBottom
|
|
122
|
+
}))), /*#__PURE__*/React.createElement(SBar, _ref2.cn("SBar", {
|
|
123
|
+
"orientation": 'horizontal'
|
|
124
|
+
})), /*#__PURE__*/React.createElement(SBar, _ref2.cn("SBar", {
|
|
125
|
+
"orientation": 'vertical'
|
|
126
|
+
}))));
|
|
127
|
+
}
|
|
128
|
+
}]);
|
|
129
|
+
}(Component);
|
|
130
|
+
_defineProperty(VirtualListRoot, "displayName", 'VirtualList');
|
|
131
|
+
_defineProperty(VirtualListRoot, "style", style);
|
|
132
|
+
_defineProperty(VirtualListRoot, "defaultProps", {
|
|
133
|
+
rowsBuffer: 10
|
|
134
|
+
});
|
|
135
|
+
export var VirtualList = createComponent(VirtualListRoot);
|
|
136
|
+
//# sourceMappingURL=VirtualList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualList.js","names":["Box","Root","Component","createComponent","sstyled","ScrollAreaComponent","React","ListBoxContextProvider","style","_sstyled","insert","VirtualListRoot","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","createRef","scrollTop","scrollDirection","e","target","HTMLElement","state","setState","_inherits","_createClass","key","value","componentDidMount","_this2","_this$asProps","asProps","index","rowHeight","setTimeout","_this2$listRef$curren","_this2$listRef$curren2","_this2$containerRef$c","listHeight","listRef","current","getBoundingClientRect","height","containerRef","scrollTo","top","render","_ref","_ref2","SDropdownMenuList","SBar","Bar","_this$state","_this$asProps2","rows","rowsBuffer","styles","RenderRow","renderRow","customData","offsetHeight","prevPrepared","nextPrepared","startIndex","Math","max","floor","lastIndex","min","ceil","rowsToRender","slice","rowMarginTop","rowMarginBottom","createElement","cn","_objectSpread","_assignProps","handleScroll","Container","ref","tabIndex","undefined","h","map","item","row","data","VirtualList"],"sources":["../../../src/components/VirtualList.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport { Root, Component, createComponent, sstyled } from '@semcore/core';\nimport ScrollAreaComponent from '@semcore/scroll-area';\nimport React from 'react';\n\nimport { ListBoxContextProvider } from './Context';\nimport style from '../style/dropdown-menu.shadow.css';\n\nexport type RenderRowProps<T, D> = {\n index: number;\n row: T;\n data: D;\n};\n\ntype VirtualListProps<T, D extends object> = {\n /** List of all rows in ddMenu */\n rows: T[];\n /** Method for render row, it's better to wrap it via React.memo */\n renderRow: (props: RenderRowProps<T, D>) => React.ReactNode;\n /** The height of row. For now, you should calculate it on your side. */\n rowHeight: number;\n /** The buffer of rows out of visible rows\n * @default 10\n */\n rowsBuffer?: number;\n /** Some custom data for each renderRow function */\n customData: D;\n};\n\ntype State = {\n scrollTop: number;\n scrollDirection: 'up' | 'down';\n};\n\nclass VirtualListRoot<T = string, D extends object = {}> extends Component<VirtualListProps<T, D>, {}, State, [], { rowsBuffer: number; index: number }> {\n static displayName = 'VirtualList';\n static style = style;\n\n static defaultProps = {\n rowsBuffer: 10,\n };\n\n containerRef = React.createRef<HTMLDivElement>();\n listRef = React.createRef<HTMLDivElement>();\n\n state: State = {\n scrollTop: 0,\n scrollDirection: 'down',\n };\n\n componentDidMount() {\n const { index, rowHeight } = this.asProps;\n\n setTimeout(() => {\n const listHeight = (this.listRef.current?.getBoundingClientRect().height ?? 0) / 2;\n this.containerRef.current?.scrollTo({ top: index * rowHeight - listHeight + rowHeight / 2 });\n }, 10); // 10 for correct work in safari\n }\n\n handleScroll = (e: React.SyntheticEvent<HTMLDivElement>) => {\n if (e.target instanceof HTMLElement) {\n const scrollDirection = e.target.scrollTop > this.state.scrollTop ? 'down' : 'up';\n\n this.setState({\n scrollDirection,\n scrollTop: e.target.scrollTop,\n });\n }\n };\n\n render() {\n const SDropdownMenuList = Root;\n const SBar = ScrollAreaComponent.Bar;\n\n const { scrollDirection, scrollTop } = this.state;\n const { rows, rowHeight, rowsBuffer, styles, renderRow: RenderRow, customData } = this.asProps;\n\n const offsetHeight = 0;\n const prevPrepared = scrollDirection === 'up' ? rowsBuffer : 6;\n const nextPrepared = scrollDirection === 'up' ? 6 : rowsBuffer;\n\n const startIndex = Math.max(Math.floor(scrollTop / rowHeight) - prevPrepared, 0);\n\n const lastIndex = scrollDirection === 'up' && scrollTop === 0\n ? rowsBuffer\n : Math.min(\n Math.ceil((scrollTop + offsetHeight) / rowHeight) + nextPrepared,\n rows.length,\n );\n\n const rowsToRender = rows.slice(startIndex, lastIndex);\n const rowMarginTop = rowHeight * startIndex;\n const rowMarginBottom = rowHeight * (rows.length - lastIndex);\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList\n render={ScrollAreaComponent}\n shadow={true}\n shadowSize={16}\n shadowTheme='light'\n onScroll={this.handleScroll}\n data-is-virtual='true'\n ref={this.listRef}\n >\n <ScrollAreaComponent.Container ref={this.containerRef} tabIndex={undefined} h={rows.length * rowHeight}>\n <Box h={rowMarginTop} />\n {rowsToRender.map((item, index) => {\n return <RenderRow key={startIndex + index} row={item} index={startIndex + index} data={customData} />;\n })}\n <Box h={rowMarginBottom} />\n </ScrollAreaComponent.Container>\n <SBar orientation='horizontal' />\n <SBar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n }\n}\n\nexport type VirtualListComponent = (<\n T = string,\n D extends object = {},\n>(\n props: Intergalactic.InternalTypings.EfficientOmit<Intergalactic.InternalTypings.ComponentProps<typeof Box, 'div', VirtualListProps<T, D>>, 'tag' | 'children'>\n) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<typeof Box, 'div', VirtualListProps<any, any>>;\n\nexport const VirtualList = createComponent(VirtualListRoot) as VirtualListComponent;\n"],"mappings":";;;;;;;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;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AAe,kBAIG;EACpBoD,UAAU,EAAE;AACd,CAAC;AAuFH,OAAO,IAAMiC,WAAW,GAAG7F,eAAe,CAACQ,eAAe,CAAyB","ignoreList":[]}
|
package/lib/es6/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport type {\n DropdownContext,\n DropdownProps,\n DropdownHandlers,\n DropdownTriggerProps,\n DropdownPopperAriaProps,\n} from '@semcore/dropdown';\nimport type Dropdown from '@semcore/dropdown';\nimport type { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';\nimport type { eventInteraction } from '@semcore/popper';\nimport type { ScrollAreaProps } from '@semcore/scroll-area';\nimport type { Text } from '@semcore/typography';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}\nexport type DropdownMenuProps = DropdownProps & {\n /**\n * Set role `menuitemradio` (or `menuitemcheckbox` if `multiselect`) for Dropdown.Item\n */\n selectable?: boolean;\n /**\n * Multiple select\n */\n multiselect?: boolean;\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n /**\n * Index of the element selected by default\n */\n defaultHighlightedIndex?: number | null;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number | null;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number | null) => void;\n /** Specifies the locale for i18n support */\n locale?: string;\n /**\n * Flag for menu that using as actions on DropdownMenu.Item\n */\n inlineActions?: boolean;\n\n /**\n * Count of menu items (for virtual lists only)\n */\n itemsCount?: number;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuListProps extends DropdownMenuListProps, UnknownProperties {}\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\n/** @deprecated */\nexport interface IDropdownMenuMenuProps extends DropdownMenuMenuProps, UnknownProperties {}\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\n/** @deprecated */\nexport interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}\nexport type DropdownMenuItemProps = FlexProps & {\n /**\n * Enables selected state. For selectable dropdowns only.\n */\n selected?: boolean;\n /**\n * Disables item\n */\n disabled?: boolean;\n /**\n * Adds focus styles around\n * @deprecated set focus manually by `.focus()` method to the same behaviour\n */\n highlighted?: boolean;\n /**\n * Disables hover state\n * @deprecated use `disabled` instead\n */\n notInteractive?: boolean;\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n /**\n * Index of item (used in virtualized lists)\n */\n index?: number;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemHintProps extends DropdownMenuItemHintProps, UnknownProperties {}\nexport type DropdownMenuItemHintProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemTitleProps\n extends DropdownMenuItemTitleProps,\n UnknownProperties {}\nexport type DropdownMenuItemTitleProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuContext extends DropdownMenuContext, UnknownProperties {}\nexport type DropdownMenuContext = DropdownContext & {\n /**\n * Tracks which menu item is currently highlighted/focused for keyboard navigation\n **/\n highlightedIndex?: number;\n /**\n * Returns props for the menu list container\n **/\n getListProps: PropGetterFn;\n /**\n * Returns props for individual menu items\n **/\n getItemProps: PropGetterFn;\n /**\n * Returns props for item hint/description elements\n **/\n getItemHintProps: PropGetterFn;\n /**\n * Returns props for item title elements\n **/\n getItemTitleProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuHandlers extends DropdownMenuHandlers, UnknownProperties {}\nexport type DropdownMenuHandlers = DropdownHandlers & {\n highlightedIndex: (index: number) => void;\n};\n\nexport type DropdownMenuTriggerProps = DropdownTriggerProps;\n\ndeclare const DropdownMenu: Intergalactic.Component<\n 'div',\n DropdownMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n> & {\n Trigger: typeof Dropdown.Trigger;\n Popper: Intergalactic.Component<'div', DropdownMenuProps & DropdownPopperAriaProps>;\n List: Intergalactic.Component<\n 'div',\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Actions: Intergalactic.Component<\n typeof Flex,\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Menu: Intergalactic.Component<\n 'div',\n DropdownMenuMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Item: Intergalactic.Component<\n typeof Dropdown.Item,\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n Addon: typeof Box;\n Content: typeof Flex;\n Text: typeof Text;\n Hint: typeof Flex;\n };\n /**\n * @deprecated Use Group with title prop\n */\n ItemTitle: Intergalactic.Component<'div', DropdownMenuItemTitleProps>;\n /**\n * @deprecated Use prop subTitle on Group or Item component\n */\n ItemHint: Intergalactic.Component<'div', DropdownMenuItemHintProps>;\n Group: typeof Dropdown.Group;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Nesting: Intergalactic.Component<\n 'div',\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n /**\n * @deprecated Use Item instead of Nesting\n */\n Trigger: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Item: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Addon: typeof Box;\n };\n\n selectedIndexContext: React.Context<number>;\n nestedMenuInteraction: eventInteraction;\n};\n\nexport default DropdownMenu;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport type {\n DropdownContext,\n DropdownProps,\n DropdownHandlers,\n DropdownTriggerProps,\n DropdownPopperAriaProps,\n} from '@semcore/dropdown';\nimport type Dropdown from '@semcore/dropdown';\nimport type { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';\nimport type { eventInteraction } from '@semcore/popper';\nimport type { ScrollAreaProps } from '@semcore/scroll-area';\nimport type { Text } from '@semcore/typography';\n\nimport type { VirtualList, RenderRowProps } from './components/VirtualList';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}\nexport type DropdownMenuProps = DropdownProps & {\n /**\n * Set role `menuitemradio` (or `menuitemcheckbox` if `multiselect`) for Dropdown.Item\n */\n selectable?: boolean;\n /**\n * Multiple select\n */\n multiselect?: boolean;\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n /**\n * Index of the element selected by default\n */\n defaultHighlightedIndex?: number | null;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number | null;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number | null) => void;\n /** Specifies the locale for i18n support */\n locale?: string;\n /**\n * Flag for menu that using as actions on DropdownMenu.Item\n */\n inlineActions?: boolean;\n\n /**\n * Count of menu items (for virtual lists only)\n */\n itemsCount?: number;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuListProps extends DropdownMenuListProps, UnknownProperties {}\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\n/** @deprecated */\nexport interface IDropdownMenuMenuProps extends DropdownMenuMenuProps, UnknownProperties {}\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\n/** @deprecated */\nexport interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}\nexport type DropdownMenuItemProps = FlexProps & {\n /**\n * Enables selected state. For selectable dropdowns only.\n */\n selected?: boolean;\n /**\n * Disables item\n */\n disabled?: boolean;\n /**\n * Adds focus styles around\n * @deprecated set focus manually by `.focus()` method to the same behaviour\n */\n highlighted?: boolean;\n /**\n * Disables hover state\n * @deprecated use `disabled` instead\n */\n notInteractive?: boolean;\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n /**\n * Index of item (used in virtualized lists)\n */\n index?: number;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemHintProps extends DropdownMenuItemHintProps, UnknownProperties {}\nexport type DropdownMenuItemHintProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemTitleProps\n extends DropdownMenuItemTitleProps,\n UnknownProperties {}\nexport type DropdownMenuItemTitleProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuContext extends DropdownMenuContext, UnknownProperties {}\nexport type DropdownMenuContext = DropdownContext & {\n /**\n * Tracks which menu item is currently highlighted/focused for keyboard navigation\n **/\n highlightedIndex?: number;\n /**\n * Returns props for the menu list container\n **/\n getListProps: PropGetterFn;\n /**\n * Returns props for individual menu items\n **/\n getItemProps: PropGetterFn;\n /**\n * Returns props for item hint/description elements\n **/\n getItemHintProps: PropGetterFn;\n /**\n * Returns props for item title elements\n **/\n getItemTitleProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuHandlers extends DropdownMenuHandlers, UnknownProperties {}\nexport type DropdownMenuHandlers = DropdownHandlers & {\n highlightedIndex: (index: number) => void;\n};\n\nexport type DropdownMenuTriggerProps = DropdownTriggerProps;\n\ndeclare const DropdownMenu: Intergalactic.Component<\n 'div',\n DropdownMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n> & {\n Trigger: typeof Dropdown.Trigger;\n Popper: Intergalactic.Component<'div', DropdownMenuProps & DropdownPopperAriaProps>;\n List: Intergalactic.Component<\n 'div',\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Actions: Intergalactic.Component<\n typeof Flex,\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Menu: Intergalactic.Component<\n 'div',\n DropdownMenuMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Item: Intergalactic.Component<\n typeof Dropdown.Item,\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n Addon: typeof Box;\n Content: typeof Flex;\n Text: typeof Text;\n Hint: typeof Flex;\n };\n /**\n * @deprecated Use Group with title prop\n */\n ItemTitle: Intergalactic.Component<'div', DropdownMenuItemTitleProps>;\n /**\n * @deprecated Use prop subTitle on Group or Item component\n */\n ItemHint: Intergalactic.Component<'div', DropdownMenuItemHintProps>;\n Group: typeof Dropdown.Group;\n\n VirtualList: typeof VirtualList;\n\n /**\n * @deprecated Use Item instead of Nesting\n */\n Nesting: Intergalactic.Component<\n 'div',\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n /**\n * @deprecated Use Item instead of Nesting\n */\n Trigger: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Item: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Addon: typeof Box;\n };\n\n selectedIndexContext: React.Context<number>;\n nestedMenuInteraction: eventInteraction;\n};\n\nexport default DropdownMenu;\n\nexport {\n RenderRowProps,\n};\n"],"mappings":"","ignoreList":[]}
|