9d4dc6e2c2f564e051285ce6d5fdab57.json
45.8 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n\n/**\n * Logic:\n * When `mode` === `picker`,\n * click will trigger `onSelect` (if value changed trigger `onChange` also).\n * Panel change will not trigger `onSelect` but trigger `onPanelChange`\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport warning from \"rc-util/es/warning\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport TimePanel from './panels/TimePanel';\nimport DatetimePanel from './panels/DatetimePanel';\nimport DatePanel from './panels/DatePanel';\nimport WeekPanel from './panels/WeekPanel';\nimport MonthPanel from './panels/MonthPanel';\nimport QuarterPanel from './panels/QuarterPanel';\nimport YearPanel from './panels/YearPanel';\nimport DecadePanel from './panels/DecadePanel';\nimport { isEqual } from './utils/dateUtil';\nimport PanelContext from './PanelContext';\nimport { PickerModeMap } from './utils/uiUtil';\nimport RangeContext from './RangeContext';\nimport getExtraFooter from './utils/getExtraFooter';\nimport getRanges from './utils/getRanges';\nimport { getLowerBoundTime, setTime } from './utils/timeUtil';\n\nfunction PickerPanel(props) {\n var _classNames;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n className = props.className,\n style = props.style,\n locale = props.locale,\n generateConfig = props.generateConfig,\n value = props.value,\n defaultValue = props.defaultValue,\n pickerValue = props.pickerValue,\n defaultPickerValue = props.defaultPickerValue,\n disabledDate = props.disabledDate,\n mode = props.mode,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n showNow = props.showNow,\n showTime = props.showTime,\n showToday = props.showToday,\n renderExtraFooter = props.renderExtraFooter,\n hideHeader = props.hideHeader,\n onSelect = props.onSelect,\n onChange = props.onChange,\n onPanelChange = props.onPanelChange,\n onMouseDown = props.onMouseDown,\n onPickerValueChange = props.onPickerValueChange,\n _onOk = props.onOk,\n components = props.components,\n direction = props.direction,\n _props$hourStep = props.hourStep,\n hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,\n _props$minuteStep = props.minuteStep,\n minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,\n _props$secondStep = props.secondStep,\n secondStep = _props$secondStep === void 0 ? 1 : _props$secondStep;\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time';\n var isHourStepValid = 24 % hourStep === 0;\n var isMinuteStepValid = 60 % minuteStep === 0;\n var isSecondStepValid = 60 % secondStep === 0;\n\n if (process.env.NODE_ENV !== 'production') {\n warning(!value || generateConfig.isValidate(value), 'Invalidate date pass to `value`.');\n warning(!value || generateConfig.isValidate(value), 'Invalidate date pass to `defaultValue`.');\n warning(isHourStepValid, \"`hourStep` \".concat(hourStep, \" is invalid. It should be a factor of 24.\"));\n warning(isMinuteStepValid, \"`minuteStep` \".concat(minuteStep, \" is invalid. It should be a factor of 60.\"));\n warning(isSecondStepValid, \"`secondStep` \".concat(secondStep, \" is invalid. It should be a factor of 60.\"));\n } // ============================ State =============================\n\n\n var panelContext = React.useContext(PanelContext);\n var operationRef = panelContext.operationRef,\n panelDivRef = panelContext.panelRef,\n onContextSelect = panelContext.onSelect,\n hideRanges = panelContext.hideRanges,\n defaultOpenValue = panelContext.defaultOpenValue;\n\n var _React$useContext = React.useContext(RangeContext),\n inRange = _React$useContext.inRange,\n panelPosition = _React$useContext.panelPosition,\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n\n var panelRef = React.useRef({}); // Handle init logic\n\n var initRef = React.useRef(true); // Value\n\n var _useMergedState = useMergedState(null, {\n value: value,\n defaultValue: defaultValue,\n postState: function postState(val) {\n if (!val && defaultOpenValue && picker === 'time') {\n return defaultOpenValue;\n }\n\n return val;\n }\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1]; // View date control\n\n\n var _useMergedState3 = useMergedState(null, {\n value: pickerValue,\n defaultValue: defaultPickerValue || mergedValue,\n postState: function postState(date) {\n return date || generateConfig.getNow();\n }\n }),\n _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n viewDate = _useMergedState4[0],\n setInnerViewDate = _useMergedState4[1];\n\n var setViewDate = function setViewDate(date) {\n setInnerViewDate(date);\n\n if (onPickerValueChange) {\n onPickerValueChange(date);\n }\n }; // Panel control\n\n\n var getInternalNextMode = function getInternalNextMode(nextMode) {\n var getNextMode = PickerModeMap[picker];\n\n if (getNextMode) {\n return getNextMode(nextMode);\n }\n\n return nextMode;\n }; // Save panel is changed from which panel\n\n\n var _useMergedState5 = useMergedState(function () {\n if (picker === 'time') {\n return 'time';\n }\n\n return getInternalNextMode('date');\n }, {\n value: mode\n }),\n _useMergedState6 = _slicedToArray(_useMergedState5, 2),\n mergedMode = _useMergedState6[0],\n setInnerMode = _useMergedState6[1];\n\n React.useEffect(function () {\n setInnerMode(picker);\n }, [picker]);\n\n var _React$useState = React.useState(function () {\n return mergedMode;\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n sourceMode = _React$useState2[0],\n setSourceMode = _React$useState2[1];\n\n var onInternalPanelChange = function onInternalPanelChange(newMode, viewValue) {\n var nextMode = getInternalNextMode(newMode || mergedMode);\n setSourceMode(mergedMode);\n setInnerMode(nextMode);\n\n if (onPanelChange && (mergedMode !== nextMode || isEqual(generateConfig, viewDate, viewDate))) {\n onPanelChange(viewValue, nextMode);\n }\n };\n\n var triggerSelect = function triggerSelect(date, type) {\n var forceTriggerSelect = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (mergedMode === picker || forceTriggerSelect) {\n setInnerValue(date);\n\n if (onSelect) {\n onSelect(date);\n }\n\n if (onContextSelect) {\n onContextSelect(date, type);\n }\n\n if (onChange && !isEqual(generateConfig, date, mergedValue) && !(disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date))) {\n onChange(date);\n }\n }\n }; // ========================= Interactive ==========================\n\n\n var onInternalKeyDown = function onInternalKeyDown(e) {\n if (panelRef.current && panelRef.current.onKeyDown) {\n if ([KeyCode.LEFT, KeyCode.RIGHT, KeyCode.UP, KeyCode.DOWN, KeyCode.PAGE_UP, KeyCode.PAGE_DOWN, KeyCode.ENTER].includes(e.which)) {\n e.preventDefault();\n }\n\n return panelRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n\n /* eslint-disable no-lone-blocks */\n\n\n {\n warning(false, 'Panel not correct handle keyDown event. Please help to fire issue about this.');\n return false;\n }\n /* eslint-enable no-lone-blocks */\n };\n\n var onInternalBlur = function onInternalBlur(e) {\n if (panelRef.current && panelRef.current.onBlur) {\n panelRef.current.onBlur(e);\n }\n };\n\n if (operationRef && panelPosition !== 'right') {\n operationRef.current = {\n onKeyDown: onInternalKeyDown,\n onClose: function onClose() {\n if (panelRef.current && panelRef.current.onClose) {\n panelRef.current.onClose();\n }\n }\n };\n } // ============================ Effect ============================\n\n\n React.useEffect(function () {\n if (value && !initRef.current) {\n setInnerViewDate(value);\n }\n }, [value]);\n React.useEffect(function () {\n initRef.current = false;\n }, []); // ============================ Panels ============================\n\n var panelNode;\n\n var pickerProps = _objectSpread(_objectSpread({}, props), {}, {\n operationRef: panelRef,\n prefixCls: prefixCls,\n viewDate: viewDate,\n value: mergedValue,\n onViewDateChange: setViewDate,\n sourceMode: sourceMode,\n onPanelChange: onInternalPanelChange,\n disabledDate: mergedMode !== 'decade' ? disabledDate : undefined\n });\n\n delete pickerProps.onChange;\n delete pickerProps.onSelect;\n\n switch (mergedMode) {\n case 'decade':\n panelNode = /*#__PURE__*/React.createElement(DecadePanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'year':\n panelNode = /*#__PURE__*/React.createElement(YearPanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'month':\n panelNode = /*#__PURE__*/React.createElement(MonthPanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'quarter':\n panelNode = /*#__PURE__*/React.createElement(QuarterPanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'week':\n panelNode = /*#__PURE__*/React.createElement(WeekPanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'time':\n delete pickerProps.showTime;\n panelNode = /*#__PURE__*/React.createElement(TimePanel, Object.assign({}, pickerProps, _typeof(showTime) === 'object' ? showTime : null, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n default:\n if (showTime) {\n panelNode = /*#__PURE__*/React.createElement(DatetimePanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n } else {\n panelNode = /*#__PURE__*/React.createElement(DatePanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n }\n\n } // ============================ Footer ============================\n\n\n var extraFooter;\n var rangesNode;\n\n var onNow = function onNow() {\n var now = generateConfig.getNow();\n var lowerBoundTime = getLowerBoundTime(generateConfig.getHour(now), generateConfig.getMinute(now), generateConfig.getSecond(now), isHourStepValid ? hourStep : 1, isMinuteStepValid ? minuteStep : 1, isSecondStepValid ? secondStep : 1);\n var adjustedNow = setTime(generateConfig, now, lowerBoundTime[0], // hour\n lowerBoundTime[1], // minute\n lowerBoundTime[2]);\n triggerSelect(adjustedNow, 'submit');\n };\n\n if (!hideRanges) {\n extraFooter = getExtraFooter(prefixCls, mergedMode, renderExtraFooter);\n rangesNode = getRanges({\n prefixCls: prefixCls,\n components: components,\n needConfirmButton: needConfirmButton,\n okDisabled: !mergedValue || disabledDate && disabledDate(mergedValue),\n locale: locale,\n showNow: showNow,\n onNow: needConfirmButton && onNow,\n onOk: function onOk() {\n if (mergedValue) {\n triggerSelect(mergedValue, 'submit', true);\n\n if (_onOk) {\n _onOk(mergedValue);\n }\n }\n }\n });\n }\n\n var todayNode;\n\n if (showToday && mergedMode === 'date' && picker === 'date' && !showTime) {\n var now = generateConfig.getNow();\n var todayCls = \"\".concat(prefixCls, \"-today-btn\");\n var disabled = disabledDate && disabledDate(now);\n todayNode = /*#__PURE__*/React.createElement(\"a\", {\n className: classNames(todayCls, disabled && \"\".concat(todayCls, \"-disabled\")),\n \"aria-disabled\": disabled,\n onClick: function onClick() {\n if (!disabled) {\n triggerSelect(now, 'mouse', true);\n }\n }\n }, locale.today);\n }\n\n return /*#__PURE__*/React.createElement(PanelContext.Provider, {\n value: _objectSpread(_objectSpread({}, panelContext), {}, {\n hideHeader: 'hideHeader' in props ? hideHeader : panelContext.hideHeader,\n hidePrevBtn: inRange && panelPosition === 'right',\n hideNextBtn: inRange && panelPosition === 'left'\n })\n }, /*#__PURE__*/React.createElement(\"div\", {\n tabIndex: tabIndex,\n className: classNames(\"\".concat(prefixCls, \"-panel\"), className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-panel-has-range\"), rangedValue && rangedValue[0] && rangedValue[1]), _defineProperty(_classNames, \"\".concat(prefixCls, \"-panel-has-range-hover\"), hoverRangedValue && hoverRangedValue[0] && hoverRangedValue[1]), _defineProperty(_classNames, \"\".concat(prefixCls, \"-panel-rtl\"), direction === 'rtl'), _classNames)),\n style: style,\n onKeyDown: onInternalKeyDown,\n onBlur: onInternalBlur,\n onMouseDown: onMouseDown,\n ref: panelDivRef\n }, panelNode, extraFooter || rangesNode || todayNode ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, extraFooter, rangesNode, todayNode) : null));\n}\n\nexport default PickerPanel;\n/* eslint-enable */","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-picker/es/PickerPanel.js"],"names":["_defineProperty","_typeof","_objectSpread","_slicedToArray","React","classNames","KeyCode","warning","useMergedState","TimePanel","DatetimePanel","DatePanel","WeekPanel","MonthPanel","QuarterPanel","YearPanel","DecadePanel","isEqual","PanelContext","PickerModeMap","RangeContext","getExtraFooter","getRanges","getLowerBoundTime","setTime","PickerPanel","props","_classNames","_props$prefixCls","prefixCls","className","style","locale","generateConfig","value","defaultValue","pickerValue","defaultPickerValue","disabledDate","mode","_props$picker","picker","_props$tabIndex","tabIndex","showNow","showTime","showToday","renderExtraFooter","hideHeader","onSelect","onChange","onPanelChange","onMouseDown","onPickerValueChange","_onOk","onOk","components","direction","_props$hourStep","hourStep","_props$minuteStep","minuteStep","_props$secondStep","secondStep","needConfirmButton","isHourStepValid","isMinuteStepValid","isSecondStepValid","process","env","NODE_ENV","isValidate","concat","panelContext","useContext","operationRef","panelDivRef","panelRef","onContextSelect","hideRanges","defaultOpenValue","_React$useContext","inRange","panelPosition","rangedValue","hoverRangedValue","useRef","initRef","_useMergedState","postState","val","_useMergedState2","mergedValue","setInnerValue","_useMergedState3","date","getNow","_useMergedState4","viewDate","setInnerViewDate","setViewDate","getInternalNextMode","nextMode","getNextMode","_useMergedState5","_useMergedState6","mergedMode","setInnerMode","useEffect","_React$useState","useState","_React$useState2","sourceMode","setSourceMode","onInternalPanelChange","newMode","viewValue","triggerSelect","type","forceTriggerSelect","arguments","length","undefined","onInternalKeyDown","e","current","onKeyDown","LEFT","RIGHT","UP","DOWN","PAGE_UP","PAGE_DOWN","ENTER","includes","which","preventDefault","onInternalBlur","onBlur","onClose","panelNode","pickerProps","onViewDateChange","createElement","Object","assign","extraFooter","rangesNode","onNow","now","lowerBoundTime","getHour","getMinute","getSecond","adjustedNow","okDisabled","todayNode","todayCls","disabled","onClick","today","Provider","hidePrevBtn","hideNextBtn","ref"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAOC,OAAP,MAAoB,mCAApB;AACA,OAAOC,aAAP,MAA0B,0CAA1B;AACA,OAAOC,cAAP,MAA2B,0CAA3B;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,cAAP,MAA2B,iCAA3B;AACA,OAAOC,SAAP,MAAsB,oBAAtB;AACA,OAAOC,aAAP,MAA0B,wBAA1B;AACA,OAAOC,SAAP,MAAsB,oBAAtB;AACA,OAAOC,SAAP,MAAsB,oBAAtB;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AACA,OAAOC,YAAP,MAAyB,uBAAzB;AACA,OAAOC,SAAP,MAAsB,oBAAtB;AACA,OAAOC,WAAP,MAAwB,sBAAxB;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,SAASC,aAAT,QAA8B,gBAA9B;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,OAAOC,cAAP,MAA2B,wBAA3B;AACA,OAAOC,SAAP,MAAsB,mBAAtB;AACA,SAASC,iBAAT,EAA4BC,OAA5B,QAA2C,kBAA3C;;AAEA,SAASC,WAAT,CAAqBC,KAArB,EAA4B;AAC1B,MAAIC,WAAJ;;AAEA,MAAIC,gBAAgB,GAAGF,KAAK,CAACG,SAA7B;AAAA,MACIA,SAAS,GAAGD,gBAAgB,KAA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iE,EAEpDC,UAFoD,EAExCS,SAFwC,CAAtD,GAE2B,IAVzB,CANI,CAApB;AAiBD;;AAED,eAAenI,WAAf;AACA","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\n\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n\n/**\n * Logic:\n * When `mode` === `picker`,\n * click will trigger `onSelect` (if value changed trigger `onChange` also).\n * Panel change will not trigger `onSelect` but trigger `onPanelChange`\n */\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport warning from \"rc-util/es/warning\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport TimePanel from './panels/TimePanel';\nimport DatetimePanel from './panels/DatetimePanel';\nimport DatePanel from './panels/DatePanel';\nimport WeekPanel from './panels/WeekPanel';\nimport MonthPanel from './panels/MonthPanel';\nimport QuarterPanel from './panels/QuarterPanel';\nimport YearPanel from './panels/YearPanel';\nimport DecadePanel from './panels/DecadePanel';\nimport { isEqual } from './utils/dateUtil';\nimport PanelContext from './PanelContext';\nimport { PickerModeMap } from './utils/uiUtil';\nimport RangeContext from './RangeContext';\nimport getExtraFooter from './utils/getExtraFooter';\nimport getRanges from './utils/getRanges';\nimport { getLowerBoundTime, setTime } from './utils/timeUtil';\n\nfunction PickerPanel(props) {\n var _classNames;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n className = props.className,\n style = props.style,\n locale = props.locale,\n generateConfig = props.generateConfig,\n value = props.value,\n defaultValue = props.defaultValue,\n pickerValue = props.pickerValue,\n defaultPickerValue = props.defaultPickerValue,\n disabledDate = props.disabledDate,\n mode = props.mode,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n showNow = props.showNow,\n showTime = props.showTime,\n showToday = props.showToday,\n renderExtraFooter = props.renderExtraFooter,\n hideHeader = props.hideHeader,\n onSelect = props.onSelect,\n onChange = props.onChange,\n onPanelChange = props.onPanelChange,\n onMouseDown = props.onMouseDown,\n onPickerValueChange = props.onPickerValueChange,\n _onOk = props.onOk,\n components = props.components,\n direction = props.direction,\n _props$hourStep = props.hourStep,\n hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,\n _props$minuteStep = props.minuteStep,\n minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,\n _props$secondStep = props.secondStep,\n secondStep = _props$secondStep === void 0 ? 1 : _props$secondStep;\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time';\n var isHourStepValid = 24 % hourStep === 0;\n var isMinuteStepValid = 60 % minuteStep === 0;\n var isSecondStepValid = 60 % secondStep === 0;\n\n if (process.env.NODE_ENV !== 'production') {\n warning(!value || generateConfig.isValidate(value), 'Invalidate date pass to `value`.');\n warning(!value || generateConfig.isValidate(value), 'Invalidate date pass to `defaultValue`.');\n warning(isHourStepValid, \"`hourStep` \".concat(hourStep, \" is invalid. It should be a factor of 24.\"));\n warning(isMinuteStepValid, \"`minuteStep` \".concat(minuteStep, \" is invalid. It should be a factor of 60.\"));\n warning(isSecondStepValid, \"`secondStep` \".concat(secondStep, \" is invalid. It should be a factor of 60.\"));\n } // ============================ State =============================\n\n\n var panelContext = React.useContext(PanelContext);\n var operationRef = panelContext.operationRef,\n panelDivRef = panelContext.panelRef,\n onContextSelect = panelContext.onSelect,\n hideRanges = panelContext.hideRanges,\n defaultOpenValue = panelContext.defaultOpenValue;\n\n var _React$useContext = React.useContext(RangeContext),\n inRange = _React$useContext.inRange,\n panelPosition = _React$useContext.panelPosition,\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n\n var panelRef = React.useRef({}); // Handle init logic\n\n var initRef = React.useRef(true); // Value\n\n var _useMergedState = useMergedState(null, {\n value: value,\n defaultValue: defaultValue,\n postState: function postState(val) {\n if (!val && defaultOpenValue && picker === 'time') {\n return defaultOpenValue;\n }\n\n return val;\n }\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1]; // View date control\n\n\n var _useMergedState3 = useMergedState(null, {\n value: pickerValue,\n defaultValue: defaultPickerValue || mergedValue,\n postState: function postState(date) {\n return date || generateConfig.getNow();\n }\n }),\n _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n viewDate = _useMergedState4[0],\n setInnerViewDate = _useMergedState4[1];\n\n var setViewDate = function setViewDate(date) {\n setInnerViewDate(date);\n\n if (onPickerValueChange) {\n onPickerValueChange(date);\n }\n }; // Panel control\n\n\n var getInternalNextMode = function getInternalNextMode(nextMode) {\n var getNextMode = PickerModeMap[picker];\n\n if (getNextMode) {\n return getNextMode(nextMode);\n }\n\n return nextMode;\n }; // Save panel is changed from which panel\n\n\n var _useMergedState5 = useMergedState(function () {\n if (picker === 'time') {\n return 'time';\n }\n\n return getInternalNextMode('date');\n }, {\n value: mode\n }),\n _useMergedState6 = _slicedToArray(_useMergedState5, 2),\n mergedMode = _useMergedState6[0],\n setInnerMode = _useMergedState6[1];\n\n React.useEffect(function () {\n setInnerMode(picker);\n }, [picker]);\n\n var _React$useState = React.useState(function () {\n return mergedMode;\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n sourceMode = _React$useState2[0],\n setSourceMode = _React$useState2[1];\n\n var onInternalPanelChange = function onInternalPanelChange(newMode, viewValue) {\n var nextMode = getInternalNextMode(newMode || mergedMode);\n setSourceMode(mergedMode);\n setInnerMode(nextMode);\n\n if (onPanelChange && (mergedMode !== nextMode || isEqual(generateConfig, viewDate, viewDate))) {\n onPanelChange(viewValue, nextMode);\n }\n };\n\n var triggerSelect = function triggerSelect(date, type) {\n var forceTriggerSelect = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (mergedMode === picker || forceTriggerSelect) {\n setInnerValue(date);\n\n if (onSelect) {\n onSelect(date);\n }\n\n if (onContextSelect) {\n onContextSelect(date, type);\n }\n\n if (onChange && !isEqual(generateConfig, date, mergedValue) && !(disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date))) {\n onChange(date);\n }\n }\n }; // ========================= Interactive ==========================\n\n\n var onInternalKeyDown = function onInternalKeyDown(e) {\n if (panelRef.current && panelRef.current.onKeyDown) {\n if ([KeyCode.LEFT, KeyCode.RIGHT, KeyCode.UP, KeyCode.DOWN, KeyCode.PAGE_UP, KeyCode.PAGE_DOWN, KeyCode.ENTER].includes(e.which)) {\n e.preventDefault();\n }\n\n return panelRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n\n /* eslint-disable no-lone-blocks */\n\n\n {\n warning(false, 'Panel not correct handle keyDown event. Please help to fire issue about this.');\n return false;\n }\n /* eslint-enable no-lone-blocks */\n };\n\n var onInternalBlur = function onInternalBlur(e) {\n if (panelRef.current && panelRef.current.onBlur) {\n panelRef.current.onBlur(e);\n }\n };\n\n if (operationRef && panelPosition !== 'right') {\n operationRef.current = {\n onKeyDown: onInternalKeyDown,\n onClose: function onClose() {\n if (panelRef.current && panelRef.current.onClose) {\n panelRef.current.onClose();\n }\n }\n };\n } // ============================ Effect ============================\n\n\n React.useEffect(function () {\n if (value && !initRef.current) {\n setInnerViewDate(value);\n }\n }, [value]);\n React.useEffect(function () {\n initRef.current = false;\n }, []); // ============================ Panels ============================\n\n var panelNode;\n\n var pickerProps = _objectSpread(_objectSpread({}, props), {}, {\n operationRef: panelRef,\n prefixCls: prefixCls,\n viewDate: viewDate,\n value: mergedValue,\n onViewDateChange: setViewDate,\n sourceMode: sourceMode,\n onPanelChange: onInternalPanelChange,\n disabledDate: mergedMode !== 'decade' ? disabledDate : undefined\n });\n\n delete pickerProps.onChange;\n delete pickerProps.onSelect;\n\n switch (mergedMode) {\n case 'decade':\n panelNode = /*#__PURE__*/React.createElement(DecadePanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'year':\n panelNode = /*#__PURE__*/React.createElement(YearPanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'month':\n panelNode = /*#__PURE__*/React.createElement(MonthPanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'quarter':\n panelNode = /*#__PURE__*/React.createElement(QuarterPanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'week':\n panelNode = /*#__PURE__*/React.createElement(WeekPanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'time':\n delete pickerProps.showTime;\n panelNode = /*#__PURE__*/React.createElement(TimePanel, Object.assign({}, pickerProps, _typeof(showTime) === 'object' ? showTime : null, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n default:\n if (showTime) {\n panelNode = /*#__PURE__*/React.createElement(DatetimePanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n } else {\n panelNode = /*#__PURE__*/React.createElement(DatePanel, Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n }\n\n } // ============================ Footer ============================\n\n\n var extraFooter;\n var rangesNode;\n\n var onNow = function onNow() {\n var now = generateConfig.getNow();\n var lowerBoundTime = getLowerBoundTime(generateConfig.getHour(now), generateConfig.getMinute(now), generateConfig.getSecond(now), isHourStepValid ? hourStep : 1, isMinuteStepValid ? minuteStep : 1, isSecondStepValid ? secondStep : 1);\n var adjustedNow = setTime(generateConfig, now, lowerBoundTime[0], // hour\n lowerBoundTime[1], // minute\n lowerBoundTime[2]);\n triggerSelect(adjustedNow, 'submit');\n };\n\n if (!hideRanges) {\n extraFooter = getExtraFooter(prefixCls, mergedMode, renderExtraFooter);\n rangesNode = getRanges({\n prefixCls: prefixCls,\n components: components,\n needConfirmButton: needConfirmButton,\n okDisabled: !mergedValue || disabledDate && disabledDate(mergedValue),\n locale: locale,\n showNow: showNow,\n onNow: needConfirmButton && onNow,\n onOk: function onOk() {\n if (mergedValue) {\n triggerSelect(mergedValue, 'submit', true);\n\n if (_onOk) {\n _onOk(mergedValue);\n }\n }\n }\n });\n }\n\n var todayNode;\n\n if (showToday && mergedMode === 'date' && picker === 'date' && !showTime) {\n var now = generateConfig.getNow();\n var todayCls = \"\".concat(prefixCls, \"-today-btn\");\n var disabled = disabledDate && disabledDate(now);\n todayNode = /*#__PURE__*/React.createElement(\"a\", {\n className: classNames(todayCls, disabled && \"\".concat(todayCls, \"-disabled\")),\n \"aria-disabled\": disabled,\n onClick: function onClick() {\n if (!disabled) {\n triggerSelect(now, 'mouse', true);\n }\n }\n }, locale.today);\n }\n\n return /*#__PURE__*/React.createElement(PanelContext.Provider, {\n value: _objectSpread(_objectSpread({}, panelContext), {}, {\n hideHeader: 'hideHeader' in props ? hideHeader : panelContext.hideHeader,\n hidePrevBtn: inRange && panelPosition === 'right',\n hideNextBtn: inRange && panelPosition === 'left'\n })\n }, /*#__PURE__*/React.createElement(\"div\", {\n tabIndex: tabIndex,\n className: classNames(\"\".concat(prefixCls, \"-panel\"), className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-panel-has-range\"), rangedValue && rangedValue[0] && rangedValue[1]), _defineProperty(_classNames, \"\".concat(prefixCls, \"-panel-has-range-hover\"), hoverRangedValue && hoverRangedValue[0] && hoverRangedValue[1]), _defineProperty(_classNames, \"\".concat(prefixCls, \"-panel-rtl\"), direction === 'rtl'), _classNames)),\n style: style,\n onKeyDown: onInternalKeyDown,\n onBlur: onInternalBlur,\n onMouseDown: onMouseDown,\n ref: panelDivRef\n }, panelNode, extraFooter || rangesNode || todayNode ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, extraFooter, rangesNode, todayNode) : null));\n}\n\nexport default PickerPanel;\n/* eslint-enable */"]},"metadata":{},"sourceType":"module"}