1 line
9.2 KiB
JSON
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/Аришина)/source/repos/PromoCursed/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.renderExtraFo
|