PromoCursed/node_modules/.cache/babel-loader/f34008b5042136158da9a60b284661753c18c4971786517e42492a3ff20fb606.json
2024-08-20 23:25:37 +04:00

1 line
4.8 KiB
JSON

{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport * as React from 'react';\nfunction isConfigObj(closable) {\n return closable !== null && _typeof(closable) === 'object';\n}\n/**\n * Convert `closable` to ClosableConfig.\n * When `preset` is true, will auto fill ClosableConfig with default value.\n */\nfunction getClosableConfig(closable, closeIcon, preset) {\n if (closable === false || closeIcon === false && (!isConfigObj(closable) || !closable.closeIcon)) {\n return null;\n }\n var mergedCloseIcon = typeof closeIcon !== 'boolean' ? closeIcon : undefined;\n if (isConfigObj(closable)) {\n var _closable$closeIcon;\n return _objectSpread(_objectSpread({}, closable), {}, {\n closeIcon: (_closable$closeIcon = closable.closeIcon) !== null && _closable$closeIcon !== void 0 ? _closable$closeIcon : mergedCloseIcon\n });\n }\n\n // When StepClosable no need auto fill, but RootClosable need this.\n return preset || closable || closeIcon ? {\n closeIcon: mergedCloseIcon\n } : 'empty';\n}\nexport function useClosable(stepClosable, stepCloseIcon, closable, closeIcon) {\n return React.useMemo(function () {\n var stepClosableConfig = getClosableConfig(stepClosable, stepCloseIcon, false);\n var rootClosableConfig = getClosableConfig(closable, closeIcon, true);\n if (stepClosableConfig !== 'empty') {\n return stepClosableConfig;\n }\n return rootClosableConfig;\n }, [closable, closeIcon, stepClosable, stepCloseIcon]);\n}","map":{"version":3,"names":["_objectSpread","_typeof","React","isConfigObj","closable","getClosableConfig","closeIcon","preset","mergedCloseIcon","undefined","_closable$closeIcon","useClosable","stepClosable","stepCloseIcon","useMemo","stepClosableConfig","rootClosableConfig"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/@rc-component/tour/es/hooks/useClosable.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport * as React from 'react';\nfunction isConfigObj(closable) {\n return closable !== null && _typeof(closable) === 'object';\n}\n/**\n * Convert `closable` to ClosableConfig.\n * When `preset` is true, will auto fill ClosableConfig with default value.\n */\nfunction getClosableConfig(closable, closeIcon, preset) {\n if (closable === false || closeIcon === false && (!isConfigObj(closable) || !closable.closeIcon)) {\n return null;\n }\n var mergedCloseIcon = typeof closeIcon !== 'boolean' ? closeIcon : undefined;\n if (isConfigObj(closable)) {\n var _closable$closeIcon;\n return _objectSpread(_objectSpread({}, closable), {}, {\n closeIcon: (_closable$closeIcon = closable.closeIcon) !== null && _closable$closeIcon !== void 0 ? _closable$closeIcon : mergedCloseIcon\n });\n }\n\n // When StepClosable no need auto fill, but RootClosable need this.\n return preset || closable || closeIcon ? {\n closeIcon: mergedCloseIcon\n } : 'empty';\n}\nexport function useClosable(stepClosable, stepCloseIcon, closable, closeIcon) {\n return React.useMemo(function () {\n var stepClosableConfig = getClosableConfig(stepClosable, stepCloseIcon, false);\n var rootClosableConfig = getClosableConfig(closable, closeIcon, true);\n if (stepClosableConfig !== 'empty') {\n return stepClosableConfig;\n }\n return rootClosableConfig;\n }, [closable, closeIcon, stepClosable, stepCloseIcon]);\n}"],"mappings":"AAAA,OAAOA,aAAa,MAAM,0CAA0C;AACpE,OAAOC,OAAO,MAAM,mCAAmC;AACvD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAWA,CAACC,QAAQ,EAAE;EAC7B,OAAOA,QAAQ,KAAK,IAAI,IAAIH,OAAO,CAACG,QAAQ,CAAC,KAAK,QAAQ;AAC5D;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAACD,QAAQ,EAAEE,SAAS,EAAEC,MAAM,EAAE;EACtD,IAAIH,QAAQ,KAAK,KAAK,IAAIE,SAAS,KAAK,KAAK,KAAK,CAACH,WAAW,CAACC,QAAQ,CAAC,IAAI,CAACA,QAAQ,CAACE,SAAS,CAAC,EAAE;IAChG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