@hazelcast/ui 2.0.4 → 3.0.0-canary.0

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 (536) hide show
  1. package/lib/components/Alert.js +116 -50
  2. package/lib/components/Alert.js.map +1 -1
  3. package/lib/components/Alert.module.scss.js +8 -0
  4. package/lib/components/Alert.module.scss.js.map +1 -0
  5. package/lib/components/AppHeader/AppHeader.js +39 -17
  6. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  7. package/lib/components/AppHeader/AppHeader.module.scss.js +8 -0
  8. package/lib/components/AppHeader/AppHeader.module.scss.js.map +1 -0
  9. package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.js +24 -7
  10. package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.js.map +1 -1
  11. package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.module.scss.js +8 -0
  12. package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.module.scss.js.map +1 -0
  13. package/lib/components/AppHeader/AppHeaderLogo/index.js +8 -2
  14. package/lib/components/AppHeader/AppHeaderLogo/index.js.map +1 -1
  15. package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.js +46 -14
  16. package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.js.map +1 -1
  17. package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.module.scss.js +8 -0
  18. package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.module.scss.js.map +1 -0
  19. package/lib/components/AppHeader/AppHeaderMenu/index.js +8 -2
  20. package/lib/components/AppHeader/AppHeaderMenu/index.js.map +1 -1
  21. package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.js +19 -9
  22. package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.js.map +1 -1
  23. package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.module.scss.js +8 -0
  24. package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.module.scss.js.map +1 -0
  25. package/lib/components/AppHeader/EnvironmentBadge/index.js +8 -2
  26. package/lib/components/AppHeader/EnvironmentBadge/index.js.map +1 -1
  27. package/lib/components/AppHeader/SelectCluster/SelectCluster.js +72 -32
  28. package/lib/components/AppHeader/SelectCluster/SelectCluster.js.map +1 -1
  29. package/lib/components/AppHeader/SelectCluster/SelectCluster.module.scss.js +8 -0
  30. package/lib/components/AppHeader/SelectCluster/SelectCluster.module.scss.js.map +1 -0
  31. package/lib/components/AppHeader/SelectCluster/index.js +8 -2
  32. package/lib/components/AppHeader/SelectCluster/index.js.map +1 -1
  33. package/lib/components/AppHeader/index.js +8 -2
  34. package/lib/components/AppHeader/index.js.map +1 -1
  35. package/lib/components/AppSidebar/AppSidebar.js +56 -30
  36. package/lib/components/AppSidebar/AppSidebar.js.map +1 -1
  37. package/lib/components/AppSidebar/AppSidebar.module.scss.js +8 -0
  38. package/lib/components/AppSidebar/AppSidebar.module.scss.js.map +1 -0
  39. package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.js +37 -21
  40. package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.js.map +1 -1
  41. package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.module.scss.js +8 -0
  42. package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.module.scss.js.map +1 -0
  43. package/lib/components/AppSidebar/AppSidebarFavoriteButton/index.js +8 -2
  44. package/lib/components/AppSidebar/AppSidebarFavoriteButton/index.js.map +1 -1
  45. package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.js +31 -10
  46. package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.js.map +1 -1
  47. package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.module.scss.js +8 -0
  48. package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.module.scss.js.map +1 -0
  49. package/lib/components/AppSidebar/AppSidebarFavorites/index.js +8 -2
  50. package/lib/components/AppSidebar/AppSidebarFavorites/index.js.map +1 -1
  51. package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.js +77 -22
  52. package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.js.map +1 -1
  53. package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.module.scss.js +8 -0
  54. package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.module.scss.js.map +1 -0
  55. package/lib/components/AppSidebar/AppSidebarItem/index.js +8 -2
  56. package/lib/components/AppSidebar/AppSidebarItem/index.js.map +1 -1
  57. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.js +17 -6
  58. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.js.map +1 -1
  59. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.module.scss.js +8 -0
  60. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.module.scss.js.map +1 -0
  61. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/index.js +8 -2
  62. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/index.js.map +1 -1
  63. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.js +39 -14
  64. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.js.map +1 -1
  65. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.module.scss.js +8 -0
  66. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.module.scss.js.map +1 -0
  67. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.js +94 -53
  68. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.js.map +1 -1
  69. package/lib/components/AppSidebar/AppSidebarSection/appSidebarSectionContext.js +8 -3
  70. package/lib/components/AppSidebar/AppSidebarSection/appSidebarSectionContext.js.map +1 -1
  71. package/lib/components/AppSidebar/AppSidebarSection/index.js +8 -2
  72. package/lib/components/AppSidebar/AppSidebarSection/index.js.map +1 -1
  73. package/lib/components/AppSidebar/appSidebarContext.js +14 -9
  74. package/lib/components/AppSidebar/appSidebarContext.js.map +1 -1
  75. package/lib/components/AppSidebar/index.js +16 -6
  76. package/lib/components/AppSidebar/index.js.map +1 -1
  77. package/lib/components/AutocompleteField.js +229 -154
  78. package/lib/components/AutocompleteField.js.map +1 -1
  79. package/lib/components/AutocompleteField.module.scss.js +8 -0
  80. package/lib/components/AutocompleteField.module.scss.js.map +1 -0
  81. package/lib/components/AutocompleteFieldFormik.js +41 -18
  82. package/lib/components/AutocompleteFieldFormik.js.map +1 -1
  83. package/lib/components/Badge.js +66 -42
  84. package/lib/components/Badge.js.map +1 -1
  85. package/lib/components/Badge.module.scss.js +8 -0
  86. package/lib/components/Badge.module.scss.js.map +1 -0
  87. package/lib/components/Button.js +115 -42
  88. package/lib/components/Button.js.map +1 -1
  89. package/lib/components/Button.module.scss.js +8 -0
  90. package/lib/components/Button.module.scss.js.map +1 -0
  91. package/lib/components/Calendar/Calendar.d.ts +6 -4
  92. package/lib/components/Calendar/Calendar.js +77 -34
  93. package/lib/components/Calendar/Calendar.js.map +1 -1
  94. package/lib/components/Calendar/Calendar.module.scss.js +8 -0
  95. package/lib/components/Calendar/Calendar.module.scss.js.map +1 -0
  96. package/lib/components/Calendar/CalendarRange.js +60 -12
  97. package/lib/components/Calendar/CalendarRange.js.map +1 -1
  98. package/lib/components/Calendar/CalendarRange.module.scss.js +8 -0
  99. package/lib/components/Calendar/CalendarRange.module.scss.js.map +1 -0
  100. package/lib/components/Calendar/components/CalendarHeader.d.ts +2 -2
  101. package/lib/components/Calendar/components/CalendarHeader.js +35 -12
  102. package/lib/components/Calendar/components/CalendarHeader.js.map +1 -1
  103. package/lib/components/Calendar/components/CalendarInput.js +39 -9
  104. package/lib/components/Calendar/components/CalendarInput.js.map +1 -1
  105. package/lib/components/Calendar/components/CalendarTime.js +104 -66
  106. package/lib/components/Calendar/components/CalendarTime.js.map +1 -1
  107. package/lib/components/Calendar/components/CalendarTime.module.scss.js +8 -0
  108. package/lib/components/Calendar/components/CalendarTime.module.scss.js.map +1 -0
  109. package/lib/components/Calendar/helpers/consts.js +8 -100
  110. package/lib/components/Calendar/helpers/consts.js.map +1 -1
  111. package/lib/components/Card.js +60 -14
  112. package/lib/components/Card.js.map +1 -1
  113. package/lib/components/Card.module.scss.js +8 -0
  114. package/lib/components/Card.module.scss.js.map +1 -0
  115. package/lib/components/Carousel.js +60 -27
  116. package/lib/components/Carousel.js.map +1 -1
  117. package/lib/components/Carousel.module.scss.js +8 -0
  118. package/lib/components/Carousel.module.scss.js.map +1 -0
  119. package/lib/components/CenteredLoader.js +18 -6
  120. package/lib/components/CenteredLoader.js.map +1 -1
  121. package/lib/components/CenteredLoader.module.scss.js +8 -0
  122. package/lib/components/CenteredLoader.module.scss.js.map +1 -0
  123. package/lib/components/Checkbox.d.ts +2 -2
  124. package/lib/components/Checkbox.js +87 -26
  125. package/lib/components/Checkbox.js.map +1 -1
  126. package/lib/components/Checkbox.module.scss.js +8 -0
  127. package/lib/components/Checkbox.module.scss.js.map +1 -0
  128. package/lib/components/CheckboxFormik.js +37 -16
  129. package/lib/components/CheckboxFormik.js.map +1 -1
  130. package/lib/components/CircularProgressBar.js +78 -27
  131. package/lib/components/CircularProgressBar.js.map +1 -1
  132. package/lib/components/CircularProgressBar.module.scss.js +8 -0
  133. package/lib/components/CircularProgressBar.module.scss.js.map +1 -0
  134. package/lib/components/ContextMenu.js +86 -60
  135. package/lib/components/ContextMenu.js.map +1 -1
  136. package/lib/components/ContextMenu.module.scss.js +8 -0
  137. package/lib/components/ContextMenu.module.scss.js.map +1 -0
  138. package/lib/components/Dialog.js +50 -30
  139. package/lib/components/Dialog.js.map +1 -1
  140. package/lib/components/Dialog.module.scss.js +8 -0
  141. package/lib/components/Dialog.module.scss.js.map +1 -0
  142. package/lib/components/EmptyState.js +66 -20
  143. package/lib/components/EmptyState.js.map +1 -1
  144. package/lib/components/EmptyState.module.scss.js +8 -0
  145. package/lib/components/EmptyState.module.scss.js.map +1 -0
  146. package/lib/components/Error.js +28 -7
  147. package/lib/components/Error.js.map +1 -1
  148. package/lib/components/Error.module.scss.js +8 -0
  149. package/lib/components/Error.module.scss.js.map +1 -0
  150. package/lib/components/FieldHeader.js +43 -14
  151. package/lib/components/FieldHeader.js.map +1 -1
  152. package/lib/components/FieldHeader.module.scss.js +8 -0
  153. package/lib/components/FieldHeader.module.scss.js.map +1 -0
  154. package/lib/components/Help.d.ts +0 -1
  155. package/lib/components/Help.js +42 -13
  156. package/lib/components/Help.js.map +1 -1
  157. package/lib/components/Help.module.scss.js +8 -0
  158. package/lib/components/Help.module.scss.js.map +1 -0
  159. package/lib/components/Icon.js +48 -25
  160. package/lib/components/Icon.js.map +1 -1
  161. package/lib/components/Icon.module.scss.js +8 -0
  162. package/lib/components/Icon.module.scss.js.map +1 -0
  163. package/lib/components/IconButton.js +81 -23
  164. package/lib/components/IconButton.js.map +1 -1
  165. package/lib/components/IconButton.module.scss.js +8 -0
  166. package/lib/components/IconButton.module.scss.js.map +1 -0
  167. package/lib/components/InteractiveList.js +115 -41
  168. package/lib/components/InteractiveList.js.map +1 -1
  169. package/lib/components/InteractiveList.module.scss.js +8 -0
  170. package/lib/components/InteractiveList.module.scss.js.map +1 -0
  171. package/lib/components/InteractiveListFormik.js +110 -81
  172. package/lib/components/InteractiveListFormik.js.map +1 -1
  173. package/lib/components/Label.js +20 -5
  174. package/lib/components/Label.js.map +1 -1
  175. package/lib/components/Label.module.scss.js +8 -0
  176. package/lib/components/Label.module.scss.js.map +1 -0
  177. package/lib/components/Link.js +59 -31
  178. package/lib/components/Link.js.map +1 -1
  179. package/lib/components/Link.module.scss.js +8 -0
  180. package/lib/components/Link.module.scss.js.map +1 -0
  181. package/lib/components/Loader.js +82 -23
  182. package/lib/components/Loader.js.map +1 -1
  183. package/lib/components/Loader.module.scss.js +8 -0
  184. package/lib/components/Loader.module.scss.js.map +1 -0
  185. package/lib/components/Modal.js +93 -26
  186. package/lib/components/Modal.js.map +1 -1
  187. package/lib/components/Modal.module.scss.js +8 -0
  188. package/lib/components/Modal.module.scss.js.map +1 -0
  189. package/lib/components/Notification.js +75 -37
  190. package/lib/components/Notification.js.map +1 -1
  191. package/lib/components/Notification.module.scss.js +8 -0
  192. package/lib/components/Notification.module.scss.js.map +1 -0
  193. package/lib/components/NumberBadge.js +18 -7
  194. package/lib/components/NumberBadge.js.map +1 -1
  195. package/lib/components/NumberBadge.module.scss.js +8 -0
  196. package/lib/components/NumberBadge.module.scss.js.map +1 -0
  197. package/lib/components/NumberField.js +181 -140
  198. package/lib/components/NumberField.js.map +1 -1
  199. package/lib/components/NumberField.module.scss.js +8 -0
  200. package/lib/components/NumberField.module.scss.js.map +1 -0
  201. package/lib/components/NumberFieldFormik.js +69 -49
  202. package/lib/components/NumberFieldFormik.js.map +1 -1
  203. package/lib/components/Overlay.js +92 -29
  204. package/lib/components/Overlay.js.map +1 -1
  205. package/lib/components/Overlay.module.scss.js +8 -0
  206. package/lib/components/Overlay.module.scss.js.map +1 -0
  207. package/lib/components/Pagination.js +198 -91
  208. package/lib/components/Pagination.js.map +1 -1
  209. package/lib/components/Pagination.module.scss.js +8 -0
  210. package/lib/components/Pagination.module.scss.js.map +1 -0
  211. package/lib/components/PasswordField.js +61 -25
  212. package/lib/components/PasswordField.js.map +1 -1
  213. package/lib/components/PasswordField.module.scss.js +8 -0
  214. package/lib/components/PasswordField.module.scss.js.map +1 -0
  215. package/lib/components/PasswordFieldFormik.js +37 -16
  216. package/lib/components/PasswordFieldFormik.js.map +1 -1
  217. package/lib/components/Popover.d.ts +3 -10
  218. package/lib/components/Popover.js +85 -119
  219. package/lib/components/Popover.js.map +1 -1
  220. package/lib/components/Popover.module.scss.js +8 -0
  221. package/lib/components/Popover.module.scss.js.map +1 -0
  222. package/lib/components/Radio.d.ts +2 -2
  223. package/lib/components/Radio.js +67 -26
  224. package/lib/components/Radio.js.map +1 -1
  225. package/lib/components/Radio.module.scss.js +8 -0
  226. package/lib/components/Radio.module.scss.js.map +1 -0
  227. package/lib/components/RadioFormik.js +26 -11
  228. package/lib/components/RadioFormik.js.map +1 -1
  229. package/lib/components/RadioGroup.js +51 -18
  230. package/lib/components/RadioGroup.js.map +1 -1
  231. package/lib/components/RadioGroup.module.scss.js +8 -0
  232. package/lib/components/RadioGroup.module.scss.js.map +1 -0
  233. package/lib/components/RadioGroupContext.js +10 -3
  234. package/lib/components/RadioGroupContext.js.map +1 -1
  235. package/lib/components/RadioGroupFormik.js +34 -16
  236. package/lib/components/RadioGroupFormik.js.map +1 -1
  237. package/lib/components/SegmentedControl.js +43 -9
  238. package/lib/components/SegmentedControl.js.map +1 -1
  239. package/lib/components/SegmentedControl.module.scss.js +8 -0
  240. package/lib/components/SegmentedControl.module.scss.js.map +1 -0
  241. package/lib/components/SegmentedControlFormik.js +30 -12
  242. package/lib/components/SegmentedControlFormik.js.map +1 -1
  243. package/lib/components/Select/CheckableSelectField.js +178 -75
  244. package/lib/components/Select/CheckableSelectField.js.map +1 -1
  245. package/lib/components/Select/CheckableSelectField.module.scss.js +8 -0
  246. package/lib/components/Select/CheckableSelectField.module.scss.js.map +1 -0
  247. package/lib/components/Select/CheckableSelectFieldFormik.js +41 -18
  248. package/lib/components/Select/CheckableSelectFieldFormik.js.map +1 -1
  249. package/lib/components/Select/Common.js +87 -44
  250. package/lib/components/Select/Common.js.map +1 -1
  251. package/lib/components/Select/Common.module.scss.js +8 -0
  252. package/lib/components/Select/Common.module.scss.js.map +1 -0
  253. package/lib/components/Select/MultiSelectField.js +187 -107
  254. package/lib/components/Select/MultiSelectField.js.map +1 -1
  255. package/lib/components/Select/MultiSelectField.module.scss.js +8 -0
  256. package/lib/components/Select/MultiSelectField.module.scss.js.map +1 -0
  257. package/lib/components/Select/MultiSelectFieldFormik.js +41 -18
  258. package/lib/components/Select/MultiSelectFieldFormik.js.map +1 -1
  259. package/lib/components/Select/SelectField.js +169 -100
  260. package/lib/components/Select/SelectField.js.map +1 -1
  261. package/lib/components/Select/SelectField.module.scss.js +8 -0
  262. package/lib/components/Select/SelectField.module.scss.js.map +1 -0
  263. package/lib/components/Select/SelectFieldFormik.js +38 -18
  264. package/lib/components/Select/SelectFieldFormik.js.map +1 -1
  265. package/lib/components/Select/helpers.js +30 -25
  266. package/lib/components/Select/helpers.js.map +1 -1
  267. package/lib/components/Select/index.js +21 -8
  268. package/lib/components/Select/index.js.map +1 -1
  269. package/lib/components/SimpleTable.js +36 -13
  270. package/lib/components/SimpleTable.js.map +1 -1
  271. package/lib/components/SimpleTable.module.scss.js +8 -0
  272. package/lib/components/SimpleTable.module.scss.js.map +1 -0
  273. package/lib/components/Slider.js +294 -173
  274. package/lib/components/Slider.js.map +1 -1
  275. package/lib/components/Slider.module.scss.js +8 -0
  276. package/lib/components/Slider.module.scss.js.map +1 -0
  277. package/lib/components/SliderFormik.js +30 -13
  278. package/lib/components/SliderFormik.js.map +1 -1
  279. package/lib/components/Table/Cell.js +111 -58
  280. package/lib/components/Table/Cell.js.map +1 -1
  281. package/lib/components/Table/Cell.module.scss.js +8 -0
  282. package/lib/components/Table/Cell.module.scss.js.map +1 -0
  283. package/lib/components/Table/CellWrapper.js +44 -27
  284. package/lib/components/Table/CellWrapper.js.map +1 -1
  285. package/lib/components/Table/EnhancedRenderers.js +31 -12
  286. package/lib/components/Table/EnhancedRenderers.js.map +1 -1
  287. package/lib/components/Table/Header.js +141 -92
  288. package/lib/components/Table/Header.js.map +1 -1
  289. package/lib/components/Table/Header.module.scss.js +8 -0
  290. package/lib/components/Table/Header.module.scss.js.map +1 -0
  291. package/lib/components/Table/Row.js +77 -22
  292. package/lib/components/Table/Row.js.map +1 -1
  293. package/lib/components/Table/Row.module.scss.js +8 -0
  294. package/lib/components/Table/Row.module.scss.js.map +1 -0
  295. package/lib/components/Table/Table.js +456 -245
  296. package/lib/components/Table/Table.js.map +1 -1
  297. package/lib/components/Table/Table.module.scss.js +8 -0
  298. package/lib/components/Table/Table.module.scss.js.map +1 -0
  299. package/lib/components/Table/TableContent.js +129 -57
  300. package/lib/components/Table/TableContent.js.map +1 -1
  301. package/lib/components/Table/TableContent.module.scss.js +8 -0
  302. package/lib/components/Table/TableContent.module.scss.js.map +1 -0
  303. package/lib/components/Table/constants.js +8 -3
  304. package/lib/components/Table/constants.js.map +1 -1
  305. package/lib/components/Table/features/columnsSelection/CellCopyablePopover.js +39 -12
  306. package/lib/components/Table/features/columnsSelection/CellCopyablePopover.js.map +1 -1
  307. package/lib/components/Table/features/columnsSelection/CellCopyablePopover.module.scss.js +8 -0
  308. package/lib/components/Table/features/columnsSelection/CellCopyablePopover.module.scss.js.map +1 -0
  309. package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.js +23 -16
  310. package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.js.map +1 -1
  311. package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.module.scss.js +8 -0
  312. package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.module.scss.js.map +1 -0
  313. package/lib/components/Table/features/columnsSelection/ContextMenu/index.js +8 -2
  314. package/lib/components/Table/features/columnsSelection/ContextMenu/index.js.map +1 -1
  315. package/lib/components/Table/features/columnsSelection/columnsSelection.d.ts +2 -2
  316. package/lib/components/Table/features/columnsSelection/columnsSelection.js +76 -68
  317. package/lib/components/Table/features/columnsSelection/columnsSelection.js.map +1 -1
  318. package/lib/components/Table/features/columnsSelection/helpers.js +28 -22
  319. package/lib/components/Table/features/columnsSelection/helpers.js.map +1 -1
  320. package/lib/components/Table/features/columnsSelection/index.js +16 -5
  321. package/lib/components/Table/features/columnsSelection/index.js.map +1 -1
  322. package/lib/components/Table/helpers.js +17 -9
  323. package/lib/components/Table/helpers.js.map +1 -1
  324. package/lib/components/Table/tableTypes.js +3 -2
  325. package/lib/components/Table/tableTypes.js.map +1 -1
  326. package/lib/components/Table/useTrackTableState.js +43 -29
  327. package/lib/components/Table/useTrackTableState.js.map +1 -1
  328. package/lib/components/Table/utils.js +176 -111
  329. package/lib/components/Table/utils.js.map +1 -1
  330. package/lib/components/Tabs/Tab.js +61 -27
  331. package/lib/components/Tabs/Tab.js.map +1 -1
  332. package/lib/components/Tabs/Tab.module.scss.js +8 -0
  333. package/lib/components/Tabs/Tab.module.scss.js.map +1 -0
  334. package/lib/components/Tabs/TabContext.js +51 -26
  335. package/lib/components/Tabs/TabContext.js.map +1 -1
  336. package/lib/components/Tabs/TabList.js +62 -49
  337. package/lib/components/Tabs/TabList.js.map +1 -1
  338. package/lib/components/Tabs/TabList.module.scss.js +8 -0
  339. package/lib/components/Tabs/TabList.module.scss.js.map +1 -0
  340. package/lib/components/Tabs/TabPanel.js +29 -9
  341. package/lib/components/Tabs/TabPanel.js.map +1 -1
  342. package/lib/components/Tabs/TabPanel.module.scss.js +8 -0
  343. package/lib/components/Tabs/TabPanel.module.scss.js.map +1 -0
  344. package/lib/components/Tabs/index.js +20 -5
  345. package/lib/components/Tabs/index.js.map +1 -1
  346. package/lib/components/Terminal.js +179 -108
  347. package/lib/components/Terminal.js.map +1 -1
  348. package/lib/components/Terminal.module.scss.js +8 -0
  349. package/lib/components/Terminal.module.scss.js.map +1 -0
  350. package/lib/components/TextArea.js +79 -30
  351. package/lib/components/TextArea.js.map +1 -1
  352. package/lib/components/TextArea.module.scss.js +8 -0
  353. package/lib/components/TextArea.module.scss.js.map +1 -0
  354. package/lib/components/TextAreaFormik.js +26 -10
  355. package/lib/components/TextAreaFormik.js.map +1 -1
  356. package/lib/components/TextField.js +154 -48
  357. package/lib/components/TextField.js.map +1 -1
  358. package/lib/components/TextField.module.scss.js +8 -0
  359. package/lib/components/TextField.module.scss.js.map +1 -0
  360. package/lib/components/TextFieldFormik.js +46 -22
  361. package/lib/components/TextFieldFormik.js.map +1 -1
  362. package/lib/components/TimeField.js +62 -14
  363. package/lib/components/TimeField.js.map +1 -1
  364. package/lib/components/TimeField.module.scss.js +8 -0
  365. package/lib/components/TimeField.module.scss.js.map +1 -0
  366. package/lib/components/TimeFieldFormik.js +26 -10
  367. package/lib/components/TimeFieldFormik.js.map +1 -1
  368. package/lib/components/Toast.js +79 -44
  369. package/lib/components/Toast.js.map +1 -1
  370. package/lib/components/Toast.module.scss.js +8 -0
  371. package/lib/components/Toast.module.scss.js.map +1 -0
  372. package/lib/components/Toggle.js +71 -21
  373. package/lib/components/Toggle.js.map +1 -1
  374. package/lib/components/Toggle.module.scss.js +8 -0
  375. package/lib/components/Toggle.module.scss.js.map +1 -0
  376. package/lib/components/ToggleFormik.js +27 -11
  377. package/lib/components/ToggleFormik.js.map +1 -1
  378. package/lib/components/Tooltip.d.ts +4 -12
  379. package/lib/components/Tooltip.js +79 -122
  380. package/lib/components/Tooltip.js.map +1 -1
  381. package/lib/components/Tooltip.module.scss.js +8 -0
  382. package/lib/components/Tooltip.module.scss.js.map +1 -0
  383. package/lib/components/TruncatedText.d.ts +0 -1
  384. package/lib/components/TruncatedText.js +49 -22
  385. package/lib/components/TruncatedText.js.map +1 -1
  386. package/lib/components/TruncatedText.module.scss.js +8 -0
  387. package/lib/components/TruncatedText.module.scss.js.map +1 -0
  388. package/lib/helpers/array.js +26 -17
  389. package/lib/helpers/array.js.map +1 -1
  390. package/lib/helpers/escapeHtml.js +10 -6
  391. package/lib/helpers/escapeHtml.js.map +1 -1
  392. package/lib/helpers/forms.js +20 -14
  393. package/lib/helpers/forms.js.map +1 -1
  394. package/lib/helpers/math.js +10 -6
  395. package/lib/helpers/math.js.map +1 -1
  396. package/lib/helpers/types.js +6 -2
  397. package/lib/helpers/types.js.map +1 -1
  398. package/lib/hooks/index.js +17 -7
  399. package/lib/hooks/index.js.map +1 -1
  400. package/lib/hooks/useCloseOnResize.js +17 -12
  401. package/lib/hooks/useCloseOnResize.js.map +1 -1
  402. package/lib/hooks/useDeepCompareMemo.js +12 -7
  403. package/lib/hooks/useDeepCompareMemo.js.map +1 -1
  404. package/lib/hooks/useDeepEqual.js +14 -9
  405. package/lib/hooks/useDeepEqual.js.map +1 -1
  406. package/lib/hooks/useDimensions.d.ts +1 -1
  407. package/lib/hooks/useDimensions.js +26 -15
  408. package/lib/hooks/useDimensions.js.map +1 -1
  409. package/lib/hooks/useIsMounted.js +16 -11
  410. package/lib/hooks/useIsMounted.js.map +1 -1
  411. package/lib/hooks/useOnClickOutside.js +41 -32
  412. package/lib/hooks/useOnClickOutside.js.map +1 -1
  413. package/lib/hooks/useOpenCloseState.js +18 -13
  414. package/lib/hooks/useOpenCloseState.js.map +1 -1
  415. package/lib/hooks/usePagination.js +64 -60
  416. package/lib/hooks/usePagination.js.map +1 -1
  417. package/lib/hooks/usePersistedState.js +35 -33
  418. package/lib/hooks/usePersistedState.js.map +1 -1
  419. package/lib/hooks/usePrevious.js +13 -8
  420. package/lib/hooks/usePrevious.js.map +1 -1
  421. package/lib/hooks/useRefValue.js +13 -8
  422. package/lib/hooks/useRefValue.js.map +1 -1
  423. package/lib/icons/Cluster.js +44 -7
  424. package/lib/icons/Cluster.js.map +1 -1
  425. package/lib/icons/Compare.js +46 -7
  426. package/lib/icons/Compare.js.map +1 -1
  427. package/lib/icons/Compute.js +43 -7
  428. package/lib/icons/Compute.js.map +1 -1
  429. package/lib/icons/Folder.js +25 -4
  430. package/lib/icons/Folder.js.map +1 -1
  431. package/lib/icons/PlusCircle.js +37 -6
  432. package/lib/icons/PlusCircle.js.map +1 -1
  433. package/lib/icons/Streaming.js +45 -8
  434. package/lib/icons/Streaming.js.map +1 -1
  435. package/lib/index.d.ts +3 -2
  436. package/lib/index.js +185 -75
  437. package/lib/index.js.map +1 -1
  438. package/lib/services/logger.js +85 -75
  439. package/lib/services/logger.js.map +1 -1
  440. package/lib/services/time.js +18 -14
  441. package/lib/services/time.js.map +1 -1
  442. package/lib/styles/constants/export.module.scss.js +8 -0
  443. package/lib/styles/constants/export.module.scss.js.map +1 -0
  444. package/lib/styles.css +1 -0
  445. package/lib/test-helpers/render.js +32 -20
  446. package/lib/test-helpers/render.js.map +1 -1
  447. package/lib/test-helpers/time.js +9 -2
  448. package/lib/test-helpers/time.js.map +1 -1
  449. package/lib/test-helpers/utils.js +13 -9
  450. package/lib/test-helpers/utils.js.map +1 -1
  451. package/lib/types.js +3 -2
  452. package/lib/types.js.map +1 -1
  453. package/lib/utils/formik.js +12 -7
  454. package/lib/utils/formik.js.map +1 -1
  455. package/lib/utils/keyboard.js +8 -3
  456. package/lib/utils/keyboard.js.map +1 -1
  457. package/lib/utils/portal.js +19 -14
  458. package/lib/utils/portal.js.map +1 -1
  459. package/lib/utils/ssr.js +6 -2
  460. package/lib/utils/ssr.js.map +1 -1
  461. package/lib/utils/types.js +3 -2
  462. package/lib/utils/types.js.map +1 -1
  463. package/package.json +25 -16
  464. package/lib/components/Alert.module.scss +0 -141
  465. package/lib/components/AppHeader/AppHeader.module.scss +0 -29
  466. package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.module.scss +0 -29
  467. package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.module.scss +0 -20
  468. package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.module.scss +0 -13
  469. package/lib/components/AppHeader/SelectCluster/SelectCluster.module.scss +0 -101
  470. package/lib/components/AppSidebar/AppSidebar.module.scss +0 -66
  471. package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.module.scss +0 -16
  472. package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.module.scss +0 -13
  473. package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.module.scss +0 -92
  474. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.module.scss +0 -24
  475. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.module.scss +0 -58
  476. package/lib/components/AutocompleteField.module.scss +0 -164
  477. package/lib/components/Badge.module.scss +0 -55
  478. package/lib/components/Button.module.scss +0 -329
  479. package/lib/components/Calendar/Calendar.module.scss +0 -185
  480. package/lib/components/Calendar/CalendarRange.module.scss +0 -21
  481. package/lib/components/Calendar/components/CalendarTime.module.scss +0 -72
  482. package/lib/components/Card.module.scss +0 -92
  483. package/lib/components/Carousel.module.scss +0 -43
  484. package/lib/components/CenteredLoader.module.scss +0 -11
  485. package/lib/components/Checkbox.module.scss +0 -106
  486. package/lib/components/CircularProgressBar.module.scss +0 -37
  487. package/lib/components/ContextMenu.module.scss +0 -37
  488. package/lib/components/Dialog.module.scss +0 -62
  489. package/lib/components/EmptyState.module.scss +0 -87
  490. package/lib/components/Error.module.scss +0 -12
  491. package/lib/components/FieldHeader.module.scss +0 -20
  492. package/lib/components/Help.module.scss +0 -9
  493. package/lib/components/Icon.module.scss +0 -33
  494. package/lib/components/IconButton.module.scss +0 -59
  495. package/lib/components/InteractiveList.module.scss +0 -72
  496. package/lib/components/Label.module.scss +0 -12
  497. package/lib/components/Link.module.scss +0 -64
  498. package/lib/components/Loader.module.scss +0 -74
  499. package/lib/components/Modal.module.scss +0 -109
  500. package/lib/components/Notification.module.scss +0 -97
  501. package/lib/components/NumberBadge.module.scss +0 -13
  502. package/lib/components/NumberField.module.scss +0 -76
  503. package/lib/components/Overlay.module.scss +0 -108
  504. package/lib/components/Pagination.module.scss +0 -117
  505. package/lib/components/PasswordField.module.scss +0 -26
  506. package/lib/components/Popover.module.scss +0 -12
  507. package/lib/components/Radio.module.scss +0 -112
  508. package/lib/components/RadioGroup.module.scss +0 -21
  509. package/lib/components/SegmentedControl.module.scss +0 -81
  510. package/lib/components/Select/CheckableSelectField.module.scss +0 -100
  511. package/lib/components/Select/Common.module.scss +0 -69
  512. package/lib/components/Select/MultiSelectField.module.scss +0 -72
  513. package/lib/components/Select/SelectField.module.scss +0 -194
  514. package/lib/components/SimpleTable.module.scss +0 -28
  515. package/lib/components/Slider.module.scss +0 -277
  516. package/lib/components/Table/Cell.module.scss +0 -61
  517. package/lib/components/Table/Header.module.scss +0 -128
  518. package/lib/components/Table/Row.module.scss +0 -59
  519. package/lib/components/Table/Table.module.scss +0 -31
  520. package/lib/components/Table/TableContent.module.scss +0 -21
  521. package/lib/components/Table/features/columnsSelection/CellCopyablePopover.module.scss +0 -12
  522. package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.module.scss +0 -6
  523. package/lib/components/Tabs/Tab.module.scss +0 -58
  524. package/lib/components/Tabs/TabList.module.scss +0 -3
  525. package/lib/components/Tabs/TabPanel.module.scss +0 -7
  526. package/lib/components/Terminal.module.scss +0 -109
  527. package/lib/components/TextArea.module.scss +0 -144
  528. package/lib/components/TextField.module.scss +0 -209
  529. package/lib/components/TimeField.module.scss +0 -4
  530. package/lib/components/Toast.module.scss +0 -53
  531. package/lib/components/Toggle.module.scss +0 -175
  532. package/lib/components/Tooltip.module.scss +0 -175
  533. package/lib/components/TruncatedText.module.scss +0 -9
  534. package/lib/hooks/useResizeAware.d.ts +0 -3
  535. package/lib/hooks/useResizeAware.js +0 -25
  536. package/lib/hooks/useResizeAware.js.map +0 -1
@@ -1,25 +1,27 @@
1
- import React, { useCallback, useEffect, useMemo, useRef } from 'react';
2
- import useEvent from 'react-use/lib/useEvent';
3
- import cn from 'classnames';
4
- import { useUID } from 'react-uid';
5
- import { Error, errorId } from './Error';
6
- import { Help } from './Help';
7
- import { Label } from './Label';
8
- import { triggerNativeInputChange } from '../helpers/forms';
9
- import styles from './Slider.module.scss';
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var useEvent = require('react-use/lib/useEvent');
5
+ var cn = require('classnames');
6
+ var reactUid = require('react-uid');
7
+ var components_Error = require('./Error.js');
8
+ var components_Help = require('./Help.js');
9
+ var components_Label = require('./Label.js');
10
+ var helpers_forms = require('../helpers/forms.js');
11
+ var Slider_module = require('./Slider.module.scss.js');
12
+
10
13
  function isRangeGuard(value, onChange) {
11
- return Array.isArray(value);
14
+ return Array.isArray(value);
12
15
  }
13
16
  function isSingleValueGuard(value, onChange) {
14
- return !Array.isArray(value);
17
+ return !Array.isArray(value);
15
18
  }
16
19
  function adjustMinMaxValue(value, inputEl, min, max) {
17
- if (value < min) {
18
- triggerNativeInputChange(min.toString(), inputEl);
19
- }
20
- else if (value > max) {
21
- triggerNativeInputChange(max.toString(), inputEl);
22
- }
20
+ if (value < min) {
21
+ helpers_forms.triggerNativeInputChange(min.toString(), inputEl);
22
+ } else if (value > max) {
23
+ helpers_forms.triggerNativeInputChange(max.toString(), inputEl);
24
+ }
23
25
  }
24
26
  /**
25
27
  * Determines the absolute left position of the mark given the markValue
@@ -34,11 +36,11 @@ function adjustMinMaxValue(value, inputEl, min, max) {
34
36
  * isActive: true if marker is in the filled area of the slider
35
37
  * }
36
38
  */
37
- export function getMarkMetadata(markValue, min, max, [firstValue, secondValue], isRange) {
38
- return {
39
- left: ((markValue - min) / (max - min)) * 100,
40
- isActive: isRange ? markValue >= firstValue && markValue <= secondValue : markValue < firstValue,
41
- };
39
+ function getMarkMetadata(markValue, min, max, [firstValue, secondValue], isRange) {
40
+ return {
41
+ left: (markValue - min) / (max - min) * 100,
42
+ isActive: isRange ? markValue >= firstValue && markValue <= secondValue : markValue < firstValue
43
+ };
42
44
  }
43
45
  /**
44
46
  * Slider component
@@ -51,155 +53,274 @@ export function getMarkMetadata(markValue, min, max, [firstValue, secondValue],
51
53
  * You can optionally pass formatCurrentValue in order to modify the way how current value is displayed.
52
54
  * When providing a single value, it behaves
53
55
  */
54
- export function Slider(props) {
55
- const { value, onChange, name, step = 1, min, max, className, sliderClassName, error, helperText, marks, label, disabled, formatCurrentValue = (x) => x.toString(), hideValueIndicators, 'data-test': dataTest, } = props;
56
- /**
57
- * Implementation notes
58
- *
59
- * - div - wrapper div that holds label + actual slider + error component
60
- * - label - visible label
61
- * - wrapper
62
- * ----------------------------------------------------------------------
63
- * | Inner wrapper | |
64
- * | - markDescriptions | |
65
- * | - input wrapper | Help component |
66
- * | - current value indicator | |
67
- * ----------------------------------------------------------------------
68
- *
69
- * where
70
- * - input container contains
71
- * - input or inputs in a range mode
72
- * - fillPlaceholder - background of the possible slider area
73
- * - fill - actual fill (active range)
74
- * - marks
75
- *
76
- * - error - error component
77
- */
78
- const id = useUID();
79
- // Slider operates in two modes, either we have a single value slider or range value slider
80
- const isRange = isRangeGuard(value);
81
- const [firstValue, secondValue] = isRange ? value : [value, Infinity];
82
- // wrapper ref is used to catch clicks on a track in order to move the closes thumb to the position
83
- const wrapperRef = useRef(null);
84
- const firstRangeInputRef = useRef(null);
85
- const secondRangeInputRef = useRef(null);
86
- const markValues = useMemo(() => new Set(marks === null || marks === void 0 ? void 0 : marks.map(({ value }) => value)), [marks]);
87
- /**
88
- * We use this callback to update value either as number or [number, number] based on a rangeGuard
89
- * We also send an event that triggered the change
90
- */
91
- const updateValues = useCallback(([changedFirstValue, changedSecondValue], e) => {
92
- if (isRangeGuard(value, onChange)) {
93
- onChange([changedFirstValue !== null && changedFirstValue !== void 0 ? changedFirstValue : firstValue, changedSecondValue !== null && changedSecondValue !== void 0 ? changedSecondValue : secondValue], e);
94
- }
95
- if (changedFirstValue !== null && isSingleValueGuard(value, onChange)) {
96
- onChange(changedFirstValue, e);
97
- }
98
- }, [firstValue, secondValue, onChange, value]);
99
- useEffect(() => {
100
- if (firstRangeInputRef.current) {
101
- adjustMinMaxValue(firstValue, firstRangeInputRef.current, min, max);
102
- }
103
- if (isRange && secondRangeInputRef.current) {
104
- adjustMinMaxValue(secondValue, secondRangeInputRef.current, min, max);
105
- }
106
- }, [min, max, firstValue, secondValue, firstRangeInputRef, secondRangeInputRef, isRange]);
107
- /**
108
- * The following code makes sure that the relevant thumb is moved to the position once
109
- * user clicks on a track.
110
- *
111
- * 1. We always move the first thumb in a non-range mode.
112
- * 2. Otherwise, we move the thumb that is closer to a clicked point.
113
- * 3. We focus the thumb after it is clicked.
114
- */
115
- const clickOnTrackHandler = useCallback((e) => {
116
- var _a, _b;
117
- const { offsetX, target } = e;
118
- if (disabled) {
119
- return false;
120
- }
121
- if (!wrapperRef.current || wrapperRef.current !== target) {
122
- return;
123
- }
124
- const clickPercentage = offsetX / wrapperRef.current.offsetWidth;
125
- const resultStepSpot = Math.round((clickPercentage * max) / step) * step;
126
- if (!isRange || Math.abs(firstValue - resultStepSpot) < Math.abs(secondValue - resultStepSpot)) {
127
- updateValues([resultStepSpot, null], e);
128
- (_a = firstRangeInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
129
- }
130
- else {
131
- // otherwise, let's move the right one
132
- updateValues([null, resultStepSpot], e);
133
- (_b = secondRangeInputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
134
- }
135
- }, [wrapperRef, firstValue, secondValue, disabled, isRange, max, step, updateValues]);
136
- useEvent('click', clickOnTrackHandler);
137
- /**
138
- * The following callbacks react to native HTML events and update the values
139
- */
140
- const setFirstValueCallback = useCallback((e) => {
141
- const { target: { value }, } = e;
142
- const newValue = parseInt(value, 10);
143
- if (newValue <= secondValue) {
144
- updateValues([newValue, null], e);
145
- }
146
- }, [secondValue, updateValues]);
147
- const setSecondValueCallback = useCallback((e) => {
148
- const { target: { value }, } = e;
149
- const newValue = parseInt(value, 10);
150
- if (newValue >= firstValue) {
151
- updateValues([null, newValue], e);
152
- }
153
- }, [firstValue, updateValues]);
154
- const left = (firstValue - min) / (max - min);
155
- const secondValueLeft = (secondValue - min) / (max - min);
156
- const widthInRangeMode = ((secondValue - firstValue) / (max - min)) * 100;
157
- return (React.createElement("div", { className: cn(className, { [styles.withError]: 'error' in props }), "data-test": dataTest },
158
- !!label && React.createElement(Label, { id: id, label: label }),
159
- React.createElement("div", { className: cn(styles.wrapper, {
160
- [styles.disabled]: disabled,
161
- }) },
162
- React.createElement("div", { className: styles.innerWrapper },
163
- !hideValueIndicators && (React.createElement("div", { className: styles.valueIndicators },
164
- !markValues.has(firstValue) && (React.createElement("span", { style: {
165
- left: `${left * 100}%`,
166
- }, "data-test": "slider-first-value-indicator" }, formatCurrentValue(firstValue))),
167
- isRange && !markValues.has(secondValue) && (React.createElement("span", { style: {
168
- left: `${secondValueLeft * 100}%`,
169
- }, "data-test": "slider-second-value-indicator" }, formatCurrentValue(secondValue))))),
170
- React.createElement("div", { className: styles.inputWrapper, role: "group", ref: wrapperRef },
171
- firstValue !== undefined && (React.createElement("input", { id: id, ref: firstRangeInputRef, type: "range", value: firstValue, min: min, max: max, name: name, disabled: disabled, onChange: setFirstValueCallback, className: sliderClassName, step: step, "aria-labelledby": id, "aria-valuenow": firstValue, "aria-valuemin": min, "aria-valuemax": Math.min(max, secondValue), "aria-invalid": !!error, "aria-errormessage": error && errorId(id) })),
172
- isRange && secondValue !== undefined && (React.createElement("input", { ref: secondRangeInputRef, type: "range", value: secondValue, min: min, max: max, name: name, disabled: disabled, onChange: setSecondValueCallback, step: step, className: cn({
173
- sliderClassName,
174
- // The second thumb is above the first thumb in DOM.
175
- // There is a corner case where both thumbs are above each other at the end
176
- // of the range. In that case we need to pass pointer-events to the first thumb
177
- // because that is the only one that can be moved.
178
- [styles.atTheBorder]: max === secondValue && secondValue === firstValue,
179
- }), "aria-label": label, "aria-valuenow": secondValue, "aria-valuemin": Math.max(min, firstValue), "aria-valuemax": max, "aria-invalid": !!error, "aria-errormessage": error && errorId(id) })),
180
- React.createElement("div", { className: styles.fillPlaceholder },
181
- React.createElement("div", { className: styles.fill, "data-test": "fill",
182
- // Since there is no easy way hot to pass properties to SCSS, we need to use
183
- // inline styles.
184
- style: isRange
185
- ? {
186
- width: `${widthInRangeMode}%`,
187
- marginLeft: `${left * 100}%`,
188
- }
189
- : {
190
- width: `${left * 100}%`,
191
- } }),
192
- !!(marks === null || marks === void 0 ? void 0 : marks.length) && (React.createElement("ul", { className: styles.marks, "data-test": "marks" }, marks.map(({ value: markValue }) => {
193
- const { isActive, left } = getMarkMetadata(markValue, min, max, [firstValue, secondValue], isRange);
194
- return (React.createElement("li", { key: markValue, style: { left: `${left}%` }, className: cn({
195
- [styles.active]: isActive,
196
- }) }));
197
- })))),
198
- !!(marks === null || marks === void 0 ? void 0 : marks.length) && (React.createElement("ul", { className: styles.markDescriptions, "data-test": "mark-descriptions" }, marks.map(({ label, value: markValue }) => {
199
- const { left } = getMarkMetadata(markValue, min, max, [firstValue, secondValue], isRange);
200
- return (React.createElement("li", { key: markValue, style: { left: `${left}%` }, "data-test": `mark-description-${markValue}`, className: cn({ [styles.activeMarkDescription]: [firstValue, secondValue].includes(markValue) }) }, label));
201
- }))))),
202
- helperText && React.createElement(Help, { parentId: id, helperText: helperText, className: styles.helperText })),
203
- React.createElement(Error, { truncated: true, error: error, className: styles.errorContainer, inputId: id })));
56
+ function Slider(props) {
57
+ const {
58
+ value,
59
+ onChange,
60
+ name,
61
+ step = 1,
62
+ min,
63
+ max,
64
+ className,
65
+ sliderClassName,
66
+ error,
67
+ helperText,
68
+ marks,
69
+ label,
70
+ disabled,
71
+ formatCurrentValue = x => x.toString(),
72
+ hideValueIndicators,
73
+ 'data-test': dataTest
74
+ } = props;
75
+ /**
76
+ * Implementation notes
77
+ *
78
+ * - div - wrapper div that holds label + actual slider + error component
79
+ * - label - visible label
80
+ * - wrapper
81
+ * ----------------------------------------------------------------------
82
+ * | Inner wrapper | |
83
+ * | - markDescriptions | |
84
+ * | - input wrapper | Help component |
85
+ * | - current value indicator | |
86
+ * ----------------------------------------------------------------------
87
+ *
88
+ * where
89
+ * - input container contains
90
+ * - input or inputs in a range mode
91
+ * - fillPlaceholder - background of the possible slider area
92
+ * - fill - actual fill (active range)
93
+ * - marks
94
+ *
95
+ * - error - error component
96
+ */
97
+ const id = reactUid.useUID();
98
+ // Slider operates in two modes, either we have a single value slider or range value slider
99
+ const isRange = isRangeGuard(value);
100
+ const [firstValue, secondValue] = isRange ? value : [value, Infinity];
101
+ // wrapper ref is used to catch clicks on a track in order to move the closes thumb to the position
102
+ const wrapperRef = React.useRef(null);
103
+ const firstRangeInputRef = React.useRef(null);
104
+ const secondRangeInputRef = React.useRef(null);
105
+ const markValues = React.useMemo(() => new Set(marks === null || marks === void 0 ? void 0 : marks.map(({
106
+ value
107
+ }) => value)), [marks]);
108
+ /**
109
+ * We use this callback to update value either as number or [number, number] based on a rangeGuard
110
+ * We also send an event that triggered the change
111
+ */
112
+ const updateValues = React.useCallback(([changedFirstValue, changedSecondValue], e) => {
113
+ if (isRangeGuard(value)) {
114
+ onChange([changedFirstValue !== null && changedFirstValue !== void 0 ? changedFirstValue : firstValue, changedSecondValue !== null && changedSecondValue !== void 0 ? changedSecondValue : secondValue], e);
115
+ }
116
+ if (changedFirstValue !== null && isSingleValueGuard(value)) {
117
+ onChange(changedFirstValue, e);
118
+ }
119
+ }, [firstValue, secondValue, onChange, value]);
120
+ React.useEffect(() => {
121
+ if (firstRangeInputRef.current) {
122
+ adjustMinMaxValue(firstValue, firstRangeInputRef.current, min, max);
123
+ }
124
+ if (isRange && secondRangeInputRef.current) {
125
+ adjustMinMaxValue(secondValue, secondRangeInputRef.current, min, max);
126
+ }
127
+ }, [min, max, firstValue, secondValue, firstRangeInputRef, secondRangeInputRef, isRange]);
128
+ /**
129
+ * The following code makes sure that the relevant thumb is moved to the position once
130
+ * user clicks on a track.
131
+ *
132
+ * 1. We always move the first thumb in a non-range mode.
133
+ * 2. Otherwise, we move the thumb that is closer to a clicked point.
134
+ * 3. We focus the thumb after it is clicked.
135
+ */
136
+ const clickOnTrackHandler = React.useCallback(e => {
137
+ var _a, _b;
138
+ const {
139
+ offsetX,
140
+ target
141
+ } = e;
142
+ if (disabled) {
143
+ return false;
144
+ }
145
+ if (!wrapperRef.current || wrapperRef.current !== target) {
146
+ return;
147
+ }
148
+ const clickPercentage = offsetX / wrapperRef.current.offsetWidth;
149
+ const resultStepSpot = Math.round(clickPercentage * max / step) * step;
150
+ if (!isRange || Math.abs(firstValue - resultStepSpot) < Math.abs(secondValue - resultStepSpot)) {
151
+ updateValues([resultStepSpot, null], e);
152
+ (_a = firstRangeInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
153
+ } else {
154
+ // otherwise, let's move the right one
155
+ updateValues([null, resultStepSpot], e);
156
+ (_b = secondRangeInputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
157
+ }
158
+ }, [wrapperRef, firstValue, secondValue, disabled, isRange, max, step, updateValues]);
159
+ useEvent('click', clickOnTrackHandler);
160
+ /**
161
+ * The following callbacks react to native HTML events and update the values
162
+ */
163
+ const setFirstValueCallback = React.useCallback(e => {
164
+ const {
165
+ target: {
166
+ value
167
+ }
168
+ } = e;
169
+ const newValue = parseInt(value, 10);
170
+ if (newValue <= secondValue) {
171
+ updateValues([newValue, null], e);
172
+ }
173
+ }, [secondValue, updateValues]);
174
+ const setSecondValueCallback = React.useCallback(e => {
175
+ const {
176
+ target: {
177
+ value
178
+ }
179
+ } = e;
180
+ const newValue = parseInt(value, 10);
181
+ if (newValue >= firstValue) {
182
+ updateValues([null, newValue], e);
183
+ }
184
+ }, [firstValue, updateValues]);
185
+ const left = (firstValue - min) / (max - min);
186
+ const secondValueLeft = (secondValue - min) / (max - min);
187
+ const widthInRangeMode = (secondValue - firstValue) / (max - min) * 100;
188
+ return /*#__PURE__*/React.createElement("div", {
189
+ className: cn(className, {
190
+ [Slider_module.default.withError]: 'error' in props
191
+ }),
192
+ "data-test": dataTest
193
+ }, !!label && /*#__PURE__*/React.createElement(components_Label.Label, {
194
+ id: id,
195
+ label: label
196
+ }), /*#__PURE__*/React.createElement("div", {
197
+ className: cn(Slider_module.default.wrapper, {
198
+ [Slider_module.default.disabled]: disabled
199
+ })
200
+ }, /*#__PURE__*/React.createElement("div", {
201
+ className: Slider_module.default.innerWrapper
202
+ }, !hideValueIndicators && (/*#__PURE__*/React.createElement("div", {
203
+ className: Slider_module.default.valueIndicators
204
+ }, !markValues.has(firstValue) && (/*#__PURE__*/React.createElement("span", {
205
+ style: {
206
+ left: `${left * 100}%`
207
+ },
208
+ "data-test": "slider-first-value-indicator"
209
+ }, formatCurrentValue(firstValue))), isRange && !markValues.has(secondValue) && (/*#__PURE__*/React.createElement("span", {
210
+ style: {
211
+ left: `${secondValueLeft * 100}%`
212
+ },
213
+ "data-test": "slider-second-value-indicator"
214
+ }, formatCurrentValue(secondValue))))), /*#__PURE__*/React.createElement("div", {
215
+ className: Slider_module.default.inputWrapper,
216
+ role: "group",
217
+ ref: wrapperRef
218
+ }, firstValue !== undefined && (/*#__PURE__*/React.createElement("input", {
219
+ id: id,
220
+ ref: firstRangeInputRef,
221
+ type: "range",
222
+ value: firstValue,
223
+ min: min,
224
+ max: max,
225
+ name: name,
226
+ disabled: disabled,
227
+ onChange: setFirstValueCallback,
228
+ className: sliderClassName,
229
+ step: step,
230
+ "aria-labelledby": id,
231
+ "aria-valuenow": firstValue,
232
+ "aria-valuemin": min,
233
+ "aria-valuemax": Math.min(max, secondValue),
234
+ "aria-invalid": !!error,
235
+ "aria-errormessage": error && components_Error.errorId(id)
236
+ })), isRange && secondValue !== undefined && (/*#__PURE__*/React.createElement("input", {
237
+ ref: secondRangeInputRef,
238
+ type: "range",
239
+ value: secondValue,
240
+ min: min,
241
+ max: max,
242
+ name: name,
243
+ disabled: disabled,
244
+ onChange: setSecondValueCallback,
245
+ step: step,
246
+ className: cn({
247
+ sliderClassName,
248
+ // The second thumb is above the first thumb in DOM.
249
+ // There is a corner case where both thumbs are above each other at the end
250
+ // of the range. In that case we need to pass pointer-events to the first thumb
251
+ // because that is the only one that can be moved.
252
+ [Slider_module.default.atTheBorder]: max === secondValue && secondValue === firstValue
253
+ }),
254
+ "aria-label": label,
255
+ "aria-valuenow": secondValue,
256
+ "aria-valuemin": Math.max(min, firstValue),
257
+ "aria-valuemax": max,
258
+ "aria-invalid": !!error,
259
+ "aria-errormessage": error && components_Error.errorId(id)
260
+ })), /*#__PURE__*/React.createElement("div", {
261
+ className: Slider_module.default.fillPlaceholder
262
+ }, /*#__PURE__*/React.createElement("div", {
263
+ className: Slider_module.default.fill,
264
+ "data-test": "fill",
265
+ // Since there is no easy way hot to pass properties to SCSS, we need to use
266
+ // inline styles.
267
+ style: isRange ? {
268
+ width: `${widthInRangeMode}%`,
269
+ marginLeft: `${left * 100}%`
270
+ } : {
271
+ width: `${left * 100}%`
272
+ }
273
+ }), !!(marks === null || marks === void 0 ? void 0 : marks.length) && (/*#__PURE__*/React.createElement("ul", {
274
+ className: Slider_module.default.marks,
275
+ "data-test": "marks"
276
+ }, marks.map(({
277
+ value: markValue
278
+ }) => {
279
+ const {
280
+ isActive,
281
+ left
282
+ } = getMarkMetadata(markValue, min, max, [firstValue, secondValue], isRange);
283
+ return /*#__PURE__*/React.createElement("li", {
284
+ key: markValue,
285
+ style: {
286
+ left: `${left}%`
287
+ },
288
+ className: cn({
289
+ [Slider_module.default.active]: isActive
290
+ })
291
+ });
292
+ })))), !!(marks === null || marks === void 0 ? void 0 : marks.length) && (/*#__PURE__*/React.createElement("ul", {
293
+ className: Slider_module.default.markDescriptions,
294
+ "data-test": "mark-descriptions"
295
+ }, marks.map(({
296
+ label,
297
+ value: markValue
298
+ }) => {
299
+ const {
300
+ left
301
+ } = getMarkMetadata(markValue, min, max, [firstValue, secondValue], isRange);
302
+ return /*#__PURE__*/React.createElement("li", {
303
+ key: markValue,
304
+ style: {
305
+ left: `${left}%`
306
+ },
307
+ "data-test": `mark-description-${markValue}`,
308
+ className: cn({
309
+ [Slider_module.default.activeMarkDescription]: [firstValue, secondValue].includes(markValue)
310
+ })
311
+ }, label);
312
+ }))))), helperText && /*#__PURE__*/React.createElement(components_Help.Help, {
313
+ parentId: id,
314
+ helperText: helperText,
315
+ className: Slider_module.default.helperText
316
+ })), /*#__PURE__*/React.createElement(components_Error.Error, {
317
+ truncated: true,
318
+ error: error,
319
+ className: Slider_module.default.errorContainer,
320
+ inputId: id
321
+ }));
204
322
  }
205
- //# sourceMappingURL=Slider.js.map
323
+
324
+ exports.Slider = Slider;
325
+ exports.getMarkMetadata = getMarkMetadata;
326
+ //# sourceMappingURL=Slider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../src/components/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA0B,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAA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I,GAAG,EAAE,EAC3B,SAAS,EAAE,EAAE,CAAC;oCACZ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ;iCAC1B,CAAC,GACF,CACH,CAAA;wBACH,CAAC,CAAC,CACC,CACN,CACG;oBACL,CAAC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAA,IAAI,CAClB,4BAAI,SAAS,EAAE,MAAM,CAAC,gBAAgB,eAAY,mBAAmB,IAClE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;wBACzC,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,OAAO,CAAC,CAAA;wBACzF,OAAO,CACL,4BACE,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,EAAE,eAChB,oBAAoB,SAAS,EAAE,EAC1C,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAE/F,KAAK,CACH,CACN,CAAA;oBACH,CAAC,CAAC,CACC,CACN,CACG,CACF;YACL,UAAU,IAAI,oBAAC,IAAI,IAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,GAAI,CACvF;QACN,oBAAC,KAAK,IAAC,SAAS,QAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,cAAc,EAAE,OAAO,EAAE,EAAE,GAAI,CAC5E,CACP,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"Slider.js","sources":["../../src/components/Slider.tsx"],"sourcesContent":[null],"names":["isRangeGuard","value","onChange","Array","isArray","isSingleValueGuard","adjustMinMaxValue","inputEl","min","max","triggerNativeInputChange","toString","getMarkMetadata","markValue","firstValue","secondValue","isRange","left","isActive","Slider","props","name","step","className","sliderClassName","error","helperText","marks","label","disabled","formatCurrentValue","x","hideValueIndicators","dataTest","id","useUID","Infinity","wrapperRef","useRef","firstRangeInputRef","secondRangeInputRef","markValues","useMemo","Set","map","updateValues","useCallback","changedFirstValue","changedSecondValue","e","useEffect","current","clickOnTrackHandler","offsetX","target","clickPercentage","offsetWidth","resultStepSpot","Math","round","abs","_a","focus","_b","useEvent","setFirstValueCallback","newValue","parseInt","setSecondValueCallback","secondValueLeft","widthInRangeMode","React","cn","styles","withError","createElement","Label","wrapper","innerWrapper","valueIndicators","has","style","inputWrapper","role","ref","undefined","type","errorId","atTheBorder","fillPlaceholder","fill","width","marginLeft","length","key","active","markDescriptions","activeMarkDescription","includes","Help","parentId","Error","truncated","errorContainer","inputId"],"mappings":";;;;;;;;;;;;AAqDA,SAASA,YAAYA,CAACC,KAAkB,EAAEC,QAAmD,EAAA;AAC3F,EAAA,OAAOC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC;AAC7B;AAEA,SAASI,kBAAkBA,CAACJ,KAAkB,EAAEC,QAAmD,EAAA;AACjG,EAAA,OAAO,CAACC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC;AAC9B;AAEA,SAASK,iBAAiBA,CAACL,KAAa,EAAEM,OAAyB,EAAEC,GAAW,EAAEC,GAAW,EAAA;EAC3F,IAAIR,KAAK,GAAGO,GAAG,EAAE;IACfE,sCAAwB,CAACF,GAAG,CAACG,QAAQ,EAAE,EAAEJ,OAAO,CAAC;AACnD,EAAA,CAAC,MAAM,IAAIN,KAAK,GAAGQ,GAAG,EAAE;IACtBC,sCAAwB,CAACD,GAAG,CAACE,QAAQ,EAAE,EAAEJ,OAAO,CAAC;AACnD,EAAA;AACF;AAEA;;;;;;;;;;;;AAYG;AACG,SAAUK,eAAeA,CAC7BC,SAAiB,E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WAAW,CAAC,CAACmF,QAAQ,CAACrF,SAAS;OAAG;KAAC,EAE/Fe,KAAK,CACH;AAET,EAAA,CAAC,CAAC,CACC,CACN,CACG,CACF,EACLF,UAAU,iBAAI6C,KAAA,CAAAI,aAAA,CAACwB,oBAAI;AAACC,IAAAA,QAAQ,EAAElE,EAAE;AAAER,IAAAA,UAAU,EAAEA,UAAU;IAAEH,SAAS,EAAEkD,qBAAM,CAAC/C;IAAc,CACvF,eACN6C,KAAA,CAAAI,aAAA,CAAC0B,sBAAK;AAACC,IAAAA,SAAS,EAAA,IAAA;AAAC7E,IAAAA,KAAK,EAAEA,KAAK;IAAEF,SAAS,EAAEkD,qBAAM,CAAC8B,cAAc;AAAEC,IAAAA,OAAO,EAAEtE;AAAE,GAAA,CAAI,CAC5E;AAEV;;;;;"}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var styles = {"markDescriptions":"Slider-module__markDescriptions___lp3hy","activeMarkDescription":"Slider-module__activeMarkDescription___r64xf","valueIndicators":"Slider-module__valueIndicators___J8Pms","withError":"Slider-module__withError___2YLUk","errorContainer":"Slider-module__errorContainer___t5unP","wrapper":"Slider-module__wrapper___70sRv","innerWrapper":"Slider-module__innerWrapper___IyjvR","inputWrapper":"Slider-module__inputWrapper___UgqGH","atTheBorder":"Slider-module__atTheBorder___P8hb5","fillPlaceholder":"Slider-module__fillPlaceholder___MuPOD","fill":"Slider-module__fill___ZYEsW","marks":"Slider-module__marks___6FZCT","active":"Slider-module__active___CTqQO","helperText":"Slider-module__helperText___1w4o0","disabled":"Slider-module__disabled___jZRWO"};
6
+
7
+ exports.default = styles;
8
+ //# sourceMappingURL=Slider.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Slider.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,14 +1,31 @@
1
- import React from 'react';
2
- import { useField } from 'formik';
3
- import { useMemo } from 'react';
4
- import { Slider } from './Slider';
5
- import { formikTouchAndUpdate, getFieldError } from '../utils/formik';
6
- export const SliderFormik = ({ name, validate, ...props }) => {
7
- const [field, meta, { setValue, setTouched }] = useField({
8
- name,
9
- validate,
10
- });
11
- const onChange = useMemo(() => formikTouchAndUpdate(setValue, setTouched), [setValue, setTouched]);
12
- return React.createElement(Slider, { ...props, name: name, value: field.value, onChange: onChange, error: getFieldError(meta) });
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var formik = require('formik');
5
+ var components_Slider = require('./Slider.js');
6
+ var utils_formik = require('../utils/formik.js');
7
+
8
+ const SliderFormik = ({
9
+ name,
10
+ validate,
11
+ ...props
12
+ }) => {
13
+ const [field, meta, {
14
+ setValue,
15
+ setTouched
16
+ }] = formik.useField({
17
+ name,
18
+ validate
19
+ });
20
+ const onChange = React.useMemo(() => utils_formik.formikTouchAndUpdate(setValue, setTouched), [setValue, setTouched]);
21
+ return /*#__PURE__*/React.createElement(components_Slider.Slider, {
22
+ ...props,
23
+ name: name,
24
+ value: field.value,
25
+ onChange: onChange,
26
+ error: utils_formik.getFieldError(meta)
27
+ });
13
28
  };
14
- //# sourceMappingURL=SliderFormik.js.map
29
+
30
+ exports.SliderFormik = SliderFormik;
31
+ //# sourceMappingURL=SliderFormik.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SliderFormik.js","sourceRoot":"","sources":["../../src/components/SliderFormik.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAkB,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,MAAM,EAAiC,MAAM,UAAU,CAAA;AAChE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AASrE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAmB,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAwB,EAAgB,EAAE;IACjH,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,GAAG,QAAQ,CAA4B;QAClF,IAAI;QACJ,QAAQ;KACT,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAA;IAElG,OAAO,oBAAC,MAAM,OAAK,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,GAAI,CAAA;AAC9G,CAAC,CAAA"}
1
+ {"version":3,"file":"SliderFormik.js","sources":["../../src/components/SliderFormik.tsx"],"sourcesContent":[null],"names":["SliderFormik","name","validate","props","field","meta","setValue","setTouched","useField","onChange","useMemo","formikTouchAndUpdate","React","createElement","Slider","value","error","getFieldError"],"mappings":";;;;;;;AAcO,MAAMA,YAAY,GAAGA,CAAmB;EAAEC,IAAI;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAwB,KAAkB;AACjH,EAAA,MAAM,CAACC,KAAK,EAAEC,IAAI,EAAE;IAAEC,QAAQ;AAAEC,IAAAA;GAAY,CAAC,GAAGC,eAAQ,CAA4B;IAClFP,IAAI;AACJC,IAAAA;AACD,GAAA,CAAC;AAEF,EAAA,MAAMO,QAAQ,GAAGC,aAAO,CAAC,MAAMC,iCAAoB,CAACL,QAAQ,EAAEC,UAAU,CAAC,EAAE,CAACD,QAAQ,EAAEC,UAAU,CAAC,CAAC;AAElG,EAAA,oBAAOK,KAAA,CAAAC,aAAA,CAACC,wBAAM,EAAA;AAAA,IAAA,GAAKX,KAAK;AAAEF,IAAAA,IAAI,EAAEA,IAAI;IAAEc,KAAK,EAAEX,KAAK,CAACW,KAAK;AAAEN,IAAAA,QAAQ,EAAEA,QAAQ;IAAEO,KAAK,EAAEC,0BAAa,CAACZ,IAAI;AAAC,GAAA,CAAI;AAC9G;;;;"}