@gsretail.com/gui-core
Version:
A skeleton to create your own React component library using Rollup, TypeScript, Sass and Storybook
2 lines (1 loc) • 2.9 kB
JavaScript
import o from"../../../@babel/runtime/helpers/esm/extends.js";import e from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";import*as n from"react";import t from"../../../prop-types/index.js";import{useDatePickerDefaultizedProps as r,datePickerValueManager as a}from"../DatePicker/shared.js";import{DatePickerToolbar as s}from"../DatePicker/DatePickerToolbar.js";import{PickerStaticWrapper as i}from"../internals/components/PickerStaticWrapper/PickerStaticWrapper.js";import{useDateValidation as p}from"../internals/hooks/validation/useDateValidation.js";import{usePickerState as l}from"../internals/hooks/usePickerState.js";import{jsx as c}from"react/jsx-runtime";import{CalendarOrClockPicker as m}from"../internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js";const u=["ToolbarComponent","value","onChange","displayStaticWrapperAs","components","componentsProps","className"],d=n.forwardRef((function(n,t){const d=r(n,"MuiStaticDatePicker"),{ToolbarComponent:b=s,displayStaticWrapperAs:f="mobile",components:h,componentsProps:P,className:g}=d,y=e(d,u),{pickerProps:k,inputProps:T,wrapperProps:j}=l(d,a),O=null!==p(d),D=o({},T,y,{ref:t,validationError:O,components:h});return c(i,o({displayStaticWrapperAs:f,components:h,componentsProps:P,className:g},j,{children:c(m,o({},k,{toolbarTitle:d.label||d.toolbarTitle,ToolbarComponent:b,DateInputProps:D,components:h,componentsProps:P},y))}))}));"production"!==process.env.NODE_ENV&&(d.propTypes={acceptRegex:t.instanceOf(RegExp),autoFocus:t.bool,className:t.string,closeOnSelect:t.bool,components:t.object,componentsProps:t.object,dayOfWeekFormatter:t.func,defaultCalendarMonth:t.any,disabled:t.bool,disableFuture:t.bool,disableHighlightToday:t.bool,disableMaskedInput:t.bool,disableOpenPicker:t.bool,disablePast:t.bool,displayStaticWrapperAs:t.oneOf(["desktop","mobile"]),getOpenDialogAriaText:t.func,getViewSwitchingButtonText:t.func,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,minDate:t.any,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","month","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,shouldDisableYear:t.func,showDaysOutsideCurrentMonth:t.bool,showToolbar:t.bool,ToolbarComponent:t.elementType,toolbarFormat:t.string,toolbarPlaceholder:t.node,toolbarTitle:t.node,value:t.any,views:t.arrayOf(t.oneOf(["day","month","year"]).isRequired)});export{d as StaticDatePicker};