@semcore/dropdown-menu 4.48.2-prerelease.0 → 4.49.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 +6 -0
- package/lib/cjs/DropdownMenu.js +257 -236
- 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 +148 -0
- package/lib/cjs/components/VirtualList.js.map +1 -0
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/dropdown-menu.shadow.css +28 -85
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/translations/de.json +1 -3
- package/lib/cjs/translations/es.json +1 -3
- package/lib/cjs/translations/fr.json +1 -3
- package/lib/cjs/translations/it.json +1 -3
- package/lib/cjs/translations/ja.json +1 -3
- package/lib/cjs/translations/ko.json +1 -3
- package/lib/cjs/translations/nl.json +1 -3
- package/lib/cjs/translations/pl.json +1 -3
- package/lib/cjs/translations/pt.json +1 -3
- package/lib/cjs/translations/sv.json +1 -3
- package/lib/cjs/translations/tr.json +1 -3
- package/lib/cjs/translations/vi.json +1 -3
- package/lib/cjs/translations/zh.json +1 -3
- package/lib/es6/DropdownMenu.js +248 -228
- 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 +143 -0
- package/lib/es6/components/VirtualList.js.map +1 -0
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/dropdown-menu.shadow.css +28 -85
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/translations/de.json +1 -3
- package/lib/es6/translations/es.json +1 -3
- package/lib/es6/translations/fr.json +1 -3
- package/lib/es6/translations/it.json +1 -3
- package/lib/es6/translations/ja.json +1 -3
- package/lib/es6/translations/ko.json +1 -3
- package/lib/es6/translations/nl.json +1 -3
- package/lib/es6/translations/pl.json +1 -3
- package/lib/es6/translations/pt.json +1 -3
- package/lib/es6/translations/sv.json +1 -3
- package/lib/es6/translations/tr.json +1 -3
- package/lib/es6/translations/vi.json +1 -3
- package/lib/es6/translations/zh.json +1 -3
- package/lib/esm/DropdownMenu.mjs +215 -188
- package/lib/esm/components/Context.mjs +11 -0
- package/lib/esm/components/VirtualList.mjs +135 -0
- package/lib/esm/style/dropdown-menu.shadow.css +28 -85
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/translations/de.json.mjs +2 -6
- package/lib/esm/translations/es.json.mjs +2 -6
- package/lib/esm/translations/fr.json.mjs +2 -6
- package/lib/esm/translations/it.json.mjs +2 -6
- package/lib/esm/translations/ja.json.mjs +2 -6
- package/lib/esm/translations/ko.json.mjs +2 -6
- package/lib/esm/translations/nl.json.mjs +2 -6
- package/lib/esm/translations/pl.json.mjs +2 -6
- package/lib/esm/translations/pt.json.mjs +2 -6
- package/lib/esm/translations/sv.json.mjs +2 -6
- package/lib/esm/translations/tr.json.mjs +2 -6
- package/lib/esm/translations/vi.json.mjs +2 -6
- package/lib/esm/translations/zh.json.mjs +2 -6
- package/lib/types/components/Context.d.ts +2 -0
- package/lib/types/components/VirtualList.d.ts +28 -0
- package/lib/types/index.d.ts +30 -79
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +16 -0
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_classnames","_dropdown","_flexBox","_scrollArea","_uniqueID","_intergalacticDynamicLocales","_keyboardFocusEnhance","_findComponent","_ref31","_assignProps14","_button","_typography","_excluded","style","_index","sstyled","insert","ListBoxContextProvider","_ref22","children","createElement","hideScrollBarsFromScreenReadersContext","Provider","value","menuItemContext","React","createContext","DropdownMenuRoot","_AbstractDropdown","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","createRef","_createClass2","key","uncontrolledProps","_this2","_objectSpread2","_get2","_getPrototypeOf2","prototype","visible","setTimeout","_this2$menuRef$curren","_this2$menuRef$curren2","options","menuRef","current","querySelectorAll","selected","querySelector","asProps","itemsCount","undefined","scrollToNode","i","handlers","highlightedIndex","itemRef","props","index","node","document","activeElement","getTriggerProps","_this$asProps","Children","uid","hasMenu","isAdvanceMode","DropdownMenu","Menu","displayName","ariaControls","onKeyDown","callAllEventHandlers","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","getListProps","handleArrowKeyDown","getPopperProps","handlePreventPopperKeyDown","getActionsProps","ref","actionsRef","handlePreventTabOnActions","getItemProps","_props$index","_this3","_this$asProps2","realIndex","isHighlighted","itemProps","tabIndex","tag","ButtonComponent","_props$use","_props$theme","_props$size","use","theme","size","onClick","place","_this4","e","_this4$menuRef$curren","_e$target$getAttribut","_this4$asProps","placement","inlineActions","contains","target","stopPropagation","show","startsWith","hide","isMenuItem","getAttribute","_this4$itemRefs$highl","itemRefs","focus","preventDefault","_this4$triggerRef$cur","triggerRef","render","_ref","_this$asProps3","selectedIndex","interaction","timeout","selectedIndexContext","Dropdown","assignProps","AbstractDropdown","Object","values","enhance","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","localizedMessages","locale","trigger","popper","List","_ref23","_ref2","arguments[0]","_ref14","styles","SDropdownMenuList","ScrollAreaComponent","cn","Container","Bar","orientation","Actions","_ref24","_ref3","_ref15","SDropdownMenuActions","Flex","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends2","role","Item","_ref25","_ref5","_ref16","id","disabled","forwardRef","ariaChecked","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray2","highlighted","setHighlighted","menuItemContextValue","contentId","forkRef","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","useUID","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","focusSourceRef","useFocusSource","Addon","_useBox","useBox","_useBox2","SDropdownMenuItemAddon","_useBox2$","className","other","_objectWithoutProperties2","Trigger","_ref6","ItemContent","_ref26","_ref7","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_toConsumableArray2","join","ItemContentText","_ref27","_ref8","_ref18","SItemContentText","Text","ItemHint","_ref28","_ref9","_ref19","SItemHint","_React$useContext","_ref10","_ref20","Title","_ref11","_ref21","Nesting","_ref29","_ref12","NestingTrigger","_ref30","_ref13","createComponent","ItemTitle","Group","_default","exports"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport createComponent, { sstyled, Root } from '@semcore/core';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, useBox } from '@semcore/flex-box';\nimport ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport { useUID } from '@semcore/utils/lib/uniqueID';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport style from './style/dropdown-menu.shadow.css';\nimport { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\nimport { forkRef } from '@semcore/utils/lib/ref';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonComponent from '@semcore/button';\nimport { Text } from '@semcore/typography';\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 const options = this.menuRef.current?.querySelectorAll(\n '[role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]',\n );\n const selected = this.menuRef.current?.querySelector('[aria-checked=\"true\"]');\n\n if (selected && options && this.asProps.itemsCount === undefined) {\n this.scrollToNode(selected, true);\n\n for (let i = 0; i < options.length; i++) {\n if (options[i] === selected) {\n this.handlers.highlightedIndex(i);\n break;\n }\n }\n }\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 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 }\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 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' && (!visible || inlineActions) && 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 this.triggerRef.current?.focus();\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\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true}>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <ScrollAreaComponent.Bar orientation='horizontal' />\n <ScrollAreaComponent.Bar 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 const focusSourceRef = useFocusSource();\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 && focusSourceRef.current === 'keyboard'}\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, { className, ...other }] = useBox(props, props.forwardRef);\n const styles = sstyled(props.styles);\n return (\n <SDropdownMenuItemAddon\n className={cn(styles.cn('SDropdownMenuItemAddon', props).className, className) || undefined}\n {...other}\n />\n );\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":";;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAFA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,SAAA,GAAAL,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GAE1CvM,YAAY;AAAAwM,OAAA,cAAAD,QAAA"}
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","names":["_core","require","_baseComponents","_button","_interopRequireDefault","_assignProps1","_findComponent","_isFocusInside","_setFocus","_ref22","_uniqueID","_dropdown","_interopRequireWildcard","_typography","_react","_Context","_VirtualList","_intergalacticDynamicLocales","style","sstyled","insert","menuItemContext","React","createContext","DropdownMenuRoot","_AbstractDropdown","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","createRef","_inherits2","_createClass2","key","value","uncontrolledProps","_this2","_objectSpread2","_superPropGet2","visible","setTimeout","focusAndScrollToSelected","get","menuElement","menuRef","current","selected","options","querySelectorAll","querySelector","_this$menuRef$current","_this3","_this$menuElements","menuElements","isFocusAlreadyInPopper","isFocusInside","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","isAdvanceMode","DropdownMenu","Menu","displayName","ariaControls","callAllEventHandlers","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","ButtonComponent","_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","setFocus","render","_ref","_this$asProps3","interaction","timeout","createElement","selectedIndexContext","Provider","Dropdown","assignProps","AbstractDropdown","Object","values","enhance","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","localizedMessages","locale","trigger","popper","List","_ref16","_ref2","arguments[0]","_ref1","styles","SDropdownMenuList","ScrollAreaComponent","SBar","Bar","SScrollContainer","Container","ListBoxContextProvider","cn","Actions","_ref17","_ref3","_ref10","SDropdownMenuActions","Flex","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends2","role","Item","_ref18","_ref5","_ref11","id","forwardRef","ariaChecked","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray2","highlighted","setHighlighted","menuItemContextValue","contentId","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","useUID","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","forkRef","lastInteraction","isKeyboard","Addon","_ref6","_ref12","SDropdownMenuItemAddon","Box","Trigger","_ref7","ItemContent","_ref19","_ref8","_ref13","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_toConsumableArray2","join","ItemContentText","_ref20","_ref9","_ref14","_ref20$ellipsis","ellipsis","SItemContentText","Text","Fragment","ItemHint","_ref21","_ref0","_ref15","SItemHint","_React$useContext","createComponent","VirtualList","Group","_default","exports"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import { Flex, ScrollArea as ScrollAreaComponent, Box } from '@semcore/base-components';\nimport 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 { 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 const isFocusAlreadyInPopper = isFocusInside(this.popperRef.current);\n\n if (isFocusAlreadyInPopper) return;\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 const SScrollContainer = ScrollAreaComponent.Container;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true} shadowSize={16} shadowTheme='light'>\n <SScrollContainer tabIndex={undefined}>\n <Children />\n </SScrollContainer>\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: itemRef,\n forwardRef,\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 });\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : forkRef(itemRef, forwardRef)}\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, menuItemCtxValue.forwardRef, 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, ellipsis = false }) {\n const SItemContentText = Root;\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n return sstyled(styles)(\n <>\n <SItemContentText\n render={Text}\n ellipsis={ellipsis}\n hint:triggerRef={menuItemCtxValue.ref}\n hint:placement='right'\n />\n </>,\n );\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\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 Group: Dropdown.Group,\n },\n {\n parent: [Dropdown],\n },\n);\n\nDropdownMenu.selectedIndexContext = selectedIndexContext;\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAC,uBAAA,CAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAV,sBAAA,CAAAH,OAAA;AAEA,IAAAc,QAAA,GAAAd,OAAA;AACA,IAAAe,YAAA,G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M,EAAEzC,oBAAQ,CAACyC,MAAM;EACvB3B,IAAI,EAAJA,IAAI;EACJ4G,WAAW,EAAXA,wBAAW;EACX9F,OAAO,EAAPA,OAAO;EACPrG,IAAI,EAAJA,IAAI;EACJqH,IAAI,EAAE,CAACA,IAAI,EAAE;IAAEmC,KAAK,EAALA,KAAK;IAAEb,OAAO,EAAEoB,WAAW;IAAE2B,IAAI,EAAEP,eAAe;IAAE1C,IAAI,EAAEmD;EAAS,CAAC,CAAC;EACpFQ,KAAK,EAAE3H,oBAAQ,CAAC2H;AAClB,CAAC,EACD;EACEvB,MAAM,EAAE,CAACpG,oBAAQ;AACnB,CACF,CAAC;AAED1E,YAAY,CAACwE,oBAAoB,GAAGA,8BAAoB;AAAC,IAAA8H,QAAA,GAAAC,OAAA,cAE1CvM,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ListBoxContextProvider = void 0;
|
|
8
|
+
var _baseComponents = require("@semcore/base-components");
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var ListBoxContextProvider = exports.ListBoxContextProvider = function ListBoxContextProvider(_ref) {
|
|
11
|
+
var children = _ref.children;
|
|
12
|
+
return /*#__PURE__*/_react["default"].createElement(_baseComponents.hideScrollBarsFromScreenReadersContext.Provider, {
|
|
13
|
+
value: true
|
|
14
|
+
}, children);
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=Context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.js","names":["_baseComponents","require","_react","_interopRequireDefault","ListBoxContextProvider","exports","_ref","children","createElement","hideScrollBarsFromScreenReadersContext","Provider","value"],"sources":["../../../src/components/Context.tsx"],"sourcesContent":["import { hideScrollBarsFromScreenReadersContext } from '@semcore/base-components';\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,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEO,IAAMG,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,SAAzBA,sBAAsBA,CAAAE,IAAA;EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EAAA,oBAC/CL,MAAA,YAAAM,aAAA,CAACR,eAAA,CAAAS,sCAAsC,CAACC,QAAQ;IAACC,KAAK,EAAE;EAAK,GAC1DJ,QAC8C,CAAC;AAAA,CACnD","ignoreList":[]}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.VirtualList = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
var _core = require("@semcore/core");
|
|
15
|
+
var _baseComponents = require("@semcore/base-components");
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
var _Context = require("./Context");
|
|
18
|
+
/*!__reshadow-styles__:"../style/dropdown-menu.shadow.css"*/
|
|
19
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SDropdownMenuList_1d74h_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, rgba(1, 5, 0, 0.899))}.___SDropdownMenuList_1d74h_gg_ .___SBar_1d74h_gg_{z-index:3}.___SDropdownMenuList_1d74h_gg_:not(.___SDropdownMenuList_1d74h_gg_:has([data-ui-name=\"DropdownMenu.Group\"][data-sticky=true])) .___SShadowHorizontal_1d74h_gg_:after,.___SDropdownMenuList_1d74h_gg_:not(.___SDropdownMenuList_1d74h_gg_:has([data-ui-name=\"DropdownMenu.Group\"][data-sticky=true])) .___SShadowHorizontal_1d74h_gg_:before,.___SDropdownMenuList_1d74h_gg_:not(.___SDropdownMenuList_1d74h_gg_:has([data-ui-name=\"DropdownMenu.Group\"][data-sticky=true])) .___SShadowVertical_1d74h_gg_:after,.___SDropdownMenuList_1d74h_gg_:not(.___SDropdownMenuList_1d74h_gg_:has([data-ui-name=\"DropdownMenu.Group\"][data-sticky=true])) .___SShadowVertical_1d74h_gg_:before{border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuItemContainer_1d74h_gg_ .___SItemContent_1d74h_gg_:focus-visible{outline:0}.___SDropdownMenuItemContainer_1d74h_gg_.__nesting-trigger_1d74h_gg_{justify-content:space-between}.___SDropdownMenuItemAddon_1d74h_gg_,.___SItemContentText_1d74h_gg_{display:inline-flex;margin-left:var(--intergalactic-spacing-1x, 4px);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SDropdownMenuItemAddon_1d74h_gg_:first-child,.___SItemContentText_1d74h_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_1d74h_gg_:last-child,.___SItemContentText_1d74h_gg_:last-child{margin-right:0}.___SDropdownMenuNesting_1d74h_gg_,.___SDropdownMenuNesting_1d74h_gg_._size_l_1d74h_gg_,.___SDropdownMenuNesting_1d74h_gg_._size_m_1d74h_gg_{padding:0}.___SDropdownMenuNesting_1d74h_gg_.__highlighted_1d74h_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_1d74h_gg_._size_l_1d74h_gg_,.___SDropdownNestingItem_1d74h_gg_._size_m_1d74h_gg_{padding-right:0}.___SDropdownNestingItem_1d74h_gg_ .___SDropdownMenuItemContainer_1d74h_gg_{width:auto;padding-top:0;padding-bottom:0;padding-left:0;min-height:auto}.___SItemHint_1d74h_gg_{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@supports (color:color(display-p3 0 0 0%)){.___SItemHint_1d74h_gg_{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@media (color-gamut:p3){.___SItemHint_1d74h_gg_{color:var(--intergalactic-text-secondary, color(display-p3 0.00228 0.01289 0.00252 / 0.583))}}}.___SScrollContainer_1d74h_gg_:has([data-ui-name=\"DropdownMenu.Group\"][data-sticky=true]){overscroll-behavior:none}", /*__inner_css_end__*/"1d74h_gg_"),
|
|
20
|
+
/*__reshadow_css_end__*/
|
|
21
|
+
{
|
|
22
|
+
"__SDropdownMenuItemContainer": "___SDropdownMenuItemContainer_1d74h_gg_",
|
|
23
|
+
"_nesting-trigger": "__nesting-trigger_1d74h_gg_",
|
|
24
|
+
"__SDropdownMenuNesting": "___SDropdownMenuNesting_1d74h_gg_",
|
|
25
|
+
"_size_l": "_size_l_1d74h_gg_",
|
|
26
|
+
"_size_m": "_size_m_1d74h_gg_",
|
|
27
|
+
"_highlighted": "__highlighted_1d74h_gg_",
|
|
28
|
+
"__SDropdownNestingItem": "___SDropdownNestingItem_1d74h_gg_",
|
|
29
|
+
"__SItemHint": "___SItemHint_1d74h_gg_",
|
|
30
|
+
"__SDropdownMenuList": "___SDropdownMenuList_1d74h_gg_",
|
|
31
|
+
"__SBar": "___SBar_1d74h_gg_",
|
|
32
|
+
"__SShadowHorizontal": "___SShadowHorizontal_1d74h_gg_",
|
|
33
|
+
"__SShadowVertical": "___SShadowVertical_1d74h_gg_",
|
|
34
|
+
"__SItemContent": "___SItemContent_1d74h_gg_",
|
|
35
|
+
"__SDropdownMenuItemAddon": "___SDropdownMenuItemAddon_1d74h_gg_",
|
|
36
|
+
"__SItemContentText": "___SItemContentText_1d74h_gg_",
|
|
37
|
+
"__SScrollContainer": "___SScrollContainer_1d74h_gg_"
|
|
38
|
+
});
|
|
39
|
+
var VirtualListRoot = /*#__PURE__*/function (_Component) {
|
|
40
|
+
function VirtualListRoot() {
|
|
41
|
+
var _this;
|
|
42
|
+
(0, _classCallCheck2["default"])(this, VirtualListRoot);
|
|
43
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
|
+
args[_key] = arguments[_key];
|
|
45
|
+
}
|
|
46
|
+
_this = (0, _callSuper2["default"])(this, VirtualListRoot, [].concat(args));
|
|
47
|
+
(0, _defineProperty2["default"])(_this, "containerRef", /*#__PURE__*/_react["default"].createRef());
|
|
48
|
+
(0, _defineProperty2["default"])(_this, "listRef", /*#__PURE__*/_react["default"].createRef());
|
|
49
|
+
(0, _defineProperty2["default"])(_this, "state", {
|
|
50
|
+
scrollTop: 0,
|
|
51
|
+
scrollDirection: 'down'
|
|
52
|
+
});
|
|
53
|
+
(0, _defineProperty2["default"])(_this, "handleScroll", function (e) {
|
|
54
|
+
if (e.target instanceof HTMLElement) {
|
|
55
|
+
var scrollDirection = e.target.scrollTop > _this.state.scrollTop ? 'down' : 'up';
|
|
56
|
+
_this.setState({
|
|
57
|
+
scrollDirection: scrollDirection,
|
|
58
|
+
scrollTop: e.target.scrollTop
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return _this;
|
|
63
|
+
}
|
|
64
|
+
(0, _inherits2["default"])(VirtualListRoot, _Component);
|
|
65
|
+
return (0, _createClass2["default"])(VirtualListRoot, [{
|
|
66
|
+
key: "componentDidMount",
|
|
67
|
+
value: function componentDidMount() {
|
|
68
|
+
var _this2 = this;
|
|
69
|
+
var _this$asProps = this.asProps,
|
|
70
|
+
index = _this$asProps.index,
|
|
71
|
+
rowHeight = _this$asProps.rowHeight,
|
|
72
|
+
rowsBuffer = _this$asProps.rowsBuffer;
|
|
73
|
+
setTimeout(function () {
|
|
74
|
+
var _this2$listRef$curren, _this2$listRef$curren2, _this2$containerRef$c;
|
|
75
|
+
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;
|
|
76
|
+
(_this2$containerRef$c = _this2.containerRef.current) === null || _this2$containerRef$c === void 0 || _this2$containerRef$c.scrollTo({
|
|
77
|
+
top: index * rowHeight - listHeight + rowHeight / 2
|
|
78
|
+
});
|
|
79
|
+
if (index <= rowsBuffer) {
|
|
80
|
+
_this2.forceUpdate(); // we need this for correct render all items with calculated container height
|
|
81
|
+
}
|
|
82
|
+
}, 10); // 10 for correct work in safari
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
key: "render",
|
|
86
|
+
value: function render() {
|
|
87
|
+
var _ref = this.asProps,
|
|
88
|
+
_ref2,
|
|
89
|
+
_this$listRef$current,
|
|
90
|
+
_this$listRef$current2;
|
|
91
|
+
var SDropdownMenuList = _baseComponents.ScrollArea;
|
|
92
|
+
var SBar = _baseComponents.ScrollArea.Bar;
|
|
93
|
+
var _this$state = this.state,
|
|
94
|
+
scrollDirection = _this$state.scrollDirection,
|
|
95
|
+
scrollTop = _this$state.scrollTop;
|
|
96
|
+
var _this$asProps2 = this.asProps,
|
|
97
|
+
rows = _this$asProps2.rows,
|
|
98
|
+
rowHeight = _this$asProps2.rowHeight,
|
|
99
|
+
rowsBuffer = _this$asProps2.rowsBuffer,
|
|
100
|
+
styles = _this$asProps2.styles,
|
|
101
|
+
RenderRow = _this$asProps2.renderRow,
|
|
102
|
+
customData = _this$asProps2.customData;
|
|
103
|
+
var offsetHeight = (_this$listRef$current = (_this$listRef$current2 = this.listRef.current) === null || _this$listRef$current2 === void 0 ? void 0 : _this$listRef$current2.offsetHeight) !== null && _this$listRef$current !== void 0 ? _this$listRef$current : 0;
|
|
104
|
+
var prevPrepared = scrollDirection === 'down' ? rowsBuffer / 2 : rowsBuffer;
|
|
105
|
+
var nextPrepared = scrollDirection === 'up' ? rowsBuffer / 2 : rowsBuffer;
|
|
106
|
+
var startIndex = Math.max(Math.floor(scrollTop / rowHeight) - prevPrepared, 0);
|
|
107
|
+
var lastIndex = Math.min(Math.ceil((scrollTop + offsetHeight) / rowHeight) + nextPrepared, rows.length);
|
|
108
|
+
var rowsToRender = rows.slice(startIndex, lastIndex);
|
|
109
|
+
var rowMarginTop = rowHeight * startIndex;
|
|
110
|
+
var rowMarginBottom = rowHeight * (rows.length - lastIndex);
|
|
111
|
+
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_Context.ListBoxContextProvider, _ref2.cn("ListBoxContextProvider", {}), /*#__PURE__*/_react["default"].createElement(SDropdownMenuList, _ref2.cn("SDropdownMenuList", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
112
|
+
"shadow": true,
|
|
113
|
+
"shadowSize": 16,
|
|
114
|
+
"shadowTheme": 'light',
|
|
115
|
+
"onScroll": this.handleScroll,
|
|
116
|
+
"data-is-virtual": 'true',
|
|
117
|
+
"ref": this.listRef
|
|
118
|
+
}, _ref))), /*#__PURE__*/_react["default"].createElement(_baseComponents.ScrollArea.Container, {
|
|
119
|
+
ref: this.containerRef,
|
|
120
|
+
tabIndex: undefined,
|
|
121
|
+
h: rows.length * rowHeight
|
|
122
|
+
}, /*#__PURE__*/_react["default"].createElement(_baseComponents.Box, _ref2.cn("Box", {
|
|
123
|
+
"h": rowMarginTop
|
|
124
|
+
})), rowsToRender.map(function (item, index) {
|
|
125
|
+
// @ts-ignore
|
|
126
|
+
return /*#__PURE__*/_react["default"].createElement(RenderRow, {
|
|
127
|
+
key: startIndex + index,
|
|
128
|
+
row: item,
|
|
129
|
+
index: startIndex + index,
|
|
130
|
+
data: customData
|
|
131
|
+
});
|
|
132
|
+
}), /*#__PURE__*/_react["default"].createElement(_baseComponents.Box, _ref2.cn("Box", {
|
|
133
|
+
"h": rowMarginBottom
|
|
134
|
+
}))), /*#__PURE__*/_react["default"].createElement(SBar, _ref2.cn("SBar", {
|
|
135
|
+
"orientation": 'horizontal'
|
|
136
|
+
})), /*#__PURE__*/_react["default"].createElement(SBar, _ref2.cn("SBar", {
|
|
137
|
+
"orientation": 'vertical'
|
|
138
|
+
}))));
|
|
139
|
+
}
|
|
140
|
+
}]);
|
|
141
|
+
}(_core.Component);
|
|
142
|
+
(0, _defineProperty2["default"])(VirtualListRoot, "displayName", 'VirtualList');
|
|
143
|
+
(0, _defineProperty2["default"])(VirtualListRoot, "style", style);
|
|
144
|
+
(0, _defineProperty2["default"])(VirtualListRoot, "defaultProps", {
|
|
145
|
+
rowsBuffer: 6
|
|
146
|
+
});
|
|
147
|
+
var VirtualList = exports.VirtualList = (0, _core.createComponent)(VirtualListRoot);
|
|
148
|
+
//# sourceMappingURL=VirtualList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualList.js","names":["_core","require","_baseComponents","_react","_interopRequireDefault","_Context","style","sstyled","insert","VirtualListRoot","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","React","createRef","scrollTop","scrollDirection","e","target","HTMLElement","state","setState","_inherits2","_createClass2","key","value","componentDidMount","_this2","_this$asProps","asProps","index","rowHeight","rowsBuffer","setTimeout","_this2$listRef$curren","_this2$listRef$curren2","_this2$containerRef$c","listHeight","listRef","current","getBoundingClientRect","height","containerRef","scrollTo","top","forceUpdate","render","_ref","_ref2","_this$listRef$current","_this$listRef$current2","SDropdownMenuList","ScrollAreaComponent","SBar","Bar","_this$state","_this$asProps2","rows","styles","RenderRow","renderRow","customData","offsetHeight","prevPrepared","nextPrepared","startIndex","Math","max","floor","lastIndex","min","ceil","rowsToRender","slice","rowMarginTop","rowMarginBottom","createElement","ListBoxContextProvider","cn","_objectSpread2","assignProps","handleScroll","ScrollArea","Container","ref","tabIndex","undefined","h","Box","map","item","row","data","Component","VirtualList","exports","createComponent"],"sources":["../../../src/components/VirtualList.tsx"],"sourcesContent":["import { ScrollArea as ScrollAreaComponent, Box } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport { Root, Component, createComponent, sstyled } from '@semcore/core';\nimport React from 'react';\n\nimport { ListBoxContextProvider } from './Context';\nimport style from '../style/dropdown-menu.shadow.css';\n\nexport type RenderRowProps<T, D = never> = {\n index: number;\n row: T;\n data: [D] extends [never] ? undefined : D;\n};\n\ntype VirtualListProps<T, D extends object = never> = {\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} & ([D] extends [never] ? { customData?: undefined } : {\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 = never> extends Component<VirtualListProps<T, D>, [], Readonly<{}>, { rowsBuffer: number; index: number }, State> {\n static displayName = 'VirtualList';\n static style = style;\n\n static defaultProps = {\n rowsBuffer: 6,\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, rowsBuffer } = 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\n if (index <= rowsBuffer) {\n this.forceUpdate(); // we need this for correct render all items with calculated container height\n }\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 = this.listRef.current?.offsetHeight ?? 0;\n const prevPrepared = scrollDirection === 'down' ? rowsBuffer / 2 : rowsBuffer;\n const nextPrepared = scrollDirection === 'up' ? rowsBuffer / 2 : rowsBuffer;\n\n const startIndex = Math.max(Math.floor(scrollTop / rowHeight) - prevPrepared, 0);\n\n const lastIndex = 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 // @ts-ignore\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 = never,\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":";;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AAAmD;AAAA,IAAAK,KAAA,8BAAAN,KAAA,CAAAO,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IA8B7CC,eAAe,0BAAAC,UAAA;EAAA,SAAAD,gBAAA;IAAA,IAAAE,KAAA;IAAA,IAAAC,gBAAA,mBAAAH,eAAA;IAAA,SAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,OAAAQ,WAAA,mBAAAV,eAAA,KAAAW,MAAA,CAAAJ,IAAA;IAAA,IAAAK,gBAAA,aAAAV,KAA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GrC,MAAA,YAAAkF,aAAA,CAACnF,eAAA,CAAA+F,GAAG,EAAAxC,KAAA,CAAA8B,EAAA;QAAA,KAAIJ;MAAY,EAAG,CAAC,EACvBF,YAAY,CAACiB,GAAG,CAAC,UAACC,IAAI,EAAE5D,KAAK,EAAK;QACjC;QACA,oBAAOpC,MAAA,YAAAkF,aAAA,CAACjB,SAAS;UAACnC,GAAG,EAAEyC,UAAU,GAAGnC,KAAM;UAAC6D,GAAG,EAAED,IAAK;UAAC5D,KAAK,EAAEmC,UAAU,GAAGnC,KAAM;UAAC8D,IAAI,EAAE/B;QAAW,CAAE,CAAC;MACvG,CAAC,CAAC,eACFnE,MAAA,YAAAkF,aAAA,CAACnF,eAAA,CAAA+F,GAAG,EAAAxC,KAAA,CAAA8B,EAAA;QAAA,KAAIH;MAAe,EAAG,CACG,CAAC,eAChCjF,MAAA,YAAAkF,aAAA,CAACvB,IAAI,EAAAL,KAAA,CAAA8B,EAAA;QAAA,eAAa;MAAY,EAAE,CAAC,eACjCpF,MAAA,YAAAkF,aAAA,CAACvB,IAAI,EAAAL,KAAA,CAAA8B,EAAA;QAAA,eAAa;MAAU,EAAE,CACb,CACG,CAAC;IAE7B;EAAC;AAAA,EAtFiEe,eAAS;AAAA,IAAAjF,gBAAA,aAAvEZ,eAAe,iBACE,aAAa;AAAA,IAAAY,gBAAA,aAD9BZ,eAAe,WAEJH,KAAK;AAAA,IAAAe,gBAAA,aAFhBZ,eAAe,kBAIG;EACpBgC,UAAU,EAAE;AACd,CAAC;AA0FI,IAAM8D,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,qBAAe,EAAChG,eAAe,CAAyB","ignoreList":[]}
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { Box, BoxProps, FlexProps, Flex, eventInteraction, ScrollAreaProps } from '@semcore/base-components';\nimport type { PropGetterFn, 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 { Text } from '@semcore/typography';\n\nimport type { VirtualList, RenderRowProps } from './components/VirtualList';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\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\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\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 * 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\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\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 Group: typeof Dropdown.Group;\n\n VirtualList: typeof VirtualList;\n\n selectedIndexContext: React.Context<number>;\n nestedMenuInteraction: eventInteraction;\n};\n\nexport default DropdownMenu;\n\nexport {\n RenderRowProps,\n};\n"],"mappings":"","ignoreList":[]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_DropdownMenu","_interopRequireDefault","require"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './DropdownMenu';\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_DropdownMenu","_interopRequireDefault","require"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './DropdownMenu';\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -6,92 +6,32 @@ SDropdownMenuList {
|
|
|
6
6
|
min-width: 32px;
|
|
7
7
|
box-sizing: content-box;
|
|
8
8
|
z-index: 0;
|
|
9
|
-
color: var(--intergalactic-text-primary,
|
|
9
|
+
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
&:after {
|
|
14
|
-
width: 16px;
|
|
15
|
-
height: 100%;
|
|
16
|
-
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
SShadowHorizontal[position='median'] {
|
|
21
|
-
&:before {
|
|
22
|
-
background: var(
|
|
23
|
-
--intergalactic-scroll-area-dropdown-menu-left,
|
|
24
|
-
linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&:after {
|
|
29
|
-
background: var(
|
|
30
|
-
--intergalactic-scroll-area-dropdown-menu-right,
|
|
31
|
-
linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
32
|
-
);
|
|
33
|
-
}
|
|
11
|
+
SBar {
|
|
12
|
+
z-index: 3;
|
|
34
13
|
}
|
|
35
14
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
15
|
+
&:not(&:has([data-ui-name="DropdownMenu.Group"][data-sticky="true"])) {
|
|
16
|
+
SShadowHorizontal {
|
|
17
|
+
&:before,
|
|
18
|
+
&:after {
|
|
19
|
+
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
20
|
+
}
|
|
42
21
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
SShadowHorizontal[position='end'] {
|
|
46
|
-
&:after {
|
|
47
|
-
background: var(
|
|
48
|
-
--intergalactic-scroll-area-dropdown-menu-right,
|
|
49
|
-
linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
22
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
SShadowVertical[position='median'] {
|
|
64
|
-
&:before {
|
|
65
|
-
background: var(
|
|
66
|
-
--intergalactic-scroll-area-dropdown-menu-top,
|
|
67
|
-
linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&:after {
|
|
72
|
-
background: var(
|
|
73
|
-
--intergalactic-scroll-area-dropdown-menu-bottom,
|
|
74
|
-
linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
SShadowVertical[position='start'] {
|
|
80
|
-
&:before {
|
|
81
|
-
background: var(
|
|
82
|
-
--intergalactic-scroll-area-dropdown-menu-top,
|
|
83
|
-
linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
84
|
-
);
|
|
23
|
+
SShadowVertical {
|
|
24
|
+
&:before,
|
|
25
|
+
&:after {
|
|
26
|
+
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
27
|
+
}
|
|
85
28
|
}
|
|
86
29
|
}
|
|
30
|
+
}
|
|
87
31
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
--intergalactic-scroll-area-dropdown-menu-bottom,
|
|
92
|
-
linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
93
|
-
);
|
|
94
|
-
}
|
|
32
|
+
SDropdownMenuItemContainer {
|
|
33
|
+
SItemContent:focus-visible {
|
|
34
|
+
outline: none;
|
|
95
35
|
}
|
|
96
36
|
}
|
|
97
37
|
|
|
@@ -99,8 +39,9 @@ SDropdownMenuItemContainer[nesting-trigger] {
|
|
|
99
39
|
justify-content: space-between;
|
|
100
40
|
}
|
|
101
41
|
|
|
102
|
-
SDropdownMenuItemAddon,
|
|
103
|
-
|
|
42
|
+
SDropdownMenuItemAddon,
|
|
43
|
+
SItemContentText {
|
|
44
|
+
display: inline-flex; /* todo: Brauer Ilia - why? should be changed to inline/inline-block for SItemContentText */
|
|
104
45
|
margin-left: var(--intergalactic-spacing-1x, 4px);
|
|
105
46
|
margin-right: var(--intergalactic-spacing-1x, 4px);
|
|
106
47
|
|
|
@@ -121,7 +62,7 @@ SDropdownMenuNesting[size='m'] {
|
|
|
121
62
|
|
|
122
63
|
SDropdownMenuNesting[highlighted] {
|
|
123
64
|
z-index: 1;
|
|
124
|
-
|
|
65
|
+
@mixin focus-outline-mixin -2px;
|
|
125
66
|
}
|
|
126
67
|
|
|
127
68
|
SDropdownNestingItem[size='l'],
|
|
@@ -137,10 +78,12 @@ SDropdownNestingItem SDropdownMenuItemContainer {
|
|
|
137
78
|
min-height: auto;
|
|
138
79
|
}
|
|
139
80
|
|
|
140
|
-
|
|
141
|
-
|
|
81
|
+
SItemHint {
|
|
82
|
+
color: var(--intergalactic-text-secondary, oklch(0.088 0.026 147.7 / 0.583));
|
|
142
83
|
}
|
|
143
84
|
|
|
144
|
-
|
|
145
|
-
|
|
85
|
+
SScrollContainer {
|
|
86
|
+
&:has([data-ui-name="DropdownMenu.Group"][data-sticky="true"]) {
|
|
87
|
+
overscroll-behavior: none;
|
|
88
|
+
}
|
|
146
89
|
}
|