pixel-react 1.7.4 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/assets/fonts/Poppins-Bold.ttf +0 -0
  3. package/lib/assets/fonts/Poppins-Medium.ttf +0 -0
  4. package/lib/assets/fonts/Poppins-Regular.ttf +0 -0
  5. package/lib/assets/fonts/Poppins-SemiBold.ttf +0 -0
  6. package/lib/components/TableTree/TableTree copy.d.ts +25 -0
  7. package/lib/index.esm.js +209 -120
  8. package/lib/index.esm.js.map +1 -1
  9. package/lib/index.js +209 -120
  10. package/lib/index.js.map +1 -1
  11. package/lib/tsconfig.tsbuildinfo +1 -1
  12. package/package.json +1 -1
  13. package/src/components/MenuOption/MenuOption.tsx +29 -20
  14. package/lib/1fb4472b34e4fe07.css +0 -1
  15. package/lib/StyleGuide/ColorPalette/ColorPalette.stories.d.ts +0 -6
  16. package/lib/StyleGuide/Typography/Typography.stories.d.ts +0 -6
  17. package/lib/components/Accordion/Accordion.stories.d.ts +0 -6
  18. package/lib/components/AddResourceButton/AddButton.stories.d.ts +0 -8
  19. package/lib/components/AllProjectsDropdown/AllProjectsDropdown.stories.d.ts +0 -7
  20. package/lib/components/AppHeader/AppHeader.stories.d.ts +0 -7
  21. package/lib/components/AttachmentButton/AttachmentButton.stories.d.ts +0 -9
  22. package/lib/components/Avatar/Avatar.stories.d.ts +0 -10
  23. package/lib/components/Button/Button.stories.d.ts +0 -13
  24. package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.d.ts +0 -7
  25. package/lib/components/Charts/DonutChart/DonutChart.stories.d.ts +0 -6
  26. package/lib/components/Charts/PieChart/PieChart.stories.d.ts +0 -7
  27. package/lib/components/Charts/RadialChart/RadialChart.stories.d.ts +0 -6
  28. package/lib/components/Checkbox/Checkbox.stories.d.ts +0 -8
  29. package/lib/components/Chip/Chip.stories.d.ts +0 -14
  30. package/lib/components/DatePicker/DatePicker.stories.d.ts +0 -9
  31. package/lib/components/DragAndDrop/DragAndDrop.stories.d.ts +0 -6
  32. package/lib/components/Drawer/Drawer.stories.d.ts +0 -12
  33. package/lib/components/ExcelFile/ColorBarselector/ColorBarSelector.d.ts +0 -8
  34. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +0 -7
  35. package/lib/components/ExcelFile/ExcelFile/Excel/Cell.d.ts +0 -4
  36. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +0 -5
  37. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +0 -3
  38. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +0 -5
  39. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +0 -5
  40. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +0 -8
  41. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +0 -10
  42. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +0 -3
  43. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +0 -3
  44. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +0 -5
  45. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +0 -3
  46. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +0 -80
  47. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +0 -3
  48. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +0 -174
  49. package/lib/components/ExcelFile/ExcelFile/Excel/areModelsEqual.d.ts +0 -1
  50. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +0 -8
  51. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +0 -22
  52. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +0 -17
  53. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +0 -2
  54. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +0 -21
  55. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +0 -3
  56. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +0 -24
  57. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +0 -13
  58. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +0 -67
  59. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +0 -22
  60. package/lib/components/ExcelFile/ExcelFile/Excel/point.d.ts +0 -11
  61. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +0 -27
  62. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +0 -95
  63. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +0 -178
  64. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +0 -3
  65. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +0 -3
  66. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +0 -44
  67. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +0 -19
  68. package/lib/components/ExcelFile/ExcelFile.stories.d.ts +0 -6
  69. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -12
  70. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +0 -15
  71. package/lib/components/ExcelFile/Types.d.ts +0 -129
  72. package/lib/components/ExcelFile/index.d.ts +0 -1
  73. package/lib/components/ExpandableMenu/ExpandableMenu.stories.d.ts +0 -7
  74. package/lib/components/FF_Captcha/captcha.stories.d.ts +0 -8
  75. package/lib/components/FileDropzone/FileDropzone.stories.d.ts +0 -8
  76. package/lib/components/Form/Form.stories.d.ts +0 -7
  77. package/lib/components/GridLayout/GridLayout.stories.d.ts +0 -8
  78. package/lib/components/HighlightText/HighlightText.stories.d.ts +0 -6
  79. package/lib/components/Icon/Icon.stories.d.ts +0 -8
  80. package/lib/components/IconButton/IconButton.stories.d.ts +0 -7
  81. package/lib/components/IconRadioGroup/IconRadioGroup.stories.d.ts +0 -7
  82. package/lib/components/Input/Input.stories.d.ts +0 -9
  83. package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +0 -9
  84. package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +0 -11
  85. package/lib/components/LazyLoad/LazyLoad.stories.d.ts +0 -6
  86. package/lib/components/MachineInputField/MachineInputField.stories.d.ts +0 -6
  87. package/lib/components/MenuOption/MenuOption.stories.d.ts +0 -16
  88. package/lib/components/MiniModal/MiniModal.stories.d.ts +0 -10
  89. package/lib/components/Modal/Modal.stories.d.ts +0 -7
  90. package/lib/components/ModulesChip/ModuleChip.stories.d.ts +0 -6
  91. package/lib/components/MultiSelect/MultiSelect.stories.d.ts +0 -10
  92. package/lib/components/NLPInput/NlpInput.stories.d.ts +0 -7
  93. package/lib/components/Paper/Paper.stories.d.ts +0 -11
  94. package/lib/components/RadioButton/RadioButton.stories.d.ts +0 -10
  95. package/lib/components/RadioGroup/RadioGroup.stories.d.ts +0 -9
  96. package/lib/components/Search/Search.stories.d.ts +0 -6
  97. package/lib/components/Select/Select.stories.d.ts +0 -13
  98. package/lib/components/Select/components/Dropdown/Dropdown.d.ts +0 -4
  99. package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +0 -17
  100. package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.d.ts +0 -6
  101. package/lib/components/StateDropdown/StateDropdown.stories.d.ts +0 -10
  102. package/lib/components/StatusButton/StatusButton.stories.d.ts +0 -14
  103. package/lib/components/Table/Table.stories.d.ts +0 -13
  104. package/lib/components/TableTree/TableTree.stories.d.ts +0 -7
  105. package/lib/components/Tabs/Tabs.stories.d.ts +0 -9
  106. package/lib/components/TextArea/Textarea.stories.d.ts +0 -9
  107. package/lib/components/Toast/Toast.stories.d.ts +0 -6
  108. package/lib/components/Toastify/Toastify.stories.d.ts +0 -6
  109. package/lib/components/Toggle/Toggle.stories.d.ts +0 -12
  110. package/lib/components/Tooltip/Tooltip.stories.d.ts +0 -15
  111. package/lib/components/Typography/Typography.stories.d.ts +0 -10
  112. package/lib/components/VariableInput/VariableInput.stories.d.ts +0 -6
  113. package/lib/utils/checkEmpty/checkEmpty.stories.d.ts +0 -6
  114. package/lib/utils/compareArrays/compareArrays.stories.d.ts +0 -6
  115. package/lib/utils/compareObjects/compareObjects.stories.d.ts +0 -6
  116. package/lib/utils/debounce/debounce.stories.d.ts +0 -6
  117. package/lib/utils/ffID/ffID.stories.d.ts +0 -6
  118. package/lib/utils/find/findAndInsert.d.ts +0 -7
  119. package/lib/utils/find/findAndInsert.stories.d.ts +0 -7
  120. package/lib/utils/findAndInsert/findAndInsert.stories.d.ts +0 -7
  121. package/lib/utils/getEncryptedData/getEncryptedData.stories.d.ts +0 -6
  122. package/lib/utils/getExtension/getExtension.stories.d.ts +0 -6
  123. package/lib/utils/throttle/throttle.stories.d.ts +0 -6
  124. package/lib/utils/truncateText/truncateText.stories.d.ts +0 -6
  125. /package/lib/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.d.ts +0 -0
package/lib/index.js CHANGED
@@ -3200,9 +3200,9 @@ const OptionCard = ({
3200
3200
  const optionCardRef = React.useRef(null);
3201
3201
  React.useEffect(() => {
3202
3202
  if (optionCardRef?.current) {
3203
- const rect = optionCardRef?.current?.getBoundingClientRect();
3204
- setOptionsHeight(rect?.height);
3205
- setOptionsWidth(rect?.width);
3203
+ const rect = optionCardRef.current.getBoundingClientRect();
3204
+ setOptionsHeight(rect.height);
3205
+ setOptionsWidth(rect.width);
3206
3206
  }
3207
3207
  }, []);
3208
3208
  useClickOutside(menuRef, closeDropdown, [optionCardRef]);
@@ -3215,7 +3215,7 @@ const OptionCard = ({
3215
3215
  };
3216
3216
  case 'down':
3217
3217
  return {
3218
- top: menuPosition.top + 20,
3218
+ top: menuPosition.top + menuPosition.height + 7,
3219
3219
  left: menuPosition.left - 4
3220
3220
  };
3221
3221
  case 'left':
@@ -3226,23 +3226,25 @@ const OptionCard = ({
3226
3226
  case 'right':
3227
3227
  return {
3228
3228
  top: menuPosition.top - 4,
3229
- left: menuPosition.left + 20
3229
+ left: menuPosition.left + menuPosition.height + 20
3230
3230
  };
3231
3231
  default:
3232
3232
  return {
3233
- top: menuPosition.bottom,
3234
- left: menuPosition.rightSpaceAvailable + 12
3233
+ top: menuPosition.top,
3234
+ left: menuPosition.left
3235
3235
  };
3236
3236
  }
3237
3237
  })();
3238
+ const adjustedStyle = {
3239
+ top: Math.min(Math.max(style.top, 0), window.innerHeight - optionsHeight),
3240
+ left: Math.min(Math.max(style.left, 0), window.innerWidth - optionsWidth),
3241
+ zIndex
3242
+ };
3238
3243
  return /*#__PURE__*/reactDom.createPortal(jsxRuntime.jsx("div", {
3239
3244
  className: classNames('ff-option-card', [{
3240
3245
  'ff-option-card--primary': variant === 'primary'
3241
3246
  }], currentTheme),
3242
- style: {
3243
- ...style,
3244
- zIndex
3245
- },
3247
+ style: adjustedStyle,
3246
3248
  ref: optionCardRef,
3247
3249
  children: options.map(opt => jsxRuntime.jsx(Option$1, {
3248
3250
  option: opt,
@@ -3276,26 +3278,28 @@ const MenuOption = ({
3276
3278
  right: 0
3277
3279
  });
3278
3280
  const closeDropDown = () => setIsClicked(false);
3279
- const onIconClickHandler = () => {
3280
- onClick();
3281
- calculateDims();
3282
- setIsClicked(prev => !prev);
3283
- };
3284
- const handleOptionClick = option => {
3285
- onOptionClick(option);
3286
- closeDropDown();
3287
- };
3288
3281
  const calculateDims = () => {
3289
3282
  if (targetRef?.current) {
3290
3283
  const rect = targetRef.current.getBoundingClientRect();
3284
+ const containerScrollTop = targetRef.current?.offsetParent?.scrollTop || 0;
3285
+ const containerScrollLeft = targetRef.current?.offsetParent?.scrollLeft || 0;
3291
3286
  setMenuPosition({
3292
- top: rect.top + window.scrollY,
3293
- left: rect.left + window.scrollX,
3287
+ top: rect.top + window.scrollY - containerScrollTop,
3288
+ left: rect.left + window.scrollX - containerScrollLeft,
3294
3289
  height: rect.height,
3295
3290
  right: rect.right
3296
3291
  });
3297
3292
  }
3298
3293
  };
3294
+ const onIconClickHandler = () => {
3295
+ onClick();
3296
+ calculateDims();
3297
+ setIsClicked(prev => !prev);
3298
+ };
3299
+ const handleOptionClick = option => {
3300
+ onOptionClick(option);
3301
+ closeDropDown();
3302
+ };
3299
3303
  return jsxRuntime.jsxs("div", {
3300
3304
  className: "ff-menu-option-container",
3301
3305
  ref: menuRef,
@@ -13255,6 +13259,53 @@ function setYear(date, year, options) {
13255
13259
  return date_;
13256
13260
  }
13257
13261
 
13262
+ const FIVE_WEEKS = 5;
13263
+ const FOUR_WEEKS = 4;
13264
+ /**
13265
+ * Return the number of weeks to display in the broadcast calendar.
13266
+ *
13267
+ * @since 9.4.0
13268
+ */
13269
+ function getBroadcastWeeksInMonth(month, dateLib) {
13270
+ // Get the first day of the month
13271
+ const firstDayOfMonth = dateLib.startOfMonth(month);
13272
+ // Get the day of the week for the first day of the month (1-7, where 1 is Monday)
13273
+ const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;
13274
+ const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);
13275
+ const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);
13276
+ const numberOfWeeks = month.getMonth() === lastDateOfLastWeek.getMonth() ? FIVE_WEEKS : FOUR_WEEKS;
13277
+ return numberOfWeeks;
13278
+ }
13279
+
13280
+ /**
13281
+ * Return the start date of the week in the broadcast calendar.
13282
+ *
13283
+ * @since 9.4.0
13284
+ */
13285
+ function startOfBroadcastWeek(date, dateLib) {
13286
+ const firstOfMonth = dateLib.startOfMonth(date);
13287
+ const dayOfWeek = firstOfMonth.getDay();
13288
+ if (dayOfWeek === 1) {
13289
+ return firstOfMonth;
13290
+ } else if (dayOfWeek === 0) {
13291
+ return dateLib.addDays(firstOfMonth, -1 * 6);
13292
+ } else {
13293
+ return dateLib.addDays(firstOfMonth, -1 * (dayOfWeek - 1));
13294
+ }
13295
+ }
13296
+
13297
+ /**
13298
+ * Return the end date of the week in the broadcast calendar.
13299
+ *
13300
+ * @since 9.4.0
13301
+ */
13302
+ function endOfBroadcastWeek(date, dateLib) {
13303
+ const startDate = startOfBroadcastWeek(date, dateLib);
13304
+ const numberOfWeeks = getBroadcastWeeksInMonth(date, dateLib);
13305
+ const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);
13306
+ return endDate;
13307
+ }
13308
+
13258
13309
  /**
13259
13310
  * A wrapper class around [date-fns](http://date-fns.org) sharing the same
13260
13311
  * options. Methods of this class can be overridden using the
@@ -13335,6 +13386,15 @@ class DateLib {
13335
13386
  this.differenceInCalendarMonths = (dateLeft, dateRight) => {
13336
13387
  return this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(dateLeft, dateRight) : differenceInCalendarMonths(dateLeft, dateRight);
13337
13388
  };
13389
+ /**
13390
+ * Returns the end of the broadcast week for the given date.
13391
+ *
13392
+ * @param date The original date.
13393
+ * @returns The end of the broadcast week.
13394
+ */
13395
+ this.endOfBroadcastWeek = date => {
13396
+ return this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(date, this) : endOfBroadcastWeek(date, this);
13397
+ };
13338
13398
  /**
13339
13399
  * Returns the end of the ISO week for the given date.
13340
13400
  *
@@ -13496,6 +13556,15 @@ class DateLib {
13496
13556
  this.setYear = (date, year) => {
13497
13557
  return this.overrides?.setYear ? this.overrides.setYear(date, year) : setYear(date, year);
13498
13558
  };
13559
+ /**
13560
+ * Returns the start of the broadcast week for the given date.
13561
+ *
13562
+ * @param date The original date.
13563
+ * @returns The start of the broadcast week.
13564
+ */
13565
+ this.startOfBroadcastWeek = date => {
13566
+ return this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(date, this) : startOfBroadcastWeek(date, this);
13567
+ };
13499
13568
  /**
13500
13569
  * Returns the start of the day for the given date.
13501
13570
  *
@@ -14081,7 +14150,8 @@ function getDataAttributes(props) {
14081
14150
  "data-mode": props.mode ?? undefined,
14082
14151
  "data-required": "required" in props ? props.required : undefined,
14083
14152
  "data-multiple-months": props.numberOfMonths && props.numberOfMonths > 1 || undefined,
14084
- "data-week-numbers": props.showWeekNumber || undefined
14153
+ "data-week-numbers": props.showWeekNumber || undefined,
14154
+ "data-broadcast-calendar": props.broadcastCalendar || undefined
14085
14155
  };
14086
14156
  Object.entries(props).forEach(([key, val]) => {
14087
14157
  if (key.startsWith("data-")) {
@@ -14147,7 +14217,7 @@ function formatDay(date, options, dateLib) {
14147
14217
  */
14148
14218
  function formatMonthDropdown(/** The month number to format. */
14149
14219
  monthNumber, /** The locale to use for formatting. */
14150
- locale = enUS) {
14220
+ locale) {
14151
14221
  return locale.localize?.month(monthNumber);
14152
14222
  }
14153
14223
 
@@ -14251,7 +14321,7 @@ function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
14251
14321
  return a - b;
14252
14322
  });
14253
14323
  const options = sortedMonths.map(value => {
14254
- const label = formatters.formatMonthDropdown(value, dateLib.options.locale);
14324
+ const label = formatters.formatMonthDropdown(value, dateLib.options.locale ?? enUS);
14255
14325
  const month = dateLib.Date ? new dateLib.Date(year, value) : new Date(year, value);
14256
14326
  const disabled = navStart && month < startOfMonth(navStart) || navEnd && month > startOfMonth(navEnd) || false;
14257
14327
  return {
@@ -14626,7 +14696,8 @@ function tzName(tz, date) {
14626
14696
  */
14627
14697
  function getWeekdays(/** The date library. */
14628
14698
  dateLib, /** Use ISOWeek instead of locale/ */
14629
- ISOWeek, timeZone) {
14699
+ ISOWeek, timeZone, /** @since 9.4.0 */
14700
+ broadcastCalendar) {
14630
14701
  const date = timeZone ? TZDate.tz(timeZone) : dateLib.Date ? new dateLib.Date() : new Date();
14631
14702
  const start = ISOWeek ? dateLib.startOfISOWeek(date) : dateLib.startOfWeek(date);
14632
14703
  const days = [];
@@ -14829,29 +14900,30 @@ var defaultLabels = /*#__PURE__*/Object.freeze({
14829
14900
  labelYearDropdown: labelYearDropdown
14830
14901
  });
14831
14902
 
14832
- /** The number of days in a month when having 6 weeks. */
14833
- const NrOfDaysWithFixedWeeks = 42;
14834
14903
  /** Return all the dates to display in the calendar. */
14835
14904
  function getDates(displayMonths, maxDate, props, dateLib) {
14836
14905
  const firstMonth = displayMonths[0];
14837
14906
  const lastMonth = displayMonths[displayMonths.length - 1];
14838
14907
  const {
14839
14908
  ISOWeek,
14840
- fixedWeeks
14909
+ fixedWeeks,
14910
+ broadcastCalendar
14841
14911
  } = props ?? {};
14842
14912
  const {
14843
- startOfWeek,
14844
- endOfWeek,
14845
- startOfISOWeek,
14846
- endOfISOWeek,
14847
14913
  addDays,
14848
14914
  differenceInCalendarDays,
14849
14915
  differenceInCalendarMonths,
14916
+ endOfBroadcastWeek,
14917
+ endOfISOWeek,
14918
+ endOfMonth,
14919
+ endOfWeek,
14850
14920
  isAfter,
14851
- endOfMonth
14921
+ startOfBroadcastWeek,
14922
+ startOfISOWeek,
14923
+ startOfWeek
14852
14924
  } = dateLib;
14853
- const startWeekFirstDate = ISOWeek ? startOfISOWeek(firstMonth) : startOfWeek(firstMonth);
14854
- const endWeekLastDate = ISOWeek ? endOfISOWeek(endOfMonth(lastMonth)) : endOfWeek(endOfMonth(lastMonth));
14925
+ const startWeekFirstDate = broadcastCalendar ? startOfBroadcastWeek(firstMonth, dateLib) : ISOWeek ? startOfISOWeek(firstMonth) : startOfWeek(firstMonth);
14926
+ const endWeekLastDate = broadcastCalendar ? endOfBroadcastWeek(lastMonth, dateLib) : ISOWeek ? endOfISOWeek(endOfMonth(lastMonth)) : endOfWeek(endOfMonth(lastMonth));
14855
14927
  const nOfDays = differenceInCalendarDays(endWeekLastDate, startWeekFirstDate);
14856
14928
  const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
14857
14929
  const dates = [];
@@ -14863,9 +14935,11 @@ function getDates(displayMonths, maxDate, props, dateLib) {
14863
14935
  dates.push(date);
14864
14936
  }
14865
14937
  // If fixed weeks is enabled, add the extra dates to the array
14866
- const extraDates = NrOfDaysWithFixedWeeks * nOfMonths;
14938
+ const nrOfDaysWithFixedWeeks = broadcastCalendar ? 35 : 42;
14939
+ const extraDates = nrOfDaysWithFixedWeeks * nOfMonths;
14867
14940
  if (fixedWeeks && dates.length < extraDates) {
14868
- for (let i = 0; i < 7; i++) {
14941
+ const daysToAdd = extraDates - dates.length;
14942
+ for (let i = 0; i < daysToAdd; i++) {
14869
14943
  const date = addDays(dates[dates.length - 1], 1);
14870
14944
  dates.push(date);
14871
14945
  }
@@ -14976,25 +15050,29 @@ displayMonths, /** The dates to display in the calendar. */
14976
15050
  dates, /** Options from the props context. */
14977
15051
  props, dateLib) {
14978
15052
  const {
14979
- startOfWeek,
14980
- endOfWeek,
14981
- startOfISOWeek,
15053
+ addDays,
15054
+ endOfBroadcastWeek,
14982
15055
  endOfISOWeek,
14983
15056
  endOfMonth,
14984
- addDays,
15057
+ endOfWeek,
15058
+ getISOWeek,
14985
15059
  getWeek,
14986
- getISOWeek
15060
+ startOfBroadcastWeek,
15061
+ startOfISOWeek,
15062
+ startOfWeek
14987
15063
  } = dateLib;
14988
15064
  const dayPickerMonths = displayMonths.reduce((months, month) => {
14989
- const firstDateOfFirstWeek = props.ISOWeek ? startOfISOWeek(month) : startOfWeek(month);
14990
- const lastDateOfLastWeek = props.ISOWeek ? endOfISOWeek(endOfMonth(month)) : endOfWeek(endOfMonth(month));
15065
+ const firstDateOfFirstWeek = props.broadcastCalendar ? startOfBroadcastWeek(month, dateLib) : props.ISOWeek ? startOfISOWeek(month) : startOfWeek(month);
15066
+ const lastDateOfLastWeek = props.broadcastCalendar ? endOfBroadcastWeek(month, dateLib) : props.ISOWeek ? endOfISOWeek(endOfMonth(month)) : endOfWeek(endOfMonth(month));
14991
15067
  /** The dates to display in the month. */
14992
15068
  const monthDates = dates.filter(date => {
14993
15069
  return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;
14994
15070
  });
14995
- if (props.fixedWeeks && monthDates.length < 42) {
15071
+ const nrOfDaysWithFixedWeeks = props.broadcastCalendar ? 35 : 42;
15072
+ if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {
14996
15073
  const extraDates = dates.filter(date => {
14997
- return date > lastDateOfLastWeek && date <= addDays(lastDateOfLastWeek, 7);
15074
+ const daysToAdd = nrOfDaysWithFixedWeeks - monthDates.length;
15075
+ return date > lastDateOfLastWeek && date <= addDays(lastDateOfLastWeek, daysToAdd);
14998
15076
  });
14999
15077
  monthDates.push(...extraDates);
15000
15078
  }
@@ -15432,27 +15510,30 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
15432
15510
  /** Return the next date that should be focused. */
15433
15511
  function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {
15434
15512
  const {
15435
- ISOWeek
15513
+ ISOWeek,
15514
+ broadcastCalendar
15436
15515
  } = props;
15437
15516
  const {
15438
15517
  addDays,
15439
15518
  addMonths,
15440
- addYears,
15441
15519
  addWeeks,
15442
- startOfISOWeek,
15520
+ addYears,
15521
+ endOfBroadcastWeek,
15443
15522
  endOfISOWeek,
15444
- startOfWeek,
15445
15523
  endOfWeek,
15446
15524
  max,
15447
- min
15525
+ min,
15526
+ startOfBroadcastWeek,
15527
+ startOfISOWeek,
15528
+ startOfWeek
15448
15529
  } = dateLib;
15449
15530
  const moveFns = {
15450
15531
  day: addDays,
15451
15532
  week: addWeeks,
15452
15533
  month: addMonths,
15453
15534
  year: addYears,
15454
- startOfWeek: date => ISOWeek ? startOfISOWeek(date) : startOfWeek(date),
15455
- endOfWeek: date => ISOWeek ? endOfISOWeek(date) : endOfWeek(date)
15535
+ startOfWeek: date => broadcastCalendar ? startOfBroadcastWeek(date, dateLib) : ISOWeek ? startOfISOWeek(date) : startOfWeek(date),
15536
+ endOfWeek: date => broadcastCalendar ? endOfBroadcastWeek(date, dateLib) : ISOWeek ? endOfISOWeek(date) : endOfWeek(date)
15456
15537
  };
15457
15538
  let focusableDate = moveFns[moveBy](refDate, moveDir === "after" ? 1 : -1);
15458
15539
  if (moveDir === "before" && navStart) {
@@ -15518,6 +15599,8 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
15518
15599
  /**
15519
15600
  * Return a function to get the modifiers for a given day.
15520
15601
  *
15602
+ * NOTE: this is not an hook, but a factory for `getModifiers`.
15603
+ *
15521
15604
  * @private
15522
15605
  */
15523
15606
  function useGetModifiers(days, props, dateLib) {
@@ -15526,12 +15609,19 @@ function useGetModifiers(days, props, dateLib) {
15526
15609
  hidden,
15527
15610
  modifiers,
15528
15611
  showOutsideDays,
15612
+ broadcastCalendar,
15529
15613
  today
15530
15614
  } = props;
15531
15615
  const {
15532
15616
  isSameDay,
15533
- isSameMonth
15617
+ isSameMonth,
15618
+ startOfMonth,
15619
+ isBefore,
15620
+ endOfMonth,
15621
+ isAfter
15534
15622
  } = dateLib;
15623
+ const startMonth = props.startMonth && startOfMonth(props.startMonth);
15624
+ const endMonth = props.endMonth && endOfMonth(props.endMonth);
15535
15625
  const internalModifiersMap = {
15536
15626
  [DayFlag.focused]: [],
15537
15627
  [DayFlag.outside]: [],
@@ -15540,20 +15630,18 @@ function useGetModifiers(days, props, dateLib) {
15540
15630
  [DayFlag.today]: []
15541
15631
  };
15542
15632
  const customModifiersMap = {};
15543
- const selectionModifiersMap = {
15544
- [SelectionState.range_end]: [],
15545
- [SelectionState.range_middle]: [],
15546
- [SelectionState.range_start]: [],
15547
- [SelectionState.selected]: []
15548
- };
15549
15633
  for (const day of days) {
15550
15634
  const {
15551
15635
  date,
15552
15636
  displayMonth
15553
15637
  } = day;
15554
15638
  const isOutside = Boolean(displayMonth && !isSameMonth(date, displayMonth));
15639
+ const isBeforeStartMonth = Boolean(startMonth && isBefore(date, startMonth));
15640
+ const isAfterEndMonth = Boolean(endMonth && isAfter(date, endMonth));
15555
15641
  const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));
15556
- const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) || !showOutsideDays && isOutside;
15642
+ const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) || isBeforeStartMonth || isAfterEndMonth ||
15643
+ // Broadcast calendar will show outside days as default
15644
+ !broadcastCalendar && !showOutsideDays && isOutside || broadcastCalendar && showOutsideDays === false && isOutside;
15557
15645
  const isToday = isSameDay(date, today ?? (props.timeZone ? TZDate.tz(props.timeZone) : dateLib.Date ? new dateLib.Date() : new Date()));
15558
15646
  if (isOutside) internalModifiersMap.outside.push(day);
15559
15647
  if (isDisabled) internalModifiersMap.disabled.push(day);
@@ -15582,27 +15670,16 @@ function useGetModifiers(days, props, dateLib) {
15582
15670
  [DayFlag.outside]: false,
15583
15671
  [DayFlag.today]: false
15584
15672
  };
15585
- const selectionStates = {
15586
- [SelectionState.range_end]: false,
15587
- [SelectionState.range_middle]: false,
15588
- [SelectionState.range_start]: false,
15589
- [SelectionState.selected]: false
15590
- };
15591
15673
  const customModifiers = {};
15592
15674
  // Find the modifiers for the given day
15593
15675
  for (const name in internalModifiersMap) {
15594
15676
  const days = internalModifiersMap[name];
15595
15677
  dayFlags[name] = days.some(d => d === day);
15596
15678
  }
15597
- for (const name in selectionModifiersMap) {
15598
- const days = selectionModifiersMap[name];
15599
- selectionStates[name] = days.some(d => d === day);
15600
- }
15601
15679
  for (const name in customModifiersMap) {
15602
15680
  customModifiers[name] = customModifiersMap[name].some(d => d === day);
15603
15681
  }
15604
15682
  return {
15605
- ...selectionStates,
15606
15683
  ...dayFlags,
15607
15684
  // custom modifiers should override all the previous ones
15608
15685
  ...customModifiers
@@ -16007,7 +16084,7 @@ function DayPicker(props) {
16007
16084
  };
16008
16085
  const dateLib = new DateLib({
16009
16086
  locale,
16010
- weekStartsOn: props.weekStartsOn,
16087
+ weekStartsOn: props.broadcastCalendar ? 1 : props.weekStartsOn,
16011
16088
  firstWeekContainsDate: props.firstWeekContainsDate,
16012
16089
  useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
16013
16090
  useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens
@@ -16026,7 +16103,7 @@ function DayPicker(props) {
16026
16103
  ...props.classNames
16027
16104
  }
16028
16105
  };
16029
- }, [props.classNames, props.components, props.dateLib, props.firstWeekContainsDate, props.formatters, props.labels, props.locale, props.useAdditionalDayOfYearTokens, props.useAdditionalWeekYearTokens, props.weekStartsOn]);
16106
+ }, [props.classNames, props.components, props.dateLib, props.firstWeekContainsDate, props.formatters, props.labels, props.locale, props.useAdditionalDayOfYearTokens, props.useAdditionalWeekYearTokens, props.weekStartsOn, props.broadcastCalendar]);
16030
16107
  const {
16031
16108
  captionLayout,
16032
16109
  mode,
@@ -18804,6 +18881,8 @@ function LiveRegion(_ref) {
18804
18881
  // Hide element visually but keep it readable by screen readers
18805
18882
  const visuallyHidden = {
18806
18883
  position: 'fixed',
18884
+ top: 0,
18885
+ left: 0,
18807
18886
  width: 1,
18808
18887
  height: 1,
18809
18888
  margin: -1,
@@ -20096,6 +20175,9 @@ class AbstractPointerSensor {
20096
20175
  passive: false
20097
20176
  });
20098
20177
  this.listeners.add(events.end.name, this.handleEnd);
20178
+ if (events.cancel) {
20179
+ this.listeners.add(events.cancel.name, this.handleCancel);
20180
+ }
20099
20181
  this.windowListeners.add(EventName.Resize, this.handleCancel);
20100
20182
  this.windowListeners.add(EventName.DragStart, preventDefault);
20101
20183
  this.windowListeners.add(EventName.VisibilityChange, this.handleCancel);
@@ -20215,6 +20297,9 @@ class AbstractPointerSensor {
20215
20297
  }
20216
20298
  }
20217
20299
  const events = {
20300
+ cancel: {
20301
+ name: 'pointercancel'
20302
+ },
20218
20303
  move: {
20219
20304
  name: 'pointermove'
20220
20305
  },
@@ -20287,6 +20372,9 @@ MouseSensor.activators = [{
20287
20372
  }
20288
20373
  }];
20289
20374
  const events$2 = {
20375
+ cancel: {
20376
+ name: 'touchcancel'
20377
+ },
20290
20378
  move: {
20291
20379
  name: 'touchmove'
20292
20380
  },
@@ -20488,11 +20576,11 @@ function useScrollIntent(_ref2) {
20488
20576
  }, [disabled, delta, previousDelta]);
20489
20577
  }
20490
20578
  function useCachedNode(draggableNodes, id) {
20491
- const draggableNode = id !== null ? draggableNodes.get(id) : undefined;
20579
+ const draggableNode = id != null ? draggableNodes.get(id) : undefined;
20492
20580
  const node = draggableNode ? draggableNode.node.current : null;
20493
20581
  return useLazyMemo(cachedNode => {
20494
20582
  var _ref;
20495
- if (id === null) {
20583
+ if (id == null) {
20496
20584
  return null;
20497
20585
  } // In some cases, the draggable node can unmount while dragging
20498
20586
  // This is the case for virtualized lists. In those situations,
@@ -20700,7 +20788,26 @@ function useRect(element, measure, fallbackRect) {
20700
20788
  if (measure === void 0) {
20701
20789
  measure = defaultMeasure;
20702
20790
  }
20703
- const [rect, measureRect] = React.useReducer(reducer, null);
20791
+ const [rect, setRect] = React.useState(null);
20792
+ function measureRect() {
20793
+ setRect(currentRect => {
20794
+ if (!element) {
20795
+ return null;
20796
+ }
20797
+ if (element.isConnected === false) {
20798
+ var _ref;
20799
+
20800
+ // Fall back to last rect we measured if the element is
20801
+ // no longer connected to the DOM.
20802
+ return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null;
20803
+ }
20804
+ const newRect = measure(element);
20805
+ if (JSON.stringify(currentRect) === JSON.stringify(newRect)) {
20806
+ return currentRect;
20807
+ }
20808
+ return newRect;
20809
+ });
20810
+ }
20704
20811
  const mutationObserver = useMutationObserver({
20705
20812
  callback(records) {
20706
20813
  if (!element) {
@@ -20735,23 +20842,6 @@ function useRect(element, measure, fallbackRect) {
20735
20842
  }
20736
20843
  }, [element]);
20737
20844
  return rect;
20738
- function reducer(currentRect) {
20739
- if (!element) {
20740
- return null;
20741
- }
20742
- if (element.isConnected === false) {
20743
- var _ref;
20744
-
20745
- // Fall back to last rect we measured if the element is
20746
- // no longer connected to the DOM.
20747
- return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null;
20748
- }
20749
- const newRect = measure(element);
20750
- if (JSON.stringify(currentRect) === JSON.stringify(newRect)) {
20751
- return currentRect;
20752
- }
20753
- return newRect;
20754
- }
20755
20845
  }
20756
20846
  function useRectDelta(rect) {
20757
20847
  const initialRect = useInitialValue(rect);
@@ -20897,28 +20987,24 @@ function useRects(elements, measure) {
20897
20987
  }
20898
20988
  const [firstElement] = elements;
20899
20989
  const windowRect = useWindowRect(firstElement ? getWindow(firstElement) : null);
20900
- const [rects, measureRects] = React.useReducer(reducer, defaultValue$2);
20990
+ const [rects, setRects] = React.useState(defaultValue$2);
20991
+ function measureRects() {
20992
+ setRects(() => {
20993
+ if (!elements.length) {
20994
+ return defaultValue$2;
20995
+ }
20996
+ return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element));
20997
+ });
20998
+ }
20901
20999
  const resizeObserver = useResizeObserver({
20902
21000
  callback: measureRects
20903
21001
  });
20904
- if (elements.length > 0 && rects === defaultValue$2) {
20905
- measureRects();
20906
- }
20907
21002
  useIsomorphicLayoutEffect$1(() => {
20908
- if (elements.length) {
20909
- elements.forEach(element => resizeObserver == null ? void 0 : resizeObserver.observe(element));
20910
- } else {
20911
- resizeObserver == null ? void 0 : resizeObserver.disconnect();
20912
- measureRects();
20913
- }
21003
+ resizeObserver == null ? void 0 : resizeObserver.disconnect();
21004
+ measureRects();
21005
+ elements.forEach(element => resizeObserver == null ? void 0 : resizeObserver.observe(element));
20914
21006
  }, [elements]);
20915
21007
  return rects;
20916
- function reducer() {
20917
- if (!elements.length) {
20918
- return defaultValue$2;
20919
- }
20920
- return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element));
20921
- }
20922
21008
  }
20923
21009
  function getMeasurableNode(node) {
20924
21010
  if (!node) {
@@ -21085,7 +21171,7 @@ function reducer$1(state, action) {
21085
21171
  }
21086
21172
  };
21087
21173
  case Action.DragMove:
21088
- if (!state.draggable.active) {
21174
+ if (state.draggable.active == null) {
21089
21175
  return state;
21090
21176
  }
21091
21177
  return {
@@ -21357,7 +21443,7 @@ const DndContext = /*#__PURE__*/React.memo(function DndContext(_ref) {
21357
21443
  containers: droppableContainers
21358
21444
  }
21359
21445
  } = state;
21360
- const node = activeId ? draggableNodes.get(activeId) : null;
21446
+ const node = activeId != null ? draggableNodes.get(activeId) : null;
21361
21447
  const activeRects = React.useRef({
21362
21448
  initial: null,
21363
21449
  translated: null
@@ -21392,7 +21478,7 @@ const DndContext = /*#__PURE__*/React.memo(function DndContext(_ref) {
21392
21478
  const autoScrollOptions = getAutoScrollerOptions();
21393
21479
  const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure);
21394
21480
  useLayoutShiftScrollCompensation({
21395
- activeNode: activeId ? draggableNodes.get(activeId) : null,
21481
+ activeNode: activeId != null ? draggableNodes.get(activeId) : null,
21396
21482
  config: autoScrollOptions.layoutShiftCompensation,
21397
21483
  initialRect: initialActiveNodeRect,
21398
21484
  measure: measuringConfiguration.draggable.measure
@@ -21470,6 +21556,7 @@ const DndContext = /*#__PURE__*/React.memo(function DndContext(_ref) {
21470
21556
 
21471
21557
  const appliedTranslate = usesDragOverlay ? modifiedTranslate : add(modifiedTranslate, activeNodeScrollDelta);
21472
21558
  const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect);
21559
+ const activeSensorRef = React.useRef(null);
21473
21560
  const instantiateSensor = React.useCallback((event, _ref2) => {
21474
21561
  let {
21475
21562
  sensor: Sensor,
@@ -21504,6 +21591,7 @@ const DndContext = /*#__PURE__*/React.memo(function DndContext(_ref) {
21504
21591
  onDragStart
21505
21592
  } = latestProps.current;
21506
21593
  const event = {
21594
+ activatorEvent,
21507
21595
  active: {
21508
21596
  id,
21509
21597
  data: draggableNode.data,
@@ -21522,6 +21610,8 @@ const DndContext = /*#__PURE__*/React.memo(function DndContext(_ref) {
21522
21610
  type: 'onDragStart',
21523
21611
  event
21524
21612
  });
21613
+ setActiveSensor(activeSensorRef.current);
21614
+ setActivatorEvent(activatorEvent);
21525
21615
  });
21526
21616
  },
21527
21617
  onMove(coordinates) {
@@ -21533,10 +21623,7 @@ const DndContext = /*#__PURE__*/React.memo(function DndContext(_ref) {
21533
21623
  onEnd: createHandler(Action.DragEnd),
21534
21624
  onCancel: createHandler(Action.DragCancel)
21535
21625
  });
21536
- reactDom.unstable_batchedUpdates(() => {
21537
- setActiveSensor(sensorInstance);
21538
- setActivatorEvent(event.nativeEvent);
21539
- });
21626
+ activeSensorRef.current = sensorInstance;
21540
21627
  function createHandler(type) {
21541
21628
  return async function handler() {
21542
21629
  const {
@@ -21573,6 +21660,7 @@ const DndContext = /*#__PURE__*/React.memo(function DndContext(_ref) {
21573
21660
  setOver(null);
21574
21661
  setActiveSensor(null);
21575
21662
  setActivatorEvent(null);
21663
+ activeSensorRef.current = null;
21576
21664
  const eventName = type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel';
21577
21665
  if (event) {
21578
21666
  const handler = latestProps.current[eventName];
@@ -21794,7 +21882,7 @@ const DndContext = /*#__PURE__*/React.memo(function DndContext(_ref) {
21794
21882
  });
21795
21883
  const NullContext = /*#__PURE__*/React.createContext(null);
21796
21884
  const defaultRole = 'button';
21797
- const ID_PREFIX$1 = 'Droppable';
21885
+ const ID_PREFIX$1 = 'Draggable';
21798
21886
  function useDraggable(_ref) {
21799
21887
  let {
21800
21888
  id,
@@ -21941,7 +22029,7 @@ function useDroppable(_ref) {
21941
22029
  resizeObserverConnected.current = false;
21942
22030
  resizeObserver.observe(nodeRef.current);
21943
22031
  }, [nodeRef, resizeObserver]);
21944
- useIsomorphicLayoutEffect$1(() => {
22032
+ React.useEffect(() => {
21945
22033
  dispatch({
21946
22034
  type: Action.RegisterDroppable,
21947
22035
  element: {
@@ -22356,6 +22444,7 @@ var DNDCore = /*#__PURE__*/Object.freeze({
22356
22444
  defaultCoordinates: defaultCoordinates,
22357
22445
  defaultDropAnimation: defaultDropAnimationConfiguration,
22358
22446
  defaultDropAnimationSideEffects: defaultDropAnimationSideEffects,
22447
+ defaultKeyboardCoordinateGetter: defaultKeyboardCoordinateGetter,
22359
22448
  defaultScreenReaderInstructions: defaultScreenReaderInstructions,
22360
22449
  getClientRect: getClientRect,
22361
22450
  getFirstCollision: getFirstCollision,