@hitachivantara/uikit-react-core 5.10.0 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/cjs/components/ActionsGeneric/ActionsGeneric.cjs.map +1 -1
  2. package/dist/cjs/components/BaseInput/BaseInput.cjs +18 -1
  3. package/dist/cjs/components/BaseInput/BaseInput.cjs.map +1 -1
  4. package/dist/cjs/components/BreadCrumb/BreadCrumb.cjs +3 -3
  5. package/dist/cjs/components/BreadCrumb/BreadCrumb.cjs.map +1 -1
  6. package/dist/cjs/components/BreadCrumb/Page/Page.cjs +22 -12
  7. package/dist/cjs/components/BreadCrumb/Page/Page.cjs.map +1 -1
  8. package/dist/cjs/components/BreadCrumb/Page/Page.styles.cjs +19 -44
  9. package/dist/cjs/components/BreadCrumb/Page/Page.styles.cjs.map +1 -1
  10. package/dist/cjs/components/Calendar/Calendar.cjs +4 -0
  11. package/dist/cjs/components/Calendar/Calendar.cjs.map +1 -1
  12. package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.cjs +3 -3
  13. package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.cjs.map +1 -1
  14. package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.styles.cjs +23 -16
  15. package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.styles.cjs.map +1 -1
  16. package/dist/cjs/components/Calendar/SingleCalendar/CalendarCell.cjs +5 -17
  17. package/dist/cjs/components/Calendar/SingleCalendar/CalendarCell.cjs.map +1 -1
  18. package/dist/cjs/components/Calendar/SingleCalendar/SingleCalendar.cjs +3 -1
  19. package/dist/cjs/components/Calendar/SingleCalendar/SingleCalendar.cjs.map +1 -1
  20. package/dist/cjs/components/Calendar/utils.cjs +0 -8
  21. package/dist/cjs/components/Calendar/utils.cjs.map +1 -1
  22. package/dist/cjs/components/DatePicker/DatePicker.cjs +5 -3
  23. package/dist/cjs/components/DatePicker/DatePicker.cjs.map +1 -1
  24. package/dist/cjs/components/DropDownMenu/DropDownMenu.cjs +4 -3
  25. package/dist/cjs/components/DropDownMenu/DropDownMenu.cjs.map +1 -1
  26. package/dist/cjs/components/FileUploader/DropZone/DropZone.cjs +5 -4
  27. package/dist/cjs/components/FileUploader/DropZone/DropZone.cjs.map +1 -1
  28. package/dist/cjs/components/FilterGroup/Counter/Counter.cjs +1 -2
  29. package/dist/cjs/components/FilterGroup/Counter/Counter.cjs.map +1 -1
  30. package/dist/cjs/components/Pagination/Pagination.styles.cjs +10 -14
  31. package/dist/cjs/components/Pagination/Pagination.styles.cjs.map +1 -1
  32. package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
  33. package/dist/cjs/components/Tooltip/Tooltip.styles.cjs +23 -37
  34. package/dist/cjs/components/Tooltip/Tooltip.styles.cjs.map +1 -1
  35. package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs +7 -0
  36. package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs.map +1 -1
  37. package/dist/cjs/components/VerticalNavigation/VerticalNavigation.cjs +2 -1
  38. package/dist/cjs/components/VerticalNavigation/VerticalNavigation.cjs.map +1 -1
  39. package/dist/cjs/components/VerticalNavigation/VerticalNavigationContext.cjs.map +1 -1
  40. package/dist/cjs/hooks/useUniqueId.cjs +1 -1
  41. package/dist/cjs/hooks/useUniqueId.cjs.map +1 -1
  42. package/dist/cjs/index.cjs +0 -2
  43. package/dist/cjs/index.cjs.map +1 -1
  44. package/dist/esm/components/ActionsGeneric/ActionsGeneric.js.map +1 -1
  45. package/dist/esm/components/BaseInput/BaseInput.js +18 -1
  46. package/dist/esm/components/BaseInput/BaseInput.js.map +1 -1
  47. package/dist/esm/components/BreadCrumb/BreadCrumb.js +3 -3
  48. package/dist/esm/components/BreadCrumb/BreadCrumb.js.map +1 -1
  49. package/dist/esm/components/BreadCrumb/Page/Page.js +23 -13
  50. package/dist/esm/components/BreadCrumb/Page/Page.js.map +1 -1
  51. package/dist/esm/components/BreadCrumb/Page/Page.styles.js +19 -42
  52. package/dist/esm/components/BreadCrumb/Page/Page.styles.js.map +1 -1
  53. package/dist/esm/components/Calendar/Calendar.js +4 -0
  54. package/dist/esm/components/Calendar/Calendar.js.map +1 -1
  55. package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.js +4 -4
  56. package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.js.map +1 -1
  57. package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.styles.js +24 -17
  58. package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.styles.js.map +1 -1
  59. package/dist/esm/components/Calendar/SingleCalendar/CalendarCell.js +6 -18
  60. package/dist/esm/components/Calendar/SingleCalendar/CalendarCell.js.map +1 -1
  61. package/dist/esm/components/Calendar/SingleCalendar/SingleCalendar.js +3 -1
  62. package/dist/esm/components/Calendar/SingleCalendar/SingleCalendar.js.map +1 -1
  63. package/dist/esm/components/Calendar/utils.js +1 -9
  64. package/dist/esm/components/Calendar/utils.js.map +1 -1
  65. package/dist/esm/components/DatePicker/DatePicker.js +5 -3
  66. package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
  67. package/dist/esm/components/DropDownMenu/DropDownMenu.js +4 -3
  68. package/dist/esm/components/DropDownMenu/DropDownMenu.js.map +1 -1
  69. package/dist/esm/components/FileUploader/DropZone/DropZone.js +5 -4
  70. package/dist/esm/components/FileUploader/DropZone/DropZone.js.map +1 -1
  71. package/dist/esm/components/FilterGroup/Counter/Counter.js +1 -2
  72. package/dist/esm/components/FilterGroup/Counter/Counter.js.map +1 -1
  73. package/dist/esm/components/Pagination/Pagination.styles.js +10 -14
  74. package/dist/esm/components/Pagination/Pagination.styles.js.map +1 -1
  75. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  76. package/dist/esm/components/Tooltip/Tooltip.styles.js +24 -38
  77. package/dist/esm/components/Tooltip/Tooltip.styles.js.map +1 -1
  78. package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js +7 -0
  79. package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js.map +1 -1
  80. package/dist/esm/components/VerticalNavigation/VerticalNavigation.js +2 -1
  81. package/dist/esm/components/VerticalNavigation/VerticalNavigation.js.map +1 -1
  82. package/dist/esm/components/VerticalNavigation/VerticalNavigationContext.js.map +1 -1
  83. package/dist/esm/hooks/useUniqueId.js +2 -2
  84. package/dist/esm/hooks/useUniqueId.js.map +1 -1
  85. package/dist/esm/index.js +0 -2
  86. package/dist/esm/index.js.map +1 -1
  87. package/dist/types/index.d.ts +40 -44
  88. package/package.json +2 -2
  89. package/dist/cjs/hocs/withId.cjs +0 -31
  90. package/dist/cjs/hocs/withId.cjs.map +0 -1
  91. package/dist/esm/hocs/withId.js +0 -28
  92. package/dist/esm/hocs/withId.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarHeader.cjs","sources":["../../../../../src/components/Calendar/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import { useState, useEffect, useContext } from \"react\";\nimport dayjs from \"dayjs\";\nimport localeData from \"dayjs/plugin/localeData\";\nimport localizedFormat from \"dayjs/plugin/localizedFormat\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat\";\nimport { clsx } from \"clsx\";\nimport isNil from \"lodash/isNil\";\nimport {\n HvFormElementContext,\n HvFormElementValueContext,\n HvFormElementDescriptorsContext,\n HvTypography,\n} from \"@core/components\";\nimport { isKeypress, keyboardCodes, setId } from \"@core/utils\";\nimport { Info } from \"@hitachivantara/uikit-react-icons\";\nimport { isRange, isSameDay, formatToLocale, isDate } from \"../utils\";\nimport { DateRangeProp } from \"../Calendar\";\nimport calendarHeaderClasses, {\n HvCalendarHeaderClasses,\n} from \"./calendarHeaderClasses\";\nimport {\n StyledHeaderDayOfWeek,\n StyledInput,\n StyledInputBorderContainer,\n StyledRoot,\n} from \"./CalendarHeader.styles\";\n\ndayjs.extend(localeData);\ndayjs.extend(localizedFormat);\ndayjs.extend(customParseFormat);\n\nconst { Enter } = keyboardCodes;\n\nexport const HvCalendarHeader = ({\n id,\n value,\n locale = \"en-US\",\n classes,\n onChange,\n showEndDate,\n showDayOfWeek = false,\n onFocus,\n ...others\n}: HvCalendarHeaderProps) => {\n const { elementId } = useContext(HvFormElementContext);\n const elementValue = useContext(HvFormElementValueContext);\n const { label } = useContext(HvFormElementDescriptorsContext);\n\n let localValue: string | Date | DateRangeProp | undefined =\n value ?? elementValue ?? \"\";\n if (isRange(localValue)) {\n localValue = showEndDate ? localValue.endDate : localValue.startDate;\n }\n const [dateValue, setDateValue] = useState<\n string | Date | DateRangeProp | undefined\n >(localValue);\n const [editedValue, setEditedValue] = useState<string | null>(null);\n const [displayValue, setDisplayValue] = useState(\"\");\n const [weekdayDisplay, setWeekdayDisplay] = useState(\"\");\n\n const localId = id ?? setId(elementId, \"calendarHeader\");\n\n const inputValue = editedValue ?? displayValue;\n const localeFormat = dayjs().locale(locale).localeData().longDateFormat(\"L\");\n\n const [isValidValue, setIsValidValue] = useState(\n inputValue.length === 0 || (!!inputValue && dayjs(localValue).isValid())\n );\n\n const validateInput = (incomingValid) =>\n incomingValid === undefined || dayjs(incomingValid).isValid();\n useEffect(() => {\n const valid = validateInput(localValue);\n setIsValidValue(valid);\n if (valid) {\n if (!localValue) {\n setDisplayValue(\"\");\n setEditedValue(null);\n setWeekdayDisplay(\"\");\n return;\n }\n const weekday = new Intl.DateTimeFormat(locale, {\n weekday: \"short\",\n }).format(isDate(localValue) ? localValue : 0);\n setDisplayValue(formatToLocale(localValue, locale));\n setEditedValue(null);\n setWeekdayDisplay(weekday);\n }\n }, [localValue, locale]);\n\n const handleNewDate = (event, date) => {\n // attempt to format in locale data, or fallback to default\n const localeParsedDate = dayjs(date, localeFormat);\n\n const isValidInput = localeParsedDate.isValid();\n const dateParsed = isValidInput\n ? localeParsedDate.toDate()\n : dayjs(date).toDate();\n // prevent extra updates\n if (!isSameDay(dateParsed, dateValue)) {\n setDateValue(dateParsed);\n onChange?.(event, dateParsed);\n }\n\n setIsValidValue(isValidInput);\n if (isValidInput) {\n setEditedValue(null);\n }\n };\n\n const onBlurHandler = (event) => {\n if (isNil(editedValue)) return;\n if (editedValue === \"\") {\n setIsValidValue(true);\n setEditedValue(null);\n return;\n }\n handleNewDate(event, editedValue);\n };\n\n const keyDownHandler = (event) => {\n if (!isKeypress(event, Enter) || isNil(editedValue) || editedValue === \"\")\n return;\n event.preventDefault();\n\n handleNewDate(event, editedValue);\n };\n\n const onFocusHandler = (event) => {\n if (!localValue) return;\n const formattedDate =\n isValidValue && isDate(localValue)\n ? dayjs(localValue).locale(locale).format(\"L\")\n : editedValue;\n setEditedValue(formattedDate);\n onFocus?.(event, formattedDate);\n };\n\n const onChangeHandler = (event) => {\n setEditedValue(event.target.value);\n };\n return (\n <>\n <StyledRoot\n id={localId}\n className={clsx(\n calendarHeaderClasses.root,\n classes?.root,\n !isValidValue &&\n inputValue !== \"\" &&\n clsx(calendarHeaderClasses.invalid, classes?.invalid)\n )}\n >\n {showDayOfWeek && (\n <StyledHeaderDayOfWeek\n className={clsx(\n calendarHeaderClasses.headerDayOfWeek,\n classes?.headerDayOfWeek\n )}\n >\n {weekdayDisplay || \"\\u00A0\"}\n </StyledHeaderDayOfWeek>\n )}\n\n <div\n className={clsx(\n calendarHeaderClasses.headerDate,\n classes?.headerDate\n )}\n >\n <StyledInput\n type=\"text\"\n id={setId(localId, \"header-input\")}\n placeholder={localeFormat}\n value={inputValue}\n className={clsx(calendarHeaderClasses.input, classes?.input)}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n onChange={onChangeHandler}\n onKeyDown={keyDownHandler}\n aria-labelledby={label?.[0]?.id}\n {...others}\n />\n </div>\n </StyledRoot>\n {!isValidValue && inputValue !== \"\" && (\n <StyledInputBorderContainer\n role=\"presentation\"\n className={clsx(\n calendarHeaderClasses.inputBorderContainer,\n classes?.inputBorderContainer\n )}\n />\n )}\n <div style={{ height: 32 }}>\n {!isValidValue && inputValue !== \"\" && (\n <HvTypography\n component=\"span\"\n variant=\"body\"\n className={clsx(\n calendarHeaderClasses.invalidMessageStyling,\n classes?.invalidMessageStyling\n )}\n >\n <Info color=\"brand\" iconSize=\"S\" />\n Invalid date\n </HvTypography>\n )}\n </div>\n </>\n );\n};\n\n// TODO: refactor this out\nHvCalendarHeader.formElementType = \"HvCalendarHeader\";\n\nexport interface HvCalendarHeaderProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvCalendarHeaderClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The text to be shown on the main part of the header.\n */\n value?: string | Date | DateRangeProp;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n value: Date | DateRangeProp\n ) => void;\n /**\n * Callback to handle input onFocus.\n */\n onFocus?: (\n event: React.FocusEventHandler<any>,\n formattedDate: string | null\n ) => void;\n /**\n * Indicates if header should display end date in a date range.\n */\n showEndDate?: boolean;\n /**\n * Indicates if header should display the day of week.\n */\n showDayOfWeek?: boolean;\n}\n"],"names":["dayjs","extend","localeData","localizedFormat","customParseFormat","Enter","keyboardCodes","HvCalendarHeader","id","value","locale","classes","onChange","showEndDate","showDayOfWeek","onFocus","others","elementId","useContext","HvFormElementContext","elementValue","HvFormElementValueContext","label","HvFormElementDescriptorsContext","localValue","isRange","endDate","startDate","dateValue","setDateValue","useState","editedValue","setEditedValue","displayValue","setDisplayValue","weekdayDisplay","setWeekdayDisplay","localId","setId","inputValue","localeFormat","longDateFormat","isValidValue","setIsValidValue","length","isValid","validateInput","incomingValid","undefined","useEffect","valid","weekday","Intl","DateTimeFormat","format","isDate","formatToLocale","handleNewDate","event","date","localeParsedDate","isValidInput","dateParsed","toDate","isSameDay","onBlurHandler","isNil","keyDownHandler","isKeypress","preventDefault","onFocusHandler","formattedDate","onChangeHandler","target","_Fragment","children","_jsxs","StyledRoot","className","clsx","calendarHeaderClasses","root","invalid","_jsx","StyledHeaderDayOfWeek","headerDayOfWeek","headerDate","StyledInput","type","placeholder","input","onBlur","onKeyDown","StyledInputBorderContainer","role","inputBorderContainer","style","height","HvTypography","component","variant","invalidMessageStyling","Info","color","iconSize","formElementType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BAA,eAAAA,QAAMC,OAAOC,oBAAAA,OAAU;AACvBF,eAAAA,QAAMC,OAAOE,yBAAAA,OAAe;AAC5BH,eAAAA,QAAMC,OAAOG,2BAAAA,OAAiB;AAE9B,MAAM;AAAA,EAAEC;AAAM,IAAIC;AAEX,MAAMC,mBAAmBA,CAAC;AAAA,EAC/BC;AAAAA,EACAC;AAAAA,EACAC,SAAS;AAAA,EACTC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,gBAAgB;AAAA,EAChBC;AAAAA,EACA,GAAGC;AACkB,MAAM;;AACrB,QAAA;AAAA,IAAEC;AAAAA,EAAAA,IAAcC,MAAAA,WAAWC,mBAAAA,oBAAoB;AAC/CC,QAAAA,eAAeF,iBAAWG,wBAAAA,yBAAyB;AACnD,QAAA;AAAA,IAAEC;AAAAA,EAAAA,IAAUJ,MAAAA,WAAWK,8BAAAA,+BAA+B;AAExDC,MAAAA,aACFf,SAASW,gBAAgB;AACvBK,MAAAA,MAAAA,QAAQD,UAAU,GAAG;AACVX,iBAAAA,cAAcW,WAAWE,UAAUF,WAAWG;AAAAA,EAC7D;AACA,QAAM,CAACC,WAAWC,YAAY,IAAIC,eAEhCN,UAAU;AACZ,QAAM,CAACO,aAAaC,cAAc,IAAIF,eAAwB,IAAI;AAClE,QAAM,CAACG,cAAcC,eAAe,IAAIJ,eAAS,EAAE;AACnD,QAAM,CAACK,gBAAgBC,iBAAiB,IAAIN,eAAS,EAAE;AAEvD,QAAMO,UAAU7B,MAAM8B,MAAMrB,MAAAA,WAAW,gBAAgB;AAEvD,QAAMsB,aAAaR,eAAeE;AAC5BO,QAAAA,eAAexC,uBAAQU,EAAAA,OAAOA,M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,QACnBX,yCAEDY,mCAAW;AAAA,UACVC,MAAK;AAAA,UACLhF,IAAI8B,MAAAA,MAAMD,SAAS,cAAc;AAAA,UACjCoD,aAAajD;AAAAA,UACb/B,OAAO8B;AAAAA,UACPuC,WAAWC,KAAAA,KAAKC,sBAAAA,QAAsBU,OAAO/E,mCAAS+E,KAAK;AAAA,UAC3DC,QAAQ1B;AAAAA,UACRlD,SAASuD;AAAAA,UACT1D,UAAU4D;AAAAA,UACVoB,WAAWzB;AAAAA,UACX,oBAAiB7C,oCAAQ,OAARA,mBAAYd;AAAAA,UAAG,GAC5BQ;AAAAA,QAAAA,CAAM;AAAA,MAAA,CAER,CAAA;AAAA,IAAA,CACK,GACZ,CAAC0B,gBAAgBH,eAAe,qCAC9BsD,sBAAAA,4BAA0B;AAAA,MACzBC,MAAK;AAAA,MACLhB,WAAWC,KAAAA,KACTC,sBAAAA,QAAsBe,sBACtBpF,mCAASoF,oBAAoB;AAAA,IAAA,CAC7B,GAGNZ,2BAAAA,IAAA,OAAA;AAAA,MAAKa,OAAO;AAAA,QAAEC,QAAQ;AAAA,MAAG;AAAA,MAAEtB,UACxB,CAACjC,gBAAgBH,eAAe,sCAC9B2D,WAAAA,cAAY;AAAA,QACXC,WAAU;AAAA,QACVC,SAAQ;AAAA,QACRtB,WAAWC,KAAAA,KACTC,sBAAAA,QAAsBqB,uBACtB1F,mCAAS0F,qBAAqB;AAAA,QAC9B1B,UAAA,CAEFQ,2BAAAA,IAACmB,sBAAI;AAAA,UAACC,OAAM;AAAA,UAAQC,UAAS;AAAA,QAAG,CAAA,GAElC,cAAA;AAAA,MAAA,CAAA;AAAA,IAAA,CAEE,CAAA;AAAA,EAAA,CACL;AAEP;AAGAjG,iBAAiBkG,kBAAkB;;"}
1
+ {"version":3,"file":"CalendarHeader.cjs","sources":["../../../../../src/components/Calendar/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import { useState, useEffect, useContext } from \"react\";\nimport dayjs from \"dayjs\";\nimport localeData from \"dayjs/plugin/localeData\";\nimport localizedFormat from \"dayjs/plugin/localizedFormat\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat\";\nimport { clsx } from \"clsx\";\nimport isNil from \"lodash/isNil\";\nimport {\n HvFormElementContext,\n HvFormElementValueContext,\n HvFormElementDescriptorsContext,\n} from \"@core/components\";\nimport { isKeypress, keyboardCodes, setId } from \"@core/utils\";\nimport { Info } from \"@hitachivantara/uikit-react-icons\";\nimport { isRange, isSameDay, formatToLocale, isDate } from \"../utils\";\nimport { DateRangeProp } from \"../Calendar\";\nimport calendarHeaderClasses, {\n HvCalendarHeaderClasses,\n} from \"./calendarHeaderClasses\";\nimport {\n StyledHeaderDayOfWeek,\n StyledInput,\n StyledInputBorderContainer,\n StyledRoot,\n StyledTypography,\n} from \"./CalendarHeader.styles\";\n\ndayjs.extend(localeData);\ndayjs.extend(localizedFormat);\ndayjs.extend(customParseFormat);\n\nconst { Enter } = keyboardCodes;\n\nexport const HvCalendarHeader = ({\n id,\n value,\n locale = \"en-US\",\n classes,\n onChange,\n showEndDate,\n showDayOfWeek = false,\n onFocus,\n invalidDateLabel = \"Invalid Date\",\n ...others\n}: HvCalendarHeaderProps) => {\n const { elementId } = useContext(HvFormElementContext);\n const elementValue = useContext(HvFormElementValueContext);\n const { label } = useContext(HvFormElementDescriptorsContext);\n\n let localValue: string | Date | DateRangeProp | undefined =\n value ?? elementValue ?? \"\";\n if (isRange(localValue)) {\n localValue = showEndDate ? localValue.endDate : localValue.startDate;\n }\n const [dateValue, setDateValue] = useState<\n string | Date | DateRangeProp | undefined\n >(localValue);\n const [editedValue, setEditedValue] = useState<string | null>(null);\n const [displayValue, setDisplayValue] = useState(\"\");\n const [weekdayDisplay, setWeekdayDisplay] = useState(\"\");\n\n const localId = id ?? setId(elementId, \"calendarHeader\");\n\n const inputValue = editedValue ?? displayValue;\n const localeFormat = dayjs().locale(locale).localeData().longDateFormat(\"L\");\n\n const [isValidValue, setIsValidValue] = useState(\n inputValue.length === 0 || (!!inputValue && dayjs(localValue).isValid())\n );\n\n const validateInput = (incomingValid) =>\n incomingValid === undefined || dayjs(incomingValid).isValid();\n useEffect(() => {\n const valid = validateInput(localValue);\n setIsValidValue(valid);\n if (valid) {\n if (!localValue) {\n setDisplayValue(\"\");\n setEditedValue(null);\n setWeekdayDisplay(\"\");\n return;\n }\n const weekday = new Intl.DateTimeFormat(locale, {\n weekday: \"short\",\n }).format(isDate(localValue) ? localValue : 0);\n setDisplayValue(formatToLocale(localValue, locale));\n setEditedValue(null);\n setWeekdayDisplay(weekday);\n }\n }, [localValue, locale]);\n\n const handleNewDate = (event, date) => {\n // attempt to format in locale data, or fallback to default\n const localeParsedDate = dayjs(date, localeFormat);\n\n const isValidInput = localeParsedDate.isValid();\n const dateParsed = isValidInput\n ? localeParsedDate.toDate()\n : dayjs(date).toDate();\n // prevent extra updates\n if (!isSameDay(dateParsed, dateValue)) {\n setDateValue(dateParsed);\n onChange?.(event, dateParsed);\n }\n\n setIsValidValue(isValidInput);\n if (isValidInput) {\n setEditedValue(null);\n }\n };\n\n const onBlurHandler = (event) => {\n if (isNil(editedValue)) return;\n if (editedValue === \"\") {\n setIsValidValue(true);\n setEditedValue(null);\n return;\n }\n handleNewDate(event, editedValue);\n };\n\n const keyDownHandler = (event) => {\n if (!isKeypress(event, Enter) || isNil(editedValue) || editedValue === \"\")\n return;\n event.preventDefault();\n\n handleNewDate(event, editedValue);\n };\n\n const onFocusHandler = (event) => {\n if (!localValue) return;\n const formattedDate =\n isValidValue && isDate(localValue)\n ? dayjs(localValue).locale(locale).format(\"L\")\n : editedValue;\n setEditedValue(formattedDate);\n onFocus?.(event, formattedDate);\n };\n\n const onChangeHandler = (event) => {\n setEditedValue(event.target.value);\n };\n return (\n <>\n <StyledRoot\n id={localId}\n className={clsx(\n calendarHeaderClasses.root,\n classes?.root,\n !isValidValue &&\n inputValue !== \"\" &&\n clsx(calendarHeaderClasses.invalid, classes?.invalid)\n )}\n >\n {showDayOfWeek && (\n <StyledHeaderDayOfWeek\n className={clsx(\n calendarHeaderClasses.headerDayOfWeek,\n classes?.headerDayOfWeek\n )}\n >\n {weekdayDisplay || \"\\u00A0\"}\n </StyledHeaderDayOfWeek>\n )}\n\n <div\n className={clsx(\n calendarHeaderClasses.headerDate,\n classes?.headerDate\n )}\n >\n <StyledInput\n type=\"text\"\n id={setId(localId, \"header-input\")}\n placeholder={localeFormat}\n value={inputValue}\n className={clsx(calendarHeaderClasses.input, classes?.input)}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n onChange={onChangeHandler}\n onKeyDown={keyDownHandler}\n aria-labelledby={label?.[0]?.id}\n {...others}\n />\n </div>\n </StyledRoot>\n {!isValidValue && inputValue !== \"\" && (\n <StyledInputBorderContainer\n role=\"presentation\"\n className={clsx(\n calendarHeaderClasses.inputBorderContainer,\n classes?.inputBorderContainer\n )}\n />\n )}\n <div style={{ height: 32 }}>\n {!isValidValue && inputValue !== \"\" && (\n <StyledTypography\n component=\"span\"\n variant=\"body\"\n className={clsx(\n calendarHeaderClasses.invalidMessageStyling,\n classes?.invalidMessageStyling\n )}\n >\n <Info color=\"brand\" iconSize=\"S\" />\n {invalidDateLabel}\n </StyledTypography>\n )}\n </div>\n </>\n );\n};\n\n// TODO: refactor this out\nHvCalendarHeader.formElementType = \"HvCalendarHeader\";\n\nexport interface HvCalendarHeaderProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvCalendarHeaderClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The text to be shown on the main part of the header.\n */\n value?: string | Date | DateRangeProp;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n value: Date | DateRangeProp\n ) => void;\n /**\n * Callback to handle input onFocus.\n */\n onFocus?: (\n event: React.FocusEventHandler<any>,\n formattedDate: string | null\n ) => void;\n /**\n * Indicates if header should display end date in a date range.\n */\n showEndDate?: boolean;\n /**\n * Indicates if header should display the day of week.\n */\n showDayOfWeek?: boolean;\n /**\n * Label shown when date is invalid.\n */\n invalidDateLabel?: string;\n}\n"],"names":["dayjs","extend","localeData","localizedFormat","customParseFormat","Enter","keyboardCodes","HvCalendarHeader","id","value","locale","classes","onChange","showEndDate","showDayOfWeek","onFocus","invalidDateLabel","others","elementId","useContext","HvFormElementContext","elementValue","HvFormElementValueContext","label","HvFormElementDescriptorsContext","localValue","isRange","endDate","startDate","dateValue","setDateValue","useState","editedValue","setEditedValue","displayValue","setDisplayValue","weekdayDisplay","setWeekdayDisplay","localId","setId","inputValue","localeFormat","longDateFormat","isValidValue","setIsValidValue","length","isValid","validateInput","incomingValid","undefined","useEffect","valid","weekday","Intl","DateTimeFormat","format","isDate","formatToLocale","handleNewDate","event","date","localeParsedDate","isValidInput","dateParsed","toDate","isSameDay","onBlurHandler","isNil","keyDownHandler","isKeypress","preventDefault","onFocusHandler","formattedDate","onChangeHandler","target","_Fragment","children","_jsxs","StyledRoot","className","clsx","calendarHeaderClasses","root","invalid","_jsx","StyledHeaderDayOfWeek","headerDayOfWeek","headerDate","StyledInput","type","placeholder","input","onBlur","onKeyDown","StyledInputBorderContainer","role","inputBorderContainer","style","height","StyledTypography","component","variant","invalidMessageStyling","Info","color","iconSize","formElementType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BAA,eAAAA,QAAMC,OAAOC,oBAAAA,OAAU;AACvBF,eAAAA,QAAMC,OAAOE,yBAAAA,OAAe;AAC5BH,eAAAA,QAAMC,OAAOG,2BAAAA,OAAiB;AAE9B,MAAM;AAAA,EAAEC;AAAM,IAAIC;AAEX,MAAMC,mBAAmBA,CAAC;AAAA,EAC/BC;AAAAA,EACAC;AAAAA,EACAC,SAAS;AAAA,EACTC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,gBAAgB;AAAA,EAChBC;AAAAA,EACAC,mBAAmB;AAAA,EACnB,GAAGC;AACkB,MAA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C,sBAAAA,QAAsBe,sBACtBrF,mCAASqF,oBAAoB;AAAA,IAAA,CAC7B,GAGNZ,2BAAAA,IAAA,OAAA;AAAA,MAAKa,OAAO;AAAA,QAAEC,QAAQ;AAAA,MAAG;AAAA,MAAEtB,UACxB,CAACjC,gBAAgBH,eAAe,sCAC9B2D,sBAAAA,kBAAgB;AAAA,QACfC,WAAU;AAAA,QACVC,SAAQ;AAAA,QACRtB,WAAWC,KAAAA,KACTC,sBAAAA,QAAsBqB,uBACtB3F,mCAAS2F,qBAAqB;AAAA,QAC9B1B,UAAA,CAEFQ,2BAAAA,IAACmB,sBAAI;AAAA,UAACC,OAAM;AAAA,UAAQC,UAAS;AAAA,QAAG,CAAA,GAC/BzF,gBAAgB;AAAA,MAAA,CAAA;AAAA,IAAA,CAGjB,CAAA;AAAA,EAAA,CACL;AAEP;AAGAT,iBAAiBmG,kBAAkB;;"}
@@ -8,9 +8,9 @@ const Typography = require("../../Typography/Typography.cjs");
8
8
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
9
9
  const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
10
10
  const StyledRoot = /* @__PURE__ */ _styled__default.default("div", process.env.NODE_ENV === "production" ? {
11
- target: "e1yjj6ap3"
11
+ target: "e1yjj6ap4"
12
12
  } : {
13
- target: "e1yjj6ap3",
13
+ target: "e1yjj6ap4",
14
14
  label: "StyledRoot"
15
15
  })({
16
16
  marginTop: uikitStyles.theme.spacing("xs"),
@@ -23,23 +23,23 @@ const StyledRoot = /* @__PURE__ */ _styled__default.default("div", process.env.N
23
23
  "&:hover, &:focus": {
24
24
  borderBottom: `1px solid ${uikitStyles.theme.colors.secondary}`
25
25
  }
26
- }, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2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cbiAgICBjb2xvcjogdGhlbWUuY29sb3JzLnNlY29uZGFyeV82MCxcbiAgfSxcbiAgXCImOjotd2Via2l0LWlubmVyLXNwaW4tYnV0dG9uLCAmOjotd2Via2l0LWNhbGVuZGFyLXBpY2tlci1pbmRpY2F0b3JcIjoge1xuICAgIFwiIC13ZWJraXQtYXBwZWFyYW5jZVwiOiBcIm5vbmVcIixcbiAgICBkaXNwbGF5OiBcIm5vbmVcIixcbiAgfSxcbiAgXCImOmZvY3VzXCI6IHtcbiAgICBvdXRsaW5lOiBcIm5vbmVcIixcbiAgfSxcbiAgXCImOmZvY3VzLXZpc2libGVcIjoge1xuICAgIC4uLm91dGxpbmVTdHlsZXMsXG4gIH0sXG59KTtcblxuZXhwb3J0IGNvbnN0IFN0eWxlZEhlYWRlckRheU9mV2VlayA9IHN0eWxlZChIdlR5cG9ncmFwaHkpKHtcbiAgY29sb3I6IHRoZW1lLmNhbGVuZGFyLmhlYWRlcklucHV0Rm9udENvbG9yLFxuICBwYWRkaW5nTGVmdDogdGhlbWUuc3BhY2luZyhcInhzXCIpLFxufSk7XG4iXX0= */");
26
+ }, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvQ2FsZW5kYXIvQ2FsZW5kYXJIZWFkZXIvQ2FsZW5kYXJIZWFkZXIuc3R5bGVzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLMEIiLCJmaWxlIjoiL2hvbWUvcnVubmVyL3dvcmsvaHYtdWlraXQtcmVhY3QvaHYtdWlraXQtcmVhY3QvcGFja2FnZXMvY29yZS9zcmMvY29tcG9uZW50cy9DYWxlbmRhci9DYWxlbmRhckhlYWRlci9DYWxlbmRhckhlYW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VuZGFyLmhlYWRlcklucHV0Rm9udENvbG9yLFxuICBwYWRkaW5nTGVmdDogdGhlbWUuc3BhY2luZyhcInhzXCIpLFxufSk7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRUeXBvZ3JhcGh5ID0gc3R5bGVkKEh2VHlwb2dyYXBoeSkoe1xuICBkaXNwbGF5OiBcImZsZXhcIixcbiAgYWxpZ25JdGVtczogXCJjZW50ZXJcIixcbiAgY29sb3I6IHRoZW1lLmNvbG9ycy5uZWdhdGl2ZSxcbn0pO1xuIl19 */");
27
27
  const StyledInputBorderContainer = /* @__PURE__ */ _styled__default.default("div", process.env.NODE_ENV === "production" ? {
28
- target: "e1yjj6ap2"
28
+ target: "e1yjj6ap3"
29
29
  } : {
30
- target: "e1yjj6ap2",
30
+ target: "e1yjj6ap3",
31
31
  label: "StyledInputBorderContainer"
32
32
  })({
33
33
  backgroundColor: uikitStyles.theme.colors.negative,
34
34
  height: 1,
35
35
  marginTop: -1
36
- }, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvQ2FsZW5kYXIvQ2FsZW5kYXJIZWFkZXIvQ2FsZW5kYXJIZWFkZXIuc3R5bGVzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrQjBDIiwiZmlsZSI6Ii9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvQ2FsZW5kYXIvQ2FsZW5kYXJIZWFkZXIvQ2FsZW5kYXJIZWFkZXIuc3R5bGVzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZ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ubmVnYXRpdmUsXG59KTtcbiJdfQ== */");
37
37
  const StyledInput = /* @__PURE__ */ _styled__default.default((props) => /* @__PURE__ */ jsxRuntime.jsx("input", {
38
38
  ...props
39
39
  }), process.env.NODE_ENV === "production" ? {
40
- target: "e1yjj6ap1"
40
+ target: "e1yjj6ap2"
41
41
  } : {
42
- target: "e1yjj6ap1",
42
+ target: "e1yjj6ap2",
43
43
  label: "StyledInput"
44
44
  })({
45
45
  border: "none",
@@ -55,28 +55,35 @@ const StyledInput = /* @__PURE__ */ _styled__default.default((props) => /* @__PU
55
55
  "&::placeholder": {
56
56
  color: uikitStyles.theme.colors.secondary_60
57
57
  },
58
- "&::-webkit-inner-spin-button, &::-webkit-calendar-picker-indicator": {
59
- " -webkit-appearance": "none",
60
- display: "none"
61
- },
62
58
  "&:focus": {
63
59
  outline: "none"
64
60
  },
65
61
  "&:focus-visible": {
66
62
  ...focusUtils.outlineStyles
67
63
  }
68
- }, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvQ2FsZW5kYXIvQ2FsZW5kYXJIZWFkZXIvQ2FsZW5kYXJIZWFkZXIuc3R5bGVzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3QjJCIiwiZmlsZSI6Ii9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvQ2FsZW5kYXIvQ2FsZW5kYXJIZWFkZXIvQ2FsZW5kYXJIZWFkZXIuc3R5bGVzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9u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cbiJdfQ== */");
69
65
  const StyledHeaderDayOfWeek = /* @__PURE__ */ _styled__default.default(Typography.HvTypography, process.env.NODE_ENV === "production" ? {
70
- target: "e1yjj6ap0"
66
+ target: "e1yjj6ap1"
71
67
  } : {
72
- target: "e1yjj6ap0",
68
+ target: "e1yjj6ap1",
73
69
  label: "StyledHeaderDayOfWeek"
74
70
  })({
75
71
  color: uikitStyles.theme.calendar.headerInputFontColor,
76
72
  paddingLeft: uikitStyles.theme.spacing("xs")
77
- }, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvQ2FsZW5kYXIvQ2FsZW5kYXJIZWFkZXIvQ2FsZW5kYXJIZWFkZXIuc3R5bGVzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtRHFDIiwiZmlsZSI6Ii9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvQ2FsZW5kYXIvQ2FsZW5kYXJIZWFkZXIvQ2FsZW5kYXJIZWFkZXIuc3R5bGVzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgdGhlbWUgfSBmcm9tIFwiQGhpdGFjaGl2YW50YXJhL3Vpa2l0LXN0eWxlc1wiO1xuaW1wb3J0IHsgSHZUeXBvZ3JhcGh5IH0gZnJvbSBcIkBjb3JlL2NvbXBvbmVudHNcIjtcbmltcG9ydCB7IG91dGxpbmVTdHlsZXMgfSBmcm9tIFwiQGNvcmUvdXRpbHNcIjtcblxuZXhwb3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TcGFjaW5nLFxuICBsaW5lSGVpZ2h0OiB0aGVtZS5jYWxlbmRhci5oZWFkZXJJbnB1dEZvbnRMaW5lSGVpZ2h0LFxuICBmb250V2VpZ2h0OiB0aGVtZS5jYWxlbmRhci5oZWFkZXJJbnB1dEZvbnRXZWlnaHQsXG4gIHdpZHRoOiBcIjEwMCVcIixcbiAgXCImOjpwbGFjZWhvbGRlclwiOiB7XG4gICAgY29sb3I6IHRoZW1lLmNvbG9ycy5zZWNvbmRhcnlfNjAsXG4gIH0sXG4gIFwiJjpmb2N1c1wiOiB7XG4gICAgb3V0bGluZTogXCJub25lXCIsXG4gIH0sXG4gIFwiJjpmb2N1cy12aXNpYmxlXCI6IHtcbiAgICAuLi5vdXRsaW5lU3R5bGVzLFxuICB9LFxufSk7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRIZWFkZXJEYXlPZldlZWsgPSBzdHlsZWQoSHZUeXBvZ3JhcGh5KSh7XG4gIGNvbG9yOiB0aGVtZS5jYWxlbmRhci5oZWFkZXJJbnB1dEZvbnRDb2xvcixcbiAgcGFkZGluZ0xlZnQ6IHRoZW1lLnNwYWNpbmcoXCJ4c1wiKSxcbn0pO1xuXG5leHBvcnQgY29uc3QgU3R5bGVkVHlwb2dyYXBoeSA9IHN0eWxlZChIdlR5cG9ncmFwaHkpKHtcbiAgZGlzcGxheTogXCJmbGV4XCIsXG4gIGFsaWduSXRlbXM6IFwiY2VudGVyXCIsXG4gIGNvbG9yOiB0aGVtZS5jb2xvcnMubmVnYXRpdmUsXG59KTtcbiJdfQ== */");
74
+ const StyledTypography = /* @__PURE__ */ _styled__default.default(Typography.HvTypography, process.env.NODE_ENV === "production" ? {
75
+ target: "e1yjj6ap0"
76
+ } : {
77
+ target: "e1yjj6ap0",
78
+ label: "StyledTypography"
79
+ })({
80
+ display: "flex",
81
+ alignItems: "center",
82
+ color: uikitStyles.theme.colors.negative
83
+ }, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset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nB1dEZvbnRMaW5lSGVpZ2h0LFxuICBmb250V2VpZ2h0OiB0aGVtZS5jYWxlbmRhci5oZWFkZXJJbnB1dEZvbnRXZWlnaHQsXG4gIHdpZHRoOiBcIjEwMCVcIixcbiAgXCImOjpwbGFjZWhvbGRlclwiOiB7XG4gICAgY29sb3I6IHRoZW1lLmNvbG9ycy5zZWNvbmRhcnlfNjAsXG4gIH0sXG4gIFwiJjpmb2N1c1wiOiB7XG4gICAgb3V0bGluZTogXCJub25lXCIsXG4gIH0sXG4gIFwiJjpmb2N1cy12aXNpYmxlXCI6IHtcbiAgICAuLi5vdXRsaW5lU3R5bGVzLFxuICB9LFxufSk7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRIZWFkZXJEYXlPZldlZWsgPSBzdHlsZWQoSHZUeXBvZ3JhcGh5KSh7XG4gIGNvbG9yOiB0aGVtZS5jYWxlbmRhci5oZWFkZXJJbnB1dEZvbnRDb2xvcixcbiAgcGFkZGluZ0xlZnQ6IHRoZW1lLnNwYWNpbmcoXCJ4c1wiKSxcbn0pO1xuXG5leHBvcnQgY29uc3QgU3R5bGVkVHlwb2dyYXBoeSA9IHN0eWxlZChIdlR5cG9ncmFwaHkpKHtcbiAgZGlzcGxheTogXCJmbGV4XCIsXG4gIGFsaWduSXRlbXM6IFwiY2VudGVyXCIsXG4gIGNvbG9yOiB0aGVtZS5jb2xvcnMubmVnYXRpdmUsXG59KTtcbiJdfQ== */");
78
84
  exports.StyledHeaderDayOfWeek = StyledHeaderDayOfWeek;
79
85
  exports.StyledInput = StyledInput;
80
86
  exports.StyledInputBorderContainer = StyledInputBorderContainer;
81
87
  exports.StyledRoot = StyledRoot;
88
+ exports.StyledTypography = StyledTypography;
82
89
  //# sourceMappingURL=CalendarHeader.styles.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarHeader.styles.cjs","sources":["../../../../../src/components/Calendar/CalendarHeader/CalendarHeader.styles.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { HvTypography } from \"@core/components\";\nimport { outlineStyles } from \"@core/utils\";\n\nexport const StyledRoot = styled(\"div\")({\n marginTop: theme.spacing(\"xs\"),\n backgroundColor: theme.colors.atmo1,\n borderBottom: theme.calendar.headerInputBorderBottom,\n borderTop: theme.calendar.headerInputBorderTop,\n borderLeft: theme.calendar.headerInputBorderLeft,\n borderRight: theme.calendar.headerInputBorderRight,\n borderRadius: theme.calendar.borderRadius,\n \"&:hover, &:focus\": {\n borderBottom: `1px solid ${theme.colors.secondary}`,\n },\n});\n\nexport const StyledInputBorderContainer = styled(\"div\")({\n backgroundColor: theme.colors.negative,\n height: 1,\n marginTop: -1,\n});\n\nexport const StyledInput = styled((props) => <input {...props} />)({\n border: \"none\",\n backgroundColor: \"transparent\",\n padding: `5px ${theme.spacing(\"xs\")}`,\n fontFamily: theme.fontFamily.body,\n\n color: theme.calendar.headerInputFontColor,\n fontSize: theme.calendar.headerInputFontSize,\n letterSpacing: theme.calendar.headerInputFontLetterSpacing,\n lineHeight: theme.calendar.headerInputFontLineHeight,\n fontWeight: theme.calendar.headerInputFontWeight,\n width: \"100%\",\n \"&::placeholder\": {\n color: theme.colors.secondary_60,\n },\n \"&::-webkit-inner-spin-button, &::-webkit-calendar-picker-indicator\": {\n \" -webkit-appearance\": \"none\",\n display: \"none\",\n },\n \"&:focus\": {\n outline: \"none\",\n },\n \"&:focus-visible\": {\n ...outlineStyles,\n },\n});\n\nexport const StyledHeaderDayOfWeek = styled(HvTypography)({\n color: theme.calendar.headerInputFontColor,\n paddingLeft: theme.spacing(\"xs\"),\n});\n"],"names":["StyledRoot","_styled","process","env","NODE_ENV","target","label","marginTop","theme","spacing","backgroundColor","colors","atmo1","borderBottom","calendar","headerInputBorderBottom","borderTop","headerInputBorderTop","borderLeft","headerInputBorderLeft","borderRight","headerInputBorderRight","borderRadius","secondary","StyledInputBorderContainer","negative","height","StyledInput","props","_jsx","border","padding","fontFamily","body","color","headerInputFontColor","fontSize","headerInputFontSize","letterSpacing","headerInputFontLetterSpacing","lineHeight","headerInputFontLineHeight","fontWeight","headerInputFontWeight","width","secondary_60","display","outline","outlineStyles","StyledHeaderDayOfWeek","HvTypography","paddingLeft"],"mappings":";;;;;;;;;AAKO,MAAMA,aAAoBC,iCAAA,QAAA,OAAKC,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CAAA,EAAE;AAAA,EACtCC,WAAWC,YAAAA,MAAMC,QAAQ,IAAI;AAAA,EAC7BC,iBAAiBF,YAAAA,MAAMG,OAAOC;AAAAA,EAC9BC,cAAcL,YAAAA,MAAMM,SAASC;AAAAA,EAC7BC,WAAWR,YAAAA,MAAMM,SAASG;AAAAA,EAC1BC,YAAYV,YAAAA,MAAMM,SAASK;AAAAA,EAC3BC,aAAaZ,YAAAA,MAAMM,SAASO;AAAAA,EAC5BC,cAAcd,YAAAA,MAAMM,SAASQ;AAAAA,EAC7B,oBAAoB;AAAA,IAClBT,cAAe,aAAYL,YAAAA,MAAMG,OAAOY;AAAAA,EAC1C;AACF,GAACrB,QAAAC,IAAAC,aAAC,eAAA,KAAA,q3FAAA;AAEK,MAAMoB,6BAAoCvB,iCAAA,QAAA,OAAKC,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CAAA,EAAE;AAAA,EACtDI,iBAAiBF,YAAAA,MAAMG,OAAOc;AAAAA,EAC9BC,QAAQ;AAAA,EACRnB,WAAW;AACb,GAACL,QAAAC,IAAAC,aAAC,eAAA,KAAA,q3FAAA;AAEK,MAAMuB,cAAc1B,iCAAAA,QAAQ2B,CAAUC,UAAAA,2BAAAA,IAAA,SAAA;AAAA,EAAA,GAAWD;AAAK,CAAA,GAAI1B,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CAAA,EAAE;AAAA,EACjEwB,QAAQ;AAAA,EACRpB,iBAAiB;AAAA,EACjBqB,SAAU,OAAMvB,YAAAA,MAAMC,QAAQ,IAAI;AAAA,EAClCuB,YAAYxB,YAAAA,MAAMwB,WAAWC;AAAAA,EAE7BC,OAAO1B,YAAAA,MAAMM,SAASqB;AAAAA,EACtBC,UAAU5B,YAAAA,MAAMM,SAASuB;AAAAA,EACzBC,eAAe9B,YAAAA,MAAMM,SAASyB;AAAAA,EAC9BC,YAAYhC,YAAAA,MAAMM,SAAS2B;AAAAA,EAC3BC,YAAYlC,YAAAA,MAAMM,SAAS6B;AAAAA,EAC3BC,OAAO;AAAA,EACP,kBAAkB;AAAA,IAChBV,OAAO1B,YAAAA,MAAMG,OAAOkC;AAAAA,EACtB;AAAA,EACA,sEAAsE;AAAA,IACpE,uBAAuB;AAAA,IACvBC,SAAS;AAAA,EACX;AAAA,EACA,WAAW;AAAA,IACTC,SAAS;AAAA,EACX;AAAA,EACA,mBAAmB;AAAA,IACjB,GAAGC,WAAAA;AAAAA,EACL;AACF,GAAC9C,QAAAC,IAAAC,aAAC,eAAA,KAAA,q3FAAA;AAEK,MAAM6C,wBAA+BC,iCAAAA,QAAAA,WAAAA,cAAYhD,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CAAA,EAAE;AAAA,EACxD4B,OAAO1B,YAAAA,MAAMM,SAASqB;AAAAA,EACtBgB,aAAa3C,YAAAA,MAAMC,QAAQ,IAAI;AACjC,GAACP,QAAAC,IAAAC,aAAC,eAAA,KAAA,q3FAAA;;;;;"}
1
+ {"version":3,"file":"CalendarHeader.styles.cjs","sources":["../../../../../src/components/Calendar/CalendarHeader/CalendarHeader.styles.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { HvTypography } from \"@core/components\";\nimport { outlineStyles } from \"@core/utils\";\n\nexport const StyledRoot = styled(\"div\")({\n marginTop: theme.spacing(\"xs\"),\n backgroundColor: theme.colors.atmo1,\n borderBottom: theme.calendar.headerInputBorderBottom,\n borderTop: theme.calendar.headerInputBorderTop,\n borderLeft: theme.calendar.headerInputBorderLeft,\n borderRight: theme.calendar.headerInputBorderRight,\n borderRadius: theme.calendar.borderRadius,\n \"&:hover, &:focus\": {\n borderBottom: `1px solid ${theme.colors.secondary}`,\n },\n});\n\nexport const StyledInputBorderContainer = styled(\"div\")({\n backgroundColor: theme.colors.negative,\n height: 1,\n marginTop: -1,\n});\n\nexport const StyledInput = styled((props) => <input {...props} />)({\n border: \"none\",\n backgroundColor: \"transparent\",\n padding: `5px ${theme.spacing(\"xs\")}`,\n fontFamily: theme.fontFamily.body,\n\n color: theme.calendar.headerInputFontColor,\n fontSize: theme.calendar.headerInputFontSize,\n letterSpacing: theme.calendar.headerInputFontLetterSpacing,\n lineHeight: theme.calendar.headerInputFontLineHeight,\n fontWeight: theme.calendar.headerInputFontWeight,\n width: \"100%\",\n \"&::placeholder\": {\n color: theme.colors.secondary_60,\n },\n \"&:focus\": {\n outline: \"none\",\n },\n \"&:focus-visible\": {\n ...outlineStyles,\n },\n});\n\nexport const StyledHeaderDayOfWeek = styled(HvTypography)({\n color: theme.calendar.headerInputFontColor,\n paddingLeft: theme.spacing(\"xs\"),\n});\n\nexport const StyledTypography = styled(HvTypography)({\n display: \"flex\",\n alignItems: \"center\",\n color: theme.colors.negative,\n});\n"],"names":["StyledRoot","_styled","process","env","NODE_ENV","target","label","marginTop","theme","spacing","backgroundColor","colors","atmo1","borderBottom","calendar","headerInputBorderBottom","borderTop","headerInputBorderTop","borderLeft","headerInputBorderLeft","borderRight","headerInputBorderRight","borderRadius","secondary","StyledInputBorderContainer","negative","height","StyledInput","props","_jsx","border","padding","fontFamily","body","color","headerInputFontColor","fontSize","headerInputFontSize","letterSpacing","headerInputFontLetterSpacing","lineHeight","headerInputFontLineHeight","fontWeight","headerInputFontWeight","width","secondary_60","outline","outlineStyles","StyledHeaderDayOfWeek","HvTypography","paddingLeft","StyledTypography","display","alignItems"],"mappings":";;;;;;;;;AAKO,MAAMA,aAAoBC,iCAAA,QAAA,OAAKC,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CAAA,EAAE;AAAA,EACtCC,WAAWC,YAAAA,MAAMC,QAAQ,IAAI;AAAA,EAC7BC,iBAAiBF,YAAAA,MAAMG,OAAOC;AAAAA,EAC9BC,cAAcL,YAAAA,MAAMM,SAASC;AAAAA,EAC7BC,WAAWR,YAAAA,MAAMM,SAASG;AAAAA,EAC1BC,YAAYV,YAAAA,MAAMM,SAASK;AAAAA,EAC3BC,aAAaZ,YAAAA,MAAMM,SAASO;AAAAA,EAC5BC,cAAcd,YAAAA,MAAMM,SAASQ;AAAAA,EAC7B,oBAAoB;AAAA,IAClBT,cAAe,aAAYL,YAAAA,MAAMG,OAAOY;AAAAA,EAC1C;AACF,GAACrB,QAAAC,IAAAC,aAAC,eAAA,KAAA,i3FAAA;AAEK,MAAMoB,6BAAoCvB,iCAAA,QAAA,OAAKC,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CAAA,EAAE;AAAA,EACtDI,iBAAiBF,YAAAA,MAAMG,OAAOc;AAAAA,EAC9BC,QAAQ;AAAA,EACRnB,WAAW;AACb,GAACL,QAAAC,IAAAC,aAAC,eAAA,KAAA,q3FAAA;AAEK,MAAMuB,cAAc1B,iCAAAA,QAAQ2B,CAAUC,UAAAA,2BAAAA,IAAA,SAAA;AAAA,EAAA,GAAWD;AAAK,CAAA,GAAI1B,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA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1B,YAAAA,MAAMG,OAAOc;AACtB,GAACvB,QAAAC,IAAAC,aAAC,eAAA,KAAA,q3FAAA;;;;;;"}
@@ -6,9 +6,6 @@ const utils = require("../utils.cjs");
6
6
  const calendarCellClasses = require("./calendarCellClasses.cjs");
7
7
  const CalendarCell_styles = require("./CalendarCell.styles.cjs");
8
8
  const jsxRuntime = require("@emotion/react/jsx-runtime");
9
- const useComputation = require("../../../hooks/useComputation.cjs");
10
- const Tooltip = require("../../Tooltip/Tooltip.cjs");
11
- const Typography = require("../../Typography/Typography.cjs");
12
9
  const HvCalendarCell = ({
13
10
  classes,
14
11
  onChange,
@@ -25,7 +22,6 @@ const HvCalendarCell = ({
25
22
  ...others
26
23
  }) => {
27
24
  const buttonEl = React.useRef(null);
28
- const [title, computeTitle] = useComputation.default(() => utils.getFormattedDate(value, locale));
29
25
  const startDate = utils.isDateRangeProp(calendarValue) ? calendarValue.startDate : void 0;
30
26
  const endDate = utils.isDateRangeProp(calendarValue) ? calendarValue.endDate : void 0;
31
27
  const isCellToday = utils.isSameDay(value, today);
@@ -66,19 +62,11 @@ const HvCalendarCell = ({
66
62
  children: value && value.getDate()
67
63
  })
68
64
  });
69
- return /* @__PURE__ */ jsxRuntime.jsx(Tooltip.HvTooltip, {
70
- enterDelay: 600,
71
- onOpen: computeTitle,
72
- title: title ? /* @__PURE__ */ jsxRuntime.jsx(Typography.HvTypography, {
73
- noWrap: true,
74
- children: title
75
- }) : "",
76
- children: /* @__PURE__ */ jsxRuntime.jsx(CalendarCell_styles.StyledDateWrapper, {
77
- className: clsx.clsx(calendarCellClasses.default.dateWrapper, classes == null ? void 0 : classes.dateWrapper, inMonth && rangeMode && isSelecting && clsx.clsx(calendarCellClasses.default.cellsInRange, classes == null ? void 0 : classes.cellsInRange), rangeMode && !isSelecting && clsx.clsx(calendarCellClasses.default.cellsOutsideRange, classes == null ? void 0 : classes.cellsOutsideRange)),
78
- "data-calendar-cell": "calendarCell",
79
- children: renderDate()
80
- })
81
- }, utils.getDateISO(value));
65
+ return /* @__PURE__ */ jsxRuntime.jsx(CalendarCell_styles.StyledDateWrapper, {
66
+ className: clsx.clsx(calendarCellClasses.default.dateWrapper, classes == null ? void 0 : classes.dateWrapper, inMonth && rangeMode && isSelecting && clsx.clsx(calendarCellClasses.default.cellsInRange, classes == null ? void 0 : classes.cellsInRange), rangeMode && !isSelecting && clsx.clsx(calendarCellClasses.default.cellsOutsideRange, classes == null ? void 0 : classes.cellsOutsideRange)),
67
+ "data-calendar-cell": "calendarCell",
68
+ children: renderDate()
69
+ });
82
70
  };
83
71
  exports.HvCalendarCell = HvCalendarCell;
84
72
  exports.default = HvCalendarCell;
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarCell.cjs","sources":["../../../../../src/components/Calendar/SingleCalendar/CalendarCell.tsx"],"sourcesContent":["import { SyntheticEvent, useRef } from \"react\";\nimport { clsx } from \"clsx\";\nimport { HvTooltip, HvTypography } from \"@core/components\";\nimport { useComputation } from \"@core/hooks\";\nimport {\n getDateISO,\n getFormattedDate,\n isSameDay,\n isSameMonth,\n dateInProvidedValueRange,\n checkIfDateIsDisabled,\n isDateRangeProp,\n} from \"../utils\";\nimport { DateRangeProp } from \"../Calendar\";\nimport calendarCellClasses, {\n HvCalendarCellClasses,\n} from \"./calendarCellClasses\";\nimport {\n StyledCalendarDate,\n StyledCellContainer,\n StyledDateWrapper,\n} from \"./CalendarCell.styles\";\nimport CalendarModel from \"../model\";\n\nexport const HvCalendarCell = ({\n classes,\n onChange,\n onKeyDown,\n calendarValue,\n firstDayOfCurrentMonth,\n value,\n isDateSelectionMode,\n today,\n locale,\n minimumDate,\n maximumDate,\n rangeMode = false,\n ...others\n}: HvCalendarCellProps) => {\n const buttonEl = useRef<HTMLButtonElement>(null);\n const [title, computeTitle] = useComputation(() =>\n getFormattedDate(value, locale)\n );\n\n const startDate = isDateRangeProp(calendarValue)\n ? calendarValue.startDate\n : undefined;\n const endDate = isDateRangeProp(calendarValue)\n ? calendarValue.endDate\n : undefined;\n const isCellToday = isSameDay(value, today);\n const isCellSelected = isSameDay(calendarValue, value);\n const inMonth = isSameMonth(value, firstDayOfCurrentMonth);\n const isCellAfterStartingDate =\n rangeMode && value && startDate ? value >= startDate : false;\n const isCellStartingDate = rangeMode ? isSameDay(value, startDate) : false;\n const isDateInSelectionRange =\n calendarValue && rangeMode\n ? dateInProvidedValueRange(value, calendarValue)\n : false;\n const isDateDisabled = checkIfDateIsDisabled(value, minimumDate, maximumDate);\n const startBookend = isSameDay(startDate, value);\n const endBookend = isSameDay(endDate, value);\n const isSelecting = isDateSelectionMode && isCellAfterStartingDate;\n\n const handleClick = (event: SyntheticEvent) => {\n if (value) {\n onChange?.(event, value);\n if (buttonEl.current) setTimeout(() => buttonEl?.current?.focus());\n }\n };\n\n const handleKeyDown = (event) => {\n onKeyDown?.(event);\n };\n\n const renderDate = () => (\n <StyledCellContainer\n ref={buttonEl}\n type=\"button\"\n className={clsx(\n calendarCellClasses.cellContainer,\n classes?.cellContainer,\n inMonth &&\n clsx(calendarCellClasses.focusSelection, classes?.focusSelection)\n )}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n disabled={isDateDisabled || !inMonth}\n data-in-month={inMonth}\n {...others}\n >\n <StyledCalendarDate\n variant={isCellToday ? \"label\" : \"body\"}\n className={clsx(\n calendarCellClasses.calendarDate,\n classes?.calendarDate,\n inMonth &&\n isCellSelected &&\n clsx(\n calendarCellClasses.calendarDateSelected,\n classes?.calendarDateSelected\n ),\n !inMonth &&\n clsx(\n calendarCellClasses.calendarDateNotInMonth,\n classes?.calendarDateNotInMonth\n ),\n inMonth &&\n rangeMode &&\n isDateInSelectionRange &&\n clsx(\n calendarCellClasses.calendarDateInSelectionRange,\n classes?.calendarDateInSelectionRange\n ),\n isDateDisabled &&\n clsx(\n calendarCellClasses.calendarDateDisabled,\n classes?.calendarDateDisabled\n ),\n inMonth &&\n ((startBookend && rangeMode) ||\n (isCellStartingDate && isDateSelectionMode)) &&\n clsx(calendarCellClasses.startBookend, classes?.startBookend),\n inMonth &&\n endBookend &&\n rangeMode &&\n clsx(calendarCellClasses.endBookend, classes?.endBookend)\n )}\n >\n {value && value.getDate()}\n </StyledCalendarDate>\n </StyledCellContainer>\n );\n\n return (\n <HvTooltip\n key={getDateISO(value)}\n enterDelay={600}\n onOpen={computeTitle}\n title={title ? <HvTypography noWrap>{title}</HvTypography> : \"\"}\n >\n <StyledDateWrapper\n className={clsx(\n calendarCellClasses.dateWrapper,\n classes?.dateWrapper,\n inMonth &&\n rangeMode &&\n isSelecting &&\n clsx(calendarCellClasses.cellsInRange, classes?.cellsInRange),\n rangeMode &&\n !isSelecting &&\n clsx(\n calendarCellClasses.cellsOutsideRange,\n classes?.cellsOutsideRange\n )\n )}\n data-calendar-cell=\"calendarCell\"\n >\n {renderDate()}\n </StyledDateWrapper>\n </HvTooltip>\n );\n};\n\nexport interface HvCalendarCellProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvCalendarCellClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The text to be shown on the main part of the header.\n */\n calendarValue?: string | Date | DateRangeProp;\n /**\n * The text to be shown on the main part of the header.\n */\n value?: Date;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (event: SyntheticEvent, value: Date | DateRangeProp) => void;\n /**\n * Callback to handle input onFocus.\n */\n onFocus?: React.FocusEventHandler<any>;\n\n calendarModel?: CalendarModel;\n onKeyDown?: (event: KeyboardEvent) => void;\n\n today?: Date;\n minimumDate?: Date;\n maximumDate?: Date;\n firstDayOfCurrentMonth?: Date;\n isDateSelectionMode?: boolean;\n rangeMode?: boolean;\n tabIndex?: number;\n}\n\nexport default HvCalendarCell;\n"],"names":["HvCalendarCell","classes","onChange","onKeyDown","calendarValue","firstDayOfCurrentMonth","value","isDateSelectionMode","today","locale","minimumDate","maximumDate","rangeMode","others","buttonEl","useRef","title","computeTitle","useComputation","getFormattedDate","startDate","isDateRangeProp","undefined","endDate","isCellToday","isSameDay","isCellSelected","inMonth","isSameMonth","isCellAfterStartingDate","isCellStartingDate","isDateInSelectionRange","dateInProvidedValueRange","isDateDisabled","checkIfDateIsDisabled","startBookend","endBookend","isSelecting","handleClick","event","current","setTimeout","focus","handleKeyDown","renderDate","_jsx","StyledCellContainer","ref","type","className","clsx","calendarCellClasses","cellContainer","focusSelection","onClick","disabled","children","StyledCalendarDate","variant","calendarDate","calendarDateSelected","calendarDateNotInMonth","calendarDateInSelectionRange","calendarDateDisabled","getDate","HvTooltip","enterDelay","onOpen","HvTypography","noWrap","StyledDateWrapper","dateWrapper","cellsInRange","cellsOutsideRange","getDateISO"],"mappings":";;;;;;;;;;;AAwBO,MAAMA,iBAAiBA,CAAC;AAAA,EAC7BC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,YAAY;AAAA,EACZ,GAAGC;AACgB,MAAM;AACnBC,QAAAA,WAAWC,aAA0B,IAAI;AACzC,QAAA,CAACC,OAAOC,YAAY,IAAIC,eAAAA,QAAe,MAC3CC,uBAAiBb,OAAOG,MAAM,CAAC;AAGjC,QAAMW,YAAYC,MAAAA,gBAAgBjB,aAAa,IAC3CA,cAAcgB,YACdE;AACJ,QAAMC,UAAUF,MAAAA,gBAAgBjB,aAAa,IACzCA,cAAcmB,UACdD;AACEE,QAAAA,cAAcC,MAAAA,UAAUnB,OAAOE,KAAK;AACpCkB,QAAAA,iBAAiBD,MAAAA,UAAUrB,eAAeE,KAAK;AAC/CqB,QAAAA,UAAUC,MAAAA,YAAYtB,OAAOD,sBAAsB;AACzD,QAAMwB,0BACJjB,aAAaN,SAASc,YAAYd,SAASc,YAAY;AACzD,QAAMU,qBAAqBlB,YAAYa,MAAAA,UAAUnB,OAAOc,SAAS,IAAI;AACrE,QAAMW,yBACJ3B,iBAAiB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AS6D,4BAA4B,GAEzC7B,kBACEiB,KAAAA,KACEC,oBAAoBY,QAAAA,sBACpB9D,mCAAS8D,oBAAoB,GAEjCpC,YACIQ,gBAAgBvB,aACfkB,sBAAsBvB,wBACzB2C,UAAKC,oBAAAA,QAAoBhB,cAAclC,mCAASkC,YAAY,GAC9DR,WACES,cACAxB,aACAsC,KAAAA,KAAKC,oBAAoBf,QAAAA,YAAYnC,mCAASmC,UAAU,CAAC;AAAA,MAC3DoB,UAEDlD,SAASA,MAAM0D,QAAO;AAAA,IAAA,CAAE;AAAA,EAAA,CAG9B;AAED,wCACGC,QAAAA,WAAS;AAAA,IAERC,YAAY;AAAA,IACZC,QAAQlD;AAAAA,IACRD,OAAOA,QAAQ6B,2BAAAA,IAACuB,yBAAY;AAAA,MAACC,QAAM;AAAA,MAAAb,UAAExC;AAAAA,IAAK,CAAA,IAAmB;AAAA,IAAGwC,yCAE/Dc,uCAAiB;AAAA,MAChBrB,WAAWC,UACTC,4BAAoBoB,aACpBtE,mCAASsE,aACT5C,WACEf,aACAyB,eACAa,KAAAA,KAAKC,oBAAAA,QAAoBqB,cAAcvE,mCAASuE,YAAY,GAC9D5D,aACE,CAACyB,eACDa,UACEC,oBAAAA,QAAoBsB,mBACpBxE,mCAASwE,iBAAiB,CAC3B;AAAA,MAEL,sBAAmB;AAAA,MAAcjB,UAEhCZ,WAAU;AAAA,IAAA,CAAE;AAAA,EAAA,GAtBV8B,MAAWpE,WAAAA,KAAK,CAAC;AA0B5B;;;"}
1
+ {"version":3,"file":"CalendarCell.cjs","sources":["../../../../../src/components/Calendar/SingleCalendar/CalendarCell.tsx"],"sourcesContent":["import { SyntheticEvent, useRef } from \"react\";\nimport { clsx } from \"clsx\";\nimport {\n isSameDay,\n isSameMonth,\n dateInProvidedValueRange,\n checkIfDateIsDisabled,\n isDateRangeProp,\n} from \"../utils\";\nimport { DateRangeProp } from \"../Calendar\";\nimport calendarCellClasses, {\n HvCalendarCellClasses,\n} from \"./calendarCellClasses\";\nimport {\n StyledCalendarDate,\n StyledCellContainer,\n StyledDateWrapper,\n} from \"./CalendarCell.styles\";\nimport CalendarModel from \"../model\";\n\nexport const HvCalendarCell = ({\n classes,\n onChange,\n onKeyDown,\n calendarValue,\n firstDayOfCurrentMonth,\n value,\n isDateSelectionMode,\n today,\n locale,\n minimumDate,\n maximumDate,\n rangeMode = false,\n ...others\n}: HvCalendarCellProps) => {\n const buttonEl = useRef<HTMLButtonElement>(null);\n\n const startDate = isDateRangeProp(calendarValue)\n ? calendarValue.startDate\n : undefined;\n const endDate = isDateRangeProp(calendarValue)\n ? calendarValue.endDate\n : undefined;\n const isCellToday = isSameDay(value, today);\n const isCellSelected = isSameDay(calendarValue, value);\n const inMonth = isSameMonth(value, firstDayOfCurrentMonth);\n const isCellAfterStartingDate =\n rangeMode && value && startDate ? value >= startDate : false;\n const isCellStartingDate = rangeMode ? isSameDay(value, startDate) : false;\n const isDateInSelectionRange =\n calendarValue && rangeMode\n ? dateInProvidedValueRange(value, calendarValue)\n : false;\n const isDateDisabled = checkIfDateIsDisabled(value, minimumDate, maximumDate);\n const startBookend = isSameDay(startDate, value);\n const endBookend = isSameDay(endDate, value);\n const isSelecting = isDateSelectionMode && isCellAfterStartingDate;\n\n const handleClick = (event: SyntheticEvent) => {\n if (value) {\n onChange?.(event, value);\n if (buttonEl.current) setTimeout(() => buttonEl?.current?.focus());\n }\n };\n\n const handleKeyDown = (event) => {\n onKeyDown?.(event);\n };\n\n const renderDate = () => (\n <StyledCellContainer\n ref={buttonEl}\n type=\"button\"\n className={clsx(\n calendarCellClasses.cellContainer,\n classes?.cellContainer,\n inMonth &&\n clsx(calendarCellClasses.focusSelection, classes?.focusSelection)\n )}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n disabled={isDateDisabled || !inMonth}\n data-in-month={inMonth}\n {...others}\n >\n <StyledCalendarDate\n variant={isCellToday ? \"label\" : \"body\"}\n className={clsx(\n calendarCellClasses.calendarDate,\n classes?.calendarDate,\n inMonth &&\n isCellSelected &&\n clsx(\n calendarCellClasses.calendarDateSelected,\n classes?.calendarDateSelected\n ),\n !inMonth &&\n clsx(\n calendarCellClasses.calendarDateNotInMonth,\n classes?.calendarDateNotInMonth\n ),\n inMonth &&\n rangeMode &&\n isDateInSelectionRange &&\n clsx(\n calendarCellClasses.calendarDateInSelectionRange,\n classes?.calendarDateInSelectionRange\n ),\n isDateDisabled &&\n clsx(\n calendarCellClasses.calendarDateDisabled,\n classes?.calendarDateDisabled\n ),\n inMonth &&\n ((startBookend && rangeMode) ||\n (isCellStartingDate && isDateSelectionMode)) &&\n clsx(calendarCellClasses.startBookend, classes?.startBookend),\n inMonth &&\n endBookend &&\n rangeMode &&\n clsx(calendarCellClasses.endBookend, classes?.endBookend)\n )}\n >\n {value && value.getDate()}\n </StyledCalendarDate>\n </StyledCellContainer>\n );\n\n return (\n <StyledDateWrapper\n className={clsx(\n calendarCellClasses.dateWrapper,\n classes?.dateWrapper,\n inMonth &&\n rangeMode &&\n isSelecting &&\n clsx(calendarCellClasses.cellsInRange, classes?.cellsInRange),\n rangeMode &&\n !isSelecting &&\n clsx(\n calendarCellClasses.cellsOutsideRange,\n classes?.cellsOutsideRange\n )\n )}\n data-calendar-cell=\"calendarCell\"\n >\n {renderDate()}\n </StyledDateWrapper>\n );\n};\n\nexport interface HvCalendarCellProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvCalendarCellClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The text to be shown on the main part of the header.\n */\n calendarValue?: string | Date | DateRangeProp;\n /**\n * The text to be shown on the main part of the header.\n */\n value?: Date;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (event: SyntheticEvent, value: Date | DateRangeProp) => void;\n /**\n * Callback to handle input onFocus.\n */\n onFocus?: React.FocusEventHandler<any>;\n\n calendarModel?: CalendarModel;\n onKeyDown?: (event: KeyboardEvent) => void;\n\n today?: Date;\n minimumDate?: Date;\n maximumDate?: Date;\n firstDayOfCurrentMonth?: Date;\n isDateSelectionMode?: boolean;\n rangeMode?: boolean;\n tabIndex?: number;\n}\n\nexport default HvCalendarCell;\n"],"names":["HvCalendarCell","classes","onChange","onKeyDown","calendarValue","firstDayOfCurrentMonth","value","isDateSelectionMode","today","locale","minimumDate","maximumDate","rangeMode","others","buttonEl","useRef","startDate","isDateRangeProp","undefined","endDate","isCellToday","isSameDay","isCellSelected","inMonth","isSameMonth","isCellAfterStartingDate","isCellStartingDate","isDateInSelectionRange","dateInProvidedValueRange","isDateDisabled","checkIfDateIsDisabled","startBookend","endBookend","isSelecting","handleClick","event","current","setTimeout","focus","handleKeyDown","renderDate","_jsx","StyledCellContainer","ref","type","className","clsx","calendarCellClasses","cellContainer","focusSelection","onClick","disabled","children","StyledCalendarDate","variant","calendarDate","calendarDateSelected","calendarDateNotInMonth","calendarDateInSelectionRange","calendarDateDisabled","getDate","StyledDateWrapper","dateWrapper","cellsInRange","cellsOutsideRange"],"mappings":";;;;;;;;AAoBO,MAAMA,iBAAiBA,CAAC;AAAA,EAC7BC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,YAAY;AAAA,EACZ,GAAGC;AACgB,MAAM;AACnBC,QAAAA,WAAWC,aAA0B,IAAI;AAE/C,QAAMC,YAAYC,MAAAA,gBAAgBb,aAAa,IAC3CA,cAAcY,YACdE;AACJ,QAAMC,UAAUF,MAAAA,gBAAgBb,aAAa,IACzCA,cAAce,UACdD;AACEE,QAAAA,cAAcC,MAAAA,UAAUf,OAAOE,KAAK;AACpCc,QAAAA,iBAAiBD,MAAAA,UAAUjB,eAAeE,KAAK;AAC/CiB,QAAAA,UAAUC,MAAAA,YAAYlB,OAAOD,sBAAsB;AACzD,QAAMoB,0BACJb,aAAaN,SAASU,YAAYV,SAASU,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U,wBACpBxD,mCAASwD,sBAAsB,GAEnClC,WACEX,aACAe,0BACAmB,UACEC,oBAAAA,QAAoBW,8BACpBzD,mCAASyD,4BAA4B,GAEzC7B,kBACEiB,KAAAA,KACEC,oBAAoBY,QAAAA,sBACpB1D,mCAAS0D,oBAAoB,GAEjCpC,YACIQ,gBAAgBnB,aACfc,sBAAsBnB,wBACzBuC,UAAKC,oBAAAA,QAAoBhB,cAAc9B,mCAAS8B,YAAY,GAC9DR,WACES,cACApB,aACAkC,KAAAA,KAAKC,oBAAoBf,QAAAA,YAAY/B,mCAAS+B,UAAU,CAAC;AAAA,MAC3DoB,UAED9C,SAASA,MAAMsD,QAAO;AAAA,IAAA,CAAE;AAAA,EAAA,CAG9B;AAED,wCACGC,oBAAAA,mBAAiB;AAAA,IAChBhB,WAAWC,UACTC,4BAAoBe,aACpB7D,mCAAS6D,aACTvC,WACEX,aACAqB,eACAa,KAAAA,KAAKC,oBAAAA,QAAoBgB,cAAc9D,mCAAS8D,YAAY,GAC9DnD,aACE,CAACqB,eACDa,UACEC,oBAAAA,QAAoBiB,mBACpB/D,mCAAS+D,iBAAiB,CAC3B;AAAA,IAEL,sBAAmB;AAAA,IAAcZ,UAEhCZ,WAAU;AAAA,EAAA,CACO;AAExB;;;"}
@@ -40,6 +40,7 @@ const HvSingleCalendar = ({
40
40
  onVisibleDateChange,
41
41
  showEndDate,
42
42
  showDayOfWeek,
43
+ invalidDateLabel,
43
44
  children,
44
45
  ...others
45
46
  }) => {
@@ -119,7 +120,8 @@ const HvSingleCalendar = ({
119
120
  locale,
120
121
  onChange: handleInputChange,
121
122
  showEndDate: showEndDate && !isDateSelectionMode,
122
- showDayOfWeek
123
+ showDayOfWeek,
124
+ invalidDateLabel
123
125
  }), calViewMode === "calendar" && /* @__PURE__ */ jsxRuntime.jsxs("div", {
124
126
  children: [/* @__PURE__ */ jsxRuntime.jsx(ComposedNavigation.HvComposedNavigation, {
125
127
  id,
@@ -1 +1 @@
1
- {"version":3,"file":"SingleCalendar.cjs","sources":["../../../../../src/components/Calendar/SingleCalendar/SingleCalendar.tsx"],"sourcesContent":["import { useState, useMemo } from \"react\";\nimport { clsx } from \"clsx\";\nimport isNil from \"lodash/isNil\";\nimport { setId, keyboardCodes, isKeypress } from \"@core/utils\";\nimport { ViewMode } from \"../enums\";\nimport { isRange, isDate, getWeekdayNamesList } from \"../utils\";\nimport { generateCalendarModel } from \"../model\";\nimport { HvComposedNavigation, HvMonthSelector } from \"../CalendarNavigation\";\nimport { DateRangeProp, VisibilitySelectorActions } from \"..\";\nimport {\n StyledCalendarContainer,\n StyledCalendarGrid,\n StyledCalendarWrapper,\n} from \"./SingleCalendar.styles\";\nimport singleCalendarClasses, {\n HvSingleCalendarClasses,\n} from \"./singleCalendarClasses\";\nimport { HvCalendarCell } from \"./CalendarCell\";\nimport { HvCalendarWeekLabel } from \"../CalendarWeekLabels\";\nimport { HvCalendarHeader } from \"../CalendarHeader/CalendarHeader\";\n\nconst { Enter, ArrowLeft, ArrowRight, ArrowUp, ArrowDown } = keyboardCodes;\n\nexport const HvSingleCalendar = ({\n classes,\n className,\n id,\n locale = \"en-US\",\n value,\n visibleMonth,\n visibleYear,\n minimumDate,\n maximumDate,\n onChange,\n onInputChange,\n onVisibleDateChange,\n showEndDate,\n showDayOfWeek,\n children,\n ...others\n}: HvSingleCalendarProps) => {\n // TODO: refactor this out\n // const { HvCalendarHeader } = useContext(HvFormElementDescriptorsContext);\n\n const today = new Date();\n const localValue = isNil(value) ? today : value;\n\n const [calViewMode, setCalViewMode] = useState<ViewMode>(\"calendar\");\n\n const rangeMode = isRange(localValue);\n const isDateSelectionMode = rangeMode && !isDate(localValue.endDate);\n const calModel = rangeMode\n ? generateCalendarModel(localValue.startDate, visibleMonth, visibleYear)\n : generateCalendarModel(localValue, visibleMonth, visibleYear);\n const firstDayOfCurrentMonth = new Date(calModel.year, calModel.month - 1, 1);\n const firstDayOfCurrentMonthTime = firstDayOfCurrentMonth.getTime();\n\n const listWeekdayNames = useMemo(\n () => getWeekdayNamesList(locale, \"narrow\"),\n [locale]\n );\n\n const handleChange = (event, date: Date | DateRangeProp) => {\n event?.preventDefault();\n onChange?.(event, date);\n };\n\n const handleInputChange = (event, date) => {\n event?.preventDefault();\n onInputChange?.(event, date);\n };\n\n const getNavChild = (event: KeyboardEvent, siblings, i: number) => {\n if (isKeypress(event, ArrowLeft)) return siblings[i - 1];\n if (isKeypress(event, ArrowRight)) return siblings[i + 1];\n if (isKeypress(event, ArrowUp)) return siblings[i - 7];\n if (isKeypress(event, ArrowDown)) return siblings[i + 7];\n return undefined;\n };\n\n const handleKeyDown = (event) => {\n // This code is very brittle and should be managed with the focus wrapper\n const el = document?.activeElement;\n const parent = el?.parentElement?.parentElement;\n const siblings =\n parent != null\n ? [\n ...parent.getElementsByClassName(\n singleCalendarClasses.cellContainer as string\n ),\n ]\n : [];\n const elIndex = el ? siblings.indexOf(el) : 0;\n\n if (isKeypress(event, Enter)) {\n (el as HTMLElement).focus();\n return;\n }\n\n const child = getNavChild(event, siblings, elIndex);\n\n if (child) {\n const inMonth = child.getAttribute(\"data-in-month\");\n if (inMonth === \"true\") {\n event?.preventDefault();\n child?.focus();\n }\n }\n };\n\n /**\n * Renders the element representing the received date.\n *\n * @param currentDate - The array representing the date [YYYY, MM, DD].\n * @memberOf Calendar\n */\n const renderCalendarDate = (currentDate) => {\n return (\n <HvCalendarCell\n classes={classes}\n key={currentDate}\n tabIndex={currentDate.getTime() === firstDayOfCurrentMonthTime ? 0 : -1}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n value={currentDate}\n today={today}\n calendarValue={localValue}\n rangeMode={rangeMode}\n isDateSelectionMode={isDateSelectionMode}\n locale={locale}\n firstDayOfCurrentMonth={firstDayOfCurrentMonth}\n maximumDate={maximumDate}\n minimumDate={minimumDate}\n />\n );\n };\n\n return (\n <StyledCalendarContainer\n className={clsx(\n className,\n singleCalendarClasses.calendarContainer,\n classes?.calendarContainer\n )}\n {...others}\n >\n <StyledCalendarWrapper\n id={id}\n className={clsx(\n singleCalendarClasses.calendarWrapper,\n classes?.calendarWrapper\n )}\n >\n <HvCalendarHeader\n id={setId(id, \"header\")}\n locale={locale}\n onChange={handleInputChange}\n showEndDate={showEndDate && !isDateSelectionMode}\n showDayOfWeek={showDayOfWeek}\n />\n {calViewMode === \"calendar\" && (\n <div>\n <HvComposedNavigation\n id={id}\n locale={locale}\n onChange={onVisibleDateChange}\n onViewModeChange={setCalViewMode}\n visibleYear={visibleYear || today.getFullYear()}\n visibleMonth={visibleMonth || today.getMonth() + 1}\n />\n <StyledCalendarGrid\n className={clsx(\n singleCalendarClasses.calendarGrid,\n classes?.calendarGrid\n )}\n aria-controls={HvCalendarHeader?.[0]?.id}\n >\n <HvCalendarWeekLabel labels={listWeekdayNames} />\n {calModel.dates.map(renderCalendarDate)}\n </StyledCalendarGrid>\n </div>\n )}\n {calViewMode === \"monthly\" && (\n <HvMonthSelector\n id={id}\n locale={locale}\n onChange={onVisibleDateChange}\n onViewModeChange={setCalViewMode}\n visibleMonth={visibleMonth || today.getMonth() + 1}\n rangeMode={rangeMode}\n />\n )}\n </StyledCalendarWrapper>\n </StyledCalendarContainer>\n );\n};\n\nexport interface HvSingleCalendarProps {\n /**\n * Styles applied from the theme.\n */\n classes?: HvSingleCalendarClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The class name to add at the root of the single calendar\n */\n className?: string;\n /**\n * The calendar locale.\n *\n */\n locale: string;\n /**\n * Date that the calendar would show.\n */\n value?: string | Date | DateRangeProp;\n /**\n * Date that will be used to know which month and year should be displayed on the calendar. The value of the day is\n * irrelevant.\n */\n visibleDate?: Date;\n /**\n * Controls the visible month of the Calendar\n */\n visibleMonth?: number;\n /**\n * Controls the visible month of the Calendar\n */\n visibleYear?: number;\n /**\n * Callback function to be triggered when the selected date has changed.\n */\n onChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n value: Date | DateRangeProp\n ) => void;\n /**\n * Callback function to be triggered when the selected date input has changed.\n */\n onInputChange?: (\n event:\n | React.ChangeEvent<\n HTMLTextAreaElement | HTMLInputElement | HTMLButtonElement\n >\n | undefined,\n value: Date | DateRangeProp,\n position?: \"left\" | \"right\"\n ) => void;\n /**\n * Callback function to be triggered when visible date has changed.\n */\n onVisibleDateChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n action: VisibilitySelectorActions,\n value?: Date | DateRangeProp | number\n ) => void;\n /**\n * The maximum selectable date after this all values are disabled.\n */\n maximumDate?: Date;\n /**\n * The minimum selectable date before this all values are disabled.\n */\n minimumDate?: Date;\n /**\n * Indicates if header should display end date in a date range.\n */\n showEndDate?: boolean;\n /**\n * Indicates if header should display the day of week.\n */\n showDayOfWeek?: boolean;\n /**\n * Content on the upper part of the calendar.\n */\n children?: React.ReactNode;\n}\n"],"names":["Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","keyboardCodes","HvSingleCalendar","classes","className","id","locale","value","visibleMonth","visibleYear","minimumDate","maximumDate","onChange","onInputChange","onVisibleDateChange","showEndDate","showDayOfWeek","children","others","today","Date","localValue","isNil","calViewMode","setCalViewMode","useState","rangeMode","isRange","isDateSelectionMode","isDate","endDate","calModel","generateCalendarModel","startDate","firstDayOfCurrentMonth","year","month","firstDayOfCurrentMonthTime","getTime","listWeekdayNames","useMemo","getWeekdayNamesList","handleChange","event","date","preventDefault","handleInputChange","getNavChild","siblings","i","isKeypress","undefined","handleKeyDown","el","document","activeElement","parent","parentElement","getElementsByClassName","singleCalendarClasses","cellContainer","elIndex","indexOf","focus","child","inMonth","getAttribute","renderCalendarDate","currentDate","HvCalendarCell","tabIndex","onKeyDown","calendarValue","StyledCalendarContainer","clsx","calendarContainer","StyledCalendarWrapper","calendarWrapper","_jsx","HvCalendarHeader","setId","HvComposedNavigation","onViewModeChange","getFullYear","getMonth","_jsxs","StyledCalendarGrid","calendarGrid","HvCalendarWeekLabel","labels","dates","map","HvM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AMiE,SAAa,IAAA;AAAA,QACjD1D;AAAAA,MAAAA,CAEH,CAAA;AAAA,IAAA,CAAA;AAAA,EAAA,CAEqB;AAE9B;;"}
1
+ {"version":3,"file":"SingleCalendar.cjs","sources":["../../../../../src/components/Calendar/SingleCalendar/SingleCalendar.tsx"],"sourcesContent":["import { useState, useMemo } from \"react\";\nimport { clsx } from \"clsx\";\nimport isNil from \"lodash/isNil\";\nimport { setId, keyboardCodes, isKeypress } from \"@core/utils\";\nimport { ViewMode } from \"../enums\";\nimport { isRange, isDate, getWeekdayNamesList } from \"../utils\";\nimport { generateCalendarModel } from \"../model\";\nimport { HvComposedNavigation, HvMonthSelector } from \"../CalendarNavigation\";\nimport { DateRangeProp, VisibilitySelectorActions } from \"..\";\nimport {\n StyledCalendarContainer,\n StyledCalendarGrid,\n StyledCalendarWrapper,\n} from \"./SingleCalendar.styles\";\nimport singleCalendarClasses, {\n HvSingleCalendarClasses,\n} from \"./singleCalendarClasses\";\nimport { HvCalendarCell } from \"./CalendarCell\";\nimport { HvCalendarWeekLabel } from \"../CalendarWeekLabels\";\nimport { HvCalendarHeader } from \"../CalendarHeader/CalendarHeader\";\n\nconst { Enter, ArrowLeft, ArrowRight, ArrowUp, ArrowDown } = keyboardCodes;\n\nexport const HvSingleCalendar = ({\n classes,\n className,\n id,\n locale = \"en-US\",\n value,\n visibleMonth,\n visibleYear,\n minimumDate,\n maximumDate,\n onChange,\n onInputChange,\n onVisibleDateChange,\n showEndDate,\n showDayOfWeek,\n invalidDateLabel,\n children,\n ...others\n}: HvSingleCalendarProps) => {\n // TODO: refactor this out\n // const { HvCalendarHeader } = useContext(HvFormElementDescriptorsContext);\n\n const today = new Date();\n const localValue = isNil(value) ? today : value;\n\n const [calViewMode, setCalViewMode] = useState<ViewMode>(\"calendar\");\n\n const rangeMode = isRange(localValue);\n const isDateSelectionMode = rangeMode && !isDate(localValue.endDate);\n const calModel = rangeMode\n ? generateCalendarModel(localValue.startDate, visibleMonth, visibleYear)\n : generateCalendarModel(localValue, visibleMonth, visibleYear);\n const firstDayOfCurrentMonth = new Date(calModel.year, calModel.month - 1, 1);\n const firstDayOfCurrentMonthTime = firstDayOfCurrentMonth.getTime();\n\n const listWeekdayNames = useMemo(\n () => getWeekdayNamesList(locale, \"narrow\"),\n [locale]\n );\n\n const handleChange = (event, date: Date | DateRangeProp) => {\n event?.preventDefault();\n onChange?.(event, date);\n };\n\n const handleInputChange = (event, date) => {\n event?.preventDefault();\n onInputChange?.(event, date);\n };\n\n const getNavChild = (event: KeyboardEvent, siblings, i: number) => {\n if (isKeypress(event, ArrowLeft)) return siblings[i - 1];\n if (isKeypress(event, ArrowRight)) return siblings[i + 1];\n if (isKeypress(event, ArrowUp)) return siblings[i - 7];\n if (isKeypress(event, ArrowDown)) return siblings[i + 7];\n return undefined;\n };\n\n const handleKeyDown = (event) => {\n // This code is very brittle and should be managed with the focus wrapper\n const el = document?.activeElement;\n const parent = el?.parentElement?.parentElement;\n const siblings =\n parent != null\n ? [\n ...parent.getElementsByClassName(\n singleCalendarClasses.cellContainer as string\n ),\n ]\n : [];\n const elIndex = el ? siblings.indexOf(el) : 0;\n\n if (isKeypress(event, Enter)) {\n (el as HTMLElement).focus();\n return;\n }\n\n const child = getNavChild(event, siblings, elIndex);\n\n if (child) {\n const inMonth = child.getAttribute(\"data-in-month\");\n if (inMonth === \"true\") {\n event?.preventDefault();\n child?.focus();\n }\n }\n };\n\n /**\n * Renders the element representing the received date.\n *\n * @param currentDate - The array representing the date [YYYY, MM, DD].\n * @memberOf Calendar\n */\n const renderCalendarDate = (currentDate) => {\n return (\n <HvCalendarCell\n classes={classes}\n key={currentDate}\n tabIndex={currentDate.getTime() === firstDayOfCurrentMonthTime ? 0 : -1}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n value={currentDate}\n today={today}\n calendarValue={localValue}\n rangeMode={rangeMode}\n isDateSelectionMode={isDateSelectionMode}\n locale={locale}\n firstDayOfCurrentMonth={firstDayOfCurrentMonth}\n maximumDate={maximumDate}\n minimumDate={minimumDate}\n />\n );\n };\n\n return (\n <StyledCalendarContainer\n className={clsx(\n className,\n singleCalendarClasses.calendarContainer,\n classes?.calendarContainer\n )}\n {...others}\n >\n <StyledCalendarWrapper\n id={id}\n className={clsx(\n singleCalendarClasses.calendarWrapper,\n classes?.calendarWrapper\n )}\n >\n <HvCalendarHeader\n id={setId(id, \"header\")}\n locale={locale}\n onChange={handleInputChange}\n showEndDate={showEndDate && !isDateSelectionMode}\n showDayOfWeek={showDayOfWeek}\n invalidDateLabel={invalidDateLabel}\n />\n {calViewMode === \"calendar\" && (\n <div>\n <HvComposedNavigation\n id={id}\n locale={locale}\n onChange={onVisibleDateChange}\n onViewModeChange={setCalViewMode}\n visibleYear={visibleYear || today.getFullYear()}\n visibleMonth={visibleMonth || today.getMonth() + 1}\n />\n <StyledCalendarGrid\n className={clsx(\n singleCalendarClasses.calendarGrid,\n classes?.calendarGrid\n )}\n aria-controls={HvCalendarHeader?.[0]?.id}\n >\n <HvCalendarWeekLabel labels={listWeekdayNames} />\n {calModel.dates.map(renderCalendarDate)}\n </StyledCalendarGrid>\n </div>\n )}\n {calViewMode === \"monthly\" && (\n <HvMonthSelector\n id={id}\n locale={locale}\n onChange={onVisibleDateChange}\n onViewModeChange={setCalViewMode}\n visibleMonth={visibleMonth || today.getMonth() + 1}\n rangeMode={rangeMode}\n />\n )}\n </StyledCalendarWrapper>\n </StyledCalendarContainer>\n );\n};\n\nexport interface HvSingleCalendarProps {\n /**\n * Styles applied from the theme.\n */\n classes?: HvSingleCalendarClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The class name to add at the root of the single calendar\n */\n className?: string;\n /**\n * The calendar locale.\n *\n */\n locale: string;\n /**\n * Date that the calendar would show.\n */\n value?: string | Date | DateRangeProp;\n /**\n * Date that will be used to know which month and year should be displayed on the calendar. The value of the day is\n * irrelevant.\n */\n visibleDate?: Date;\n /**\n * Controls the visible month of the Calendar\n */\n visibleMonth?: number;\n /**\n * Controls the visible month of the Calendar\n */\n visibleYear?: number;\n /**\n * Callback function to be triggered when the selected date has changed.\n */\n onChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n value: Date | DateRangeProp\n ) => void;\n /**\n * Callback function to be triggered when the selected date input has changed.\n */\n onInputChange?: (\n event:\n | React.ChangeEvent<\n HTMLTextAreaElement | HTMLInputElement | HTMLButtonElement\n >\n | undefined,\n value: Date | DateRangeProp,\n position?: \"left\" | \"right\"\n ) => void;\n /**\n * Callback function to be triggered when visible date has changed.\n */\n onVisibleDateChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n action: VisibilitySelectorActions,\n value?: Date | DateRangeProp | number\n ) => void;\n /**\n * The maximum selectable date after this all values are disabled.\n */\n maximumDate?: Date;\n /**\n * The minimum selectable date before this all values are disabled.\n */\n minimumDate?: Date;\n /**\n * Indicates if header should display end date in a date range.\n */\n showEndDate?: boolean;\n /**\n * Indicates if header should display the day of week.\n */\n showDayOfWeek?: boolean;\n /**\n * Content on the upper part of the calendar.\n */\n children?: React.ReactNode;\n /**\n * Label shown when date is invalid.\n */\n invalidDateLabel?: string;\n}\n"],"names":["Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","keyboardCodes","HvSingleCalendar","classes","className","id","locale","value","visibleMonth","visibleYear","minimumDate","maximumDate","onChange","onInputChange","onVisibleDateChange","showEndDate","showDayOfWeek","invalidDateLabel","children","others","today","Date","localValue","isNil","calViewMode","setCalViewMode","useState","rangeMode","isRange","isDateSelectionMode","isDate","endDate","calModel","generateCalendarModel","startDate","firstDayOfCurrentMonth","year","month","firstDayOfCurrentMonthTime","getTime","listWeekdayNames","useMemo","getWeekdayNamesList","handleChange","event","date","preventDefault","handleInputChange","getNavChild","siblings","i","isKeypress","undefined","handleKeyDown","el","document","activeElement","parent","parentElement","getElementsByClassName","singleCalendarClasses","cellContainer","elIndex","indexOf","focus","child","inMonth","getAttribute","renderCalendarDate","currentDate","HvCalendarCell","tabIndex","onKeyDown","calendarValue","StyledCalendarContainer","clsx","calendarContainer","StyledCalendarWrapper","calendarWrapper","_jsx","HvCalendarHeader","setId","HvComposedNavigation","onViewModeChange","getFullYear","getMonth","_jsxs","StyledCalendarGrid","calendarGrid","HvCalendarWeekLabel","labels","dates","map","HvMonthSelector"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,MAAM;AAAA,EAAEA;AAAAA,EAAOC;AAAAA,EAAWC;AAAAA,EAAYC;AAAAA,EAASC;AAAU,IAAIC;AAEtD,MAAMC,mBAAmBA,CAAC;AAAA,EAC/BC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,SAAS;AAAA,EACTC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACA,GAAGC;AACkB,MAAM;;AAIrBC,QAAAA,4BAAYC;AAClB,QAAMC,aAAaC,eAAAA,QAAMhB,KAAK,IAAIa,QAAQb;AAE1C,QAAM,CAACiB,aAAaC,cAAc,IAAIC,eAAmB,UAAU;AAE7DC,QAAAA,YAAYC,cAAQN,UAAU;AACpC,QAAMO,sBAAsBF,aAAa,CAACG,MAAAA,OAAOR,WAAWS,OAAO;AAC7DC,QAAAA,WAAWL,YACbM,4BAAsBX,WAAWY,WAAW1B,cAAcC,WAAW,IACrEwB,MAAAA,sBAAsBX,YAAYd,cAAcC,WAAW;AACzD0B,QAAAA,yBAAyB,IAAId,KAAKW,SAASI,MAAMJ,SAASK,QAAQ,GAAG,CAAC;AACtEC,QAAAA,6BAA6BH,uBAAuBI;AAEpDC,QAAAA,mBAAmBC,cACvB,MAAMC,MAAAA,oBAAoBpC,QAAQ,QAAQ,GAC1C,CAACA,MAAM,CAAC;AAGJqC,QAAAA,eAAeA,CAACC,OAAOC,SAA+B;AAC1D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,CAAA,GAChDR,SAAS2D,MAAMC,IAAIxB,kBAAkB,CAAC;AAAA,QAAA,CACpB,CAAA;AAAA,MAAA,CAAA,GAGxB5C,gBAAgB,4CACdqE,cAAAA,iBAAe;AAAA,QACdxF;AAAAA,QACAC;AAAAA,QACAM,UAAUE;AAAAA,QACVqE,kBAAkB1D;AAAAA,QAClBjB,cAAcA,gBAAgBY,MAAMiE,SAAa,IAAA;AAAA,QACjD1D;AAAAA,MAAAA,CAEH,CAAA;AAAA,IAAA,CAAA;AAAA,EAAA,CAEqB;AAE9B;;"}
@@ -8,7 +8,6 @@ const dayjs__default = /* @__PURE__ */ _interopDefault(dayjs);
8
8
  const isNil__default = /* @__PURE__ */ _interopDefault(isNil);
9
9
  const capitalize__default = /* @__PURE__ */ _interopDefault(capitalize);
10
10
  const CALENDAR_WEEKS = 6;
11
- const zeroPad = (value, length) => `${value}`.padStart(length, "0");
12
11
  const getMonthDays = (month, year) => new Date(year, month, 0).getDate();
13
12
  const getMonthFirstWeekday = (month, year) => new Date(year, month - 1, 1).getDay();
14
13
  const makeUTCDate = (year, monthIndex, day, hour = 1) => new Date(Date.UTC(year, monthIndex, day, hour));
@@ -24,11 +23,6 @@ const isSameDay = (date1, date2) => {
24
23
  return false;
25
24
  return date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear();
26
25
  };
27
- const getDateISO = (date) => {
28
- if (!isDate(date))
29
- return null;
30
- return [date.getFullYear(), zeroPad(date.getMonth() + 1, 2), zeroPad(date.getDate(), 2)].join("-");
31
- };
32
26
  const getPreviousMonth = (month, year) => {
33
27
  const prevMonth = month > 1 ? month - 1 : 12;
34
28
  const prevMonthYear = month > 1 ? year : year - 1;
@@ -126,7 +120,6 @@ exports.checkIfDateIsDisabled = checkIfDateIsDisabled;
126
120
  exports.createDatesArray = createDatesArray;
127
121
  exports.dateInProvidedValueRange = dateInProvidedValueRange;
128
122
  exports.formatToLocale = formatToLocale;
129
- exports.getDateISO = getDateISO;
130
123
  exports.getFormattedDate = getFormattedDate;
131
124
  exports.getMonthDays = getMonthDays;
132
125
  exports.getMonthFirstWeekday = getMonthFirstWeekday;
@@ -141,5 +134,4 @@ exports.isRange = isRange;
141
134
  exports.isSameDay = isSameDay;
142
135
  exports.isSameMonth = isSameMonth;
143
136
  exports.makeUTCDate = makeUTCDate;
144
- exports.zeroPad = zeroPad;
145
137
  //# sourceMappingURL=utils.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","sources":["../../../../src/components/Calendar/utils.tsx"],"sourcesContent":["import dayjs from \"dayjs\";\nimport isNil from \"lodash/isNil\";\nimport capitalize from \"lodash/capitalize\";\nimport { DateRangeProp } from \".\";\n\n/**\n * Constant with the number of weeks to be displayed on the calendar.\n */\nexport const CALENDAR_WEEKS = 6;\n\n/**\n * Constant with the default locale that should be used as the default.\n */\nexport const DEFAULT_LOCALE = \"en\";\n\n/**\n * Pads a string value with leading zeroes(0) until length is reached.\n *\n * @param value - Value to be padded.\n * @param length - Length of the value after the padding is added.\n * @returns The value as a string with the received amount of padding.\n *\n * @example zeroPad(5, 2) => \"05\"\n */\nexport const zeroPad = (value: number, length: number) =>\n `${value}`.padStart(length, \"0\");\n\n/**\n * Returns the number of days in the month given a month and year.\n *\n * @param month - Number of the month (1 to 12).\n * @param year - Number of the year.\n * @returns The number of days in a month for the received year.\n */\nexport const getMonthDays = (month: number, year: number) =>\n new Date(year, month, 0).getDate();\n\n/**\n * Gets the week day of the first day of a given month and year.\n * From 0 (Sunday) to 6 (Saturday).\n *\n * @param month - Number of the month (1 to 12).\n * @param year - Number of the year.\n * @returns The zero indexed week day where 0 is Sunday (0 to 6).\n */\nexport const getMonthFirstWeekday = (month: number, year: number) =>\n new Date(year, month - 1, 1).getDay();\n\n/**\n * Creates a `Date` instance in UTC timezone.\n *\n * @param year - The year of the date.\n * @param monthIndex - The zero indexed month of the year (0 to 11).\n * @param day - The day of the month.\n * @param [hour=1] - The hour of the day.\n * @returns A `Date` instance in UTC timezone.\n */\nexport const makeUTCDate = (\n year: number,\n monthIndex: number,\n day: number,\n hour = 1\n) => new Date(Date.UTC(year, monthIndex, day, hour));\n\n/**\n * Checks if the received date is a valid date.\n *\n * @param date - The date to be validated.\n * @returns A flag stating if the date is valid or not.\n */\nexport const isDate = (date: any): date is Date =>\n Object.prototype.toString.call(date) === \"[object Date]\" &&\n !Number.isNaN(date.valueOf());\n\nexport const isDateRangeProp = (date: any): date is DateRangeProp =>\n \"startDate\" in date;\n\n/**\n * Checks if two dates are in the same month and year.\n *\n * @param date1 - First date.\n * @param date2 - Second date.\n * @returns A flag stating if the dates are in the same month and year or not.\n */\nexport const isSameMonth = (date1: any, date2: any) => {\n if (!(isDate(date1) && isDate(date2))) return false;\n\n return (\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear()\n );\n};\n\n/**\n * Checks if two dates are on the same day.\n *\n * @param date1 - First date.\n * @param date2 - Second date.\n * @returns A flag stating if the dates are in the same day or not.\n */\nexport const isSameDay = (date1: any, date2: any) => {\n if (!(isDate(date1) && isDate(date2))) return false;\n\n return (\n date1.getDate() === date2.getDate() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear()\n );\n};\n\n/**\n * Formats the received date using the ISO format (YYYY-MM-DD).\n *\n * @param date - The date to be formatted.\n * @returns The formatted date in ISO format.\n */\nexport const getDateISO = (date?: Date) => {\n if (!isDate(date)) return null;\n\n return [\n date.getFullYear(),\n zeroPad(date.getMonth() + 1, 2),\n zeroPad(date.getDate(), 2),\n ].join(\"-\");\n};\n\n/**\n * Returns an object with the previous month taking also into consideration the year.\n * For example the previous month of January 2000 will be December 1999.\n *\n * @param month - Number of the month.\n * @param year - Number of the year.\n * @returns Object with new month and year defined.\n */\nexport const getPreviousMonth = (month: number, year: number) => {\n const prevMonth = month > 1 ? month - 1 : 12;\n const prevMonthYear = month > 1 ? year : year - 1;\n\n return { month: prevMonth, year: prevMonthYear };\n};\n\n/**\n * Returns an object with the next month taking also into consideration the year.\n * For example the next month of December 2000 will be January 2001.\n *\n * @param month - Number of the month.\n * @param year - Number of the year.\n * @returns Object with new month and year defined.\n */\nexport const getNextMonth = (month: number, year: number) => {\n const nextMonth = month < 12 ? month + 1 : 1;\n const nextMonthYear = month < 12 ? year : year + 1;\n\n return { month: nextMonth, year: nextMonthYear };\n};\n\n/**\n * Returns a list with the names of all the months localized in the received locale and representation value.\n *\n * @param locale - The locale to be applied to the Intl format.\n * @param representationValue - The representation value for the month.\n * @returns An array with all the months names.\n */\nexport const getMonthNamesList = (\n locale: string | undefined,\n representationValue: Intl.DateTimeFormatOptions[\"month\"] = \"long\"\n) => {\n const options = { month: representationValue, timeZone: \"UTC\" };\n\n return [...new Array(12)].map((n, index) => {\n const auxDate = makeUTCDate(1970, index, 1);\n return capitalize(Intl.DateTimeFormat(locale, options).format(auxDate));\n });\n};\n\n/**\n * Returns a list with the names of all the weekdays localized in the received locale and representation value.\n *\n * @param locale - The locale to be applied.\n * @param dateTimeFormatValue - The representation value for the weekday.\n * @returns An array with all the weekday names.\n */\nexport const getWeekdayNamesList = (\n locale: string,\n dateTimeFormatValue: Intl.DateTimeFormatOptions[\"weekday\"] = \"long\"\n) => {\n const options = { weekday: dateTimeFormatValue, timeZone: \"UTC\" };\n const weekdayNames: string[] = [];\n\n for (let day = 4; day <= 10; day += 1) {\n const auxDate = makeUTCDate(1970, 0, day);\n weekdayNames.push(Intl.DateTimeFormat(locale, options).format(auxDate));\n }\n return weekdayNames;\n};\n\n/**\n * Returns the name of the month for the supplied month localized in the received locale and representation value.\n *\n * @param date - The date from which the month name is extracted.\n * @param locale - The locale to be applied to the Intl format.\n * @param representationValue - The locale to be applied to the Intl format.\n * @returns The name of the month.\n */\nexport const getMonthName = (\n date: Date,\n locale: string,\n representationValue: Intl.DateTimeFormatOptions[\"month\"] = \"long\"\n) =>\n new Intl.DateTimeFormat(locale, { month: representationValue }).format(date);\n\n/**\n * Formats the received date according to Design System specifications.\n * Currently: day month, year => `14 Aug, 2019`.\n *\n * @param date - UTC date to be formatted.\n * @param locale - The locale to be applied to the Intl format.\n * @returns The formatted date as a string.\n */\nexport const getFormattedDate = (\n // TODO: fix this\n date: any,\n locale: any,\n rep: Intl.DateTimeFormatOptions[\"month\"] = \"short\"\n) =>\n `${date.getDate()} ${getMonthName(date, locale, rep)} ${date.getFullYear()}`;\n\n/**\n * Creates an array of 42 days. The complete current month and enough days from the previous and next months to fill\n * the 42 positions.\n *\n * @param month - The number of the month (1 to 12).\n * @param year - The number of the year.\n * @returns The array of dates.\n */\nexport const createDatesArray = (month: number, year: number) => {\n // Initializes the variables needed to calculate the dates for the received month and year\n const monthDays = getMonthDays(month, year);\n const daysFromPrevMonth = getMonthFirstWeekday(month, year);\n const daysFromNextMonth =\n CALENDAR_WEEKS * 7 - (daysFromPrevMonth + monthDays);\n const prevMonthYear = getPreviousMonth(month, year);\n const nextMonthYear = getNextMonth(month, year);\n const prevMonthDays = getMonthDays(prevMonthYear.month, prevMonthYear.year);\n\n // Creates the arrays for the dates for previous, current and next months\n const prevMonthDates = [...new Array(daysFromPrevMonth)].map((n, index) => {\n const day = index + 1 + (prevMonthDays - daysFromPrevMonth);\n return new Date(prevMonthYear.year, prevMonthYear.month - 1, day);\n });\n const currentMonthDates = [...new Array(monthDays)].map((n, index) => {\n const day = index + 1;\n return new Date(year, month - 1, day);\n });\n const nextMonthDates = [...new Array(daysFromNextMonth)].map((n, index) => {\n const day = index + 1;\n return new Date(nextMonthYear.year, nextMonthYear.month - 1, day);\n });\n\n return [...prevMonthDates, ...currentMonthDates, ...nextMonthDates];\n};\n\n/**\n * Checks if the received locale is valid according to Intl.\n *\n * @param locale - The locale to be checked\n * @returns True if the locale is valid, false otherwise.\n */\nexport const isValidLocale = (locale: string) => {\n try {\n if (Intl.DateTimeFormat.supportedLocalesOf(locale).length > 0) {\n return true;\n }\n // eslint-disable-next-line no-console\n console.warn(`${locale} is not supported. Falling back to a known locale.`);\n return false;\n } catch (error) {\n if (\n error != null &&\n typeof error === \"object\" &&\n \"name\" in error &&\n error?.name === \"RangeError\"\n ) {\n // eslint-disable-next-line no-console\n console.error(`Invalid locale: ${locale}`);\n return false;\n }\n if (error != null && typeof error === \"object\" && \"message\" in error) {\n // eslint-disable-next-line no-console\n console.error(error?.message);\n return false;\n }\n\n return false;\n }\n};\n\nexport const isRange = (date): date is DateRangeProp =>\n date != null && typeof date === \"object\" && \"startDate\" in date;\n\n/**\n * Checks if the date falls within a specified date range.\n *\n * @param date - The date to be evaluated.\n * @param providedValueRange - Provided selection range.\n * @returns - True if the date falls within the range, false otherwise.\n */\nexport const dateInProvidedValueRange = (\n date: any,\n providedValueRange: any\n) => {\n const { startDate, endDate } = providedValueRange;\n\n if (!isRange(providedValueRange) || isNil(endDate)) return false;\n const localEndDate = endDate;\n\n const modStartDate = dayjs(startDate).format(\"YYYY-MM-DD\");\n const modEndDate = dayjs(localEndDate).format(\"YYYY-MM-DD\");\n\n const convertedDate = dayjs(date).format(\"YYYY-MM-DD\");\n\n return convertedDate >= modStartDate && convertedDate <= modEndDate;\n};\n\nexport const checkIfDateIsDisabled = (\n date?: string | number | Date | dayjs.Dayjs,\n minimumDate?: string | number | Date | dayjs.Dayjs,\n maximumDate?: string | number | Date | dayjs.Dayjs\n) => {\n if (!minimumDate && !maximumDate) return false;\n const modStartDate = minimumDate\n ? dayjs(minimumDate).format(\"YYYY-MM-DD\")\n : undefined;\n const modEndDate = maximumDate\n ? dayjs(maximumDate).format(\"YYYY-MM-DD\")\n : undefined;\n\n const convertedDate = dayjs(date).format(\"YYYY-MM-DD\");\n\n return (\n (modStartDate !== undefined && convertedDate < modStartDate) ||\n (modEndDate !== undefined && convertedDate > modEndDate)\n );\n};\n\nexport const formatToLocale = (date, locale) => {\n return new Intl.DateTimeFormat(locale, {\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n }).format(date);\n};\n"],"names":["CALENDAR_WEEKS","zeroPad","value","length","padStart","getMonthDays","month","year","Date","getDate","getMonthFirstWeekday","getDay","makeUTCDate","monthIndex","day","hour","UTC","isDate","date","Object","prototype","toString","call","Number","isNaN","valueOf","isDateRangeProp","isSameMonth","date1","date2","getMonth","getFullYear","isSameDay","getDateISO","join","getPreviousMonth","prevMonth","prevMonthYear","getNextMonth","nextMonth","nextMonthYear","getMonthNamesList","locale","representationValue","options","timeZone","Array","map","n","index","auxDate","capitalize","Intl","DateTimeFormat","format","getWeekdayNamesList","dateTimeFormatValue","weekday","weekdayNames","push","getMonthName","getFormattedDate","rep","createDatesArray","monthDays","daysFromPrevMonth","daysFromNextMonth","prevMonthDays","prevMonthDates","currentMonthDates","nextMonthDates","isRange","dateInProvidedValueRange","providedValueRange","startDate","endDate","isNil","localEndDate","modStartDate","dayjs","modEndDate","convertedDate","checkIfDateIsDisabled","minimumDate","maximumDate","undefined","formatToLocale"],"mappings":";;;;;;;;;AAQO,MAAMA,iBAAiB;AAgBjBC,MAAAA,UAAUA,CAACC,OAAeC,WACpC,GAAED,QAAQE,SAASD,QAAQ,GAAG;AASpBE,MAAAA,eAAeA,CAACC,OAAeC,SAC1C,IAAIC,KAAKD,MAAMD,OAAO,CAAC,EAAEG,QAAS;AAUvBC,MAAAA,uBAAuBA,CAACJ,OAAeC,SAClD,IAAIC,KAAKD,MAAMD,QAAQ,GAAG,CAAC,EAAEK,OAAQ;AAWhC,MAAMC,cAAcA,CACzBL,MACAM,YACAC,KACAC,OAAO,MACJ,IAAIP,KAAKA,KAAKQ,IAAIT,MAAMM,YAAYC,KAAKC,IAAI,CAAC;AAQ5C,MAAME,SAASA,CAACC,SACrBC,OAAOC,UAAUC,SAASC,KAAKJ,IAAI,MAAM,mBACzC,CAACK,OAAOC,MAAMN,KAAKO,SAAS;AAEjBC,MAAAA,kBAAkBA,CAACR,SAC9B,eAAeA;AASJS,MAAAA,cAAcA,CAACC,OAAYC,UAAe;AACrD,MAAI,EAAEZ,OAAOW,KAAK,KAAKX,OAAOY,KAAK;AAAW,WAAA;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G;AACC,MAAA,CAACD,eAAe,CAACC;AAAoB,WAAA;AACzC,QAAMN,eAAeK,cACjBJ,uBAAMI,WAAW,EAAE7B,OAAO,YAAY,IACtC+B;AACJ,QAAML,aAAaI,cACfL,uBAAMK,WAAW,EAAE9B,OAAO,YAAY,IACtC+B;AAEJ,QAAMJ,gBAAgBF,eAAAA,QAAM7D,IAAI,EAAEoC,OAAO,YAAY;AAErD,SACGwB,iBAAiBO,UAAaJ,gBAAgBH,gBAC9CE,eAAeK,UAAaJ,gBAAgBD;AAEjD;AAEaM,MAAAA,iBAAiBA,CAACpE,MAAMwB,WAAW;AACvC,SAAA,IAAIU,KAAKC,eAAeX,QAAQ;AAAA,IACrC5B,KAAK;AAAA,IACLR,OAAO;AAAA,IACPC,MAAM;AAAA,EAAA,CACP,EAAE+C,OAAOpC,IAAI;AAChB;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"utils.cjs","sources":["../../../../src/components/Calendar/utils.tsx"],"sourcesContent":["import dayjs from \"dayjs\";\nimport isNil from \"lodash/isNil\";\nimport capitalize from \"lodash/capitalize\";\nimport { DateRangeProp } from \".\";\n\n/**\n * Constant with the number of weeks to be displayed on the calendar.\n */\nexport const CALENDAR_WEEKS = 6;\n\n/**\n * Constant with the default locale that should be used as the default.\n */\nexport const DEFAULT_LOCALE = \"en\";\n\n/**\n * Pads a string value with leading zeroes(0) until length is reached.\n *\n * @param value - Value to be padded.\n * @param length - Length of the value after the padding is added.\n * @returns The value as a string with the received amount of padding.\n *\n * @example zeroPad(5, 2) => \"05\"\n */\nexport const zeroPad = (value: number, length: number) =>\n `${value}`.padStart(length, \"0\");\n\n/**\n * Returns the number of days in the month given a month and year.\n *\n * @param month - Number of the month (1 to 12).\n * @param year - Number of the year.\n * @returns The number of days in a month for the received year.\n */\nexport const getMonthDays = (month: number, year: number) =>\n new Date(year, month, 0).getDate();\n\n/**\n * Gets the week day of the first day of a given month and year.\n * From 0 (Sunday) to 6 (Saturday).\n *\n * @param month - Number of the month (1 to 12).\n * @param year - Number of the year.\n * @returns The zero indexed week day where 0 is Sunday (0 to 6).\n */\nexport const getMonthFirstWeekday = (month: number, year: number) =>\n new Date(year, month - 1, 1).getDay();\n\n/**\n * Creates a `Date` instance in UTC timezone.\n *\n * @param year - The year of the date.\n * @param monthIndex - The zero indexed month of the year (0 to 11).\n * @param day - The day of the month.\n * @param [hour=1] - The hour of the day.\n * @returns A `Date` instance in UTC timezone.\n */\nexport const makeUTCDate = (\n year: number,\n monthIndex: number,\n day: number,\n hour = 1\n) => new Date(Date.UTC(year, monthIndex, day, hour));\n\n/**\n * Checks if the received date is a valid date.\n *\n * @param date - The date to be validated.\n * @returns A flag stating if the date is valid or not.\n */\nexport const isDate = (date: any): date is Date =>\n Object.prototype.toString.call(date) === \"[object Date]\" &&\n !Number.isNaN(date.valueOf());\n\nexport const isDateRangeProp = (date: any): date is DateRangeProp =>\n \"startDate\" in date;\n\n/**\n * Checks if two dates are in the same month and year.\n *\n * @param date1 - First date.\n * @param date2 - Second date.\n * @returns A flag stating if the dates are in the same month and year or not.\n */\nexport const isSameMonth = (date1: any, date2: any) => {\n if (!(isDate(date1) && isDate(date2))) return false;\n\n return (\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear()\n );\n};\n\n/**\n * Checks if two dates are on the same day.\n *\n * @param date1 - First date.\n * @param date2 - Second date.\n * @returns A flag stating if the dates are in the same day or not.\n */\nexport const isSameDay = (date1: any, date2: any) => {\n if (!(isDate(date1) && isDate(date2))) return false;\n\n return (\n date1.getDate() === date2.getDate() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear()\n );\n};\n\n/**\n * Formats the received date using the ISO format (YYYY-MM-DD).\n *\n * @param date - The date to be formatted.\n * @returns The formatted date in ISO format.\n */\nexport const getDateISO = (date?: Date) => {\n if (!isDate(date)) return null;\n\n return [\n date.getFullYear(),\n zeroPad(date.getMonth() + 1, 2),\n zeroPad(date.getDate(), 2),\n ].join(\"-\");\n};\n\n/**\n * Returns an object with the previous month taking also into consideration the year.\n * For example the previous month of January 2000 will be December 1999.\n *\n * @param month - Number of the month.\n * @param year - Number of the year.\n * @returns Object with new month and year defined.\n */\nexport const getPreviousMonth = (month: number, year: number) => {\n const prevMonth = month > 1 ? month - 1 : 12;\n const prevMonthYear = month > 1 ? year : year - 1;\n\n return { month: prevMonth, year: prevMonthYear };\n};\n\n/**\n * Returns an object with the next month taking also into consideration the year.\n * For example the next month of December 2000 will be January 2001.\n *\n * @param month - Number of the month.\n * @param year - Number of the year.\n * @returns Object with new month and year defined.\n */\nexport const getNextMonth = (month: number, year: number) => {\n const nextMonth = month < 12 ? month + 1 : 1;\n const nextMonthYear = month < 12 ? year : year + 1;\n\n return { month: nextMonth, year: nextMonthYear };\n};\n\n/**\n * Returns a list with the names of all the months localized in the received locale and representation value.\n *\n * @param locale - The locale to be applied to the Intl format.\n * @param representationValue - The representation value for the month.\n * @returns An array with all the months names.\n */\nexport const getMonthNamesList = (\n locale: string | undefined,\n representationValue: Intl.DateTimeFormatOptions[\"month\"] = \"long\"\n) => {\n const options = { month: representationValue, timeZone: \"UTC\" };\n\n return [...new Array(12)].map((n, index) => {\n const auxDate = makeUTCDate(1970, index, 1);\n return capitalize(Intl.DateTimeFormat(locale, options).format(auxDate));\n });\n};\n\n/**\n * Returns a list with the names of all the weekdays localized in the received locale and representation value.\n *\n * @param locale - The locale to be applied.\n * @param dateTimeFormatValue - The representation value for the weekday.\n * @returns An array with all the weekday names.\n */\nexport const getWeekdayNamesList = (\n locale: string,\n dateTimeFormatValue: Intl.DateTimeFormatOptions[\"weekday\"] = \"long\"\n) => {\n const options = { weekday: dateTimeFormatValue, timeZone: \"UTC\" };\n const weekdayNames: string[] = [];\n\n for (let day = 4; day <= 10; day += 1) {\n const auxDate = makeUTCDate(1970, 0, day);\n weekdayNames.push(Intl.DateTimeFormat(locale, options).format(auxDate));\n }\n return weekdayNames;\n};\n\n/**\n * Returns the name of the month for the supplied month localized in the received locale and representation value.\n *\n * @param date - The date from which the month name is extracted.\n * @param locale - The locale to be applied to the Intl format.\n * @param representationValue - The locale to be applied to the Intl format.\n * @returns The name of the month.\n */\nexport const getMonthName = (\n date: Date,\n locale: string,\n representationValue: Intl.DateTimeFormatOptions[\"month\"] = \"long\"\n) =>\n new Intl.DateTimeFormat(locale, { month: representationValue }).format(date);\n\n/**\n * Formats the received date according to Design System specifications.\n * Currently: day month, year => `14 Aug, 2019`.\n *\n * @param date - UTC date to be formatted.\n * @param locale - The locale to be applied to the Intl format.\n * @returns The formatted date as a string.\n */\nexport const getFormattedDate = (\n // TODO: fix this\n date: any,\n locale: any,\n rep: Intl.DateTimeFormatOptions[\"month\"] = \"short\"\n) =>\n `${date.getDate()} ${getMonthName(date, locale, rep)} ${date.getFullYear()}`;\n\n/**\n * Creates an array of 42 days. The complete current month and enough days from the previous and next months to fill\n * the 42 positions.\n *\n * @param month - The number of the month (1 to 12).\n * @param year - The number of the year.\n * @returns The array of dates.\n */\nexport const createDatesArray = (month: number, year: number) => {\n // Initializes the variables needed to calculate the dates for the received month and year\n const monthDays = getMonthDays(month, year);\n const daysFromPrevMonth = getMonthFirstWeekday(month, year);\n const daysFromNextMonth =\n CALENDAR_WEEKS * 7 - (daysFromPrevMonth + monthDays);\n const prevMonthYear = getPreviousMonth(month, year);\n const nextMonthYear = getNextMonth(month, year);\n const prevMonthDays = getMonthDays(prevMonthYear.month, prevMonthYear.year);\n\n // Creates the arrays for the dates for previous, current and next months\n const prevMonthDates = [...new Array(daysFromPrevMonth)].map((n, index) => {\n const day = index + 1 + (prevMonthDays - daysFromPrevMonth);\n return new Date(prevMonthYear.year, prevMonthYear.month - 1, day);\n });\n const currentMonthDates = [...new Array(monthDays)].map((n, index) => {\n const day = index + 1;\n return new Date(year, month - 1, day);\n });\n const nextMonthDates = [...new Array(daysFromNextMonth)].map((n, index) => {\n const day = index + 1;\n return new Date(nextMonthYear.year, nextMonthYear.month - 1, day);\n });\n\n return [...prevMonthDates, ...currentMonthDates, ...nextMonthDates];\n};\n\n/**\n * Checks if the received locale is valid according to Intl.\n *\n * @param locale - The locale to be checked\n * @returns True if the locale is valid, false otherwise.\n */\nexport const isValidLocale = (locale: string) => {\n try {\n if (Intl.DateTimeFormat.supportedLocalesOf(locale).length > 0) {\n return true;\n }\n // eslint-disable-next-line no-console\n console.warn(`${locale} is not supported. Falling back to a known locale.`);\n return false;\n } catch (error) {\n if (\n error != null &&\n typeof error === \"object\" &&\n \"name\" in error &&\n error?.name === \"RangeError\"\n ) {\n // eslint-disable-next-line no-console\n console.error(`Invalid locale: ${locale}`);\n return false;\n }\n if (error != null && typeof error === \"object\" && \"message\" in error) {\n // eslint-disable-next-line no-console\n console.error(error?.message);\n return false;\n }\n\n return false;\n }\n};\n\nexport const isRange = (date): date is DateRangeProp =>\n date != null && typeof date === \"object\" && \"startDate\" in date;\n\n/**\n * Checks if the date falls within a specified date range.\n *\n * @param date - The date to be evaluated.\n * @param providedValueRange - Provided selection range.\n * @returns - True if the date falls within the range, false otherwise.\n */\nexport const dateInProvidedValueRange = (\n date: any,\n providedValueRange: any\n) => {\n const { startDate, endDate } = providedValueRange;\n\n if (!isRange(providedValueRange) || isNil(endDate)) return false;\n const localEndDate = endDate;\n\n const modStartDate = dayjs(startDate).format(\"YYYY-MM-DD\");\n const modEndDate = dayjs(localEndDate).format(\"YYYY-MM-DD\");\n\n const convertedDate = dayjs(date).format(\"YYYY-MM-DD\");\n\n return convertedDate >= modStartDate && convertedDate <= modEndDate;\n};\n\nexport const checkIfDateIsDisabled = (\n date?: string | number | Date | dayjs.Dayjs,\n minimumDate?: string | number | Date | dayjs.Dayjs,\n maximumDate?: string | number | Date | dayjs.Dayjs\n) => {\n if (!minimumDate && !maximumDate) return false;\n const modStartDate = minimumDate\n ? dayjs(minimumDate).format(\"YYYY-MM-DD\")\n : undefined;\n const modEndDate = maximumDate\n ? dayjs(maximumDate).format(\"YYYY-MM-DD\")\n : undefined;\n\n const convertedDate = dayjs(date).format(\"YYYY-MM-DD\");\n\n return (\n (modStartDate !== undefined && convertedDate < modStartDate) ||\n (modEndDate !== undefined && convertedDate > modEndDate)\n );\n};\n\nexport const formatToLocale = (date, locale) => {\n return new Intl.DateTimeFormat(locale, {\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n }).format(date);\n};\n"],"names":["CALENDAR_WEEKS","getMonthDays","month","year","Date","getDate","getMonthFirstWeekday","getDay","makeUTCDate","monthIndex","day","hour","UTC","isDate","date","Object","prototype","toString","call","Number","isNaN","valueOf","isDateRangeProp","isSameMonth","date1","date2","getMonth","getFullYear","isSameDay","getPreviousMonth","prevMonth","prevMonthYear","getNextMonth","nextMonth","nextMonthYear","getMonthNamesList","locale","representationValue","options","timeZone","Array","map","n","index","auxDate","capitalize","Intl","DateTimeFormat","format","getWeekdayNamesList","dateTimeFormatValue","weekday","weekdayNames","push","getMonthName","getFormattedDate","rep","createDatesArray","monthDays","daysFromPrevMonth","daysFromNextMonth","prevMonthDays","prevMonthDates","currentMonthDates","nextMonthDates","isRange","dateInProvidedValueRange","providedValueRange","startDate","endDate","isNil","localEndDate","modStartDate","dayjs","modEndDate","convertedDate","checkIfDateIsDisabled","minimumDate","maximumDate","undefined","formatToLocale"],"mappings":";;;;;;;;;AAQO,MAAMA,iBAAiB;AA0BjBC,MAAAA,eAAeA,CAACC,OAAeC,SAC1C,IAAIC,KAAKD,MAAMD,OAAO,CAAC,EAAEG,QAAS;AAUvBC,MAAAA,uBAAuBA,CAACJ,OAAeC,SAClD,IAAIC,KAAKD,MAAMD,QAAQ,GAAG,CAAC,EAAEK,OAAQ;AAWhC,MAAMC,cAAcA,CACzBL,MACAM,YACAC,KACAC,OAAO,MACJ,IAAIP,KAAKA,KAAKQ,IAAIT,MAAMM,YAAYC,KAAKC,IAAI,CAAC;AAQ5C,MAAME,SAASA,CAACC,SACrBC,OAAOC,UAAUC,SAASC,KAAKJ,IAAI,MAAM,mBACzC,CAACK,OAAOC,MAAMN,KA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