Files
ETB/ETB-FrontEnd/node_modules/.cache/babel-loader/aa595d64e3b65b59129303a76e85e0d4db6ae7b084f5de722db09fa09615febd.json
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

1 line
13 KiB
JSON

{"ast":null,"code":"'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useTabsContext } from '../Tabs';\nimport { TabsListActionTypes } from './useTabsList.types';\nimport { useCompoundParent } from '../useCompound';\nimport { useList } from '../useList';\nimport { tabsListReducer } from './tabsListReducer';\n\n/**\n *\n * Demos:\n *\n * - [Tabs](https://mui.com/base-ui/react-tabs/#hooks)\n *\n * API:\n *\n * - [useTabsList API](https://mui.com/base-ui/react-tabs/hooks-api/#use-tabs-list)\n */\nfunction useTabsList(parameters) {\n var _selectedValues$;\n const {\n rootRef: externalRef\n } = parameters;\n const {\n direction = 'ltr',\n onSelected,\n orientation = 'horizontal',\n value,\n registerTabIdLookup,\n selectionFollowsFocus\n } = useTabsContext();\n const {\n subitems,\n contextValue: compoundComponentContextValue\n } = useCompoundParent();\n const tabIdLookup = React.useCallback(tabValue => {\n var _subitems$get;\n return (_subitems$get = subitems.get(tabValue)) == null ? void 0 : _subitems$get.id;\n }, [subitems]);\n registerTabIdLookup(tabIdLookup);\n const subitemKeys = React.useMemo(() => Array.from(subitems.keys()), [subitems]);\n const getTabElement = React.useCallback(tabValue => {\n var _subitems$get$ref$cur, _subitems$get2;\n if (tabValue == null) {\n return null;\n }\n return (_subitems$get$ref$cur = (_subitems$get2 = subitems.get(tabValue)) == null ? void 0 : _subitems$get2.ref.current) != null ? _subitems$get$ref$cur : null;\n }, [subitems]);\n const isRtl = direction === 'rtl';\n let listOrientation;\n if (orientation === 'vertical') {\n listOrientation = 'vertical';\n } else {\n listOrientation = isRtl ? 'horizontal-rtl' : 'horizontal-ltr';\n }\n const handleChange = React.useCallback((event, newValue) => {\n var _newValue$;\n onSelected(event, (_newValue$ = newValue[0]) != null ? _newValue$ : null);\n }, [onSelected]);\n const controlledProps = React.useMemo(() => {\n if (value === undefined) {\n return {};\n }\n return value != null ? {\n selectedValues: [value]\n } : {\n selectedValues: []\n };\n }, [value]);\n const isItemDisabled = React.useCallback(item => {\n var _subitems$get$disable, _subitems$get3;\n return (_subitems$get$disable = (_subitems$get3 = subitems.get(item)) == null ? void 0 : _subitems$get3.disabled) != null ? _subitems$get$disable : false;\n }, [subitems]);\n const {\n contextValue: listContextValue,\n dispatch,\n getRootProps: getListboxRootProps,\n state: {\n highlightedValue,\n selectedValues\n },\n rootRef: mergedRootRef\n } = useList({\n controlledProps,\n disabledItemsFocusable: !selectionFollowsFocus,\n focusManagement: 'DOM',\n getItemDomElement: getTabElement,\n isItemDisabled,\n items: subitemKeys,\n rootRef: externalRef,\n onChange: handleChange,\n orientation: listOrientation,\n reducerActionContext: React.useMemo(() => ({\n selectionFollowsFocus: selectionFollowsFocus || false\n }), [selectionFollowsFocus]),\n selectionMode: 'single',\n stateReducer: tabsListReducer\n });\n React.useEffect(() => {\n if (value === undefined) {\n return;\n }\n\n // when a value changes externally, the highlighted value should be synced to it\n if (value != null) {\n dispatch({\n type: TabsListActionTypes.valueChange,\n value\n });\n }\n }, [dispatch, value]);\n const getRootProps = (externalProps = {}) => {\n return _extends({}, externalProps, getListboxRootProps(externalProps), {\n 'aria-orientation': orientation === 'vertical' ? 'vertical' : undefined,\n role: 'tablist'\n });\n };\n const contextValue = React.useMemo(() => _extends({}, compoundComponentContextValue, listContextValue), [compoundComponentContextValue, listContextValue]);\n return {\n contextValue,\n dispatch,\n getRootProps,\n highlightedValue,\n isRtl,\n orientation,\n rootRef: mergedRootRef,\n selectedValue: (_selectedValues$ = selectedValues[0]) != null ? _selectedValues$ : null\n };\n}\nexport { useTabsList };","map":{"version":3,"names":["_extends","React","useTabsContext","TabsListActionTypes","useCompoundParent","useList","tabsListReducer","useTabsList","parameters","_selectedValues$","rootRef","externalRef","direction","onSelected","orientation","value","registerTabIdLookup","selectionFollowsFocus","subitems","contextValue","compoundComponentContextValue","tabIdLookup","useCallback","tabValue","_subitems$get","get","id","subitemKeys","useMemo","Array","from","keys","getTabElement","_subitems$get$ref$cur","_subitems$get2","ref","current","isRtl","listOrientation","handleChange","event","newValue","_newValue$","controlledProps","undefined","selectedValues","isItemDisabled","item","_subitems$get$disable","_subitems$get3","disabled","listContextValue","dispatch","getRootProps","getListboxRootProps","state","highlightedValue","mergedRootRef","disabledItemsFocusable","focusManagement","getItemDomElement","items","onChange","reducerActionContext","selectionMode","stateReducer","useEffect","type","valueChange","externalProps","role","selectedValue"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/base/useTabsList/useTabsList.js"],"sourcesContent":["'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useTabsContext } from '../Tabs';\nimport { TabsListActionTypes } from './useTabsList.types';\nimport { useCompoundParent } from '../useCompound';\nimport { useList } from '../useList';\nimport { tabsListReducer } from './tabsListReducer';\n\n/**\n *\n * Demos:\n *\n * - [Tabs](https://mui.com/base-ui/react-tabs/#hooks)\n *\n * API:\n *\n * - [useTabsList API](https://mui.com/base-ui/react-tabs/hooks-api/#use-tabs-list)\n */\nfunction useTabsList(parameters) {\n var _selectedValues$;\n const {\n rootRef: externalRef\n } = parameters;\n const {\n direction = 'ltr',\n onSelected,\n orientation = 'horizontal',\n value,\n registerTabIdLookup,\n selectionFollowsFocus\n } = useTabsContext();\n const {\n subitems,\n contextValue: compoundComponentContextValue\n } = useCompoundParent();\n const tabIdLookup = React.useCallback(tabValue => {\n var _subitems$get;\n return (_subitems$get = subitems.get(tabValue)) == null ? void 0 : _subitems$get.id;\n }, [subitems]);\n registerTabIdLookup(tabIdLookup);\n const subitemKeys = React.useMemo(() => Array.from(subitems.keys()), [subitems]);\n const getTabElement = React.useCallback(tabValue => {\n var _subitems$get$ref$cur, _subitems$get2;\n if (tabValue == null) {\n return null;\n }\n return (_subitems$get$ref$cur = (_subitems$get2 = subitems.get(tabValue)) == null ? void 0 : _subitems$get2.ref.current) != null ? _subitems$get$ref$cur : null;\n }, [subitems]);\n const isRtl = direction === 'rtl';\n let listOrientation;\n if (orientation === 'vertical') {\n listOrientation = 'vertical';\n } else {\n listOrientation = isRtl ? 'horizontal-rtl' : 'horizontal-ltr';\n }\n const handleChange = React.useCallback((event, newValue) => {\n var _newValue$;\n onSelected(event, (_newValue$ = newValue[0]) != null ? _newValue$ : null);\n }, [onSelected]);\n const controlledProps = React.useMemo(() => {\n if (value === undefined) {\n return {};\n }\n return value != null ? {\n selectedValues: [value]\n } : {\n selectedValues: []\n };\n }, [value]);\n const isItemDisabled = React.useCallback(item => {\n var _subitems$get$disable, _subitems$get3;\n return (_subitems$get$disable = (_subitems$get3 = subitems.get(item)) == null ? void 0 : _subitems$get3.disabled) != null ? _subitems$get$disable : false;\n }, [subitems]);\n const {\n contextValue: listContextValue,\n dispatch,\n getRootProps: getListboxRootProps,\n state: {\n highlightedValue,\n selectedValues\n },\n rootRef: mergedRootRef\n } = useList({\n controlledProps,\n disabledItemsFocusable: !selectionFollowsFocus,\n focusManagement: 'DOM',\n getItemDomElement: getTabElement,\n isItemDisabled,\n items: subitemKeys,\n rootRef: externalRef,\n onChange: handleChange,\n orientation: listOrientation,\n reducerActionContext: React.useMemo(() => ({\n selectionFollowsFocus: selectionFollowsFocus || false\n }), [selectionFollowsFocus]),\n selectionMode: 'single',\n stateReducer: tabsListReducer\n });\n React.useEffect(() => {\n if (value === undefined) {\n return;\n }\n\n // when a value changes externally, the highlighted value should be synced to it\n if (value != null) {\n dispatch({\n type: TabsListActionTypes.valueChange,\n value\n });\n }\n }, [dispatch, value]);\n const getRootProps = (externalProps = {}) => {\n return _extends({}, externalProps, getListboxRootProps(externalProps), {\n 'aria-orientation': orientation === 'vertical' ? 'vertical' : undefined,\n role: 'tablist'\n });\n };\n const contextValue = React.useMemo(() => _extends({}, compoundComponentContextValue, listContextValue), [compoundComponentContextValue, listContextValue]);\n return {\n contextValue,\n dispatch,\n getRootProps,\n highlightedValue,\n isRtl,\n orientation,\n rootRef: mergedRootRef,\n selectedValue: (_selectedValues$ = selectedValues[0]) != null ? _selectedValues$ : null\n };\n}\nexport { useTabsList };"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,mBAAmB,QAAQ,qBAAqB;AACzD,SAASC,iBAAiB,QAAQ,gBAAgB;AAClD,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,eAAe,QAAQ,mBAAmB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,WAAWA,CAACC,UAAU,EAAE;EAC/B,IAAIC,gBAAgB;EACpB,MAAM;IACJC,OAAO,EAAEC;EACX,CAAC,GAAGH,UAAU;EACd,MAAM;IACJI,SAAS,GAAG,KAAK;IACjBC,UAAU;IACVC,WAAW,GAAG,YAAY;IAC1BC,KAAK;IACLC,mBAAmB;IACnBC;EACF,CAAC,GAAGf,cAAc,CAAC,CAAC;EACpB,MAAM;IACJgB,QAAQ;IACRC,YAAY,EAAEC;EAChB,CAAC,GAAGhB,iBAAiB,CAAC,CAAC;EACvB,MAAMiB,WAAW,GAAGpB,KAAK,CAACqB,WAAW,CAACC,QAAQ,IAAI;IAChD,IAAIC,aAAa;IACjB,OAAO,CAACA,aAAa,GAAGN,QAAQ,CAACO,GAAG,CAACF,QAAQ,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,GAAGC,aAAa,CAACE,EAAE;EACrF,CAAC,EAAE,CAACR,QAAQ,CAAC,CAAC;EACdF,mBAAmB,CAACK,WAAW,CAAC;EAChC,MAAMM,WAAW,GAAG1B,KAAK,CAAC2B,OAAO,CAAC,MAAMC,KAAK,CAACC,IAAI,CAACZ,QAAQ,CAACa,IAAI,CAAC,CAAC,CAAC,EAAE,CAACb,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