1 line
54 KiB
JSON
1 line
54 KiB
JSON
|
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useEvent, useMergedState } from 'rc-util';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport omit from \"rc-util/es/omit\";\nimport pickAttrs from \"rc-util/es/pickAttrs\";\nimport * as React from 'react';\nimport useToggleDates from \"../hooks/useToggleDates\";\nimport PickerTrigger from \"../PickerTrigger\";\nimport { pickTriggerProps } from \"../PickerTrigger/util\";\nimport { toArray } from \"../utils/miscUtil\";\nimport PickerContext from \"./context\";\nimport useCellRender from \"./hooks/useCellRender\";\nimport useFieldsInvalidate from \"./hooks/useFieldsInvalidate\";\nimport useFilledProps from \"./hooks/useFilledProps\";\nimport useOpen from \"./hooks/useOpen\";\nimport usePickerRef from \"./hooks/usePickerRef\";\nimport usePresets from \"./hooks/usePresets\";\nimport useRangeActive from \"./hooks/useRangeActive\";\nimport useRangePickerValue from \"./hooks/useRangePickerValue\";\nimport useRangeValue, { useInnerValue } from \"./hooks/useRangeValue\";\nimport useShowNow from \"./hooks/useShowNow\";\nimport Popup from \"./Popup\";\nimport SingleSelector from \"./Selector/SingleSelector\";\n\n// TODO: isInvalidateDate with showTime.disabledTime should not provide `range` prop\n\n/** Internal usage. For cross function get same aligned props */\n\nfunction Picker(props, ref) {\n // ========================= Prop =========================\n var _useFilledProps = useFilledProps(props),\n _useFilledProps2 = _slicedToArray(_useFilledProps, 6),\n filledProps = _useFilledProps2[0],\n internalPicker = _useFilledProps2[1],\n complexPicker = _useFilledProps2[2],\n formatList = _useFilledProps2[3],\n maskFormat = _useFilledProps2[4],\n isInvalidateDate = _useFilledProps2[5];\n var _ref = filledProps,\n prefixCls = _ref.prefixCls,\n styles = _ref.styles,\n classNames = _ref.classNames,\n order = _ref.order,\n defaultValue = _ref.defaultValue,\n value = _ref.value,\n needConfirm = _ref.needConfirm,\n onChange = _ref.onChange,\n onKeyDown = _ref.onKeyDown,\n disabled = _ref.disabled,\n disabledDate = _ref.disabledDate,\n minDate = _ref.minDate,\n maxDate = _ref.maxDate,\n defaultOpen = _ref.defaultOpen,\n open = _ref.open,\n onOpenChange = _ref.onOpenChange,\n locale = _ref.locale,\n generateConfig = _ref.generateConfig,\n picker = _ref.picker,\n showNow = _ref.showNow,\n showToday = _ref.showToday,\n showTime = _ref.showTime,\n mode = _ref.mode,\n onPanelChange = _ref.onPanelChange,\n onCalendarChange = _ref.onCalendarChange,\n onOk = _ref.onOk,\n multiple = _ref.multiple,\n defaultPickerValue = _ref.defaultPickerValue,\n pickerValue = _ref.pickerValue,\n onPickerValueChange = _ref.onPickerValueChange,\n inputReadOnly = _ref.inputReadOnly,\n suffixIcon = _ref.suffixIcon,\n removeIcon = _ref.removeIcon,\n onFocus = _ref.onFocus,\n onBlur = _ref.onBlur,\n presets = _ref.presets,\n components = _ref.components,\n cellRender = _ref.cellRender,\n dateRender = _ref.dateRender,\n monthCellRender = _ref.monthCellRender,\n onClick = _ref.onClick;\n\n // ========================= Refs =========================\n var selectorRef = usePickerRef(ref);\n\n // ========================= Util =========================\n function pickerParam(values) {\n if (values === null) {\n return null;\n }\n return multiple ? values : values[0];\n }\n var toggleDates = useToggleDates(generateConfig, locale, internalPicker);\n\n // ========================= Open =========================\n var _useOpen = useOpen(open, defaultOpen, [disabled], onOpenChange),\n _useOpen2 = _slicedToArray(_useOpen, 2),\n mergedOpen = _useOpen2[0],\n triggerOpen =
|