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

1 line
9.2 KiB
JSON

{"ast":null,"code":"import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport useTimeInfo from \"../../hooks/useTimeInfo\";\nimport PickerContext from \"../context\";\nexport default function Footer(props) {\n var mode = props.mode,\n internalMode = props.internalMode,\n renderExtraFooter = props.renderExtraFooter,\n showNow = props.showNow,\n showTime = props.showTime,\n onSubmit = props.onSubmit,\n onNow = props.onNow,\n invalid = props.invalid,\n needConfirm = props.needConfirm,\n generateConfig = props.generateConfig,\n disabledDate = props.disabledDate;\n var _React$useContext = React.useContext(PickerContext),\n prefixCls = _React$useContext.prefixCls,\n locale = _React$useContext.locale,\n _React$useContext$but = _React$useContext.button,\n Button = _React$useContext$but === void 0 ? 'button' : _React$useContext$but;\n\n // >>> Now\n var now = generateConfig.getNow();\n var _useTimeInfo = useTimeInfo(generateConfig, showTime, now),\n _useTimeInfo2 = _slicedToArray(_useTimeInfo, 1),\n getValidTime = _useTimeInfo2[0];\n\n // ======================== Extra =========================\n var extraNode = renderExtraFooter === null || renderExtraFooter === void 0 ? void 0 : renderExtraFooter(mode);\n\n // ======================== Ranges ========================\n var nowDisabled = disabledDate(now, {\n type: mode\n });\n var onInternalNow = function onInternalNow() {\n if (!nowDisabled) {\n var validateNow = getValidTime(now);\n onNow(validateNow);\n }\n };\n var nowPrefixCls = \"\".concat(prefixCls, \"-now\");\n var nowBtnPrefixCls = \"\".concat(nowPrefixCls, \"-btn\");\n var presetNode = showNow && /*#__PURE__*/React.createElement(\"li\", {\n className: nowPrefixCls\n }, /*#__PURE__*/React.createElement(\"a\", {\n className: classNames(nowBtnPrefixCls, nowDisabled && \"\".concat(nowBtnPrefixCls, \"-disabled\")),\n \"aria-disabled\": nowDisabled,\n onClick: onInternalNow\n }, internalMode === 'date' ? locale.today : locale.now));\n\n // >>> OK\n var okNode = needConfirm && /*#__PURE__*/React.createElement(\"li\", {\n className: \"\".concat(prefixCls, \"-ok\")\n }, /*#__PURE__*/React.createElement(Button, {\n disabled: invalid,\n onClick: onSubmit\n }, locale.ok));\n var rangeNode = (presetNode || okNode) && /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-ranges\")\n }, presetNode, okNode);\n\n // ======================== Render ========================\n if (!extraNode && !rangeNode) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, extraNode && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer-extra\")\n }, extraNode), rangeNode);\n}","map":{"version":3,"names":["_slicedToArray","classNames","React","useTimeInfo","PickerContext","Footer","props","mode","internalMode","renderExtraFooter","showNow","showTime","onSubmit","onNow","invalid","needConfirm","generateConfig","disabledDate","_React$useContext","useContext","prefixCls","locale","_React$useContext$but","button","Button","now","getNow","_useTimeInfo","_useTimeInfo2","getValidTime","extraNode","nowDisabled","type","onInternalNow","validateNow","nowPrefixCls","concat","nowBtnPrefixCls","presetNode","createElement","className","onClick","today","okNode","disabled","ok","rangeNode"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-picker/es/PickerInput/Popup/Footer.js"],"sourcesContent":["import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport useTimeInfo from \"../../hooks/useTimeInfo\";\nimport PickerContext from \"../context\";\nexport default function Footer(props) {\n var mode = props.mode,\n internalMode = props.internalMode,\n renderExtraFooter = props.renderExtraFooter,\n showNow = props.showNow,\n showTime = props.showTime,\n onSubmit = props.onSubmit,\n onNow = props.onNow,\n invalid = props.invalid,\n needConfirm = props.needConfirm,\n generateConfig = props.generateConfig,\n disabledDate = props.disabledDate;\n var _React$useContext = React.useContext(PickerContext),\n prefixCls = _React$useContext.prefixCls,\n locale = _React$useContext.locale,\n _React$useContext$but = _React$useContext.button,\n Button = _React$useContext$but === void 0 ? 'button' : _React$useContext$but;\n\n // >>> Now\n var now = generateConfig.getNow();\n var _useTimeInfo = useTimeInfo(generateConfig, showTime, now),\n _useTimeInfo2 = _slicedToArray(_useTimeInfo, 1),\n getValidTime = _useTimeInfo2[0];\n\n // ======================== Extra =========================\n var extraNode = renderExtraFooter === null || renderExtraFooter === void 0 ? void 0 : renderExtraFooter(mode);\n\n // ======================== Ranges ========================\n var nowDisabled = disabledDate(now, {\n type: mode\n });\n var onInternalNow = function onInternalNow() {\n if (!nowDisabled) {\n var validateNow = getValidTime(now);\n onNow(validateNow);\n }\n };\n var nowPrefixCls = \"\".concat(prefixCls, \"-now\");\n var nowBtnPrefixCls = \"\".concat(nowPrefixCls, \"-btn\");\n var presetNode = showNow && /*#__PURE__*/React.createElement(\"li\", {\n className: nowPrefixCls\n }, /*#__PURE__*/React.createElement(\"a\", {\n className: classNames(nowBtnPrefixCls, nowDisabled && \"\".concat(nowBtnPrefixCls, \"-disabled\")),\n \"aria-disabled\": nowDisabled,\n onClick: onInternalNow\n }, internalMode === 'date' ? locale.today : locale.now));\n\n // >>> OK\n var okNode = needConfirm && /*#__PURE__*/React.createElement(\"li\", {\n className: \"\".concat(prefixCls, \"-ok\")\n }, /*#__PURE__*/React.createElement(Button, {\n disabled: invalid,\n onClick: onSubmit\n }, locale.ok));\n var rangeNode = (presetNode || okNode) && /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-ranges\")\n }, presetNode, okNode);\n\n // ======================== Render ========================\n if (!extraNode && !rangeNode) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, extraNode && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer-extra\")\n }, extraNode), rangeNode);\n}"],"mappings":"AAAA,OAAOA,cAAc,MAAM,0CAA0C;AACrE,OAAOC,UAAU,MAAM,Y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