22
33import { createElement , useCallback , useEffect , useMemo , useRef , useState } from 'react' ;
44import { createPortal } from 'react-dom' ;
5- import PropTypes from 'prop-types' ;
65import makeEventProps from 'make-event-props' ;
76import clsx from 'clsx' ;
87import Calendar from 'react-calendar' ;
@@ -11,9 +10,6 @@ import Fit from 'react-fit';
1110
1211import DateTimeInput from './DateTimeInput.js' ;
1312
14- import { isMaxDate , isMinDate , rangeOf } from './shared/propTypes.js' ;
15-
16- import type { ReactNodeArray } from 'prop-types' ;
1713import type {
1814 ClassName ,
1915 CloseReason ,
@@ -59,7 +55,9 @@ const ClearIcon = (
5955 </ svg >
6056) ;
6157
62- type Icon = React . ReactElement | ReactNodeArray | null | string | number | boolean ;
58+ type ReactNodeLike = React . ReactNode | string | number | boolean | null | undefined ;
59+
60+ type Icon = ReactNodeLike | ReactNodeLike [ ] ;
6361
6462type IconOrRenderFunction = Icon | React . ComponentType | React . ReactElement ;
6563
@@ -902,61 +900,4 @@ const DateTimePicker: React.FC<DateTimePickerProps> = function DateTimePicker(pr
902900 ) ;
903901} ;
904902
905- const isValue = PropTypes . oneOfType ( [ PropTypes . string , PropTypes . instanceOf ( Date ) ] ) ;
906-
907- const isValueOrValueArray = PropTypes . oneOfType ( [ isValue , rangeOf ( isValue ) ] ) ;
908-
909- DateTimePicker . propTypes = {
910- amPmAriaLabel : PropTypes . string ,
911- autoFocus : PropTypes . bool ,
912- calendarAriaLabel : PropTypes . string ,
913- calendarClassName : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . arrayOf ( PropTypes . string ) ] ) ,
914- calendarIcon : PropTypes . oneOfType ( [ PropTypes . node , PropTypes . func ] ) ,
915- className : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . arrayOf ( PropTypes . string ) ] ) ,
916- clearAriaLabel : PropTypes . string ,
917- clearIcon : PropTypes . oneOfType ( [ PropTypes . node , PropTypes . func ] ) ,
918- clockClassName : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . arrayOf ( PropTypes . string ) ] ) ,
919- closeWidgets : PropTypes . bool ,
920- 'data-testid' : PropTypes . string ,
921- dayAriaLabel : PropTypes . string ,
922- dayPlaceholder : PropTypes . string ,
923- disableCalendar : PropTypes . bool ,
924- disableClock : PropTypes . bool ,
925- disabled : PropTypes . bool ,
926- format : PropTypes . string ,
927- hourAriaLabel : PropTypes . string ,
928- hourPlaceholder : PropTypes . string ,
929- id : PropTypes . string ,
930- isCalendarOpen : PropTypes . bool ,
931- isClockOpen : PropTypes . bool ,
932- locale : PropTypes . string ,
933- maxDate : isMaxDate ,
934- maxDetail : PropTypes . oneOf ( allViews ) ,
935- minDate : isMinDate ,
936- minuteAriaLabel : PropTypes . string ,
937- minutePlaceholder : PropTypes . string ,
938- monthAriaLabel : PropTypes . string ,
939- monthPlaceholder : PropTypes . string ,
940- name : PropTypes . string ,
941- nativeInputAriaLabel : PropTypes . string ,
942- onCalendarClose : PropTypes . func ,
943- onCalendarOpen : PropTypes . func ,
944- onChange : PropTypes . func ,
945- onClockClose : PropTypes . func ,
946- onClockOpen : PropTypes . func ,
947- onFocus : PropTypes . func ,
948- openWidgetsOnFocus : PropTypes . bool ,
949- required : PropTypes . bool ,
950- secondAriaLabel : PropTypes . string ,
951- secondPlaceholder : PropTypes . string ,
952- showLeadingZeros : PropTypes . bool ,
953- value : isValueOrValueArray ,
954- yearAriaLabel : PropTypes . string ,
955- yearPlaceholder : PropTypes . string ,
956- } ;
957-
958- if ( isBrowser ) {
959- DateTimePicker . propTypes . portalContainer = PropTypes . instanceOf ( HTMLElement ) ;
960- }
961-
962903export default DateTimePicker ;
0 commit comments