@gsretail.com/gui-core
Version:
A skeleton to create your own React component library using Rollup, TypeScript, Sass and Storybook
2 lines (1 loc) • 3.44 kB
JavaScript
import e from"../../../@babel/runtime/helpers/esm/extends.js";import o from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";import*as n from"react";import t from"../../../prop-types/index.js";import{useDateTimePickerDefaultizedProps as r,dateTimePickerValueManager as a}from"../DateTimePicker/shared.js";import{DateTimePickerToolbar as i}from"../DateTimePicker/DateTimePickerToolbar.js";import{PickerStaticWrapper as s}from"../internals/components/PickerStaticWrapper/PickerStaticWrapper.js";import{useDateTimeValidation as p}from"../internals/hooks/validation/useDateTimeValidation.js";import{usePickerState as l}from"../internals/hooks/usePickerState.js";import{DateTimePickerTabs as c}from"../DateTimePicker/DateTimePickerTabs.js";import{jsx as m}from"react/jsx-runtime";import{CalendarOrClockPicker as u}from"../internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js";const d=["displayStaticWrapperAs","onChange","ToolbarComponent","value","components","componentsProps","hideTabs","className"],b=n.forwardRef((function(t,b){const f=r(t,"MuiStaticDateTimePicker"),{displayStaticWrapperAs:T="mobile",ToolbarComponent:h=i,components:P,componentsProps:g,hideTabs:y="desktop"===T,className:k}=f,D=o(f,d),{pickerProps:j,inputProps:C,wrapperProps:O}=l(f,a),x=null!==p(f),I=n.useMemo((()=>e({Tabs:c},P)),[P]),S=e({},C,D,{ref:b,validationError:x,components:I,componentsProps:g});return m(s,e({displayStaticWrapperAs:T,components:I,componentsProps:g,className:k},O,{children:m(u,e({},j,{toolbarTitle:f.label||f.toolbarTitle,ToolbarComponent:h,DateInputProps:S,components:I,componentsProps:g,hideTabs:y},D))}))}));"production"!==process.env.NODE_ENV&&(b.propTypes={acceptRegex:t.instanceOf(RegExp),ampm:t.bool,ampmInClock:t.bool,autoFocus:t.bool,className:t.string,closeOnSelect:t.bool,components:t.object,componentsProps:t.object,dateRangeIcon:t.node,dayOfWeekFormatter:t.func,defaultCalendarMonth:t.any,disabled:t.bool,disableFuture:t.bool,disableHighlightToday:t.bool,disableIgnoringDatePartForTimeValidation:t.bool,disableMaskedInput:t.bool,disableOpenPicker:t.bool,disablePast:t.bool,displayStaticWrapperAs:t.oneOf(["desktop","mobile"]),getClockLabelText:t.func,getOpenDialogAriaText:t.func,getViewSwitchingButtonText:t.func,hideTabs:t.bool,ignoreInvalidInputs:t.bool,InputAdornmentProps:t.object,inputFormat:t.string,InputProps:t.object,inputRef:t.oneOfType([t.func,t.shape({current:t.object})]),label:t.node,leftArrowButtonText:t.string,loading:t.bool,mask:t.string,maxDate:t.any,maxDateTime:t.any,maxTime:t.any,minDate:t.any,minDateTime:t.any,minTime:t.any,minutesStep:t.number,onAccept:t.func,onChange:t.func.isRequired,onError:t.func,onMonthChange:t.func,onViewChange:t.func,onYearChange:t.func,OpenPickerButtonProps:t.object,openTo:t.oneOf(["day","hours","minutes","month","seconds","year"]),orientation:t.oneOf(["landscape","portrait"]),readOnly:t.bool,reduceAnimations:t.bool,renderDay:t.func,renderInput:t.func.isRequired,renderLoading:t.func,rifmFormatter:t.func,rightArrowButtonText:t.string,shouldDisableDate:t.func,shouldDisableMonth:t.func,shouldDisableTime:t.func,shouldDisableYear:t.func,showDaysOutsideCurrentMonth:t.bool,showToolbar:t.bool,timeIcon:t.node,ToolbarComponent:t.elementType,toolbarFormat:t.string,toolbarPlaceholder:t.node,toolbarTitle:t.node,value:t.any,views:t.arrayOf(t.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired)});export{b as StaticDateTimePicker};