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