@bikdotai/bik-component-library 0.0.805-beta.8 → 0.0.805

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 (335) hide show
  1. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
  2. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  3. package/dist/cjs/components/BikGiftedChat/GiftedChat/types.js.map +1 -1
  4. package/dist/cjs/components/avatar/Avatar.js +1 -1
  5. package/dist/cjs/components/avatar/Avatar.js.map +1 -1
  6. package/dist/cjs/components/avatar/Avatar.styled.js +3 -3
  7. package/dist/cjs/components/avatar/Avatar.styled.js.map +1 -1
  8. package/dist/cjs/components/avatar/AvatarHelper.js +1 -1
  9. package/dist/cjs/components/avatar/AvatarHelper.js.map +1 -1
  10. package/dist/cjs/components/bik-layout/BikSidebar.js.map +1 -1
  11. package/dist/cjs/components/button/Button.js +1 -1
  12. package/dist/cjs/components/button/Button.js.map +1 -1
  13. package/dist/cjs/components/button/Button.styled.js +1 -1
  14. package/dist/cjs/components/button/Button.styled.js.map +1 -1
  15. package/dist/cjs/components/button/themes.js +1 -1
  16. package/dist/cjs/components/button/themes.js.map +1 -1
  17. package/dist/cjs/components/country-code-picker/CountryCodePicker.js.map +1 -1
  18. package/dist/cjs/components/country-code-picker/CountryPicker.js.map +1 -1
  19. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  20. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  21. package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
  22. package/dist/cjs/components/dropdown/DropdownPopover/index.js.map +1 -1
  23. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  24. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  25. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +5 -6
  26. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
  27. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.js.map +1 -1
  28. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.styled.js.map +1 -1
  29. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js.map +1 -1
  30. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +7 -7
  31. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  32. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  33. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  34. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +4 -8
  35. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js.map +1 -1
  36. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  37. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
  38. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
  39. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  40. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js.map +1 -1
  41. package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
  42. package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
  43. package/dist/cjs/components/dropdown-button/DropdownButton.style.js +6 -10
  44. package/dist/cjs/components/dropdown-button/DropdownButton.style.js.map +1 -1
  45. package/dist/cjs/components/fab-menu/FABMenu.js.map +1 -1
  46. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +1 -1
  47. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js.map +1 -1
  48. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +1 -1
  49. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js.map +1 -1
  50. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -1
  51. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js.map +1 -1
  52. package/dist/cjs/components/icon-button/IconButton.js +1 -1
  53. package/dist/cjs/components/icon-button/IconButton.js.map +1 -1
  54. package/dist/cjs/components/icon-button/IconButton.styled.js +3 -3
  55. package/dist/cjs/components/icon-button/IconButton.styled.js.map +1 -1
  56. package/dist/cjs/components/icon-button/theme.js +1 -1
  57. package/dist/cjs/components/icon-button/theme.js.map +1 -1
  58. package/dist/cjs/components/input/Input.js +1 -1
  59. package/dist/cjs/components/input/Input.js.map +1 -1
  60. package/dist/cjs/components/input/Input.styled.js +1 -1
  61. package/dist/cjs/components/input/Input.styled.js.map +1 -1
  62. package/dist/cjs/components/list-item/ListItem.js +1 -1
  63. package/dist/cjs/components/list-item/ListItem.js.map +1 -1
  64. package/dist/cjs/components/list-item/ListItem.styled.js +1 -1
  65. package/dist/cjs/components/list-item/ListItem.styled.js.map +1 -1
  66. package/dist/cjs/components/list-item/themes.js +1 -1
  67. package/dist/cjs/components/list-item/themes.js.map +1 -1
  68. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js +1 -1
  69. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js.map +1 -1
  70. package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
  71. package/dist/cjs/components/multi-level-dropdown/MenuItem.js.map +1 -1
  72. package/dist/cjs/components/multi-level-dropdown/MenuList.js +1 -1
  73. package/dist/cjs/components/multi-level-dropdown/MenuList.js.map +1 -1
  74. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
  75. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
  76. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js +30 -33
  77. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
  78. package/dist/cjs/components/tag/Tag.js +1 -1
  79. package/dist/cjs/components/tag/Tag.js.map +1 -1
  80. package/dist/cjs/components/tag/Tag.styled.js +1 -1
  81. package/dist/cjs/components/tag/Tag.styled.js.map +1 -1
  82. package/dist/cjs/components/tag/model.js.map +1 -1
  83. package/dist/cjs/components/whats-new/WhatsNew.js +1 -1
  84. package/dist/cjs/components/whats-new/WhatsNew.js.map +1 -1
  85. package/dist/cjs/components/whats-new/WhatsNewButton.js +1 -1
  86. package/dist/cjs/components/whats-new/WhatsNewButton.js.map +1 -1
  87. package/dist/cjs/components/whats-new/WhatsNewPanel.js +1 -1
  88. package/dist/cjs/components/whats-new/WhatsNewPanel.js.map +1 -1
  89. package/dist/cjs/constants/Theme.js +1 -1
  90. package/dist/cjs/constants/Theme.js.map +1 -1
  91. package/dist/cjs/icons/Arrows/Chevron/ChevronUp.js +1 -1
  92. package/dist/cjs/icons/Arrows/Chevron/ChevronUp.js.map +1 -1
  93. package/dist/cjs/index.js +1 -1
  94. package/dist/cjs/src/components/BikGiftedChat/GiftedChat/types.d.ts +2 -2
  95. package/dist/cjs/src/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  96. package/dist/cjs/src/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  97. package/dist/cjs/src/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  98. package/dist/cjs/src/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  99. package/dist/cjs/src/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  100. package/dist/cjs/src/components/avatar/Avatar.d.ts +2 -3
  101. package/dist/cjs/src/components/avatar/AvatarHelper.d.ts +4 -5
  102. package/dist/cjs/src/components/bik-layout/MockMenus.d.ts +0 -1
  103. package/dist/cjs/src/components/bik-layout/index.d.ts +0 -2
  104. package/dist/cjs/src/components/button/Button.styled.d.ts +1 -1
  105. package/dist/cjs/src/components/button/model.d.ts +3 -3
  106. package/dist/cjs/src/components/button/themes.d.ts +2 -2
  107. package/dist/cjs/src/components/country-code-picker/CountryCodePicker.d.ts +1 -1
  108. package/dist/cjs/src/components/country-code-picker/CountryPicker.d.ts +1 -1
  109. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +1 -1
  110. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/description/Description.d.ts +1 -1
  111. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +1 -1
  112. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.d.ts +1 -1
  113. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +1 -1
  114. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +1 -1
  115. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +1 -2
  116. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +1 -1
  117. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.d.ts +1 -1
  118. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +0 -1
  119. package/dist/cjs/src/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +0 -2
  120. package/dist/cjs/src/components/dropdown/hooks/useDropdown.d.ts +0 -2
  121. package/dist/cjs/src/components/dropdown/type.d.ts +1 -2
  122. package/dist/cjs/src/components/dropdown-button/DropdownButton.d.ts +1 -3
  123. package/dist/cjs/src/components/dropdown-button/DropdownButton.style.d.ts +2 -9
  124. package/dist/cjs/src/components/fab-menu/FABMenu.d.ts +1 -1
  125. package/dist/cjs/src/components/feature-announcements/types/feature.types.d.ts +1 -1
  126. package/dist/cjs/src/components/icon-button/IconButton.styled.d.ts +1 -3
  127. package/dist/cjs/src/components/icon-button/model.d.ts +1 -12
  128. package/dist/cjs/src/components/input/Input.model.d.ts +1 -2
  129. package/dist/cjs/src/components/input/Input.styled.d.ts +1 -16
  130. package/dist/cjs/src/components/list-item/List.model.d.ts +1 -1
  131. package/dist/cjs/src/components/list-item/ListItem.styled.d.ts +1 -1
  132. package/dist/cjs/src/components/list-item/themes.d.ts +2 -2
  133. package/dist/cjs/src/components/multi-level-dropdown/GroupedMenuList.d.ts +0 -1
  134. package/dist/cjs/src/components/multi-level-dropdown/MenuItem.d.ts +0 -1
  135. package/dist/cjs/src/components/multi-level-dropdown/MenuList.d.ts +0 -1
  136. package/dist/cjs/src/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +3 -13
  137. package/dist/cjs/src/components/multi-level-dropdown/type.d.ts +0 -1
  138. package/dist/cjs/src/components/tag/Tag.d.ts +1 -1
  139. package/dist/cjs/src/components/tag/Tag.stories.d.ts +5 -5
  140. package/dist/cjs/src/components/tag/Tag.styled.d.ts +1 -3
  141. package/dist/cjs/src/components/tag/model.d.ts +1 -5
  142. package/dist/cjs/src/components/whats-new/WhatsNew.d.ts +0 -2
  143. package/dist/cjs/src/components/whats-new/WhatsNew.types.d.ts +0 -2
  144. package/dist/cjs/src/constants/Theme.d.ts +0 -6
  145. package/dist/cjs/src/icons/Arrows/Chevron/ChevronUp.d.ts +2 -1
  146. package/dist/cjs/src/index.d.ts +0 -1
  147. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
  148. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  149. package/dist/esm/components/BikGiftedChat/GiftedChat/types.js.map +1 -1
  150. package/dist/esm/components/avatar/Avatar.js +1 -1
  151. package/dist/esm/components/avatar/Avatar.js.map +1 -1
  152. package/dist/esm/components/avatar/Avatar.styled.js +6 -6
  153. package/dist/esm/components/avatar/Avatar.styled.js.map +1 -1
  154. package/dist/esm/components/avatar/AvatarHelper.js +1 -1
  155. package/dist/esm/components/avatar/AvatarHelper.js.map +1 -1
  156. package/dist/esm/components/bik-layout/BikSidebar.js.map +1 -1
  157. package/dist/esm/components/button/Button.js +1 -1
  158. package/dist/esm/components/button/Button.js.map +1 -1
  159. package/dist/esm/components/button/Button.styled.js +1 -1
  160. package/dist/esm/components/button/Button.styled.js.map +1 -1
  161. package/dist/esm/components/button/themes.js +1 -1
  162. package/dist/esm/components/button/themes.js.map +1 -1
  163. package/dist/esm/components/country-code-picker/CountryCodePicker.js.map +1 -1
  164. package/dist/esm/components/country-code-picker/CountryPicker.js.map +1 -1
  165. package/dist/esm/components/dropdown/Dropdown.js +1 -1
  166. package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
  167. package/dist/esm/components/dropdown/DropdownPopover/index.js +1 -1
  168. package/dist/esm/components/dropdown/DropdownPopover/index.js.map +1 -1
  169. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  170. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  171. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +2 -3
  172. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
  173. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.js.map +1 -1
  174. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.js.map +1 -1
  175. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js.map +1 -1
  176. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +1 -1
  177. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  178. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  179. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  180. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +2 -6
  181. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js.map +1 -1
  182. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  183. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
  184. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
  185. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  186. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js.map +1 -1
  187. package/dist/esm/components/dropdown-button/DropdownButton.js +1 -1
  188. package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
  189. package/dist/esm/components/dropdown-button/DropdownButton.style.js +4 -8
  190. package/dist/esm/components/dropdown-button/DropdownButton.style.js.map +1 -1
  191. package/dist/esm/components/fab-menu/FABMenu.js.map +1 -1
  192. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +1 -1
  193. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js.map +1 -1
  194. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +1 -1
  195. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js.map +1 -1
  196. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +1 -1
  197. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js.map +1 -1
  198. package/dist/esm/components/icon-button/IconButton.js +1 -1
  199. package/dist/esm/components/icon-button/IconButton.js.map +1 -1
  200. package/dist/esm/components/icon-button/IconButton.styled.js +1 -1
  201. package/dist/esm/components/icon-button/IconButton.styled.js.map +1 -1
  202. package/dist/esm/components/icon-button/theme.js +1 -1
  203. package/dist/esm/components/icon-button/theme.js.map +1 -1
  204. package/dist/esm/components/input/Input.js +1 -1
  205. package/dist/esm/components/input/Input.js.map +1 -1
  206. package/dist/esm/components/input/Input.styled.js +1 -1
  207. package/dist/esm/components/input/Input.styled.js.map +1 -1
  208. package/dist/esm/components/list-item/ListItem.js +1 -1
  209. package/dist/esm/components/list-item/ListItem.js.map +1 -1
  210. package/dist/esm/components/list-item/ListItem.styled.js +1 -1
  211. package/dist/esm/components/list-item/ListItem.styled.js.map +1 -1
  212. package/dist/esm/components/list-item/themes.js +1 -1
  213. package/dist/esm/components/list-item/themes.js.map +1 -1
  214. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js +1 -1
  215. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js.map +1 -1
  216. package/dist/esm/components/multi-level-dropdown/MenuItem.js +1 -1
  217. package/dist/esm/components/multi-level-dropdown/MenuItem.js.map +1 -1
  218. package/dist/esm/components/multi-level-dropdown/MenuList.js +1 -1
  219. package/dist/esm/components/multi-level-dropdown/MenuList.js.map +1 -1
  220. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
  221. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
  222. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js +29 -32
  223. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
  224. package/dist/esm/components/tag/Tag.js +1 -1
  225. package/dist/esm/components/tag/Tag.js.map +1 -1
  226. package/dist/esm/components/tag/Tag.styled.js +1 -1
  227. package/dist/esm/components/tag/Tag.styled.js.map +1 -1
  228. package/dist/esm/components/tag/model.js.map +1 -1
  229. package/dist/esm/components/whats-new/WhatsNew.js +1 -1
  230. package/dist/esm/components/whats-new/WhatsNew.js.map +1 -1
  231. package/dist/esm/components/whats-new/WhatsNewButton.js +1 -1
  232. package/dist/esm/components/whats-new/WhatsNewButton.js.map +1 -1
  233. package/dist/esm/components/whats-new/WhatsNewPanel.js +1 -1
  234. package/dist/esm/components/whats-new/WhatsNewPanel.js.map +1 -1
  235. package/dist/esm/constants/Theme.js +1 -1
  236. package/dist/esm/constants/Theme.js.map +1 -1
  237. package/dist/esm/icons/Arrows/Chevron/ChevronUp.js +1 -1
  238. package/dist/esm/icons/Arrows/Chevron/ChevronUp.js.map +1 -1
  239. package/dist/esm/index.js +1 -1
  240. package/dist/esm/src/components/BikGiftedChat/GiftedChat/types.d.ts +2 -2
  241. package/dist/esm/src/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  242. package/dist/esm/src/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  243. package/dist/esm/src/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  244. package/dist/esm/src/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  245. package/dist/esm/src/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  246. package/dist/esm/src/components/avatar/Avatar.d.ts +2 -3
  247. package/dist/esm/src/components/avatar/AvatarHelper.d.ts +4 -5
  248. package/dist/esm/src/components/bik-layout/MockMenus.d.ts +0 -1
  249. package/dist/esm/src/components/bik-layout/index.d.ts +0 -2
  250. package/dist/esm/src/components/button/Button.styled.d.ts +1 -1
  251. package/dist/esm/src/components/button/model.d.ts +3 -3
  252. package/dist/esm/src/components/button/themes.d.ts +2 -2
  253. package/dist/esm/src/components/country-code-picker/CountryCodePicker.d.ts +1 -1
  254. package/dist/esm/src/components/country-code-picker/CountryPicker.d.ts +1 -1
  255. package/dist/esm/src/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +1 -1
  256. package/dist/esm/src/components/dropdown/OpenedDropdown/components/description/Description.d.ts +1 -1
  257. package/dist/esm/src/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +1 -1
  258. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.d.ts +1 -1
  259. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +1 -1
  260. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +1 -1
  261. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +1 -2
  262. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +1 -1
  263. package/dist/esm/src/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.d.ts +1 -1
  264. package/dist/esm/src/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +0 -1
  265. package/dist/esm/src/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +0 -2
  266. package/dist/esm/src/components/dropdown/hooks/useDropdown.d.ts +0 -2
  267. package/dist/esm/src/components/dropdown/type.d.ts +1 -2
  268. package/dist/esm/src/components/dropdown-button/DropdownButton.d.ts +1 -3
  269. package/dist/esm/src/components/dropdown-button/DropdownButton.style.d.ts +2 -9
  270. package/dist/esm/src/components/fab-menu/FABMenu.d.ts +1 -1
  271. package/dist/esm/src/components/feature-announcements/types/feature.types.d.ts +1 -1
  272. package/dist/esm/src/components/icon-button/IconButton.styled.d.ts +1 -3
  273. package/dist/esm/src/components/icon-button/model.d.ts +1 -12
  274. package/dist/esm/src/components/input/Input.model.d.ts +1 -2
  275. package/dist/esm/src/components/input/Input.styled.d.ts +1 -16
  276. package/dist/esm/src/components/list-item/List.model.d.ts +1 -1
  277. package/dist/esm/src/components/list-item/ListItem.styled.d.ts +1 -1
  278. package/dist/esm/src/components/list-item/themes.d.ts +2 -2
  279. package/dist/esm/src/components/multi-level-dropdown/GroupedMenuList.d.ts +0 -1
  280. package/dist/esm/src/components/multi-level-dropdown/MenuItem.d.ts +0 -1
  281. package/dist/esm/src/components/multi-level-dropdown/MenuList.d.ts +0 -1
  282. package/dist/esm/src/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +3 -13
  283. package/dist/esm/src/components/multi-level-dropdown/type.d.ts +0 -1
  284. package/dist/esm/src/components/tag/Tag.d.ts +1 -1
  285. package/dist/esm/src/components/tag/Tag.stories.d.ts +5 -5
  286. package/dist/esm/src/components/tag/Tag.styled.d.ts +1 -3
  287. package/dist/esm/src/components/tag/model.d.ts +1 -5
  288. package/dist/esm/src/components/whats-new/WhatsNew.d.ts +0 -2
  289. package/dist/esm/src/components/whats-new/WhatsNew.types.d.ts +0 -2
  290. package/dist/esm/src/constants/Theme.d.ts +0 -6
  291. package/dist/esm/src/icons/Arrows/Chevron/ChevronUp.d.ts +2 -1
  292. package/dist/esm/src/index.d.ts +0 -1
  293. package/package.json +2 -1
  294. package/dist/cjs/components/bik-layout/BikSidebarV2/BikSidebarV2.js +0 -2
  295. package/dist/cjs/components/bik-layout/BikSidebarV2/BikSidebarV2.js.map +0 -1
  296. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Popup.js +0 -2
  297. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Popup.js.map +0 -1
  298. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Styles.js +0 -294
  299. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Styles.js.map +0 -1
  300. package/dist/cjs/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js +0 -2
  301. package/dist/cjs/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js.map +0 -1
  302. package/dist/cjs/components/dual-icon-button/DualIconButton.js +0 -2
  303. package/dist/cjs/components/dual-icon-button/DualIconButton.js.map +0 -1
  304. package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js +0 -26
  305. package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js.map +0 -1
  306. package/dist/cjs/src/components/bik-layout/BikSidebarV2/BikSidebarV2.d.ts +0 -33
  307. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SidebarV2.model.d.ts +0 -27
  308. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SidebarV2Popup.d.ts +0 -13
  309. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +0 -44
  310. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SimpleSidebarV2.d.ts +0 -3
  311. package/dist/cjs/src/components/dual-icon-button/DualIconButton.d.ts +0 -3
  312. package/dist/cjs/src/components/dual-icon-button/DualIconButton.styled.d.ts +0 -7
  313. package/dist/cjs/src/components/dual-icon-button/index.d.ts +0 -2
  314. package/dist/cjs/src/components/dual-icon-button/model.d.ts +0 -12
  315. package/dist/esm/components/bik-layout/BikSidebarV2/BikSidebarV2.js +0 -2
  316. package/dist/esm/components/bik-layout/BikSidebarV2/BikSidebarV2.js.map +0 -1
  317. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Popup.js +0 -2
  318. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Popup.js.map +0 -1
  319. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.js +0 -294
  320. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.js.map +0 -1
  321. package/dist/esm/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js +0 -2
  322. package/dist/esm/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js.map +0 -1
  323. package/dist/esm/components/dual-icon-button/DualIconButton.js +0 -2
  324. package/dist/esm/components/dual-icon-button/DualIconButton.js.map +0 -1
  325. package/dist/esm/components/dual-icon-button/DualIconButton.styled.js +0 -26
  326. package/dist/esm/components/dual-icon-button/DualIconButton.styled.js.map +0 -1
  327. package/dist/esm/src/components/bik-layout/BikSidebarV2/BikSidebarV2.d.ts +0 -33
  328. package/dist/esm/src/components/bik-layout/BikSidebarV2/SidebarV2.model.d.ts +0 -27
  329. package/dist/esm/src/components/bik-layout/BikSidebarV2/SidebarV2Popup.d.ts +0 -13
  330. package/dist/esm/src/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +0 -44
  331. package/dist/esm/src/components/bik-layout/BikSidebarV2/SimpleSidebarV2.d.ts +0 -3
  332. package/dist/esm/src/components/dual-icon-button/DualIconButton.d.ts +0 -3
  333. package/dist/esm/src/components/dual-icon-button/DualIconButton.styled.d.ts +0 -7
  334. package/dist/esm/src/components/dual-icon-button/index.d.ts +0 -2
  335. package/dist/esm/src/components/dual-icon-button/model.d.ts +0 -12
@@ -1 +1 @@
1
- {"version":3,"file":"OpennedDropdown.js","sources":["../../../../../../src/components/dropdown/OpenedDropdown/components/OpennedDropdown.tsx"],"sourcesContent":["import ErrorInfoIcon from '@src/assets/icons/errorInfo.svg';\nimport RetryIcon from '@src/assets/icons/refresh-purple.svg';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { ZeroState } from '@src/components/zeroState/ZeroState';\nimport { useOutside } from '@src/hooks/useOutside';\nimport { COLORS } from '@src/constants/Theme';\nimport { useDropdown } from '../../hooks/useDropdown';\nimport {\n\tDropdownOption,\n\tGroupedOption,\n\tMultiSelectOption,\n\tOpenDropdownProps,\n\tSingleOption,\n} from '../../type';\nimport { Description } from './description/Description';\nimport { FreeFormMenu } from './menu/FreeFormMenu';\nimport { MenuList } from './menu/MenuList';\nimport { SelectAllMenu } from './menu/SelectAllMenu';\nimport MultiSelectDropdownBottomBar from './multiSelect/MultiSelectDropdownBottomBar';\nimport {\n\tMenuListContainer,\n\tOpennedDropdownContainer,\n} from './OpennedDropdown.styled';\nimport { SearchBox } from './searchbox/SearchBox';\nimport { SearchZeroState } from './searchbox/SearchZeroState';\n\n/** CONSTANTS */\nconst defaults = {\n\theight: 304,\n\twidth: 290,\n};\n\nexport const OpenedDropdown: React.FC<OpenDropdownProps> = ({\n\toptions,\n\tisSearchable,\n\tisMultiSelect,\n\tmaxSelections,\n\twidth,\n\tallowFreeForm,\n\theight,\n\tonClose,\n\tonSelect,\n\tonSearch,\n\tversion,\n\tskipSorting,\n\theaderRef,\n\thideSelectAll,\n\tprimaryButtonText,\n\tonInfiniteScroll,\n\tonMultiSelectClear: onMultiSelectClearProp,\n\tonDropdownItemClick,\n\tbuttonOptions,\n\tisSearchLoading,\n\tisOptionsLoading,\n\toptionsErrorState,\n\tdisableSearchOptions,\n\tdisableSearchedOptionExcept,\n\tuseDefaultCursor,\n\tcontainerStyle = {},\n\tzeroState = undefined,\n\tisDraggable = false,\n\tonOptionsReorder,\n\thideClearButton = false,\n\tshowCheckboxForCustomElement = false,\n}) => {\n\t// Sort options with selected at top, unselected at bottom, maintaining order within groups\n\tconst sortOptionsWithSelectedOnTop = useCallback(\n\t\t(opts: DropdownOption[]): DropdownOption[] => {\n\t\t\tif (!isDraggable || !isMultiSelect) return opts;\n\n\t\t\tconst selected: DropdownOption[] = [];\n\t\t\tconst unselected: DropdownOption[] = [];\n\n\t\t\topts.forEach((option) => {\n\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t// Handle grouped options - maintain grouping\n\t\t\t\t\tunselected.push(option);\n\t\t\t\t} else {\n\t\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\t\tif (singleOption.selected) {\n\t\t\t\t\t\tselected.push(option);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunselected.push(option);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn [...selected, ...unselected];\n\t\t},\n\t\t[isDraggable, isMultiSelect],\n\t);\n\n\tconst [localOptions, setLocalOptions] = useState<DropdownOption[]>(() =>\n\t\tsortOptionsWithSelectedOnTop(options),\n\t);\n\tconst localOptionsRef = useRef<DropdownOption[]>(localOptions);\n\tconst hasReorderedRef = useRef(false);\n\tconst onOptionsReorderRef = useRef(onOptionsReorder);\n\n\tuseEffect(() => {\n\t\tsetLocalOptions(sortOptionsWithSelectedOnTop(options));\n\t}, [options, sortOptionsWithSelectedOnTop]);\n\n\tuseEffect(() => {\n\t\tlocalOptionsRef.current = localOptions;\n\t}, [localOptions]);\n\n\tuseEffect(() => {\n\t\tonOptionsReorderRef.current = onOptionsReorder;\n\t}, [onOptionsReorder]);\n\n\t// Fire onOptionsReorder on unmount (dropdown close from Apply or click-outside)\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (hasReorderedRef.current && onOptionsReorderRef.current) {\n\t\t\t\tonOptionsReorderRef.current(localOptionsRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\tconst handleOptionsReorder = useCallback(\n\t\t(reorderedOptions: DropdownOption[]) => {\n\t\t\tsetLocalOptions(reorderedOptions);\n\t\t\t// For version 2.0 (no Apply button), apply reorder immediately\n\t\t\tif (version === '2.0') {\n\t\t\t\tonOptionsReorder?.(reorderedOptions);\n\t\t\t} else {\n\t\t\t\t// For version 1.0, defer until Apply/close (handled by unmount cleanup)\n\t\t\t\thasReorderedRef.current = true;\n\t\t\t}\n\t\t},\n\t\t[onOptionsReorder, version],\n\t);\n\n\tconst optionsToUse = isDraggable ? localOptions : options;\n\tconst {\n\t\tdropdownOptions,\n\t\tsearch,\n\t\tsearchedString,\n\t\tsearchedOptions,\n\t\tsearchError,\n\t\tretrySearch,\n\t\tonApplyHandler,\n\t\tselectAllHandler,\n\t\tonMultiSelectClear,\n\t\tonFreeFormSelect,\n\t\tonMultiSelectApply,\n\t\tlatestDropdownOptionsRef,\n\t\tgetSelectedOptions,\n\t\tgetCurrentSelectionCount,\n\t} = useDropdown(\n\t\tversion,\n\t\toptionsToUse,\n\t\tonSelect,\n\t\tskipSorting || isDraggable,\n\t\tisMultiSelect,\n\t\tonSearch,\n\t\tdisableSearchOptions,\n\t\tdisableSearchedOptionExcept,\n\t\tmaxSelections,\n\t);\n\tconst [widthState, setWidthState] = useState(width ?? defaults.width);\n\tconst [descriptionInfo, setDescription] = useState<{\n\t\ttitle: string;\n\t\tdescription: string;\n\t} | null>(null);\n\tconst [focusedIndex, setFocusedIndex] = useState<number>(-1);\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst childRefs = useRef([]);\n\tconst menuListRef = useRef<HTMLDivElement>(null);\n\tuseOutside(\n\t\tref,\n\t\t() => {\n\t\t\tsetDescription(null);\n\t\t\tif (isMultiSelect && version === '2.0') {\n\t\t\t\tconst optionsToSend = getSelectedOptions(\n\t\t\t\t\tlatestDropdownOptionsRef.current,\n\t\t\t\t);\n\t\t\t\tonClose?.(optionsToSend);\n\t\t\t} else {\n\t\t\t\tonClose?.(dropdownOptions);\n\t\t\t}\n\t\t},\n\t\t[headerRef, childRefs],\n\t);\n\n\t// Auto-focus dropdown when it opens for keyboard navigation while preventing scroll to maintain popper positioning\n\tuseEffect(() => {\n\t\tconst timer = setTimeout(() => {\n\t\t\tif (ref.current) {\n\t\t\t\tref.current.focus({ preventScroll: true });\n\t\t\t}\n\t\t}, 0);\n\t\treturn () => clearTimeout(timer);\n\t}, []);\n\n\t// Get flattened selectable options\n\tconst getFlattenedOptions = (opts: DropdownOption[]): SingleOption[] => {\n\t\tconst flattened: SingleOption[] = [];\n\t\topts.forEach((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\tconst groupedOption = option as GroupedOption;\n\t\t\t\tgroupedOption.options.forEach((nestedOption) => {\n\t\t\t\t\tif (!nestedOption.disabled) {\n\t\t\t\t\t\tflattened.push(nestedOption);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\tif (!singleOption.disabled) {\n\t\t\t\t\tflattened.push(singleOption);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn flattened;\n\t};\n\n\t/** Keyboard navigation handler */\n\tuseEffect(() => {\n\t\tconst handleKeyDown = (e: KeyboardEvent) => {\n\t\t\tconst currentOptions =\n\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions;\n\t\t\tconst flattenedOptions = getFlattenedOptions(currentOptions);\n\n\t\t\tif (flattenedOptions.length === 0) return;\n\n\t\t\tif (e.key === 'ArrowDown') {\n\t\t\t\te.preventDefault();\n\t\t\t\tsetFocusedIndex((prev) => {\n\t\t\t\t\tconst newIndex = prev < flattenedOptions.length - 1 ? prev + 1 : 0;\n\t\t\t\t\t// Scroll to the focused item\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tconst focusedElement = menuListRef.current?.querySelector(\n\t\t\t\t\t\t\t`[data-option-index=\"${newIndex}\"]`,\n\t\t\t\t\t\t) as HTMLElement;\n\t\t\t\t\t\tif (focusedElement) {\n\t\t\t\t\t\t\tfocusedElement.scrollIntoView({\n\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t\treturn newIndex;\n\t\t\t\t});\n\t\t\t} else if (e.key === 'ArrowUp') {\n\t\t\t\te.preventDefault();\n\t\t\t\tsetFocusedIndex((prev) => {\n\t\t\t\t\tconst newIndex = prev > 0 ? prev - 1 : flattenedOptions.length - 1;\n\t\t\t\t\t// Scroll to the focused item\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tconst focusedElement = menuListRef.current?.querySelector(\n\t\t\t\t\t\t\t`[data-option-index=\"${newIndex}\"]`,\n\t\t\t\t\t\t) as HTMLElement;\n\t\t\t\t\t\tif (focusedElement) {\n\t\t\t\t\t\t\tfocusedElement.scrollIntoView({\n\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t\treturn newIndex;\n\t\t\t\t});\n\t\t\t} else if (e.key === 'Enter' && focusedIndex >= 0) {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst focusedOption = flattenedOptions[focusedIndex];\n\t\t\t\tif (focusedOption) {\n\t\t\t\t\t// onApplyHandler handles the selection state and calls onSelect internally\n\t\t\t\t\tonApplyHandler({\n\t\t\t\t\t\t...focusedOption,\n\t\t\t\t\t\tselected: !focusedOption.selected,\n\t\t\t\t\t});\n\t\t\t\t\t// Also trigger onDropdownItemClick if provided\n\t\t\t\t\tif (onDropdownItemClick) {\n\t\t\t\t\t\tonDropdownItemClick(focusedOption);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst dropdownElement = ref.current;\n\t\tif (dropdownElement) {\n\t\t\tdropdownElement.addEventListener('keydown', handleKeyDown);\n\t\t\treturn () => {\n\t\t\t\tdropdownElement.removeEventListener('keydown', handleKeyDown);\n\t\t\t};\n\t\t}\n\t}, [\n\t\tfocusedIndex,\n\t\tsearchedString,\n\t\tsearchedOptions,\n\t\tdropdownOptions,\n\t\tonSearch,\n\t\tonApplyHandler,\n\t\tonDropdownItemClick,\n\t]);\n\n\t// LOCAL CONSTANTS\n\tconst heightToUse = height ?? defaults.height;\n\tconst menuListMaxHeight =\n\t\ttypeof heightToUse === 'number'\n\t\t\t? isSearchable && isMultiSelect\n\t\t\t\t? heightToUse - 96\n\t\t\t\t: (isSearchable && !isMultiSelect) || (!isSearchable && isMultiSelect)\n\t\t\t\t? heightToUse - 48\n\t\t\t\t: heightToUse\n\t\t\t: heightToUse;\n\n\tfunction showDescription(title?: string, description?: string) {\n\t\tif (title && description) {\n\t\t\tsetDescription({\n\t\t\t\ttitle,\n\t\t\t\tdescription,\n\t\t\t});\n\t\t} else {\n\t\t\tsetDescription(null);\n\t\t}\n\t}\n\n\tuseEffect(() => {\n\t\tconst widthToUse = width ?? defaults.width;\n\t\tif (descriptionInfo === null) {\n\t\t\tsetWidthState(widthToUse);\n\t\t} else if (typeof widthToUse === 'number') {\n\t\t\tsetWidthState(widthToUse * 2);\n\t\t} else if (typeof widthToUse === 'string') {\n\t\t\tif (widthToUse.endsWith('px')) {\n\t\t\t\tconst newWidth = parseInt(widthToUse.replace('px', '')) * 2;\n\t\t\t\tsetWidthState(newWidth);\n\t\t\t}\n\t\t}\n\t}, [descriptionInfo]);\n\n\t/**\n\t * This is to show the search result in a stateless way\n\t */\n\n\tconst exactMatchFound: boolean[] = [];\n\n\tconst processOptionsWithMaxSelections = (\n\t\toptionsToProcess: DropdownOption[],\n\t) => {\n\t\tif (!isMultiSelect || (!maxSelections && maxSelections !== 0)) {\n\t\t\treturn optionsToProcess;\n\t\t}\n\n\t\t// Count from the full options list (not the filtered subset) so selections\n\t\t// hidden by a search query are still included in the limit check.\n\t\tconst currentSelectionCount = getCurrentSelectionCount(dropdownOptions);\n\t\tconst maxSelectionsReached = currentSelectionCount >= maxSelections;\n\n\t\tif (!maxSelectionsReached) {\n\t\t\treturn optionsToProcess;\n\t\t}\n\n\t\t// Disable unselected options when max selections is reached\n\t\treturn optionsToProcess.map((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\treturn {\n\t\t\t\t\t...option,\n\t\t\t\t\toptions: (option as GroupedOption).options.map((nestedOption) => ({\n\t\t\t\t\t\t...nestedOption,\n\t\t\t\t\t\tdisabled:\n\t\t\t\t\t\t\tnestedOption.disabled ||\n\t\t\t\t\t\t\t(!nestedOption.selected && maxSelectionsReached),\n\t\t\t\t\t})),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\treturn {\n\t\t\t\t\t...singleOption,\n\t\t\t\t\tdisabled:\n\t\t\t\t\t\tsingleOption.disabled ||\n\t\t\t\t\t\t(!singleOption.selected && maxSelectionsReached),\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t};\n\n\tconst optionsToShow = processOptionsWithMaxSelections(\n\t\t(searchedString && onSearch ? searchedOptions : dropdownOptions)\n\t\t\t.map((option) => {\n\t\t\t\tif (searchedString && !onSearch) {\n\t\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t\tconst groupedOption = { ...option } as GroupedOption;\n\t\t\t\t\t\tgroupedOption.options = groupedOption.options.filter((op) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\top.label?.toLowerCase().includes(searchedString.toLowerCase())\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\texactMatchFound.push(\n\t\t\t\t\t\t\t\t\t!searchedString || op.label === searchedString,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn groupedOption.options.length > 0 ? groupedOption : null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\toption.label\n\t\t\t\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(searchedString.toLowerCase()) ||\n\t\t\t\t\t\t\t(option as SingleOption | MultiSelectOption).searchKey\n\t\t\t\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(searchedString.toLowerCase())\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\texactMatchFound.push(\n\t\t\t\t\t\t\t\t!searchedString || option.label === searchedString,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn option;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn option;\n\t\t\t})\n\t\t\t.filter((option) => option !== null) as DropdownOption[],\n\t);\n\n\tconst noResultForSearch =\n\t\t!!isSearchable && searchedString && optionsToShow.length === 0;\n\tconst showLoadingState = !searchedString && !!isOptionsLoading;\n\tconst showErrorState =\n\t\t!searchedString && !!optionsErrorState && !showLoadingState;\n\tconst showEmptyState =\n\t\t!searchedString &&\n\t\t!optionsToShow.length &&\n\t\t!showLoadingState &&\n\t\t!showErrorState;\n\tconst showTopLevelZeroState =\n\t\tshowLoadingState || showErrorState || showEmptyState;\n\n\tconst emptyStateTitle = zeroState?.title || 'No results found';\n\tconst emptyStateSubTitle =\n\t\tzeroState?.subTitle ||\n\t\t`Please try again later or contact us at support@bik.ai if you require further assistance.`;\n\tconst errorStateTitle = optionsErrorState?.title || 'Failed to load options';\n\tconst errorStateSubTitle =\n\t\toptionsErrorState?.subTitle ||\n\t\t'Something went wrong while fetching the list. Please try again';\n\tconst defaultErrorActionButton = {\n\t\tbuttonText: 'Try again',\n\t\tbuttonType: 'text' as const,\n\t\tsize: 'small' as const,\n\t\tbuttonTextColor: COLORS.background.inverseLight,\n\t\tcustomIconColor: COLORS.background.inverseLight,\n\t\tLeadingIcon: RetryIcon,\n\t};\n\n\tconst mergedErrorState = {\n\t\tIconHolderStyle: {\n\t\t\tbackground: COLORS.background.negative.light,\n\t\t},\n\t\tIcon: (\n\t\t\t<ErrorInfoIcon color={COLORS.content.negative} width={24} height={24} />\n\t\t),\n\t\t...optionsErrorState,\n\t};\n\tmergedErrorState.actionButton = {\n\t\t...defaultErrorActionButton,\n\t\t...(optionsErrorState?.actionButton ?? {}),\n\t};\n\tconst zeroStateProps = showLoadingState\n\t\t? undefined\n\t\t: showErrorState\n\t\t? mergedErrorState\n\t\t: zeroState;\n\n\treturn (\n\t\t<OpennedDropdownContainer\n\t\t\tversion={version}\n\t\t\tref={ref}\n\t\t\ttabIndex={-1}\n\t\t\tstyle={{\n\t\t\t\t// maxWidth: descriptionInfo ? 800 : 400,\n\t\t\t\twidth: widthState,\n\t\t\t\t...containerStyle,\n\t\t\t\toutline: 'none',\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\twidth: descriptionInfo ? '50%' : '100%',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\tbackground: 'white',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{!!isSearchable && <SearchBox onSearch={search} version={version} />}\n\n\t\t\t\t{showTopLevelZeroState ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: heightToUse,\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tbackground: COLORS.background.base,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ZeroState\n\t\t\t\t\t\t\t{...(zeroStateProps ?? {})}\n\t\t\t\t\t\t\tisLoading={showLoadingState}\n\t\t\t\t\t\t\ttitle={showErrorState ? errorStateTitle : emptyStateTitle}\n\t\t\t\t\t\t\tsubTitle={\n\t\t\t\t\t\t\t\tshowErrorState ? errorStateSubTitle : emptyStateSubTitle\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<MenuListContainer\n\t\t\t\t\t\tminHeight={heightToUse}\n\t\t\t\t\t\tmaxHeight={menuListMaxHeight}\n\t\t\t\t\t\tref={menuListRef}\n\t\t\t\t\t>\n\t\t\t\t\t\t{!!isMultiSelect && !noResultForSearch && !hideSelectAll && (\n\t\t\t\t\t\t\t<SelectAllMenu\n\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\toptions={\n\t\t\t\t\t\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSelect={selectAllHandler}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!allowFreeForm && noResultForSearch && (\n\t\t\t\t\t\t\t<SearchZeroState\n\t\t\t\t\t\t\t\tisLoading={isSearchLoading}\n\t\t\t\t\t\t\t\terrorMessage={searchError}\n\t\t\t\t\t\t\t\tonRetry={retrySearch}\n\t\t\t\t\t\t\t\theight={menuListMaxHeight as number}\n\t\t\t\t\t\t\t\tsearchedString={searchedString}\n\t\t\t\t\t\t\t\tcontainerWidth={width}\n\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{allowFreeForm &&\n\t\t\t\t\t\t\t(noResultForSearch ||\n\t\t\t\t\t\t\t\t(!!exactMatchFound.length &&\n\t\t\t\t\t\t\t\t\texactMatchFound.every((val) => val === false))) && (\n\t\t\t\t\t\t\t\t<FreeFormMenu\n\t\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\t\t\tonSelect={onFreeFormSelect}\n\t\t\t\t\t\t\t\t\tsearchedString={searchedString}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<MenuList\n\t\t\t\t\t\t\tonInfiniteScroll={onInfiniteScroll}\n\t\t\t\t\t\t\tonDropdownItemClick={onDropdownItemClick}\n\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\tonSelect={onApplyHandler}\n\t\t\t\t\t\t\tshowDescription={showDescription}\n\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\toptions={optionsToShow}\n\t\t\t\t\t\t\tuseDefaultCursor={useDefaultCursor}\n\t\t\t\t\t\t\tref={childRefs}\n\t\t\t\t\t\t\tfocusedIndex={focusedIndex}\n\t\t\t\t\t\t\tisDraggable={isDraggable}\n\t\t\t\t\t\t\tonOptionsReorder={handleOptionsReorder}\n\t\t\t\t\t\t\tshowCheckboxForCustomElement={showCheckboxForCustomElement}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MenuListContainer>\n\t\t\t\t)}\n\t\t\t\t{!!isMultiSelect && !showTopLevelZeroState && version !== '2.0' && (\n\t\t\t\t\t<MultiSelectDropdownBottomBar\n\t\t\t\t\t\tonClear={() => {\n\t\t\t\t\t\t\tonMultiSelectClear();\n\t\t\t\t\t\t\tonMultiSelectClearProp?.();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonApply={onMultiSelectApply}\n\t\t\t\t\t\tlist={\n\t\t\t\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuttonText={primaryButtonText}\n\t\t\t\t\t\tbuttonOptions={buttonOptions}\n\t\t\t\t\t\thideClearButton={hideClearButton}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{!!descriptionInfo && (\n\t\t\t\t<Description\n\t\t\t\t\ttitle={descriptionInfo.title}\n\t\t\t\t\tdescription={descriptionInfo.description}\n\t\t\t\t\tversion={version}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</OpennedDropdownContainer>\n\t);\n};\n"],"names":["defaults","OpenedDropdown","_ref","options","isSearchable","isMultiSelect","maxSelections","width","allowFreeForm","height","onClose","onSelect","onSearch","version","skipSorting","headerRef","hideSelectAll","primaryButtonText","onInfiniteScroll","onMultiSelectClear","onMultiSelectClearProp","onDropdownItemClick","buttonOptions","isSearchLoading","isOptionsLoading","optionsErrorState","disableSearchOptions","disableSearchedOptionExcept","useDefaultCursor","containerStyle","zeroState","isDraggable","onOptionsReorder","hideClearButton","showCheckboxForCustomElement","sortOptionsWithSelectedOnTop","useCallback","opts","selected","unselected","forEach","option","push","localOptions","setLocalOptions","useState","localOptionsRef","useRef","hasReorderedRef","onOptionsReorderRef","useEffect","current","handleOptionsReorder","reorderedOptions","optionsToUse","dropdownOptions","search","searchedString","searchedOptions","searchError","retrySearch","onApplyHandler","selectAllHandler","onFreeFormSelect","onMultiSelectApply","latestDropdownOptionsRef","getSelectedOptions","getCurrentSelectionCount","useDropdown","widthState","setWidthState","descriptionInfo","setDescription","focusedIndex","setFocusedIndex","ref","childRefs","menuListRef","useOutside","optionsToSend","timer","setTimeout","focus","preventScroll","clearTimeout","handleKeyDown","e","flattenedOptions","flattened","nestedOption","disabled","singleOption","getFlattenedOptions","length","key","preventDefault","prev","newIndex","focusedElement","_a","querySelector","scrollIntoView","block","behavior","focusedOption","Object","assign","dropdownElement","addEventListener","removeEventListener","heightToUse","menuListMaxHeight","widthToUse","endsWith","newWidth","parseInt","replace","exactMatchFound","optionsToShow","optionsToProcess","maxSelectionsReached","map","processOptionsWithMaxSelections","groupedOption","filter","op","label","toLowerCase","includes","_b","searchKey","noResultForSearch","showLoadingState","showErrorState","showEmptyState","showTopLevelZeroState","emptyStateTitle","title","emptyStateSubTitle","subTitle","errorStateTitle","errorStateSubTitle","defaultErrorActionButton","buttonText","buttonType","size","buttonTextColor","COLORS","background","inverseLight","customIconColor","LeadingIcon","RetryIcon","mergedErrorState","IconHolderStyle","negative","light","Icon","_jsx","ErrorInfoIcon","color","content","actionButton","zeroStateProps","undefined","_jsxs","OpennedDropdownContainer","tabIndex","style","outline","children","display","flexDirection","SearchBox","base","ZeroState","isLoading","MenuListContainer","minHeight","maxHeight","SelectAllMenu","SearchZeroState","errorMessage","onRetry","containerWidth","every","val","FreeFormMenu","MenuList","showDescription","description","MultiSelectDropdownBottomBar","onClear","onApply","list","Description"],"mappings":"w8BA2BA,MAAMA,EACG,IADHA,EAEE,IAGKC,EAA8CC,IAgCtD,IAhCuDC,QAC3DA,EAAOC,aACPA,EAAYC,cACZA,EAAaC,cACbA,EAAaC,MACbA,EAAKC,cACLA,EAAaC,OACbA,EAAMC,QACNA,EAAOC,SACPA,EAAQC,SACRA,EAAQC,QACRA,EAAOC,YACPA,EAAWC,UACXA,EAASC,cACTA,EAAaC,kBACbA,EAAiBC,iBACjBA,EACAC,mBAAoBC,EAAsBC,oBAC1CA,EAAmBC,cACnBA,EAAaC,gBACbA,EAAeC,iBACfA,EAAgBC,kBAChBA,EAAiBC,qBACjBA,EAAoBC,4BACpBA,EAA2BC,iBAC3BA,EAAgBC,eAChBA,EAAiB,CAAE,EAAAC,UACnBA,EAAqBC,YACrBA,GAAc,EAAKC,iBACnBA,EAAgBC,gBAChBA,GAAkB,EAAKC,6BACvBA,IAA+B,GAC/BhC,SAEA,MAAMiC,GAA+BC,GACnCC,IACA,IAAKN,IAAgB1B,EAAe,OAAOgC,EAE3C,MAAMC,EAA6B,GAC7BC,EAA+B,GAgBrC,OAdAF,EAAKG,SAASC,IACb,GAAKA,EAAyBtC,QAE7BoC,EAAWG,KAAKD,OACV,CACeA,EACJH,SAChBA,EAASI,KAAKD,GAEdF,EAAWG,KAAKD,EAEjB,KAGK,IAAIH,KAAaC,EAAW,GAEpC,CAACR,EAAa1B,KAGRsC,GAAcC,IAAmBC,GAA2B,IAClEV,GAA6BhC,KAExB2C,GAAkBC,EAAyBJ,IAC3CK,GAAkBD,GAAO,GACzBE,GAAsBF,EAAOf,GAEnCkB,GAAU,KACTN,GAAgBT,GAA6BhC,GAAS,GACpD,CAACA,EAASgC,KAEbe,GAAU,KACTJ,GAAgBK,QAAUR,EAAY,GACpC,CAACA,KAEJO,GAAU,KACTD,GAAoBE,QAAUnB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AAUoD,GACVN,eAAgBA,KAInBqG,EAAC8B,EACA,CAAA1K,iBAAkBA,EAClBG,oBAAqBA,EACrBR,QAASA,EACTF,SAAUkD,GACVgI,gBAxPN,SAAyBpD,EAAgBqD,GAEvCtH,GADGiE,GAASqD,EACG,CACdrD,QACAqD,eAGc,KAEjB,EAgPMzL,cAAeA,EACfF,QAASmH,GACT1F,iBAAkBA,EAClB+C,IAAKC,GACLH,aAAcA,GACd1C,YAAaA,EACbC,iBAAkBoB,GAClBlB,6BAA8BA,WAI9B7B,IAAkBkI,IAAqC,QAAZ1H,GAC7CiJ,EAACiC,EACA,CAAAC,QAASA,KACR7K,KACAC,SAAAA,GAA0B,EAE3B6K,QAASjI,GACTkI,KACCzI,IAAkB7C,EAAW8C,GAAkBH,GAEhDwF,WAAY9H,EACZK,cAAeA,EACfW,gBAAiBA,UAIjBsC,IACFuF,EAACqC,EAAW,CACX1D,MAAOlE,GAAgBkE,MACvBqD,YAAavH,GAAgBuH,YAC7BjL,QAASA,OAGe"}
1
+ {"version":3,"file":"OpennedDropdown.js","sources":["../../../../../../src/components/dropdown/OpenedDropdown/components/OpennedDropdown.tsx"],"sourcesContent":["import ErrorInfoIcon from '@src/assets/icons/errorInfo.svg';\nimport RetryIcon from '@src/assets/icons/refresh-purple.svg';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { ZeroState } from '@src/components/zeroState/ZeroState';\nimport { useOutside } from '@src/hooks/useOutside';\nimport { COLORS } from '@src/constants/Theme';\nimport { useDropdown } from '../../hooks/useDropdown';\nimport {\n\tDropdownOption,\n\tGroupedOption,\n\tMultiSelectOption,\n\tOpenDropdownProps,\n\tSingleOption,\n} from '../../type';\nimport { Description } from './description/Description';\nimport { FreeFormMenu } from './menu/FreeFormMenu';\nimport { MenuList } from './menu/MenuList';\nimport { SelectAllMenu } from './menu/SelectAllMenu';\nimport MultiSelectDropdownBottomBar from './multiSelect/MultiSelectDropdownBottomBar';\nimport {\n\tMenuListContainer,\n\tOpennedDropdownContainer,\n} from './OpennedDropdown.styled';\nimport { SearchBox } from './searchbox/SearchBox';\nimport { SearchZeroState } from './searchbox/SearchZeroState';\n\n/** CONSTANTS */\nconst defaults = {\n\theight: 304,\n\twidth: 290,\n};\n\nexport const OpenedDropdown: React.FC<OpenDropdownProps> = ({\n\toptions,\n\tisSearchable,\n\tisMultiSelect,\n\tmaxSelections,\n\twidth,\n\tallowFreeForm,\n\theight,\n\tonClose,\n\tonSelect,\n\tonSearch,\n\tversion,\n\tskipSorting,\n\theaderRef,\n\thideSelectAll,\n\tprimaryButtonText,\n\tonInfiniteScroll,\n\tonMultiSelectClear: onMultiSelectClearProp,\n\tonDropdownItemClick,\n\tbuttonOptions,\n\tisSearchLoading,\n\tisOptionsLoading,\n\toptionsErrorState,\n\tdisableSearchOptions,\n\tdisableSearchedOptionExcept,\n\tuseDefaultCursor,\n\tcontainerStyle = {},\n\tzeroState = undefined,\n\tisDraggable = false,\n\tonOptionsReorder,\n\thideClearButton = false,\n\tshowCheckboxForCustomElement = false,\n}) => {\n\t// Sort options with selected at top, unselected at bottom, maintaining order within groups\n\tconst sortOptionsWithSelectedOnTop = useCallback(\n\t\t(opts: DropdownOption[]): DropdownOption[] => {\n\t\t\tif (!isDraggable || !isMultiSelect) return opts;\n\n\t\t\tconst selected: DropdownOption[] = [];\n\t\t\tconst unselected: DropdownOption[] = [];\n\n\t\t\topts.forEach((option) => {\n\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t// Handle grouped options - maintain grouping\n\t\t\t\t\tunselected.push(option);\n\t\t\t\t} else {\n\t\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\t\tif (singleOption.selected) {\n\t\t\t\t\t\tselected.push(option);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunselected.push(option);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn [...selected, ...unselected];\n\t\t},\n\t\t[isDraggable, isMultiSelect],\n\t);\n\n\tconst [localOptions, setLocalOptions] = useState<DropdownOption[]>(() =>\n\t\tsortOptionsWithSelectedOnTop(options),\n\t);\n\tconst localOptionsRef = useRef<DropdownOption[]>(localOptions);\n\tconst hasReorderedRef = useRef(false);\n\tconst onOptionsReorderRef = useRef(onOptionsReorder);\n\n\tuseEffect(() => {\n\t\tsetLocalOptions(sortOptionsWithSelectedOnTop(options));\n\t}, [options, sortOptionsWithSelectedOnTop]);\n\n\tuseEffect(() => {\n\t\tlocalOptionsRef.current = localOptions;\n\t}, [localOptions]);\n\n\tuseEffect(() => {\n\t\tonOptionsReorderRef.current = onOptionsReorder;\n\t}, [onOptionsReorder]);\n\n\t// Fire onOptionsReorder on unmount (dropdown close from Apply or click-outside)\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (hasReorderedRef.current && onOptionsReorderRef.current) {\n\t\t\t\tonOptionsReorderRef.current(localOptionsRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\tconst handleOptionsReorder = useCallback(\n\t\t(reorderedOptions: DropdownOption[]) => {\n\t\t\tsetLocalOptions(reorderedOptions);\n\t\t\t// For version 2.0 (no Apply button), apply reorder immediately\n\t\t\tif (version === '2.0') {\n\t\t\t\tonOptionsReorder?.(reorderedOptions);\n\t\t\t} else {\n\t\t\t\t// For version 1.0, defer until Apply/close (handled by unmount cleanup)\n\t\t\t\thasReorderedRef.current = true;\n\t\t\t}\n\t\t},\n\t\t[onOptionsReorder, version],\n\t);\n\n\tconst optionsToUse = isDraggable ? localOptions : options;\n\tconst {\n\t\tdropdownOptions,\n\t\tsearch,\n\t\tsearchedString,\n\t\tsearchedOptions,\n\t\tsearchError,\n\t\tretrySearch,\n\t\tonApplyHandler,\n\t\tselectAllHandler,\n\t\tonMultiSelectClear,\n\t\tonFreeFormSelect,\n\t\tonMultiSelectApply,\n\t\tlatestDropdownOptionsRef,\n\t\tgetSelectedOptions,\n\t\tgetCurrentSelectionCount,\n\t} = useDropdown(\n\t\tversion,\n\t\toptionsToUse,\n\t\tonSelect,\n\t\tskipSorting || isDraggable,\n\t\tisMultiSelect,\n\t\tonSearch,\n\t\tdisableSearchOptions,\n\t\tdisableSearchedOptionExcept,\n\t\tmaxSelections,\n\t);\n\tconst [widthState, setWidthState] = useState(width ?? defaults.width);\n\tconst [descriptionInfo, setDescription] = useState<{\n\t\ttitle: string;\n\t\tdescription: string;\n\t} | null>(null);\n\tconst [focusedIndex, setFocusedIndex] = useState<number>(-1);\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst childRefs = useRef([]);\n\tconst menuListRef = useRef<HTMLDivElement>(null);\n\tuseOutside(\n\t\tref,\n\t\t() => {\n\t\t\tsetDescription(null);\n\t\t\tif (isMultiSelect && version === '2.0') {\n\t\t\t\tconst optionsToSend = getSelectedOptions(\n\t\t\t\t\tlatestDropdownOptionsRef.current,\n\t\t\t\t);\n\t\t\t\tonClose?.(optionsToSend);\n\t\t\t} else {\n\t\t\t\tonClose?.(dropdownOptions);\n\t\t\t}\n\t\t},\n\t\t[headerRef, childRefs],\n\t);\n\n\t// Auto-focus dropdown when it opens for keyboard navigation while preventing scroll to maintain popper positioning\n\tuseEffect(() => {\n\t\tconst timer = setTimeout(() => {\n\t\t\tif (ref.current) {\n\t\t\t\tref.current.focus({ preventScroll: true });\n\t\t\t}\n\t\t}, 0);\n\t\treturn () => clearTimeout(timer);\n\t}, []);\n\n\t// Get flattened selectable options\n\tconst getFlattenedOptions = (opts: DropdownOption[]): SingleOption[] => {\n\t\tconst flattened: SingleOption[] = [];\n\t\topts.forEach((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\tconst groupedOption = option as GroupedOption;\n\t\t\t\tgroupedOption.options.forEach((nestedOption) => {\n\t\t\t\t\tif (!nestedOption.disabled) {\n\t\t\t\t\t\tflattened.push(nestedOption);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\tif (!singleOption.disabled) {\n\t\t\t\t\tflattened.push(singleOption);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn flattened;\n\t};\n\n\t/** Keyboard navigation handler */\n\tuseEffect(() => {\n\t\tconst handleKeyDown = (e: KeyboardEvent) => {\n\t\t\tconst currentOptions =\n\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions;\n\t\t\tconst flattenedOptions = getFlattenedOptions(currentOptions);\n\n\t\t\tif (flattenedOptions.length === 0) return;\n\n\t\t\tif (e.key === 'ArrowDown') {\n\t\t\t\te.preventDefault();\n\t\t\t\tsetFocusedIndex((prev) => {\n\t\t\t\t\tconst newIndex = prev < flattenedOptions.length - 1 ? prev + 1 : 0;\n\t\t\t\t\t// Scroll to the focused item\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tconst focusedElement = menuListRef.current?.querySelector(\n\t\t\t\t\t\t\t`[data-option-index=\"${newIndex}\"]`,\n\t\t\t\t\t\t) as HTMLElement;\n\t\t\t\t\t\tif (focusedElement) {\n\t\t\t\t\t\t\tfocusedElement.scrollIntoView({\n\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t\treturn newIndex;\n\t\t\t\t});\n\t\t\t} else if (e.key === 'ArrowUp') {\n\t\t\t\te.preventDefault();\n\t\t\t\tsetFocusedIndex((prev) => {\n\t\t\t\t\tconst newIndex = prev > 0 ? prev - 1 : flattenedOptions.length - 1;\n\t\t\t\t\t// Scroll to the focused item\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tconst focusedElement = menuListRef.current?.querySelector(\n\t\t\t\t\t\t\t`[data-option-index=\"${newIndex}\"]`,\n\t\t\t\t\t\t) as HTMLElement;\n\t\t\t\t\t\tif (focusedElement) {\n\t\t\t\t\t\t\tfocusedElement.scrollIntoView({\n\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t\treturn newIndex;\n\t\t\t\t});\n\t\t\t} else if (e.key === 'Enter' && focusedIndex >= 0) {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst focusedOption = flattenedOptions[focusedIndex];\n\t\t\t\tif (focusedOption) {\n\t\t\t\t\t// onApplyHandler handles the selection state and calls onSelect internally\n\t\t\t\t\tonApplyHandler({\n\t\t\t\t\t\t...focusedOption,\n\t\t\t\t\t\tselected: !focusedOption.selected,\n\t\t\t\t\t});\n\t\t\t\t\t// Also trigger onDropdownItemClick if provided\n\t\t\t\t\tif (onDropdownItemClick) {\n\t\t\t\t\t\tonDropdownItemClick(focusedOption);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst dropdownElement = ref.current;\n\t\tif (dropdownElement) {\n\t\t\tdropdownElement.addEventListener('keydown', handleKeyDown);\n\t\t\treturn () => {\n\t\t\t\tdropdownElement.removeEventListener('keydown', handleKeyDown);\n\t\t\t};\n\t\t}\n\t}, [\n\t\tfocusedIndex,\n\t\tsearchedString,\n\t\tsearchedOptions,\n\t\tdropdownOptions,\n\t\tonSearch,\n\t\tonApplyHandler,\n\t\tonDropdownItemClick,\n\t]);\n\n\t// LOCAL CONSTANTS\n\tconst heightToUse = height ?? defaults.height;\n\tconst menuListMaxHeight =\n\t\ttypeof heightToUse === 'number'\n\t\t\t? isSearchable && isMultiSelect\n\t\t\t\t? heightToUse - 96\n\t\t\t\t: (isSearchable && !isMultiSelect) || (!isSearchable && isMultiSelect)\n\t\t\t\t? heightToUse - 48\n\t\t\t\t: heightToUse\n\t\t\t: heightToUse;\n\n\tfunction showDescription(title?: string, description?: string) {\n\t\tif (title && description) {\n\t\t\tsetDescription({\n\t\t\t\ttitle,\n\t\t\t\tdescription,\n\t\t\t});\n\t\t} else {\n\t\t\tsetDescription(null);\n\t\t}\n\t}\n\n\tuseEffect(() => {\n\t\tconst widthToUse = width ?? defaults.width;\n\t\tif (descriptionInfo === null) {\n\t\t\tsetWidthState(widthToUse);\n\t\t} else if (typeof widthToUse === 'number') {\n\t\t\tsetWidthState(widthToUse * 2);\n\t\t} else if (typeof widthToUse === 'string') {\n\t\t\tif (widthToUse.endsWith('px')) {\n\t\t\t\tconst newWidth = parseInt(widthToUse.replace('px', '')) * 2;\n\t\t\t\tsetWidthState(newWidth);\n\t\t\t}\n\t\t}\n\t}, [descriptionInfo]);\n\n\t/**\n\t * This is to show the search result in a stateless way\n\t */\n\n\tconst exactMatchFound: boolean[] = [];\n\n\tconst processOptionsWithMaxSelections = (\n\t\toptionsToProcess: DropdownOption[],\n\t) => {\n\t\tif (!isMultiSelect || (!maxSelections && maxSelections !== 0)) {\n\t\t\treturn optionsToProcess;\n\t\t}\n\n\t\t// Count from the full options list (not the filtered subset) so selections\n\t\t// hidden by a search query are still included in the limit check.\n\t\tconst currentSelectionCount = getCurrentSelectionCount(dropdownOptions);\n\t\tconst maxSelectionsReached = currentSelectionCount >= maxSelections;\n\n\t\tif (!maxSelectionsReached) {\n\t\t\treturn optionsToProcess;\n\t\t}\n\n\t\t// Disable unselected options when max selections is reached\n\t\treturn optionsToProcess.map((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\treturn {\n\t\t\t\t\t...option,\n\t\t\t\t\toptions: (option as GroupedOption).options.map((nestedOption) => ({\n\t\t\t\t\t\t...nestedOption,\n\t\t\t\t\t\tdisabled:\n\t\t\t\t\t\t\tnestedOption.disabled ||\n\t\t\t\t\t\t\t(!nestedOption.selected && maxSelectionsReached),\n\t\t\t\t\t})),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\treturn {\n\t\t\t\t\t...singleOption,\n\t\t\t\t\tdisabled:\n\t\t\t\t\t\tsingleOption.disabled ||\n\t\t\t\t\t\t(!singleOption.selected && maxSelectionsReached),\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t};\n\n\tconst optionsToShow = processOptionsWithMaxSelections(\n\t\t(searchedString && onSearch ? searchedOptions : dropdownOptions)\n\t\t\t.map((option) => {\n\t\t\t\tif (searchedString && !onSearch) {\n\t\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t\tconst groupedOption = { ...option } as GroupedOption;\n\t\t\t\t\t\tgroupedOption.options = groupedOption.options.filter((op) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\top.label?.toLowerCase().includes(searchedString.toLowerCase())\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\texactMatchFound.push(\n\t\t\t\t\t\t\t\t\t!searchedString || op.label === searchedString,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn groupedOption.options.length > 0 ? groupedOption : null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\toption.label\n\t\t\t\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(searchedString.toLowerCase()) ||\n\t\t\t\t\t\t\t(option as SingleOption | MultiSelectOption).searchKey\n\t\t\t\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(searchedString.toLowerCase())\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\texactMatchFound.push(\n\t\t\t\t\t\t\t\t!searchedString || option.label === searchedString,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn option;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn option;\n\t\t\t})\n\t\t\t.filter((option) => option !== null) as DropdownOption[],\n\t);\n\n\tconst noResultForSearch =\n\t\t!!isSearchable && searchedString && optionsToShow.length === 0;\n\tconst showLoadingState = !searchedString && !!isOptionsLoading;\n\tconst showErrorState =\n\t\t!searchedString && !!optionsErrorState && !showLoadingState;\n\tconst showEmptyState =\n\t\t!searchedString &&\n\t\t!optionsToShow.length &&\n\t\t!showLoadingState &&\n\t\t!showErrorState;\n\tconst showTopLevelZeroState =\n\t\tshowLoadingState || showErrorState || showEmptyState;\n\n\tconst emptyStateTitle = zeroState?.title || 'No results found';\n\tconst emptyStateSubTitle =\n\t\tzeroState?.subTitle ||\n\t\t`Please try again later or contact us at support@bik.ai if you require further assistance.`;\n\tconst errorStateTitle = optionsErrorState?.title || 'Failed to load options';\n\tconst errorStateSubTitle =\n\t\toptionsErrorState?.subTitle ||\n\t\t'Something went wrong while fetching the list. Please try again';\n\tconst defaultErrorActionButton = {\n\t\tbuttonText: 'Try again',\n\t\tbuttonType: 'text' as const,\n\t\tsize: 'small' as const,\n\t\tbuttonTextColor: COLORS.background.inverseLight,\n\t\tcustomIconColor: COLORS.background.inverseLight,\n\t\tLeadingIcon: RetryIcon,\n\t};\n\n\tconst mergedErrorState = {\n\t\tIconHolderStyle: {\n\t\t\tbackground: COLORS.background.negative.light,\n\t\t},\n\t\tIcon: (\n\t\t\t<ErrorInfoIcon color={COLORS.content.negative} width={24} height={24} />\n\t\t),\n\t\t...optionsErrorState,\n\t};\n\tmergedErrorState.actionButton = {\n\t\t...defaultErrorActionButton,\n\t\t...(optionsErrorState?.actionButton ?? {}),\n\t};\n\tconst zeroStateProps = showLoadingState\n\t\t? undefined\n\t\t: showErrorState\n\t\t? mergedErrorState\n\t\t: zeroState;\n\n\treturn (\n\t\t<OpennedDropdownContainer\n\t\t\tversion={version}\n\t\t\tref={ref}\n\t\t\ttabIndex={-1}\n\t\t\tstyle={{\n\t\t\t\t// maxWidth: descriptionInfo ? 800 : 400,\n\t\t\t\twidth: widthState,\n\t\t\t\t...containerStyle,\n\t\t\t\toutline: 'none',\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\twidth: descriptionInfo ? '50%' : '100%',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\tbackground: 'white',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{!!isSearchable && <SearchBox onSearch={search} version={version} />}\n\n\t\t\t\t{showTopLevelZeroState ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: heightToUse,\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tbackground: COLORS.background.base,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ZeroState\n\t\t\t\t\t\t\t{...(zeroStateProps ?? {})}\n\t\t\t\t\t\t\tisLoading={showLoadingState}\n\t\t\t\t\t\t\ttitle={showErrorState ? errorStateTitle : emptyStateTitle}\n\t\t\t\t\t\t\tsubTitle={\n\t\t\t\t\t\t\t\tshowErrorState ? errorStateSubTitle : emptyStateSubTitle\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<MenuListContainer\n\t\t\t\t\t\tminHeight={heightToUse}\n\t\t\t\t\t\tmaxHeight={menuListMaxHeight}\n\t\t\t\t\t\tref={menuListRef}\n\t\t\t\t\t>\n\t\t\t\t\t\t{!!isMultiSelect && !noResultForSearch && !hideSelectAll && (\n\t\t\t\t\t\t\t<SelectAllMenu\n\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\toptions={\n\t\t\t\t\t\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSelect={selectAllHandler}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!allowFreeForm && noResultForSearch && (\n\t\t\t\t\t\t\t<SearchZeroState\n\t\t\t\t\t\t\t\tisLoading={isSearchLoading}\n\t\t\t\t\t\t\t\terrorMessage={searchError}\n\t\t\t\t\t\t\t\tonRetry={retrySearch}\n\t\t\t\t\t\t\t\theight={menuListMaxHeight as number}\n\t\t\t\t\t\t\t\tsearchedString={searchedString}\n\t\t\t\t\t\t\t\tcontainerWidth={width}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{allowFreeForm &&\n\t\t\t\t\t\t\t(noResultForSearch ||\n\t\t\t\t\t\t\t\t(!!exactMatchFound.length &&\n\t\t\t\t\t\t\t\t\texactMatchFound.every((val) => val === false))) && (\n\t\t\t\t\t\t\t\t<FreeFormMenu\n\t\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\t\t\tonSelect={onFreeFormSelect}\n\t\t\t\t\t\t\t\t\tsearchedString={searchedString}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<MenuList\n\t\t\t\t\t\t\tonInfiniteScroll={onInfiniteScroll}\n\t\t\t\t\t\t\tonDropdownItemClick={onDropdownItemClick}\n\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\tonSelect={onApplyHandler}\n\t\t\t\t\t\t\tshowDescription={showDescription}\n\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\toptions={optionsToShow}\n\t\t\t\t\t\t\tuseDefaultCursor={useDefaultCursor}\n\t\t\t\t\t\t\tref={childRefs}\n\t\t\t\t\t\t\tfocusedIndex={focusedIndex}\n\t\t\t\t\t\t\tisDraggable={isDraggable}\n\t\t\t\t\t\t\tonOptionsReorder={handleOptionsReorder}\n\t\t\t\t\t\t\tshowCheckboxForCustomElement={showCheckboxForCustomElement}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MenuListContainer>\n\t\t\t\t)}\n\t\t\t\t{!!isMultiSelect && !showTopLevelZeroState && version !== '2.0' && (\n\t\t\t\t\t<MultiSelectDropdownBottomBar\n\t\t\t\t\t\tonClear={() => {\n\t\t\t\t\t\t\tonMultiSelectClear();\n\t\t\t\t\t\t\tonMultiSelectClearProp?.();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonApply={onMultiSelectApply}\n\t\t\t\t\t\tlist={\n\t\t\t\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuttonText={primaryButtonText}\n\t\t\t\t\t\tbuttonOptions={buttonOptions}\n\t\t\t\t\t\thideClearButton={hideClearButton}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{!!descriptionInfo && (\n\t\t\t\t<Description\n\t\t\t\t\ttitle={descriptionInfo.title}\n\t\t\t\t\tdescription={descriptionInfo.description}\n\t\t\t\t\tversion={version}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</OpennedDropdownContainer>\n\t);\n};\n"],"names":["defaults","OpenedDropdown","_ref","options","isSearchable","isMultiSelect","maxSelections","width","allowFreeForm","height","onClose","onSelect","onSearch","version","skipSorting","headerRef","hideSelectAll","primaryButtonText","onInfiniteScroll","onMultiSelectClear","onMultiSelectClearProp","onDropdownItemClick","buttonOptions","isSearchLoading","isOptionsLoading","optionsErrorState","disableSearchOptions","disableSearchedOptionExcept","useDefaultCursor","containerStyle","zeroState","isDraggable","onOptionsReorder","hideClearButton","showCheckboxForCustomElement","sortOptionsWithSelectedOnTop","useCallback","opts","selected","unselected","forEach","option","push","localOptions","setLocalOptions","useState","localOptionsRef","useRef","hasReorderedRef","onOptionsReorderRef","useEffect","current","handleOptionsReorder","reorderedOptions","optionsToUse","dropdownOptions","search","searchedString","searchedOptions","searchError","retrySearch","onApplyHandler","selectAllHandler","onFreeFormSelect","onMultiSelectApply","latestDropdownOptionsRef","getSelectedOptions","getCurrentSelectionCount","useDropdown","widthState","setWidthState","descriptionInfo","setDescription","focusedIndex","setFocusedIndex","ref","childRefs","menuListRef","useOutside","optionsToSend","timer","setTimeout","focus","preventScroll","clearTimeout","handleKeyDown","e","flattenedOptions","flattened","nestedOption","disabled","singleOption","getFlattenedOptions","length","key","preventDefault","prev","newIndex","focusedElement","_a","querySelector","scrollIntoView","block","behavior","focusedOption","Object","assign","dropdownElement","addEventListener","removeEventListener","heightToUse","menuListMaxHeight","widthToUse","endsWith","newWidth","parseInt","replace","exactMatchFound","optionsToShow","optionsToProcess","maxSelectionsReached","map","processOptionsWithMaxSelections","groupedOption","filter","op","label","toLowerCase","includes","_b","searchKey","noResultForSearch","showLoadingState","showErrorState","showEmptyState","showTopLevelZeroState","emptyStateTitle","title","emptyStateSubTitle","subTitle","errorStateTitle","errorStateSubTitle","defaultErrorActionButton","buttonText","buttonType","size","buttonTextColor","COLORS","background","inverseLight","customIconColor","LeadingIcon","RetryIcon","mergedErrorState","IconHolderStyle","negative","light","Icon","_jsx","ErrorInfoIcon","color","content","actionButton","zeroStateProps","undefined","_jsxs","OpennedDropdownContainer","tabIndex","style","outline","children","display","flexDirection","SearchBox","base","ZeroState","isLoading","MenuListContainer","minHeight","maxHeight","SelectAllMenu","SearchZeroState","errorMessage","onRetry","containerWidth","every","val","FreeFormMenu","MenuList","showDescription","description","MultiSelectDropdownBottomBar","onClear","onApply","list","Description"],"mappings":"w8BA2BA,MAAMA,EACG,IADHA,EAEE,IAGKC,EAA8CC,IAgCtD,IAhCuDC,QAC3DA,EAAOC,aACPA,EAAYC,cACZA,EAAaC,cACbA,EAAaC,MACbA,EAAKC,cACLA,EAAaC,OACbA,EAAMC,QACNA,EAAOC,SACPA,EAAQC,SACRA,EAAQC,QACRA,EAAOC,YACPA,EAAWC,UACXA,EAASC,cACTA,EAAaC,kBACbA,EAAiBC,iBACjBA,EACAC,mBAAoBC,EAAsBC,oBAC1CA,EAAmBC,cACnBA,EAAaC,gBACbA,EAAeC,iBACfA,EAAgBC,kBAChBA,EAAiBC,qBACjBA,EAAoBC,4BACpBA,EAA2BC,iBAC3BA,EAAgBC,eAChBA,EAAiB,CAAE,EAAAC,UACnBA,EAAqBC,YACrBA,G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avH,GAAgBuH,YAC7BjL,QAASA,OAGe"}
@@ -1,8 +1,7 @@
1
1
  import o from"styled-components";import{COLORS as r}from"../../../../constants/Theme.js";const e=o.div`
2
2
  border-radius: ${o=>"2.0"===o.version?8:4}px;
3
- border: ${o=>"2.0"===o.version||"3.0"===o.version?0:1}px
4
- solid ${r.stroke.primary};
5
- box-shadow: ${o=>"3.0"===o.version?"0px 2px 8px 0px rgba(0, 0, 0, 0.12)":"none"};
3
+ border: ${o=>"2.0"===o.version?0:1}px solid
4
+ ${r.stroke.primary};
6
5
  max-height: 480px;
7
6
  overflow: hidden;
8
7
  display: flex;
@@ -1 +1 @@
1
- {"version":3,"file":"OpennedDropdown.styled.js","sources":["../../../../../../src/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const OpennedDropdownContainer = styled.div<{\n\tversion?: '1.0' | '2.0' | '3.0';\n}>`\n\tborder-radius: ${(props) => (props.version === '2.0' ? 8 : 4)}px;\n\tborder: ${(props) =>\n\t\t\tprops.version === '2.0' || props.version === '3.0' ? 0 : 1}px\n\t\tsolid ${COLORS.stroke.primary};\n\tbox-shadow: ${(props) =>\n\t\tprops.version === '3.0' ? '0px 2px 8px 0px rgba(0, 0, 0, 0.12)' : 'none'};\n\tmax-height: 480px;\n\toverflow: hidden;\n\tdisplay: flex;\n\tflex-direction: row;\n\tposition: relative;\n\tpadding: ${(props) => (props.version === '2.0' ? 4 : 0)}px;\n\tbackground-color: ${COLORS.surface.standard};\n`;\n\nexport const ItemContainer = styled.div`\n\tpadding: 14px 16px 14px 18px;\n\tflex-direction: row;\n\talign-items: center;\n\tborder-bottom-width: 1px;\n\tborder-bottom-style: solid;\n\tborder-bottom-color: ${COLORS.stroke.primary};\n\twidth: 100%;\n\theight: 100%;\n`;\n\nexport const MenuListContainer = styled.div<{\n\tmaxHeight: number | string;\n\tminHeight: number | string;\n}>`\n\tmax-height: ${(props) =>\n\t\ttypeof props.maxHeight === 'number'\n\t\t\t? `${props.maxHeight}px`\n\t\t\t: props.maxHeight};\n\toverflow-y: auto;\n\tposition: relative;\n\t&::-webkit-scrollbar-thumb {\n\t\tbackground: #e0e0e0;\n\t\tborder-radius: 8px;\n\t}\n\t&::-webkit-scrollbar {\n\t\theight: 5px;\n\t\tdisplay: block;\n\t\twidth: 8px;\n\t}\n\t&::-webkit-scrollbar-thumb:horizontal {\n\t\twidth: 8px;\n\t}\n`;\n"],"names":["OpennedDropdownContainer","styled","div","props","version","COLORS","stroke","primary","surface","standard","MenuListContainer","maxHeight"],"mappings":"yFAGaA,MAAAA,EAA2BC,EAAOC,GAE7C;kBACiBC,GAA6B,QAAlBA,EAAMC,QAAoB,EAAI;WAChDD,GACS,QAAlBA,EAAMC,SAAuC,QAAlBD,EAAMC,QAAoB,EAAI;UAClDC,EAAOC,OAAOC;eACRJ,GACI,QAAlBA,EAAMC,QAAoB,sCAAwC;;;;;;YAMvDD,GAA6B,QAAlBA,EAAMC,QAAoB,EAAI;qBACjCC,EAAOG,QAAQC;EAGPR,EAAOC,GAAG;;;;;;wBAMfG,EAAOC,OAAOC;;;EAKzBG,MAAAA,EAAoBT,EAAOC,GAGtC;eACcC,GACa,iBAApBA,EAAMQ,UACV,GAAGR,EAAMQ,cACTR,EAAMQ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"OpennedDropdown.styled.js","sources":["../../../../../../src/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const OpennedDropdownContainer = styled.div<{ version?: '1.0' | '2.0' }>`\n\tborder-radius: ${(props) => (props.version === '2.0' ? 8 : 4)}px;\n\tborder: ${(props) => (props.version === '2.0' ? 0 : 1)}px solid\n\t\t${COLORS.stroke.primary};\n\tmax-height: 480px;\n\toverflow: hidden;\n\tdisplay: flex;\n\tflex-direction: row;\n\tposition: relative;\n\tpadding: ${(props) => (props.version === '2.0' ? 4 : 0)}px;\n\tbackground-color: ${COLORS.surface.standard};\n`;\n\nexport const ItemContainer = styled.div`\n\tpadding: 14px 16px 14px 18px;\n\tflex-direction: row;\n\talign-items: center;\n\tborder-bottom-width: 1px;\n\tborder-bottom-style: solid;\n\tborder-bottom-color: ${COLORS.stroke.primary};\n\twidth: 100%;\n\theight: 100%;\n`;\n\nexport const MenuListContainer = styled.div<{\n\tmaxHeight: number | string;\n\tminHeight: number | string;\n}>`\n\tmax-height: ${(props) =>\n\t\ttypeof props.maxHeight === 'number'\n\t\t\t? `${props.maxHeight}px`\n\t\t\t: props.maxHeight};\n\toverflow-y: auto;\n\tposition: relative;\n\t&::-webkit-scrollbar-thumb {\n\t\tbackground: #e0e0e0;\n\t\tborder-radius: 8px;\n\t}\n\t&::-webkit-scrollbar {\n\t\theight: 5px;\n\t\tdisplay: block;\n\t\twidth: 8px;\n\t}\n\t&::-webkit-scrollbar-thumb:horizontal {\n\t\twidth: 8px;\n\t}\n`;\n"],"names":["OpennedDropdownContainer","styled","div","props","version","COLORS","stroke","primary","surface","standard","MenuListContainer","maxHeight"],"mappings":"yFAGaA,MAAAA,EAA2BC,EAAOC,GAAgC;kBAC5DC,GAA6B,QAAlBA,EAAMC,QAAoB,EAAI;WAChDD,GAA6B,QAAlBA,EAAMC,QAAoB,EAAI;IACjDC,EAAOC,OAAOC;;;;;;YAMLJ,GAA6B,QAAlBA,EAAMC,QAAoB,EAAI;qBACjCC,EAAOG,QAAQC;EAGPR,EAAOC,GAAG;;;;;;wBAMfG,EAAOC,OAAOC;;;EAKzBG,MAAAA,EAAoBT,EAAOC,GAGtC;eACcC,GACa,iBAApBA,EAAMQ,UACV,GAAGR,EAAMQ,cACTR,EAAMQ;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Description.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/description/Description.tsx"],"sourcesContent":["import React from 'react';\nimport { BodySecondary, TitleRegular } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { DescriptionContainer } from './Description.styled';\n\nexport const Description: React.FC<{\n\ttitle: string;\n\tdescription: string;\n\tversion?: '1.0' | '2.0' | '3.0';\n}> = ({ title, description, version }) => {\n\treturn (\n\t\t<DescriptionContainer version={version}>\n\t\t\t<div style={{ padding: version === '2.0' ? 12 : 24 }}>\n\t\t\t\t<TitleRegular\n\t\t\t\t\tstyle={{ color: COLORS.content.primary, marginBottom: 4 }}\n\t\t\t\t>\n\t\t\t\t\t{title}\n\t\t\t\t</TitleRegular>\n\t\t\t\t<BodySecondary style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t{description}\n\t\t\t\t</BodySecondary>\n\t\t\t</div>\n\t\t</DescriptionContainer>\n\t);\n};\n"],"names":["Description","_ref","title","description","version","_jsx","DescriptionContainer","Object","assign","children","_jsxs","style","padding","TitleRegular","color","COLORS","content","primary","marginBottom","BodySecondary","secondary"],"mappings":"6PAKaA,MAAAA,EAIRC,IAAoC,IAAnCC,MAAEA,EAAKC,YAAEA,EAAWC,QAAEA,GAASH,EACpC,OACCI,EAACC,EAAoBC,OAAAC,OAAA,CAACJ,QAASA,GAC9B,CAAAK,SAAAC,EAAA,MAAAH,OAAAC,OAAA,CAAKG,MAAO,CAAEC,QAAqB,QAAZR,EAAoB,GAAK,KAAI,CAAAK,SAAA,CACnDJ,EAACQ,EACAN,OAAAC,OAAA,CAAAG,MAAO,CAAEG,MAAOC,EAAOC,QAAQC,QAASC,aAAc,IAErD,CAAAT,SAAAP,KAEFG,EAACc,EAAaZ,OAAAC,OAAA,CAACG,MAAO,CAAEG,MAAOC,EAAOC,QAAQI,sBAC5CjB,WAGmB"}
1
+ {"version":3,"file":"Description.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/description/Description.tsx"],"sourcesContent":["import React from 'react';\nimport { BodySecondary, TitleRegular } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { DescriptionContainer } from './Description.styled';\n\nexport const Description: React.FC<{\n\ttitle: string;\n\tdescription: string;\n\tversion?: '1.0' | '2.0';\n}> = ({ title, description, version }) => {\n\treturn (\n\t\t<DescriptionContainer version={version}>\n\t\t\t<div style={{ padding: version === '2.0' ? 12 : 24 }}>\n\t\t\t\t<TitleRegular\n\t\t\t\t\tstyle={{ color: COLORS.content.primary, marginBottom: 4 }}\n\t\t\t\t>\n\t\t\t\t\t{title}\n\t\t\t\t</TitleRegular>\n\t\t\t\t<BodySecondary style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t{description}\n\t\t\t\t</BodySecondary>\n\t\t\t</div>\n\t\t</DescriptionContainer>\n\t);\n};\n"],"names":["Description","_ref","title","description","version","_jsx","DescriptionContainer","Object","assign","children","_jsxs","style","padding","TitleRegular","color","COLORS","content","primary","marginBottom","BodySecondary","secondary"],"mappings":"6PAKaA,MAAAA,EAIRC,IAAoC,IAAnCC,MAAEA,EAAKC,YAAEA,EAAWC,QAAEA,GAASH,EACpC,OACCI,EAACC,EAAoBC,OAAAC,OAAA,CAACJ,QAASA,GAC9B,CAAAK,SAAAC,EAAA,MAAAH,OAAAC,OAAA,CAAKG,MAAO,CAAEC,QAAqB,QAAZR,EAAoB,GAAK,KAAI,CAAAK,SAAA,CACnDJ,EAACQ,EACAN,OAAAC,OAAA,CAAAG,MAAO,CAAEG,MAAOC,EAAOC,QAAQC,QAASC,aAAc,IAErD,CAAAT,SAAAP,KAEFG,EAACc,EAAaZ,OAAAC,OAAA,CAACG,MAAO,CAAEG,MAAOC,EAAOC,QAAQI,sBAC5CjB,WAGmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Description.styled.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/description/Description.styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const DescriptionContainer = styled.div<{\n\tversion?: '1.0' | '2.0' | '3.0';\n}>`\n\tbackground: ${COLORS.surface.standard};\n\tborder-left: ${(props) => (props.version === '2.0' ? 0.5 : 1)}px solid\n\t\t${COLORS.stroke.primary};\n\twidth: 50%;\n`;\n"],"names":["DescriptionContainer","styled","div","COLORS","surface","standard","props","version","stroke","primary"],"mappings":"4FAGaA,MAAAA,EAAuBC,EAAOC,GAEzC;eACaC,EAAOC,QAAQC;gBACbC,GAA6B,QAAlBA,EAAMC,QAAoB,GAAM;IACxDJ,EAAOK,OAAOC;;"}
1
+ {"version":3,"file":"Description.styled.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/description/Description.styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const DescriptionContainer = styled.div<{ version?: '1.0' | '2.0' }>`\n\tbackground: ${COLORS.surface.standard};\n\tborder-left: ${(props) => (props.version === '2.0' ? 0.5 : 1)}px solid\n\t\t${COLORS.stroke.primary};\n\twidth: 50%;\n`;\n"],"names":["DescriptionContainer","styled","div","COLORS","surface","standard","props","version","stroke","primary"],"mappings":"4FAGaA,MAAAA,EAAuBC,EAAOC,GAAgC;eAC5DC,EAAOC,QAAQC;gBACbC,GAA6B,QAAlBA,EAAMC,QAAoB,GAAM;IACxDJ,EAAOK,OAAOC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FreeFormMenu.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { CheckBox } from '@src/components/checkBox';\nimport { ListItem } from '@src/components/list-item';\nimport { BodyCaption } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { FreeFormContainer } from './FreeFormMenu.styled';\n\nexport const FreeFormMenu: React.FC<{\n\tisMultiSelect?: boolean;\n\tsearchedString: string;\n\tonSelect: (isChecked: boolean) => void;\n\tversion?: '1.0' | '2.0' | '3.0';\n}> = ({ searchedString, onSelect, isMultiSelect, version }) => {\n\tconst [isChecked, setChecked] = useState(false);\n\tfunction onCheckHandler() {\n\t\tsetChecked(!isChecked);\n\t\tonSelect(!isChecked);\n\t}\n\n\treturn (\n\t\t<ListItem\n\t\t\tversion={version}\n\t\t\tonClick={(e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tonCheckHandler();\n\t\t\t}}\n\t\t\tlistItem={{\n\t\t\t\tlabel: searchedString,\n\t\t\t\tvalue: searchedString,\n\t\t\t}}\n\t\t\tleadingIcon={\n\t\t\t\tisMultiSelect ? (\n\t\t\t\t\t<CheckBox\n\t\t\t\t\t\tsize={version === '2.0' ? 'SMALL' : 'DEFAULT'}\n\t\t\t\t\t\tisChecked={isChecked}\n\t\t\t\t\t\tonValueChange={onCheckHandler}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<></>\n\t\t\t\t)\n\t\t\t}\n\t\t\ttrailingIcon={\n\t\t\t\t<FreeFormContainer>\n\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tcolor: COLORS.content.secondary,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tFreeform\n\t\t\t\t\t</BodyCaption>\n\t\t\t\t</FreeFormContainer>\n\t\t\t}\n\t\t/>\n\t);\n};\n"],"names":["FreeFormMenu","_ref","searchedString","onSelect","isMultiSelect","version","isChecked","setChecked","useState","onCheckHandler","_jsx","ListItem","onClick","e","preventDefault","listItem","label","value","leadingIcon","CheckBox","size","onValueChange","trailingIcon","FreeFormContainer","BodyCaption","Object","assign","style","color","COLORS","content","secondary","children"],"mappings":"qYAOaA,MAAAA,EAKRC,IAAyD,IAAxDC,eAAEA,EAAcC,SAAEA,EAAQC,cAAEA,EAAaC,QAAEA,GAASJ,EACzD,MAAOK,EAAWC,GAAcC,GAAS,GACzC,SAASC,IACRF,GAAYD,GACZH,GAAUG,EACX,CAEA,OACCI,EAACC,EAAQ,CACRN,QAASA,EACTO,QAAUC,IACTA,EAAEC,iBACFL,GAAgB,EAEjBM,SAAU,CACTC,MAAOd,EACPe,MAAOf,GAERgB,YACCd,EACCM,EAACS,EACA,CAAAC,KAAkB,QAAZf,EAAoB,QAAU,UACpCC,UAAWA,EACXe,cAAeZ,IAGhBC,QAGFY,aACCZ,EAACa,YACAb,EAACc,EACAC,OAAAC,OAAA,CAAAC,MAAO,CACNC,MAAOC,EAAOC,QAAQC,YAIV,CAAAC,SAAA,iBAGf"}
1
+ {"version":3,"file":"FreeFormMenu.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { CheckBox } from '@src/components/checkBox';\nimport { ListItem } from '@src/components/list-item';\nimport { BodyCaption } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { FreeFormContainer } from './FreeFormMenu.styled';\n\nexport const FreeFormMenu: React.FC<{\n\tisMultiSelect?: boolean;\n\tsearchedString: string;\n\tonSelect: (isChecked: boolean) => void;\n\tversion?: '1.0' | '2.0';\n}> = ({ searchedString, onSelect, isMultiSelect, version }) => {\n\tconst [isChecked, setChecked] = useState(false);\n\tfunction onCheckHandler() {\n\t\tsetChecked(!isChecked);\n\t\tonSelect(!isChecked);\n\t}\n\n\treturn (\n\t\t<ListItem\n\t\t\tversion={version}\n\t\t\tonClick={(e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tonCheckHandler();\n\t\t\t}}\n\t\t\tlistItem={{\n\t\t\t\tlabel: searchedString,\n\t\t\t\tvalue: searchedString,\n\t\t\t}}\n\t\t\tleadingIcon={\n\t\t\t\tisMultiSelect ? (\n\t\t\t\t\t<CheckBox\n\t\t\t\t\t\tsize={version === '2.0' ? 'SMALL' : 'DEFAULT'}\n\t\t\t\t\t\tisChecked={isChecked}\n\t\t\t\t\t\tonValueChange={onCheckHandler}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<></>\n\t\t\t\t)\n\t\t\t}\n\t\t\ttrailingIcon={\n\t\t\t\t<FreeFormContainer>\n\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tcolor: COLORS.content.secondary,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tFreeform\n\t\t\t\t\t</BodyCaption>\n\t\t\t\t</FreeFormContainer>\n\t\t\t}\n\t\t/>\n\t);\n};\n"],"names":["FreeFormMenu","_ref","searchedString","onSelect","isMultiSelect","version","isChecked","setChecked","useState","onCheckHandler","_jsx","ListItem","onClick","e","preventDefault","listItem","label","value","leadingIcon","CheckBox","size","onValueChange","trailingIcon","FreeFormContainer","BodyCaption","Object","assign","style","color","COLORS","content","secondary","children"],"mappings":"qYAOaA,MAAAA,EAKRC,IAAyD,IAAxDC,eAAEA,EAAcC,SAAEA,EAAQC,cAAEA,EAAaC,QAAEA,GAASJ,EACzD,MAAOK,EAAWC,GAAcC,GAAS,GACzC,SAASC,IACRF,GAAYD,GACZH,GAAUG,EACX,CAEA,OACCI,EAACC,EAAQ,CACRN,QAASA,EACTO,QAAUC,IACTA,EAAEC,iBACFL,GAAgB,EAEjBM,SAAU,CACTC,MAAOd,EACPe,MAAOf,GAERgB,YACCd,EACCM,EAACS,EACA,CAAAC,KAAkB,QAAZf,EAAoB,QAAU,UACpCC,UAAWA,EACXe,cAAeZ,IAGhBC,QAGFY,aACCZ,EAACa,YACAb,EAACc,EACAC,OAAAC,OAAA,CAAAC,MAAO,CACNC,MAAOC,EAAOC,QAAQC,YAIV,CAAAC,SAAA,iBAGf"}
@@ -1,5 +1,5 @@
1
1
  import{jsx as e,Fragment as o,jsxs as n}from"react/jsx-runtime";import t from"../../../../../assets/icons/chevronRight.svg.js";import{forwardRef as r,useState as i}from"react";import s from"styled-components";import{CheckBox as l}from"../../../../checkBox/CheckBox.js";import{ListItem as a}from"../../../../list-item/ListItem.js";import{Tooltip as d}from"../../../../tooltips/Tooltip.js";import{BodyCaption as c}from"../../../../TypographyStyle.js";import{DEFAULT_THEME as p,COLORS as g}from"../../../../../constants/Theme.js";import{FreeFormContainer as m}from"./FreeFormMenu.styled.js";const u=s(a)`
2
- padding: ${e=>"3.0"===e.version?"8px":"2.0"===e.version?"8px 12px":"14px 16px"} !important;
2
+ padding: ${e=>"2.0"===e.version?"8px 12px":"14px 16px"} !important;
3
3
  cursor: pointer;
4
4
  margin-top: ${e=>"2.0"===e.version?"2px":"0"};
5
5
  `,h=s.div`
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItem.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/menu/MenuItem.tsx"],"sourcesContent":["import ChevronRightIcon from '@src/assets/icons/chevronRight.svg';\nimport { forwardRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { CheckBox } from '@src/components/checkBox';\nimport { ListItem } from '@src/components/list-item';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BodyCaption } from '@src/components/TypographyStyle';\nimport { COLORS, DEFAULT_THEME } from '@src/constants/Theme';\nimport { MultiSelectOption, SingleOption } from '../../../type';\nimport { FreeFormContainer } from './FreeFormMenu.styled';\n\nconst StyledListItem = styled(ListItem)<{ version?: '1.0' | '2.0' | '3.0' }>`\n\tpadding: ${(props) =>\n\t\tprops.version === '3.0'\n\t\t\t? '8px'\n\t\t\t: props.version === '2.0'\n\t\t\t? '8px 12px'\n\t\t\t: '14px 16px'} !important;\n\tcursor: pointer;\n\tmargin-top: ${(props) => (props.version === '2.0' ? '2px' : '0')};\n`;\n\nconst StyledChildDropdownContainer = styled.div<{ version: string }>`\n\tbox-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.12);\n\tborder-radius: ${({ version }) => (version === '1.0' ? '0' : '8px')};\n\tpadding: ${({ version }) => (version === '1.0' ? '0' : '4px')};\n\tmin-width: 148px;\n\tborder: ${({ version }) =>\n\t\tversion === '1.0'\n\t\t\t? `1px solid ${DEFAULT_THEME.colorsV2.stroke.primary}`\n\t\t\t: 'none'};\n\tmax-height: 248px;\n\toverflow-y: auto;\n`;\n\nconst DragHandleContainer = styled.div`\n\tdisplay: grid;\n\tgrid-template-columns: repeat(2, 2.86px);\n\tgrid-template-rows: repeat(3, 2.86px);\n\tcolumn-gap: 3.8px;\n\trow-gap: 4px;\n\tmargin-right: 8px;\n\tcursor: move;\n\tflex-shrink: 0;\n\talign-self: center;\n\theight: fit-content;\n\tmin-height: 18px;\n`;\n\nconst DragDot = styled.div`\n\twidth: 2.86px;\n\theight: 2.86px;\n\tborder-radius: 50%;\n\tbackground-color: ${COLORS.content.inactive};\n\tflex-shrink: 0;\n`;\n\nconst MultiSelectLeadingContainer = styled.div`\n\tdisplay: flex;\n\talign-content: center;\n\tjustify-content: center;\n\tgap: 8px;\n`;\n\nconst LeadingIconWrapper = styled.div`\n\tmargin-right: -4px;\n`;\n\nconst SingleSelectDragContainer = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tflex-direction: column;\n\tflex: 1;\n`;\n\ninterface DragHandleIconProps {\n\tonDragStart?: (e: React.DragEvent<HTMLDivElement>) => void;\n\tonDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;\n}\n\nconst DragHandleIcon = ({ onDragStart, onDragEnd }: DragHandleIconProps) => (\n\t<DragHandleContainer\n\t\tdraggable\n\t\tonDragStart={onDragStart}\n\t\tonDragEnd={onDragEnd}\n\t>\n\t\t<DragDot />\n\t\t<DragDot />\n\t\t<DragDot />\n\t\t<DragDot />\n\t\t<DragDot />\n\t\t<DragDot />\n\t</DragHandleContainer>\n);\n\ninterface MenuItemProps {\n\toption: SingleOption | MultiSelectOption;\n\tisMultiSelect?: boolean;\n\tshowDescription: (title?: string, description?: string) => void;\n\tonSelect: (option: SingleOption) => void;\n\tonDropdownItemClick?: (option: SingleOption) => void;\n\tlast?: boolean;\n\tversion?: '1.0' | '2.0' | '3.0';\n\tuseDefaultCursor?: boolean;\n\tisFocused?: boolean;\n\tdataIndex?: number;\n\tisDraggable?: boolean;\n\tonDragStart?: (e: React.DragEvent<HTMLDivElement>) => void;\n\tonDragOver?: (e: React.DragEvent<HTMLDivElement>) => void;\n\tonDrop?: (e: React.DragEvent<HTMLDivElement>) => void;\n\tonDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;\n\tisDraggedOver?: boolean;\n\tshowCheckboxForCustomElement?: boolean;\n}\n// eslint-disable-next-line react/display-name\nexport const MenuItem = forwardRef<HTMLDivElement, MenuItemProps>(\n\t(\n\t\t{\n\t\t\toption,\n\t\t\tisMultiSelect,\n\t\t\tshowDescription,\n\t\t\tonSelect,\n\t\t\tlast,\n\t\t\tversion,\n\t\t\tonDropdownItemClick,\n\t\t\tuseDefaultCursor,\n\t\t\tisFocused = false,\n\t\t\tdataIndex = -1,\n\t\t\tisDraggable = false,\n\t\t\tonDragStart,\n\t\t\tonDragOver,\n\t\t\tonDrop,\n\t\t\tonDragEnd,\n\t\t\tisDraggedOver = false,\n\t\t\tshowCheckboxForCustomElement = false,\n\t\t},\n\t\tchildRef,\n\t) => {\n\t\tconst [isChildOptionHovered, setIsChildOptionHovered] = useState(\n\t\t\toption.selected,\n\t\t);\n\n\t\tconst handleOptionClick = (option: SingleOption, parent?: SingleOption) => {\n\t\t\tif (!option.children) {\n\t\t\t\tonCheckHandler(!option.selected);\n\t\t\t\tconst updatedOption = parent ? { ...option, parent } : option;\n\t\t\t\tonDropdownItemClick?.(updatedOption);\n\t\t\t}\n\t\t};\n\n\t\tconst onCheckHandler = (checked: boolean) => {\n\t\t\tif (!option.disabled) {\n\t\t\t\tonSelect({ ...option, selected: checked });\n\t\t\t}\n\t\t};\n\n\t\tconst onHoverIn = () => {\n\t\t\tif (option.description) {\n\t\t\t\tshowDescription(option.label, option.description);\n\t\t\t} else {\n\t\t\t\tshowDescription();\n\t\t\t}\n\t\t};\n\n\t\tconst cursorConfig = useDefaultCursor ? { cursor: 'default' } : {};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Tooltip\n\t\t\t\t\tbody={''}\n\t\t\t\t\ttooltipContent={\n\t\t\t\t\t\toption.children ? (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tbackgroundColor: DEFAULT_THEME.colorsV2.surface.standard,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tref={childRef}\n\t\t\t\t\t\t\t\tonMouseEnter={() => setIsChildOptionHovered(true)}\n\t\t\t\t\t\t\t\tonMouseLeave={() => setIsChildOptionHovered(false)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<StyledChildDropdownContainer version={version ?? '2.0'}>\n\t\t\t\t\t\t\t\t\t{option.children.map((child) => (\n\t\t\t\t\t\t\t\t\t\t<StyledListItem\n\t\t\t\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\t\t\t\tkey={child.value}\n\t\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\t\tversion !== '1.0' && (option?.children ?? []).length - 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t? { borderBottom: 0 }\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\thandleOptionClick(child, option);\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tlistItem={{ value: child.value, label: child.label }}\n\t\t\t\t\t\t\t\t\t\t\tsubText={child.subText}\n\t\t\t\t\t\t\t\t\t\t\tleadingIcon={child.leadingIcon || undefined}\n\t\t\t\t\t\t\t\t\t\t\tcustomComponent={child.customComponent}\n\t\t\t\t\t\t\t\t\t\t\ttrailingIcon={child.trailingIcon || undefined}\n\t\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\t\toption.disabled\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'inactive'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: child.selected\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'selected'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</StyledChildDropdownContainer>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tplacement={'right-start'}\n\t\t\t\t\thideArrow={true}\n\t\t\t\t>\n\t\t\t\t\t<StyledListItem\n\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\tlast\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\tborderBottom: 0,\n\t\t\t\t\t\t\t\t\t\t...cursorConfig,\n\t\t\t\t\t\t\t\t\t\t...(isDraggedOver\n\t\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t\tborderTop: `2px solid ${COLORS.content.brand}`,\n\t\t\t\t\t\t\t\t\t\t\t\t\topacity: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t...cursorConfig,\n\t\t\t\t\t\t\t\t\t\t...(isDraggedOver\n\t\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t\tborderTop: `2px solid ${COLORS.content.brand}`,\n\t\t\t\t\t\t\t\t\t\t\t\t\topacity: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\thandleOptionClick(option);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonMouseOver={onHoverIn}\n\t\t\t\t\t\tlistItem={{ value: option.value, label: option.label }}\n\t\t\t\t\t\tsubText={option.subText}\n\t\t\t\t\t\tdata-option-index={dataIndex}\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\tid={`dropdown-option-${dataIndex}`}\n\t\t\t\t\t\taria-selected={!!option.selected}\n\t\t\t\t\t\tonDragOver={isDraggable ? onDragOver : undefined}\n\t\t\t\t\t\tonDrop={isDraggable ? onDrop : undefined}\n\t\t\t\t\t\tleadingIcon={\n\t\t\t\t\t\t\tisMultiSelect &&\n\t\t\t\t\t\t\t!(showCheckboxForCustomElement && option.customComponent) ? (\n\t\t\t\t\t\t\t\t<MultiSelectLeadingContainer>\n\t\t\t\t\t\t\t\t\t{isDraggable && (\n\t\t\t\t\t\t\t\t\t\t<DragHandleIcon\n\t\t\t\t\t\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\t\t\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<CheckBox\n\t\t\t\t\t\t\t\t\t\tsize={version === '2.0' ? 'SMALL' : 'DEFAULT'}\n\t\t\t\t\t\t\t\t\t\tisDisabled={option.disabled ?? false}\n\t\t\t\t\t\t\t\t\t\tisChecked={!!option.selected}\n\t\t\t\t\t\t\t\t\t\tonValueChange={onCheckHandler}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<LeadingIconWrapper>{option.leadingIcon}</LeadingIconWrapper>\n\t\t\t\t\t\t\t\t</MultiSelectLeadingContainer>\n\t\t\t\t\t\t\t) : isDraggable ? (\n\t\t\t\t\t\t\t\t<SingleSelectDragContainer>\n\t\t\t\t\t\t\t\t\t<DragHandleIcon\n\t\t\t\t\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\t\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{option.leadingIcon && <div>{option.leadingIcon}</div>}\n\t\t\t\t\t\t\t\t</SingleSelectDragContainer>\n\t\t\t\t\t\t\t) : option.leadingIcon ? (\n\t\t\t\t\t\t\t\t<>{option.leadingIcon}</>\n\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomComponent={\n\t\t\t\t\t\t\tisMultiSelect &&\n\t\t\t\t\t\t\tshowCheckboxForCustomElement &&\n\t\t\t\t\t\t\toption.customComponent ? (\n\t\t\t\t\t\t\t\t<MultiSelectLeadingContainer>\n\t\t\t\t\t\t\t\t\t{isDraggable && (\n\t\t\t\t\t\t\t\t\t\t<DragHandleIcon\n\t\t\t\t\t\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\t\t\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<CheckBox\n\t\t\t\t\t\t\t\t\t\tsize={version === '2.0' ? 'SMALL' : 'DEFAULT'}\n\t\t\t\t\t\t\t\t\t\tisDisabled={option.disabled ?? false}\n\t\t\t\t\t\t\t\t\t\tisChecked={!!option.selected}\n\t\t\t\t\t\t\t\t\t\tonValueChange={onCheckHandler}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{option.customComponent}\n\t\t\t\t\t\t\t\t</MultiSelectLeadingContainer>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\toption.customComponent\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttrailingIcon={\n\t\t\t\t\t\t\toption.isFreeForm ? (\n\t\t\t\t\t\t\t\t<FreeFormContainer>\n\t\t\t\t\t\t\t\t\t<BodyCaption style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\t\t\t\tFreeform\n\t\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t\t</FreeFormContainer>\n\t\t\t\t\t\t\t) : option.children ? (\n\t\t\t\t\t\t\t\t<ChevronRightIcon width={12} height={12} />\n\t\t\t\t\t\t\t) : option.trailingIcon ? (\n\t\t\t\t\t\t\t\t<>{option.trailingIcon}</>\n\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\toption.disabled\n\t\t\t\t\t\t\t\t? 'inactive'\n\t\t\t\t\t\t\t\t: isFocused ||\n\t\t\t\t\t\t\t\t option.selected ||\n\t\t\t\t\t\t\t\t (!isMultiSelect && isChildOptionHovered)\n\t\t\t\t\t\t\t\t? 'selected'\n\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Tooltip>\n\t\t\t</>\n\t\t);\n\t},\n);\n"],"names":["StyledListItem","styled","ListItem","props","version","StyledChildDropdownContainer","div","_ref","_ref2","_ref3","DEFAULT_THEME","colorsV2","stroke","primary","DragHandleContainer","DragDot","COLORS","content","inactive","MultiSelectLeadingContainer","LeadingIconWrapper","SingleSelectDragContainer","DragHandleIcon","_ref4","onDragStart","onDragEnd","_jsxs","Object","assign","draggable","children","_jsx","MenuItem","forwardRef","_ref5","childRef","option","isMultiSelect","showDescription","onSelect","last","onDropdownItemClick","useDefaultCursor","isFocused","dataIndex","isDraggable","onDragOver","onDrop","isDraggedOver","showCheckboxForCustomElement","isChildOptionHovered","setIsChildOptionHovered","useState","selected","handleOptionClick","parent","onCheckHandler","updatedOption","checked","disabled","cursorConfig","cursor","Tooltip","body","tooltipContent","style","backgroundColor","surface","standard","ref","onMouseEnter","onMouseLeave","map","child","_a","length","borderBottom","onClick","e","preventDefault","listItem","value","label","subText","leadingIcon","undefined","customComponent","trailingIcon","variant","_Fragment","placement","hideArrow","borderTop","brand","opacity","onMouseOver","onHoverIn","description","role","id","CheckBox","size","isDisabled","isChecked","onValueChange","_b","isFreeForm","FreeFormContainer","BodyCaption","color","secondary","ChevronRightIcon","width","height"],"mappings":"4kBAWA,MAAMA,EAAiBC,EAAOC,EAA8C;YAC/DC,GACO,QAAlBA,EAAMC,QACH,MACkB,QAAlBD,EAAMC,QACN,WACA;;eAEWD,GAA6B,QAAlBA,EAAMC,QAAoB,MAAQ;EAGvDC,EAA+BJ,EAAOK,GAAwB;;kBAElDC,IAAA,IAACH,QAAEA,GAASG,EAAA,MAAkB,QAAZH,EAAoB,IAAM,KAAK;YACvDI,IAAA,IAACJ,QAAEA,GAASI,EAAA,MAAkB,QAAZJ,EAAoB,IAAM,KAAK;;WAElDK,IAAA,IAACL,QAAEA,GAASK,EAAA,MACT,QAAZL,eACgBM,EAAcC,SAASC,OAAOC,UAC3C,MAAM;;;EAKLC,EAAsBb,EAAOK,GAAG;;;;;;;;;;;;EAchCS,EAAUd,EAAOK,GAAG;;;;qBAILU,EAAOC,QAAQC;;EAI9BC,EAA8BlB,EAAOK,GAAG;;;;;EAOxCc,EAAqBnB,EAAOK,GAAG;;EAI/Be,EAA4BpB,EAAOK,GAAG;;;;;EAYtCgB,EAAiBC,IAAA,IAACC,YAAEA,EAAWC,UAAEA,GAAgCF,EAAA,OACtEG,EAACZ,EACAa,OAAAC,OAAA,CAAAC,WACA,EAAAL,YAAaA,EACbC,UAAWA,GAAS,CAAAK,SAAA,CAEpBC,EAAChB,EAAO,IACRgB,EAAChB,MACDgB,EAAChB,EAAO,CAAA,GACRgB,EAAChB,EAAU,IACXgB,EAAChB,EAAU,CAAA,GACXgB,EAAChB,EAAO,CAAA,MACa,EAuBViB,EAAWC,GACvB,CAAAC,EAoBCC,KACG,IApBHC,OACCA,EAAMC,cACNA,EAAaC,gBACbA,EAAeC,SACfA,EAAQC,KACRA,EAAIpC,QACJA,EAAOqC,oBACPA,EAAmBC,iBACnBA,EAAgBC,UAChBA,GAAY,EAAKC,UACjBA,GAAY,EAAEC,YACdA,GAAc,EAAKrB,YACnBA,EAAWsB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AAOiB,SACpBmD,cAAehD,IAEhBzB,EAACX,EAAoB,CAAAU,SAAAM,EAAOgD,iBAc/BE,gBACCjD,GACAY,GACAb,EAAOkD,gBACN5D,EAACP,EAA2B,CAAAW,SAAA,CAC1Be,GACAd,EAACT,GACAE,YAAaA,EACbC,UAAWA,IAGbM,EAACqE,EACA,CAAAC,KAAkB,QAAZjG,EAAoB,QAAU,UACpCkG,WAA2B,UAAflE,EAAOuB,gBAAQ,IAAA8C,GAAAA,EAC3BF,YAAanE,EAAOiB,SACpBmD,cAAehD,IAEfpB,EAAOkD,mBAGTlD,EAAOkD,gBAGTC,aACCnD,EAAOsE,WACN3E,EAAC4E,EACA,CAAA7E,SAAAC,EAAC6E,EAAWjF,OAAAC,OAAA,CAACqC,MAAO,CAAE4C,MAAO7F,EAAOC,QAAQ6F,YAE9B,CAAAhF,SAAA,gBAEZM,EAAON,SACVC,EAACgF,EAAiB,CAAAC,MAAO,GAAIC,OAAQ,KAClC7E,EAAOmD,aACVxD,EAAG0D,EAAA,CAAA3D,SAAAM,EAAOmD,oBACPF,EAELG,QACCpD,EAAOuB,SACJ,WACAhB,GACAP,EAAOiB,WACLhB,GAAiBa,EACnB,WACA,gBAIJ"}
1
+ {"version":3,"file":"MenuItem.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/menu/MenuItem.tsx"],"sourcesContent":["import ChevronRightIcon from '@src/assets/icons/chevronRight.svg';\nimport { forwardRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { CheckBox } from '@src/components/checkBox';\nimport { ListItem } from '@src/components/list-item';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BodyCaption } from '@src/components/TypographyStyle';\nimport { COLORS, DEFAULT_THEME } from '@src/constants/Theme';\nimport { MultiSelectOption, SingleOption } from '../../../type';\nimport { FreeFormContainer } from './FreeFormMenu.styled';\n\nconst StyledListItem = styled(ListItem)<{ version?: '1.0' | '2.0' }>`\n\tpadding: ${(props) =>\n\t\tprops.version === '2.0' ? '8px 12px' : '14px 16px'} !important;\n\tcursor: pointer;\n\tmargin-top: ${(props) => (props.version === '2.0' ? '2px' : '0')};\n`;\n\nconst StyledChildDropdownContainer = styled.div<{ version: string }>`\n\tbox-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.12);\n\tborder-radius: ${({ version }) => (version === '1.0' ? '0' : '8px')};\n\tpadding: ${({ version }) => (version === '1.0' ? '0' : '4px')};\n\tmin-width: 148px;\n\tborder: ${({ version }) =>\n\t\tversion === '1.0'\n\t\t\t? `1px solid ${DEFAULT_THEME.colorsV2.stroke.primary}`\n\t\t\t: 'none'};\n\tmax-height: 248px;\n\toverflow-y: auto;\n`;\n\nconst DragHandleContainer = styled.div`\n\tdisplay: grid;\n\tgrid-template-columns: repeat(2, 2.86px);\n\tgrid-template-rows: repeat(3, 2.86px);\n\tcolumn-gap: 3.8px;\n\trow-gap: 4px;\n\tmargin-right: 8px;\n\tcursor: move;\n\tflex-shrink: 0;\n\talign-self: center;\n\theight: fit-content;\n\tmin-height: 18px;\n`;\n\nconst DragDot = styled.div`\n\twidth: 2.86px;\n\theight: 2.86px;\n\tborder-radius: 50%;\n\tbackground-color: ${COLORS.content.inactive};\n\tflex-shrink: 0;\n`;\n\nconst MultiSelectLeadingContainer = styled.div`\n\tdisplay: flex;\n\talign-content: center;\n\tjustify-content: center;\n\tgap: 8px;\n`;\n\nconst LeadingIconWrapper = styled.div`\n\tmargin-right: -4px;\n`;\n\nconst SingleSelectDragContainer = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tflex-direction: column;\n\tflex: 1;\n`;\n\ninterface DragHandleIconProps {\n\tonDragStart?: (e: React.DragEvent<HTMLDivElement>) => void;\n\tonDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;\n}\n\nconst DragHandleIcon = ({ onDragStart, onDragEnd }: DragHandleIconProps) => (\n\t<DragHandleContainer\n\t\tdraggable\n\t\tonDragStart={onDragStart}\n\t\tonDragEnd={onDragEnd}\n\t>\n\t\t<DragDot />\n\t\t<DragDot />\n\t\t<DragDot />\n\t\t<DragDot />\n\t\t<DragDot />\n\t\t<DragDot />\n\t</DragHandleContainer>\n);\n\ninterface MenuItemProps {\n\toption: SingleOption | MultiSelectOption;\n\tisMultiSelect?: boolean;\n\tshowDescription: (title?: string, description?: string) => void;\n\tonSelect: (option: SingleOption) => void;\n\tonDropdownItemClick?: (option: SingleOption) => void;\n\tlast?: boolean;\n\tversion?: '1.0' | '2.0';\n\tuseDefaultCursor?: boolean;\n\tisFocused?: boolean;\n\tdataIndex?: number;\n\tisDraggable?: boolean;\n\tonDragStart?: (e: React.DragEvent<HTMLDivElement>) => void;\n\tonDragOver?: (e: React.DragEvent<HTMLDivElement>) => void;\n\tonDrop?: (e: React.DragEvent<HTMLDivElement>) => void;\n\tonDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;\n\tisDraggedOver?: boolean;\n\tshowCheckboxForCustomElement?: boolean;\n}\n// eslint-disable-next-line react/display-name\nexport const MenuItem = forwardRef<HTMLDivElement, MenuItemProps>(\n\t(\n\t\t{\n\t\t\toption,\n\t\t\tisMultiSelect,\n\t\t\tshowDescription,\n\t\t\tonSelect,\n\t\t\tlast,\n\t\t\tversion,\n\t\t\tonDropdownItemClick,\n\t\t\tuseDefaultCursor,\n\t\t\tisFocused = false,\n\t\t\tdataIndex = -1,\n\t\t\tisDraggable = false,\n\t\t\tonDragStart,\n\t\t\tonDragOver,\n\t\t\tonDrop,\n\t\t\tonDragEnd,\n\t\t\tisDraggedOver = false,\n\t\t\tshowCheckboxForCustomElement = false,\n\t\t},\n\t\tchildRef,\n\t) => {\n\t\tconst [isChildOptionHovered, setIsChildOptionHovered] = useState(\n\t\t\toption.selected,\n\t\t);\n\n\t\tconst handleOptionClick = (option: SingleOption, parent?: SingleOption) => {\n\t\t\tif (!option.children) {\n\t\t\t\tonCheckHandler(!option.selected);\n\t\t\t\tconst updatedOption = parent ? { ...option, parent } : option;\n\t\t\t\tonDropdownItemClick?.(updatedOption);\n\t\t\t}\n\t\t};\n\n\t\tconst onCheckHandler = (checked: boolean) => {\n\t\t\tif (!option.disabled) {\n\t\t\t\tonSelect({ ...option, selected: checked });\n\t\t\t}\n\t\t};\n\n\t\tconst onHoverIn = () => {\n\t\t\tif (option.description) {\n\t\t\t\tshowDescription(option.label, option.description);\n\t\t\t} else {\n\t\t\t\tshowDescription();\n\t\t\t}\n\t\t};\n\n\t\tconst cursorConfig = useDefaultCursor ? { cursor: 'default' } : {};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Tooltip\n\t\t\t\t\tbody={''}\n\t\t\t\t\ttooltipContent={\n\t\t\t\t\t\toption.children ? (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tbackgroundColor: DEFAULT_THEME.colorsV2.surface.standard,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tref={childRef}\n\t\t\t\t\t\t\t\tonMouseEnter={() => setIsChildOptionHovered(true)}\n\t\t\t\t\t\t\t\tonMouseLeave={() => setIsChildOptionHovered(false)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<StyledChildDropdownContainer version={version ?? '2.0'}>\n\t\t\t\t\t\t\t\t\t{option.children.map((child) => (\n\t\t\t\t\t\t\t\t\t\t<StyledListItem\n\t\t\t\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\t\t\t\tkey={child.value}\n\t\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\t\tversion !== '1.0' && (option?.children ?? []).length - 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t? { borderBottom: 0 }\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\thandleOptionClick(child, option);\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tlistItem={{ value: child.value, label: child.label }}\n\t\t\t\t\t\t\t\t\t\t\tsubText={child.subText}\n\t\t\t\t\t\t\t\t\t\t\tleadingIcon={child.leadingIcon || undefined}\n\t\t\t\t\t\t\t\t\t\t\tcustomComponent={child.customComponent}\n\t\t\t\t\t\t\t\t\t\t\ttrailingIcon={child.trailingIcon || undefined}\n\t\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\t\toption.disabled\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'inactive'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: child.selected\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'selected'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</StyledChildDropdownContainer>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tplacement={'right-start'}\n\t\t\t\t\thideArrow={true}\n\t\t\t\t>\n\t\t\t\t\t<StyledListItem\n\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\tlast\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\tborderBottom: 0,\n\t\t\t\t\t\t\t\t\t\t...cursorConfig,\n\t\t\t\t\t\t\t\t\t\t...(isDraggedOver\n\t\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t\tborderTop: `2px solid ${COLORS.content.brand}`,\n\t\t\t\t\t\t\t\t\t\t\t\t\topacity: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t...cursorConfig,\n\t\t\t\t\t\t\t\t\t\t...(isDraggedOver\n\t\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t\tborderTop: `2px solid ${COLORS.content.brand}`,\n\t\t\t\t\t\t\t\t\t\t\t\t\topacity: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\thandleOptionClick(option);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonMouseOver={onHoverIn}\n\t\t\t\t\t\tlistItem={{ value: option.value, label: option.label }}\n\t\t\t\t\t\tsubText={option.subText}\n\t\t\t\t\t\tdata-option-index={dataIndex}\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\tid={`dropdown-option-${dataIndex}`}\n\t\t\t\t\t\taria-selected={!!option.selected}\n\t\t\t\t\t\tonDragOver={isDraggable ? onDragOver : undefined}\n\t\t\t\t\t\tonDrop={isDraggable ? onDrop : undefined}\n\t\t\t\t\t\tleadingIcon={\n\t\t\t\t\t\t\tisMultiSelect &&\n\t\t\t\t\t\t\t!(showCheckboxForCustomElement && option.customComponent) ? (\n\t\t\t\t\t\t\t\t<MultiSelectLeadingContainer>\n\t\t\t\t\t\t\t\t\t{isDraggable && (\n\t\t\t\t\t\t\t\t\t\t<DragHandleIcon\n\t\t\t\t\t\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\t\t\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<CheckBox\n\t\t\t\t\t\t\t\t\t\tsize={version === '2.0' ? 'SMALL' : 'DEFAULT'}\n\t\t\t\t\t\t\t\t\t\tisDisabled={option.disabled ?? false}\n\t\t\t\t\t\t\t\t\t\tisChecked={!!option.selected}\n\t\t\t\t\t\t\t\t\t\tonValueChange={onCheckHandler}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<LeadingIconWrapper>{option.leadingIcon}</LeadingIconWrapper>\n\t\t\t\t\t\t\t\t</MultiSelectLeadingContainer>\n\t\t\t\t\t\t\t) : isDraggable ? (\n\t\t\t\t\t\t\t\t<SingleSelectDragContainer>\n\t\t\t\t\t\t\t\t\t<DragHandleIcon\n\t\t\t\t\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\t\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{option.leadingIcon && <div>{option.leadingIcon}</div>}\n\t\t\t\t\t\t\t\t</SingleSelectDragContainer>\n\t\t\t\t\t\t\t) : option.leadingIcon ? (\n\t\t\t\t\t\t\t\t<>{option.leadingIcon}</>\n\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomComponent={\n\t\t\t\t\t\t\tisMultiSelect &&\n\t\t\t\t\t\t\tshowCheckboxForCustomElement &&\n\t\t\t\t\t\t\toption.customComponent ? (\n\t\t\t\t\t\t\t\t<MultiSelectLeadingContainer>\n\t\t\t\t\t\t\t\t\t{isDraggable && (\n\t\t\t\t\t\t\t\t\t\t<DragHandleIcon\n\t\t\t\t\t\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\t\t\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<CheckBox\n\t\t\t\t\t\t\t\t\t\tsize={version === '2.0' ? 'SMALL' : 'DEFAULT'}\n\t\t\t\t\t\t\t\t\t\tisDisabled={option.disabled ?? false}\n\t\t\t\t\t\t\t\t\t\tisChecked={!!option.selected}\n\t\t\t\t\t\t\t\t\t\tonValueChange={onCheckHandler}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{option.customComponent}\n\t\t\t\t\t\t\t\t</MultiSelectLeadingContainer>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\toption.customComponent\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttrailingIcon={\n\t\t\t\t\t\t\toption.isFreeForm ? (\n\t\t\t\t\t\t\t\t<FreeFormContainer>\n\t\t\t\t\t\t\t\t\t<BodyCaption style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\t\t\t\tFreeform\n\t\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t\t</FreeFormContainer>\n\t\t\t\t\t\t\t) : option.children ? (\n\t\t\t\t\t\t\t\t<ChevronRightIcon width={12} height={12} />\n\t\t\t\t\t\t\t) : option.trailingIcon ? (\n\t\t\t\t\t\t\t\t<>{option.trailingIcon}</>\n\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\toption.disabled\n\t\t\t\t\t\t\t\t? 'inactive'\n\t\t\t\t\t\t\t\t: isFocused ||\n\t\t\t\t\t\t\t\t option.selected ||\n\t\t\t\t\t\t\t\t (!isMultiSelect && isChildOptionHovered)\n\t\t\t\t\t\t\t\t? 'selected'\n\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Tooltip>\n\t\t\t</>\n\t\t);\n\t},\n);\n"],"names":["StyledListItem","styled","ListItem","props","version","StyledChildDropdownContainer","div","_ref","_ref2","_ref3","DEFAULT_THEME","colorsV2","stroke","primary","DragHandleContainer","DragDot","COLORS","content","inactive","MultiSelectLeadingContainer","LeadingIconWrapper","SingleSelectDragContainer","DragHandleIcon","_ref4","onDragStart","onDragEnd","_jsxs","Object","assign","draggable","children","_jsx","MenuItem","forwardRef","_ref5","childRef","option","isMultiSelect","showDescription","onSelect","last","onDropdownItemClick","useDefaultCursor","isFocused","dataIndex","isDraggable","onDragOver","onDrop","isDraggedOver","showCheckboxForCustomElement","isChildOptionHovered","setIsChildOptionHovered","useState","selected","handleOptionClick","parent","onCheckHandler","updatedOption","checked","disabled","cursorConfig","cursor","Tooltip","body","tooltipContent","style","backgroundColor","surface","standard","ref","onMouseEnter","onMouseLeave","map","child","_a","length","borderBottom","onClick","e","preventDefault","listItem","value","label","subText","leadingIcon","undefined","customComponent","trailingIcon","variant","_Fragment","placement","hideArrow","borderTop","brand","opacity","onMouseOver","onHoverIn","description","role","id","CheckBox","size","isDisabled","isChecked","onValueChange","_b","isFreeForm","FreeFormContainer","BodyCaption","color","secondary","ChevronRightIcon","width","height"],"mappings":"4kBAWA,MAAMA,EAAiBC,EAAOC,EAAsC;YACvDC,GACO,QAAlBA,EAAMC,QAAoB,WAAa;;eAEzBD,GAA6B,QAAlBA,EAAMC,QAAoB,MAAQ;EAGvDC,EAA+BJ,EAAOK,GAAwB;;kBAElDC,IAAA,IAACH,QAAEA,GAASG,EAAA,MAAkB,QAAZH,EAAoB,IAAM,KAAK;YACvDI,IAAA,IAACJ,QAAEA,GAASI,EAAA,MAAkB,QAAZJ,EAAoB,IAAM,KAAK;;WAElDK,IAAA,IAACL,QAAEA,GAASK,EAAA,MACT,QAAZL,eACgBM,EAAcC,SAASC,OAAOC,UAC3C,MAAM;;;EAKLC,EAAsBb,EAAOK,GAAG;;;;;;;;;;;;EAchCS,EAAUd,EAAOK,GAAG;;;;qBAILU,EAAOC,QAAQC;;EAI9BC,EAA8BlB,EAAOK,GAAG;;;;;EAOxCc,EAAqBnB,EAAOK,GAAG;;EAI/Be,EAA4BpB,EAAOK,GAAG;;;;;EAYtCgB,EAAiBC,IAAA,IAACC,YAAEA,EAAWC,UAAEA,GAAgCF,EAAA,OACtEG,EAACZ,EACAa,OAAAC,OAAA,CAAAC,WACA,EAAAL,YAAaA,EACbC,U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r,useRef as o,useState as s,useCallback as l,useEffect as i}from"react";import{MenuItem as c}from"./MenuItem.js";import{StyledGroupedLabel as u,Divider as a}from"./MenuList.styled.js";const d=r(((r,d)=>{let{options:p,isMultiSelect:f,showDescription:m,onSelect:g,version:h,onInfiniteScroll:D,onDropdownItemClick:b,useDefaultCursor:v,focusedIndex:w=-1,isDraggable:C=!1,onOptionsReorder:I,showCheckboxForCustomElement:j=!1}=r;const x=o(null),S=o(null),[E,O]=s(null),[k,M]=s(null),y=l((()=>{x.current&&x.current.disconnect(),x.current=new IntersectionObserver((e=>{e[0].isIntersecting&&(null==D||D())})),S.current&&x.current.observe(S.current)}),[D]);i((()=>(y(),()=>{x.current&&x.current.disconnect()})),[y,p]);const F=l((e=>n=>{C&&(O(e),n.dataTransfer.effectAllowed="move")}),[C]),T=l((e=>n=>{C&&(n.preventDefault(),n.dataTransfer.dropEffect="move",M(e))}),[C]),R=l((e=>n=>{if(C&&null!==E){if(n.preventDefault(),E!==e){const n=[...p],[t]=n.splice(E,1);n.splice(e,0,t),null==I||I(n)}O(null),M(null)}}),[C,E,p,I]),$=l((()=>{O(null),M(null)}),[]),A=new Map;let L=-1;return p.forEach((e=>{if(e.options)e.options.forEach((e=>{e.disabled||(L++,A.set(e,L))}));else{const n=e;n.disabled||(L++,A.set(n,L))}})),e(n,{children:p.map(((n,r)=>{const o=r===p.length-1;if(n.options){const s=n;return t("div",Object.assign({style:{marginTop:"2.0"===h?2:0}},{children:[t(u,Object.assign({version:h},{children:[s.leadingIcon?e("span",Object.assign({style:{marginRight:8}},{children:s.leadingIcon})):null,s.label]})),s.options.map(((n,t)=>{const o=A.get(n),l=o===w&&!n.disabled;return e(c,{version:h,last:t===s.options.length-1,onSelect:g,showDescription:m,onDropdownItemClick:b,isMultiSelect:f,option:n,useDefaultCursor:v,isFocused:l,dataIndex:o,isDraggable:!1,showCheckboxForCustomElement:j,ref:e=>{d&&"object"==typeof d&&d.current&&e&&e&&e&&e&&(d.current[r]=e)}},`${r}-${t}`)})),o?e("span",{ref:S}):null]}),r)}const s=n,l=A.get(s),i=l===w&&!s.disabled;return t("div",{children:[s.hasDivider&&e(a,{}),e(c,{version:h,last:o,onSelect:g,showDescription:m,onDropdownItemClick:b,isMultiSelect:f,option:s,useDefaultCursor:v,isFocused:i,dataIndex:l,isDraggable:C,onDragStart:F(r),onDragOver:T(r),onDrop:R(r),onDragEnd:$,isDraggedOver:k===r,showCheckboxForCustomElement:j,ref:e=>{d&&"object"==typeof d&&d.current&&e&&(d.current[r]=e)}},s.value),o?e("span",{ref:S}):null]},r)}))})}));export{d as MenuList};
1
+ import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import{forwardRef as r,useRef as o,useState as s,useCallback as l,useEffect as i}from"react";import{MenuItem as c}from"./MenuItem.js";import{StyledGroupedLabel as u}from"./MenuList.styled.js";const a=r(((r,a)=>{let{options:d,isMultiSelect:p,showDescription:f,onSelect:m,version:g,onInfiniteScroll:h,onDropdownItemClick:D,useDefaultCursor:b,focusedIndex:v=-1,isDraggable:w=!1,onOptionsReorder:C,showCheckboxForCustomElement:I=!1}=r;const j=o(null),x=o(null),[S,E]=s(null),[O,k]=s(null),M=l((()=>{j.current&&j.current.disconnect(),j.current=new IntersectionObserver((e=>{e[0].isIntersecting&&(null==h||h())})),x.current&&j.current.observe(x.current)}),[h]);i((()=>(M(),()=>{j.current&&j.current.disconnect()})),[M,d]);const y=l((e=>n=>{w&&(E(e),n.dataTransfer.effectAllowed="move")}),[w]),F=l((e=>n=>{w&&(n.preventDefault(),n.dataTransfer.dropEffect="move",k(e))}),[w]),T=l((e=>n=>{if(w&&null!==S){if(n.preventDefault(),S!==e){const n=[...d],[t]=n.splice(S,1);n.splice(e,0,t),null==C||C(n)}E(null),k(null)}}),[w,S,d,C]),R=l((()=>{E(null),k(null)}),[]),$=new Map;let A=-1;return d.forEach((e=>{if(e.options)e.options.forEach((e=>{e.disabled||(A++,$.set(e,A))}));else{const n=e;n.disabled||(A++,$.set(n,A))}})),e(n,{children:d.map(((n,r)=>{const o=r===d.length-1;if(n.options){const s=n;return t("div",Object.assign({style:{marginTop:"2.0"===g?2:0}},{children:[t(u,Object.assign({version:g},{children:[s.leadingIcon?e("span",Object.assign({style:{marginRight:8}},{children:s.leadingIcon})):null,s.label]})),s.options.map(((n,t)=>{const o=$.get(n),l=o===v&&!n.disabled;return e(c,{version:g,last:t===s.options.length-1,onSelect:m,showDescription:f,onDropdownItemClick:D,isMultiSelect:p,option:n,useDefaultCursor:b,isFocused:l,dataIndex:o,isDraggable:!1,showCheckboxForCustomElement:I,ref:e=>{a&&"object"==typeof a&&a.current&&e&&e&&e&&e&&(a.current[r]=e)}},`${r}-${t}`)})),o?e("span",{ref:x}):null]}),r)}const s=n,l=$.get(s),i=l===v&&!s.disabled;return t("div",{children:[e(c,{version:g,last:o,onSelect:m,showDescription:f,onDropdownItemClick:D,isMultiSelect:p,option:s,useDefaultCursor:b,isFocused:i,dataIndex:l,isDraggable:w,onDragStart:y(r),onDragOver:F(r),onDrop:T(r),onDragEnd:R,isDraggedOver:O===r,showCheckboxForCustomElement:I,ref:e=>{a&&"object"==typeof a&&a.current&&e&&(a.current[r]=e)}},s.value),o?e("span",{ref:x}):null]},r)}))})}));export{a as MenuList};
2
2
  //# sourceMappingURL=MenuList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuList.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/menu/MenuList.tsx"],"sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { DropdownOption, GroupedOption, SingleOption } from '../../../type';\nimport { MenuItem } from './MenuItem';\nimport { Divider, StyledGroupedLabel } from './MenuList.styled';\n\ninterface MenuListProps {\n\toptions: DropdownOption[];\n\tisMultiSelect?: boolean;\n\tshowDescription: (title?: string, description?: string) => void;\n\tonSelect: (optionSelect: SingleOption) => void;\n\tversion?: '1.0' | '2.0' | '3.0';\n\tonInfiniteScroll?: () => void;\n\tonDropdownItemClick?: (option: DropdownOption) => void;\n\tuseDefaultCursor?: boolean;\n\tfocusedIndex?: number;\n\tisDraggable?: boolean;\n\tonOptionsReorder?: (reorderedOptions: DropdownOption[]) => void;\n\tshowCheckboxForCustomElement?: boolean;\n}\n// eslint-disable-next-line react/display-name\nexport const MenuList = forwardRef<HTMLDivElement[], MenuListProps>(\n\t(\n\t\t{\n\t\t\toptions,\n\t\t\tisMultiSelect,\n\t\t\tshowDescription,\n\t\t\tonSelect,\n\t\t\tversion,\n\t\t\tonInfiniteScroll,\n\t\t\tonDropdownItemClick,\n\t\t\tuseDefaultCursor,\n\t\t\tfocusedIndex = -1,\n\t\t\tisDraggable = false,\n\t\t\tonOptionsReorder,\n\t\t\tshowCheckboxForCustomElement = false,\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst observer = useRef<IntersectionObserver | null>(null);\n\t\tconst spanRef = useRef<HTMLSpanElement | null>(null);\n\t\tconst [draggedIndex, setDraggedIndex] = useState<number | null>(null);\n\t\tconst [draggedOverIndex, setDraggedOverIndex] = useState<number | null>(\n\t\t\tnull,\n\t\t);\n\n\t\tconst setupObserver = useCallback(() => {\n\t\t\tif (observer.current) {\n\t\t\t\tobserver.current.disconnect();\n\t\t\t}\n\t\t\tobserver.current = new IntersectionObserver((entries) => {\n\t\t\t\tif (entries[0].isIntersecting) {\n\t\t\t\t\tonInfiniteScroll?.();\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (spanRef.current) {\n\t\t\t\tobserver.current.observe(spanRef.current);\n\t\t\t}\n\t\t}, [onInfiniteScroll]);\n\n\t\tuseEffect(() => {\n\t\t\tsetupObserver();\n\t\t\treturn () => {\n\t\t\t\tif (observer.current) {\n\t\t\t\t\tobserver.current.disconnect();\n\t\t\t\t}\n\t\t\t};\n\t\t}, [setupObserver, options]);\n\n\t\tconst handleDragStart = useCallback(\n\t\t\t(index: number) => (e: React.DragEvent<HTMLDivElement>) => {\n\t\t\t\tif (!isDraggable) return;\n\t\t\t\tsetDraggedIndex(index);\n\t\t\t\te.dataTransfer.effectAllowed = 'move';\n\t\t\t},\n\t\t\t[isDraggable],\n\t\t);\n\n\t\tconst handleDragOver = useCallback(\n\t\t\t(index: number) => (e: React.DragEvent<HTMLDivElement>) => {\n\t\t\t\tif (!isDraggable) return;\n\t\t\t\te.preventDefault();\n\t\t\t\te.dataTransfer.dropEffect = 'move';\n\t\t\t\tsetDraggedOverIndex(index);\n\t\t\t},\n\t\t\t[isDraggable],\n\t\t);\n\n\t\tconst handleDrop = useCallback(\n\t\t\t(dropIndex: number) => (e: React.DragEvent<HTMLDivElement>) => {\n\t\t\t\tif (!isDraggable || draggedIndex === null) return;\n\t\t\t\te.preventDefault();\n\n\t\t\t\tif (draggedIndex !== dropIndex) {\n\t\t\t\t\tconst newOptions = [...options];\n\t\t\t\t\tconst [item] = newOptions.splice(draggedIndex, 1);\n\t\t\t\t\tnewOptions.splice(dropIndex, 0, item);\n\t\t\t\t\tonOptionsReorder?.(newOptions);\n\t\t\t\t}\n\n\t\t\t\tsetDraggedIndex(null);\n\t\t\t\tsetDraggedOverIndex(null);\n\t\t\t},\n\t\t\t[isDraggable, draggedIndex, options, onOptionsReorder],\n\t\t);\n\n\t\tconst handleDragEnd = useCallback(() => {\n\t\t\tsetDraggedIndex(null);\n\t\t\tsetDraggedOverIndex(null);\n\t\t}, []);\n\n\t\t// Calculate flat indices for all options\n\t\tconst flatIndices = new Map<SingleOption, number>();\n\t\tlet currentIndex = -1;\n\t\toptions.forEach((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t(option as GroupedOption).options.forEach((menuOption) => {\n\t\t\t\t\tif (!menuOption.disabled) {\n\t\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\t\tflatIndices.set(menuOption, currentIndex);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\tif (!singleOption.disabled) {\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\tflatIndices.set(singleOption, currentIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{options.map((option, i) => {\n\t\t\t\t\tconst last = i === options.length - 1;\n\t\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t\tconst groupedOption = option as GroupedOption;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div key={i} style={{ marginTop: version === '2.0' ? 2 : 0 }}>\n\t\t\t\t\t\t\t\t<StyledGroupedLabel version={version}>\n\t\t\t\t\t\t\t\t\t{groupedOption.leadingIcon ? (\n\t\t\t\t\t\t\t\t\t\t<span style={{ marginRight: 8 }}>\n\t\t\t\t\t\t\t\t\t\t\t{groupedOption.leadingIcon}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{groupedOption.label}\n\t\t\t\t\t\t\t\t</StyledGroupedLabel>\n\t\t\t\t\t\t\t\t{groupedOption.options.map((menuOption, idx) => {\n\t\t\t\t\t\t\t\t\tconst currentFlatIndex = flatIndices.get(menuOption);\n\t\t\t\t\t\t\t\t\tconst isFocused =\n\t\t\t\t\t\t\t\t\t\tcurrentFlatIndex === focusedIndex && !menuOption.disabled;\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\t\t\t\tlast={idx === groupedOption.options.length - 1}\n\t\t\t\t\t\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\t\t\t\t\t\tshowDescription={showDescription}\n\t\t\t\t\t\t\t\t\t\t\tonDropdownItemClick={onDropdownItemClick}\n\t\t\t\t\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\t\t\t\t\toption={menuOption}\n\t\t\t\t\t\t\t\t\t\t\tuseDefaultCursor={useDefaultCursor}\n\t\t\t\t\t\t\t\t\t\t\tkey={`${i}-${idx}`}\n\t\t\t\t\t\t\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\t\t\t\t\t\t\tdataIndex={currentFlatIndex}\n\t\t\t\t\t\t\t\t\t\t\tisDraggable={false}\n\t\t\t\t\t\t\t\t\t\t\tshowCheckboxForCustomElement={\n\t\t\t\t\t\t\t\t\t\t\t\tshowCheckboxForCustomElement\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tref={(el) => {\n\t\t\t\t\t\t\t\t\t\t\t\tif (ref && typeof ref === 'object' && ref.current) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (el) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (el) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (el) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (el) ref.current[i] = el;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t{last ? <span ref={spanRef} /> : null}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\t\tconst currentFlatIndex = flatIndices.get(singleOption);\n\t\t\t\t\tconst isFocused =\n\t\t\t\t\t\tcurrentFlatIndex === focusedIndex && !singleOption.disabled;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div key={i}>\n\t\t\t\t\t\t\t{singleOption.hasDivider && <Divider />}\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\tlast={last}\n\t\t\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\t\t\tshowDescription={showDescription}\n\t\t\t\t\t\t\t\tonDropdownItemClick={onDropdownItemClick}\n\t\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\t\toption={singleOption}\n\t\t\t\t\t\t\t\tuseDefaultCursor={useDefaultCursor}\n\t\t\t\t\t\t\t\tkey={singleOption.value}\n\t\t\t\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\t\t\t\tdataIndex={currentFlatIndex}\n\t\t\t\t\t\t\t\tisDraggable={isDraggable}\n\t\t\t\t\t\t\t\tonDragStart={handleDragStart(i)}\n\t\t\t\t\t\t\t\tonDragOver={handleDragOver(i)}\n\t\t\t\t\t\t\t\tonDrop={handleDrop(i)}\n\t\t\t\t\t\t\t\tonDragEnd={handleDragEnd}\n\t\t\t\t\t\t\t\tisDraggedOver={draggedOverIndex === i}\n\t\t\t\t\t\t\t\tshowCheckboxForCustomElement={showCheckboxForCustomElement}\n\t\t\t\t\t\t\t\tref={(el) => {\n\t\t\t\t\t\t\t\t\tif (ref && typeof ref === 'object' && ref.current && el) {\n\t\t\t\t\t\t\t\t\t\tref.current[i] = el;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{last ? <span ref={spanRef} /> : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</>\n\t\t);\n\t},\n);\n"],"names":["MenuList","forwardRef","_ref","ref","options","isMultiSelect","showDescription","onSelect","version","onInfiniteScroll","onDropdownItemClick","useDefaultCursor","focusedIndex","isDraggable","onOptionsReorder","showCheckboxForCustomElement","observer","useRef","spanRef","draggedIndex","setDraggedIndex","useState","draggedOverIndex","setDraggedOverIndex","setupObserver","useCallback","current","disconnect","IntersectionObserver","entries","isIntersecting","observe","useEffect","handleDragStart","index","e","dataTransfer","effectAllowed","handleDragOver","preventDefault","dropEffect","handleDrop","dropIndex","newOptions","item","splice","handleDragEnd","flatIndices","Map","currentIndex","forEach","option","menuOption","disabled","set","singleOption","_jsx","_Fragment","children","map","i","last","length","groupedOption","_jsxs","Object","assign","style","marginTop","StyledGroupedLabel","leadingIcon","marginRight","label","idx","currentFlatIndex","get","isFocused","MenuItem","dataIndex","el","hasDivider","Divider","onDragStart","onDragOver","onDrop","onDragEnd","isDraggedOver","value"],"mappings":"6QAoBO,MAAMA,EAAWC,GACvB,CAAAC,EAeCC,KACG,IAfHC,QACCA,EAAOC,cACPA,EAAaC,gBACbA,EAAeC,SACfA,EAAQC,QACRA,EAAOC,iBACPA,EAAgBC,oBAChBA,EAAmBC,iBACnBA,EAAgBC,aAChBA,GAAe,EAAEC,YACjBA,GAAc,EAAKC,iBACnBA,EAAgBC,6BAChBA,GAA+B,GAC/Bb,EAGD,MAAMc,EAAWC,EAAoC,MAC/CC,EAAUD,EAA+B,OACxCE,EAAcC,GAAmBC,EAAwB,OACzDC,EAAkBC,GAAuBF,EAC/C,MAGKG,EAAgBC,GAAY,KAC7BT,EAASU,SACZV,EAASU,QAAQC,aAElBX,EAASU,QAAU,IAAIE,sBAAsBC,IACxCA,EAAQ,GAAGC,iBACdrB,SAAAA,IACA,IAEES,EAAQQ,SACXV,EAASU,QAAQK,QAAQb,EAAQQ,QACjC,GACC,CAACjB,IAEJuB,GAAU,KACTR,IACO,KACFR,EAASU,SACZV,EAASU,QAAQC,YACjB,IAEA,CAACH,EAAepB,IAEnB,MAAM6B,EAAkBR,GACtBS,GAAmBC,IACdtB,IACLO,EAAgBc,GAChBC,EAAEC,aAAaC,cAAgB,OAAM,GAEtC,CAACxB,IAGIyB,EAAiBb,GACrBS,GAAmBC,IACdtB,IACLsB,EAAEI,iBACFJ,EAAEC,aAAaI,WAAa,OAC5BjB,EAAoBW,GAAM,GAE3B,CAACrB,IAGI4B,EAAahB,GACjBiB,GAAuBP,IACvB,GAAKtB,GAAgC,OAAjBM,EAApB,CAGA,GAFAgB,EAAEI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S,EAC7CvD,SAAUA,EACVD,gBAAiBA,EACjBI,oBAAqBA,EACrBL,cAAeA,EACf8C,OAAQC,EACRzC,iBAAkBA,EAElBiE,UAAWA,EACXE,UAAWJ,EACX7D,aAAa,EACbE,6BACCA,EAEDZ,IAAM4E,IACD5E,GAAsB,iBAARA,GAAoBA,EAAIuB,SACrCqD,GACCA,GACCA,GACCA,IAAI5E,EAAIuB,QAAQkC,GAAKmB,EAI5B,MAhBMnB,KAAKa,IAkBZ,IAGHZ,EAAOL,UAAMrD,IAAKe,IAAc,QA5CxB0C,EA+CX,CAED,MAAML,EAAeJ,EACfuB,EAAmB3B,EAAY4B,IAAIpB,GACnCqB,EACLF,IAAqB9D,IAAiB2C,EAAaF,SACpD,OACCW,mBACET,EAAayB,YAAcxB,EAACyB,EAAU,CAAA,GACvCzB,EAACqB,EAAQ,CACRrE,QAASA,EACTqD,KAAMA,EACNtD,SAAUA,EACVD,gBAAiBA,EACjBI,oBAAqBA,EACrBL,cAAeA,EACf8C,OAAQI,EACR5C,iBAAkBA,EAElBiE,UAAWA,EACXE,UAAWJ,EACX7D,YAAaA,EACbqE,YAAajD,EAAgB2B,GAC7BuB,WAAY7C,EAAesB,GAC3BwB,OAAQ3C,EAAWmB,GACnByB,UAAWvC,EACXwC,cAAehE,IAAqBsC,EACpC7C,6BAA8BA,EAC9BZ,IAAM4E,IACD5E,GAAsB,iBAARA,GAAoBA,EAAIuB,SAAWqD,IACpD5E,EAAIuB,QAAQkC,GAAKmB,EACjB,GAbGxB,EAAagC,OAgBlB1B,EAAOL,EAAA,OAAA,CAAMrD,IAAKe,IAAc,OA3BxB0C,EA4BJ,KAGN"}
1
+ {"version":3,"file":"MenuList.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/menu/MenuList.tsx"],"sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { DropdownOption, GroupedOption, SingleOption } from '../../../type';\nimport { MenuItem } from './MenuItem';\nimport { StyledGroupedLabel } from './MenuList.styled';\n\ninterface MenuListProps {\n\toptions: DropdownOption[];\n\tisMultiSelect?: boolean;\n\tshowDescription: (title?: string, description?: string) => void;\n\tonSelect: (optionSelect: SingleOption) => void;\n\tversion?: '1.0' | '2.0';\n\tonInfiniteScroll?: () => void;\n\tonDropdownItemClick?: (option: DropdownOption) => void;\n\tuseDefaultCursor?: boolean;\n\tfocusedIndex?: number;\n\tisDraggable?: boolean;\n\tonOptionsReorder?: (reorderedOptions: DropdownOption[]) => void;\n\tshowCheckboxForCustomElement?: boolean;\n}\n// eslint-disable-next-line react/display-name\nexport const MenuList = forwardRef<HTMLDivElement[], MenuListProps>(\n\t(\n\t\t{\n\t\t\toptions,\n\t\t\tisMultiSelect,\n\t\t\tshowDescription,\n\t\t\tonSelect,\n\t\t\tversion,\n\t\t\tonInfiniteScroll,\n\t\t\tonDropdownItemClick,\n\t\t\tuseDefaultCursor,\n\t\t\tfocusedIndex = -1,\n\t\t\tisDraggable = false,\n\t\t\tonOptionsReorder,\n\t\t\tshowCheckboxForCustomElement = false,\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst observer = useRef<IntersectionObserver | null>(null);\n\t\tconst spanRef = useRef<HTMLSpanElement | null>(null);\n\t\tconst [draggedIndex, setDraggedIndex] = useState<number | null>(null);\n\t\tconst [draggedOverIndex, setDraggedOverIndex] = useState<number | null>(\n\t\t\tnull,\n\t\t);\n\n\t\tconst setupObserver = useCallback(() => {\n\t\t\tif (observer.current) {\n\t\t\t\tobserver.current.disconnect();\n\t\t\t}\n\t\t\tobserver.current = new IntersectionObserver((entries) => {\n\t\t\t\tif (entries[0].isIntersecting) {\n\t\t\t\t\tonInfiniteScroll?.();\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (spanRef.current) {\n\t\t\t\tobserver.current.observe(spanRef.current);\n\t\t\t}\n\t\t}, [onInfiniteScroll]);\n\n\t\tuseEffect(() => {\n\t\t\tsetupObserver();\n\t\t\treturn () => {\n\t\t\t\tif (observer.current) {\n\t\t\t\t\tobserver.current.disconnect();\n\t\t\t\t}\n\t\t\t};\n\t\t}, [setupObserver, options]);\n\n\t\tconst handleDragStart = useCallback(\n\t\t\t(index: number) => (e: React.DragEvent<HTMLDivElement>) => {\n\t\t\t\tif (!isDraggable) return;\n\t\t\t\tsetDraggedIndex(index);\n\t\t\t\te.dataTransfer.effectAllowed = 'move';\n\t\t\t},\n\t\t\t[isDraggable],\n\t\t);\n\n\t\tconst handleDragOver = useCallback(\n\t\t\t(index: number) => (e: React.DragEvent<HTMLDivElement>) => {\n\t\t\t\tif (!isDraggable) return;\n\t\t\t\te.preventDefault();\n\t\t\t\te.dataTransfer.dropEffect = 'move';\n\t\t\t\tsetDraggedOverIndex(index);\n\t\t\t},\n\t\t\t[isDraggable],\n\t\t);\n\n\t\tconst handleDrop = useCallback(\n\t\t\t(dropIndex: number) => (e: React.DragEvent<HTMLDivElement>) => {\n\t\t\t\tif (!isDraggable || draggedIndex === null) return;\n\t\t\t\te.preventDefault();\n\n\t\t\t\tif (draggedIndex !== dropIndex) {\n\t\t\t\t\tconst newOptions = [...options];\n\t\t\t\t\tconst [item] = newOptions.splice(draggedIndex, 1);\n\t\t\t\t\tnewOptions.splice(dropIndex, 0, item);\n\t\t\t\t\tonOptionsReorder?.(newOptions);\n\t\t\t\t}\n\n\t\t\t\tsetDraggedIndex(null);\n\t\t\t\tsetDraggedOverIndex(null);\n\t\t\t},\n\t\t\t[isDraggable, draggedIndex, options, onOptionsReorder],\n\t\t);\n\n\t\tconst handleDragEnd = useCallback(() => {\n\t\t\tsetDraggedIndex(null);\n\t\t\tsetDraggedOverIndex(null);\n\t\t}, []);\n\n\t\t// Calculate flat indices for all options\n\t\tconst flatIndices = new Map<SingleOption, number>();\n\t\tlet currentIndex = -1;\n\t\toptions.forEach((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t(option as GroupedOption).options.forEach((menuOption) => {\n\t\t\t\t\tif (!menuOption.disabled) {\n\t\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\t\tflatIndices.set(menuOption, currentIndex);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\tif (!singleOption.disabled) {\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\tflatIndices.set(singleOption, currentIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{options.map((option, i) => {\n\t\t\t\t\tconst last = i === options.length - 1;\n\t\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t\tconst groupedOption = option as GroupedOption;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div key={i} style={{ marginTop: version === '2.0' ? 2 : 0 }}>\n\t\t\t\t\t\t\t\t<StyledGroupedLabel version={version}>\n\t\t\t\t\t\t\t\t\t{groupedOption.leadingIcon ? (\n\t\t\t\t\t\t\t\t\t\t<span style={{ marginRight: 8 }}>\n\t\t\t\t\t\t\t\t\t\t\t{groupedOption.leadingIcon}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{groupedOption.label}\n\t\t\t\t\t\t\t\t</StyledGroupedLabel>\n\t\t\t\t\t\t\t\t{groupedOption.options.map((menuOption, idx) => {\n\t\t\t\t\t\t\t\t\tconst currentFlatIndex = flatIndices.get(menuOption);\n\t\t\t\t\t\t\t\t\tconst isFocused =\n\t\t\t\t\t\t\t\t\t\tcurrentFlatIndex === focusedIndex && !menuOption.disabled;\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\t\t\t\tlast={idx === groupedOption.options.length - 1}\n\t\t\t\t\t\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\t\t\t\t\t\tshowDescription={showDescription}\n\t\t\t\t\t\t\t\t\t\t\tonDropdownItemClick={onDropdownItemClick}\n\t\t\t\t\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\t\t\t\t\toption={menuOption}\n\t\t\t\t\t\t\t\t\t\t\tuseDefaultCursor={useDefaultCursor}\n\t\t\t\t\t\t\t\t\t\t\tkey={`${i}-${idx}`}\n\t\t\t\t\t\t\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\t\t\t\t\t\t\tdataIndex={currentFlatIndex}\n\t\t\t\t\t\t\t\t\t\t\tisDraggable={false}\n\t\t\t\t\t\t\t\t\t\t\tshowCheckboxForCustomElement={\n\t\t\t\t\t\t\t\t\t\t\t\tshowCheckboxForCustomElement\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tref={(el) => {\n\t\t\t\t\t\t\t\t\t\t\t\tif (ref && typeof ref === 'object' && ref.current) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (el) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (el) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (el) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (el) ref.current[i] = el;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t{last ? <span ref={spanRef} /> : null}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\t\tconst currentFlatIndex = flatIndices.get(singleOption);\n\t\t\t\t\tconst isFocused =\n\t\t\t\t\t\tcurrentFlatIndex === focusedIndex && !singleOption.disabled;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div key={i}>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\tlast={last}\n\t\t\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\t\t\tshowDescription={showDescription}\n\t\t\t\t\t\t\t\tonDropdownItemClick={onDropdownItemClick}\n\t\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\t\toption={singleOption}\n\t\t\t\t\t\t\t\tuseDefaultCursor={useDefaultCursor}\n\t\t\t\t\t\t\t\tkey={singleOption.value}\n\t\t\t\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\t\t\t\tdataIndex={currentFlatIndex}\n\t\t\t\t\t\t\t\tisDraggable={isDraggable}\n\t\t\t\t\t\t\t\tonDragStart={handleDragStart(i)}\n\t\t\t\t\t\t\t\tonDragOver={handleDragOver(i)}\n\t\t\t\t\t\t\t\tonDrop={handleDrop(i)}\n\t\t\t\t\t\t\t\tonDragEnd={handleDragEnd}\n\t\t\t\t\t\t\t\tisDraggedOver={draggedOverIndex === i}\n\t\t\t\t\t\t\t\tshowCheckboxForCustomElement={showCheckboxForCustomElement}\n\t\t\t\t\t\t\t\tref={(el) => {\n\t\t\t\t\t\t\t\t\tif (ref && typeof ref === 'object' && ref.current && el) {\n\t\t\t\t\t\t\t\t\t\tref.current[i] = el;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{last ? <span ref={spanRef} /> : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</>\n\t\t);\n\t},\n);\n"],"names":["MenuList","forwardRef","_ref","ref","options","isMultiSelect","showDescription","onSelect","version","onInfiniteScroll","onDropdownItemClick","useDefaultCursor","focusedIndex","isDraggable","onOptionsReorder","showCheckboxForCustomElement","observer","useRef","spanRef","draggedIndex","setDraggedIndex","useState","draggedOverIndex","setDraggedOverIndex","setupObserver","useCallback","current","disconnect","IntersectionObserver","entries","isIntersecting","observe","useEffect","handleDragStart","index","e","dataTransfer","effectAllowed","handleDragOver","preventDefault","dropEffect","handleDrop","dropIndex","newOptions","item","splice","handleDragEnd","flatIndices","Map","currentIndex","forEach","option","menuOption","disabled","set","singleOption","_jsx","_Fragment","children","map","i","last","length","groupedOption","_jsxs","Object","assign","style","marginTop","StyledGroupedLabel","leadingIcon","marginRight","label","idx","currentFlatIndex","get","isFocused","MenuItem","dataIndex","el","onDragStart","onDragOver","onDrop","onDragEnd","isDraggedOver","value"],"mappings":"gQAoBO,MAAMA,EAAWC,GACvB,CAAAC,EAeCC,KACG,IAfHC,QACCA,EAAOC,cACPA,EAAaC,gBACbA,EAAeC,SACfA,EAAQC,QACRA,EAAOC,iBACPA,EAAgBC,oBAChBA,EAAmBC,iBACnBA,EAAgBC,aAChBA,GAAe,EAAEC,YACjBA,GAAc,EAAKC,iBACnBA,EAAgBC,6BAChBA,GAA+B,GAC/Bb,EAGD,MAAMc,EAAWC,EAAoC,MAC/CC,EAAUD,EAA+B,OACxCE,EAAcC,GAAmBC,EAAwB,OACzDC,EAAkBC,GAAuBF,EAC/C,MAGKG,EAAgBC,GAAY,KAC7BT,EAASU,SACZV,EAASU,QAAQC,aAElBX,EAASU,QAAU,IAAIE,sBAAsBC,IACxCA,EAAQ,GAAGC,iBACdrB,SAAAA,IACA,IAEES,EAAQQ,SACXV,EAASU,QAAQK,QAAQb,EAAQQ,QACjC,GACC,CAACjB,IAEJuB,GAAU,KACTR,IACO,KACFR,EAASU,SACZV,EAASU,QAAQC,YACjB,IAEA,CAACH,EAAepB,IAEnB,MAAM6B,EAAkBR,GACtBS,GAAmBC,IACdtB,IACLO,EAAgBc,GAChBC,EAAEC,aAAaC,cAAgB,OAAM,GAEtC,CAACxB,IAGIyB,EAAiBb,GACrBS,GAAmBC,IACdtB,IACLsB,EAAEI,iBACFJ,EAAEC,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EAAY4B,IAAIvB,GACnCwB,EACLF,IAAqB9D,IAAiBwC,EAAWC,SAClD,OACCG,EAACqB,EAAQ,CACRrE,QAASA,EACTqD,KAAMY,IAAQV,EAAc3D,QAAQ0D,OAAS,EAC7CvD,SAAUA,EACVD,gBAAiBA,EACjBI,oBAAqBA,EACrBL,cAAeA,EACf8C,OAAQC,EACRzC,iBAAkBA,EAElBiE,UAAWA,EACXE,UAAWJ,EACX7D,aAAa,EACbE,6BACCA,EAEDZ,IAAM4E,IACD5E,GAAsB,iBAARA,GAAoBA,EAAIuB,SACrCqD,GACCA,GACCA,GACCA,IAAI5E,EAAIuB,QAAQkC,GAAKmB,EAI5B,MAhBMnB,KAAKa,IAkBZ,IAGHZ,EAAOL,UAAMrD,IAAKe,IAAc,QA5CxB0C,EA+CX,CAED,MAAML,EAAeJ,EACfuB,EAAmB3B,EAAY4B,IAAIpB,GACnCqB,EACLF,IAAqB9D,IAAiB2C,EAAaF,SACpD,OACCW,EACC,MAAA,CAAAN,SAAA,CAAAF,EAACqB,EACA,CAAArE,QAASA,EACTqD,KAAMA,EACNtD,SAAUA,EACVD,gBAAiBA,EACjBI,oBAAqBA,EACrBL,cAAeA,EACf8C,OAAQI,EACR5C,iBAAkBA,EAElBiE,UAAWA,EACXE,UAAWJ,EACX7D,YAAaA,EACbmE,YAAa/C,EAAgB2B,GAC7BqB,WAAY3C,EAAesB,GAC3BsB,OAAQzC,EAAWmB,GACnBuB,UAAWrC,EACXsC,cAAe9D,IAAqBsC,EACpC7C,6BAA8BA,EAC9BZ,IAAM4E,IACD5E,GAAsB,iBAARA,GAAoBA,EAAIuB,SAAWqD,IACpD5E,EAAIuB,QAAQkC,GAAKmB,EACjB,GAbGxB,EAAa8B,OAgBlBxB,EAAOL,EAAA,OAAA,CAAMrD,IAAKe,IAAc,OA1BxB0C,EA2BJ,KAGN"}
@@ -1,11 +1,7 @@
1
- import o from"styled-components";import{BodyCaption as r}from"../../../../TypographyStyle.js";import{COLORS as n}from"../../../../../constants/Theme.js";const e=o.div`
2
- height: 1px;
3
- background-color: ${n.stroke.primary};
4
- margin: 4px 8px;
5
- `,t=o(r)`
1
+ import o from"styled-components";import{BodyCaption as r}from"../../../../TypographyStyle.js";import{COLORS as n}from"../../../../../constants/Theme.js";const e=o(r)`
6
2
  padding: 8px ${o=>"2.0"===o.version?12:16}px;
7
3
  color: ${o=>"2.0"===o.version?n.content.placeholder:n.content.secondary};
8
4
  background-color: ${o=>"2.0"===o.version?n.surface.standard:n.background.base};
9
5
  font-size: ${o=>"2.0"===o.version?10:12}px;
10
- `;export{e as Divider,t as StyledGroupedLabel};
6
+ `;export{e as StyledGroupedLabel};
11
7
  //# sourceMappingURL=MenuList.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuList.styled.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { BodyCaption } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const Divider = styled.div`\n\theight: 1px;\n\tbackground-color: ${COLORS.stroke.primary};\n\tmargin: 4px 8px;\n`;\n\nexport const StyledGroupedLabel = styled(BodyCaption)<{\n\tversion?: '1.0' | '2.0' | '3.0';\n}>`\n\tpadding: 8px ${(props) => (props.version === '2.0' ? 12 : 16)}px;\n\tcolor: ${(props) =>\n\t\tprops.version === '2.0'\n\t\t\t? COLORS.content.placeholder\n\t\t\t: COLORS.content.secondary};\n\tbackground-color: ${(props) =>\n\t\tprops.version === '2.0' ? COLORS.surface.standard : COLORS.background.base};\n\tfont-size: ${(props) => (props.version === '2.0' ? 10 : 12)}px;\n`;\n"],"names":["Divider","styled","div","COLORS","stroke","primary","StyledGroupedLabel","BodyCaption","props","version","content","placeholder","secondary","surface","standard","background","base"],"mappings":"yJAIaA,MAAAA,EAAUC,EAAOC,GAAG;;qBAEZC,EAAOC,OAAOC;;EAItBC,EAAqBL,EAAOM,EAEvC;gBACeC,GAA6B,QAAlBA,EAAMC,QAAoB,GAAK;UAChDD,GACS,QAAlBA,EAAMC,QACHN,EAAOO,QAAQC,YACfR,EAAOO,QAAQE;qBACEJ,GACF,QAAlBA,EAAMC,QAAoBN,EAAOU,QAAQC,SAAWX,EAAOY,WAAWC;cACzDR,GAA6B,QAAlBA,EAAMC,QAAoB,GAAK;"}
1
+ {"version":3,"file":"MenuList.styled.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { BodyCaption } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const StyledGroupedLabel = styled(BodyCaption)<{\n\tversion?: '1.0' | '2.0';\n}>`\n\tpadding: 8px ${(props) => (props.version === '2.0' ? 12 : 16)}px;\n\tcolor: ${(props) =>\n\t\tprops.version === '2.0'\n\t\t\t? COLORS.content.placeholder\n\t\t\t: COLORS.content.secondary};\n\tbackground-color: ${(props) =>\n\t\tprops.version === '2.0' ? COLORS.surface.standard : COLORS.background.base};\n\tfont-size: ${(props) => (props.version === '2.0' ? 10 : 12)}px;\n`;\n"],"names":["StyledGroupedLabel","styled","BodyCaption","props","version","COLORS","content","placeholder","secondary","surface","standard","background","base"],"mappings":"+JAIaA,EAAqBC,EAAOC,EAEvC;gBACeC,GAA6B,QAAlBA,EAAMC,QAAoB,GAAK;UAChDD,GACS,QAAlBA,EAAMC,QACHC,EAAOC,QAAQC,YACfF,EAAOC,QAAQE;qBACEL,GACF,QAAlBA,EAAMC,QAAoBC,EAAOI,QAAQC,SAAWL,EAAOM,WAAWC;cACzDT,GAA6B,QAAlBA,EAAMC,QAAoB,GAAK;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectAllMenu.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { CheckBox } from '@src/components/checkBox';\nimport { ListItem } from '@src/components/list-item';\nimport { DropdownOption, GroupedOption, SingleOption } from '../../../type';\n\nexport type SelectAllCheckboxState =\n\t| 'notSelected'\n\t| 'selectAll'\n\t| 'partiallySelected';\n\nexport const SelectAllMenu: React.FC<{\n\toptions: DropdownOption[];\n\tonSelect: (newState: SelectAllCheckboxState) => void;\n\tversion?: '1.0' | '2.0' | '3.0';\n}> = ({ options, onSelect, version }) => {\n\tconst [checkStatus, setCheckStatus] =\n\t\tuseState<SelectAllCheckboxState>('notSelected');\n\n\tfunction onCheckHandler() {\n\t\tif (checkStatus === 'partiallySelected') {\n\t\t\tonSelect('notSelected');\n\t\t}\n\n\t\tif (checkStatus === 'selectAll') {\n\t\t\tonSelect('notSelected');\n\t\t}\n\n\t\tif (checkStatus === 'notSelected') {\n\t\t\tonSelect('selectAll');\n\t\t}\n\t}\n\n\tuseEffect(() => {\n\t\tconst allOptions: boolean[] = [];\n\n\t\toptions\n\t\t\t.filter((option) => !(option as SingleOption).disabled)\n\t\t\t.forEach((option) => {\n\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t(option as GroupedOption).options\n\t\t\t\t\t\t.filter((op) => !op.disabled)\n\t\t\t\t\t\t.forEach((nestedOption) => {\n\t\t\t\t\t\t\tallOptions.push(nestedOption.selected || false);\n\t\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tallOptions.push((option as SingleOption).selected || false);\n\t\t\t\t}\n\t\t\t});\n\n\t\tif (allOptions.every(Boolean)) {\n\t\t\tsetCheckStatus('selectAll');\n\t\t} else if (allOptions.filter(Boolean).length > 0) {\n\t\t\tsetCheckStatus('partiallySelected');\n\t\t} else {\n\t\t\tsetCheckStatus('notSelected');\n\t\t}\n\t}, [options]);\n\n\treturn (\n\t\t<ListItem\n\t\t\tversion={version}\n\t\t\tonClick={(e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tonCheckHandler();\n\t\t\t}}\n\t\t\tlistItem={{\n\t\t\t\tlabel: 'Select All',\n\t\t\t\tvalue: 'All',\n\t\t\t}}\n\t\t\tleadingIcon={\n\t\t\t\t<div style={{ width: 18, height: 18 }}>\n\t\t\t\t\t<CheckBox\n\t\t\t\t\t\tsize={version === '2.0' ? 'SMALL' : 'DEFAULT'}\n\t\t\t\t\t\tisChecked={\n\t\t\t\t\t\t\tcheckStatus === 'selectAll' || checkStatus === 'partiallySelected'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisPartiallyChecked={checkStatus === 'partiallySelected'}\n\t\t\t\t\t\tonValueChange={onCheckHandler}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\tvariant={'default'}\n\t\t/>\n\t);\n};\n"],"names":["SelectAllMenu","_ref","options","onSelect","version","checkStatus","setCheckStatus","useState","onCheckHandler","useEffect","allOptions","filter","option","disabled","forEach","op","nestedOption","push","selected","every","Boolean","length","_jsx","ListItem","onClick","e","preventDefault","listItem","label","value","leadingIcon","Object","assign","style","width","height","children","CheckBox","size","isChecked","isPartiallyChecked","onValueChange","variant"],"mappings":"iNAUaA,MAAAA,EAIRC,IAAmC,IAAlCC,QAAEA,EAAOC,SAAEA,EAAQC,QAAEA,GAASH,EACnC,MAAOI,EAAaC,GACnBC,EAAiC,eAElC,SAASC,IACY,sBAAhBH,GACHF,EAAS,eAGU,cAAhBE,GACHF,EAAS,eAGU,gBAAhBE,GACHF,EAAS,YAEX,CA4BA,OA1BAM,GAAU,KACT,MAAMC,EAAwB,GAE9BR,EACES,QAAQC,IAAaA,EAAwBC,WAC7CC,SAASF,IACJA,EAAyBV,QAC5BU,EAAyBV,QACxBS,QAAQI,IAAQA,EAAGF,WACnBC,SAASE,IACTN,EAAWO,KAAKD,EAAaE,WAAY,EAAM,IAGjDR,EAAWO,KAAML,EAAwBM,WAAY,EACrD,IAGCR,EAAWS,MAAMC,SACpBd,EAAe,aACLI,EAAWC,OAAOS,SAASC,OAAS,EAC9Cf,EAAe,qBAEfA,EAAe,cACf,GACC,CAACJ,IAGHoB,EAACC,EAAQ,CACRnB,QAASA,EACToB,QAAUC,IACTA,EAAEC,iBACFlB,GAAgB,EAEjBmB,SAAU,CACTC,MAAO,aACPC,MAAO,OAERC,YACCR,EAAA,MAAAS,OAAAC,OAAA,CAAKC,MAAO,CAAEC,MAAO,GAAIC,OAAQ,KAAI,CAAAC,SACpCd,EAACe,EACA,CAAAC,KAAkB,QAAZlC,EAAoB,QAAU,UACpCmC,UACiB,cAAhBlC,GAA+C,sBAAhBA,EAEhCmC,mBAAoC,sBAAhBnC,EACpBoC,cAAejC,OAIlBkC,QAAS,WACR"}
1
+ {"version":3,"file":"SelectAllMenu.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { CheckBox } from '@src/components/checkBox';\nimport { ListItem } from '@src/components/list-item';\nimport { DropdownOption, GroupedOption, SingleOption } from '../../../type';\n\nexport type SelectAllCheckboxState =\n\t| 'notSelected'\n\t| 'selectAll'\n\t| 'partiallySelected';\n\nexport const SelectAllMenu: React.FC<{\n\toptions: DropdownOption[];\n\tonSelect: (newState: SelectAllCheckboxState) => void;\n\tversion?: '1.0' | '2.0';\n}> = ({ options, onSelect, version }) => {\n\tconst [checkStatus, setCheckStatus] =\n\t\tuseState<SelectAllCheckboxState>('notSelected');\n\n\tfunction onCheckHandler() {\n\t\tif (checkStatus === 'partiallySelected') {\n\t\t\tonSelect('notSelected');\n\t\t}\n\n\t\tif (checkStatus === 'selectAll') {\n\t\t\tonSelect('notSelected');\n\t\t}\n\n\t\tif (checkStatus === 'notSelected') {\n\t\t\tonSelect('selectAll');\n\t\t}\n\t}\n\n\tuseEffect(() => {\n\t\tconst allOptions: boolean[] = [];\n\n\t\toptions\n\t\t\t.filter((option) => !(option as SingleOption).disabled)\n\t\t\t.forEach((option) => {\n\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t(option as GroupedOption).options\n\t\t\t\t\t\t.filter((op) => !op.disabled)\n\t\t\t\t\t\t.forEach((nestedOption) => {\n\t\t\t\t\t\t\tallOptions.push(nestedOption.selected || false);\n\t\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tallOptions.push((option as SingleOption).selected || false);\n\t\t\t\t}\n\t\t\t});\n\n\t\tif (allOptions.every(Boolean)) {\n\t\t\tsetCheckStatus('selectAll');\n\t\t} else if (allOptions.filter(Boolean).length > 0) {\n\t\t\tsetCheckStatus('partiallySelected');\n\t\t} else {\n\t\t\tsetCheckStatus('notSelected');\n\t\t}\n\t}, [options]);\n\n\treturn (\n\t\t<ListItem\n\t\t\tversion={version}\n\t\t\tonClick={(e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tonCheckHandler();\n\t\t\t}}\n\t\t\tlistItem={{\n\t\t\t\tlabel: 'Select All',\n\t\t\t\tvalue: 'All',\n\t\t\t}}\n\t\t\tleadingIcon={\n\t\t\t\t<div style={{ width: 18, height: 18 }}>\n\t\t\t\t\t<CheckBox\n\t\t\t\t\t\tsize={version === '2.0' ? 'SMALL' : 'DEFAULT'}\n\t\t\t\t\t\tisChecked={\n\t\t\t\t\t\t\tcheckStatus === 'selectAll' || checkStatus === 'partiallySelected'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisPartiallyChecked={checkStatus === 'partiallySelected'}\n\t\t\t\t\t\tonValueChange={onCheckHandler}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\tvariant={'default'}\n\t\t/>\n\t);\n};\n"],"names":["SelectAllMenu","_ref","options","onSelect","version","checkStatus","setCheckStatus","useState","onCheckHandler","useEffect","allOptions","filter","option","disabled","forEach","op","nestedOption","push","selected","every","Boolean","length","_jsx","ListItem","onClick","e","preventDefault","listItem","label","value","leadingIcon","Object","assign","style","width","height","children","CheckBox","size","isChecked","isPartiallyChecked","onValueChange","variant"],"mappings":"iNAUaA,MAAAA,EAIRC,IAAmC,IAAlCC,QAAEA,EAAOC,SAAEA,EAAQC,QAAEA,GAASH,EACnC,MAAOI,EAAaC,GACnBC,EAAiC,eAElC,SAASC,IACY,sBAAhBH,GACHF,EAAS,eAGU,cAAhBE,GACHF,EAAS,eAGU,gBAAhBE,GACHF,EAAS,YAEX,CA4BA,OA1BAM,GAAU,KACT,MAAMC,EAAwB,GAE9BR,EACES,QAAQC,IAAaA,EAAwBC,WAC7CC,SAASF,IACJA,EAAyBV,QAC5BU,EAAyBV,QACxBS,QAAQI,IAAQA,EAAGF,WACnBC,SAASE,IACTN,EAAWO,KAAKD,EAAaE,WAAY,EAAM,IAGjDR,EAAWO,KAAML,EAAwBM,WAAY,EACrD,IAGCR,EAAWS,MAAMC,SACpBd,EAAe,aACLI,EAAWC,OAAOS,SAASC,OAAS,EAC9Cf,EAAe,qBAEfA,EAAe,cACf,GACC,CAACJ,IAGHoB,EAACC,EAAQ,CACRnB,QAASA,EACToB,QAAUC,IACTA,EAAEC,iBACFlB,GAAgB,EAEjBmB,SAAU,CACTC,MAAO,aACPC,MAAO,OAERC,YACCR,EAAA,MAAAS,OAAAC,OAAA,CAAKC,MAAO,CAAEC,MAAO,GAAIC,OAAQ,KAAI,CAAAC,SACpCd,EAACe,EACA,CAAAC,KAAkB,QAAZlC,EAAoB,QAAU,UACpCmC,UACiB,cAAhBlC,GAA+C,sBAAhBA,EAEhCmC,mBAAoC,sBAAhBnC,EACpBoC,cAAejC,OAIlBkC,QAAS,WACR"}
@@ -1,2 +1,2 @@
1
- import{jsx as o,Fragment as r}from"react/jsx-runtime";import{useState as t}from"react";import{IconButton as e}from"../../../../icon-button/IconButton.js";import{Input as n}from"../../../../input/Input.js";import{InputStyleContext as i}from"../../../../input/context/InputStyleProvider.js";import{COLORS as s}from"../../../../../constants/Theme.js";import c from"../../../../../assets/icons/cross.svg.js";import p from"../../../../../assets/icons/search.svg.js";const a=a=>{let{onSearch:m,version:l}=a;const[h,d]=t(""),[u,f]=t(!1);return o(i.Provider,Object.assign({value:{InputWrapper:{borderRadius:0,border:0,borderBottom:`${"2.0"===l||"3.0"===l?.5:1}px solid ${s.stroke.primary}`,padding:""+("2.0"===l||"3.0"===l?"6px 8px":"14px 16px")},IconHolder:{marginLeft:0},input:{marginLeft:4,minHeight:"100%"}}},{children:o(n,{noKeyDownChange:!0,skipFocus:!0,placeholder:"Search",variant:"2.0"===l||"3.0"===l?"small":"default",leftIcon:{icon:()=>o(p,{width:"2.0"===l||"3.0"===l?18:24,height:"2.0"===l||"3.0"===l?18:24,color:s.content.placeholder})},rightIcon:{icon:()=>h?o(e,{onClick:()=>{f(!0),m(""),d("")},Icon:c,width:"2.0"===l||"3.0"===l?18:24,height:"2.0"===l||"3.0"===l?18:24,iconColor:s.content.placeholder}):o(r,{})},reset:u,onChangeText:o=>{f(!1),d(o),m(o)}})}))};export{a as SearchBox};
1
+ import{jsx as o,Fragment as r}from"react/jsx-runtime";import{useState as t}from"react";import{IconButton as e}from"../../../../icon-button/IconButton.js";import{Input as n}from"../../../../input/Input.js";import{InputStyleContext as i}from"../../../../input/context/InputStyleProvider.js";import{COLORS as s}from"../../../../../constants/Theme.js";import c from"../../../../../assets/icons/cross.svg.js";import p from"../../../../../assets/icons/search.svg.js";const a=a=>{let{onSearch:m,version:l}=a;const[h,d]=t(""),[u,f]=t(!1);return o(i.Provider,Object.assign({value:{InputWrapper:{borderRadius:0,border:0,borderBottom:`${"2.0"===l?.5:1}px solid ${s.stroke.primary}`,padding:""+("2.0"===l?"6px 8px":"14px 16px")},IconHolder:{marginLeft:0},input:{marginLeft:4,minHeight:"100%"}}},{children:o(n,{noKeyDownChange:!0,skipFocus:!0,placeholder:"Search",variant:"2.0"===l?"small":"default",leftIcon:{icon:()=>o(p,{width:"2.0"===l?18:24,height:"2.0"===l?18:24,color:s.content.placeholder})},rightIcon:{icon:()=>h?o(e,{onClick:()=>{f(!0),m(""),d("")},Icon:c,width:"2.0"===l?18:24,height:"2.0"===l?18:24,iconColor:s.content.placeholder}):o(r,{})},reset:u,onChangeText:o=>{f(!1),d(o),m(o)}})}))};export{a as SearchBox};
2
2
  //# sourceMappingURL=SearchBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBox.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { IconButton } from '@src/components/icon-button';\nimport { Input } from '@src/components/input';\nimport { InputStyleContext } from '@src/components/input/context/InputStyleProvider';\nimport { COLORS } from '@src/constants/Theme';\nimport CrossIcon from '../../../../../assets/icons/cross.svg';\nimport SearchIcon from '../../../../../assets/icons/search.svg';\n\nexport const SearchBox: React.FC<{\n\tonSearch: (searchString: string) => void;\n\tversion?: '1.0' | '2.0' | '3.0';\n}> = ({ onSearch, version }) => {\n\tconst [val, setVal] = useState('');\n\tconst [reset, setReset] = useState(false);\n\n\treturn (\n\t\t<InputStyleContext.Provider\n\t\t\tvalue={{\n\t\t\t\tInputWrapper: {\n\t\t\t\t\tborderRadius: 0,\n\t\t\t\t\tborder: 0,\n\t\t\t\t\tborderBottom: `${\n\t\t\t\t\t\tversion === '2.0' || version === '3.0' ? 0.5 : 1\n\t\t\t\t\t}px solid ${COLORS.stroke.primary}`,\n\t\t\t\t\tpadding: `${\n\t\t\t\t\t\tversion === '2.0' || version === '3.0' ? '6px 8px' : '14px 16px'\n\t\t\t\t\t}`,\n\t\t\t\t},\n\t\t\t\tIconHolder: {\n\t\t\t\t\tmarginLeft: 0,\n\t\t\t\t},\n\t\t\t\tinput: {\n\t\t\t\t\tmarginLeft: 4,\n\t\t\t\t\tminHeight: '100%',\n\t\t\t\t},\n\t\t\t}}\n\t\t>\n\t\t\t<Input\n\t\t\t\tnoKeyDownChange\n\t\t\t\tskipFocus={true}\n\t\t\t\tplaceholder=\"Search\"\n\t\t\t\tvariant={version === '2.0' || version === '3.0' ? 'small' : 'default'}\n\t\t\t\tleftIcon={{\n\t\t\t\t\ticon: () => (\n\t\t\t\t\t\t<SearchIcon\n\t\t\t\t\t\t\twidth={version === '2.0' || version === '3.0' ? 18 : 24}\n\t\t\t\t\t\t\theight={version === '2.0' || version === '3.0' ? 18 : 24}\n\t\t\t\t\t\t\tcolor={COLORS.content.placeholder}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t\trightIcon={{\n\t\t\t\t\ticon: () =>\n\t\t\t\t\t\t!val ? (\n\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tsetReset(true);\n\t\t\t\t\t\t\t\t\tonSearch('');\n\t\t\t\t\t\t\t\t\tsetVal('');\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tIcon={CrossIcon}\n\t\t\t\t\t\t\t\twidth={version === '2.0' || version === '3.0' ? 18 : 24}\n\t\t\t\t\t\t\t\theight={version === '2.0' || version === '3.0' ? 18 : 24}\n\t\t\t\t\t\t\t\ticonColor={COLORS.content.placeholder}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t\treset={reset}\n\t\t\t\tonChangeText={(text) => {\n\t\t\t\t\tsetReset(false);\n\t\t\t\t\tsetVal(text);\n\t\t\t\t\tonSearch(text);\n\t\t\t\t}}\n\t\t\t/>\n\t\t</InputStyleContext.Provider>\n\t);\n};\n"],"names":["SearchBox","_ref","onSearch","version","val","setVal","useState","reset","setReset","_jsx","InputStyleContext","Provider","Object","assign","value","InputWrapper","borderRadius","border","borderBottom","COLORS","stroke","primary","padding","IconHolder","marginLeft","input","minHeight","children","Input","noKeyDownChange","skipFocus","placeholder","variant","leftIcon","icon","SearchIcon","width","height","color","content","rightIcon","IconButton","onClick","Icon","CrossIcon","iconColor","_Fragment","onChangeText","text"],"mappings":"6cAQaA,MAAAA,EAGRC,IAA0B,IAAzBC,SAAEA,EAAQC,QAAEA,GAASF,EAC1B,MAAOG,EAAKC,GAAUC,EAAS,KACxBC,EAAOC,GAAYF,GAAS,GAEnC,OACCG,EAACC,EAAkBC,SAAQC,OAAAC,OAAA,CAC1BC,MAAO,CACNC,aAAc,CACbC,aAAc,EACdC,OAAQ,EACRC,gBACa,QAAZf,GAAiC,QAAZA,EAAoB,GAAM,aACpCgB,EAAOC,OAAOC,UAC1BC,QACC,IAAY,QAAZnB,GAAiC,QAAZA,EAAoB,UAAY,cAGvDoB,WAAY,CACXC,WAAY,GAEbC,MAAO,CACND,WAAY,EACZE,UAAW,UAEZ,CAAAC,SAEDlB,EAACmB,EACA,CAAAC,mBACAC,WAAW,EACXC,YAAY,SACZC,QAAqB,QAAZ7B,GAAiC,QAAZA,EAAoB,QAAU,UAC5D8B,SAAU,CACTC,KAAMA,IACLzB,EAAC0B,EAAU,CACVC,MAAmB,QAAZjC,GAAiC,QAAZA,EAAoB,GAAK,GACrDkC,OAAoB,QAAZlC,GAAiC,QAAZA,EAAoB,GAAK,GACtDmC,MAAOnB,EAAOoB,QAAQR,eAIzBS,UAAW,CACVN,KAAMA,IACJ9B,EAGAK,EAACgC,EACA,CAAAC,QAASA,KACRlC,GAAS,GACTN,EAAS,IACTG,EAAO,GAAG,EAEXsC,KAAMC,EACNR,MAAmB,QAAZjC,GAAiC,QAAZA,EAAoB,GAAK,GACrDkC,OAAoB,QAAZlC,GAAiC,QAAZA,EAAoB,GAAK,GACtD0C,UAAW1B,EAAOoB,QAAQR,cAX3BtB,EAAAqC,EAAA,KAeHvC,MAAOA,EACPwC,aAAeC,IACdxC,GAAS,GACTH,EAAO2C,GACP9C,EAAS8C,EAAK,MAGY"}
1
+ {"version":3,"file":"SearchBox.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { IconButton } from '@src/components/icon-button';\nimport { Input } from '@src/components/input';\nimport { InputStyleContext } from '@src/components/input/context/InputStyleProvider';\nimport { COLORS } from '@src/constants/Theme';\nimport CrossIcon from '../../../../../assets/icons/cross.svg';\nimport SearchIcon from '../../../../../assets/icons/search.svg';\n\nexport const SearchBox: React.FC<{\n\tonSearch: (searchString: string) => void;\n\tversion?: '1.0' | '2.0';\n}> = ({ onSearch, version }) => {\n\tconst [val, setVal] = useState('');\n\tconst [reset, setReset] = useState(false);\n\n\treturn (\n\t\t<InputStyleContext.Provider\n\t\t\tvalue={{\n\t\t\t\tInputWrapper: {\n\t\t\t\t\tborderRadius: 0,\n\t\t\t\t\tborder: 0,\n\t\t\t\t\tborderBottom: `${version === '2.0' ? 0.5 : 1}px solid ${\n\t\t\t\t\t\tCOLORS.stroke.primary\n\t\t\t\t\t}`,\n\t\t\t\t\tpadding: `${version === '2.0' ? '6px 8px' : '14px 16px'}`,\n\t\t\t\t},\n\t\t\t\tIconHolder: {\n\t\t\t\t\tmarginLeft: 0,\n\t\t\t\t},\n\t\t\t\tinput: {\n\t\t\t\t\tmarginLeft: 4,\n\t\t\t\t\tminHeight: '100%',\n\t\t\t\t},\n\t\t\t}}\n\t\t>\n\t\t\t<Input\n\t\t\t\tnoKeyDownChange\n\t\t\t\tskipFocus={true}\n\t\t\t\tplaceholder=\"Search\"\n\t\t\t\tvariant={version === '2.0' ? 'small' : 'default'}\n\t\t\t\tleftIcon={{\n\t\t\t\t\ticon: () => (\n\t\t\t\t\t\t<SearchIcon\n\t\t\t\t\t\t\twidth={version === '2.0' ? 18 : 24}\n\t\t\t\t\t\t\theight={version === '2.0' ? 18 : 24}\n\t\t\t\t\t\t\tcolor={COLORS.content.placeholder}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t\trightIcon={{\n\t\t\t\t\ticon: () =>\n\t\t\t\t\t\t!val ? (\n\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tsetReset(true);\n\t\t\t\t\t\t\t\t\tonSearch('');\n\t\t\t\t\t\t\t\t\tsetVal('');\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tIcon={CrossIcon}\n\t\t\t\t\t\t\t\twidth={version === '2.0' ? 18 : 24}\n\t\t\t\t\t\t\t\theight={version === '2.0' ? 18 : 24}\n\t\t\t\t\t\t\t\ticonColor={COLORS.content.placeholder}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t\treset={reset}\n\t\t\t\tonChangeText={(text) => {\n\t\t\t\t\tsetReset(false);\n\t\t\t\t\tsetVal(text);\n\t\t\t\t\tonSearch(text);\n\t\t\t\t}}\n\t\t\t/>\n\t\t</InputStyleContext.Provider>\n\t);\n};\n"],"names":["SearchBox","_ref","onSearch","version","val","setVal","useState","reset","setReset","_jsx","InputStyleContext","Provider","Object","assign","value","InputWrapper","borderRadius","border","borderBottom","COLORS","stroke","primary","padding","IconHolder","marginLeft","input","minHeight","children","Input","noKeyDownChange","skipFocus","placeholder","variant","leftIcon","icon","SearchIcon","width","height","color","content","rightIcon","IconButton","onClick","Icon","CrossIcon","iconColor","_Fragment","onChangeText","text"],"mappings":"6cAQaA,MAAAA,EAGRC,IAA0B,IAAzBC,SAAEA,EAAQC,QAAEA,GAASF,EAC1B,MAAOG,EAAKC,GAAUC,EAAS,KACxBC,EAAOC,GAAYF,GAAS,GAEnC,OACCG,EAACC,EAAkBC,SAAQC,OAAAC,OAAA,CAC1BC,MAAO,CACNC,aAAc,CACbC,aAAc,EACdC,OAAQ,EACRC,aAAiB,GAAY,QAAZf,EAAoB,GAAM,aAC1CgB,EAAOC,OAAOC,UAEfC,QAAS,IAAe,QAAZnB,EAAoB,UAAY,cAE7CoB,WAAY,CACXC,WAAY,GAEbC,MAAO,CACND,WAAY,EACZE,UAAW,UAEZ,CAAAC,SAEDlB,EAACmB,EACA,CAAAC,iBACA,EAAAC,WAAW,EACXC,YAAY,SACZC,QAAqB,QAAZ7B,EAAoB,QAAU,UACvC8B,SAAU,CACTC,KAAMA,IACLzB,EAAC0B,GACAC,MAAmB,QAAZjC,EAAoB,GAAK,GAChCkC,OAAoB,QAAZlC,EAAoB,GAAK,GACjCmC,MAAOnB,EAAOoB,QAAQR,eAIzBS,UAAW,CACVN,KAAMA,IACJ9B,EAGAK,EAACgC,EACA,CAAAC,QAASA,KACRlC,GAAS,GACTN,EAAS,IACTG,EAAO,GAAG,EAEXsC,KAAMC,EACNR,MAAmB,QAAZjC,EAAoB,GAAK,GAChCkC,OAAoB,QAAZlC,EAAoB,GAAK,GACjC0C,UAAW1B,EAAOoB,QAAQR,cAX3BtB,EAAAqC,EAAA,KAeHvC,MAAOA,EACPwC,aAAeC,IACdxC,GAAS,GACTH,EAAO2C,GACP9C,EAAS8C,EAAK,MAGY"}
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import{ZeroState as e}from"../../../../zeroState/ZeroState.js";import{COLORS as n}from"../../../../../constants/Theme.js";const o=o=>{let{searchedString:i,height:r,isLoading:s,containerWidth:l,errorMessage:a,onRetry:c,version:d}=o;const h=!!a&&!s;return t("div","3.0"!==d||h||s?Object.assign({style:{height:r,display:"flex",alignItems:"center"}},{children:t(e,{isLoading:s,title:h?"Failed to load options":"No results found",subTitle:h?a:`Sorry we could not find any results for "${null!=i?i:""}"`,actionButton:h?{buttonText:"Try again",buttonType:"text",onClick:c}:void 0,containerWidth:l})}):Object.assign({style:{height:r,display:"flex",alignItems:"center",justifyContent:"center"}},{children:t("span",Object.assign({style:{fontFamily:"Inter",fontSize:"12px",fontWeight:400,lineHeight:"16px",color:n.content.placeholder,whiteSpace:"nowrap"}},{children:"No results found!"}))}))};export{o as SearchZeroState};
1
+ import{jsx as t}from"react/jsx-runtime";import{ZeroState as e}from"../../../../zeroState/ZeroState.js";const o=o=>{let{searchedString:i,height:n,isLoading:r,containerWidth:s,errorMessage:a,onRetry:l}=o;const d=!!a&&!r;return t("div",Object.assign({style:{height:n,display:"flex",alignItems:"center"}},{children:t(e,{isLoading:r,title:d?"Failed to load options":"No results found",subTitle:d?a:`Sorry we could not find any results for "${null!=i?i:""}"`,actionButton:d?{buttonText:"Try again",buttonType:"text",onClick:l}:void 0,containerWidth:s})}))};export{o as SearchZeroState};
2
2
  //# sourceMappingURL=SearchZeroState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchZeroState.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.tsx"],"sourcesContent":["import React from 'react';\nimport { ZeroState } from '@src/components/zeroState/ZeroState';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const SearchZeroState: React.FC<{\n\tsearchedString: string;\n\theight: number;\n\tisLoading?: boolean;\n\tcontainerWidth?: string;\n\terrorMessage?: string;\n\tonRetry?: () => void;\n\tversion?: '1.0' | '2.0' | '3.0';\n}> = ({\n\tsearchedString,\n\theight,\n\tisLoading,\n\tcontainerWidth,\n\terrorMessage,\n\tonRetry,\n\tversion,\n}) => {\n\tconst isErrorState = !!errorMessage && !isLoading;\n\n\tif (version === '3.0' && !isErrorState && !isLoading) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\theight: height,\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tfontFamily: 'Inter',\n\t\t\t\t\t\tfontSize: '12px',\n\t\t\t\t\t\tfontWeight: 400,\n\t\t\t\t\t\tlineHeight: '16px',\n\t\t\t\t\t\tcolor: COLORS.content.placeholder,\n\t\t\t\t\t\twhiteSpace: 'nowrap',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\tNo results found!\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\theight: height,\n\t\t\t\tdisplay: 'flex',\n\t\t\t\talignItems: 'center',\n\t\t\t}}\n\t\t>\n\t\t\t<ZeroState\n\t\t\t\tisLoading={isLoading}\n\t\t\t\ttitle={isErrorState ? 'Failed to load options' : 'No results found'}\n\t\t\t\tsubTitle={\n\t\t\t\t\tisErrorState\n\t\t\t\t\t\t? errorMessage\n\t\t\t\t\t\t: `Sorry we could not find any results for \"${\n\t\t\t\t\t\t\t\tsearchedString ?? ''\n\t\t\t\t\t\t }\"`\n\t\t\t\t}\n\t\t\t\tactionButton={\n\t\t\t\t\tisErrorState\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tbuttonText: 'Try again',\n\t\t\t\t\t\t\t\tbuttonType: 'text',\n\t\t\t\t\t\t\t\tonClick: onRetry,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tcontainerWidth={containerWidth}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n"],"names":["SearchZeroState","_ref","searchedString","height","isLoading","containerWidth","errorMessage","onRetry","version","isErrorState","_jsx","Object","assign","style","display","alignItems","children","ZeroState","title","subTitle","actionButton","buttonText","buttonType","onClick","undefined","justifyContent","fontFamily","fontSize","fontWeight","lineHeight","color","COLORS","content","placeholder","whiteSpace"],"mappings":"kKAIaA,MAAAA,EAQRC,IAQA,IARCC,eACLA,EAAcC,OACdA,EAAMC,UACNA,EAASC,eACTA,EAAcC,aACdA,EAAYC,QACZA,EAAOC,QACPA,GACAP,EACA,MAAMQ,IAAiBH,IAAiBF,EAExC,OA2BCM,EACC,MA5Bc,QAAZF,GAAsBC,GAAiBL,EA4BzCO,OAAAC,OAAA,CAAAC,MAAO,CACNV,OAAQA,EACRW,QAAS,OACTC,WAAY,WAGb,CAAAC,SAAAN,EAACO,EACA,CAAAb,UAAWA,EACXc,MAAOT,EAAe,yBAA2B,mBACjDU,SACCV,EACGH,EACA,4CACAJ,QAAAA,EAAkB,MAGtBkB,aACCX,EACG,CACAY,WAAY,YACZC,WAAY,OACZC,QAAShB,QAETiB,EAEJnB,eAAgBA,MAlDhBM,OAAAC,OAAA,CAAAC,MAAO,CACNV,OAAQA,EACRW,QAAS,OACTC,WAAY,SACZU,eAAgB,WAGjB,CAAAT,SAAAN,EAAA,OAAAC,OAAAC,OAAA,CACCC,MAAO,CACNa,WAAY,QACZC,SAAU,OACVC,WAAY,IACZC,WAAY,OACZC,MAAOC,EAAOC,QAAQC,YACtBC,WAAY,WAIP,CAAAlB,SAAA,yBAkCH"}
1
+ {"version":3,"file":"SearchZeroState.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.tsx"],"sourcesContent":["import React from 'react';\nimport { ZeroState } from '@src/components/zeroState/ZeroState';\n\nexport const SearchZeroState: React.FC<{\n\tsearchedString: string;\n\theight: number;\n\tisLoading?: boolean;\n\tcontainerWidth?: string;\n\terrorMessage?: string;\n\tonRetry?: () => void;\n}> = ({\n\tsearchedString,\n\theight,\n\tisLoading,\n\tcontainerWidth,\n\terrorMessage,\n\tonRetry,\n}) => {\n\tconst isErrorState = !!errorMessage && !isLoading;\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\theight: height,\n\t\t\t\tdisplay: 'flex',\n\t\t\t\talignItems: 'center',\n\t\t\t}}\n\t\t>\n\t\t\t<ZeroState\n\t\t\t\tisLoading={isLoading}\n\t\t\t\ttitle={isErrorState ? 'Failed to load options' : 'No results found'}\n\t\t\t\tsubTitle={\n\t\t\t\t\tisErrorState\n\t\t\t\t\t\t? errorMessage\n\t\t\t\t\t\t: `Sorry we could not find any results for \"${\n\t\t\t\t\t\t\t\tsearchedString ?? ''\n\t\t\t\t\t\t }\"`\n\t\t\t\t}\n\t\t\t\tactionButton={\n\t\t\t\t\tisErrorState\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tbuttonText: 'Try again',\n\t\t\t\t\t\t\t\tbuttonType: 'text',\n\t\t\t\t\t\t\t\tonClick: onRetry,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tcontainerWidth={containerWidth}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n"],"names":["SearchZeroState","_ref","searchedString","height","isLoading","containerWidth","errorMessage","onRetry","isErrorState","_jsx","Object","assign","style","display","alignItems","children","ZeroState","title","subTitle","actionButton","buttonText","buttonType","onClick","undefined"],"mappings":"uGAGaA,MAAAA,EAORC,IAOA,IAPCC,eACLA,EAAcC,OACdA,EAAMC,UACNA,EAASC,eACTA,EAAcC,aACdA,EAAYC,QACZA,GACAN,EACA,MAAMO,IAAiBF,IAAiBF,EAExC,OACCK,EACC,MAAAC,OAAAC,OAAA,CAAAC,MAAO,CACNT,OAAQA,EACRU,QAAS,OACTC,WAAY,WAGb,CAAAC,SAAAN,EAACO,EACA,CAAAZ,UAAWA,EACXa,MAAOT,EAAe,yBAA2B,mBACjDU,SACCV,EACGF,EACA,4CACAJ,QAAAA,EAAkB,MAGtBiB,aACCX,EACG,CACAY,WAAY,YACZC,WAAY,OACZC,QAASf,QAETgB,EAEJlB,eAAgBA,MAEZ"}
@@ -1,2 +1,2 @@
1
- import{__rest as o}from"../../_virtual/_tslib.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{DropdownPopover as i}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"react";import"../zeroState/ZeroState.js";import"../../constants/Theme.js";import"lodash/debounce";import"../TypographyStyle.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import{Button as e}from"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{IconButton as r}from"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{SpinnerColorMap as s}from"../button/themes.js";import{Spinner as d}from"../spinner/Spinner.js";import{DropdownButtonStyle as p,LoaderContainer as u}from"./DropdownButton.style.js";const l=l=>{var m,a,c,b,j,y,v,g,x;const w=!!l.iconButtonProps,P=w?null===(m=l.iconButtonProps)||void 0===m?void 0:m.disabled:null===(a=l.buttonProps)||void 0===a?void 0:a.disabled;if(w){const{iconButtonProps:o}=l;return t(p,Object.assign({type:void 0,disabled:P,isIconButton:!0,iconButtonType:null!==(c=null==o?void 0:o.iconButtonType)&&void 0!==c?c:"primary",iconButtonSize:null!==(b=null==o?void 0:o.size)&&void 0!==b?b:"default"},{children:[n(r,Object.assign({},o,{style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px"}})),n("div",{className:"dd-button-divider"}),n("div",Object.assign({style:{display:"flex",alignItems:"center"}},{children:n(i,Object.assign({},l.dropdownProps,{isChildLoading:!1},{children:n(r,{Icon:l.iconProps,iconButtonType:null!==(j=null==o?void 0:o.iconButtonType)&&void 0!==j?j:"primary",size:null==o?void 0:o.size,disabled:P,style:{display:"flex",borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"}})}))}))]}))}const h=l.buttonProps,B=o(h,["onClick","LeadingIcon","LeadingIconStyles","IconComponent","TrailingIcon"]);return t(p,Object.assign({type:l.buttonProps.buttonType,disabled:l.buttonProps.disabled,size:l.buttonProps.size},{children:[(null===(y=l.buttonProps)||void 0===y?void 0:y.isLoading)&&n(u,Object.assign({type:l.buttonProps.buttonType},{children:n(d,{className:"spinner",size:"small",color:s(l.buttonProps.buttonType||"primary",l.buttonProps.inverse)})})),n(e,Object.assign({},l.buttonProps,{isLoading:!1,style:Object.assign({borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:"0px"},"xs"===(null===(v=l.buttonProps)||void 0===v?void 0:v.size)?{border:"none",borderRadius:"0px"}:{})})),n("div",{className:"dd-button-divider"}),n(i,Object.assign({},l.dropdownProps,{isChildLoading:null===(g=l.buttonProps)||void 0===g?void 0:g.isLoading},{children:n(e,Object.assign({},B,{isLoading:!1,buttonText:"",TrailingIcon:l.iconProps,style:Object.assign({borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"},"xs"===(null===(x=l.buttonProps)||void 0===x?void 0:x.size)?{border:"none",borderRadius:"0px"}:{})}))}))]}))};export{l as DropdownButton};
1
+ import{__rest as o}from"../../_virtual/_tslib.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{DropdownPopover as r}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"react";import"../zeroState/ZeroState.js";import"../../constants/Theme.js";import"lodash/debounce";import"../TypographyStyle.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import{Button as e}from"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{SpinnerColorMap as p}from"../button/themes.js";import{Spinner as s}from"../spinner/Spinner.js";import{DropdownButtonStyle as i,LoaderContainer as d}from"./DropdownButton.style.js";const m=m=>{var u,l;const a=m.buttonProps,c=o(a,["onClick"]);return t(i,Object.assign({type:m.buttonProps.buttonType,disabled:m.buttonProps.disabled},{children:[(null===(u=m.buttonProps)||void 0===u?void 0:u.isLoading)&&n(d,{children:n(s,{className:"spinner",size:"small",color:p(m.buttonProps.buttonType||"primary",m.buttonProps.inverse)})}),n(e,Object.assign({},m.buttonProps,{isLoading:!1,style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:"0px"}})),n("div",{className:"dd-button-divider"}),n(r,Object.assign({},m.dropdownProps,{isChildLoading:null===(l=m.buttonProps)||void 0===l?void 0:l.isLoading},{children:n(e,Object.assign({},c,{isLoading:!1,buttonText:"",TrailingIcon:m.iconProps,style:{borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"}}))}))]}))};export{m as DropdownButton};
2
2
  //# sourceMappingURL=DropdownButton.js.map