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
@@ -593,11 +593,18 @@ var DomHandler = /*#__PURE__*/function () {
593
593
  element.style.transformOrigin = 'top';
594
594
  }
595
595
  var targetOffsetPx = targetOffset.left;
596
- var alignOffset = align === 'left' ? 0 : elementOuterWidth - targetOuterWidth;
597
- if (targetOffsetPx + targetOuterWidth + elementOuterWidth > viewport.width) {
598
- left = Math.max(0, targetOffsetPx + windowScrollLeft + targetOuterWidth - elementOuterWidth);
596
+ if (align === 'left') {
597
+ if (targetOffsetPx + elementOuterWidth > viewport.width) {
598
+ left = Math.max(0, targetOffsetPx + windowScrollLeft + targetOuterWidth - elementOuterWidth);
599
+ } else {
600
+ left = targetOffsetPx + windowScrollLeft;
601
+ }
599
602
  } else {
600
- left = targetOffsetPx - alignOffset + windowScrollLeft;
603
+ if (targetOffsetPx + targetOuterWidth - elementOuterWidth < 0) {
604
+ left = windowScrollLeft;
605
+ } else {
606
+ left = targetOffsetPx + targetOuterWidth - elementOuterWidth + windowScrollLeft;
607
+ }
601
608
  }
602
609
  element.style.top = top + 'px';
603
610
  element.style.left = left + 'px';
@@ -806,13 +813,12 @@ var DomHandler = /*#__PURE__*/function () {
806
813
  /**
807
814
  * Gets all scrollable parent elements of a given element
808
815
  * @param {HTMLElement} element - The element to find scrollable parents for
809
- * @param {boolean} hideOverlaysOnDocumentScrolling - Whether to include window/document level scrolling
810
816
  * @returns {Array} Array of scrollable parent elements
811
817
  */
812
818
  }, {
813
819
  key: "getScrollableParents",
814
820
  value: function getScrollableParents(element) {
815
- var hideOverlaysOnDocumentScrolling = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
821
+ var _this3 = this;
816
822
  var scrollableParents = [];
817
823
  if (element) {
818
824
  // Get all parent elements
@@ -835,10 +841,8 @@ var DomHandler = /*#__PURE__*/function () {
835
841
  * @param {HTMLElement} node - Element to add
836
842
  */
837
843
  var addScrollableParent = function addScrollableParent(node) {
838
- if (hideOverlaysOnDocumentScrolling) {
839
- // For document/body/html elements, add window instead
840
- scrollableParents.push(node.nodeName === 'BODY' || node.nodeName === 'HTML' || node.nodeType === 9 ? window : node);
841
- }
844
+ // For document/body/html elements, add window instead
845
+ scrollableParents.push(node.nodeName === 'BODY' || node.nodeName === 'HTML' || _this3.isDocument(node) ? window : node);
842
846
  };
843
847
 
844
848
  // Iterate through all parent elements
@@ -882,13 +886,6 @@ var DomHandler = /*#__PURE__*/function () {
882
886
  _iterator.f();
883
887
  }
884
888
  }
885
-
886
- // Ensure window/body is always included as fallback
887
- if (!scrollableParents.some(function (node) {
888
- return node === document.body || node === window;
889
- })) {
890
- scrollableParents.push(hideOverlaysOnDocumentScrolling ? window : document.body);
891
- }
892
889
  return scrollableParents;
893
890
  }
894
891
  }, {
@@ -1028,6 +1025,11 @@ var DomHandler = /*#__PURE__*/function () {
1028
1025
  value: function isElement(obj) {
1029
1026
  return (typeof HTMLElement === "undefined" ? "undefined" : _typeof(HTMLElement)) === 'object' ? obj instanceof HTMLElement : obj && _typeof(obj) === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string';
1030
1027
  }
1028
+ }, {
1029
+ key: "isDocument",
1030
+ value: function isDocument(obj) {
1031
+ return (typeof Document === "undefined" ? "undefined" : _typeof(Document)) === 'object' ? obj instanceof Document : obj && _typeof(obj) === 'object' && obj !== null && obj.nodeType === 9;
1032
+ }
1031
1033
  }, {
1032
1034
  key: "scrollInView",
1033
1035
  value: function scrollInView(container, item) {
@@ -1365,7 +1367,7 @@ var DomHandler = /*#__PURE__*/function () {
1365
1367
  return !!(obj && obj.constructor && obj.call && obj.apply);
1366
1368
  };
1367
1369
  var element = isFunction(target) ? target() : target;
1368
- return element && element.nodeType === 9 || this.isExist(element) ? element : null;
1370
+ return this.isDocument(element) || this.isExist(element) ? element : null;
1369
1371
  }
1370
1372
 
1371
1373
  /**
@@ -2068,6 +2070,122 @@ var ObjectUtils = /*#__PURE__*/function () {
2068
2070
  obj = obj[fields[i]];
2069
2071
  }
2070
2072
  }
2073
+
2074
+ /**
2075
+ * This helper function takes an object and a dot-separated key path. It traverses the object based on the path,
2076
+ * returning the value at the specified depth. If any part of the path is missing or undefined, it returns undefined.
2077
+ *
2078
+ * Example:
2079
+ * const obj = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2080
+ * const path = 'address.city';
2081
+ * const result = ObjectUtils.getNestedValue(obj, path);
2082
+ * console.log(result); // Output: "Wonderland"
2083
+ *
2084
+ * @param {object} obj - The object to traverse.
2085
+ * @param {string} path - The dot-separated key path.
2086
+ * @returns {*} The value at the specified depth, or undefined if any part of the path is missing or undefined.
2087
+ */
2088
+ }, {
2089
+ key: "getNestedValue",
2090
+ value: function getNestedValue(obj, path) {
2091
+ return path.split('.').reduce(function (acc, part) {
2092
+ return acc && acc[part] !== undefined ? acc[part] : undefined;
2093
+ }, obj);
2094
+ }
2095
+
2096
+ /**
2097
+ * This function takes an object and a dot-separated key path. It traverses the object based on the path,
2098
+ * returning the value at the specified depth. If any part of the path is missing or undefined, it returns undefined.
2099
+ *
2100
+ * Example:
2101
+ * const objA = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2102
+ * const objB = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2103
+ * const result = ObjectUtils.absoluteCompare(objA, objB);
2104
+ * console.log(result); // Output: true
2105
+ *
2106
+ * const objC = { name: 'Alice', address: { city: 'Wonderland', zip: 12346 } };
2107
+ * const result2 = ObjectUtils.absoluteCompare(objA, objC);
2108
+ * console.log(result2); // Output: false
2109
+ *
2110
+ * @param {object} objA - The first object to compare.
2111
+ * @param {object} objB - The second object to compare.
2112
+ * @param {number} [maxDepth=1] - The maximum depth to compare.
2113
+ * @param {number} [currentDepth=0] - The current depth (used internally for recursion).
2114
+ * @returns {boolean} True if the objects are equal within the specified depth, false otherwise.
2115
+ *
2116
+ */
2117
+ }, {
2118
+ key: "absoluteCompare",
2119
+ value: function absoluteCompare(objA, objB) {
2120
+ var maxDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
2121
+ var currentDepth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
2122
+ if (!objA || !objB) return true;
2123
+ if (currentDepth > maxDepth) return true;
2124
+ if (_typeof(objA) !== _typeof(objB)) return false;
2125
+ var aKeys = Object.keys(objA);
2126
+ var bKeys = Object.keys(objB);
2127
+ if (aKeys.length !== bKeys.length) return false;
2128
+ for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) {
2129
+ var key = _aKeys[_i];
2130
+ var aValue = objA[key];
2131
+ var bValue = objB[key];
2132
+
2133
+ // Skip comparison if values are objects
2134
+ var isObject = ObjectUtils.isObject(aValue) && ObjectUtils.isObject(bValue);
2135
+ var isFunction = ObjectUtils.isFunction(aValue) && ObjectUtils.isFunction(bValue);
2136
+ if ((isObject || isFunction) && !this.absoluteCompare(aValue, bValue, maxDepth, currentDepth + 1)) return false;
2137
+ if (!isObject && aValue !== bValue) return false;
2138
+ }
2139
+ return true;
2140
+ }
2141
+
2142
+ /**
2143
+ * This helper function takes two objects and a list of keys to compare. It compares the values of the specified keys
2144
+ * in both objects. If any comparison fails, it returns false. If all specified properties are equal, it returns true.
2145
+ * It performs a shallow comparison using absoluteCompare if no keys are provided.
2146
+ *
2147
+ * Example:
2148
+ * const objA = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2149
+ * const objB = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2150
+ * const keysToCompare = ['name', 'address.city', 'address.zip'];
2151
+ * const result = ObjectUtils.selectiveCompare(objA, objB, keysToCompare);
2152
+ * console.log(result); // Output: true
2153
+ *
2154
+ * const objC = { name: 'Alice', address: { city: 'Wonderland', zip: 12346 } };
2155
+ * const result2 = ObjectUtils.selectiveCompare(objA, objC, keysToCompare);
2156
+ * console.log(result2); // Output: false
2157
+ *
2158
+ * @param {object} a - The first object to compare.
2159
+ * @param {object} b - The second object to compare.
2160
+ * @param {string[]} [keysToCompare] - The keys to compare. If not provided, performs a shallow comparison using absoluteCompare.
2161
+ * @returns {boolean} True if all specified properties are equal, false otherwise.
2162
+ */
2163
+ }, {
2164
+ key: "selectiveCompare",
2165
+ value: function selectiveCompare(a, b, keysToCompare) {
2166
+ if (a === b) return true;
2167
+ if (!a || !b || _typeof(a) !== 'object' || _typeof(b) !== 'object') return false;
2168
+ if (!keysToCompare) return this.absoluteCompare(a, b, 1); // If no keys are provided, the comparison is limited to one depth level.
2169
+ var _iterator2 = _createForOfIteratorHelper$g(keysToCompare),
2170
+ _step2;
2171
+ try {
2172
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
2173
+ var key = _step2.value;
2174
+ var aValue = this.getNestedValue(a, key);
2175
+ var bValue = this.getNestedValue(b, key);
2176
+ var isObject = _typeof(aValue) === 'object' && aValue !== null && _typeof(bValue) === 'object' && bValue !== null;
2177
+
2178
+ // If the current key is an object, they are compared in one further level only.
2179
+ if (isObject && !this.absoluteCompare(aValue, bValue, 1)) return false;
2180
+ if (!isObject && aValue !== bValue) return false;
2181
+ }
2182
+ } catch (err) {
2183
+ _iterator2.e(err);
2184
+ } finally {
2185
+ _iterator2.f();
2186
+ }
2187
+ return true;
2188
+ }
2071
2189
  }]);
2072
2190
  }();
2073
2191
 
@@ -4394,7 +4512,14 @@ var useOverlayScrollListener = function useOverlayScrollListener(_ref) {
4394
4512
  }
4395
4513
  if (!listenerRef.current && targetRef.current) {
4396
4514
  var hideOnScroll = context ? context.hideOverlaysOnDocumentScrolling : PrimeReact.hideOverlaysOnDocumentScrolling;
4397
- var nodes = scrollableParentsRef.current = DomHandler.getScrollableParents(targetRef.current, hideOnScroll);
4515
+ var nodes = scrollableParentsRef.current = DomHandler.getScrollableParents(targetRef.current);
4516
+
4517
+ // Ensure window/body is always included as fallback
4518
+ if (!nodes.some(function (node) {
4519
+ return node === document.body || node === window;
4520
+ })) {
4521
+ nodes.push(hideOnScroll ? window : document.body);
4522
+ }
4398
4523
  listenerRef.current = function (event) {
4399
4524
  return listener && listener(event);
4400
4525
  };
@@ -4486,19 +4611,20 @@ var useOverlayListener = function useOverlayListener(_ref) {
4486
4611
  type: 'outside',
4487
4612
  valid: event.which !== 3 && isOutsideClicked(event)
4488
4613
  });
4489
- }
4614
+ },
4615
+ when: when
4490
4616
  }),
4491
4617
  _useEventListener2 = _slicedToArray(_useEventListener, 2),
4492
4618
  bindDocumentClickListener = _useEventListener2[0],
4493
4619
  unbindDocumentClickListener = _useEventListener2[1];
4494
4620
  var _useResizeListener = useResizeListener({
4495
- target: 'window',
4496
4621
  listener: function listener(event) {
4497
4622
  _listener && _listener(event, {
4498
4623
  type: 'resize',
4499
4624
  valid: !DomHandler.isTouchDevice()
4500
4625
  });
4501
- }
4626
+ },
4627
+ when: when
4502
4628
  }),
4503
4629
  _useResizeListener2 = _slicedToArray(_useResizeListener, 2),
4504
4630
  bindWindowResizeListener = _useResizeListener2[0],
@@ -4511,7 +4637,8 @@ var useOverlayListener = function useOverlayListener(_ref) {
4511
4637
  type: 'orientationchange',
4512
4638
  valid: true
4513
4639
  });
4514
- }
4640
+ },
4641
+ when: when
4515
4642
  }),
4516
4643
  _useEventListener4 = _slicedToArray(_useEventListener3, 2),
4517
4644
  bindWindowOrientationChangeListener = _useEventListener4[0],
@@ -4523,7 +4650,8 @@ var useOverlayListener = function useOverlayListener(_ref) {
4523
4650
  type: 'scroll',
4524
4651
  valid: true
4525
4652
  });
4526
- }
4653
+ },
4654
+ when: when
4527
4655
  }),
4528
4656
  _useOverlayScrollList2 = _slicedToArray(_useOverlayScrollList, 2),
4529
4657
  bindOverlayScrollListener = _useOverlayScrollList2[0],
@@ -8138,7 +8266,15 @@ var AutoComplete = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namesp
8138
8266
  var type = _ref.type,
8139
8267
  valid = _ref.valid;
8140
8268
  if (valid) {
8141
- type === 'outside' ? !isInputClicked(event) && hide() : hide();
8269
+ if (type === 'outside') {
8270
+ if (!isInputClicked(event)) {
8271
+ hide();
8272
+ }
8273
+ } else if (context.hideOverlaysOnDocumentScrolling) {
8274
+ hide();
8275
+ } else if (!DomHandler.isDocument(event.target)) {
8276
+ alignOverlay();
8277
+ }
8142
8278
  }
8143
8279
  },
8144
8280
  when: overlayVisibleState
@@ -8314,6 +8450,9 @@ var AutoComplete = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namesp
8314
8450
  }
8315
8451
  };
8316
8452
  var removeItem = function removeItem(event, index) {
8453
+ if (props.disabled || props.readOnly) {
8454
+ return;
8455
+ }
8317
8456
  var removedValue = props.value[index];
8318
8457
  var newValue = props.value.filter(function (_, i) {
8319
8458
  return index !== i;
@@ -8756,6 +8895,7 @@ var AutoComplete = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namesp
8756
8895
  listId: listId,
8757
8896
  onItemClick: selectItem,
8758
8897
  selectedItem: selectedItem,
8898
+ onOverlayHide: hide,
8759
8899
  onClick: onPanelClick,
8760
8900
  getOptionGroupLabel: getOptionGroupLabel,
8761
8901
  getOptionGroupChildren: getOptionGroupChildren,
@@ -9277,7 +9417,8 @@ var BreadCrumb = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
9277
9417
  onClick: function onClick(event) {
9278
9418
  return itemClick(event, item);
9279
9419
  },
9280
- 'aria-disabled': item.disabled
9420
+ 'aria-disabled': item.disabled,
9421
+ tabIndex: item.disabled ? -1 : undefined
9281
9422
  }, ptm('action'));
9282
9423
  var content = /*#__PURE__*/React__namespace.createElement("a", actionProps, label);
9283
9424
  if (item.template) {
@@ -9682,7 +9823,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
9682
9823
  isUnstyled = _CalendarBase$setMeta.isUnstyled;
9683
9824
  useGlobalOnEscapeKey({
9684
9825
  callback: function callback() {
9685
- hide();
9826
+ hide(null, reFocusInputField);
9686
9827
  },
9687
9828
  when: overlayVisibleState && overlayDisplayOrder,
9688
9829
  priority: [ESC_KEY_HANDLING_PRIORITIES.OVERLAY_PANEL, overlayDisplayOrder]
@@ -9733,7 +9874,15 @@ var Calendar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
9733
9874
  var type = _ref.type,
9734
9875
  valid = _ref.valid;
9735
9876
  if (valid) {
9736
- type === 'outside' ? !isOverlayClicked.current && !isNavIconClicked(event.target) && hide('outside') : hide();
9877
+ if (type === 'outside') {
9878
+ if (!isOverlayClicked.current && !isNavIconClicked(event.target)) {
9879
+ hide('outside');
9880
+ }
9881
+ } else if (context.hideOverlaysOnDocumentScrolling) {
9882
+ hide();
9883
+ } else if (!DomHandler.isDocument(event.target)) {
9884
+ alignOverlay();
9885
+ }
9737
9886
  }
9738
9887
  isOverlayClicked.current = false;
9739
9888
  },
@@ -14587,8 +14736,15 @@ var CascadeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__names
14587
14736
  target: elementRef,
14588
14737
  overlay: overlayRef,
14589
14738
  listener: function listener(event, _ref) {
14590
- var valid = _ref.valid;
14591
- valid && hide();
14739
+ var valid = _ref.valid,
14740
+ type = _ref.type;
14741
+ if (valid) {
14742
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
14743
+ hide();
14744
+ } else if (!DomHandler.isDocument(event.target)) {
14745
+ alignOverlay();
14746
+ }
14747
+ }
14592
14748
  },
14593
14749
  when: overlayVisibleState
14594
14750
  }),
@@ -15199,7 +15355,7 @@ var Checkbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
15199
15355
  return props.checked === props.trueValue;
15200
15356
  };
15201
15357
  var _onChange = function onChange(event) {
15202
- if (props.disabled || props.readonly) {
15358
+ if (props.disabled || props.readOnly) {
15203
15359
  return;
15204
15360
  }
15205
15361
  if (props.onChange) {
@@ -15383,6 +15539,10 @@ var Chip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
15383
15539
  _React$useState2 = _slicedToArray(_React$useState, 2),
15384
15540
  visibleState = _React$useState2[0],
15385
15541
  setVisibleState = _React$useState2[1];
15542
+ var _React$useState3 = React__namespace.useState(props.id),
15543
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
15544
+ idState = _React$useState4[0],
15545
+ setIdState = _React$useState4[1];
15386
15546
  var _ChipBase$setMetaData = ChipBase.setMetaData({
15387
15547
  props: props
15388
15548
  }),
@@ -15400,6 +15560,7 @@ var Chip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
15400
15560
  var close = function close(event) {
15401
15561
  var result = true;
15402
15562
  if (props.onRemove) {
15563
+ event.stopPropagation();
15403
15564
  result = props.onRemove({
15404
15565
  originalEvent: event,
15405
15566
  value: props.label || props.image || props.icon
@@ -15419,7 +15580,7 @@ var Chip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
15419
15580
  onKeyDown: onKeyDown
15420
15581
  }, ptm('removeIcon'));
15421
15582
  var icon = props.removeIcon || /*#__PURE__*/React__namespace.createElement(TimesCircleIcon, _extends({}, removeIconProps, {
15422
- key: UniqueComponentId('removeIcon')
15583
+ key: "".concat(idState, "-removeIcon")
15423
15584
  }));
15424
15585
  if (props.image) {
15425
15586
  var imageProps = mergeProps({
@@ -15429,7 +15590,7 @@ var Chip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
15429
15590
  content.push(/*#__PURE__*/React__namespace.createElement("img", _extends({
15430
15591
  alt: props.imageAlt
15431
15592
  }, imageProps, {
15432
- key: UniqueComponentId('image')
15593
+ key: "".concat(idState, "-image")
15433
15594
  })));
15434
15595
  } else if (props.icon) {
15435
15596
  var chipIconProps = mergeProps({
@@ -15480,6 +15641,14 @@ var Chip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
15480
15641
  }
15481
15642
  };
15482
15643
  });
15644
+ useMountEffect(function () {
15645
+ if (!idState) {
15646
+ setIdState(UniqueComponentId());
15647
+ }
15648
+ });
15649
+ if (!idState) {
15650
+ return null;
15651
+ }
15483
15652
  return visibleState && createElement();
15484
15653
  }));
15485
15654
  Chip.displayName = 'Chip';
@@ -15588,7 +15757,7 @@ var Chips = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.for
15588
15757
  var listRef = React__namespace.useRef(null);
15589
15758
  var inputRef = React__namespace.useRef(props.inputRef);
15590
15759
  var removeItem = function removeItem(event, index) {
15591
- if (props.disabled && props.readOnly) {
15760
+ if (props.disabled || props.readOnly) {
15592
15761
  return;
15593
15762
  }
15594
15763
  var values = _toConsumableArray(props.value);
@@ -16121,8 +16290,15 @@ var ColorPicker = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
16121
16290
  target: elementRef,
16122
16291
  overlay: overlayRef,
16123
16292
  listener: function listener(event, _ref) {
16124
- var valid = _ref.valid;
16125
- valid && hide();
16293
+ var valid = _ref.valid,
16294
+ type = _ref.type;
16295
+ if (valid) {
16296
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
16297
+ hide();
16298
+ } else if (!DomHandler.isDocument(event.target)) {
16299
+ alignOverlay();
16300
+ }
16301
+ }
16126
16302
  },
16127
16303
  when: overlayVisibleState
16128
16304
  }),
@@ -17995,9 +18171,17 @@ var ConfirmPopup = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namesp
17995
18171
  var type = _ref.type,
17996
18172
  valid = _ref.valid;
17997
18173
  if (valid) {
17998
- type === 'outside' ? props.dismissable && !isPanelClicked.current && hide('hide') : hide('hide');
18174
+ if (type === 'outside') {
18175
+ if (props.dismissable && !isPanelClicked.current) {
18176
+ hide('hide');
18177
+ }
18178
+ isPanelClicked.current = false;
18179
+ } else if (context.hideOverlaysOnDocumentScrolling) {
18180
+ hide('hide');
18181
+ } else if (!DomHandler.isDocument(event.target)) {
18182
+ align();
18183
+ }
17999
18184
  }
18000
- isPanelClicked.current = false;
18001
18185
  },
18002
18186
  when: visibleState
18003
18187
  }),
@@ -20761,8 +20945,11 @@ var InputNumber = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
20761
20945
  newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
20762
20946
  updateValue(event, newValueStr, text, 'insert');
20763
20947
  } else if (decimalCharIndex === -1 && (maxFractionDigits || props.maxFractionDigits)) {
20764
- newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
20765
- updateValue(event, newValueStr, text, 'insert');
20948
+ var allowedDecimal = inputMode !== 'numeric' || inputMode === 'numeric' && (props.min || props.max);
20949
+ if (allowedDecimal) {
20950
+ newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
20951
+ updateValue(event, newValueStr, text, 'insert');
20952
+ }
20766
20953
  }
20767
20954
  } else {
20768
20955
  var operation = selectionStart !== selectionEnd ? 'range-insert' : 'insert';
@@ -22233,7 +22420,15 @@ var Dropdown = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
22233
22420
  var type = _ref.type,
22234
22421
  valid = _ref.valid;
22235
22422
  if (valid) {
22236
- type === 'outside' ? !isClearClicked(event) && hide() : hide();
22423
+ if (type === 'outside') {
22424
+ if (!isClearClicked(event)) {
22425
+ hide();
22426
+ }
22427
+ } else if (context.hideOverlaysOnDocumentScrolling) {
22428
+ hide();
22429
+ } else if (!DomHandler.isDocument(event.target)) {
22430
+ alignOverlay();
22431
+ }
22237
22432
  }
22238
22433
  },
22239
22434
  when: overlayVisibleState
@@ -22432,12 +22627,14 @@ var Dropdown = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
22432
22627
  case 'ArrowRight':
22433
22628
  onArrowLeftKey(event, true);
22434
22629
  break;
22435
- case 'Escape':
22436
22630
  case 'Enter':
22437
22631
  case 'NumpadEnter':
22438
22632
  onEnterKey(event);
22439
22633
  event.preventDefault();
22440
22634
  break;
22635
+ case 'Escape':
22636
+ onEscapeKey(event);
22637
+ break;
22441
22638
  }
22442
22639
  };
22443
22640
  var hasFocusableElements = function hasFocusableElements() {
@@ -23179,6 +23376,7 @@ var Dropdown = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
23179
23376
  "in": overlayVisibleState,
23180
23377
  isOptionDisabled: isOptionDisabled,
23181
23378
  isSelected: isSelected,
23379
+ onOverlayHide: hide,
23182
23380
  onClick: onPanelClick,
23183
23381
  onEnter: onOverlayEnter,
23184
23382
  onEntered: onOverlayEntered,
@@ -24058,7 +24256,7 @@ var RadioButton = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
24058
24256
  onChange(event);
24059
24257
  };
24060
24258
  var onChange = function onChange(event) {
24061
- if (props.disabled || props.readonly) {
24259
+ if (props.disabled || props.readOnly) {
24062
24260
  return;
24063
24261
  }
24064
24262
  if (props.onChange) {
@@ -24161,7 +24359,7 @@ var RadioButton = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
24161
24359
  onBlur: onBlur,
24162
24360
  onChange: onChange,
24163
24361
  disabled: props.disabled,
24164
- readOnly: props.readonly,
24362
+ readOnly: props.readOnly,
24165
24363
  required: props.required,
24166
24364
  tabIndex: props.tabIndex,
24167
24365
  className: cx('input')
@@ -24234,7 +24432,7 @@ RowRadioButton.displayName = 'RowRadioButton';
24234
24432
 
24235
24433
  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; }
24236
24434
  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; }
24237
- var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24435
+ var Cell = function Cell(props) {
24238
24436
  var mergeProps = useMergeProps();
24239
24437
  var _React$useState = React__namespace.useState(props.editing),
24240
24438
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -24262,13 +24460,9 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24262
24460
  var getColumnProp = function getColumnProp(name) {
24263
24461
  return ColumnBase.getCProp(props.column, name);
24264
24462
  };
24265
- var getColumnProps = function getColumnProps() {
24266
- return ColumnBase.getCProps(props.column);
24267
- };
24268
24463
  var getColumnPTOptions = function getColumnPTOptions(key) {
24269
- var cProps = getColumnProps();
24270
24464
  var columnMetaData = {
24271
- props: cProps,
24465
+ props: props.cProps,
24272
24466
  parent: props.metaData,
24273
24467
  hostName: props.hostName,
24274
24468
  state: {
@@ -24284,10 +24478,8 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24284
24478
  };
24285
24479
  return mergeProps(ptm("column.".concat(key), {
24286
24480
  column: columnMetaData
24287
- }), ptm("column.".concat(key), columnMetaData), ptmo(cProps, key, columnMetaData));
24481
+ }), ptm("column.".concat(key), columnMetaData), ptmo(props.cProps, key, columnMetaData));
24288
24482
  };
24289
- var field = getColumnProp('field') || "field_".concat(props.index);
24290
- var editingKey = props.dataKey ? props.rowData && props.rowData[props.dataKey] || props.rowIndex : props.rowIndex;
24291
24483
  var isEditable = function isEditable() {
24292
24484
  return ObjectUtils.isNotEmpty(props.editMode) && getColumnProp('editor');
24293
24485
  };
@@ -24312,34 +24504,22 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24312
24504
  _useEventListener2 = _slicedToArray(_useEventListener, 2),
24313
24505
  bindDocumentClickListener = _useEventListener2[0],
24314
24506
  unbindDocumentClickListener = _useEventListener2[1];
24315
- var isSelected = function isSelected() {
24316
- return props.selection ? props.selection instanceof Array ? findIndex(props.selection) > -1 : equals(props.selection) : false;
24317
- };
24318
- var equalsData = function equalsData(data) {
24319
- return props.compareSelectionBy === 'equals' ? data === props.rowData : ObjectUtils.equals(data, props.rowData, props.dataKey);
24320
- };
24321
- var equals = function equals(selectedCell) {
24322
- return selectedCell && (selectedCell.rowIndex === props.rowIndex || equalsData(selectedCell.rowData)) && (selectedCell.field === field || selectedCell.cellIndex === props.index);
24323
- };
24324
24507
  var isOutsideClicked = function isOutsideClicked(target) {
24325
24508
  return elementRef.current && !(elementRef.current.isSameNode(target) || elementRef.current.contains(target));
24326
24509
  };
24327
- var getVirtualScrollerOption = function getVirtualScrollerOption(option) {
24328
- return props.virtualScrollerOptions ? props.virtualScrollerOptions[option] : null;
24329
- };
24330
24510
  var getStyle = function getStyle() {
24331
24511
  var bodyStyle = getColumnProp('bodyStyle');
24332
24512
  var columnStyle = getColumnProp('style');
24333
- return getColumnProp('frozen') ? Object.assign({}, columnStyle, bodyStyle, styleObjectState) : Object.assign({}, columnStyle, bodyStyle);
24513
+ return props.frozenCol ? Object.assign({}, columnStyle, bodyStyle, styleObjectState) : Object.assign({}, columnStyle, bodyStyle);
24334
24514
  };
24335
24515
  var getCellParams = function getCellParams() {
24336
24516
  return {
24337
- value: resolveFieldData(),
24338
- field: field,
24517
+ value: props.resolveFieldData(),
24518
+ field: props.field,
24339
24519
  rowData: props.rowData,
24340
24520
  rowIndex: props.rowIndex,
24341
24521
  cellIndex: props.index,
24342
- selected: isSelected(),
24522
+ selected: props.isCellSelected,
24343
24523
  column: props.column,
24344
24524
  props: props
24345
24525
  };
@@ -24350,20 +24530,6 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24350
24530
  originalEvent: event
24351
24531
  }, params);
24352
24532
  };
24353
- var resolveFieldData = function resolveFieldData(data) {
24354
- return ObjectUtils.resolveFieldData(data || props.rowData, field);
24355
- };
24356
- var getEditingRowData = function getEditingRowData() {
24357
- return props.editingMeta && props.editingMeta[editingKey] ? props.editingMeta[editingKey].data : props.rowData;
24358
- };
24359
- var getTabIndex = function getTabIndex(cellSelected) {
24360
- return props.allowCellSelection ? cellSelected ? 0 : props.rowIndex === 0 && props.index === 0 ? props.tabIndex : -1 : null;
24361
- };
24362
- var findIndex = function findIndex(collection) {
24363
- return (collection || []).findIndex(function (data) {
24364
- return equals(data);
24365
- });
24366
- };
24367
24533
  var closeCell = function closeCell(event) {
24368
24534
  var params = getCellCallbackParams(event);
24369
24535
  var onBeforeCellEditHide = getColumnProp('onBeforeCellEditHide');
@@ -24384,7 +24550,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24384
24550
  var switchCellToViewMode = function switchCellToViewMode(event, submit) {
24385
24551
  var callbackParams = getCellCallbackParams(event);
24386
24552
  var newRowData = _objectSpread$1i({}, editingRowDataStateRef.current);
24387
- var newValue = resolveFieldData(newRowData);
24553
+ var newValue = props.resolveFieldData(newRowData);
24388
24554
  var params = _objectSpread$1i(_objectSpread$1i({}, callbackParams), {}, {
24389
24555
  newRowData: newRowData,
24390
24556
  newValue: newValue
@@ -24409,128 +24575,20 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24409
24575
  }
24410
24576
  setEditingRowDataState(newRowData);
24411
24577
  };
24412
- var _findNextSelectableCell = function findNextSelectableCell(cell) {
24413
- var nextCell = cell.nextElementSibling;
24414
- return nextCell ? DomHandler.getAttribute(nextCell, 'data-p-selectable-cell') ? nextCell : _findNextSelectableCell(nextCell) : null;
24415
- };
24416
- var _findPrevSelectableCell = function findPrevSelectableCell(cell) {
24417
- var prevCell = cell.previousElementSibling;
24418
- return prevCell ? DomHandler.getAttribute(prevCell, 'data-p-selectable-cell') ? prevCell : _findPrevSelectableCell(prevCell) : null;
24419
- };
24420
- var _findDownSelectableCell = function findDownSelectableCell(cell) {
24421
- var downRow = cell.parentElement.nextElementSibling;
24422
- var downCell = downRow ? downRow.children[props.index] : null;
24423
- return downRow && downCell ? DomHandler.getAttribute(downRow, 'data-p-selectable-row') && DomHandler.getAttribute(downCell, 'data-p-selectable-cell') ? downCell : _findDownSelectableCell(downCell) : null;
24424
- };
24425
- var _findUpSelectableCell = function findUpSelectableCell(cell) {
24426
- var upRow = cell.parentElement.previousElementSibling;
24427
- var upCell = upRow ? upRow.children[props.index] : null;
24428
- return upRow && upCell ? DomHandler.getAttribute(upRow, 'data-p-selectable-row') && DomHandler.getAttribute(upCell, 'data-p-selectable-cell') ? upCell : _findUpSelectableCell(upCell) : null;
24429
- };
24430
- var changeTabIndex = function changeTabIndex(currentCell, nextCell) {
24431
- if (currentCell && nextCell) {
24432
- currentCell.tabIndex = -1;
24433
- nextCell.tabIndex = props.tabIndex;
24434
- }
24435
- };
24436
- var focusOnElement = function focusOnElement() {
24437
- clearTimeout(focusTimeout.current);
24438
- focusTimeout.current = setTimeout(function () {
24439
- if (editingState) {
24440
- var focusableEl = props.editMode === 'cell' ? DomHandler.getFirstFocusableElement(elementRef.current, ':not([data-pc-section="editorkeyhelperlabel"])') : DomHandler.findSingle(elementRef.current, '[data-p-row-editor-save="true"]');
24441
- focusableEl && focusableEl.focus();
24442
- }
24443
- keyHelperRef.current && (keyHelperRef.current.tabIndex = editingState ? -1 : 0);
24444
- }, 1);
24445
- };
24446
- var focusOnInit = function focusOnInit() {
24447
- clearTimeout(initFocusTimeout.current);
24448
- initFocusTimeout.current = setTimeout(function () {
24449
- var focusableEl = props.editMode === 'row' ? DomHandler.findSingle(elementRef.current, '[data-p-row-editor-init="true"]') : null;
24450
- focusableEl && focusableEl.focus();
24451
- }, 1);
24452
- };
24453
- var updateStickyPosition = function updateStickyPosition() {
24454
- if (getColumnProp('frozen')) {
24455
- var styleObject = _objectSpread$1i({}, styleObjectState);
24456
- var align = getColumnProp('alignFrozen');
24457
- if (align === 'right') {
24458
- var right = 0;
24459
- var next = elementRef.current && elementRef.current.nextElementSibling;
24460
- if (next && next.classList.contains('p-frozen-column')) {
24461
- right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0);
24462
- }
24463
- styleObject.right = right + 'px';
24464
- } else {
24465
- var left = 0;
24466
- var prev = elementRef.current && elementRef.current.previousElementSibling;
24467
- if (prev && prev.classList.contains('p-frozen-column')) {
24468
- left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0);
24469
- }
24470
- styleObject.left = left + 'px';
24471
- }
24472
- var isSameStyle = styleObjectState.left === styleObject.left && styleObjectState.right === styleObject.right;
24473
- !isSameStyle && setStyleObjectState(styleObject);
24474
- }
24475
- };
24476
24578
  var editorCallback = function editorCallback(val) {
24477
24579
  var editingRowData = _objectSpread$1i({}, editingRowDataState);
24478
- ObjectUtils.mutateFieldData(editingRowData, field, val);
24580
+ ObjectUtils.mutateFieldData(editingRowData, props.field, val);
24479
24581
  setEditingRowDataState(editingRowData);
24480
24582
 
24481
24583
  // update editing meta for complete methods on row mode
24482
- var currentData = getEditingRowData();
24584
+ var currentData = props.getEditingRowData();
24483
24585
  if (currentData) {
24484
- ObjectUtils.mutateFieldData(currentData, field, val);
24586
+ ObjectUtils.mutateFieldData(currentData, props.field, val);
24485
24587
  }
24486
24588
  editingRowDataStateRef.current = editingRowData;
24487
24589
  };
24488
24590
  var _onClick = function onClick(event) {
24489
- var params = getCellCallbackParams(event);
24490
- if (props.editMode !== 'row' && isEditable() && !editingState && (props.selectOnEdit || !props.selectOnEdit && props.selected)) {
24491
- selfClick.current = true;
24492
- var onBeforeCellEditShow = getColumnProp('onBeforeCellEditShow');
24493
- var onCellEditInit = getColumnProp('onCellEditInit');
24494
- var cellEditValidatorEvent = getColumnProp('cellEditValidatorEvent');
24495
- if (onBeforeCellEditShow) {
24496
- // if user returns false do not show the editor
24497
- if (onBeforeCellEditShow(params) === false) {
24498
- return;
24499
- }
24500
-
24501
- // if user prevents default stop the editor
24502
- if (event && event.defaultPrevented) {
24503
- return;
24504
- }
24505
- }
24506
-
24507
- // 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.
24508
- setTimeout(function () {
24509
- setEditingState(true);
24510
- if (onCellEditInit) {
24511
- if (onCellEditInit(params) === false) {
24512
- return;
24513
- }
24514
-
24515
- // if user prevents default stop the editor
24516
- if (event && event.defaultPrevented) {
24517
- return;
24518
- }
24519
- }
24520
- if (cellEditValidatorEvent === 'click') {
24521
- bindDocumentClickListener();
24522
- overlayEventListener.current = function (e) {
24523
- if (!isOutsideClicked(e.target)) {
24524
- selfClick.current = true;
24525
- }
24526
- };
24527
- OverlayService.on('overlay-click', overlayEventListener.current);
24528
- }
24529
- }, 1);
24530
- }
24531
- if (props.allowCellSelection && props.onClick) {
24532
- props.onClick(params);
24533
- }
24591
+ props.onClick(event, getCellCallbackParams(event), isEditable(), editingState, setEditingState, selfClick, props.column, bindDocumentClickListener, overlayEventListener);
24534
24592
  };
24535
24593
  var _onMouseDown = function onMouseDown(event) {
24536
24594
  var params = getCellCallbackParams(event);
@@ -24554,7 +24612,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24554
24612
  cell = event.currentTarget;
24555
24613
  switch (event.code) {
24556
24614
  case 'ArrowLeft':
24557
- var prevCell = _findPrevSelectableCell(cell);
24615
+ var prevCell = props.findPrevSelectableCell(cell);
24558
24616
  if (prevCell) {
24559
24617
  changeTabIndex(cell, prevCell);
24560
24618
  prevCell.focus();
@@ -24562,7 +24620,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24562
24620
  event.preventDefault();
24563
24621
  break;
24564
24622
  case 'ArrowRight':
24565
- var nextCell = _findNextSelectableCell(cell);
24623
+ var nextCell = props.findNextSelectableCell(cell);
24566
24624
  if (nextCell) {
24567
24625
  changeTabIndex(cell, nextCell);
24568
24626
  nextCell.focus();
@@ -24570,7 +24628,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24570
24628
  event.preventDefault();
24571
24629
  break;
24572
24630
  case 'ArrowUp':
24573
- var upCell = _findUpSelectableCell(cell);
24631
+ var upCell = props.findUpSelectableCell(cell, index);
24574
24632
  if (upCell) {
24575
24633
  changeTabIndex(cell, upCell);
24576
24634
  upCell.focus();
@@ -24578,7 +24636,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24578
24636
  event.preventDefault();
24579
24637
  break;
24580
24638
  case 'ArrowDown':
24581
- var downCell = _findDownSelectableCell(cell);
24639
+ var downCell = props.findDownSelectableCell(cell, index);
24582
24640
  if (downCell) {
24583
24641
  changeTabIndex(cell, downCell);
24584
24642
  downCell.focus();
@@ -24617,13 +24675,6 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24617
24675
  index: props.rowIndex
24618
24676
  });
24619
24677
  };
24620
- var onCheckboxChange = function onCheckboxChange(event) {
24621
- props.onCheckboxChange({
24622
- originalEvent: event,
24623
- data: props.rowData,
24624
- index: props.rowIndex
24625
- });
24626
- };
24627
24678
  var onRowToggle = function onRowToggle(event) {
24628
24679
  props.onRowToggle({
24629
24680
  originalEvent: event,
@@ -24636,8 +24687,8 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24636
24687
  props.onRowEditInit({
24637
24688
  originalEvent: event,
24638
24689
  data: props.rowData,
24639
- newData: getEditingRowData(),
24640
- field: field,
24690
+ newData: props.getEditingRowData(),
24691
+ field: props.field,
24641
24692
  index: props.rowIndex
24642
24693
  });
24643
24694
  };
@@ -24645,32 +24696,26 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24645
24696
  props.onRowEditSave({
24646
24697
  originalEvent: event,
24647
24698
  data: props.rowData,
24648
- newData: getEditingRowData(),
24649
- field: field,
24699
+ newData: props.getEditingRowData(),
24700
+ field: props.field,
24650
24701
  index: props.rowIndex
24651
24702
  });
24652
- focusOnInit();
24703
+ props.focusOnInit(initFocusTimeout, elementRef);
24653
24704
  };
24654
24705
  var onRowEditCancel = function onRowEditCancel(event) {
24655
24706
  props.onRowEditCancel({
24656
24707
  originalEvent: event,
24657
24708
  data: props.rowData,
24658
- newData: getEditingRowData(),
24659
- field: field,
24709
+ newData: props.getEditingRowData(),
24710
+ field: props.field,
24660
24711
  index: props.rowIndex
24661
24712
  });
24662
- focusOnInit();
24713
+ props.focusOnInit();
24663
24714
  };
24664
24715
  React__namespace.useEffect(function () {
24665
- if (getColumnProp('frozen')) {
24666
- updateStickyPosition();
24667
- }
24668
- });
24669
- React__namespace.useEffect(function () {
24670
- if (props.editMode === 'cell' || props.editMode === 'row') {
24671
- focusOnElement();
24672
- }
24673
- }, [props.editMode, props.editing, editingState]); // eslint-disable-line react-hooks/exhaustive-deps
24716
+ if (props.frozenCol) props.updateStickyPosition(elementRef, props.frozenCol, props.alignFrozenCol, styleObjectState, setStyleObjectState);
24717
+ if (props.editMode === 'cell' || props.editMode === 'row') props.focusOnElement(focusTimeout, editingState, elementRef, keyHelperRef);
24718
+ }, [props.editMode, props.editing, editingState, props.frozenCol, props.alignFrozenCol]); // eslint-disable-line react-hooks/exhaustive-deps
24674
24719
 
24675
24720
  React__namespace.useEffect(function () {
24676
24721
  if (props.editMode === 'row' && props.editing !== editingState) {
@@ -24679,7 +24724,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24679
24724
  }, [props.editMode, props.editing, editingState]);
24680
24725
  useUpdateEffect(function () {
24681
24726
  if (props.editMode === 'cell' || props.editMode === 'row') {
24682
- var editingRowData = getEditingRowData();
24727
+ var editingRowData = props.getEditingRowData();
24683
24728
  setEditingRowDataState(editingRowData);
24684
24729
  editingRowDataStateRef.current = editingRowData;
24685
24730
  }
@@ -24689,7 +24734,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24689
24734
  var callbackParams = getCellCallbackParams();
24690
24735
  var params = _objectSpread$1i(_objectSpread$1i({}, callbackParams), {}, {
24691
24736
  editing: editingState,
24692
- editingKey: editingKey
24737
+ editingKey: props.editingKey
24693
24738
  });
24694
24739
  props.onEditingMetaChange(params);
24695
24740
  }
@@ -24702,16 +24747,16 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24702
24747
  }
24703
24748
  });
24704
24749
  var createLoading = function createLoading() {
24705
- var options = getVirtualScrollerOption('getLoaderOptions')(props.rowIndex, {
24750
+ var options = props.getVirtualScrollerOption('getLoaderOptions')(props.rowIndex, {
24706
24751
  cellIndex: props.index,
24707
24752
  cellFirst: props.index === 0,
24708
- cellLast: props.index === getVirtualScrollerOption('columns').length - 1,
24753
+ cellLast: props.index === props.getVirtualScrollerOption('columns').length - 1,
24709
24754
  cellEven: props.index % 2 === 0,
24710
24755
  cellOdd: props.index % 2 !== 0,
24711
24756
  column: props.column,
24712
- field: field
24757
+ field: props.field
24713
24758
  });
24714
- var content = ObjectUtils.getJSXElement(getVirtualScrollerOption('loadingTemplate'), options);
24759
+ var content = ObjectUtils.getJSXElement(props.getVirtualScrollerOption('loadingTemplate'), options);
24715
24760
  var bodyCellProps = mergeProps(getColumnPTOptions('bodyCell'), {
24716
24761
  role: 'cell'
24717
24762
  });
@@ -24720,20 +24765,20 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24720
24765
  var createElement = function createElement() {
24721
24766
  var content;
24722
24767
  var editorKeyHelper;
24723
- var cellSelected = props.allowCellSelection && isSelected();
24768
+ var cellSelected = props.allowCellSelection && props.isCellSelected;
24724
24769
  var isRowEditor = props.editMode === 'row';
24725
- var tabIndex = getTabIndex(cellSelected);
24770
+ var tabIndex = props.getTabIndex(cellSelected, props.index);
24726
24771
  var selectionMode = getColumnProp('selectionMode');
24727
24772
  var rowReorder = getColumnProp('rowReorder');
24728
24773
  var header = getColumnProp('header');
24729
24774
  var body = getColumnProp('body');
24730
24775
  var editor = getColumnProp('editor');
24731
- var frozen = getColumnProp('frozen');
24776
+ var frozen = props.frozenCol;
24732
24777
  var align = getColumnProp('align');
24733
- var value = resolveFieldData();
24778
+ var value = props.resolveFieldData();
24734
24779
  var columnBodyOptions = {
24735
24780
  column: props.column,
24736
- field: field,
24781
+ field: props.field,
24737
24782
  rowIndex: props.rowIndex,
24738
24783
  frozenRow: props.frozenRow,
24739
24784
  props: props.tableProps
@@ -24758,12 +24803,12 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24758
24803
  if (showSelection) {
24759
24804
  var ariaLabelField = props.selectionAriaLabel || props.tableProps.dataKey;
24760
24805
  var ariaLabelText = ObjectUtils.resolveFieldData(props.rowData, ariaLabelField);
24761
- label = "".concat(props.selected ? ariaLabel('unselectRow') : ariaLabel('selectRow'), " ").concat(ariaLabelText);
24806
+ label = "".concat(props.isRowSelected ? ariaLabel('unselectRow') : ariaLabel('selectRow'), " ").concat(ariaLabelText);
24762
24807
  }
24763
24808
  content = showSelection && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, selectionMode === 'single' && /*#__PURE__*/React__namespace.createElement(RowRadioButton, {
24764
24809
  hostName: props.hostName,
24765
24810
  column: props.column,
24766
- checked: props.selected,
24811
+ checked: props.isRowSelected,
24767
24812
  disabled: !props.isSelectable({
24768
24813
  data: props.rowData,
24769
24814
  index: props.rowIndex
@@ -24778,12 +24823,12 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24778
24823
  }), selectionMode === 'multiple' && /*#__PURE__*/React__namespace.createElement(RowCheckbox, {
24779
24824
  hostName: props.hostName,
24780
24825
  column: props.column,
24781
- checked: props.selected,
24826
+ checked: props.isRowSelected,
24782
24827
  disabled: !props.isSelectable({
24783
24828
  data: props.rowData,
24784
24829
  index: props.rowIndex
24785
24830
  }),
24786
- onChange: onCheckboxChange,
24831
+ onChange: props.onCheckboxChange,
24787
24832
  tabIndex: props.tabIndex,
24788
24833
  ariaLabel: label,
24789
24834
  checkIcon: props.checkIcon,
@@ -24833,7 +24878,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24833
24878
  expanderProps.element = content;
24834
24879
  content = ObjectUtils.getJSXElement(body, props.rowData, {
24835
24880
  column: props.column,
24836
- field: field,
24881
+ field: props.field,
24837
24882
  rowIndex: props.rowIndex,
24838
24883
  frozenRow: props.frozenRow,
24839
24884
  props: props.tableProps,
@@ -24907,7 +24952,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24907
24952
  rowEditorProps.element = content;
24908
24953
  content = ObjectUtils.getJSXElement(body, props.rowData, {
24909
24954
  column: props.column,
24910
- field: field,
24955
+ field: props.field,
24911
24956
  rowIndex: props.rowIndex,
24912
24957
  frozenRow: props.frozenRow,
24913
24958
  props: props.tableProps,
@@ -24917,7 +24962,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24917
24962
  } else if (body && (!editingState || !editor)) {
24918
24963
  content = body ? ObjectUtils.getJSXElement(body, props.rowData, {
24919
24964
  column: props.column,
24920
- field: field,
24965
+ field: props.field,
24921
24966
  rowIndex: props.rowIndex,
24922
24967
  frozenRow: props.frozenRow,
24923
24968
  props: props.tableProps
@@ -24925,9 +24970,9 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24925
24970
  } else if (editor && editingState) {
24926
24971
  content = ObjectUtils.getJSXElement(editor, {
24927
24972
  rowData: editingRowDataState,
24928
- value: resolveFieldData(editingRowDataState),
24973
+ value: props.resolveFieldData(editingRowDataState),
24929
24974
  column: props.column,
24930
- field: field,
24975
+ field: props.field,
24931
24976
  rowIndex: props.rowIndex,
24932
24977
  frozenRow: props.frozenRow,
24933
24978
  props: props.tableProps,
@@ -24995,7 +25040,22 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24995
25040
  ref: elementRef
24996
25041
  }, bodyCellProps), editorKeyHelper, title, content);
24997
25042
  };
24998
- return getVirtualScrollerOption('loading') ? createLoading() : createElement();
25043
+ return props.getVirtualScrollerOption('loading') ? createLoading() : createElement();
25044
+ };
25045
+
25046
+ // RadioCheckCell is used for the Radio and Checkbox selection and has the isRowSelected dependency
25047
+ var RadioCheckCell = /*#__PURE__*/React__namespace.memo(function (props) {
25048
+ return /*#__PURE__*/React__namespace.createElement(Cell, props);
25049
+ }, function (prevProps, nextProps) {
25050
+ var keysToCompare = ['isRowSelected', 'field', 'allowCellSelection', 'isCellSelected', 'editMode', 'index', 'tabIndex', 'editing', 'expanded', 'editingMeta', 'rowData'];
25051
+ return ObjectUtils.selectiveCompare(prevProps, nextProps, keysToCompare);
25052
+ });
25053
+ RadioCheckCell.displayName = 'RadioCheckCell';
25054
+ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
25055
+ return /*#__PURE__*/React__namespace.createElement(Cell, props);
25056
+ }, function (prevProps, nextProps) {
25057
+ var keysToCompare = ['field', 'allowCellSelection', 'isCellSelected', 'editMode', 'index', 'tabIndex', 'editing', 'expanded', 'editingMeta', 'rowData', 'frozenCol', 'alignFrozenCol'];
25058
+ return ObjectUtils.selectiveCompare(prevProps, nextProps, keysToCompare);
24999
25059
  });
25000
25060
  BodyCell.displayName = 'BodyCell';
25001
25061
 
@@ -25011,6 +25071,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
25011
25071
  var _props$ptCallbacks = props.ptCallbacks,
25012
25072
  ptm = _props$ptCallbacks.ptm,
25013
25073
  cx = _props$ptCallbacks.cx;
25074
+ var isRowSelected = !props.allowCellSelection && props.selected || props.contextMenuSelected;
25014
25075
  var getBodyRowPTOptions = function getBodyRowPTOptions(key) {
25015
25076
  return ptm(key, {
25016
25077
  parent: props.metaData,
@@ -25024,7 +25085,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
25024
25085
  data: props.rowData,
25025
25086
  index: props.rowIndex
25026
25087
  }),
25027
- selected: !props.allowCellSelection && props.selected || props.contextMenuSelected,
25088
+ selected: isRowSelected,
25028
25089
  stripedRows: props.metaData.props.stripedRows
25029
25090
  }
25030
25091
  });
@@ -25053,10 +25114,10 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
25053
25114
  return equals(rowData, data);
25054
25115
  });
25055
25116
  };
25056
- var changeTabIndex = function changeTabIndex(currentRow, nextRow) {
25057
- if (currentRow && nextRow) {
25058
- currentRow.tabIndex = -1;
25059
- nextRow.tabIndex = props.tabIndex;
25117
+ var changeTabIndex = function changeTabIndex(currentElement, nextElement) {
25118
+ if (currentElement && nextElement) {
25119
+ currentElement.tabIndex = -1;
25120
+ nextElement.tabIndex = props.tabIndex;
25060
25121
  }
25061
25122
  };
25062
25123
  var findFirstSelectableRow = function findFirstSelectableRow(row) {
@@ -25383,32 +25444,176 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
25383
25444
  onEditChange(e, false);
25384
25445
  event.preventDefault();
25385
25446
  };
25447
+ var equalsDataCell = function equalsDataCell(data) {
25448
+ return props.compareSelectionBy === 'equals' ? data === props.rowData : ObjectUtils.equals(data, props.rowData, props.dataKey);
25449
+ };
25450
+ var equalsCell = function equalsCell(selectedCell, field, colIndex) {
25451
+ return selectedCell && (selectedCell.rowIndex === props.rowIndex || equalsDataCell(selectedCell.rowData)) && (selectedCell.field === field || selectedCell.cellIndex === colIndex);
25452
+ };
25453
+ var findIndexCell = function findIndexCell(collection, field, colIndex) {
25454
+ return (collection || []).findIndex(function (data) {
25455
+ return equalsCell(data, field, colIndex);
25456
+ });
25457
+ };
25458
+ var isCellSelected = function isCellSelected(selection, field, colIndex) {
25459
+ return selection ? selection instanceof Array ? findIndexCell(selection, field, colIndex) > -1 : equalsCell(selection, field, colIndex) : false;
25460
+ };
25461
+ var onCheckboxChange = function onCheckboxChange(event) {
25462
+ props.onCheckboxChange({
25463
+ originalEvent: event,
25464
+ data: props.rowData,
25465
+ index: props.rowIndex
25466
+ });
25467
+ };
25468
+ var editingKey = props.dataKey ? props.rowData && props.rowData[props.dataKey] || props.rowIndex : props.rowIndex;
25469
+ var getVirtualScrollerOption = React__namespace.useCallback(function (option) {
25470
+ return props.virtualScrollerOptions ? props.virtualScrollerOptions[option] : null;
25471
+ }, [props.virtualScrollerOptions]);
25472
+ var getEditingRowData = function getEditingRowData() {
25473
+ return props.editingMeta && props.editingMeta[editingKey] ? props.editingMeta[editingKey].data : props.rowData;
25474
+ };
25475
+ var getTabIndexCell = React__namespace.useCallback(function (cellSelected, cellIndex) {
25476
+ return props.allowCellSelection ? cellSelected ? 0 : props.rowIndex === 0 && cellIndex === 0 ? props.tabIndex : -1 : null;
25477
+ }, [props.allowCellSelection, props.rowIndex, props.tabIndex]);
25478
+ var findNextSelectableCell = React__namespace.useCallback(function (cell) {
25479
+ var nextCell = cell.nextElementSibling;
25480
+ return nextCell ? DomHandler.getAttribute(nextCell, 'data-p-selectable-cell') ? nextCell : findNextSelectableCell(nextCell) : null;
25481
+ }, []);
25482
+ var findPrevSelectableCell = React__namespace.useCallback(function (cell) {
25483
+ var prevCell = cell.previousElementSibling;
25484
+ return prevCell ? DomHandler.getAttribute(prevCell, 'data-p-selectable-cell') ? prevCell : findPrevSelectableCell(prevCell) : null;
25485
+ }, []);
25486
+ var findDownSelectableCell = React__namespace.useCallback(function (cell, cellIndex) {
25487
+ var downRow = cell.parentElement.nextElementSibling;
25488
+ var downCell = downRow ? downRow.children[cellIndex] : null;
25489
+ return downRow && downCell ? DomHandler.getAttribute(downRow, 'data-p-selectable-row') && DomHandler.getAttribute(downCell, 'data-p-selectable-cell') ? downCell : findDownSelectableCell(downCell) : null;
25490
+ }, []);
25491
+ var findUpSelectableCell = React__namespace.useCallback(function (cell, cellIndex) {
25492
+ var upRow = cell.parentElement.previousElementSibling;
25493
+ var upCell = upRow ? upRow.children[cellIndex] : null;
25494
+ return upRow && upCell ? DomHandler.getAttribute(upRow, 'data-p-selectable-row') && DomHandler.getAttribute(upCell, 'data-p-selectable-cell') ? upCell : findUpSelectableCell(upCell) : null;
25495
+ }, []);
25496
+ var focusOnElement = React__namespace.useCallback(function (focusTimeoutRef, editingState, elementRef, keyHelperRef) {
25497
+ clearTimeout(focusTimeoutRef.current);
25498
+ focusTimeoutRef.current = setTimeout(function () {
25499
+ if (editingState) {
25500
+ var focusableEl = props.editMode === 'cell' ? DomHandler.getFirstFocusableElement(elementRef.current, ':not([data-pc-section="editorkeyhelperlabel"])') : DomHandler.findSingle(elementRef.current, '[data-p-row-editor-save="true"]');
25501
+ focusableEl && focusableEl.focus();
25502
+ }
25503
+ keyHelperRef.current && (keyHelperRef.current.tabIndex = editingState ? -1 : 0);
25504
+ }, 1);
25505
+ }, [props.editMode]);
25506
+ var focusOnInit = React__namespace.useCallback(function (initFocusTimeoutRef, elementRef) {
25507
+ clearTimeout(initFocusTimeoutRef.current);
25508
+ initFocusTimeoutRef.current = setTimeout(function () {
25509
+ var focusableEl = props.editMode === 'row' ? DomHandler.findSingle(elementRef.current, '[data-p-row-editor-init="true"]') : null;
25510
+ focusableEl && focusableEl.focus();
25511
+ }, 1);
25512
+ }, [props.editMode]);
25513
+ var updateStickyPosition = React__namespace.useCallback(function (elementRef, frozen, alignFrozen, styleObjectState, setStyleObjectState) {
25514
+ if (frozen) {
25515
+ var styleObject = _objectSpread$1h({}, styleObjectState);
25516
+ if (alignFrozen === 'right') {
25517
+ var right = 0;
25518
+ var next = elementRef.current && elementRef.current.nextElementSibling;
25519
+ if (next && next.classList.contains('p-frozen-column')) {
25520
+ right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0);
25521
+ }
25522
+ styleObject.right = right + 'px';
25523
+ } else {
25524
+ var left = 0;
25525
+ var prev = elementRef.current && elementRef.current.previousElementSibling;
25526
+ if (prev && prev.classList.contains('p-frozen-column')) {
25527
+ left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0);
25528
+ }
25529
+ styleObject.left = left + 'px';
25530
+ }
25531
+ var isSameStyle = styleObjectState.left === styleObject.left && styleObjectState.right === styleObject.right;
25532
+ !isSameStyle && setStyleObjectState(styleObject);
25533
+ }
25534
+ }, []);
25535
+ var onCellClick = function onCellClick(event, params, isEditable, editingState, setEditingState, selfClick, column, bindDocumentClickListener, overlayEventListener) {
25536
+ if (props.editMode !== 'row' && isEditable && !editingState && (props.selectOnEdit || !props.selectOnEdit && props.isRowSelected)) {
25537
+ selfClick.current = true;
25538
+ var onBeforeCellEditShow = getColumnProp(column, 'onBeforeCellEditShow');
25539
+ var onCellEditInit = getColumnProp(column, 'onCellEditInit');
25540
+ var cellEditValidatorEvent = getColumnProp(column, 'cellEditValidatorEvent');
25541
+ if (onBeforeCellEditShow) {
25542
+ // if user returns false do not show the editor
25543
+ if (onBeforeCellEditShow(params) === false) {
25544
+ return;
25545
+ }
25546
+
25547
+ // if user prevents default stop the editor
25548
+ if (event && event.defaultPrevented) {
25549
+ return;
25550
+ }
25551
+ }
25552
+
25553
+ // 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.
25554
+ setTimeout(function () {
25555
+ setEditingState(true);
25556
+ if (onCellEditInit) {
25557
+ if (onCellEditInit(params) === false) {
25558
+ return;
25559
+ }
25560
+
25561
+ // if user prevents default stop the editor
25562
+ if (event && event.defaultPrevented) {
25563
+ return;
25564
+ }
25565
+ }
25566
+ if (cellEditValidatorEvent === 'click') {
25567
+ bindDocumentClickListener();
25568
+ overlayEventListener.current = function (e) {
25569
+ if (!isOutsideClicked(e.target)) {
25570
+ selfClick.current = true;
25571
+ }
25572
+ };
25573
+ OverlayService.on('overlay-click', overlayEventListener.current);
25574
+ }
25575
+ }, 1);
25576
+ }
25577
+ if (props.allowCellSelection && props.onCellClick) {
25578
+ props.onCellClick(params);
25579
+ }
25580
+ };
25386
25581
  var createContent = function createContent() {
25387
25582
  return props.columns.map(function (col, i) {
25388
25583
  if (shouldRenderBodyCell(props.value, col, props.index)) {
25389
25584
  var key = "".concat(props.rowIndex, "_").concat(getColumnProp(col, 'columnKey') || getColumnProp(col, 'field'), "_").concat(i);
25390
25585
  var rowSpan = props.rowGroupMode === 'rowspan' ? calculateRowGroupSize(props.value, col, props.index) : null;
25391
- return /*#__PURE__*/React__namespace.createElement(BodyCell, {
25586
+ var field = getColumnProp(col, 'field') || "field_".concat(i);
25587
+ var resolveFieldData = function resolveFieldData(data) {
25588
+ return ObjectUtils.resolveFieldData(data || props.rowData, field);
25589
+ };
25590
+ var selectionMode = getColumnProp(col, 'selectionMode');
25591
+ var cellProps = mergeProps({
25392
25592
  hostName: props.hostName,
25393
- key: key,
25394
25593
  allowCellSelection: props.allowCellSelection,
25395
25594
  cellClassName: props.cellClassName,
25396
25595
  checkIcon: props.checkIcon,
25397
25596
  collapsedRowIcon: props.collapsedRowIcon,
25597
+ field: field,
25598
+ resolveFieldData: resolveFieldData,
25398
25599
  column: col,
25399
- compareSelectionBy: props.compareSelectionBy,
25600
+ cProps: props.colsProps[i],
25400
25601
  dataKey: props.dataKey,
25401
25602
  editMode: props.editMode,
25402
25603
  editing: editing,
25403
25604
  editingMeta: props.editingMeta,
25605
+ onEditingMetaChange: props.onEditingMetaChange,
25606
+ editingKey: editingKey,
25607
+ getEditingRowData: getEditingRowData,
25404
25608
  expanded: props.expanded,
25405
25609
  expandedRowIcon: props.expandedRowIcon,
25406
25610
  frozenRow: props.frozenRow,
25611
+ frozenCol: getColumnProp(col, 'frozen'),
25612
+ alignFrozenCol: getColumnProp(col, 'alignFrozen'),
25407
25613
  index: i,
25408
25614
  isSelectable: props.isSelectable,
25409
- onCheckboxChange: props.onCheckboxChange,
25410
- onClick: props.onCellClick,
25411
- onEditingMetaChange: props.onEditingMetaChange,
25615
+ onCheckboxChange: onCheckboxChange,
25616
+ onClick: onCellClick,
25412
25617
  onMouseDown: props.onCellMouseDown,
25413
25618
  onMouseUp: props.onCellMouseUp,
25414
25619
  onRadioChange: props.onRadioChange,
@@ -25424,20 +25629,31 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
25424
25629
  rowIndex: props.rowIndex,
25425
25630
  rowSpan: rowSpan,
25426
25631
  selectOnEdit: props.selectOnEdit,
25427
- selected: props.selected,
25428
- selection: props.selection,
25632
+ isRowSelected: isRowSelected,
25633
+ isCellSelected: isCellSelected(props.selection, field, i),
25429
25634
  selectionAriaLabel: props.tableProps.selectionAriaLabel,
25430
25635
  showRowReorderElement: props.showRowReorderElement,
25431
25636
  showSelectionElement: props.showSelectionElement,
25432
25637
  tabIndex: props.tabIndex,
25638
+ getTabIndex: getTabIndexCell,
25433
25639
  tableProps: props.tableProps,
25434
25640
  tableSelector: props.tableSelector,
25435
25641
  value: props.value,
25436
- virtualScrollerOptions: props.virtualScrollerOptions,
25642
+ getVirtualScrollerOption: getVirtualScrollerOption,
25437
25643
  ptCallbacks: props.ptCallbacks,
25438
25644
  metaData: props.metaData,
25439
- unstyled: props.unstyled
25645
+ unstyled: props.unstyled,
25646
+ findNextSelectableCell: findNextSelectableCell,
25647
+ findPrevSelectableCell: findPrevSelectableCell,
25648
+ findDownSelectableCell: findDownSelectableCell,
25649
+ findUpSelectableCell: findUpSelectableCell,
25650
+ focusOnElement: focusOnElement,
25651
+ focusOnInit: focusOnInit,
25652
+ updateStickyPosition: updateStickyPosition
25440
25653
  });
25654
+ return /*#__PURE__*/React__namespace.createElement(React.Fragment, {
25655
+ key: key
25656
+ }, selectionMode ? /*#__PURE__*/React__namespace.createElement(RadioCheckCell, cellProps) : /*#__PURE__*/React__namespace.createElement(BodyCell, cellProps));
25441
25657
  }
25442
25658
  return null;
25443
25659
  });
@@ -25587,8 +25803,11 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25587
25803
  var getColumnProps = function getColumnProps(column) {
25588
25804
  return ColumnBase.getCProps(column);
25589
25805
  };
25806
+ var cProps = getColumnProps(props.column);
25807
+ var colsProps = props.columns ? props.columns.map(function (col) {
25808
+ return getColumnProps(col);
25809
+ }) : [];
25590
25810
  var getColumnPTOptions = function getColumnPTOptions(key) {
25591
- var cProps = getColumnProps(props.column);
25592
25811
  var columnMetaData = {
25593
25812
  props: cProps,
25594
25813
  parent: props.metaData,
@@ -25713,8 +25932,12 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25713
25932
  var allowSelection = function allowSelection(event) {
25714
25933
  return !DomHandler.isClickable(event.originalEvent.target);
25715
25934
  };
25935
+ var metaKeySelectionRef = React__namespace.useRef(props.metaKeySelection);
25936
+ React__namespace.useEffect(function () {
25937
+ metaKeySelectionRef.current = props.metaKeySelection;
25938
+ }, [props.metaKeySelection]);
25716
25939
  var allowMetaKeySelection = function allowMetaKeySelection(event) {
25717
- return !rowTouched.current && (!props.metaKeySelection || props.metaKeySelection && (event.originalEvent.metaKey || event.originalEvent.ctrlKey));
25940
+ return !rowTouched.current && (!metaKeySelectionRef.current || metaKeySelectionRef.current && (event.originalEvent.metaKey || event.originalEvent.ctrlKey));
25718
25941
  };
25719
25942
  var allowRangeSelection = function allowRangeSelection(event) {
25720
25943
  return isMultipleSelection() && event.originalEvent.shiftKey && anchorRowIndex.current !== null;
@@ -25787,6 +26010,10 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25787
26010
  });
25788
26011
  }
25789
26012
  };
26013
+ var selectionRef = React__namespace.useRef(props.selection);
26014
+ React__namespace.useEffect(function () {
26015
+ selectionRef.current = props.selection;
26016
+ }, [props.selection]);
25790
26017
  var onSingleSelection = function onSingleSelection(_ref) {
25791
26018
  var originalEvent = _ref.originalEvent,
25792
26019
  data = _ref.data,
@@ -25800,10 +26027,11 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25800
26027
  return;
25801
26028
  }
25802
26029
  var selected = isSelected(data);
25803
- var selection = props.selection;
26030
+ var currentSelection = selectionRef.current || [];
26031
+ var newSelection = currentSelection;
25804
26032
  if (selected) {
25805
26033
  if (toggleable) {
25806
- selection = null;
26034
+ newSelection = null;
25807
26035
  onUnselect({
25808
26036
  originalEvent: originalEvent,
25809
26037
  data: data,
@@ -25811,7 +26039,7 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25811
26039
  });
25812
26040
  }
25813
26041
  } else {
25814
- selection = data;
26042
+ newSelection = data;
25815
26043
  onSelect({
25816
26044
  originalEvent: originalEvent,
25817
26045
  data: data,
@@ -25819,10 +26047,10 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25819
26047
  });
25820
26048
  }
25821
26049
  focusOnElement(originalEvent, true);
25822
- if (props.onSelectionChange && selection !== props.selection) {
26050
+ if (props.onSelectionChange && newSelection !== currentSelection) {
25823
26051
  props.onSelectionChange({
25824
26052
  originalEvent: originalEvent,
25825
- value: selection,
26053
+ value: newSelection,
25826
26054
  type: type
25827
26055
  });
25828
26056
  }
@@ -25840,11 +26068,12 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25840
26068
  return;
25841
26069
  }
25842
26070
  var selected = isSelected(data);
25843
- var selection = props.selection || [];
26071
+ var currentSelection = selectionRef.current || [];
26072
+ var newSelection = currentSelection;
25844
26073
  if (selected) {
25845
26074
  if (toggleable) {
25846
- var selectionIndex = findIndex(selection, data);
25847
- selection = props.selection.filter(function (val, i) {
26075
+ var selectionIndex = findIndex(currentSelection, data);
26076
+ newSelection = currentSelection.filter(function (val, i) {
25848
26077
  return i !== selectionIndex;
25849
26078
  });
25850
26079
  onUnselect({
@@ -25852,15 +26081,15 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25852
26081
  data: data,
25853
26082
  type: type
25854
26083
  });
25855
- } else if (selection.length) {
25856
- props.selection.forEach(function (d) {
26084
+ } else if (currentSelection.length) {
26085
+ currentSelection.forEach(function (d) {
25857
26086
  return onUnselect({
25858
26087
  originalEvent: originalEvent,
25859
26088
  data: d,
25860
26089
  type: type
25861
26090
  });
25862
26091
  });
25863
- selection = [data];
26092
+ newSelection = [data];
25864
26093
  onSelect({
25865
26094
  originalEvent: originalEvent,
25866
26095
  data: data,
@@ -25868,18 +26097,18 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25868
26097
  });
25869
26098
  }
25870
26099
  } else {
25871
- selection = ObjectUtils.isObject(selection) ? [selection] : selection;
25872
- selection = toggleable && isMultipleSelection() ? [].concat(_toConsumableArray(selection), [data]) : [data];
26100
+ newSelection = ObjectUtils.isObject(currentSelection) ? [currentSelection] : currentSelection;
26101
+ newSelection = toggleable && isMultipleSelection() ? [].concat(_toConsumableArray(newSelection), [data]) : [data];
25873
26102
  onSelect({
25874
26103
  originalEvent: originalEvent,
25875
26104
  data: data,
25876
26105
  type: type
25877
26106
  });
25878
26107
  }
25879
- if (props.onSelectionChange && selection !== props.selection) {
26108
+ if (props.onSelectionChange && newSelection !== currentSelection) {
25880
26109
  props.onSelectionChange({
25881
26110
  originalEvent: originalEvent,
25882
- value: selection,
26111
+ value: newSelection,
25883
26112
  type: type
25884
26113
  });
25885
26114
  }
@@ -26481,6 +26710,7 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
26481
26710
  checkIcon: props.checkIcon,
26482
26711
  collapsedRowIcon: props.collapsedRowIcon,
26483
26712
  columns: props.columns,
26713
+ colsProps: colsProps,
26484
26714
  compareSelectionBy: props.compareSelectionBy,
26485
26715
  contextMenuSelected: contextMenuSelected,
26486
26716
  dataKey: props.dataKey,
@@ -26960,9 +27190,17 @@ var ColumnFilter = /*#__PURE__*/React__namespace.memo(function (props) {
26960
27190
  var type = _ref.type,
26961
27191
  valid = _ref.valid;
26962
27192
  if (valid) {
26963
- type === 'outside' ? !selfClick.current && !isTargetClicked(event.target) && hide() : hide();
27193
+ if (type === 'outside') {
27194
+ if (!selfClick.current && !isTargetClicked(event.target)) {
27195
+ hide();
27196
+ }
27197
+ selfClick.current = false;
27198
+ } else if (context.hideOverlaysOnDocumentScrolling) {
27199
+ hide();
27200
+ } else if (!DomHandler.isDocument(event.target)) {
27201
+ DomHandler.alignOverlay(overlayRef.current, iconRef.current, context && context.appendTo || PrimeReact.appendTo, false);
27202
+ }
26964
27203
  }
26965
- selfClick.current = false;
26966
27204
  },
26967
27205
  when: overlayVisibleState
26968
27206
  }),
@@ -35645,7 +35883,7 @@ var InputMask = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
35645
35883
  var updateValue = function updateValue(allow) {
35646
35884
  var pos;
35647
35885
  if (elementRef.current) {
35648
- if (props.value == null) {
35886
+ if (ObjectUtils.isEmpty(props.value)) {
35649
35887
  elementRef.current.value = '';
35650
35888
  } else {
35651
35889
  elementRef.current.value = props.value;
@@ -38756,13 +38994,6 @@ var MentionBase = ComponentBase.extend({
38756
38994
  inputRef: null,
38757
38995
  inputStyle: null,
38758
38996
  itemTemplate: null,
38759
- panelClassName: null,
38760
- panelStyle: null,
38761
- scrollHeight: '200px',
38762
- style: null,
38763
- suggestions: null,
38764
- transitionOptions: null,
38765
- trigger: '@',
38766
38997
  onBlur: null,
38767
38998
  onChange: null,
38768
38999
  onFocus: null,
@@ -38771,6 +39002,14 @@ var MentionBase = ComponentBase.extend({
38771
39002
  onSearch: null,
38772
39003
  onSelect: null,
38773
39004
  onShow: null,
39005
+ panelClassName: null,
39006
+ panelStyle: null,
39007
+ scrollHeight: '200px',
39008
+ style: null,
39009
+ suggestions: null,
39010
+ transitionOptions: null,
39011
+ trigger: '@',
39012
+ variant: null,
38774
39013
  children: undefined
38775
39014
  },
38776
39015
  css: {
@@ -38839,8 +39078,15 @@ var Mention = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.f
38839
39078
  target: elementRef,
38840
39079
  overlay: overlayRef,
38841
39080
  listener: function listener(event, _ref) {
38842
- var valid = _ref.valid;
38843
- valid && hide();
39081
+ var valid = _ref.valid,
39082
+ type = _ref.type;
39083
+ if (valid) {
39084
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
39085
+ hide();
39086
+ } else if (!DomHandler.isDocument(event.target)) {
39087
+ alignOverlay();
39088
+ }
39089
+ }
38844
39090
  },
38845
39091
  when: overlayVisibleState
38846
39092
  }),
@@ -39243,6 +39489,7 @@ var Mention = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.f
39243
39489
  style: props.inputStyle
39244
39490
  }, inputProps), {}, {
39245
39491
  unstyled: props.unstyled,
39492
+ variant: props.variant,
39246
39493
  autoResize: props.autoResize,
39247
39494
  onFocus: onFocus,
39248
39495
  onBlur: onBlur,
@@ -39410,10 +39657,15 @@ var Menu = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
39410
39657
  target: targetRef,
39411
39658
  overlay: menuRef,
39412
39659
  listener: function listener(event, _ref) {
39413
- var valid = _ref.valid;
39660
+ var valid = _ref.valid,
39661
+ type = _ref.type;
39414
39662
  if (valid) {
39415
- hide(event);
39416
- setFocusedOptionIndex(-1);
39663
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
39664
+ hide(event);
39665
+ setFocusedOptionIndex(-1);
39666
+ } else if (!DomHandler.isDocument(event.target)) {
39667
+ DomHandler.absolutePosition(menuRef.current, targetRef.current, props.popupAlignment);
39668
+ }
39417
39669
  }
39418
39670
  },
39419
39671
  when: visibleState
@@ -39469,6 +39721,9 @@ var Menu = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
39469
39721
  props.onFocus && props.onFocus(event);
39470
39722
  };
39471
39723
  var onListBlur = function onListBlur(event) {
39724
+ var currentTarget = event.currentTarget,
39725
+ relatedTarget = event.relatedTarget;
39726
+ if (relatedTarget && currentTarget.contains(relatedTarget)) return;
39472
39727
  setFocused(false);
39473
39728
  setFocusedOptionIndex(-1);
39474
39729
  props.onBlur && props.onBlur(event);
@@ -40071,7 +40326,6 @@ var MenubarSub = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
40071
40326
  'aria-disabled': disabled,
40072
40327
  'aria-expanded': group ? active : undefined,
40073
40328
  'aria-haspopup': group && !item.url ? 'menu' : undefined,
40074
- 'aria-level': props.level + 1,
40075
40329
  'aria-setsize': getAriaSetSize(),
40076
40330
  'aria-posinset': getAriaPosInset(index),
40077
40331
  'data-p-highlight': active,
@@ -40189,12 +40443,13 @@ var Menubar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.f
40189
40443
  var _useEventListener = useEventListener({
40190
40444
  type: 'click',
40191
40445
  listener: function listener(event) {
40192
- if (isOutsideClicked(event)) {
40193
- var isOutsideContainer = elementRef.current && !elementRef.current.contains(event.target);
40194
- if (isOutsideContainer) {
40195
- hide();
40196
- }
40446
+ var isOutsideButton = menuButtonRef.current && !menuButtonRef.current.contains(event.target);
40447
+ if (isOutsideButton) {
40448
+ hide();
40197
40449
  }
40450
+ },
40451
+ options: {
40452
+ capture: true
40198
40453
  }
40199
40454
  }),
40200
40455
  _useEventListener2 = _slicedToArray(_useEventListener, 2),
@@ -40249,9 +40504,6 @@ var Menubar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.f
40249
40504
  var menuButtonKeydown = function menuButtonKeydown(event) {
40250
40505
  (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && toggle(event);
40251
40506
  };
40252
- var isOutsideClicked = function isOutsideClicked(event) {
40253
- return rootMenuRef.current !== event.target && !rootMenuRef.current.contains(event.target) && menuButtonRef.current !== event.target && !menuButtonRef.current.contains(event.target);
40254
- };
40255
40507
  var getItemProp = function getItemProp(item, name) {
40256
40508
  return item ? ObjectUtils.getItemValue(item[name]) : undefined;
40257
40509
  };
@@ -41856,9 +42108,13 @@ var MultiSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
41856
42108
  valid = _ref.valid;
41857
42109
  if (valid) {
41858
42110
  if (type === 'outside') {
41859
- !isClearClicked(event) && !isSelectAllClicked(event) && hide();
41860
- } else {
42111
+ if (!isClearClicked(event) && !isSelectAllClicked(event)) {
42112
+ hide();
42113
+ }
42114
+ } else if (context.hideOverlaysOnDocumentScrolling) {
41861
42115
  hide();
42116
+ } else if (!DomHandler.isDocument(event.target)) {
42117
+ alignOverlay();
41862
42118
  }
41863
42119
  }
41864
42120
  },
@@ -43604,6 +43860,7 @@ var OrderList = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
43604
43860
  var styleElementRef = React__namespace.useRef(null);
43605
43861
  var reorderDirection = React__namespace.useRef(null);
43606
43862
  var listElementRef = React__namespace.useRef(null);
43863
+ var reorderedListElementRef = React__namespace.useRef(null);
43607
43864
  var metaData = {
43608
43865
  props: props,
43609
43866
  state: {
@@ -43829,9 +44086,9 @@ var OrderList = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
43829
44086
  }
43830
44087
  var _focusedOptionIndex = items[order] ? items[order].getAttribute('id') : -1;
43831
44088
  setFocusedOptionIndex(_focusedOptionIndex);
43832
- scrollInView(_focusedOptionIndex);
44089
+ scrollInViewWithFocus(_focusedOptionIndex);
43833
44090
  };
43834
- var scrollInView = function scrollInView(id) {
44091
+ var scrollInViewWithFocus = function scrollInViewWithFocus(id) {
43835
44092
  var listElement = getListElement();
43836
44093
  var element = DomHandler.findSingle(listElement, "[data-pc-section=\"item\"][id=\"".concat(id, "\"]"));
43837
44094
  if (element) {
@@ -43841,6 +44098,33 @@ var OrderList = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
43841
44098
  });
43842
44099
  }
43843
44100
  };
44101
+ var scrollInView = function scrollInView(listContainer) {
44102
+ var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
44103
+ var selectedItems = listContainer.getElementsByClassName('p-highlight');
44104
+ if (ObjectUtils.isNotEmpty(selectedItems)) {
44105
+ DomHandler.scrollInView(listContainer, direction === -1 ? selectedItems[0] : selectedItems[selectedItems.length - 1]);
44106
+ }
44107
+ };
44108
+ var handleScrollPosition = function handleScrollPosition(listElement, direction) {
44109
+ if (listElement) {
44110
+ switch (direction) {
44111
+ case 'up':
44112
+ scrollInView(listElement, -1);
44113
+ break;
44114
+ case 'top':
44115
+ listElement.scrollTop = 0;
44116
+ break;
44117
+ case 'down':
44118
+ scrollInView(listElement, 1);
44119
+ break;
44120
+ case 'bottom':
44121
+ setTimeout(function () {
44122
+ return listElement.scrollTop = listElement.scrollHeight;
44123
+ }, 100);
44124
+ break;
44125
+ }
44126
+ }
44127
+ };
43844
44128
  var onFilter = function onFilter(event) {
43845
44129
  var _filterValue = event.target.value;
43846
44130
  setFilterValueState(_filterValue);
@@ -43875,6 +44159,7 @@ var OrderList = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
43875
44159
  });
43876
44160
  }
43877
44161
  reorderDirection.current = event.direction;
44162
+ reorderedListElementRef.current = getListElement();
43878
44163
  };
43879
44164
  var createStyle = function createStyle() {
43880
44165
  if (!styleElementRef.current) {
@@ -43911,7 +44196,9 @@ var OrderList = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
43911
44196
  setFocusedOptionId(_focusedOptionId);
43912
44197
  }, [focusedOptionIndex]);
43913
44198
  useUpdateEffect(function () {
43914
- if (reorderDirection.current) {
44199
+ if (reorderedListElementRef.current) {
44200
+ handleScrollPosition(reorderedListElementRef.current, reorderDirection.current);
44201
+ reorderedListElementRef.current = null;
43915
44202
  reorderDirection.current = null;
43916
44203
  }
43917
44204
  });
@@ -44402,18 +44689,17 @@ var OverlayPanel = /*#__PURE__*/React__namespace.forwardRef(function (inProps, r
44402
44689
  var type = _ref.type,
44403
44690
  valid = _ref.valid;
44404
44691
  if (valid) {
44405
- switch (type) {
44406
- case 'outside':
44407
- props.dismissable && !isPanelClicked.current && hide();
44408
- break;
44409
- case 'resize':
44410
- case 'scroll':
44411
- case 'orientationchange':
44412
- align();
44413
- break;
44692
+ if (type === 'outside') {
44693
+ if (props.dismissable && !isPanelClicked.current) {
44694
+ hide();
44695
+ }
44696
+ isPanelClicked.current = false;
44697
+ } else if (context.hideOverlaysOnDocumentScrolling) {
44698
+ hide();
44699
+ } else if (!DomHandler.isDocument(event.target)) {
44700
+ align();
44414
44701
  }
44415
44702
  }
44416
- isPanelClicked.current = false;
44417
44703
  },
44418
44704
  when: visibleState
44419
44705
  }),
@@ -46170,8 +46456,15 @@ var Password = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
46170
46456
  target: elementRef,
46171
46457
  overlay: overlayRef,
46172
46458
  listener: function listener(event, _ref) {
46173
- var valid = _ref.valid;
46174
- valid && hide();
46459
+ var valid = _ref.valid,
46460
+ type = _ref.type;
46461
+ if (valid) {
46462
+ if (type === 'outside' || context.hideOverlaysOnDocumentScrolling) {
46463
+ hide();
46464
+ } else if (!DomHandler.isDocument(event.target)) {
46465
+ alignOverlay();
46466
+ }
46467
+ }
46175
46468
  },
46176
46469
  when: overlayVisibleState
46177
46470
  }),
@@ -49736,8 +50029,15 @@ var SlideMenu = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
49736
50029
  target: targetRef,
49737
50030
  overlay: menuRef,
49738
50031
  listener: function listener(event, _ref) {
49739
- var valid = _ref.valid;
49740
- valid && hide(event);
50032
+ var valid = _ref.valid,
50033
+ type = _ref.type;
50034
+ if (valid) {
50035
+ if (type === 'outside' || context.hideOverlaysOnDocumentScrolling) {
50036
+ hide(event);
50037
+ } else if (!DomHandler.isDocument(event.target)) {
50038
+ DomHandler.absolutePosition(menuRef.current, targetRef.current);
50039
+ }
50040
+ }
49741
50041
  },
49742
50042
  when: visibleState
49743
50043
  }),
@@ -57485,9 +57785,9 @@ var TreeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
57485
57785
  expandedKeysState = _React$useState6[0],
57486
57786
  setExpandedKeysState = _React$useState6[1];
57487
57787
  var _useDebounce = useDebounce('', props.filterDelay || 0),
57488
- _useDebounce2 = _slicedToArray(_useDebounce, 3);
57489
- _useDebounce2[0];
57490
- var filterValueState = _useDebounce2[1],
57788
+ _useDebounce2 = _slicedToArray(_useDebounce, 3),
57789
+ filterValue = _useDebounce2[0],
57790
+ filterValueState = _useDebounce2[1],
57491
57791
  setFilterValueState = _useDebounce2[2];
57492
57792
  var elementRef = React__namespace.useRef(null);
57493
57793
  var overlayRef = React__namespace.useRef(null);
@@ -57534,8 +57834,15 @@ var TreeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
57534
57834
  target: elementRef,
57535
57835
  overlay: overlayRef,
57536
57836
  listener: function listener(event, _ref) {
57537
- var valid = _ref.valid;
57538
- valid && hide();
57837
+ var valid = _ref.valid,
57838
+ type = _ref.type;
57839
+ if (valid) {
57840
+ if (type === 'outside' || context.hideOverlaysOnDocumentScrolling) {
57841
+ hide();
57842
+ } else if (!DomHandler.isDocument(event.target)) {
57843
+ alignOverlay();
57844
+ }
57845
+ }
57539
57846
  },
57540
57847
  when: overlayVisibleState
57541
57848
  }),
@@ -58073,15 +58380,15 @@ var TreeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
58073
58380
  };
58074
58381
  var createFilterElement = function createFilterElement() {
58075
58382
  if (props.filter) {
58076
- var _filterValue = props.onFilterValueChange ? props.filterValue : filteredValue;
58077
- _filterValue = ObjectUtils.isNotEmpty(_filterValue) ? _filterValue : '';
58383
+ var newValue = props.onFilterValueChange ? props.filterValue : filterValue;
58384
+ newValue = ObjectUtils.isNotEmpty(newValue) ? newValue : '';
58078
58385
  var filterContainerProps = mergeProps({
58079
58386
  className: cx('filterContainer')
58080
58387
  }, ptm('filterContainer'));
58081
58388
  var filterProps = mergeProps({
58082
58389
  ref: filterInputRef,
58083
58390
  type: 'text',
58084
- value: _filterValue,
58391
+ value: newValue,
58085
58392
  autoComplete: 'off',
58086
58393
  className: cx('filter'),
58087
58394
  placeholder: props.filterPlaceholder,
@@ -61499,7 +61806,7 @@ var TriStateCheckboxBase = ComponentBase.extend({
61499
61806
  tooltip: null,
61500
61807
  tooltipOptions: null,
61501
61808
  uncheckIcon: null,
61502
- value: '',
61809
+ value: null,
61503
61810
  children: undefined
61504
61811
  },
61505
61812
  css: {
@@ -61513,7 +61820,7 @@ var TriStateCheckbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__na
61513
61820
  var mergeProps = useMergeProps();
61514
61821
  var context = React__namespace.useContext(PrimeReactContext);
61515
61822
  var props = TriStateCheckboxBase.getProps(inProps, context);
61516
- var _useState = React.useState(''),
61823
+ var _useState = React.useState(null),
61517
61824
  _useState2 = _slicedToArray(_useState, 2),
61518
61825
  checkBoxValue = _useState2[0],
61519
61826
  setCheckBoxValue = _useState2[1];
@@ -61528,10 +61835,10 @@ var TriStateCheckbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__na
61528
61835
  name: 'tristatecheckbox'
61529
61836
  });
61530
61837
  React.useEffect(function () {
61531
- if ([true, false, ''].includes(props.value)) {
61838
+ if ([true, false, null].includes(props.value)) {
61532
61839
  setCheckBoxValue(props.value);
61533
61840
  } else {
61534
- setCheckBoxValue('');
61841
+ setCheckBoxValue(null);
61535
61842
  }
61536
61843
  }, [props.value]);
61537
61844
  var onChange = function onChange(event) {
@@ -61539,12 +61846,12 @@ var TriStateCheckbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__na
61539
61846
  return;
61540
61847
  }
61541
61848
  var newValue;
61542
- if (checkBoxValue === '') {
61849
+ if (checkBoxValue === null) {
61543
61850
  newValue = true;
61544
61851
  } else if (checkBoxValue === true) {
61545
61852
  newValue = false;
61546
61853
  } else if (checkBoxValue === false) {
61547
- newValue = '';
61854
+ newValue = null;
61548
61855
  }
61549
61856
  if (props.onChange) {
61550
61857
  props.onChange({