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

1 line
6.1 KiB
JSON

{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport useTimeInfo from \"../../hooks/useTimeInfo\";\nimport { fillTime } from \"../../utils/dateUtil\";\nimport DatePanel from \"../DatePanel\";\nimport TimePanel from \"../TimePanel\";\nexport default function DateTimePanel(props) {\n var prefixCls = props.prefixCls,\n generateConfig = props.generateConfig,\n showTime = props.showTime,\n onSelect = props.onSelect,\n value = props.value,\n pickerValue = props.pickerValue,\n onHover = props.onHover;\n var panelPrefixCls = \"\".concat(prefixCls, \"-datetime-panel\");\n\n // =============================== Time ===============================\n var _useTimeInfo = useTimeInfo(generateConfig, showTime),\n _useTimeInfo2 = _slicedToArray(_useTimeInfo, 1),\n getValidTime = _useTimeInfo2[0];\n\n // Merge the time info from `value` or `pickerValue`\n var mergeTime = function mergeTime(date) {\n if (value) {\n return fillTime(generateConfig, date, value);\n }\n return fillTime(generateConfig, date, pickerValue);\n };\n\n // ============================== Hover ===============================\n var onDateHover = function onDateHover(date) {\n onHover === null || onHover === void 0 || onHover(date ? mergeTime(date) : date);\n };\n\n // ============================== Select ==============================\n var onDateSelect = function onDateSelect(date) {\n // Merge with current time\n var cloneDate = mergeTime(date);\n onSelect(getValidTime(cloneDate, cloneDate));\n };\n\n // ============================== Render ==============================\n return /*#__PURE__*/React.createElement(\"div\", {\n className: panelPrefixCls\n }, /*#__PURE__*/React.createElement(DatePanel, _extends({}, props, {\n onSelect: onDateSelect,\n onHover: onDateHover\n })), /*#__PURE__*/React.createElement(TimePanel, props));\n}","map":{"version":3,"names":["_extends","_slicedToArray","React","useTimeInfo","fillTime","DatePanel","TimePanel","DateTimePanel","props","prefixCls","generateConfig","showTime","onSelect","value","pickerValue","onHover","panelPrefixCls","concat","_useTimeInfo","_useTimeInfo2","getValidTime","mergeTime","date","onDateHover","onDateSelect","cloneDate","createElement","className"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-picker/es/PickerPanel/DateTimePanel/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport useTimeInfo from \"../../hooks/useTimeInfo\";\nimport { fillTime } from \"../../utils/dateUtil\";\nimport DatePanel from \"../DatePanel\";\nimport TimePanel from \"../TimePanel\";\nexport default function DateTimePanel(props) {\n var prefixCls = props.prefixCls,\n generateConfig = props.generateConfig,\n showTime = props.showTime,\n onSelect = props.onSelect,\n value = props.value,\n pickerValue = props.pickerValue,\n onHover = props.onHover;\n var panelPrefixCls = \"\".concat(prefixCls, \"-datetime-panel\");\n\n // =============================== Time ===============================\n var _useTimeInfo = useTimeInfo(generateConfig, showTime),\n _useTimeInfo2 = _slicedToArray(_useTimeInfo, 1),\n getValidTime = _useTimeInfo2[0];\n\n // Merge the time info from `value` or `pickerValue`\n var mergeTime = function mergeTime(date) {\n if (value) {\n return fillTime(generateConfig, date, value);\n }\n return fillTime(generateConfig, date, pickerValue);\n };\n\n // ============================== Hover ===============================\n var onDateHover = function onDateHover(date) {\n onHover === null || onHover === void 0 || onHover(date ? mergeTime(date) : date);\n };\n\n // ============================== Select ==============================\n var onDateSelect = function onDateSelect(date) {\n // Merge with current time\n var cloneDate = mergeTime(date);\n onSelect(getValidTime(cloneDate, cloneDate));\n };\n\n // ============================== Render ==============================\n return /*#__PURE__*/React.createElement(\"div\", {\n className: panelPrefixCls\n }, /*#__PURE__*/React.createElement(DatePanel, _extends({}, props, {\n onSelect: onDateSelect,\n onHover: onDateHover\n })), /*#__PURE__*/React.createElement(TimePanel, props));\n}"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,cAAc,MAAM,0CAA0C;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