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","multiplicityHours","multiplicityMinutes","multiplicitySeconds","renderAdditionalControls","currentVisibleDate","onChangeCurrentVisibleDate","onDropdownOpen","dropdownOpen","ignoreOutsideClicksRefs"];import React,{forwardRef,useEffect,useRef}from"react";import{useClickOutside}from"../../../hooks/useClickOutside/useClickOutside";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.multiplicityHours,j=a.multiplicityMinutes,k=a.multiplicitySeconds,l=a.renderAdditionalControls,m=a.currentVisibleDate,n=a.onChangeCurrentVisibleDate,o=a.onDropdownOpen,p=a.dropdownOpen,q=a.ignoreOutsideClicksRefs,r=_objectWithoutProperties(a,_excluded),s=getMultiplicityTime(r.format||datePickerPropFormatTypeDateTime,i,j,k),t=_slicedToArray(s,3),u=t[0],v=t[1],w=t[2],x=useRef(null),y=useRef(null),z=useRef(null),A=useCalendarVisible({dropdownOpen:p,onDropdownOpen:o,startRef:z}),B=_slicedToArray(A,2),C=B[0],D=B[1];return useEffect(function(){b&&setRef(b,x.current)},[b,x]),useClickOutside({isActive:C,ignoreClicksInsideRefs:[x,y].concat(_toConsumableArray(null!==q&&void 0!==q?q:[])),handler:D.off}),React.createElement(React.Fragment,null,React.createElement(DatePickerFieldTypeTime,Object.assign({},r,{ref:x,inputRef:z,onClick:D.on,multiplicityHours:u,multiplicitySeconds:w,multiplicityMinutes:v})),React.createElement(DatePickerDropdown,{ref:y,anchorRef:x,isOpen:C,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:l,multiplicityHours:u,multiplicitySeconds:w,multiplicityMinutes:v,zIndex:getDropdownZIndex(a.style)}))});
//# sourceMappingURL=DatePickerTypeTime.js.map