@fluentui/react-calendar-compat 0.1.12 → 0.1.14

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 (117) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/lib/Calendar.js.map +1 -1
  3. package/lib/CalendarDay.js.map +1 -1
  4. package/lib/CalendarDayGrid.js.map +1 -1
  5. package/lib/CalendarMonth.js.map +1 -1
  6. package/lib/CalendarPicker.js.map +1 -1
  7. package/lib/CalendarYear.js.map +1 -1
  8. package/lib/components/Calendar/Calendar.js.map +1 -1
  9. package/lib/components/Calendar/Calendar.types.js +4 -4
  10. package/lib/components/Calendar/Calendar.types.js.map +1 -1
  11. package/lib/components/Calendar/calendarNavigationIcons.js.map +1 -1
  12. package/lib/components/Calendar/defaults.js.map +1 -1
  13. package/lib/components/Calendar/index.js.map +1 -1
  14. package/lib/components/CalendarDay/CalendarDay.js.map +1 -1
  15. package/lib/components/CalendarDay/CalendarDay.types.js.map +1 -1
  16. package/lib/components/CalendarDay/index.js.map +1 -1
  17. package/lib/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
  18. package/lib/components/CalendarDayGrid/CalendarDayGrid.types.js.map +1 -1
  19. package/lib/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
  20. package/lib/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
  21. package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
  22. package/lib/components/CalendarDayGrid/index.js.map +1 -1
  23. package/lib/components/CalendarDayGrid/useWeeks.js.map +1 -1
  24. package/lib/components/CalendarMonth/CalendarMonth.js.map +1 -1
  25. package/lib/components/CalendarMonth/CalendarMonth.types.js.map +1 -1
  26. package/lib/components/CalendarMonth/index.js.map +1 -1
  27. package/lib/components/CalendarPicker/CalendarPicker.types.js +3 -1
  28. package/lib/components/CalendarPicker/CalendarPicker.types.js.map +1 -1
  29. package/lib/components/CalendarPicker/index.js.map +1 -1
  30. package/lib/components/CalendarYear/CalendarYear.js.map +1 -1
  31. package/lib/components/CalendarYear/CalendarYear.types.js.map +1 -1
  32. package/lib/components/CalendarYear/index.js.map +1 -1
  33. package/lib/index.js.map +1 -1
  34. package/lib/utils/animations.js.map +1 -1
  35. package/lib/utils/constants.js.map +1 -1
  36. package/lib/utils/dateFormatting/dateFormatting.defaults.js.map +1 -1
  37. package/lib/utils/dateFormatting/dateFormatting.types.js.map +1 -1
  38. package/lib/utils/dateFormatting/index.js.map +1 -1
  39. package/lib/utils/dateGrid/dateGrid.types.js.map +1 -1
  40. package/lib/utils/dateGrid/findAvailableDate.js.map +1 -1
  41. package/lib/utils/dateGrid/getBoundedDateRange.js.map +1 -1
  42. package/lib/utils/dateGrid/getDateRangeTypeToUse.js.map +1 -1
  43. package/lib/utils/dateGrid/getDayGrid.js.map +1 -1
  44. package/lib/utils/dateGrid/index.js.map +1 -1
  45. package/lib/utils/dateGrid/isAfterMaxDate.js.map +1 -1
  46. package/lib/utils/dateGrid/isBeforeMinDate.js.map +1 -1
  47. package/lib/utils/dateGrid/isContiguous.js.map +1 -1
  48. package/lib/utils/dateGrid/isRestrictedDate.js.map +1 -1
  49. package/lib/utils/dateMath/dateMath.js.map +1 -1
  50. package/lib/utils/dateMath/index.js.map +1 -1
  51. package/lib/utils/focus.js.map +1 -1
  52. package/lib/utils/index.js.map +1 -1
  53. package/lib-commonjs/Calendar.js.map +1 -1
  54. package/lib-commonjs/CalendarDay.js.map +1 -1
  55. package/lib-commonjs/CalendarDayGrid.js.map +1 -1
  56. package/lib-commonjs/CalendarMonth.js.map +1 -1
  57. package/lib-commonjs/CalendarPicker.js.map +1 -1
  58. package/lib-commonjs/CalendarYear.js.map +1 -1
  59. package/lib-commonjs/components/Calendar/Calendar.js.map +1 -1
  60. package/lib-commonjs/components/Calendar/Calendar.types.js +4 -4
  61. package/lib-commonjs/components/Calendar/Calendar.types.js.map +1 -1
  62. package/lib-commonjs/components/Calendar/calendarNavigationIcons.js.map +1 -1
  63. package/lib-commonjs/components/Calendar/defaults.js.map +1 -1
  64. package/lib-commonjs/components/Calendar/index.js.map +1 -1
  65. package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js.map +1 -1
  66. package/lib-commonjs/components/CalendarDay/CalendarDay.js.map +1 -1
  67. package/lib-commonjs/components/CalendarDay/CalendarDay.types.js.map +1 -1
  68. package/lib-commonjs/components/CalendarDay/index.js.map +1 -1
  69. package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
  70. package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
  71. package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.types.js.map +1 -1
  72. package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
  73. package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
  74. package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
  75. package/lib-commonjs/components/CalendarDayGrid/index.js.map +1 -1
  76. package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
  77. package/lib-commonjs/components/CalendarDayGrid/useWeekCornerStyles.styles.js +3 -3
  78. package/lib-commonjs/components/CalendarDayGrid/useWeekCornerStyles.styles.js.map +1 -1
  79. package/lib-commonjs/components/CalendarDayGrid/useWeeks.js.map +1 -1
  80. package/lib-commonjs/components/CalendarMonth/CalendarMonth.js.map +1 -1
  81. package/lib-commonjs/components/CalendarMonth/CalendarMonth.types.js.map +1 -1
  82. package/lib-commonjs/components/CalendarMonth/index.js.map +1 -1
  83. package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.js.map +1 -1
  84. package/lib-commonjs/components/CalendarPicker/CalendarPicker.types.js +3 -1
  85. package/lib-commonjs/components/CalendarPicker/CalendarPicker.types.js.map +1 -1
  86. package/lib-commonjs/components/CalendarPicker/index.js.map +1 -1
  87. package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
  88. package/lib-commonjs/components/CalendarYear/CalendarYear.js.map +1 -1
  89. package/lib-commonjs/components/CalendarYear/CalendarYear.types.js.map +1 -1
  90. package/lib-commonjs/components/CalendarYear/index.js.map +1 -1
  91. package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
  92. package/lib-commonjs/index.js +44 -44
  93. package/lib-commonjs/index.js.map +1 -1
  94. package/lib-commonjs/utils/animations.js +9 -9
  95. package/lib-commonjs/utils/animations.js.map +1 -1
  96. package/lib-commonjs/utils/constants.js +8 -8
  97. package/lib-commonjs/utils/constants.js.map +1 -1
  98. package/lib-commonjs/utils/dateFormatting/dateFormatting.defaults.js +12 -12
  99. package/lib-commonjs/utils/dateFormatting/dateFormatting.defaults.js.map +1 -1
  100. package/lib-commonjs/utils/dateFormatting/dateFormatting.types.js.map +1 -1
  101. package/lib-commonjs/utils/dateFormatting/index.js.map +1 -1
  102. package/lib-commonjs/utils/dateGrid/dateGrid.types.js.map +1 -1
  103. package/lib-commonjs/utils/dateGrid/findAvailableDate.js.map +1 -1
  104. package/lib-commonjs/utils/dateGrid/getBoundedDateRange.js.map +1 -1
  105. package/lib-commonjs/utils/dateGrid/getDateRangeTypeToUse.js.map +1 -1
  106. package/lib-commonjs/utils/dateGrid/getDayGrid.js.map +1 -1
  107. package/lib-commonjs/utils/dateGrid/index.js.map +1 -1
  108. package/lib-commonjs/utils/dateGrid/isAfterMaxDate.js.map +1 -1
  109. package/lib-commonjs/utils/dateGrid/isBeforeMinDate.js.map +1 -1
  110. package/lib-commonjs/utils/dateGrid/isContiguous.js.map +1 -1
  111. package/lib-commonjs/utils/dateGrid/isRestrictedDate.js.map +1 -1
  112. package/lib-commonjs/utils/dateMath/dateMath.js +29 -29
  113. package/lib-commonjs/utils/dateMath/dateMath.js.map +1 -1
  114. package/lib-commonjs/utils/dateMath/index.js.map +1 -1
  115. package/lib-commonjs/utils/focus.js.map +1 -1
  116. package/lib-commonjs/utils/index.js.map +1 -1
  117. package/package.json +5 -5
@@ -12,56 +12,56 @@ _export(exports, {
12
12
  addDays: function() {
13
13
  return addDays;
14
14
  },
15
- addWeeks: function() {
16
- return addWeeks;
17
- },
18
15
  addMonths: function() {
19
16
  return addMonths;
20
17
  },
18
+ addWeeks: function() {
19
+ return addWeeks;
20
+ },
21
21
  addYears: function() {
22
22
  return addYears;
23
23
  },
24
- getMonthStart: function() {
25
- return getMonthStart;
26
- },
27
- getMonthEnd: function() {
28
- return getMonthEnd;
29
- },
30
- getYearStart: function() {
31
- return getYearStart;
32
- },
33
- getYearEnd: function() {
34
- return getYearEnd;
35
- },
36
- setMonth: function() {
37
- return setMonth;
24
+ compareDatePart: function() {
25
+ return compareDatePart;
38
26
  },
39
27
  compareDates: function() {
40
28
  return compareDates;
41
29
  },
42
- compareDatePart: function() {
43
- return compareDatePart;
30
+ getDatePartHashValue: function() {
31
+ return getDatePartHashValue;
44
32
  },
45
33
  getDateRangeArray: function() {
46
34
  return getDateRangeArray;
47
35
  },
48
- isInDateRangeArray: function() {
49
- return isInDateRangeArray;
36
+ getEndDateOfWeek: function() {
37
+ return getEndDateOfWeek;
50
38
  },
51
- getWeekNumbersInMonth: function() {
52
- return getWeekNumbersInMonth;
39
+ getMonthEnd: function() {
40
+ return getMonthEnd;
53
41
  },
54
- getWeekNumber: function() {
55
- return getWeekNumber;
42
+ getMonthStart: function() {
43
+ return getMonthStart;
56
44
  },
57
45
  getStartDateOfWeek: function() {
58
46
  return getStartDateOfWeek;
59
47
  },
60
- getEndDateOfWeek: function() {
61
- return getEndDateOfWeek;
48
+ getWeekNumber: function() {
49
+ return getWeekNumber;
62
50
  },
63
- getDatePartHashValue: function() {
64
- return getDatePartHashValue;
51
+ getWeekNumbersInMonth: function() {
52
+ return getWeekNumbersInMonth;
53
+ },
54
+ getYearEnd: function() {
55
+ return getYearEnd;
56
+ },
57
+ getYearStart: function() {
58
+ return getYearStart;
59
+ },
60
+ isInDateRangeArray: function() {
61
+ return isInDateRangeArray;
62
+ },
63
+ setMonth: function() {
64
+ return setMonth;
65
65
  }
66
66
  });
67
67
  const _constants = require("../constants");
@@ -1 +1 @@
1
- {"version":3,"sources":["dateMath.js"],"sourcesContent":["import { DateRangeType, DayOfWeek, FirstWeekOfYear, MonthOfYear, TimeConstants } from '../constants';\n/**\n * Returns a date offset from the given date by the specified number of days.\n * @param date - The origin date\n * @param days - The number of days to offset. 'days' can be negative.\n * @returns A new Date object offset from the origin date by the given number of days\n */ export function addDays(date, days) {\n const result = new Date(date.getTime());\n result.setDate(result.getDate() + days);\n return result;\n}\n/**\n * Returns a date offset from the given date by the specified number of weeks.\n * @param date - The origin date\n * @param weeks - The number of weeks to offset. 'weeks' can be negative.\n * @returns A new Date object offset from the origin date by the given number of weeks\n */ export function addWeeks(date, weeks) {\n return addDays(date, weeks * TimeConstants.DaysInOneWeek);\n}\n/**\n * Returns a date offset from the given date by the specified number of months.\n * The method tries to preserve the day-of-month; however, if the new month does not have enough days\n * to contain the original day-of-month, we'll use the last day of the new month.\n * @param date - The origin date\n * @param months - The number of months to offset. 'months' can be negative.\n * @returns A new Date object offset from the origin date by the given number of months\n */ export function addMonths(date, months) {\n let result = new Date(date.getTime());\n const newMonth = result.getMonth() + months;\n result.setMonth(newMonth);\n // We want to maintain the same day-of-month, but that may not be possible if the new month doesn't have enough days.\n // Loop until we back up to a day the new month has.\n // (Weird modulo math is due to Javascript's treatment of negative numbers in modulo)\n if (result.getMonth() !== (newMonth % TimeConstants.MonthInOneYear + TimeConstants.MonthInOneYear) % TimeConstants.MonthInOneYear) {\n result = addDays(result, -result.getDate());\n }\n return result;\n}\n/**\n * Returns a date offset from the given date by the specified number of years.\n * The method tries to preserve the day-of-month; however, if the new month does not have enough days\n * to contain the original day-of-month, we'll use the last day of the new month.\n * @param date - The origin date\n * @param years - The number of years to offset. 'years' can be negative.\n * @returns A new Date object offset from the origin date by the given number of years\n */ export function addYears(date, years) {\n let result = new Date(date.getTime());\n result.setFullYear(date.getFullYear() + years);\n // We want to maintain the same day-of-month, but that may not be possible if the new month doesn't have enough days.\n // Loop until we back up to a day the new month has.\n // (Weird modulo math is due to Javascript's treatment of negative numbers in modulo)\n if (result.getMonth() !== (date.getMonth() % TimeConstants.MonthInOneYear + TimeConstants.MonthInOneYear) % TimeConstants.MonthInOneYear) {\n result = addDays(result, -result.getDate());\n }\n return result;\n}\n/**\n * Returns a date that is the first day of the month of the provided date.\n * @param date - The origin date\n * @returns A new Date object with the day set to the first day of the month.\n */ export function getMonthStart(date) {\n return new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0, 0);\n}\n/**\n * Returns a date that is the last day of the month of the provided date.\n * @param date - The origin date\n * @returns A new Date object with the day set to the last day of the month.\n */ export function getMonthEnd(date) {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0, 0, 0, 0, 0);\n}\n/**\n * Returns a date that is the first day of the year of the provided date.\n * @param date - The origin date\n * @returns A new Date object with the day set to the first day of the year.\n */ export function getYearStart(date) {\n return new Date(date.getFullYear(), 0, 1, 0, 0, 0, 0);\n}\n/**\n * Returns a date that is the last day of the year of the provided date.\n * @param date - The origin date\n * @returns A new Date object with the day set to the last day of the year.\n */ export function getYearEnd(date) {\n return new Date(date.getFullYear() + 1, 0, 0, 0, 0, 0, 0);\n}\n/**\n * Returns a date that is a copy of the given date, aside from the month changing to the given month.\n * The method tries to preserve the day-of-month; however, if the new month does not have enough days\n * to contain the original day-of-month, we'll use the last day of the new month.\n * @param date - The origin date\n * @param month - The 0-based index of the month to set on the date.\n * @returns A new Date object with the given month set.\n */ export function setMonth(date, month) {\n return addMonths(date, month - date.getMonth());\n}\n/**\n * Compares two dates, and returns true if the two dates (not accounting for time-of-day) are equal.\n * @returns True if the two dates represent the same date (regardless of time-of-day), false otherwise.\n */ export function compareDates(date1, date2) {\n if (!date1 && !date2) {\n return true;\n } else if (!date1 || !date2) {\n return false;\n } else {\n return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();\n }\n}\n/**\n * Compare the date parts of two dates\n * @param date1 - The first date to compare\n * @param date2 - The second date to compare\n * @returns A negative value if date1 is earlier than date2, 0 if the dates are equal, or a positive value\n * if date1 is later than date2.\n */ export function compareDatePart(date1, date2) {\n return getDatePartHashValue(date1) - getDatePartHashValue(date2);\n}\n/**\n * Gets the date range array including the specified date. The date range array is calculated as the list\n * of dates accounting for the specified first day of the week and date range type.\n * @param date - The input date\n * @param dateRangeType - The desired date range type, i.e., day, week, month, etc.\n * @param firstDayOfWeek - The first day of the week.\n * @param workWeekDays - The allowed days in work week. If not provided, assumes all days are allowed.\n * @param daysToSelectInDayView - The number of days to include when using dateRangeType === DateRangeType.Day\n * for multiday view. Defaults to 1\n * @returns An array of dates representing the date range containing the specified date.\n */ export function getDateRangeArray(date, dateRangeType, firstDayOfWeek, workWeekDays, daysToSelectInDayView = 1) {\n const datesArray = [];\n let startDate;\n let endDate = null;\n if (!workWeekDays) {\n workWeekDays = [\n DayOfWeek.Monday,\n DayOfWeek.Tuesday,\n DayOfWeek.Wednesday,\n DayOfWeek.Thursday,\n DayOfWeek.Friday\n ];\n }\n daysToSelectInDayView = Math.max(daysToSelectInDayView, 1);\n switch(dateRangeType){\n case DateRangeType.Day:\n startDate = getDatePart(date);\n endDate = addDays(startDate, daysToSelectInDayView);\n break;\n case DateRangeType.Week:\n case DateRangeType.WorkWeek:\n startDate = getStartDateOfWeek(getDatePart(date), firstDayOfWeek);\n endDate = addDays(startDate, TimeConstants.DaysInOneWeek);\n break;\n case DateRangeType.Month:\n startDate = new Date(date.getFullYear(), date.getMonth(), 1);\n endDate = addMonths(startDate, 1);\n break;\n default:\n throw new Error('Unexpected object: ' + dateRangeType);\n }\n // Populate the dates array with the dates in range\n let nextDate = startDate;\n do {\n if (dateRangeType !== DateRangeType.WorkWeek) {\n // push all days not in work week view\n datesArray.push(nextDate);\n } else if (workWeekDays.indexOf(nextDate.getDay()) !== -1) {\n datesArray.push(nextDate);\n }\n nextDate = addDays(nextDate, 1);\n }while (!compareDates(nextDate, endDate))\n return datesArray;\n}\n/**\n * Checks whether the specified date is in the given date range.\n * @param date - The origin date\n * @param dateRange - An array of dates to do the lookup on\n * @returns True if the date matches one of the dates in the specified array, false otherwise.\n */ export function isInDateRangeArray(date, dateRange) {\n for (const dateInRange of dateRange){\n if (compareDates(date, dateInRange)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Returns the week number for a date.\n * Week numbers are 1 - 52 (53) in a year\n * @param navigatedDate - A date to find the week number for.\n * @param firstDayOfWeek - The first day of the week (0-6, Sunday = 0)\n * @param firstWeekOfYear - The first week of the year (1-2)\n * @returns The weeks number array for the current month.\n */ export function getWeekNumbersInMonth(weeksInMonth, firstDayOfWeek, firstWeekOfYear, navigatedDate) {\n const selectedYear = navigatedDate.getFullYear();\n const selectedMonth = navigatedDate.getMonth();\n let dayOfMonth = 1;\n const fistDayOfMonth = new Date(selectedYear, selectedMonth, dayOfMonth);\n const endOfFirstWeek = dayOfMonth + (firstDayOfWeek + TimeConstants.DaysInOneWeek - 1) - adjustWeekDay(firstDayOfWeek, fistDayOfMonth.getDay());\n let endOfWeekRange = new Date(selectedYear, selectedMonth, endOfFirstWeek);\n dayOfMonth = endOfWeekRange.getDate();\n const weeksArray = [];\n for(let i = 0; i < weeksInMonth; i++){\n // Get week number for end of week\n weeksArray.push(getWeekNumber(endOfWeekRange, firstDayOfWeek, firstWeekOfYear));\n dayOfMonth += TimeConstants.DaysInOneWeek;\n endOfWeekRange = new Date(selectedYear, selectedMonth, dayOfMonth);\n }\n return weeksArray;\n}\n/**\n * Returns the week number for a date.\n * Week numbers are 1 - 52 (53) in a year\n * @param date - A date to find the week number for.\n * @param firstDayOfWeek - The first day of the week (0-6, Sunday = 0)\n * @param firstWeekOfYear - The first week of the year (1-2)\n * @returns The week's number in the year.\n */ export function getWeekNumber(date, firstDayOfWeek, firstWeekOfYear) {\n // First four-day week of the year - minumum days count\n const fourDayWeek = 4;\n switch(firstWeekOfYear){\n case FirstWeekOfYear.FirstFullWeek:\n return getWeekOfYearFullDays(date, firstDayOfWeek, TimeConstants.DaysInOneWeek);\n case FirstWeekOfYear.FirstFourDayWeek:\n return getWeekOfYearFullDays(date, firstDayOfWeek, fourDayWeek);\n default:\n return getFirstDayWeekOfYear(date, firstDayOfWeek);\n }\n}\n/**\n * Gets the date for the first day of the week based on the given date assuming\n * the specified first day of the week.\n * @param date - The date to find the beginning of the week date for.\n * @returns A new date object representing the first day of the week containing the input date.\n */ export function getStartDateOfWeek(date, firstDayOfWeek) {\n let daysOffset = firstDayOfWeek - date.getDay();\n if (daysOffset > 0) {\n // If first day of week is > date, go 1 week back, to ensure resulting date is in the past.\n daysOffset -= TimeConstants.DaysInOneWeek;\n }\n return addDays(date, daysOffset);\n}\n/**\n * Gets the date for the last day of the week based on the given date assuming\n * the specified first day of the week.\n * @param date - The date to find the beginning of the week date for.\n * @returns A new date object representing the first day of the week containing the input date.\n */ export function getEndDateOfWeek(date, firstDayOfWeek) {\n const lastDayOfWeek = firstDayOfWeek - 1 >= 0 ? firstDayOfWeek - 1 : TimeConstants.DaysInOneWeek - 1;\n let daysOffset = lastDayOfWeek - date.getDay();\n if (daysOffset < 0) {\n // If last day of week is < date, go 1 week forward, to ensure resulting date is in the future.\n daysOffset += TimeConstants.DaysInOneWeek;\n }\n return addDays(date, daysOffset);\n}\n/**\n * Gets a new date with the time portion zeroed out, i.e., set to midnight\n * @param date - The origin date\n * @returns A new date with the time set to midnight\n */ function getDatePart(date) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n}\n/**\n * Helper function to assist in date comparisons\n */ export function getDatePartHashValue(date) {\n // Generate date hash value created as sum of Date (up to 31 = 5 bits), Month (up to 11 = 4 bits) and Year.\n // eslint-disable-next-line no-bitwise\n return date.getDate() + (date.getMonth() << 5) + (date.getFullYear() << 9);\n}\n/**\n * Helper function for `getWeekNumber`.\n * Returns week number for a date.\n * @param date - current selected date.\n * @param firstDayOfWeek - The first day of week (0-6, Sunday = 0)\n * @param numberOfFullDays - week settings.\n * @returns The week's number in the year.\n */ function getWeekOfYearFullDays(date, firstDayOfWeek, numberOfFullDays) {\n const dayOfYear = getDayOfYear(date) - 1;\n let num = date.getDay() - dayOfYear % TimeConstants.DaysInOneWeek;\n const lastDayOfPrevYear = new Date(date.getFullYear() - 1, MonthOfYear.December, 31);\n const daysInYear = getDayOfYear(lastDayOfPrevYear) - 1;\n let num2 = (firstDayOfWeek - num + 2 * TimeConstants.DaysInOneWeek) % TimeConstants.DaysInOneWeek;\n if (num2 !== 0 && num2 >= numberOfFullDays) {\n num2 -= TimeConstants.DaysInOneWeek;\n }\n let num3 = dayOfYear - num2;\n if (num3 < 0) {\n num -= daysInYear % TimeConstants.DaysInOneWeek;\n num2 = (firstDayOfWeek - num + 2 * TimeConstants.DaysInOneWeek) % TimeConstants.DaysInOneWeek;\n if (num2 !== 0 && num2 + 1 >= numberOfFullDays) {\n num2 -= TimeConstants.DaysInOneWeek;\n }\n num3 = daysInYear - num2;\n }\n return Math.floor(num3 / TimeConstants.DaysInOneWeek + 1);\n}\n/**\n * Helper function for `getWeekNumber`.\n * Returns week number for a date.\n * @param date - current selected date.\n * @param firstDayOfWeek - The first day of week (0-6, Sunday = 0)\n * @returns The week's number in the year.\n */ function getFirstDayWeekOfYear(date, firstDayOfWeek) {\n const num = getDayOfYear(date) - 1;\n const num2 = date.getDay() - num % TimeConstants.DaysInOneWeek;\n const num3 = (num2 - firstDayOfWeek + 2 * TimeConstants.DaysInOneWeek) % TimeConstants.DaysInOneWeek;\n return Math.floor((num + num3) / TimeConstants.DaysInOneWeek + 1);\n}\n/**\n * Helper function for `getWeekNumber`.\n * Returns adjusted week day number when `firstDayOfWeek` is other than Sunday.\n * For Week Day Number comparison checks\n * @param firstDayOfWeek - The first day of week (0-6, Sunday = 0)\n * @param dateWeekDay - shifts number forward to 1 week in case passed as true\n * @returns The day of week adjusted to `firstDayOfWeek`; e.g. when `firstDayOfWeek` is Monday (1),\n * Sunday becomes 7.\n */ function adjustWeekDay(firstDayOfWeek, dateWeekDay) {\n return firstDayOfWeek !== DayOfWeek.Sunday && dateWeekDay < firstDayOfWeek ? dateWeekDay + TimeConstants.DaysInOneWeek : dateWeekDay;\n}\n/**\n * Returns the day number for a date in a year:\n * the number of days since January 1st in the particular year.\n * @param date - A date to find the day number for.\n * @returns The day's number in the year.\n */ function getDayOfYear(date) {\n const month = date.getMonth();\n const year = date.getFullYear();\n let daysUntilDate = 0;\n for(let i = 0; i < month; i++){\n daysUntilDate += daysInMonth(i + 1, year);\n }\n daysUntilDate += date.getDate();\n return daysUntilDate;\n}\n/**\n * Returns the number of days in the month\n * @param month - The month number to target (months 1-12).\n * @param year - The year to target.\n * @returns The number of days in the month.\n */ function daysInMonth(month, year) {\n return new Date(year, month, 0).getDate();\n}\n"],"names":["addDays","addWeeks","addMonths","addYears","getMonthStart","getMonthEnd","getYearStart","getYearEnd","setMonth","compareDates","compareDatePart","getDateRangeArray","isInDateRangeArray","getWeekNumbersInMonth","getWeekNumber","getStartDateOfWeek","getEndDateOfWeek","getDatePartHashValue","date","days","result","Date","getTime","setDate","getDate","weeks","TimeConstants","DaysInOneWeek","months","newMonth","getMonth","MonthInOneYear","years","setFullYear","getFullYear","month","date1","date2","dateRangeType","firstDayOfWeek","workWeekDays","daysToSelectInDayView","datesArray","startDate","endDate","DayOfWeek","Monday","Tuesday","Wednesday","Thursday","Friday","Math","max","DateRangeType","Day","getDatePart","Week","WorkWeek","Month","Error","nextDate","push","indexOf","getDay","dateRange","dateInRange","weeksInMonth","firstWeekOfYear","navigatedDate","selectedYear","selectedMonth","dayOfMonth","fistDayOfMonth","endOfFirstWeek","adjustWeekDay","endOfWeekRange","weeksArray","i","fourDayWeek","FirstWeekOfYear","FirstFullWeek","getWeekOfYearFullDays","FirstFourDayWeek","getFirstDayWeekOfYear","daysOffset","lastDayOfWeek","numberOfFullDays","dayOfYear","getDayOfYear","num","lastDayOfPrevYear","MonthOfYear","December","daysInYear","num2","num3","floor","d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AAI,GAAGsB;IACxC;IACAC,iBAAiBlF,KAAKM,OAAO;IAC7B,OAAO4E;AACX;AACA;;;;;CAKC,GAAG,SAASC,YAAYlE,KAAK,EAAEgE,IAAI;IAChC,OAAO,IAAI9E,KAAK8E,MAAMhE,OAAO,GAAGX,OAAO;AAC3C"}
1
+ {"version":3,"sources":["dateMath.ts"],"sourcesContent":["import { DateRangeType, DayOfWeek, FirstWeekOfYear, MonthOfYear, TimeConstants } from '../constants';\n\n/**\n * Returns a date offset from the given date by the specified number of days.\n * @param date - The origin date\n * @param days - The number of days to offset. 'days' can be negative.\n * @returns A new Date object offset from the origin date by the given number of days\n */\nexport function addDays(date: Date, days: number): Date {\n const result = new Date(date.getTime());\n result.setDate(result.getDate() + days);\n return result;\n}\n\n/**\n * Returns a date offset from the given date by the specified number of weeks.\n * @param date - The origin date\n * @param weeks - The number of weeks to offset. 'weeks' can be negative.\n * @returns A new Date object offset from the origin date by the given number of weeks\n */\nexport function addWeeks(date: Date, weeks: number): Date {\n return addDays(date, weeks * TimeConstants.DaysInOneWeek);\n}\n\n/**\n * Returns a date offset from the given date by the specified number of months.\n * The method tries to preserve the day-of-month; however, if the new month does not have enough days\n * to contain the original day-of-month, we'll use the last day of the new month.\n * @param date - The origin date\n * @param months - The number of months to offset. 'months' can be negative.\n * @returns A new Date object offset from the origin date by the given number of months\n */\nexport function addMonths(date: Date, months: number): Date {\n let result = new Date(date.getTime());\n const newMonth = result.getMonth() + months;\n result.setMonth(newMonth);\n\n // We want to maintain the same day-of-month, but that may not be possible if the new month doesn't have enough days.\n // Loop until we back up to a day the new month has.\n // (Weird modulo math is due to Javascript's treatment of negative numbers in modulo)\n if (\n result.getMonth() !==\n ((newMonth % TimeConstants.MonthInOneYear) + TimeConstants.MonthInOneYear) % TimeConstants.MonthInOneYear\n ) {\n result = addDays(result, -result.getDate());\n }\n return result;\n}\n\n/**\n * Returns a date offset from the given date by the specified number of years.\n * The method tries to preserve the day-of-month; however, if the new month does not have enough days\n * to contain the original day-of-month, we'll use the last day of the new month.\n * @param date - The origin date\n * @param years - The number of years to offset. 'years' can be negative.\n * @returns A new Date object offset from the origin date by the given number of years\n */\nexport function addYears(date: Date, years: number): Date {\n let result = new Date(date.getTime());\n result.setFullYear(date.getFullYear() + years);\n\n // We want to maintain the same day-of-month, but that may not be possible if the new month doesn't have enough days.\n // Loop until we back up to a day the new month has.\n // (Weird modulo math is due to Javascript's treatment of negative numbers in modulo)\n if (\n result.getMonth() !==\n ((date.getMonth() % TimeConstants.MonthInOneYear) + TimeConstants.MonthInOneYear) % TimeConstants.MonthInOneYear\n ) {\n result = addDays(result, -result.getDate());\n }\n return result;\n}\n\n/**\n * Returns a date that is the first day of the month of the provided date.\n * @param date - The origin date\n * @returns A new Date object with the day set to the first day of the month.\n */\nexport function getMonthStart(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0, 0);\n}\n\n/**\n * Returns a date that is the last day of the month of the provided date.\n * @param date - The origin date\n * @returns A new Date object with the day set to the last day of the month.\n */\nexport function getMonthEnd(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0, 0, 0, 0, 0);\n}\n\n/**\n * Returns a date that is the first day of the year of the provided date.\n * @param date - The origin date\n * @returns A new Date object with the day set to the first day of the year.\n */\nexport function getYearStart(date: Date): Date {\n return new Date(date.getFullYear(), 0, 1, 0, 0, 0, 0);\n}\n\n/**\n * Returns a date that is the last day of the year of the provided date.\n * @param date - The origin date\n * @returns A new Date object with the day set to the last day of the year.\n */\nexport function getYearEnd(date: Date): Date {\n return new Date(date.getFullYear() + 1, 0, 0, 0, 0, 0, 0);\n}\n\n/**\n * Returns a date that is a copy of the given date, aside from the month changing to the given month.\n * The method tries to preserve the day-of-month; however, if the new month does not have enough days\n * to contain the original day-of-month, we'll use the last day of the new month.\n * @param date - The origin date\n * @param month - The 0-based index of the month to set on the date.\n * @returns A new Date object with the given month set.\n */\nexport function setMonth(date: Date, month: number): Date {\n return addMonths(date, month - date.getMonth());\n}\n\n/**\n * Compares two dates, and returns true if the two dates (not accounting for time-of-day) are equal.\n * @returns True if the two dates represent the same date (regardless of time-of-day), false otherwise.\n */\nexport function compareDates(date1: Date, date2: Date): boolean {\n if (!date1 && !date2) {\n return true;\n } else if (!date1 || !date2) {\n return false;\n } else {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n }\n}\n\n/**\n * Compare the date parts of two dates\n * @param date1 - The first date to compare\n * @param date2 - The second date to compare\n * @returns A negative value if date1 is earlier than date2, 0 if the dates are equal, or a positive value\n * if date1 is later than date2.\n */\nexport function compareDatePart(date1: Date, date2: Date): number {\n return getDatePartHashValue(date1) - getDatePartHashValue(date2);\n}\n\n/**\n * Gets the date range array including the specified date. The date range array is calculated as the list\n * of dates accounting for the specified first day of the week and date range type.\n * @param date - The input date\n * @param dateRangeType - The desired date range type, i.e., day, week, month, etc.\n * @param firstDayOfWeek - The first day of the week.\n * @param workWeekDays - The allowed days in work week. If not provided, assumes all days are allowed.\n * @param daysToSelectInDayView - The number of days to include when using dateRangeType === DateRangeType.Day\n * for multiday view. Defaults to 1\n * @returns An array of dates representing the date range containing the specified date.\n */\nexport function getDateRangeArray(\n date: Date,\n dateRangeType: DateRangeType,\n firstDayOfWeek: DayOfWeek,\n workWeekDays?: DayOfWeek[],\n daysToSelectInDayView: number = 1,\n): Date[] {\n const datesArray: Date[] = [];\n let startDate: Date;\n let endDate = null;\n\n if (!workWeekDays) {\n workWeekDays = [DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday];\n }\n\n daysToSelectInDayView = Math.max(daysToSelectInDayView, 1);\n\n switch (dateRangeType) {\n case DateRangeType.Day:\n startDate = getDatePart(date);\n endDate = addDays(startDate, daysToSelectInDayView);\n break;\n\n case DateRangeType.Week:\n case DateRangeType.WorkWeek:\n startDate = getStartDateOfWeek(getDatePart(date), firstDayOfWeek);\n endDate = addDays(startDate, TimeConstants.DaysInOneWeek);\n break;\n\n case DateRangeType.Month:\n startDate = new Date(date.getFullYear(), date.getMonth(), 1);\n endDate = addMonths(startDate, 1);\n break;\n\n default:\n throw new Error('Unexpected object: ' + dateRangeType);\n }\n\n // Populate the dates array with the dates in range\n let nextDate = startDate;\n\n do {\n if (dateRangeType !== DateRangeType.WorkWeek) {\n // push all days not in work week view\n datesArray.push(nextDate);\n } else if (workWeekDays.indexOf(nextDate.getDay()) !== -1) {\n datesArray.push(nextDate);\n }\n nextDate = addDays(nextDate, 1);\n } while (!compareDates(nextDate, endDate));\n\n return datesArray;\n}\n\n/**\n * Checks whether the specified date is in the given date range.\n * @param date - The origin date\n * @param dateRange - An array of dates to do the lookup on\n * @returns True if the date matches one of the dates in the specified array, false otherwise.\n */\nexport function isInDateRangeArray(date: Date, dateRange: Date[]): boolean {\n for (const dateInRange of dateRange) {\n if (compareDates(date, dateInRange)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Returns the week number for a date.\n * Week numbers are 1 - 52 (53) in a year\n * @param navigatedDate - A date to find the week number for.\n * @param firstDayOfWeek - The first day of the week (0-6, Sunday = 0)\n * @param firstWeekOfYear - The first week of the year (1-2)\n * @returns The weeks number array for the current month.\n */\nexport function getWeekNumbersInMonth(\n weeksInMonth: number,\n firstDayOfWeek: DayOfWeek,\n firstWeekOfYear: FirstWeekOfYear,\n navigatedDate: Date,\n): number[] {\n const selectedYear = navigatedDate.getFullYear();\n const selectedMonth = navigatedDate.getMonth();\n let dayOfMonth = 1;\n const fistDayOfMonth = new Date(selectedYear, selectedMonth, dayOfMonth);\n const endOfFirstWeek =\n dayOfMonth +\n (firstDayOfWeek + TimeConstants.DaysInOneWeek - 1) -\n adjustWeekDay(firstDayOfWeek, fistDayOfMonth.getDay());\n let endOfWeekRange = new Date(selectedYear, selectedMonth, endOfFirstWeek);\n dayOfMonth = endOfWeekRange.getDate();\n\n const weeksArray = [];\n for (let i = 0; i < weeksInMonth; i++) {\n // Get week number for end of week\n weeksArray.push(getWeekNumber(endOfWeekRange, firstDayOfWeek, firstWeekOfYear));\n dayOfMonth += TimeConstants.DaysInOneWeek;\n endOfWeekRange = new Date(selectedYear, selectedMonth, dayOfMonth);\n }\n return weeksArray;\n}\n\n/**\n * Returns the week number for a date.\n * Week numbers are 1 - 52 (53) in a year\n * @param date - A date to find the week number for.\n * @param firstDayOfWeek - The first day of the week (0-6, Sunday = 0)\n * @param firstWeekOfYear - The first week of the year (1-2)\n * @returns The week's number in the year.\n */\nexport function getWeekNumber(date: Date, firstDayOfWeek: DayOfWeek, firstWeekOfYear: FirstWeekOfYear): number {\n // First four-day week of the year - minumum days count\n const fourDayWeek = 4;\n\n switch (firstWeekOfYear) {\n case FirstWeekOfYear.FirstFullWeek:\n return getWeekOfYearFullDays(date, firstDayOfWeek, TimeConstants.DaysInOneWeek);\n\n case FirstWeekOfYear.FirstFourDayWeek:\n return getWeekOfYearFullDays(date, firstDayOfWeek, fourDayWeek);\n\n default:\n return getFirstDayWeekOfYear(date, firstDayOfWeek);\n }\n}\n\n/**\n * Gets the date for the first day of the week based on the given date assuming\n * the specified first day of the week.\n * @param date - The date to find the beginning of the week date for.\n * @returns A new date object representing the first day of the week containing the input date.\n */\nexport function getStartDateOfWeek(date: Date, firstDayOfWeek: DayOfWeek): Date {\n let daysOffset = firstDayOfWeek - date.getDay();\n if (daysOffset > 0) {\n // If first day of week is > date, go 1 week back, to ensure resulting date is in the past.\n daysOffset -= TimeConstants.DaysInOneWeek;\n }\n return addDays(date, daysOffset);\n}\n\n/**\n * Gets the date for the last day of the week based on the given date assuming\n * the specified first day of the week.\n * @param date - The date to find the beginning of the week date for.\n * @returns A new date object representing the first day of the week containing the input date.\n */\nexport function getEndDateOfWeek(date: Date, firstDayOfWeek: DayOfWeek): Date {\n const lastDayOfWeek = firstDayOfWeek - 1 >= 0 ? firstDayOfWeek - 1 : TimeConstants.DaysInOneWeek - 1;\n let daysOffset = lastDayOfWeek - date.getDay();\n if (daysOffset < 0) {\n // If last day of week is < date, go 1 week forward, to ensure resulting date is in the future.\n daysOffset += TimeConstants.DaysInOneWeek;\n }\n return addDays(date, daysOffset);\n}\n\n/**\n * Gets a new date with the time portion zeroed out, i.e., set to midnight\n * @param date - The origin date\n * @returns A new date with the time set to midnight\n */\nfunction getDatePart(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n}\n\n/**\n * Helper function to assist in date comparisons\n */\nexport function getDatePartHashValue(date: Date): number {\n // Generate date hash value created as sum of Date (up to 31 = 5 bits), Month (up to 11 = 4 bits) and Year.\n // eslint-disable-next-line no-bitwise\n return date.getDate() + (date.getMonth() << 5) + (date.getFullYear() << 9);\n}\n\n/**\n * Helper function for `getWeekNumber`.\n * Returns week number for a date.\n * @param date - current selected date.\n * @param firstDayOfWeek - The first day of week (0-6, Sunday = 0)\n * @param numberOfFullDays - week settings.\n * @returns The week's number in the year.\n */\nfunction getWeekOfYearFullDays(date: Date, firstDayOfWeek: DayOfWeek, numberOfFullDays: number): number {\n const dayOfYear = getDayOfYear(date) - 1;\n let num = date.getDay() - (dayOfYear % TimeConstants.DaysInOneWeek);\n\n const lastDayOfPrevYear = new Date(date.getFullYear() - 1, MonthOfYear.December, 31);\n const daysInYear = getDayOfYear(lastDayOfPrevYear) - 1;\n\n let num2 = (firstDayOfWeek - num + 2 * TimeConstants.DaysInOneWeek) % TimeConstants.DaysInOneWeek;\n if (num2 !== 0 && num2 >= numberOfFullDays) {\n num2 -= TimeConstants.DaysInOneWeek;\n }\n\n let num3 = dayOfYear - num2;\n if (num3 < 0) {\n num -= daysInYear % TimeConstants.DaysInOneWeek;\n num2 = (firstDayOfWeek - num + 2 * TimeConstants.DaysInOneWeek) % TimeConstants.DaysInOneWeek;\n if (num2 !== 0 && num2 + 1 >= numberOfFullDays) {\n num2 -= TimeConstants.DaysInOneWeek;\n }\n\n num3 = daysInYear - num2;\n }\n\n return Math.floor(num3 / TimeConstants.DaysInOneWeek + 1);\n}\n\n/**\n * Helper function for `getWeekNumber`.\n * Returns week number for a date.\n * @param date - current selected date.\n * @param firstDayOfWeek - The first day of week (0-6, Sunday = 0)\n * @returns The week's number in the year.\n */\nfunction getFirstDayWeekOfYear(date: Date, firstDayOfWeek: number): number {\n const num = getDayOfYear(date) - 1;\n const num2 = date.getDay() - (num % TimeConstants.DaysInOneWeek);\n const num3 = (num2 - firstDayOfWeek + 2 * TimeConstants.DaysInOneWeek) % TimeConstants.DaysInOneWeek;\n\n return Math.floor((num + num3) / TimeConstants.DaysInOneWeek + 1);\n}\n\n/**\n * Helper function for `getWeekNumber`.\n * Returns adjusted week day number when `firstDayOfWeek` is other than Sunday.\n * For Week Day Number comparison checks\n * @param firstDayOfWeek - The first day of week (0-6, Sunday = 0)\n * @param dateWeekDay - shifts number forward to 1 week in case passed as true\n * @returns The day of week adjusted to `firstDayOfWeek`; e.g. when `firstDayOfWeek` is Monday (1),\n * Sunday becomes 7.\n */\nfunction adjustWeekDay(firstDayOfWeek: DayOfWeek, dateWeekDay: DayOfWeek): number {\n return firstDayOfWeek !== DayOfWeek.Sunday && dateWeekDay < firstDayOfWeek\n ? dateWeekDay + TimeConstants.DaysInOneWeek\n : dateWeekDay;\n}\n\n/**\n * Returns the day number for a date in a year:\n * the number of days since January 1st in the particular year.\n * @param date - A date to find the day number for.\n * @returns The day's number in the year.\n */\nfunction getDayOfYear(date: Date): number {\n const month = date.getMonth();\n const year = date.getFullYear();\n let daysUntilDate = 0;\n\n for (let i = 0; i < month; i++) {\n daysUntilDate += daysInMonth(i + 1, year);\n }\n\n daysUntilDate += date.getDate();\n\n return daysUntilDate;\n}\n\n/**\n * Returns the number of days in the month\n * @param month - The month number to target (months 1-12).\n * @param year - The year to target.\n * @returns The number of days in the month.\n */\nfunction daysInMonth(month: number, year: number): number {\n return new Date(year, month, 0).getDate();\n}\n"],"names":["addDays","addMonths","addWeeks","addYears","compareDatePart","compareDates","getDatePartHashValue","getDateRangeArray","getEndDateOfWeek","getMonthEnd","getMonthStart","getStartDateOfWeek","getWeekNumber","getWeekNumbersInMonth","getYearEnd","getYearStart","isInDateRangeArray","setMonth","date","days","result","Date","getTime","setDate","getDate","weeks","TimeConstants","DaysInOneWeek","months","newMonth","getMonth","MonthInOneYear","years","setFullYear","getFullYear","month","date1","date2","dateRangeType","firstDayOfWeek","workWeekDays","daysToSelectInDayView","datesArray","startDate","endDate","DayOfWeek","Monday","Tuesday","Wednesday","Thursday","Friday","Math","max","DateRangeType","Day","getDatePart","Week","WorkWeek","Month","Error","nextDate","push","indexOf","getDay","dateRange","dateInRange","weeksInMonth","firstWeekOfYear","navigatedDate","selectedYear","selectedMonth","dayOfMonth","fistDayOfMonth","endOfFirstWeek","adjustWeekDay","endOfWeekRange","weeksArray","i","fourDayWeek","FirstWeekOfYear","FirstFullWeek","getWeekOfYearFullDays","FirstFourDayWeek","getFirstDayWeekOfYear","daysOffset","lastDayOfWeek","numberOfFullDays","dayOfYear","getDayOfYear","num","lastDayOfPrevYear","MonthOfYear","December","daysInYear","num2","num3","floor","dateWeekDay","Sunday","year","daysUntilDate","daysInMonth"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAQgBA,OAAAA;eAAAA;;IAwBAC,SAAAA;eAAAA;;IAZAC,QAAAA;eAAAA;;IAqCAC,QAAAA;eAAAA;;IAyFAC,eAAAA;eAAAA;;IArBAC,YAAAA;eA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KM,OAAO;IAE7B,OAAO4E;AACT;AAEA;;;;;CAKC,GACD,SAASC,YAAYlE,KAAa,EAAEgE,IAAY;IAC9C,OAAO,IAAI9E,KAAK8E,MAAMhE,OAAO,GAAGX,OAAO;AACzC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './dateMath';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './dateMath';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["focus.js"],"sourcesContent":["let targetToFocusOnNextRepaint = undefined;\n/**\n * Sets focus to an element asynchronously. The focus will be set at the next browser repaint,\n * meaning it won't cause any extra recalculations. If more than one focusAsync is called during one frame,\n * only the latest called focusAsync element will actually be focused\n * @param element - The element to focus\n */ export function focusAsync(element, win) {\n if (element) {\n // An element was already queued to be focused, so replace that one with the new element\n if (targetToFocusOnNextRepaint) {\n targetToFocusOnNextRepaint = element;\n return;\n }\n targetToFocusOnNextRepaint = element;\n if (win) {\n // element.focus() is a no-op if the element is no longer in the DOM, meaning this is always safe\n win.requestAnimationFrame(()=>{\n targetToFocusOnNextRepaint && targetToFocusOnNextRepaint.focus();\n // We are done focusing for this frame, so reset the queued focus element\n targetToFocusOnNextRepaint = undefined;\n });\n }\n }\n}\n"],"names":["focusAsync","targetToFocusOnNextRepaint","undefined","element","win","requestAnimationFrame","focus"],"mappings":";;;;+BAMoBA;;;eAAAA;;;AANpB,IAAIC,6BAA6BC;AAMtB,SAASF,WAAWG,OAAO,EAAEC,GAAG;IACvC,IAAID,SAAS;QACT,wFAAwF;QACxF,IAAIF,4BAA4B;YAC5BA,6BAA6BE;YAC7B;QACJ;QACAF,6BAA6BE;QAC7B,IAAIC,KAAK;YACL,iGAAiG;YACjGA,IAAIC,qBAAqB,CAAC;gBACtBJ,8BAA8BA,2BAA2BK,KAAK;gBAC9D,yEAAyE;gBACzEL,6BAA6BC;YACjC;QACJ;IACJ;AACJ"}
1
+ {"version":3,"sources":["focus.ts"],"sourcesContent":["let targetToFocusOnNextRepaint: HTMLElement | { focus: () => void } | null | undefined = undefined;\n\n/**\n * Sets focus to an element asynchronously. The focus will be set at the next browser repaint,\n * meaning it won't cause any extra recalculations. If more than one focusAsync is called during one frame,\n * only the latest called focusAsync element will actually be focused\n * @param element - The element to focus\n */\nexport function focusAsync(\n element: HTMLElement | { focus: () => void } | undefined | null,\n win: Window | undefined | null,\n): void {\n if (element) {\n // An element was already queued to be focused, so replace that one with the new element\n if (targetToFocusOnNextRepaint) {\n targetToFocusOnNextRepaint = element;\n return;\n }\n\n targetToFocusOnNextRepaint = element;\n\n if (win) {\n // element.focus() is a no-op if the element is no longer in the DOM, meaning this is always safe\n win.requestAnimationFrame(() => {\n targetToFocusOnNextRepaint && targetToFocusOnNextRepaint.focus();\n\n // We are done focusing for this frame, so reset the queued focus element\n targetToFocusOnNextRepaint = undefined;\n });\n }\n }\n}\n"],"names":["focusAsync","targetToFocusOnNextRepaint","undefined","element","win","requestAnimationFrame","focus"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQgBA;;;eAAAA;;;AARhB,IAAIC,6BAAqFC;AAQlF,SAASF,WACdG,OAA+D,EAC/DC,GAA8B;IAE9B,IAAID,SAAS;QACX,wFAAwF;QACxF,IAAIF,4BAA4B;YAC9BA,6BAA6BE;YAC7B;QACF;QAEAF,6BAA6BE;QAE7B,IAAIC,KAAK;YACP,iGAAiG;YACjGA,IAAIC,qBAAqB,CAAC;gBACxBJ,8BAA8BA,2BAA2BK,KAAK;gBAE9D,yEAAyE;gBACzEL,6BAA6BC;YAC/B;QACF;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './animations';\nexport * from './constants';\nexport * from './dateFormatting';\nexport * from './dateGrid';\nexport * from './dateMath';\nexport * from './focus';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './animations';\nexport * from './constants';\nexport * from './dateFormatting';\nexport * from './dateGrid';\nexport * from './dateMath';\nexport * from './focus';\n"],"names":[],"rangeMappings":";;;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-calendar-compat",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Calendar compat component for Fluent UI v9",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -32,11 +32,11 @@
32
32
  "dependencies": {
33
33
  "@fluentui/keyboard-keys": "^9.0.7",
34
34
  "@fluentui/react-icons": "^2.0.245",
35
- "@fluentui/react-jsx-runtime": "^9.0.40",
36
- "@fluentui/react-shared-contexts": "^9.19.0",
37
- "@fluentui/react-tabster": "^9.22.1",
35
+ "@fluentui/react-jsx-runtime": "^9.0.42",
36
+ "@fluentui/react-shared-contexts": "^9.20.0",
37
+ "@fluentui/react-tabster": "^9.22.3",
38
38
  "@fluentui/react-theme": "^9.1.19",
39
- "@fluentui/react-utilities": "^9.18.11",
39
+ "@fluentui/react-utilities": "^9.18.13",
40
40
  "@griffel/react": "^1.5.22",
41
41
  "@swc/helpers": "^0.5.1"
42
42
  },