1 line
29 KiB
JSON
1 line
29 KiB
JSON
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { getFocusNodeList } from \"rc-util/es/Dom/focus\";\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport raf from \"rc-util/es/raf\";\nimport * as React from 'react';\nimport { getMenuId } from \"../context/IdContext\";\n// destruct to reduce minify size\nvar LEFT = KeyCode.LEFT,\n RIGHT = KeyCode.RIGHT,\n UP = KeyCode.UP,\n DOWN = KeyCode.DOWN,\n ENTER = KeyCode.ENTER,\n ESC = KeyCode.ESC,\n HOME = KeyCode.HOME,\n END = KeyCode.END;\nvar ArrowKeys = [UP, DOWN, LEFT, RIGHT];\nfunction getOffset(mode, isRootLevel, isRtl, which) {\n var _inline, _horizontal, _vertical, _offsets;\n var prev = 'prev';\n var next = 'next';\n var children = 'children';\n var parent = 'parent';\n\n // Inline enter is special that we use unique operation\n if (mode === 'inline' && which === ENTER) {\n return {\n inlineTrigger: true\n };\n }\n var inline = (_inline = {}, _defineProperty(_inline, UP, prev), _defineProperty(_inline, DOWN, next), _inline);\n var horizontal = (_horizontal = {}, _defineProperty(_horizontal, LEFT, isRtl ? next : prev), _defineProperty(_horizontal, RIGHT, isRtl ? prev : next), _defineProperty(_horizontal, DOWN, children), _defineProperty(_horizontal, ENTER, children), _horizontal);\n var vertical = (_vertical = {}, _defineProperty(_vertical, UP, prev), _defineProperty(_vertical, DOWN, next), _defineProperty(_vertical, ENTER, children), _defineProperty(_vertical, ESC, parent), _defineProperty(_vertical, LEFT, isRtl ? children : parent), _defineProperty(_vertical, RIGHT, isRtl ? parent : children), _vertical);\n var offsets = {\n inline: inline,\n horizontal: horizontal,\n vertical: vertical,\n inlineSub: inline,\n horizontalSub: vertical,\n verticalSub: vertical\n };\n var type = (_offsets = offsets[\"\".concat(mode).concat(isRootLevel ? '' : 'Sub')]) === null || _offsets === void 0 ? void 0 : _offsets[which];\n switch (type) {\n case prev:\n return {\n offset: -1,\n sibling: true\n };\n case next:\n return {\n offset: 1,\n sibling: true\n };\n case parent:\n return {\n offset: -1,\n sibling: false\n };\n case children:\n return {\n offset: 1,\n sibling: false\n };\n default:\n return null;\n }\n}\nfunction findContainerUL(element) {\n var current = element;\n while (current) {\n if (current.getAttribute('data-menu-list')) {\n return current;\n }\n current = current.parentElement;\n }\n\n // Normally should not reach this line\n /* istanbul ignore next */\n return null;\n}\n\n/**\n * Find focused element within element set provided\n */\nfunction getFocusElement(activeElement, elements) {\n var current = activeElement || document.activeElement;\n while (current) {\n if (elements.has(current)) {\n return current;\n }\n current = current.parentElement;\n }\n return null;\n}\n\n/**\n * Get focusable elements from the element set under provided container\n */\nexport function getFocusableElements(container, elements) {\n var list = getFocusNodeList(container, true);\n return list.filter(function (ele) {\n return elements.has(ele);\n });\n}\nfunction getNextFocusElement(parentQueryContainer, elements, focusMenuElement) {\n var offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n // Key on the menu item will not get validate parent container\n if (!parentQueryContainer) {\n return null;\n }\n\n // List current level menu item elements\n var sameLevelFocusableMenuElementList = getFocusableElements(parentQueryContainer, elements);\n\n // Find next focus index\n var count = sameLevelFocusableMenuElementList.length;\n var focusIndex = sameLevelFocusableMenuElementList.findIndex(function (ele) {\n return focusMenuElement === ele;\n });\n if (offset < 0) {\n if (focusIndex === -1) {\n focusIndex = count - 1;\n } else {\n focusIndex -= 1;\n }\n } else if (offset > 0) {\n focusIndex += 1;\n }\n focusIndex = (focusIndex + count) % count;\n\n // Focus menu item\n return sameLevelFocusableMenuElementList[focusIndex];\n}\nexport var refreshElements = function refreshElements(keys, id) {\n var elements = new Set();\n var key2element = new Map();\n var element2key = new Map();\n keys.forEach(function (key) {\n var element = document.querySelector(\"[data-menu-id='\".concat(getMenuId(id, key), \"']\"));\n if (element) {\n elements.add(element);\n element2key.set(element, key);\n key2element.set(key, element);\n }\n });\n return {\n elements: elements,\n key2element: key2element,\n element2key: element2key\n };\n};\nexport function useAccessibility(mode, activeKey, isRtl, id, containerRef, getKeys, getKeyPath, triggerActiveKey, triggerAccessibilityOpen, originOnKeyDown) {\n var rafRef = React.useRef();\n var activeRef = React.useRef();\n activeRef.current = activeKey;\n var cleanRaf = function cleanRaf() {\n raf.cancel(rafRef.current);\n };\n React.useEffect(function () {\n return function () {\n cleanRaf();\n };\n }, []);\n return function (e) {\n var which = e.which;\n if ([].concat(ArrowKeys, [ENTER, ESC, HOME, END]).includes(which)) {\n var keys = getKeys();\n var refreshedElements = refreshElements(keys, id);\n var _refreshedElements = refreshedElements,\n elements = _refreshedElements.elements,\n key2element = _refreshedElements.key2element,\n element2key = _refreshedElements.element2key;\n\n // First we should find current focused MenuItem/SubMenu element\n var activeElement = key2element.get(activeKey);\n var focusMenuElement = getFocusElement(activeElement, elements);\n var focusMenuKey = element2key.get(focusMenuElement);\n var offsetObj = getOffset(mode, getKeyPath(focusMenuKey, true).length === 1, isRtl, which);\n\n // Some mode do not have fully arrow operation like inline\n if (!offsetObj && which !== HOME && which !== END) {\n return;\n }\n\n // Arrow prevent default to avoid page scroll\n if (ArrowKeys.includes(which) || [HOME, END].includes(which)) {\n e.preventDefault();\n }\n var tryFocus = function tryFocus(menuElement) {\n if (menuElement) {\n var focusTargetElement = menuElement;\n\n // Focus to link instead of menu item if possible\n var link = menuElement.querySelector('a');\n if (link !== null && link !== void 0 && link.getAttribute('href')) {\n focusTargetElement = link;\n }\n var targetKey = element2key.get(menuElement);\n triggerActiveKey(targetKey);\n\n /**\n * Do not `useEffect` here since `tryFocus` may trigger async\n * which makes React sync update the `activeKey`\n * that force render before `useRef` set the next activeKey\n */\n cleanRaf();\n rafRef.current = raf(function () {\n if (activeRef.current === targetKey) {\n focusTargetElement.focus();\n }\n });\n }\n };\n if ([HOME, END].includes(which) || offsetObj.sibling || !focusMenuElement) {\n // ========================== Sibling ==========================\n // Find walkable focus menu element container\n var parentQueryContainer;\n if (!focusMenuElement || mode === 'inline') {\n parentQueryContainer = containerRef.current;\n } else {\n parentQueryContainer = findContainerUL(focusMenuElement);\n }\n\n // Get next focus element\n var targetElement;\n var focusableElements = getFocusableElements(parentQueryContainer, elements);\n if (which === HOME) {\n targetElement = focusableElements[0];\n } else if (which === END) {\n targetElement = focusableElements[focusableElements.length - 1];\n } else {\n targetElement = getNextFocusElement(parentQueryContainer, elements, focusMenuElement, offsetObj.offset);\n }\n // Focus menu item\n tryFocus(targetElement);\n\n // ======================= InlineTrigger =======================\n } else if (offsetObj.inlineTrigger) {\n // Inline trigger no need switch to sub menu item\n triggerAccessibilityOpen(focusMenuKey);\n // =========================== Level ===========================\n } else if (offsetObj.offset > 0) {\n triggerAccessibilityOpen(focusMenuKey, true);\n cleanRaf();\n rafRef.current = raf(function () {\n // Async should resync elements\n refreshedElements = refreshElements(keys, id);\n var controlId = focusMenuElement.getAttribute('aria-controls');\n var subQueryContainer = document.getElementById(controlId);\n\n // Get sub focusable menu item\n var targetElement = getNextFocusElement(subQueryContainer, refreshedElements.elements);\n\n // Focus menu item\n tryFocus(targetElement);\n }, 5);\n } else if (offsetObj.offset < 0) {\n var keyPath = getKeyPath(focusMenuKey, true);\n var parentKey = keyPath[keyPath.length - 2];\n var parentMenuElement = key2element.get(parentKey);\n\n // Focus menu item\n triggerAccessibilityOpen(parentKey, false);\n tryFocus(parentMenuElement);\n }\n }\n\n // Pass origin key down event\n originOnKeyDown === null || originOnKeyDown === void 0 ? void 0 : originOnKeyDown(e);\n };\n}","map":{"version":3,"names":["_defineProperty","getFocusNodeList","KeyCode","raf","React","getMenuId","LEFT","RIGHT","UP","DOWN","ENTER","ESC","HOME","END","ArrowKeys","getOffset","mode","isRootLevel","isRtl","which","_inline","_horizontal","_vertical","_offsets","prev","next","children","parent","inlineTrigger","inline","horizontal","vertical","offsets","inlineSub","horizontalSub","verticalSub","type","concat","offset","sibling","findContainerUL","element","current","getAttribute","parentElement","getFocusElement","activeElement","elements","document","has","getFocusableElements","container","list","filter","ele","getNextFocusElement","parentQueryContainer","focusMenuElement","arguments","length","undefined","sameLevelFocusableMenuElementList","count","focusIndex","findIndex","refreshElements","keys","id","Set","key2element","Map","element2key","forEach","key","querySelector","add","set","useAccessibility","activeKey","containerRef","getKeys","getKeyPath","triggerActiveKey","triggerAccessibilityOpen","originOnKeyDown","rafRef","useRef","activeRef","cleanRaf","cancel","useEffect","e","includes","refreshedElements","_refreshedElements","get","focusMenuKey","offsetObj","preventDefault","tryFocus","menuElement","focusTargetElement","link","targetKey","focus","targetElement","focusableElements","controlId","subQueryContainer","getElementById","keyPath","parentKey","parentMenuElement"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-menu/es/hooks/useAccessibility.js"],"sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { getFocusNodeList } from \"rc-util/es/Dom/focus\";\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport raf from \"rc-util/es/raf\";\nimport * as React from 'react';\nimport { getMenuId } from \"../context/IdContext\";\n// destruct to reduce minify size\nvar LEFT = KeyCode.LEFT,\n RIGHT = KeyCode.RIGHT,\n UP = KeyCode.UP,\n DOWN = KeyCode.DOWN,\n ENTER = KeyCode.ENTER,\n ESC = KeyCode.ESC,\n HOME = KeyCode.HOME,\n END = KeyCode.END;\nvar ArrowKeys = [UP, DOWN, LEFT, RIGHT];\nfunction getOffset(mode, isRootLevel, isRtl, which) {\n var _inline, _horizontal, _vertical, _offsets;\n var prev = 'prev';\n var next = 'next';\n var children = 'children';\n var parent = 'parent';\n\n // Inline enter is special that we use unique operation\n if (mode === 'inline' && which === ENTER) {\n return {\n inlineTrigger: true\n };\n }\n var inline = (_inline = {}, _defineProperty(_inline, UP, prev), _defineProperty(_inline, DOWN, next), _inline);\n var horizontal = (_horizontal = {}, _defineProperty(_horizontal, LEFT, isRtl ? next : prev), _defineProperty(_horizontal, RIGHT, isRtl ? prev : next), _defineProperty(_horizontal, DOWN, children), _defineProperty(_horizontal, ENTER, children), _horizontal);\n var vertical = (_vertical = {}, _defineProperty(_vertical, UP, prev), _defineProperty(_vertical, DOWN, next), _defineProperty(_vertical, ENTER, children), _defineProperty(_vertical, ESC, parent), _defineProperty(_vertical, LEFT, isRtl ? children : parent), _defineProperty(_vertical, RIGHT, isRtl ? parent : children), _vertical);\n var offsets = {\n inline: inline,\n horizontal: horizontal,\n vertical: vertical,\n inlineSub: inline,\n horizontalSub: vertical,\n verticalSub: vertical\n };\n var type = (_offsets = offsets[\"\".concat(mode).concat(isRootLevel ? '' : 'Sub')]) === null || _offsets === void 0 ? void 0 : _offsets[which];\n switch (type) {\n case prev:\n return {\n offset: -1,\n sibling: true\n };\n case next:\n return {\n offset: 1,\n sibling: true\n };\n case parent:\n return {\n offset: -1,\n sibling: false\n };\n case children:\n return {\n offset: 1,\n sibling: false\n };\n default:\n return null;\n }\n}\nfunction findContainerUL(element) {\n var current = element;\n while (current) {\n if (current.getAttribute('data-menu-list')) {\n return current;\n }\n current = current.parentElement;\n }\n\n // Normally should not reach this line\n /* istanbul ignore next */\n return null;\n}\n\n/**\n * Find focused element within element set provided\n */\nfunction getFocusElement(activeElement, elements) {\n var current = activeElement || document.activeElement;\n while (current) {\n if (elements.has(current)) {\n return current;\n }\n current = current.parentElement;\n }\n return null;\n}\n\n/**\n * Get focusable elements from the element set under provided container\n */\nexport function getFocusableElements(container, elements) {\n var list = getFocusNodeList(container, true);\n return list.filter(function (ele) {\n return elements.has(ele);\n });\n}\nfunction getNextFocusElement(parentQueryContainer, elements, focusMenuElement) {\n var offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n // Key on the menu item will not get validate parent container\n if (!parentQueryContainer) {\n return null;\n }\n\n // List current level menu item elements\n var sameLevelFocusableMenuElementList = getFocusableElements(parentQueryContainer, elements);\n\n // Find next focus index\n var count = sameLevelFocusableMenuElementList.length;\n var focusIndex = sameLevelFocusableMenuElementList.findIndex(function (ele) {\n return focusMenuElement === ele;\n });\n if (offset < 0) {\n if (focusIndex === -1) {\n focusIndex = count - 1;\n } else {\n focusIndex -= 1;\n }\n } else if (offset > 0) {\n focusIndex += 1;\n }\n focusIndex = (focusIndex + count) % count;\n\n // Focus menu item\n return sameLevelFocusableMenuElementList[focusIndex];\n}\nexport var refreshElements = function refreshElements(keys, id) {\n var elements = new Set();\n var key2element = new Map();\n var element2key = new Map();\n keys.forEach(function (key) {\n var element = document.querySelector(\"[data-menu-id='\".concat(getMenuId(id, key), \"']\"));\n if (element) {\n elements.add(element);\n element2key.set(element, key);\n key2element.set(key, element);\n }\n });\n return {\n elements: elements,\n key2element: key2element,\n element2key: element2key\n };\n};\nexport function useAccessibility(mode, activeKey, isRtl, id, containerRef, getKeys, getKeyPath, triggerActiveKey, triggerAccessibilityOpen, originOnKeyDown) {\n var rafRef = React.useRef();\n var activeRef = React.useRef();\n activeRef.current = activeKey;\n var cleanRaf = function cleanRaf() {\n raf.cancel(rafRef.current);\n };\n React.useEffect(function () {\n return function () {\n cleanRaf();\n };\n }, []);\n return function (e) {\n var which = e.which;\n if ([].concat(ArrowKeys, [ENTER, ESC, HOME, END]).includes(which)) {\n var keys = getKeys();\n var refreshedElements = refreshElements(keys, id);\n var _refreshedElements = refreshedElements,\n elements = _refreshedElements.elements,\n key2element = _refreshedElements.key2element,\n element2key = _refreshedElements.element2key;\n\n // First we should find current focused MenuItem/SubMenu element\n var activeElement = key2element.get(activeKey);\n var focusMenuElement = getFocusElement(activeElement, elements);\n var focusMenuKey = element2key.get(focusMenuElement);\n var offsetObj = getOffset(mode, getKeyPath(focusMenuKey, true).length === 1, isRtl, which);\n\n // Some mode do not have fully arrow operation like inline\n if (!offsetObj && which !== HOME && which !== END) {\n return;\n }\n\n // Arrow prevent default to avoid page scroll\n if (ArrowKeys.includes(which) || [HOME, END].includes(which)) {\n e.preventDefault();\n }\n var tryFocus = function tryFocus(menuElement) {\n if (menuElement) {\n var focusTargetElement = menuElement;\n\n // Focus to link instead of menu item if possible\n var link = menuElement.querySelector('a');\n if (link !== null && link !== void 0 && link.getAttribute('href')) {\n focusTargetElement = link;\n }\n var targetKey = element2key.get(menuElement);\n triggerActiveKey(targetKey);\n\n /**\n * Do not `useEffect` here since `tryFocus` may trigger async\n * which makes React sync update the `activeKey`\n * that force render before `useRef` set the next activeKey\n */\n cleanRaf();\n rafRef.current = raf(function () {\n if (activeRef.current === targetKey) {\n focusTargetElement.focus();\n }\n });\n }\n };\n if ([HOME, END].includes(which) || offsetObj.sibling || !focusMenuElement) {\n // ========================== Sibling ==========================\n // Find walkable focus menu element container\n var parentQueryContainer;\n if (!focusMenuElement || mode === 'inline') {\n parentQueryContainer = containerRef.current;\n } else {\n parentQueryContainer = findContainerUL(focusMenuElement);\n }\n\n // Get next focus element\n var targetElement;\n var focusableElements = getFocusableElements(parentQueryContainer, elements);\n if (which === HOME) {\n targetElement = focusableElements[0];\n } else if (which === END) {\n targetElement = focusableElements[focusableElements.length - 1];\n } else {\n targetElement = getNextFocusElement(parentQueryContainer, elements, focusMenuElement, offsetObj.offset);\n }\n // Focus menu item\n tryFocus(targetElement);\n\n // ======================= InlineTrigger =======================\n } else if (offsetObj.inlineTrigger) {\n // Inline trigger no need switch to sub menu item\n triggerAccessibilityOpen(focusMenuKey);\n // =========================== Level ===========================\n } else if (offsetObj.offset > 0) {\n triggerAccessibilityOpen(focusMenuKey, true);\n cleanRaf();\n rafRef.current = raf(function () {\n // Async should resync elements\n refreshedElements = refreshElements(keys, id);\n var controlId = focusMenuElement.getAttribute('aria-controls');\n var subQueryContainer = document.getElementById(controlId);\n\n // Get sub focusable menu item\n var targetElement = getNextFocusElement(subQueryContainer, refreshedElements.elements);\n\n // Focus menu item\n tryFocus(targetElement);\n }, 5);\n } else if (offsetObj.offset < 0) {\n var keyPath = getKeyPath(focusMenuKey, true);\n var parentKey = keyPath[keyPath.length - 2];\n var parentMenuElement = key2element.get(parentKey);\n\n // Focus menu item\n triggerAccessibilityOpen(parentKey, false);\n tryFocus(parentMenuElement);\n }\n }\n\n // Pass origin key down event\n originOnKeyDown === null || originOnKeyDown === void 0 ? void 0 : originO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