You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Scripted/website/node_modules/.cache/babel-loader/a8ee9bd10a8c01ba97817910047...

1 line
7.5 KiB

{"ast":null,"code":"const _excluded = [\"eventKey\", \"disabled\", \"onClick\", \"active\", \"as\"];\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport useEventCallback from '@restart/hooks/useEventCallback';\nimport SelectableContext, { makeEventKey } from './SelectableContext';\nimport NavContext from './NavContext';\nimport Button from './Button';\nimport { dataAttr } from './DataKey';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\n/**\n * Create a dropdown item. Returns a set of props for the dropdown item component\n * including an `onClick` handler that prevents selection when the item is disabled\n */\nexport function useDropdownItem(_ref2) {\n let {\n key,\n href,\n active,\n disabled,\n onClick\n } = _ref2;\n const onSelectCtx = useContext(SelectableContext);\n const navContext = useContext(NavContext);\n const {\n activeKey\n } = navContext || {};\n const eventKey = makeEventKey(key, href);\n const isActive = active == null && key != null ? makeEventKey(activeKey) === eventKey : active;\n const handleClick = useEventCallback(event => {\n if (disabled) return;\n onClick == null ? void 0 : onClick(event);\n if (onSelectCtx && !event.isPropagationStopped()) {\n onSelectCtx(eventKey, event);\n }\n });\n return [{\n onClick: handleClick,\n 'aria-disabled': disabled || undefined,\n 'aria-selected': isActive,\n [dataAttr('dropdown-item')]: ''\n }, {\n isActive\n }];\n}\nconst DropdownItem = /*#__PURE__*/React.forwardRef((_ref, ref) => {\n let {\n eventKey,\n disabled,\n onClick,\n active,\n as: Component = Button\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n const [dropdownItemProps] = useDropdownItem({\n key: eventKey,\n href: props.href,\n disabled,\n onClick,\n active\n });\n return /*#__PURE__*/_jsx(Component, Object.assign({}, props, {\n ref: ref\n }, dropdownItemProps));\n});\nDropdownItem.displayName = 'DropdownItem';\nexport default DropdownItem;","map":{"version":3,"names":["_excluded","_objectWithoutPropertiesLoose","source","excluded","target","sourceKeys","Object","keys","key","i","length","indexOf","React","useContext","useEventCallback","SelectableContext","makeEventKey","NavContext","Button","dataAttr","jsx","_jsx","useDropdownItem","href","active","disabled","onClick","onSelectCtx","navContext","activeKey","eventKey","isActive","handleClick","event","isPropagationStopped","undefined","DropdownItem","forwardRef","_ref","ref","as","Component","props","dropdownItemProps","assign","displayName"],"sources":["C:/Cours/SAE/SAE-3.01/Scripted/Scripted/website/node_modules/@restart/ui/esm/DropdownItem.js"],"sourcesContent":["const _excluded = [\"eventKey\", \"disabled\", \"onClick\", \"active\", \"as\"];\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport useEventCallback from '@restart/hooks/useEventCallback';\nimport SelectableContext, { makeEventKey } from './SelectableContext';\nimport NavContext from './NavContext';\nimport Button from './Button';\nimport { dataAttr } from './DataKey';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\n/**\n * Create a dropdown item. Returns a set of props for the dropdown item component\n * including an `onClick` handler that prevents selection when the item is disabled\n */\nexport function useDropdownItem({\n key,\n href,\n active,\n disabled,\n onClick\n}) {\n const onSelectCtx = useContext(SelectableContext);\n const navContext = useContext(NavContext);\n const {\n activeKey\n } = navContext || {};\n const eventKey = makeEventKey(key, href);\n const isActive = active == null && key != null ? makeEventKey(activeKey) === eventKey : active;\n const handleClick = useEventCallback(event => {\n if (disabled) return;\n onClick == null ? void 0 : onClick(event);\n\n if (onSelectCtx && !event.isPropagationStopped()) {\n onSelectCtx(eventKey, event);\n }\n });\n return [{\n onClick: handleClick,\n 'aria-disabled': disabled || undefined,\n 'aria-selected': isActive,\n [dataAttr('dropdown-item')]: ''\n }, {\n isActive\n }];\n}\nconst DropdownItem = /*#__PURE__*/React.forwardRef((_ref, ref) => {\n let {\n eventKey,\n disabled,\n onClick,\n active,\n as: Component = Button\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n\n const [dropdownItemProps] = useDropdownItem({\n key: eventKey,\n href: props.href,\n disabled,\n onClick,\n active\n });\n return /*#__PURE__*/_jsx(Component, Object.assign({}, props, {\n ref: ref\n }, dropdownItemProps));\n});\nDropdownItem.displayName = 'DropdownItem';\nexport default DropdownItem;"],"mappings":"AAAA,MAAMA,SAAS,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC;AAErE,SAASC,6BAA6B,CAACC,MAAM,EAAEC,QAAQ,EAAE;EAAE,IAAID,MAAM,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;EAAE,IAAIE,MAAM,GAAG,CAAC,CAAC;EAAE,IAAIC,UAAU,GAAGC,MAAM,CAACC,IAAI,CAACL,MAAM,CAAC;EAAE,IAAIM,GAAG,EAAEC,CAAC;EAAE,KAAKA,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,UAAU,CAACK,MAAM,EAAED,CAAC,EAAE,EAAE;IAAED,GAAG,GAAGH,UAAU,CAACI,CAAC,CAAC;IAAE,IAAIN,QAAQ,CAACQ,OAAO,CAACH,GAAG,CAAC,IAAI,CAAC,EAAE;IAAUJ,MAAM,CAACI,GAAG,CAAC,GAAGN,MAAM,CAACM,GAAG,CAAC;EAAE;EAAE,OAAOJ,MAAM;AAAE;AAElT,OAAO,KAAKQ,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,QAAQ,OAAO;AAClC,OAAOC,gBAAgB,MAAM,iCAAiC;AAC9D,OAAOC,iBAAiB,IAAIC,YAAY,QAAQ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