reactstrap-date-picker
Version: 
Reactstrap based, zero dependencies, date picker
1 lines • 91.8 kB
Source Map (JSON)
{"version":3,"file":"reactstrap-date-picker.mjs","sources":["../src/util/useCheckProps.mjs","../src/input/InputGroup.mjs","../src/input/InputOverlay.mjs","../src/input/InputHidden.mjs","../src/input/InputClearButton.mjs","../src/input/InputControlInput.mjs","../src/util/setTimeToNoon.mjs","../src/util/getDateFromIsoString.mjs","../src/util/getIsoStringFromDate.mjs","../src/input/useInputValues.mjs","../src/util/getInstanceCount.mjs","../src/input/useInputIds.mjs","../src/input/useDayLabels.mjs","../src/util/compareMonths.mjs","../src/calendar/pickmonth/PickMonthDefault.mjs","../src/calendar/CalendarHeader.mjs","../src/calendar/CalendarSubHeader.mjs","../src/calendar/CalendarDayOutOfMonth.mjs","../src/calendar/CalendarDayInMonth.mjs","../src/calendar/CalendarWeekNum.mjs","../src/calendar/CalendarBody.mjs","../src/calendar/CalendarFooter.mjs","../src/calendar/useCalendarDays.mjs","../src/calendar/Calendar.mjs","../src/input/useCustomEvents.mjs","../src/util/getMaybeFuncValue.mjs","../src/calendar/useCalendarProps.mjs","../src/DatePicker.mjs"],"sourcesContent":["const useCheckProps = (value, defaultValue) => {\n  if (value && defaultValue) {\n    return 'Conflicting DatePicker properties \\'value\\' and \\'defaultValue\\''\n  }\n\n  return undefined \n}\n\nexport {useCheckProps}","import React from 'react'\n\nimport {InputGroup as RSInputGroup} from 'reactstrap'\n\nconst InputGroup = ({children, customInputGroup, size, inputId}) => {\n\n  if (customInputGroup != undefined) {\n    return (\n      React.cloneElement(customInputGroup, {children: children})\n    )    \n  }\n\n  return (\n      <RSInputGroup\n        size      = {size}\n        id        = {inputId}\n        className = {`rdp-input-group`}\n      >\n        {children}\n      </RSInputGroup>\n  )\n}\n    \nexport {InputGroup}","import React from 'react'\n\nconst InputOverlay = ({oid, overlayContainerRef, children}) =>\n  <div   \n    ref       = {overlayContainerRef}\n    id        = {oid}\n    className = 'rdp-overlay'>\n    {children}\n  </div>\n\nexport  {InputOverlay}\n","import React from 'react'\n\nconst InputHidden = ({inputId, name, value, formattedValue, hiddenInputRef}) =>\n  <input \n      ref       = {hiddenInputRef}\n      type      = \"hidden\"\n      className = 'rdp-hidden'\n      id        = {inputId} \n      name      = {name} \n      value     = {value || ''} \n      data-formattedvalue = {formattedValue}\n  />\nexport  {InputHidden}\n","import React from 'react'\nimport {InputGroupText} from 'reactstrap'\n\nconst InputClearButton = ({inputValue, disabled, clearButtonElement, onClick}) => \n  <div className=\"rdp-addon input-group-append\">\n    <InputGroupText  \n      onClick  = {() => disabled ? null : onClick()}\n      style    = {{\n                  opacity: (inputValue && !disabled) ? 1 : 0.5,\n                  cursor:(inputValue && !disabled) ? 'pointer' : 'not-allowed'\n                }}>\n      {clearButtonElement}\n    </InputGroupText>   \n  </div>\n\n\nexport {InputClearButton}","import React from 'react'\nimport {Input} from 'reactstrap'\n\nconst InputControlInput = (\n  {customControl, controlId, \n    value, required, placeholder, inputRef, disabled, \n  className, style, autoFocus, autoComplete, valid, invalid, onInvalid, noValidate,\n  onKeyDown, onFocus, onBlur, onChange}) => {\n  \n    const validityClassNames= `${invalid===true ? 'is-invalid' : ''} ${valid===true ? 'is-valid' : ''}`\n\n  if (customControl!=undefined) {\n    return React.cloneElement(customControl, {\n      id          : controlId,\n      value       : value || '',\n      required    : required,\n      placeholder : placeholder,\n      ref         : inputRef,\n      disabled    : disabled,\n      className   : `rdp-form-control ${className || ''} ${customControl.props.className||''} ${validityClassNames}`,\n      style       : {...customControl.props.style||{},  ...style || {}},\n      autoComplete: autoComplete,\n      onInvalid   : onInvalid,\n      noValidate  : noValidate,\n      onKeyDown   : onKeyDown,\n      onFocus     : onFocus,\n      onBlur      : onBlur,\n      onChange    : onChange,\n      valid       : valid,\n      invalid     : invalid\n    })\n  }\n\n  return (\n    <Input\n      id          = {controlId}\n      name        = {controlId}\n      value       = {value || ''}\n      required    = {required}\n      placeholder = {placeholder}\n      innerRef    = {inputRef}\n      disabled    = {disabled}\n      type        = \"text\"\n      className   = {`rdp-form-control ${className || ''} ${validityClassNames}`}\n      style       = {style}\n      autoFocus   = {autoFocus}\n      autoComplete= {autoComplete}\n      onInvalid   = {onInvalid}\n      noValidate  = {noValidate}\n      onKeyDown   = {onKeyDown}\n      onFocus     = {onFocus}\n      onBlur      = {onBlur}\n      onChange    = {onChange}\n      valid       = {valid}\n      invalid     = {invalid}\n      />\n  )\n\n}\n\nexport {InputControlInput}","const setTimeToNoon = (date) => {\n  if (! date) {\n    return null\n  }\n  date.setHours(12 - date.getTimezoneOffset()/60)\n  date.setMinutes(0)\n  date.setSeconds(0)\n  date.setMilliseconds(0)\n  return date\n}\n\nexport {setTimeToNoon}","import {setTimeToNoon} from './setTimeToNoon'\n\nconst getDateFromIsoString = (isoString) =>\n  isoString ? setTimeToNoon(new Date(isoString)) : null\n  //isoString ? new Date(`${isoString.slice(0,10)}T12:00:00.000Z`) : null\n  \n\nexport { getDateFromIsoString }","import {setTimeToNoon} from './setTimeToNoon'\n\nconst getIsoStringFromDate = (date) =>\n  date ? setTimeToNoon(date).toISOString() : null\n  //date ? `${date.toISOString().slice(0,10)}T12:00:00.000Z` : null\n\nexport { getIsoStringFromDate }","import {useState, useEffect /*, useCallback*/} from 'react'\nimport { getDateFromIsoString } from '../util/getDateFromIsoString'\nimport { getIsoStringFromDate } from '../util/getIsoStringFromDate'\n\nconst _makeInputValueString = (date, separator, dateFormat) => {\n  const month = date.getMonth() + 1\n  const day = date.getDate()\n\n  if (dateFormat.match(/MM.DD.YYYY/)) {\n    return (month > 9 ? month : `0${month}`) + separator + (day > 9 ? day : `0${day}`) + separator + date.getFullYear()\n  }\n  else if (dateFormat.match(/DD.MM.YYYY/)) {\n    return (day > 9 ? day : `0${day}`) + separator + (month > 9 ? month : `0${month}`) + separator + date.getFullYear()\n  }\n  else {\n    return date.getFullYear() + separator + (month > 9 ? month : `0${month}`) + separator + (day > 9 ? day : `0${day}`)\n  }\n}\n\nconst useInputValues = (controlInputRef, value, defaultValue, minDate, maxDate, dateFormat, onClear, onChange) => {\n  const [separator, setSeparator]= useState(dateFormat.match(/[^A-Z]/)[0])\n  const [innerValue, setInnerValue]= useState(null)\n  const [inputValue, setInputValue]= useState(null)\n  const [displayDate, setDisplayDate]= useState(null)\n  const [selectedDate, setSelectedDate]= useState(null)\n  \n\n\n  // handle props changes\n  useEffect(() => {\n    setSeparator(dateFormat.match(/[^A-Z]/)[0])\n  }, [dateFormat])\n\n\n  // handle input values\n  useEffect(() => {\n    const isoString= value || defaultValue\n    const minDate = getDateFromIsoString(minDate)\n    const maxDate = getDateFromIsoString(maxDate)\n\n\n\n    const nSelectedDate = getDateFromIsoString(isoString)\n    const nInnerValue = getIsoStringFromDate(nSelectedDate)\n    const nInputValue = isoString ? _makeInputValueString(nSelectedDate, separator, dateFormat) : null\n\n    let nDisplayDate\n    if (nSelectedDate) {\n      //nDisplayDate = new Date(nSelectedDate)\n      nDisplayDate = nSelectedDate\n    } else {\n      const today = getDateFromIsoString(new Date().toISOString())\n      if (minDate && Date.parse(minDate) >= Date.parse(today)){\n        nDisplayDate = minDate\n      } else if (maxDate && Date.parse(maxDate) <= Date.parse(today)){\n        nDisplayDate = maxDate\n      } else {\n        nDisplayDate = today\n      }\n    }\n    \n    setInnerValue(nInnerValue)\n    setInputValue(nInputValue)\n    setSelectedDate(nSelectedDate)\n    setDisplayDate(nDisplayDate)\n\n  }, [value, defaultValue, minDate, maxDate, separator, dateFormat])\n\n  //\n  const handleClear = /*useCallback(*/() => {\n    if (onClear) {\n      onClear()\n    }\n    else {\n      setInnerValue(null)\n      setInputValue(null)\n      setSelectedDate(null)\n      setDisplayDate(null)\n\n      if (onChange) {\n        onChange(null, null)\n      }\n    }\n  }/*, [onClear, onChange])*/\n\n  const handleBadInput = /*useCallback(*/(originalValue, tail= false) => {\n    \n    const parts = originalValue.replace(new RegExp(`[^0-9${separator}]`), '').split(separator)\n\n    if (dateFormat.match(/MM.DD.YYYY/) || dateFormat.match(/DD.MM.YYYY/)) {\n      if (parts[0] && parts[0].length > 2) {\n        parts[1] = parts[0].slice(2) + (parts[1] || '')\n        parts[0] = parts[0].slice(0, 2)\n      }\n      if (parts[1] && parts[1].length > 2) {\n        parts[2] = parts[1].slice(2) + (parts[2] || '')\n        parts[1] = parts[1].slice(0, 2)\n      }\n      if (parts[2]) {\n        parts[2] = parts[2].slice(0,4)\n        if (tail) {\n          if (parts[2].length < 4) {\n            parts[2]= parts[2].padEnd(4, '0')\n          }\n        }\n      }\n    } else {\n      if (parts[0] && parts[0].length > 4) {\n        parts[1] = parts[0].slice(4) + (parts[1] || '')\n        parts[0] = parts[0].slice(0, 4)\n      }\n      if (parts[1] && parts[1].length > 2) {\n        parts[2] = parts[1].slice(2) + (parts[2] || '')\n        parts[1] = parts[1].slice(0, 2)\n      }\n      if (parts[2]) {\n        parts[2] = parts[2].slice(0,2)\n      }\n    }\n    const nInputValue= parts.join(separator)\n    setInputValue(nInputValue)\n  }/*, [dateFormat, separator])*/\n\n  const handleBadInputOnBlur = () => {\n    const originalValue = controlInputRef?.current?.value || ''\n    if (originalValue) {\n      handleBadInput(originalValue, true)\n    }\n  }\n\n  const handleInputChange = /*useCallback(*/() => {\n    const originalValue = controlInputRef?.current?.value || ''\n    const nInputValue = originalValue.replace(/(-|\\/\\/)/g, separator).slice(0,10)\n    \n    if (!nInputValue) {\n      handleClear()\n      return\n    }\n\n    let month, day, year\n    if (dateFormat.match(/MM.DD.YYYY/)) {\n      if (!nInputValue.match(/[0-1][0-9].[0-3][0-9].[1-2][0-9][0-9][0-9]/)) {\n        return handleBadInput(originalValue)\n      }\n\n      month = nInputValue.slice(0,2).replace(/[^0-9]/g, '')\n      day = nInputValue.slice(3,5).replace(/[^0-9]/g, '')\n      year = nInputValue.slice(6,10).replace(/[^0-9]/g, '')\n    } else if (dateFormat.match(/DD.MM.YYYY/)) {\n      if (!nInputValue.match(/[0-3][0-9].[0-1][0-9].[1-2][0-9][0-9][0-9]/)) {\n        return handleBadInput(originalValue)\n      }\n\n      day = nInputValue.slice(0,2).replace(/[^0-9]/g, '')\n      month = nInputValue.slice(3,5).replace(/[^0-9]/g, '')\n      year = nInputValue.slice(6,10).replace(/[^0-9]/g, '')\n    } else {\n      if (!nInputValue.match(/[1-2][0-9][0-9][0-9].[0-1][0-9].[0-3][0-9]/)) {\n        return handleBadInput(originalValue)\n      }\n\n      year = nInputValue.slice(0,4).replace(/[^0-9]/g, '')\n      month = nInputValue.slice(5,7).replace(/[^0-9]/g, '')\n      day = nInputValue.slice(8,10).replace(/[^0-9]/g, '')\n    }\n\n    const monthInteger = parseInt(month, 10)\n    const dayInteger = parseInt(day, 10)\n    const yearInteger = parseInt(year, 10)\n    if (monthInteger > 12 || dayInteger > 31) {\n      return handleBadInput(originalValue)\n    }\n\n    const beforeMinDate = minDate && Date.parse(originalValue) < Date.parse(minDate)\n    const afterMaxDate = maxDate && Date.parse(originalValue) > Date.parse(maxDate)\n\n    if (beforeMinDate || afterMaxDate) {\n      return handleBadInput(originalValue)\n    }\n\n    if (!isNaN(monthInteger) && !isNaN(dayInteger) && !isNaN(yearInteger) && monthInteger <= 12 && dayInteger <= 31 && yearInteger > 999) {\n      const nSelectedDate = getDateFromIsoString(new Date(yearInteger, monthInteger - 1, dayInteger, 12, 0, 0, 0).toISOString())\n      const nInnerValue = getIsoStringFromDate(nSelectedDate)\n\n      setSelectedDate(nSelectedDate)\n      setDisplayDate(nSelectedDate)\n      setInnerValue(nInnerValue)\n\n      if (onChange) {\n        onChange(nInnerValue, nInputValue)\n      }\n    }\n\n    setInputValue(nInputValue)\n  }/*, [controlInputRef, separator, onChange, minDate, maxDate])*/\n\n  const handleChangeMonth = (nDisplayDate) => {\n    setDisplayDate(nDisplayDate)\n  }\n\n  const handleChangeDate = /*useCallback(*/(nSelectedDate) => {\n    const nInnerValue = getIsoStringFromDate(nSelectedDate)\n    const nInputValue = _makeInputValueString(nSelectedDate, separator, dateFormat)\n\n    setInputValue(nInputValue)\n    setSelectedDate(nSelectedDate)\n    setDisplayDate(nSelectedDate)\n    setInnerValue(nInnerValue)\n\n    if (onChange) {\n      onChange(nInnerValue, nInputValue)\n    }\n  }/*, [separator, dateFormat, onChange])*/\n\n\n  return [innerValue, inputValue, displayDate, selectedDate, handleClear, handleInputChange, handleChangeMonth, handleChangeDate, handleBadInputOnBlur]\n\n}\n\n\n\nexport { useInputValues }","const getInstanceCount = () => {\n  if (typeof window === 'object') {\n    if (window._reactstrapDatePickerInstance == undefined) {\n      window._reactstrapDatePickerInstance= 0\n    }\n    const next= window._reactstrapDatePickerInstance+1\n    window._reactstrapDatePickerInstance= next\n    return next\n  } else if (typeof process === 'object') {\n    if (process._reactstrapDatePickerInstance == undefined) {\n      process._reactstrapDatePickerInstance= 0\n    }\n    const next= process._reactstrapDatePickerInstance+1\n    process._reactstrapDatePickerInstance= next\n    return next\n  } else {\n    console.error(\"Reactstrap Date Picker cannot determine environment (it is neither browser's <window> nor Node's <process>).\")\n    return 1\n  }\n}\n\nexport {getInstanceCount}","import {useState, useEffect} from 'react'\nimport {getInstanceCount} from '../util/getInstanceCount'\n\nconst _getIdSuffix = (id, name) => {\n  // Try <id> or <name> props to determine elements' id suffix\n  if (id!=undefined && id!='')\n    return id\n  if (name!=undefined && name!='')\n    return name\n  // If none was passed, use global vars\n  const iCount= getInstanceCount()\n  return iCount.toString()\n}\n\n\nconst _getInputIds = (id, name, customControl) => {\n  const idSuffix = _getIdSuffix(id, name)\n  const group= `rdp-input-group-${idSuffix}`\n  const hidden = id!=undefined ? id : `rdp-hidden-${idSuffix}`\n  let control= `rdp-form-control-${idSuffix}`\n  if (customControl!=undefined && customControl?.props?.id) {\n    control= customControl.props.id\n  }\n  const overlay = `rdp-overlay-${idSuffix}`\n  return [group, hidden, control, overlay]\n}\n\n\nconst useInputIds = (id, name, customControl) => {\n\n  const [inputIds, setInputIds]= useState(_getInputIds(id, name, customControl))\n\n  useEffect(() => {\n    setInputIds(_getInputIds(id, name, customControl))\n  }, [id, name, customControl])\n  \n  return inputIds\n}\n\n\n\nexport {useInputIds}","import {useState, useEffect} from 'react'\n\nconst _getFixedDayLabels = (dayLabels, weekStartsOn) => {\n  if (weekStartsOn > 1) {\n    return dayLabels\n      .slice(weekStartsOn)\n      .concat(dayLabels.slice(0, weekStartsOn))\n  }\n  \n  if (weekStartsOn === 1) {\n    return dayLabels.slice(1).concat(dayLabels.slice(0,1))\n  }\n  \n  return dayLabels\n}\n\n\nconst useFixedDayLabels = (dayLabels, weekStartsOn) => {\n\n  const [fixedDayLabels, setFixedDayLabels]= useState(_getFixedDayLabels(dayLabels, weekStartsOn))\n\n  useEffect(() => {\n    setFixedDayLabels(_getFixedDayLabels(dayLabels, weekStartsOn))\n  }, [dayLabels, weekStartsOn])\n  \n  return fixedDayLabels\n}\n\nexport {useFixedDayLabels}","const compareMonths = (a, b) => {\n  try {\n  const da= new Date(a)\n  const db= new Date(b)\n\n  const sameYear= da.getFullYear() == db.getFullYear()\n  const sameMonth = da.getMonth() == db.getMonth()\n\n  return sameMonth && sameYear\n  }catch(e) {\n    console.error(e)\n    return true\n  }\n}\n\n\nexport {compareMonths}","import React, {useState, useEffect} from 'react'\nimport {Input} from 'reactstrap'\n\nconst _getYearList = (minDate, maxDate) => {\n  const minYear= minDate\n    ? (new Date(minDate)).getFullYear()\n    : 1970\n  const maxYear= maxDate\n    ? (new Date(maxDate)).getFullYear()\n    : 2045\n  let yList= []\n  for (let y=minYear; y<=maxYear; y++) {\n    yList.push(y)\n  }\n  return yList\n}\n\n\nconst PickMonthDefault = ({displayDate, minDate, maxDate, monthLabels, onChangeMonth, onChangeYear}) => {\n  const [month, setMonth]= useState((new Date(displayDate)).getMonth())\n  const [year, setYear]= useState((new Date(displayDate)).getFullYear())\n  const [yearList, setYearList] = useState(_getYearList(minDate, maxDate))\n\n  useEffect(() => {\n    setMonth((new Date(displayDate)).getMonth())\n    setYear((new Date(displayDate)).getFullYear())\n  }, [displayDate])\n\n  useEffect(() => {\n    setYearList(_getYearList(minDate, maxDate))\n  }, [minDate, maxDate])\n\n  const handleChangeMonth = (ev) => {\n    const m= ev.target.value\n    setMonth(m)\n    onChangeMonth(m)\n  }\n\n  const handleChangeYear = (ev) => {\n    const y= ev.target.value\n    setYear(y)\n    onChangeYear(y)\n  }  \n\n\n  return (\n    <div className= \"rdp-header-pick-month-default\"\n         style={{display: 'flex', flexFlow: 'row', flexWrap: 'nowrap'}}>\n      <div className= \"rdp-header-pick-month-default-month\"\n           style={{flex: '2 1 auto'}}>\n        <Input\n          type=\"select\"\n          name=\"rdp-header-pick-month-default-month\"\n          style={{lineHeight: \"1.5\", fontSize: \"0.875rem\", padding: \"0.2rem\"}}\n          value={month}\n          onChange={handleChangeMonth}>\n          {\n            monthLabels.map((lmonth, lidx) => {\n              return (\n                <option key={`month_${lidx}`}\n                        value={lidx}>\n                  {lmonth}\n                </option>\n              )\n            })\n          }\n        </Input>\n      </div>\n      <div className= \"rdp-header-pick-month-default-year\"\n           style={{flex: '1 1 67px'}}>\n      <Input\n          type=\"select\"\n          name=\"rdp-header-pick-month-default-year\"\n          style={{lineHeight: \"1.5\", fontSize: \"0.875rem\", padding: \"0.2rem\"}}\n          value={year}\n          onChange={handleChangeYear}>\n          {\n            yearList.map(lyear => {\n              return (\n                <option key={`year${lyear}`}\n                        value={lyear}>\n                  {lyear}\n                </option>\n              )\n            })\n          }\n        </Input>\n      </div>\n    </div>\n  )\n}\n\nexport default PickMonthDefault\n","\nimport React, {useState, useEffect} from 'react'\nimport {compareMonths} from '../util/compareMonths'\nimport PickMonthDefault from './pickmonth/PickMonthDefault'\n\nfunction CalendarHeader ({\n   previousButtonElement, nextButtonElement, pickMonthElement,\n   displayDate, minDate, maxDate, onChange, monthLabels}) {\n  \n  const [displayingMinMonth, setDisplayingMinMonth]= useState(false)\n  const [displayingMaxMonth, setDisplayingMaxMonth]= useState(false)\n  const [title, setTitle]= useState('')\n  const PickMonthElement = pickMonthElement\n \n  useEffect(() => {\n    if (displayDate==undefined) {\n      return \n    }\n    \n    if (!minDate) {\n      setDisplayingMinMonth(false)\n    } else {\n      setDisplayingMinMonth(compareMonths(displayDate, minDate))\n    }\n    \n    if (!maxDate) {\n      setDisplayingMaxMonth(false)\n    } else {\n      setDisplayingMaxMonth(compareMonths(displayDate, maxDate))\n    }\n\n    try {\n      if (monthLabels) {\n        setTitle(`${monthLabels[displayDate.getMonth()]} ${displayDate.getFullYear()}`)\n      }\n    } catch(e) {\n      console.error(e)\n    }\n\n  }, [displayDate, minDate, maxDate, monthLabels])\n\n  \n  const handleChangeMonthIncr = (inc) => {\n    const newDisplayDate = new Date(displayDate)\n    newDisplayDate.setMonth(newDisplayDate.getMonth() + inc, 1)\n    onChange(newDisplayDate)\n  }\n\n  const handleChangeMonth = (m) => {\n    const newDisplayDate = new Date(displayDate)\n    newDisplayDate.setMonth(m)\n    onChange(newDisplayDate)\n  }\n\n  const handleChangeYear = (y) => {\n    const newDisplayDate = new Date(displayDate)\n    newDisplayDate.setFullYear(y)\n    onChange(newDisplayDate)\n  }\n\n  return (\n    <div className=\"rdp-header text-center\" style={{display: 'flex', flexFlow: 'row', flexWrap: 'nowrap'}}>\n      <div className= \"text-muted rdp-header-previous-wrapper\" \n            onClick  = {() => handleChangeMonthIncr(-1)}\n            style    = {{cursor: 'pointer', userSelect: 'none', flexBasis: '1.25em', alignSelf: 'center'}}>\n        {displayingMinMonth ? null : previousButtonElement}\n      </div>\n      \n      <div className= \"rdp-header-pick-month-wrapper\"\n           style={{flex: '1 1 auto'}}>{\n        (PickMonthElement==null || PickMonthElement==='none')\n        ? <div>{title}</div>\n        : PickMonthElement==='default'\n        ? <PickMonthDefault\n            displayDate   = { displayDate }\n            monthLabels   = { monthLabels }\n            minDate       = { minDate }\n            maxDate       = { maxDate }\n            onChangeMonth = { (m) => handleChangeMonth(m) }\n            onChangeYear  = { (y) => handleChangeYear(y) }/>\n        : <PickMonthElement\n            displayDate   = { displayDate }\n            minDate       = { minDate }\n            maxDate       = { maxDate }\n            onChangeMonth = { (m) => handleChangeMonth(m) }\n            onChangeYear  = { (y) => handleChangeYear(y) }/>\n        \n      }</div>\n      <div className= \"text-muted rdp-header-next-wrapper\" \n            onClick  = {() => handleChangeMonthIncr(+1)} \n            style    = {{cursor: 'pointer', userSelect: 'none', flexBasis: '1.25em', alignSelf: 'center'}}>\n        {displayingMaxMonth ? null : nextButtonElement}\n      </div>\n    </div>\n  )\n\n}\n\nexport {CalendarHeader}\n","import React from 'react' \n\nconst CalendarSubHeader = ({dayLabels, showWeeks, cellPadding}) => \n\n  <thead>\n    <tr>\n      {showWeeks \n        ? <td className=\"text-muted current-week\"\n              style={{padding: cellPadding}} /> \n        : null\n      }\n      {dayLabels.map((label, index) => \n          <td key={index}\n              className=\"text-muted\"\n              style={{padding: cellPadding}}>\n            <small>{label}</small>\n          </td>\n      )}\n    </tr>\n  </thead>\n\nexport {CalendarSubHeader}","import React from 'react'\n\nconst CalendarDayOutOfMonth = () => \n  <td></td>\n\nexport {CalendarDayOutOfMonth}","import React from 'react'\n\nconst CAL_DAY_CLASSNAME_BY_MODE= {\n  'normal': '',\n  'muted': 'text-muted',\n  'selected': 'bg-primary',\n  'current': 'text-primary'\n}\n\nconst CalendarDayInMonth = ({day, mode, onDayClick, cellPadding, roundedCorners}) => {\n\n  const handleClick = (ev) => {\n    if (mode!='muted') {\n      onDayClick(ev)\n    }\n  }\n\n  return (\n    <td\n        data-day = {day}\n        onClick  = {handleClick}\n        style    = {{ cursor: mode=='muted' ? 'default' : 'pointer', \n                      padding: cellPadding, \n                      borderRadius: roundedCorners ? '5px' : '0px' }}\n        className= {CAL_DAY_CLASSNAME_BY_MODE[mode]}>\n        {day}\n    </td>\n\n  )\n}\n\nexport {CalendarDayInMonth}\n\n","import React from 'react' \n\nconst CalendarWeekNum = ({weekNum, cellPadding}) => \n  <td style={{padding: cellPadding, fontSize: '0.8em', color: 'darkgrey'}}\n      className=\"text-muted\">\n    {weekNum}\n  </td>\n\nexport {CalendarWeekNum}\n","import React from 'react' \nimport {CalendarDayOutOfMonth} from './CalendarDayOutOfMonth'\nimport {CalendarDayInMonth} from './CalendarDayInMonth'\nimport {CalendarWeekNum} from './CalendarWeekNum'\n\nconst CalendarBody = ({calendarDays, showWeeks, onDayClick, cellPadding, roundedCorners}) => {\n  if (! calendarDays) {\n    return <tbody></tbody>\n  }\n\n  return (\n    <tbody>\n     {calendarDays.map( (week, weekIndex) => \n       <tr key={`rdp_calendar_week_${weekIndex}`}>\n        {showWeeks\n         ? <CalendarWeekNum\n            key={`rdp_calendar_week_${weekIndex}_weeknum`}\n            weekNum     = {week.weekNum}\n            cellPadding = {cellPadding}/>\n         : null\n        }\n        {week.weekDays.map((weekDay, weekDayIndex) => \n          weekDay.inMonth\n          ? <CalendarDayInMonth\n              key={`rdp_calendar_week_${weekIndex}_day_${weekDayIndex}`}\n              day= {weekDay.day}\n              mode= {weekDay.mode}\n              onDayClick= {onDayClick}\n              cellPadding= {cellPadding}\n              roundedCorners= {roundedCorners}\n            /> \n          : <CalendarDayOutOfMonth \n             key={`rdp_calendar_week_${weekIndex}_day_${weekDayIndex}`}/>\n        )}\n       </tr>\n     )}\n    </tbody> \n  )\n}\n\nexport {CalendarBody}\n","import React from 'react' \nimport {Button} from 'reactstrap'\n\nconst CalendarFooter = ({dayLabels, showWeeks, handleTodayClick, showTodayButton, todayButtonLabel}) => {\n  if (!showTodayButton) {\n    return null\n  }\n  \n  return (\n    <tfoot>\n      <tr>\n        <td colSpan={dayLabels.length + (showWeeks ? 1 : 0)} style={{ paddingTop: '9px' }}>\n          <Button\n            block\n            size=\"sm\"\n            className=\"u-today-button\"\n            onClick={() => handleTodayClick()}>\n            {todayButtonLabel}\n          </Button>\n        </td>\n      </tr>\n    </tfoot>\n  )\n\n}\n\nexport {CalendarFooter}","import {useState, useEffect} from 'react'\nimport {setTimeToNoon} from '../util/setTimeToNoon'\n\nconst DAYS_BY_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n/**\n  groupByWeeks: {\n   year,\n   month,\n   weeks: [\n      {weekNum: N,\n      wekDays: [\n        {inMonth: true, day: N, mode: ''}\n        or\n        {inMonth: false}\n        ]\n      },...\n      ]\n  }\n */\n\nfunction _groupByWeeks(year, month, weekStartsOn) {\n  if (year == undefined || month == undefined) {\n    return undefined\n  }\n\n  const firstDay = new Date(year, month, 1)\n  const startingDay = weekStartsOn > 1\n    ? firstDay.getDay() - weekStartsOn + 7\n    : weekStartsOn === 1\n      ? (firstDay.getDay() === 0 ? 6 : firstDay.getDay() - 1)\n      : firstDay.getDay();\n\n  let monthLength = DAYS_BY_MONTH[month]\n  if (month == 1) {\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n      monthLength = 29;\n    }\n  }\n  \n  const isInMonth = (monthDay, weekIndex, weekDay) => {\n    if (monthDay <= monthLength && (weekIndex > 0 || weekDay >= startingDay)) {\n      return true\n    }\n    return false\n  }\n\n  const getWeekNumber = (monthDay) => {\n    const date   = new Date(year, month, monthDay - 1, 12, 0, 0, 0)\n    const target = new Date(date.valueOf());\n    const dayNr  = (date.getDay() + 6) % 7;\n    target.setDate(target.getDate() - dayNr + 3);\n    const firstThursday = target.valueOf();\n    target.setMonth(0, 1);\n    if (target.getDay() !== 4) {\n      target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7);\n    }\n    return 1 + Math.ceil((firstThursday - target) / 604800000);\n  }\n  \n\n  const allWeeks = []\n  let monthDay = 1\n  for (let weekIndex = 0; weekIndex < 9; weekIndex++) {\n    const weekDays = []\n    for (let weekDay = 0; weekDay <= 6; weekDay++) {\n      if (isInMonth(monthDay, weekIndex, weekDay)) {\n        weekDays.push({\n          inMonth: true,\n          day: monthDay\n        })\n        monthDay+= 1\n      } else {\n        weekDays.push({\n          inMonth: false       \n        })\n      }\n    }\n    \n    const weekNum = getWeekNumber(monthDay)\n\n    allWeeks.push({\n      weekDays,\n      weekNum\n    })\n\n    if (monthDay > monthLength) {\n      break\n    }\n  }\n  \n  return {\n    year, month, weeks: allWeeks\n  }\n\n}\n\n\n\n/**\n  calendarDays: [\n  {weekNum: N,\n   wekDays: [\n     {inMonth: true, day: N, mode: ''}\n     or\n     {inMonth: false}\n    ]\n  },...\n  ]\n */\n\nfunction _makeCalendarDays(groupByWeeks, selectedDate, minDate, maxDate) {\n\n  if (groupByWeeks==undefined) {\n    return []\n  }\n\n\n  const getDayMode = (day) => {\n    const date= setTimeToNoon(new Date(groupByWeeks.year, groupByWeeks.month, day, 12, 0, 0, 0)).toISOString()\n    \n\n    const beforeMinDate = minDate!=undefined ? (Date.parse(date) < Date.parse(setTimeToNoon(new Date(minDate)))) : false\n    const afterMaxDate  = maxDate!=undefined ? (Date.parse(date) > Date.parse(setTimeToNoon(new Date(maxDate)))) : false\n    const currentDate   = setTimeToNoon(new Date())\n    const nSelectedDate = setTimeToNoon(new Date(selectedDate))\n\n    if (beforeMinDate || afterMaxDate) {\n      return 'muted'\n    } else if (Date.parse(date) === Date.parse(nSelectedDate)) {\n      return 'selected'\n    } else if (Date.parse(date) === Date.parse(currentDate)) {\n      return 'current'\n    } else {\n      return 'normal'\n    }\n  }\n\n  let calendarDays= []\n\n  groupByWeeks.weeks.map(week => {\n    const weekNum= week.weekNum\n    const weekDays = week.weekDays.map(weekDay => {\n      return {\n        ...weekDay,\n        mode: weekDay.inMonth ? getDayMode(weekDay.day) : undefined\n      }\n    })\n    calendarDays.push({\n      weekNum,\n      weekDays\n    })\n  })\n\n  return calendarDays\n}\n\nfunction useCalendarDays(displayDate, selectedDate, minDate, maxDate, weekStartsOn) {\n  const [year, setYear]= useState(undefined)\n  const [month, setMonth]= useState(undefined)\n  const [groupByWeeks, setGroupByWeeks]= useState(undefined)\n  const [calendarDays, setCalendarDays]= useState([])\n  \n\n  useEffect(() => {\n    if (displayDate) {\n      setYear(displayDate.getFullYear())\n      setMonth(displayDate.getMonth())\n    }\n  }, [displayDate])\n\n\n  useEffect(() => {\n    setGroupByWeeks(_groupByWeeks(year, month, weekStartsOn))\n  }, [year, month, weekStartsOn])\n\n  useEffect(() => {\n    setCalendarDays(_makeCalendarDays(groupByWeeks, selectedDate, minDate, maxDate))\n  }, [groupByWeeks, selectedDate, minDate, maxDate])\n\n\n  return calendarDays\n}\n\n\nexport {useCalendarDays}","import React from 'react'\nimport {Popover, PopoverHeader, PopoverBody} from 'reactstrap'\nimport {setTimeToNoon} from '../util/setTimeToNoon'\nimport {CalendarHeader} from './CalendarHeader'\nimport {CalendarSubHeader} from './CalendarSubHeader'\nimport {CalendarBody} from './CalendarBody'\nimport {CalendarFooter} from './CalendarFooter'\nimport {useCalendarDays} from './useCalendarDays'\n\nconst Calendar = (\n  {popoverRef, selectedDate, displayDate, minDate, maxDate, onChange, dayLabels, \n    cellPadding, weekStartsOn, showTodayButton, todayButtonLabel, \n    roundedCorners, showWeeks, monthLabels, previousButtonElement, \n    nextButtonElement, pickMonthElement, placement, open, \n    container, target,  onChangeMonth}) => {\n  const calendarDays = useCalendarDays(displayDate, selectedDate, minDate, maxDate, weekStartsOn)\n  \n  const handleDayClick = (e) => {\n    const day = e.currentTarget.getAttribute('data-day')\n    const newSelectedDate = setTimeToNoon(new Date(displayDate))\n    newSelectedDate.setDate(day)\n    onChange(newSelectedDate)\n  }\n\n  const handleTodayClick = () => {\n    const newSelectedDate = setTimeToNoon(new Date())\n    onChange(newSelectedDate)\n  }\n  \n  return (\n    <>\n\n      <Popover  \n          innerRef   = {popoverRef}\n          className  = {`rdp-popover ${placement}`}\n          //toggle     = {() => handleHide()}\n          isOpen     = {open}\n          container  = {container}\n          target     = {target}\n          placement  = {placement}\n          // delay      = {200} //  does not apply for us (manual triggering)\n      >\n        <PopoverHeader tag = \"div\">\n          <CalendarHeader\n              previousButtonElement= {previousButtonElement}\n              nextButtonElement    = {nextButtonElement}\n              pickMonthElement     = {pickMonthElement}\n              displayDate          = {displayDate}\n              minDate              = {minDate}\n              maxDate              = {maxDate}\n              onChange             = {(newDisplayDate) => onChangeMonth(newDisplayDate)}\n              monthLabels          = {monthLabels}/>\n        </PopoverHeader>\n\n        <PopoverBody>\n          <table className=\"rdp-calendar text-center\">\n            <CalendarSubHeader \n              dayLabels   = {dayLabels}\n              showWeeks   = {showWeeks}\n              cellPadding = {cellPadding}\n            />\n\n            <CalendarBody \n              calendarDays   = {calendarDays}\n              showWeeks      = {showWeeks}\n              onDayClick     = {handleDayClick}\n              cellPadding    = {cellPadding}\n              roundedCorners = {roundedCorners}\n            />\n\n            <CalendarFooter\n              dayLabels         = {dayLabels}\n              showWeeks         = {showWeeks}\n              handleTodayClick  = {handleTodayClick}\n              showTodayButton   = {showTodayButton}\n              todayButtonLabel  = {todayButtonLabel}\n            />\n          </table>\n        </PopoverBody>\n      </Popover>\n    </>\n  )\n}\n\nexport { Calendar }\n\n\n\n","import {useCallback} from 'react'\n\n// NOTE: do we want to use the controlInput or  the hiddenInput here?\n// We were previously using the hidden one, but I see no reasons.\n// 'change' events would make sense on the hidden input, but focus\n// control seems to be more on the control input.\n// Anyway, this is not decided here, but when calling useCustomEvents()\n\nconst useCustomEvents = (inputRef, onBlur, onFocus) => {\n  const customOnBlur = useCallback(() => {\n    \n    if (onBlur) {\n      const event = document.createEvent('CustomEvent')\n      event.initEvent('Change Date', true, false)\n      inputRef.current.dispatchEvent(event)\n      onBlur(event)\n    }\n  }, [inputRef, onBlur])\n\n  const customOnFocus = useCallback(() => {\n    if (onFocus) {\n      const event = document.createEvent('CustomEvent')\n      event.initEvent('Change Date', true, false)\n      inputRef.current.dispatchEvent(event)\n      onFocus(event)\n    }\n  }, [inputRef, onFocus])\n\n  return [customOnBlur, customOnFocus]\n}\n\nexport { useCustomEvents }","const getMaybeFuncValue = (value) => {\n  const tag = Object.prototype.toString.call(value)\n  const isFunction = tag === '[object AsyncFunction]' || tag === '[object Function]' || tag === '[object GeneratorFunction]' || tag === '[object Proxy]'\n  if (isFunction) {\n    return value()\n  }\n  else {\n    return value\n  }  \n}\n\n\nexport { getMaybeFuncValue }","import {useState, useEffect, useCallback, useRef} from 'react'\nimport { useCustomEvents } from '../input/useCustomEvents'\nimport { getMaybeFuncValue } from '../util/getMaybeFuncValue'\n\n// About autoFocus\n// We could handle by our own through ref callbacks\n//   (https://blog.maisie.ink/react-ref-autofocus/)\n// But let's just use react's autoFocus attribute by now\n\n\n\nconst useCalendarProps = (calendarPlacement, inputRef, autoFocus, onBlur, onFocus) => {\n  const [open, setOpen] = useState(false)\n  \n  const [placement, setPlacement] = useState(getMaybeFuncValue(calendarPlacement))\n\n  const hiddenInputRef = useRef()\n  const overlayContainerRef = useRef()\n  const popoverRef = useRef()\n  const controlInputRef = typeof inputRef == 'object'\n                          ? inputRef\n                          : useRef(inputRef) // eslint-disable-line react-hooks/rules-of-hooks\n\n  // NOTE: do we want to use the controlInput or  the hiddenInput here?\n  const [customOnBlur, customOnFocus] = useCustomEvents(/*hiddenInputRef*/ controlInputRef, onBlur, onFocus)\n\n  const isOutside = useCallback((event) => {\n    const outOfCalendar =  (popoverRef?.current==undefined) || (!popoverRef?.current.contains(event.target))\n    const outOfControlInput = (controlInputRef?.current==undefined) || (!controlInputRef.current.contains(event.target))\n    const isOut= (outOfCalendar && outOfControlInput)\n    return isOut\n  }, [popoverRef, controlInputRef])\n\n  // Control the click outside\n  useEffect(() => {\n    function handleClickOutside(event) {\n      event.stopPropagation()\n\n      if (open) {\n        if (isOutside(event)) {\n          setOpen(false)\n          customOnBlur()\n        }\n      }\n    }\n    \n    document.addEventListener(\"mousedown\", handleClickOutside)\n    return () => {\n      document.removeEventListener(\"mousedown\", handleClickOutside)\n    }\n  }, [open, isOutside, customOnBlur])\n\n\n  //\n  //  This callback is bound to Calendar.Popover's toggle() method,\n  //    but seems it's unneccesary \n  //  Leaving, by now, this testimonial comments\n  //\n  //  const handleHide = () => {\n  //    let inputFocused = false\n  //    try {\n  //      inputFocused= controlInputRef.current==document.activeElement\n  //    } catch(e) {}\n  //    \n  //    if (inputFocused) {\n  //      return\n  //    }\n  //    setOpen(false)\n  //    customOnBlur()\n  //  }\n\n  const handleFocus = useCallback(() => {\n    const nPlacement = getMaybeFuncValue(calendarPlacement)\n    setPlacement(nPlacement)\n\n    setOpen(true)\n    customOnFocus()\n  }, [calendarPlacement, customOnFocus])\n\n  const handleBlur = useCallback((event) => {\n    if (isOutside(event)) {\n      setOpen(false)\n      customOnBlur()  \n    }\n  }, [isOutside, customOnBlur])\n\n  return [hiddenInputRef, overlayContainerRef, popoverRef, controlInputRef, open, placement, handleFocus, handleBlur]\n}\n\nexport { useCalendarProps }\n\n","import React, { useImperativeHandle, forwardRef }  from 'react'\n\nimport { useCheckProps } from './util/useCheckProps'\nimport { InputGroup } from './input/InputGroup'\nimport { InputOverlay } from './input/InputOverlay'\nimport { InputHidden } from './input/InputHidden'\nimport { InputClearButton } from './input/InputClearButton'\nimport { InputControlInput } from './input/InputControlInput'\nimport { useInputValues } from './input/useInputValues'\nimport { useInputIds } from './input/useInputIds'\nimport { useFixedDayLabels } from './input/useDayLabels'\nimport { Calendar } from './calendar/Calendar'\nimport { useCalendarProps } from './calendar/useCalendarProps'\n\nconst _defaultDateFormat= () => {\n  const language = typeof window !== 'undefined' && window.navigator ? (window.navigator.userLanguage || window.navigator.language || '').toLowerCase() : ''\n  const dateFormat = !language || language === 'en-us' ? 'MM/DD/YYYY' : 'DD/MM/YYYY'\n  return dateFormat\n}\n\nconst DEFAULT_DAY_LABELS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']\nconst DEFAULT_MONTH_LABELS = ['January', 'February', 'March', 'April',\n  'May', 'June', 'July', 'August', 'September',\n  'October', 'November', 'December']\n\nconst DatePickerBase = (props, ref) => {\n\n  const {\n    // Global props\n    value, \n    defaultValue, \n    id, \n    name, \n    dateFormat           = _defaultDateFormat(),\n    minDate,\n    maxDate, \n    clearButtonElement   = '×',\n    showClearButton      = true,\n\n    // Event props\n    onInvalid,\n    onChange,\n    onClear,\n    onBlur,\n    onFocus,\n    \n    // Input Group props\n    size,\n    valid, \n    invalid,\n    customInputGroup,    \n    \n    // Input props\n    autoComplete = 'on',\n    autoFocus = false,\n    disabled = false,\n    noValidate = false,\n    placeholder,\n    required,\n    className,\n    style = undefined /* {\n      width: '100%'\n    } */,\n    inputRef,\n    customControl,\n    children, \n    \n    // Calendar props\n    // target,\n    calendarContainer, \n    \n    dayLabels   = DEFAULT_DAY_LABELS,\n    monthLabels = DEFAULT_MONTH_LABELS,\n    weekStartsOn,\n    showWeeks            = false,\n    previousButtonElement= '<',\n    nextButtonElement    = '>',\n    pickMonthElement     = undefined,\n    showTodayButton      = false,\n    todayButtonLabel     = 'Today',\n    roundedCorners       = false,\n    cellPadding          = '5px',\n    calendarPlacement    = 'bottom'\n  } = props\n\n  const propError= useCheckProps(value, defaultValue)\n  if (propError!=undefined) {\n    throw new Error(propError)\n  }\n\n\n  const [hiddenInputRef, overlayContainerRef, popoverRef, controlInputRef, open, placement, \n    handleFocus, handleBlur] = useCalendarProps(calendarPlacement, inputRef, autoFocus, onBlur, onFocus)\n\n  const [innerValue, inputValue, displayDate, \n         selectedDate, handleClear, handleInputChange, \n         handleChangeMonth, handleChangeDate, handleBadInputOnBlur] = useInputValues(controlInputRef, value, defaultValue, \n          minDate, maxDate, dateFormat, onClear, onChange)\n\n  const [groupInputId, hiddenInputId, controlInputId, overlayId] = useInputIds(id, name, customControl)\n\n  useImperativeHandle(ref, () => ({\n    getValue: () => {\n      return selectedDate ? selectedDate.toISOString() : null;\n    },\n    getFormattedValue: () => {\n      return displayDate ? inputValue : null;\n    },\n    getNode: () => controlInputRef?.current\n  })) //, [controlInputRef, displayDate, inputValue, selectedDate]))\n  \n\n  const fixedDayLabels = useFixedDayLabels(dayLabels, weekStartsOn)\n\n  const handleChangeDateAndBlur = (nSelectedDate) => {\n    handleChangeDate(nSelectedDate)\n    handleBlur(true)\n  }\n  \n  return (\n    <InputGroup\n      customInputGroup  = {customInputGroup}\n      size              = {size}\n      inputId           = {groupInputId}>\n      \n      <InputControlInput \n        controlId         = {controlInputId}\n        customControl     = {customControl}\n        value             = {inputValue || ''}\n        required          = {required}\n        placeholder       = {placeholder || ''}\n        inputRef          = {controlInputRef}\n        disabled          = {disabled}\n        className         = {className}\n        style             = {style}\n        autoFocus         = {autoFocus}\n        autoComplete      = {autoComplete}\n        onInvalid         = {onInvalid}\n        noValidate        = {noValidate}\n        valid             = {valid}\n        invalid           = {invalid}\n        onFocus           = {() => handleFocus()}\n        onBlur            = {(event) => {handleBadInputOnBlur(); handleBlur(event) }}\n        onChange          = {() => handleInputChange()}\n      />\n\n      <InputOverlay  \n        overlayContainerRef = {overlayContainerRef}\n        oid                 = {overlayId}>\n\n        {overlayContainerRef.current == undefined\n         ? null\n         : \n\n          <Calendar\n            popoverRef           = {popoverRef}\n            placement            = {placement}\n            open                 = {open}\n            container            = {calendarContainer || overlayContainerRef}\n            target               = {controlInputId}\n            previousButtonElement= {previousButtonElement}\n            nextButtonElement    = {nextButtonElement}\n            pickMonthElement     = {pickMonthElement}\n            displayDate          = {displayDate}\n            minDate              = {minDate}\n            maxDate              = {maxDate}\n            onChangeMonth        = {(newDisplayDate) => handleChangeMonth(newDisplayDate)}\n            monthLabels          = {monthLabels}\n            cellPadding          = {cellPadding}\n            selectedDate         = {selectedDate}\n            onChange             = {(newSelectedDate) => handleChangeDateAndBlur(newSelectedDate)}\n            dayLabels            = {fixedDayLabels}\n            weekStartsOn         = {weekStartsOn}\n            showTodayButton      = {showTodayButton}\n            todayButtonLabel     = {todayButtonLabel}\n            roundedCorners       = {roundedCorners}\n            showWeeks            = {showWeeks}/>\n        }\n      </InputOverlay>\n      \n      <InputHidden\n        inputId             = {hiddenInputId}\n        name                = {name}\n        value               = {innerValue || ''}\n        formattedValue      = {innerValue ? inputValue : ''}\n        hiddenInputRef      = {hiddenInputRef}\n        />\n      \n            \n      {(showClearButton && !customControl)\n        ? \n        <InputClearButton\n          inputValue         = {inputValue}\n          disabled           = {disabled}\n          clearButtonElement = {clearButtonElement}\n          onClick            = {() => handleClear()}\n        /> \n        : null         \n      }\n      \n      {children}\n  \n    </InputGroup>\n  )\n}\n\nconst DatePicker = forwardRef(DatePickerBase)\n\nexport {DatePicker}\n"],"names":["useCheckProps","value","defaultValue","undefined","InputGroup","_ref","children","customInputGroup","size","inputId","React","cloneElement","createElement","RSInputGroup","id","className","InputOverlay","oid","overlayContainerRef","ref","InputHidden","name","formattedValue","hiddenInputRef","type","InputClearButton","inputValue","disabled","clearButtonElement","onClick","InputGroupText","style","opacity","cursor","InputControlInput","customControl","controlId","required","placeholder","inputRef","autoFocus","autoComplete","valid","invalid","onInvalid","noValidate","onKeyDown","onFocus","onBlur","onChange","validityClassNames","concat","props","_objectSpread","Input","innerRef","setTimeToNoon","date","setHours","getTimezoneOffset","setMinutes","setSeconds","setMilliseconds","getDateFromIsoString","isoString","Date","getIsoStringFromDate","toISOString","_makeInputValueString","separator","dateFormat","month","getMonth","day","getDate","match","getFullYear","useInputValues","controlInputRef","minDate","maxDate","onClear","setSeparator","useState","innerValue","setInnerValue","setInputValue","displayDate","setDisplayDate","selectedDate","setSelectedDate","useEffect","nSelectedDate","nInnerValue","nInputValue","nDisplayDate","today","parse","handleClear","handleBadInput","originalValue","tail","arguments","length","parts","replace","RegExp","split","slice","padEnd","join","handleBadInputOnBlur","_controlInputRef$curr","current","handleInputChange","_controlInputRef$curr2","year","monthInteger","parseInt","dayInteger","yearInteger","beforeMinDate","afterMaxDate","isNaN","handleChangeMonth","handleChangeDate","getInstanceCount","window","_reactstrapDatePickerInstance","next","process","console","error","_getIdSuffix","iCount","toString","_getInputIds","_customControl$props","idSuffix","group","hidden","control","overlay","useInputIds","inputIds","setInputIds","_getFixedDayLabels","dayLabels","weekStartsOn","useFixedDayLabels","fixedDayLabels","setFixedDayLabels","compareMonths","a","b","da","db","sameYear","sameMonth","e","_getYearList","minYear","maxYear","yList","y","push","PickMonthDefault","monthLabels","onChangeMonth","onChangeYear","setMonth","setYear","yearList","setYearList","ev","m","target","handleChangeYear","display","flexFlow","flexWrap","flex","lineHeight","fontSize","padding","map","lmonth","lidx","key","lyear","CalendarHeader","previousButtonElement","nextButtonElement","pickMonthElement","displayingMinMonth","setDisplayingMinMonth","displayingMaxMonth","setDisplayingMaxMonth","title","setTitle","PickMonthElement","handleChangeMonthIncr","inc","newDisplayDate","setFullYear","userSelect","flexBasis","alignSelf","CalendarSubHeader","showWeeks","cellPadding","label","index","CalendarDayOutOfMonth","CAL_DAY_CLASSNAME_BY_MODE","CalendarDayInMonth","mode","onDayClick","roundedCorners","handleClick","borderRadius","CalendarWeekNum","weekNum","color","CalendarBody","calendarDays","week","weekIndex","weekDays","weekDay","weekDayIndex","inMonth","CalendarFooter","handleTodayClick","showTodayButton","todayButtonLabel","colSpan","paddingTop","Button","block","DAYS_BY_MONTH","_groupByWeeks","firstDay","startingDay","getDay","monthLength","isInMonth","monthDay","getWeekNumber","valueOf","dayNr","setDate","firstThursday","Math","ceil","allWeeks","weeks","_makeCalendarDays","groupByWeeks","getDayMode","currentDate","useCalendarDays","setGroupByWeeks","setCalendarDays","Calendar","popoverRef","placement","open","container","handleDayClick","currentTarget","getAttribute","newSelectedDate","Fragment","Popover","isOpen","PopoverHeader","tag","PopoverBody","useCustomEvents","customOnBlur","useCallback","event","document","createEvent","initEvent","dispatchEvent","customOnFocus","getMaybeFuncValue","Object","prototype","call","isFunction","useCalendarProps","calendarPlacement","setOpen","setPlacement","useRef","isOutside","outOfCalendar","contains","outOfControlInput","isOut","handleClickOutside","stopPropagation","addEventListener","removeEventListener","handleFocus","nPlacement","handleBlur","_defaultDateFormat","language","navigator","userLanguage","toLowerCase","DEFAULT_DAY_LABELS","DEFAULT_MONTH_LABELS","DatePickerBase","showClearButton","calendarContainer","propError","Error","groupInputId","hiddenInputId","controlInputId","overlayId","useImperativeHandle","getValue","getFormattedValue","getNode","handleChangeDateAndBlur","DatePicker","forwardRef"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAMA,aAAa,GAAGA,CAACC,KAAK,EAAEC,YAAY,KAAK;EAC7C,IAAID,KAAK,IAAIC,YAAY,EAAE;AACzB,IAAA,OAAO,kEAAkE;AAC3E;AAEA,EAAA,OAAOC,SAAS;AAClB,CAAC;;ACFD,IAAMC,UAAU,GAAGC,IAAA,IAAiD;EAAA,IAAhD;IAACC,QAAQ;IAAEC,gBAAgB;IAAEC,IAAI;AAAEC,IAAAA;AAAO,GAAC,GAAAJ,IAAA;EAE7D,IAAIE,gBAAgB,IAAIJ,SAAS,EAAE;AACjC,IAAA,oBACEO,KAAK,CAACC,YAAY,CAACJ,gBAAgB,EAAE;AAACD,MAAAA,QAAQ,EAAEA;AAAQ,KAAC,CAAC;AAE9D;AAEA,EAAA,oBACII,KAAA,CAAAE,aAAA,CAACC,YAAY,EAAA;AACXL,IAAAA,IAAI,EAASA,IAAK;AAClBM,IAA