primereact 10.9.4 → 10.9.6

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 (237) hide show
  1. package/api/api.cjs.js +9 -1
  2. package/api/api.cjs.min.js +1 -1
  3. package/api/api.d.ts +5 -3
  4. package/api/api.esm.js +9 -1
  5. package/api/api.esm.min.js +1 -1
  6. package/api/api.js +9 -1
  7. package/api/api.min.js +1 -1
  8. package/autocomplete/autocomplete.cjs.js +13 -1
  9. package/autocomplete/autocomplete.cjs.min.js +1 -1
  10. package/autocomplete/autocomplete.d.ts +5 -5
  11. package/autocomplete/autocomplete.esm.js +14 -2
  12. package/autocomplete/autocomplete.esm.min.js +1 -1
  13. package/autocomplete/autocomplete.js +13 -1
  14. package/autocomplete/autocomplete.min.js +1 -1
  15. package/breadcrumb/breadcrumb.cjs.js +2 -1
  16. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  17. package/breadcrumb/breadcrumb.esm.js +2 -1
  18. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  19. package/breadcrumb/breadcrumb.js +2 -1
  20. package/breadcrumb/breadcrumb.min.js +1 -1
  21. package/calendar/calendar.cjs.js +37 -7
  22. package/calendar/calendar.cjs.min.js +1 -1
  23. package/calendar/calendar.esm.js +38 -8
  24. package/calendar/calendar.esm.min.js +1 -1
  25. package/calendar/calendar.js +37 -7
  26. package/calendar/calendar.min.js +1 -1
  27. package/cascadeselect/cascadeselect.cjs.js +62 -5
  28. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  29. package/cascadeselect/cascadeselect.d.ts +22 -0
  30. package/cascadeselect/cascadeselect.esm.js +63 -6
  31. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  32. package/cascadeselect/cascadeselect.js +63 -7
  33. package/cascadeselect/cascadeselect.min.js +1 -1
  34. package/checkbox/checkbox.cjs.js +1 -1
  35. package/checkbox/checkbox.cjs.min.js +1 -1
  36. package/checkbox/checkbox.esm.js +1 -1
  37. package/checkbox/checkbox.esm.min.js +1 -1
  38. package/checkbox/checkbox.js +1 -1
  39. package/checkbox/checkbox.min.js +1 -1
  40. package/chip/chip.cjs.js +15 -2
  41. package/chip/chip.cjs.min.js +1 -1
  42. package/chip/chip.esm.js +17 -4
  43. package/chip/chip.esm.min.js +1 -1
  44. package/chip/chip.js +15 -2
  45. package/chip/chip.min.js +1 -1
  46. package/chips/chips.cjs.js +1 -1
  47. package/chips/chips.cjs.min.js +1 -1
  48. package/chips/chips.esm.js +1 -1
  49. package/chips/chips.esm.min.js +1 -1
  50. package/chips/chips.js +1 -1
  51. package/chips/chips.min.js +1 -1
  52. package/colorpicker/colorpicker.cjs.js +9 -2
  53. package/colorpicker/colorpicker.cjs.min.js +1 -1
  54. package/colorpicker/colorpicker.esm.js +9 -2
  55. package/colorpicker/colorpicker.esm.min.js +1 -1
  56. package/colorpicker/colorpicker.js +9 -2
  57. package/colorpicker/colorpicker.min.js +1 -1
  58. package/confirmpopup/confirmpopup.cjs.js +10 -2
  59. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  60. package/confirmpopup/confirmpopup.esm.js +10 -2
  61. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  62. package/confirmpopup/confirmpopup.js +10 -2
  63. package/confirmpopup/confirmpopup.min.js +1 -1
  64. package/core/core.js +214 -38
  65. package/core/core.min.js +9 -9
  66. package/datatable/datatable.cjs.js +359 -291
  67. package/datatable/datatable.cjs.min.js +1 -1
  68. package/datatable/datatable.d.ts +79 -3
  69. package/datatable/datatable.esm.js +360 -292
  70. package/datatable/datatable.esm.min.js +1 -1
  71. package/datatable/datatable.js +359 -291
  72. package/datatable/datatable.min.js +1 -1
  73. package/dialog/dialog.cjs.js +3 -2
  74. package/dialog/dialog.cjs.min.js +1 -1
  75. package/dialog/dialog.d.ts +6 -1
  76. package/dialog/dialog.esm.js +3 -2
  77. package/dialog/dialog.esm.min.js +1 -1
  78. package/dialog/dialog.js +3 -2
  79. package/dialog/dialog.min.js +1 -1
  80. package/dropdown/dropdown.cjs.js +26 -5
  81. package/dropdown/dropdown.cjs.min.js +1 -1
  82. package/dropdown/dropdown.d.ts +4 -0
  83. package/dropdown/dropdown.esm.js +26 -5
  84. package/dropdown/dropdown.esm.min.js +1 -1
  85. package/dropdown/dropdown.js +26 -5
  86. package/dropdown/dropdown.min.js +1 -1
  87. package/fileupload/fileupload.cjs.js +4 -2
  88. package/fileupload/fileupload.cjs.min.js +1 -1
  89. package/fileupload/fileupload.esm.js +4 -2
  90. package/fileupload/fileupload.esm.min.js +1 -1
  91. package/fileupload/fileupload.js +4 -2
  92. package/fileupload/fileupload.min.js +1 -1
  93. package/galleria/galleria.cjs.js +1 -0
  94. package/galleria/galleria.cjs.min.js +1 -1
  95. package/galleria/galleria.esm.js +1 -0
  96. package/galleria/galleria.esm.min.js +1 -1
  97. package/galleria/galleria.js +1 -0
  98. package/galleria/galleria.min.js +1 -1
  99. package/hooks/hooks.cjs.js +16 -6
  100. package/hooks/hooks.cjs.min.js +1 -1
  101. package/hooks/hooks.esm.js +16 -6
  102. package/hooks/hooks.esm.min.js +1 -1
  103. package/hooks/hooks.js +16 -6
  104. package/hooks/hooks.min.js +1 -1
  105. package/inputmask/inputmask.cjs.js +1 -1
  106. package/inputmask/inputmask.cjs.min.js +1 -1
  107. package/inputmask/inputmask.esm.js +1 -1
  108. package/inputmask/inputmask.esm.min.js +1 -1
  109. package/inputmask/inputmask.js +1 -1
  110. package/inputmask/inputmask.min.js +1 -1
  111. package/inputnumber/inputnumber.cjs.js +11 -3
  112. package/inputnumber/inputnumber.cjs.min.js +1 -1
  113. package/inputnumber/inputnumber.esm.js +11 -3
  114. package/inputnumber/inputnumber.esm.min.js +1 -1
  115. package/inputnumber/inputnumber.js +11 -3
  116. package/inputnumber/inputnumber.min.js +1 -1
  117. package/inputotp/inputotp.cjs.js +1 -0
  118. package/inputotp/inputotp.cjs.min.js +1 -1
  119. package/inputotp/inputotp.esm.js +1 -0
  120. package/inputotp/inputotp.esm.min.js +1 -1
  121. package/inputotp/inputotp.js +1 -0
  122. package/inputotp/inputotp.min.js +1 -1
  123. package/listbox/listbox.d.ts +4 -4
  124. package/mention/mention.cjs.js +18 -9
  125. package/mention/mention.cjs.min.js +1 -1
  126. package/mention/mention.d.ts +5 -0
  127. package/mention/mention.esm.js +18 -9
  128. package/mention/mention.esm.min.js +1 -1
  129. package/mention/mention.js +18 -9
  130. package/mention/mention.min.js +1 -1
  131. package/menu/menu.cjs.js +14 -3
  132. package/menu/menu.cjs.min.js +1 -1
  133. package/menu/menu.esm.js +15 -4
  134. package/menu/menu.esm.min.js +1 -1
  135. package/menu/menu.js +14 -3
  136. package/menu/menu.min.js +1 -1
  137. package/menubar/menubar.cjs.js +6 -9
  138. package/menubar/menubar.cjs.min.js +1 -1
  139. package/menubar/menubar.esm.js +6 -9
  140. package/menubar/menubar.esm.min.js +1 -1
  141. package/menubar/menubar.js +6 -9
  142. package/menubar/menubar.min.js +1 -1
  143. package/multiselect/multiselect.cjs.js +68 -18
  144. package/multiselect/multiselect.cjs.min.js +1 -1
  145. package/multiselect/multiselect.esm.js +68 -18
  146. package/multiselect/multiselect.esm.min.js +1 -1
  147. package/multiselect/multiselect.js +68 -18
  148. package/multiselect/multiselect.min.js +1 -1
  149. package/multistatecheckbox/multistatecheckbox.cjs.js +17 -9
  150. package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
  151. package/multistatecheckbox/multistatecheckbox.esm.js +17 -9
  152. package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
  153. package/multistatecheckbox/multistatecheckbox.js +17 -9
  154. package/multistatecheckbox/multistatecheckbox.min.js +1 -1
  155. package/orderlist/orderlist.cjs.js +34 -3
  156. package/orderlist/orderlist.cjs.min.js +1 -1
  157. package/orderlist/orderlist.esm.js +34 -3
  158. package/orderlist/orderlist.esm.min.js +1 -1
  159. package/orderlist/orderlist.js +34 -3
  160. package/orderlist/orderlist.min.js +1 -1
  161. package/overlaypanel/overlaypanel.cjs.js +9 -10
  162. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  163. package/overlaypanel/overlaypanel.esm.js +9 -10
  164. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  165. package/overlaypanel/overlaypanel.js +9 -10
  166. package/overlaypanel/overlaypanel.min.js +1 -1
  167. package/package.json +1 -1
  168. package/paginator/paginator.cjs.js +9 -1
  169. package/paginator/paginator.cjs.min.js +1 -1
  170. package/paginator/paginator.esm.js +9 -1
  171. package/paginator/paginator.esm.min.js +1 -1
  172. package/paginator/paginator.js +9 -1
  173. package/paginator/paginator.min.js +1 -1
  174. package/password/password.cjs.js +9 -2
  175. package/password/password.cjs.min.js +1 -1
  176. package/password/password.esm.js +10 -3
  177. package/password/password.esm.min.js +1 -1
  178. package/password/password.js +9 -2
  179. package/password/password.min.js +1 -1
  180. package/picklist/picklist.cjs.js +9 -1
  181. package/picklist/picklist.cjs.min.js +1 -1
  182. package/picklist/picklist.esm.js +9 -1
  183. package/picklist/picklist.esm.min.js +1 -1
  184. package/picklist/picklist.js +9 -1
  185. package/picklist/picklist.min.js +1 -1
  186. package/primereact.all.cjs.js +931 -442
  187. package/primereact.all.cjs.min.js +1 -1
  188. package/primereact.all.esm.js +932 -443
  189. package/primereact.all.esm.min.js +1 -1
  190. package/primereact.all.js +931 -442
  191. package/primereact.all.min.js +1 -1
  192. package/radiobutton/radiobutton.cjs.js +2 -2
  193. package/radiobutton/radiobutton.cjs.min.js +1 -1
  194. package/radiobutton/radiobutton.d.ts +1 -1
  195. package/radiobutton/radiobutton.esm.js +2 -2
  196. package/radiobutton/radiobutton.esm.min.js +1 -1
  197. package/radiobutton/radiobutton.js +2 -2
  198. package/radiobutton/radiobutton.min.js +1 -1
  199. package/slidemenu/slidemenu.cjs.js +9 -2
  200. package/slidemenu/slidemenu.cjs.min.js +1 -1
  201. package/slidemenu/slidemenu.esm.js +10 -3
  202. package/slidemenu/slidemenu.esm.min.js +1 -1
  203. package/slidemenu/slidemenu.js +9 -2
  204. package/slidemenu/slidemenu.min.js +1 -1
  205. package/tree/tree.cjs.js +1 -1
  206. package/tree/tree.cjs.min.js +1 -1
  207. package/tree/tree.esm.js +1 -1
  208. package/tree/tree.esm.min.js +1 -1
  209. package/tree/tree.js +1 -1
  210. package/tree/tree.min.js +1 -1
  211. package/treeselect/treeselect.cjs.js +19 -8
  212. package/treeselect/treeselect.cjs.min.js +1 -1
  213. package/treeselect/treeselect.d.ts +33 -0
  214. package/treeselect/treeselect.esm.js +19 -8
  215. package/treeselect/treeselect.esm.min.js +1 -1
  216. package/treeselect/treeselect.js +19 -8
  217. package/treeselect/treeselect.min.js +1 -1
  218. package/treetable/treetable.cjs.js +1 -1
  219. package/treetable/treetable.cjs.min.js +1 -1
  220. package/treetable/treetable.esm.js +1 -1
  221. package/treetable/treetable.esm.min.js +1 -1
  222. package/treetable/treetable.js +1 -1
  223. package/treetable/treetable.min.js +1 -1
  224. package/tristatecheckbox/tristatecheckbox.cjs.js +7 -6
  225. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  226. package/tristatecheckbox/tristatecheckbox.esm.js +7 -6
  227. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  228. package/tristatecheckbox/tristatecheckbox.js +7 -6
  229. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  230. package/utils/utils.cjs.js +138 -18
  231. package/utils/utils.cjs.min.js +1 -1
  232. package/utils/utils.d.ts +5 -1
  233. package/utils/utils.esm.js +138 -18
  234. package/utils/utils.esm.min.js +1 -1
  235. package/utils/utils.js +138 -18
  236. package/utils/utils.min.js +1 -1
  237. package/web-types.json +105 -11
@@ -154,6 +154,7 @@ var FilterMatchMode = Object.freeze({
154
154
  EQUALS: 'equals',
155
155
  NOT_EQUALS: 'notEquals',
156
156
  IN: 'in',
157
+ NOT_IN: 'notIn',
157
158
  LESS_THAN: 'lt',
158
159
  LESS_THAN_OR_EQUAL_TO: 'lte',
159
160
  GREATER_THAN: 'gt',
@@ -593,11 +594,18 @@ var DomHandler = /*#__PURE__*/function () {
593
594
  element.style.transformOrigin = 'top';
594
595
  }
595
596
  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);
597
+ if (align === 'left') {
598
+ if (targetOffsetPx + elementOuterWidth > viewport.width) {
599
+ left = Math.max(0, targetOffsetPx + windowScrollLeft + targetOuterWidth - elementOuterWidth);
600
+ } else {
601
+ left = targetOffsetPx + windowScrollLeft;
602
+ }
599
603
  } else {
600
- left = targetOffsetPx - alignOffset + windowScrollLeft;
604
+ if (targetOffsetPx + targetOuterWidth - elementOuterWidth < 0) {
605
+ left = windowScrollLeft;
606
+ } else {
607
+ left = targetOffsetPx + targetOuterWidth - elementOuterWidth + windowScrollLeft;
608
+ }
601
609
  }
602
610
  element.style.top = top + 'px';
603
611
  element.style.left = left + 'px';
@@ -806,13 +814,12 @@ var DomHandler = /*#__PURE__*/function () {
806
814
  /**
807
815
  * Gets all scrollable parent elements of a given element
808
816
  * @param {HTMLElement} element - The element to find scrollable parents for
809
- * @param {boolean} hideOverlaysOnDocumentScrolling - Whether to include window/document level scrolling
810
817
  * @returns {Array} Array of scrollable parent elements
811
818
  */
812
819
  }, {
813
820
  key: "getScrollableParents",
814
821
  value: function getScrollableParents(element) {
815
- var hideOverlaysOnDocumentScrolling = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
822
+ var _this3 = this;
816
823
  var scrollableParents = [];
817
824
  if (element) {
818
825
  // Get all parent elements
@@ -835,10 +842,8 @@ var DomHandler = /*#__PURE__*/function () {
835
842
  * @param {HTMLElement} node - Element to add
836
843
  */
837
844
  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
- }
845
+ // For document/body/html elements, add window instead
846
+ scrollableParents.push(node.nodeName === 'BODY' || node.nodeName === 'HTML' || _this3.isDocument(node) ? window : node);
842
847
  };
843
848
 
844
849
  // Iterate through all parent elements
@@ -882,13 +887,6 @@ var DomHandler = /*#__PURE__*/function () {
882
887
  _iterator.f();
883
888
  }
884
889
  }
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
890
  return scrollableParents;
893
891
  }
894
892
  }, {
@@ -1028,6 +1026,11 @@ var DomHandler = /*#__PURE__*/function () {
1028
1026
  value: function isElement(obj) {
1029
1027
  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
1028
  }
1029
+ }, {
1030
+ key: "isDocument",
1031
+ value: function isDocument(obj) {
1032
+ return (typeof Document === "undefined" ? "undefined" : _typeof(Document)) === 'object' ? obj instanceof Document : obj && _typeof(obj) === 'object' && obj !== null && obj.nodeType === 9;
1033
+ }
1031
1034
  }, {
1032
1035
  key: "scrollInView",
1033
1036
  value: function scrollInView(container, item) {
@@ -1365,7 +1368,7 @@ var DomHandler = /*#__PURE__*/function () {
1365
1368
  return !!(obj && obj.constructor && obj.call && obj.apply);
1366
1369
  };
1367
1370
  var element = isFunction(target) ? target() : target;
1368
- return element && element.nodeType === 9 || this.isExist(element) ? element : null;
1371
+ return this.isDocument(element) || this.isExist(element) ? element : null;
1369
1372
  }
1370
1373
 
1371
1374
  /**
@@ -2068,6 +2071,124 @@ var ObjectUtils = /*#__PURE__*/function () {
2068
2071
  obj = obj[fields[i]];
2069
2072
  }
2070
2073
  }
2074
+
2075
+ /**
2076
+ * This helper function takes an object and a dot-separated key path. It traverses the object based on the path,
2077
+ * returning the value at the specified depth. If any part of the path is missing or undefined, it returns undefined.
2078
+ *
2079
+ * Example:
2080
+ * const obj = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2081
+ * const path = 'address.city';
2082
+ * const result = ObjectUtils.getNestedValue(obj, path);
2083
+ * console.log(result); // Output: "Wonderland"
2084
+ *
2085
+ * @param {object} obj - The object to traverse.
2086
+ * @param {string} path - The dot-separated key path.
2087
+ * @returns {*} The value at the specified depth, or undefined if any part of the path is missing or undefined.
2088
+ */
2089
+ }, {
2090
+ key: "getNestedValue",
2091
+ value: function getNestedValue(obj, path) {
2092
+ return path.split('.').reduce(function (acc, part) {
2093
+ return acc && acc[part] !== undefined ? acc[part] : undefined;
2094
+ }, obj);
2095
+ }
2096
+
2097
+ /**
2098
+ * This function takes an object and a dot-separated key path. It traverses the object based on the path,
2099
+ * returning the value at the specified depth. If any part of the path is missing or undefined, it returns undefined.
2100
+ *
2101
+ * Example:
2102
+ * const objA = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2103
+ * const objB = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2104
+ * const result = ObjectUtils.absoluteCompare(objA, objB);
2105
+ * console.log(result); // Output: true
2106
+ *
2107
+ * const objC = { name: 'Alice', address: { city: 'Wonderland', zip: 12346 } };
2108
+ * const result2 = ObjectUtils.absoluteCompare(objA, objC);
2109
+ * console.log(result2); // Output: false
2110
+ *
2111
+ * @param {object} objA - The first object to compare.
2112
+ * @param {object} objB - The second object to compare.
2113
+ * @param {number} [maxDepth=1] - The maximum depth to compare.
2114
+ * @param {number} [currentDepth=0] - The current depth (used internally for recursion).
2115
+ * @returns {boolean} True if the objects are equal within the specified depth, false otherwise.
2116
+ *
2117
+ */
2118
+ }, {
2119
+ key: "absoluteCompare",
2120
+ value: function absoluteCompare(objA, objB) {
2121
+ var maxDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
2122
+ var currentDepth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
2123
+ if (!objA || !objB) return true;
2124
+ if (currentDepth > maxDepth) return true;
2125
+ if (_typeof(objA) !== _typeof(objB)) return false;
2126
+ var aKeys = Object.keys(objA);
2127
+ var bKeys = Object.keys(objB);
2128
+ if (aKeys.length !== bKeys.length) return false;
2129
+ for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) {
2130
+ var key = _aKeys[_i];
2131
+ var aValue = objA[key];
2132
+ var bValue = objB[key];
2133
+
2134
+ // Skip comparison if values are objects
2135
+ var isObject = ObjectUtils.isObject(aValue) && ObjectUtils.isObject(bValue);
2136
+ var isFunction = ObjectUtils.isFunction(aValue) && ObjectUtils.isFunction(bValue);
2137
+ if ((isObject || isFunction) && !this.absoluteCompare(aValue, bValue, maxDepth, currentDepth + 1)) return false;
2138
+ if (!isObject && aValue !== bValue) return false;
2139
+ }
2140
+ return true;
2141
+ }
2142
+
2143
+ /**
2144
+ * This helper function takes two objects and a list of keys to compare. It compares the values of the specified keys
2145
+ * in both objects. If any comparison fails, it returns false. If all specified properties are equal, it returns true.
2146
+ * It performs a shallow comparison using absoluteCompare if no keys are provided.
2147
+ *
2148
+ * Example:
2149
+ * const objA = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2150
+ * const objB = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
2151
+ * const keysToCompare = ['name', 'address.city', 'address.zip'];
2152
+ * const result = ObjectUtils.selectiveCompare(objA, objB, keysToCompare);
2153
+ * console.log(result); // Output: true
2154
+ *
2155
+ * const objC = { name: 'Alice', address: { city: 'Wonderland', zip: 12346 } };
2156
+ * const result2 = ObjectUtils.selectiveCompare(objA, objC, keysToCompare);
2157
+ * console.log(result2); // Output: false
2158
+ *
2159
+ * @param {object} a - The first object to compare.
2160
+ * @param {object} b - The second object to compare.
2161
+ * @param {string[]} [keysToCompare] - The keys to compare. If not provided, performs a shallow comparison using absoluteCompare.
2162
+ * @param {number} [maxDepth=1] - The maximum depth to compare if the variables are objects.
2163
+ * @returns {boolean} True if all specified properties are equal, false otherwise.
2164
+ */
2165
+ }, {
2166
+ key: "selectiveCompare",
2167
+ value: function selectiveCompare(a, b, keysToCompare) {
2168
+ var maxDepth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
2169
+ if (a === b) return true;
2170
+ if (!a || !b || _typeof(a) !== 'object' || _typeof(b) !== 'object') return false;
2171
+ if (!keysToCompare) return this.absoluteCompare(a, b, 1); // If no keys are provided, the comparison is limited to one depth level.
2172
+ var _iterator2 = _createForOfIteratorHelper$g(keysToCompare),
2173
+ _step2;
2174
+ try {
2175
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
2176
+ var key = _step2.value;
2177
+ var aValue = this.getNestedValue(a, key);
2178
+ var bValue = this.getNestedValue(b, key);
2179
+ var isObject = _typeof(aValue) === 'object' && aValue !== null && _typeof(bValue) === 'object' && bValue !== null;
2180
+
2181
+ // If the current key is an object, they are compared in one further level only.
2182
+ if (isObject && !this.absoluteCompare(aValue, bValue, maxDepth)) return false;
2183
+ if (!isObject && aValue !== bValue) return false;
2184
+ }
2185
+ } catch (err) {
2186
+ _iterator2.e(err);
2187
+ } finally {
2188
+ _iterator2.f();
2189
+ }
2190
+ return true;
2191
+ }
2071
2192
  }]);
2072
2193
  }();
2073
2194
 
@@ -2986,6 +3107,7 @@ var locales = {
2986
3107
  emptySelectionMessage: 'No selected item',
2987
3108
  endsWith: 'Ends with',
2988
3109
  equals: 'Equals',
3110
+ fileChosenMessage: '{0} files',
2989
3111
  fileSizeTypes: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
2990
3112
  filter: 'Filter',
2991
3113
  firstDayOfWeek: 0,
@@ -3004,6 +3126,7 @@ var locales = {
3004
3126
  nextMonth: 'Next Month',
3005
3127
  nextSecond: 'Next Second',
3006
3128
  nextYear: 'Next Year',
3129
+ noFileChosenMessage: 'No file chosen',
3007
3130
  noFilter: 'No Filter',
3008
3131
  notContains: 'Not contains',
3009
3132
  notEquals: 'Not equals',
@@ -3031,8 +3154,10 @@ var locales = {
3031
3154
  aria: {
3032
3155
  cancelEdit: 'Cancel Edit',
3033
3156
  close: 'Close',
3157
+ collapseLabel: 'Collapse',
3034
3158
  collapseRow: 'Row Collapsed',
3035
3159
  editRow: 'Edit Row',
3160
+ expandLabel: 'Expand',
3036
3161
  expandRow: 'Row Expanded',
3037
3162
  falseLabel: 'False',
3038
3163
  filterConstraint: 'Filter Constraint',
@@ -3057,18 +3182,20 @@ var locales = {
3057
3182
  next: 'Next',
3058
3183
  nextPageLabel: 'Next Page',
3059
3184
  nullLabel: 'Not Selected',
3060
- pageLabel: 'Page {page}',
3061
3185
  otpLabel: 'Please enter one time password character {0}',
3186
+ pageLabel: 'Page {page}',
3062
3187
  passwordHide: 'Hide Password',
3063
3188
  passwordShow: 'Show Password',
3064
3189
  previous: 'Previous',
3065
3190
  prevPageLabel: 'Previous Page',
3191
+ removeLabel: 'Remove',
3066
3192
  rotateLeft: 'Rotate Left',
3067
3193
  rotateRight: 'Rotate Right',
3068
3194
  rowsPerPageLabel: 'Rows per page',
3069
3195
  saveEdit: 'Save Edit',
3070
3196
  scrollTop: 'Scroll Top',
3071
3197
  selectAll: 'All items selected',
3198
+ selectLabel: 'Select',
3072
3199
  selectRow: 'Row Selected',
3073
3200
  showFilterMenu: 'Show Filter Menu',
3074
3201
  slide: 'Slide',
@@ -3077,6 +3204,7 @@ var locales = {
3077
3204
  stars: '{star} stars',
3078
3205
  trueLabel: 'True',
3079
3206
  unselectAll: 'All items unselected',
3207
+ unselectLabel: 'Unselect',
3080
3208
  unselectRow: 'Row Unselected',
3081
3209
  zoomImage: 'Zoom Image',
3082
3210
  zoomIn: 'Zoom In',
@@ -4394,7 +4522,14 @@ var useOverlayScrollListener = function useOverlayScrollListener(_ref) {
4394
4522
  }
4395
4523
  if (!listenerRef.current && targetRef.current) {
4396
4524
  var hideOnScroll = context ? context.hideOverlaysOnDocumentScrolling : PrimeReact.hideOverlaysOnDocumentScrolling;
4397
- var nodes = scrollableParentsRef.current = DomHandler.getScrollableParents(targetRef.current, hideOnScroll);
4525
+ var nodes = scrollableParentsRef.current = DomHandler.getScrollableParents(targetRef.current);
4526
+
4527
+ // Ensure window/body is always included as fallback
4528
+ if (!nodes.some(function (node) {
4529
+ return node === document.body || node === window;
4530
+ })) {
4531
+ nodes.push(hideOnScroll ? window : document.body);
4532
+ }
4398
4533
  listenerRef.current = function (event) {
4399
4534
  return listener && listener(event);
4400
4535
  };
@@ -4486,19 +4621,20 @@ var useOverlayListener = function useOverlayListener(_ref) {
4486
4621
  type: 'outside',
4487
4622
  valid: event.which !== 3 && isOutsideClicked(event)
4488
4623
  });
4489
- }
4624
+ },
4625
+ when: when
4490
4626
  }),
4491
4627
  _useEventListener2 = _slicedToArray(_useEventListener, 2),
4492
4628
  bindDocumentClickListener = _useEventListener2[0],
4493
4629
  unbindDocumentClickListener = _useEventListener2[1];
4494
4630
  var _useResizeListener = useResizeListener({
4495
- target: 'window',
4496
4631
  listener: function listener(event) {
4497
4632
  _listener && _listener(event, {
4498
4633
  type: 'resize',
4499
4634
  valid: !DomHandler.isTouchDevice()
4500
4635
  });
4501
- }
4636
+ },
4637
+ when: when
4502
4638
  }),
4503
4639
  _useResizeListener2 = _slicedToArray(_useResizeListener, 2),
4504
4640
  bindWindowResizeListener = _useResizeListener2[0],
@@ -4511,7 +4647,8 @@ var useOverlayListener = function useOverlayListener(_ref) {
4511
4647
  type: 'orientationchange',
4512
4648
  valid: true
4513
4649
  });
4514
- }
4650
+ },
4651
+ when: when
4515
4652
  }),
4516
4653
  _useEventListener4 = _slicedToArray(_useEventListener3, 2),
4517
4654
  bindWindowOrientationChangeListener = _useEventListener4[0],
@@ -4523,7 +4660,8 @@ var useOverlayListener = function useOverlayListener(_ref) {
4523
4660
  type: 'scroll',
4524
4661
  valid: true
4525
4662
  });
4526
- }
4663
+ },
4664
+ when: when
4527
4665
  }),
4528
4666
  _useOverlayScrollList2 = _slicedToArray(_useOverlayScrollList, 2),
4529
4667
  bindOverlayScrollListener = _useOverlayScrollList2[0],
@@ -8138,7 +8276,15 @@ var AutoComplete = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namesp
8138
8276
  var type = _ref.type,
8139
8277
  valid = _ref.valid;
8140
8278
  if (valid) {
8141
- type === 'outside' ? !isInputClicked(event) && hide() : hide();
8279
+ if (type === 'outside') {
8280
+ if (!isInputClicked(event)) {
8281
+ hide();
8282
+ }
8283
+ } else if (context.hideOverlaysOnDocumentScrolling) {
8284
+ hide();
8285
+ } else if (!DomHandler.isDocument(event.target)) {
8286
+ alignOverlay();
8287
+ }
8142
8288
  }
8143
8289
  },
8144
8290
  when: overlayVisibleState
@@ -8314,6 +8460,9 @@ var AutoComplete = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namesp
8314
8460
  }
8315
8461
  };
8316
8462
  var removeItem = function removeItem(event, index) {
8463
+ if (props.disabled || props.readOnly) {
8464
+ return;
8465
+ }
8317
8466
  var removedValue = props.value[index];
8318
8467
  var newValue = props.value.filter(function (_, i) {
8319
8468
  return index !== i;
@@ -8756,6 +8905,7 @@ var AutoComplete = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namesp
8756
8905
  listId: listId,
8757
8906
  onItemClick: selectItem,
8758
8907
  selectedItem: selectedItem,
8908
+ onOverlayHide: hide,
8759
8909
  onClick: onPanelClick,
8760
8910
  getOptionGroupLabel: getOptionGroupLabel,
8761
8911
  getOptionGroupChildren: getOptionGroupChildren,
@@ -9277,7 +9427,8 @@ var BreadCrumb = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
9277
9427
  onClick: function onClick(event) {
9278
9428
  return itemClick(event, item);
9279
9429
  },
9280
- 'aria-disabled': item.disabled
9430
+ 'aria-disabled': item.disabled,
9431
+ tabIndex: item.disabled ? -1 : undefined
9281
9432
  }, ptm('action'));
9282
9433
  var content = /*#__PURE__*/React__namespace.createElement("a", actionProps, label);
9283
9434
  if (item.template) {
@@ -9682,7 +9833,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
9682
9833
  isUnstyled = _CalendarBase$setMeta.isUnstyled;
9683
9834
  useGlobalOnEscapeKey({
9684
9835
  callback: function callback() {
9685
- hide();
9836
+ hide(null, reFocusInputField);
9686
9837
  },
9687
9838
  when: overlayVisibleState && overlayDisplayOrder,
9688
9839
  priority: [ESC_KEY_HANDLING_PRIORITIES.OVERLAY_PANEL, overlayDisplayOrder]
@@ -9733,7 +9884,15 @@ var Calendar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
9733
9884
  var type = _ref.type,
9734
9885
  valid = _ref.valid;
9735
9886
  if (valid) {
9736
- type === 'outside' ? !isOverlayClicked.current && !isNavIconClicked(event.target) && hide('outside') : hide();
9887
+ if (type === 'outside') {
9888
+ if (!isOverlayClicked.current && !isNavIconClicked(event.target)) {
9889
+ hide('outside');
9890
+ }
9891
+ } else if (context.hideOverlaysOnDocumentScrolling) {
9892
+ hide();
9893
+ } else if (!DomHandler.isDocument(event.target)) {
9894
+ alignOverlay();
9895
+ }
9737
9896
  }
9738
9897
  isOverlayClicked.current = false;
9739
9898
  },
@@ -12025,13 +12184,32 @@ var Calendar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
12025
12184
  return props.parseDateTime(text);
12026
12185
  }
12027
12186
  var date;
12028
- var parts = text.split(' ');
12029
12187
  if (props.timeOnly) {
12030
12188
  date = new Date();
12031
- populateTime(date, parts[0], parts[1]);
12189
+ var match = text.match(/(\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,3})?)\s?(AM|PM)?/i);
12190
+ if (match) {
12191
+ populateTime(date, match[1], match[2]);
12192
+ } else {
12193
+ return null;
12194
+ }
12032
12195
  } else if (props.showTime) {
12033
- date = parseDate(parts[0], getDateFormat());
12034
- populateTime(date, parts[1], parts[2]);
12196
+ var time12 = /(\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,3})?)\s?(AM|PM)/i;
12197
+ var time24 = /(\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,3})?)$/;
12198
+ var _match, datePart, timePart, ampm;
12199
+ if (props.hourFormat === '12' && (_match = text.match(time12))) {
12200
+ timePart = _match[1];
12201
+ ampm = _match[2];
12202
+ datePart = text.replace(time12, '').trim();
12203
+ } else if (props.hourFormat === '24' && (_match = text.match(time24))) {
12204
+ timePart = _match[1];
12205
+ datePart = text.replace(time24, '').trim();
12206
+ }
12207
+ if (datePart && timePart) {
12208
+ date = parseDate(datePart, getDateFormat());
12209
+ populateTime(date, timePart, ampm);
12210
+ } else {
12211
+ date = parseDate(text, getDateFormat());
12212
+ }
12035
12213
  } else {
12036
12214
  date = parseDate(text, getDateFormat());
12037
12215
  }
@@ -12420,7 +12598,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
12420
12598
  viewDate.setHours(0, 0, 0);
12421
12599
  isClearClicked.current = false;
12422
12600
  }
12423
- if (!prevPropValue && propValue || propValue && propValue instanceof Date && propValue.getTime() !== prevPropValue.getTime()) {
12601
+ if (!prevPropValue && propValue || propValue && propValue instanceof Date && prevPropValue instanceof Date && propValue.getTime() !== prevPropValue.getTime()) {
12424
12602
  validateDate(viewDate);
12425
12603
  }
12426
12604
  setViewDateState(viewDate);
@@ -12674,6 +12852,9 @@ var Calendar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
12674
12852
  }),
12675
12853
  'aria-selected': selected,
12676
12854
  'aria-disabled': !date.selectable,
12855
+ onMouseDown: function onMouseDown(e) {
12856
+ return e.preventDefault();
12857
+ },
12677
12858
  onClick: function onClick(e) {
12678
12859
  return onDateSelect(e, date);
12679
12860
  },
@@ -14192,6 +14373,22 @@ var Carousel = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
14192
14373
  CarouselItem.displayName = 'CarouselItem';
14193
14374
  Carousel.displayName = 'Carousel';
14194
14375
 
14376
+ var TimesIcon = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
14377
+ var pti = IconBase.getPTI(inProps);
14378
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
14379
+ ref: ref,
14380
+ width: "14",
14381
+ height: "14",
14382
+ viewBox: "0 0 14 14",
14383
+ fill: "none",
14384
+ xmlns: "http://www.w3.org/2000/svg"
14385
+ }, pti), /*#__PURE__*/React__namespace.createElement("path", {
14386
+ d: "M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",
14387
+ fill: "currentColor"
14388
+ }));
14389
+ }));
14390
+ TimesIcon.displayName = 'TimesIcon';
14391
+
14195
14392
  var classes$14 = {
14196
14393
  root: function root(_ref) {
14197
14394
  var props = _ref.props,
@@ -14228,6 +14425,7 @@ var classes$14 = {
14228
14425
  });
14229
14426
  },
14230
14427
  dropdownIcon: 'p-cascadeselect-trigger-icon',
14428
+ clearIcon: 'p-cascadeselect-clear-icon p-clickable',
14231
14429
  loadingIcon: 'p-cascadeselect-trigger-icon',
14232
14430
  dropdownButton: 'p-cascadeselect-trigger',
14233
14431
  loadingButton: 'p-cascadeselect-trigger',
@@ -14238,7 +14436,7 @@ var classes$14 = {
14238
14436
  text: 'p-cascadeselect-item-text',
14239
14437
  transition: 'p-connected-overlay'
14240
14438
  };
14241
- var styles$U = "\n@layer primereact {\n .p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n }\n \n .p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n \n .p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n \n .p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n }\n \n .p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n }\n \n .p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n }\n \n .p-cascadeselect-item-content {\n display: flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-cascadeselect-group-icon {\n margin-left: auto;\n }\n \n .p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n }\n \n .p-fluid .p-cascadeselect {\n display: flex;\n }\n \n .p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n }\n \n .p-cascadeselect-sublist-wrapper {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n }\n \n .p-cascadeselect-item-active {\n overflow: visible;\n }\n \n .p-cascadeselect-item-active > .p-cascadeselect-sublist-wrapper {\n display: block;\n left: 100%;\n top: 0;\n }\n}\n";
14439
+ var styles$U = "\n@layer primereact {\n .p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n }\n \n .p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n \n .p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n \n .p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n }\n \n .p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n }\n \n .p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n }\n \n .p-cascadeselect-item-content {\n display: flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-cascadeselect-group-icon {\n margin-left: auto;\n }\n \n .p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n }\n \n .p-fluid .p-cascadeselect {\n display: flex;\n }\n \n .p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n }\n \n .p-cascadeselect-sublist-wrapper {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n }\n \n .p-cascadeselect-item-active {\n overflow: visible;\n }\n \n .p-cascadeselect-item-active > .p-cascadeselect-sublist-wrapper {\n display: block;\n left: 100%;\n top: 0;\n }\n .p-cascadeselect-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n right: 3rem;\n }\n}\n";
14242
14440
  var CascadeSelectBase = ComponentBase.extend({
14243
14441
  defaultProps: {
14244
14442
  __TYPE: 'CascadeSelect',
@@ -14271,6 +14469,8 @@ var CascadeSelectBase = ComponentBase.extend({
14271
14469
  optionLabel: null,
14272
14470
  optionValue: null,
14273
14471
  options: null,
14472
+ panelClassName: null,
14473
+ panelStyle: null,
14274
14474
  placeholder: null,
14275
14475
  scrollHeight: '400px',
14276
14476
  style: null,
@@ -14583,12 +14783,20 @@ var CascadeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__names
14583
14783
  var styleElementRef = React__namespace.useRef(null);
14584
14784
  var dirty = React__namespace.useRef(false);
14585
14785
  var selectionPath = React__namespace.useRef(null);
14786
+ var selfChange = React__namespace.useRef(null);
14586
14787
  var _useOverlayListener = useOverlayListener({
14587
14788
  target: elementRef,
14588
14789
  overlay: overlayRef,
14589
14790
  listener: function listener(event, _ref) {
14590
- var valid = _ref.valid;
14591
- valid && hide();
14791
+ var valid = _ref.valid,
14792
+ type = _ref.type;
14793
+ if (valid) {
14794
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
14795
+ hide();
14796
+ } else if (!DomHandler.isDocument(event.target)) {
14797
+ alignOverlay();
14798
+ }
14799
+ }
14592
14800
  },
14593
14801
  when: overlayVisibleState
14594
14802
  }),
@@ -14605,6 +14813,7 @@ var CascadeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__names
14605
14813
  });
14606
14814
  var onOptionSelect = function onOptionSelect(event) {
14607
14815
  if (props.onChange) {
14816
+ selfChange.current = true;
14608
14817
  props.onChange({
14609
14818
  originalEvent: event,
14610
14819
  value: event.value
@@ -14831,6 +15040,48 @@ var CascadeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__names
14831
15040
  }, ariaProps), ptm('input'));
14832
15041
  return /*#__PURE__*/React__namespace.createElement("div", hiddenSelectedMessageProps, /*#__PURE__*/React__namespace.createElement("input", inputProps));
14833
15042
  };
15043
+ var clear = function clear(event) {
15044
+ if (props.onChange) {
15045
+ selfChange.current = true;
15046
+ props.onChange({
15047
+ originalEvent: event,
15048
+ value: undefined,
15049
+ stopPropagation: function stopPropagation() {
15050
+ event === null || event === void 0 || event.stopPropagation();
15051
+ },
15052
+ preventDefault: function preventDefault() {
15053
+ event === null || event === void 0 || event.preventDefault();
15054
+ },
15055
+ target: {
15056
+ name: props.name,
15057
+ id: props.id,
15058
+ value: undefined
15059
+ }
15060
+ });
15061
+ }
15062
+ };
15063
+ var onClearIconKeyDown = function onClearIconKeyDown(event) {
15064
+ if (event.key === 'Enter' || event.code === 'Space') {
15065
+ clear(event);
15066
+ event.preventDefault();
15067
+ }
15068
+ };
15069
+ var createClearIcon = function createClearIcon() {
15070
+ if (props.value != null && props.showClear && !props.disabled) {
15071
+ var clearIconProps = mergeProps({
15072
+ className: cx('clearIcon'),
15073
+ onPointerUp: clear,
15074
+ tabIndex: props.tabIndex || '0',
15075
+ onKeyDown: onClearIconKeyDown,
15076
+ 'aria-label': localeOption('clear')
15077
+ }, ptm('clearIcon'));
15078
+ var icon = props.clearIcon || /*#__PURE__*/React__namespace.createElement(TimesIcon, clearIconProps);
15079
+ return IconUtils.getJSXIcon(icon, _objectSpread$1H({}, clearIconProps), {
15080
+ props: props
15081
+ });
15082
+ }
15083
+ return null;
15084
+ };
14834
15085
  var createLabel = function createLabel() {
14835
15086
  var label = props.value ? getOptionLabel(props.value) : props.placeholder || 'p-emptylabel';
14836
15087
  var labelProps = mergeProps({
@@ -14884,7 +15135,8 @@ var CascadeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__names
14884
15135
  }, ptm('wrapper'));
14885
15136
  var panelProps = mergeProps({
14886
15137
  ref: overlayRef,
14887
- className: cx('panel'),
15138
+ className: classNames(props.panelClassName, cx('panel')),
15139
+ style: props.panelStyle,
14888
15140
  onClick: function onClick(e) {
14889
15141
  return onPanelClick(e);
14890
15142
  }
@@ -14933,6 +15185,7 @@ var CascadeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__names
14933
15185
  var createElement = function createElement() {
14934
15186
  var keyboardHelper = createKeyboardHelper();
14935
15187
  var labelElement = createLabel();
15188
+ var clearIcon = createClearIcon();
14936
15189
  var dropdownIcon = props.loading ? createLoadingIcon() : createDropdownIcon();
14937
15190
  var overlay = createOverlay();
14938
15191
  var rootProps = mergeProps({
@@ -14948,7 +15201,7 @@ var CascadeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__names
14948
15201
  return _onClick(e);
14949
15202
  }
14950
15203
  }, otherProps, ptm('root'));
14951
- return /*#__PURE__*/React__namespace.createElement("div", rootProps, keyboardHelper, labelElement, dropdownIcon, overlay);
15204
+ return /*#__PURE__*/React__namespace.createElement("div", rootProps, keyboardHelper, labelElement, clearIcon, dropdownIcon, overlay);
14952
15205
  };
14953
15206
  var otherProps = CascadeSelectBase.getOtherProps(props);
14954
15207
  ObjectUtils.reduceKeys(otherProps, DomHandler.DATA_PROPS);
@@ -15199,7 +15452,7 @@ var Checkbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
15199
15452
  return props.checked === props.trueValue;
15200
15453
  };
15201
15454
  var _onChange = function onChange(event) {
15202
- if (props.disabled || props.readonly) {
15455
+ if (props.disabled || props.readOnly) {
15203
15456
  return;
15204
15457
  }
15205
15458
  if (props.onChange) {
@@ -15383,6 +15636,10 @@ var Chip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
15383
15636
  _React$useState2 = _slicedToArray(_React$useState, 2),
15384
15637
  visibleState = _React$useState2[0],
15385
15638
  setVisibleState = _React$useState2[1];
15639
+ var _React$useState3 = React__namespace.useState(props.id),
15640
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
15641
+ idState = _React$useState4[0],
15642
+ setIdState = _React$useState4[1];
15386
15643
  var _ChipBase$setMetaData = ChipBase.setMetaData({
15387
15644
  props: props
15388
15645
  }),
@@ -15400,6 +15657,7 @@ var Chip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
15400
15657
  var close = function close(event) {
15401
15658
  var result = true;
15402
15659
  if (props.onRemove) {
15660
+ event.stopPropagation();
15403
15661
  result = props.onRemove({
15404
15662
  originalEvent: event,
15405
15663
  value: props.label || props.image || props.icon
@@ -15419,7 +15677,7 @@ var Chip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
15419
15677
  onKeyDown: onKeyDown
15420
15678
  }, ptm('removeIcon'));
15421
15679
  var icon = props.removeIcon || /*#__PURE__*/React__namespace.createElement(TimesCircleIcon, _extends({}, removeIconProps, {
15422
- key: UniqueComponentId('removeIcon')
15680
+ key: "".concat(idState, "-removeIcon")
15423
15681
  }));
15424
15682
  if (props.image) {
15425
15683
  var imageProps = mergeProps({
@@ -15429,7 +15687,7 @@ var Chip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
15429
15687
  content.push(/*#__PURE__*/React__namespace.createElement("img", _extends({
15430
15688
  alt: props.imageAlt
15431
15689
  }, imageProps, {
15432
- key: UniqueComponentId('image')
15690
+ key: "".concat(idState, "-image")
15433
15691
  })));
15434
15692
  } else if (props.icon) {
15435
15693
  var chipIconProps = mergeProps({
@@ -15480,6 +15738,14 @@ var Chip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
15480
15738
  }
15481
15739
  };
15482
15740
  });
15741
+ useMountEffect(function () {
15742
+ if (!idState) {
15743
+ setIdState(UniqueComponentId());
15744
+ }
15745
+ });
15746
+ if (!idState) {
15747
+ return null;
15748
+ }
15483
15749
  return visibleState && createElement();
15484
15750
  }));
15485
15751
  Chip.displayName = 'Chip';
@@ -15588,7 +15854,7 @@ var Chips = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.for
15588
15854
  var listRef = React__namespace.useRef(null);
15589
15855
  var inputRef = React__namespace.useRef(props.inputRef);
15590
15856
  var removeItem = function removeItem(event, index) {
15591
- if (props.disabled && props.readOnly) {
15857
+ if (props.disabled || props.readOnly) {
15592
15858
  return;
15593
15859
  }
15594
15860
  var values = _toConsumableArray(props.value);
@@ -16121,8 +16387,15 @@ var ColorPicker = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
16121
16387
  target: elementRef,
16122
16388
  overlay: overlayRef,
16123
16389
  listener: function listener(event, _ref) {
16124
- var valid = _ref.valid;
16125
- valid && hide();
16390
+ var valid = _ref.valid,
16391
+ type = _ref.type;
16392
+ if (valid) {
16393
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
16394
+ hide();
16395
+ } else if (!DomHandler.isDocument(event.target)) {
16396
+ alignOverlay();
16397
+ }
16398
+ }
16126
16399
  },
16127
16400
  when: overlayVisibleState
16128
16401
  }),
@@ -16777,22 +17050,6 @@ var FocusTrap = /*#__PURE__*/React__default["default"].memo(/*#__PURE__*/React__
16777
17050
  }));
16778
17051
  var FocusTrap$1 = FocusTrap;
16779
17052
 
16780
- var TimesIcon = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
16781
- var pti = IconBase.getPTI(inProps);
16782
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
16783
- ref: ref,
16784
- width: "14",
16785
- height: "14",
16786
- viewBox: "0 0 14 14",
16787
- fill: "none",
16788
- xmlns: "http://www.w3.org/2000/svg"
16789
- }, pti), /*#__PURE__*/React__namespace.createElement("path", {
16790
- d: "M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",
16791
- fill: "currentColor"
16792
- }));
16793
- }));
16794
- TimesIcon.displayName = 'TimesIcon';
16795
-
16796
17053
  var WindowMaximizeIcon = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
16797
17054
  var pti = IconBase.getPTI(inProps);
16798
17055
  return /*#__PURE__*/React__namespace.createElement("svg", _extends({
@@ -16946,6 +17203,7 @@ var DialogBase = ComponentBase.extend({
16946
17203
  resizable: true,
16947
17204
  rtl: false,
16948
17205
  showHeader: true,
17206
+ showCloseIcon: true,
16949
17207
  style: null,
16950
17208
  transitionOptions: null,
16951
17209
  visible: false,
@@ -17077,7 +17335,7 @@ var Dialog = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
17077
17335
  var focus = function focus() {
17078
17336
  var activeElement = document.activeElement;
17079
17337
  var isActiveElementInDialog = activeElement && dialogRef.current && dialogRef.current.contains(activeElement);
17080
- if (!isActiveElementInDialog && props.closable && props.showHeader && closeRef.current) {
17338
+ if (!isActiveElementInDialog && props.closable && props.showCloseIcon && props.showHeader && closeRef.current) {
17081
17339
  closeRef.current.focus();
17082
17340
  }
17083
17341
  };
@@ -17383,7 +17641,7 @@ var Dialog = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
17383
17641
  };
17384
17642
  });
17385
17643
  var createCloseIcon = function createCloseIcon() {
17386
- if (props.closable) {
17644
+ if (props.closable && props.showCloseIcon) {
17387
17645
  var labelAria = props.ariaCloseIconLabel || ariaLabel('close');
17388
17646
  var closeButtonIconProps = mergeProps({
17389
17647
  className: cx('closeButtonIcon'),
@@ -17995,9 +18253,17 @@ var ConfirmPopup = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namesp
17995
18253
  var type = _ref.type,
17996
18254
  valid = _ref.valid;
17997
18255
  if (valid) {
17998
- type === 'outside' ? props.dismissable && !isPanelClicked.current && hide('hide') : hide('hide');
18256
+ if (type === 'outside') {
18257
+ if (props.dismissable && !isPanelClicked.current) {
18258
+ hide('hide');
18259
+ }
18260
+ isPanelClicked.current = false;
18261
+ } else if (context.hideOverlaysOnDocumentScrolling) {
18262
+ hide('hide');
18263
+ } else if (!DomHandler.isDocument(event.target)) {
18264
+ align();
18265
+ }
17999
18266
  }
18000
- isPanelClicked.current = false;
18001
18267
  },
18002
18268
  when: visibleState
18003
18269
  }),
@@ -20193,7 +20459,7 @@ var InputNumber = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
20193
20459
  var stacked = props.showButtons && props.buttonLayout === 'stacked';
20194
20460
  var horizontal = props.showButtons && props.buttonLayout === 'horizontal';
20195
20461
  var vertical = props.showButtons && props.buttonLayout === 'vertical';
20196
- var inputMode = props.inputMode || (props.mode === 'decimal' && !props.minFractionDigits ? 'numeric' : 'decimal');
20462
+ var inputMode = props.inputMode || (props.mode === 'decimal' && !props.minFractionDigits && !props.maxFractionDigits ? 'numeric' : 'decimal');
20197
20463
  var getOptions = function getOptions() {
20198
20464
  var _props$minFractionDig, _props$maxFractionDig;
20199
20465
  return {
@@ -20628,6 +20894,10 @@ var InputNumber = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
20628
20894
  event.preventDefault();
20629
20895
  var _char2 = event.key;
20630
20896
  if (_char2) {
20897
+ // get decimal separator in current locale
20898
+ if (_char2 === '.') {
20899
+ _char2 = _decimalSeparator.current;
20900
+ }
20631
20901
  var _isDecimalSign = isDecimalSign(_char2);
20632
20902
  var _isMinusSign = isMinusSign(_char2);
20633
20903
  if (Number(_char2) >= 0 && Number(_char2) <= 9 || _isMinusSign || _isDecimalSign) {
@@ -20742,6 +21012,7 @@ var InputNumber = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
20742
21012
  suffixCharIndex = _getCharIndexes2.suffixCharIndex,
20743
21013
  currencyCharIndex = _getCharIndexes2.currencyCharIndex;
20744
21014
  var maxFractionDigits = numberFormat.current.resolvedOptions().maximumFractionDigits;
21015
+ var hasBoundOrAffix = props.min || props.max || props.suffix || props.prefix; //only exception
20745
21016
  var newValueStr;
20746
21017
  if (sign.isMinusSign) {
20747
21018
  var isNewMinusSign = minusCharIndex === -1;
@@ -20761,8 +21032,11 @@ var InputNumber = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
20761
21032
  newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
20762
21033
  updateValue(event, newValueStr, text, 'insert');
20763
21034
  } else if (decimalCharIndex === -1 && (maxFractionDigits || props.maxFractionDigits)) {
20764
- newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
20765
- updateValue(event, newValueStr, text, 'insert');
21035
+ var allowedDecimal = inputMode !== 'numeric' || inputMode === 'numeric' && hasBoundOrAffix;
21036
+ if (allowedDecimal) {
21037
+ newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
21038
+ updateValue(event, newValueStr, text, 'insert');
21039
+ }
20766
21040
  }
20767
21041
  } else {
20768
21042
  var operation = selectionStart !== selectionEnd ? 'range-insert' : 'insert';
@@ -21725,6 +21999,7 @@ var DropdownBase = ComponentBase.extend({
21725
21999
  name: null,
21726
22000
  onBlur: null,
21727
22001
  onChange: null,
22002
+ onClick: null,
21728
22003
  onContextMenu: null,
21729
22004
  onFilter: null,
21730
22005
  onFocus: null,
@@ -22233,7 +22508,15 @@ var Dropdown = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
22233
22508
  var type = _ref.type,
22234
22509
  valid = _ref.valid;
22235
22510
  if (valid) {
22236
- type === 'outside' ? !isClearClicked(event) && hide() : hide();
22511
+ if (type === 'outside') {
22512
+ if (!isClearClicked(event)) {
22513
+ hide();
22514
+ }
22515
+ } else if (context.hideOverlaysOnDocumentScrolling) {
22516
+ hide();
22517
+ } else if (!DomHandler.isDocument(event.target)) {
22518
+ alignOverlay();
22519
+ }
22237
22520
  }
22238
22521
  },
22239
22522
  when: overlayVisibleState
@@ -22432,12 +22715,14 @@ var Dropdown = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
22432
22715
  case 'ArrowRight':
22433
22716
  onArrowLeftKey(event, true);
22434
22717
  break;
22435
- case 'Escape':
22436
22718
  case 'Enter':
22437
22719
  case 'NumpadEnter':
22438
22720
  onEnterKey(event);
22439
22721
  event.preventDefault();
22440
22722
  break;
22723
+ case 'Escape':
22724
+ onEscapeKey(event);
22725
+ break;
22441
22726
  }
22442
22727
  };
22443
22728
  var hasFocusableElements = function hasFocusableElements() {
@@ -22604,15 +22889,24 @@ var Dropdown = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
22604
22889
  !pressedInInputText && onEnterKey(event);
22605
22890
  };
22606
22891
  var onEnterKey = function onEnterKey(event) {
22892
+ event.preventDefault();
22607
22893
  if (!overlayVisibleState) {
22608
22894
  setFocusedOptionIndex(-1);
22609
22895
  onArrowDownKey(event);
22610
22896
  } else {
22611
- if (focusedOptionIndex !== -1) {
22612
- onOptionSelect(event, visibleOptions[focusedOptionIndex]);
22897
+ if (focusedOptionIndex === -1) {
22898
+ return;
22899
+ }
22900
+ var focusedOption = visibleOptions[focusedOptionIndex];
22901
+ var optionValue = getOptionValue(focusedOption);
22902
+ if (optionValue == null || optionValue == undefined) {
22903
+ hide();
22904
+ resetFilter();
22905
+ updateEditableLabel(selectedOption);
22906
+ return;
22613
22907
  }
22908
+ onOptionSelect(event, focusedOption);
22614
22909
  }
22615
- event.preventDefault();
22616
22910
  };
22617
22911
  var onEscapeKey = function onEscapeKey(event) {
22618
22912
  overlayVisibleState && hide();
@@ -23179,6 +23473,7 @@ var Dropdown = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
23179
23473
  "in": overlayVisibleState,
23180
23474
  isOptionDisabled: isOptionDisabled,
23181
23475
  isSelected: isSelected,
23476
+ onOverlayHide: hide,
23182
23477
  onClick: onPanelClick,
23183
23478
  onEnter: onOverlayEnter,
23184
23479
  onEntered: onOverlayEntered,
@@ -24058,7 +24353,7 @@ var RadioButton = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
24058
24353
  onChange(event);
24059
24354
  };
24060
24355
  var onChange = function onChange(event) {
24061
- if (props.disabled || props.readonly) {
24356
+ if (props.disabled || props.readOnly) {
24062
24357
  return;
24063
24358
  }
24064
24359
  if (props.onChange) {
@@ -24161,7 +24456,7 @@ var RadioButton = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
24161
24456
  onBlur: onBlur,
24162
24457
  onChange: onChange,
24163
24458
  disabled: props.disabled,
24164
- readOnly: props.readonly,
24459
+ readOnly: props.readOnly,
24165
24460
  required: props.required,
24166
24461
  tabIndex: props.tabIndex,
24167
24462
  className: cx('input')
@@ -24234,7 +24529,7 @@ RowRadioButton.displayName = 'RowRadioButton';
24234
24529
 
24235
24530
  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
24531
  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) {
24532
+ var Cell = function Cell(props) {
24238
24533
  var mergeProps = useMergeProps();
24239
24534
  var _React$useState = React__namespace.useState(props.editing),
24240
24535
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -24262,13 +24557,9 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24262
24557
  var getColumnProp = function getColumnProp(name) {
24263
24558
  return ColumnBase.getCProp(props.column, name);
24264
24559
  };
24265
- var getColumnProps = function getColumnProps() {
24266
- return ColumnBase.getCProps(props.column);
24267
- };
24268
24560
  var getColumnPTOptions = function getColumnPTOptions(key) {
24269
- var cProps = getColumnProps();
24270
24561
  var columnMetaData = {
24271
- props: cProps,
24562
+ props: props.cProps,
24272
24563
  parent: props.metaData,
24273
24564
  hostName: props.hostName,
24274
24565
  state: {
@@ -24284,10 +24575,8 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24284
24575
  };
24285
24576
  return mergeProps(ptm("column.".concat(key), {
24286
24577
  column: columnMetaData
24287
- }), ptm("column.".concat(key), columnMetaData), ptmo(cProps, key, columnMetaData));
24578
+ }), ptm("column.".concat(key), columnMetaData), ptmo(props.cProps, key, columnMetaData));
24288
24579
  };
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
24580
  var isEditable = function isEditable() {
24292
24581
  return ObjectUtils.isNotEmpty(props.editMode) && getColumnProp('editor');
24293
24582
  };
@@ -24312,34 +24601,22 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24312
24601
  _useEventListener2 = _slicedToArray(_useEventListener, 2),
24313
24602
  bindDocumentClickListener = _useEventListener2[0],
24314
24603
  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
24604
  var isOutsideClicked = function isOutsideClicked(target) {
24325
24605
  return elementRef.current && !(elementRef.current.isSameNode(target) || elementRef.current.contains(target));
24326
24606
  };
24327
- var getVirtualScrollerOption = function getVirtualScrollerOption(option) {
24328
- return props.virtualScrollerOptions ? props.virtualScrollerOptions[option] : null;
24329
- };
24330
24607
  var getStyle = function getStyle() {
24331
24608
  var bodyStyle = getColumnProp('bodyStyle');
24332
24609
  var columnStyle = getColumnProp('style');
24333
- return getColumnProp('frozen') ? Object.assign({}, columnStyle, bodyStyle, styleObjectState) : Object.assign({}, columnStyle, bodyStyle);
24610
+ return props.frozenCol ? Object.assign({}, columnStyle, bodyStyle, styleObjectState) : Object.assign({}, columnStyle, bodyStyle);
24334
24611
  };
24335
24612
  var getCellParams = function getCellParams() {
24336
24613
  return {
24337
- value: resolveFieldData(),
24338
- field: field,
24614
+ value: props.resolveFieldData(),
24615
+ field: props.field,
24339
24616
  rowData: props.rowData,
24340
24617
  rowIndex: props.rowIndex,
24341
24618
  cellIndex: props.index,
24342
- selected: isSelected(),
24619
+ selected: props.isCellSelected,
24343
24620
  column: props.column,
24344
24621
  props: props
24345
24622
  };
@@ -24350,20 +24627,6 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24350
24627
  originalEvent: event
24351
24628
  }, params);
24352
24629
  };
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
24630
  var closeCell = function closeCell(event) {
24368
24631
  var params = getCellCallbackParams(event);
24369
24632
  var onBeforeCellEditHide = getColumnProp('onBeforeCellEditHide');
@@ -24384,7 +24647,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24384
24647
  var switchCellToViewMode = function switchCellToViewMode(event, submit) {
24385
24648
  var callbackParams = getCellCallbackParams(event);
24386
24649
  var newRowData = _objectSpread$1i({}, editingRowDataStateRef.current);
24387
- var newValue = resolveFieldData(newRowData);
24650
+ var newValue = props.resolveFieldData(newRowData);
24388
24651
  var params = _objectSpread$1i(_objectSpread$1i({}, callbackParams), {}, {
24389
24652
  newRowData: newRowData,
24390
24653
  newValue: newValue
@@ -24409,128 +24672,20 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24409
24672
  }
24410
24673
  setEditingRowDataState(newRowData);
24411
24674
  };
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
24675
  var editorCallback = function editorCallback(val) {
24477
24676
  var editingRowData = _objectSpread$1i({}, editingRowDataState);
24478
- ObjectUtils.mutateFieldData(editingRowData, field, val);
24677
+ ObjectUtils.mutateFieldData(editingRowData, props.field, val);
24479
24678
  setEditingRowDataState(editingRowData);
24480
24679
 
24481
24680
  // update editing meta for complete methods on row mode
24482
- var currentData = getEditingRowData();
24681
+ var currentData = props.getEditingRowData();
24483
24682
  if (currentData) {
24484
- ObjectUtils.mutateFieldData(currentData, field, val);
24683
+ ObjectUtils.mutateFieldData(currentData, props.field, val);
24485
24684
  }
24486
24685
  editingRowDataStateRef.current = editingRowData;
24487
24686
  };
24488
24687
  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
- }
24688
+ props.onClick(event, getCellCallbackParams(event), isEditable(), editingState, setEditingState, selfClick, props.column, bindDocumentClickListener, overlayEventListener, isOutsideClicked);
24534
24689
  };
24535
24690
  var _onMouseDown = function onMouseDown(event) {
24536
24691
  var params = getCellCallbackParams(event);
@@ -24554,7 +24709,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24554
24709
  cell = event.currentTarget;
24555
24710
  switch (event.code) {
24556
24711
  case 'ArrowLeft':
24557
- var prevCell = _findPrevSelectableCell(cell);
24712
+ var prevCell = props.findPrevSelectableCell(cell);
24558
24713
  if (prevCell) {
24559
24714
  changeTabIndex(cell, prevCell);
24560
24715
  prevCell.focus();
@@ -24562,7 +24717,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24562
24717
  event.preventDefault();
24563
24718
  break;
24564
24719
  case 'ArrowRight':
24565
- var nextCell = _findNextSelectableCell(cell);
24720
+ var nextCell = props.findNextSelectableCell(cell);
24566
24721
  if (nextCell) {
24567
24722
  changeTabIndex(cell, nextCell);
24568
24723
  nextCell.focus();
@@ -24570,7 +24725,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24570
24725
  event.preventDefault();
24571
24726
  break;
24572
24727
  case 'ArrowUp':
24573
- var upCell = _findUpSelectableCell(cell);
24728
+ var upCell = props.findUpSelectableCell(cell, index);
24574
24729
  if (upCell) {
24575
24730
  changeTabIndex(cell, upCell);
24576
24731
  upCell.focus();
@@ -24578,7 +24733,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24578
24733
  event.preventDefault();
24579
24734
  break;
24580
24735
  case 'ArrowDown':
24581
- var downCell = _findDownSelectableCell(cell);
24736
+ var downCell = props.findDownSelectableCell(cell, index);
24582
24737
  if (downCell) {
24583
24738
  changeTabIndex(cell, downCell);
24584
24739
  downCell.focus();
@@ -24617,13 +24772,6 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24617
24772
  index: props.rowIndex
24618
24773
  });
24619
24774
  };
24620
- var onCheckboxChange = function onCheckboxChange(event) {
24621
- props.onCheckboxChange({
24622
- originalEvent: event,
24623
- data: props.rowData,
24624
- index: props.rowIndex
24625
- });
24626
- };
24627
24775
  var onRowToggle = function onRowToggle(event) {
24628
24776
  props.onRowToggle({
24629
24777
  originalEvent: event,
@@ -24636,8 +24784,8 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24636
24784
  props.onRowEditInit({
24637
24785
  originalEvent: event,
24638
24786
  data: props.rowData,
24639
- newData: getEditingRowData(),
24640
- field: field,
24787
+ newData: props.getEditingRowData(),
24788
+ field: props.field,
24641
24789
  index: props.rowIndex
24642
24790
  });
24643
24791
  };
@@ -24645,32 +24793,26 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24645
24793
  props.onRowEditSave({
24646
24794
  originalEvent: event,
24647
24795
  data: props.rowData,
24648
- newData: getEditingRowData(),
24649
- field: field,
24796
+ newData: props.getEditingRowData(),
24797
+ field: props.field,
24650
24798
  index: props.rowIndex
24651
24799
  });
24652
- focusOnInit();
24800
+ props.focusOnInit(initFocusTimeout, elementRef);
24653
24801
  };
24654
24802
  var onRowEditCancel = function onRowEditCancel(event) {
24655
24803
  props.onRowEditCancel({
24656
24804
  originalEvent: event,
24657
24805
  data: props.rowData,
24658
- newData: getEditingRowData(),
24659
- field: field,
24806
+ newData: props.getEditingRowData(),
24807
+ field: props.field,
24660
24808
  index: props.rowIndex
24661
24809
  });
24662
- focusOnInit();
24810
+ props.focusOnInit(initFocusTimeout, elementRef);
24663
24811
  };
24664
24812
  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
24813
+ if (props.frozenCol) props.updateStickyPosition(elementRef, props.frozenCol, props.alignFrozenCol, styleObjectState, setStyleObjectState);
24814
+ if (props.editMode === 'cell' || props.editMode === 'row') props.focusOnElement(focusTimeout, editingState, elementRef, keyHelperRef);
24815
+ }, [props.editMode, props.editing, editingState, props.frozenCol, props.alignFrozenCol]); // eslint-disable-line react-hooks/exhaustive-deps
24674
24816
 
24675
24817
  React__namespace.useEffect(function () {
24676
24818
  if (props.editMode === 'row' && props.editing !== editingState) {
@@ -24679,7 +24821,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24679
24821
  }, [props.editMode, props.editing, editingState]);
24680
24822
  useUpdateEffect(function () {
24681
24823
  if (props.editMode === 'cell' || props.editMode === 'row') {
24682
- var editingRowData = getEditingRowData();
24824
+ var editingRowData = props.getEditingRowData();
24683
24825
  setEditingRowDataState(editingRowData);
24684
24826
  editingRowDataStateRef.current = editingRowData;
24685
24827
  }
@@ -24689,7 +24831,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24689
24831
  var callbackParams = getCellCallbackParams();
24690
24832
  var params = _objectSpread$1i(_objectSpread$1i({}, callbackParams), {}, {
24691
24833
  editing: editingState,
24692
- editingKey: editingKey
24834
+ editingKey: props.editingKey
24693
24835
  });
24694
24836
  props.onEditingMetaChange(params);
24695
24837
  }
@@ -24702,16 +24844,16 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24702
24844
  }
24703
24845
  });
24704
24846
  var createLoading = function createLoading() {
24705
- var options = getVirtualScrollerOption('getLoaderOptions')(props.rowIndex, {
24847
+ var options = props.getVirtualScrollerOption('getLoaderOptions')(props.rowIndex, {
24706
24848
  cellIndex: props.index,
24707
24849
  cellFirst: props.index === 0,
24708
- cellLast: props.index === getVirtualScrollerOption('columns').length - 1,
24850
+ cellLast: props.index === props.getVirtualScrollerOption('columns').length - 1,
24709
24851
  cellEven: props.index % 2 === 0,
24710
24852
  cellOdd: props.index % 2 !== 0,
24711
24853
  column: props.column,
24712
- field: field
24854
+ field: props.field
24713
24855
  });
24714
- var content = ObjectUtils.getJSXElement(getVirtualScrollerOption('loadingTemplate'), options);
24856
+ var content = ObjectUtils.getJSXElement(props.getVirtualScrollerOption('loadingTemplate'), options);
24715
24857
  var bodyCellProps = mergeProps(getColumnPTOptions('bodyCell'), {
24716
24858
  role: 'cell'
24717
24859
  });
@@ -24720,20 +24862,20 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24720
24862
  var createElement = function createElement() {
24721
24863
  var content;
24722
24864
  var editorKeyHelper;
24723
- var cellSelected = props.allowCellSelection && isSelected();
24865
+ var cellSelected = props.allowCellSelection && props.isCellSelected;
24724
24866
  var isRowEditor = props.editMode === 'row';
24725
- var tabIndex = getTabIndex(cellSelected);
24867
+ var tabIndex = props.getTabIndex(cellSelected, props.index);
24726
24868
  var selectionMode = getColumnProp('selectionMode');
24727
24869
  var rowReorder = getColumnProp('rowReorder');
24728
24870
  var header = getColumnProp('header');
24729
24871
  var body = getColumnProp('body');
24730
24872
  var editor = getColumnProp('editor');
24731
- var frozen = getColumnProp('frozen');
24873
+ var frozen = props.frozenCol;
24732
24874
  var align = getColumnProp('align');
24733
- var value = resolveFieldData();
24875
+ var value = props.resolveFieldData();
24734
24876
  var columnBodyOptions = {
24735
24877
  column: props.column,
24736
- field: field,
24878
+ field: props.field,
24737
24879
  rowIndex: props.rowIndex,
24738
24880
  frozenRow: props.frozenRow,
24739
24881
  props: props.tableProps
@@ -24758,12 +24900,12 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24758
24900
  if (showSelection) {
24759
24901
  var ariaLabelField = props.selectionAriaLabel || props.tableProps.dataKey;
24760
24902
  var ariaLabelText = ObjectUtils.resolveFieldData(props.rowData, ariaLabelField);
24761
- label = "".concat(props.selected ? ariaLabel('unselectRow') : ariaLabel('selectRow'), " ").concat(ariaLabelText);
24903
+ label = "".concat(props.isRowSelected ? ariaLabel('unselectRow') : ariaLabel('selectRow'), " ").concat(ariaLabelText);
24762
24904
  }
24763
24905
  content = showSelection && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, selectionMode === 'single' && /*#__PURE__*/React__namespace.createElement(RowRadioButton, {
24764
24906
  hostName: props.hostName,
24765
24907
  column: props.column,
24766
- checked: props.selected,
24908
+ checked: props.isRowSelected,
24767
24909
  disabled: !props.isSelectable({
24768
24910
  data: props.rowData,
24769
24911
  index: props.rowIndex
@@ -24778,12 +24920,12 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24778
24920
  }), selectionMode === 'multiple' && /*#__PURE__*/React__namespace.createElement(RowCheckbox, {
24779
24921
  hostName: props.hostName,
24780
24922
  column: props.column,
24781
- checked: props.selected,
24923
+ checked: props.isRowSelected,
24782
24924
  disabled: !props.isSelectable({
24783
24925
  data: props.rowData,
24784
24926
  index: props.rowIndex
24785
24927
  }),
24786
- onChange: onCheckboxChange,
24928
+ onChange: props.onCheckboxChange,
24787
24929
  tabIndex: props.tabIndex,
24788
24930
  ariaLabel: label,
24789
24931
  checkIcon: props.checkIcon,
@@ -24833,7 +24975,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24833
24975
  expanderProps.element = content;
24834
24976
  content = ObjectUtils.getJSXElement(body, props.rowData, {
24835
24977
  column: props.column,
24836
- field: field,
24978
+ field: props.field,
24837
24979
  rowIndex: props.rowIndex,
24838
24980
  frozenRow: props.frozenRow,
24839
24981
  props: props.tableProps,
@@ -24907,7 +25049,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24907
25049
  rowEditorProps.element = content;
24908
25050
  content = ObjectUtils.getJSXElement(body, props.rowData, {
24909
25051
  column: props.column,
24910
- field: field,
25052
+ field: props.field,
24911
25053
  rowIndex: props.rowIndex,
24912
25054
  frozenRow: props.frozenRow,
24913
25055
  props: props.tableProps,
@@ -24917,7 +25059,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24917
25059
  } else if (body && (!editingState || !editor)) {
24918
25060
  content = body ? ObjectUtils.getJSXElement(body, props.rowData, {
24919
25061
  column: props.column,
24920
- field: field,
25062
+ field: props.field,
24921
25063
  rowIndex: props.rowIndex,
24922
25064
  frozenRow: props.frozenRow,
24923
25065
  props: props.tableProps
@@ -24925,9 +25067,9 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24925
25067
  } else if (editor && editingState) {
24926
25068
  content = ObjectUtils.getJSXElement(editor, {
24927
25069
  rowData: editingRowDataState,
24928
- value: resolveFieldData(editingRowDataState),
25070
+ value: props.resolveFieldData(editingRowDataState),
24929
25071
  column: props.column,
24930
- field: field,
25072
+ field: props.field,
24931
25073
  rowIndex: props.rowIndex,
24932
25074
  frozenRow: props.frozenRow,
24933
25075
  props: props.tableProps,
@@ -24995,7 +25137,29 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
24995
25137
  ref: elementRef
24996
25138
  }, bodyCellProps), editorKeyHelper, title, content);
24997
25139
  };
24998
- return getVirtualScrollerOption('loading') ? createLoading() : createElement();
25140
+ return props.getVirtualScrollerOption('loading') ? createLoading() : createElement();
25141
+ };
25142
+
25143
+ // RadioCheckCell is used for the Radio and Checkbox selection and has the isRowSelected dependency
25144
+ var RadioCheckCell = /*#__PURE__*/React__namespace.memo(function (props) {
25145
+ return /*#__PURE__*/React__namespace.createElement(Cell, props);
25146
+ }, function (prevProps, nextProps) {
25147
+ var keysToCompare = ['isRowSelected', 'field', 'allowCellSelection', 'isCellSelected', 'editMode', 'index', 'tabIndex', 'editing', 'expanded', 'editingMeta', 'rowData'];
25148
+ return ObjectUtils.selectiveCompare(prevProps, nextProps, keysToCompare);
25149
+ });
25150
+ RadioCheckCell.displayName = 'RadioCheckCell';
25151
+ var defaultKeysToCompare = ['rowData', 'field', 'allowCellSelection', 'isCellSelected', 'editMode', 'index', 'tabIndex', 'editing', 'expanded', 'editingMeta', 'frozenCol', 'alignFrozenCol'];
25152
+ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
25153
+ return /*#__PURE__*/React__namespace.createElement(Cell, props);
25154
+ }, function (prevProps, nextProps) {
25155
+ if (nextProps.cellMemo === false) return false;
25156
+ var memoProps = nextProps.cellMemoProps;
25157
+ var keysToCompare = Array.isArray(memoProps) && memoProps.every(function (prop) {
25158
+ return typeof prop === 'string';
25159
+ }) ? memoProps : defaultKeysToCompare;
25160
+ var memoPropsDepth = nextProps.cellMemoPropsDepth;
25161
+ var depth = typeof memoPropsDepth === 'number' && memoPropsDepth > 0 ? memoPropsDepth : 1;
25162
+ return ObjectUtils.selectiveCompare(prevProps, nextProps, keysToCompare, depth);
24999
25163
  });
25000
25164
  BodyCell.displayName = 'BodyCell';
25001
25165
 
@@ -25011,6 +25175,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
25011
25175
  var _props$ptCallbacks = props.ptCallbacks,
25012
25176
  ptm = _props$ptCallbacks.ptm,
25013
25177
  cx = _props$ptCallbacks.cx;
25178
+ var isRowSelected = !props.allowCellSelection && props.selected || props.contextMenuSelected;
25014
25179
  var getBodyRowPTOptions = function getBodyRowPTOptions(key) {
25015
25180
  return ptm(key, {
25016
25181
  parent: props.metaData,
@@ -25024,7 +25189,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
25024
25189
  data: props.rowData,
25025
25190
  index: props.rowIndex
25026
25191
  }),
25027
- selected: !props.allowCellSelection && props.selected || props.contextMenuSelected,
25192
+ selected: isRowSelected,
25028
25193
  stripedRows: props.metaData.props.stripedRows
25029
25194
  }
25030
25195
  });
@@ -25053,10 +25218,10 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
25053
25218
  return equals(rowData, data);
25054
25219
  });
25055
25220
  };
25056
- var changeTabIndex = function changeTabIndex(currentRow, nextRow) {
25057
- if (currentRow && nextRow) {
25058
- currentRow.tabIndex = -1;
25059
- nextRow.tabIndex = props.tabIndex;
25221
+ var changeTabIndex = function changeTabIndex(currentElement, nextElement) {
25222
+ if (currentElement && nextElement) {
25223
+ currentElement.tabIndex = -1;
25224
+ nextElement.tabIndex = props.tabIndex;
25060
25225
  }
25061
25226
  };
25062
25227
  var findFirstSelectableRow = function findFirstSelectableRow(row) {
@@ -25383,32 +25548,179 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
25383
25548
  onEditChange(e, false);
25384
25549
  event.preventDefault();
25385
25550
  };
25551
+ var equalsDataCell = function equalsDataCell(data) {
25552
+ return props.compareSelectionBy === 'equals' ? data === props.rowData : ObjectUtils.equals(data, props.rowData, props.dataKey);
25553
+ };
25554
+ var equalsCell = function equalsCell(selectedCell, field, colIndex) {
25555
+ return selectedCell && (selectedCell.rowIndex === props.rowIndex || equalsDataCell(selectedCell.rowData)) && (selectedCell.field === field || selectedCell.cellIndex === colIndex);
25556
+ };
25557
+ var findIndexCell = function findIndexCell(collection, field, colIndex) {
25558
+ return (collection || []).findIndex(function (data) {
25559
+ return equalsCell(data, field, colIndex);
25560
+ });
25561
+ };
25562
+ var isCellSelected = function isCellSelected(selection, field, colIndex) {
25563
+ return selection ? selection instanceof Array ? findIndexCell(selection, field, colIndex) > -1 : equalsCell(selection, field, colIndex) : false;
25564
+ };
25565
+ var onCheckboxChange = function onCheckboxChange(event) {
25566
+ props.onCheckboxChange({
25567
+ originalEvent: event,
25568
+ data: props.rowData,
25569
+ index: props.rowIndex
25570
+ });
25571
+ };
25572
+ var editingKey = props.dataKey ? props.rowData && props.rowData[props.dataKey] || props.rowIndex : props.rowIndex;
25573
+ var getVirtualScrollerOption = React__namespace.useCallback(function (option) {
25574
+ return props.virtualScrollerOptions ? props.virtualScrollerOptions[option] : null;
25575
+ }, [props.virtualScrollerOptions]);
25576
+ var getEditingRowData = function getEditingRowData() {
25577
+ return props.editingMeta && props.editingMeta[editingKey] ? props.editingMeta[editingKey].data : props.rowData;
25578
+ };
25579
+ var getTabIndexCell = React__namespace.useCallback(function (cellSelected, cellIndex) {
25580
+ return props.allowCellSelection ? cellSelected ? 0 : props.rowIndex === 0 && cellIndex === 0 ? props.tabIndex : -1 : null;
25581
+ }, [props.allowCellSelection, props.rowIndex, props.tabIndex]);
25582
+ var findNextSelectableCell = React__namespace.useCallback(function (cell) {
25583
+ var nextCell = cell.nextElementSibling;
25584
+ return nextCell ? DomHandler.getAttribute(nextCell, 'data-p-selectable-cell') ? nextCell : findNextSelectableCell(nextCell) : null;
25585
+ }, []);
25586
+ var findPrevSelectableCell = React__namespace.useCallback(function (cell) {
25587
+ var prevCell = cell.previousElementSibling;
25588
+ return prevCell ? DomHandler.getAttribute(prevCell, 'data-p-selectable-cell') ? prevCell : findPrevSelectableCell(prevCell) : null;
25589
+ }, []);
25590
+ var findDownSelectableCell = React__namespace.useCallback(function (cell, cellIndex) {
25591
+ var downRow = cell.parentElement.nextElementSibling;
25592
+ var downCell = downRow ? downRow.children[cellIndex] : null;
25593
+ return downRow && downCell ? DomHandler.getAttribute(downRow, 'data-p-selectable-row') && DomHandler.getAttribute(downCell, 'data-p-selectable-cell') ? downCell : findDownSelectableCell(downCell) : null;
25594
+ }, []);
25595
+ var findUpSelectableCell = React__namespace.useCallback(function (cell, cellIndex) {
25596
+ var upRow = cell.parentElement.previousElementSibling;
25597
+ var upCell = upRow ? upRow.children[cellIndex] : null;
25598
+ return upRow && upCell ? DomHandler.getAttribute(upRow, 'data-p-selectable-row') && DomHandler.getAttribute(upCell, 'data-p-selectable-cell') ? upCell : findUpSelectableCell(upCell) : null;
25599
+ }, []);
25600
+ var focusOnElement = React__namespace.useCallback(function (focusTimeoutRef, editingState, elementRef, keyHelperRef) {
25601
+ clearTimeout(focusTimeoutRef.current);
25602
+ focusTimeoutRef.current = setTimeout(function () {
25603
+ if (editingState) {
25604
+ var focusableEl = props.editMode === 'cell' ? DomHandler.getFirstFocusableElement(elementRef.current, ':not([data-pc-section="editorkeyhelperlabel"])') : DomHandler.findSingle(elementRef.current, '[data-p-row-editor-save="true"]');
25605
+ focusableEl && focusableEl.focus();
25606
+ }
25607
+ keyHelperRef.current && (keyHelperRef.current.tabIndex = editingState ? -1 : 0);
25608
+ }, 1);
25609
+ }, [props.editMode]);
25610
+ var focusOnInit = React__namespace.useCallback(function (initFocusTimeoutRef, elementRef) {
25611
+ clearTimeout(initFocusTimeoutRef.current);
25612
+ initFocusTimeoutRef.current = setTimeout(function () {
25613
+ var focusableEl = props.editMode === 'row' ? DomHandler.findSingle(elementRef.current, '[data-p-row-editor-init="true"]') : null;
25614
+ focusableEl && focusableEl.focus();
25615
+ }, 1);
25616
+ }, [props.editMode]);
25617
+ var updateStickyPosition = React__namespace.useCallback(function (elementRef, frozen, alignFrozen, styleObjectState, setStyleObjectState) {
25618
+ if (frozen) {
25619
+ var styleObject = _objectSpread$1h({}, styleObjectState);
25620
+ if (alignFrozen === 'right') {
25621
+ var right = 0;
25622
+ var next = elementRef.current && elementRef.current.nextElementSibling;
25623
+ if (next && next.classList.contains('p-frozen-column')) {
25624
+ right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0);
25625
+ }
25626
+ styleObject.right = right + 'px';
25627
+ } else {
25628
+ var left = 0;
25629
+ var prev = elementRef.current && elementRef.current.previousElementSibling;
25630
+ if (prev && prev.classList.contains('p-frozen-column')) {
25631
+ left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0);
25632
+ }
25633
+ styleObject.left = left + 'px';
25634
+ }
25635
+ var isSameStyle = styleObjectState.left === styleObject.left && styleObjectState.right === styleObject.right;
25636
+ !isSameStyle && setStyleObjectState(styleObject);
25637
+ }
25638
+ }, []);
25639
+ var onCellClick = function onCellClick(event, params, isEditable, editingState, setEditingState, selfClick, column, bindDocumentClickListener, overlayEventListener, isOutsideClicked) {
25640
+ if (props.editMode !== 'row' && isEditable && !editingState && (props.selectOnEdit || !props.selectOnEdit && props.isRowSelected)) {
25641
+ selfClick.current = true;
25642
+ var onBeforeCellEditShow = getColumnProp(column, 'onBeforeCellEditShow');
25643
+ var onCellEditInit = getColumnProp(column, 'onCellEditInit');
25644
+ var cellEditValidatorEvent = getColumnProp(column, 'cellEditValidatorEvent');
25645
+ if (onBeforeCellEditShow) {
25646
+ // if user returns false do not show the editor
25647
+ if (onBeforeCellEditShow(params) === false) {
25648
+ return;
25649
+ }
25650
+
25651
+ // if user prevents default stop the editor
25652
+ if (event && event.defaultPrevented) {
25653
+ return;
25654
+ }
25655
+ }
25656
+
25657
+ // 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.
25658
+ setTimeout(function () {
25659
+ setEditingState(true);
25660
+ if (onCellEditInit) {
25661
+ if (onCellEditInit(params) === false) {
25662
+ return;
25663
+ }
25664
+
25665
+ // if user prevents default stop the editor
25666
+ if (event && event.defaultPrevented) {
25667
+ return;
25668
+ }
25669
+ }
25670
+ if (cellEditValidatorEvent === 'click') {
25671
+ bindDocumentClickListener();
25672
+ overlayEventListener.current = function (e) {
25673
+ if (!isOutsideClicked(e.target)) {
25674
+ selfClick.current = true;
25675
+ }
25676
+ };
25677
+ OverlayService.on('overlay-click', overlayEventListener.current);
25678
+ }
25679
+ }, 1);
25680
+ }
25681
+ if (props.allowCellSelection && props.onCellClick) {
25682
+ props.onCellClick(params);
25683
+ }
25684
+ };
25386
25685
  var createContent = function createContent() {
25387
25686
  return props.columns.map(function (col, i) {
25388
25687
  if (shouldRenderBodyCell(props.value, col, props.index)) {
25389
25688
  var key = "".concat(props.rowIndex, "_").concat(getColumnProp(col, 'columnKey') || getColumnProp(col, 'field'), "_").concat(i);
25390
25689
  var rowSpan = props.rowGroupMode === 'rowspan' ? calculateRowGroupSize(props.value, col, props.index) : null;
25391
- return /*#__PURE__*/React__namespace.createElement(BodyCell, {
25690
+ var field = getColumnProp(col, 'field') || "field_".concat(i);
25691
+ var resolveFieldData = function resolveFieldData(data) {
25692
+ return ObjectUtils.resolveFieldData(data || props.rowData, field);
25693
+ };
25694
+ var selectionMode = getColumnProp(col, 'selectionMode');
25695
+ var cellProps = mergeProps({
25392
25696
  hostName: props.hostName,
25393
- key: key,
25394
25697
  allowCellSelection: props.allowCellSelection,
25698
+ cellMemo: props.cellMemo,
25699
+ cellMemoProps: props.cellMemoProps,
25700
+ cellMemoPropsDepth: props.cellMemoPropsDepth,
25395
25701
  cellClassName: props.cellClassName,
25396
25702
  checkIcon: props.checkIcon,
25397
25703
  collapsedRowIcon: props.collapsedRowIcon,
25704
+ field: field,
25705
+ resolveFieldData: resolveFieldData,
25398
25706
  column: col,
25399
- compareSelectionBy: props.compareSelectionBy,
25707
+ cProps: props.colsProps[i],
25400
25708
  dataKey: props.dataKey,
25401
25709
  editMode: props.editMode,
25402
25710
  editing: editing,
25403
25711
  editingMeta: props.editingMeta,
25712
+ onEditingMetaChange: props.onEditingMetaChange,
25713
+ editingKey: editingKey,
25714
+ getEditingRowData: getEditingRowData,
25404
25715
  expanded: props.expanded,
25405
25716
  expandedRowIcon: props.expandedRowIcon,
25406
25717
  frozenRow: props.frozenRow,
25718
+ frozenCol: getColumnProp(col, 'frozen'),
25719
+ alignFrozenCol: getColumnProp(col, 'alignFrozen'),
25407
25720
  index: i,
25408
25721
  isSelectable: props.isSelectable,
25409
- onCheckboxChange: props.onCheckboxChange,
25410
- onClick: props.onCellClick,
25411
- onEditingMetaChange: props.onEditingMetaChange,
25722
+ onCheckboxChange: onCheckboxChange,
25723
+ onClick: onCellClick,
25412
25724
  onMouseDown: props.onCellMouseDown,
25413
25725
  onMouseUp: props.onCellMouseUp,
25414
25726
  onRadioChange: props.onRadioChange,
@@ -25424,20 +25736,31 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
25424
25736
  rowIndex: props.rowIndex,
25425
25737
  rowSpan: rowSpan,
25426
25738
  selectOnEdit: props.selectOnEdit,
25427
- selected: props.selected,
25428
- selection: props.selection,
25739
+ isRowSelected: isRowSelected,
25740
+ isCellSelected: isCellSelected(props.selection, field, i),
25429
25741
  selectionAriaLabel: props.tableProps.selectionAriaLabel,
25430
25742
  showRowReorderElement: props.showRowReorderElement,
25431
25743
  showSelectionElement: props.showSelectionElement,
25432
25744
  tabIndex: props.tabIndex,
25745
+ getTabIndex: getTabIndexCell,
25433
25746
  tableProps: props.tableProps,
25434
25747
  tableSelector: props.tableSelector,
25435
25748
  value: props.value,
25436
- virtualScrollerOptions: props.virtualScrollerOptions,
25749
+ getVirtualScrollerOption: getVirtualScrollerOption,
25437
25750
  ptCallbacks: props.ptCallbacks,
25438
25751
  metaData: props.metaData,
25439
- unstyled: props.unstyled
25752
+ unstyled: props.unstyled,
25753
+ findNextSelectableCell: findNextSelectableCell,
25754
+ findPrevSelectableCell: findPrevSelectableCell,
25755
+ findDownSelectableCell: findDownSelectableCell,
25756
+ findUpSelectableCell: findUpSelectableCell,
25757
+ focusOnElement: focusOnElement,
25758
+ focusOnInit: focusOnInit,
25759
+ updateStickyPosition: updateStickyPosition
25440
25760
  });
25761
+ return /*#__PURE__*/React__namespace.createElement(React.Fragment, {
25762
+ key: key
25763
+ }, selectionMode ? /*#__PURE__*/React__namespace.createElement(RadioCheckCell, cellProps) : /*#__PURE__*/React__namespace.createElement(BodyCell, cellProps));
25441
25764
  }
25442
25765
  return null;
25443
25766
  });
@@ -25587,8 +25910,11 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25587
25910
  var getColumnProps = function getColumnProps(column) {
25588
25911
  return ColumnBase.getCProps(column);
25589
25912
  };
25913
+ var cProps = getColumnProps(props.column);
25914
+ var colsProps = props.columns ? props.columns.map(function (col) {
25915
+ return getColumnProps(col);
25916
+ }) : [];
25590
25917
  var getColumnPTOptions = function getColumnPTOptions(key) {
25591
- var cProps = getColumnProps(props.column);
25592
25918
  var columnMetaData = {
25593
25919
  props: cProps,
25594
25920
  parent: props.metaData,
@@ -25713,8 +26039,12 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25713
26039
  var allowSelection = function allowSelection(event) {
25714
26040
  return !DomHandler.isClickable(event.originalEvent.target);
25715
26041
  };
26042
+ var metaKeySelectionRef = React__namespace.useRef(props.metaKeySelection);
26043
+ React__namespace.useEffect(function () {
26044
+ metaKeySelectionRef.current = props.metaKeySelection;
26045
+ }, [props.metaKeySelection]);
25716
26046
  var allowMetaKeySelection = function allowMetaKeySelection(event) {
25717
- return !rowTouched.current && (!props.metaKeySelection || props.metaKeySelection && (event.originalEvent.metaKey || event.originalEvent.ctrlKey));
26047
+ return !rowTouched.current && (!metaKeySelectionRef.current || metaKeySelectionRef.current && (event.originalEvent.metaKey || event.originalEvent.ctrlKey));
25718
26048
  };
25719
26049
  var allowRangeSelection = function allowRangeSelection(event) {
25720
26050
  return isMultipleSelection() && event.originalEvent.shiftKey && anchorRowIndex.current !== null;
@@ -25735,9 +26065,6 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25735
26065
  options = options || props.virtualScrollerOptions;
25736
26066
  return options ? options[option] : null;
25737
26067
  };
25738
- var getProcessedDataIndex = function getProcessedDataIndex(rowIndex) {
25739
- return props.lazy ? rowIndex - props.first : rowIndex;
25740
- };
25741
26068
  var findIndex = function findIndex(collection, rowData) {
25742
26069
  return (collection || []).findIndex(function (data) {
25743
26070
  return equals(rowData, data);
@@ -25787,6 +26114,10 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25787
26114
  });
25788
26115
  }
25789
26116
  };
26117
+ var selectionRef = React__namespace.useRef(props.selection);
26118
+ React__namespace.useEffect(function () {
26119
+ selectionRef.current = props.selection;
26120
+ }, [props.selection]);
25790
26121
  var onSingleSelection = function onSingleSelection(_ref) {
25791
26122
  var originalEvent = _ref.originalEvent,
25792
26123
  data = _ref.data,
@@ -25800,10 +26131,11 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25800
26131
  return;
25801
26132
  }
25802
26133
  var selected = isSelected(data);
25803
- var selection = props.selection;
26134
+ var currentSelection = selectionRef.current || [];
26135
+ var newSelection = currentSelection;
25804
26136
  if (selected) {
25805
26137
  if (toggleable) {
25806
- selection = null;
26138
+ newSelection = null;
25807
26139
  onUnselect({
25808
26140
  originalEvent: originalEvent,
25809
26141
  data: data,
@@ -25811,7 +26143,7 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25811
26143
  });
25812
26144
  }
25813
26145
  } else {
25814
- selection = data;
26146
+ newSelection = data;
25815
26147
  onSelect({
25816
26148
  originalEvent: originalEvent,
25817
26149
  data: data,
@@ -25819,10 +26151,10 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25819
26151
  });
25820
26152
  }
25821
26153
  focusOnElement(originalEvent, true);
25822
- if (props.onSelectionChange && selection !== props.selection) {
26154
+ if (props.onSelectionChange && newSelection !== currentSelection) {
25823
26155
  props.onSelectionChange({
25824
26156
  originalEvent: originalEvent,
25825
- value: selection,
26157
+ value: newSelection,
25826
26158
  type: type
25827
26159
  });
25828
26160
  }
@@ -25840,11 +26172,12 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25840
26172
  return;
25841
26173
  }
25842
26174
  var selected = isSelected(data);
25843
- var selection = props.selection || [];
26175
+ var currentSelection = selectionRef.current || [];
26176
+ var newSelection = currentSelection;
25844
26177
  if (selected) {
25845
26178
  if (toggleable) {
25846
- var selectionIndex = findIndex(selection, data);
25847
- selection = props.selection.filter(function (val, i) {
26179
+ var selectionIndex = findIndex(currentSelection, data);
26180
+ newSelection = currentSelection.filter(function (val, i) {
25848
26181
  return i !== selectionIndex;
25849
26182
  });
25850
26183
  onUnselect({
@@ -25852,15 +26185,15 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25852
26185
  data: data,
25853
26186
  type: type
25854
26187
  });
25855
- } else if (selection.length) {
25856
- props.selection.forEach(function (d) {
26188
+ } else if (currentSelection.length) {
26189
+ currentSelection.forEach(function (d) {
25857
26190
  return onUnselect({
25858
26191
  originalEvent: originalEvent,
25859
26192
  data: d,
25860
26193
  type: type
25861
26194
  });
25862
26195
  });
25863
- selection = [data];
26196
+ newSelection = [data];
25864
26197
  onSelect({
25865
26198
  originalEvent: originalEvent,
25866
26199
  data: data,
@@ -25868,18 +26201,18 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25868
26201
  });
25869
26202
  }
25870
26203
  } else {
25871
- selection = ObjectUtils.isObject(selection) ? [selection] : selection;
25872
- selection = toggleable && isMultipleSelection() ? [].concat(_toConsumableArray(selection), [data]) : [data];
26204
+ newSelection = ObjectUtils.isObject(currentSelection) ? [currentSelection] : currentSelection;
26205
+ newSelection = toggleable && isMultipleSelection() ? [].concat(_toConsumableArray(newSelection), [data]) : [data];
25873
26206
  onSelect({
25874
26207
  originalEvent: originalEvent,
25875
26208
  data: data,
25876
26209
  type: type
25877
26210
  });
25878
26211
  }
25879
- if (props.onSelectionChange && selection !== props.selection) {
26212
+ if (props.onSelectionChange && newSelection !== currentSelection) {
25880
26213
  props.onSelectionChange({
25881
26214
  originalEvent: originalEvent,
25882
- value: selection,
26215
+ value: newSelection,
25883
26216
  type: type
25884
26217
  });
25885
26218
  }
@@ -25902,16 +26235,14 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25902
26235
  var rangeStart;
25903
26236
  var rangeEnd;
25904
26237
  var isAllowCellSelection = allowCellSelection();
25905
- var rangeRowIndexInProcessedData = getProcessedDataIndex(rangeRowIndex.current);
25906
- var anchorRowIndexInProcessedData = getProcessedDataIndex(anchorRowIndex.current);
25907
- if (rangeRowIndexInProcessedData > anchorRowIndexInProcessedData) {
25908
- rangeStart = anchorRowIndexInProcessedData;
25909
- rangeEnd = rangeRowIndexInProcessedData;
25910
- } else if (rangeRowIndexInProcessedData < anchorRowIndexInProcessedData) {
25911
- rangeStart = rangeRowIndexInProcessedData;
25912
- rangeEnd = anchorRowIndexInProcessedData;
26238
+ if (rangeRowIndex.current > anchorRowIndex.current) {
26239
+ rangeStart = anchorRowIndex.current;
26240
+ rangeEnd = rangeRowIndex.current;
26241
+ } else if (rangeRowIndex.current < anchorRowIndex.current) {
26242
+ rangeStart = rangeRowIndex.current;
26243
+ rangeEnd = anchorRowIndex.current;
25913
26244
  } else {
25914
- rangeStart = rangeEnd = rangeRowIndexInProcessedData;
26245
+ rangeStart = rangeEnd = rangeRowIndex.current;
25915
26246
  }
25916
26247
  return isAllowCellSelection ? selectRangeOnCell(event, rangeStart, rangeEnd) : selectRangeOnRow(event, rangeStart, rangeEnd);
25917
26248
  };
@@ -25952,7 +26283,7 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
25952
26283
  for (var i = rowRangeStart; i <= rowRangeEnd; i++) {
25953
26284
  var rowData = value[i];
25954
26285
  var columns = props.columns;
25955
- var rowIndex = props.lazy ? i + props.first : i;
26286
+ var rowIndex = props.paginator ? i + props.first : i;
25956
26287
  for (var j = cellRangeStart; j <= cellRangeEnd; j++) {
25957
26288
  var field = getColumnProp(columns[j], 'field');
25958
26289
  var _value = ObjectUtils.resolveFieldData(rowData, field);
@@ -26151,13 +26482,17 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
26151
26482
  onRangeSelection(event, 'row');
26152
26483
  }
26153
26484
  };
26485
+ var expandedRowsRef = React__namespace.useRef(props.expandedRows);
26486
+ React__namespace.useEffect(function () {
26487
+ expandedRowsRef.current = props.expandedRows;
26488
+ }, [props.expandedRows]);
26154
26489
  var onRowToggle = function onRowToggle(event) {
26155
26490
  var expandedRows;
26156
26491
  var dataKey = props.dataKey;
26157
26492
  var hasDataKey = props.groupRowsBy ? dataKey === props.groupRowsBy : !!dataKey;
26158
26493
  if (hasDataKey) {
26159
26494
  var dataKeyValue = String(ObjectUtils.resolveFieldData(event.data, dataKey));
26160
- expandedRows = props.expandedRows ? _objectSpread$1f({}, props.expandedRows) : {};
26495
+ expandedRows = expandedRowsRef.current ? _objectSpread$1f({}, expandedRowsRef.current) : {};
26161
26496
  if (expandedRows[dataKeyValue] != null) {
26162
26497
  delete expandedRows[dataKeyValue];
26163
26498
  if (props.onRowCollapse) {
@@ -26176,8 +26511,8 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
26176
26511
  }
26177
26512
  }
26178
26513
  } else {
26179
- var expandedRowIndex = findIndex(props.expandedRows, event.data);
26180
- expandedRows = props.expandedRows ? _toConsumableArray(props.expandedRows) : [];
26514
+ var expandedRowIndex = findIndex(expandedRowsRef.current, event.data);
26515
+ expandedRows = expandedRowsRef.current ? _toConsumableArray(expandedRowsRef.current) : [];
26181
26516
  if (expandedRowIndex !== -1) {
26182
26517
  expandedRows = expandedRows.filter(function (_, i) {
26183
26518
  return i !== expandedRowIndex;
@@ -26427,7 +26762,7 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
26427
26762
  return null;
26428
26763
  };
26429
26764
  var createGroupHeader = function createGroupHeader(rowData, rowIndex, expanded, colSpan) {
26430
- if (isSubheaderGrouping && shouldRenderRowGroupHeader(props.value, rowData, getProcessedDataIndex(rowIndex))) {
26765
+ if (isSubheaderGrouping && shouldRenderRowGroupHeader(props.value, rowData, rowIndex - props.first)) {
26431
26766
  var style = rowGroupHeaderStyle();
26432
26767
  var toggler = props.expandableRowGroups && /*#__PURE__*/React__namespace.createElement(RowTogglerButton, {
26433
26768
  hostName: props.hostName,
@@ -26477,10 +26812,14 @@ var TableBody = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
26477
26812
  hostName: props.hostName,
26478
26813
  allowCellSelection: _allowCellSelection,
26479
26814
  allowRowSelection: _allowRowSelection,
26815
+ cellMemo: props.cellMemo,
26816
+ cellMemoProps: props.cellMemoProps,
26817
+ cellMemoPropsDepth: props.cellMemoPropsDepth,
26480
26818
  cellClassName: props.cellClassName,
26481
26819
  checkIcon: props.checkIcon,
26482
26820
  collapsedRowIcon: props.collapsedRowIcon,
26483
26821
  columns: props.columns,
26822
+ colsProps: colsProps,
26484
26823
  compareSelectionBy: props.compareSelectionBy,
26485
26824
  contextMenuSelected: contextMenuSelected,
26486
26825
  dataKey: props.dataKey,
@@ -26960,9 +27299,17 @@ var ColumnFilter = /*#__PURE__*/React__namespace.memo(function (props) {
26960
27299
  var type = _ref.type,
26961
27300
  valid = _ref.valid;
26962
27301
  if (valid) {
26963
- type === 'outside' ? !selfClick.current && !isTargetClicked(event.target) && hide() : hide();
27302
+ if (type === 'outside') {
27303
+ if (!selfClick.current && !isTargetClicked(event.target)) {
27304
+ hide();
27305
+ }
27306
+ selfClick.current = false;
27307
+ } else if (context.hideOverlaysOnDocumentScrolling) {
27308
+ hide();
27309
+ } else if (!DomHandler.isDocument(event.target)) {
27310
+ DomHandler.alignOverlay(overlayRef.current, iconRef.current, context && context.appendTo || PrimeReact.appendTo, false);
27311
+ }
26964
27312
  }
26965
- selfClick.current = false;
26966
27313
  },
26967
27314
  when: overlayVisibleState
26968
27315
  }),
@@ -29718,58 +30065,60 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
29718
30065
  var exportCSV = function exportCSV(options) {
29719
30066
  var data;
29720
30067
  var csv = "\uFEFF";
29721
- var columns = getColumns();
29722
30068
  if (options && options.selectionOnly) {
29723
30069
  data = props.selection || [];
29724
30070
  } else {
29725
30071
  data = [].concat(_toConsumableArray(props.frozenValue || []), _toConsumableArray(processedData() || []));
29726
30072
  }
29727
30073
 
29728
- //headers
29729
- columns.forEach(function (column, i) {
29730
- var _ref5 = [getColumnProp(column, 'field'), getColumnProp(column, 'header'), getColumnProp(column, 'exportHeader'), getColumnProp(column, 'exportable')],
30074
+ // First build collection of exportable columns
30075
+ var exportableColumns = getColumns().filter(function (column) {
30076
+ var exportable = getColumnProp(column, 'exportable');
30077
+ var field = getColumnProp(column, 'field');
30078
+
30079
+ // Column must be exportable (or undefined/not set) and have a field defined
30080
+ return exportable !== false && field;
30081
+ });
30082
+
30083
+ // headers
30084
+ exportableColumns.forEach(function (column, i) {
30085
+ var _ref5 = [getColumnProp(column, 'field'), getColumnProp(column, 'header'), getColumnProp(column, 'exportHeader')],
29731
30086
  field = _ref5[0],
29732
30087
  header = _ref5[1],
29733
- exportHeader = _ref5[2],
29734
- exportable = _ref5[3];
29735
- if (exportable && field) {
29736
- var columnHeader = String(exportHeader || header || field).replace(/"/g, '""').replace(/\n/g, "\u2028");
29737
- csv = csv + ('"' + columnHeader + '"');
29738
- if (i < columns.length - 1) {
29739
- csv = csv + props.csvSeparator;
29740
- }
30088
+ exportHeader = _ref5[2];
30089
+ var columnHeader = String(exportHeader || header || field).replace(/"/g, '""').replace(/\n/g, "\u2028");
30090
+ csv = csv + ('"' + columnHeader + '"');
30091
+ if (i < exportableColumns.length - 1) {
30092
+ csv = csv + props.csvSeparator;
29741
30093
  }
29742
30094
  });
29743
30095
 
29744
- //body
30096
+ // body
29745
30097
  data.forEach(function (record) {
29746
30098
  csv = csv + '\n';
29747
- columns.forEach(function (column, i) {
29748
- var _ref6 = [getColumnProp(column, 'field'), getColumnProp(column, 'exportField'), getColumnProp(column, 'exportable')],
30099
+ exportableColumns.forEach(function (column, i) {
30100
+ var _ref6 = [getColumnProp(column, 'field'), getColumnProp(column, 'exportField')],
29749
30101
  colField = _ref6[0],
29750
- exportField = _ref6[1],
29751
- exportable = _ref6[2];
30102
+ exportField = _ref6[1];
29752
30103
  var field = exportField || colField;
29753
- if (exportable && field) {
29754
- var cellData = ObjectUtils.resolveFieldData(record, field);
29755
- if (cellData != null) {
29756
- if (props.exportFunction) {
29757
- cellData = props.exportFunction({
29758
- data: cellData,
29759
- field: field,
29760
- rowData: record,
29761
- column: column
29762
- });
29763
- } else {
29764
- cellData = String(cellData).replace(/"/g, '""').replace(/\n/g, "\u2028");
29765
- }
30104
+ var cellData = ObjectUtils.resolveFieldData(record, field);
30105
+ if (cellData != null) {
30106
+ if (props.exportFunction) {
30107
+ cellData = props.exportFunction({
30108
+ data: cellData,
30109
+ field: field,
30110
+ rowData: record,
30111
+ column: column
30112
+ });
29766
30113
  } else {
29767
- cellData = '';
29768
- }
29769
- csv = csv + ('"' + cellData + '"');
29770
- if (i < columns.length - 1) {
29771
- csv = csv + props.csvSeparator;
30114
+ cellData = String(cellData).replace(/"/g, '""').replace(/\n/g, "\u2028");
29772
30115
  }
30116
+ } else {
30117
+ cellData = '';
30118
+ }
30119
+ csv = csv + ('"' + cellData + '"');
30120
+ if (i < exportableColumns.length - 1) {
30121
+ csv = csv + props.csvSeparator;
29773
30122
  }
29774
30123
  });
29775
30124
  });
@@ -30034,6 +30383,9 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
30034
30383
  var frozenBody = ObjectUtils.isNotEmpty(props.frozenValue) && /*#__PURE__*/React__namespace.createElement(TableBody, {
30035
30384
  hostName: "DataTable",
30036
30385
  ref: frozenBodyRef,
30386
+ cellMemo: props.cellMemo,
30387
+ cellMemoProps: props.cellMemoProps,
30388
+ cellMemoPropsDepth: props.cellMemoPropsDepth,
30037
30389
  cellClassName: props.cellClassName,
30038
30390
  cellSelection: props.cellSelection,
30039
30391
  checkIcon: props.checkIcon,
@@ -30118,6 +30470,9 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
30118
30470
  var body = /*#__PURE__*/React__namespace.createElement(TableBody, {
30119
30471
  hostName: "DataTable",
30120
30472
  ref: bodyRef,
30473
+ cellMemo: props.cellMemo,
30474
+ cellMemoProps: props.cellMemoProps,
30475
+ cellMemoPropsDepth: props.cellMemoPropsDepth,
30121
30476
  cellClassName: props.cellClassName,
30122
30477
  cellSelection: props.cellSelection,
30123
30478
  checkIcon: props.checkIcon,
@@ -32538,7 +32893,7 @@ var FileUpload = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
32538
32893
  var k = 1024;
32539
32894
  var dm = 3;
32540
32895
  var sizes = localeOption('fileSizeTypes');
32541
- if (bytes === 0) {
32896
+ if (bytes <= 0) {
32542
32897
  return "0 ".concat(sizes[0]);
32543
32898
  }
32544
32899
  var i = Math.floor(Math.log(bytes) / Math.log(k));
@@ -32560,7 +32915,8 @@ var FileUpload = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
32560
32915
  var selectedFiles = event.dataTransfer ? event.dataTransfer.files : event.target.files;
32561
32916
  for (var i = 0; i < selectedFiles.length; i++) {
32562
32917
  var file = selectedFiles[i];
32563
- if (!isFileSelected(file) && validate(file)) {
32918
+ var shouldAddFile = props.multiple ? !isFileSelected(file) && validate(file) : validate(file);
32919
+ if (shouldAddFile) {
32564
32920
  file.objectURL = window.URL.createObjectURL(file);
32565
32921
  currentFiles.push(file);
32566
32922
  }
@@ -32576,6 +32932,7 @@ var FileUpload = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
32576
32932
  });
32577
32933
  }
32578
32934
  clearInput();
32935
+ setFocusedState(false);
32579
32936
  if (props.mode === 'basic' && currentFiles.length > 0) {
32580
32937
  fileInputRef.current.style.display = 'none';
32581
32938
  }
@@ -34302,6 +34659,7 @@ var Galleria = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
34302
34659
  },
34303
34660
  options: props.transitionOptions,
34304
34661
  unmountOnExit: true,
34662
+ appear: true,
34305
34663
  onEnter: onEnter,
34306
34664
  onEntering: onEntering,
34307
34665
  onEntered: onEntered,
@@ -35645,7 +36003,7 @@ var InputMask = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
35645
36003
  var updateValue = function updateValue(allow) {
35646
36004
  var pos;
35647
36005
  if (elementRef.current) {
35648
- if (props.value == null) {
36006
+ if (ObjectUtils.isEmpty(props.value)) {
35649
36007
  elementRef.current.value = '';
35650
36008
  } else {
35651
36009
  elementRef.current.value = props.value;
@@ -38756,13 +39114,6 @@ var MentionBase = ComponentBase.extend({
38756
39114
  inputRef: null,
38757
39115
  inputStyle: null,
38758
39116
  itemTemplate: null,
38759
- panelClassName: null,
38760
- panelStyle: null,
38761
- scrollHeight: '200px',
38762
- style: null,
38763
- suggestions: null,
38764
- transitionOptions: null,
38765
- trigger: '@',
38766
39117
  onBlur: null,
38767
39118
  onChange: null,
38768
39119
  onFocus: null,
@@ -38771,6 +39122,14 @@ var MentionBase = ComponentBase.extend({
38771
39122
  onSearch: null,
38772
39123
  onSelect: null,
38773
39124
  onShow: null,
39125
+ panelClassName: null,
39126
+ panelStyle: null,
39127
+ scrollHeight: '200px',
39128
+ style: null,
39129
+ suggestions: null,
39130
+ transitionOptions: null,
39131
+ trigger: '@',
39132
+ variant: null,
38774
39133
  children: undefined
38775
39134
  },
38776
39135
  css: {
@@ -38839,8 +39198,15 @@ var Mention = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.f
38839
39198
  target: elementRef,
38840
39199
  overlay: overlayRef,
38841
39200
  listener: function listener(event, _ref) {
38842
- var valid = _ref.valid;
38843
- valid && hide();
39201
+ var valid = _ref.valid,
39202
+ type = _ref.type;
39203
+ if (valid) {
39204
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
39205
+ hide();
39206
+ } else if (!DomHandler.isDocument(event.target)) {
39207
+ alignOverlay();
39208
+ }
39209
+ }
38844
39210
  },
38845
39211
  when: overlayVisibleState
38846
39212
  }),
@@ -39243,6 +39609,7 @@ var Mention = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.f
39243
39609
  style: props.inputStyle
39244
39610
  }, inputProps), {}, {
39245
39611
  unstyled: props.unstyled,
39612
+ variant: props.variant,
39246
39613
  autoResize: props.autoResize,
39247
39614
  onFocus: onFocus,
39248
39615
  onBlur: onBlur,
@@ -39410,10 +39777,15 @@ var Menu = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
39410
39777
  target: targetRef,
39411
39778
  overlay: menuRef,
39412
39779
  listener: function listener(event, _ref) {
39413
- var valid = _ref.valid;
39780
+ var valid = _ref.valid,
39781
+ type = _ref.type;
39414
39782
  if (valid) {
39415
- hide(event);
39416
- setFocusedOptionIndex(-1);
39783
+ if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
39784
+ hide(event);
39785
+ setFocusedOptionIndex(-1);
39786
+ } else if (!DomHandler.isDocument(event.target)) {
39787
+ DomHandler.absolutePosition(menuRef.current, targetRef.current, props.popupAlignment);
39788
+ }
39417
39789
  }
39418
39790
  },
39419
39791
  when: visibleState
@@ -39469,6 +39841,9 @@ var Menu = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
39469
39841
  props.onFocus && props.onFocus(event);
39470
39842
  };
39471
39843
  var onListBlur = function onListBlur(event) {
39844
+ var currentTarget = event.currentTarget,
39845
+ relatedTarget = event.relatedTarget;
39846
+ if (relatedTarget && currentTarget.contains(relatedTarget)) return;
39472
39847
  setFocused(false);
39473
39848
  setFocusedOptionIndex(-1);
39474
39849
  props.onBlur && props.onBlur(event);
@@ -39729,6 +40104,9 @@ var Menu = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forw
39729
40104
  className: classNames(item.className, cx('menuitem', {
39730
40105
  focused: focusedOptionIndex === key
39731
40106
  })),
40107
+ onClick: function onClick(event) {
40108
+ return onItemClick(event, item, key);
40109
+ },
39732
40110
  style: sx('menuitem', {
39733
40111
  item: item
39734
40112
  }),
@@ -40071,7 +40449,6 @@ var MenubarSub = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
40071
40449
  'aria-disabled': disabled,
40072
40450
  'aria-expanded': group ? active : undefined,
40073
40451
  'aria-haspopup': group && !item.url ? 'menu' : undefined,
40074
- 'aria-level': props.level + 1,
40075
40452
  'aria-setsize': getAriaSetSize(),
40076
40453
  'aria-posinset': getAriaPosInset(index),
40077
40454
  'data-p-highlight': active,
@@ -40189,12 +40566,13 @@ var Menubar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.f
40189
40566
  var _useEventListener = useEventListener({
40190
40567
  type: 'click',
40191
40568
  listener: function listener(event) {
40192
- if (isOutsideClicked(event)) {
40193
- var isOutsideContainer = elementRef.current && !elementRef.current.contains(event.target);
40194
- if (isOutsideContainer) {
40195
- hide();
40196
- }
40569
+ var isOutsideButton = menuButtonRef.current && !menuButtonRef.current.contains(event.target);
40570
+ if (isOutsideButton) {
40571
+ hide();
40197
40572
  }
40573
+ },
40574
+ options: {
40575
+ capture: true
40198
40576
  }
40199
40577
  }),
40200
40578
  _useEventListener2 = _slicedToArray(_useEventListener, 2),
@@ -40249,9 +40627,6 @@ var Menubar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.f
40249
40627
  var menuButtonKeydown = function menuButtonKeydown(event) {
40250
40628
  (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && toggle(event);
40251
40629
  };
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
40630
  var getItemProp = function getItemProp(item, name) {
40256
40631
  return item ? ObjectUtils.getItemValue(item[name]) : undefined;
40257
40632
  };
@@ -41339,6 +41714,7 @@ var MultiSelectHeader = /*#__PURE__*/React__namespace.memo(function (props) {
41339
41714
  role: "searchbox",
41340
41715
  value: props.filterValue,
41341
41716
  onChange: onFilter,
41717
+ onKeyDown: props.onFilterKeyDown,
41342
41718
  className: "p-multiselect-filter",
41343
41719
  placeholder: props.filterPlaceholder,
41344
41720
  pt: ptm('filterInput'),
@@ -41494,9 +41870,7 @@ var MultiSelectItem = /*#__PURE__*/React__namespace.memo(function (props) {
41494
41870
  'data-p-highlight': props.selected,
41495
41871
  'data-p-disabled': props.disabled
41496
41872
  }, getPTOptions('item'));
41497
- return /*#__PURE__*/React__namespace.createElement("li", _extends({}, itemProps, {
41498
- key: props.index + '_multiselectitem'
41499
- }), /*#__PURE__*/React__namespace.createElement("div", checkboxContainerProps, /*#__PURE__*/React__namespace.createElement(Checkbox, {
41873
+ return /*#__PURE__*/React__namespace.createElement("li", itemProps, /*#__PURE__*/React__namespace.createElement("div", checkboxContainerProps, /*#__PURE__*/React__namespace.createElement(Checkbox, {
41500
41874
  ref: checkboxRef,
41501
41875
  checked: props.selected,
41502
41876
  icon: checkboxIcon,
@@ -41564,6 +41938,7 @@ var MultiSelectPanel = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__na
41564
41938
  getOptionValue: props.getOptionValue,
41565
41939
  updateModel: props.updateModel,
41566
41940
  onFilter: onFilterInputChange,
41941
+ onFilterKeyDown: props.onFilterKeyDown,
41567
41942
  filterPlaceholder: props.filterPlaceholder,
41568
41943
  onClose: props.onCloseClick,
41569
41944
  showSelectAll: props.showSelectAll,
@@ -41856,9 +42231,13 @@ var MultiSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
41856
42231
  valid = _ref.valid;
41857
42232
  if (valid) {
41858
42233
  if (type === 'outside') {
41859
- !isClearClicked(event) && !isSelectAllClicked(event) && hide();
41860
- } else {
42234
+ if (!isClearClicked(event) && !isSelectAllClicked(event)) {
42235
+ hide();
42236
+ }
42237
+ } else if (context.hideOverlaysOnDocumentScrolling) {
41861
42238
  hide();
42239
+ } else if (!DomHandler.isDocument(event.target)) {
42240
+ alignOverlay();
41862
42241
  }
41863
42242
  }
41864
42243
  },
@@ -42127,6 +42506,52 @@ var MultiSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
42127
42506
  }
42128
42507
  setClicked(false);
42129
42508
  };
42509
+ var onFilterKeyDown = function onFilterKeyDown(event) {
42510
+ switch (event.code) {
42511
+ case 'ArrowUp':
42512
+ if (props.inline) {
42513
+ break;
42514
+ }
42515
+ onArrowUpKey(event);
42516
+ break;
42517
+ case 'ArrowDown':
42518
+ if (props.inline) {
42519
+ break;
42520
+ }
42521
+ onArrowDownKey(event);
42522
+ break;
42523
+ case 'NumpadEnter':
42524
+ case 'Enter':
42525
+ if (props.inline) {
42526
+ break;
42527
+ }
42528
+ onEnterKey(event);
42529
+ break;
42530
+ case 'Home':
42531
+ if (props.inline) {
42532
+ break;
42533
+ }
42534
+ onHomeKey(event);
42535
+ event.preventDefault();
42536
+ break;
42537
+ case 'End':
42538
+ if (props.inline) {
42539
+ break;
42540
+ }
42541
+ onEndKey(event);
42542
+ event.preventDefault();
42543
+ break;
42544
+ case 'Escape':
42545
+ if (props.inline) {
42546
+ break;
42547
+ }
42548
+ hide();
42549
+ break;
42550
+ case 'Tab':
42551
+ onTabKey(event);
42552
+ break;
42553
+ }
42554
+ };
42130
42555
  var onSelectAll = function onSelectAll(event) {
42131
42556
  if (props.onSelectAll) {
42132
42557
  props.onSelectAll(event);
@@ -42539,20 +42964,19 @@ var MultiSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
42539
42964
  return selectedItemsLabel;
42540
42965
  };
42541
42966
  var getLabel = function getLabel() {
42542
- var label;
42543
- if (!empty && !props.fixedPlaceholder) {
42544
- var _props$value;
42545
- if (ObjectUtils.isNotEmpty(props.maxSelectedLabels) && ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.length) > props.maxSelectedLabels) {
42546
- return getSelectedItemsLabel();
42547
- }
42548
- if (ObjectUtils.isArray(props.value)) {
42549
- return props.value.reduce(function (acc, value, index) {
42550
- return acc + (index !== 0 ? ', ' : '') + getLabelByValue(value);
42551
- }, '');
42552
- }
42967
+ var _props$value;
42968
+ if (empty || props.fixedPlaceholder) {
42553
42969
  return '';
42554
42970
  }
42555
- return label;
42971
+ if (ObjectUtils.isNotEmpty(props.maxSelectedLabels) && ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.length) > props.maxSelectedLabels) {
42972
+ return getSelectedItemsLabel();
42973
+ }
42974
+ if (ObjectUtils.isArray(props.value)) {
42975
+ return props.value.reduce(function (acc, value, index) {
42976
+ return acc + (index !== 0 ? ', ' : '') + getLabelByValue(value);
42977
+ }, '');
42978
+ }
42979
+ return '';
42556
42980
  };
42557
42981
  var getLabelContent = function getLabelContent() {
42558
42982
  var valueLength = props.value ? props.value.length : 0;
@@ -42825,6 +43249,7 @@ var MultiSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespa
42825
43249
  getOptionValue: getOptionValue,
42826
43250
  updateModel: updateModel,
42827
43251
  onFilterInputChange: onFilterInputChange,
43252
+ onFilterKeyDown: onFilterKeyDown,
42828
43253
  resetFilter: resetFilter,
42829
43254
  onCloseClick: onCloseClick,
42830
43255
  onSelectAll: onSelectAll,
@@ -42865,12 +43290,20 @@ var classes$v = {
42865
43290
  },
42866
43291
  root: function root(_ref2) {
42867
43292
  var props = _ref2.props;
42868
- return classNames('p-multistatecheckbox p-checkbox p-component', props.classNames);
43293
+ return classNames('p-multistatecheckbox p-checkbox p-component', props.classNames, {
43294
+ 'p-variant-filled': props.variant === 'filled'
43295
+ });
43296
+ },
43297
+ checkbox: function checkbox(_ref3) {
43298
+ var props = _ref3.props;
43299
+ return classNames(props.className, {
43300
+ 'p-invalid': props.invalid
43301
+ });
42869
43302
  }
42870
43303
  };
42871
43304
  var inlineStyles$9 = {
42872
- checkbox: function checkbox(_ref3) {
42873
- var selectedOption = _ref3.selectedOption;
43305
+ checkbox: function checkbox(_ref4) {
43306
+ var selectedOption = _ref4.selectedOption;
42874
43307
  return selectedOption && selectedOption.style;
42875
43308
  }
42876
43309
  };
@@ -42895,7 +43328,9 @@ var MultiStateCheckboxBase = ComponentBase.extend({
42895
43328
  tooltip: null,
42896
43329
  tooltipOptions: null,
42897
43330
  value: null,
42898
- children: undefined
43331
+ children: undefined,
43332
+ invalid: false,
43333
+ variant: null
42899
43334
  },
42900
43335
  css: {
42901
43336
  classes: classes$v,
@@ -43044,7 +43479,6 @@ var MultiStateCheckbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__
43044
43479
  var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
43045
43480
  var icon = createIcon();
43046
43481
  var ariaValueLabel = selectedOption ? getOptionAriaLabel(selectedOption) : ariaLabel('nullLabel');
43047
- var ariaChecked = selectedOption ? 'true' : 'false';
43048
43482
  var rootProps = mergeProps({
43049
43483
  ref: elementRef,
43050
43484
  id: props.id,
@@ -43053,7 +43487,8 @@ var MultiStateCheckbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__
43053
43487
  onClick: onClick
43054
43488
  }, MultiStateCheckboxBase.getOtherProps(props), ptm('root'));
43055
43489
  var checkboxProps = mergeProps(_objectSpread$I({
43056
- className: classNames(props.className),
43490
+ id: props.id + '_checkbox',
43491
+ className: cx('checkbox'),
43057
43492
  style: sx('checkbox', {
43058
43493
  selectedOption: selectedOption
43059
43494
  }),
@@ -43061,8 +43496,6 @@ var MultiStateCheckbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__
43061
43496
  onFocus: onFocus,
43062
43497
  onBlur: onBlur,
43063
43498
  onKeyDown: onKeyDown,
43064
- role: 'checkbox',
43065
- 'aria-checked': ariaChecked,
43066
43499
  onChange: onClick,
43067
43500
  checked: !!selectedOption,
43068
43501
  disabled: props === null || props === void 0 ? void 0 : props.disabled,
@@ -43604,6 +44037,7 @@ var OrderList = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
43604
44037
  var styleElementRef = React__namespace.useRef(null);
43605
44038
  var reorderDirection = React__namespace.useRef(null);
43606
44039
  var listElementRef = React__namespace.useRef(null);
44040
+ var reorderedListElementRef = React__namespace.useRef(null);
43607
44041
  var metaData = {
43608
44042
  props: props,
43609
44043
  state: {
@@ -43829,9 +44263,9 @@ var OrderList = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
43829
44263
  }
43830
44264
  var _focusedOptionIndex = items[order] ? items[order].getAttribute('id') : -1;
43831
44265
  setFocusedOptionIndex(_focusedOptionIndex);
43832
- scrollInView(_focusedOptionIndex);
44266
+ scrollInViewWithFocus(_focusedOptionIndex);
43833
44267
  };
43834
- var scrollInView = function scrollInView(id) {
44268
+ var scrollInViewWithFocus = function scrollInViewWithFocus(id) {
43835
44269
  var listElement = getListElement();
43836
44270
  var element = DomHandler.findSingle(listElement, "[data-pc-section=\"item\"][id=\"".concat(id, "\"]"));
43837
44271
  if (element) {
@@ -43841,6 +44275,33 @@ var OrderList = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
43841
44275
  });
43842
44276
  }
43843
44277
  };
44278
+ var scrollInView = function scrollInView(listContainer) {
44279
+ var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
44280
+ var selectedItems = listContainer.getElementsByClassName('p-highlight');
44281
+ if (ObjectUtils.isNotEmpty(selectedItems)) {
44282
+ DomHandler.scrollInView(listContainer, direction === -1 ? selectedItems[0] : selectedItems[selectedItems.length - 1]);
44283
+ }
44284
+ };
44285
+ var handleScrollPosition = function handleScrollPosition(listElement, direction) {
44286
+ if (listElement) {
44287
+ switch (direction) {
44288
+ case 'up':
44289
+ scrollInView(listElement, -1);
44290
+ break;
44291
+ case 'top':
44292
+ listElement.scrollTop = 0;
44293
+ break;
44294
+ case 'down':
44295
+ scrollInView(listElement, 1);
44296
+ break;
44297
+ case 'bottom':
44298
+ setTimeout(function () {
44299
+ return listElement.scrollTop = listElement.scrollHeight;
44300
+ }, 100);
44301
+ break;
44302
+ }
44303
+ }
44304
+ };
43844
44305
  var onFilter = function onFilter(event) {
43845
44306
  var _filterValue = event.target.value;
43846
44307
  setFilterValueState(_filterValue);
@@ -43875,6 +44336,7 @@ var OrderList = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
43875
44336
  });
43876
44337
  }
43877
44338
  reorderDirection.current = event.direction;
44339
+ reorderedListElementRef.current = getListElement();
43878
44340
  };
43879
44341
  var createStyle = function createStyle() {
43880
44342
  if (!styleElementRef.current) {
@@ -43911,7 +44373,9 @@ var OrderList = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
43911
44373
  setFocusedOptionId(_focusedOptionId);
43912
44374
  }, [focusedOptionIndex]);
43913
44375
  useUpdateEffect(function () {
43914
- if (reorderDirection.current) {
44376
+ if (reorderedListElementRef.current) {
44377
+ handleScrollPosition(reorderedListElementRef.current, reorderDirection.current);
44378
+ reorderedListElementRef.current = null;
43915
44379
  reorderDirection.current = null;
43916
44380
  }
43917
44381
  });
@@ -44402,18 +44866,17 @@ var OverlayPanel = /*#__PURE__*/React__namespace.forwardRef(function (inProps, r
44402
44866
  var type = _ref.type,
44403
44867
  valid = _ref.valid;
44404
44868
  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;
44869
+ if (type === 'outside') {
44870
+ if (props.dismissable && !isPanelClicked.current) {
44871
+ hide();
44872
+ }
44873
+ isPanelClicked.current = false;
44874
+ } else if (context.hideOverlaysOnDocumentScrolling) {
44875
+ hide();
44876
+ } else if (!DomHandler.isDocument(event.target)) {
44877
+ align();
44414
44878
  }
44415
44879
  }
44416
- isPanelClicked.current = false;
44417
44880
  },
44418
44881
  when: visibleState
44419
44882
  }),
@@ -46170,8 +46633,15 @@ var Password = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
46170
46633
  target: elementRef,
46171
46634
  overlay: overlayRef,
46172
46635
  listener: function listener(event, _ref) {
46173
- var valid = _ref.valid;
46174
- valid && hide();
46636
+ var valid = _ref.valid,
46637
+ type = _ref.type;
46638
+ if (valid) {
46639
+ if (type === 'outside' || context.hideOverlaysOnDocumentScrolling) {
46640
+ hide();
46641
+ } else if (!DomHandler.isDocument(event.target)) {
46642
+ alignOverlay();
46643
+ }
46644
+ }
46175
46645
  },
46176
46646
  when: overlayVisibleState
46177
46647
  }),
@@ -49736,8 +50206,15 @@ var SlideMenu = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace
49736
50206
  target: targetRef,
49737
50207
  overlay: menuRef,
49738
50208
  listener: function listener(event, _ref) {
49739
- var valid = _ref.valid;
49740
- valid && hide(event);
50209
+ var valid = _ref.valid,
50210
+ type = _ref.type;
50211
+ if (valid) {
50212
+ if (type === 'outside' || context.hideOverlaysOnDocumentScrolling) {
50213
+ hide(event);
50214
+ } else if (!DomHandler.isDocument(event.target)) {
50215
+ DomHandler.absolutePosition(menuRef.current, targetRef.current);
50216
+ }
50217
+ }
49741
50218
  },
49742
50219
  when: visibleState
49743
50220
  }),
@@ -57371,7 +57848,9 @@ var TreeSelectBase = ComponentBase.extend({
57371
57848
  onBlur: null,
57372
57849
  onFilterValueChange: null,
57373
57850
  onHide: null,
57851
+ onNodeClick: null,
57374
57852
  onNodeCollapse: null,
57853
+ onNodeDoubleClick: null,
57375
57854
  onNodeExpand: null,
57376
57855
  onNodeSelect: null,
57377
57856
  onNodeUnselect: null,
@@ -57485,9 +57964,9 @@ var TreeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
57485
57964
  expandedKeysState = _React$useState6[0],
57486
57965
  setExpandedKeysState = _React$useState6[1];
57487
57966
  var _useDebounce = useDebounce('', props.filterDelay || 0),
57488
- _useDebounce2 = _slicedToArray(_useDebounce, 3);
57489
- _useDebounce2[0];
57490
- var filterValueState = _useDebounce2[1],
57967
+ _useDebounce2 = _slicedToArray(_useDebounce, 3),
57968
+ filterValue = _useDebounce2[0],
57969
+ filterValueState = _useDebounce2[1],
57491
57970
  setFilterValueState = _useDebounce2[2];
57492
57971
  var elementRef = React__namespace.useRef(null);
57493
57972
  var overlayRef = React__namespace.useRef(null);
@@ -57534,8 +58013,15 @@ var TreeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
57534
58013
  target: elementRef,
57535
58014
  overlay: overlayRef,
57536
58015
  listener: function listener(event, _ref) {
57537
- var valid = _ref.valid;
57538
- valid && hide();
58016
+ var valid = _ref.valid,
58017
+ type = _ref.type;
58018
+ if (valid) {
58019
+ if (type === 'outside' || context.hideOverlaysOnDocumentScrolling) {
58020
+ hide();
58021
+ } else if (!DomHandler.isDocument(event.target)) {
58022
+ alignOverlay();
58023
+ }
58024
+ }
57539
58025
  },
57540
58026
  when: overlayVisibleState
57541
58027
  }),
@@ -58056,6 +58542,8 @@ var TreeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
58056
58542
  onCollapse: props.onNodeCollapse,
58057
58543
  onExpand: props.onNodeExpand,
58058
58544
  onFilterValueChange: onFilterValueChange,
58545
+ onNodeClick: props.onNodeClick,
58546
+ onNodeDoubleClick: props.onNodeDoubleClick,
58059
58547
  onSelect: onNodeSelect,
58060
58548
  onSelectionChange: onSelectionChange,
58061
58549
  onToggle: onNodeToggle,
@@ -58073,15 +58561,15 @@ var TreeSelect = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespac
58073
58561
  };
58074
58562
  var createFilterElement = function createFilterElement() {
58075
58563
  if (props.filter) {
58076
- var _filterValue = props.onFilterValueChange ? props.filterValue : filteredValue;
58077
- _filterValue = ObjectUtils.isNotEmpty(_filterValue) ? _filterValue : '';
58564
+ var newValue = props.onFilterValueChange ? props.filterValue : filterValue;
58565
+ newValue = ObjectUtils.isNotEmpty(newValue) ? newValue : '';
58078
58566
  var filterContainerProps = mergeProps({
58079
58567
  className: cx('filterContainer')
58080
58568
  }, ptm('filterContainer'));
58081
58569
  var filterProps = mergeProps({
58082
58570
  ref: filterInputRef,
58083
58571
  type: 'text',
58084
- value: _filterValue,
58572
+ value: newValue,
58085
58573
  autoComplete: 'off',
58086
58574
  className: cx('filter'),
58087
58575
  placeholder: props.filterPlaceholder,
@@ -61499,7 +61987,7 @@ var TriStateCheckboxBase = ComponentBase.extend({
61499
61987
  tooltip: null,
61500
61988
  tooltipOptions: null,
61501
61989
  uncheckIcon: null,
61502
- value: '',
61990
+ value: null,
61503
61991
  children: undefined
61504
61992
  },
61505
61993
  css: {
@@ -61513,7 +62001,7 @@ var TriStateCheckbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__na
61513
62001
  var mergeProps = useMergeProps();
61514
62002
  var context = React__namespace.useContext(PrimeReactContext);
61515
62003
  var props = TriStateCheckboxBase.getProps(inProps, context);
61516
- var _useState = React.useState(''),
62004
+ var _useState = React.useState(null),
61517
62005
  _useState2 = _slicedToArray(_useState, 2),
61518
62006
  checkBoxValue = _useState2[0],
61519
62007
  setCheckBoxValue = _useState2[1];
@@ -61528,10 +62016,10 @@ var TriStateCheckbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__na
61528
62016
  name: 'tristatecheckbox'
61529
62017
  });
61530
62018
  React.useEffect(function () {
61531
- if ([true, false, ''].includes(props.value)) {
62019
+ if ([true, false, null].includes(props.value)) {
61532
62020
  setCheckBoxValue(props.value);
61533
62021
  } else {
61534
- setCheckBoxValue('');
62022
+ setCheckBoxValue(null);
61535
62023
  }
61536
62024
  }, [props.value]);
61537
62025
  var onChange = function onChange(event) {
@@ -61539,12 +62027,12 @@ var TriStateCheckbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__na
61539
62027
  return;
61540
62028
  }
61541
62029
  var newValue;
61542
- if (checkBoxValue === '') {
62030
+ if (checkBoxValue === null) {
61543
62031
  newValue = true;
61544
62032
  } else if (checkBoxValue === true) {
61545
62033
  newValue = false;
61546
62034
  } else if (checkBoxValue === false) {
61547
- newValue = '';
62035
+ newValue = null;
61548
62036
  }
61549
62037
  if (props.onChange) {
61550
62038
  props.onChange({
@@ -61615,6 +62103,7 @@ var TriStateCheckbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__na
61615
62103
  var ariaValueLabel = checkBoxValue ? ariaLabel('trueLabel') : checkBoxValue === false ? ariaLabel('falseLabel') : ariaLabel('nullLabel');
61616
62104
  var ariaChecked = checkBoxValue ? 'true' : 'false';
61617
62105
  var boxProps = mergeProps(_objectSpread({
62106
+ id: props.id + '_box',
61618
62107
  className: cx('box'),
61619
62108
  tabIndex: props.disabled ? '-1' : props.tabIndex,
61620
62109
  onFocus: onFocus,