1 line
6.2 KiB
JSON
1 line
6.2 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useEventCallback } from '@mui/material/utils';\nimport { onSpaceOrEnter } from '../utils/utils';\nimport { useLocaleText, useUtils } from '../hooks/useUtils';\nimport { getDisplayDate } from '../utils/text-field-helper';\n// TODO: why is this called \"Pure*\" when it's not memoized? Does \"Pure\" mean \"readonly\"?\nexport const PureDateInput = /*#__PURE__*/React.forwardRef(function PureDateInput(props, ref) {\n const {\n disabled,\n getOpenDialogAriaText: getOpenDialogAriaTextProp,\n inputFormat,\n InputProps,\n inputRef,\n label,\n openPicker: onOpen,\n rawValue,\n renderInput,\n TextFieldProps = {},\n validationError,\n className\n } = props;\n const localeText = useLocaleText(); // The prop can not be deprecated\n // Default is \"Choose date, ...\", but time pickers override it with \"Choose time, ...\"\n\n const getOpenDialogAriaText = getOpenDialogAriaTextProp != null ? getOpenDialogAriaTextProp : localeText.openDatePickerDialogue;\n const utils = useUtils();\n const PureDateInputProps = React.useMemo(() => _extends({}, InputProps, {\n readOnly: true\n }), [InputProps]);\n const inputValue = getDisplayDate(utils, rawValue, inputFormat);\n const handleOnClick = useEventCallback(event => {\n event.stopPropagation();\n onOpen();\n });\n return renderInput(_extends({\n label,\n disabled,\n ref,\n inputRef,\n error: validationError,\n InputProps: PureDateInputProps,\n className\n }, !props.readOnly && !props.disabled && {\n onClick: handleOnClick\n }, {\n inputProps: _extends({\n disabled,\n readOnly: true,\n 'aria-readonly': true,\n 'aria-label': getOpenDialogAriaText(rawValue, utils),\n value: inputValue\n }, !props.readOnly && {\n onClick: handleOnClick\n }, {\n onKeyDown: onSpaceOrEnter(onOpen)\n })\n }, TextFieldProps));\n});","map":{"version":3,"names":["_extends","React","useEventCallback","onSpaceOrEnter","useLocaleText","useUtils","getDisplayDate","PureDateInput","forwardRef","props","ref","disabled","getOpenDialogAriaText","getOpenDialogAriaTextProp","inputFormat","InputProps","inputRef","label","openPicker","onOpen","rawValue","renderInput","TextFieldProps","validationError","className","localeText","openDatePickerDialogue","utils","PureDateInputProps","useMemo","readOnly","inputValue","handleOnClick","event","stopPropagation","error","onClick","inputProps","value","onKeyDown"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/x-date-pickers/internals/components/PureDateInput.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useEventCallback } from '@mui/material/utils';\nimport { onSpaceOrEnter } from '../utils/utils';\nimport { useLocaleText, useUtils } from '../hooks/useUtils';\nimport { getDisplayDate } from '../utils/text-field-helper';\n// TODO: why is this called \"Pure*\" when it's not memoized? Does \"Pure\" mean \"readonly\"?\nexport const PureDateInput = /*#__PURE__*/React.forwardRef(function PureDateInput(props, ref) {\n const {\n disabled,\n getOpenDialogAriaText: getOpenDialogAriaTextProp,\n inputFormat,\n InputProps,\n inputRef,\n label,\n openPicker: onOpen,\n rawValue,\n renderInput,\n TextFieldProps = {},\n validationError,\n className\n } = props;\n const localeText = useLocaleText(); // The prop can not be deprecated\n // Default is \"Choose date, ...\", but time pickers override it with \"Choose time, ...\"\n\n const getOpenDialogAriaText = getOpenDialogAriaTextProp != null ? getOpenDialogAriaTextProp : localeText.openDatePickerDialogue;\n const utils = useUtils();\n const PureDateInputProps = React.useMemo(() => _extends({}, InputProps, {\n readOnly: true\n }), [InputProps]);\n const inputValue = getDisplayDate(utils, rawValue, inputFormat);\n const handleOnClick = useEventCallback(event => {\n event.stopPropagation();\n onOpen();\n });\n return renderInput(_extends({\n label,\n disabled,\n ref,\n inputRef,\n error: validationError,\n InputProps: PureDateInputProps,\n className\n }, !props.readOnly && !props.disabled && {\n onClick: handleOnClick\n }, {\n inputProps: _extends({\n disabled,\n readOnly: true,\n 'aria-readonly': true,\n 'aria-label': getOpenDialogAriaText(rawValue, utils),\n value: inputValue\n }, !props.readOnly && {\n onClick: handleOnClick\n }, {\n onKeyDown: onSpaceOrEnter(onOpen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