@fluentui/react-calendar-compat 0.1.12 → 0.1.13
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.
- package/CHANGELOG.md +15 -2
- package/lib/Calendar.js.map +1 -1
- package/lib/CalendarDay.js.map +1 -1
- package/lib/CalendarDayGrid.js.map +1 -1
- package/lib/CalendarMonth.js.map +1 -1
- package/lib/CalendarPicker.js.map +1 -1
- package/lib/CalendarYear.js.map +1 -1
- package/lib/components/Calendar/Calendar.js.map +1 -1
- package/lib/components/Calendar/Calendar.types.js +4 -4
- package/lib/components/Calendar/Calendar.types.js.map +1 -1
- package/lib/components/Calendar/calendarNavigationIcons.js.map +1 -1
- package/lib/components/Calendar/defaults.js.map +1 -1
- package/lib/components/Calendar/index.js.map +1 -1
- package/lib/components/CalendarDay/CalendarDay.js.map +1 -1
- package/lib/components/CalendarDay/CalendarDay.types.js.map +1 -1
- package/lib/components/CalendarDay/index.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.types.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
- package/lib/components/CalendarDayGrid/index.js.map +1 -1
- package/lib/components/CalendarDayGrid/useWeeks.js.map +1 -1
- package/lib/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib/components/CalendarMonth/CalendarMonth.types.js.map +1 -1
- package/lib/components/CalendarMonth/index.js.map +1 -1
- package/lib/components/CalendarPicker/CalendarPicker.types.js +3 -1
- package/lib/components/CalendarPicker/CalendarPicker.types.js.map +1 -1
- package/lib/components/CalendarPicker/index.js.map +1 -1
- package/lib/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib/components/CalendarYear/CalendarYear.types.js.map +1 -1
- package/lib/components/CalendarYear/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/animations.js.map +1 -1
- package/lib/utils/constants.js.map +1 -1
- package/lib/utils/dateFormatting/dateFormatting.defaults.js.map +1 -1
- package/lib/utils/dateFormatting/dateFormatting.types.js.map +1 -1
- package/lib/utils/dateFormatting/index.js.map +1 -1
- package/lib/utils/dateGrid/dateGrid.types.js.map +1 -1
- package/lib/utils/dateGrid/findAvailableDate.js.map +1 -1
- package/lib/utils/dateGrid/getBoundedDateRange.js.map +1 -1
- package/lib/utils/dateGrid/getDateRangeTypeToUse.js.map +1 -1
- package/lib/utils/dateGrid/getDayGrid.js.map +1 -1
- package/lib/utils/dateGrid/index.js.map +1 -1
- package/lib/utils/dateGrid/isAfterMaxDate.js.map +1 -1
- package/lib/utils/dateGrid/isBeforeMinDate.js.map +1 -1
- package/lib/utils/dateGrid/isContiguous.js.map +1 -1
- package/lib/utils/dateGrid/isRestrictedDate.js.map +1 -1
- package/lib/utils/dateMath/dateMath.js.map +1 -1
- package/lib/utils/dateMath/index.js.map +1 -1
- package/lib/utils/focus.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib-commonjs/Calendar.js.map +1 -1
- package/lib-commonjs/CalendarDay.js.map +1 -1
- package/lib-commonjs/CalendarDayGrid.js.map +1 -1
- package/lib-commonjs/CalendarMonth.js.map +1 -1
- package/lib-commonjs/CalendarPicker.js.map +1 -1
- package/lib-commonjs/CalendarYear.js.map +1 -1
- package/lib-commonjs/components/Calendar/Calendar.js.map +1 -1
- package/lib-commonjs/components/Calendar/Calendar.types.js +4 -4
- package/lib-commonjs/components/Calendar/Calendar.types.js.map +1 -1
- package/lib-commonjs/components/Calendar/calendarNavigationIcons.js.map +1 -1
- package/lib-commonjs/components/Calendar/defaults.js.map +1 -1
- package/lib-commonjs/components/Calendar/index.js.map +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/CalendarDay.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/CalendarDay.types.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/index.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.types.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/index.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useWeekCornerStyles.styles.js +3 -3
- package/lib-commonjs/components/CalendarDayGrid/useWeekCornerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useWeeks.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.types.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/index.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/CalendarPicker.types.js +3 -1
- package/lib-commonjs/components/CalendarPicker/CalendarPicker.types.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/index.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/CalendarYear.types.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/index.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +44 -44
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/animations.js +9 -9
- package/lib-commonjs/utils/animations.js.map +1 -1
- package/lib-commonjs/utils/constants.js +8 -8
- package/lib-commonjs/utils/constants.js.map +1 -1
- package/lib-commonjs/utils/dateFormatting/dateFormatting.defaults.js +12 -12
- package/lib-commonjs/utils/dateFormatting/dateFormatting.defaults.js.map +1 -1
- package/lib-commonjs/utils/dateFormatting/dateFormatting.types.js.map +1 -1
- package/lib-commonjs/utils/dateFormatting/index.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/dateGrid.types.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/findAvailableDate.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/getBoundedDateRange.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/getDateRangeTypeToUse.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/getDayGrid.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/index.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isAfterMaxDate.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isBeforeMinDate.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isContiguous.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isRestrictedDate.js.map +1 -1
- package/lib-commonjs/utils/dateMath/dateMath.js +29 -29
- package/lib-commonjs/utils/dateMath/dateMath.js.map +1 -1
- package/lib-commonjs/utils/dateMath/index.js.map +1 -1
- package/lib-commonjs/utils/focus.js.map +1 -1
- package/lib-commonjs/utils/index.js.map +1 -1
- package/package.json +5 -5
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './dateGrid.types';\nexport * from './findAvailableDate';\nexport * from './getBoundedDateRange';\nexport * from './getDayGrid';\nexport * from './isRestrictedDate';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,sBAAsB;AACpC,cAAc,wBAAwB;AACtC,cAAc,eAAe;AAC7B,cAAc,qBAAqB"}
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './dateGrid.types';\nexport * from './findAvailableDate';\nexport * from './getBoundedDateRange';\nexport * from './getDayGrid';\nexport * from './isRestrictedDate';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,sBAAsB;AACpC,cAAc,wBAAwB;AACtC,cAAc,eAAe;AAC7B,cAAc,qBAAqB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["isAfterMaxDate.ts"],"sourcesContent":["import { RestrictedDatesOptions } from './dateGrid.types';\nimport { compareDatePart } from '../dateMath/dateMath';\n\n/**\n * Checks if `date` happens later than max date\n * @param date - date to check\n * @param options - object with max date to check against\n */\nexport const isAfterMaxDate = (date: Date, options: RestrictedDatesOptions): boolean => {\n const { maxDate } = options;\n return maxDate ? compareDatePart(date, maxDate) >= 1 : false;\n};\n"],"names":["compareDatePart","isAfterMaxDate","date","options","maxDate"],"mappings":"AACA,SAASA,eAAe,QAAQ,uBAAuB;AAEvD;;;;CAIC,GACD,OAAO,MAAMC,iBAAiB,CAACC,MAAYC;IACzC,MAAM,EAAEC,OAAO,EAAE,GAAGD;IACpB,OAAOC,UAAUJ,gBAAgBE,MAAME,YAAY,IAAI;AACzD,EAAE"}
|
1
|
+
{"version":3,"sources":["isAfterMaxDate.ts"],"sourcesContent":["import { RestrictedDatesOptions } from './dateGrid.types';\nimport { compareDatePart } from '../dateMath/dateMath';\n\n/**\n * Checks if `date` happens later than max date\n * @param date - date to check\n * @param options - object with max date to check against\n */\nexport const isAfterMaxDate = (date: Date, options: RestrictedDatesOptions): boolean => {\n const { maxDate } = options;\n return maxDate ? compareDatePart(date, maxDate) >= 1 : false;\n};\n"],"names":["compareDatePart","isAfterMaxDate","date","options","maxDate"],"rangeMappings":";;;;;;;;","mappings":"AACA,SAASA,eAAe,QAAQ,uBAAuB;AAEvD;;;;CAIC,GACD,OAAO,MAAMC,iBAAiB,CAACC,MAAYC;IACzC,MAAM,EAAEC,OAAO,EAAE,GAAGD;IACpB,OAAOC,UAAUJ,gBAAgBE,MAAME,YAAY,IAAI;AACzD,EAAE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["isBeforeMinDate.ts"],"sourcesContent":["import { RestrictedDatesOptions } from './dateGrid.types';\nimport { compareDatePart } from '../dateMath/dateMath';\n\n/**\n * Checks if `date` happens earlier than min date\n * @param date - date to check\n * @param options - object with min date to check against\n */\nexport const isBeforeMinDate = (date: Date, options: RestrictedDatesOptions): boolean => {\n const { minDate } = options;\n return minDate ? compareDatePart(minDate, date) >= 1 : false;\n};\n"],"names":["compareDatePart","isBeforeMinDate","date","options","minDate"],"mappings":"AACA,SAASA,eAAe,QAAQ,uBAAuB;AAEvD;;;;CAIC,GACD,OAAO,MAAMC,kBAAkB,CAACC,MAAYC;IAC1C,MAAM,EAAEC,OAAO,EAAE,GAAGD;IACpB,OAAOC,UAAUJ,gBAAgBI,SAASF,SAAS,IAAI;AACzD,EAAE"}
|
1
|
+
{"version":3,"sources":["isBeforeMinDate.ts"],"sourcesContent":["import { RestrictedDatesOptions } from './dateGrid.types';\nimport { compareDatePart } from '../dateMath/dateMath';\n\n/**\n * Checks if `date` happens earlier than min date\n * @param date - date to check\n * @param options - object with min date to check against\n */\nexport const isBeforeMinDate = (date: Date, options: RestrictedDatesOptions): boolean => {\n const { minDate } = options;\n return minDate ? compareDatePart(minDate, date) >= 1 : false;\n};\n"],"names":["compareDatePart","isBeforeMinDate","date","options","minDate"],"rangeMappings":";;;;;;;;","mappings":"AACA,SAASA,eAAe,QAAQ,uBAAuB;AAEvD;;;;CAIC,GACD,OAAO,MAAMC,kBAAkB,CAACC,MAAYC;IAC1C,MAAM,EAAEC,OAAO,EAAE,GAAGD;IACpB,OAAOC,UAAUJ,gBAAgBI,SAASF,SAAS,IAAI;AACzD,EAAE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["isContiguous.ts"],"sourcesContent":["import { DayOfWeek } from '../constants';\n\n/**\n * Returns whether provided week days are contiguous.\n * @param days - list of days in a week\n * @param isSingleWeek - decides whether the contiguous logic applies across week boundaries or not\n * @param firstDayOfWeek - decides which day of week is the first one in the order.\n */\nexport const isContiguous = (days: DayOfWeek[], isSingleWeek: boolean, firstDayOfWeek: DayOfWeek): boolean => {\n const daySet = new Set(days);\n let amountOfNoNeighbors = 0;\n for (const day of days) {\n const nextDay = (day + 1) % 7;\n if (!(daySet.has(nextDay) && (!isSingleWeek || firstDayOfWeek !== nextDay))) {\n amountOfNoNeighbors++;\n }\n }\n\n // In case the full week is provided, then each day has a neighbor\n //, otherwise the last day does not have a neighbor.\n return amountOfNoNeighbors < 2;\n};\n"],"names":["isContiguous","days","isSingleWeek","firstDayOfWeek","daySet","Set","amountOfNoNeighbors","day","nextDay","has"],"mappings":"AAEA;;;;;CAKC,GACD,OAAO,MAAMA,eAAe,CAACC,MAAmBC,cAAuBC;IACrE,MAAMC,SAAS,IAAIC,IAAIJ;IACvB,IAAIK,sBAAsB;IAC1B,KAAK,MAAMC,OAAON,KAAM;QACtB,MAAMO,UAAU,AAACD,CAAAA,MAAM,CAAA,IAAK;QAC5B,IAAI,CAAEH,CAAAA,OAAOK,GAAG,CAACD,YAAa,CAAA,CAACN,gBAAgBC,mBAAmBK,OAAM,CAAC,GAAI;YAC3EF;QACF;IACF;IAEA,kEAAkE;IAClE,oDAAoD;IACpD,OAAOA,sBAAsB;AAC/B,EAAE"}
|
1
|
+
{"version":3,"sources":["isContiguous.ts"],"sourcesContent":["import { DayOfWeek } from '../constants';\n\n/**\n * Returns whether provided week days are contiguous.\n * @param days - list of days in a week\n * @param isSingleWeek - decides whether the contiguous logic applies across week boundaries or not\n * @param firstDayOfWeek - decides which day of week is the first one in the order.\n */\nexport const isContiguous = (days: DayOfWeek[], isSingleWeek: boolean, firstDayOfWeek: DayOfWeek): boolean => {\n const daySet = new Set(days);\n let amountOfNoNeighbors = 0;\n for (const day of days) {\n const nextDay = (day + 1) % 7;\n if (!(daySet.has(nextDay) && (!isSingleWeek || firstDayOfWeek !== nextDay))) {\n amountOfNoNeighbors++;\n }\n }\n\n // In case the full week is provided, then each day has a neighbor\n //, otherwise the last day does not have a neighbor.\n return amountOfNoNeighbors < 2;\n};\n"],"names":["isContiguous","days","isSingleWeek","firstDayOfWeek","daySet","Set","amountOfNoNeighbors","day","nextDay","has"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAEA;;;;;CAKC,GACD,OAAO,MAAMA,eAAe,CAACC,MAAmBC,cAAuBC;IACrE,MAAMC,SAAS,IAAIC,IAAIJ;IACvB,IAAIK,sBAAsB;IAC1B,KAAK,MAAMC,OAAON,KAAM;QACtB,MAAMO,UAAU,AAACD,CAAAA,MAAM,CAAA,IAAK;QAC5B,IAAI,CAAEH,CAAAA,OAAOK,GAAG,CAACD,YAAa,CAAA,CAACN,gBAAgBC,mBAAmBK,OAAM,CAAC,GAAI;YAC3EF;QACF;IACF;IAEA,kEAAkE;IAClE,oDAAoD;IACpD,OAAOA,sBAAsB;AAC/B,EAAE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["isRestrictedDate.ts"],"sourcesContent":["import { RestrictedDatesOptions } from './dateGrid.types';\nimport { compareDates } from '../dateMath/dateMath';\nimport { isBeforeMinDate } from './isBeforeMinDate';\nimport { isAfterMaxDate } from './isAfterMaxDate';\n\n/**\n * Checks if `date` falls into the restricted `options`\n * @param date - date to check\n * @param options - restriction options (min date, max date and list of restricted dates)\n */\nexport const isRestrictedDate = (date: Date, options: RestrictedDatesOptions): boolean => {\n const { restrictedDates, minDate, maxDate } = options;\n if (!restrictedDates && !minDate && !maxDate) {\n return false;\n }\n const inRestrictedDates = restrictedDates && restrictedDates.some((rd: Date) => compareDates(rd, date));\n return inRestrictedDates || isBeforeMinDate(date, options) || isAfterMaxDate(date, options);\n};\n"],"names":["compareDates","isBeforeMinDate","isAfterMaxDate","isRestrictedDate","date","options","restrictedDates","minDate","maxDate","inRestrictedDates","some","rd"],"mappings":"AACA,SAASA,YAAY,QAAQ,uBAAuB;AACpD,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAASC,cAAc,QAAQ,mBAAmB;AAElD;;;;CAIC,GACD,OAAO,MAAMC,mBAAmB,CAACC,MAAYC;IAC3C,MAAM,EAAEC,eAAe,EAAEC,OAAO,EAAEC,OAAO,EAAE,GAAGH;IAC9C,IAAI,CAACC,mBAAmB,CAACC,WAAW,CAACC,SAAS;QAC5C,OAAO;IACT;IACA,MAAMC,oBAAoBH,mBAAmBA,gBAAgBI,IAAI,CAAC,CAACC,KAAaX,aAAaW,IAAIP;IACjG,OAAOK,qBAAqBR,gBAAgBG,MAAMC,YAAYH,eAAeE,MAAMC;AACrF,EAAE"}
|
1
|
+
{"version":3,"sources":["isRestrictedDate.ts"],"sourcesContent":["import { RestrictedDatesOptions } from './dateGrid.types';\nimport { compareDates } from '../dateMath/dateMath';\nimport { isBeforeMinDate } from './isBeforeMinDate';\nimport { isAfterMaxDate } from './isAfterMaxDate';\n\n/**\n * Checks if `date` falls into the restricted `options`\n * @param date - date to check\n * @param options - restriction options (min date, max date and list of restricted dates)\n */\nexport const isRestrictedDate = (date: Date, options: RestrictedDatesOptions): boolean => {\n const { restrictedDates, minDate, maxDate } = options;\n if (!restrictedDates && !minDate && !maxDate) {\n return false;\n }\n const inRestrictedDates = restrictedDates && restrictedDates.some((rd: Date) => compareDates(rd, date));\n return inRestrictedDates || isBeforeMinDate(date, options) || isAfterMaxDate(date, options);\n};\n"],"names":["compareDates","isBeforeMinDate","isAfterMaxDate","isRestrictedDate","date","options","restrictedDates","minDate","maxDate","inRestrictedDates","some","rd"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AACA,SAASA,YAAY,QAAQ,uBAAuB;AACpD,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAASC,cAAc,QAAQ,mBAAmB;AAElD;;;;CAIC,GACD,OAAO,MAAMC,mBAAmB,CAACC,MAAYC;IAC3C,MAAM,EAAEC,eAAe,EAAEC,OAAO,EAAEC,OAAO,EAAE,GAAGH;IAC9C,IAAI,CAACC,mBAAmB,CAACC,WAAW,CAACC,SAAS;QAC5C,OAAO;IACT;IACA,MAAMC,oBAAoBH,mBAAmBA,gBAAgBI,IAAI,CAAC,CAACC,KAAaX,aAAaW,IAAIP;IACjG,OAAOK,qBAAqBR,gBAAgBG,MAAMC,YAAYH,eAAeE,MAAMC;AACrF,EAAE"}
|
@@ -1 +1 @@
|
|
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":["DateRangeType","DayOfWeek","FirstWeekOfYear","MonthOfYear","TimeConstants","addDays","date","days","result","Date","getTime","setDate","getDate","addWeeks","weeks","DaysInOneWeek","addMonths","months","newMonth","getMonth","setMonth","MonthInOneYear","addYears","years","setFullYear","getFullYear","getMonthStart","getMonthEnd","getYearStart","getYearEnd","month","compareDates","date1","date2","compareDatePart","getDatePartHashValue","getDateRangeArray","dateRangeType","firstDayOfWeek","workWeekDays","daysToSelectInDayView","datesArray","startDate","endDate","Monday","Tuesday","Wednesday","Thursday","Friday","Math","max","Day","getDatePart","Week","WorkWeek","getStartDateOfWeek","Month","Error","nextDate","push","indexOf","getDay","isInDateRangeArray","dateRange","dateInRange","getWeekNumbersInMonth","weeksInMonth","firstWeekOfYear","navigatedDate","selectedYear","selectedMonth","dayOfMonth","fistDayOfMonth","endOfFirstWeek","adjustWeekDay","endOfWeekRange","weeksArray","i","getWeekNumber","fourDayWeek","FirstFullWeek","getWeekOfYearFullDays","FirstFourDayWeek","getFirstDayWeekOfYear","daysOffset","getEndDateOfWeek","lastDayOfWeek","numberOfFullDays","dayOfYear","getDayOfYear","num","lastDayOfPrevYear","December","daysInYear","num2","num3","floor","dateWeekDay","Sunday","year","daysUntilDate","daysInMonth"],"mappings":"AAAA,SAASA,aAAa,EAAEC,SAAS,EAAEC,eAAe,EAAEC,WAAW,EAAEC,aAAa,QAAQ,eAAe;AAErG;;;;;CAKC,GACD,OAAO,SAASC,QAAQC,IAAU,EAAEC,IAAY;IAC9C,MAAMC,SAAS,IAAIC,KAAKH,KAAKI,OAAO;IACpCF,OAAOG,OAAO,CAACH,OAAOI,OAAO,KAAKL;IAClC,OAAOC;AACT;AAEA;;;;;CAKC,GACD,OAAO,SAASK,SAASP,IAAU,EAAEQ,KAAa;IAChD,OAAOT,QAAQC,MAAMQ,QAAQV,cAAcW,aAAa;AAC1D;AAEA;;;;;;;CAOC,GACD,OAAO,SAASC,UAAUV,IAAU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aAAa;IAC/D,MAAMgF,OAAO,AAACD,CAAAA,OAAOxD,iBAAiB,IAAIlC,cAAcW,aAAa,AAAD,IAAKX,cAAcW,aAAa;IAEpG,OAAOkC,KAAK+C,KAAK,CAAC,AAACN,CAAAA,MAAMK,IAAG,IAAK3F,cAAcW,aAAa,GAAG;AACjE;AAEA;;;;;;;;CAQC,GACD,SAAS2D,cAAcpC,cAAyB,EAAE2D,WAAsB;IACtE,OAAO3D,mBAAmBrC,UAAUiG,MAAM,IAAID,cAAc3D,iBACxD2D,cAAc7F,cAAcW,aAAa,GACzCkF;AACN;AAEA;;;;;CAKC,GACD,SAASR,aAAanF,IAAU;IAC9B,MAAMwB,QAAQxB,KAAKa,QAAQ;IAC3B,MAAMgF,OAAO7F,KAAKmB,WAAW;IAC7B,IAAI2E,gBAAgB;IAEpB,IAAK,IAAIvB,IAAI,GAAGA,IAAI/C,OAAO+C,IAAK;QAC9BuB,iBAAiBC,YAAYxB,IAAI,GAAGsB;IACtC;IAEAC,iBAAiB9F,KAAKM,OAAO;IAE7B,OAAOwF;AACT;AAEA;;;;;CAKC,GACD,SAASC,YAAYvE,KAAa,EAAEqE,IAAY;IAC9C,OAAO,IAAI1F,KAAK0F,MAAMrE,OAAO,GAAGlB,OAAO;AACzC"}
|
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":["DateRangeType","DayOfWeek","FirstWeekOfYear","MonthOfYear","TimeConstants","addDays","date","days","result","Date","getTime","setDate","getDate","addWeeks","weeks","DaysInOneWeek","addMonths","months","newMonth","getMonth","setMonth","MonthInOneYear","addYears","years","setFullYear","getFullYear","getMonthStart","getMonthEnd","getYearStart","getYearEnd","month","compareDates","date1","date2","compareDatePart","getDatePartHashValue","getDateRangeArray","dateRangeType","firstDayOfWeek","workWeekDays","daysToSelectInDayView","datesArray","startDate","endDate","Monday","Tuesday","Wednesday","Thursday","Friday","Math","max","Day","getDatePart","Week","WorkWeek","getStartDateOfWeek","Month","Error","nextDate","push","indexOf","getDay","isInDateRangeArray","dateRange","dateInRange","getWeekNumbersInMonth","weeksInMonth","firstWeekOfYear","navigatedDate","selectedYear","selectedMonth","dayOfMonth","fistDayOfMonth","endOfFirstWeek","adjustWeekDay","endOfWeekRange","weeksArray","i","getWeekNumber","fourDayWeek","FirstFullWeek","getWeekOfYearFullDays","FirstFourDayWeek","getFirstDayWeekOfYear","daysOffset","getEndDateOfWeek","lastDayOfWeek","numberOfFullDays","dayOfYear","getDayOfYear","num","lastDayOfPrevYear","December","daysInYear","num2","num3","floor","dateWeekDay","Sunday","year","daysUntilDate","daysInMonth"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,aAAa,EAAEC,SAAS,EAAEC,eAAe,EAAEC,WAAW,EAAEC,aAAa,QAAQ,eAAe;AAErG;;;;;CAKC,GACD,OAAO,SAASC,QAAQC,IAAU,EAAEC,IAAY;IAC9C,MAAMC,SAAS,IAAIC,KAAKH,KAAKI,OAAO;IACpCF,OAAOG,OAAO,CAACH,OAAOI,OAAO,KAAKL;IAClC,OAAOC;AACT;AAEA;;;;;CAKC,GACD,OAAO,SAASK,SAASP,IAAU,EAAEQ,KAAa;IAChD,OAAOT,QAAQC,MAAMQ,QAAQV,cAAcW,aAAa;AAC1D;AAEA;;;;;;;CAOC,GACD,OAAO,SAASC,UAAUV,IAAU,EAAEW,MAAc;IAClD,IAAIT,SAAS,IAAIC,KAAKH,KAAKI,OAAO;IAClC,MAAMQ,WAAWV,OAAOW,QAAQ,KAAKF;IACrCT,OAAOY,QAAQ,CAACF;IAEhB,qHAAqH;IACrH,oDAAoD;IACpD,qFAAqF;IACrF,IACEV,OAAOW,QAAQ,OACf,AAAC,CAAA,AAACD,WAAWd,cAAciB,cAAc,GAAIjB,cAAciB,cAAc,AAAD,IAAKjB,cAAciB,cAAc,EACzG;QACAb,SAASH,QAAQ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D,iBACxD2D,cAAc7F,cAAcW,aAAa,GACzCkF;AACN;AAEA;;;;;CAKC,GACD,SAASR,aAAanF,IAAU;IAC9B,MAAMwB,QAAQxB,KAAKa,QAAQ;IAC3B,MAAMgF,OAAO7F,KAAKmB,WAAW;IAC7B,IAAI2E,gBAAgB;IAEpB,IAAK,IAAIvB,IAAI,GAAGA,IAAI/C,OAAO+C,IAAK;QAC9BuB,iBAAiBC,YAAYxB,IAAI,GAAGsB;IACtC;IAEAC,iBAAiB9F,KAAKM,OAAO;IAE7B,OAAOwF;AACT;AAEA;;;;;CAKC,GACD,SAASC,YAAYvE,KAAa,EAAEqE,IAAY;IAC9C,OAAO,IAAI1F,KAAK0F,MAAMrE,OAAO,GAAGlB,OAAO;AACzC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './dateMath';\n"],"names":[],"mappings":"AAAA,cAAc,aAAa"}
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './dateMath';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,aAAa"}
|
package/lib/utils/focus.js.map
CHANGED
@@ -1 +1 @@
|
|
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":["targetToFocusOnNextRepaint","undefined","focusAsync","element","win","requestAnimationFrame","focus"],"mappings":"AAAA,IAAIA,6BAAqFC;AAEzF;;;;;CAKC,GACD,OAAO,SAASC,WACdC,OAA+D,EAC/DC,GAA8B;IAE9B,IAAID,SAAS;QACX,wFAAwF;QACxF,IAAIH,4BAA4B;YAC9BA,6BAA6BG;YAC7B;QACF;QAEAH,6BAA6BG;QAE7B,IAAIC,KAAK;YACP,iGAAiG;YACjGA,IAAIC,qBAAqB,CAAC;gBACxBL,8BAA8BA,2BAA2BM,KAAK;gBAE9D,yEAAyE;gBACzEN,6BAA6BC;YAC/B;QACF;IACF;AACF"}
|
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":["targetToFocusOnNextRepaint","undefined","focusAsync","element","win","requestAnimationFrame","focus"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,IAAIA,6BAAqFC;AAEzF;;;;;CAKC,GACD,OAAO,SAASC,WACdC,OAA+D,EAC/DC,GAA8B;IAE9B,IAAID,SAAS;QACX,wFAAwF;QACxF,IAAIH,4BAA4B;YAC9BA,6BAA6BG;YAC7B;QACF;QAEAH,6BAA6BG;QAE7B,IAAIC,KAAK;YACP,iGAAiG;YACjGA,IAAIC,qBAAqB,CAAC;gBACxBL,8BAA8BA,2BAA2BM,KAAK;gBAE9D,yEAAyE;gBACzEN,6BAA6BC;YAC/B;QACF;IACF;AACF"}
|
package/lib/utils/index.js.map
CHANGED
@@ -1 +1 @@
|
|
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":[],"mappings":"AAAA,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,mBAAmB;AACjC,cAAc,aAAa;AAC3B,cAAc,aAAa;AAC3B,cAAc,UAAU"}
|
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":"AAAA,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,mBAAmB;AACjC,cAAc,aAAa;AAC3B,cAAc,aAAa;AAC3B,cAAc,UAAU"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Calendar.
|
1
|
+
{"version":3,"sources":["Calendar.ts"],"sourcesContent":["export * from './components/Calendar/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["CalendarDay.
|
1
|
+
{"version":3,"sources":["CalendarDay.ts"],"sourcesContent":["export * from './components/CalendarDay/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["CalendarDayGrid.
|
1
|
+
{"version":3,"sources":["CalendarDayGrid.ts"],"sourcesContent":["export * from './components/CalendarDayGrid/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["CalendarMonth.
|
1
|
+
{"version":3,"sources":["CalendarMonth.ts"],"sourcesContent":["export * from './components/CalendarMonth/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["CalendarPicker.
|
1
|
+
{"version":3,"sources":["CalendarPicker.ts"],"sourcesContent":["export * from './components/CalendarPicker/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["CalendarYear.
|
1
|
+
{"version":3,"sources":["CalendarYear.ts"],"sourcesContent":["export * from './components/CalendarYear/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Calendar.js"],"sourcesContent":["import * as React from 'react';\nimport { Backspace, Enter, Escape, PageDown, PageUp, Space } from '@fluentui/keyboard-keys';\nimport { useControllableState } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { addMonths, addYears, DateRangeType, DayOfWeek, DEFAULT_CALENDAR_STRINGS, DEFAULT_DATE_FORMATTING, FirstWeekOfYear, focusAsync } from '../../utils';\nimport { CalendarDay } from '../CalendarDay/CalendarDay';\nimport { CalendarMonth } from '../CalendarMonth/CalendarMonth';\nimport { defaultNavigationIcons } from './calendarNavigationIcons';\nimport { useCalendarStyles_unstable } from './useCalendarStyles.styles';\nconst MIN_SIZE_FORCE_OVERLAY = 440;\nconst defaultWorkWeekDays = [\n DayOfWeek.Monday,\n DayOfWeek.Tuesday,\n DayOfWeek.Wednesday,\n DayOfWeek.Thursday,\n DayOfWeek.Friday\n];\nfunction useDateState(props) {\n const { value, today: todayProp, onSelectDate } = props;\n const today = React.useMemo(()=>todayProp !== null && todayProp !== void 0 ? todayProp : new Date(), [\n todayProp\n ]);\n /** The currently selected date in the calendar */ const [selectedDate, setSelectedDate] = useControllableState({\n state: value,\n defaultState: value ? undefined : today,\n initialState: today\n });\n /** The currently focused date in the day picker, but not necessarily selected */ const [navigatedDay = today, setNavigatedDay] = React.useState(value);\n /** The currently focused date in the month picker, but not necessarily selected */ const [navigatedMonth = today, setNavigatedMonth] = React.useState(value);\n /** If using a controlled value, when that value changes, navigate to that date */ const [lastSelectedDate = today, setLastSelectedDate] = React.useState(value);\n if (value && lastSelectedDate.valueOf() !== value.valueOf()) {\n setNavigatedDay(value);\n setNavigatedMonth(value);\n setLastSelectedDate(value);\n }\n const navigateMonth = (date)=>{\n setNavigatedMonth(date);\n };\n const navigateDay = (date)=>{\n setNavigatedMonth(date);\n setNavigatedDay(date);\n };\n const onDateSelected = (date, selectedDateRangeArray)=>{\n setNavigatedMonth(date);\n setNavigatedDay(date);\n setSelectedDate(date);\n onSelectDate === null || onSelectDate === void 0 ? void 0 : onSelectDate(date, selectedDateRangeArray);\n };\n return [\n selectedDate,\n navigatedDay,\n navigatedMonth,\n onDateSelected,\n navigateDay,\n navigateMonth\n ];\n}\nfunction useVisibilityState({ isDayPickerVisible: isDayPickerVisibleProp, isMonthPickerVisible: isMonthPickerVisibleProp, showMonthPickerAsOverlay }) {\n /** State used to show/hide month picker */ const showMonthPickerAsOverlayState = useShowMonthPickerAsOverlay({\n isDayPickerVisible: isDayPickerVisibleProp,\n showMonthPickerAsOverlay\n });\n const [isMonthPickerVisible, setIsMonthPickerVisible] = React.useState(()=>showMonthPickerAsOverlayState ? false : isMonthPickerVisibleProp !== null && isMonthPickerVisibleProp !== void 0 ? isMonthPickerVisibleProp : false);\n /** State used to show/hide day picker */ const [isDayPickerVisible, setIsDayPickerVisible] = React.useState(()=>showMonthPickerAsOverlayState ? true : isDayPickerVisibleProp !== null && isDayPickerVisibleProp !== void 0 ? isDayPickerVisibleProp : true);\n const toggleDayMonthPickerVisibility = ()=>{\n setIsMonthPickerVisible(!isMonthPickerVisible);\n setIsDayPickerVisible(!isDayPickerVisible);\n };\n return [\n isMonthPickerVisible,\n isDayPickerVisible,\n toggleDayMonthPickerVisibility\n ];\n}\nfunction useFocusLogic({ componentRef }, isDayPickerVisible, isMonthPickerVisible) {\n const dayPicker = React.useRef(null);\n const monthPicker = React.useRef(null);\n const focusOnUpdate = React.useRef(false);\n const { targetDocument } = useFluent();\n const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;\n const focus = React.useCallback(()=>{\n if (isDayPickerVisible && dayPicker.current) {\n focusAsync(dayPicker.current, win);\n } else if (isMonthPickerVisible && monthPicker.current) {\n focusAsync(monthPicker.current, win);\n }\n }, [\n isDayPickerVisible,\n isMonthPickerVisible,\n win\n ]);\n React.useImperativeHandle(componentRef, ()=>({\n focus\n }), [\n focus\n ]);\n React.useEffect(()=>{\n if (focusOnUpdate.current) {\n focus();\n focusOnUpdate.current = false;\n }\n });\n const focusOnNextUpdate = ()=>{\n focusOnUpdate.current = true;\n };\n return [\n dayPicker,\n monthPicker,\n focusOnNextUpdate\n ];\n}\n/**\n * @internal\n */ export const Calendar = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{\n const { allFocusable = false, calendarDayProps, calendarMonthProps, className, componentRef, dateRangeType = DateRangeType.Day, dateTimeFormatter = DEFAULT_DATE_FORMATTING, firstDayOfWeek = DayOfWeek.Sunday, firstWeekOfYear = FirstWeekOfYear.FirstDay, highlightCurrentMonth = false, highlightSelectedMonth = false, id, isDayPickerVisible: isDayPickerVisibleProp = true, isMonthPickerVisible: isMonthPickerVisibleProp = true, maxDate, minDate, onDismiss, onSelectDate, restrictedDates, showCloseButton = false, showGoToToday = true, showMonthPickerAsOverlay: showMonthPickerAsOverlayProp = false, showSixWeeksByDefault = false, showWeekNumbers = false, strings = DEFAULT_CALENDAR_STRINGS, today: todayProp, value, workWeekDays = defaultWorkWeekDays } = props;\n const today = React.useMemo(()=>{\n return todayProp !== null && todayProp !== void 0 ? todayProp : new Date();\n }, [\n todayProp\n ]);\n const [selectedDate, navigatedDay, navigatedMonth, onDateSelected, navigateDay, navigateMonth] = useDateState({\n onSelectDate,\n value,\n today\n });\n const [isMonthPickerVisible, isDayPickerVisible, toggleDayMonthPickerVisibility] = useVisibilityState({\n isDayPickerVisible: isDayPickerVisibleProp,\n isMonthPickerVisible: isMonthPickerVisibleProp,\n showMonthPickerAsOverlay: showMonthPickerAsOverlayProp\n });\n const [dayPicker, monthPicker, focusOnNextUpdate] = useFocusLogic({\n componentRef\n }, isDayPickerVisible, isMonthPickerVisible);\n const renderGoToTodayButton = ()=>{\n let goTodayEnabled = showGoToToday;\n if (goTodayEnabled && today) {\n goTodayEnabled = navigatedDay.getFullYear() !== today.getFullYear() || navigatedDay.getMonth() !== today.getMonth() || navigatedMonth.getFullYear() !== today.getFullYear() || navigatedMonth.getMonth() !== today.getMonth();\n }\n return showGoToToday && /*#__PURE__*/ React.createElement(\"button\", {\n className: classes.goTodayButton,\n onClick: onGotoToday,\n onKeyDown: onButtonKeyDown(onGotoToday),\n type: \"button\",\n disabled: !goTodayEnabled\n }, strings.goToToday);\n };\n const onNavigateDayDate = (date, focusOnNavigatedDay)=>{\n navigateDay(date);\n if (focusOnNavigatedDay) {\n focusOnNextUpdate();\n }\n };\n const onNavigateMonthDate = (date, focusOnNavigatedDay)=>{\n if (focusOnNavigatedDay) {\n focusOnNextUpdate();\n }\n if (!focusOnNavigatedDay) {\n navigateMonth(date);\n return;\n }\n if (monthPickerOnly) {\n onDateSelected(date);\n }\n navigateDay(date);\n };\n const showMonthPickerAsOverlay = useShowMonthPickerAsOverlay({\n isDayPickerVisible: isDayPickerVisibleProp,\n showMonthPickerAsOverlay: showMonthPickerAsOverlayProp\n });\n const onHeaderSelect = showMonthPickerAsOverlay ? ()=>{\n toggleDayMonthPickerVisibility();\n focusOnNextUpdate();\n } : undefined;\n const onGotoToday = ()=>{\n navigateDay(today);\n if (showMonthPickerAsOverlay && isMonthPickerVisible) {\n toggleDayMonthPickerVisibility();\n }\n focusOnNextUpdate();\n };\n const onButtonKeyDown = (callback)=>{\n return (ev)=>{\n switch(ev.key){\n case Enter:\n case Space:\n callback();\n break;\n }\n };\n };\n const onDatePickerPopupKeyDown = (ev)=>{\n switch(ev.key){\n case Enter:\n ev.preventDefault();\n break;\n case Backspace:\n ev.preventDefault();\n break;\n case Escape:\n ev.stopPropagation();\n onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();\n break;\n case PageUp:\n if (ev.ctrlKey) {\n // go to next year\n navigateDay(addYears(navigatedDay, 1));\n } else {\n // go to next month\n navigateDay(addMonths(navigatedDay, 1));\n }\n ev.preventDefault();\n break;\n case PageDown:\n if (ev.ctrlKey) {\n // go to previous year\n navigateDay(addYears(navigatedDay, -1));\n } else {\n // go to previous month\n navigateDay(addMonths(navigatedDay, -1));\n }\n ev.preventDefault();\n break;\n default:\n break;\n }\n };\n const monthPickerOnly = !showMonthPickerAsOverlay && !isDayPickerVisible;\n const classes = useCalendarStyles_unstable({\n className,\n isDayPickerVisible,\n isMonthPickerVisible,\n showWeekNumbers\n });\n let todayDateString = '';\n let selectedDateString = '';\n if (dateTimeFormatter && strings.todayDateFormatString) {\n todayDateString = strings.todayDateFormatString.replace('{0}', dateTimeFormatter.formatMonthDayYear(today, strings));\n }\n if (dateTimeFormatter && strings.selectedDateFormatString) {\n const dateStringFormatter = monthPickerOnly ? dateTimeFormatter.formatMonthYear : dateTimeFormatter.formatMonthDayYear;\n selectedDateString = strings.selectedDateFormatString.replace('{0}', dateStringFormatter(selectedDate, strings));\n }\n const selectionAndTodayString = selectedDateString + ', ' + todayDateString;\n return /*#__PURE__*/ React.createElement(\"div\", {\n id: id,\n ref: forwardedRef,\n className: classes.root,\n onKeyDown: onDatePickerPopupKeyDown\n }, /*#__PURE__*/ React.createElement(\"div\", {\n className: classes.liveRegion,\n \"aria-live\": \"polite\",\n \"aria-atomic\": \"true\"\n }, /*#__PURE__*/ React.createElement(\"span\", null, selectedDateString)), isDayPickerVisible && /*#__PURE__*/ React.createElement(CalendarDay, {\n gridLabel: selectionAndTodayString,\n selectedDate: selectedDate,\n navigatedDate: navigatedDay,\n today: today,\n onSelectDate: onDateSelected,\n // eslint-disable-next-line react/jsx-no-bind\n onNavigateDate: onNavigateDayDate,\n onDismiss: onDismiss,\n firstDayOfWeek: firstDayOfWeek,\n dateRangeType: dateRangeType,\n strings: strings,\n // eslint-disable-next-line react/jsx-no-bind\n onHeaderSelect: onHeaderSelect,\n showWeekNumbers: showWeekNumbers,\n firstWeekOfYear: firstWeekOfYear,\n dateTimeFormatter: dateTimeFormatter,\n showSixWeeksByDefault: showSixWeeksByDefault,\n minDate: minDate,\n maxDate: maxDate,\n navigationIcons: defaultNavigationIcons,\n restrictedDates: restrictedDates,\n workWeekDays: workWeekDays,\n componentRef: dayPicker,\n showCloseButton: showCloseButton,\n allFocusable: allFocusable,\n ...calendarDayProps\n }), isDayPickerVisible && isMonthPickerVisible && /*#__PURE__*/ React.createElement(\"div\", {\n className: classes.divider\n }), isMonthPickerVisible ? /*#__PURE__*/ React.createElement(\"div\", {\n className: classes.monthPickerWrapper\n }, /*#__PURE__*/ React.createElement(CalendarMonth, {\n navigatedDate: navigatedMonth,\n selectedDate: navigatedDay,\n strings: strings,\n // eslint-disable-next-line react/jsx-no-bind\n onNavigateDate: onNavigateMonthDate,\n today: today,\n highlightCurrentMonth: highlightCurrentMonth,\n highlightSelectedMonth: highlightSelectedMonth,\n // eslint-disable-next-line react/jsx-no-bind\n onHeaderSelect: onHeaderSelect,\n dateTimeFormatter: dateTimeFormatter,\n minDate: minDate,\n maxDate: maxDate,\n componentRef: monthPicker,\n navigationIcons: defaultNavigationIcons,\n ...calendarMonthProps\n }), renderGoToTodayButton()) : renderGoToTodayButton());\n});\nCalendar.displayName = 'Calendar';\nconst useShowMonthPickerAsOverlay = ({ isDayPickerVisible, showMonthPickerAsOverlay })=>{\n const { targetDocument } = useFluent();\n const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;\n return showMonthPickerAsOverlay || isDayPickerVisible && win && win.innerWidth <= MIN_SIZE_FORCE_OVERLAY;\n};\n"],"names":["Calendar","MIN_SIZE_FORCE_OVERLAY","defaultWorkWeekDays","DayOfWeek","Monday","Tuesday","Wednesday","Thursday","Friday","useDateState","props","value","today","todayProp","onSelectDate","React","useMemo","Date","selectedDate","setSelectedDate","useControllableState","state","defaultState","undefined","initialState","navigatedDay","setNavigatedDay","useState","navigatedMonth","setNavigatedMonth","lastSelectedDate","setLastSelectedDate","valueOf","navigateMonth","date","navigateDay","onDateSelected","selectedDateRangeArray","useVisibilityState","isDayPickerVisible","isDayPickerVisibleProp","isMonthPickerVisible","isMonthPickerVisibleProp","showMonthPickerAsOverlay","showMonthPickerAsOverlayState","useShowMonthPickerAsOverlay","setIsMonthPickerVisible","setIsDayPickerVisible","toggleDayMonthPickerVisibility","useFocusLogic","componentRef","dayPicker","useRef","monthPicker","focusOnUpdate","targetDocument","useFluent","win","defaultView","focus","useCallback","current","focusAsync","useImperativeHandle","useEffect","focusOnNextUpdate","forwardRef","forwardedRef","allFocusable","calendarDayProps","calendarMonthProps","className","dateRangeType","DateRangeType","Day","dateTimeFormatter","DEFAULT_DATE_FORMATTING","firstDayOfWeek","Sunday","firstWeekOfYear","FirstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","id","maxDate","minDate","onDismiss","restrictedDates","showCloseButton","showGoToToday","showMonthPickerAsOverlayProp","showSixWeeksByDefault","showWeekNumbers","strings","DEFAULT_CALENDAR_STRINGS","workWeekDays","renderGoToTodayButton","goTodayEnabled","getFullYear","getMonth","createElement","classes","goTodayButton","onClick","onGotoToday","onKeyDown","onButtonKeyDown","type","disabled","goToToday","onNavigateDayDate","focusOnNavigatedDay","onNavigateMonthDate","monthPickerOnly","onHeaderSelect","callback","ev","key","Enter","Space","onDatePickerPopupKeyDown","preventDefault","Backspace","Escape","stopPropagation","PageUp","ctrlKey","addYears","addMonths","PageDown","useCalendarStyles_unstable","todayDateString","selectedDateString","todayDateFormatString","replace","formatMonthDayYear","selectedDateFormatString","dateStringFormatter","formatMonthYear","selectionAndTodayString","ref","root","liveRegion","CalendarDay","gridLabel","navigatedDate","onNavigateDate","navigationIcons","defaultNavigationIcons","divider","monthPickerWrapper","CalendarMonth","displayName","innerWidth"],"mappings":";;;;+BAiHiBA;;;eAAAA;;;;iEAjHM;8BAC2C;gCAC7B;qCACW;uBAC8F;6BAClH;+BACE;yCACS;yCACI;AAC3C,MAAMC,yBAAyB;AAC/B,MAAMC,sBAAsB;IACxBC,gBAAS,CAACC,MAAM;IAChBD,gBAAS,CAACE,OAAO;IACjBF,gBAAS,CAACG,SAAS;IACnBH,gBAAS,CAACI,QAAQ;IAClBJ,gBAAS,CAACK,MAAM;CACnB;AACD,SAASC,aAAaC,KAAK;IACvB,MAAM,EAAEC,KAAK,EAAEC,OAAOC,SAAS,EAAEC,YAAY,EAAE,GAAGJ;IAClD,MAAME,QAAQG,OAAMC,OAAO,CAAC,IAAIH,cAAc,QAAQA,cAAc,KAAK,IAAIA,YAAY,IAAII,QAAQ;QACjGJ;KACH;IACD,gDAAgD,GAAG,MAAM,CAACK,cAAcC,gBAAgB,GAAGC,IAAAA,oCAAoB,EAAC;QAC5GC,OAAOV;QACPW,cAAcX,QAAQY,YAAYX;QAClCY,cAAcZ;IAClB;IACA,+EAA+E,GAAG,MAAM,CAACa,eAAeb,KAAK,EAAEc,gBAAgB,GAAGX,OAAMY,QAAQ,CAAChB;IACjJ,iFAAiF,GAAG,MAAM,CAACiB,iBAAiBhB,KAAK,EAAEiB,kBAAkB,GAAGd,OAAMY,QAAQ,CAAChB;IACvJ,gFAAgF,GAAG,MAAM,CAACmB,mBAAmBlB,KAAK,EAAEmB,oBAAoB,GAAGhB,OAAMY,QAAQ,CAAChB;IA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vBN,SAASA;QACTD,SAASA;QACT+D,iBAAiBC,+CAAsB;QACvC7D,iBAAiBA;QACjBQ,cAAcA;QACd9C,cAAcC;QACdsC,iBAAiBA;QACjBrB,cAAcA;QACd,GAAGC,gBAAgB;IACvB,IAAI9B,sBAAsBE,wBAAwB,WAAW,GAAG1B,OAAMsF,aAAa,CAAC,OAAO;QACvF9B,WAAW+B,QAAQgD,OAAO;IAC9B,IAAI7G,uBAAuB,WAAW,GAAG1B,OAAMsF,aAAa,CAAC,OAAO;QAChE9B,WAAW+B,QAAQiD,kBAAkB;IACzC,GAAG,WAAW,GAAGxI,OAAMsF,aAAa,CAACmD,4BAAa,EAAE;QAChDN,eAAetH;QACfV,cAAcO;QACdqE,SAASA;QACT,6CAA6C;QAC7CqD,gBAAgBlC;QAChBrG,OAAOA;QACPsE,uBAAuBA;QACvBC,wBAAwBA;QACxB,6CAA6C;QAC7CgC,gBAAgBA;QAChBxC,mBAAmBA;QACnBW,SAASA;QACTD,SAASA;QACTnC,cAAcG;QACd+F,iBAAiBC,+CAAsB;QACvC,GAAG/E,kBAAkB;IACzB,IAAI2B,2BAA2BA;AACnC;AACAjG,SAASyJ,WAAW,GAAG;AACvB,MAAM5G,8BAA8B,CAAC,EAAEN,kBAAkB,EAAEI,wBAAwB,EAAE;IACjF,MAAM,EAAEY,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,MAAMF,mBAAmB,QAAQA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeG,WAAW;IACtG,OAAOf,4BAA4BJ,sBAAsBkB,OAAOA,IAAIiG,UAAU,IAAIzJ;AACtF"}
|
1
|
+
{"version":3,"sources":["Calendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Backspace, Enter, Escape, PageDown, PageUp, Space } from '@fluentui/keyboard-keys';\nimport { useControllableState } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n addMonths,\n addYears,\n DateRangeType,\n DayOfWeek,\n DEFAULT_CALENDAR_STRINGS,\n DEFAULT_DATE_FORMATTING,\n FirstWeekOfYear,\n focusAsync,\n} from '../../utils';\nimport { CalendarDay } from '../CalendarDay/CalendarDay';\nimport { CalendarMonth } from '../CalendarMonth/CalendarMonth';\nimport { defaultNavigationIcons } from './calendarNavigationIcons';\nimport { useCalendarStyles_unstable } from './useCalendarStyles.styles';\nimport type { ICalendarDay } from '../CalendarDay/CalendarDay.types';\nimport type { ICalendarMonth } from '../CalendarMonth/CalendarMonth.types';\nimport type { CalendarProps } from './Calendar.types';\n\nconst MIN_SIZE_FORCE_OVERLAY = 440;\n\nconst defaultWorkWeekDays: DayOfWeek[] = [\n DayOfWeek.Monday,\n DayOfWeek.Tuesday,\n DayOfWeek.Wednesday,\n DayOfWeek.Thursday,\n DayOfWeek.Friday,\n];\n\nfunction useDateState(props: CalendarProps) {\n const { value, today: todayProp, onSelectDate } = props;\n\n const today = React.useMemo(() => todayProp ?? new Date(), [todayProp]);\n\n /** The currently selected date in the calendar */\n const [selectedDate, setSelectedDate] = useControllableState({\n state: value,\n defaultState: value ? undefined : today,\n initialState: today,\n });\n\n /** The currently focused date in the day picker, but not necessarily selected */\n const [navigatedDay = today, setNavigatedDay] = React.useState(value);\n\n /** The currently focused date in the month picker, but not necessarily selected */\n const [navigatedMonth = today, setNavigatedMonth] = React.useState(value);\n\n /** If using a controlled value, when that value changes, navigate to that date */\n const [lastSelectedDate = today, setLastSelectedDate] = React.useState(value);\n if (value && lastSelectedDate.valueOf() !== value.valueOf()) {\n setNavigatedDay(value);\n setNavigatedMonth(value);\n setLastSelectedDate(value);\n }\n\n const navigateMonth = (date: Date) => {\n setNavigatedMonth(date);\n };\n\n const navigateDay = (date: Date) => {\n setNavigatedMonth(date);\n setNavigatedDay(date);\n };\n\n const onDateSelected = (date: Date, selectedDateRangeArray?: Date[]) => {\n setNavigatedMonth(date);\n setNavigatedDay(date);\n setSelectedDate(date);\n onSelectDate?.(date, selectedDateRangeArray);\n };\n\n return [selectedDate, navigatedDay, navigatedMonth, onDateSelected, navigateDay, navigateMonth] as const;\n}\n\nfunction useVisibilityState({\n isDayPickerVisible: isDayPickerVisibleProp,\n isMonthPickerVisible: isMonthPickerVisibleProp,\n showMonthPickerAsOverlay,\n}: CalendarProps) {\n /** State used to show/hide month picker */\n const showMonthPickerAsOverlayState = useShowMonthPickerAsOverlay({\n isDayPickerVisible: isDayPickerVisibleProp,\n showMonthPickerAsOverlay,\n });\n\n const [isMonthPickerVisible, setIsMonthPickerVisible] = React.useState(() =>\n showMonthPickerAsOverlayState ? false : isMonthPickerVisibleProp ?? false,\n );\n /** State used to show/hide day picker */\n const [isDayPickerVisible, setIsDayPickerVisible] = React.useState(() =>\n showMonthPickerAsOverlayState ? true : isDayPickerVisibleProp ?? true,\n );\n\n const toggleDayMonthPickerVisibility = () => {\n setIsMonthPickerVisible(!isMonthPickerVisible);\n setIsDayPickerVisible(!isDayPickerVisible);\n };\n\n return [isMonthPickerVisible, isDayPickerVisible, toggleDayMonthPickerVisibility] as const;\n}\n\nfunction useFocusLogic({ componentRef }: CalendarProps, isDayPickerVisible: boolean, isMonthPickerVisible: boolean) {\n const dayPicker = React.useRef<ICalendarDay>(null);\n const monthPicker = React.useRef<ICalendarMonth>(null);\n const focusOnUpdate = React.useRef(false);\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n const focus = React.useCallback(() => {\n if (isDayPickerVisible && dayPicker.current) {\n focusAsync(dayPicker.current, win);\n } else if (isMonthPickerVisible && monthPicker.current) {\n focusAsync(monthPicker.current, win);\n }\n }, [isDayPickerVisible, isMonthPickerVisible, win]);\n\n React.useImperativeHandle(componentRef, () => ({ focus }), [focus]);\n\n React.useEffect(() => {\n if (focusOnUpdate.current) {\n focus();\n focusOnUpdate.current = false;\n }\n });\n\n const focusOnNextUpdate = () => {\n focusOnUpdate.current = true;\n };\n\n return [dayPicker, monthPicker, focusOnNextUpdate] as const;\n}\n\n/**\n * @internal\n */\nexport const Calendar: React.FunctionComponent<CalendarProps> = React.forwardRef<HTMLDivElement, CalendarProps>(\n (props, forwardedRef) => {\n const {\n allFocusable = false,\n calendarDayProps,\n calendarMonthProps,\n className,\n componentRef,\n dateRangeType = DateRangeType.Day,\n dateTimeFormatter = DEFAULT_DATE_FORMATTING,\n firstDayOfWeek = DayOfWeek.Sunday,\n firstWeekOfYear = FirstWeekOfYear.FirstDay,\n highlightCurrentMonth = false,\n highlightSelectedMonth = false,\n id,\n isDayPickerVisible: isDayPickerVisibleProp = true,\n isMonthPickerVisible: isMonthPickerVisibleProp = true,\n maxDate,\n minDate,\n onDismiss,\n onSelectDate,\n restrictedDates,\n showCloseButton = false,\n showGoToToday = true,\n showMonthPickerAsOverlay: showMonthPickerAsOverlayProp = false,\n showSixWeeksByDefault = false,\n showWeekNumbers = false,\n strings = DEFAULT_CALENDAR_STRINGS,\n today: todayProp,\n value,\n workWeekDays = defaultWorkWeekDays,\n } = props;\n\n const today = React.useMemo(() => {\n return todayProp ?? new Date();\n }, [todayProp]);\n\n const [selectedDate, navigatedDay, navigatedMonth, onDateSelected, navigateDay, navigateMonth] = useDateState({\n onSelectDate,\n value,\n today,\n });\n const [isMonthPickerVisible, isDayPickerVisible, toggleDayMonthPickerVisibility] = useVisibilityState({\n isDayPickerVisible: isDayPickerVisibleProp,\n isMonthPickerVisible: isMonthPickerVisibleProp,\n showMonthPickerAsOverlay: showMonthPickerAsOverlayProp,\n });\n const [dayPicker, monthPicker, focusOnNextUpdate] = useFocusLogic(\n { componentRef },\n isDayPickerVisible,\n isMonthPickerVisible,\n );\n\n const renderGoToTodayButton = () => {\n let goTodayEnabled = showGoToToday;\n\n if (goTodayEnabled && today) {\n goTodayEnabled =\n navigatedDay.getFullYear() !== today.getFullYear() ||\n navigatedDay.getMonth() !== today.getMonth() ||\n navigatedMonth.getFullYear() !== today.getFullYear() ||\n navigatedMonth.getMonth() !== today.getMonth();\n }\n\n return (\n showGoToToday && (\n <button\n className={classes.goTodayButton}\n onClick={onGotoToday}\n onKeyDown={onButtonKeyDown(onGotoToday)}\n type=\"button\"\n disabled={!goTodayEnabled}\n >\n {strings!.goToToday}\n </button>\n )\n );\n };\n\n const onNavigateDayDate = (date: Date, focusOnNavigatedDay: boolean): void => {\n navigateDay(date);\n if (focusOnNavigatedDay) {\n focusOnNextUpdate();\n }\n };\n\n const onNavigateMonthDate = (date: Date, focusOnNavigatedDay: boolean): void => {\n if (focusOnNavigatedDay) {\n focusOnNextUpdate();\n }\n\n if (!focusOnNavigatedDay) {\n navigateMonth(date);\n return;\n }\n\n if (monthPickerOnly) {\n onDateSelected(date);\n }\n\n navigateDay(date);\n };\n\n const showMonthPickerAsOverlay = useShowMonthPickerAsOverlay({\n isDayPickerVisible: isDayPickerVisibleProp,\n showMonthPickerAsOverlay: showMonthPickerAsOverlayProp,\n });\n\n const onHeaderSelect = showMonthPickerAsOverlay\n ? (): void => {\n toggleDayMonthPickerVisibility();\n\n focusOnNextUpdate();\n }\n : undefined;\n\n const onGotoToday = (): void => {\n navigateDay(today!);\n if (showMonthPickerAsOverlay && isMonthPickerVisible) {\n toggleDayMonthPickerVisibility();\n }\n focusOnNextUpdate();\n };\n\n const onButtonKeyDown = (callback: () => void): ((ev: React.KeyboardEvent<HTMLButtonElement>) => void) => {\n return (ev: React.KeyboardEvent<HTMLButtonElement>) => {\n switch (ev.key) {\n case Enter:\n case Space:\n callback();\n break;\n }\n };\n };\n\n const onDatePickerPopupKeyDown = (ev: React.KeyboardEvent<HTMLElement>): void => {\n switch (ev.key) {\n case Enter:\n ev.preventDefault();\n break;\n\n case Backspace:\n ev.preventDefault();\n break;\n\n case Escape:\n ev.stopPropagation();\n onDismiss?.();\n break;\n\n case PageUp:\n if (ev.ctrlKey) {\n // go to next year\n navigateDay(addYears(navigatedDay, 1));\n } else {\n // go to next month\n navigateDay(addMonths(navigatedDay, 1));\n }\n ev.preventDefault();\n break;\n case PageDown:\n if (ev.ctrlKey) {\n // go to previous year\n navigateDay(addYears(navigatedDay, -1));\n } else {\n // go to previous month\n navigateDay(addMonths(navigatedDay, -1));\n }\n ev.preventDefault();\n break;\n default:\n break;\n }\n };\n\n const monthPickerOnly = !showMonthPickerAsOverlay && !isDayPickerVisible;\n\n const classes = useCalendarStyles_unstable({\n className,\n isDayPickerVisible,\n isMonthPickerVisible,\n showWeekNumbers,\n });\n\n let todayDateString: string = '';\n let selectedDateString: string = '';\n if (dateTimeFormatter && strings!.todayDateFormatString) {\n todayDateString = strings!.todayDateFormatString.replace(\n '{0}',\n dateTimeFormatter.formatMonthDayYear(today, strings!),\n );\n }\n if (dateTimeFormatter && strings!.selectedDateFormatString) {\n const dateStringFormatter = monthPickerOnly\n ? dateTimeFormatter.formatMonthYear\n : dateTimeFormatter.formatMonthDayYear;\n selectedDateString = strings!.selectedDateFormatString.replace(\n '{0}',\n dateStringFormatter(selectedDate, strings!),\n );\n }\n const selectionAndTodayString = selectedDateString + ', ' + todayDateString;\n\n return (\n <div id={id} ref={forwardedRef} className={classes.root} onKeyDown={onDatePickerPopupKeyDown}>\n <div className={classes.liveRegion} aria-live=\"polite\" aria-atomic=\"true\">\n <span>{selectedDateString}</span>\n </div>\n {isDayPickerVisible && (\n <CalendarDay\n gridLabel={selectionAndTodayString}\n selectedDate={selectedDate!}\n navigatedDate={navigatedDay!}\n today={today}\n onSelectDate={onDateSelected}\n // eslint-disable-next-line react/jsx-no-bind\n onNavigateDate={onNavigateDayDate}\n onDismiss={onDismiss}\n firstDayOfWeek={firstDayOfWeek!}\n dateRangeType={dateRangeType!}\n strings={strings!}\n // eslint-disable-next-line react/jsx-no-bind\n onHeaderSelect={onHeaderSelect}\n showWeekNumbers={showWeekNumbers}\n firstWeekOfYear={firstWeekOfYear!}\n dateTimeFormatter={dateTimeFormatter!}\n showSixWeeksByDefault={showSixWeeksByDefault}\n minDate={minDate}\n maxDate={maxDate}\n navigationIcons={defaultNavigationIcons}\n restrictedDates={restrictedDates}\n workWeekDays={workWeekDays}\n componentRef={dayPicker}\n showCloseButton={showCloseButton}\n allFocusable={allFocusable}\n {...calendarDayProps} // at end of list so consumer's custom functions take precedence\n />\n )}\n {isDayPickerVisible && isMonthPickerVisible && <div className={classes.divider} />}\n {isMonthPickerVisible ? (\n <div className={classes.monthPickerWrapper}>\n <CalendarMonth\n navigatedDate={navigatedMonth}\n selectedDate={navigatedDay}\n strings={strings!}\n // eslint-disable-next-line react/jsx-no-bind\n onNavigateDate={onNavigateMonthDate}\n today={today}\n highlightCurrentMonth={highlightCurrentMonth!}\n highlightSelectedMonth={highlightSelectedMonth!}\n // eslint-disable-next-line react/jsx-no-bind\n onHeaderSelect={onHeaderSelect}\n dateTimeFormatter={dateTimeFormatter!}\n minDate={minDate}\n maxDate={maxDate}\n componentRef={monthPicker}\n navigationIcons={defaultNavigationIcons}\n {...calendarMonthProps} // at end of list so consumer's custom functions take precedence\n />\n {renderGoToTodayButton()}\n </div>\n ) : (\n renderGoToTodayButton()\n )}\n </div>\n );\n },\n);\nCalendar.displayName = 'Calendar';\n\nconst useShowMonthPickerAsOverlay = ({ isDayPickerVisible, showMonthPickerAsOverlay }: CalendarProps) => {\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n return showMonthPickerAsOverlay || (isDayPickerVisible && win && win.innerWidth <= MIN_SIZE_FORCE_OVERLAY);\n};\n"],"names":["Calendar","MIN_SIZE_FORCE_OVERLAY","defaultWorkWeekDays","DayOfWeek","Monday","Tuesday","Wednesday","Thursday","Friday","useDateState","props","value","today","todayProp","onSelectDate","React","useMemo","Date","selectedDate","setSelectedDate","useControllableState","state","defaultState","undefined","initialState","navigatedDay","setNavigatedDay","useState","navigatedMonth","setNavigatedMonth","lastSelectedDate","setLastSelectedDate","valueOf","navigateMonth","date","navigateDay","onDateSelected","selectedDateRangeArray","useVisibilityState","isDayPickerVisible","isDayPickerVisibleProp","isMonthPickerVisible","isMonthPickerVisibleProp","showMonthPickerAsOverlay","showMonthPickerAsOverlayState","useShowMonthPickerAsOverlay","setIsMonthPickerVisible","setIsDayPickerVisible","toggleDayMonthPickerVisibility","useFocusLogic","componentRef","dayPicker","useRef","monthPicker","focusOnUpdate","targetDocument","useFluent","win","defaultView","focus","useCallback","current","focusAsync","useImperativeHandle","useEffect","focusOnNextUpdate","forwardRef","forwardedRef","allFocusable","calendarDayProps","calendarMonthProps","className","dateRangeType","DateRangeType","Day","dateTimeFormatter","DEFAULT_DATE_FORMATTING","firstDayOfWeek","Sunday","firstWeekOfYear","FirstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","id","maxDate","minDate","onDismiss","restrictedDates","showCloseButton","showGoToToday","showMonthPickerAsOverlayProp","showSixWeeksByDefault","showWeekNumbers","strings","DEFAULT_CALENDAR_STRINGS","workWeekDays","renderGoToTodayButton","goTodayEnabled","getFullYear","getMonth","createElement","button","classes","goTodayButton","onClick","onGotoToday","onKeyDown","onButtonKeyDown","type","disabled","goToToday","onNavigateDayDate","focusOnNavigatedDay","onNavigateMonthDate","monthPickerOnly","onHeaderSelect","callback","ev","key","Enter","Space","onDatePickerPopupKeyDown","preventDefault","Backspace","Escape","stopPropagation","PageUp","ctrlKey","addYears","addMonths","PageDown","useCalendarStyles_unstable","todayDateString","selectedDateString","todayDateFormatString","replace","formatMonthDayYear","selectedDateFormatString","dateStringFormatter","formatMonthYear","selectionAndTodayString","div","ref","root","liveRegion","aria-live","aria-atomic","span","CalendarDay","gridLabel","navigatedDate","onNavigateDate","navigationIcons","defaultNavigationIcons","divider","monthPickerWrapper","CalendarMonth","displayName","innerWidth"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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gBAAgB;QAGvB9B,sBAAsBE,wBAAAA,WAAAA,GAAwB1B,OAAAsF,aAAA,CAACyC,OAAAA;QAAIvE,WAAWgC,QAAQoD,OAAO;QAC7ElH,uBAAAA,WAAAA,GACC1B,OAAAsF,aAAA,CAACyC,OAAAA;QAAIvE,WAAWgC,QAAQqD,kBAAkB;qBACxC7I,OAAAsF,aAAA,CAACwD,4BAAAA,EAAAA;QACCN,eAAe3H;QACfV,cAAcO;QACdqE,SAASA;QACT,6CAA6C;QAC7C0D,gBAAgBtC;QAChBtG,OAAOA;QACPsE,uBAAuBA;QACvBC,wBAAwBA;QACxB,6CAA6C;QAC7CiC,gBAAgBA;QAChBzC,mBAAmBA;QACnBW,SAASA;QACTD,SAASA;QACTnC,cAAcG;QACdoG,iBAAiBC,+CAAAA;QAChB,GAAGpF,kBAAkB;QAEvB2B,2BAGHA;AAIR;AAEFjG,SAAS8J,WAAW,GAAG;AAEvB,MAAMjH,8BAA8B,CAAC,EAAEN,kBAAkB,EAAEI,wBAAwB,EAAiB;IAClG,MAAM,EAAEY,cAAc,EAAE,GAAGC,IAAAA,uCAAAA;IAC3B,MAAMC,MAAMF,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBG,WAAW;IACvC,OAAOf,4BAA6BJ,sBAAsBkB,OAAOA,IAAIsG,UAAU,IAAI9J;AACrF"}
|
@@ -12,10 +12,10 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
13
13
|
var AnimationDirection;
|
14
14
|
(function(AnimationDirection) {
|
15
|
-
|
15
|
+
/**
|
16
16
|
* Grid will transition out and in horizontally
|
17
|
-
*/ "Horizontal"] = 0] = "Horizontal";
|
18
|
-
|
17
|
+
*/ AnimationDirection[AnimationDirection["Horizontal"] = 0] = "Horizontal";
|
18
|
+
/**
|
19
19
|
* Grid will transition out and in vertically
|
20
|
-
*/ "Vertical"] = 1] = "Vertical";
|
20
|
+
*/ AnimationDirection[AnimationDirection["Vertical"] = 1] = "Vertical";
|
21
21
|
})(AnimationDirection || (AnimationDirection = {}));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Calendar.types.
|
1
|
+
{"version":3,"sources":["Calendar.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { CalendarStrings, DateFormatting, DateRangeType, DayOfWeek, FirstWeekOfYear } from '../../utils';\nimport type { CalendarDayProps } from '../CalendarDay/CalendarDay.types';\nimport type { CalendarMonthProps } from '../CalendarMonth/CalendarMonth.types';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ICalendar {\n /** Sets focus to the selected date. */\n focus: () => void;\n}\n\nexport interface CalendarProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * Optional callback to access the ICalendar interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<ICalendar>;\n\n /**\n * Customized props for the calendar day\n */\n calendarDayProps?: Partial<CalendarDayProps>;\n\n /**\n * Customized props for the calendar month\n */\n calendarMonthProps?: Partial<CalendarMonthProps>;\n\n /**\n * Optional class name to add to the root element.\n */\n className?: string;\n\n /**\n * Callback for when a date is selected\n * @param date - The date the user selected\n * @param selectedDateRangeArray - The resultant list of dates that are selected based on the date range type set\n * for the component.\n */\n onSelectDate?: (date: Date, selectedDateRangeArray?: Date[]) => void;\n\n /**\n * Callback for when calendar is closed\n */\n onDismiss?: () => void;\n\n /**\n * ID for the calendar\n */\n id?: string;\n\n /**\n * Default value of the Calendar, if any\n */\n value?: Date;\n\n /**\n * Value of today. If unspecified, current time in client machine will be used.\n */\n today?: Date;\n\n /**\n * The date range type indicating how many days should be selected as the user\n * selects days\n * @default DateRangeType.Day\n */\n dateRangeType?: DateRangeType;\n\n /**\n * The first day of the week for your locale.\n * @default DayOfWeek.Sunday\n */\n firstDayOfWeek?: DayOfWeek;\n\n /**\n * Defines when the first week of the year should start.\n * @default FirstWeekOfYear.FirstDay\n */\n firstWeekOfYear?: FirstWeekOfYear;\n\n /**\n * Whether the month picker is shown beside the day picker or hidden.\n * @default true\n */\n isMonthPickerVisible?: boolean;\n\n /**\n * Whether the day picker is shown beside the month picker or hidden.\n * @default true\n */\n isDayPickerVisible?: boolean;\n\n /**\n * Show month picker on top of date picker when visible.\n * @default false\n */\n showMonthPickerAsOverlay?: boolean;\n\n /**\n * Whether the \"Go to today\" link should be shown or not\n */\n showGoToToday?: boolean;\n\n /**\n * Whether the calendar should show the week number (weeks 1 to 53) before each week row\n * @default false\n */\n showWeekNumbers?: boolean;\n\n /**\n * Localized strings to use in the Calendar\n */\n strings?: CalendarStrings;\n\n /**\n * Apply additional formatting to dates, for example localized date formatting.\n */\n dateTimeFormatter?: DateFormatting;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a date earlier than this value.\n */\n minDate?: Date;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a date later than this value.\n */\n maxDate?: Date;\n\n /**\n * If set the Calendar will not allow selection of dates in this array.\n */\n restrictedDates?: Date[];\n\n /**\n * Whether the calendar should show 6 weeks by default.\n * @default false\n */\n showSixWeeksByDefault?: boolean;\n\n /**\n * The days that are selectable when `dateRangeType` is `WorkWeek`.\n * If `dateRangeType` is not `WorkWeek` this property does nothing.\n * @default [Monday,Tuesday,Wednesday,Thursday,Friday]\n */\n workWeekDays?: DayOfWeek[];\n\n /**\n * Whether the month picker should highlight the current month\n * @default false\n */\n highlightCurrentMonth?: boolean;\n\n /**\n * Whether the month picker should highlight the selected month\n * @default false\n */\n highlightSelectedMonth?: boolean;\n\n /**\n * Whether the close button should be shown or not\n * @default false\n */\n showCloseButton?: boolean;\n\n /**\n * Allows all dates and buttons to be focused, including disabled ones\n * @default false\n */\n allFocusable?: boolean;\n}\n\n/**\n * @internal\n */\nexport interface CalendarStyleProps {\n /**\n * Custom CSS class for the calendar.\n */\n className?: string;\n\n /**\n * Whether the month picker is visible\n */\n isMonthPickerVisible?: boolean;\n\n /**\n * Whether the day picker is visible\n */\n isDayPickerVisible?: boolean;\n\n /**\n * Whether only month picker is shown\n */\n monthPickerOnly?: boolean;\n\n /**\n * Whether the month picker is overlaid on the day picker\n */\n showMonthPickerAsOverlay?: boolean;\n\n /**\n * @deprecated Use `overlaidWithButton`\n */\n overlayedWithButton?: boolean;\n\n /**\n * Whether the month and day picker are overlaid and the 'go to today' button is shown\n */\n overlaidWithButton?: boolean;\n\n /**\n * Whether the go to today button is shown\n */\n showGoToToday?: boolean;\n\n /**\n * Whether the week numbers are shown\n */\n showWeekNumbers?: boolean;\n}\n\n/**\n * @internal\n */\nexport interface CalendarStyles {\n /**\n * Style for the root element.\n */\n root: string;\n\n divider: string;\n\n goTodayButton: string;\n\n monthPickerWrapper: string;\n\n liveRegion: string;\n}\n\nexport enum AnimationDirection {\n /**\n * Grid will transition out and in horizontally\n */\n Horizontal,\n\n /**\n * Grid will transition out and in vertically\n */\n Vertical,\n}\n"],"names":["AnimationDirection"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;iEAAuB;;UAgPXA,kBAAAA;IACV;;GAEC,GAAAA,kBAAA,CAAAA,kBAAA,CAAA,aAAA,GAAA,EAAA,GAAA;IAGD;;GAEC,GAAAA,kBAAA,CAAAA,kBAAA,CAAA,WAAA,GAAA,EAAA,GAAA;GARSA,sBAAAA,CAAAA,qBAAAA,CAAAA,CAAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["calendarNavigationIcons.
|
1
|
+
{"version":3,"sources":["calendarNavigationIcons.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDownRegular, ArrowUpRegular, DismissRegular } from '@fluentui/react-icons';\n\nexport type CalendarNavigationIcons = {\n /**\n * Icon to use for up arrow navigation. Default comes from \\@fluentui\\/react-icons\n * @default ArrowUpRegular\n */\n upNavigation?: JSX.Element;\n\n /**\n * Icon to use for down arrow navigation. Default comes from \\@fluentui\\/react-icons\n * @default ArrowDownRegular\n */\n downNavigation?: JSX.Element;\n\n /**\n * Icon to use for the dismiss button. Default comes from \\@fluentui\\/react-icons\n * @default DismissRegular\n */\n dismiss?: JSX.Element;\n};\n\nexport const defaultNavigationIcons: CalendarNavigationIcons = {\n dismiss: <DismissRegular />,\n downNavigation: <ArrowDownRegular />,\n upNavigation: <ArrowUpRegular />,\n};\n"],"names":["defaultNavigationIcons","dismiss","React","createElement","DismissRegular","downNavigation","ArrowDownRegular","upNavigation","ArrowUpRegular"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BAuBaA;;;eAAAA;;;;iEAvBU;4BAC0C;AAsB1D,MAAMA,yBAAkD;IAC7DC,SAAAA,WAAAA,GAASC,OAAAC,aAAA,CAACC,0BAAAA,EAAAA;IACVC,gBAAAA,WAAAA,GAAgBH,OAAAC,aAAA,CAACG,4BAAAA,EAAAA;IACjBC,cAAAA,WAAAA,GAAcL,OAAAC,aAAA,CAACK,0BAAAA,EAAAA;AACjB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["defaults.
|
1
|
+
{"version":3,"sources":["defaults.ts"],"sourcesContent":["import { DEFAULT_CALENDAR_STRINGS } from '../../utils';\nimport type { CalendarStrings } from '../../utils';\n\nexport const defaultCalendarStrings: CalendarStrings = DEFAULT_CALENDAR_STRINGS;\n"],"names":["defaultCalendarStrings","DEFAULT_CALENDAR_STRINGS"],"rangeMappings":";;;;;;;;;;;","mappings":";;;;+BAGaA;;;eAAAA;;;uBAH4B;AAGlC,MAAMA,yBAA0CC,+BAAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Calendar';\nexport * from './Calendar.types';\nexport * from './useCalendarStyles.styles';\nexport { defaultCalendarStrings } from './defaults';\n"],"names":["defaultCalendarStrings"],"rangeMappings":";;;;;;;;;;;;;;","mappings":";;;;+BAGSA;;;eAAAA,gCAAsB;;;;uBAHjB;uBACA;uBACA;0BACyB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useCalendarStyles.styles.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { __styles, mergeClasses, shorthands } from '@griffel/react';\n/**\n * @internal\n */\nexport const calendarClassNames = {\n root: 'fui-Calendar',\n divider: 'fui-Calendar__divider',\n goTodayButton: 'fui-Calendar__goTodayButton',\n monthPickerWrapper: 'fui-Calendar__monthPickerWrapper',\n liveRegion: 'fui-Calendar__liveRegion'\n};\nconst useRootStyles = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"f22iagw\",\n a9b677: \"f13dwy2t\"\n },\n normalize: {\n E5pizo: \"f1couhl3\",\n B7ck84d: \"f1ewtqcl\",\n jrapky: 0,\n Frg6f3: 0,\n t21cq0: 0,\n B6of3ja: 0,\n B74szlk: \"f1s184ao\",\n Byoj8tv: 0,\n uwmqm3: 0,\n z189sj: 0,\n z8tnut: 0,\n B0ocmuz: \"f1mk8lai\"\n },\n monthPickerNotVisible: {\n Beiy3e4: \"f1vx9l62\"\n },\n dayAndMonthPickersVisible: {\n a9b677: \"fcy5b15\"\n },\n dayPickerVisibleAndWeekNumbersShown: {\n a9b677: \"fhsg0in\"\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n a9b677: \"fcarq7f\"\n }\n}, {\n d: [\".f22iagw{display:flex;}\", \".f13dwy2t{width:220px;}\", \".f1couhl3{box-shadow:none;}\", \".f1ewtqcl{box-sizing:border-box;}\", [\".f1s184ao{margin:0;}\", {\n p: -1\n }], [\".f1mk8lai{padding:0;}\", {\n p: -1\n }], \".f1vx9l62{flex-direction:column;}\", \".fcy5b15{width:440px;}\", \".fhsg0in{width:250px;}\", \".fcarq7f{width:470px;}\"]\n});\nconst useDividerStyles = /*#__PURE__*/__styles({\n base: {\n h3c5rm: 0,\n vrafjx: 0,\n Bekrc4i: 0,\n u1mtju: [\"fe2nn5g\", \"f1rcbay7\"],\n Bhzewxz: \"f15twtuk\"\n }\n}, {\n d: [[\".fe2nn5g{border-right:1px solid var(--colorNeutralStroke2);}\", {\n p: -1\n }], [\".f1rcbay7{border-left:1px solid var(--colorNeutralStroke2);}\", {\n p: -1\n }], \".f15twtuk{top:0;}\"]\n});\nconst useMonthPickerWrapperStyles = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"f22iagw\",\n Beiy3e4: \"f1vx9l62\"\n }\n}, {\n d: [\".f22iagw{display:flex;}\", \".f1vx9l62{flex-direction:column;}\"]\n});\nconst useGoTodayButtonStyles = /*#__PURE__*/__styles({\n base: {\n qb2dma: \"fpydfdc\",\n De3pzq: \"f1c21dwh\",\n icvyot: \"f1ern45e\",\n vrafjx: [\"f1n71otn\", \"f1deefiw\"],\n oivjwe: \"f1h8hb77\",\n wvpqe5: [\"f1deefiw\", \"f1n71otn\"],\n B5kzvoi: \"f1yab3r1\",\n B7ck84d: \"f1e4lqlz\",\n sj55zd: \"f19n0e5\",\n Bahqtrf: \"f1mo0ibp\",\n Be2twd7: \"fy9rknc\",\n Bqenvij: \"f1tvdnth\",\n Bg96gwp: \"fpfng1i\",\n t21cq0: [\"f17vyym1\", \"fb5scp\"],\n B6of3ja: \"f4gg0ds\",\n B68tc82: 0,\n Bmxbyg5: 0,\n Bpg54ce: \"f1gl81tg\",\n Byoj8tv: 0,\n uwmqm3: 0,\n z189sj: 0,\n z8tnut: 0,\n B0ocmuz: \"f1p2x7z2\",\n seuwu7: \"fvy6vk6\",\n Jwef8y: \"f9ql6rf\",\n Bi91k9c: \"f1f1pb61\",\n eoavqd: \"f8491dx\",\n Bx7pl5v: 0,\n Bnosqey: 0,\n Bv57zgv: 0,\n Bbxjs3m: \"fzk52v6\",\n knvgbf: 0,\n B23s7e0: 0,\n Be8uuq8: 0,\n B3ons6i: 0,\n Bnj8mme: \"fxh1mxx\",\n B2d53fq: \"fc9d3oc\",\n Dyrjrp: \"f1cqwcg4\",\n Be90el1: \"fmjaa5u\"\n }\n}, {\n d: [\".fpydfdc{align-self:flex-end;}\", \".f1c21dwh{background-color:var(--colorTransparentBackground);}\", \".f1ern45e{border-top-style:none;}\", \".f1n71otn{border-right-style:none;}\", \".f1deefiw{border-left-style:none;}\", \".f1h8hb77{border-bottom-style:none;}\", \".f1yab3r1{bottom:0;}\", \".f1e4lqlz{box-sizing:content-box;}\", \".f19n0e5{color:var(--colorNeutralForeground1);}\", \".f1mo0ibp{font-family:inherit;}\", \".fy9rknc{font-size:var(--fontSizeBase200);}\", \".f1tvdnth{height:30px;}\", \".fpfng1i{line-height:30px;}\", \".f17vyym1{margin-right:16px;}\", \".fb5scp{margin-left:16px;}\", \".f4gg0ds{margin-top:3px;}\", [\".f1gl81tg{overflow:visible;}\", {\n p: -1\n }], [\".f1p2x7z2{padding:0 4px;}\", {\n p: -1\n }], \".fvy6vk6 div{font-size:var(--fontSizeBase200);}\", \".f1cqwcg4:disabled{color:var(--colorNeutralForegroundDisabled);}\", \".fmjaa5u:disabled{pointer-events:none;}\"],\n h: [\".f9ql6rf:hover{background-color:var(--colorTransparentBackground);}\", \".f1f1pb61:hover{color:var(--colorBrandForeground1);}\", \".f8491dx:hover{cursor:pointer;}\", \".fc9d3oc:hover:active{color:var(--colorBrandForeground2);}\"],\n m: [[\"@media (forced-colors: active){.fzk52v6:hover{outline:var(--strokeWidthThin);}}\", {\n p: -1,\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fxh1mxx:hover{border-radius:var(--borderRadiusSmall);}}\", {\n p: -1,\n m: \"(forced-colors: active)\"\n }]]\n});\nconst useLiveRegionStyles = /*#__PURE__*/__styles({\n base: {\n Bgfg5da: 0,\n B9xav0g: 0,\n oivjwe: 0,\n Bn0qgzm: 0,\n B4g9neb: 0,\n zhjwy3: 0,\n wvpqe5: 0,\n ibv6hh: 0,\n u1mtju: 0,\n h3c5rm: 0,\n vrafjx: 0,\n Bekrc4i: 0,\n i8vvqc: 0,\n g2u3we: 0,\n icvyot: 0,\n B4j52fo: 0,\n irswps: \"f3bhgqh\",\n Bqenvij: \"f1mpe4l3\",\n jrapky: 0,\n Frg6f3: 0,\n t21cq0: 0,\n B6of3ja: 0,\n B74szlk: \"f1jlpb2r\",\n B68tc82: 0,\n Bmxbyg5: 0,\n Bpg54ce: \"f1a3p1vp\",\n Byoj8tv: 0,\n uwmqm3: 0,\n z189sj: 0,\n z8tnut: 0,\n B0ocmuz: \"f1mk8lai\",\n qhf8xq: \"f1euv43f\",\n a9b677: \"frkrog8\"\n }\n}, {\n d: [[\".f3bhgqh{border:none;}\", {\n p: -2\n }], \".f1mpe4l3{height:1px;}\", [\".f1jlpb2r{margin:-1px;}\", {\n p: -1\n }], [\".f1a3p1vp{overflow:hidden;}\", {\n p: -1\n }], [\".f1mk8lai{padding:0;}\", {\n p: -1\n }], \".f1euv43f{position:absolute;}\", \".frkrog8{width:1px;}\"]\n});\n/**\n * @internal\n *\n * Apply styling to the Calendar slots based on the state\n */\nexport const useCalendarStyles_unstable = props => {\n 'use no memo';\n\n const rootStyles = useRootStyles();\n const dividerStyles = useDividerStyles();\n const monthPickerWrapperStyles = useMonthPickerWrapperStyles();\n const goTodayButtonStyles = useGoTodayButtonStyles();\n const liveRegionStyles = useLiveRegionStyles();\n const {\n className,\n isDayPickerVisible,\n isMonthPickerVisible,\n showWeekNumbers\n } = props;\n return {\n root: mergeClasses(calendarClassNames.root, rootStyles.base, rootStyles.normalize, !isMonthPickerVisible && rootStyles.monthPickerNotVisible, isDayPickerVisible && isMonthPickerVisible && !showWeekNumbers && rootStyles.dayAndMonthPickersVisible, isDayPickerVisible && !isMonthPickerVisible && showWeekNumbers && rootStyles.dayPickerVisibleAndWeekNumbersShown, isDayPickerVisible && isMonthPickerVisible && showWeekNumbers && rootStyles.dayAndMonthPickersVisibleAndWeekNumbersShown, className),\n divider: mergeClasses(calendarClassNames.divider, dividerStyles.base),\n monthPickerWrapper: mergeClasses(calendarClassNames.monthPickerWrapper, monthPickerWrapperStyles.base),\n goTodayButton: mergeClasses(calendarClassNames.goTodayButton, goTodayButtonStyles.base),\n liveRegion: mergeClasses(calendarClassNames.liveRegion, liveRegionStyles.base)\n };\n};\n//# sourceMappingURL=useCalendarStyles.styles.js.map"],"names":["calendarClassNames","useCalendarStyles_unstable","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","__styles","base","mc9l5x","a9b677","normalize","E5pizo","B7ck84d","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","monthPickerNotVisible","Beiy3e4","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","d","p","useDividerStyles","h3c5rm","vrafjx","Bekrc4i","u1mtju","Bhzewxz","useMonthPickerWrapperStyles","useGoTodayButtonStyles","qb2dma","De3pzq","icvyot","oivjwe","wvpqe5","B5kzvoi","sj55zd","Bahqtrf","Be2twd7","Bqenvij","Bg96gwp","B68tc82","Bmxbyg5","Bpg54ce","seuwu7","Jwef8y","Bi91k9c","eoavqd","Bx7pl5v","Bnosqey","Bv57zgv","Bbxjs3m","knvgbf","B23s7e0","Be8uuq8","B3ons6i","Bnj8mme","B2d53fq","Dyrjrp","Be90el1","h","m","useLiveRegionStyles","Bgfg5da","B9xav0g","Bn0qgzm","B4g9neb","zhjwy3","ibv6hh","i8vvqc","g2u3we","B4j52fo","irswps","qhf8xq","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers","mergeClasses"],"mappings":";;;;;;;;;;;IAKaA,kBAAkB;eAAlBA;;IAiLAC,0BAA0B;eAA1BA;;;uBArLsC;AAI5C,MAAMD,qBAAqB;IAChCE,MAAM;IACNC,SAAS;IACTC,eAAe;IACfC,oBAAoB;IACpBC,YAAY;AACd;AACA,MAAMC,gBAAgB,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IAC1CC,MAAM;QACJC,QAAQ;QACRC,QAAQ;IACV;IACAC,WAA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,UAAU,EAAEmF,iBAAiBhF,IAAI;IAC/E;AACF,GACA,oDAAoD"}
|
1
|
+
{"version":3,"sources":["useCalendarStyles.styles.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\n/**\n * @internal\n */ export const calendarClassNames = {\n root: 'fui-Calendar',\n divider: 'fui-Calendar__divider',\n goTodayButton: 'fui-Calendar__goTodayButton',\n monthPickerWrapper: 'fui-Calendar__monthPickerWrapper',\n liveRegion: 'fui-Calendar__liveRegion'\n};\nconst useRootStyles = makeStyles({\n base: {\n display: 'flex',\n width: '220px'\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0'\n },\n monthPickerNotVisible: {\n flexDirection: 'column'\n },\n dayAndMonthPickersVisible: {\n width: '440px'\n },\n dayPickerVisibleAndWeekNumbersShown: {\n width: '250px'\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n width: '470px'\n }\n});\nconst useDividerStyles = makeStyles({\n base: {\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n top: 0\n }\n});\nconst useMonthPickerWrapperStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column'\n }\n});\nconst useGoTodayButtonStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n bottom: 0,\n boxSizing: 'content-box',\n color: tokens.colorNeutralForeground1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '30px',\n lineHeight: '30px',\n marginRight: '16px',\n marginTop: '3px',\n overflow: 'visible',\n padding: '0 4px',\n '& div': {\n fontSize: tokens.fontSizeBase200\n },\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorBrandForeground1,\n cursor: 'pointer',\n '@media (forced-colors: active)': {\n outline: tokens.strokeWidthThin,\n borderRadius: tokens.borderRadiusSmall\n }\n },\n '&:hover:active': {\n color: tokens.colorBrandForeground2\n },\n '&:disabled': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none'\n }\n }\n});\nconst useLiveRegionStyles = makeStyles({\n base: {\n border: 'none',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px'\n }\n});\n/**\n * @internal\n *\n * Apply styling to the Calendar slots based on the state\n */ export const useCalendarStyles_unstable = (props)=>{\n 'use no memo';\n const rootStyles = useRootStyles();\n const dividerStyles = useDividerStyles();\n const monthPickerWrapperStyles = useMonthPickerWrapperStyles();\n const goTodayButtonStyles = useGoTodayButtonStyles();\n const liveRegionStyles = useLiveRegionStyles();\n const { className, isDayPickerVisible, isMonthPickerVisible, showWeekNumbers } = props;\n return {\n root: mergeClasses(calendarClassNames.root, rootStyles.base, rootStyles.normalize, !isMonthPickerVisible && rootStyles.monthPickerNotVisible, isDayPickerVisible && isMonthPickerVisible && !showWeekNumbers && rootStyles.dayAndMonthPickersVisible, isDayPickerVisible && !isMonthPickerVisible && showWeekNumbers && rootStyles.dayPickerVisibleAndWeekNumbersShown, isDayPickerVisible && isMonthPickerVisible && showWeekNumbers && rootStyles.dayAndMonthPickersVisibleAndWeekNumbersShown, className),\n divider: mergeClasses(calendarClassNames.divider, dividerStyles.base),\n monthPickerWrapper: mergeClasses(calendarClassNames.monthPickerWrapper, monthPickerWrapperStyles.base),\n goTodayButton: mergeClasses(calendarClassNames.goTodayButton, goTodayButtonStyles.base),\n liveRegion: mergeClasses(calendarClassNames.liveRegion, liveRegionStyles.base)\n };\n};\n"],"names":["calendarClassNames","useCalendarStyles_unstable","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","__styles","base","mc9l5x","a9b677","normalize","E5pizo","B7ck84d","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","monthPickerNotVisible","Beiy3e4","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","d","p","useDividerStyles","h3c5rm","vrafjx","Bekrc4i","u1mtju","Bhzewxz","useMonthPickerWrapperStyles","useGoTodayButtonStyles","qb2dma","De3pzq","icvyot","oivjwe","wvpqe5","B5kzvoi","sj55zd","Bahqtrf","Be2twd7","Bqenvij","Bg96gwp","B68tc82","Bmxbyg5","Bpg54ce","seuwu7","Jwef8y","Bi91k9c","eoavqd","Bx7pl5v","Bnosqey","Bv57zgv","Bbxjs3m","knvgbf","B23s7e0","Be8uuq8","B3ons6i","Bnj8mme","B2d53fq","Dyrjrp","Be90el1","h","m","useLiveRegionStyles","Bgfg5da","B9xav0g","Bn0qgzm","B4g9neb","zhjwy3","ibv6hh","i8vvqc","g2u3we","B4j52fo","irswps","qhf8xq","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIiBA,kBAAkB;eAAlBA;;IA+FAC,0BAA0B;eAA1BA;;;uBAlGoC;AAG1C,MAAMD,qBAAqB;IAClCE,MAAM;IACNC,SAAS;IACTC,eAAe;IACfC,oBAAoB;IACpBC,YAAY;AAChB;AACA,MAAMC,gBAAa,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,MAAA;QAAAC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BAAoB/E,IAAI;QACtFH,YAAYwF,IAAAA,mBAAY,EAAC9F,mBAAmBM,UAAU,EAAEmF,iBAAiBhF,IAAI;IACjF;AACJ"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["CalendarDay.js"],"sourcesContent":["import * as React from 'react';\nimport { Enter } from '@fluentui/keyboard-keys';\nimport { mergeClasses } from '@griffel/react';\nimport { addMonths, compareDatePart, getMonthEnd, getMonthStart } from '../../utils';\nimport { CalendarDayGrid } from '../CalendarDayGrid/CalendarDayGrid';\nimport { useCalendarDayStyles_unstable } from './useCalendarDayStyles.styles';\n/**\n * @internal\n */ export const CalendarDay = (props)=>{\n const dayGrid = React.useRef(null);\n React.useImperativeHandle(props.componentRef, ()=>({\n focus () {\n var _dayGrid_current_focus, _dayGrid_current;\n (_dayGrid_current = dayGrid.current) === null || _dayGrid_current === void 0 ? void 0 : (_dayGrid_current_focus = _dayGrid_current.focus) === null || _dayGrid_current_focus === void 0 ? void 0 : _dayGrid_current_focus.call(_dayGrid_current);\n }\n }), []);\n const { strings, gridLabel, navigatedDate, dateTimeFormatter, className, onHeaderSelect, showSixWeeksByDefault, minDate, maxDate, restrictedDates, onNavigateDate, showWeekNumbers, dateRangeType, animationDirection } = props;\n const classNames = useCalendarDayStyles_unstable({\n className,\n headerIsClickable: !!onHeaderSelect,\n showWeekNumbers,\n animationDirection\n });\n const monthAndYear = dateTimeFormatter.formatMonthYear(navigatedDate, strings);\n const HeaderButtonComponentType = onHeaderSelect ? 'button' : 'div';\n const headerAriaLabel = strings.yearPickerHeaderAriaLabel ? strings.yearPickerHeaderAriaLabel.replace('{0}', monthAndYear) : monthAndYear;\n const { ...propsWithoutStyles } = props;\n return /*#__PURE__*/ React.createElement(\"div\", {\n className: classNames.root\n }, /*#__PURE__*/ React.createElement(\"div\", {\n className: classNames.header\n }, /*#__PURE__*/ React.createElement(HeaderButtonComponentType, {\n \"aria-label\": onHeaderSelect ? headerAriaLabel : undefined,\n className: classNames.monthAndYear,\n onClick: onHeaderSelect,\n tabIndex: onHeaderSelect ? 0 : -1,\n onKeyDown: onButtonKeyDown(onHeaderSelect),\n type: \"button\"\n }, /*#__PURE__*/ React.createElement(\"span\", {\n \"aria-live\": \"polite\",\n \"aria-atomic\": \"true\"\n }, monthAndYear)), /*#__PURE__*/ React.createElement(CalendarDayNavigationButtons, {\n ...props,\n classNames: classNames\n })), /*#__PURE__*/ React.createElement(CalendarDayGrid, {\n ...propsWithoutStyles,\n gridLabel: `${monthAndYear}, ${gridLabel}`,\n componentRef: dayGrid,\n strings: strings,\n navigatedDate: navigatedDate,\n weeksToShow: showSixWeeksByDefault ? 6 : undefined,\n dateTimeFormatter: dateTimeFormatter,\n minDate: minDate,\n maxDate: maxDate,\n restrictedDates: restrictedDates,\n onNavigateDate: onNavigateDate,\n dateRangeType: dateRangeType\n }));\n};\nCalendarDay.displayName = 'CalendarDay';\nconst CalendarDayNavigationButtons = (props)=>{\n const { minDate, maxDate, navigatedDate, navigationIcons, allFocusable, strings, showCloseButton, classNames, onNavigateDate, onDismiss } = props;\n const onSelectNextMonth = ()=>{\n onNavigateDate(addMonths(navigatedDate, 1), false);\n };\n const onSelectPrevMonth = ()=>{\n onNavigateDate(addMonths(navigatedDate, -1), false);\n };\n // determine if previous/next months are in bounds\n const prevMonthInBounds = minDate ? compareDatePart(minDate, getMonthStart(navigatedDate)) < 0 : true;\n const nextMonthInBounds = maxDate ? compareDatePart(getMonthEnd(navigatedDate), maxDate) < 0 : true;\n // use aria-disabled instead of disabled so focus is not lost\n // when a prev/next button becomes disabled after being clicked\n return /*#__PURE__*/ React.createElement(\"div\", {\n className: classNames.monthComponents\n }, /*#__PURE__*/ React.createElement(\"button\", {\n className: mergeClasses(classNames.headerIconButton, !prevMonthInBounds && classNames.disabledStyle),\n tabIndex: prevMonthInBounds ? undefined : allFocusable ? 0 : -1,\n \"aria-disabled\": !prevMonthInBounds,\n onClick: prevMonthInBounds ? onSelectPrevMonth : undefined,\n onKeyDown: prevMonthInBounds ? onButtonKeyDown(onSelectPrevMonth) : undefined,\n title: strings.prevMonthAriaLabel ? strings.prevMonthAriaLabel + ' ' + strings.months[addMonths(navigatedDate, -1).getMonth()] : undefined,\n type: \"button\"\n }, navigationIcons.upNavigation), /*#__PURE__*/ React.createElement(\"button\", {\n className: mergeClasses(classNames.headerIconButton, !nextMonthInBounds && classNames.disabledStyle),\n tabIndex: nextMonthInBounds ? undefined : allFocusable ? 0 : -1,\n \"aria-disabled\": !nextMonthInBounds,\n onClick: nextMonthInBounds ? onSelectNextMonth : undefined,\n onKeyDown: nextMonthInBounds ? onButtonKeyDown(onSelectNextMonth) : undefined,\n title: strings.nextMonthAriaLabel ? strings.nextMonthAriaLabel + ' ' + strings.months[addMonths(navigatedDate, 1).getMonth()] : undefined,\n type: \"button\"\n }, navigationIcons.downNavigation), showCloseButton && /*#__PURE__*/ React.createElement(\"button\", {\n className: classNames.headerIconButton,\n onClick: onDismiss,\n onKeyDown: onButtonKeyDown(onDismiss),\n title: strings.closeButtonAriaLabel,\n type: \"button\"\n }, navigationIcons.dismiss));\n};\nCalendarDayNavigationButtons.displayName = 'CalendarDayNavigationButtons';\nconst onButtonKeyDown = (callback)=>(ev)=>{\n switch(ev.key){\n case Enter:\n callback === null || callback === void 0 ? void 0 : callback();\n break;\n }\n };\n"],"names":["CalendarDay","props","dayGrid","React","useRef","useImperativeHandle","componentRef","focus","_dayGrid_current_focus","_dayGrid_current","current","call","strings","gridLabel","navigatedDate","dateTimeFormatter","className","onHeaderSelect","showSixWeeksByDefault","minDate","maxDate","restrictedDates","onNavigateDate","showWeekNumbers","dateRangeType","animationDirection","classNames","useCalendarDayStyles_unstable","headerIsClickable","monthAndYear","formatMonthYear","HeaderButtonComponentType","headerAriaLabel","yearPickerHeaderAriaLabel","replace","propsWithoutStyles","createElement","root","header","undefined","onClick","tabIndex","onKeyDown","onButtonKeyDown","type","CalendarDayNavigationButtons","CalendarDayGrid","weeksToShow","displayName","navigationIcons","allFocusable","showCloseButton","onDismiss","onSelectNextMonth","addMonths","onSelectPrevMonth","prevMonthInBounds","compareDatePart","getMonthStart","nextMonthInBounds","getMonthEnd","monthComponents","mergeClasses","headerIconButton","disabledStyle","title","prevMonthAriaLabel","months","getMonth","upNavigation","nextMonthAriaLabel","downNavigation","closeButtonAriaLabel","dismiss","callback","ev","key","Enter"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;8BACD;wBACO;uBAC0C;iCACvC;4CACc;AAGnC,MAAMA,cAAc,CAACC;IAC5B,MAAMC,UAAUC,OAAMC,MAAM,CAAC;IAC7BD,OAAME,mBAAmB,CAACJ,MAAMK,YAAY,EAAE,IAAK,CAAA;YAC3CC;gBACI,IAAIC,wBAAwBC;gBAC3BA,CAAAA,mBAAmBP,QAAQQ,OAAO,AAAD,MAAO,QAAQD,qBAAqB,KAAK,IAAI,KAAK,IAAI,AAACD,CAAAA,yBAAyBC,iBAAiBF,KAAK,AAAD,MAAO,QAAQC,2BAA2B,KAAK,IAAI,KAAK,IAAIA,uBAAuBG,IAAI,CAACF;YACnO;QACJ,CAAA,GAAI,EAAE;IACV,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAEC,aAAa,EAAEC,iBAAiB,EAAEC,SAAS,EAAEC,cAAc,EAAEC,qBAAqB,EAAEC,OAAO,EAAEC,OAAO,EAAEC,eAAe,EAAEC,cAAc,EAAEC,eAAe,EAAEC,aAAa,EAAEC,kBAAkB,EAAE,GAAGxB;IAC1N,MAAMyB,aAAaC,IAAAA,yDAA6B,EAAC;QAC7CX;QACAY,mBAAmB,CAAC,CAACX;QACrBM;QACAE;IACJ;IACA,MAAMI,eAAed,kBAAkBe,eAAe,CAAChB,eAAeF;IACtE,MAAMmB,4BAA4Bd,iBAAiB,WAAW;IAC9D,MAAMe,kBAAkBpB,QAAQqB,yBAAyB,GAAGrB,QAAQqB,yBAAyB,CAACC,OAAO,CAAC,OAAOL,gBAAgBA;IAC7H,MAAM,EAAE,GAAGM,oBAAoB,GAA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1D,QAAQuD,MAAM,CAACb,IAAAA,gBAAS,EAACxC,eAAe,GAAGsD,QAAQ,GAAG,GAAG7B;QAChIK,MAAM;IACV,GAAGK,gBAAgBsB,cAAc,GAAGpB,mBAAmB,WAAW,GAAGhD,OAAMiC,aAAa,CAAC,UAAU;QAC/FpB,WAAWU,WAAWqC,gBAAgB;QACtCvB,SAASY;QACTV,WAAWC,gBAAgBS;QAC3Ba,OAAOrD,QAAQ4D,oBAAoB;QACnC5B,MAAM;IACV,GAAGK,gBAAgBwB,OAAO;AAC9B;AACA5B,6BAA6BG,WAAW,GAAG;AAC3C,MAAML,kBAAkB,CAAC+B,WAAW,CAACC;QAC7B,OAAOA,GAAGC,GAAG;YACT,KAAKC,mBAAK;gBACNH,aAAa,QAAQA,aAAa,KAAK,IAAI,KAAK,IAAIA;gBACpD;QACR;IACJ"}
|
1
|
+
{"version":3,"sources":["CalendarDay.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Enter } from '@fluentui/keyboard-keys';\nimport { mergeClasses } from '@griffel/react';\nimport { addMonths, compareDatePart, getMonthEnd, getMonthStart } from '../../utils';\nimport { CalendarDayGrid } from '../CalendarDayGrid/CalendarDayGrid';\nimport { useCalendarDayStyles_unstable } from './useCalendarDayStyles.styles';\nimport type { ICalendarDayGrid } from '../CalendarDayGrid/CalendarDayGrid.types';\nimport type { CalendarDayProps, CalendarDayStyles } from './CalendarDay.types';\n\n/**\n * @internal\n */\nexport const CalendarDay: React.FunctionComponent<CalendarDayProps> = props => {\n const dayGrid = React.useRef<ICalendarDayGrid>(null);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n focus() {\n dayGrid.current?.focus?.();\n },\n }),\n [],\n );\n\n const {\n strings,\n gridLabel,\n navigatedDate,\n dateTimeFormatter,\n className,\n onHeaderSelect,\n showSixWeeksByDefault,\n minDate,\n maxDate,\n restrictedDates,\n onNavigateDate,\n showWeekNumbers,\n dateRangeType,\n animationDirection,\n } = props;\n\n const classNames = useCalendarDayStyles_unstable({\n className,\n headerIsClickable: !!onHeaderSelect,\n showWeekNumbers,\n animationDirection,\n });\n\n const monthAndYear = dateTimeFormatter.formatMonthYear(navigatedDate, strings);\n const HeaderButtonComponentType = onHeaderSelect ? 'button' : 'div';\n const headerAriaLabel = strings.yearPickerHeaderAriaLabel\n ? strings.yearPickerHeaderAriaLabel.replace('{0}', monthAndYear)\n : monthAndYear;\n\n const { ...propsWithoutStyles } = props;\n\n return (\n <div className={classNames.root}>\n <div className={classNames.header}>\n <HeaderButtonComponentType\n aria-label={onHeaderSelect ? headerAriaLabel : undefined}\n className={classNames.monthAndYear}\n onClick={onHeaderSelect}\n tabIndex={onHeaderSelect ? 0 : -1} // prevent focus if there's no action for the button\n onKeyDown={onButtonKeyDown(onHeaderSelect)}\n type=\"button\"\n >\n <span aria-live=\"polite\" aria-atomic=\"true\">\n {monthAndYear}\n </span>\n </HeaderButtonComponentType>\n <CalendarDayNavigationButtons {...props} classNames={classNames} />\n </div>\n <CalendarDayGrid\n {...propsWithoutStyles}\n gridLabel={`${monthAndYear}, ${gridLabel}`}\n componentRef={dayGrid}\n strings={strings}\n navigatedDate={navigatedDate!}\n weeksToShow={showSixWeeksByDefault ? 6 : undefined}\n dateTimeFormatter={dateTimeFormatter!}\n minDate={minDate}\n maxDate={maxDate}\n restrictedDates={restrictedDates}\n onNavigateDate={onNavigateDate}\n dateRangeType={dateRangeType}\n />\n </div>\n );\n};\nCalendarDay.displayName = 'CalendarDay';\n\ninterface CalendarDayNavigationButtonsProps extends CalendarDayProps {\n classNames: Record<keyof CalendarDayStyles, string>;\n}\n\nconst CalendarDayNavigationButtons = (props: CalendarDayNavigationButtonsProps): JSX.Element => {\n const {\n minDate,\n maxDate,\n navigatedDate,\n navigationIcons,\n allFocusable,\n strings,\n showCloseButton,\n classNames,\n onNavigateDate,\n onDismiss,\n } = props;\n\n const onSelectNextMonth = (): void => {\n onNavigateDate(addMonths(navigatedDate, 1), false);\n };\n\n const onSelectPrevMonth = (): void => {\n onNavigateDate(addMonths(navigatedDate, -1), false);\n };\n\n // determine if previous/next months are in bounds\n const prevMonthInBounds = minDate ? compareDatePart(minDate, getMonthStart(navigatedDate)) < 0 : true;\n const nextMonthInBounds = maxDate ? compareDatePart(getMonthEnd(navigatedDate), maxDate) < 0 : true;\n\n // use aria-disabled instead of disabled so focus is not lost\n // when a prev/next button becomes disabled after being clicked\n return (\n <div className={classNames.monthComponents}>\n <button\n className={mergeClasses(classNames.headerIconButton, !prevMonthInBounds && classNames.disabledStyle)}\n tabIndex={prevMonthInBounds ? undefined : allFocusable ? 0 : -1}\n aria-disabled={!prevMonthInBounds}\n onClick={prevMonthInBounds ? onSelectPrevMonth : undefined}\n onKeyDown={prevMonthInBounds ? onButtonKeyDown(onSelectPrevMonth) : undefined}\n title={\n strings.prevMonthAriaLabel\n ? strings.prevMonthAriaLabel + ' ' + strings.months[addMonths(navigatedDate, -1).getMonth()]\n : undefined\n }\n type=\"button\"\n >\n {navigationIcons.upNavigation}\n </button>\n <button\n className={mergeClasses(classNames.headerIconButton, !nextMonthInBounds && classNames.disabledStyle)}\n tabIndex={nextMonthInBounds ? undefined : allFocusable ? 0 : -1}\n aria-disabled={!nextMonthInBounds}\n onClick={nextMonthInBounds ? onSelectNextMonth : undefined}\n onKeyDown={nextMonthInBounds ? onButtonKeyDown(onSelectNextMonth) : undefined}\n title={\n strings.nextMonthAriaLabel\n ? strings.nextMonthAriaLabel + ' ' + strings.months[addMonths(navigatedDate, 1).getMonth()]\n : undefined\n }\n type=\"button\"\n >\n {navigationIcons.downNavigation}\n </button>\n {showCloseButton && (\n <button\n className={classNames.headerIconButton}\n onClick={onDismiss}\n onKeyDown={onButtonKeyDown(onDismiss)}\n title={strings.closeButtonAriaLabel}\n type=\"button\"\n >\n {navigationIcons.dismiss}\n </button>\n )}\n </div>\n );\n};\nCalendarDayNavigationButtons.displayName = 'CalendarDayNavigationButtons';\n\nconst onButtonKeyDown =\n (callback?: () => void): ((ev: React.KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => void) =>\n (ev: React.KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => {\n switch (ev.key) {\n case Enter:\n callback?.();\n break;\n }\n };\n"],"names":["CalendarDay","props","dayGrid","React","useRef","useImperativeHandle","componentRef","focus","current","strings","gridLabel","navigatedDate","dateTimeFormatter","className","onHeaderSelect","showSixWeeksByDefault","minDate","maxDate","restrictedDates","onNavigateDate","showWeekNumbers","dateRangeType","animationDirection","classNames","useCalendarDayStyles_unstable","headerIsClickable","monthAndYear","formatMonthYear","HeaderButtonComponentType","headerAriaLabel","yearPickerHeaderAriaLabel","replace","propsWithoutStyles","createElement","div","root","header","aria-label","undefined","onClick","tabIndex","onKeyDown","onButtonKeyDown","type","span","aria-live","aria-atomic","CalendarDayNavigationButtons","CalendarDayGrid","weeksToShow","displayName","navigationIcons","allFocusable","showCloseButton","onDismiss","onSelectNextMonth","addMonths","onSelectPrevMonth","prevMonthInBounds","compareDatePart","getMonthStart","nextMonthInBounds","getMonthEnd","monthComponents","button","mergeClasses","headerIconButton","disabledStyle","aria-disabled","title","prevMonthAriaLabel","months","getMonth","upNavigation","nextMonthAriaLabel","downNavigation","closeButtonAriaLabel","dismiss","callback","ev","key","Enter"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;;iEAZU;8BACD;wBACO;uBAC0C;iCACvC;4CACc;AAOvC,MAAMA,cAAyDC,CAAAA;IACpE,MAAMC,UAAUC,OAAMC,MAAM,CAAmB;IAE/CD,OAAME,mBAAmB,CACvBJ,MAAMK,YAAY,EAClB,IAAO,CAAA;YACLC;oBACEL,wBAAAA;gBAAAA,CAAAA,mBAAAA,QAAQM,OAAO,AAAPA,MAAO,QAAfN,qBAAAA,KAAAA,IAAAA,KAAAA,IAAAA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cesContent":["import * as React from 'react';\nimport type { CalendarStrings, DateFormatting } from '../../utils';\nimport type { CalendarDayGridProps, CalendarDayGridStyleProps } from '../CalendarDayGrid/CalendarDayGrid.types';\nimport type { CalendarNavigationIcons } from '../Calendar/calendarNavigationIcons';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ICalendarDay {\n focus(): void;\n}\n\nexport interface CalendarDayProps extends CalendarDayGridProps {\n /**\n * Optional callback to access the ICalendarDay interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<ICalendarDay>;\n\n /**\n * Additional CSS class(es) to apply to the CalendarDay.\n */\n className?: string;\n\n /**\n * Localized strings to use in the Calendar\n */\n strings: CalendarStrings;\n\n /**\n * The currently navigated date\n */\n navigatedDate: Date;\n\n /**\n * Callback issued when a date in the calendar is navigated\n * @param date - The date that is navigated to\n * @param focusOnNavigatedDay - Whether to set the focus to the navigated date.\n */\n onNavigateDate: (date: Date, focusOnNavigatedDay: boolean) => void;\n\n /**\n * Callback issued when calendar day is closed\n */\n onDismiss?: () => void;\n\n /**\n * Callback function when the header is selected\n */\n onHeaderSelect?: () => void;\n\n /**\n * Whether the calendar should show the week number (weeks 1 to 53) before each week row\n * @default false\n */\n showWeekNumbers?: boolean;\n\n /**\n * Apply additional formatting to dates, for example localized date formatting.\n */\n dateTimeFormatter: DateFormatting;\n\n /**\n * Whether the calendar should show 6 weeks by default.\n * @default false\n */\n showSixWeeksByDefault?: boolean;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a date earlier than this value.\n */\n minDate?: Date;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a date later than this value.\n */\n maxDate?: Date;\n\n /**\n * If set the Calendar will not allow selection of dates in this array.\n */\n restrictedDates?: Date[];\n\n /**\n * Whether the close button should be shown or not\n * @default false\n */\n showCloseButton?: boolean;\n\n /**\n * Allows all dates and buttons to be focused, including disabled ones\n * @default false\n */\n allFocusable?: boolean;\n\n /**\n * Custom navigation icons.\n */\n navigationIcons: CalendarNavigationIcons;\n}\n\n/**\n * @internal\n */\nexport interface CalendarDayStyleProps extends CalendarDayGridStyleProps {\n /**\n * Accept custom classNames\n */\n className?: string;\n\n /**\n * Whether the header is clickable\n */\n headerIsClickable?: boolean;\n\n /**\n * Whether week numbers are being shown\n */\n showWeekNumbers?: boolean;\n}\n\n/**\n * @internal\n */\nexport interface CalendarDayStyles {\n /**\n * Style for the root element.\n */\n root: string;\n\n /**\n * The style for the header button and forward/back navigation button container\n */\n header: string;\n\n /**\n * The style for the title text inside the header\n */\n monthAndYear: string;\n\n /**\n * The style for the wrapper around forward/back/close buttons\n */\n monthComponents: string;\n\n /**\n * The style for the forward/back/close buttons\n */\n headerIconButton: string;\n\n /**\n * The style to apply for disabled elements\n */\n disabledStyle: string;\n}\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './CalendarDay';\nexport * from './CalendarDay.types';\nexport * from './useCalendarDayStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA"}
|