import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["events","dateTimeView","locale","dropdownForm","dropdownClassName","dropdownRef","multiplicityHours","multiplicityMinutes","multiplicitySeconds","renderAdditionalControls","currentVisibleDate","onChangeCurrentVisibleDate","onDropdownOpen","dropdownOpen","ignoreOutsideClicksRefs","disabled","inputRef"];import React,{forwardRef,useEffect,useRef}from"react";import{useClickOutside}from"../../../hooks/useClickOutside/useClickOutside";import{useForkRef}from"../../../hooks/useForkRef";import{setRef}from"../../../utils/setRef";import{DatePickerDropdown}from"../DatePickerDropdown/DatePickerDropdown";import{DatePickerFieldTypeTime}from"../DatePickerFieldTypeTime/DatePickerFieldTypeTime";import{datePickerPropFormatTypeDateTime,getDropdownZIndex,getMultiplicityTime}from"../helpers";import{datePickerPropDateTimeViewDefault}from"../types";import{useCalendarVisible}from"../useCalendarVisible";export var DatePickerTypeTime=forwardRef(function(a,b){var c=a.events,d=a.dateTimeView,e=void 0===d?datePickerPropDateTimeViewDefault:d,f=a.locale,g=a.dropdownForm,h=a.dropdownClassName,i=a.dropdownRef,j=a.multiplicityHours,k=a.multiplicityMinutes,l=a.multiplicitySeconds,m=a.renderAdditionalControls,n=a.currentVisibleDate,o=a.onChangeCurrentVisibleDate,p=a.onDropdownOpen,q=a.dropdownOpen,r=a.ignoreOutsideClicksRefs,s=a.disabled,t=a.inputRef,u=_objectWithoutProperties(a,_excluded),v=getMultiplicityTime(u.format||datePickerPropFormatTypeDateTime,j,k,l),w=_slicedToArray(v,3),x=w[0],y=w[1],z=w[2],A=useRef(null),B=useRef(null),C=useRef(null),D=useCalendarVisible({dropdownOpen:q,onDropdownOpen:p,disabled:s,startRef:C}),E=_slicedToArray(D,2),F=E[0],G=E[1];return useEffect(function(){b&&setRef(b,A.current)},[b,A]),useClickOutside({isActive:F,ignoreClicksInsideRefs:[A,B].concat(_toConsumableArray(null!==r&&void 0!==r?r:[])),handler:G.off}),React.createElement(React.Fragment,null,React.createElement(DatePickerFieldTypeTime,Object.assign({},u,{ref:A,inputRef:useForkRef([C,t]),onClick:G.on,multiplicityHours:x,multiplicitySeconds:z,multiplicityMinutes:y,disabled:s})),React.createElement(DatePickerDropdown,{ref:useForkRef([i,B]),anchorRef:A,isOpen:F,value:a.value||void 0,type:"time",view:e,events:c,locale:f,minDate:a.minDate,maxDate:a.maxDate,form:g,className:h,onChange:a.onChange,renderAdditionalControls:m,multiplicityHours:x,multiplicitySeconds:z,multiplicityMinutes:y,zIndex:getDropdownZIndex(a.style)}))});
//# sourceMappingURL=DatePickerTypeTime.js.map