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