import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","form","startFieldInputRef","startFieldLeftSide","startFieldRightSide","endFieldInputRef","endFieldLeftSide","endFieldRightSide","value","onChange","onError","disabled","size","view","status","autoFocus","placeholder","readOnly","required","tabIndex","ariaLabel","id","iconSize","format","separator","minDate","maxDate","startFieldOnClick","startFieldOnBlur","startFieldOnFocus","endFieldOnClick","endFieldOnBlur","endFieldOnFocus","startFieldRef","endFieldRef","startFocused","endFocused","label","labelIcon","labelPosition","caption","startFieldName","endFieldName","withClearButton"];import React,{forwardRef}from"react";import{FieldCaption}from"../../FieldCaption";import{FieldLabel}from"../../FieldLabel";import{DatePickerFieldTypeDateTime}from"../DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime";import{cnDatePickerMixRangeField}from"../DatePickerMixRangeField/DatePickerMixRangeField";import{getChangeFnRange}from"../getChangeFnRange";import{getFormForEnd,getFormForStart}from"../helpers";export var DatePickerFieldTypeDateTimeRange=forwardRef(function(a,b){var c=a.className,d=a.form,e=void 0===d?"default":d,f=a.startFieldInputRef,g=a.startFieldLeftSide,h=a.startFieldRightSide,i=a.endFieldInputRef,j=a.endFieldLeftSide,k=a.endFieldRightSide,l=a.value,m=void 0===l?[]:l,n=a.onChange,o=a.onError,p=a.disabled,q=a.size,r=a.view,s=a.status,t=a.autoFocus,u=a.placeholder,v=a.readOnly,w=a.required,x=a.tabIndex,y=a.ariaLabel,z=a.id,A=a.iconSize,B=a.format,C=a.separator,D=a.minDate,E=a.maxDate,F=a.startFieldOnClick,G=a.startFieldOnBlur,H=a.startFieldOnFocus,I=a.endFieldOnClick,J=a.endFieldOnBlur,K=a.endFieldOnFocus,L=a.startFieldRef,M=a.endFieldRef,N=a.startFocused,O=a.endFocused,P=a.label,Q=a.labelIcon,R=a.labelPosition,S=a.caption,T=a.startFieldName,U=a.endFieldName,V=a.withClearButton,W=_objectWithoutProperties(a,_excluded),X={className:cnDatePickerMixRangeField("Field"),disabled:p,onError:o,size:q,view:r,status:s,placeholder:u,readOnly:v,required:w,tabIndex:x,ariaLabel:y,iconSize:A,format:B,separator:C,minDate:D,maxDate:E,withClearButton:V},Y=getChangeFnRange(n,o,m),Z=_slicedToArray(Y,2),$=Z[0],_=Z[1];return React.createElement("div",Object.assign({},W,{className:cnDatePickerMixRangeField({view:r,labelPosition:R,size:q},[c]),ref:b}),P&&React.createElement(FieldLabel,{icon:Q,as:"label",required:w,className:cnDatePickerMixRangeField("Label",{labelPosition:R}),size:q,htmlFor:z},P),React.createElement("div",{className:cnDatePickerMixRangeField("Body")},React.createElement("div",{className:cnDatePickerMixRangeField("Fields")},React.createElement(DatePickerFieldTypeDateTime,Object.assign({},X,{inputRef:f,ref:L,leftSide:g,rightSide:h,id:z,form:getFormForStart(e),value:null===m||void 0===m?void 0:m[0],onClick:F,onChange:$,onFocus:H,onBlur:G,focused:N,autoFocus:t,name:T})),React.createElement(DatePickerFieldTypeDateTime,Object.assign({},X,{inputRef:i,ref:M,leftSide:j,rightSide:k,form:getFormForEnd(e),value:null===m||void 0===m?void 0:m[1],onClick:I,onChange:_,onFocus:K,onBlur:J,focused:O,name:U}))),S&&React.createElement(FieldCaption,{className:cnDatePickerMixRangeField("Caption"),status:s},S)))});
//# sourceMappingURL=DatePickerFieldTypeDateTimeRange.js.map