@capillarytech/blaze-ui 1.0.2 → 1.0.3-alpha.10

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 (243) hide show
  1. package/CapUnifiedSelect/CapUnifiedSelect.d.ts +153 -0
  2. package/CapUnifiedSelect/CapUnifiedSelect.d.ts.map +1 -0
  3. package/CapUnifiedSelect/constants.d.ts +57 -0
  4. package/CapUnifiedSelect/constants.d.ts.map +1 -0
  5. package/{dist/CapUnifiedSelect → CapUnifiedSelect}/index.js +1327 -66
  6. package/CapUnifiedSelect/index.js.map +1 -0
  7. package/CapUnifiedSelect/testData.d.ts +107 -0
  8. package/CapUnifiedSelect/testData.d.ts.map +1 -0
  9. package/{dist/index.js → index.js} +1282 -66
  10. package/index.js.map +1 -0
  11. package/package.json +101 -199
  12. package/{dist/utils → utils}/index.js.map +1 -1
  13. package/{dist/utils → utils}/styles.d.ts +1 -1
  14. package/{dist/utils → utils}/styles.d.ts.map +1 -1
  15. package/dist/CapUnifiedSelect/CapUnifiedSelect.d.ts +0 -52
  16. package/dist/CapUnifiedSelect/CapUnifiedSelect.d.ts.map +0 -1
  17. package/dist/CapUnifiedSelect/index.js.map +0 -1
  18. package/dist/index.js.map +0 -1
  19. /package/{dist/CapAlert → CapAlert}/CapAlert.d.ts +0 -0
  20. /package/{dist/CapAlert → CapAlert}/CapAlert.d.ts.map +0 -0
  21. /package/{dist/CapAlert → CapAlert}/CapAlert.test.d.ts +0 -0
  22. /package/{dist/CapAlert → CapAlert}/CapAlert.test.d.ts.map +0 -0
  23. /package/{dist/CapAlert → CapAlert}/index.d.ts +0 -0
  24. /package/{dist/CapAlert → CapAlert}/index.d.ts.map +0 -0
  25. /package/{dist/CapAlert → CapAlert}/index.js +0 -0
  26. /package/{dist/CapAlert → CapAlert}/index.js.map +0 -0
  27. /package/{dist/CapButton → CapButton}/CapButton.d.ts +0 -0
  28. /package/{dist/CapButton → CapButton}/CapButton.d.ts.map +0 -0
  29. /package/{dist/CapButton → CapButton}/CapButton.test.d.ts +0 -0
  30. /package/{dist/CapButton → CapButton}/CapButton.test.d.ts.map +0 -0
  31. /package/{dist/CapButton → CapButton}/index.d.ts +0 -0
  32. /package/{dist/CapButton → CapButton}/index.d.ts.map +0 -0
  33. /package/{dist/CapButton → CapButton}/index.js +0 -0
  34. /package/{dist/CapButton → CapButton}/index.js.map +0 -0
  35. /package/{dist/CapCard → CapCard}/CapCard.d.ts +0 -0
  36. /package/{dist/CapCard → CapCard}/CapCard.d.ts.map +0 -0
  37. /package/{dist/CapCard → CapCard}/CapCard.test.d.ts +0 -0
  38. /package/{dist/CapCard → CapCard}/CapCard.test.d.ts.map +0 -0
  39. /package/{dist/CapCard → CapCard}/index.d.ts +0 -0
  40. /package/{dist/CapCard → CapCard}/index.d.ts.map +0 -0
  41. /package/{dist/CapCard → CapCard}/index.js +0 -0
  42. /package/{dist/CapCard → CapCard}/index.js.map +0 -0
  43. /package/{dist/CapCheckbox → CapCheckbox}/CapCheckbox.d.ts +0 -0
  44. /package/{dist/CapCheckbox → CapCheckbox}/CapCheckbox.d.ts.map +0 -0
  45. /package/{dist/CapCheckbox → CapCheckbox}/CapCheckbox.test.d.ts +0 -0
  46. /package/{dist/CapCheckbox → CapCheckbox}/CapCheckbox.test.d.ts.map +0 -0
  47. /package/{dist/CapCheckbox → CapCheckbox}/index.d.ts +0 -0
  48. /package/{dist/CapCheckbox → CapCheckbox}/index.d.ts.map +0 -0
  49. /package/{dist/CapCheckbox → CapCheckbox}/index.js +0 -0
  50. /package/{dist/CapCheckbox → CapCheckbox}/index.js.map +0 -0
  51. /package/{dist/CapColumn → CapColumn}/CapColumn.d.ts +0 -0
  52. /package/{dist/CapColumn → CapColumn}/CapColumn.d.ts.map +0 -0
  53. /package/{dist/CapColumn → CapColumn}/CapColumn.test.d.ts +0 -0
  54. /package/{dist/CapColumn → CapColumn}/CapColumn.test.d.ts.map +0 -0
  55. /package/{dist/CapColumn → CapColumn}/index.d.ts +0 -0
  56. /package/{dist/CapColumn → CapColumn}/index.d.ts.map +0 -0
  57. /package/{dist/CapColumn → CapColumn}/index.js +0 -0
  58. /package/{dist/CapColumn → CapColumn}/index.js.map +0 -0
  59. /package/{dist/CapDivider → CapDivider}/CapDivider.d.ts +0 -0
  60. /package/{dist/CapDivider → CapDivider}/CapDivider.d.ts.map +0 -0
  61. /package/{dist/CapDivider → CapDivider}/CapDivider.test.d.ts +0 -0
  62. /package/{dist/CapDivider → CapDivider}/CapDivider.test.d.ts.map +0 -0
  63. /package/{dist/CapDivider → CapDivider}/index.d.ts +0 -0
  64. /package/{dist/CapDivider → CapDivider}/index.d.ts.map +0 -0
  65. /package/{dist/CapDivider → CapDivider}/index.js +0 -0
  66. /package/{dist/CapDivider → CapDivider}/index.js.map +0 -0
  67. /package/{dist/CapDropdown → CapDropdown}/CapDropdown.d.ts +0 -0
  68. /package/{dist/CapDropdown → CapDropdown}/CapDropdown.d.ts.map +0 -0
  69. /package/{dist/CapDropdown → CapDropdown}/CapDropdown.test.d.ts +0 -0
  70. /package/{dist/CapDropdown → CapDropdown}/CapDropdown.test.d.ts.map +0 -0
  71. /package/{dist/CapDropdown → CapDropdown}/index.d.ts +0 -0
  72. /package/{dist/CapDropdown → CapDropdown}/index.d.ts.map +0 -0
  73. /package/{dist/CapDropdown → CapDropdown}/index.js +0 -0
  74. /package/{dist/CapDropdown → CapDropdown}/index.js.map +0 -0
  75. /package/{dist/CapForm → CapForm}/CapForm.d.ts +0 -0
  76. /package/{dist/CapForm → CapForm}/CapForm.d.ts.map +0 -0
  77. /package/{dist/CapForm → CapForm}/CapForm.test.d.ts +0 -0
  78. /package/{dist/CapForm → CapForm}/CapForm.test.d.ts.map +0 -0
  79. /package/{dist/CapForm → CapForm}/index.d.ts +0 -0
  80. /package/{dist/CapForm → CapForm}/index.d.ts.map +0 -0
  81. /package/{dist/CapForm → CapForm}/index.js +0 -0
  82. /package/{dist/CapForm → CapForm}/index.js.map +0 -0
  83. /package/{dist/CapFormItem → CapFormItem}/CapFormItem.d.ts +0 -0
  84. /package/{dist/CapFormItem → CapFormItem}/CapFormItem.d.ts.map +0 -0
  85. /package/{dist/CapFormItem → CapFormItem}/CapFormItem.test.d.ts +0 -0
  86. /package/{dist/CapFormItem → CapFormItem}/CapFormItem.test.d.ts.map +0 -0
  87. /package/{dist/CapFormItem → CapFormItem}/index.d.ts +0 -0
  88. /package/{dist/CapFormItem → CapFormItem}/index.d.ts.map +0 -0
  89. /package/{dist/CapFormItem → CapFormItem}/index.js +0 -0
  90. /package/{dist/CapFormItem → CapFormItem}/index.js.map +0 -0
  91. /package/{dist/CapIcon → CapIcon}/CapIcon.d.ts +0 -0
  92. /package/{dist/CapIcon → CapIcon}/CapIcon.d.ts.map +0 -0
  93. /package/{dist/CapIcon → CapIcon}/CapIcon.test.d.ts +0 -0
  94. /package/{dist/CapIcon → CapIcon}/CapIcon.test.d.ts.map +0 -0
  95. /package/{dist/CapIcon → CapIcon}/index.d.ts +0 -0
  96. /package/{dist/CapIcon → CapIcon}/index.d.ts.map +0 -0
  97. /package/{dist/CapIcon → CapIcon}/index.js +0 -0
  98. /package/{dist/CapIcon → CapIcon}/index.js.map +0 -0
  99. /package/{dist/CapInput → CapInput}/CapInput.d.ts +0 -0
  100. /package/{dist/CapInput → CapInput}/CapInput.d.ts.map +0 -0
  101. /package/{dist/CapInput → CapInput}/CapInput.test.d.ts +0 -0
  102. /package/{dist/CapInput → CapInput}/CapInput.test.d.ts.map +0 -0
  103. /package/{dist/CapInput → CapInput}/Number.d.ts +0 -0
  104. /package/{dist/CapInput → CapInput}/Number.d.ts.map +0 -0
  105. /package/{dist/CapInput → CapInput}/Number.test.d.ts +0 -0
  106. /package/{dist/CapInput → CapInput}/Number.test.d.ts.map +0 -0
  107. /package/{dist/CapInput → CapInput}/Search.d.ts +0 -0
  108. /package/{dist/CapInput → CapInput}/Search.d.ts.map +0 -0
  109. /package/{dist/CapInput → CapInput}/Search.test.d.ts +0 -0
  110. /package/{dist/CapInput → CapInput}/Search.test.d.ts.map +0 -0
  111. /package/{dist/CapInput → CapInput}/TextArea.d.ts +0 -0
  112. /package/{dist/CapInput → CapInput}/TextArea.d.ts.map +0 -0
  113. /package/{dist/CapInput → CapInput}/TextArea.test.d.ts +0 -0
  114. /package/{dist/CapInput → CapInput}/TextArea.test.d.ts.map +0 -0
  115. /package/{dist/CapInput → CapInput}/index.d.ts +0 -0
  116. /package/{dist/CapInput → CapInput}/index.d.ts.map +0 -0
  117. /package/{dist/CapInput → CapInput}/index.js +0 -0
  118. /package/{dist/CapInput → CapInput}/index.js.map +0 -0
  119. /package/{dist/CapLabel → CapLabel}/CapLabel.d.ts +0 -0
  120. /package/{dist/CapLabel → CapLabel}/CapLabel.d.ts.map +0 -0
  121. /package/{dist/CapLabel → CapLabel}/CapLabel.test.d.ts +0 -0
  122. /package/{dist/CapLabel → CapLabel}/CapLabel.test.d.ts.map +0 -0
  123. /package/{dist/CapLabel → CapLabel}/index.d.ts +0 -0
  124. /package/{dist/CapLabel → CapLabel}/index.d.ts.map +0 -0
  125. /package/{dist/CapLabel → CapLabel}/index.js +0 -0
  126. /package/{dist/CapLabel → CapLabel}/index.js.map +0 -0
  127. /package/{dist/CapMenu → CapMenu}/CapMenu.d.ts +0 -0
  128. /package/{dist/CapMenu → CapMenu}/CapMenu.d.ts.map +0 -0
  129. /package/{dist/CapMenu → CapMenu}/CapMenu.test.d.ts +0 -0
  130. /package/{dist/CapMenu → CapMenu}/CapMenu.test.d.ts.map +0 -0
  131. /package/{dist/CapMenu → CapMenu}/index.d.ts +0 -0
  132. /package/{dist/CapMenu → CapMenu}/index.d.ts.map +0 -0
  133. /package/{dist/CapMenu → CapMenu}/index.js +0 -0
  134. /package/{dist/CapMenu → CapMenu}/index.js.map +0 -0
  135. /package/{dist/CapRadio → CapRadio}/CapRadio.d.ts +0 -0
  136. /package/{dist/CapRadio → CapRadio}/CapRadio.d.ts.map +0 -0
  137. /package/{dist/CapRadio → CapRadio}/CapRadio.test.d.ts +0 -0
  138. /package/{dist/CapRadio → CapRadio}/CapRadio.test.d.ts.map +0 -0
  139. /package/{dist/CapRadio → CapRadio}/index.d.ts +0 -0
  140. /package/{dist/CapRadio → CapRadio}/index.d.ts.map +0 -0
  141. /package/{dist/CapRadio → CapRadio}/index.js +0 -0
  142. /package/{dist/CapRadio → CapRadio}/index.js.map +0 -0
  143. /package/{dist/CapRow → CapRow}/CapRow.d.ts +0 -0
  144. /package/{dist/CapRow → CapRow}/CapRow.d.ts.map +0 -0
  145. /package/{dist/CapRow → CapRow}/CapRow.test.d.ts +0 -0
  146. /package/{dist/CapRow → CapRow}/CapRow.test.d.ts.map +0 -0
  147. /package/{dist/CapRow → CapRow}/index.d.ts +0 -0
  148. /package/{dist/CapRow → CapRow}/index.d.ts.map +0 -0
  149. /package/{dist/CapRow → CapRow}/index.js +0 -0
  150. /package/{dist/CapRow → CapRow}/index.js.map +0 -0
  151. /package/{dist/CapSkeleton → CapSkeleton}/CapSkeleton.d.ts +0 -0
  152. /package/{dist/CapSkeleton → CapSkeleton}/CapSkeleton.d.ts.map +0 -0
  153. /package/{dist/CapSkeleton → CapSkeleton}/CapSkeleton.test.d.ts +0 -0
  154. /package/{dist/CapSkeleton → CapSkeleton}/CapSkeleton.test.d.ts.map +0 -0
  155. /package/{dist/CapSkeleton → CapSkeleton}/index.d.ts +0 -0
  156. /package/{dist/CapSkeleton → CapSkeleton}/index.d.ts.map +0 -0
  157. /package/{dist/CapSkeleton → CapSkeleton}/index.js +0 -0
  158. /package/{dist/CapSkeleton → CapSkeleton}/index.js.map +0 -0
  159. /package/{dist/CapSpin → CapSpin}/CapSpin.d.ts +0 -0
  160. /package/{dist/CapSpin → CapSpin}/CapSpin.d.ts.map +0 -0
  161. /package/{dist/CapSpin → CapSpin}/CapSpin.test.d.ts +0 -0
  162. /package/{dist/CapSpin → CapSpin}/CapSpin.test.d.ts.map +0 -0
  163. /package/{dist/CapSpin → CapSpin}/index.d.ts +0 -0
  164. /package/{dist/CapSpin → CapSpin}/index.d.ts.map +0 -0
  165. /package/{dist/CapSpin → CapSpin}/index.js +0 -0
  166. /package/{dist/CapSpin → CapSpin}/index.js.map +0 -0
  167. /package/{dist/CapSwitch → CapSwitch}/CapSwitch.d.ts +0 -0
  168. /package/{dist/CapSwitch → CapSwitch}/CapSwitch.d.ts.map +0 -0
  169. /package/{dist/CapSwitch → CapSwitch}/CapSwitch.test.d.ts +0 -0
  170. /package/{dist/CapSwitch → CapSwitch}/CapSwitch.test.d.ts.map +0 -0
  171. /package/{dist/CapSwitch → CapSwitch}/index.d.ts +0 -0
  172. /package/{dist/CapSwitch → CapSwitch}/index.d.ts.map +0 -0
  173. /package/{dist/CapSwitch → CapSwitch}/index.js +0 -0
  174. /package/{dist/CapSwitch → CapSwitch}/index.js.map +0 -0
  175. /package/{dist/CapTab → CapTab}/CapTab.d.ts +0 -0
  176. /package/{dist/CapTab → CapTab}/CapTab.d.ts.map +0 -0
  177. /package/{dist/CapTab → CapTab}/CapTab.test.d.ts +0 -0
  178. /package/{dist/CapTab → CapTab}/CapTab.test.d.ts.map +0 -0
  179. /package/{dist/CapTab → CapTab}/index.d.ts +0 -0
  180. /package/{dist/CapTab → CapTab}/index.d.ts.map +0 -0
  181. /package/{dist/CapTab → CapTab}/index.js +0 -0
  182. /package/{dist/CapTab → CapTab}/index.js.map +0 -0
  183. /package/{dist/CapTable → CapTable}/CapTable.d.ts +0 -0
  184. /package/{dist/CapTable → CapTable}/CapTable.d.ts.map +0 -0
  185. /package/{dist/CapTable → CapTable}/CapTable.test.d.ts +0 -0
  186. /package/{dist/CapTable → CapTable}/CapTable.test.d.ts.map +0 -0
  187. /package/{dist/CapTable → CapTable}/index.d.ts +0 -0
  188. /package/{dist/CapTable → CapTable}/index.d.ts.map +0 -0
  189. /package/{dist/CapTable → CapTable}/index.js +0 -0
  190. /package/{dist/CapTable → CapTable}/index.js.map +0 -0
  191. /package/{dist/CapTable → CapTable}/loadable.d.ts +0 -0
  192. /package/{dist/CapTable → CapTable}/loadable.d.ts.map +0 -0
  193. /package/{dist/CapTable → CapTable}/loadable.test.d.ts +0 -0
  194. /package/{dist/CapTable → CapTable}/loadable.test.d.ts.map +0 -0
  195. /package/{dist/CapTestSelect → CapTestSelect}/CapTestSelect.d.ts +0 -0
  196. /package/{dist/CapTestSelect → CapTestSelect}/CapTestSelect.d.ts.map +0 -0
  197. /package/{dist/CapTestSelect → CapTestSelect}/CapTestSelect.test.d.ts +0 -0
  198. /package/{dist/CapTestSelect → CapTestSelect}/CapTestSelect.test.d.ts.map +0 -0
  199. /package/{dist/CapTestSelect → CapTestSelect}/index.d.ts +0 -0
  200. /package/{dist/CapTestSelect → CapTestSelect}/index.d.ts.map +0 -0
  201. /package/{dist/CapTestSelect → CapTestSelect}/index.js +0 -0
  202. /package/{dist/CapTestSelect → CapTestSelect}/index.js.map +0 -0
  203. /package/{dist/CapTooltip → CapTooltip}/CapTooltip.d.ts +0 -0
  204. /package/{dist/CapTooltip → CapTooltip}/CapTooltip.d.ts.map +0 -0
  205. /package/{dist/CapTooltip → CapTooltip}/CapTooltip.test.d.ts +0 -0
  206. /package/{dist/CapTooltip → CapTooltip}/CapTooltip.test.d.ts.map +0 -0
  207. /package/{dist/CapTooltip → CapTooltip}/index.d.ts +0 -0
  208. /package/{dist/CapTooltip → CapTooltip}/index.d.ts.map +0 -0
  209. /package/{dist/CapTooltip → CapTooltip}/index.js +0 -0
  210. /package/{dist/CapTooltip → CapTooltip}/index.js.map +0 -0
  211. /package/{dist/CapTooltipWithInfo → CapTooltipWithInfo}/CapTooltipWithInfo.d.ts +0 -0
  212. /package/{dist/CapTooltipWithInfo → CapTooltipWithInfo}/CapTooltipWithInfo.d.ts.map +0 -0
  213. /package/{dist/CapTooltipWithInfo → CapTooltipWithInfo}/CapTooltipWithInfo.test.d.ts +0 -0
  214. /package/{dist/CapTooltipWithInfo → CapTooltipWithInfo}/CapTooltipWithInfo.test.d.ts.map +0 -0
  215. /package/{dist/CapTooltipWithInfo → CapTooltipWithInfo}/index.d.ts +0 -0
  216. /package/{dist/CapTooltipWithInfo → CapTooltipWithInfo}/index.d.ts.map +0 -0
  217. /package/{dist/CapTooltipWithInfo → CapTooltipWithInfo}/index.js +0 -0
  218. /package/{dist/CapTooltipWithInfo → CapTooltipWithInfo}/index.js.map +0 -0
  219. /package/{dist/CapUnifiedSelect → CapUnifiedSelect}/CapUnifiedSelect.test.d.ts +0 -0
  220. /package/{dist/CapUnifiedSelect → CapUnifiedSelect}/CapUnifiedSelect.test.d.ts.map +0 -0
  221. /package/{dist/CapUnifiedSelect → CapUnifiedSelect}/index.d.ts +0 -0
  222. /package/{dist/CapUnifiedSelect → CapUnifiedSelect}/index.d.ts.map +0 -0
  223. /package/{dist/CapUnifiedSelect → CapUnifiedSelect}/messages.d.ts +0 -0
  224. /package/{dist/CapUnifiedSelect → CapUnifiedSelect}/messages.d.ts.map +0 -0
  225. /package/{dist/LocaleHoc → LocaleHoc}/index.d.ts +0 -0
  226. /package/{dist/LocaleHoc → LocaleHoc}/index.d.ts.map +0 -0
  227. /package/{dist/LocaleHoc → LocaleHoc}/index.js +0 -0
  228. /package/{dist/LocaleHoc → LocaleHoc}/index.js.map +0 -0
  229. /package/{dist/LocaleHoc → LocaleHoc}/index.test.d.ts +0 -0
  230. /package/{dist/LocaleHoc → LocaleHoc}/index.test.d.ts.map +0 -0
  231. /package/{dist/assets → assets}/upload.svg +0 -0
  232. /package/{dist/index.d.ts → index.d.ts} +0 -0
  233. /package/{dist/index.d.ts.map → index.d.ts.map} +0 -0
  234. /package/{dist/styled → styled}/variables.d.ts +0 -0
  235. /package/{dist/styled → styled}/variables.d.ts.map +0 -0
  236. /package/{dist/styled → styled}/variables.scss +0 -0
  237. /package/{dist/utils → utils}/fonts.d.ts +0 -0
  238. /package/{dist/utils → utils}/fonts.d.ts.map +0 -0
  239. /package/{dist/utils → utils}/fonts.test.d.ts +0 -0
  240. /package/{dist/utils → utils}/fonts.test.d.ts.map +0 -0
  241. /package/{dist/utils → utils}/index.d.ts +0 -0
  242. /package/{dist/utils → utils}/index.d.ts.map +0 -0
  243. /package/{dist/utils → utils}/index.js +0 -0
@@ -20391,21 +20391,17 @@ var _react = _interopRequireWildcard(__webpack_require__(9206));
20391
20391
  var _CapIcon = _interopRequireDefault(__webpack_require__(8244));
20392
20392
  var _CapLabel = _interopRequireDefault(__webpack_require__(3737));
20393
20393
  var _CapRow = _interopRequireDefault(__webpack_require__(7375));
20394
+ var _CapSpin = _interopRequireDefault(__webpack_require__(1549));
20394
20395
  var _CapTooltip = _interopRequireDefault(__webpack_require__(5636));
20395
20396
  var _CapTooltipWithInfo = _interopRequireDefault(__webpack_require__(2608));
20397
+ var _constants = __webpack_require__(9788);
20396
20398
  var _styles = _interopRequireDefault(__webpack_require__(8263));
20397
20399
  var _jsxRuntime = __webpack_require__(4848);
20398
- const _excluded = ["type", "options", "value", "onChange", "placeholder", "className", "style", "isError", "errorMessage", "containerClassName", "popoverClassName", "allowClear", "headerLabel", "onUpload", "tooltip", "bylineText", "disabled", "showUpload", "customPopupRender", "showSearch", "searchBasedOn", "onConfirm", "clearText", "noResultCustomText", "noResultCustomIcon", "readOnly"];
20400
+ const _excluded = ["type", "options", "value", "onChange", "placeholder", "className", "style", "isError", "errorMessage", "containerClassName", "popoverClassName", "allowClear", "headerLabel", "onUpload", "uploadLabel", "tooltip", "bylineText", "disabled", "showUpload", "customPopupRender", "showSearch", "searchBasedOn", "onSearch", "searchDebounce", "onConfirm", "clearText", "noResultCustomText", "noResultCustomIcon", "readOnly", "staticValue", "onFooterDownloadChange", "onPopupScroll", "hasMore", "enableVirtualization", "virtualRowHeight", "resetSearch", "resetData", "fetchMissingOptions"];
20399
20401
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
20400
20402
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20401
20403
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
20402
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
20403
- const SELECT_TYPES = {
20404
- SELECT: 'select',
20405
- MULTI_SELECT: 'multiSelect',
20406
- TREE_SELECT: 'treeSelect',
20407
- MULTI_TREE_SELECT: 'multiTreeSelect'
20408
- };
20404
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable max-lines */
20409
20405
  const NoResult = _ref => {
20410
20406
  let {
20411
20407
  noResultCustomText,
@@ -20423,7 +20419,7 @@ const NoResult = _ref => {
20423
20419
  size: "m"
20424
20420
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
20425
20421
  className: _styles.default['cap-unified-select-no-result-text'],
20426
- children: showUpload && (options == null ? void 0 : options.length) === 0 ? noResultCustomText : 'No results found'
20422
+ children: showUpload && (options == null ? void 0 : options.length) === 0 ? noResultCustomText : _constants.DEFAULTS.NO_RESULT_TEXT
20427
20423
  })]
20428
20424
  });
20429
20425
  };
@@ -20508,22 +20504,27 @@ const countSelectedLeaves = (treeMaps, selectedValues) => {
20508
20504
  selectedValues == null || selectedValues.forEach(processNode);
20509
20505
  return (treeMaps == null || (_treeMaps$leafValues = treeMaps.leafValues) == null ? void 0 : _treeMaps$leafValues.reduce((count, leaf) => expandedSet.has(leaf) ? count + 1 : count, 0)) || 0;
20510
20506
  };
20511
- const filterTreeData = function (data, search, searchBasedOn) {
20507
+ const filterTreeData = function (data, search, searchBasedOn, selectedValues) {
20512
20508
  if (searchBasedOn === void 0) {
20513
20509
  searchBasedOn = 'label';
20514
20510
  }
20515
20511
  if (!(data != null && data.length) || !search) return data;
20516
20512
  const searchLower = search.toLowerCase();
20513
+ const selectedSet = new Set(selectedValues || []);
20517
20514
  const nodeMatchesSearch = node => {
20518
20515
  var _node$value, _node$key, _ref3, _node$label;
20519
20516
  const target = searchBasedOn === 'value' ? String((_node$value = node == null ? void 0 : node.value) != null ? _node$value : '') : searchBasedOn === 'key' ? String((_node$key = node == null ? void 0 : node.key) != null ? _node$key : '') : String((_ref3 = (_node$label = node == null ? void 0 : node.label) != null ? _node$label : node == null ? void 0 : node.title) != null ? _ref3 : '');
20520
20517
  return target.toLowerCase().includes(searchLower);
20521
20518
  };
20519
+ const isNodeSelected = node => {
20520
+ return node.value !== undefined && selectedSet.has(node.value);
20521
+ };
20522
20522
  const loop = items => items.reduce((acc, item) => {
20523
20523
  var _item$children;
20524
20524
  if (!item) return acc;
20525
20525
  const children = item != null && (_item$children = item.children) != null && _item$children.length ? loop(item.children) : [];
20526
- if (nodeMatchesSearch(item) || children.length) {
20526
+ // Include node if: matches search OR is selected OR has matching children
20527
+ if (nodeMatchesSearch(item) || isNodeSelected(item) || children.length) {
20527
20528
  acc.push(_extends({}, item, {
20528
20529
  children
20529
20530
  }));
@@ -20534,11 +20535,11 @@ const filterTreeData = function (data, search, searchBasedOn) {
20534
20535
  };
20535
20536
  const CapUnifiedSelect = _ref4 => {
20536
20537
  let {
20537
- type = SELECT_TYPES.SELECT,
20538
+ type = _constants.SELECT_TYPES.SELECT,
20538
20539
  options = [],
20539
20540
  value,
20540
20541
  onChange,
20541
- placeholder = 'Select an option',
20542
+ placeholder = _constants.DEFAULTS.PLACEHOLDER,
20542
20543
  className = '',
20543
20544
  style,
20544
20545
  isError = false,
@@ -20548,6 +20549,7 @@ const CapUnifiedSelect = _ref4 => {
20548
20549
  allowClear = false,
20549
20550
  headerLabel,
20550
20551
  onUpload,
20552
+ uploadLabel = _constants.DEFAULTS.UPLOAD_LABEL,
20551
20553
  tooltip,
20552
20554
  bylineText,
20553
20555
  disabled = false,
@@ -20555,38 +20557,740 @@ const CapUnifiedSelect = _ref4 => {
20555
20557
  customPopupRender = true,
20556
20558
  showSearch = true,
20557
20559
  searchBasedOn = 'label',
20560
+ onSearch,
20561
+ searchDebounce = _constants.TIMEOUTS.DEFAULT_SEARCH_DEBOUNCE,
20558
20562
  onConfirm,
20559
- clearText = 'Clear',
20560
- noResultCustomText = 'No results found',
20561
- noResultCustomIcon = 'warning',
20562
- readOnly = false
20563
+ clearText = _constants.DEFAULTS.CLEAR_TEXT,
20564
+ noResultCustomText = _constants.DEFAULTS.NO_RESULT_TEXT,
20565
+ noResultCustomIcon = _constants.DEFAULTS.NO_RESULT_ICON,
20566
+ readOnly = false,
20567
+ staticValue = true,
20568
+ onFooterDownloadChange,
20569
+ onPopupScroll,
20570
+ hasMore = true,
20571
+ enableVirtualization = false,
20572
+ virtualRowHeight = _constants.DEFAULTS.VIRTUAL_ROW_HEIGHT,
20573
+ resetSearch = true,
20574
+ resetData,
20575
+ fetchMissingOptions
20563
20576
  } = _ref4,
20564
20577
  rest = _objectWithoutPropertiesLoose(_ref4, _excluded);
20565
20578
  const [searchText, setSearchText] = (0, _react.useState)('');
20566
20579
  const [tempValue, setTempValue] = (0, _react.useState)(value);
20567
20580
  const [dropdownOpen, setDropdownOpen] = (0, _react.useState)(false);
20581
+ const [isSearching, setIsSearching] = (0, _react.useState)(false);
20582
+ const [isLoadingOnScroll, setIsLoadingOnScroll] = (0, _react.useState)(false);
20583
+ const [isResettingData, setIsResettingData] = (0, _react.useState)(false);
20584
+ // Store ordered options after confirm (selected items moved to top based on selection order)
20585
+ const [orderedOptions, setOrderedOptions] = (0, _react.useState)(null);
20586
+ const searchTimeoutRef = (0, _react.useRef)(null);
20587
+ const scrollContainerRef = (0, _react.useRef)(null);
20588
+ const scrollLoadingTimeoutRef = (0, _react.useRef)(null);
20589
+ // Track if scroll handler is currently processing to prevent duplicate calls
20590
+ const isScrollProcessingRef = (0, _react.useRef)(false);
20591
+ // Throttle ref for scroll events
20592
+ const scrollThrottleTimeoutRef = (0, _react.useRef)(null);
20593
+ // Ref to track options for scroll handler (avoids recreating handleScroll)
20594
+ const optionsRef = (0, _react.useRef)(options);
20595
+ // Cache of selected items from async results to preserve them during search
20596
+ const selectedItemsCacheRef = (0, _react.useRef)(new Map());
20597
+ // Track the last search query to detect when options update after search
20598
+ const lastSearchQueryRef = (0, _react.useRef)('');
20599
+ // Track when search was cleared to help clear loading state
20600
+ const searchClearedTimeRef = (0, _react.useRef)(null);
20601
+ // Track previous options to detect when they change after a search
20602
+ const prevOptionsRef = (0, _react.useRef)(options);
20603
+ // Track previous options before resetData is called to detect when options update
20604
+ const prevOptionsBeforeResetRef = (0, _react.useRef)(options);
20605
+ // Track previous options count to detect when options change after scroll
20606
+ const prevOptionsCountRef = (0, _react.useRef)(options.length);
20607
+ // Track previous options to detect when options change (even if count stays same)
20608
+ const prevOptionsRefForScroll = (0, _react.useRef)(options);
20609
+ // Track options count when scroll was triggered (for orderedOptions update)
20610
+ const scrollTriggerOptionsCountRef = (0, _react.useRef)(options.length);
20611
+ // Track if initial sort has been done (only sort once on initial load with selected values)
20612
+ const initialSortDoneRef = (0, _react.useRef)(false);
20613
+ // Track if user has interacted with the dropdown during current session (selected, searched, etc.)
20614
+ const hasInteractedRef = (0, _react.useRef)(false);
20615
+ // Track the initial tempValue when dropdown opens to detect if user made changes
20616
+ const initialTempValueRef = (0, _react.useRef)(value);
20617
+ // Track if resetData was already called in the current session to prevent duplicate calls
20618
+ const resetDataCalledRef = (0, _react.useRef)(false);
20619
+ // Track when resetData was called to help clear loading state
20620
+ const resetDataCalledTimeRef = (0, _react.useRef)(null);
20621
+ // Track if fetchMissingOptions was already called to prevent duplicate calls
20622
+ const fetchMissingOptionsCalledRef = (0, _react.useRef)(false);
20623
+ // Track the last missing values that were sent to prevent duplicate calls with same values
20624
+ const lastMissingValuesRef = (0, _react.useRef)('');
20625
+
20626
+ // Helper function to check if a value exists in options (recursive for tree structures)
20627
+ const findValueInOptions = (0, _react.useCallback)((opts, targetValue) => {
20628
+ for (const opt of opts) {
20629
+ if (opt.value === targetValue) {
20630
+ return true;
20631
+ }
20632
+ if (opt.children && opt.children.length > 0) {
20633
+ if (findValueInOptions(opt.children, targetValue)) {
20634
+ return true;
20635
+ }
20636
+ }
20637
+ }
20638
+ return false;
20639
+ }, []);
20640
+
20641
+ // Helper function to find missing selected values
20642
+ const findMissingValues = (0, _react.useCallback)((selectedValues, currentOptions) => {
20643
+ if (!selectedValues.length || !currentOptions.length) {
20644
+ return selectedValues;
20645
+ }
20646
+ return selectedValues.filter(val => !findValueInOptions(currentOptions, val));
20647
+ }, [findValueInOptions]);
20648
+
20649
+ // Check for missing options and call fetchMissingOptions if needed
20650
+ (0, _react.useEffect)(() => {
20651
+ // Only check if fetchMissingOptions is provided
20652
+ if (!fetchMissingOptions) {
20653
+ return;
20654
+ }
20655
+
20656
+ // Get current selected values
20657
+ const selectedValues = Array.isArray(value) ? value : value ? [value] : [];
20658
+ if (selectedValues.length === 0) {
20659
+ // No selected values, reset the tracking
20660
+ fetchMissingOptionsCalledRef.current = false;
20661
+ lastMissingValuesRef.current = '';
20662
+ return;
20663
+ }
20664
+
20665
+ // Find missing values
20666
+ const missingValues = findMissingValues(selectedValues, options);
20667
+
20668
+ // If no missing values, reset tracking and return
20669
+ if (missingValues.length === 0) {
20670
+ fetchMissingOptionsCalledRef.current = false;
20671
+ lastMissingValuesRef.current = '';
20672
+ return;
20673
+ }
20674
+
20675
+ // Create a sorted string representation of missing values for comparison
20676
+ // Use slice() to avoid mutating the original array
20677
+ const missingValuesKey = [...missingValues].sort().join(',');
20678
+
20679
+ // Only call if:
20680
+ // 1. We haven't called it before, OR
20681
+ // 2. The missing values have changed (different values are missing now)
20682
+ if (!fetchMissingOptionsCalledRef.current || lastMissingValuesRef.current !== missingValuesKey) {
20683
+ fetchMissingOptionsCalledRef.current = true;
20684
+ lastMissingValuesRef.current = missingValuesKey;
20685
+ // Call the developer's function with missing values (pass a copy to avoid mutation)
20686
+ fetchMissingOptions([...missingValues]);
20687
+ }
20688
+ }, [value, options, fetchMissingOptions, findMissingValues]);
20568
20689
  (0, _react.useEffect)(() => {
20569
20690
  const isEqual = Array.isArray(value) && Array.isArray(tempValue) ? (value == null ? void 0 : value.length) === (tempValue == null ? void 0 : tempValue.length) && value.every(v => Array.isArray(tempValue) && tempValue.includes(v)) : value === tempValue;
20570
- if (!isEqual) setTempValue(value);
20691
+ if (!isEqual) {
20692
+ setTempValue(value);
20693
+ // Reset ordered options when value changes from outside
20694
+ setOrderedOptions(null);
20695
+ }
20696
+ // eslint-disable-next-line react-hooks/exhaustive-deps
20571
20697
  }, [value]);
20572
- const isMulti = (0, _react.useMemo)(() => type === SELECT_TYPES.MULTI_SELECT || type === SELECT_TYPES.MULTI_TREE_SELECT, [type]);
20573
- const isTree = (0, _react.useMemo)(() => type === SELECT_TYPES.TREE_SELECT || type === SELECT_TYPES.MULTI_TREE_SELECT, [type]);
20698
+
20699
+ // Cache selected items when tempValue changes
20700
+ (0, _react.useEffect)(() => {
20701
+ const currentSelected = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
20702
+
20703
+ // Store selected items in cache for persistence
20704
+ const findAndCacheOption = (opts, val) => {
20705
+ for (const opt of opts) {
20706
+ if (opt.value === val) {
20707
+ selectedItemsCacheRef.current.set(val, opt);
20708
+ return true;
20709
+ }
20710
+ if (opt.children && opt.children.length > 0) {
20711
+ if (findAndCacheOption(opt.children, val)) {
20712
+ return true;
20713
+ }
20714
+ }
20715
+ }
20716
+ return false;
20717
+ };
20718
+ currentSelected.forEach(val => {
20719
+ if (!selectedItemsCacheRef.current.has(val)) {
20720
+ findAndCacheOption(options, val);
20721
+ }
20722
+ });
20723
+
20724
+ // Clean up cache for unselected items
20725
+ const selectedSet = new Set(currentSelected);
20726
+ selectedItemsCacheRef.current.forEach((_, value) => {
20727
+ if (!selectedSet.has(value)) {
20728
+ selectedItemsCacheRef.current.delete(value);
20729
+ }
20730
+ });
20731
+ }, [tempValue, options]);
20732
+
20733
+ // Reset ordered options when options change, but only if it would invalidate the current ordering
20734
+ // This prevents resetting when options are updated via onSearch/onScroll but selected items still exist
20735
+ (0, _react.useEffect)(() => {
20736
+ // Only reset if we have orderedOptions and the current value's items are no longer in options
20737
+ if (orderedOptions) {
20738
+ const currentSelected = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
20739
+
20740
+ // Check if all selected values still exist in the new options
20741
+ const checkValueExists = (opts, val) => {
20742
+ for (const opt of opts) {
20743
+ if (opt.value === val) return true;
20744
+ if (opt.children && opt.children.length > 0) {
20745
+ if (checkValueExists(opt.children, val)) return true;
20746
+ }
20747
+ }
20748
+ return false;
20749
+ };
20750
+
20751
+ // If any selected value is missing from new options, reset ordering
20752
+ const allSelectedStillExist = currentSelected.every(val => checkValueExists(options, val));
20753
+ if (!allSelectedStillExist) {
20754
+ setOrderedOptions(null);
20755
+ }
20756
+ // Otherwise, keep the ordering even if options changed (e.g., via onSearch adding more items)
20757
+ } else {
20758
+ // No ordering set, nothing to reset
20759
+ }
20760
+ }, [options, orderedOptions, tempValue]);
20761
+
20762
+ // Extract debounce timeout (extracted early for use in useEffects)
20763
+ const debounceTimeout = searchDebounce != null ? searchDebounce : _constants.TIMEOUTS.DEFAULT_SEARCH_DEBOUNCE;
20764
+
20765
+ // Keep optionsRef in sync with options
20766
+ (0, _react.useEffect)(() => {
20767
+ optionsRef.current = options;
20768
+ }, [options]);
20769
+
20770
+ // Cleanup timeouts on unmount
20771
+ (0, _react.useEffect)(() => {
20772
+ return () => {
20773
+ if (searchTimeoutRef.current) {
20774
+ clearTimeout(searchTimeoutRef.current);
20775
+ }
20776
+ if (scrollLoadingTimeoutRef.current) {
20777
+ clearTimeout(scrollLoadingTimeoutRef.current);
20778
+ }
20779
+ if (scrollThrottleTimeoutRef.current) {
20780
+ clearTimeout(scrollThrottleTimeoutRef.current);
20781
+ }
20782
+ };
20783
+ }, []);
20784
+
20785
+ // Detect when options update after a search to clear loading state
20786
+ // This prevents showing "No results found" before data arrives
20787
+ (0, _react.useEffect)(() => {
20788
+ // Only handle this for API-based searches (staticValue = false)
20789
+ // Check if lastSearchQueryRef has been set (including empty string for cleared search)
20790
+ const hasSearchQuery = lastSearchQueryRef.current !== null && lastSearchQueryRef.current !== undefined;
20791
+ if (staticValue || !isSearching || !hasSearchQuery) {
20792
+ prevOptionsRef.current = options;
20793
+ return;
20794
+ }
20795
+
20796
+ // Check if options actually changed (reference or content)
20797
+ const optionsChanged = prevOptionsRef.current !== options || prevOptionsRef.current.length !== options.length;
20798
+
20799
+ // Also check if search was cleared (empty string) and enough time has passed
20800
+ // This handles the case where clearing search reloads initial data that might be the same reference
20801
+ const searchCleared = lastSearchQueryRef.current === '';
20802
+ const timeSinceCleared = searchClearedTimeRef.current ? Date.now() - searchClearedTimeRef.current : Infinity;
20803
+ const hasOptionsData = options.length > 0;
20804
+ // Wait at least SEARCH_CLEARED_TIMEOUT after search is cleared to allow API call to complete
20805
+ const clearedSearchReady = searchCleared && hasOptionsData && timeSinceCleared > _constants.TIMEOUTS.SEARCH_CLEARED_TIMEOUT;
20806
+ if (optionsChanged || clearedSearchReady) {
20807
+ // Options updated after search - data has arrived
20808
+ // Use a small delay to ensure state updates are processed
20809
+ const timeoutId = setTimeout(() => {
20810
+ setIsSearching(false);
20811
+ prevOptionsRef.current = options;
20812
+ // Clear timestamp when search loading is cleared
20813
+ if (searchCleared) {
20814
+ searchClearedTimeRef.current = null;
20815
+ }
20816
+ }, _constants.TIMEOUTS.SEARCH_STATE_UPDATE_DELAY);
20817
+ return () => clearTimeout(timeoutId);
20818
+ }
20819
+ prevOptionsRef.current = options;
20820
+ }, [options, staticValue, isSearching]);
20821
+
20822
+ // Fallback: Clear searching state after a reasonable timeout to prevent infinite loading
20823
+ // This handles edge cases where options might not change reference but data has arrived
20824
+ // Also handles error cases where options don't update after search
20825
+ (0, _react.useEffect)(() => {
20826
+ // Check if lastSearchQueryRef has been set (including empty string for cleared search)
20827
+ const hasSearchQuery = lastSearchQueryRef.current !== null && lastSearchQueryRef.current !== undefined;
20828
+ if (!isSearching || staticValue || !hasSearchQuery) {
20829
+ return;
20830
+ }
20831
+
20832
+ // For cleared search (empty string), use a shorter timeout since it should reload initial data quickly
20833
+ // For regular search, use debounce timeout + buffer
20834
+ const searchCleared = lastSearchQueryRef.current === '';
20835
+ const timeoutDuration = searchCleared ? debounceTimeout + _constants.TIMEOUTS.SEARCH_CLEARED_BUFFER // Shorter timeout for cleared search
20836
+ : debounceTimeout + _constants.TIMEOUTS.SEARCH_REGULAR_BUFFER; // Longer timeout for regular search
20837
+
20838
+ // Calculate timeout: debounce timeout + a small buffer for API response
20839
+ // This ensures we wait for the API call to complete before showing "No results"
20840
+ // For error cases where options don't update, this will clear loading state
20841
+ const fallbackTimeout = setTimeout(() => {
20842
+ setIsSearching(false);
20843
+ searchClearedTimeRef.current = null; // Clear search cleared timestamp
20844
+ }, timeoutDuration);
20845
+ return () => clearTimeout(fallbackTimeout);
20846
+ }, [isSearching, staticValue, debounceTimeout, options.length]);
20847
+
20848
+ // Detect when options update after resetData is called to clear loading state
20849
+ (0, _react.useEffect)(() => {
20850
+ if (!isResettingData) {
20851
+ // Update ref even when not resetting to keep it in sync
20852
+ prevOptionsBeforeResetRef.current = options;
20853
+ // Clear timestamp when not resetting
20854
+ resetDataCalledTimeRef.current = null;
20855
+ return;
20856
+ }
20857
+
20858
+ // Check if options actually changed (reference, length, or content)
20859
+ // Compare against the options that existed before resetData was called
20860
+ const prevOptions = prevOptionsBeforeResetRef.current;
20861
+ const currentOptions = options;
20862
+
20863
+ // More robust comparison: check reference, length, or any content differences
20864
+ const optionsChanged = prevOptions !== currentOptions || prevOptions.length !== currentOptions.length ||
20865
+ // Deep comparison: check if any option values or labels changed
20866
+ prevOptions.length === currentOptions.length && prevOptions.length > 0 && prevOptions.some((prevOpt, idx) => {
20867
+ const currentOpt = currentOptions[idx];
20868
+ return !currentOpt || prevOpt.value !== currentOpt.value || prevOpt.label !== currentOpt.label;
20869
+ });
20870
+
20871
+ // Additional check: if enough time has passed since resetData was called
20872
+ // and we have options data, assume data has loaded even if comparison didn't detect change
20873
+ const timeSinceReset = resetDataCalledTimeRef.current ? Date.now() - resetDataCalledTimeRef.current : Infinity;
20874
+ const hasDataAfterTimeout = currentOptions.length > 0 && timeSinceReset > _constants.TIMEOUTS.RESET_DATA_MIN_TIME && timeSinceReset < _constants.TIMEOUTS.RESET_DATA_MAX_TIME;
20875
+
20876
+ // If options changed or enough time has passed with data, clear the loading state
20877
+ if (optionsChanged || hasDataAfterTimeout) {
20878
+ // Options updated after resetData - data has arrived
20879
+ // Clear immediately without delay for faster response
20880
+ setIsResettingData(false);
20881
+ prevOptionsBeforeResetRef.current = currentOptions;
20882
+ resetDataCalledTimeRef.current = null;
20883
+ }
20884
+ }, [options, isResettingData]);
20885
+
20886
+ // Fallback: Clear resetData loading state after a reasonable timeout
20887
+ // This handles edge cases where options might not change reference but data has arrived
20888
+ (0, _react.useEffect)(() => {
20889
+ if (!isResettingData) {
20890
+ return;
20891
+ }
20892
+
20893
+ // Set a timeout to clear loading state if options don't update
20894
+ // Reduced timeout to 1 second for faster recovery
20895
+ const fallbackTimeout = setTimeout(() => {
20896
+ setIsResettingData(false);
20897
+ // Update ref to current options to prevent false positives in future comparisons
20898
+ prevOptionsBeforeResetRef.current = options;
20899
+ // Clear timestamp
20900
+ resetDataCalledTimeRef.current = null;
20901
+ }, _constants.TIMEOUTS.RESET_DATA_TIMEOUT);
20902
+ return () => clearTimeout(fallbackTimeout);
20903
+ }, [isResettingData, options]);
20904
+
20905
+ // Clear loading state when hasMore becomes false (all items exhausted)
20906
+ (0, _react.useEffect)(() => {
20907
+ if (!hasMore && isLoadingOnScroll) {
20908
+ setIsLoadingOnScroll(false);
20909
+ isScrollProcessingRef.current = false;
20910
+ if (scrollLoadingTimeoutRef.current) {
20911
+ clearTimeout(scrollLoadingTimeoutRef.current);
20912
+ scrollLoadingTimeoutRef.current = null;
20913
+ }
20914
+ }
20915
+ }, [hasMore, isLoadingOnScroll]);
20916
+
20917
+ // Detect when options change after scroll to clear loading overlay
20918
+ (0, _react.useEffect)(() => {
20919
+ // Always update refs when options change (when not loading)
20920
+ // This ensures we track the current state for next scroll detection
20921
+ if (!isLoadingOnScroll) {
20922
+ prevOptionsCountRef.current = options.length;
20923
+ // Store a reference to the options array for comparison
20924
+ // We'll compare by length and last item to detect changes
20925
+ prevOptionsRefForScroll.current = options;
20926
+ }
20927
+
20928
+ // Only check for changes if we're currently loading from scroll
20929
+ if (!isLoadingOnScroll || !onPopupScroll) {
20930
+ return;
20931
+ }
20932
+
20933
+ // Check if options count increased (new data loaded via append)
20934
+ const optionsCountIncreased = options.length > prevOptionsCountRef.current;
20935
+
20936
+ // Check if options content changed (even if count is same - replacement scenario)
20937
+ // Compare the last option to detect if new data was appended
20938
+ const optionsContentChanged = (() => {
20939
+ const prevCount = prevOptionsCountRef.current;
20940
+ const currentCount = options.length;
20941
+
20942
+ // If count changed, definitely content changed
20943
+ if (prevCount !== currentCount) {
20944
+ return true;
20945
+ }
20946
+
20947
+ // If count is same, check if last option changed (indicates new data appended/replaced)
20948
+ if (currentCount > 0 && prevCount > 0 && prevOptionsRefForScroll.current.length > 0) {
20949
+ const prevOptions = prevOptionsRefForScroll.current;
20950
+ const lastPrevOption = prevOptions[prevOptions.length - 1];
20951
+ const lastCurrentOption = options[options.length - 1];
20952
+
20953
+ // If last option is different, content changed
20954
+ if ((lastPrevOption == null ? void 0 : lastPrevOption.value) !== (lastCurrentOption == null ? void 0 : lastCurrentOption.value) || (lastPrevOption == null ? void 0 : lastPrevOption.label) !== (lastCurrentOption == null ? void 0 : lastCurrentOption.label)) {
20955
+ return true;
20956
+ }
20957
+ }
20958
+ return false;
20959
+ })();
20960
+
20961
+ // Clear loading if options changed (either count increased or content changed)
20962
+ // This handles both append (count increase) and replace (content change) scenarios
20963
+ if (optionsCountIncreased || optionsContentChanged) {
20964
+ // Options updated after scroll - data has arrived, clear loading overlay
20965
+ setIsLoadingOnScroll(false);
20966
+ // Reset processing flag to allow next scroll event
20967
+ isScrollProcessingRef.current = false;
20968
+ if (scrollLoadingTimeoutRef.current) {
20969
+ clearTimeout(scrollLoadingTimeoutRef.current);
20970
+ scrollLoadingTimeoutRef.current = null;
20971
+ }
20972
+
20973
+ // Update refs to track the new state after options change
20974
+ // This is critical for detecting subsequent scroll loads
20975
+ prevOptionsCountRef.current = options.length;
20976
+ prevOptionsRefForScroll.current = options;
20977
+ }
20978
+ }, [options, isLoadingOnScroll, onPopupScroll]);
20979
+
20980
+ // Handle search with debouncing
20981
+ const handleSearch = (0, _react.useCallback)(query => {
20982
+ // Clear existing timeout
20983
+ if (searchTimeoutRef.current) {
20984
+ clearTimeout(searchTimeoutRef.current);
20985
+ }
20986
+ const trimmedQuery = query.trim();
20987
+
20988
+ // Track when search is cleared (empty string after having a query)
20989
+ const wasSearching = lastSearchQueryRef.current !== '';
20990
+ const isNowCleared = trimmedQuery === '';
20991
+ if (wasSearching && isNowCleared) {
20992
+ searchClearedTimeRef.current = Date.now();
20993
+ } else if (!isNowCleared) {
20994
+ searchClearedTimeRef.current = null;
20995
+ }
20996
+
20997
+ // Track the search query to detect when options update
20998
+ lastSearchQueryRef.current = trimmedQuery;
20999
+
21000
+ // Mark as interacted if user typed something (even if they clear it later)
21001
+ if (trimmedQuery.length > 0 || lastSearchQueryRef.current.length > 0) {
21002
+ hasInteractedRef.current = true;
21003
+ }
21004
+
21005
+ // For API-based searches (staticValue = false), always call onSearch
21006
+ // This allows the developer to reload all initial data when search is cleared
21007
+ if (!staticValue && onSearch) {
21008
+ // Set loading state for both empty and non-empty queries
21009
+ setIsSearching(true);
21010
+
21011
+ // Debounce the search callback
21012
+ searchTimeoutRef.current = setTimeout(() => {
21013
+ // Send the search input (empty string when cleared, or the actual query)
21014
+ onSearch(trimmedQuery);
21015
+ // For API-based searches, keep isSearching true until options update
21016
+ // This prevents showing "No results found" before data arrives
21017
+ }, debounceTimeout);
21018
+ } else if (!trimmedQuery) {
21019
+ // For static searches, if query is empty, just reset the state
21020
+ setIsSearching(false);
21021
+ } else {
21022
+ // For static searches with content, show brief loading indicator
21023
+ // Set loading state briefly to show user feedback
21024
+ setIsSearching(true);
21025
+ // Clear loading state after a short delay (filtering is instant but we show feedback)
21026
+ searchTimeoutRef.current = setTimeout(() => {
21027
+ setIsSearching(false);
21028
+ }, _constants.TIMEOUTS.STATIC_SEARCH_DELAY);
21029
+ }
21030
+ }, [onSearch, staticValue, debounceTimeout]);
21031
+ const isMulti = (0, _react.useMemo)(() => type === _constants.SELECT_TYPES.MULTI_SELECT || type === _constants.SELECT_TYPES.MULTI_TREE_SELECT, [type]);
21032
+ const isTree = (0, _react.useMemo)(() => type === _constants.SELECT_TYPES.TREE_SELECT || type === _constants.SELECT_TYPES.MULTI_TREE_SELECT, [type]);
21033
+
21034
+ // Use options directly since pagination is handled by the developer
21035
+ const mergedOptions = (0, _react.useMemo)(() => {
21036
+ return options;
21037
+ }, [options]);
21038
+
21039
+ // Helper function to reorder options based on selection order
21040
+ // Selected items are moved to top in the order they were selected
21041
+ // For tree structures, maintains parent-child relationships
21042
+ // For flat lists, directly reorders items
21043
+ // Works for all data types: flat lists, tree structures, nested trees
21044
+ const reorderOptionsBySelection = (0, _react.useCallback)((opts, selectedOrder) => {
21045
+ if (!Array.isArray(selectedOrder) || selectedOrder.length === 0 || !(opts != null && opts.length)) {
21046
+ return opts;
21047
+ }
21048
+ const selectedSet = new Set(selectedOrder);
21049
+ const selectedItems = [];
21050
+ const unselectedItems = [];
21051
+ const processedTopLevelValues = new Set();
21052
+
21053
+ // Deep clone helper to avoid mutating original items
21054
+ const deepCloneItem = item => {
21055
+ return _extends({}, item, {
21056
+ children: item.children ? item.children.map(deepCloneItem) : undefined
21057
+ });
21058
+ };
21059
+
21060
+ // Find the top-level item that contains the selected value
21061
+ // For flat lists, returns the item itself
21062
+ // For tree structures, returns the top-level parent from opts
21063
+ const findTopLevelItem = targetValue => {
21064
+ // First, find which top-level item in opts contains this value
21065
+ for (const topLevelItem of opts) {
21066
+ // Check if this top-level item itself matches
21067
+ if (topLevelItem.value === targetValue) {
21068
+ return topLevelItem;
21069
+ }
21070
+
21071
+ // Recursively search in children
21072
+ const searchInChildren = items => {
21073
+ for (const item of items) {
21074
+ if (item.value === targetValue) {
21075
+ return true; // Found it
21076
+ }
21077
+ if (item.children && item.children.length > 0) {
21078
+ if (searchInChildren(item.children)) {
21079
+ return true;
21080
+ }
21081
+ }
21082
+ }
21083
+ return false;
21084
+ };
21085
+
21086
+ // If found in this top-level item's children, return the top-level item
21087
+ if (topLevelItem.children && topLevelItem.children.length > 0) {
21088
+ if (searchInChildren(topLevelItem.children)) {
21089
+ return topLevelItem;
21090
+ }
21091
+ }
21092
+ }
21093
+ return null;
21094
+ };
21095
+
21096
+ // Check if an item or any of its descendants is selected
21097
+ const hasSelectedDescendant = item => {
21098
+ if (item.value !== undefined && selectedSet.has(item.value)) {
21099
+ return true;
21100
+ }
21101
+ if (item.children && item.children.length > 0) {
21102
+ return item.children.some(child => hasSelectedDescendant(child));
21103
+ }
21104
+ return false;
21105
+ };
21106
+
21107
+ // Collect selected items in selection order
21108
+ selectedOrder.forEach(selectedVal => {
21109
+ const topLevelItem = findTopLevelItem(selectedVal);
21110
+ if (topLevelItem && topLevelItem.value !== undefined && !processedTopLevelValues.has(topLevelItem.value)) {
21111
+ // Clone the item to avoid mutating the original
21112
+ const clonedItem = deepCloneItem(topLevelItem);
21113
+ selectedItems.push(clonedItem);
21114
+ processedTopLevelValues.add(topLevelItem.value);
21115
+ }
21116
+ });
21117
+
21118
+ // Collect unselected items maintaining original order
21119
+ // For tree structures, only include top-level items that don't have any selected descendants
21120
+ opts.forEach(item => {
21121
+ if (item.value === undefined) {
21122
+ // Item without value, include as-is
21123
+ unselectedItems.push(deepCloneItem(item));
21124
+ } else if (!processedTopLevelValues.has(item.value)) {
21125
+ // Check if this item or any of its descendants is selected
21126
+ if (!hasSelectedDescendant(item)) {
21127
+ unselectedItems.push(deepCloneItem(item));
21128
+ }
21129
+ }
21130
+ });
21131
+
21132
+ // Return selected items first (in selection order), then unselected items
21133
+ return [...selectedItems, ...unselectedItems];
21134
+ }, []);
21135
+
21136
+ // Track previous options count before fetchMissingOptions to detect when missing options are added
21137
+ const prevOptionsCountBeforeFetchMissingRef = (0, _react.useRef)(options.length);
21138
+ // Track previous options before fetchMissingOptions to detect when missing options are added
21139
+ const prevOptionsBeforeFetchMissingRef = (0, _react.useRef)(options);
21140
+
21141
+ // Update orderedOptions when new options are appended via scroll (when items are selected)
21142
+ // This ensures new data appears even when items are selected
21143
+ (0, _react.useEffect)(() => {
21144
+ // Only update if we have orderedOptions (items are selected), onPopupScroll is provided,
21145
+ // and options increased from when scroll was triggered
21146
+ if (!orderedOptions || !onPopupScroll) {
21147
+ return;
21148
+ }
21149
+ const currentOptions = options;
21150
+ // Compare against the count when scroll was triggered, not the current ref value
21151
+ // This ensures we detect increases even if refs were updated in other useEffects
21152
+ const optionsCountIncreased = currentOptions.length > scrollTriggerOptionsCountRef.current;
21153
+
21154
+ // Only update if options increased from scroll trigger time
21155
+ // This prevents updating on other option changes (like search)
21156
+ if (optionsCountIncreased && scrollTriggerOptionsCountRef.current > 0) {
21157
+ const selectedValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
21158
+ if (selectedValues.length > 0) {
21159
+ // Reorder the full options list (which now includes new options) to maintain selection order
21160
+ // This will put selected items at top and append new unselected items at bottom
21161
+ const reordered = reorderOptionsBySelection(currentOptions, selectedValues);
21162
+ setOrderedOptions(reordered);
21163
+ // Update the scroll trigger count for next scroll detection
21164
+ scrollTriggerOptionsCountRef.current = currentOptions.length;
21165
+ }
21166
+ }
21167
+ }, [options, orderedOptions, onPopupScroll, tempValue, reorderOptionsBySelection]);
21168
+
21169
+ // Update orderedOptions when new options are added via fetchMissingOptions (for paginated API-driven data)
21170
+ // This handles the case when user selects items from paginated pages and confirms
21171
+ // The fetchMissingOptions callback fetches the missing selected items, and we need to reorder them to top
21172
+ // Also handles search cases and upload cases where selected items might not be in current options
21173
+ (0, _react.useEffect)(() => {
21174
+ // Only handle if fetchMissingOptions is provided (indicates API-driven pagination)
21175
+ if (!fetchMissingOptions) {
21176
+ // Update refs even when fetchMissingOptions is not provided
21177
+ prevOptionsCountBeforeFetchMissingRef.current = options.length;
21178
+ prevOptionsBeforeFetchMissingRef.current = options;
21179
+ return;
21180
+ }
21181
+ const currentOptions = options;
21182
+ const currentSelectedValues = Array.isArray(value) ? value : value ? [value] : [];
21183
+ const tempSelectedValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
21184
+ // Use tempValue if available (during selection), otherwise use value (after confirm)
21185
+ const selectedValues = tempSelectedValues.length > 0 ? tempSelectedValues : currentSelectedValues;
21186
+ if (selectedValues.length === 0) {
21187
+ // No selected values, update refs and return
21188
+ prevOptionsCountBeforeFetchMissingRef.current = currentOptions.length;
21189
+ prevOptionsBeforeFetchMissingRef.current = currentOptions;
21190
+ return;
21191
+ }
21192
+
21193
+ // Check if options changed (count or content) after fetchMissingOptions was called
21194
+ const prevOptions = prevOptionsBeforeFetchMissingRef.current;
21195
+ const optionsCountIncreased = currentOptions.length > prevOptionsCountBeforeFetchMissingRef.current;
21196
+ const optionsChanged = prevOptions !== currentOptions || optionsCountIncreased;
21197
+
21198
+ // Check if any previously missing selected values now exist in options
21199
+ // This handles both cases: when fetchMissingOptions was called, and when options update for any reason
21200
+ const hasNewlyFetchedSelectedItems = (() => {
21201
+ if (selectedValues.length === 0 || !optionsChanged) {
21202
+ return false;
21203
+ }
21204
+
21205
+ // Find which selected values were missing in previous options
21206
+ const previouslyMissingValues = selectedValues.filter(val => !findValueInOptions(prevOptions, val));
21207
+ if (previouslyMissingValues.length === 0) {
21208
+ return false;
21209
+ }
21210
+
21211
+ // Check if any of those previously missing values now exist in current options
21212
+ const nowPresentValues = previouslyMissingValues.filter(val => findValueInOptions(currentOptions, val));
21213
+ return nowPresentValues.length > 0;
21214
+ })();
21215
+
21216
+ // Update orderedOptions if:
21217
+ // 1. Options changed (increased or content changed) AND
21218
+ // 2. Previously missing selected items are now present in options
21219
+ // This works for both cases: when fetchMissingOptions was explicitly called, and when options update for other reasons
21220
+ if (optionsChanged && hasNewlyFetchedSelectedItems) {
21221
+ // Reorder the full options list to put selected items at top
21222
+ const reordered = reorderOptionsBySelection(currentOptions, selectedValues);
21223
+ setOrderedOptions(reordered);
21224
+ }
21225
+
21226
+ // Always update the previous options and count for next comparison
21227
+ // This ensures we can detect when missing options are added in the future
21228
+ prevOptionsCountBeforeFetchMissingRef.current = currentOptions.length;
21229
+ prevOptionsBeforeFetchMissingRef.current = currentOptions;
21230
+ }, [options, value, tempValue, fetchMissingOptions, reorderOptionsBySelection, findValueInOptions]);
21231
+
21232
+ // Sort selected items to top on initial load (only once)
21233
+ // This handles the case when user comes from another flow with pre-selected values
21234
+ (0, _react.useEffect)(() => {
21235
+ // Only do this once, and only if we have options and selected values
21236
+ if (initialSortDoneRef.current || !(options != null && options.length)) {
21237
+ return;
21238
+ }
21239
+
21240
+ // Check if there are selected values
21241
+ const selectedValues = Array.isArray(value) ? value : value ? [value] : [];
21242
+ if (selectedValues.length === 0) {
21243
+ // No selected values, mark as done
21244
+ initialSortDoneRef.current = true;
21245
+ return;
21246
+ }
21247
+
21248
+ // Check if any selected values exist in options
21249
+ const checkValueExists = (opts, val) => {
21250
+ for (const opt of opts) {
21251
+ if (opt.value === val) return true;
21252
+ if (opt.children && opt.children.length > 0) {
21253
+ if (checkValueExists(opt.children, val)) return true;
21254
+ }
21255
+ }
21256
+ return false;
21257
+ };
21258
+ const hasSelectedInOptions = selectedValues.some(val => checkValueExists(options, val));
21259
+ if (hasSelectedInOptions) {
21260
+ // Reorder options to move selected items to top
21261
+ const reordered = reorderOptionsBySelection(options, selectedValues);
21262
+ setOrderedOptions(reordered);
21263
+ }
21264
+
21265
+ // Mark as done - only sort once on initial load
21266
+ initialSortDoneRef.current = true;
21267
+ }, [options, value, reorderOptionsBySelection]);
20574
21268
  const dataSource = (0, _react.useMemo)(() => {
20575
- if (!(options != null && options.length)) return [];
21269
+ // During search, use normal options (mergedOptions) to show filtered results without selected items at top
21270
+ // When not searching, use ordered options if available (selected items at top), otherwise use merged options
21271
+ const sourceOptions = searchText.trim() ? mergedOptions : orderedOptions || mergedOptions;
21272
+ if (!(sourceOptions != null && sourceOptions.length)) return [];
20576
21273
  const enhanceOptions = opts => opts.map(opt => {
20577
21274
  const decoratedTitle = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
20578
21275
  className: _styles.default['cap-unified-select-option-with-suffix'],
20579
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
20580
- type: "label14",
21276
+ justify: "space-between",
21277
+ align: "middle",
21278
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
20581
21279
  className: _styles.default['cap-unified-select-option-label'],
20582
- children: opt == null ? void 0 : opt.label
20583
- }), (opt == null ? void 0 : opt.optionSuffix) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
20584
- className: _styles.default['cap-unified-select-option-suffix'],
20585
- children: [opt == null ? void 0 : opt.optionSuffix, ' ', (opt == null ? void 0 : opt.optionSuffixInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
20586
- title: opt == null ? void 0 : opt.optionSuffixInfo
21280
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
21281
+ type: "label14",
21282
+ children: opt == null ? void 0 : opt.label
21283
+ })
21284
+ }), ((opt == null ? void 0 : opt.optionSuffix) || (opt == null ? void 0 : opt.optionTooltipInfo)) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
21285
+ className: _styles.default['cap-unified-select-option-end'],
21286
+ children: [(opt == null ? void 0 : opt.optionSuffix) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
21287
+ className: _styles.default['cap-unified-select-option-suffix'],
21288
+ children: [opt == null ? void 0 : opt.optionSuffix, (opt == null ? void 0 : opt.optionSuffixInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
21289
+ title: opt == null ? void 0 : opt.optionSuffixInfo
21290
+ })]
21291
+ }), (opt == null ? void 0 : opt.optionTooltipInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
21292
+ title: opt == null ? void 0 : opt.optionTooltipInfo
20587
21293
  })]
20588
- }), (opt == null ? void 0 : opt.optionTooltipInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
20589
- title: opt == null ? void 0 : opt.optionTooltipInfo
20590
21294
  })]
20591
21295
  });
20592
21296
  return _extends({}, opt, {
@@ -20595,26 +21299,43 @@ const CapUnifiedSelect = _ref4 => {
20595
21299
  children: opt != null && opt.children ? enhanceOptions(opt.children) : []
20596
21300
  });
20597
21301
  });
20598
- return isTree ? enhanceOptions(options) : options.map(opt => _extends({}, opt, {
21302
+ return isTree ? enhanceOptions(sourceOptions) : sourceOptions.map(opt => _extends({}, opt, {
20599
21303
  title: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
20600
21304
  className: _styles.default['cap-unified-select-option-with-suffix'],
20601
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
20602
- type: "label14",
21305
+ justify: "space-between",
21306
+ align: "middle",
21307
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
20603
21308
  className: _styles.default['cap-unified-select-option-label'],
20604
- children: opt == null ? void 0 : opt.label
20605
- }), (opt == null ? void 0 : opt.optionSuffix) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
20606
- className: _styles.default['cap-unified-select-option-suffix'],
20607
- children: [opt == null ? void 0 : opt.optionSuffix, ' ', (opt == null ? void 0 : opt.optionSuffixInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
20608
- title: opt == null ? void 0 : opt.optionSuffixInfo
21309
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
21310
+ type: "label14",
21311
+ children: opt == null ? void 0 : opt.label
21312
+ })
21313
+ }), ((opt == null ? void 0 : opt.optionSuffix) || (opt == null ? void 0 : opt.optionTooltipInfo)) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
21314
+ className: _styles.default['cap-unified-select-option-end'],
21315
+ children: [(opt == null ? void 0 : opt.optionSuffix) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
21316
+ className: _styles.default['cap-unified-select-option-suffix'],
21317
+ children: [opt == null ? void 0 : opt.optionSuffix, (opt == null ? void 0 : opt.optionSuffixInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
21318
+ title: opt == null ? void 0 : opt.optionSuffixInfo
21319
+ })]
21320
+ }), (opt == null ? void 0 : opt.optionTooltipInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
21321
+ title: opt == null ? void 0 : opt.optionTooltipInfo
20609
21322
  })]
20610
- }), (opt == null ? void 0 : opt.optionTooltipInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
20611
- title: opt == null ? void 0 : opt.optionTooltipInfo
20612
21323
  })]
20613
21324
  }),
20614
21325
  label: opt == null ? void 0 : opt.label
20615
21326
  }));
20616
- }, [isTree, options]);
20617
- const filteredTree = (0, _react.useMemo)(() => filterTreeData(dataSource, searchText, searchBasedOn), [dataSource, searchText, searchBasedOn]);
21327
+ }, [isTree, mergedOptions, orderedOptions, searchText]);
21328
+ const filteredTree = (0, _react.useMemo)(() => {
21329
+ const selectedValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
21330
+ const hasSearchQuery = searchText.trim().length > 0;
21331
+
21332
+ // If staticValue is true, use local filtering on existing options
21333
+ // If staticValue is false, still use local filtering for immediate feedback,
21334
+ // but onSearch callback will be triggered for parent to update options
21335
+ // During search, don't include selectedValues so only matching items are shown
21336
+ // When not searching, include selectedValues to show selected items
21337
+ return filterTreeData(dataSource, searchText.trim(), searchBasedOn, hasSearchQuery ? undefined : selectedValues);
21338
+ }, [dataSource, searchText, searchBasedOn, tempValue]);
20618
21339
  const treeMaps = (0, _react.useMemo)(() => buildTreeMaps(options), [options]);
20619
21340
  const selectedLeafCount = (0, _react.useMemo)(() => countSelectedLeaves(treeMaps, Array.isArray(tempValue) ? tempValue : undefined), [treeMaps, tempValue]);
20620
21341
  const displayValue = dropdownOpen ? tempValue : value;
@@ -20659,28 +21380,344 @@ const CapUnifiedSelect = _ref4 => {
20659
21380
  return null;
20660
21381
  }, [isMulti, displayValue, treeMaps]);
20661
21382
  const handleConfirm = (0, _react.useCallback)(() => {
21383
+ // Mark as interacted since user clicked confirm (explicit action)
21384
+ hasInteractedRef.current = true;
21385
+
21386
+ // Reorder options based on selection order when confirm is clicked
21387
+ // Use mergedOptions to include paginated options if they exist
21388
+ const optionsToReorder = mergedOptions;
21389
+ if (isMulti && Array.isArray(tempValue) && tempValue.length > 0) {
21390
+ // Reorder the options (includes paginated if they exist)
21391
+ const reordered = reorderOptionsBySelection(optionsToReorder, tempValue);
21392
+ setOrderedOptions(reordered);
21393
+ } else if (!isMulti && tempValue && !Array.isArray(tempValue)) {
21394
+ // For single select, move selected item to top
21395
+ const reordered = reorderOptionsBySelection(optionsToReorder, [tempValue]);
21396
+ setOrderedOptions(reordered);
21397
+ } else {
21398
+ // No selection, reset to original order
21399
+ setOrderedOptions(null);
21400
+ }
20662
21401
  onChange == null || onChange(tempValue);
20663
21402
  setDropdownOpen(false);
20664
- setSearchText('');
21403
+ // Always clear searching state since search operation is complete
21404
+ setIsSearching(false);
21405
+ searchClearedTimeRef.current = null; // Clear search cleared timestamp
21406
+ // Clear search text on confirm only if resetSearch is true
21407
+ // This allows users to keep their search when reopening the dropdown if desired
21408
+ if (resetSearch) {
21409
+ setSearchText('');
21410
+ lastSearchQueryRef.current = ''; // Clear search query ref
21411
+ }
21412
+ // Call resetData to allow developer to reload initial data
21413
+ if (resetData) {
21414
+ // Store current options before calling resetData to detect when they update
21415
+ prevOptionsBeforeResetRef.current = mergedOptions;
21416
+ setIsResettingData(true);
21417
+ resetDataCalledRef.current = true;
21418
+ resetDataCalledTimeRef.current = Date.now();
21419
+ resetData();
21420
+ }
20665
21421
  onConfirm == null || onConfirm(tempValue);
20666
- }, [onChange, onConfirm, tempValue]);
21422
+ }, [onChange, onConfirm, tempValue, resetSearch, isMulti, mergedOptions, reorderOptionsBySelection, resetData]);
20667
21423
  const handleClearAll = (0, _react.useCallback)(() => {
21424
+ // Mark as interacted since user clicked clear (explicit action)
21425
+ hasInteractedRef.current = true;
20668
21426
  const cleared = isMulti ? [] : undefined;
20669
21427
  setTempValue(cleared);
20670
21428
  onChange == null || onChange(cleared);
20671
21429
  setDropdownOpen(false);
20672
- }, [isMulti, onChange]);
21430
+ // Call resetData to allow developer to reload initial data
21431
+ if (resetData) {
21432
+ // Store current options before calling resetData to detect when they update
21433
+ prevOptionsBeforeResetRef.current = options;
21434
+ setIsResettingData(true);
21435
+ resetDataCalledRef.current = true;
21436
+ resetDataCalledTimeRef.current = Date.now();
21437
+ resetData();
21438
+ }
21439
+ }, [isMulti, onChange, resetData, options]);
20673
21440
  const handleDropdownVisibilityChange = (0, _react.useCallback)(open => {
20674
21441
  if (readOnly) {
20675
21442
  return;
20676
21443
  }
20677
- if (!open && !customPopupRender) {
20678
- onChange == null || onChange(tempValue);
20679
- } else if (!open) {
20680
- setTempValue(value);
21444
+ if (open) {
21445
+ // Reset interaction tracking when dropdown opens
21446
+ // Store initial value (not tempValue) to detect if user makes changes
21447
+ // This ensures we track changes from the actual selected value, not temporary state
21448
+ initialTempValueRef.current = value;
21449
+ hasInteractedRef.current = false;
21450
+ resetDataCalledRef.current = false;
21451
+ // Reset fetchMissingOptions tracking to allow re-checking when dropdown opens
21452
+ fetchMissingOptionsCalledRef.current = false;
21453
+ lastMissingValuesRef.current = '';
21454
+ // Clear any pending search timeouts
21455
+ if (searchTimeoutRef.current) {
21456
+ clearTimeout(searchTimeoutRef.current);
21457
+ searchTimeoutRef.current = null;
21458
+ }
21459
+ // Clear any pending scroll loading timeouts
21460
+ if (scrollLoadingTimeoutRef.current) {
21461
+ clearTimeout(scrollLoadingTimeoutRef.current);
21462
+ scrollLoadingTimeoutRef.current = null;
21463
+ }
21464
+ if (scrollThrottleTimeoutRef.current) {
21465
+ clearTimeout(scrollThrottleTimeoutRef.current);
21466
+ scrollThrottleTimeoutRef.current = null;
21467
+ }
21468
+ // Reset loading states
21469
+ setIsSearching(false);
21470
+ searchClearedTimeRef.current = null; // Clear search cleared timestamp
21471
+ setIsLoadingOnScroll(false);
21472
+ isScrollProcessingRef.current = false;
21473
+ // Safety check: Clear isResettingData if it's still true when opening
21474
+ // This handles cases where options updated while dropdown was closed
21475
+ if (isResettingData) {
21476
+ setIsResettingData(false);
21477
+ // Update ref to current options to prevent false positives
21478
+ prevOptionsBeforeResetRef.current = options;
21479
+ // Clear timestamp
21480
+ resetDataCalledTimeRef.current = null;
21481
+ }
21482
+ } else {
21483
+ // Dropdown is closing
21484
+ if (!customPopupRender) {
21485
+ onChange == null || onChange(tempValue);
21486
+ } else {
21487
+ setTempValue(value);
21488
+ }
21489
+ // Clear search when closing (if enabled)
21490
+ if (resetSearch) {
21491
+ setSearchText('');
21492
+ setIsSearching(false);
21493
+ lastSearchQueryRef.current = ''; // Clear search query ref
21494
+ searchClearedTimeRef.current = null; // Clear search cleared timestamp
21495
+ }
21496
+ // Reset scroll loading state
21497
+ setIsLoadingOnScroll(false);
21498
+ isScrollProcessingRef.current = false;
21499
+ if (scrollLoadingTimeoutRef.current) {
21500
+ clearTimeout(scrollLoadingTimeoutRef.current);
21501
+ scrollLoadingTimeoutRef.current = null;
21502
+ }
21503
+ if (scrollThrottleTimeoutRef.current) {
21504
+ clearTimeout(scrollThrottleTimeoutRef.current);
21505
+ scrollThrottleTimeoutRef.current = null;
21506
+ }
21507
+ scrollContainerRef.current = null;
21508
+
21509
+ // Only call resetData if user actually interacted (selected, searched, etc.)
21510
+ // and resetData hasn't been called already in this session
21511
+ // This prevents multiple API calls when user just opens/closes without interaction
21512
+ if (resetData && hasInteractedRef.current && !resetDataCalledRef.current) {
21513
+ // Store current options before calling resetData to detect when they update
21514
+ prevOptionsBeforeResetRef.current = options;
21515
+ setIsResettingData(true);
21516
+ resetDataCalledRef.current = true;
21517
+ resetDataCalledTimeRef.current = Date.now();
21518
+ resetData();
21519
+ } else if (!hasInteractedRef.current) {
21520
+ // User did nothing - reset everything as if it's a fresh load
21521
+ // Clear any pending operations
21522
+ if (searchTimeoutRef.current) {
21523
+ clearTimeout(searchTimeoutRef.current);
21524
+ searchTimeoutRef.current = null;
21525
+ }
21526
+ setIsSearching(false);
21527
+ setIsResettingData(false);
21528
+ // Reset search query ref
21529
+ lastSearchQueryRef.current = '';
21530
+ }
21531
+
21532
+ // Reset interaction flag for next session
21533
+ hasInteractedRef.current = false;
20681
21534
  }
20682
21535
  setDropdownOpen(open);
20683
- }, [customPopupRender, value, onChange, tempValue, readOnly]);
21536
+ }, [customPopupRender, value, onChange, tempValue, readOnly, resetSearch, resetData, options, isResettingData]);
21537
+ const handleFooterDownload = (0, _react.useCallback)(() => {
21538
+ const currentValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
21539
+ onFooterDownloadChange == null || onFooterDownloadChange(currentValues);
21540
+ }, [tempValue, onFooterDownloadChange]);
21541
+ const handleUpload = (0, _react.useCallback)(() => {
21542
+ onUpload == null || onUpload();
21543
+ setDropdownOpen(false);
21544
+ }, [onUpload]);
21545
+ const handleSearchChange = (0, _react.useCallback)(e => {
21546
+ const query = e.target.value;
21547
+ setSearchText(query);
21548
+
21549
+ // Trigger search handler (handles debouncing and minLength check)
21550
+ handleSearch(query);
21551
+ }, [handleSearch]);
21552
+ const handleSearchKeyDown = (0, _react.useCallback)(e => {
21553
+ // Stop propagation of backspace and delete keys to prevent TreeSelect from deselecting items
21554
+ // The input itself will handle the deletion, we just need to prevent TreeSelect from handling it
21555
+ if (e.key === 'Backspace' || e.key === 'Delete') {
21556
+ e.stopPropagation();
21557
+ }
21558
+ // Also stop Escape key to prevent dropdown from closing when clearing search
21559
+ if (e.key === 'Escape' && searchText.length > 0) {
21560
+ e.stopPropagation();
21561
+ }
21562
+ }, [searchText]);
21563
+
21564
+ // Handle scroll event - automatically checks if scroll is near bottom
21565
+ // Developer handles hasMore and isLoading conditions in onPopupScroll callback
21566
+ // Using refs to avoid recreating the callback when options change
21567
+ const handleScroll = (0, _react.useCallback)(event => {
21568
+ if (!onPopupScroll) return;
21569
+ const target = event.target;
21570
+ if (!target) return;
21571
+
21572
+ // Check if scroll is near bottom
21573
+ const isNearBottom = Math.floor(target.scrollHeight - target.scrollTop) <= target.clientHeight;
21574
+
21575
+ // Only call onPopupScroll if scroll is near bottom
21576
+ // Developer will handle hasMore and isLoading checks inside the callback
21577
+ if (!isNearBottom) {
21578
+ // Reset processing flag when not near bottom
21579
+ isScrollProcessingRef.current = false;
21580
+ return;
21581
+ }
21582
+
21583
+ // Prevent multiple scroll triggers while already processing
21584
+ // This ensures we don't trigger multiple API calls simultaneously
21585
+ if (isScrollProcessingRef.current) return;
21586
+
21587
+ // Prevent multiple scroll triggers while already loading
21588
+ // This ensures loading state is managed properly and data loading completes
21589
+ if (isLoadingOnScroll) return;
21590
+
21591
+ // Don't trigger if there are no more items to load
21592
+ // This prevents showing loading state when all items are exhausted
21593
+ if (!hasMore) {
21594
+ isScrollProcessingRef.current = false;
21595
+ return;
21596
+ }
21597
+
21598
+ // Throttle scroll events to prevent rapid-fire API calls
21599
+ // Clear any existing throttle timeout
21600
+ if (scrollThrottleTimeoutRef.current) {
21601
+ clearTimeout(scrollThrottleTimeoutRef.current);
21602
+ }
21603
+
21604
+ // Set processing flag immediately to prevent duplicate calls
21605
+ isScrollProcessingRef.current = true;
21606
+
21607
+ // Throttle the actual API call to prevent multiple rapid triggers
21608
+ scrollThrottleTimeoutRef.current = setTimeout(() => {
21609
+ // Double-check we're still near bottom and not loading
21610
+ const stillNearBottom = Math.floor(target.scrollHeight - target.scrollTop) <= target.clientHeight;
21611
+ // Also check if hasMore is still true (might have changed during throttle delay)
21612
+ if (!stillNearBottom || isLoadingOnScroll || !hasMore) {
21613
+ isScrollProcessingRef.current = false;
21614
+ return;
21615
+ }
21616
+
21617
+ // Store current options count and options reference before triggering load
21618
+ // This helps detect when new data arrives
21619
+ // Use ref to get current options without depending on options.length
21620
+ const currentOptions = optionsRef.current;
21621
+ prevOptionsCountRef.current = currentOptions.length;
21622
+ prevOptionsRefForScroll.current = currentOptions;
21623
+ // Also store the count at scroll trigger time for orderedOptions update
21624
+ scrollTriggerOptionsCountRef.current = currentOptions.length;
21625
+
21626
+ // Show loading indicator when scrolling near bottom
21627
+ // This happens before calling onPopupScroll to provide immediate feedback
21628
+ setIsLoadingOnScroll(true);
21629
+
21630
+ // Clear any existing timeout
21631
+ if (scrollLoadingTimeoutRef.current) {
21632
+ clearTimeout(scrollLoadingTimeoutRef.current);
21633
+ scrollLoadingTimeoutRef.current = null;
21634
+ }
21635
+
21636
+ // Mark as interacted when user scrolls (triggers data loading)
21637
+ hasInteractedRef.current = true;
21638
+
21639
+ // Call the developer's scroll handler - component already checked scroll position
21640
+ // Developer should check hasMore and isLoading inside the callback
21641
+ // This triggers the async data loading
21642
+ onPopupScroll();
21643
+
21644
+ // Set a fallback timeout to clear loading if options don't change
21645
+ // This prevents loading from staying forever if data never arrives
21646
+ // Using a longer timeout (10 seconds) to give enough time for slow API calls
21647
+ scrollLoadingTimeoutRef.current = setTimeout(() => {
21648
+ // Only clear if still loading (options change detection might have cleared it already)
21649
+ setIsLoadingOnScroll(prev => {
21650
+ if (prev) {
21651
+ // Clear the timeout reference when clearing loading state
21652
+ scrollLoadingTimeoutRef.current = null;
21653
+ // Reset processing flag when loading times out
21654
+ isScrollProcessingRef.current = false;
21655
+ return false;
21656
+ }
21657
+ return prev;
21658
+ });
21659
+ }, _constants.TIMEOUTS.SCROLL_LOADING_TIMEOUT);
21660
+ }, 150); // 150ms throttle to prevent rapid-fire events
21661
+ }, [onPopupScroll, isLoadingOnScroll, hasMore]);
21662
+
21663
+ // Setup scroll listener for onPopupScroll
21664
+ (0, _react.useEffect)(() => {
21665
+ if (!onPopupScroll || !dropdownOpen) return;
21666
+
21667
+ // Use a small delay to ensure DOM is ready
21668
+ const timeoutId = setTimeout(() => {
21669
+ // Find the scrollable container in the dropdown
21670
+ const findScrollContainer = () => {
21671
+ // Try to find the Ant Design dropdown scroll container
21672
+ // Look for dropdowns that are currently visible (not hidden)
21673
+ const dropdowns = document.querySelectorAll('.ant-select-dropdown:not(.ant-select-dropdown-hidden)');
21674
+ if (dropdowns.length === 0) return null;
21675
+
21676
+ // Get the last opened dropdown (most recent)
21677
+ const dropdown = Array.from(dropdowns).pop();
21678
+ if (!dropdown) return null;
21679
+
21680
+ // Look for the scrollable list container
21681
+ const treeList = dropdown.querySelector('.ant-select-tree-list-holder');
21682
+ if (treeList && treeList.scrollHeight > treeList.clientHeight) {
21683
+ return treeList;
21684
+ }
21685
+
21686
+ // Try alternative selectors
21687
+ const virtualList = dropdown.querySelector('.rc-virtual-list-holder');
21688
+ if (virtualList && virtualList.scrollHeight > virtualList.clientHeight) {
21689
+ return virtualList;
21690
+ }
21691
+
21692
+ // Fallback to dropdown itself if it's scrollable
21693
+ if (dropdown.scrollHeight > dropdown.clientHeight) {
21694
+ return dropdown;
21695
+ }
21696
+ return null;
21697
+ };
21698
+ const scrollContainer = findScrollContainer();
21699
+ if (scrollContainer) {
21700
+ scrollContainerRef.current = scrollContainer;
21701
+ scrollContainer.addEventListener('scroll', handleScroll, {
21702
+ passive: true
21703
+ });
21704
+ }
21705
+ }, _constants.TIMEOUTS.SCROLL_CONTAINER_DELAY);
21706
+ return () => {
21707
+ clearTimeout(timeoutId);
21708
+ // Clear throttle timeout when cleaning up
21709
+ if (scrollThrottleTimeoutRef.current) {
21710
+ clearTimeout(scrollThrottleTimeoutRef.current);
21711
+ scrollThrottleTimeoutRef.current = null;
21712
+ }
21713
+ if (scrollContainerRef.current) {
21714
+ scrollContainerRef.current.removeEventListener('scroll', handleScroll);
21715
+ scrollContainerRef.current = null;
21716
+ }
21717
+ // Reset processing flag when listener is removed
21718
+ isScrollProcessingRef.current = false;
21719
+ };
21720
+ }, [onPopupScroll, dropdownOpen, handleScroll]);
20684
21721
  const renderHeader = (0, _react.useMemo)(() => {
20685
21722
  if (!headerLabel && !tooltip) return null;
20686
21723
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
@@ -20723,13 +21760,14 @@ const CapUnifiedSelect = _ref4 => {
20723
21760
  placeholder: "Search",
20724
21761
  variant: "borderless",
20725
21762
  value: searchText,
20726
- onChange: e => setSearchText(e.target.value),
21763
+ onChange: handleSearchChange,
21764
+ onKeyDown: handleSearchKeyDown,
20727
21765
  allowClear: true
20728
21766
  })
20729
21767
  }), isMulti && showUpload && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
20730
21768
  className: _styles.default['cap-unified-select-upload-container'],
20731
21769
  align: "middle",
20732
- onClick: onUpload,
21770
+ onClick: handleUpload,
20733
21771
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
20734
21772
  type: "upload",
20735
21773
  size: "s",
@@ -20737,20 +21775,71 @@ const CapUnifiedSelect = _ref4 => {
20737
21775
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
20738
21776
  type: "label14",
20739
21777
  className: _styles.default['cap-unified-select-upload-label'],
20740
- children: "Upload"
21778
+ children: uploadLabel
20741
21779
  })]
20742
- }), isMulti && currentItems.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectAllCheckbox, {
21780
+ }), isMulti && staticValue && currentItems.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectAllCheckbox, {
20743
21781
  currentItems: currentItems,
20744
21782
  tempValue: Array.isArray(tempValue) ? tempValue : undefined,
20745
21783
  setTempValue: val => setTempValue(val),
20746
21784
  processTreeData: buildTreeMaps
20747
- }), currentItems.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(NoResult, {
21785
+ }), currentItems.length === 0 ? isSearching || isResettingData ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
21786
+ className: _styles.default['cap-unified-select-loading-container'],
21787
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
21788
+ align: "middle",
21789
+ justify: "center",
21790
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSpin.default, {
21791
+ size: "small"
21792
+ })
21793
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
21794
+ align: "middle",
21795
+ justify: "center",
21796
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
21797
+ type: "label14",
21798
+ children: "Loading..."
21799
+ })
21800
+ })]
21801
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NoResult, {
20748
21802
  noResultCustomText: noResultCustomText,
20749
21803
  className: className,
20750
21804
  showUpload: showUpload,
20751
21805
  options: options,
20752
21806
  noResultCustomIcon: noResultCustomIcon
20753
- }) : menu, currentItems.length > 0 && isMulti && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
21807
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
21808
+ className: _styles.default['cap-unified-select-menu-wrapper'],
21809
+ children: [menu, (isSearching || isResettingData) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
21810
+ className: _styles.default['cap-unified-select-loading-overlay'],
21811
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
21812
+ align: "middle",
21813
+ justify: "center",
21814
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSpin.default, {
21815
+ size: "small"
21816
+ })
21817
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
21818
+ align: "middle",
21819
+ justify: "center",
21820
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
21821
+ type: "label14",
21822
+ children: "Loading..."
21823
+ })
21824
+ })]
21825
+ }), isLoadingOnScroll && onPopupScroll && hasMore && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
21826
+ className: _styles.default['cap-unified-select-loading-overlay'],
21827
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
21828
+ align: "middle",
21829
+ justify: "center",
21830
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSpin.default, {
21831
+ size: "small"
21832
+ })
21833
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
21834
+ align: "middle",
21835
+ justify: "center",
21836
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
21837
+ type: "label14",
21838
+ children: "Loading..."
21839
+ })
21840
+ })]
21841
+ })]
21842
+ }), currentItems.length > 0 && isMulti && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
20754
21843
  className: _styles.default['cap-unified-select-confirm-container'],
20755
21844
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
20756
21845
  className: _styles.default['cap-unified-select-confirm-button-group'],
@@ -20767,12 +21856,21 @@ const CapUnifiedSelect = _ref4 => {
20767
21856
  size: "small",
20768
21857
  onClick: handleClearAll,
20769
21858
  children: clearText
20770
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapLabel.default, {
20771
- className: _styles.default['cap-unified-select-selected-count'],
20772
- children: [selectedLeafCount, " selected"]
21859
+ }), onFooterDownloadChange && selectedLeafCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
21860
+ className: _styles.default['cap-unified-select-footer-download-container'],
21861
+ align: "middle",
21862
+ onClick: handleFooterDownload,
21863
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
21864
+ type: "download",
21865
+ size: "s",
21866
+ className: _styles.default['cap-unified-select-footer-download-icon']
21867
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapLabel.default, {
21868
+ className: _styles.default['cap-unified-select-footer-download-label'],
21869
+ children: [selectedLeafCount, " selected"]
21870
+ })]
20773
21871
  })]
20774
21872
  })
20775
- }), (type === SELECT_TYPES.SELECT || type === SELECT_TYPES.TREE_SELECT) && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
21873
+ }), (type === _constants.SELECT_TYPES.SELECT || type === _constants.SELECT_TYPES.TREE_SELECT) && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
20776
21874
  className: _styles.default['cap-unified-select-tree-clear-container'],
20777
21875
  onClick: handleClearAll,
20778
21876
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
@@ -20781,17 +21879,60 @@ const CapUnifiedSelect = _ref4 => {
20781
21879
  })
20782
21880
  })]
20783
21881
  });
20784
- }, [customPopupRender, filteredTree, searchText, isMulti, showUpload, onUpload, noResultCustomText, noResultCustomIcon, options, type, tempValue, handleConfirm, handleClearAll, popoverClassName, className, selectedLeafCount, clearText, allowClear]);
21882
+ }, [customPopupRender, filteredTree, searchText, isMulti, showUpload, uploadLabel, handleUpload, noResultCustomText, noResultCustomIcon, options, type, tempValue, handleConfirm, handleClearAll, popoverClassName, className, selectedLeafCount, clearText, allowClear, staticValue, showSearch, onFooterDownloadChange, handleFooterDownload, isSearching, handleSearchChange, handleSearchKeyDown, isLoadingOnScroll, onPopupScroll, hasMore, isResettingData]);
20785
21883
  const combinedClassName = (0, _react.useMemo)(() => (0, _classnames.default)(containerClassName, _styles.default['cap-unified-tree-select'], {
20786
21884
  [_styles.default['cap-unified-tree-select-readonly']]: readOnly
20787
21885
  }, className), [containerClassName, className, readOnly]);
21886
+
21887
+ // Handle onChange for single select - detect clear button click and call resetData
21888
+ const handleSingleSelectChange = (0, _react.useCallback)(newValue => {
21889
+ // Mark as interacted if value changed from initial
21890
+ if (newValue !== initialTempValueRef.current) {
21891
+ hasInteractedRef.current = true;
21892
+ }
21893
+
21894
+ // If value is cleared (becomes undefined), call resetData
21895
+ if (newValue === undefined || newValue === null) {
21896
+ if (resetData) {
21897
+ // Store current options before calling resetData to detect when they update
21898
+ prevOptionsBeforeResetRef.current = options;
21899
+ setIsResettingData(true);
21900
+ resetDataCalledRef.current = true;
21901
+ resetDataCalledTimeRef.current = Date.now();
21902
+ resetData();
21903
+ }
21904
+ }
21905
+ onChange == null || onChange(newValue);
21906
+ }, [onChange, resetData, options]);
21907
+
21908
+ // Handle onChange for multi select - detect clear and call resetData
21909
+ const handleMultiSelectChange = (0, _react.useCallback)(newValue => {
21910
+ // Mark as interacted if value changed from initial
21911
+ const initialValue = initialTempValueRef.current;
21912
+ const hasChanged = Array.isArray(newValue) && Array.isArray(initialValue) ? newValue.length !== initialValue.length || !newValue.every(v => initialValue.includes(v)) || !initialValue.every(v => newValue.includes(v)) : newValue !== initialValue;
21913
+ if (hasChanged) {
21914
+ hasInteractedRef.current = true;
21915
+ }
21916
+ // If value is cleared (becomes empty array or undefined), call resetData
21917
+ if (newValue === undefined || newValue === null || Array.isArray(newValue) && newValue.length === 0) {
21918
+ if (resetData) {
21919
+ // Store current options before calling resetData to detect when they update
21920
+ prevOptionsBeforeResetRef.current = options;
21921
+ setIsResettingData(true);
21922
+ resetDataCalledRef.current = true;
21923
+ resetDataCalledTimeRef.current = Date.now();
21924
+ resetData();
21925
+ }
21926
+ }
21927
+ setTempValue(newValue);
21928
+ }, [resetData, options]);
20788
21929
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
20789
21930
  className: className,
20790
21931
  children: [renderHeader, /*#__PURE__*/(0, _jsxRuntime.jsx)(_antdV.TreeSelect, _extends({
20791
21932
  treeData: filteredTree,
20792
21933
  value: customPopupRender ? tempValue : value,
20793
21934
  treeNodeLabelProp: "label",
20794
- onChange: isMulti ? setTempValue : onChange,
21935
+ onChange: isMulti ? handleMultiSelectChange : handleSingleSelectChange,
20795
21936
  placeholder: placeholder,
20796
21937
  showSearch: false,
20797
21938
  maxTagCount: 0,
@@ -20813,12 +21954,12 @@ const CapUnifiedSelect = _ref4 => {
20813
21954
  showCheckedStrategy: _antdV.TreeSelect.SHOW_CHILD,
20814
21955
  open: dropdownOpen,
20815
21956
  onOpenChange: handleDropdownVisibilityChange,
20816
- virtual: true,
21957
+ virtual: !enableVirtualization,
20817
21958
  popupMatchSelectWidth: false,
20818
21959
  disabled: disabled,
20819
21960
  filterTreeNode: false,
20820
- listHeight: 256,
20821
- listItemHeight: 32,
21961
+ listHeight: _constants.DEFAULTS.LIST_HEIGHT,
21962
+ listItemHeight: virtualRowHeight,
20822
21963
  popupRender: renderCustomDropdown
20823
21964
  }, rest)), isError && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
20824
21965
  className: _styles.default['cap-unified-select-status'],
@@ -22548,7 +23689,7 @@ var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ = __webpack_require__(1601);
22548
23689
  var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(6314);
22549
23690
  var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
22550
23691
  // Module
22551
- ___CSS_LOADER_EXPORT___.push([module.id, `.blaze-ui-cap-unified-select-header-wrapper{display:flex;align-items:center}.blaze-ui-cap-unified-select-header-wrapper.blaze-ui-disabled{opacity:.5;cursor:not-allowed}.blaze-ui-cap-unified-select-header-wrapper .blaze-ui-cap-unified-select-header-label{font-family:"Roboto",sans-serif;font-weight:500;font-size:1rem;line-height:1.429rem;letter-spacing:0}.blaze-ui-cap-unified-select-header-byline-text{font-family:"Roboto",sans-serif;font-weight:400;font-size:.857rem;letter-spacing:0;color:#97a0af}.blaze-ui-cap-unified-select-container{text-align:justify;min-width:13.786rem}.blaze-ui-cap-unified-select-container.blaze-ui-disabled{cursor:not-allowed}.blaze-ui-cap-unified-select-container.ant-select-focused .ant-select-selector{border:1px solid #091e42 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-more-text{cursor:pointer;color:#091e42;margin-right:.286rem;position:relative}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-suffix-icon{color:#7a869a}.blaze-ui-cap-unified-select-container .blaze-ui-cap-tooltip-with-info-icon{margin-top:.143rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly{pointer-events:none}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly .blaze-ui-cap-unified-select-more-text{pointer-events:auto}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select .ant-select-tree-treenode{padding-left:.286rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-selector{background-color:#fff;border-color:#ebecf0 !important;cursor:default}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-arrow{pointer-events:auto;color:#b3bac5}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:hover .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:active .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:focus .ant-select-selector{border-color:#ebecf0 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-status{color:#ea213a}.blaze-ui-cap-unified-select-container .ant-select-outlined:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-container .ant-select-selector{background-color:#fff !important;border:.071rem solid #7a869a !important;border-radius:.286rem !important}.blaze-ui-cap-unified-select-container .ant-select-selector .ant-select-selection-placeholder{pointer-events:unset;color:#97a0af;display:flex;align-items:center}.blaze-ui-cap-unified-select-container .ant-select-prefix{font-size:1rem;font-weight:400;color:#091e42;line-height:1.429rem}.blaze-ui-cap-unified-select-container .ant-input-affix-wrapper .ant-input-prefix{left:.857rem}.blaze-ui-cap-unified-select-container .ant-select-selector{border-color:#7a869a !important;box-shadow:none !important;outline:0}.blaze-ui-cap-unified-select-container .ant-btn-variant-solid:not(:disabled):not(.ant-btn-disabled):hover{background-color:#47af46}.blaze-ui-cap-unified-select-container .ant-select-dropdown{margin-top:-0.571rem !important;border-radius:.286rem;background-color:#fff;box-shadow:0 .286rem .571rem -0.143rem rgba(9,30,66,.15),0 0 .071rem 0 rgba(9,30,66,.1);max-height:25.714rem;overflow:visible}.blaze-ui-cap-unified-select-container .ant-select-outlined.ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item,.blaze-ui-cap-unified-select-container .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap{align-self:center}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container{border-bottom:.071rem solid #ebecf0 !important;line-height:2.857rem !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container .blaze-ui-cap-unified-select-search-icon{color:#b3bac5}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container{padding:.643rem 1.071rem;cursor:pointer;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container .blaze-ui-cap-unified-select-select-all-checkbox{display:contents !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container{cursor:pointer;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem;padding-left:1.143rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-icon{color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-label{margin-left:.857rem;color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container{display:flex;align-items:center;height:3.429rem;padding:.5rem;border-top:.071rem solid #ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group{display:flex;padding-left:.571rem;align-items:center}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button{background-color:#47af46;height:2.286rem;width:6.714rem;color:#fff}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:hover{background-color:#1f9a1d}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:disabled{background-color:#a1d8a0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-cancel-button{border:rgba(0,0,0,0);box-shadow:none;width:5.714rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-selected-count{display:flex;margin-left:auto;font-size:.857rem;font-weight:400;line-height:1.143rem;color:#5e6c84}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container{display:flex;justify-content:center;align-items:center;height:2.857rem;border-top:.071rem solid #ebecf0;cursor:pointer;color:#091e42}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container:hover{background-color:#ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container .blaze-ui-cap-unified-select-tree-clear-label{font-size:1rem;font-weight:400}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;color:#97a0af;font-size:1rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result .blaze-ui-cap-unified-select-no-result-text{font-weight:500}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix{display:flex;justify-content:flex-start;align-items:center;width:100%;height:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-label{flex:1}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-suffix{display:flex;align-items:center;padding:0 .571rem;max-height:1.429rem;white-space:nowrap;margin-left:.571rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info{margin-left:auto}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon{margin-top:.357rem;color:#42526e}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon .blaze-ui-cap-icon{color:#42526e}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu{margin-top:0 !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu .ant-select-dropdown-menu-item{padding:.571rem 1.714rem !important;height:unset !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu-item-disabled{color:rgba(0,0,0,.25) !important;cursor:not-allowed !important;line-height:1.428rem !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{background-color:rgba(0,0,0,0);height:100%}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper:hover{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode{height:2.857rem;margin-bottom:0}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode:hover{background-color:#fffbe6}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-selected{background-color:#f4f5f7 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled{cursor:not-allowed !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-unified-select-option-label{color:#b3bac5}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-icon{color:#b3bac5 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode.ant-select-tree-treenode-selected{background-color:#f4f5f7}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-leaf .ant-select-tree-switcher-noop{display:none}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox .ant-select-tree-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:hover{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{border-radius:0;padding-left:.214rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-indent{margin-left:.857rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher:not(.ant-select-tree-switcher-noop):hover:before{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher .ant-select-tree-switcher-icon{font-size:.857rem;margin-top:1.286rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-list-holder-inner{width:fit-content !important;min-width:100%}.blaze-ui-cap-unified-select-popup .ant-tree-select:hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-popup .ant-tree-select-focused .ant-select-selector,.blaze-ui-cap-unified-select-popup .ant-tree-select-open .ant-select-selector{border-color:#7a869a;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem}.blaze-ui-cap-unified-select-popup .ant-checkbox-wrapper:not(.ant-checkbox-wrapper-disabled):hover .ant-checkbox-checked:not(.ant-checkbox-disabled) .ant-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper{padding-left:.571rem;border:none;box-shadow:none;border-radius:0;border-bottom:.071rem solid rgba(0,0,0,0);transition:border-color .2s ease}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:hover{border-bottom:.071rem solid #7a869a !important;box-shadow:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:focus-within{border-bottom:.071rem solid #091e42 !important;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper .ant-input{border:none !important;box-shadow:none !important}`, ""]);
23692
+ ___CSS_LOADER_EXPORT___.push([module.id, `.blaze-ui-cap-unified-select-header-wrapper{display:flex;align-items:center}.blaze-ui-cap-unified-select-header-wrapper.blaze-ui-disabled{opacity:.5;cursor:not-allowed}.blaze-ui-cap-unified-select-header-wrapper .blaze-ui-cap-unified-select-header-label{font-family:"Roboto",sans-serif;font-weight:500;font-size:1rem;line-height:1.429rem;letter-spacing:0}.blaze-ui-cap-unified-select-header-byline-text{font-family:"Roboto",sans-serif;font-weight:400;font-size:.857rem;letter-spacing:0;color:#97a0af}.blaze-ui-cap-unified-select-container{text-align:justify;min-width:13.786rem}.blaze-ui-cap-unified-select-container.blaze-ui-disabled{cursor:not-allowed}.blaze-ui-cap-unified-select-container.ant-select-focused .ant-select-selector{border:.071rem solid #091e42 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-more-text{cursor:pointer;color:#091e42;margin-right:.286rem;position:relative}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-suffix-icon{color:#7a869a}.blaze-ui-cap-unified-select-container .blaze-ui-cap-tooltip-with-info-icon{margin-top:.143rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly{pointer-events:none}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly .blaze-ui-cap-unified-select-more-text{pointer-events:auto}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select .ant-select-tree-treenode{padding-left:.286rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-selector{background-color:#fff;border-color:#ebecf0 !important;cursor:default}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-arrow{pointer-events:auto;color:#b3bac5}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:hover .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:active .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:focus .ant-select-selector{border-color:#ebecf0 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-status{color:#ea213a}.blaze-ui-cap-unified-select-container .ant-select-outlined:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-container .ant-select-selector{background-color:#fff !important;border:.071rem solid #7a869a !important;border-radius:.286rem !important}.blaze-ui-cap-unified-select-container .ant-select-selector .ant-select-selection-placeholder{pointer-events:unset;color:#97a0af;display:flex;align-items:center}.blaze-ui-cap-unified-select-container .ant-select-prefix{font-size:1rem;font-weight:400;color:#091e42;line-height:1.429rem}.blaze-ui-cap-unified-select-container .ant-input-affix-wrapper .ant-input-prefix{left:.857rem}.blaze-ui-cap-unified-select-container .ant-select-selector{border-color:#7a869a !important;box-shadow:none !important;outline:0}.blaze-ui-cap-unified-select-container .ant-btn-variant-solid:not(:disabled):not(.ant-btn-disabled):hover{background-color:#47af46}.blaze-ui-cap-unified-select-container .ant-select-dropdown{margin-top:-0.571rem !important;border-radius:.286rem;background-color:#fff;box-shadow:0 .286rem .571rem -0.143rem rgba(9,30,66,.15),0 0 .071rem 0 rgba(9,30,66,.1);max-height:25.714rem;overflow:visible}.blaze-ui-cap-unified-select-container .ant-select-outlined.ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item,.blaze-ui-cap-unified-select-container .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap{align-self:center}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container{border-bottom:.071rem solid #ebecf0 !important;line-height:2.857rem !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container .blaze-ui-cap-unified-select-search-icon{color:#b3bac5}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container{padding:.643rem 1.071rem;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container .blaze-ui-cap-unified-select-select-all-checkbox{display:contents !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container{cursor:pointer;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem;padding-left:1.143rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-icon{color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-label{margin-left:.857rem;color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container{display:flex;align-items:center;height:3.429rem;padding:.5rem;border-top:.071rem solid #ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group{display:flex;padding-left:.571rem;align-items:center;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button{background-color:#47af46;height:2.286rem;width:6.714rem;color:#fff}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:hover{background-color:#1f9a1d}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:disabled{background-color:#a1d8a0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-cancel-button{border:rgba(0,0,0,0);box-shadow:none;width:5.714rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-selected-count{display:flex;margin-left:auto;font-size:.857rem;font-weight:400;line-height:1.143rem;color:#5e6c84}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container{display:flex;justify-content:center;align-items:center;height:2.857rem;border-top:.071rem solid #ebecf0;cursor:pointer;color:#091e42}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container:hover{background-color:#ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container .blaze-ui-cap-unified-select-tree-clear-label{font-size:1rem;font-weight:400}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container{cursor:pointer;display:flex;align-items:center;margin-left:auto;padding-right:1.143rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container:hover{opacity:.8}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container .blaze-ui-cap-unified-select-footer-download-icon{color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container .blaze-ui-cap-unified-select-footer-download-label{margin-left:.857rem;color:#2466ea;font-family:Roboto,sans-serif;font-weight:400;font-style:normal;font-size:.857rem;line-height:1.143rem;letter-spacing:0;text-align:right}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;color:#97a0af;font-size:1rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result .blaze-ui-cap-unified-select-no-result-text{font-weight:500}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;width:100%;gap:.571rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-more{display:flex;align-items:center;justify-content:center;padding:.857rem;border-top:.071rem solid #ebecf0;color:#97a0af}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-menu-wrapper{position:relative;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:rgba(255,255,255,.8);z-index:10;gap:.571rem;color:#97a0af}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix{display:flex;justify-content:start;align-items:center;width:100%;height:100%;line-height:1.5;vertical-align:middle;flex:1}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-label{display:flex;align-items:center;flex-shrink:1;min-width:0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-end{display:flex;align-items:center;gap:.571rem;flex-shrink:0;margin-left:auto}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-suffix{display:flex;align-items:center;padding:0 .571rem;max-height:1.429rem;white-space:nowrap}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon{margin-top:.357rem;color:#42526e}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon .blaze-ui-cap-icon{color:#42526e}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu{margin-top:0 !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu .ant-select-dropdown-menu-item{padding:.571rem 1.714rem !important;height:unset !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu-item-disabled{color:rgba(0,0,0,.25) !important;cursor:not-allowed !important;line-height:1.428rem !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{background-color:rgba(0,0,0,0);height:100%;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper:hover{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode{height:2.857rem;margin-bottom:0;display:flex;align-items:center;width:100%}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode:hover{background-color:#fffbe6}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-selected{background-color:#f4f5f7 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled{cursor:not-allowed !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-unified-select-option-label{color:#b3bac5}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-icon{color:#b3bac5 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode.ant-select-tree-treenode-selected{background-color:#f4f5f7}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-leaf .ant-select-tree-switcher-noop{display:none}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox{display:flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox .ant-select-tree-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem;display:flex;align-items:center;justify-content:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:hover{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{border-radius:0;padding-left:.214rem;width:100%;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-title{width:100%;display:flex}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-indent{margin-left:.857rem;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher{display:flex;align-items:center;justify-content:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher:not(.ant-select-tree-switcher-noop):hover:before{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher .ant-select-tree-switcher-icon{font-size:.857rem;margin-top:1.286rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-list-holder-inner{width:fit-content !important;min-width:100%}.blaze-ui-cap-unified-select-popup .ant-tree-select:hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-popup .ant-tree-select-focused .ant-select-selector,.blaze-ui-cap-unified-select-popup .ant-tree-select-open .ant-select-selector{border-color:#7a869a;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem}.blaze-ui-cap-unified-select-popup .ant-checkbox-wrapper:not(.ant-checkbox-wrapper-disabled):hover .ant-checkbox-checked:not(.ant-checkbox-disabled) .ant-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper{padding-left:.571rem;border:none;box-shadow:none;border-radius:0;border-bottom:.071rem solid rgba(0,0,0,0);transition:border-color .2s ease}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:hover{border-bottom:.071rem solid #7a869a !important;box-shadow:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:focus-within{border-bottom:.071rem solid #091e42 !important;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper .ant-input{border:none !important;box-shadow:none !important}`, ""]);
22552
23693
  // Exports
22553
23694
  ___CSS_LOADER_EXPORT___.locals = {
22554
23695
  "cap-unified-select-header-wrapper": `blaze-ui-cap-unified-select-header-wrapper`,
@@ -22577,10 +23718,18 @@ ___CSS_LOADER_EXPORT___.locals = {
22577
23718
  "cap-unified-select-selected-count": `blaze-ui-cap-unified-select-selected-count`,
22578
23719
  "cap-unified-select-tree-clear-container": `blaze-ui-cap-unified-select-tree-clear-container`,
22579
23720
  "cap-unified-select-tree-clear-label": `blaze-ui-cap-unified-select-tree-clear-label`,
23721
+ "cap-unified-select-footer-download-container": `blaze-ui-cap-unified-select-footer-download-container`,
23722
+ "cap-unified-select-footer-download-icon": `blaze-ui-cap-unified-select-footer-download-icon`,
23723
+ "cap-unified-select-footer-download-label": `blaze-ui-cap-unified-select-footer-download-label`,
22580
23724
  "cap-unified-select-no-result": `blaze-ui-cap-unified-select-no-result`,
22581
23725
  "cap-unified-select-no-result-text": `blaze-ui-cap-unified-select-no-result-text`,
23726
+ "cap-unified-select-loading-container": `blaze-ui-cap-unified-select-loading-container`,
23727
+ "cap-unified-select-loading-more": `blaze-ui-cap-unified-select-loading-more`,
23728
+ "cap-unified-select-menu-wrapper": `blaze-ui-cap-unified-select-menu-wrapper`,
23729
+ "cap-unified-select-loading-overlay": `blaze-ui-cap-unified-select-loading-overlay`,
22582
23730
  "cap-unified-select-option-with-suffix": `blaze-ui-cap-unified-select-option-with-suffix`,
22583
23731
  "cap-unified-select-option-label": `blaze-ui-cap-unified-select-option-label`,
23732
+ "cap-unified-select-option-end": `blaze-ui-cap-unified-select-option-end`,
22584
23733
  "cap-unified-select-option-suffix": `blaze-ui-cap-unified-select-option-suffix`,
22585
23734
  "cap-tooltip-with-info": `blaze-ui-cap-tooltip-with-info`,
22586
23735
  "cap-icon": `blaze-ui-cap-icon`
@@ -22588,6 +23737,73 @@ ___CSS_LOADER_EXPORT___.locals = {
22588
23737
  module.exports = ___CSS_LOADER_EXPORT___;
22589
23738
 
22590
23739
 
23740
+ /***/ }),
23741
+
23742
+ /***/ 9788:
23743
+ /***/ ((__unused_webpack_module, exports) => {
23744
+
23745
+ "use strict";
23746
+
23747
+
23748
+ exports.__esModule = true;
23749
+ exports.TIMEOUTS = exports.SELECT_TYPES = exports.DEFAULTS = void 0;
23750
+ /**
23751
+ * Select type constants for CapUnifiedSelect component
23752
+ */
23753
+ const SELECT_TYPES = exports.SELECT_TYPES = {
23754
+ SELECT: 'select',
23755
+ MULTI_SELECT: 'multiSelect',
23756
+ TREE_SELECT: 'treeSelect',
23757
+ MULTI_TREE_SELECT: 'multiTreeSelect'
23758
+ };
23759
+ /**
23760
+ * Timeout constants (in milliseconds)
23761
+ */
23762
+ const TIMEOUTS = exports.TIMEOUTS = {
23763
+ /** Default search debounce timeout */
23764
+ DEFAULT_SEARCH_DEBOUNCE: 300,
23765
+ /** Delay for state updates after search */
23766
+ SEARCH_STATE_UPDATE_DELAY: 100,
23767
+ /** Minimum time since search was cleared to consider data ready */
23768
+ SEARCH_CLEARED_TIMEOUT: 200,
23769
+ /** Buffer time added to debounce for cleared search */
23770
+ SEARCH_CLEARED_BUFFER: 300,
23771
+ /** Buffer time added to debounce for regular search */
23772
+ SEARCH_REGULAR_BUFFER: 500,
23773
+ /** Brief delay to show loading indicator for static search */
23774
+ STATIC_SEARCH_DELAY: 150,
23775
+ /** Timeout for resetData fallback (1 second) */
23776
+ RESET_DATA_TIMEOUT: 1000,
23777
+ /** Minimum time since resetData was called to consider data ready */
23778
+ RESET_DATA_MIN_TIME: 300,
23779
+ /** Maximum time since resetData was called to consider data ready */
23780
+ RESET_DATA_MAX_TIME: 2000,
23781
+ /** Fallback timeout for scroll loading (10 seconds) */
23782
+ SCROLL_LOADING_TIMEOUT: 10000,
23783
+ /** Delay before setting up scroll container listener */
23784
+ SCROLL_CONTAINER_DELAY: 100
23785
+ };
23786
+
23787
+ /**
23788
+ * Default values for component props
23789
+ */
23790
+ const DEFAULTS = exports.DEFAULTS = {
23791
+ /** Default placeholder text */
23792
+ PLACEHOLDER: 'Select an option',
23793
+ /** Default upload button label */
23794
+ UPLOAD_LABEL: 'Upload',
23795
+ /** Default clear button text */
23796
+ CLEAR_TEXT: 'Clear',
23797
+ /** Default no results message */
23798
+ NO_RESULT_TEXT: 'No results found',
23799
+ /** Default no results icon */
23800
+ NO_RESULT_ICON: 'warning',
23801
+ /** Default virtual row height in pixels */
23802
+ VIRTUAL_ROW_HEIGHT: 32,
23803
+ /** Default list height in pixels */
23804
+ LIST_HEIGHT: 256
23805
+ };
23806
+
22591
23807
  /***/ }),
22592
23808
 
22593
23809
  /***/ 9819: