primereact 10.9.4 → 10.9.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 (195) hide show
  1. package/autocomplete/autocomplete.cjs.js +13 -1
  2. package/autocomplete/autocomplete.cjs.min.js +1 -1
  3. package/autocomplete/autocomplete.esm.js +14 -2
  4. package/autocomplete/autocomplete.esm.min.js +1 -1
  5. package/autocomplete/autocomplete.js +13 -1
  6. package/autocomplete/autocomplete.min.js +1 -1
  7. package/breadcrumb/breadcrumb.cjs.js +2 -1
  8. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  9. package/breadcrumb/breadcrumb.esm.js +2 -1
  10. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  11. package/breadcrumb/breadcrumb.js +2 -1
  12. package/breadcrumb/breadcrumb.min.js +1 -1
  13. package/calendar/calendar.cjs.js +10 -2
  14. package/calendar/calendar.cjs.min.js +1 -1
  15. package/calendar/calendar.esm.js +11 -3
  16. package/calendar/calendar.esm.min.js +1 -1
  17. package/calendar/calendar.js +10 -2
  18. package/calendar/calendar.min.js +1 -1
  19. package/cascadeselect/cascadeselect.cjs.js +9 -2
  20. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  21. package/cascadeselect/cascadeselect.d.ts +9 -0
  22. package/cascadeselect/cascadeselect.esm.js +9 -2
  23. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  24. package/cascadeselect/cascadeselect.js +9 -2
  25. package/cascadeselect/cascadeselect.min.js +1 -1
  26. package/checkbox/checkbox.cjs.js +1 -1
  27. package/checkbox/checkbox.cjs.min.js +1 -1
  28. package/checkbox/checkbox.esm.js +1 -1
  29. package/checkbox/checkbox.esm.min.js +1 -1
  30. package/checkbox/checkbox.js +1 -1
  31. package/checkbox/checkbox.min.js +1 -1
  32. package/chip/chip.cjs.js +15 -2
  33. package/chip/chip.cjs.min.js +1 -1
  34. package/chip/chip.esm.js +17 -4
  35. package/chip/chip.esm.min.js +1 -1
  36. package/chip/chip.js +15 -2
  37. package/chip/chip.min.js +1 -1
  38. package/chips/chips.cjs.js +1 -1
  39. package/chips/chips.cjs.min.js +1 -1
  40. package/chips/chips.esm.js +1 -1
  41. package/chips/chips.esm.min.js +1 -1
  42. package/chips/chips.js +1 -1
  43. package/chips/chips.min.js +1 -1
  44. package/colorpicker/colorpicker.cjs.js +9 -2
  45. package/colorpicker/colorpicker.cjs.min.js +1 -1
  46. package/colorpicker/colorpicker.esm.js +9 -2
  47. package/colorpicker/colorpicker.esm.min.js +1 -1
  48. package/colorpicker/colorpicker.js +9 -2
  49. package/colorpicker/colorpicker.min.js +1 -1
  50. package/confirmpopup/confirmpopup.cjs.js +10 -2
  51. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  52. package/confirmpopup/confirmpopup.esm.js +10 -2
  53. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  54. package/confirmpopup/confirmpopup.js +10 -2
  55. package/confirmpopup/confirmpopup.min.js +1 -1
  56. package/core/core.js +172 -30
  57. package/core/core.min.js +6 -6
  58. package/datatable/datatable.cjs.js +278 -238
  59. package/datatable/datatable.cjs.min.js +1 -1
  60. package/datatable/datatable.esm.js +279 -239
  61. package/datatable/datatable.esm.min.js +1 -1
  62. package/datatable/datatable.js +278 -238
  63. package/datatable/datatable.min.js +1 -1
  64. package/dropdown/dropdown.cjs.js +13 -2
  65. package/dropdown/dropdown.cjs.min.js +1 -1
  66. package/dropdown/dropdown.d.ts +4 -0
  67. package/dropdown/dropdown.esm.js +13 -2
  68. package/dropdown/dropdown.esm.min.js +1 -1
  69. package/dropdown/dropdown.js +13 -2
  70. package/dropdown/dropdown.min.js +1 -1
  71. package/hooks/hooks.cjs.js +16 -6
  72. package/hooks/hooks.cjs.min.js +1 -1
  73. package/hooks/hooks.esm.js +16 -6
  74. package/hooks/hooks.esm.min.js +1 -1
  75. package/hooks/hooks.js +16 -6
  76. package/hooks/hooks.min.js +1 -1
  77. package/inputmask/inputmask.cjs.js +1 -1
  78. package/inputmask/inputmask.cjs.min.js +1 -1
  79. package/inputmask/inputmask.esm.js +1 -1
  80. package/inputmask/inputmask.esm.min.js +1 -1
  81. package/inputmask/inputmask.js +1 -1
  82. package/inputmask/inputmask.min.js +1 -1
  83. package/inputnumber/inputnumber.cjs.js +5 -2
  84. package/inputnumber/inputnumber.cjs.min.js +1 -1
  85. package/inputnumber/inputnumber.esm.js +5 -2
  86. package/inputnumber/inputnumber.esm.min.js +1 -1
  87. package/inputnumber/inputnumber.js +5 -2
  88. package/inputnumber/inputnumber.min.js +1 -1
  89. package/inputotp/inputotp.cjs.js +1 -0
  90. package/inputotp/inputotp.cjs.min.js +1 -1
  91. package/inputotp/inputotp.esm.js +1 -0
  92. package/inputotp/inputotp.esm.min.js +1 -1
  93. package/inputotp/inputotp.js +1 -0
  94. package/inputotp/inputotp.min.js +1 -1
  95. package/mention/mention.cjs.js +18 -9
  96. package/mention/mention.cjs.min.js +1 -1
  97. package/mention/mention.d.ts +5 -0
  98. package/mention/mention.esm.js +18 -9
  99. package/mention/mention.esm.min.js +1 -1
  100. package/mention/mention.js +18 -9
  101. package/mention/mention.min.js +1 -1
  102. package/menu/menu.cjs.js +11 -3
  103. package/menu/menu.cjs.min.js +1 -1
  104. package/menu/menu.esm.js +12 -4
  105. package/menu/menu.esm.min.js +1 -1
  106. package/menu/menu.js +11 -3
  107. package/menu/menu.min.js +1 -1
  108. package/menubar/menubar.cjs.js +6 -9
  109. package/menubar/menubar.cjs.min.js +1 -1
  110. package/menubar/menubar.esm.js +6 -9
  111. package/menubar/menubar.esm.min.js +1 -1
  112. package/menubar/menubar.js +6 -9
  113. package/menubar/menubar.min.js +1 -1
  114. package/multiselect/multiselect.cjs.js +7 -3
  115. package/multiselect/multiselect.cjs.min.js +1 -1
  116. package/multiselect/multiselect.esm.js +7 -3
  117. package/multiselect/multiselect.esm.min.js +1 -1
  118. package/multiselect/multiselect.js +7 -3
  119. package/multiselect/multiselect.min.js +1 -1
  120. package/multistatecheckbox/multistatecheckbox.cjs.js +1 -1
  121. package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
  122. package/multistatecheckbox/multistatecheckbox.esm.js +1 -1
  123. package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
  124. package/multistatecheckbox/multistatecheckbox.js +1 -1
  125. package/multistatecheckbox/multistatecheckbox.min.js +1 -1
  126. package/orderlist/orderlist.cjs.js +34 -3
  127. package/orderlist/orderlist.cjs.min.js +1 -1
  128. package/orderlist/orderlist.esm.js +34 -3
  129. package/orderlist/orderlist.esm.min.js +1 -1
  130. package/orderlist/orderlist.js +34 -3
  131. package/orderlist/orderlist.min.js +1 -1
  132. package/overlaypanel/overlaypanel.cjs.js +9 -10
  133. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  134. package/overlaypanel/overlaypanel.esm.js +9 -10
  135. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  136. package/overlaypanel/overlaypanel.js +9 -10
  137. package/overlaypanel/overlaypanel.min.js +1 -1
  138. package/package.json +1 -1
  139. package/password/password.cjs.js +9 -2
  140. package/password/password.cjs.min.js +1 -1
  141. package/password/password.esm.js +10 -3
  142. package/password/password.esm.min.js +1 -1
  143. package/password/password.js +9 -2
  144. package/password/password.min.js +1 -1
  145. package/primereact.all.cjs.js +641 -334
  146. package/primereact.all.cjs.min.js +1 -1
  147. package/primereact.all.esm.js +642 -335
  148. package/primereact.all.esm.min.js +1 -1
  149. package/primereact.all.js +641 -334
  150. package/primereact.all.min.js +1 -1
  151. package/radiobutton/radiobutton.cjs.js +2 -2
  152. package/radiobutton/radiobutton.cjs.min.js +1 -1
  153. package/radiobutton/radiobutton.d.ts +1 -1
  154. package/radiobutton/radiobutton.esm.js +2 -2
  155. package/radiobutton/radiobutton.esm.min.js +1 -1
  156. package/radiobutton/radiobutton.js +2 -2
  157. package/radiobutton/radiobutton.min.js +1 -1
  158. package/slidemenu/slidemenu.cjs.js +9 -2
  159. package/slidemenu/slidemenu.cjs.min.js +1 -1
  160. package/slidemenu/slidemenu.esm.js +10 -3
  161. package/slidemenu/slidemenu.esm.min.js +1 -1
  162. package/slidemenu/slidemenu.js +9 -2
  163. package/slidemenu/slidemenu.min.js +1 -1
  164. package/tree/tree.cjs.js +1 -1
  165. package/tree/tree.cjs.min.js +1 -1
  166. package/tree/tree.esm.js +1 -1
  167. package/tree/tree.esm.min.js +1 -1
  168. package/tree/tree.js +1 -1
  169. package/tree/tree.min.js +1 -1
  170. package/treeselect/treeselect.cjs.js +15 -8
  171. package/treeselect/treeselect.cjs.min.js +1 -1
  172. package/treeselect/treeselect.esm.js +15 -8
  173. package/treeselect/treeselect.esm.min.js +1 -1
  174. package/treeselect/treeselect.js +15 -8
  175. package/treeselect/treeselect.min.js +1 -1
  176. package/treetable/treetable.cjs.js +1 -1
  177. package/treetable/treetable.cjs.min.js +1 -1
  178. package/treetable/treetable.esm.js +1 -1
  179. package/treetable/treetable.esm.min.js +1 -1
  180. package/treetable/treetable.js +1 -1
  181. package/treetable/treetable.min.js +1 -1
  182. package/tristatecheckbox/tristatecheckbox.cjs.js +6 -6
  183. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  184. package/tristatecheckbox/tristatecheckbox.esm.js +6 -6
  185. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  186. package/tristatecheckbox/tristatecheckbox.js +6 -6
  187. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  188. package/utils/utils.cjs.js +136 -18
  189. package/utils/utils.cjs.min.js +1 -1
  190. package/utils/utils.d.ts +5 -1
  191. package/utils/utils.esm.js +136 -18
  192. package/utils/utils.esm.min.js +1 -1
  193. package/utils/utils.js +136 -18
  194. package/utils/utils.min.js +1 -1
  195. package/web-types.json +29 -2
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import * as React from 'react';
3
- import React__default, { useState, useEffect, useContext, useRef, Children, cloneElement } from 'react';
3
+ import React__default, { useState, useEffect, useContext, useRef, Fragment, Children, cloneElement } from 'react';
4
4
  import { CSSTransition as CSSTransition$1, TransitionGroup } from 'react-transition-group';
5
5
  import ReactDOM from 'react-dom';
6
6
 
@@ -566,11 +566,18 @@ var DomHandler = /*#__PURE__*/function () {
566
566
  element.style.transformOrigin = 'top';
567
567
  }
568
568
  var targetOffsetPx = targetOffset.left;
569
- var alignOffset = align === 'left' ? 0 : elementOuterWidth - targetOuterWidth;
570
- if (targetOffsetPx + targetOuterWidth + elementOuterWidth > viewport.width) {
571
- left = Math.max(0, targetOffsetPx + windowScrollLeft + targetOuterWidth - elementOuterWidth);
569
+ if (align === 'left') {
570
+ if (targetOffsetPx + elementOuterWidth > viewport.width) {
571
+ left = Math.max(0, targetOffsetPx + windowScrollLeft + targetOuterWidth - elementOuterWidth);
572
+ } else {
573
+ left = targetOffsetPx + windowScrollLeft;
574
+ }
572
575
  } else {
573
- left = targetOffsetPx - alignOffset + windowScrollLeft;
576
+ if (targetOffsetPx + targetOuterWidth - elementOuterWidth < 0) {
577
+ left = windowScrollLeft;
578
+ } else {
579
+ left = targetOffsetPx + targetOuterWidth - elementOuterWidth + windowScrollLeft;
580
+ }
574
581
  }
575
582
  element.style.top = top + 'px';
576
583
  element.style.left = left + 'px';
@@ -779,13 +786,12 @@ var DomHandler = /*#__PURE__*/function () {
779
786
  /**
780
787
  * Gets all scrollable parent elements of a given element
781
788
  * @param {HTMLElement} element - The element to find scrollable parents for
782
- * @param {boolean} hideOverlaysOnDocumentScrolling - Whether to include window/document level scrolling
783
789
  * @returns {Array} Array of scrollable parent elements
784
790
  */
785
791
  }, {
786
792
  key: "getScrollableParents",
787
793
  value: function getScrollableParents(element) {
788
- var hideOverlaysOnDocumentScrolling = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
794
+ var _this3 = this;
789
795
  var scrollableParents = [];
790
796
  if (element) {
791
797
  // Get all parent elements
@@ -808,10 +814,8 @@ var DomHandler = /*#__PURE__*/function () {
808
814
  * @param {HTMLElement} node - Element to add
809
815
  */
810
816
  var addScrollableParent = function addScrollableParent(node) {
811
- if (hideOverlaysOnDocumentScrolling) {
812
- // For document/body/html elements, add window instead
813
- scrollableParents.push(node.nodeName === 'BODY' || node.nodeName === 'HTML' || node.nodeType === 9 ? window : node);
814
- }
817
+ // For document/body/html elements, add window instead
818
+ scrollableParents.push(node.nodeName === 'BODY' || node.nodeName === 'HTML' || _this3.isDocument(node) ? window : node);
815
819
  };
816
820
 
817
821
  // Iterate through all parent elements
@@ -855,13 +859,6 @@ var DomHandler = /*#__PURE__*/function () {
855
859
  _iterator.f();
856
860
  }
857
861
  }
858
-
859
- // Ensure window/body is always included as fallback
860
- if (!scrollableParents.some(function (node) {
861
- return node === document.body || node === window;
862
- })) {
863
- scrollableParents.push(hideOverlaysOnDocumentScrolling ? window : document.body);
864
- }
865
862
  return scrollableParents;
866
863
  }
867
864
  }, {
@@ -1001,6 +998,11 @@ var DomHandler = /*#__PURE__*/function () {
1001
998
  value: function isElement(obj) {
1002
999
  return (typeof HTMLElement === "undefined" ? "undefined" : _typeof(HTMLElement)) === 'object' ? obj instanceof HTMLElement : obj && _typeof(obj) === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string';
1003
1000
  }
1001
+ }, {
1002
+ key: "isDocument",
1003
+ value: function isDocument(obj) {
1004
+ return (typeof Document === "undefined" ? "undefined" : _typeof(Document)) === 'object' ? obj instanceof Document : obj && _typeof(obj) === 'object' && obj !== null && obj.nodeType === 9;
1005
+ }
1004
1006
  }, {
1005
1007
  key: "scrollInView",
1006
1008
  value: function scrollInView(container, item) {
@@ -1338,7 +1340,7 @@ var DomHandler = /*#__PURE__*/function () {
1338
1340
  return !!(obj && obj.constructor && obj.call && obj.apply);
1339
1341
  };
1340
1342
  var element = isFunction(target) ? target() : target;
1341
- return element && element.nodeType === 9 || this.isExist(element) ? element : null;
1343
+ return this.isDocument(element) || this.isExist(element) ? element : null;
1342
1344
  }
1343
1345
 
1344
1346
  /**
@@ -2041,6 +2043,122 @@ var ObjectUtils = /*#__PURE__*/function () {
2041
2043
  obj = obj[fields[i]];
2042
2044
  }
2043
2045
  }
2046
+
2047
+ /**
2048
+ * This helper function takes an object and a dot-separated key path. It traverses the object based on the path,
2049
+ * returning the value at the specified depth. If any part of the path is missing or undefined, it returns undefined.
2050
+ *
2051
+ * Example:
2052
+ * const obj = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2053
+ * const path = 'address.city';
2054
+ * const result = ObjectUtils.getNestedValue(obj, path);
2055
+ * console.log(result); // Output: "Wonderland"
2056
+ *
2057
+ * @param {object} obj - The object to traverse.
2058
+ * @param {string} path - The dot-separated key path.
2059
+ * @returns {*} The value at the specified depth, or undefined if any part of the path is missing or undefined.
2060
+ */
2061
+ }, {
2062
+ key: "getNestedValue",
2063
+ value: function getNestedValue(obj, path) {
2064
+ return path.split('.').reduce(function (acc, part) {
2065
+ return acc && acc[part] !== undefined ? acc[part] : undefined;
2066
+ }, obj);
2067
+ }
2068
+
2069
+ /**
2070
+ * This function takes an object and a dot-separated key path. It traverses the object based on the path,
2071
+ * returning the value at the specified depth. If any part of the path is missing or undefined, it returns undefined.
2072
+ *
2073
+ * Example:
2074
+ * const objA = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2075
+ * const objB = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2076
+ * const result = ObjectUtils.absoluteCompare(objA, objB);
2077
+ * console.log(result); // Output: true
2078
+ *
2079
+ * const objC = { name: 'Alice', address: { city: 'Wonderland', zip: 12346 } };
2080
+ * const result2 = ObjectUtils.absoluteCompare(objA, objC);
2081
+ * console.log(result2); // Output: false
2082
+ *
2083
+ * @param {object} objA - The first object to compare.
2084
+ * @param {object} objB - The second object to compare.
2085
+ * @param {number} [maxDepth=1] - The maximum depth to compare.
2086
+ * @param {number} [currentDepth=0] - The current depth (used internally for recursion).
2087
+ * @returns {boolean} True if the objects are equal within the specified depth, false otherwise.
2088
+ *
2089
+ */
2090
+ }, {
2091
+ key: "absoluteCompare",
2092
+ value: function absoluteCompare(objA, objB) {
2093
+ var maxDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
2094
+ var currentDepth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
2095
+ if (!objA || !objB) return true;
2096
+ if (currentDepth > maxDepth) return true;
2097
+ if (_typeof(objA) !== _typeof(objB)) return false;
2098
+ var aKeys = Object.keys(objA);
2099
+ var bKeys = Object.keys(objB);
2100
+ if (aKeys.length !== bKeys.length) return false;
2101
+ for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) {
2102
+ var key = _aKeys[_i];
2103
+ var aValue = objA[key];
2104
+ var bValue = objB[key];
2105
+
2106
+ // Skip comparison if values are objects
2107
+ var isObject = ObjectUtils.isObject(aValue) && ObjectUtils.isObject(bValue);
2108
+ var isFunction = ObjectUtils.isFunction(aValue) && ObjectUtils.isFunction(bValue);
2109
+ if ((isObject || isFunction) && !this.absoluteCompare(aValue, bValue, maxDepth, currentDepth + 1)) return false;
2110
+ if (!isObject && aValue !== bValue) return false;
2111
+ }
2112
+ return true;
2113
+ }
2114
+
2115
+ /**
2116
+ * This helper function takes two objects and a list of keys to compare. It compares the values of the specified keys
2117
+ * in both objects. If any comparison fails, it returns false. If all specified properties are equal, it returns true.
2118
+ * It performs a shallow comparison using absoluteCompare if no keys are provided.
2119
+ *
2120
+ * Example:
2121
+ * const objA = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2122
+ * const objB = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2123
+ * const keysToCompare = ['name', 'address.city', 'address.zip'];
2124
+ * const result = ObjectUtils.selectiveCompare(objA, objB, keysToCompare);
2125
+ * console.log(result); // Output: true
2126
+ *
2127
+ * const objC = { name: 'Alice', address: { city: 'Wonderland', zip: 12346 } };
2128
+ * const result2 = ObjectUtils.selectiveCompare(objA, objC, keysToCompare);
2129
+ * console.log(result2); // Output: false
2130
+ *
2131
+ * @param {object} a - The first object to compare.
2132
+ * @param {object} b - The second object to compare.
2133
+ * @param {string[]} [keysToCompare] - The keys to compare. If not provided, performs a shallow comparison using absoluteCompare.
2134
+ * @returns {boolean} True if all specified properties are equal, false otherwise.
2135
+ */
2136
+ }, {
2137
+ key: "selectiveCompare",
2138
+ value: function selectiveCompare(a, b, keysToCompare) {
2139
+ if (a === b) return true;
2140
+ if (!a || !b || _typeof(a) !== 'object' || _typeof(b) !== 'object') return false;
2141
+ if (!keysToCompare) return this.absoluteCompare(a, b, 1); // If no keys are provided, the comparison is limited to one depth level.
2142
+ var _iterator2 = _createForOfIteratorHelper$g(keysToCompare),
2143
+ _step2;
2144
+ try {
2145
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
2146
+ var key = _step2.value;
2147
+ var aValue = this.getNestedValue(a, key);
2148
+ var bValue = this.getNestedValue(b, key);
2149
+ var isObject = _typeof(aValue) === 'object' && aValue !== null && _typeof(bValue) === 'object' && bValue !== null;
2150
+
2151
+ // If the current key is an object, they are compared in one further level only.
2152
+ if (isObject && !this.absoluteCompare(aValue, bValue, 1)) return false;
2153
+ if (!isObject && aValue !== bValue) return false;
2154
+ }
2155
+ } catch (err) {
2156
+ _iterator2.e(err);
2157
+ } finally {
2158
+ _iterator2.f();
2159
+ }
2160
+ return true;
2161
+ }
2044
2162
  }]);
2045
2163
  }();
2046
2164
 
@@ -4367,7 +4485,14 @@ var useOverlayScrollListener = function useOverlayScrollListener(_ref) {
4367
4485
  }
4368
4486
  if (!listenerRef.current && targetRef.current) {
4369
4487
  var hideOnScroll = context ? context.hideOverlaysOnDocumentScrolling : PrimeReact.hideOverlaysOnDocumentScrolling;
4370
- var nodes = scrollableParentsRef.current = DomHandler.getScrollableParents(targetRef.current, hideOnScroll);
4488
+ var nodes = scrollableParentsRef.current = DomHandler.getScrollableParents(targetRef.current);
4489
+
4490
+ // Ensure window/body is always included as fallback
4491
+ if (!nodes.some(function (node) {
4492
+ return node === document.body || node === window;
4493
+ })) {
4494
+ nodes.push(hideOnScroll ? window : document.body);
4495
+ }
4371
4496
  listenerRef.current = function (event) {
4372
4497
  return listener && listener(event);
4373
4498
  };
@@ -4459,19 +4584,20 @@ var useOverlayListener = function useOverlayListener(_ref) {
4459
4584
  type: 'outside',
4460
4585
  valid: event.which !== 3 && isOutsideClicked(event)
4461
4586
  });
4462
- }
4587
+ },
4588
+ when: when
4463
4589
  }),
4464
4590
  _useEventListener2 = _slicedToArray(_useEventListener, 2),
4465
4591
  bindDocumentClickListener = _useEventListener2[0],
4466
4592
  unbindDocumentClickListener = _useEventListener2[1];
4467
4593
  var _useResizeListener = useResizeListener({
4468
- target: 'window',
4469
4594
  listener: function listener(event) {
4470
4595
  _listener && _listener(event, {
4471
4596
  type: 'resize',
4472
4597
  valid: !DomHandler.isTouchDevice()
4473
4598
  });
4474
- }
4599
+ },
4600
+ when: when
4475
4601
  }),
4476
4602
  _useResizeListener2 = _slicedToArray(_useResizeListener, 2),
4477
4603
  bindWindowResizeListener = _useResizeListener2[0],
@@ -4484,7 +4610,8 @@ var useOverlayListener = function useOverlayListener(_ref) {
4484
4610
  type: 'orientationchange',
4485
4611
  valid: true
4486
4612
  });
4487
- }
4613
+ },
4614
+ when: when
4488
4615
  }),
4489
4616
  _useEventListener4 = _slicedToArray(_useEventListener3, 2),
4490
4617
  bindWindowOrientationChangeListener = _useEventListener4[0],
@@ -4496,7 +4623,8 @@ var useOverlayListener = function useOverlayListener(_ref) {
4496
4623
  type: 'scroll',
4497
4624
  valid: true
4498
4625
  });
4499
- }
4626
+ },
4627
+ when: when
4500
4628
  }),
4501
4629
  _useOverlayScrollList2 = _slicedToArray(_useOverlayScrollList, 2),
4502
4630
  bindOverlayScrollListener = _useOverlayScrollList2[0],
@@ -8111,7 +8239,15 @@ var AutoComplete = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(functio
8111
8239
  var type = _ref.type,
8112
8240
  valid = _ref.valid;
8113
8241
  if (valid) {
8114
- type === 'outside' ? !isInputClicked(event) && hide() : hide();
8242
+ if (type === 'outside') {
8243
+ if (!isInputClicked(event)) {
8244
+ hide();
8245
+ }
8246
+ } else if (context.hideOverlaysOnDocumentScrolling) {
8247
+ hide();
8248
+ } else if (!DomHandler.isDocument(event.target)) {
8249
+ alignOverlay();
8250
+ }
8115
8251
  }
8116
8252
  },
8117
8253
  when: overlayVisibleState
@@ -8287,6 +8423,9 @@ var AutoComplete = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(functio
8287
8423
  }
8288
8424
  };
8289
8425
  var removeItem = function removeItem(event, index) {
8426
+ if (props.disabled || props.readOnly) {
8427
+ return;
8428
+ }
8290
8429
  var removedValue = props.value[index];
8291
8430
  var newValue = props.value.filter(function (_, i) {
8292
8431
  return index !== i;
@@ -8729,6 +8868,7 @@ var AutoComplete = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(functio
8729
8868
  listId: listId,
8730
8869
  onItemClick: selectItem,
8731
8870
  selectedItem: selectedItem,
8871
+ onOverlayHide: hide,
8732
8872
  onClick: onPanelClick,
8733
8873
  getOptionGroupLabel: getOptionGroupLabel,
8734
8874
  getOptionGroupChildren: getOptionGroupChildren,
@@ -9250,7 +9390,8 @@ var BreadCrumb = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
9250
9390
  onClick: function onClick(event) {
9251
9391
  return itemClick(event, item);
9252
9392
  },
9253
- 'aria-disabled': item.disabled
9393
+ 'aria-disabled': item.disabled,
9394
+ tabIndex: item.disabled ? -1 : undefined
9254
9395
  }, ptm('action'));
9255
9396
  var content = /*#__PURE__*/React.createElement("a", actionProps, label);
9256
9397
  if (item.template) {
@@ -9655,7 +9796,7 @@ var Calendar = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (i
9655
9796
  isUnstyled = _CalendarBase$setMeta.isUnstyled;
9656
9797
  useGlobalOnEscapeKey({
9657
9798
  callback: function callback() {
9658
- hide();
9799
+ hide(null, reFocusInputField);
9659
9800
  },
9660
9801
  when: overlayVisibleState && overlayDisplayOrder,
9661
9802
  priority: [ESC_KEY_HANDLING_PRIORITIES.OVERLAY_PANEL, overlayDisplayOrder]
@@ -9706,7 +9847,15 @@ var Calendar = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (i
9706
9847
  var type = _ref.type,
9707
9848
  valid = _ref.valid;
9708
9849
  if (valid) {
9709
- type === 'outside' ? !isOverlayClicked.current && !isNavIconClicked(event.target) && hide('outside') : hide();
9850
+ if (type === 'outside') {
9851
+ if (!isOverlayClicked.current && !isNavIconClicked(event.target)) {
9852
+ hide('outside');
9853
+ }
9854
+ } else if (context.hideOverlaysOnDocumentScrolling) {
9855
+ hide();
9856
+ } else if (!DomHandler.isDocument(event.target)) {
9857
+ alignOverlay();
9858
+ }
9710
9859
  }
9711
9860
  isOverlayClicked.current = false;
9712
9861
  },
@@ -14560,8 +14709,15 @@ var CascadeSelect = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(functi
14560
14709
  target: elementRef,
14561
14710
  overlay: overlayRef,
14562
14711
  listener: function listener(event, _ref) {
14563
- var valid = _ref.valid;
14564
- valid && hide();
14712
+ var valid = _ref.valid,
14713
+ type = _ref.type;
14714
+ if (valid) {
14715
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
14716
+ hide();
14717
+ } else if (!DomHandler.isDocument(event.target)) {
14718
+ alignOverlay();
14719
+ }
14720
+ }
14565
14721
  },
14566
14722
  when: overlayVisibleState
14567
14723
  }),
@@ -15172,7 +15328,7 @@ var Checkbox = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (i
15172
15328
  return props.checked === props.trueValue;
15173
15329
  };
15174
15330
  var _onChange = function onChange(event) {
15175
- if (props.disabled || props.readonly) {
15331
+ if (props.disabled || props.readOnly) {
15176
15332
  return;
15177
15333
  }
15178
15334
  if (props.onChange) {
@@ -15356,6 +15512,10 @@ var Chip = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inPro
15356
15512
  _React$useState2 = _slicedToArray(_React$useState, 2),
15357
15513
  visibleState = _React$useState2[0],
15358
15514
  setVisibleState = _React$useState2[1];
15515
+ var _React$useState3 = React.useState(props.id),
15516
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
15517
+ idState = _React$useState4[0],
15518
+ setIdState = _React$useState4[1];
15359
15519
  var _ChipBase$setMetaData = ChipBase.setMetaData({
15360
15520
  props: props
15361
15521
  }),
@@ -15373,6 +15533,7 @@ var Chip = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inPro
15373
15533
  var close = function close(event) {
15374
15534
  var result = true;
15375
15535
  if (props.onRemove) {
15536
+ event.stopPropagation();
15376
15537
  result = props.onRemove({
15377
15538
  originalEvent: event,
15378
15539
  value: props.label || props.image || props.icon
@@ -15392,7 +15553,7 @@ var Chip = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inPro
15392
15553
  onKeyDown: onKeyDown
15393
15554
  }, ptm('removeIcon'));
15394
15555
  var icon = props.removeIcon || /*#__PURE__*/React.createElement(TimesCircleIcon, _extends({}, removeIconProps, {
15395
- key: UniqueComponentId('removeIcon')
15556
+ key: "".concat(idState, "-removeIcon")
15396
15557
  }));
15397
15558
  if (props.image) {
15398
15559
  var imageProps = mergeProps({
@@ -15402,7 +15563,7 @@ var Chip = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inPro
15402
15563
  content.push(/*#__PURE__*/React.createElement("img", _extends({
15403
15564
  alt: props.imageAlt
15404
15565
  }, imageProps, {
15405
- key: UniqueComponentId('image')
15566
+ key: "".concat(idState, "-image")
15406
15567
  })));
15407
15568
  } else if (props.icon) {
15408
15569
  var chipIconProps = mergeProps({
@@ -15453,6 +15614,14 @@ var Chip = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inPro
15453
15614
  }
15454
15615
  };
15455
15616
  });
15617
+ useMountEffect(function () {
15618
+ if (!idState) {
15619
+ setIdState(UniqueComponentId());
15620
+ }
15621
+ });
15622
+ if (!idState) {
15623
+ return null;
15624
+ }
15456
15625
  return visibleState && createElement();
15457
15626
  }));
15458
15627
  Chip.displayName = 'Chip';
@@ -15561,7 +15730,7 @@ var Chips = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inPr
15561
15730
  var listRef = React.useRef(null);
15562
15731
  var inputRef = React.useRef(props.inputRef);
15563
15732
  var removeItem = function removeItem(event, index) {
15564
- if (props.disabled && props.readOnly) {
15733
+ if (props.disabled || props.readOnly) {
15565
15734
  return;
15566
15735
  }
15567
15736
  var values = _toConsumableArray(props.value);
@@ -16094,8 +16263,15 @@ var ColorPicker = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
16094
16263
  target: elementRef,
16095
16264
  overlay: overlayRef,
16096
16265
  listener: function listener(event, _ref) {
16097
- var valid = _ref.valid;
16098
- valid && hide();
16266
+ var valid = _ref.valid,
16267
+ type = _ref.type;
16268
+ if (valid) {
16269
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
16270
+ hide();
16271
+ } else if (!DomHandler.isDocument(event.target)) {
16272
+ alignOverlay();
16273
+ }
16274
+ }
16099
16275
  },
16100
16276
  when: overlayVisibleState
16101
16277
  }),
@@ -17968,9 +18144,17 @@ var ConfirmPopup = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(functio
17968
18144
  var type = _ref.type,
17969
18145
  valid = _ref.valid;
17970
18146
  if (valid) {
17971
- type === 'outside' ? props.dismissable && !isPanelClicked.current && hide('hide') : hide('hide');
18147
+ if (type === 'outside') {
18148
+ if (props.dismissable && !isPanelClicked.current) {
18149
+ hide('hide');
18150
+ }
18151
+ isPanelClicked.current = false;
18152
+ } else if (context.hideOverlaysOnDocumentScrolling) {
18153
+ hide('hide');
18154
+ } else if (!DomHandler.isDocument(event.target)) {
18155
+ align();
18156
+ }
17972
18157
  }
17973
- isPanelClicked.current = false;
17974
18158
  },
17975
18159
  when: visibleState
17976
18160
  }),
@@ -20734,8 +20918,11 @@ var InputNumber = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
20734
20918
  newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
20735
20919
  updateValue(event, newValueStr, text, 'insert');
20736
20920
  } else if (decimalCharIndex === -1 && (maxFractionDigits || props.maxFractionDigits)) {
20737
- newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
20738
- updateValue(event, newValueStr, text, 'insert');
20921
+ var allowedDecimal = inputMode !== 'numeric' || inputMode === 'numeric' && (props.min || props.max);
20922
+ if (allowedDecimal) {
20923
+ newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
20924
+ updateValue(event, newValueStr, text, 'insert');
20925
+ }
20739
20926
  }
20740
20927
  } else {
20741
20928
  var operation = selectionStart !== selectionEnd ? 'range-insert' : 'insert';
@@ -22206,7 +22393,15 @@ var Dropdown = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (i
22206
22393
  var type = _ref.type,
22207
22394
  valid = _ref.valid;
22208
22395
  if (valid) {
22209
- type === 'outside' ? !isClearClicked(event) && hide() : hide();
22396
+ if (type === 'outside') {
22397
+ if (!isClearClicked(event)) {
22398
+ hide();
22399
+ }
22400
+ } else if (context.hideOverlaysOnDocumentScrolling) {
22401
+ hide();
22402
+ } else if (!DomHandler.isDocument(event.target)) {
22403
+ alignOverlay();
22404
+ }
22210
22405
  }
22211
22406
  },
22212
22407
  when: overlayVisibleState
@@ -22405,12 +22600,14 @@ var Dropdown = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (i
22405
22600
  case 'ArrowRight':
22406
22601
  onArrowLeftKey(event, true);
22407
22602
  break;
22408
- case 'Escape':
22409
22603
  case 'Enter':
22410
22604
  case 'NumpadEnter':
22411
22605
  onEnterKey(event);
22412
22606
  event.preventDefault();
22413
22607
  break;
22608
+ case 'Escape':
22609
+ onEscapeKey(event);
22610
+ break;
22414
22611
  }
22415
22612
  };
22416
22613
  var hasFocusableElements = function hasFocusableElements() {
@@ -23152,6 +23349,7 @@ var Dropdown = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (i
23152
23349
  "in": overlayVisibleState,
23153
23350
  isOptionDisabled: isOptionDisabled,
23154
23351
  isSelected: isSelected,
23352
+ onOverlayHide: hide,
23155
23353
  onClick: onPanelClick,
23156
23354
  onEnter: onOverlayEnter,
23157
23355
  onEntered: onOverlayEntered,
@@ -24031,7 +24229,7 @@ var RadioButton = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
24031
24229
  onChange(event);
24032
24230
  };
24033
24231
  var onChange = function onChange(event) {
24034
- if (props.disabled || props.readonly) {
24232
+ if (props.disabled || props.readOnly) {
24035
24233
  return;
24036
24234
  }
24037
24235
  if (props.onChange) {
@@ -24134,7 +24332,7 @@ var RadioButton = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
24134
24332
  onBlur: onBlur,
24135
24333
  onChange: onChange,
24136
24334
  disabled: props.disabled,
24137
- readOnly: props.readonly,
24335
+ readOnly: props.readOnly,
24138
24336
  required: props.required,
24139
24337
  tabIndex: props.tabIndex,
24140
24338
  className: cx('input')
@@ -24207,7 +24405,7 @@ RowRadioButton.displayName = 'RowRadioButton';
24207
24405
 
24208
24406
  function ownKeys$1i(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24209
24407
  function _objectSpread$1i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1i(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24210
- var BodyCell = /*#__PURE__*/React.memo(function (props) {
24408
+ var Cell = function Cell(props) {
24211
24409
  var mergeProps = useMergeProps();
24212
24410
  var _React$useState = React.useState(props.editing),
24213
24411
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -24235,13 +24433,9 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24235
24433
  var getColumnProp = function getColumnProp(name) {
24236
24434
  return ColumnBase.getCProp(props.column, name);
24237
24435
  };
24238
- var getColumnProps = function getColumnProps() {
24239
- return ColumnBase.getCProps(props.column);
24240
- };
24241
24436
  var getColumnPTOptions = function getColumnPTOptions(key) {
24242
- var cProps = getColumnProps();
24243
24437
  var columnMetaData = {
24244
- props: cProps,
24438
+ props: props.cProps,
24245
24439
  parent: props.metaData,
24246
24440
  hostName: props.hostName,
24247
24441
  state: {
@@ -24257,10 +24451,8 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24257
24451
  };
24258
24452
  return mergeProps(ptm("column.".concat(key), {
24259
24453
  column: columnMetaData
24260
- }), ptm("column.".concat(key), columnMetaData), ptmo(cProps, key, columnMetaData));
24454
+ }), ptm("column.".concat(key), columnMetaData), ptmo(props.cProps, key, columnMetaData));
24261
24455
  };
24262
- var field = getColumnProp('field') || "field_".concat(props.index);
24263
- var editingKey = props.dataKey ? props.rowData && props.rowData[props.dataKey] || props.rowIndex : props.rowIndex;
24264
24456
  var isEditable = function isEditable() {
24265
24457
  return ObjectUtils.isNotEmpty(props.editMode) && getColumnProp('editor');
24266
24458
  };
@@ -24285,34 +24477,22 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24285
24477
  _useEventListener2 = _slicedToArray(_useEventListener, 2),
24286
24478
  bindDocumentClickListener = _useEventListener2[0],
24287
24479
  unbindDocumentClickListener = _useEventListener2[1];
24288
- var isSelected = function isSelected() {
24289
- return props.selection ? props.selection instanceof Array ? findIndex(props.selection) > -1 : equals(props.selection) : false;
24290
- };
24291
- var equalsData = function equalsData(data) {
24292
- return props.compareSelectionBy === 'equals' ? data === props.rowData : ObjectUtils.equals(data, props.rowData, props.dataKey);
24293
- };
24294
- var equals = function equals(selectedCell) {
24295
- return selectedCell && (selectedCell.rowIndex === props.rowIndex || equalsData(selectedCell.rowData)) && (selectedCell.field === field || selectedCell.cellIndex === props.index);
24296
- };
24297
24480
  var isOutsideClicked = function isOutsideClicked(target) {
24298
24481
  return elementRef.current && !(elementRef.current.isSameNode(target) || elementRef.current.contains(target));
24299
24482
  };
24300
- var getVirtualScrollerOption = function getVirtualScrollerOption(option) {
24301
- return props.virtualScrollerOptions ? props.virtualScrollerOptions[option] : null;
24302
- };
24303
24483
  var getStyle = function getStyle() {
24304
24484
  var bodyStyle = getColumnProp('bodyStyle');
24305
24485
  var columnStyle = getColumnProp('style');
24306
- return getColumnProp('frozen') ? Object.assign({}, columnStyle, bodyStyle, styleObjectState) : Object.assign({}, columnStyle, bodyStyle);
24486
+ return props.frozenCol ? Object.assign({}, columnStyle, bodyStyle, styleObjectState) : Object.assign({}, columnStyle, bodyStyle);
24307
24487
  };
24308
24488
  var getCellParams = function getCellParams() {
24309
24489
  return {
24310
- value: resolveFieldData(),
24311
- field: field,
24490
+ value: props.resolveFieldData(),
24491
+ field: props.field,
24312
24492
  rowData: props.rowData,
24313
24493
  rowIndex: props.rowIndex,
24314
24494
  cellIndex: props.index,
24315
- selected: isSelected(),
24495
+ selected: props.isCellSelected,
24316
24496
  column: props.column,
24317
24497
  props: props
24318
24498
  };
@@ -24323,20 +24503,6 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24323
24503
  originalEvent: event
24324
24504
  }, params);
24325
24505
  };
24326
- var resolveFieldData = function resolveFieldData(data) {
24327
- return ObjectUtils.resolveFieldData(data || props.rowData, field);
24328
- };
24329
- var getEditingRowData = function getEditingRowData() {
24330
- return props.editingMeta && props.editingMeta[editingKey] ? props.editingMeta[editingKey].data : props.rowData;
24331
- };
24332
- var getTabIndex = function getTabIndex(cellSelected) {
24333
- return props.allowCellSelection ? cellSelected ? 0 : props.rowIndex === 0 && props.index === 0 ? props.tabIndex : -1 : null;
24334
- };
24335
- var findIndex = function findIndex(collection) {
24336
- return (collection || []).findIndex(function (data) {
24337
- return equals(data);
24338
- });
24339
- };
24340
24506
  var closeCell = function closeCell(event) {
24341
24507
  var params = getCellCallbackParams(event);
24342
24508
  var onBeforeCellEditHide = getColumnProp('onBeforeCellEditHide');
@@ -24357,7 +24523,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24357
24523
  var switchCellToViewMode = function switchCellToViewMode(event, submit) {
24358
24524
  var callbackParams = getCellCallbackParams(event);
24359
24525
  var newRowData = _objectSpread$1i({}, editingRowDataStateRef.current);
24360
- var newValue = resolveFieldData(newRowData);
24526
+ var newValue = props.resolveFieldData(newRowData);
24361
24527
  var params = _objectSpread$1i(_objectSpread$1i({}, callbackParams), {}, {
24362
24528
  newRowData: newRowData,
24363
24529
  newValue: newValue
@@ -24382,128 +24548,20 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24382
24548
  }
24383
24549
  setEditingRowDataState(newRowData);
24384
24550
  };
24385
- var _findNextSelectableCell = function findNextSelectableCell(cell) {
24386
- var nextCell = cell.nextElementSibling;
24387
- return nextCell ? DomHandler.getAttribute(nextCell, 'data-p-selectable-cell') ? nextCell : _findNextSelectableCell(nextCell) : null;
24388
- };
24389
- var _findPrevSelectableCell = function findPrevSelectableCell(cell) {
24390
- var prevCell = cell.previousElementSibling;
24391
- return prevCell ? DomHandler.getAttribute(prevCell, 'data-p-selectable-cell') ? prevCell : _findPrevSelectableCell(prevCell) : null;
24392
- };
24393
- var _findDownSelectableCell = function findDownSelectableCell(cell) {
24394
- var downRow = cell.parentElement.nextElementSibling;
24395
- var downCell = downRow ? downRow.children[props.index] : null;
24396
- return downRow && downCell ? DomHandler.getAttribute(downRow, 'data-p-selectable-row') && DomHandler.getAttribute(downCell, 'data-p-selectable-cell') ? downCell : _findDownSelectableCell(downCell) : null;
24397
- };
24398
- var _findUpSelectableCell = function findUpSelectableCell(cell) {
24399
- var upRow = cell.parentElement.previousElementSibling;
24400
- var upCell = upRow ? upRow.children[props.index] : null;
24401
- return upRow && upCell ? DomHandler.getAttribute(upRow, 'data-p-selectable-row') && DomHandler.getAttribute(upCell, 'data-p-selectable-cell') ? upCell : _findUpSelectableCell(upCell) : null;
24402
- };
24403
- var changeTabIndex = function changeTabIndex(currentCell, nextCell) {
24404
- if (currentCell && nextCell) {
24405
- currentCell.tabIndex = -1;
24406
- nextCell.tabIndex = props.tabIndex;
24407
- }
24408
- };
24409
- var focusOnElement = function focusOnElement() {
24410
- clearTimeout(focusTimeout.current);
24411
- focusTimeout.current = setTimeout(function () {
24412
- if (editingState) {
24413
- var focusableEl = props.editMode === 'cell' ? DomHandler.getFirstFocusableElement(elementRef.current, ':not([data-pc-section="editorkeyhelperlabel"])') : DomHandler.findSingle(elementRef.current, '[data-p-row-editor-save="true"]');
24414
- focusableEl && focusableEl.focus();
24415
- }
24416
- keyHelperRef.current && (keyHelperRef.current.tabIndex = editingState ? -1 : 0);
24417
- }, 1);
24418
- };
24419
- var focusOnInit = function focusOnInit() {
24420
- clearTimeout(initFocusTimeout.current);
24421
- initFocusTimeout.current = setTimeout(function () {
24422
- var focusableEl = props.editMode === 'row' ? DomHandler.findSingle(elementRef.current, '[data-p-row-editor-init="true"]') : null;
24423
- focusableEl && focusableEl.focus();
24424
- }, 1);
24425
- };
24426
- var updateStickyPosition = function updateStickyPosition() {
24427
- if (getColumnProp('frozen')) {
24428
- var styleObject = _objectSpread$1i({}, styleObjectState);
24429
- var align = getColumnProp('alignFrozen');
24430
- if (align === 'right') {
24431
- var right = 0;
24432
- var next = elementRef.current && elementRef.current.nextElementSibling;
24433
- if (next && next.classList.contains('p-frozen-column')) {
24434
- right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0);
24435
- }
24436
- styleObject.right = right + 'px';
24437
- } else {
24438
- var left = 0;
24439
- var prev = elementRef.current && elementRef.current.previousElementSibling;
24440
- if (prev && prev.classList.contains('p-frozen-column')) {
24441
- left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0);
24442
- }
24443
- styleObject.left = left + 'px';
24444
- }
24445
- var isSameStyle = styleObjectState.left === styleObject.left && styleObjectState.right === styleObject.right;
24446
- !isSameStyle && setStyleObjectState(styleObject);
24447
- }
24448
- };
24449
24551
  var editorCallback = function editorCallback(val) {
24450
24552
  var editingRowData = _objectSpread$1i({}, editingRowDataState);
24451
- ObjectUtils.mutateFieldData(editingRowData, field, val);
24553
+ ObjectUtils.mutateFieldData(editingRowData, props.field, val);
24452
24554
  setEditingRowDataState(editingRowData);
24453
24555
 
24454
24556
  // update editing meta for complete methods on row mode
24455
- var currentData = getEditingRowData();
24557
+ var currentData = props.getEditingRowData();
24456
24558
  if (currentData) {
24457
- ObjectUtils.mutateFieldData(currentData, field, val);
24559
+ ObjectUtils.mutateFieldData(currentData, props.field, val);
24458
24560
  }
24459
24561
  editingRowDataStateRef.current = editingRowData;
24460
24562
  };
24461
24563
  var _onClick = function onClick(event) {
24462
- var params = getCellCallbackParams(event);
24463
- if (props.editMode !== 'row' && isEditable() && !editingState && (props.selectOnEdit || !props.selectOnEdit && props.selected)) {
24464
- selfClick.current = true;
24465
- var onBeforeCellEditShow = getColumnProp('onBeforeCellEditShow');
24466
- var onCellEditInit = getColumnProp('onCellEditInit');
24467
- var cellEditValidatorEvent = getColumnProp('cellEditValidatorEvent');
24468
- if (onBeforeCellEditShow) {
24469
- // if user returns false do not show the editor
24470
- if (onBeforeCellEditShow(params) === false) {
24471
- return;
24472
- }
24473
-
24474
- // if user prevents default stop the editor
24475
- if (event && event.defaultPrevented) {
24476
- return;
24477
- }
24478
- }
24479
-
24480
- // If the data is sorted using sort icon, it has been added to wait for the sort operation when any cell is wanted to be opened.
24481
- setTimeout(function () {
24482
- setEditingState(true);
24483
- if (onCellEditInit) {
24484
- if (onCellEditInit(params) === false) {
24485
- return;
24486
- }
24487
-
24488
- // if user prevents default stop the editor
24489
- if (event && event.defaultPrevented) {
24490
- return;
24491
- }
24492
- }
24493
- if (cellEditValidatorEvent === 'click') {
24494
- bindDocumentClickListener();
24495
- overlayEventListener.current = function (e) {
24496
- if (!isOutsideClicked(e.target)) {
24497
- selfClick.current = true;
24498
- }
24499
- };
24500
- OverlayService.on('overlay-click', overlayEventListener.current);
24501
- }
24502
- }, 1);
24503
- }
24504
- if (props.allowCellSelection && props.onClick) {
24505
- props.onClick(params);
24506
- }
24564
+ props.onClick(event, getCellCallbackParams(event), isEditable(), editingState, setEditingState, selfClick, props.column, bindDocumentClickListener, overlayEventListener);
24507
24565
  };
24508
24566
  var _onMouseDown = function onMouseDown(event) {
24509
24567
  var params = getCellCallbackParams(event);
@@ -24527,7 +24585,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24527
24585
  cell = event.currentTarget;
24528
24586
  switch (event.code) {
24529
24587
  case 'ArrowLeft':
24530
- var prevCell = _findPrevSelectableCell(cell);
24588
+ var prevCell = props.findPrevSelectableCell(cell);
24531
24589
  if (prevCell) {
24532
24590
  changeTabIndex(cell, prevCell);
24533
24591
  prevCell.focus();
@@ -24535,7 +24593,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24535
24593
  event.preventDefault();
24536
24594
  break;
24537
24595
  case 'ArrowRight':
24538
- var nextCell = _findNextSelectableCell(cell);
24596
+ var nextCell = props.findNextSelectableCell(cell);
24539
24597
  if (nextCell) {
24540
24598
  changeTabIndex(cell, nextCell);
24541
24599
  nextCell.focus();
@@ -24543,7 +24601,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24543
24601
  event.preventDefault();
24544
24602
  break;
24545
24603
  case 'ArrowUp':
24546
- var upCell = _findUpSelectableCell(cell);
24604
+ var upCell = props.findUpSelectableCell(cell, index);
24547
24605
  if (upCell) {
24548
24606
  changeTabIndex(cell, upCell);
24549
24607
  upCell.focus();
@@ -24551,7 +24609,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24551
24609
  event.preventDefault();
24552
24610
  break;
24553
24611
  case 'ArrowDown':
24554
- var downCell = _findDownSelectableCell(cell);
24612
+ var downCell = props.findDownSelectableCell(cell, index);
24555
24613
  if (downCell) {
24556
24614
  changeTabIndex(cell, downCell);
24557
24615
  downCell.focus();
@@ -24590,13 +24648,6 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24590
24648
  index: props.rowIndex
24591
24649
  });
24592
24650
  };
24593
- var onCheckboxChange = function onCheckboxChange(event) {
24594
- props.onCheckboxChange({
24595
- originalEvent: event,
24596
- data: props.rowData,
24597
- index: props.rowIndex
24598
- });
24599
- };
24600
24651
  var onRowToggle = function onRowToggle(event) {
24601
24652
  props.onRowToggle({
24602
24653
  originalEvent: event,
@@ -24609,8 +24660,8 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24609
24660
  props.onRowEditInit({
24610
24661
  originalEvent: event,
24611
24662
  data: props.rowData,
24612
- newData: getEditingRowData(),
24613
- field: field,
24663
+ newData: props.getEditingRowData(),
24664
+ field: props.field,
24614
24665
  index: props.rowIndex
24615
24666
  });
24616
24667
  };
@@ -24618,32 +24669,26 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24618
24669
  props.onRowEditSave({
24619
24670
  originalEvent: event,
24620
24671
  data: props.rowData,
24621
- newData: getEditingRowData(),
24622
- field: field,
24672
+ newData: props.getEditingRowData(),
24673
+ field: props.field,
24623
24674
  index: props.rowIndex
24624
24675
  });
24625
- focusOnInit();
24676
+ props.focusOnInit(initFocusTimeout, elementRef);
24626
24677
  };
24627
24678
  var onRowEditCancel = function onRowEditCancel(event) {
24628
24679
  props.onRowEditCancel({
24629
24680
  originalEvent: event,
24630
24681
  data: props.rowData,
24631
- newData: getEditingRowData(),
24632
- field: field,
24682
+ newData: props.getEditingRowData(),
24683
+ field: props.field,
24633
24684
  index: props.rowIndex
24634
24685
  });
24635
- focusOnInit();
24686
+ props.focusOnInit();
24636
24687
  };
24637
24688
  React.useEffect(function () {
24638
- if (getColumnProp('frozen')) {
24639
- updateStickyPosition();
24640
- }
24641
- });
24642
- React.useEffect(function () {
24643
- if (props.editMode === 'cell' || props.editMode === 'row') {
24644
- focusOnElement();
24645
- }
24646
- }, [props.editMode, props.editing, editingState]); // eslint-disable-line react-hooks/exhaustive-deps
24689
+ if (props.frozenCol) props.updateStickyPosition(elementRef, props.frozenCol, props.alignFrozenCol, styleObjectState, setStyleObjectState);
24690
+ if (props.editMode === 'cell' || props.editMode === 'row') props.focusOnElement(focusTimeout, editingState, elementRef, keyHelperRef);
24691
+ }, [props.editMode, props.editing, editingState, props.frozenCol, props.alignFrozenCol]); // eslint-disable-line react-hooks/exhaustive-deps
24647
24692
 
24648
24693
  React.useEffect(function () {
24649
24694
  if (props.editMode === 'row' && props.editing !== editingState) {
@@ -24652,7 +24697,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24652
24697
  }, [props.editMode, props.editing, editingState]);
24653
24698
  useUpdateEffect(function () {
24654
24699
  if (props.editMode === 'cell' || props.editMode === 'row') {
24655
- var editingRowData = getEditingRowData();
24700
+ var editingRowData = props.getEditingRowData();
24656
24701
  setEditingRowDataState(editingRowData);
24657
24702
  editingRowDataStateRef.current = editingRowData;
24658
24703
  }
@@ -24662,7 +24707,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24662
24707
  var callbackParams = getCellCallbackParams();
24663
24708
  var params = _objectSpread$1i(_objectSpread$1i({}, callbackParams), {}, {
24664
24709
  editing: editingState,
24665
- editingKey: editingKey
24710
+ editingKey: props.editingKey
24666
24711
  });
24667
24712
  props.onEditingMetaChange(params);
24668
24713
  }
@@ -24675,16 +24720,16 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24675
24720
  }
24676
24721
  });
24677
24722
  var createLoading = function createLoading() {
24678
- var options = getVirtualScrollerOption('getLoaderOptions')(props.rowIndex, {
24723
+ var options = props.getVirtualScrollerOption('getLoaderOptions')(props.rowIndex, {
24679
24724
  cellIndex: props.index,
24680
24725
  cellFirst: props.index === 0,
24681
- cellLast: props.index === getVirtualScrollerOption('columns').length - 1,
24726
+ cellLast: props.index === props.getVirtualScrollerOption('columns').length - 1,
24682
24727
  cellEven: props.index % 2 === 0,
24683
24728
  cellOdd: props.index % 2 !== 0,
24684
24729
  column: props.column,
24685
- field: field
24730
+ field: props.field
24686
24731
  });
24687
- var content = ObjectUtils.getJSXElement(getVirtualScrollerOption('loadingTemplate'), options);
24732
+ var content = ObjectUtils.getJSXElement(props.getVirtualScrollerOption('loadingTemplate'), options);
24688
24733
  var bodyCellProps = mergeProps(getColumnPTOptions('bodyCell'), {
24689
24734
  role: 'cell'
24690
24735
  });
@@ -24693,20 +24738,20 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24693
24738
  var createElement = function createElement() {
24694
24739
  var content;
24695
24740
  var editorKeyHelper;
24696
- var cellSelected = props.allowCellSelection && isSelected();
24741
+ var cellSelected = props.allowCellSelection && props.isCellSelected;
24697
24742
  var isRowEditor = props.editMode === 'row';
24698
- var tabIndex = getTabIndex(cellSelected);
24743
+ var tabIndex = props.getTabIndex(cellSelected, props.index);
24699
24744
  var selectionMode = getColumnProp('selectionMode');
24700
24745
  var rowReorder = getColumnProp('rowReorder');
24701
24746
  var header = getColumnProp('header');
24702
24747
  var body = getColumnProp('body');
24703
24748
  var editor = getColumnProp('editor');
24704
- var frozen = getColumnProp('frozen');
24749
+ var frozen = props.frozenCol;
24705
24750
  var align = getColumnProp('align');
24706
- var value = resolveFieldData();
24751
+ var value = props.resolveFieldData();
24707
24752
  var columnBodyOptions = {
24708
24753
  column: props.column,
24709
- field: field,
24754
+ field: props.field,
24710
24755
  rowIndex: props.rowIndex,
24711
24756
  frozenRow: props.frozenRow,
24712
24757
  props: props.tableProps
@@ -24731,12 +24776,12 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24731
24776
  if (showSelection) {
24732
24777
  var ariaLabelField = props.selectionAriaLabel || props.tableProps.dataKey;
24733
24778
  var ariaLabelText = ObjectUtils.resolveFieldData(props.rowData, ariaLabelField);
24734
- label = "".concat(props.selected ? ariaLabel('unselectRow') : ariaLabel('selectRow'), " ").concat(ariaLabelText);
24779
+ label = "".concat(props.isRowSelected ? ariaLabel('unselectRow') : ariaLabel('selectRow'), " ").concat(ariaLabelText);
24735
24780
  }
24736
24781
  content = showSelection && /*#__PURE__*/React.createElement(React.Fragment, null, selectionMode === 'single' && /*#__PURE__*/React.createElement(RowRadioButton, {
24737
24782
  hostName: props.hostName,
24738
24783
  column: props.column,
24739
- checked: props.selected,
24784
+ checked: props.isRowSelected,
24740
24785
  disabled: !props.isSelectable({
24741
24786
  data: props.rowData,
24742
24787
  index: props.rowIndex
@@ -24751,12 +24796,12 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24751
24796
  }), selectionMode === 'multiple' && /*#__PURE__*/React.createElement(RowCheckbox, {
24752
24797
  hostName: props.hostName,
24753
24798
  column: props.column,
24754
- checked: props.selected,
24799
+ checked: props.isRowSelected,
24755
24800
  disabled: !props.isSelectable({
24756
24801
  data: props.rowData,
24757
24802
  index: props.rowIndex
24758
24803
  }),
24759
- onChange: onCheckboxChange,
24804
+ onChange: props.onCheckboxChange,
24760
24805
  tabIndex: props.tabIndex,
24761
24806
  ariaLabel: label,
24762
24807
  checkIcon: props.checkIcon,
@@ -24806,7 +24851,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24806
24851
  expanderProps.element = content;
24807
24852
  content = ObjectUtils.getJSXElement(body, props.rowData, {
24808
24853
  column: props.column,
24809
- field: field,
24854
+ field: props.field,
24810
24855
  rowIndex: props.rowIndex,
24811
24856
  frozenRow: props.frozenRow,
24812
24857
  props: props.tableProps,
@@ -24880,7 +24925,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24880
24925
  rowEditorProps.element = content;
24881
24926
  content = ObjectUtils.getJSXElement(body, props.rowData, {
24882
24927
  column: props.column,
24883
- field: field,
24928
+ field: props.field,
24884
24929
  rowIndex: props.rowIndex,
24885
24930
  frozenRow: props.frozenRow,
24886
24931
  props: props.tableProps,
@@ -24890,7 +24935,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24890
24935
  } else if (body && (!editingState || !editor)) {
24891
24936
  content = body ? ObjectUtils.getJSXElement(body, props.rowData, {
24892
24937
  column: props.column,
24893
- field: field,
24938
+ field: props.field,
24894
24939
  rowIndex: props.rowIndex,
24895
24940
  frozenRow: props.frozenRow,
24896
24941
  props: props.tableProps
@@ -24898,9 +24943,9 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24898
24943
  } else if (editor && editingState) {
24899
24944
  content = ObjectUtils.getJSXElement(editor, {
24900
24945
  rowData: editingRowDataState,
24901
- value: resolveFieldData(editingRowDataState),
24946
+ value: props.resolveFieldData(editingRowDataState),
24902
24947
  column: props.column,
24903
- field: field,
24948
+ field: props.field,
24904
24949
  rowIndex: props.rowIndex,
24905
24950
  frozenRow: props.frozenRow,
24906
24951
  props: props.tableProps,
@@ -24968,7 +25013,22 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
24968
25013
  ref: elementRef
24969
25014
  }, bodyCellProps), editorKeyHelper, title, content);
24970
25015
  };
24971
- return getVirtualScrollerOption('loading') ? createLoading() : createElement();
25016
+ return props.getVirtualScrollerOption('loading') ? createLoading() : createElement();
25017
+ };
25018
+
25019
+ // RadioCheckCell is used for the Radio and Checkbox selection and has the isRowSelected dependency
25020
+ var RadioCheckCell = /*#__PURE__*/React.memo(function (props) {
25021
+ return /*#__PURE__*/React.createElement(Cell, props);
25022
+ }, function (prevProps, nextProps) {
25023
+ var keysToCompare = ['isRowSelected', 'field', 'allowCellSelection', 'isCellSelected', 'editMode', 'index', 'tabIndex', 'editing', 'expanded', 'editingMeta', 'rowData'];
25024
+ return ObjectUtils.selectiveCompare(prevProps, nextProps, keysToCompare);
25025
+ });
25026
+ RadioCheckCell.displayName = 'RadioCheckCell';
25027
+ var BodyCell = /*#__PURE__*/React.memo(function (props) {
25028
+ return /*#__PURE__*/React.createElement(Cell, props);
25029
+ }, function (prevProps, nextProps) {
25030
+ var keysToCompare = ['field', 'allowCellSelection', 'isCellSelected', 'editMode', 'index', 'tabIndex', 'editing', 'expanded', 'editingMeta', 'rowData', 'frozenCol', 'alignFrozenCol'];
25031
+ return ObjectUtils.selectiveCompare(prevProps, nextProps, keysToCompare);
24972
25032
  });
24973
25033
  BodyCell.displayName = 'BodyCell';
24974
25034
 
@@ -24984,6 +25044,7 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
24984
25044
  var _props$ptCallbacks = props.ptCallbacks,
24985
25045
  ptm = _props$ptCallbacks.ptm,
24986
25046
  cx = _props$ptCallbacks.cx;
25047
+ var isRowSelected = !props.allowCellSelection && props.selected || props.contextMenuSelected;
24987
25048
  var getBodyRowPTOptions = function getBodyRowPTOptions(key) {
24988
25049
  return ptm(key, {
24989
25050
  parent: props.metaData,
@@ -24997,7 +25058,7 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
24997
25058
  data: props.rowData,
24998
25059
  index: props.rowIndex
24999
25060
  }),
25000
- selected: !props.allowCellSelection && props.selected || props.contextMenuSelected,
25061
+ selected: isRowSelected,
25001
25062
  stripedRows: props.metaData.props.stripedRows
25002
25063
  }
25003
25064
  });
@@ -25026,10 +25087,10 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
25026
25087
  return equals(rowData, data);
25027
25088
  });
25028
25089
  };
25029
- var changeTabIndex = function changeTabIndex(currentRow, nextRow) {
25030
- if (currentRow && nextRow) {
25031
- currentRow.tabIndex = -1;
25032
- nextRow.tabIndex = props.tabIndex;
25090
+ var changeTabIndex = function changeTabIndex(currentElement, nextElement) {
25091
+ if (currentElement && nextElement) {
25092
+ currentElement.tabIndex = -1;
25093
+ nextElement.tabIndex = props.tabIndex;
25033
25094
  }
25034
25095
  };
25035
25096
  var findFirstSelectableRow = function findFirstSelectableRow(row) {
@@ -25356,32 +25417,176 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
25356
25417
  onEditChange(e, false);
25357
25418
  event.preventDefault();
25358
25419
  };
25420
+ var equalsDataCell = function equalsDataCell(data) {
25421
+ return props.compareSelectionBy === 'equals' ? data === props.rowData : ObjectUtils.equals(data, props.rowData, props.dataKey);
25422
+ };
25423
+ var equalsCell = function equalsCell(selectedCell, field, colIndex) {
25424
+ return selectedCell && (selectedCell.rowIndex === props.rowIndex || equalsDataCell(selectedCell.rowData)) && (selectedCell.field === field || selectedCell.cellIndex === colIndex);
25425
+ };
25426
+ var findIndexCell = function findIndexCell(collection, field, colIndex) {
25427
+ return (collection || []).findIndex(function (data) {
25428
+ return equalsCell(data, field, colIndex);
25429
+ });
25430
+ };
25431
+ var isCellSelected = function isCellSelected(selection, field, colIndex) {
25432
+ return selection ? selection instanceof Array ? findIndexCell(selection, field, colIndex) > -1 : equalsCell(selection, field, colIndex) : false;
25433
+ };
25434
+ var onCheckboxChange = function onCheckboxChange(event) {
25435
+ props.onCheckboxChange({
25436
+ originalEvent: event,
25437
+ data: props.rowData,
25438
+ index: props.rowIndex
25439
+ });
25440
+ };
25441
+ var editingKey = props.dataKey ? props.rowData && props.rowData[props.dataKey] || props.rowIndex : props.rowIndex;
25442
+ var getVirtualScrollerOption = React.useCallback(function (option) {
25443
+ return props.virtualScrollerOptions ? props.virtualScrollerOptions[option] : null;
25444
+ }, [props.virtualScrollerOptions]);
25445
+ var getEditingRowData = function getEditingRowData() {
25446
+ return props.editingMeta && props.editingMeta[editingKey] ? props.editingMeta[editingKey].data : props.rowData;
25447
+ };
25448
+ var getTabIndexCell = React.useCallback(function (cellSelected, cellIndex) {
25449
+ return props.allowCellSelection ? cellSelected ? 0 : props.rowIndex === 0 && cellIndex === 0 ? props.tabIndex : -1 : null;
25450
+ }, [props.allowCellSelection, props.rowIndex, props.tabIndex]);
25451
+ var findNextSelectableCell = React.useCallback(function (cell) {
25452
+ var nextCell = cell.nextElementSibling;
25453
+ return nextCell ? DomHandler.getAttribute(nextCell, 'data-p-selectable-cell') ? nextCell : findNextSelectableCell(nextCell) : null;
25454
+ }, []);
25455
+ var findPrevSelectableCell = React.useCallback(function (cell) {
25456
+ var prevCell = cell.previousElementSibling;
25457
+ return prevCell ? DomHandler.getAttribute(prevCell, 'data-p-selectable-cell') ? prevCell : findPrevSelectableCell(prevCell) : null;
25458
+ }, []);
25459
+ var findDownSelectableCell = React.useCallback(function (cell, cellIndex) {
25460
+ var downRow = cell.parentElement.nextElementSibling;
25461
+ var downCell = downRow ? downRow.children[cellIndex] : null;
25462
+ return downRow && downCell ? DomHandler.getAttribute(downRow, 'data-p-selectable-row') && DomHandler.getAttribute(downCell, 'data-p-selectable-cell') ? downCell : findDownSelectableCell(downCell) : null;
25463
+ }, []);
25464
+ var findUpSelectableCell = React.useCallback(function (cell, cellIndex) {
25465
+ var upRow = cell.parentElement.previousElementSibling;
25466
+ var upCell = upRow ? upRow.children[cellIndex] : null;
25467
+ return upRow && upCell ? DomHandler.getAttribute(upRow, 'data-p-selectable-row') && DomHandler.getAttribute(upCell, 'data-p-selectable-cell') ? upCell : findUpSelectableCell(upCell) : null;
25468
+ }, []);
25469
+ var focusOnElement = React.useCallback(function (focusTimeoutRef, editingState, elementRef, keyHelperRef) {
25470
+ clearTimeout(focusTimeoutRef.current);
25471
+ focusTimeoutRef.current = setTimeout(function () {
25472
+ if (editingState) {
25473
+ var focusableEl = props.editMode === 'cell' ? DomHandler.getFirstFocusableElement(elementRef.current, ':not([data-pc-section="editorkeyhelperlabel"])') : DomHandler.findSingle(elementRef.current, '[data-p-row-editor-save="true"]');
25474
+ focusableEl && focusableEl.focus();
25475
+ }
25476
+ keyHelperRef.current && (keyHelperRef.current.tabIndex = editingState ? -1 : 0);
25477
+ }, 1);
25478
+ }, [props.editMode]);
25479
+ var focusOnInit = React.useCallback(function (initFocusTimeoutRef, elementRef) {
25480
+ clearTimeout(initFocusTimeoutRef.current);
25481
+ initFocusTimeoutRef.current = setTimeout(function () {
25482
+ var focusableEl = props.editMode === 'row' ? DomHandler.findSingle(elementRef.current, '[data-p-row-editor-init="true"]') : null;
25483
+ focusableEl && focusableEl.focus();
25484
+ }, 1);
25485
+ }, [props.editMode]);
25486
+ var updateStickyPosition = React.useCallback(function (elementRef, frozen, alignFrozen, styleObjectState, setStyleObjectState) {
25487
+ if (frozen) {
25488
+ var styleObject = _objectSpread$1h({}, styleObjectState);
25489
+ if (alignFrozen === 'right') {
25490
+ var right = 0;
25491
+ var next = elementRef.current && elementRef.current.nextElementSibling;
25492
+ if (next && next.classList.contains('p-frozen-column')) {
25493
+ right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0);
25494
+ }
25495
+ styleObject.right = right + 'px';
25496
+ } else {
25497
+ var left = 0;
25498
+ var prev = elementRef.current && elementRef.current.previousElementSibling;
25499
+ if (prev && prev.classList.contains('p-frozen-column')) {
25500
+ left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0);
25501
+ }
25502
+ styleObject.left = left + 'px';
25503
+ }
25504
+ var isSameStyle = styleObjectState.left === styleObject.left && styleObjectState.right === styleObject.right;
25505
+ !isSameStyle && setStyleObjectState(styleObject);
25506
+ }
25507
+ }, []);
25508
+ var onCellClick = function onCellClick(event, params, isEditable, editingState, setEditingState, selfClick, column, bindDocumentClickListener, overlayEventListener) {
25509
+ if (props.editMode !== 'row' && isEditable && !editingState && (props.selectOnEdit || !props.selectOnEdit && props.isRowSelected)) {
25510
+ selfClick.current = true;
25511
+ var onBeforeCellEditShow = getColumnProp(column, 'onBeforeCellEditShow');
25512
+ var onCellEditInit = getColumnProp(column, 'onCellEditInit');
25513
+ var cellEditValidatorEvent = getColumnProp(column, 'cellEditValidatorEvent');
25514
+ if (onBeforeCellEditShow) {
25515
+ // if user returns false do not show the editor
25516
+ if (onBeforeCellEditShow(params) === false) {
25517
+ return;
25518
+ }
25519
+
25520
+ // if user prevents default stop the editor
25521
+ if (event && event.defaultPrevented) {
25522
+ return;
25523
+ }
25524
+ }
25525
+
25526
+ // If the data is sorted using sort icon, it has been added to wait for the sort operation when any cell is wanted to be opened.
25527
+ setTimeout(function () {
25528
+ setEditingState(true);
25529
+ if (onCellEditInit) {
25530
+ if (onCellEditInit(params) === false) {
25531
+ return;
25532
+ }
25533
+
25534
+ // if user prevents default stop the editor
25535
+ if (event && event.defaultPrevented) {
25536
+ return;
25537
+ }
25538
+ }
25539
+ if (cellEditValidatorEvent === 'click') {
25540
+ bindDocumentClickListener();
25541
+ overlayEventListener.current = function (e) {
25542
+ if (!isOutsideClicked(e.target)) {
25543
+ selfClick.current = true;
25544
+ }
25545
+ };
25546
+ OverlayService.on('overlay-click', overlayEventListener.current);
25547
+ }
25548
+ }, 1);
25549
+ }
25550
+ if (props.allowCellSelection && props.onCellClick) {
25551
+ props.onCellClick(params);
25552
+ }
25553
+ };
25359
25554
  var createContent = function createContent() {
25360
25555
  return props.columns.map(function (col, i) {
25361
25556
  if (shouldRenderBodyCell(props.value, col, props.index)) {
25362
25557
  var key = "".concat(props.rowIndex, "_").concat(getColumnProp(col, 'columnKey') || getColumnProp(col, 'field'), "_").concat(i);
25363
25558
  var rowSpan = props.rowGroupMode === 'rowspan' ? calculateRowGroupSize(props.value, col, props.index) : null;
25364
- return /*#__PURE__*/React.createElement(BodyCell, {
25559
+ var field = getColumnProp(col, 'field') || "field_".concat(i);
25560
+ var resolveFieldData = function resolveFieldData(data) {
25561
+ return ObjectUtils.resolveFieldData(data || props.rowData, field);
25562
+ };
25563
+ var selectionMode = getColumnProp(col, 'selectionMode');
25564
+ var cellProps = mergeProps({
25365
25565
  hostName: props.hostName,
25366
- key: key,
25367
25566
  allowCellSelection: props.allowCellSelection,
25368
25567
  cellClassName: props.cellClassName,
25369
25568
  checkIcon: props.checkIcon,
25370
25569
  collapsedRowIcon: props.collapsedRowIcon,
25570
+ field: field,
25571
+ resolveFieldData: resolveFieldData,
25371
25572
  column: col,
25372
- compareSelectionBy: props.compareSelectionBy,
25573
+ cProps: props.colsProps[i],
25373
25574
  dataKey: props.dataKey,
25374
25575
  editMode: props.editMode,
25375
25576
  editing: editing,
25376
25577
  editingMeta: props.editingMeta,
25578
+ onEditingMetaChange: props.onEditingMetaChange,
25579
+ editingKey: editingKey,
25580
+ getEditingRowData: getEditingRowData,
25377
25581
  expanded: props.expanded,
25378
25582
  expandedRowIcon: props.expandedRowIcon,
25379
25583
  frozenRow: props.frozenRow,
25584
+ frozenCol: getColumnProp(col, 'frozen'),
25585
+ alignFrozenCol: getColumnProp(col, 'alignFrozen'),
25380
25586
  index: i,
25381
25587
  isSelectable: props.isSelectable,
25382
- onCheckboxChange: props.onCheckboxChange,
25383
- onClick: props.onCellClick,
25384
- onEditingMetaChange: props.onEditingMetaChange,
25588
+ onCheckboxChange: onCheckboxChange,
25589
+ onClick: onCellClick,
25385
25590
  onMouseDown: props.onCellMouseDown,
25386
25591
  onMouseUp: props.onCellMouseUp,
25387
25592
  onRadioChange: props.onRadioChange,
@@ -25397,20 +25602,31 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
25397
25602
  rowIndex: props.rowIndex,
25398
25603
  rowSpan: rowSpan,
25399
25604
  selectOnEdit: props.selectOnEdit,
25400
- selected: props.selected,
25401
- selection: props.selection,
25605
+ isRowSelected: isRowSelected,
25606
+ isCellSelected: isCellSelected(props.selection, field, i),
25402
25607
  selectionAriaLabel: props.tableProps.selectionAriaLabel,
25403
25608
  showRowReorderElement: props.showRowReorderElement,
25404
25609
  showSelectionElement: props.showSelectionElement,
25405
25610
  tabIndex: props.tabIndex,
25611
+ getTabIndex: getTabIndexCell,
25406
25612
  tableProps: props.tableProps,
25407
25613
  tableSelector: props.tableSelector,
25408
25614
  value: props.value,
25409
- virtualScrollerOptions: props.virtualScrollerOptions,
25615
+ getVirtualScrollerOption: getVirtualScrollerOption,
25410
25616
  ptCallbacks: props.ptCallbacks,
25411
25617
  metaData: props.metaData,
25412
- unstyled: props.unstyled
25618
+ unstyled: props.unstyled,
25619
+ findNextSelectableCell: findNextSelectableCell,
25620
+ findPrevSelectableCell: findPrevSelectableCell,
25621
+ findDownSelectableCell: findDownSelectableCell,
25622
+ findUpSelectableCell: findUpSelectableCell,
25623
+ focusOnElement: focusOnElement,
25624
+ focusOnInit: focusOnInit,
25625
+ updateStickyPosition: updateStickyPosition
25413
25626
  });
25627
+ return /*#__PURE__*/React.createElement(Fragment, {
25628
+ key: key
25629
+ }, selectionMode ? /*#__PURE__*/React.createElement(RadioCheckCell, cellProps) : /*#__PURE__*/React.createElement(BodyCell, cellProps));
25414
25630
  }
25415
25631
  return null;
25416
25632
  });
@@ -25560,8 +25776,11 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
25560
25776
  var getColumnProps = function getColumnProps(column) {
25561
25777
  return ColumnBase.getCProps(column);
25562
25778
  };
25779
+ var cProps = getColumnProps(props.column);
25780
+ var colsProps = props.columns ? props.columns.map(function (col) {
25781
+ return getColumnProps(col);
25782
+ }) : [];
25563
25783
  var getColumnPTOptions = function getColumnPTOptions(key) {
25564
- var cProps = getColumnProps(props.column);
25565
25784
  var columnMetaData = {
25566
25785
  props: cProps,
25567
25786
  parent: props.metaData,
@@ -25686,8 +25905,12 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
25686
25905
  var allowSelection = function allowSelection(event) {
25687
25906
  return !DomHandler.isClickable(event.originalEvent.target);
25688
25907
  };
25908
+ var metaKeySelectionRef = React.useRef(props.metaKeySelection);
25909
+ React.useEffect(function () {
25910
+ metaKeySelectionRef.current = props.metaKeySelection;
25911
+ }, [props.metaKeySelection]);
25689
25912
  var allowMetaKeySelection = function allowMetaKeySelection(event) {
25690
- return !rowTouched.current && (!props.metaKeySelection || props.metaKeySelection && (event.originalEvent.metaKey || event.originalEvent.ctrlKey));
25913
+ return !rowTouched.current && (!metaKeySelectionRef.current || metaKeySelectionRef.current && (event.originalEvent.metaKey || event.originalEvent.ctrlKey));
25691
25914
  };
25692
25915
  var allowRangeSelection = function allowRangeSelection(event) {
25693
25916
  return isMultipleSelection() && event.originalEvent.shiftKey && anchorRowIndex.current !== null;
@@ -25760,6 +25983,10 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
25760
25983
  });
25761
25984
  }
25762
25985
  };
25986
+ var selectionRef = React.useRef(props.selection);
25987
+ React.useEffect(function () {
25988
+ selectionRef.current = props.selection;
25989
+ }, [props.selection]);
25763
25990
  var onSingleSelection = function onSingleSelection(_ref) {
25764
25991
  var originalEvent = _ref.originalEvent,
25765
25992
  data = _ref.data,
@@ -25773,10 +26000,11 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
25773
26000
  return;
25774
26001
  }
25775
26002
  var selected = isSelected(data);
25776
- var selection = props.selection;
26003
+ var currentSelection = selectionRef.current || [];
26004
+ var newSelection = currentSelection;
25777
26005
  if (selected) {
25778
26006
  if (toggleable) {
25779
- selection = null;
26007
+ newSelection = null;
25780
26008
  onUnselect({
25781
26009
  originalEvent: originalEvent,
25782
26010
  data: data,
@@ -25784,7 +26012,7 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
25784
26012
  });
25785
26013
  }
25786
26014
  } else {
25787
- selection = data;
26015
+ newSelection = data;
25788
26016
  onSelect({
25789
26017
  originalEvent: originalEvent,
25790
26018
  data: data,
@@ -25792,10 +26020,10 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
25792
26020
  });
25793
26021
  }
25794
26022
  focusOnElement(originalEvent, true);
25795
- if (props.onSelectionChange && selection !== props.selection) {
26023
+ if (props.onSelectionChange && newSelection !== currentSelection) {
25796
26024
  props.onSelectionChange({
25797
26025
  originalEvent: originalEvent,
25798
- value: selection,
26026
+ value: newSelection,
25799
26027
  type: type
25800
26028
  });
25801
26029
  }
@@ -25813,11 +26041,12 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
25813
26041
  return;
25814
26042
  }
25815
26043
  var selected = isSelected(data);
25816
- var selection = props.selection || [];
26044
+ var currentSelection = selectionRef.current || [];
26045
+ var newSelection = currentSelection;
25817
26046
  if (selected) {
25818
26047
  if (toggleable) {
25819
- var selectionIndex = findIndex(selection, data);
25820
- selection = props.selection.filter(function (val, i) {
26048
+ var selectionIndex = findIndex(currentSelection, data);
26049
+ newSelection = currentSelection.filter(function (val, i) {
25821
26050
  return i !== selectionIndex;
25822
26051
  });
25823
26052
  onUnselect({
@@ -25825,15 +26054,15 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
25825
26054
  data: data,
25826
26055
  type: type
25827
26056
  });
25828
- } else if (selection.length) {
25829
- props.selection.forEach(function (d) {
26057
+ } else if (currentSelection.length) {
26058
+ currentSelection.forEach(function (d) {
25830
26059
  return onUnselect({
25831
26060
  originalEvent: originalEvent,
25832
26061
  data: d,
25833
26062
  type: type
25834
26063
  });
25835
26064
  });
25836
- selection = [data];
26065
+ newSelection = [data];
25837
26066
  onSelect({
25838
26067
  originalEvent: originalEvent,
25839
26068
  data: data,
@@ -25841,18 +26070,18 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
25841
26070
  });
25842
26071
  }
25843
26072
  } else {
25844
- selection = ObjectUtils.isObject(selection) ? [selection] : selection;
25845
- selection = toggleable && isMultipleSelection() ? [].concat(_toConsumableArray(selection), [data]) : [data];
26073
+ newSelection = ObjectUtils.isObject(currentSelection) ? [currentSelection] : currentSelection;
26074
+ newSelection = toggleable && isMultipleSelection() ? [].concat(_toConsumableArray(newSelection), [data]) : [data];
25846
26075
  onSelect({
25847
26076
  originalEvent: originalEvent,
25848
26077
  data: data,
25849
26078
  type: type
25850
26079
  });
25851
26080
  }
25852
- if (props.onSelectionChange && selection !== props.selection) {
26081
+ if (props.onSelectionChange && newSelection !== currentSelection) {
25853
26082
  props.onSelectionChange({
25854
26083
  originalEvent: originalEvent,
25855
- value: selection,
26084
+ value: newSelection,
25856
26085
  type: type
25857
26086
  });
25858
26087
  }
@@ -26454,6 +26683,7 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
26454
26683
  checkIcon: props.checkIcon,
26455
26684
  collapsedRowIcon: props.collapsedRowIcon,
26456
26685
  columns: props.columns,
26686
+ colsProps: colsProps,
26457
26687
  compareSelectionBy: props.compareSelectionBy,
26458
26688
  contextMenuSelected: contextMenuSelected,
26459
26689
  dataKey: props.dataKey,
@@ -26933,9 +27163,17 @@ var ColumnFilter = /*#__PURE__*/React.memo(function (props) {
26933
27163
  var type = _ref.type,
26934
27164
  valid = _ref.valid;
26935
27165
  if (valid) {
26936
- type === 'outside' ? !selfClick.current && !isTargetClicked(event.target) && hide() : hide();
27166
+ if (type === 'outside') {
27167
+ if (!selfClick.current && !isTargetClicked(event.target)) {
27168
+ hide();
27169
+ }
27170
+ selfClick.current = false;
27171
+ } else if (context.hideOverlaysOnDocumentScrolling) {
27172
+ hide();
27173
+ } else if (!DomHandler.isDocument(event.target)) {
27174
+ DomHandler.alignOverlay(overlayRef.current, iconRef.current, context && context.appendTo || PrimeReact.appendTo, false);
27175
+ }
26937
27176
  }
26938
- selfClick.current = false;
26939
27177
  },
26940
27178
  when: overlayVisibleState
26941
27179
  }),
@@ -35618,7 +35856,7 @@ var InputMask = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
35618
35856
  var updateValue = function updateValue(allow) {
35619
35857
  var pos;
35620
35858
  if (elementRef.current) {
35621
- if (props.value == null) {
35859
+ if (ObjectUtils.isEmpty(props.value)) {
35622
35860
  elementRef.current.value = '';
35623
35861
  } else {
35624
35862
  elementRef.current.value = props.value;
@@ -38729,13 +38967,6 @@ var MentionBase = ComponentBase.extend({
38729
38967
  inputRef: null,
38730
38968
  inputStyle: null,
38731
38969
  itemTemplate: null,
38732
- panelClassName: null,
38733
- panelStyle: null,
38734
- scrollHeight: '200px',
38735
- style: null,
38736
- suggestions: null,
38737
- transitionOptions: null,
38738
- trigger: '@',
38739
38970
  onBlur: null,
38740
38971
  onChange: null,
38741
38972
  onFocus: null,
@@ -38744,6 +38975,14 @@ var MentionBase = ComponentBase.extend({
38744
38975
  onSearch: null,
38745
38976
  onSelect: null,
38746
38977
  onShow: null,
38978
+ panelClassName: null,
38979
+ panelStyle: null,
38980
+ scrollHeight: '200px',
38981
+ style: null,
38982
+ suggestions: null,
38983
+ transitionOptions: null,
38984
+ trigger: '@',
38985
+ variant: null,
38747
38986
  children: undefined
38748
38987
  },
38749
38988
  css: {
@@ -38812,8 +39051,15 @@ var Mention = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (in
38812
39051
  target: elementRef,
38813
39052
  overlay: overlayRef,
38814
39053
  listener: function listener(event, _ref) {
38815
- var valid = _ref.valid;
38816
- valid && hide();
39054
+ var valid = _ref.valid,
39055
+ type = _ref.type;
39056
+ if (valid) {
39057
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
39058
+ hide();
39059
+ } else if (!DomHandler.isDocument(event.target)) {
39060
+ alignOverlay();
39061
+ }
39062
+ }
38817
39063
  },
38818
39064
  when: overlayVisibleState
38819
39065
  }),
@@ -39216,6 +39462,7 @@ var Mention = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (in
39216
39462
  style: props.inputStyle
39217
39463
  }, inputProps), {}, {
39218
39464
  unstyled: props.unstyled,
39465
+ variant: props.variant,
39219
39466
  autoResize: props.autoResize,
39220
39467
  onFocus: onFocus,
39221
39468
  onBlur: onBlur,
@@ -39383,10 +39630,15 @@ var Menu = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inPro
39383
39630
  target: targetRef,
39384
39631
  overlay: menuRef,
39385
39632
  listener: function listener(event, _ref) {
39386
- var valid = _ref.valid;
39633
+ var valid = _ref.valid,
39634
+ type = _ref.type;
39387
39635
  if (valid) {
39388
- hide(event);
39389
- setFocusedOptionIndex(-1);
39636
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
39637
+ hide(event);
39638
+ setFocusedOptionIndex(-1);
39639
+ } else if (!DomHandler.isDocument(event.target)) {
39640
+ DomHandler.absolutePosition(menuRef.current, targetRef.current, props.popupAlignment);
39641
+ }
39390
39642
  }
39391
39643
  },
39392
39644
  when: visibleState
@@ -39442,6 +39694,9 @@ var Menu = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inPro
39442
39694
  props.onFocus && props.onFocus(event);
39443
39695
  };
39444
39696
  var onListBlur = function onListBlur(event) {
39697
+ var currentTarget = event.currentTarget,
39698
+ relatedTarget = event.relatedTarget;
39699
+ if (relatedTarget && currentTarget.contains(relatedTarget)) return;
39445
39700
  setFocused(false);
39446
39701
  setFocusedOptionIndex(-1);
39447
39702
  props.onBlur && props.onBlur(event);
@@ -40044,7 +40299,6 @@ var MenubarSub = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
40044
40299
  'aria-disabled': disabled,
40045
40300
  'aria-expanded': group ? active : undefined,
40046
40301
  'aria-haspopup': group && !item.url ? 'menu' : undefined,
40047
- 'aria-level': props.level + 1,
40048
40302
  'aria-setsize': getAriaSetSize(),
40049
40303
  'aria-posinset': getAriaPosInset(index),
40050
40304
  'data-p-highlight': active,
@@ -40162,12 +40416,13 @@ var Menubar = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (in
40162
40416
  var _useEventListener = useEventListener({
40163
40417
  type: 'click',
40164
40418
  listener: function listener(event) {
40165
- if (isOutsideClicked(event)) {
40166
- var isOutsideContainer = elementRef.current && !elementRef.current.contains(event.target);
40167
- if (isOutsideContainer) {
40168
- hide();
40169
- }
40419
+ var isOutsideButton = menuButtonRef.current && !menuButtonRef.current.contains(event.target);
40420
+ if (isOutsideButton) {
40421
+ hide();
40170
40422
  }
40423
+ },
40424
+ options: {
40425
+ capture: true
40171
40426
  }
40172
40427
  }),
40173
40428
  _useEventListener2 = _slicedToArray(_useEventListener, 2),
@@ -40222,9 +40477,6 @@ var Menubar = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (in
40222
40477
  var menuButtonKeydown = function menuButtonKeydown(event) {
40223
40478
  (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && toggle(event);
40224
40479
  };
40225
- var isOutsideClicked = function isOutsideClicked(event) {
40226
- return rootMenuRef.current !== event.target && !rootMenuRef.current.contains(event.target) && menuButtonRef.current !== event.target && !menuButtonRef.current.contains(event.target);
40227
- };
40228
40480
  var getItemProp = function getItemProp(item, name) {
40229
40481
  return item ? ObjectUtils.getItemValue(item[name]) : undefined;
40230
40482
  };
@@ -41829,9 +42081,13 @@ var MultiSelect = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
41829
42081
  valid = _ref.valid;
41830
42082
  if (valid) {
41831
42083
  if (type === 'outside') {
41832
- !isClearClicked(event) && !isSelectAllClicked(event) && hide();
41833
- } else {
42084
+ if (!isClearClicked(event) && !isSelectAllClicked(event)) {
42085
+ hide();
42086
+ }
42087
+ } else if (context.hideOverlaysOnDocumentScrolling) {
41834
42088
  hide();
42089
+ } else if (!DomHandler.isDocument(event.target)) {
42090
+ alignOverlay();
41835
42091
  }
41836
42092
  }
41837
42093
  },
@@ -43577,6 +43833,7 @@ var OrderList = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
43577
43833
  var styleElementRef = React.useRef(null);
43578
43834
  var reorderDirection = React.useRef(null);
43579
43835
  var listElementRef = React.useRef(null);
43836
+ var reorderedListElementRef = React.useRef(null);
43580
43837
  var metaData = {
43581
43838
  props: props,
43582
43839
  state: {
@@ -43802,9 +44059,9 @@ var OrderList = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
43802
44059
  }
43803
44060
  var _focusedOptionIndex = items[order] ? items[order].getAttribute('id') : -1;
43804
44061
  setFocusedOptionIndex(_focusedOptionIndex);
43805
- scrollInView(_focusedOptionIndex);
44062
+ scrollInViewWithFocus(_focusedOptionIndex);
43806
44063
  };
43807
- var scrollInView = function scrollInView(id) {
44064
+ var scrollInViewWithFocus = function scrollInViewWithFocus(id) {
43808
44065
  var listElement = getListElement();
43809
44066
  var element = DomHandler.findSingle(listElement, "[data-pc-section=\"item\"][id=\"".concat(id, "\"]"));
43810
44067
  if (element) {
@@ -43814,6 +44071,33 @@ var OrderList = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
43814
44071
  });
43815
44072
  }
43816
44073
  };
44074
+ var scrollInView = function scrollInView(listContainer) {
44075
+ var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
44076
+ var selectedItems = listContainer.getElementsByClassName('p-highlight');
44077
+ if (ObjectUtils.isNotEmpty(selectedItems)) {
44078
+ DomHandler.scrollInView(listContainer, direction === -1 ? selectedItems[0] : selectedItems[selectedItems.length - 1]);
44079
+ }
44080
+ };
44081
+ var handleScrollPosition = function handleScrollPosition(listElement, direction) {
44082
+ if (listElement) {
44083
+ switch (direction) {
44084
+ case 'up':
44085
+ scrollInView(listElement, -1);
44086
+ break;
44087
+ case 'top':
44088
+ listElement.scrollTop = 0;
44089
+ break;
44090
+ case 'down':
44091
+ scrollInView(listElement, 1);
44092
+ break;
44093
+ case 'bottom':
44094
+ setTimeout(function () {
44095
+ return listElement.scrollTop = listElement.scrollHeight;
44096
+ }, 100);
44097
+ break;
44098
+ }
44099
+ }
44100
+ };
43817
44101
  var onFilter = function onFilter(event) {
43818
44102
  var _filterValue = event.target.value;
43819
44103
  setFilterValueState(_filterValue);
@@ -43848,6 +44132,7 @@ var OrderList = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
43848
44132
  });
43849
44133
  }
43850
44134
  reorderDirection.current = event.direction;
44135
+ reorderedListElementRef.current = getListElement();
43851
44136
  };
43852
44137
  var createStyle = function createStyle() {
43853
44138
  if (!styleElementRef.current) {
@@ -43884,7 +44169,9 @@ var OrderList = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
43884
44169
  setFocusedOptionId(_focusedOptionId);
43885
44170
  }, [focusedOptionIndex]);
43886
44171
  useUpdateEffect(function () {
43887
- if (reorderDirection.current) {
44172
+ if (reorderedListElementRef.current) {
44173
+ handleScrollPosition(reorderedListElementRef.current, reorderDirection.current);
44174
+ reorderedListElementRef.current = null;
43888
44175
  reorderDirection.current = null;
43889
44176
  }
43890
44177
  });
@@ -44375,18 +44662,17 @@ var OverlayPanel = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
44375
44662
  var type = _ref.type,
44376
44663
  valid = _ref.valid;
44377
44664
  if (valid) {
44378
- switch (type) {
44379
- case 'outside':
44380
- props.dismissable && !isPanelClicked.current && hide();
44381
- break;
44382
- case 'resize':
44383
- case 'scroll':
44384
- case 'orientationchange':
44385
- align();
44386
- break;
44665
+ if (type === 'outside') {
44666
+ if (props.dismissable && !isPanelClicked.current) {
44667
+ hide();
44668
+ }
44669
+ isPanelClicked.current = false;
44670
+ } else if (context.hideOverlaysOnDocumentScrolling) {
44671
+ hide();
44672
+ } else if (!DomHandler.isDocument(event.target)) {
44673
+ align();
44387
44674
  }
44388
44675
  }
44389
- isPanelClicked.current = false;
44390
44676
  },
44391
44677
  when: visibleState
44392
44678
  }),
@@ -46143,8 +46429,15 @@ var Password = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (i
46143
46429
  target: elementRef,
46144
46430
  overlay: overlayRef,
46145
46431
  listener: function listener(event, _ref) {
46146
- var valid = _ref.valid;
46147
- valid && hide();
46432
+ var valid = _ref.valid,
46433
+ type = _ref.type;
46434
+ if (valid) {
46435
+ if (type === 'outside' || context.hideOverlaysOnDocumentScrolling) {
46436
+ hide();
46437
+ } else if (!DomHandler.isDocument(event.target)) {
46438
+ alignOverlay();
46439
+ }
46440
+ }
46148
46441
  },
46149
46442
  when: overlayVisibleState
46150
46443
  }),
@@ -49709,8 +50002,15 @@ var SlideMenu = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
49709
50002
  target: targetRef,
49710
50003
  overlay: menuRef,
49711
50004
  listener: function listener(event, _ref) {
49712
- var valid = _ref.valid;
49713
- valid && hide(event);
50005
+ var valid = _ref.valid,
50006
+ type = _ref.type;
50007
+ if (valid) {
50008
+ if (type === 'outside' || context.hideOverlaysOnDocumentScrolling) {
50009
+ hide(event);
50010
+ } else if (!DomHandler.isDocument(event.target)) {
50011
+ DomHandler.absolutePosition(menuRef.current, targetRef.current);
50012
+ }
50013
+ }
49714
50014
  },
49715
50015
  when: visibleState
49716
50016
  }),
@@ -57458,9 +57758,9 @@ var TreeSelect = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
57458
57758
  expandedKeysState = _React$useState6[0],
57459
57759
  setExpandedKeysState = _React$useState6[1];
57460
57760
  var _useDebounce = useDebounce('', props.filterDelay || 0),
57461
- _useDebounce2 = _slicedToArray(_useDebounce, 3);
57462
- _useDebounce2[0];
57463
- var filterValueState = _useDebounce2[1],
57761
+ _useDebounce2 = _slicedToArray(_useDebounce, 3),
57762
+ filterValue = _useDebounce2[0],
57763
+ filterValueState = _useDebounce2[1],
57464
57764
  setFilterValueState = _useDebounce2[2];
57465
57765
  var elementRef = React.useRef(null);
57466
57766
  var overlayRef = React.useRef(null);
@@ -57507,8 +57807,15 @@ var TreeSelect = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
57507
57807
  target: elementRef,
57508
57808
  overlay: overlayRef,
57509
57809
  listener: function listener(event, _ref) {
57510
- var valid = _ref.valid;
57511
- valid && hide();
57810
+ var valid = _ref.valid,
57811
+ type = _ref.type;
57812
+ if (valid) {
57813
+ if (type === 'outside' || context.hideOverlaysOnDocumentScrolling) {
57814
+ hide();
57815
+ } else if (!DomHandler.isDocument(event.target)) {
57816
+ alignOverlay();
57817
+ }
57818
+ }
57512
57819
  },
57513
57820
  when: overlayVisibleState
57514
57821
  }),
@@ -58046,15 +58353,15 @@ var TreeSelect = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
58046
58353
  };
58047
58354
  var createFilterElement = function createFilterElement() {
58048
58355
  if (props.filter) {
58049
- var _filterValue = props.onFilterValueChange ? props.filterValue : filteredValue;
58050
- _filterValue = ObjectUtils.isNotEmpty(_filterValue) ? _filterValue : '';
58356
+ var newValue = props.onFilterValueChange ? props.filterValue : filterValue;
58357
+ newValue = ObjectUtils.isNotEmpty(newValue) ? newValue : '';
58051
58358
  var filterContainerProps = mergeProps({
58052
58359
  className: cx('filterContainer')
58053
58360
  }, ptm('filterContainer'));
58054
58361
  var filterProps = mergeProps({
58055
58362
  ref: filterInputRef,
58056
58363
  type: 'text',
58057
- value: _filterValue,
58364
+ value: newValue,
58058
58365
  autoComplete: 'off',
58059
58366
  className: cx('filter'),
58060
58367
  placeholder: props.filterPlaceholder,
@@ -61472,7 +61779,7 @@ var TriStateCheckboxBase = ComponentBase.extend({
61472
61779
  tooltip: null,
61473
61780
  tooltipOptions: null,
61474
61781
  uncheckIcon: null,
61475
- value: '',
61782
+ value: null,
61476
61783
  children: undefined
61477
61784
  },
61478
61785
  css: {
@@ -61486,7 +61793,7 @@ var TriStateCheckbox = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(fun
61486
61793
  var mergeProps = useMergeProps();
61487
61794
  var context = React.useContext(PrimeReactContext);
61488
61795
  var props = TriStateCheckboxBase.getProps(inProps, context);
61489
- var _useState = useState(''),
61796
+ var _useState = useState(null),
61490
61797
  _useState2 = _slicedToArray(_useState, 2),
61491
61798
  checkBoxValue = _useState2[0],
61492
61799
  setCheckBoxValue = _useState2[1];
@@ -61501,10 +61808,10 @@ var TriStateCheckbox = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(fun
61501
61808
  name: 'tristatecheckbox'
61502
61809
  });
61503
61810
  useEffect(function () {
61504
- if ([true, false, ''].includes(props.value)) {
61811
+ if ([true, false, null].includes(props.value)) {
61505
61812
  setCheckBoxValue(props.value);
61506
61813
  } else {
61507
- setCheckBoxValue('');
61814
+ setCheckBoxValue(null);
61508
61815
  }
61509
61816
  }, [props.value]);
61510
61817
  var onChange = function onChange(event) {
@@ -61512,12 +61819,12 @@ var TriStateCheckbox = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(fun
61512
61819
  return;
61513
61820
  }
61514
61821
  var newValue;
61515
- if (checkBoxValue === '') {
61822
+ if (checkBoxValue === null) {
61516
61823
  newValue = true;
61517
61824
  } else if (checkBoxValue === true) {
61518
61825
  newValue = false;
61519
61826
  } else if (checkBoxValue === false) {
61520
- newValue = '';
61827
+ newValue = null;
61521
61828
  }
61522
61829
  if (props.onChange) {
61523
61830
  props.onChange({