@adyen/bento-vue2 1.76.0 → 1.76.2

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 (40) hide show
  1. package/dist/assets/accordion-item.css +1 -1
  2. package/dist/assets/action-bar.css +1 -1
  3. package/dist/assets/base-modal.css +1 -1
  4. package/dist/assets/button-actions.css +1 -1
  5. package/dist/assets/card.css +1 -1
  6. package/dist/assets/data-grid.css +1 -1
  7. package/dist/assets/dialog-page.css +1 -1
  8. package/dist/assets/file-uploader.css +1 -1
  9. package/dist/assets/input-field.css +1 -1
  10. package/dist/assets/inspector.css +1 -1
  11. package/dist/assets/modal-fullscreen.css +1 -1
  12. package/dist/assets/sidepanel.css +1 -1
  13. package/dist/chunks/{data-grid.B5aCkT0o.js → data-grid.C07AmPwV.js} +5 -5
  14. package/dist/chunks/{data-grid.B5aCkT0o.js.map → data-grid.C07AmPwV.js.map} +1 -1
  15. package/dist/chunks/{date-range-picker.DgZMERzx.js → date-range-picker.NAG_5i8I.js} +2 -2
  16. package/dist/chunks/{date-range-picker.DgZMERzx.js.map → date-range-picker.NAG_5i8I.js.map} +1 -1
  17. package/dist/chunks/{filter-bar.C0S87JZD.js → filter-bar.DVqgwt2p.js} +4 -4
  18. package/dist/chunks/{filter-bar.C0S87JZD.js.map → filter-bar.DVqgwt2p.js.map} +1 -1
  19. package/dist/chunks/{header-with-views.j16q5wEc.js → header-with-views.jnhILkoQ.js} +2 -2
  20. package/dist/chunks/{header-with-views.j16q5wEc.js.map → header-with-views.jnhILkoQ.js.map} +1 -1
  21. package/dist/chunks/{input-field-password.CSfXqEbT.js → input-field-password.CHn2GUcL.js} +2 -2
  22. package/dist/chunks/{input-field-password.CSfXqEbT.js.map → input-field-password.CHn2GUcL.js.map} +1 -1
  23. package/dist/chunks/{input-field-phone-number.oa4hXQdK.js → input-field-phone-number.CpnfVw6w.js} +2 -2
  24. package/dist/chunks/{input-field-phone-number.oa4hXQdK.js.map → input-field-phone-number.CpnfVw6w.js.map} +1 -1
  25. package/dist/chunks/{input-field.DdQu3b1-.js → input-field.sGmuIXiw.js} +38 -38
  26. package/dist/chunks/input-field.sGmuIXiw.js.map +1 -0
  27. package/dist/chunks/{search-bar.DJVfPz-f.js → search-bar.D8SJsbze.js} +2 -2
  28. package/dist/chunks/{search-bar.DJVfPz-f.js.map → search-bar.D8SJsbze.js.map} +1 -1
  29. package/dist/data-grid.js +1 -1
  30. package/dist/date-range-picker.js +1 -1
  31. package/dist/filter-bar.js +1 -1
  32. package/dist/header-with-views.js +1 -1
  33. package/dist/index.js +8 -8
  34. package/dist/input-field-password.js +1 -1
  35. package/dist/input-field-phone-number.js +1 -1
  36. package/dist/input-field.js +1 -1
  37. package/dist/search-bar.js +1 -1
  38. package/dist/web-types.json +1 -1
  39. package/package.json +6 -6
  40. package/dist/chunks/input-field.DdQu3b1-.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"date-range-picker.DgZMERzx.js","sources":["../../src/components/date-range-picker/utils/date-text-to-start-of-day.ts","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addQuarters.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subQuarters.js","../../src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.ts","../../src/components/date-range-picker/composables/use-granularity-memory.ts","../../src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.types.ts","../../src/utils/ts/time-input.ts","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setHours.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMinutes.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setSeconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfSecond.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameSecond.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isEqual.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isToday.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMilliseconds.js","../../src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getQuarter.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getYear.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameQuarter.js","../../src/components/date-range-picker/composables/use-date-range-picker-calendar-text.ts","../../src/components/date-range-picker/date-range-picker.types.ts","../../src/components/date-range-picker/date-range-picker.vue"],"sourcesContent":["import { startOfDay } from 'date-fns/startOfDay';\n\n/**\n * Parses an ISO date string and returns a Date set to the\n * start of that calendar day (00:00:00) in the system’s local time zone.\n *\n * Uses the numeric Date constructor `new Date(year, monthIndex, day)`\n * which interprets its arguments as local time.\n *\n * @param dateText - A date in `YYYY-MM-DD` format.\n * @returns A `Date` at the local start of the specified day.\n */\nexport function parseDateTextToStartOfDay(dateText?: string) {\n if (dateText == null) {\n return startOfDay(new Date());\n }\n\n const [year, month, day] = dateText.split('-').map(s => parseInt(s, 10));\n return new Date(year, month - 1, day);\n}\n","import { addMonths } from \"./addMonths.js\";\n\n/**\n * The {@link addQuarters} function options.\n */\n\n/**\n * @name addQuarters\n * @category Quarter Helpers\n * @summary Add the specified number of year quarters to the given date.\n *\n * @description\n * Add the specified number of year quarters to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of quarters to be added.\n * @param options - An object with options\n *\n * @returns The new date with the quarters added\n *\n * @example\n * // Add 1 quarter to 1 September 2014:\n * const result = addQuarters(new Date(2014, 8, 1), 1)\n * //=; Mon Dec 01 2014 00:00:00\n */\nexport function addQuarters(date, amount, options) {\n return addMonths(date, amount * 3, options);\n}\n\n// Fallback for modularized imports:\nexport default addQuarters;\n","import { addQuarters } from \"./addQuarters.js\";\n\n/**\n * The {@link subQuarters} function options.\n */\n\n/**\n * @name subQuarters\n * @category Quarter Helpers\n * @summary Subtract the specified number of year quarters from the given date.\n *\n * @description\n * Subtract the specified number of year quarters from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of quarters to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the quarters subtracted\n *\n * @example\n * // Subtract 3 quarters from 1 September 2014:\n * const result = subQuarters(new Date(2014, 8, 1), 3)\n * //=> Sun Dec 01 2013 00:00:00\n */\nexport function subQuarters(date, amount, options) {\n return addQuarters(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subQuarters;\n","import { addDays } from 'date-fns/addDays';\nimport { addMonths } from 'date-fns/addMonths';\nimport { addQuarters } from 'date-fns/addQuarters';\nimport { endOfDay } from 'date-fns/endOfDay';\nimport { endOfMonth } from 'date-fns/endOfMonth';\nimport { endOfQuarter } from 'date-fns/endOfQuarter';\nimport { endOfWeek } from 'date-fns/endOfWeek';\nimport { isSameDay } from 'date-fns/isSameDay';\nimport { startOfDay } from 'date-fns/startOfDay';\nimport { startOfMonth } from 'date-fns/startOfMonth';\nimport { startOfQuarter } from 'date-fns/startOfQuarter';\nimport { startOfWeek } from 'date-fns/startOfWeek';\nimport { subDays } from 'date-fns/subDays';\nimport { subMonths } from 'date-fns/subMonths';\nimport { subQuarters } from 'date-fns/subQuarters';\n\nimport type { CalendarGranularityConfig } from '../../../calendar.types';\nimport type { UseGranularMinMaxDate } from './granular-min-max-date.types';\n\n/**\n * Provides utility function to set calendar min/max dates based on the granularity selected.\n * @param props Configured min/max dates, and the day the week starts on.\n * @returns Function to calculate calendar limits.\n */\nexport const useGranularMinMaxDate: UseGranularMinMaxDate = ({\n firstDayOfWeek,\n min: minimumDate,\n max: maximumDate,\n}) => {\n const getGranularCalendarLimits = (granularity: CalendarGranularityConfig) => {\n if (!minimumDate && !maximumDate) {\n return { min: null, max: null };\n }\n\n let min = minimumDate ? startOfDay(minimumDate) : null;\n let max = maximumDate ? endOfDay(maximumDate) : null;\n\n if (granularity?.type === 'weekly') {\n if (granularity.earliest) {\n min = startOfDay(granularity.earliest);\n } else if (min) {\n const startOfMin = startOfWeek(min, { weekStartsOn: firstDayOfWeek });\n\n // If the minimum is in the middle of a week, set to the end (only allow full weeks)\n if (!isSameDay(min, startOfMin)) {\n min = startOfDay(addDays(endOfWeek(min, { weekStartsOn: firstDayOfWeek }), 1));\n }\n }\n\n if (granularity.latest) {\n max = endOfDay(granularity.latest);\n } else if (max) {\n const endOfMax = endOfWeek(max, { weekStartsOn: firstDayOfWeek });\n\n // If the maximum is in the middle of a week, set to the end of last week (only allow full weeks)\n if (!isSameDay(max, endOfMax)) {\n max = endOfDay(subDays(startOfWeek(max, { weekStartsOn: firstDayOfWeek }), 1));\n }\n }\n }\n\n if (granularity?.type === 'monthly') {\n if (granularity.earliest) {\n min = startOfDay(granularity.earliest);\n } else if (min) {\n const startOfMin = startOfMonth(min);\n\n // If the minimum is in the middle of a month, set to the start of next month (only allow full month)\n if (!isSameDay(min, startOfMin)) {\n min = startOfMonth(addMonths(min, 1));\n }\n }\n\n if (granularity.latest) {\n max = endOfDay(granularity.latest);\n } else if (max) {\n const endOfMax = endOfMonth(max);\n\n // If the maximum is in the middle of a month, set to the end of last month (only allow full months)\n if (!isSameDay(max, endOfMax)) {\n max = endOfMonth(subMonths(max, 1));\n }\n }\n }\n\n if (granularity?.type === 'quarterly') {\n if (granularity.earliest) {\n min = startOfQuarter(granularity.earliest);\n } else if (min) {\n const startOfMin = startOfQuarter(min);\n\n // If the minimum is in the middle of a quarter, set to the start of next quarter (only allow full fiscal quarters)\n if (!isSameDay(min, startOfMin)) {\n min = startOfQuarter(addQuarters(min, 1));\n }\n }\n\n if (granularity.latest) {\n max = endOfDay(granularity.latest);\n } else if (max) {\n const endOfMax = endOfQuarter(max);\n\n // If the maximum is in the middle of a quarter, set to the end of last quarter (only allow full fiscal quarters)\n if (!isSameDay(max, endOfMax)) {\n max = endOfQuarter(subQuarters(max, 1));\n }\n }\n }\n\n return { min, max };\n };\n\n return { getGranularCalendarLimits };\n};\n","import { reactive } from 'vue';\n\nimport type { CalendarGranularityType } from '../../internal/calendar/calendar.types';\nimport type { UseGranularityMemory } from './use-granularity-memory.types';\n\n/**\n * Provides utility property and functions to store date ranges based on granularity.\n * This is used to revert back to the previously selected range when users switch between granularities\n * @returns Saved date ranges per granularity, and functions to save/reset ranges.\n */\nexport const useGranularityMemory: UseGranularityMemory = () => {\n const savedRanges = reactive<{\n daily: { startDate: Date; endDate: Date } | null;\n weekly: { startDate: Date; endDate: Date } | null;\n monthly: { startDate: Date; endDate: Date } | null;\n quarterly: { startDate: Date; endDate: Date } | null;\n }>({\n daily: null,\n weekly: null,\n monthly: null,\n quarterly: null,\n });\n\n const saveRange = (type: CalendarGranularityType, range: { startDate: Date; endDate: Date }) => {\n savedRanges[type] = range;\n };\n\n const resetSavedRanges = () => {\n savedRanges.daily = null;\n savedRanges.weekly = null;\n savedRanges.monthly = null;\n savedRanges.quarterly = null;\n };\n\n return {\n savedRanges,\n\n saveRange,\n resetSavedRanges,\n };\n};\n","import { type CalendarGranularityType } from '@/internal/calendar/calendar.types';\n\nexport interface DateRangePickerCalendarFormData {\n startDate: string;\n endDate: string;\n startTime?: string;\n endTime?: string;\n granularity?: CalendarGranularityType;\n}\n\nexport enum DateRangePickerCalendarEvent {\n CUSTOM_RANGE = 'custom-range',\n INPUT = 'input',\n ERROR = 'error',\n FORM_DATE = 'form-date',\n START_DATE_SELECTED = 'start-date-selected',\n}\n\nexport interface DateRangePickerCalendarRangeSelectorItem {\n label: string;\n value: string;\n data: {\n startDate: Date;\n endDate?: Date;\n granularity?: CalendarGranularityType;\n isRelativeToNow?: boolean;\n timeDifference?: number;\n };\n}\n\nexport type DateRangePickerCalendarRangeSelectorItems = Array<DateRangePickerCalendarRangeSelectorItem>;\n","const validDigitRegex = /[\\d]/;\n\nconst hourRegex = /^\\d{2}$/;\nconst minuteRegex = /^\\d{2}:\\d{2}$/;\n\nexport const validateTimeInput = (event: KeyboardEvent) => {\n const { selectionStart } = event.target as HTMLInputElement;\n\n const allowedKeys = ['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight'];\n const isValidKey = validDigitRegex.test(event.key) || allowedKeys.includes(event.key);\n const isValidColon = [1, 2, 4, 5].includes(selectionStart) && event.key === ':';\n\n if (!isValidKey && !isValidColon) {\n event.preventDefault();\n }\n};\n\nexport const formatTimeInputValue = (value: string) => {\n if (!value) {\n return value;\n }\n\n let formattedValue = value;\n\n // Format if the first value is bigger than 2, because it can't be bigger than 24 hours\n if (formattedValue.length === 1 && parseInt(value, 10) > 2) {\n return `0${formattedValue}:`;\n }\n\n const [secondToLastDigit, lastDigit] = formattedValue.slice(-2);\n if ([2, 5].includes(formattedValue.length) && lastDigit === ':') {\n formattedValue = `${formattedValue.slice(0, formattedValue.length - 2)}0${secondToLastDigit}`;\n }\n\n // Add `:` after hour/minute\n if (hourRegex.test(formattedValue) || minuteRegex.test(formattedValue)) {\n formattedValue += ':';\n }\n return formattedValue;\n};\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setHours} function options.\n */\n\n/**\n * @name setHours\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param hours - The hours of the new date\n * @param options - An object with options\n *\n * @returns The new date with the hours set\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * const result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\nexport function setHours(date, hours, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(hours);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setHours;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMinutes} function options.\n */\n\n/**\n * @name setMinutes\n * @category Minute Helpers\n * @summary Set the minutes to the given date.\n *\n * @description\n * Set the minutes to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, returned from the context function, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param minutes - The minutes of the new date\n * @param options - An object with options\n *\n * @returns The new date with the minutes set\n *\n * @example\n * // Set 45 minutes to 1 September 2014 11:30:40:\n * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:45:40\n */\nexport function setMinutes(date, minutes, options) {\n const date_ = toDate(date, options?.in);\n date_.setMinutes(minutes);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default setMinutes;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setSeconds} function options.\n */\n\n/**\n * @name setSeconds\n * @category Second Helpers\n * @summary Set the seconds to the given date, with context support.\n *\n * @description\n * Set the seconds to the given date, with an optional context for time zone specification.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param seconds - The seconds of the new date\n * @param options - An object with options\n *\n * @returns The new date with the seconds set\n *\n * @example\n * // Set 45 seconds to 1 September 2014 11:30:40:\n * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:30:45\n */\nexport function setSeconds(date, seconds, options) {\n const _date = toDate(date, options?.in);\n _date.setSeconds(seconds);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setSeconds;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfSecond} function options.\n */\n\n/**\n * @name startOfSecond\n * @category Second Helpers\n * @summary Return the start of a second for the given date.\n *\n * @description\n * Return the start of a second for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a second\n *\n * @example\n * // The start of a second for 1 December 2014 22:15:45.400:\n * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.000\n */\nexport function startOfSecond(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setMilliseconds(0);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default startOfSecond;\n","import { startOfSecond } from \"./startOfSecond.js\";\n\n/**\n * @name isSameSecond\n * @category Second Helpers\n * @summary Are the given dates in the same second (and hour and day)?\n *\n * @description\n * Are the given dates in the same second (and hour and day)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n *\n * @returns The dates are in the same second (and hour and day)\n *\n * @example\n * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500 in the same second?\n * const result = isSameSecond(\n * new Date(2014, 8, 4, 6, 30, 15),\n * new Date(2014, 8, 4, 6, 30, 15, 500)\n * )\n * //=> true\n *\n * @example\n * // Are 4 September 2014 06:00:15.000 and 4 September 2014 06:01.15.000 in the same second?\n * const result = isSameSecond(\n * new Date(2014, 8, 4, 6, 0, 15),\n * new Date(2014, 8, 4, 6, 1, 15)\n * )\n * //=> false\n *\n * @example\n * // Are 4 September 2014 06:00:15.000 and 5 September 2014 06:00.15.000 in the same second?\n * const result = isSameSecond(\n * new Date(2014, 8, 4, 6, 0, 15),\n * new Date(2014, 8, 5, 6, 0, 15)\n * )\n * //=> false\n */\nexport function isSameSecond(laterDate, earlierDate) {\n return +startOfSecond(laterDate) === +startOfSecond(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default isSameSecond;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The dates are equal\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * const result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\nexport function isEqual(leftDate, rightDate) {\n return +toDate(leftDate) === +toDate(rightDate);\n}\n\n// Fallback for modularized imports:\nexport default isEqual;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { constructNow } from \"./constructNow.js\";\nimport { isSameDay } from \"./isSameDay.js\";\n\n/**\n * The {@link isToday} function options.\n */\n\n/**\n * @name isToday\n * @category Day Helpers\n * @summary Is the given date today?\n * @pure false\n *\n * @description\n * Is the given date today?\n *\n * @param date - The date to check\n * @param options - An object with options\n *\n * @returns The date is today\n *\n * @example\n * // If today is 6 October 2014, is 6 October 14:00:00 today?\n * const result = isToday(new Date(2014, 9, 6, 14, 0))\n * //=> true\n */\nexport function isToday(date, options) {\n return isSameDay(\n constructFrom(options?.in || date, date),\n constructNow(options?.in || date),\n );\n}\n\n// Fallback for modularized imports:\nexport default isToday;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMilliseconds} function options.\n */\n\n/**\n * @name setMilliseconds\n * @category Millisecond Helpers\n * @summary Set the milliseconds to the given date.\n *\n * @description\n * Set the milliseconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param milliseconds - The milliseconds of the new date\n * @param options - The options\n *\n * @returns The new date with the milliseconds set\n *\n * @example\n * // Set 300 milliseconds to 1 September 2014 11:30:40.500:\n * const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)\n * //=> Mon Sep 01 2014 11:30:40.300\n */\nexport function setMilliseconds(date, milliseconds, options) {\n const _date = toDate(date, options?.in);\n _date.setMilliseconds(milliseconds);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setMilliseconds;\n","<template>\n <div class=\"b-date-range-picker-calendar\">\n <!-- Form -->\n <div class=\"b-date-range-picker-calendar__form-container\">\n <div class=\"b-date-range-picker-calendar__form\">\n <template v-if=\"hasSlot('title')\">\n <slot name=\"title\" />\n </template>\n\n <bento-dropdown\n v-if=\"quickSelectRanges\"\n :aria-label=\"t('customRange')\"\n :items=\"quickSelectRangeDefaultItems\"\n :value=\"selectedRangeSelectorValue\"\n @input=\"onRangeSelectorInput\"\n />\n\n <bento-segmented-control\n v-if=\"granularities\"\n :items=\"granularityItems\"\n :model-value=\"internalRangeDate.granularity\"\n full-width\n @update:model-value=\"onGranularityInput\"\n >\n </bento-segmented-control>\n <div>\n <bento-typography stronger el=\"span\" class=\"b-date-range-picker-calendar__label\">\n From\n </bento-typography>\n <div :class=\"formInputWrapperConditionalClasses\">\n <bento-input-field\n :aria-label=\"t('dateFrom')\"\n :value=\"dateTextInput.startDate\"\n :error=\"startDateError\"\n class=\"b-date-range-picker-calendar__form-input\"\n @input=\"onStartDateInput\"\n @keydown=\"onDateInputKeyDown\"\n >\n <template #description>YYYY-MM-DD</template>\n </bento-input-field>\n\n <bento-input-field\n v-if=\"allowTimeInput\"\n :aria-label=\"t('timeFrom')\"\n :value=\"dateTextInput.startTime\"\n :error=\"startTimeError\"\n class=\"b-date-range-picker-calendar__form-input\"\n @input=\"onStartTimeInput\"\n @keydown=\"onTimeInputKeyDown\"\n >\n <template #description>HH:MM:SS</template>\n </bento-input-field>\n </div>\n </div>\n\n <div>\n <bento-typography stronger el=\"span\" class=\"b-date-range-picker-calendar__label\">\n To\n </bento-typography>\n <div :class=\"formInputWrapperConditionalClasses\">\n <bento-input-field\n class=\"b-date-range-picker-calendar__form-input\"\n :aria-label=\"t('dateTo')\"\n :value=\"dateTextInput.endDate\"\n :error=\"endDateError\"\n @input=\"onEndDateInput\"\n @keydown=\"onDateInputKeyDown\"\n >\n <template #description>YYYY-MM-DD</template>\n </bento-input-field>\n\n <bento-input-field\n v-if=\"allowTimeInput\"\n :aria-label=\"t('timeTo')\"\n :value=\"dateTextInput.endTime\"\n :error=\"endTimeError\"\n class=\"b-date-range-picker-calendar__form-input\"\n @input=\"onEndTimeInput\"\n @keydown=\"onTimeInputKeyDown\"\n >\n <template #description>HH:MM:SS</template>\n </bento-input-field>\n </div>\n </div>\n </div>\n\n <div v-if=\"hasSlot('actions')\">\n <slot name=\"actions\" />\n </div>\n </div>\n\n <!-- Calendar -->\n <div class=\"b-date-range-picker-calendar__calendars-container\">\n <calendar\n :value=\"internalRangeDate\"\n :first-day-of-week=\"firstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :max-range=\"maxRange\"\n :min=\"computedMinMax.min\"\n :max=\"computedMinMax.max\"\n :number-of-months=\"numberOfMonths\"\n :show-end-date-on-open=\"showEndDateOnOpen\"\n :granularity=\"selectedGranularity\"\n :variant=\"variant\"\n is-range\n @input=\"onDateInput\"\n @start-date-selected=\"onStartDateSelected\"\n @end-date-selected=\"onEndDateSelected\"\n />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, reactive, ref, toRaw } from 'vue';\n import { Calendar, type CalendarGranularityType } from '@/internal';\n import { BentoTypography } from '@/components/typography';\n import { BentoInputField } from '@/components/input-field';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n import { BentoSegmentedControl, type BentoSegmentedControlItem } from '@/components/segmented-control';\n import { getDateLocale } from '@/utils/ts/get-date-locale/get-date-locale';\n import { useI18n } from '@/utils/ts/i18n';\n import { parseDateTextToStartOfDay } from '../../utils/date-text-to-start-of-day';\n import { debounce } from '@/utils/ts/debounce';\n import { useHasSlot } from '@/composables';\n import { useGranularityAdjustments } from '@/components/internal/calendar/composables/use-granularity-adjustments';\n import { useGranularMinMaxDate } from '@/components/internal/calendar/components/calendar-month/composables/granular-min-max-date';\n import { useGranularityMemory } from '../../composables/use-granularity-memory';\n import { formatDateInputValue, validateDateInput } from '@/utils/ts/date-input';\n import {\n DateRangePickerCalendarEvent,\n type DateRangePickerCalendarFormData,\n type DateRangePickerCalendarRangeSelectorItems,\n } from './date-range-picker-calendar.types';\n import type {\n BentoDateRangePickerGranularityConfig,\n BentoDateRangePickerValue,\n } from '../../date-range-picker.types';\n import { DateFormat } from '@/types/date-format';\n import { formatTimeInputValue, validateTimeInput } from '@/utils/ts/time-input';\n import { endOfDay } from 'date-fns/endOfDay';\n import { format } from 'date-fns/format';\n import { setHours } from 'date-fns/setHours';\n import { setMinutes } from 'date-fns/setMinutes';\n import { setSeconds } from 'date-fns/setSeconds';\n import { startOfDay } from 'date-fns/startOfDay';\n import { isSameSecond } from 'date-fns/isSameSecond';\n import { isSameDay } from 'date-fns/isSameDay';\n import { isEqual } from 'date-fns/isEqual';\n import { isToday } from 'date-fns/isToday';\n import { setMilliseconds } from 'date-fns/setMilliseconds';\n import messages from './messages.json';\n\n const FORM_INPUT_DEBOUNCE_TIME = 300;\n const RANGE_SELECTOR_CUSTOM_RANGE_KEY = 'customRange';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Calendar for range dates. Contains the logic to handle the range forms.\n *\n * @example\n * import DatePickerCalendarRange from './date-range-picker-calendar.vue';\n *\n * export default {\n * components: { DatePickerCalendarRange },\n * template: `\n * <date-range-picker-calendar\n * :value=\"{startDate: new Date(), endDate: new Date() }\"\n * :first-day-of-week=\"BentoDatePickerFirstDayOfWeek.MONDAY\"\n * :is-date-disabled=\"(date: Date) => boolean\"\n * :number-of-months=\"2\"\n * @input=\"({ startDate, endDate }) => void\"\n * />\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'date-range-picker-calendar',\n components: {\n BentoDropdown,\n BentoInputField,\n BentoSegmentedControl,\n BentoTypography,\n Calendar,\n },\n props: {\n /**\n * Allows user to enter time values in the form\n */\n allowTimeInput: { type: Boolean, default: false },\n\n /**\n * Ranges form persistance data\n */\n dateFormData: {\n type: Object as PropType<DateRangePickerCalendarFormData>,\n default: () => ({ startDate: undefined, endDate: undefined, startTime: undefined, endTime: undefined }),\n },\n\n /**\n * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n */\n firstDayOfWeek: Calendar.props.firstDayOfWeek,\n\n /**\n * A list of available granularities.\n * If present, the date picker will display a segmented control to change granularity.\n */\n granularities: {\n type: Array as PropType<Array<BentoDateRangePickerGranularityConfig>>,\n default: null,\n },\n\n /**\n * Indicate if a date should be disabled or not\n */\n isDateDisabled: Calendar.props.isDateDisabled,\n\n /**\n * Set a maximum number of dates to be selectable by the range.\n */\n maxRange: Calendar.props.maxRange,\n\n /**\n * Sets a minimum limit for selectable dates - dates before `min` will not be selectable\n */\n min: Calendar.props.min,\n\n /**\n * Sets a maximum limit for selectable dates - dates after `max` will not be selectable\n */\n max: Calendar.props.max,\n\n /**\n * Number of months rendered on pane\n */\n numberOfMonths: Calendar.props.numberOfMonths,\n\n /**\n * Displays the end date's month when the calendar is opened. Defaults to false i.e. the start date's month is displayed.\n */\n showEndDateOnOpen: { type: Boolean, default: false },\n\n /**\n * Enables the custom range selector.\n * If provided, must be an array that sets the custom range dropdown items. Items are of the structure:\n * `label` - label of custom range item.\n * `value` - a unique key of the custom range item.\n * `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.\n */\n quickSelectRanges: {\n type: Array as PropType<DateRangePickerCalendarRangeSelectorItems>,\n default: undefined,\n },\n\n /**\n * Selected date\n */\n value: { type: Object as PropType<BentoDateRangePickerValue>, default: undefined },\n\n /**\n * The type of calendar to display. Defaults to showing days.\n */\n variant: Calendar.props.variant,\n },\n emits: [\n DateRangePickerCalendarEvent.CUSTOM_RANGE,\n DateRangePickerCalendarEvent.INPUT,\n DateRangePickerCalendarEvent.ERROR,\n DateRangePickerCalendarEvent.FORM_DATE,\n DateRangePickerCalendarEvent.START_DATE_SELECTED,\n ],\n setup(props, { emit, slots }) {\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const locales = getDateLocale();\n const calculatedIsRelativeToNowQuickSelectRanges = ref({});\n\n const defaultGranularity = computed(() => (props.variant === 'month' ? 'monthly' : 'daily'));\n\n const internalRangeDate = reactive<BentoDateRangePickerValue>({\n startDate: props.value?.startDate,\n endDate: props.value?.endDate,\n range: props.value?.range,\n ...(props.granularities\n ? {\n granularity: props.value?.granularity || defaultGranularity.value,\n }\n : {}),\n });\n\n /**\n * Deserializes a date to transform it to a UTC standard so it can be compared regardless of timezone.\n * src: https://stackoverflow.com/a/38050824\n * @param date Date to deserialize/normalize for comparisson\n */\n function deserializeDate(date: Date) {\n if (!date) {\n return null;\n }\n return new Date(\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds()\n );\n }\n\n /**\n * Currently range selector dropdown item that is selected.\n * The logic will try and find in each range item:\n * - If an endDate does not exist, then only check if the startDate day matches and if today's day matches.\n * - if time input has been enabled, then check if the seconds match.\n * - if an endDate does exist then just check if the startDate day and the endDate day match.\n */\n const selectedRangeSelectorValue = computed(() => {\n return (\n // eslint-disable-next-line consistent-return\n props?.quickSelectRanges?.find(({ value, data }) => {\n if (!data.endDate) {\n // Check if this quick select range is explicitly marked as \"relative to now\"\n if (data.isRelativeToNow) {\n // Retrieve previously calculated start/end dates for this relative range.\n // We use these if the user has already clicked on this time of quick range\n const newlyCalculatedQuickSelectDates =\n calculatedIsRelativeToNowQuickSelectRanges.value?.[value];\n return newlyCalculatedQuickSelectDates\n ? isEqual(\n deserializeDate(newlyCalculatedQuickSelectDates.startDate),\n deserializeDate(internalRangeDate.startDate)\n ) &&\n isEqual(\n deserializeDate(newlyCalculatedQuickSelectDates.endDate),\n deserializeDate(internalRangeDate.endDate)\n )\n : // If not stored calculated dates, fall back to comparing the quick select item's value\n // with the internal range's stored range identifier.\n value === internalRangeDate.range;\n }\n // This block handles quick select ranges that do not have an endDate\n // AND are NOT explicitly marked as 'isRelativeToNow'.\n // This means the endDate will be today at the end of the day\n return (\n isEqual(\n deserializeDate(data.startDate),\n deserializeDate(internalRangeDate.startDate)\n ) &&\n isEqual(\n deserializeDate(internalRangeDate.endDate),\n deserializeDate(endOfDay(internalRangeDate.endDate))\n ) &&\n isToday(deserializeDate(internalRangeDate.endDate)) &&\n (props.granularities ? data.granularity === internalRangeDate.granularity : true)\n );\n }\n\n if (props.allowTimeInput) {\n const res =\n isSameSecond(\n deserializeDate(data.startDate),\n deserializeDate(internalRangeDate.startDate)\n ) &&\n isSameSecond(\n deserializeDate(data.endDate),\n deserializeDate(internalRangeDate.endDate)\n ) &&\n (props.granularities ? data.granularity === internalRangeDate.granularity : true);\n return res;\n }\n\n if (data.endDate) {\n return (\n isSameDay(data.startDate, internalRangeDate.startDate) &&\n isSameDay(data.endDate, internalRangeDate.endDate) &&\n (props.granularities ? data.granularity === internalRangeDate.granularity : true)\n );\n }\n })?.value ?? RANGE_SELECTOR_CUSTOM_RANGE_KEY\n );\n });\n const formInputWrapperConditionalClasses = computed(() => ({\n 'b-date-range-picker-calendar__form-input-wrapper': props.allowTimeInput,\n }));\n const quickSelectRangeDefaultItems = computed(() => [\n { label: t('customRange'), value: RANGE_SELECTOR_CUSTOM_RANGE_KEY },\n ...(props.quickSelectRanges ? props.quickSelectRanges : []),\n ]);\n\n const selectedGranularity = computed(\n () => props.granularities?.find(({ type }) => type === internalRangeDate.granularity) || null\n );\n\n const granularityItems = computed<Array<BentoSegmentedControlItem>>(\n () =>\n props.granularities?.map(({ type, disabled }) => ({\n label: t(type),\n value: type,\n disabled,\n })) ?? []\n );\n\n const { getGranularCalendarLimits } = useGranularMinMaxDate(props);\n\n const computedMinMax = computed(() =>\n props.granularities\n ? getGranularCalendarLimits(selectedGranularity.value)\n : { min: props.min ? startOfDay(props.min) : null, max: props.max ? endOfDay(props.max) : null }\n );\n\n const {\n adjustDateForQuarterly,\n adjustDateForMonthly,\n adjustDateForWeekly,\n adjustStartDateInputForWeekly,\n adjustEndDateInputForWeekly,\n adjustStartDateInputForMonthly,\n adjustEndDateInputForMonthly,\n adjustStartDateInputForQuarterly,\n adjustEndDateInputForQuarterly,\n } = useGranularityAdjustments(props.firstDayOfWeek);\n const { savedRanges, saveRange, resetSavedRanges } = useGranularityMemory();\n\n /**\n * Format date to a string value in format yyyy-MM-dd\n * @param {Date} dateToFormat Date to be formatted\n */\n const formatDate = (dateToFormat?: Date) => {\n if (!dateToFormat) {\n return '';\n }\n return format(dateToFormat, DateFormat.NUMERIC_DATE_YEAR_FIRST, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n });\n };\n\n const formatTime = (dateToFormat?: Date) => {\n if (!dateToFormat) {\n return '';\n }\n\n return format(dateToFormat, DateFormat.HOUR_MINUTE_SECONDS, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n });\n };\n\n // Form error flags\n const startDateError = ref(false);\n const endDateError = ref(false);\n const startTimeError = ref(false);\n const endTimeError = ref(false);\n\n // Form input text used in range variant\n const dateTextInput = reactive({\n startDate: props.dateFormData.startDate,\n endDate: props.dateFormData.endDate,\n startTime: props.dateFormData.startTime,\n endTime: props.dateFormData.endTime,\n });\n\n /**\n * Sets the time of a date object from a time string.\n * @param dateToSetTimeIn The date object to set the time in.\n * @param time The time string in HH:MM:SS format.\n * @returns A new Date object with the time set.\n */\n const setTimeInDateObject = (dateToSetTimeIn: Date, time: string) => {\n let dateWithTime = new Date(dateToSetTimeIn);\n\n const [hours, minutes, seconds] = time.split(':');\n dateWithTime = setHours(dateWithTime, parseInt(hours, 10));\n dateWithTime = setMinutes(dateWithTime, parseInt(minutes, 10));\n dateWithTime = setSeconds(dateWithTime, parseInt(seconds, 10));\n return dateWithTime;\n };\n\n const isValidTimeString = (timeText: string) =>\n /^(?:[01]\\d|2[01234]):(?:[012345]\\d):(?:[012345]\\d)$/.test(timeText);\n\n /**\n * Checks if a time string is valid and within the min/max bounds if a date is provided.\n * @param timeText The time string to validate.\n * @param date The date string to check the time against.\n * @returns True if the time is valid, false otherwise.\n */\n const isValidTime = (timeText: string, date?: string) => {\n const isTimeAllowed = () => {\n if (date && isValidDate(date)) {\n const dateToCheckWithTime = setTimeInDateObject(new Date(date), timeText);\n // Check if date is between min/max bounds, if there are any\n if (\n (props.min && dateToCheckWithTime < setMilliseconds(props.min, 0)) ||\n (props.max && dateToCheckWithTime > setMilliseconds(props.max, 0))\n ) {\n return false;\n }\n }\n\n return true;\n };\n\n return isValidTimeString(timeText) && isTimeAllowed();\n };\n\n /**\n * Sets the time in a date object if the time is valid and the variant is not 'month'.\n * @param date The date object to modify.\n * @param time The time string to set.\n * @returns The modified date object or the original if time is not set.\n */\n const setTimeInDateRef = (date: Date, time: string) => {\n // Do not set time if month variant\n if (!time || !isValidTimeString(time) || props.variant === 'month') {\n return date;\n }\n\n return setTimeInDateObject(new Date(date), time);\n };\n\n const onDateInput = (selectedRange: BentoDateRangePickerValue) => {\n dateTextInput.startTime = formatTime(\n props.min && props.allowTimeInput && isSameDay(props.min, selectedRange.startDate)\n ? props.min\n : startOfDay(selectedRange.startDate)\n );\n dateTextInput.endTime = formatTime(\n props.max && props.allowTimeInput && isSameDay(props.max, selectedRange.endDate)\n ? props.max\n : endOfDay(selectedRange.endDate)\n );\n\n internalRangeDate.startDate = setTimeInDateRef(selectedRange.startDate, dateTextInput.startTime);\n internalRangeDate.endDate = setTimeInDateRef(selectedRange.endDate, dateTextInput.endTime);\n // Resetting internal range date when selecting a custom range through the calendar\n internalRangeDate.range = null;\n\n if (props.granularities) {\n // Reset saved ranges on input\n resetSavedRanges();\n }\n\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n };\n\n /**\n * Checks if a date string is in YYYY-MM-DD format and if the date is enabled.\n * @param dateText The date string to validate.\n * @returns True if the date is valid and enabled, false otherwise.\n */\n const isValidDate = (dateText: string) => {\n // Is date selectable\n const isDateEnabled = (date: Date) => {\n // Check if date is between or equal to min/max bounds\n // Set the time to the start of the day to disregard time\n if (\n (props.min && startOfDay(date) < startOfDay(props.min)) ||\n (props.max && startOfDay(date) > startOfDay(props.max))\n ) {\n return false;\n }\n\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled) {\n return !props.isDateDisabled(startOfDay(date));\n }\n\n return true;\n };\n\n // YYYY-MM-DD regex\n const dateRegex = /^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/;\n // Date matches text regex\n return dateRegex.test(dateText) && isDateEnabled(new Date(dateText));\n };\n\n /**\n * When mounted, set the input error states to true if the values are not valid\n */\n onMounted(() => {\n // Start date validation\n startDateError.value = !!(props.dateFormData.startDate && !isValidDate(props.dateFormData.startDate));\n\n // Start time validation\n if (props.allowTimeInput) {\n startTimeError.value = !!(\n props.dateFormData.startTime &&\n !isValidTime(props.dateFormData.startTime, props.dateFormData.startDate)\n );\n } else {\n startTimeError.value = false;\n }\n\n // End date validation\n endDateError.value = !!(props.dateFormData.endDate && !isValidDate(props.dateFormData.endDate));\n\n // End time validation\n if (props.allowTimeInput) {\n endTimeError.value = !!(\n props.dateFormData.endTime &&\n !isValidTime(props.dateFormData.endTime, props.dateFormData.endDate)\n );\n } else {\n endTimeError.value = false;\n }\n });\n\n const onStartDateSelected = (newStartDate: Date) => {\n dateTextInput.startDate = formatDate(newStartDate);\n if (!dateTextInput.startTime) {\n // Set the time to the beginning of the day\n dateTextInput.startTime = formatTime(newStartDate);\n } else if (startTimeError.value) {\n // Set the form time if it was previously set\n dateTextInput.startTime = props.dateFormData?.startTime;\n }\n\n // Reset errors\n startDateError.value = false;\n startTimeError.value = false;\n\n emit(DateRangePickerCalendarEvent.START_DATE_SELECTED, newStartDate);\n };\n\n const onEndDateSelected = (newEndDate: Date) => {\n dateTextInput.endDate = formatDate(newEndDate);\n if (!dateTextInput.endTime) {\n // Set the time to the end of the day\n dateTextInput.endTime = formatTime(endOfDay(newEndDate));\n } else if (endTimeError.value) {\n // Set the form time if it was previously set\n dateTextInput.endTime = props.dateFormData?.endTime;\n }\n\n // Reset errors\n endDateError.value = false;\n endTimeError.value = false;\n };\n\n const getDate = (keyName: keyof BentoDateRangePickerValue) => {\n const dateProp = (props.value as BentoDateRangePickerValue)[keyName];\n if (dateProp) {\n return dateProp;\n }\n\n if (props.dateFormData[keyName] && isValidDate(props.dateFormData[keyName])) {\n return new Date(props.dateFormData[keyName]);\n }\n\n return undefined;\n };\n\n const validateStartDate = debounce((startDateText: string) => {\n // Checks for YYYY-MM-DD format\n if (isValidDate(startDateText)) {\n let dateText = startDateText;\n\n startDateError.value = false;\n\n switch (selectedGranularity.value?.type) {\n case 'weekly':\n dateText = adjustStartDateInputForWeekly(\n startDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.startDate = dateText;\n break;\n case 'monthly':\n dateText = adjustStartDateInputForMonthly(\n startDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.startDate = dateText;\n break;\n case 'quarterly':\n dateText = adjustStartDateInputForQuarterly(\n startDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.startDate = dateText;\n break;\n case 'daily':\n default:\n break;\n }\n\n const startDate = parseDateTextToStartOfDay(dateText);\n internalRangeDate.startDate = setTimeInDateRef(startDate, dateTextInput.startTime);\n internalRangeDate.endDate = setTimeInDateRef(\n parseDateTextToStartOfDay(dateTextInput.endDate),\n dateTextInput.endTime\n );\n\n if (isValidDate(dateTextInput.endDate)) {\n internalRangeDate.endDate = setTimeInDateRef(\n parseDateTextToStartOfDay(dateTextInput.endDate),\n dateTextInput.endTime\n );\n }\n\n const endDate = getDate('endDate');\n\n // Resetting internal range date when selecting a custom range through the calendar\n internalRangeDate.range = null;\n\n emit(DateRangePickerCalendarEvent.FORM_DATE, {\n startDate,\n endDate,\n });\n\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n } else {\n // Indicate form error\n startDateError.value = true;\n // Emit Date picker calendar error\n emit(DateRangePickerCalendarEvent.ERROR, { ...dateTextInput });\n }\n }, FORM_INPUT_DEBOUNCE_TIME);\n\n const onStartDateInput = (startDateText: string) => {\n // Set the date as string when input through the form\n dateTextInput.startDate = formatDateInputValue(startDateText);\n validateStartDate(dateTextInput.startDate);\n };\n\n const validateEndDate = debounce((endDateText: string) => {\n // Checks for YYYY-MM-DD format\n if (isValidDate(endDateText)) {\n let dateText = endDateText;\n\n endDateError.value = false;\n\n switch (selectedGranularity.value?.type) {\n case 'weekly':\n dateText = adjustEndDateInputForWeekly(\n endDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.endDate = dateText;\n break;\n case 'monthly':\n dateText = adjustEndDateInputForMonthly(\n endDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.endDate = dateText;\n break;\n case 'quarterly':\n dateText = adjustEndDateInputForQuarterly(\n endDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.endDate = dateText;\n break;\n case 'daily':\n default:\n break;\n }\n\n // Format date string to Date object\n const endDate = parseDateTextToStartOfDay(dateText);\n internalRangeDate.endDate = setTimeInDateRef(endDate, dateTextInput.endTime);\n if (isValidDate(dateTextInput.startDate)) {\n internalRangeDate.startDate = setTimeInDateRef(\n parseDateTextToStartOfDay(dateTextInput.startDate),\n dateTextInput.startTime\n );\n }\n\n const startDate = getDate('startDate');\n\n // Resetting internal range date when selecting a custom range through the calendar\n internalRangeDate.range = null;\n\n emit(DateRangePickerCalendarEvent.FORM_DATE, {\n startDate,\n endDate,\n });\n\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n } else {\n // Indicate form error\n endDateError.value = true;\n // Emit Date picker calendar error\n emit(DateRangePickerCalendarEvent.ERROR, { ...dateTextInput });\n }\n }, FORM_INPUT_DEBOUNCE_TIME);\n\n const onEndDateInput = (endDateText: string) => {\n // Set the date as string when input through the form\n dateTextInput.endDate = formatDateInputValue(endDateText);\n validateEndDate(dateTextInput.endDate);\n };\n\n const onDateInputKeyDown = (event: KeyboardEvent) => {\n validateDateInput(event);\n };\n\n const validateStartTime = debounce((startTimeText: string) => {\n if (isValidTime(startTimeText, props.dateFormData.startDate)) {\n startTimeError.value = false;\n internalRangeDate.startDate = setTimeInDateRef(internalRangeDate.startDate, startTimeText);\n\n const endDate = getDate('endDate');\n\n emit(DateRangePickerCalendarEvent.FORM_DATE, {\n startDate: internalRangeDate.startDate,\n endDate,\n startTime: startTimeText,\n endTime: dateTextInput.endTime ?? props.dateFormData.endTime,\n });\n\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n } else {\n // Indicate form error\n startTimeError.value = true;\n // Emit Date picker calendar error\n emit(DateRangePickerCalendarEvent.ERROR, { ...dateTextInput });\n }\n });\n\n const validateEndTime = debounce((endTimeText: string) => {\n if (isValidTime(endTimeText, props.dateFormData.endDate)) {\n endTimeError.value = false;\n internalRangeDate.endDate = setTimeInDateRef(internalRangeDate.endDate, endTimeText);\n\n emit(DateRangePickerCalendarEvent.FORM_DATE, {\n startDate: internalRangeDate.startDate,\n endDate: internalRangeDate.endDate,\n startTime: dateTextInput.startTime ?? props.dateFormData.startTime,\n endTime: endTimeText,\n });\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n } else {\n // Indicate form error\n endTimeError.value = true;\n // Emit Date picker calendar error\n emit(DateRangePickerCalendarEvent.ERROR, { ...dateTextInput });\n }\n });\n\n const onStartTimeInput = (startTimeText: string) => {\n dateTextInput.startTime = formatTimeInputValue(startTimeText);\n validateStartTime(dateTextInput.startTime);\n };\n\n const onEndTimeInput = (endDateText: string) => {\n dateTextInput.endTime = formatTimeInputValue(endDateText);\n validateEndTime(dateTextInput.endTime);\n };\n\n const onTimeInputKeyDown = (event: KeyboardEvent) => {\n validateTimeInput(event);\n };\n\n const setInternalRange = (\n startDate: Date,\n endDate: Date,\n granularity?: CalendarGranularityType,\n range?: string\n ) => {\n internalRangeDate.startDate = startDate;\n internalRangeDate.endDate = endDate;\n\n if (granularity) {\n internalRangeDate.granularity = granularity;\n }\n\n if (range) {\n internalRangeDate.range = range;\n }\n };\n\n const onRangeSelectorInput = (newCustomRangeValue: string) => {\n const foundResult = props.quickSelectRanges?.find(({ value }) => value === newCustomRangeValue);\n\n if (foundResult) {\n resetSavedRanges();\n const date = foundResult.data;\n const newEndDate =\n date.endDate || (date.isRelativeToNow ? new Date(Date.now()) : endOfDay(new Date(Date.now())));\n // If the time difference between start and end dates is available,\n // calculating start date dynamically\n const newStartDate =\n date.isRelativeToNow && date.timeDifference\n ? new Date(newEndDate.getTime() - date.timeDifference)\n : date.startDate;\n\n // Set Form input Dates\n dateTextInput.endDate = formatDate(newEndDate);\n dateTextInput.startDate = formatDate(newStartDate);\n\n setInternalRange(newStartDate, newEndDate, null, newCustomRangeValue);\n\n if (props.granularities) {\n internalRangeDate.granularity = date.granularity || defaultGranularity.value;\n }\n\n // Set Form input time to quick select range time\n dateTextInput.startTime = formatTime(newStartDate);\n dateTextInput.endTime = formatTime(newEndDate);\n\n // Set calendar selection\n internalRangeDate.startDate = newStartDate;\n internalRangeDate.endDate = newEndDate;\n\n if (date.isRelativeToNow) {\n // Store this calculated start and end dates to be used in the selectedRangeSelectorValue logic\n calculatedIsRelativeToNowQuickSelectRanges.value = {\n ...calculatedIsRelativeToNowQuickSelectRanges.value,\n [newCustomRangeValue]: {\n startDate: newStartDate,\n endDate: newEndDate,\n },\n };\n }\n\n // Emit everytime the date range changes\n emit(DateRangePickerCalendarEvent.CUSTOM_RANGE, {\n ...foundResult.data,\n startDate: newStartDate,\n endDate: newEndDate,\n range: foundResult.value,\n });\n }\n };\n\n const adjustDate = {\n weekly: adjustDateForWeekly,\n monthly: adjustDateForMonthly,\n quarterly: adjustDateForQuarterly,\n };\n\n const onGranularityInput = (value: CalendarGranularityType) => {\n const previousValue = internalRangeDate.granularity;\n\n internalRangeDate.granularity = value;\n\n // Save previously selected range\n if (previousValue) {\n saveRange(previousValue, structuredClone(toRaw(internalRangeDate)));\n }\n\n if (internalRangeDate.startDate && internalRangeDate.endDate) {\n // Adjust date range based on new granularity\n switch (value) {\n case 'quarterly':\n case 'monthly':\n case 'weekly': {\n if (savedRanges[value]) {\n setInternalRange(savedRanges[value].startDate, savedRanges[value].endDate, value);\n break;\n }\n\n const { startDate, endDate } = adjustDate[value](\n internalRangeDate.startDate,\n internalRangeDate.endDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n setInternalRange(startDate, endDate, value);\n break;\n }\n case 'daily':\n if (savedRanges.daily) {\n setInternalRange(savedRanges.daily.startDate, savedRanges.daily.endDate, value);\n }\n break;\n default:\n break;\n }\n\n dateTextInput.startDate = formatDate(internalRangeDate.startDate);\n dateTextInput.endDate = formatDate(internalRangeDate.endDate);\n\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n }\n };\n\n return {\n // Values\n internalRangeDate,\n dateTextInput,\n endDateError,\n endTimeError,\n granularityItems,\n selectedGranularity,\n computedMinMax,\n selectedRangeSelectorValue,\n startDateError,\n startTimeError,\n quickSelectRangeDefaultItems,\n formInputWrapperConditionalClasses,\n\n // Methods\n hasSlot: useHasSlot(slots),\n t,\n\n // Events\n onDateInput,\n onDateInputKeyDown,\n onEndDateInput,\n onEndDateSelected,\n onEndTimeInput,\n onGranularityInput,\n onRangeSelectorInput,\n onStartDateInput,\n onStartDateSelected,\n onStartTimeInput,\n onTimeInputKeyDown,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-range-picker-calendar.scss\" />\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getQuarter} function options.\n */\n\n/**\n * @name getQuarter\n * @category Quarter Helpers\n * @summary Get the year quarter of the given date.\n *\n * @description\n * Get the year quarter of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The quarter\n *\n * @example\n * // Which quarter is 2 July 2014?\n * const result = getQuarter(new Date(2014, 6, 2));\n * //=> 3\n */\nexport function getQuarter(date, options) {\n const _date = toDate(date, options?.in);\n const quarter = Math.trunc(_date.getMonth() / 3) + 1;\n return quarter;\n}\n\n// Fallback for modularized imports:\nexport default getQuarter;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getYear} function options.\n */\n\n/**\n * @name getYear\n * @category Year Helpers\n * @summary Get the year of the given date.\n *\n * @description\n * Get the year of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The year\n *\n * @example\n * // Which year is 2 July 2014?\n * const result = getYear(new Date(2014, 6, 2))\n * //=> 2014\n */\nexport function getYear(date, options) {\n return toDate(date, options?.in).getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default getYear;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { startOfQuarter } from \"./startOfQuarter.js\";\n\n/**\n * The {@link isSameQuarter} function options.\n */\n\n/**\n * @name isSameQuarter\n * @category Quarter Helpers\n * @summary Are the given dates in the same quarter (and year)?\n *\n * @description\n * Are the given dates in the same quarter (and year)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same quarter (and year)\n *\n * @example\n * // Are 1 January 2014 and 8 March 2014 in the same quarter?\n * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8))\n * //=> true\n *\n * @example\n * // Are 1 January 2014 and 1 January 2015 in the same quarter?\n * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2015, 0, 1))\n * //=> false\n */\nexport function isSameQuarter(laterDate, earlierDate, options) {\n const [dateLeft_, dateRight_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return +startOfQuarter(dateLeft_) === +startOfQuarter(dateRight_);\n}\n\n// Fallback for modularized imports:\nexport default isSameQuarter;\n","import { computed, reactive } from 'vue';\nimport { getDateLocale } from '@/utils/ts/get-date-locale/get-date-locale';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { parseDateTextToStartOfDay } from '../utils/date-text-to-start-of-day';\nimport { type UseDateDisplayText } from './use-date-range-picker-calendar-text.types';\nimport { DateFormat } from '@/types/date-format';\nimport { type CalendarRangeDateValue } from '@/internal';\nimport { type DateRangePickerCalendarFormData } from '../components/date-range-picker-calendar/date-range-picker-calendar.types';\nimport { format } from 'date-fns/format';\nimport { getQuarter } from 'date-fns/getQuarter';\nimport { getYear } from 'date-fns/getYear';\nimport { isSameQuarter } from 'date-fns/isSameQuarter';\nimport messages from '../messages.json';\n\ntype MessageSchema = (typeof messages)['en-US'];\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Date Range Picker\n * @param {Ref<Date>} option.datePickerValue Ref to the datePickerValue set in the DateRangePicker component\n * @param {Ref<boolean>} option.isDateIncorrect Indicates if the date is correct or not\n * @param {Ref<DateRangePickerCalendarRangeSelectorItems>} option.quickSelectRanges Ref to the quick select date ranges (optional)\n * @param {?Ref<boolean>} option.isMonthVariant Indicates if the date range picker has variant \"month\"\n */\nexport const useDateRangePickerCalendarText: UseDateDisplayText<CalendarRangeDateValue> = ({\n datePickerValue,\n isDateIncorrect,\n quickSelectRanges,\n isMonthVariant,\n withTimeInput,\n placeholder,\n}) => {\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const locales = getDateLocale();\n\n const isValidDate = date => !!date && !isNaN(date.getTime());\n\n const formatDate = (date: Date, dateFormat: DateFormat) =>\n isValidDate(date)\n ? format(date, dateFormat, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n })\n : undefined;\n\n // Handle the form input text\n const textInputDisplayValue = reactive<DateRangePickerCalendarFormData>({\n startDate: formatDate(datePickerValue.value?.startDate, DateFormat.NUMERIC_DATE_YEAR_FIRST),\n endDate: formatDate(datePickerValue.value?.endDate, DateFormat.NUMERIC_DATE_YEAR_FIRST),\n startTime: formatDate(datePickerValue.value?.startDate, DateFormat.HOUR_MINUTE_SECONDS),\n endTime: formatDate(datePickerValue.value?.endDate, DateFormat.HOUR_MINUTE_SECONDS),\n });\n\n const dateDisplayValue = computed(() => {\n // Display incorrect date when there's an error with the input\n if (isDateIncorrect.value) {\n return `${textInputDisplayValue.startDate || ''} - ${textInputDisplayValue.endDate || ''}`;\n }\n\n // Display \"Select a date\" when there's no date selected or input\n if (!datePickerValue.value || (!datePickerValue.value.startDate && !datePickerValue.value.endDate)) {\n return placeholder?.value || (t('selectDateRange') as string);\n }\n\n if (quickSelectRanges.value?.length) {\n const customRangeSelected = quickSelectRanges.value.find(({ value }) => {\n return value === datePickerValue.value?.range;\n });\n\n if (customRangeSelected) {\n return customRangeSelected.label;\n }\n }\n\n if (datePickerValue.value.granularity === 'quarterly') {\n const { startDate, endDate } = datePickerValue.value;\n const startQuarter = t('quarter', { quarter: getQuarter(startDate), year: getYear(startDate) });\n\n // If a single quarter is selected, show it only (e.g.: `Q2 2024`)\n if (isSameQuarter(startDate, endDate)) {\n return startQuarter;\n }\n\n const endQuarter = t('quarter', { quarter: getQuarter(endDate), year: getYear(endDate) });\n return `${startQuarter} - ${endQuarter}`;\n }\n\n const { startDate, endDate, startTime, endTime } = textInputDisplayValue;\n const dateFormat = isMonthVariant?.value ? DateFormat.LONG_MONTH_YEAR : DateFormat.FULL_DATE_MONTH_FIRST;\n const formattedStateDate = formatDate(parseDateTextToStartOfDay(startDate), dateFormat);\n const formattedEndDate = formatDate(parseDateTextToStartOfDay(endDate), dateFormat);\n\n if (!withTimeInput.value) {\n return `${formattedStateDate} - ${formattedEndDate}`;\n }\n\n const startDisplay = [formattedStateDate, startTime].filter(Boolean).join(', ');\n const endDisplay = [formattedEndDate, endTime].filter(Boolean).join(', ');\n\n return `${startDisplay} - ${endDisplay}`;\n });\n\n const formatTextInputDisplayValue = () => '';\n\n return {\n // Values\n dateDisplayValue,\n textInputDisplayValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\n};\n","import type { FormField } from '../../types/form-field';\n\nimport {\n CalendarFirstDayOfWeek as BentoDateRangePickerFirstDayOfWeek,\n type CalendarGranularityConfig as BentoDateRangePickerGranularityConfig,\n type CalendarIsDateDisabled as BentoDateRangePickerIsDateDisabled,\n type CalendarRangeDateValue as BentoDateRangePickerValue,\n CalendarVariant as BentoDateRangePickerVariant,\n} from '@/internal/calendar/calendar.types';\nimport type { DateRangePickerCalendarRangeSelectorItems as BentoDateRangePickerQuickSelectRanges } from './components/date-range-picker-calendar/date-range-picker-calendar.types';\n\nexport {\n BentoDateRangePickerFirstDayOfWeek,\n type BentoDateRangePickerIsDateDisabled,\n type BentoDateRangePickerValue,\n type BentoDateRangePickerGranularityConfig,\n BentoDateRangePickerVariant,\n};\n\nexport enum BentoDateRangePickerEvent {\n INPUT = 'input',\n}\n\nexport interface BentoDateRangePickerProps extends FormField {\n /**\n * Allows user to enter time values in the form\n * @default false\n */\n allowTimeInput?: boolean;\n\n /**\n * Allows user to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n * @default 1\n */\n firstDayOfWeek?: BentoDateRangePickerFirstDayOfWeek | number;\n\n /**\n * A list of available granularities.\n * If present, the date picker will display a segmented control to change granularity.\n */\n granularities?: Array<BentoDateRangePickerGranularityConfig>;\n\n /**\n * Indicate if a date should be disabled or not\n */\n isDateDisabled?: BentoDateRangePickerIsDateDisabled;\n\n /**\n * Upon opening date range picker, end date's month will be pre-selected.\n * @default false\n */\n showEndDateOnOpen?: boolean;\n\n /**\n * Enables the range selector.\n * If provided, must be an array that sets the custom range dropdown items.\n */\n quickSelectRanges?: BentoDateRangePickerQuickSelectRanges;\n\n /**\n * Set a maximum number of dates to be selectable by the range.\n */\n maxRange?: number;\n\n /**\n * Sets a minimum limit for selectable dates - dates before `min` will not be selectable\n */\n min?: Date;\n\n /**\n * Sets a maximum limit for selectable dates - dates after `max` will not be selectable\n */\n max?: Date;\n\n /**\n * Number of months rendered on pane\n */\n numberOfMonths?: number;\n\n /**\n * Selected date\n */\n value?: BentoDateRangePickerValue | null;\n\n /**\n * The type of calendar to display. Defaults to showing days.\n */\n variant?: `${BentoDateRangePickerVariant}`;\n\n /**\n * Enables the date picker selection to persist until it is explicitly applied.\n * Displays a set of buttons: Apply and Cancel.\n * @deprecated This will be the default behaviour in v2.0.0.\n * @default false\n */\n hasActions?: boolean;\n}\n","<!-- TODO: Remove aria props as these are part of JSX elements /vue/types/jsx.d.ts -->\n<!-- eslint-disable vue/attribute-hyphenation -->\n<template>\n <div v-bento-click-outside-directive=\"closeDateRangePicker\" class=\"b-date-range-picker\">\n <!-- Label -->\n <field-label\n v-if=\"label\"\n :id=\"labelId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n\n <!-- Input -->\n <div @keydown.enter=\"onEnterPressedOverInput\">\n <dropdown-input-default\n ref=\"inputContainerRef\"\n always-combobox-is-input\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDateRangePickerOpen\"\n :aria-labelledby=\"label ? labelId : null\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n :is-invalid=\"!!errorMessage || shouldDisplayError\"\n :open=\"isDateRangePickerOpen\"\n :display-value=\"displayedDateValue\"\n :readonly=\"isReadOnly\"\n @open=\"openDateRangePicker\"\n @clear=\"clearDateRangePickerValue\"\n @close=\"closeDateRangePicker\"\n />\n </div>\n\n <!-- Error Messages -->\n <error-message\n v-if=\"shouldDisplayError\"\n :id=\"dateErrorId\"\n :error-message=\"t('provideDateInAFormat')\"\n class=\"b-date-range-picker__error-message\"\n />\n <error-message\n v-if=\"!!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-date-range-picker__error-message\"\n />\n\n <!-- Description -->\n <bento-typography\n v-if=\"description\"\n :id=\"descriptionId\"\n class=\"b-date-range-picker__description\"\n :class=\"descriptionConditionalClasses\"\n el=\"span\"\n >\n {{ description }}\n </bento-typography>\n\n <!-- Calendar container -->\n <bento-popover\n v-if=\"inputContainerRef\"\n :id=\"datePickerContainerId\"\n class=\"b-date-range-picker__container\"\n :open=\"isDateRangePickerOpen\"\n :target-element=\"inputContainerRef\"\n :aria-label=\"popoverAriaLabel\"\n position=\"bottom-start\"\n without-space\n fit-content\n trap-all\n @keydown.esc.native=\"closeDateRangePicker\"\n >\n <date-range-picker-calendar\n :allow-time-input=\"withTimeInput\"\n :quick-select-ranges=\"adjustedQuickSelectRanges\"\n :value=\"value\"\n :first-day-of-week=\"firstDayOfWeek\"\n :granularities=\"granularities\"\n :is-date-disabled=\"isDateDisabled\"\n :max-range=\"maxRange\"\n :min=\"min\"\n :max=\"max\"\n :number-of-months=\"numberOfMonths\"\n :show-end-date-on-open=\"showEndDateOnOpen\"\n :date-form-data=\"displayedTextInputValue\"\n :variant=\"variant\"\n @custom-range=\"onRangeSelectorInput\"\n @input=\"onDateRangePickerInput\"\n @error=\"onDateRangePickerError\"\n @form-date=\"onDateRangePickerFormDateInputUpdate\"\n >\n <template v-if=\"hasActions\" #actions>\n <bento-divider />\n\n <div class=\"b-date-range-picker__footer\">\n <bento-button-actions\n :actions=\"rangePickerButtonActions\"\n :layout=\"BentoButtonActionsLayout.SPACE_BETWEEN\"\n />\n </div>\n </template>\n </date-range-picker-calendar>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, ref, toRaw, toRef, watch } from 'vue';\n\n // Components\n import { BentoButtonActions, BentoButtonActionsLayout } from '../button';\n import { BentoDivider } from '@/components/divider';\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '../typography';\n import { DateRangePickerCalendar } from './components/date-range-picker-calendar';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { getDateLocale } from '@/utils/ts/get-date-locale/get-date-locale';\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { format } from 'date-fns/format';\n\n // Composables\n import { useDateRangePickerCalendarText } from './composables/use-date-range-picker-calendar-text';\n import { useFormLayoutFieldLoading } from '@/composables';\n\n // Directives\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives';\n\n // Types\n import {\n BentoDateRangePickerEvent,\n type BentoDateRangePickerProps,\n type BentoDateRangePickerValue,\n } from './date-range-picker.types';\n import { DateFormat } from '@/types/date-format';\n import {\n type DateRangePickerCalendarFormData,\n type DateRangePickerCalendarRangeSelectorItem,\n } from './components/date-range-picker-calendar/date-range-picker-calendar.types';\n\n import { deprecate } from '@/utils/ts/deprecate';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const emit = defineEmits([BentoDateRangePickerEvent.INPUT]);\n const props = defineProps({\n description: { default: undefined },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: undefined },\n optional: { type: Boolean, default: false },\n placeholder: { default: null },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n allowTimeInput: { type: Boolean },\n firstDayOfWeek: { default: 1 },\n granularities: null,\n isDateDisabled: { default: undefined },\n showEndDateOnOpen: { type: Boolean, default: false },\n quickSelectRanges: { default: undefined },\n maxRange: { default: null },\n min: { default: null },\n max: { default: null },\n numberOfMonths: { default: undefined },\n value: { default: null },\n variant: { default: undefined },\n hasActions: { type: Boolean, default: false }\n});\n\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const locales = getDateLocale();\n const datePickerContainerId = generateUid('bento-date-range-picker-container');\n const labelId = generateUid('bento-date-range-picker-label');\n const descriptionId = generateUid('bento-date-range-picker-description');\n const errorId = generateUid('bento-date-range-picker-error');\n const dateErrorId = generateUid('bento-date-range-picker-date-error');\n const popoverAriaLabel = computed(() => props.label || t('dateRangePicker', { name: datePickerContainerId }));\n\n const adjustedQuickSelectRanges = computed<Array<DateRangePickerCalendarRangeSelectorItem>>(() => {\n return (\n props?.quickSelectRanges &&\n props.quickSelectRanges.map((range: DateRangePickerCalendarRangeSelectorItem) => {\n const timeDiff = !range.data.endDate\n ? new Date(Date.now()).getTime() - range.data.startDate.getTime()\n : undefined;\n return {\n ...range,\n data: {\n ...range.data,\n // Adding timeDifference to calculate an up-to-date endDate on range selection\n timeDifference: timeDiff,\n },\n };\n })\n );\n });\n\n const isDateIncorrect = ref(false);\n const inputContainerRef = ref(null);\n const isDateRangePickerOpen = ref(false);\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n watch(\n () => props.disabled,\n () => {\n // Close date picker popover if it's opened when it's disabled\n if (props.disabled && isDateRangePickerOpen.value) {\n isDateRangePickerOpen.value = false;\n }\n }\n );\n\n const shouldDisplayError = computed(() => {\n if (props.hasActions) {\n return !isApplyDisabled.value && isDateIncorrect.value;\n }\n\n return isDateIncorrect.value;\n });\n\n const descriptionConditionalClasses = computed(() => ({\n 'b-date-range-picker__description--error': !!props.errorMessage || shouldDisplayError.value,\n }));\n\n const isMonthVariant = computed(() => props.variant === 'month');\n const withTimeInput = computed(() => props.allowTimeInput && props.variant !== 'month');\n\n const { dateDisplayValue, textInputDisplayValue, formatTextInputDisplayValue } = useDateRangePickerCalendarText({\n datePickerValue: toRef(props, 'value'),\n isDateIncorrect,\n quickSelectRanges: adjustedQuickSelectRanges,\n isMonthVariant,\n withTimeInput,\n placeholder: toRef(props, 'placeholder'),\n });\n\n const ariaDescribedBy = computed(\n () =>\n `${props.description ? descriptionId : ''} ${props.errorMessage ? errorId : ''} ${\n isDateIncorrect.value ? dateErrorId : ''\n }`.trim() || null\n );\n\n const closeDateRangePicker = () => {\n isDateRangePickerOpen.value = false;\n };\n\n const openDateRangePicker = () => {\n isDateRangePickerOpen.value = true;\n formatTextInputDisplayValue();\n };\n\n /*\n * Used when `hasActions` is set to true\n */\n const localDateDisplayValue = ref(dateDisplayValue.value);\n const localTextInputDisplayValue = ref<DateRangePickerCalendarFormData>(\n // textInputDisplayValue is a reactive object\n structuredClone(toRaw(textInputDisplayValue))\n );\n const selectedDate = ref<BentoDateRangePickerValue>(props.value);\n const isApplyDisabled = ref(true);\n\n const displayedTextInputValue = computed(() =>\n props.hasActions ? localTextInputDisplayValue.value : textInputDisplayValue\n );\n\n const displayedDateValue = computed(() =>\n props.hasActions ? localDateDisplayValue.value : dateDisplayValue.value\n );\n\n onMounted(() => {\n if (!props.hasActions) {\n deprecate(\n 'BentoDateRangePicker \"hasActions\" property',\n `Set the BentoDateRangePicker \"hasActions\" property true which will display the \"Apply\" and \"Cancel\" buttons.\n This will be the default behavior in the v2 and \"hasActions\" will be removed.`,\n '2.0.0'\n );\n }\n\n if (\n props.granularities &&\n props.variant !== 'month' &&\n props.granularities.find(({ type }) => type === 'quarterly')\n ) {\n throw new Error('Quarterly granularity is only supported by BentoDateRangePicker with variant: \"month\"');\n }\n });\n\n // On update for the value we need to update all the locally stored data\n watch(\n () => props.value,\n () => {\n localDateDisplayValue.value = dateDisplayValue.value;\n localTextInputDisplayValue.value = structuredClone(toRaw(textInputDisplayValue));\n }\n );\n\n const rangePickerButtonActions = computed(() => [\n {\n title: t('apply'),\n event: () => {\n emit(BentoDateRangePickerEvent.INPUT, selectedDate.value);\n closeDateRangePicker();\n\n isApplyDisabled.value = true;\n },\n disabled: isApplyDisabled.value,\n },\n {\n title: t('cancel'),\n event: closeDateRangePicker,\n },\n ]);\n\n watch(selectedDate, date => {\n // skip emit until Apply button is clicked\n if (props.hasActions) {\n isApplyDisabled.value = isDateIncorrect.value;\n\n return;\n }\n\n emit(BentoDateRangePickerEvent.INPUT, date);\n });\n\n const onDateRangePickerInput = (selectedRange: BentoDateRangePickerValue) => {\n // Reset the errors when the date is correct\n isDateIncorrect.value = false;\n\n const formatDate = (date: Date, dateFormat: DateFormat) =>\n date\n ? format(date, dateFormat, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n })\n : undefined;\n\n textInputDisplayValue.startDate = formatDate(selectedRange.startDate, DateFormat.NUMERIC_DATE_YEAR_FIRST);\n textInputDisplayValue.endDate = formatDate(selectedRange.endDate, DateFormat.NUMERIC_DATE_YEAR_FIRST);\n textInputDisplayValue.startTime = formatDate(selectedRange.startDate, DateFormat.HOUR_MINUTE_SECONDS);\n textInputDisplayValue.endTime = formatDate(selectedRange.endDate, DateFormat.HOUR_MINUTE_SECONDS);\n\n selectedDate.value = selectedRange;\n };\n\n const clearDateRangePickerValue = async () => {\n if (isDateIncorrect.value) {\n isDateIncorrect.value = false;\n }\n\n selectedDate.value = null;\n };\n\n const onEnterPressedOverInput = () => {\n // open the datepicker\n if (!isDateRangePickerOpen.value) {\n isDateRangePickerOpen.value = true;\n\n return;\n }\n\n // Close the date picker if the date is correct and it is open\n if (!isDateIncorrect.value) {\n isDateRangePickerOpen.value = false;\n }\n };\n\n const onDateRangePickerFormDateInputUpdate = (dateFormDate: DateRangePickerCalendarFormData) => {\n isDateIncorrect.value = false;\n\n if (dateFormDate.startTime) {\n textInputDisplayValue.startTime = dateFormDate.startTime;\n }\n\n if (dateFormDate.endTime) {\n textInputDisplayValue.endTime = dateFormDate.endTime;\n }\n };\n\n const onDateRangePickerError = dateTextInput => {\n isDateIncorrect.value = true;\n textInputDisplayValue.startDate = dateTextInput.startDate;\n textInputDisplayValue.endDate = dateTextInput.endDate;\n\n // Remove current date range selection\n selectedDate.value = { startDate: null, endDate: null };\n };\n\n const onRangeSelectorInput = (quickSelectRanges?: BentoDateRangePickerValue) => {\n if (quickSelectRanges) {\n const formatDateTime = (date: Date, dateFormat: DateFormat) =>\n date\n ? format(date, dateFormat, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n })\n : undefined;\n\n const formatDate = (date: Date) =>\n format(date, DateFormat.NUMERIC_DATE_YEAR_FIRST, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n });\n textInputDisplayValue.startDate = formatDate(quickSelectRanges.startDate);\n textInputDisplayValue.endDate = formatDate(quickSelectRanges.endDate);\n textInputDisplayValue.startTime = formatDateTime(\n quickSelectRanges.startDate,\n DateFormat.HOUR_MINUTE_SECONDS\n );\n textInputDisplayValue.endTime = formatDateTime(quickSelectRanges.endDate, DateFormat.HOUR_MINUTE_SECONDS);\n\n selectedDate.value = quickSelectRanges;\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Date range picker selector.\n *\n * @example\n * import { BentoDateRangePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDateRangePicker },\n * template: `\n * <bento-date-range-picker\n * label=\"Label\"\n * description=\"Supporting text\"\n * required\n * optional\n * disabled\n * @input=\"onDateChanged\"\n * v-model=\"selectedDate\"\n * />\n * `,\n * setup() {\n * const selectedDate = ref(new Date()); // reactive({ startDate: new Date(), endDate: new Date() })\n * return {\n * selectedDate,\n * }\n * }\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-date-range-picker',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-range-picker.scss\" />\n"],"names":["parseDateTextToStartOfDay","dateText","startOfDay","year","month","day","s","addQuarters","date","amount","options","addMonths","subQuarters","useGranularMinMaxDate","firstDayOfWeek","minimumDate","maximumDate","granularity","min","max","endOfDay","startOfMin","startOfWeek","isSameDay","addDays","endOfWeek","endOfMax","subDays","startOfMonth","endOfMonth","subMonths","startOfQuarter","endOfQuarter","useGranularityMemory","savedRanges","reactive","type","range","DateRangePickerCalendarEvent","DateRangePickerCalendarEvent2","validDigitRegex","hourRegex","minuteRegex","validateTimeInput","event","selectionStart","allowedKeys","isValidKey","isValidColon","formatTimeInputValue","value","formattedValue","secondToLastDigit","lastDigit","setHours","hours","_date","toDate","setMinutes","minutes","date_","setSeconds","seconds","startOfSecond","isSameSecond","laterDate","earlierDate","isEqual","leftDate","rightDate","isToday","constructFrom","constructNow","setMilliseconds","milliseconds","FORM_INPUT_DEBOUNCE_TIME","RANGE_SELECTOR_CUSTOM_RANGE_KEY","_sfc_main$1","defineComponent","messages$1","BentoDropdown","BentoInputField","BentoSegmentedControl","BentoTypography","Calendar","props","emit","slots","locale","t","useI18n","locales","getDateLocale","calculatedIsRelativeToNowQuickSelectRanges","ref","defaultGranularity","computed","internalRangeDate","_a","_b","_c","_d","deserializeDate","selectedRangeSelectorValue","data","newlyCalculatedQuickSelectDates","formInputWrapperConditionalClasses","quickSelectRangeDefaultItems","selectedGranularity","granularityItems","disabled","getGranularCalendarLimits","computedMinMax","adjustDateForQuarterly","adjustDateForMonthly","adjustDateForWeekly","adjustStartDateInputForWeekly","adjustEndDateInputForWeekly","adjustStartDateInputForMonthly","adjustEndDateInputForMonthly","adjustStartDateInputForQuarterly","adjustEndDateInputForQuarterly","useGranularityAdjustments","saveRange","resetSavedRanges","formatDate","dateToFormat","format","DateFormat","formatTime","startDateError","endDateError","startTimeError","endTimeError","dateTextInput","setTimeInDateObject","dateToSetTimeIn","time","dateWithTime","isValidTimeString","timeText","isValidTime","isTimeAllowed","isValidDate","dateToCheckWithTime","setTimeInDateRef","onDateInput","selectedRange","isDateEnabled","onMounted","onStartDateSelected","newStartDate","onEndDateSelected","newEndDate","getDate","keyName","dateProp","validateStartDate","debounce","startDateText","startDate","endDate","onStartDateInput","formatDateInputValue","validateEndDate","endDateText","onEndDateInput","onDateInputKeyDown","validateDateInput","validateStartTime","startTimeText","validateEndTime","endTimeText","onStartTimeInput","onEndTimeInput","onTimeInputKeyDown","setInternalRange","onRangeSelectorInput","newCustomRangeValue","foundResult","adjustDate","onGranularityInput","previousValue","toRaw","useHasSlot","getQuarter","getYear","isSameQuarter","dateLeft_","dateRight_","normalizeDates","useDateRangePickerCalendarText","datePickerValue","isDateIncorrect","quickSelectRanges","isMonthVariant","withTimeInput","placeholder","dateFormat","textInputDisplayValue","customRangeSelected","startDate2","endDate2","startQuarter","endQuarter","startTime","endTime","formattedStateDate","formattedEndDate","startDisplay","endDisplay","BentoDateRangePickerEvent","BentoDateRangePickerEvent2","__default__","messages","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","adjustedQuickSelectRanges","timeDiff","inputContainerRef","isDateRangePickerOpen","isReadOnly","useFormLayoutFieldLoading","toRef","watch","shouldDisplayError","isApplyDisabled","descriptionConditionalClasses","dateDisplayValue","formatTextInputDisplayValue","ariaDescribedBy","closeDateRangePicker","openDateRangePicker","localDateDisplayValue","localTextInputDisplayValue","selectedDate","displayedTextInputValue","displayedDateValue","deprecate","rangePickerButtonActions","dateFormDate","formatDateTime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAAAA,EAAAC,GAAA;AACH,MAAAA,KAAA;AACI,WAAAC,EAAA,oBAAA,KAAA,CAAA;AAGJ,QAAA,CAAAC,GAAAC,GAAAC,CAAA,IAAAJ,EAAA,MAAA,GAAA,EAAA,IAAA,CAAAK,MAAA,SAAAA,GAAA,EAAA,CAAA;AACA,SAAA,IAAA,KAAAH,GAAAC,IAAA,GAAAC,CAAA;AACJ;ACSO,SAAAE,GAAAC,GAAAC,GAAAC,GAAA;AACP,SAAAC,GAAAH,GAAAC,IAAA,GAAAC,CAAA;AACA;ACFO,SAAAE,GAAAJ,GAAAC,GAAAC,GAAA;AACP,SAAAH,GAAAC,GAAA,IAAAE,CAAA;AACA;ACNO,MAAAG,KAAA,CAAA;AAAA,EAAsD,gBAAAC;AAAA,EACzD,KAAAC;AAAA,EACK,KAAAC;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AA,UAAA,gBAAAU,EAAA,UAAA,GAAA,EAAA,KAAAP,EAAA;AAAA,UACa,CAAA;AAAA;AAElE,QAAA4G,EAAA,YAAA1E,EAAAqE,EAAA,SAAA,GACAK,EAAA,UAAA1E,EAAAqE,EAAA,OAAA,GACAK,EAAA,YAAA+C;AAAA,UAAkCpD,EAAA;AAAA,UACZlE,EAAA;AAAA,QACP,GAEfuE,EAAA,UAAA+C,EAAApD,EAAA,SAAAlE,EAAA,mBAAA,GAEAgH,EAAA,QAAA9C;AAAA,MAAqB;AAAA,IACzB;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1,2,7,8,9,10,11,12,13,14,16,17,18]}
1
+ {"version":3,"file":"date-range-picker.NAG_5i8I.js","sources":["../../src/components/date-range-picker/utils/date-text-to-start-of-day.ts","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addQuarters.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subQuarters.js","../../src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.ts","../../src/components/date-range-picker/composables/use-granularity-memory.ts","../../src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.types.ts","../../src/utils/ts/time-input.ts","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setHours.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMinutes.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setSeconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfSecond.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameSecond.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isEqual.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isToday.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMilliseconds.js","../../src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getQuarter.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getYear.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameQuarter.js","../../src/components/date-range-picker/composables/use-date-range-picker-calendar-text.ts","../../src/components/date-range-picker/date-range-picker.types.ts","../../src/components/date-range-picker/date-range-picker.vue"],"sourcesContent":["import { startOfDay } from 'date-fns/startOfDay';\n\n/**\n * Parses an ISO date string and returns a Date set to the\n * start of that calendar day (00:00:00) in the system’s local time zone.\n *\n * Uses the numeric Date constructor `new Date(year, monthIndex, day)`\n * which interprets its arguments as local time.\n *\n * @param dateText - A date in `YYYY-MM-DD` format.\n * @returns A `Date` at the local start of the specified day.\n */\nexport function parseDateTextToStartOfDay(dateText?: string) {\n if (dateText == null) {\n return startOfDay(new Date());\n }\n\n const [year, month, day] = dateText.split('-').map(s => parseInt(s, 10));\n return new Date(year, month - 1, day);\n}\n","import { addMonths } from \"./addMonths.js\";\n\n/**\n * The {@link addQuarters} function options.\n */\n\n/**\n * @name addQuarters\n * @category Quarter Helpers\n * @summary Add the specified number of year quarters to the given date.\n *\n * @description\n * Add the specified number of year quarters to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of quarters to be added.\n * @param options - An object with options\n *\n * @returns The new date with the quarters added\n *\n * @example\n * // Add 1 quarter to 1 September 2014:\n * const result = addQuarters(new Date(2014, 8, 1), 1)\n * //=; Mon Dec 01 2014 00:00:00\n */\nexport function addQuarters(date, amount, options) {\n return addMonths(date, amount * 3, options);\n}\n\n// Fallback for modularized imports:\nexport default addQuarters;\n","import { addQuarters } from \"./addQuarters.js\";\n\n/**\n * The {@link subQuarters} function options.\n */\n\n/**\n * @name subQuarters\n * @category Quarter Helpers\n * @summary Subtract the specified number of year quarters from the given date.\n *\n * @description\n * Subtract the specified number of year quarters from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of quarters to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the quarters subtracted\n *\n * @example\n * // Subtract 3 quarters from 1 September 2014:\n * const result = subQuarters(new Date(2014, 8, 1), 3)\n * //=> Sun Dec 01 2013 00:00:00\n */\nexport function subQuarters(date, amount, options) {\n return addQuarters(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subQuarters;\n","import { addDays } from 'date-fns/addDays';\nimport { addMonths } from 'date-fns/addMonths';\nimport { addQuarters } from 'date-fns/addQuarters';\nimport { endOfDay } from 'date-fns/endOfDay';\nimport { endOfMonth } from 'date-fns/endOfMonth';\nimport { endOfQuarter } from 'date-fns/endOfQuarter';\nimport { endOfWeek } from 'date-fns/endOfWeek';\nimport { isSameDay } from 'date-fns/isSameDay';\nimport { startOfDay } from 'date-fns/startOfDay';\nimport { startOfMonth } from 'date-fns/startOfMonth';\nimport { startOfQuarter } from 'date-fns/startOfQuarter';\nimport { startOfWeek } from 'date-fns/startOfWeek';\nimport { subDays } from 'date-fns/subDays';\nimport { subMonths } from 'date-fns/subMonths';\nimport { subQuarters } from 'date-fns/subQuarters';\n\nimport type { CalendarGranularityConfig } from '../../../calendar.types';\nimport type { UseGranularMinMaxDate } from './granular-min-max-date.types';\n\n/**\n * Provides utility function to set calendar min/max dates based on the granularity selected.\n * @param props Configured min/max dates, and the day the week starts on.\n * @returns Function to calculate calendar limits.\n */\nexport const useGranularMinMaxDate: UseGranularMinMaxDate = ({\n firstDayOfWeek,\n min: minimumDate,\n max: maximumDate,\n}) => {\n const getGranularCalendarLimits = (granularity: CalendarGranularityConfig) => {\n if (!minimumDate && !maximumDate) {\n return { min: null, max: null };\n }\n\n let min = minimumDate ? startOfDay(minimumDate) : null;\n let max = maximumDate ? endOfDay(maximumDate) : null;\n\n if (granularity?.type === 'weekly') {\n if (granularity.earliest) {\n min = startOfDay(granularity.earliest);\n } else if (min) {\n const startOfMin = startOfWeek(min, { weekStartsOn: firstDayOfWeek });\n\n // If the minimum is in the middle of a week, set to the end (only allow full weeks)\n if (!isSameDay(min, startOfMin)) {\n min = startOfDay(addDays(endOfWeek(min, { weekStartsOn: firstDayOfWeek }), 1));\n }\n }\n\n if (granularity.latest) {\n max = endOfDay(granularity.latest);\n } else if (max) {\n const endOfMax = endOfWeek(max, { weekStartsOn: firstDayOfWeek });\n\n // If the maximum is in the middle of a week, set to the end of last week (only allow full weeks)\n if (!isSameDay(max, endOfMax)) {\n max = endOfDay(subDays(startOfWeek(max, { weekStartsOn: firstDayOfWeek }), 1));\n }\n }\n }\n\n if (granularity?.type === 'monthly') {\n if (granularity.earliest) {\n min = startOfDay(granularity.earliest);\n } else if (min) {\n const startOfMin = startOfMonth(min);\n\n // If the minimum is in the middle of a month, set to the start of next month (only allow full month)\n if (!isSameDay(min, startOfMin)) {\n min = startOfMonth(addMonths(min, 1));\n }\n }\n\n if (granularity.latest) {\n max = endOfDay(granularity.latest);\n } else if (max) {\n const endOfMax = endOfMonth(max);\n\n // If the maximum is in the middle of a month, set to the end of last month (only allow full months)\n if (!isSameDay(max, endOfMax)) {\n max = endOfMonth(subMonths(max, 1));\n }\n }\n }\n\n if (granularity?.type === 'quarterly') {\n if (granularity.earliest) {\n min = startOfQuarter(granularity.earliest);\n } else if (min) {\n const startOfMin = startOfQuarter(min);\n\n // If the minimum is in the middle of a quarter, set to the start of next quarter (only allow full fiscal quarters)\n if (!isSameDay(min, startOfMin)) {\n min = startOfQuarter(addQuarters(min, 1));\n }\n }\n\n if (granularity.latest) {\n max = endOfDay(granularity.latest);\n } else if (max) {\n const endOfMax = endOfQuarter(max);\n\n // If the maximum is in the middle of a quarter, set to the end of last quarter (only allow full fiscal quarters)\n if (!isSameDay(max, endOfMax)) {\n max = endOfQuarter(subQuarters(max, 1));\n }\n }\n }\n\n return { min, max };\n };\n\n return { getGranularCalendarLimits };\n};\n","import { reactive } from 'vue';\n\nimport type { CalendarGranularityType } from '../../internal/calendar/calendar.types';\nimport type { UseGranularityMemory } from './use-granularity-memory.types';\n\n/**\n * Provides utility property and functions to store date ranges based on granularity.\n * This is used to revert back to the previously selected range when users switch between granularities\n * @returns Saved date ranges per granularity, and functions to save/reset ranges.\n */\nexport const useGranularityMemory: UseGranularityMemory = () => {\n const savedRanges = reactive<{\n daily: { startDate: Date; endDate: Date } | null;\n weekly: { startDate: Date; endDate: Date } | null;\n monthly: { startDate: Date; endDate: Date } | null;\n quarterly: { startDate: Date; endDate: Date } | null;\n }>({\n daily: null,\n weekly: null,\n monthly: null,\n quarterly: null,\n });\n\n const saveRange = (type: CalendarGranularityType, range: { startDate: Date; endDate: Date }) => {\n savedRanges[type] = range;\n };\n\n const resetSavedRanges = () => {\n savedRanges.daily = null;\n savedRanges.weekly = null;\n savedRanges.monthly = null;\n savedRanges.quarterly = null;\n };\n\n return {\n savedRanges,\n\n saveRange,\n resetSavedRanges,\n };\n};\n","import { type CalendarGranularityType } from '@/internal/calendar/calendar.types';\n\nexport interface DateRangePickerCalendarFormData {\n startDate: string;\n endDate: string;\n startTime?: string;\n endTime?: string;\n granularity?: CalendarGranularityType;\n}\n\nexport enum DateRangePickerCalendarEvent {\n CUSTOM_RANGE = 'custom-range',\n INPUT = 'input',\n ERROR = 'error',\n FORM_DATE = 'form-date',\n START_DATE_SELECTED = 'start-date-selected',\n}\n\nexport interface DateRangePickerCalendarRangeSelectorItem {\n label: string;\n value: string;\n data: {\n startDate: Date;\n endDate?: Date;\n granularity?: CalendarGranularityType;\n isRelativeToNow?: boolean;\n timeDifference?: number;\n };\n}\n\nexport type DateRangePickerCalendarRangeSelectorItems = Array<DateRangePickerCalendarRangeSelectorItem>;\n","const validDigitRegex = /[\\d]/;\n\nconst hourRegex = /^\\d{2}$/;\nconst minuteRegex = /^\\d{2}:\\d{2}$/;\n\nexport const validateTimeInput = (event: KeyboardEvent) => {\n const { selectionStart } = event.target as HTMLInputElement;\n\n const allowedKeys = ['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight'];\n const isValidKey = validDigitRegex.test(event.key) || allowedKeys.includes(event.key);\n const isValidColon = [1, 2, 4, 5].includes(selectionStart) && event.key === ':';\n\n if (!isValidKey && !isValidColon) {\n event.preventDefault();\n }\n};\n\nexport const formatTimeInputValue = (value: string) => {\n if (!value) {\n return value;\n }\n\n let formattedValue = value;\n\n // Format if the first value is bigger than 2, because it can't be bigger than 24 hours\n if (formattedValue.length === 1 && parseInt(value, 10) > 2) {\n return `0${formattedValue}:`;\n }\n\n const [secondToLastDigit, lastDigit] = formattedValue.slice(-2);\n if ([2, 5].includes(formattedValue.length) && lastDigit === ':') {\n formattedValue = `${formattedValue.slice(0, formattedValue.length - 2)}0${secondToLastDigit}`;\n }\n\n // Add `:` after hour/minute\n if (hourRegex.test(formattedValue) || minuteRegex.test(formattedValue)) {\n formattedValue += ':';\n }\n return formattedValue;\n};\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setHours} function options.\n */\n\n/**\n * @name setHours\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param hours - The hours of the new date\n * @param options - An object with options\n *\n * @returns The new date with the hours set\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * const result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\nexport function setHours(date, hours, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(hours);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setHours;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMinutes} function options.\n */\n\n/**\n * @name setMinutes\n * @category Minute Helpers\n * @summary Set the minutes to the given date.\n *\n * @description\n * Set the minutes to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, returned from the context function, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param minutes - The minutes of the new date\n * @param options - An object with options\n *\n * @returns The new date with the minutes set\n *\n * @example\n * // Set 45 minutes to 1 September 2014 11:30:40:\n * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:45:40\n */\nexport function setMinutes(date, minutes, options) {\n const date_ = toDate(date, options?.in);\n date_.setMinutes(minutes);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default setMinutes;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setSeconds} function options.\n */\n\n/**\n * @name setSeconds\n * @category Second Helpers\n * @summary Set the seconds to the given date, with context support.\n *\n * @description\n * Set the seconds to the given date, with an optional context for time zone specification.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param seconds - The seconds of the new date\n * @param options - An object with options\n *\n * @returns The new date with the seconds set\n *\n * @example\n * // Set 45 seconds to 1 September 2014 11:30:40:\n * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:30:45\n */\nexport function setSeconds(date, seconds, options) {\n const _date = toDate(date, options?.in);\n _date.setSeconds(seconds);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setSeconds;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfSecond} function options.\n */\n\n/**\n * @name startOfSecond\n * @category Second Helpers\n * @summary Return the start of a second for the given date.\n *\n * @description\n * Return the start of a second for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a second\n *\n * @example\n * // The start of a second for 1 December 2014 22:15:45.400:\n * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.000\n */\nexport function startOfSecond(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setMilliseconds(0);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default startOfSecond;\n","import { startOfSecond } from \"./startOfSecond.js\";\n\n/**\n * @name isSameSecond\n * @category Second Helpers\n * @summary Are the given dates in the same second (and hour and day)?\n *\n * @description\n * Are the given dates in the same second (and hour and day)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n *\n * @returns The dates are in the same second (and hour and day)\n *\n * @example\n * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500 in the same second?\n * const result = isSameSecond(\n * new Date(2014, 8, 4, 6, 30, 15),\n * new Date(2014, 8, 4, 6, 30, 15, 500)\n * )\n * //=> true\n *\n * @example\n * // Are 4 September 2014 06:00:15.000 and 4 September 2014 06:01.15.000 in the same second?\n * const result = isSameSecond(\n * new Date(2014, 8, 4, 6, 0, 15),\n * new Date(2014, 8, 4, 6, 1, 15)\n * )\n * //=> false\n *\n * @example\n * // Are 4 September 2014 06:00:15.000 and 5 September 2014 06:00.15.000 in the same second?\n * const result = isSameSecond(\n * new Date(2014, 8, 4, 6, 0, 15),\n * new Date(2014, 8, 5, 6, 0, 15)\n * )\n * //=> false\n */\nexport function isSameSecond(laterDate, earlierDate) {\n return +startOfSecond(laterDate) === +startOfSecond(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default isSameSecond;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The dates are equal\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * const result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\nexport function isEqual(leftDate, rightDate) {\n return +toDate(leftDate) === +toDate(rightDate);\n}\n\n// Fallback for modularized imports:\nexport default isEqual;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { constructNow } from \"./constructNow.js\";\nimport { isSameDay } from \"./isSameDay.js\";\n\n/**\n * The {@link isToday} function options.\n */\n\n/**\n * @name isToday\n * @category Day Helpers\n * @summary Is the given date today?\n * @pure false\n *\n * @description\n * Is the given date today?\n *\n * @param date - The date to check\n * @param options - An object with options\n *\n * @returns The date is today\n *\n * @example\n * // If today is 6 October 2014, is 6 October 14:00:00 today?\n * const result = isToday(new Date(2014, 9, 6, 14, 0))\n * //=> true\n */\nexport function isToday(date, options) {\n return isSameDay(\n constructFrom(options?.in || date, date),\n constructNow(options?.in || date),\n );\n}\n\n// Fallback for modularized imports:\nexport default isToday;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMilliseconds} function options.\n */\n\n/**\n * @name setMilliseconds\n * @category Millisecond Helpers\n * @summary Set the milliseconds to the given date.\n *\n * @description\n * Set the milliseconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param milliseconds - The milliseconds of the new date\n * @param options - The options\n *\n * @returns The new date with the milliseconds set\n *\n * @example\n * // Set 300 milliseconds to 1 September 2014 11:30:40.500:\n * const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)\n * //=> Mon Sep 01 2014 11:30:40.300\n */\nexport function setMilliseconds(date, milliseconds, options) {\n const _date = toDate(date, options?.in);\n _date.setMilliseconds(milliseconds);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setMilliseconds;\n","<template>\n <div class=\"b-date-range-picker-calendar\">\n <!-- Form -->\n <div class=\"b-date-range-picker-calendar__form-container\">\n <div class=\"b-date-range-picker-calendar__form\">\n <template v-if=\"hasSlot('title')\">\n <slot name=\"title\" />\n </template>\n\n <bento-dropdown\n v-if=\"quickSelectRanges\"\n :aria-label=\"t('customRange')\"\n :items=\"quickSelectRangeDefaultItems\"\n :value=\"selectedRangeSelectorValue\"\n @input=\"onRangeSelectorInput\"\n />\n\n <bento-segmented-control\n v-if=\"granularities\"\n :items=\"granularityItems\"\n :model-value=\"internalRangeDate.granularity\"\n full-width\n @update:model-value=\"onGranularityInput\"\n >\n </bento-segmented-control>\n <div>\n <bento-typography stronger el=\"span\" class=\"b-date-range-picker-calendar__label\">\n From\n </bento-typography>\n <div :class=\"formInputWrapperConditionalClasses\">\n <bento-input-field\n :aria-label=\"t('dateFrom')\"\n :value=\"dateTextInput.startDate\"\n :error=\"startDateError\"\n class=\"b-date-range-picker-calendar__form-input\"\n @input=\"onStartDateInput\"\n @keydown=\"onDateInputKeyDown\"\n >\n <template #description>YYYY-MM-DD</template>\n </bento-input-field>\n\n <bento-input-field\n v-if=\"allowTimeInput\"\n :aria-label=\"t('timeFrom')\"\n :value=\"dateTextInput.startTime\"\n :error=\"startTimeError\"\n class=\"b-date-range-picker-calendar__form-input\"\n @input=\"onStartTimeInput\"\n @keydown=\"onTimeInputKeyDown\"\n >\n <template #description>HH:MM:SS</template>\n </bento-input-field>\n </div>\n </div>\n\n <div>\n <bento-typography stronger el=\"span\" class=\"b-date-range-picker-calendar__label\">\n To\n </bento-typography>\n <div :class=\"formInputWrapperConditionalClasses\">\n <bento-input-field\n class=\"b-date-range-picker-calendar__form-input\"\n :aria-label=\"t('dateTo')\"\n :value=\"dateTextInput.endDate\"\n :error=\"endDateError\"\n @input=\"onEndDateInput\"\n @keydown=\"onDateInputKeyDown\"\n >\n <template #description>YYYY-MM-DD</template>\n </bento-input-field>\n\n <bento-input-field\n v-if=\"allowTimeInput\"\n :aria-label=\"t('timeTo')\"\n :value=\"dateTextInput.endTime\"\n :error=\"endTimeError\"\n class=\"b-date-range-picker-calendar__form-input\"\n @input=\"onEndTimeInput\"\n @keydown=\"onTimeInputKeyDown\"\n >\n <template #description>HH:MM:SS</template>\n </bento-input-field>\n </div>\n </div>\n </div>\n\n <div v-if=\"hasSlot('actions')\">\n <slot name=\"actions\" />\n </div>\n </div>\n\n <!-- Calendar -->\n <div class=\"b-date-range-picker-calendar__calendars-container\">\n <calendar\n :value=\"internalRangeDate\"\n :first-day-of-week=\"firstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :max-range=\"maxRange\"\n :min=\"computedMinMax.min\"\n :max=\"computedMinMax.max\"\n :number-of-months=\"numberOfMonths\"\n :show-end-date-on-open=\"showEndDateOnOpen\"\n :granularity=\"selectedGranularity\"\n :variant=\"variant\"\n is-range\n @input=\"onDateInput\"\n @start-date-selected=\"onStartDateSelected\"\n @end-date-selected=\"onEndDateSelected\"\n />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, reactive, ref, toRaw } from 'vue';\n import { Calendar, type CalendarGranularityType } from '@/internal';\n import { BentoTypography } from '@/components/typography';\n import { BentoInputField } from '@/components/input-field';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n import { BentoSegmentedControl, type BentoSegmentedControlItem } from '@/components/segmented-control';\n import { getDateLocale } from '@/utils/ts/get-date-locale/get-date-locale';\n import { useI18n } from '@/utils/ts/i18n';\n import { parseDateTextToStartOfDay } from '../../utils/date-text-to-start-of-day';\n import { debounce } from '@/utils/ts/debounce';\n import { useHasSlot } from '@/composables';\n import { useGranularityAdjustments } from '@/components/internal/calendar/composables/use-granularity-adjustments';\n import { useGranularMinMaxDate } from '@/components/internal/calendar/components/calendar-month/composables/granular-min-max-date';\n import { useGranularityMemory } from '../../composables/use-granularity-memory';\n import { formatDateInputValue, validateDateInput } from '@/utils/ts/date-input';\n import {\n DateRangePickerCalendarEvent,\n type DateRangePickerCalendarFormData,\n type DateRangePickerCalendarRangeSelectorItems,\n } from './date-range-picker-calendar.types';\n import type {\n BentoDateRangePickerGranularityConfig,\n BentoDateRangePickerValue,\n } from '../../date-range-picker.types';\n import { DateFormat } from '@/types/date-format';\n import { formatTimeInputValue, validateTimeInput } from '@/utils/ts/time-input';\n import { endOfDay } from 'date-fns/endOfDay';\n import { format } from 'date-fns/format';\n import { setHours } from 'date-fns/setHours';\n import { setMinutes } from 'date-fns/setMinutes';\n import { setSeconds } from 'date-fns/setSeconds';\n import { startOfDay } from 'date-fns/startOfDay';\n import { isSameSecond } from 'date-fns/isSameSecond';\n import { isSameDay } from 'date-fns/isSameDay';\n import { isEqual } from 'date-fns/isEqual';\n import { isToday } from 'date-fns/isToday';\n import { setMilliseconds } from 'date-fns/setMilliseconds';\n import messages from './messages.json';\n\n const FORM_INPUT_DEBOUNCE_TIME = 300;\n const RANGE_SELECTOR_CUSTOM_RANGE_KEY = 'customRange';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Calendar for range dates. Contains the logic to handle the range forms.\n *\n * @example\n * import DatePickerCalendarRange from './date-range-picker-calendar.vue';\n *\n * export default {\n * components: { DatePickerCalendarRange },\n * template: `\n * <date-range-picker-calendar\n * :value=\"{startDate: new Date(), endDate: new Date() }\"\n * :first-day-of-week=\"BentoDatePickerFirstDayOfWeek.MONDAY\"\n * :is-date-disabled=\"(date: Date) => boolean\"\n * :number-of-months=\"2\"\n * @input=\"({ startDate, endDate }) => void\"\n * />\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'date-range-picker-calendar',\n components: {\n BentoDropdown,\n BentoInputField,\n BentoSegmentedControl,\n BentoTypography,\n Calendar,\n },\n props: {\n /**\n * Allows user to enter time values in the form\n */\n allowTimeInput: { type: Boolean, default: false },\n\n /**\n * Ranges form persistance data\n */\n dateFormData: {\n type: Object as PropType<DateRangePickerCalendarFormData>,\n default: () => ({ startDate: undefined, endDate: undefined, startTime: undefined, endTime: undefined }),\n },\n\n /**\n * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n */\n firstDayOfWeek: Calendar.props.firstDayOfWeek,\n\n /**\n * A list of available granularities.\n * If present, the date picker will display a segmented control to change granularity.\n */\n granularities: {\n type: Array as PropType<Array<BentoDateRangePickerGranularityConfig>>,\n default: null,\n },\n\n /**\n * Indicate if a date should be disabled or not\n */\n isDateDisabled: Calendar.props.isDateDisabled,\n\n /**\n * Set a maximum number of dates to be selectable by the range.\n */\n maxRange: Calendar.props.maxRange,\n\n /**\n * Sets a minimum limit for selectable dates - dates before `min` will not be selectable\n */\n min: Calendar.props.min,\n\n /**\n * Sets a maximum limit for selectable dates - dates after `max` will not be selectable\n */\n max: Calendar.props.max,\n\n /**\n * Number of months rendered on pane\n */\n numberOfMonths: Calendar.props.numberOfMonths,\n\n /**\n * Displays the end date's month when the calendar is opened. Defaults to false i.e. the start date's month is displayed.\n */\n showEndDateOnOpen: { type: Boolean, default: false },\n\n /**\n * Enables the custom range selector.\n * If provided, must be an array that sets the custom range dropdown items. Items are of the structure:\n * `label` - label of custom range item.\n * `value` - a unique key of the custom range item.\n * `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.\n */\n quickSelectRanges: {\n type: Array as PropType<DateRangePickerCalendarRangeSelectorItems>,\n default: undefined,\n },\n\n /**\n * Selected date\n */\n value: { type: Object as PropType<BentoDateRangePickerValue>, default: undefined },\n\n /**\n * The type of calendar to display. Defaults to showing days.\n */\n variant: Calendar.props.variant,\n },\n emits: [\n DateRangePickerCalendarEvent.CUSTOM_RANGE,\n DateRangePickerCalendarEvent.INPUT,\n DateRangePickerCalendarEvent.ERROR,\n DateRangePickerCalendarEvent.FORM_DATE,\n DateRangePickerCalendarEvent.START_DATE_SELECTED,\n ],\n setup(props, { emit, slots }) {\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const locales = getDateLocale();\n const calculatedIsRelativeToNowQuickSelectRanges = ref({});\n\n const defaultGranularity = computed(() => (props.variant === 'month' ? 'monthly' : 'daily'));\n\n const internalRangeDate = reactive<BentoDateRangePickerValue>({\n startDate: props.value?.startDate,\n endDate: props.value?.endDate,\n range: props.value?.range,\n ...(props.granularities\n ? {\n granularity: props.value?.granularity || defaultGranularity.value,\n }\n : {}),\n });\n\n /**\n * Deserializes a date to transform it to a UTC standard so it can be compared regardless of timezone.\n * src: https://stackoverflow.com/a/38050824\n * @param date Date to deserialize/normalize for comparisson\n */\n function deserializeDate(date: Date) {\n if (!date) {\n return null;\n }\n return new Date(\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds()\n );\n }\n\n /**\n * Currently range selector dropdown item that is selected.\n * The logic will try and find in each range item:\n * - If an endDate does not exist, then only check if the startDate day matches and if today's day matches.\n * - if time input has been enabled, then check if the seconds match.\n * - if an endDate does exist then just check if the startDate day and the endDate day match.\n */\n const selectedRangeSelectorValue = computed(() => {\n return (\n // eslint-disable-next-line consistent-return\n props?.quickSelectRanges?.find(({ value, data }) => {\n if (!data.endDate) {\n // Check if this quick select range is explicitly marked as \"relative to now\"\n if (data.isRelativeToNow) {\n // Retrieve previously calculated start/end dates for this relative range.\n // We use these if the user has already clicked on this time of quick range\n const newlyCalculatedQuickSelectDates =\n calculatedIsRelativeToNowQuickSelectRanges.value?.[value];\n return newlyCalculatedQuickSelectDates\n ? isEqual(\n deserializeDate(newlyCalculatedQuickSelectDates.startDate),\n deserializeDate(internalRangeDate.startDate)\n ) &&\n isEqual(\n deserializeDate(newlyCalculatedQuickSelectDates.endDate),\n deserializeDate(internalRangeDate.endDate)\n )\n : // If not stored calculated dates, fall back to comparing the quick select item's value\n // with the internal range's stored range identifier.\n value === internalRangeDate.range;\n }\n // This block handles quick select ranges that do not have an endDate\n // AND are NOT explicitly marked as 'isRelativeToNow'.\n // This means the endDate will be today at the end of the day\n return (\n isEqual(\n deserializeDate(data.startDate),\n deserializeDate(internalRangeDate.startDate)\n ) &&\n isEqual(\n deserializeDate(internalRangeDate.endDate),\n deserializeDate(endOfDay(internalRangeDate.endDate))\n ) &&\n isToday(deserializeDate(internalRangeDate.endDate)) &&\n (props.granularities ? data.granularity === internalRangeDate.granularity : true)\n );\n }\n\n if (props.allowTimeInput) {\n const res =\n isSameSecond(\n deserializeDate(data.startDate),\n deserializeDate(internalRangeDate.startDate)\n ) &&\n isSameSecond(\n deserializeDate(data.endDate),\n deserializeDate(internalRangeDate.endDate)\n ) &&\n (props.granularities ? data.granularity === internalRangeDate.granularity : true);\n return res;\n }\n\n if (data.endDate) {\n return (\n isSameDay(data.startDate, internalRangeDate.startDate) &&\n isSameDay(data.endDate, internalRangeDate.endDate) &&\n (props.granularities ? data.granularity === internalRangeDate.granularity : true)\n );\n }\n })?.value ?? RANGE_SELECTOR_CUSTOM_RANGE_KEY\n );\n });\n const formInputWrapperConditionalClasses = computed(() => ({\n 'b-date-range-picker-calendar__form-input-wrapper': props.allowTimeInput,\n }));\n const quickSelectRangeDefaultItems = computed(() => [\n { label: t('customRange'), value: RANGE_SELECTOR_CUSTOM_RANGE_KEY },\n ...(props.quickSelectRanges ? props.quickSelectRanges : []),\n ]);\n\n const selectedGranularity = computed(\n () => props.granularities?.find(({ type }) => type === internalRangeDate.granularity) || null\n );\n\n const granularityItems = computed<Array<BentoSegmentedControlItem>>(\n () =>\n props.granularities?.map(({ type, disabled }) => ({\n label: t(type),\n value: type,\n disabled,\n })) ?? []\n );\n\n const { getGranularCalendarLimits } = useGranularMinMaxDate(props);\n\n const computedMinMax = computed(() =>\n props.granularities\n ? getGranularCalendarLimits(selectedGranularity.value)\n : { min: props.min ? startOfDay(props.min) : null, max: props.max ? endOfDay(props.max) : null }\n );\n\n const {\n adjustDateForQuarterly,\n adjustDateForMonthly,\n adjustDateForWeekly,\n adjustStartDateInputForWeekly,\n adjustEndDateInputForWeekly,\n adjustStartDateInputForMonthly,\n adjustEndDateInputForMonthly,\n adjustStartDateInputForQuarterly,\n adjustEndDateInputForQuarterly,\n } = useGranularityAdjustments(props.firstDayOfWeek);\n const { savedRanges, saveRange, resetSavedRanges } = useGranularityMemory();\n\n /**\n * Format date to a string value in format yyyy-MM-dd\n * @param {Date} dateToFormat Date to be formatted\n */\n const formatDate = (dateToFormat?: Date) => {\n if (!dateToFormat) {\n return '';\n }\n return format(dateToFormat, DateFormat.NUMERIC_DATE_YEAR_FIRST, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n });\n };\n\n const formatTime = (dateToFormat?: Date) => {\n if (!dateToFormat) {\n return '';\n }\n\n return format(dateToFormat, DateFormat.HOUR_MINUTE_SECONDS, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n });\n };\n\n // Form error flags\n const startDateError = ref(false);\n const endDateError = ref(false);\n const startTimeError = ref(false);\n const endTimeError = ref(false);\n\n // Form input text used in range variant\n const dateTextInput = reactive({\n startDate: props.dateFormData.startDate,\n endDate: props.dateFormData.endDate,\n startTime: props.dateFormData.startTime,\n endTime: props.dateFormData.endTime,\n });\n\n /**\n * Sets the time of a date object from a time string.\n * @param dateToSetTimeIn The date object to set the time in.\n * @param time The time string in HH:MM:SS format.\n * @returns A new Date object with the time set.\n */\n const setTimeInDateObject = (dateToSetTimeIn: Date, time: string) => {\n let dateWithTime = new Date(dateToSetTimeIn);\n\n const [hours, minutes, seconds] = time.split(':');\n dateWithTime = setHours(dateWithTime, parseInt(hours, 10));\n dateWithTime = setMinutes(dateWithTime, parseInt(minutes, 10));\n dateWithTime = setSeconds(dateWithTime, parseInt(seconds, 10));\n return dateWithTime;\n };\n\n const isValidTimeString = (timeText: string) =>\n /^(?:[01]\\d|2[01234]):(?:[012345]\\d):(?:[012345]\\d)$/.test(timeText);\n\n /**\n * Checks if a time string is valid and within the min/max bounds if a date is provided.\n * @param timeText The time string to validate.\n * @param date The date string to check the time against.\n * @returns True if the time is valid, false otherwise.\n */\n const isValidTime = (timeText: string, date?: string) => {\n const isTimeAllowed = () => {\n if (date && isValidDate(date)) {\n const dateToCheckWithTime = setTimeInDateObject(new Date(date), timeText);\n // Check if date is between min/max bounds, if there are any\n if (\n (props.min && dateToCheckWithTime < setMilliseconds(props.min, 0)) ||\n (props.max && dateToCheckWithTime > setMilliseconds(props.max, 0))\n ) {\n return false;\n }\n }\n\n return true;\n };\n\n return isValidTimeString(timeText) && isTimeAllowed();\n };\n\n /**\n * Sets the time in a date object if the time is valid and the variant is not 'month'.\n * @param date The date object to modify.\n * @param time The time string to set.\n * @returns The modified date object or the original if time is not set.\n */\n const setTimeInDateRef = (date: Date, time: string) => {\n // Do not set time if month variant\n if (!time || !isValidTimeString(time) || props.variant === 'month') {\n return date;\n }\n\n return setTimeInDateObject(new Date(date), time);\n };\n\n const onDateInput = (selectedRange: BentoDateRangePickerValue) => {\n dateTextInput.startTime = formatTime(\n props.min && props.allowTimeInput && isSameDay(props.min, selectedRange.startDate)\n ? props.min\n : startOfDay(selectedRange.startDate)\n );\n dateTextInput.endTime = formatTime(\n props.max && props.allowTimeInput && isSameDay(props.max, selectedRange.endDate)\n ? props.max\n : endOfDay(selectedRange.endDate)\n );\n\n internalRangeDate.startDate = setTimeInDateRef(selectedRange.startDate, dateTextInput.startTime);\n internalRangeDate.endDate = setTimeInDateRef(selectedRange.endDate, dateTextInput.endTime);\n // Resetting internal range date when selecting a custom range through the calendar\n internalRangeDate.range = null;\n\n if (props.granularities) {\n // Reset saved ranges on input\n resetSavedRanges();\n }\n\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n };\n\n /**\n * Checks if a date string is in YYYY-MM-DD format and if the date is enabled.\n * @param dateText The date string to validate.\n * @returns True if the date is valid and enabled, false otherwise.\n */\n const isValidDate = (dateText: string) => {\n // Is date selectable\n const isDateEnabled = (date: Date) => {\n // Check if date is between or equal to min/max bounds\n // Set the time to the start of the day to disregard time\n if (\n (props.min && startOfDay(date) < startOfDay(props.min)) ||\n (props.max && startOfDay(date) > startOfDay(props.max))\n ) {\n return false;\n }\n\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled) {\n return !props.isDateDisabled(startOfDay(date));\n }\n\n return true;\n };\n\n // YYYY-MM-DD regex\n const dateRegex = /^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/;\n // Date matches text regex\n return dateRegex.test(dateText) && isDateEnabled(new Date(dateText));\n };\n\n /**\n * When mounted, set the input error states to true if the values are not valid\n */\n onMounted(() => {\n // Start date validation\n startDateError.value = !!(props.dateFormData.startDate && !isValidDate(props.dateFormData.startDate));\n\n // Start time validation\n if (props.allowTimeInput) {\n startTimeError.value = !!(\n props.dateFormData.startTime &&\n !isValidTime(props.dateFormData.startTime, props.dateFormData.startDate)\n );\n } else {\n startTimeError.value = false;\n }\n\n // End date validation\n endDateError.value = !!(props.dateFormData.endDate && !isValidDate(props.dateFormData.endDate));\n\n // End time validation\n if (props.allowTimeInput) {\n endTimeError.value = !!(\n props.dateFormData.endTime &&\n !isValidTime(props.dateFormData.endTime, props.dateFormData.endDate)\n );\n } else {\n endTimeError.value = false;\n }\n });\n\n const onStartDateSelected = (newStartDate: Date) => {\n dateTextInput.startDate = formatDate(newStartDate);\n if (!dateTextInput.startTime) {\n // Set the time to the beginning of the day\n dateTextInput.startTime = formatTime(newStartDate);\n } else if (startTimeError.value) {\n // Set the form time if it was previously set\n dateTextInput.startTime = props.dateFormData?.startTime;\n }\n\n // Reset errors\n startDateError.value = false;\n startTimeError.value = false;\n\n emit(DateRangePickerCalendarEvent.START_DATE_SELECTED, newStartDate);\n };\n\n const onEndDateSelected = (newEndDate: Date) => {\n dateTextInput.endDate = formatDate(newEndDate);\n if (!dateTextInput.endTime) {\n // Set the time to the end of the day\n dateTextInput.endTime = formatTime(endOfDay(newEndDate));\n } else if (endTimeError.value) {\n // Set the form time if it was previously set\n dateTextInput.endTime = props.dateFormData?.endTime;\n }\n\n // Reset errors\n endDateError.value = false;\n endTimeError.value = false;\n };\n\n const getDate = (keyName: keyof BentoDateRangePickerValue) => {\n const dateProp = (props.value as BentoDateRangePickerValue)[keyName];\n if (dateProp) {\n return dateProp;\n }\n\n if (props.dateFormData[keyName] && isValidDate(props.dateFormData[keyName])) {\n return new Date(props.dateFormData[keyName]);\n }\n\n return undefined;\n };\n\n const validateStartDate = debounce((startDateText: string) => {\n // Checks for YYYY-MM-DD format\n if (isValidDate(startDateText)) {\n let dateText = startDateText;\n\n startDateError.value = false;\n\n switch (selectedGranularity.value?.type) {\n case 'weekly':\n dateText = adjustStartDateInputForWeekly(\n startDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.startDate = dateText;\n break;\n case 'monthly':\n dateText = adjustStartDateInputForMonthly(\n startDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.startDate = dateText;\n break;\n case 'quarterly':\n dateText = adjustStartDateInputForQuarterly(\n startDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.startDate = dateText;\n break;\n case 'daily':\n default:\n break;\n }\n\n const startDate = parseDateTextToStartOfDay(dateText);\n internalRangeDate.startDate = setTimeInDateRef(startDate, dateTextInput.startTime);\n internalRangeDate.endDate = setTimeInDateRef(\n parseDateTextToStartOfDay(dateTextInput.endDate),\n dateTextInput.endTime\n );\n\n if (isValidDate(dateTextInput.endDate)) {\n internalRangeDate.endDate = setTimeInDateRef(\n parseDateTextToStartOfDay(dateTextInput.endDate),\n dateTextInput.endTime\n );\n }\n\n const endDate = getDate('endDate');\n\n // Resetting internal range date when selecting a custom range through the calendar\n internalRangeDate.range = null;\n\n emit(DateRangePickerCalendarEvent.FORM_DATE, {\n startDate,\n endDate,\n });\n\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n } else {\n // Indicate form error\n startDateError.value = true;\n // Emit Date picker calendar error\n emit(DateRangePickerCalendarEvent.ERROR, { ...dateTextInput });\n }\n }, FORM_INPUT_DEBOUNCE_TIME);\n\n const onStartDateInput = (startDateText: string) => {\n // Set the date as string when input through the form\n dateTextInput.startDate = formatDateInputValue(startDateText);\n validateStartDate(dateTextInput.startDate);\n };\n\n const validateEndDate = debounce((endDateText: string) => {\n // Checks for YYYY-MM-DD format\n if (isValidDate(endDateText)) {\n let dateText = endDateText;\n\n endDateError.value = false;\n\n switch (selectedGranularity.value?.type) {\n case 'weekly':\n dateText = adjustEndDateInputForWeekly(\n endDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.endDate = dateText;\n break;\n case 'monthly':\n dateText = adjustEndDateInputForMonthly(\n endDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.endDate = dateText;\n break;\n case 'quarterly':\n dateText = adjustEndDateInputForQuarterly(\n endDateText,\n formatDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n dateTextInput.endDate = dateText;\n break;\n case 'daily':\n default:\n break;\n }\n\n // Format date string to Date object\n const endDate = parseDateTextToStartOfDay(dateText);\n internalRangeDate.endDate = setTimeInDateRef(endDate, dateTextInput.endTime);\n if (isValidDate(dateTextInput.startDate)) {\n internalRangeDate.startDate = setTimeInDateRef(\n parseDateTextToStartOfDay(dateTextInput.startDate),\n dateTextInput.startTime\n );\n }\n\n const startDate = getDate('startDate');\n\n // Resetting internal range date when selecting a custom range through the calendar\n internalRangeDate.range = null;\n\n emit(DateRangePickerCalendarEvent.FORM_DATE, {\n startDate,\n endDate,\n });\n\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n } else {\n // Indicate form error\n endDateError.value = true;\n // Emit Date picker calendar error\n emit(DateRangePickerCalendarEvent.ERROR, { ...dateTextInput });\n }\n }, FORM_INPUT_DEBOUNCE_TIME);\n\n const onEndDateInput = (endDateText: string) => {\n // Set the date as string when input through the form\n dateTextInput.endDate = formatDateInputValue(endDateText);\n validateEndDate(dateTextInput.endDate);\n };\n\n const onDateInputKeyDown = (event: KeyboardEvent) => {\n validateDateInput(event);\n };\n\n const validateStartTime = debounce((startTimeText: string) => {\n if (isValidTime(startTimeText, props.dateFormData.startDate)) {\n startTimeError.value = false;\n internalRangeDate.startDate = setTimeInDateRef(internalRangeDate.startDate, startTimeText);\n\n const endDate = getDate('endDate');\n\n emit(DateRangePickerCalendarEvent.FORM_DATE, {\n startDate: internalRangeDate.startDate,\n endDate,\n startTime: startTimeText,\n endTime: dateTextInput.endTime ?? props.dateFormData.endTime,\n });\n\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n } else {\n // Indicate form error\n startTimeError.value = true;\n // Emit Date picker calendar error\n emit(DateRangePickerCalendarEvent.ERROR, { ...dateTextInput });\n }\n });\n\n const validateEndTime = debounce((endTimeText: string) => {\n if (isValidTime(endTimeText, props.dateFormData.endDate)) {\n endTimeError.value = false;\n internalRangeDate.endDate = setTimeInDateRef(internalRangeDate.endDate, endTimeText);\n\n emit(DateRangePickerCalendarEvent.FORM_DATE, {\n startDate: internalRangeDate.startDate,\n endDate: internalRangeDate.endDate,\n startTime: dateTextInput.startTime ?? props.dateFormData.startTime,\n endTime: endTimeText,\n });\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n } else {\n // Indicate form error\n endTimeError.value = true;\n // Emit Date picker calendar error\n emit(DateRangePickerCalendarEvent.ERROR, { ...dateTextInput });\n }\n });\n\n const onStartTimeInput = (startTimeText: string) => {\n dateTextInput.startTime = formatTimeInputValue(startTimeText);\n validateStartTime(dateTextInput.startTime);\n };\n\n const onEndTimeInput = (endDateText: string) => {\n dateTextInput.endTime = formatTimeInputValue(endDateText);\n validateEndTime(dateTextInput.endTime);\n };\n\n const onTimeInputKeyDown = (event: KeyboardEvent) => {\n validateTimeInput(event);\n };\n\n const setInternalRange = (\n startDate: Date,\n endDate: Date,\n granularity?: CalendarGranularityType,\n range?: string\n ) => {\n internalRangeDate.startDate = startDate;\n internalRangeDate.endDate = endDate;\n\n if (granularity) {\n internalRangeDate.granularity = granularity;\n }\n\n if (range) {\n internalRangeDate.range = range;\n }\n };\n\n const onRangeSelectorInput = (newCustomRangeValue: string) => {\n const foundResult = props.quickSelectRanges?.find(({ value }) => value === newCustomRangeValue);\n\n if (foundResult) {\n resetSavedRanges();\n const date = foundResult.data;\n const newEndDate =\n date.endDate || (date.isRelativeToNow ? new Date(Date.now()) : endOfDay(new Date(Date.now())));\n // If the time difference between start and end dates is available,\n // calculating start date dynamically\n const newStartDate =\n date.isRelativeToNow && date.timeDifference\n ? new Date(newEndDate.getTime() - date.timeDifference)\n : date.startDate;\n\n // Set Form input Dates\n dateTextInput.endDate = formatDate(newEndDate);\n dateTextInput.startDate = formatDate(newStartDate);\n\n setInternalRange(newStartDate, newEndDate, null, newCustomRangeValue);\n\n if (props.granularities) {\n internalRangeDate.granularity = date.granularity || defaultGranularity.value;\n }\n\n // Set Form input time to quick select range time\n dateTextInput.startTime = formatTime(newStartDate);\n dateTextInput.endTime = formatTime(newEndDate);\n\n // Set calendar selection\n internalRangeDate.startDate = newStartDate;\n internalRangeDate.endDate = newEndDate;\n\n if (date.isRelativeToNow) {\n // Store this calculated start and end dates to be used in the selectedRangeSelectorValue logic\n calculatedIsRelativeToNowQuickSelectRanges.value = {\n ...calculatedIsRelativeToNowQuickSelectRanges.value,\n [newCustomRangeValue]: {\n startDate: newStartDate,\n endDate: newEndDate,\n },\n };\n }\n\n // Emit everytime the date range changes\n emit(DateRangePickerCalendarEvent.CUSTOM_RANGE, {\n ...foundResult.data,\n startDate: newStartDate,\n endDate: newEndDate,\n range: foundResult.value,\n });\n }\n };\n\n const adjustDate = {\n weekly: adjustDateForWeekly,\n monthly: adjustDateForMonthly,\n quarterly: adjustDateForQuarterly,\n };\n\n const onGranularityInput = (value: CalendarGranularityType) => {\n const previousValue = internalRangeDate.granularity;\n\n internalRangeDate.granularity = value;\n\n // Save previously selected range\n if (previousValue) {\n saveRange(previousValue, structuredClone(toRaw(internalRangeDate)));\n }\n\n if (internalRangeDate.startDate && internalRangeDate.endDate) {\n // Adjust date range based on new granularity\n switch (value) {\n case 'quarterly':\n case 'monthly':\n case 'weekly': {\n if (savedRanges[value]) {\n setInternalRange(savedRanges[value].startDate, savedRanges[value].endDate, value);\n break;\n }\n\n const { startDate, endDate } = adjustDate[value](\n internalRangeDate.startDate,\n internalRangeDate.endDate,\n computedMinMax.value.min,\n computedMinMax.value.max\n );\n setInternalRange(startDate, endDate, value);\n break;\n }\n case 'daily':\n if (savedRanges.daily) {\n setInternalRange(savedRanges.daily.startDate, savedRanges.daily.endDate, value);\n }\n break;\n default:\n break;\n }\n\n dateTextInput.startDate = formatDate(internalRangeDate.startDate);\n dateTextInput.endDate = formatDate(internalRangeDate.endDate);\n\n emit(DateRangePickerCalendarEvent.INPUT, {\n ...internalRangeDate,\n range: selectedRangeSelectorValue.value,\n });\n }\n };\n\n return {\n // Values\n internalRangeDate,\n dateTextInput,\n endDateError,\n endTimeError,\n granularityItems,\n selectedGranularity,\n computedMinMax,\n selectedRangeSelectorValue,\n startDateError,\n startTimeError,\n quickSelectRangeDefaultItems,\n formInputWrapperConditionalClasses,\n\n // Methods\n hasSlot: useHasSlot(slots),\n t,\n\n // Events\n onDateInput,\n onDateInputKeyDown,\n onEndDateInput,\n onEndDateSelected,\n onEndTimeInput,\n onGranularityInput,\n onRangeSelectorInput,\n onStartDateInput,\n onStartDateSelected,\n onStartTimeInput,\n onTimeInputKeyDown,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-range-picker-calendar.scss\" />\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getQuarter} function options.\n */\n\n/**\n * @name getQuarter\n * @category Quarter Helpers\n * @summary Get the year quarter of the given date.\n *\n * @description\n * Get the year quarter of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The quarter\n *\n * @example\n * // Which quarter is 2 July 2014?\n * const result = getQuarter(new Date(2014, 6, 2));\n * //=> 3\n */\nexport function getQuarter(date, options) {\n const _date = toDate(date, options?.in);\n const quarter = Math.trunc(_date.getMonth() / 3) + 1;\n return quarter;\n}\n\n// Fallback for modularized imports:\nexport default getQuarter;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getYear} function options.\n */\n\n/**\n * @name getYear\n * @category Year Helpers\n * @summary Get the year of the given date.\n *\n * @description\n * Get the year of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The year\n *\n * @example\n * // Which year is 2 July 2014?\n * const result = getYear(new Date(2014, 6, 2))\n * //=> 2014\n */\nexport function getYear(date, options) {\n return toDate(date, options?.in).getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default getYear;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { startOfQuarter } from \"./startOfQuarter.js\";\n\n/**\n * The {@link isSameQuarter} function options.\n */\n\n/**\n * @name isSameQuarter\n * @category Quarter Helpers\n * @summary Are the given dates in the same quarter (and year)?\n *\n * @description\n * Are the given dates in the same quarter (and year)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same quarter (and year)\n *\n * @example\n * // Are 1 January 2014 and 8 March 2014 in the same quarter?\n * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8))\n * //=> true\n *\n * @example\n * // Are 1 January 2014 and 1 January 2015 in the same quarter?\n * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2015, 0, 1))\n * //=> false\n */\nexport function isSameQuarter(laterDate, earlierDate, options) {\n const [dateLeft_, dateRight_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return +startOfQuarter(dateLeft_) === +startOfQuarter(dateRight_);\n}\n\n// Fallback for modularized imports:\nexport default isSameQuarter;\n","import { computed, reactive } from 'vue';\nimport { getDateLocale } from '@/utils/ts/get-date-locale/get-date-locale';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { parseDateTextToStartOfDay } from '../utils/date-text-to-start-of-day';\nimport { type UseDateDisplayText } from './use-date-range-picker-calendar-text.types';\nimport { DateFormat } from '@/types/date-format';\nimport { type CalendarRangeDateValue } from '@/internal';\nimport { type DateRangePickerCalendarFormData } from '../components/date-range-picker-calendar/date-range-picker-calendar.types';\nimport { format } from 'date-fns/format';\nimport { getQuarter } from 'date-fns/getQuarter';\nimport { getYear } from 'date-fns/getYear';\nimport { isSameQuarter } from 'date-fns/isSameQuarter';\nimport messages from '../messages.json';\n\ntype MessageSchema = (typeof messages)['en-US'];\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Date Range Picker\n * @param {Ref<Date>} option.datePickerValue Ref to the datePickerValue set in the DateRangePicker component\n * @param {Ref<boolean>} option.isDateIncorrect Indicates if the date is correct or not\n * @param {Ref<DateRangePickerCalendarRangeSelectorItems>} option.quickSelectRanges Ref to the quick select date ranges (optional)\n * @param {?Ref<boolean>} option.isMonthVariant Indicates if the date range picker has variant \"month\"\n */\nexport const useDateRangePickerCalendarText: UseDateDisplayText<CalendarRangeDateValue> = ({\n datePickerValue,\n isDateIncorrect,\n quickSelectRanges,\n isMonthVariant,\n withTimeInput,\n placeholder,\n}) => {\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const locales = getDateLocale();\n\n const isValidDate = date => !!date && !isNaN(date.getTime());\n\n const formatDate = (date: Date, dateFormat: DateFormat) =>\n isValidDate(date)\n ? format(date, dateFormat, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n })\n : undefined;\n\n // Handle the form input text\n const textInputDisplayValue = reactive<DateRangePickerCalendarFormData>({\n startDate: formatDate(datePickerValue.value?.startDate, DateFormat.NUMERIC_DATE_YEAR_FIRST),\n endDate: formatDate(datePickerValue.value?.endDate, DateFormat.NUMERIC_DATE_YEAR_FIRST),\n startTime: formatDate(datePickerValue.value?.startDate, DateFormat.HOUR_MINUTE_SECONDS),\n endTime: formatDate(datePickerValue.value?.endDate, DateFormat.HOUR_MINUTE_SECONDS),\n });\n\n const dateDisplayValue = computed(() => {\n // Display incorrect date when there's an error with the input\n if (isDateIncorrect.value) {\n return `${textInputDisplayValue.startDate || ''} - ${textInputDisplayValue.endDate || ''}`;\n }\n\n // Display \"Select a date\" when there's no date selected or input\n if (!datePickerValue.value || (!datePickerValue.value.startDate && !datePickerValue.value.endDate)) {\n return placeholder?.value || (t('selectDateRange') as string);\n }\n\n if (quickSelectRanges.value?.length) {\n const customRangeSelected = quickSelectRanges.value.find(({ value }) => {\n return value === datePickerValue.value?.range;\n });\n\n if (customRangeSelected) {\n return customRangeSelected.label;\n }\n }\n\n if (datePickerValue.value.granularity === 'quarterly') {\n const { startDate, endDate } = datePickerValue.value;\n const startQuarter = t('quarter', { quarter: getQuarter(startDate), year: getYear(startDate) });\n\n // If a single quarter is selected, show it only (e.g.: `Q2 2024`)\n if (isSameQuarter(startDate, endDate)) {\n return startQuarter;\n }\n\n const endQuarter = t('quarter', { quarter: getQuarter(endDate), year: getYear(endDate) });\n return `${startQuarter} - ${endQuarter}`;\n }\n\n const { startDate, endDate, startTime, endTime } = textInputDisplayValue;\n const dateFormat = isMonthVariant?.value ? DateFormat.LONG_MONTH_YEAR : DateFormat.FULL_DATE_MONTH_FIRST;\n const formattedStateDate = formatDate(parseDateTextToStartOfDay(startDate), dateFormat);\n const formattedEndDate = formatDate(parseDateTextToStartOfDay(endDate), dateFormat);\n\n if (!withTimeInput.value) {\n return `${formattedStateDate} - ${formattedEndDate}`;\n }\n\n const startDisplay = [formattedStateDate, startTime].filter(Boolean).join(', ');\n const endDisplay = [formattedEndDate, endTime].filter(Boolean).join(', ');\n\n return `${startDisplay} - ${endDisplay}`;\n });\n\n const formatTextInputDisplayValue = () => '';\n\n return {\n // Values\n dateDisplayValue,\n textInputDisplayValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\n};\n","import type { FormField } from '../../types/form-field';\n\nimport {\n CalendarFirstDayOfWeek as BentoDateRangePickerFirstDayOfWeek,\n type CalendarGranularityConfig as BentoDateRangePickerGranularityConfig,\n type CalendarIsDateDisabled as BentoDateRangePickerIsDateDisabled,\n type CalendarRangeDateValue as BentoDateRangePickerValue,\n CalendarVariant as BentoDateRangePickerVariant,\n} from '@/internal/calendar/calendar.types';\nimport type { DateRangePickerCalendarRangeSelectorItems as BentoDateRangePickerQuickSelectRanges } from './components/date-range-picker-calendar/date-range-picker-calendar.types';\n\nexport {\n BentoDateRangePickerFirstDayOfWeek,\n type BentoDateRangePickerIsDateDisabled,\n type BentoDateRangePickerValue,\n type BentoDateRangePickerGranularityConfig,\n BentoDateRangePickerVariant,\n};\n\nexport enum BentoDateRangePickerEvent {\n INPUT = 'input',\n}\n\nexport interface BentoDateRangePickerProps extends FormField {\n /**\n * Allows user to enter time values in the form\n * @default false\n */\n allowTimeInput?: boolean;\n\n /**\n * Allows user to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n * @default 1\n */\n firstDayOfWeek?: BentoDateRangePickerFirstDayOfWeek | number;\n\n /**\n * A list of available granularities.\n * If present, the date picker will display a segmented control to change granularity.\n */\n granularities?: Array<BentoDateRangePickerGranularityConfig>;\n\n /**\n * Indicate if a date should be disabled or not\n */\n isDateDisabled?: BentoDateRangePickerIsDateDisabled;\n\n /**\n * Upon opening date range picker, end date's month will be pre-selected.\n * @default false\n */\n showEndDateOnOpen?: boolean;\n\n /**\n * Enables the range selector.\n * If provided, must be an array that sets the custom range dropdown items.\n */\n quickSelectRanges?: BentoDateRangePickerQuickSelectRanges;\n\n /**\n * Set a maximum number of dates to be selectable by the range.\n */\n maxRange?: number;\n\n /**\n * Sets a minimum limit for selectable dates - dates before `min` will not be selectable\n */\n min?: Date;\n\n /**\n * Sets a maximum limit for selectable dates - dates after `max` will not be selectable\n */\n max?: Date;\n\n /**\n * Number of months rendered on pane\n */\n numberOfMonths?: number;\n\n /**\n * Selected date\n */\n value?: BentoDateRangePickerValue | null;\n\n /**\n * The type of calendar to display. Defaults to showing days.\n */\n variant?: `${BentoDateRangePickerVariant}`;\n\n /**\n * Enables the date picker selection to persist until it is explicitly applied.\n * Displays a set of buttons: Apply and Cancel.\n * @deprecated This will be the default behaviour in v2.0.0.\n * @default false\n */\n hasActions?: boolean;\n}\n","<!-- TODO: Remove aria props as these are part of JSX elements /vue/types/jsx.d.ts -->\n<!-- eslint-disable vue/attribute-hyphenation -->\n<template>\n <div v-bento-click-outside-directive=\"closeDateRangePicker\" class=\"b-date-range-picker\">\n <!-- Label -->\n <field-label\n v-if=\"label\"\n :id=\"labelId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n\n <!-- Input -->\n <div @keydown.enter=\"onEnterPressedOverInput\">\n <dropdown-input-default\n ref=\"inputContainerRef\"\n always-combobox-is-input\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDateRangePickerOpen\"\n :aria-labelledby=\"label ? labelId : null\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n :is-invalid=\"!!errorMessage || shouldDisplayError\"\n :open=\"isDateRangePickerOpen\"\n :display-value=\"displayedDateValue\"\n :readonly=\"isReadOnly\"\n @open=\"openDateRangePicker\"\n @clear=\"clearDateRangePickerValue\"\n @close=\"closeDateRangePicker\"\n />\n </div>\n\n <!-- Error Messages -->\n <error-message\n v-if=\"shouldDisplayError\"\n :id=\"dateErrorId\"\n :error-message=\"t('provideDateInAFormat')\"\n class=\"b-date-range-picker__error-message\"\n />\n <error-message\n v-if=\"!!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-date-range-picker__error-message\"\n />\n\n <!-- Description -->\n <bento-typography\n v-if=\"description\"\n :id=\"descriptionId\"\n class=\"b-date-range-picker__description\"\n :class=\"descriptionConditionalClasses\"\n el=\"span\"\n >\n {{ description }}\n </bento-typography>\n\n <!-- Calendar container -->\n <bento-popover\n v-if=\"inputContainerRef\"\n :id=\"datePickerContainerId\"\n class=\"b-date-range-picker__container\"\n :open=\"isDateRangePickerOpen\"\n :target-element=\"inputContainerRef\"\n :aria-label=\"popoverAriaLabel\"\n position=\"bottom-start\"\n without-space\n fit-content\n trap-all\n @keydown.esc.native=\"closeDateRangePicker\"\n >\n <date-range-picker-calendar\n :allow-time-input=\"withTimeInput\"\n :quick-select-ranges=\"adjustedQuickSelectRanges\"\n :value=\"value\"\n :first-day-of-week=\"firstDayOfWeek\"\n :granularities=\"granularities\"\n :is-date-disabled=\"isDateDisabled\"\n :max-range=\"maxRange\"\n :min=\"min\"\n :max=\"max\"\n :number-of-months=\"numberOfMonths\"\n :show-end-date-on-open=\"showEndDateOnOpen\"\n :date-form-data=\"displayedTextInputValue\"\n :variant=\"variant\"\n @custom-range=\"onRangeSelectorInput\"\n @input=\"onDateRangePickerInput\"\n @error=\"onDateRangePickerError\"\n @form-date=\"onDateRangePickerFormDateInputUpdate\"\n >\n <template v-if=\"hasActions\" #actions>\n <bento-divider />\n\n <div class=\"b-date-range-picker__footer\">\n <bento-button-actions\n :actions=\"rangePickerButtonActions\"\n :layout=\"BentoButtonActionsLayout.SPACE_BETWEEN\"\n />\n </div>\n </template>\n </date-range-picker-calendar>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, ref, toRaw, toRef, watch } from 'vue';\n\n // Components\n import { BentoButtonActions, BentoButtonActionsLayout } from '../button';\n import { BentoDivider } from '@/components/divider';\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '../typography';\n import { DateRangePickerCalendar } from './components/date-range-picker-calendar';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { getDateLocale } from '@/utils/ts/get-date-locale/get-date-locale';\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { format } from 'date-fns/format';\n\n // Composables\n import { useDateRangePickerCalendarText } from './composables/use-date-range-picker-calendar-text';\n import { useFormLayoutFieldLoading } from '@/composables';\n\n // Directives\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives';\n\n // Types\n import {\n BentoDateRangePickerEvent,\n type BentoDateRangePickerProps,\n type BentoDateRangePickerValue,\n } from './date-range-picker.types';\n import { DateFormat } from '@/types/date-format';\n import {\n type DateRangePickerCalendarFormData,\n type DateRangePickerCalendarRangeSelectorItem,\n } from './components/date-range-picker-calendar/date-range-picker-calendar.types';\n\n import { deprecate } from '@/utils/ts/deprecate';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const emit = defineEmits([BentoDateRangePickerEvent.INPUT]);\n const props = defineProps({\n description: { default: undefined },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: undefined },\n optional: { type: Boolean, default: false },\n placeholder: { default: null },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n allowTimeInput: { type: Boolean },\n firstDayOfWeek: { default: 1 },\n granularities: null,\n isDateDisabled: { default: undefined },\n showEndDateOnOpen: { type: Boolean, default: false },\n quickSelectRanges: { default: undefined },\n maxRange: { default: null },\n min: { default: null },\n max: { default: null },\n numberOfMonths: { default: undefined },\n value: { default: null },\n variant: { default: undefined },\n hasActions: { type: Boolean, default: false }\n});\n\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const locales = getDateLocale();\n const datePickerContainerId = generateUid('bento-date-range-picker-container');\n const labelId = generateUid('bento-date-range-picker-label');\n const descriptionId = generateUid('bento-date-range-picker-description');\n const errorId = generateUid('bento-date-range-picker-error');\n const dateErrorId = generateUid('bento-date-range-picker-date-error');\n const popoverAriaLabel = computed(() => props.label || t('dateRangePicker', { name: datePickerContainerId }));\n\n const adjustedQuickSelectRanges = computed<Array<DateRangePickerCalendarRangeSelectorItem>>(() => {\n return (\n props?.quickSelectRanges &&\n props.quickSelectRanges.map((range: DateRangePickerCalendarRangeSelectorItem) => {\n const timeDiff = !range.data.endDate\n ? new Date(Date.now()).getTime() - range.data.startDate.getTime()\n : undefined;\n return {\n ...range,\n data: {\n ...range.data,\n // Adding timeDifference to calculate an up-to-date endDate on range selection\n timeDifference: timeDiff,\n },\n };\n })\n );\n });\n\n const isDateIncorrect = ref(false);\n const inputContainerRef = ref(null);\n const isDateRangePickerOpen = ref(false);\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n watch(\n () => props.disabled,\n () => {\n // Close date picker popover if it's opened when it's disabled\n if (props.disabled && isDateRangePickerOpen.value) {\n isDateRangePickerOpen.value = false;\n }\n }\n );\n\n const shouldDisplayError = computed(() => {\n if (props.hasActions) {\n return !isApplyDisabled.value && isDateIncorrect.value;\n }\n\n return isDateIncorrect.value;\n });\n\n const descriptionConditionalClasses = computed(() => ({\n 'b-date-range-picker__description--error': !!props.errorMessage || shouldDisplayError.value,\n }));\n\n const isMonthVariant = computed(() => props.variant === 'month');\n const withTimeInput = computed(() => props.allowTimeInput && props.variant !== 'month');\n\n const { dateDisplayValue, textInputDisplayValue, formatTextInputDisplayValue } = useDateRangePickerCalendarText({\n datePickerValue: toRef(props, 'value'),\n isDateIncorrect,\n quickSelectRanges: adjustedQuickSelectRanges,\n isMonthVariant,\n withTimeInput,\n placeholder: toRef(props, 'placeholder'),\n });\n\n const ariaDescribedBy = computed(\n () =>\n `${props.description ? descriptionId : ''} ${props.errorMessage ? errorId : ''} ${\n isDateIncorrect.value ? dateErrorId : ''\n }`.trim() || null\n );\n\n const closeDateRangePicker = () => {\n isDateRangePickerOpen.value = false;\n };\n\n const openDateRangePicker = () => {\n isDateRangePickerOpen.value = true;\n formatTextInputDisplayValue();\n };\n\n /*\n * Used when `hasActions` is set to true\n */\n const localDateDisplayValue = ref(dateDisplayValue.value);\n const localTextInputDisplayValue = ref<DateRangePickerCalendarFormData>(\n // textInputDisplayValue is a reactive object\n structuredClone(toRaw(textInputDisplayValue))\n );\n const selectedDate = ref<BentoDateRangePickerValue>(props.value);\n const isApplyDisabled = ref(true);\n\n const displayedTextInputValue = computed(() =>\n props.hasActions ? localTextInputDisplayValue.value : textInputDisplayValue\n );\n\n const displayedDateValue = computed(() =>\n props.hasActions ? localDateDisplayValue.value : dateDisplayValue.value\n );\n\n onMounted(() => {\n if (!props.hasActions) {\n deprecate(\n 'BentoDateRangePicker \"hasActions\" property',\n `Set the BentoDateRangePicker \"hasActions\" property true which will display the \"Apply\" and \"Cancel\" buttons.\n This will be the default behavior in the v2 and \"hasActions\" will be removed.`,\n '2.0.0'\n );\n }\n\n if (\n props.granularities &&\n props.variant !== 'month' &&\n props.granularities.find(({ type }) => type === 'quarterly')\n ) {\n throw new Error('Quarterly granularity is only supported by BentoDateRangePicker with variant: \"month\"');\n }\n });\n\n // On update for the value we need to update all the locally stored data\n watch(\n () => props.value,\n () => {\n localDateDisplayValue.value = dateDisplayValue.value;\n localTextInputDisplayValue.value = structuredClone(toRaw(textInputDisplayValue));\n }\n );\n\n const rangePickerButtonActions = computed(() => [\n {\n title: t('apply'),\n event: () => {\n emit(BentoDateRangePickerEvent.INPUT, selectedDate.value);\n closeDateRangePicker();\n\n isApplyDisabled.value = true;\n },\n disabled: isApplyDisabled.value,\n },\n {\n title: t('cancel'),\n event: closeDateRangePicker,\n },\n ]);\n\n watch(selectedDate, date => {\n // skip emit until Apply button is clicked\n if (props.hasActions) {\n isApplyDisabled.value = isDateIncorrect.value;\n\n return;\n }\n\n emit(BentoDateRangePickerEvent.INPUT, date);\n });\n\n const onDateRangePickerInput = (selectedRange: BentoDateRangePickerValue) => {\n // Reset the errors when the date is correct\n isDateIncorrect.value = false;\n\n const formatDate = (date: Date, dateFormat: DateFormat) =>\n date\n ? format(date, dateFormat, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n })\n : undefined;\n\n textInputDisplayValue.startDate = formatDate(selectedRange.startDate, DateFormat.NUMERIC_DATE_YEAR_FIRST);\n textInputDisplayValue.endDate = formatDate(selectedRange.endDate, DateFormat.NUMERIC_DATE_YEAR_FIRST);\n textInputDisplayValue.startTime = formatDate(selectedRange.startDate, DateFormat.HOUR_MINUTE_SECONDS);\n textInputDisplayValue.endTime = formatDate(selectedRange.endDate, DateFormat.HOUR_MINUTE_SECONDS);\n\n selectedDate.value = selectedRange;\n };\n\n const clearDateRangePickerValue = async () => {\n if (isDateIncorrect.value) {\n isDateIncorrect.value = false;\n }\n\n selectedDate.value = null;\n };\n\n const onEnterPressedOverInput = () => {\n // open the datepicker\n if (!isDateRangePickerOpen.value) {\n isDateRangePickerOpen.value = true;\n\n return;\n }\n\n // Close the date picker if the date is correct and it is open\n if (!isDateIncorrect.value) {\n isDateRangePickerOpen.value = false;\n }\n };\n\n const onDateRangePickerFormDateInputUpdate = (dateFormDate: DateRangePickerCalendarFormData) => {\n isDateIncorrect.value = false;\n\n if (dateFormDate.startTime) {\n textInputDisplayValue.startTime = dateFormDate.startTime;\n }\n\n if (dateFormDate.endTime) {\n textInputDisplayValue.endTime = dateFormDate.endTime;\n }\n };\n\n const onDateRangePickerError = dateTextInput => {\n isDateIncorrect.value = true;\n textInputDisplayValue.startDate = dateTextInput.startDate;\n textInputDisplayValue.endDate = dateTextInput.endDate;\n\n // Remove current date range selection\n selectedDate.value = { startDate: null, endDate: null };\n };\n\n const onRangeSelectorInput = (quickSelectRanges?: BentoDateRangePickerValue) => {\n if (quickSelectRanges) {\n const formatDateTime = (date: Date, dateFormat: DateFormat) =>\n date\n ? format(date, dateFormat, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n })\n : undefined;\n\n const formatDate = (date: Date) =>\n format(date, DateFormat.NUMERIC_DATE_YEAR_FIRST, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n });\n textInputDisplayValue.startDate = formatDate(quickSelectRanges.startDate);\n textInputDisplayValue.endDate = formatDate(quickSelectRanges.endDate);\n textInputDisplayValue.startTime = formatDateTime(\n quickSelectRanges.startDate,\n DateFormat.HOUR_MINUTE_SECONDS\n );\n textInputDisplayValue.endTime = formatDateTime(quickSelectRanges.endDate, DateFormat.HOUR_MINUTE_SECONDS);\n\n selectedDate.value = quickSelectRanges;\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Date range picker selector.\n *\n * @example\n * import { BentoDateRangePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDateRangePicker },\n * template: `\n * <bento-date-range-picker\n * label=\"Label\"\n * description=\"Supporting text\"\n * required\n * optional\n * disabled\n * @input=\"onDateChanged\"\n * v-model=\"selectedDate\"\n * />\n * `,\n * setup() {\n * const selectedDate = ref(new Date()); // reactive({ startDate: new Date(), endDate: new Date() })\n * return {\n * selectedDate,\n * }\n * }\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-date-range-picker',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-range-picker.scss\" />\n"],"names":["parseDateTextToStartOfDay","dateText","startOfDay","year","month","day","s","addQuarters","date","amount","options","addMonths","subQuarters","useGranularMinMaxDate","firstDayOfWeek","minimumDate","maximumDate","granularity","min","max","endOfDay","startOfMin","startOfWeek","isSameDay","addDays","endOfWeek","endOfMax","subDays","startOfMonth","endOfMonth","subMonths","startOfQuarter","endOfQuarter","useGranularityMemory","savedRanges","reactive","type","range","DateRangePickerCalendarEvent","DateRangePickerCalendarEvent2","validDigitRegex","hourRegex","minuteRegex","validateTimeInput","event","selectionStart","allowedKeys","isValidKey","isValidColon","formatTimeInputValue","value","formattedValue","secondToLastDigit","lastDigit","setHours","hours","_date","toDate","setMinutes","minutes","date_","setSeconds","seconds","startOfSecond","isSameSecond","laterDate","earlierDate","isEqual","leftDate","rightDate","isToday","constructFrom","constructNow","setMilliseconds","milliseconds","FORM_INPUT_DEBOUNCE_TIME","RANGE_SELECTOR_CUSTOM_RANGE_KEY","_sfc_main$1","defineComponent","messages$1","BentoDropdown","BentoInputField","BentoSegmentedControl","BentoTypography","Calendar","props","emit","slots","locale","t","useI18n","locales","getDateLocale","calculatedIsRelativeToNowQuickSelectRanges","ref","defaultGranularity","computed","internalRangeDate","_a","_b","_c","_d","deserializeDate","selectedRangeSelectorValue","data","newlyCalculatedQuickSelectDates","formInputWrapperConditionalClasses","quickSelectRangeDefaultItems","selectedGranularity","granularityItems","disabled","getGranularCalendarLimits","computedMinMax","adjustDateForQuarterly","adjustDateForMonthly","adjustDateForWeekly","adjustStartDateInputForWeekly","adjustEndDateInputForWeekly","adjustStartDateInputForMonthly","adjustEndDateInputForMonthly","adjustStartDateInputForQuarterly","adjustEndDateInputForQuarterly","useGranularityAdjustments","saveRange","resetSavedRanges","formatDate","dateToFormat","format","DateFormat","formatTime","startDateError","endDateError","startTimeError","endTimeError","dateTextInput","setTimeInDateObject","dateToSetTimeIn","time","dateWithTime","isValidTimeString","timeText","isValidTime","isTimeAllowed","isValidDate","dateToCheckWithTime","setTimeInDateRef","onDateInput","selectedRange","isDateEnabled","onMounted","onStartDateSelected","newStartDate","onEndDateSelected","newEndDate","getDate","keyName","dateProp","validateStartDate","debounce","startDateText","startDate","endDate","onStartDateInput","formatDateInputValue","validateEndDate","endDateText","onEndDateInput","onDateInputKeyDown","validateDateInput","validateStartTime","startTimeText","validateEndTime","endTimeText","onStartTimeInput","onEndTimeInput","onTimeInputKeyDown","setInternalRange","onRangeSelectorInput","newCustomRangeValue","foundResult","adjustDate","onGranularityInput","previousValue","toRaw","useHasSlot","getQuarter","getYear","isSameQuarter","dateLeft_","dateRight_","normalizeDates","useDateRangePickerCalendarText","datePickerValue","isDateIncorrect","quickSelectRanges","isMonthVariant","withTimeInput","placeholder","dateFormat","textInputDisplayValue","customRangeSelected","startDate2","endDate2","startQuarter","endQuarter","startTime","endTime","formattedStateDate","formattedEndDate","startDisplay","endDisplay","BentoDateRangePickerEvent","BentoDateRangePickerEvent2","__default__","messages","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","adjustedQuickSelectRanges","timeDiff","inputContainerRef","isDateRangePickerOpen","isReadOnly","useFormLayoutFieldLoading","toRef","watch","shouldDisplayError","isApplyDisabled","descriptionConditionalClasses","dateDisplayValue","formatTextInputDisplayValue","ariaDescribedBy","closeDateRangePicker","openDateRangePicker","localDateDisplayValue","localTextInputDisplayValue","selectedDate","displayedTextInputValue","displayedDateValue","deprecate","rangePickerButtonActions","dateFormDate","formatDateTime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAAAA,EAAAC,GAAA;AACH,MAAAA,KAAA;AACI,WAAAC,EAAA,oBAAA,KAAA,CAAA;AAGJ,QAAA,CAAAC,GAAAC,GAAAC,CAAA,IAAAJ,EAAA,MAAA,GAAA,EAAA,IAAA,CAAAK,MAAA,SAAAA,GAAA,EAAA,CAAA;AACA,SAAA,IAAA,KAAAH,GAAAC,IAAA,GAAAC,CAAA;AACJ;ACSO,SAAAE,GAAAC,GAAAC,GAAAC,GAAA;AACP,SAAAC,GAAAH,GAAAC,IAAA,GAAAC,CAAA;AACA;ACFO,SAAAE,GAAAJ,GAAAC,GAAAC,GAAA;AACP,SAAAH,GAAAC,GAAA,IAAAE,CAAA;AACA;ACNO,MAAAG,KAAA,CAAA;AAAA,EAAsD,gBAAAC;AAAA,EACzD,KAAAC;AAAA,EACK,KAAAC;AAET,OAoFI,EAAA,2BAnFA,CAAAC,MAAA;AACI,MAAA,CAAAF,KAAA,CAAAC;AACI,WAAA,EAAA,KAAA,MAAA,KAAA,KAAA;AAGJ,MAAAE,IAAAH,IAAAb,EAAAa,CAA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