UNPKG

26.4 kBJavaScriptView Raw
1"use strict";
2'use client';
3
4var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6Object.defineProperty(exports, "__esModule", {
7 value: true
8});
9exports.rootOverridesResolver = exports.inputOverridesResolver = exports.default = exports.InputBaseRoot = exports.InputBaseInput = void 0;
10var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
11var React = _interopRequireWildcard(require("react"));
12var _propTypes = _interopRequireDefault(require("prop-types"));
13var _clsx = _interopRequireDefault(require("clsx"));
14var _elementTypeAcceptingRef = _interopRequireDefault(require("@mui/utils/elementTypeAcceptingRef"));
15var _refType = _interopRequireDefault(require("@mui/utils/refType"));
16var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
17var _TextareaAutosize = _interopRequireDefault(require("../TextareaAutosize"));
18var _isHostComponent = _interopRequireDefault(require("../utils/isHostComponent"));
19var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
20var _FormControlContext = _interopRequireDefault(require("../FormControl/FormControlContext"));
21var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
22var _zeroStyled = require("../zero-styled");
23var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
24var _DefaultPropsProvider = require("../DefaultPropsProvider");
25var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
26var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
27var _useEnhancedEffect = _interopRequireDefault(require("../utils/useEnhancedEffect"));
28var _utils = require("./utils");
29var _inputBaseClasses = _interopRequireWildcard(require("./inputBaseClasses"));
30var _jsxRuntime = require("react/jsx-runtime");
31var _InputGlobalStyles;
32const rootOverridesResolver = (props, styles) => {
33 const {
34 ownerState
35 } = props;
36 return [styles.root, ownerState.formControl && styles.formControl, ownerState.startAdornment && styles.adornedStart, ownerState.endAdornment && styles.adornedEnd, ownerState.error && styles.error, ownerState.size === 'small' && styles.sizeSmall, ownerState.multiline && styles.multiline, ownerState.color && styles[`color${(0, _capitalize.default)(ownerState.color)}`], ownerState.fullWidth && styles.fullWidth, ownerState.hiddenLabel && styles.hiddenLabel];
37};
38exports.rootOverridesResolver = rootOverridesResolver;
39const inputOverridesResolver = (props, styles) => {
40 const {
41 ownerState
42 } = props;
43 return [styles.input, ownerState.size === 'small' && styles.inputSizeSmall, ownerState.multiline && styles.inputMultiline, ownerState.type === 'search' && styles.inputTypeSearch, ownerState.startAdornment && styles.inputAdornedStart, ownerState.endAdornment && styles.inputAdornedEnd, ownerState.hiddenLabel && styles.inputHiddenLabel];
44};
45exports.inputOverridesResolver = inputOverridesResolver;
46const useUtilityClasses = ownerState => {
47 const {
48 classes,
49 color,
50 disabled,
51 error,
52 endAdornment,
53 focused,
54 formControl,
55 fullWidth,
56 hiddenLabel,
57 multiline,
58 readOnly,
59 size,
60 startAdornment,
61 type
62 } = ownerState;
63 const slots = {
64 root: ['root', `color${(0, _capitalize.default)(color)}`, disabled && 'disabled', error && 'error', fullWidth && 'fullWidth', focused && 'focused', formControl && 'formControl', size && size !== 'medium' && `size${(0, _capitalize.default)(size)}`, multiline && 'multiline', startAdornment && 'adornedStart', endAdornment && 'adornedEnd', hiddenLabel && 'hiddenLabel', readOnly && 'readOnly'],
65 input: ['input', disabled && 'disabled', type === 'search' && 'inputTypeSearch', multiline && 'inputMultiline', size === 'small' && 'inputSizeSmall', hiddenLabel && 'inputHiddenLabel', startAdornment && 'inputAdornedStart', endAdornment && 'inputAdornedEnd', readOnly && 'readOnly']
66 };
67 return (0, _composeClasses.default)(slots, _inputBaseClasses.getInputBaseUtilityClass, classes);
68};
69const InputBaseRoot = exports.InputBaseRoot = (0, _zeroStyled.styled)('div', {
70 name: 'MuiInputBase',
71 slot: 'Root',
72 overridesResolver: rootOverridesResolver
73})((0, _memoTheme.default)(({
74 theme
75}) => ({
76 ...theme.typography.body1,
77 color: (theme.vars || theme).palette.text.primary,
78 lineHeight: '1.4375em',
79 // 23px
80 boxSizing: 'border-box',
81 // Prevent padding issue with fullWidth.
82 position: 'relative',
83 cursor: 'text',
84 display: 'inline-flex',
85 alignItems: 'center',
86 [`&.${_inputBaseClasses.default.disabled}`]: {
87 color: (theme.vars || theme).palette.text.disabled,
88 cursor: 'default'
89 },
90 variants: [{
91 props: ({
92 ownerState
93 }) => ownerState.multiline,
94 style: {
95 padding: '4px 0 5px'
96 }
97 }, {
98 props: ({
99 ownerState,
100 size
101 }) => ownerState.multiline && size === 'small',
102 style: {
103 paddingTop: 1
104 }
105 }, {
106 props: ({
107 ownerState
108 }) => ownerState.fullWidth,
109 style: {
110 width: '100%'
111 }
112 }]
113})));
114const InputBaseInput = exports.InputBaseInput = (0, _zeroStyled.styled)('input', {
115 name: 'MuiInputBase',
116 slot: 'Input',
117 overridesResolver: inputOverridesResolver
118})((0, _memoTheme.default)(({
119 theme
120}) => {
121 const light = theme.palette.mode === 'light';
122 const placeholder = {
123 color: 'currentColor',
124 ...(theme.vars ? {
125 opacity: theme.vars.opacity.inputPlaceholder
126 } : {
127 opacity: light ? 0.42 : 0.5
128 }),
129 transition: theme.transitions.create('opacity', {
130 duration: theme.transitions.duration.shorter
131 })
132 };
133 const placeholderHidden = {
134 opacity: '0 !important'
135 };
136 const placeholderVisible = theme.vars ? {
137 opacity: theme.vars.opacity.inputPlaceholder
138 } : {
139 opacity: light ? 0.42 : 0.5
140 };
141 return {
142 font: 'inherit',
143 letterSpacing: 'inherit',
144 color: 'currentColor',
145 padding: '4px 0 5px',
146 border: 0,
147 boxSizing: 'content-box',
148 background: 'none',
149 height: '1.4375em',
150 // Reset 23pxthe native input line-height
151 margin: 0,
152 // Reset for Safari
153 WebkitTapHighlightColor: 'transparent',
154 display: 'block',
155 // Make the flex item shrink with Firefox
156 minWidth: 0,
157 width: '100%',
158 '&::-webkit-input-placeholder': placeholder,
159 '&::-moz-placeholder': placeholder,
160 // Firefox 19+
161 '&::-ms-input-placeholder': placeholder,
162 // Edge
163 '&:focus': {
164 outline: 0
165 },
166 // Reset Firefox invalid required input style
167 '&:invalid': {
168 boxShadow: 'none'
169 },
170 '&::-webkit-search-decoration': {
171 // Remove the padding when type=search.
172 WebkitAppearance: 'none'
173 },
174 // Show and hide the placeholder logic
175 [`label[data-shrink=false] + .${_inputBaseClasses.default.formControl} &`]: {
176 '&::-webkit-input-placeholder': placeholderHidden,
177 '&::-moz-placeholder': placeholderHidden,
178 // Firefox 19+
179 '&::-ms-input-placeholder': placeholderHidden,
180 // Edge
181 '&:focus::-webkit-input-placeholder': placeholderVisible,
182 '&:focus::-moz-placeholder': placeholderVisible,
183 // Firefox 19+
184 '&:focus::-ms-input-placeholder': placeholderVisible // Edge
185 },
186 [`&.${_inputBaseClasses.default.disabled}`]: {
187 opacity: 1,
188 // Reset iOS opacity
189 WebkitTextFillColor: (theme.vars || theme).palette.text.disabled // Fix opacity Safari bug
190 },
191 variants: [{
192 props: ({
193 ownerState
194 }) => !ownerState.disableInjectingGlobalStyles,
195 style: {
196 animationName: 'mui-auto-fill-cancel',
197 animationDuration: '10ms',
198 '&:-webkit-autofill': {
199 animationDuration: '5000s',
200 animationName: 'mui-auto-fill'
201 }
202 }
203 }, {
204 props: {
205 size: 'small'
206 },
207 style: {
208 paddingTop: 1
209 }
210 }, {
211 props: ({
212 ownerState
213 }) => ownerState.multiline,
214 style: {
215 height: 'auto',
216 resize: 'none',
217 padding: 0,
218 paddingTop: 0
219 }
220 }, {
221 props: {
222 type: 'search'
223 },
224 style: {
225 MozAppearance: 'textfield' // Improve type search style.
226 }
227 }]
228 };
229}));
230const InputGlobalStyles = (0, _zeroStyled.globalCss)({
231 '@keyframes mui-auto-fill': {
232 from: {
233 display: 'block'
234 }
235 },
236 '@keyframes mui-auto-fill-cancel': {
237 from: {
238 display: 'block'
239 }
240 }
241});
242
243/**
244 * `InputBase` contains as few styles as possible.
245 * It aims to be a simple building block for creating an input.
246 * It contains a load of style reset and some state logic.
247 */
248const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
249 const props = (0, _DefaultPropsProvider.useDefaultProps)({
250 props: inProps,
251 name: 'MuiInputBase'
252 });
253 const {
254 'aria-describedby': ariaDescribedby,
255 autoComplete,
256 autoFocus,
257 className,
258 color,
259 components = {},
260 componentsProps = {},
261 defaultValue,
262 disabled,
263 disableInjectingGlobalStyles,
264 endAdornment,
265 error,
266 fullWidth = false,
267 id,
268 inputComponent = 'input',
269 inputProps: inputPropsProp = {},
270 inputRef: inputRefProp,
271 margin,
272 maxRows,
273 minRows,
274 multiline = false,
275 name,
276 onBlur,
277 onChange,
278 onClick,
279 onFocus,
280 onKeyDown,
281 onKeyUp,
282 placeholder,
283 readOnly,
284 renderSuffix,
285 rows,
286 size,
287 slotProps = {},
288 slots = {},
289 startAdornment,
290 type = 'text',
291 value: valueProp,
292 ...other
293 } = props;
294 const value = inputPropsProp.value != null ? inputPropsProp.value : valueProp;
295 const {
296 current: isControlled
297 } = React.useRef(value != null);
298 const inputRef = React.useRef();
299 const handleInputRefWarning = React.useCallback(instance => {
300 if (process.env.NODE_ENV !== 'production') {
301 if (instance && instance.nodeName !== 'INPUT' && !instance.focus) {
302 console.error(['MUI: You have provided a `inputComponent` to the input component', 'that does not correctly handle the `ref` prop.', 'Make sure the `ref` prop is called with a HTMLInputElement.'].join('\n'));
303 }
304 }
305 }, []);
306 const handleInputRef = (0, _useForkRef.default)(inputRef, inputRefProp, inputPropsProp.ref, handleInputRefWarning);
307 const [focused, setFocused] = React.useState(false);
308 const muiFormControl = (0, _useFormControl.default)();
309 if (process.env.NODE_ENV !== 'production') {
310 // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
311 // eslint-disable-next-line react-hooks/rules-of-hooks
312 React.useEffect(() => {
313 if (muiFormControl) {
314 return muiFormControl.registerEffect();
315 }
316 return undefined;
317 }, [muiFormControl]);
318 }
319 const fcs = (0, _formControlState.default)({
320 props,
321 muiFormControl,
322 states: ['color', 'disabled', 'error', 'hiddenLabel', 'size', 'required', 'filled']
323 });
324 fcs.focused = muiFormControl ? muiFormControl.focused : focused;
325
326 // The blur won't fire when the disabled state is set on a focused input.
327 // We need to book keep the focused state manually.
328 React.useEffect(() => {
329 if (!muiFormControl && disabled && focused) {
330 setFocused(false);
331 if (onBlur) {
332 onBlur();
333 }
334 }
335 }, [muiFormControl, disabled, focused, onBlur]);
336 const onFilled = muiFormControl && muiFormControl.onFilled;
337 const onEmpty = muiFormControl && muiFormControl.onEmpty;
338 const checkDirty = React.useCallback(obj => {
339 if ((0, _utils.isFilled)(obj)) {
340 if (onFilled) {
341 onFilled();
342 }
343 } else if (onEmpty) {
344 onEmpty();
345 }
346 }, [onFilled, onEmpty]);
347 (0, _useEnhancedEffect.default)(() => {
348 if (isControlled) {
349 checkDirty({
350 value
351 });
352 }
353 }, [value, checkDirty, isControlled]);
354 const handleFocus = event => {
355 if (onFocus) {
356 onFocus(event);
357 }
358 if (inputPropsProp.onFocus) {
359 inputPropsProp.onFocus(event);
360 }
361 if (muiFormControl && muiFormControl.onFocus) {
362 muiFormControl.onFocus(event);
363 } else {
364 setFocused(true);
365 }
366 };
367 const handleBlur = event => {
368 if (onBlur) {
369 onBlur(event);
370 }
371 if (inputPropsProp.onBlur) {
372 inputPropsProp.onBlur(event);
373 }
374 if (muiFormControl && muiFormControl.onBlur) {
375 muiFormControl.onBlur(event);
376 } else {
377 setFocused(false);
378 }
379 };
380 const handleChange = (event, ...args) => {
381 if (!isControlled) {
382 const element = event.target || inputRef.current;
383 if (element == null) {
384 throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Expected valid input target. ' + 'Did you use a custom `inputComponent` and forget to forward refs? ' + 'See https://mui.com/r/input-component-ref-interface for more info.' : (0, _formatMuiErrorMessage2.default)(1));
385 }
386 checkDirty({
387 value: element.value
388 });
389 }
390 if (inputPropsProp.onChange) {
391 inputPropsProp.onChange(event, ...args);
392 }
393
394 // Perform in the willUpdate
395 if (onChange) {
396 onChange(event, ...args);
397 }
398 };
399
400 // Check the input state on mount, in case it was filled by the user
401 // or auto filled by the browser before the hydration (for SSR).
402 React.useEffect(() => {
403 checkDirty(inputRef.current);
404 // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
405 // eslint-disable-next-line react-hooks/exhaustive-deps
406 }, []);
407 const handleClick = event => {
408 if (inputRef.current && event.currentTarget === event.target) {
409 inputRef.current.focus();
410 }
411 if (onClick) {
412 onClick(event);
413 }
414 };
415 let InputComponent = inputComponent;
416 let inputProps = inputPropsProp;
417 if (multiline && InputComponent === 'input') {
418 if (rows) {
419 if (process.env.NODE_ENV !== 'production') {
420 if (minRows || maxRows) {
421 console.warn('MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set.');
422 }
423 }
424 inputProps = {
425 type: undefined,
426 minRows: rows,
427 maxRows: rows,
428 ...inputProps
429 };
430 } else {
431 inputProps = {
432 type: undefined,
433 maxRows,
434 minRows,
435 ...inputProps
436 };
437 }
438 InputComponent = _TextareaAutosize.default;
439 }
440 const handleAutoFill = event => {
441 // Provide a fake value as Chrome might not let you access it for security reasons.
442 checkDirty(event.animationName === 'mui-auto-fill-cancel' ? inputRef.current : {
443 value: 'x'
444 });
445 };
446 React.useEffect(() => {
447 if (muiFormControl) {
448 muiFormControl.setAdornedStart(Boolean(startAdornment));
449 }
450 }, [muiFormControl, startAdornment]);
451 const ownerState = {
452 ...props,
453 color: fcs.color || 'primary',
454 disabled: fcs.disabled,
455 endAdornment,
456 error: fcs.error,
457 focused: fcs.focused,
458 formControl: muiFormControl,
459 fullWidth,
460 hiddenLabel: fcs.hiddenLabel,
461 multiline,
462 size: fcs.size,
463 startAdornment,
464 type
465 };
466 const classes = useUtilityClasses(ownerState);
467 const Root = slots.root || components.Root || InputBaseRoot;
468 const rootProps = slotProps.root || componentsProps.root || {};
469 const Input = slots.input || components.Input || InputBaseInput;
470 inputProps = {
471 ...inputProps,
472 ...(slotProps.input ?? componentsProps.input)
473 };
474 return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
475 children: [!disableInjectingGlobalStyles && typeof InputGlobalStyles === 'function' && (// For Emotion/Styled-components, InputGlobalStyles will be a function
476 // For Pigment CSS, this has no effect because the InputGlobalStyles will be null.
477 _InputGlobalStyles || (_InputGlobalStyles = /*#__PURE__*/(0, _jsxRuntime.jsx)(InputGlobalStyles, {}))), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, {
478 ...rootProps,
479 ref: ref,
480 onClick: handleClick,
481 ...other,
482 ...(!(0, _isHostComponent.default)(Root) && {
483 ownerState: {
484 ...ownerState,
485 ...rootProps.ownerState
486 }
487 }),
488 className: (0, _clsx.default)(classes.root, rootProps.className, className, readOnly && 'MuiInputBase-readOnly'),
489 children: [startAdornment, /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlContext.default.Provider, {
490 value: null,
491 children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Input, {
492 "aria-invalid": fcs.error,
493 "aria-describedby": ariaDescribedby,
494 autoComplete: autoComplete,
495 autoFocus: autoFocus,
496 defaultValue: defaultValue,
497 disabled: fcs.disabled,
498 id: id,
499 onAnimationStart: handleAutoFill,
500 name: name,
501 placeholder: placeholder,
502 readOnly: readOnly,
503 required: fcs.required,
504 rows: rows,
505 value: value,
506 onKeyDown: onKeyDown,
507 onKeyUp: onKeyUp,
508 type: type,
509 ...inputProps,
510 ...(!(0, _isHostComponent.default)(Input) && {
511 as: InputComponent,
512 ownerState: {
513 ...ownerState,
514 ...inputProps.ownerState
515 }
516 }),
517 ref: handleInputRef,
518 className: (0, _clsx.default)(classes.input, inputProps.className, readOnly && 'MuiInputBase-readOnly'),
519 onBlur: handleBlur,
520 onChange: handleChange,
521 onFocus: handleFocus
522 })
523 }), endAdornment, renderSuffix ? renderSuffix({
524 ...fcs,
525 startAdornment
526 }) : null]
527 })]
528 });
529});
530process.env.NODE_ENV !== "production" ? InputBase.propTypes /* remove-proptypes */ = {
531 // ┌────────────────────────────── Warning ──────────────────────────────┐
532 // │ These PropTypes are generated from the TypeScript type definitions. │
533 // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
534 // └─────────────────────────────────────────────────────────────────────┘
535 /**
536 * @ignore
537 */
538 'aria-describedby': _propTypes.default.string,
539 /**
540 * This prop helps users to fill forms faster, especially on mobile devices.
541 * The name can be confusing, as it's more like an autofill.
542 * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
543 */
544 autoComplete: _propTypes.default.string,
545 /**
546 * If `true`, the `input` element is focused during the first mount.
547 */
548 autoFocus: _propTypes.default.bool,
549 /**
550 * Override or extend the styles applied to the component.
551 */
552 classes: _propTypes.default.object,
553 /**
554 * @ignore
555 */
556 className: _propTypes.default.string,
557 /**
558 * The color of the component.
559 * It supports both default and custom theme colors, which can be added as shown in the
560 * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
561 * The prop defaults to the value (`'primary'`) inherited from the parent FormControl component.
562 */
563 color: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), _propTypes.default.string]),
564 /**
565 * The components used for each slot inside.
566 *
567 * @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
568 *
569 * @default {}
570 */
571 components: _propTypes.default.shape({
572 Input: _propTypes.default.elementType,
573 Root: _propTypes.default.elementType
574 }),
575 /**
576 * The extra props for the slot components.
577 * You can override the existing props or add new ones.
578 *
579 * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
580 *
581 * @default {}
582 */
583 componentsProps: _propTypes.default.shape({
584 input: _propTypes.default.object,
585 root: _propTypes.default.object
586 }),
587 /**
588 * The default value. Use when the component is not controlled.
589 */
590 defaultValue: _propTypes.default.any,
591 /**
592 * If `true`, the component is disabled.
593 * The prop defaults to the value (`false`) inherited from the parent FormControl component.
594 */
595 disabled: _propTypes.default.bool,
596 /**
597 * If `true`, GlobalStyles for the auto-fill keyframes will not be injected/removed on mount/unmount. Make sure to inject them at the top of your application.
598 * This option is intended to help with boosting the initial rendering performance if you are loading a big amount of Input components at once.
599 * @default false
600 */
601 disableInjectingGlobalStyles: _propTypes.default.bool,
602 /**
603 * End `InputAdornment` for this component.
604 */
605 endAdornment: _propTypes.default.node,
606 /**
607 * If `true`, the `input` will indicate an error.
608 * The prop defaults to the value (`false`) inherited from the parent FormControl component.
609 */
610 error: _propTypes.default.bool,
611 /**
612 * If `true`, the `input` will take up the full width of its container.
613 * @default false
614 */
615 fullWidth: _propTypes.default.bool,
616 /**
617 * The id of the `input` element.
618 */
619 id: _propTypes.default.string,
620 /**
621 * The component used for the `input` element.
622 * Either a string to use a HTML element or a component.
623 * @default 'input'
624 */
625 inputComponent: _elementTypeAcceptingRef.default,
626 /**
627 * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
628 * @default {}
629 */
630 inputProps: _propTypes.default.object,
631 /**
632 * Pass a ref to the `input` element.
633 */
634 inputRef: _refType.default,
635 /**
636 * If `dense`, will adjust vertical spacing. This is normally obtained via context from
637 * FormControl.
638 * The prop defaults to the value (`'none'`) inherited from the parent FormControl component.
639 */
640 margin: _propTypes.default.oneOf(['dense', 'none']),
641 /**
642 * Maximum number of rows to display when multiline option is set to true.
643 */
644 maxRows: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
645 /**
646 * Minimum number of rows to display when multiline option is set to true.
647 */
648 minRows: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
649 /**
650 * If `true`, a [TextareaAutosize](https://mui.com/material-ui/react-textarea-autosize/) element is rendered.
651 * @default false
652 */
653 multiline: _propTypes.default.bool,
654 /**
655 * Name attribute of the `input` element.
656 */
657 name: _propTypes.default.string,
658 /**
659 * Callback fired when the `input` is blurred.
660 *
661 * Notice that the first argument (event) might be undefined.
662 */
663 onBlur: _propTypes.default.func,
664 /**
665 * Callback fired when the value is changed.
666 *
667 * @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
668 * You can pull out the new value by accessing `event.target.value` (string).
669 */
670 onChange: _propTypes.default.func,
671 /**
672 * @ignore
673 */
674 onClick: _propTypes.default.func,
675 /**
676 * @ignore
677 */
678 onFocus: _propTypes.default.func,
679 /**
680 * Callback fired when the `input` doesn't satisfy its constraints.
681 */
682 onInvalid: _propTypes.default.func,
683 /**
684 * @ignore
685 */
686 onKeyDown: _propTypes.default.func,
687 /**
688 * @ignore
689 */
690 onKeyUp: _propTypes.default.func,
691 /**
692 * The short hint displayed in the `input` before the user enters a value.
693 */
694 placeholder: _propTypes.default.string,
695 /**
696 * It prevents the user from changing the value of the field
697 * (not from interacting with the field).
698 */
699 readOnly: _propTypes.default.bool,
700 /**
701 * @ignore
702 */
703 renderSuffix: _propTypes.default.func,
704 /**
705 * If `true`, the `input` element is required.
706 * The prop defaults to the value (`false`) inherited from the parent FormControl component.
707 */
708 required: _propTypes.default.bool,
709 /**
710 * Number of rows to display when multiline option is set to true.
711 */
712 rows: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
713 /**
714 * The size of the component.
715 */
716 size: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['medium', 'small']), _propTypes.default.string]),
717 /**
718 * The extra props for the slot components.
719 * You can override the existing props or add new ones.
720 *
721 * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
722 *
723 * @default {}
724 */
725 slotProps: _propTypes.default.shape({
726 input: _propTypes.default.object,
727 root: _propTypes.default.object
728 }),
729 /**
730 * The components used for each slot inside.
731 *
732 * This prop is an alias for the `components` prop, which will be deprecated in the future.
733 *
734 * @default {}
735 */
736 slots: _propTypes.default.shape({
737 input: _propTypes.default.elementType,
738 root: _propTypes.default.elementType
739 }),
740 /**
741 * Start `InputAdornment` for this component.
742 */
743 startAdornment: _propTypes.default.node,
744 /**
745 * The system prop that allows defining system overrides as well as additional CSS styles.
746 */
747 sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
748 /**
749 * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
750 * @default 'text'
751 */
752 type: _propTypes.default.string,
753 /**
754 * The value of the `input` element, required for a controlled component.
755 */
756 value: _propTypes.default.any
757} : void 0;
758var _default = exports.default = InputBase;
\No newline at end of file