@plesk/ui-library 3.31.0 → 3.31.2

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 (614) hide show
  1. package/cjs/components/Action/Action.js +18 -34
  2. package/cjs/components/Action/index.js +0 -2
  3. package/cjs/components/Alert/Alert.js +18 -22
  4. package/cjs/components/Alert/Alert.stories.js +1 -8
  5. package/cjs/components/Alert/index.js +0 -2
  6. package/cjs/components/AutoClosable/AutoClosable.js +3 -23
  7. package/cjs/components/AutoClosable/index.js +0 -2
  8. package/cjs/components/AuxiliaryActions/AuxiliaryActions.js +16 -22
  9. package/cjs/components/AuxiliaryActions/index.js +0 -2
  10. package/cjs/components/Badge/Badge.js +10 -25
  11. package/cjs/components/Badge/index.js +0 -2
  12. package/cjs/components/Breadcrumbs/Breadcrumbs.js +21 -29
  13. package/cjs/components/Breadcrumbs/index.js +0 -2
  14. package/cjs/components/Button/Button.js +39 -86
  15. package/cjs/components/Button/Button.stories.js +1 -14
  16. package/cjs/components/Button/index.js +0 -2
  17. package/cjs/components/ButtonGroup/ButtonGroup.js +13 -17
  18. package/cjs/components/ButtonGroup/index.js +0 -2
  19. package/cjs/components/Card/Card.js +4 -77
  20. package/cjs/components/Card/CardButton.js +9 -14
  21. package/cjs/components/Card/PreviewPanel.js +21 -52
  22. package/cjs/components/Card/helpers.js +6 -6
  23. package/cjs/components/Card/index.js +0 -3
  24. package/cjs/components/CardList/CardList.js +44 -100
  25. package/cjs/components/CardList/CardListToolbar.js +17 -51
  26. package/cjs/components/CardList/index.js +0 -2
  27. package/cjs/components/Carousel/Carousel.js +41 -74
  28. package/cjs/components/Carousel/index.js +0 -2
  29. package/cjs/components/Checkbox/Checkbox.js +16 -26
  30. package/cjs/components/Checkbox/index.js +0 -2
  31. package/cjs/components/ClosingConfirmation/index.js +0 -2
  32. package/cjs/components/ClosingConfirmation/useClosingConfirmation.js +6 -23
  33. package/cjs/components/CodeEditor/CodeEditor.js +23 -62
  34. package/cjs/components/CodeEditor/CodeMirror.js +1 -12
  35. package/cjs/components/CodeEditor/index.js +0 -2
  36. package/cjs/components/Columns/Column.js +15 -24
  37. package/cjs/components/Columns/Columns.js +19 -31
  38. package/cjs/components/Columns/index.js +0 -3
  39. package/cjs/components/ComboBox/ComboBox.js +16 -59
  40. package/cjs/components/ComboBox/ComboBoxOption.js +1 -7
  41. package/cjs/components/ComboBox/index.js +0 -3
  42. package/cjs/components/ComboBoxDropdown/ComboBoxDropdown.js +22 -50
  43. package/cjs/components/ComboBoxDropdown/index.js +0 -3
  44. package/cjs/components/ConsoleOutput/ConsoleOutput.js +3 -22
  45. package/cjs/components/ConsoleOutput/index.js +0 -2
  46. package/cjs/components/ContentLoader/ContentLoader.js +16 -31
  47. package/cjs/components/ContentLoader/IconsLoader.js +15 -32
  48. package/cjs/components/ContentLoader/index.js +0 -2
  49. package/cjs/components/Cuttable/Cuttable.js +23 -35
  50. package/cjs/components/Cuttable/Cuttable.stories.js +1 -9
  51. package/cjs/components/Cuttable/index.js +0 -2
  52. package/cjs/components/Dialog/Dialog.js +45 -90
  53. package/cjs/components/Dialog/Dialog.stories.js +3 -13
  54. package/cjs/components/Dialog/index.js +0 -2
  55. package/cjs/components/DistractionFreeModeContext/DistractionFreeModeContext.js +1 -2
  56. package/cjs/components/DistractionFreeModeContext/index.js +0 -2
  57. package/cjs/components/Drawer/Drawer.js +77 -112
  58. package/cjs/components/Drawer/Drawer.stories.js +7 -19
  59. package/cjs/components/Drawer/DrawerProgress.js +3 -33
  60. package/cjs/components/Drawer/Header.js +5 -26
  61. package/cjs/components/Drawer/ScrollDirection.js +3 -10
  62. package/cjs/components/Drawer/index.js +0 -2
  63. package/cjs/components/Dropdown/Dropdown.js +26 -65
  64. package/cjs/components/Dropdown/index.js +0 -2
  65. package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessage.js +26 -31
  66. package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageActions.js +11 -14
  67. package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageDescription.js +11 -14
  68. package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageSeparator.js +9 -11
  69. package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageTitle.js +12 -16
  70. package/cjs/components/ExtendedStatusMessage/index.js +0 -6
  71. package/cjs/components/Figure/Figure.js +18 -27
  72. package/cjs/components/Figure/index.js +0 -2
  73. package/cjs/components/FocusTrap/FocusTrap.js +9 -39
  74. package/cjs/components/FocusTrap/index.js +0 -2
  75. package/cjs/components/Form/DisabledContext.js +1 -2
  76. package/cjs/components/Form/Form.js +68 -111
  77. package/cjs/components/Form/Form.stories.js +1 -8
  78. package/cjs/components/Form/FormContext.js +1 -2
  79. package/cjs/components/Form/ScrollableElementFormContext.js +1 -2
  80. package/cjs/components/Form/index.js +0 -3
  81. package/cjs/components/Form/utils.js +7 -19
  82. package/cjs/components/FormField/FormField.js +50 -113
  83. package/cjs/components/FormField/index.js +0 -2
  84. package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.js +44 -58
  85. package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.stories.js +3 -9
  86. package/cjs/components/FormFieldCheckbox/index.js +0 -2
  87. package/cjs/components/FormFieldPassword/FormFieldPassword.js +23 -42
  88. package/cjs/components/FormFieldPassword/PasswordMeter.js +13 -24
  89. package/cjs/components/FormFieldPassword/estimatePassword.js +3 -42
  90. package/cjs/components/FormFieldPassword/generatePassword.js +1 -2
  91. package/cjs/components/FormFieldPassword/index.js +0 -3
  92. package/cjs/components/FormFieldRadioButtons/FormFieldRadioButtons.js +49 -69
  93. package/cjs/components/FormFieldRadioButtons/index.js +0 -2
  94. package/cjs/components/FormFieldSelect/FormFieldSelect.js +36 -39
  95. package/cjs/components/FormFieldSelect/index.js +0 -2
  96. package/cjs/components/FormFieldText/FormFieldText.js +33 -56
  97. package/cjs/components/FormFieldText/index.js +0 -2
  98. package/cjs/components/Grid/Grid.js +16 -49
  99. package/cjs/components/Grid/index.js +0 -2
  100. package/cjs/components/GridCol/GridCol.js +13 -26
  101. package/cjs/components/GridCol/index.js +0 -2
  102. package/cjs/components/Heading/Heading.js +10 -24
  103. package/cjs/components/Heading/index.js +0 -2
  104. package/cjs/components/Hint/Hint.js +8 -14
  105. package/cjs/components/Hint/index.js +0 -2
  106. package/cjs/components/Icon/Icon.js +18 -34
  107. package/cjs/components/Icon/Icon.stories.js +1 -8
  108. package/cjs/components/Icon/constants.js +3 -3
  109. package/cjs/components/Icon/images/symbols.svg +59 -1
  110. package/cjs/components/Icon/index.js +0 -4
  111. package/cjs/components/Icon/oldIconNames.js +1 -0
  112. package/cjs/components/Icon/utils.js +5 -16
  113. package/cjs/components/InPlaceEdit/InPlaceEdit.js +11 -29
  114. package/cjs/components/InPlaceEdit/index.js +0 -2
  115. package/cjs/components/Input/Input.js +13 -19
  116. package/cjs/components/Input/index.js +0 -2
  117. package/cjs/components/InputFile/InputFile.js +14 -33
  118. package/cjs/components/InputFile/index.js +0 -2
  119. package/cjs/components/InputNumber/InputNumber.js +20 -57
  120. package/cjs/components/InputNumber/index.js +0 -2
  121. package/cjs/components/Item/Item.js +2 -42
  122. package/cjs/components/Item/index.js +0 -2
  123. package/cjs/components/ItemLink/ItemLink.js +8 -16
  124. package/cjs/components/ItemLink/ItemLink.stories.js +1 -5
  125. package/cjs/components/ItemLink/index.js +0 -2
  126. package/cjs/components/ItemList/ItemList.js +29 -72
  127. package/cjs/components/ItemList/ItemList.stories.js +11 -16
  128. package/cjs/components/ItemList/index.js +0 -2
  129. package/cjs/components/Label/Label.js +12 -16
  130. package/cjs/components/Label/index.js +0 -2
  131. package/cjs/components/Layer/Layer.js +12 -23
  132. package/cjs/components/Layer/index.js +0 -4
  133. package/cjs/components/Layout/Layout.js +66 -111
  134. package/cjs/components/Layout/index.js +0 -2
  135. package/cjs/components/Link/Link.js +17 -31
  136. package/cjs/components/Link/index.js +0 -2
  137. package/cjs/components/List/List.js +217 -377
  138. package/cjs/components/List/List.stories.js +18 -24
  139. package/cjs/components/List/ListAction.js +8 -17
  140. package/cjs/components/List/ListActions.js +12 -31
  141. package/cjs/components/List/ListActionsDivider.js +0 -5
  142. package/cjs/components/List/ListEmptyView.js +23 -39
  143. package/cjs/components/List/ListOperation.js +14 -42
  144. package/cjs/components/List/ListOperationContext.js +1 -2
  145. package/cjs/components/List/example-data/domains.js +1 -12
  146. package/cjs/components/List/images/default.png +0 -0
  147. package/cjs/components/List/images/filtered.png +0 -0
  148. package/cjs/components/List/index.js +0 -7
  149. package/cjs/components/LocaleProvider/LocaleProvider.js +10 -34
  150. package/cjs/components/LocaleProvider/index.js +0 -4
  151. package/cjs/components/Markdown/Markdown.js +18 -29
  152. package/cjs/components/Markdown/index.js +0 -2
  153. package/cjs/components/Media/Media.js +15 -41
  154. package/cjs/components/Media/MediaSection.js +11 -18
  155. package/cjs/components/Media/index.js +0 -3
  156. package/cjs/components/Menu/Menu.js +14 -49
  157. package/cjs/components/Menu/Menu.stories.js +1 -9
  158. package/cjs/components/Menu/MenuBaseItem.js +22 -35
  159. package/cjs/components/Menu/MenuDivider.js +11 -17
  160. package/cjs/components/Menu/MenuHeader.js +12 -20
  161. package/cjs/components/Menu/MenuItem.js +13 -35
  162. package/cjs/components/Menu/MenuSelectableItem.js +15 -24
  163. package/cjs/components/Menu/index.js +0 -7
  164. package/cjs/components/OnDarkContext/OnDarkContext.js +1 -2
  165. package/cjs/components/OnDarkContext/index.js +0 -2
  166. package/cjs/components/Overlay/Backdrop.js +12 -18
  167. package/cjs/components/Overlay/Focuser.js +1 -24
  168. package/cjs/components/Overlay/Overlay.js +22 -71
  169. package/cjs/components/Overlay/index.js +0 -2
  170. package/cjs/components/PageHeader/PageHeader.js +35 -43
  171. package/cjs/components/PageHeader/index.js +0 -2
  172. package/cjs/components/Pagination/Pagination.js +18 -38
  173. package/cjs/components/Pagination/index.js +0 -3
  174. package/cjs/components/Panel/Panel.js +10 -29
  175. package/cjs/components/Panel/index.js +0 -2
  176. package/cjs/components/Paragraph/Paragraph.js +12 -16
  177. package/cjs/components/Paragraph/index.js +0 -2
  178. package/cjs/components/Plaintext/Plaintext.js +10 -16
  179. package/cjs/components/Plaintext/index.js +0 -2
  180. package/cjs/components/Popover/Popover.js +18 -85
  181. package/cjs/components/Popover/Popover.stories.js +5 -14
  182. package/cjs/components/Popover/index.js +0 -2
  183. package/cjs/components/Popper/Popper.js +14 -52
  184. package/cjs/components/Popper/index.js +0 -2
  185. package/cjs/components/Progress/Progress.js +6 -32
  186. package/cjs/components/Progress/index.js +0 -2
  187. package/cjs/components/ProgressBar/ProgressBar.js +21 -28
  188. package/cjs/components/ProgressBar/ProgressIndicator.js +18 -21
  189. package/cjs/components/ProgressBar/index.js +0 -2
  190. package/cjs/components/ProgressDialog/ProgressDialog.js +6 -45
  191. package/cjs/components/ProgressDialog/index.js +0 -2
  192. package/cjs/components/ProgressDialogStep/ProgressDialogStep.js +0 -6
  193. package/cjs/components/ProgressDialogStep/index.js +0 -2
  194. package/cjs/components/ProgressStep/ProgressStep.js +14 -43
  195. package/cjs/components/ProgressStep/index.js +0 -4
  196. package/cjs/components/Radio/Radio.js +15 -21
  197. package/cjs/components/Radio/index.js +0 -2
  198. package/cjs/components/Rating/Rating.js +24 -34
  199. package/cjs/components/Rating/index.js +0 -2
  200. package/cjs/components/ResponsiveContext/ResponsiveContext.js +1 -2
  201. package/cjs/components/ResponsiveContext/index.js +0 -2
  202. package/cjs/components/Section/Section.js +73 -112
  203. package/cjs/components/Section/SectionItem.js +10 -25
  204. package/cjs/components/Section/index.js +0 -3
  205. package/cjs/components/SegmentedControl/SegmentedControl.js +37 -89
  206. package/cjs/components/SegmentedControl/index.js +0 -2
  207. package/cjs/components/Select/MultiValue.js +8 -16
  208. package/cjs/components/Select/Select.js +24 -88
  209. package/cjs/components/Select/Select.stories.js +1 -9
  210. package/cjs/components/Select/SelectControl.js +39 -68
  211. package/cjs/components/Select/SelectOption.js +1 -7
  212. package/cjs/components/Select/SelectOptionGroup.js +0 -5
  213. package/cjs/components/Select/index.js +0 -4
  214. package/cjs/components/Skeleton/Skeleton.js +13 -19
  215. package/cjs/components/Skeleton/Skeleton.stories.js +1 -7
  216. package/cjs/components/Skeleton/SkeletonTabs.js +16 -21
  217. package/cjs/components/Skeleton/SkeletonTabs.stories.js +1 -5
  218. package/cjs/components/Skeleton/SkeletonText.js +21 -25
  219. package/cjs/components/Skeleton/SkeletonText.stories.js +1 -9
  220. package/cjs/components/Skeleton/index.js +0 -4
  221. package/cjs/components/Spinner/Spinner.js +21 -25
  222. package/cjs/components/Spinner/index.js +0 -2
  223. package/cjs/components/SplitButton/SplitButton.js +13 -40
  224. package/cjs/components/SplitButton/index.js +0 -2
  225. package/cjs/components/Spot/Spot.js +10 -30
  226. package/cjs/components/Spot/SpotPopup.js +22 -34
  227. package/cjs/components/Spot/SpotPulsar.js +9 -21
  228. package/cjs/components/Spot/index.js +0 -2
  229. package/cjs/components/Squeezer/Squeezer.js +15 -28
  230. package/cjs/components/Squeezer/index.js +0 -2
  231. package/cjs/components/Status/Status.js +17 -31
  232. package/cjs/components/Status/Status.stories.js +1 -5
  233. package/cjs/components/Status/index.js +0 -2
  234. package/cjs/components/StatusMessage/StatusMessage.js +16 -23
  235. package/cjs/components/StatusMessage/index.js +0 -2
  236. package/cjs/components/Subnav/Subnav.js +23 -50
  237. package/cjs/components/Subnav/index.js +0 -4
  238. package/cjs/components/Switch/Switch.js +2 -29
  239. package/cjs/components/Switch/index.js +0 -2
  240. package/cjs/components/SwitchesPanel/SwitchesPanel.js +15 -25
  241. package/cjs/components/SwitchesPanel/index.js +0 -2
  242. package/cjs/components/SwitchesPanelItem/SwitchesPanelItem.js +2 -27
  243. package/cjs/components/SwitchesPanelItem/index.js +0 -2
  244. package/cjs/components/Tabs/SearchBar.js +6 -83
  245. package/cjs/components/Tabs/Tab.js +6 -15
  246. package/cjs/components/Tabs/Tabs.js +40 -123
  247. package/cjs/components/Tabs/Tabs.stories.js +1 -6
  248. package/cjs/components/Tabs/index.js +0 -4
  249. package/cjs/components/Text/Text.js +15 -25
  250. package/cjs/components/Text/index.js +0 -2
  251. package/cjs/components/TextArea/TextArea.js +8 -31
  252. package/cjs/components/TextArea/calculateNodeHeight.js +14 -21
  253. package/cjs/components/TextArea/index.js +0 -2
  254. package/cjs/components/Toast/Toast.js +3 -27
  255. package/cjs/components/Toast/index.js +0 -4
  256. package/cjs/components/Toaster/Toaster.js +45 -61
  257. package/cjs/components/Toaster/index.js +0 -2
  258. package/cjs/components/Toolbar/RegistryContext.js +3 -14
  259. package/cjs/components/Toolbar/Toolbar.js +16 -31
  260. package/cjs/components/Toolbar/ToolbarExpander.js +7 -18
  261. package/cjs/components/Toolbar/ToolbarGroup.js +5 -37
  262. package/cjs/components/Toolbar/ToolbarItem.js +3 -25
  263. package/cjs/components/Toolbar/ToolbarMenu.js +7 -34
  264. package/cjs/components/Toolbar/index.js +0 -4
  265. package/cjs/components/Tooltip/Tooltip.js +28 -49
  266. package/cjs/components/Tooltip/index.js +0 -2
  267. package/cjs/components/Tour/Tour.js +11 -19
  268. package/cjs/components/Tour/index.js +0 -2
  269. package/cjs/components/Translate/Translate.js +14 -37
  270. package/cjs/components/Translate/index.js +0 -3
  271. package/cjs/components/VerticalContext/VerticalContext.js +1 -2
  272. package/cjs/components/VerticalContext/index.js +0 -3
  273. package/cjs/components/index.js +0 -104
  274. package/cjs/components/intentIconMap.js +1 -0
  275. package/cjs/components/utils.js +39 -81
  276. package/cjs/constants.js +1 -0
  277. package/cjs/index.js +1 -9
  278. package/cjs/publicPath.js +3 -7
  279. package/cjs/utils.js +3 -9
  280. package/dist/images/default.png +0 -0
  281. package/dist/images/filtered.png +0 -0
  282. package/dist/images/symbols.svg +59 -1
  283. package/dist/plesk-ui-library-rtl.css +1 -1
  284. package/dist/plesk-ui-library-rtl.css.map +1 -1
  285. package/dist/plesk-ui-library.css +1 -1
  286. package/dist/plesk-ui-library.css.map +1 -1
  287. package/dist/plesk-ui-library.js +8915 -13255
  288. package/dist/plesk-ui-library.js.map +1 -1
  289. package/dist/plesk-ui-library.min.js +8 -8
  290. package/dist/plesk-ui-library.min.js.map +1 -1
  291. package/esm/components/Action/Action.js +19 -24
  292. package/esm/components/Action/index.js +1 -0
  293. package/esm/components/Alert/Alert.js +19 -17
  294. package/esm/components/Alert/Alert.stories.js +1 -0
  295. package/esm/components/Alert/index.js +1 -0
  296. package/esm/components/AutoClosable/AutoClosable.js +3 -21
  297. package/esm/components/AutoClosable/index.js +1 -0
  298. package/esm/components/AuxiliaryActions/AuxiliaryActions.js +17 -15
  299. package/esm/components/AuxiliaryActions/index.js +1 -0
  300. package/esm/components/Badge/Badge.js +11 -16
  301. package/esm/components/Badge/index.js +1 -0
  302. package/esm/components/Breadcrumbs/Breadcrumbs.js +22 -20
  303. package/esm/components/Breadcrumbs/index.js +1 -0
  304. package/esm/components/Button/Button.js +40 -70
  305. package/esm/components/Button/Button.stories.js +1 -0
  306. package/esm/components/Button/index.js +1 -0
  307. package/esm/components/ButtonGroup/ButtonGroup.js +14 -12
  308. package/esm/components/ButtonGroup/index.js +1 -0
  309. package/esm/components/Card/Card.js +4 -63
  310. package/esm/components/Card/CardButton.js +10 -8
  311. package/esm/components/Card/PreviewPanel.js +21 -42
  312. package/esm/components/Card/helpers.js +6 -5
  313. package/esm/components/Card/index.js +1 -0
  314. package/esm/components/CardList/CardList.js +44 -87
  315. package/esm/components/CardList/CardListToolbar.js +17 -35
  316. package/esm/components/CardList/index.js +1 -0
  317. package/esm/components/Carousel/Carousel.js +41 -64
  318. package/esm/components/Carousel/index.js +1 -0
  319. package/esm/components/Checkbox/Checkbox.js +17 -20
  320. package/esm/components/Checkbox/index.js +1 -0
  321. package/esm/components/ClosingConfirmation/index.js +1 -0
  322. package/esm/components/ClosingConfirmation/locale/en-US.js +1 -0
  323. package/esm/components/ClosingConfirmation/useClosingConfirmation.js +6 -13
  324. package/esm/components/CodeEditor/CodeEditor.js +22 -55
  325. package/esm/components/CodeEditor/CodeMirror.js +1 -4
  326. package/esm/components/CodeEditor/index.js +1 -0
  327. package/esm/components/Columns/Column.js +15 -16
  328. package/esm/components/Columns/Columns.js +20 -22
  329. package/esm/components/Columns/index.js +1 -0
  330. package/esm/components/ComboBox/ComboBox.js +16 -43
  331. package/esm/components/ComboBox/ComboBoxOption.js +2 -5
  332. package/esm/components/ComboBox/index.js +1 -0
  333. package/esm/components/ComboBoxDropdown/ComboBoxDropdown.js +22 -35
  334. package/esm/components/ComboBoxDropdown/index.js +1 -0
  335. package/esm/components/ConsoleOutput/ConsoleOutput.js +3 -19
  336. package/esm/components/ConsoleOutput/index.js +1 -0
  337. package/esm/components/ContentLoader/ContentLoader.js +16 -22
  338. package/esm/components/ContentLoader/IconsLoader.js +15 -23
  339. package/esm/components/ContentLoader/index.js +1 -0
  340. package/esm/components/Cuttable/Cuttable.js +24 -29
  341. package/esm/components/Cuttable/Cuttable.stories.js +1 -0
  342. package/esm/components/Cuttable/index.js +1 -0
  343. package/esm/components/Dialog/Dialog.js +45 -75
  344. package/esm/components/Dialog/Dialog.stories.js +3 -1
  345. package/esm/components/Dialog/index.js +1 -0
  346. package/esm/components/DistractionFreeModeContext/DistractionFreeModeContext.js +1 -0
  347. package/esm/components/DistractionFreeModeContext/index.js +1 -0
  348. package/esm/components/Drawer/Drawer.js +77 -94
  349. package/esm/components/Drawer/Drawer.stories.js +7 -3
  350. package/esm/components/Drawer/DrawerProgress.js +3 -25
  351. package/esm/components/Drawer/Header.js +5 -14
  352. package/esm/components/Drawer/ScrollDirection.js +3 -9
  353. package/esm/components/Drawer/index.js +1 -0
  354. package/esm/components/Dropdown/Dropdown.js +26 -48
  355. package/esm/components/Dropdown/index.js +1 -0
  356. package/esm/components/Dropdown/locale/en-US.js +1 -0
  357. package/esm/components/ExtendedStatusMessage/ExtendedStatusMessage.js +27 -25
  358. package/esm/components/ExtendedStatusMessage/ExtendedStatusMessageActions.js +12 -9
  359. package/esm/components/ExtendedStatusMessage/ExtendedStatusMessageDescription.js +12 -9
  360. package/esm/components/ExtendedStatusMessage/ExtendedStatusMessageSeparator.js +10 -7
  361. package/esm/components/ExtendedStatusMessage/ExtendedStatusMessageTitle.js +13 -10
  362. package/esm/components/ExtendedStatusMessage/index.js +1 -0
  363. package/esm/components/Figure/Figure.js +19 -21
  364. package/esm/components/Figure/index.js +1 -0
  365. package/esm/components/FocusTrap/FocusTrap.js +9 -30
  366. package/esm/components/FocusTrap/index.js +1 -0
  367. package/esm/components/Form/DisabledContext.js +1 -0
  368. package/esm/components/Form/Form.js +68 -102
  369. package/esm/components/Form/Form.stories.js +1 -0
  370. package/esm/components/Form/FormContext.js +1 -0
  371. package/esm/components/Form/ScrollableElementFormContext.js +1 -0
  372. package/esm/components/Form/index.js +1 -0
  373. package/esm/components/Form/utils.js +7 -17
  374. package/esm/components/FormField/FormField.js +50 -98
  375. package/esm/components/FormField/index.js +1 -0
  376. package/esm/components/FormFieldCheckbox/FormFieldCheckbox.js +45 -48
  377. package/esm/components/FormFieldCheckbox/FormFieldCheckbox.stories.js +3 -1
  378. package/esm/components/FormFieldCheckbox/index.js +1 -0
  379. package/esm/components/FormFieldPassword/FormFieldPassword.js +24 -31
  380. package/esm/components/FormFieldPassword/PasswordMeter.js +13 -14
  381. package/esm/components/FormFieldPassword/estimatePassword.js +3 -35
  382. package/esm/components/FormFieldPassword/generatePassword.js +1 -2
  383. package/esm/components/FormFieldPassword/index.js +1 -0
  384. package/esm/components/FormFieldPassword/locale/en-US.js +1 -0
  385. package/esm/components/FormFieldRadioButtons/FormFieldRadioButtons.js +50 -58
  386. package/esm/components/FormFieldRadioButtons/index.js +1 -0
  387. package/esm/components/FormFieldSelect/FormFieldSelect.js +37 -32
  388. package/esm/components/FormFieldSelect/index.js +1 -0
  389. package/esm/components/FormFieldText/FormFieldText.js +34 -45
  390. package/esm/components/FormFieldText/index.js +1 -0
  391. package/esm/components/Grid/Grid.js +17 -40
  392. package/esm/components/Grid/index.js +1 -0
  393. package/esm/components/GridCol/GridCol.js +14 -19
  394. package/esm/components/GridCol/index.js +1 -0
  395. package/esm/components/Heading/Heading.js +11 -16
  396. package/esm/components/Heading/index.js +1 -0
  397. package/esm/components/Hint/Hint.js +9 -9
  398. package/esm/components/Hint/index.js +1 -0
  399. package/esm/components/Icon/Icon.js +18 -20
  400. package/esm/components/Icon/Icon.stories.js +1 -0
  401. package/esm/components/Icon/constants.js +3 -2
  402. package/esm/components/Icon/images/symbols.svg +59 -1
  403. package/esm/components/Icon/index.js +1 -0
  404. package/esm/components/Icon/oldIconNames.js +1 -0
  405. package/esm/components/Icon/utils.js +5 -7
  406. package/esm/components/InPlaceEdit/InPlaceEdit.js +12 -20
  407. package/esm/components/InPlaceEdit/index.js +1 -0
  408. package/esm/components/InPlaceEdit/locale/en-US.js +1 -0
  409. package/esm/components/Input/Input.js +14 -14
  410. package/esm/components/Input/index.js +1 -0
  411. package/esm/components/InputFile/InputFile.js +14 -21
  412. package/esm/components/InputFile/index.js +1 -0
  413. package/esm/components/InputFile/locale/en-US.js +1 -0
  414. package/esm/components/InputNumber/InputNumber.js +20 -47
  415. package/esm/components/InputNumber/index.js +1 -0
  416. package/esm/components/Item/Item.js +2 -28
  417. package/esm/components/Item/index.js +1 -0
  418. package/esm/components/ItemLink/ItemLink.js +9 -10
  419. package/esm/components/ItemLink/ItemLink.stories.js +1 -0
  420. package/esm/components/ItemLink/index.js +1 -0
  421. package/esm/components/ItemList/ItemList.js +29 -62
  422. package/esm/components/ItemList/ItemList.stories.js +11 -7
  423. package/esm/components/ItemList/index.js +1 -0
  424. package/esm/components/Label/Label.js +13 -11
  425. package/esm/components/Label/index.js +1 -0
  426. package/esm/components/Layer/Layer.js +12 -14
  427. package/esm/components/Layer/index.js +1 -0
  428. package/esm/components/Layout/Layout.js +66 -105
  429. package/esm/components/Layout/index.js +1 -0
  430. package/esm/components/Link/Link.js +18 -20
  431. package/esm/components/Link/index.js +1 -0
  432. package/esm/components/List/List.js +216 -365
  433. package/esm/components/List/List.stories.js +18 -12
  434. package/esm/components/List/ListAction.js +9 -12
  435. package/esm/components/List/ListActions.js +13 -17
  436. package/esm/components/List/ListActionsDivider.js +1 -2
  437. package/esm/components/List/ListEmptyView.js +23 -30
  438. package/esm/components/List/ListOperation.js +14 -29
  439. package/esm/components/List/ListOperationContext.js +1 -0
  440. package/esm/components/List/example-data/domains.js +1 -12
  441. package/esm/components/List/images/default.png +0 -0
  442. package/esm/components/List/images/filtered.png +0 -0
  443. package/esm/components/List/index.js +1 -0
  444. package/esm/components/LocaleProvider/LocaleProvider.js +11 -28
  445. package/esm/components/LocaleProvider/index.js +1 -0
  446. package/esm/components/Markdown/Markdown.js +19 -22
  447. package/esm/components/Markdown/index.js +1 -0
  448. package/esm/components/Media/Media.js +16 -31
  449. package/esm/components/Media/MediaSection.js +13 -12
  450. package/esm/components/Media/index.js +1 -0
  451. package/esm/components/Menu/Menu.js +14 -34
  452. package/esm/components/Menu/Menu.stories.js +1 -1
  453. package/esm/components/Menu/MenuBaseItem.js +24 -26
  454. package/esm/components/Menu/MenuDivider.js +13 -11
  455. package/esm/components/Menu/MenuHeader.js +14 -13
  456. package/esm/components/Menu/MenuItem.js +15 -24
  457. package/esm/components/Menu/MenuSelectableItem.js +17 -17
  458. package/esm/components/Menu/index.js +1 -0
  459. package/esm/components/OnDarkContext/OnDarkContext.js +1 -0
  460. package/esm/components/OnDarkContext/index.js +1 -0
  461. package/esm/components/Overlay/Backdrop.js +13 -13
  462. package/esm/components/Overlay/Focuser.js +1 -18
  463. package/esm/components/Overlay/Overlay.js +23 -63
  464. package/esm/components/Overlay/index.js +1 -0
  465. package/esm/components/PageHeader/PageHeader.js +36 -34
  466. package/esm/components/PageHeader/index.js +1 -0
  467. package/esm/components/Pagination/Pagination.js +18 -24
  468. package/esm/components/Pagination/index.js +1 -0
  469. package/esm/components/Panel/Panel.js +11 -18
  470. package/esm/components/Panel/index.js +1 -0
  471. package/esm/components/Paragraph/Paragraph.js +13 -11
  472. package/esm/components/Paragraph/index.js +1 -0
  473. package/esm/components/Plaintext/Plaintext.js +11 -11
  474. package/esm/components/Plaintext/index.js +1 -0
  475. package/esm/components/Popover/Popover.js +18 -73
  476. package/esm/components/Popover/Popover.stories.js +5 -2
  477. package/esm/components/Popover/index.js +1 -0
  478. package/esm/components/Popper/Popper.js +16 -44
  479. package/esm/components/Popper/index.js +1 -0
  480. package/esm/components/Progress/Progress.js +7 -22
  481. package/esm/components/Progress/index.js +1 -0
  482. package/esm/components/ProgressBar/ProgressBar.js +22 -20
  483. package/esm/components/ProgressBar/ProgressIndicator.js +19 -17
  484. package/esm/components/ProgressBar/index.js +1 -0
  485. package/esm/components/ProgressDialog/ProgressDialog.js +7 -35
  486. package/esm/components/ProgressDialog/index.js +1 -0
  487. package/esm/components/ProgressDialogStep/ProgressDialogStep.js +2 -3
  488. package/esm/components/ProgressDialogStep/index.js +1 -0
  489. package/esm/components/ProgressStep/ProgressStep.js +14 -29
  490. package/esm/components/ProgressStep/index.js +1 -0
  491. package/esm/components/Radio/Radio.js +15 -15
  492. package/esm/components/Radio/index.js +1 -0
  493. package/esm/components/Rating/Rating.js +24 -28
  494. package/esm/components/Rating/index.js +1 -0
  495. package/esm/components/ResponsiveContext/ResponsiveContext.js +1 -0
  496. package/esm/components/ResponsiveContext/index.js +1 -0
  497. package/esm/components/Section/Section.js +73 -98
  498. package/esm/components/Section/SectionItem.js +11 -16
  499. package/esm/components/Section/index.js +1 -0
  500. package/esm/components/SegmentedControl/SegmentedControl.js +37 -79
  501. package/esm/components/SegmentedControl/index.js +1 -0
  502. package/esm/components/Select/MultiValue.js +8 -10
  503. package/esm/components/Select/Select.js +24 -73
  504. package/esm/components/Select/Select.stories.js +1 -0
  505. package/esm/components/Select/SelectControl.js +39 -57
  506. package/esm/components/Select/SelectOption.js +2 -5
  507. package/esm/components/Select/SelectOptionGroup.js +1 -3
  508. package/esm/components/Select/index.js +1 -0
  509. package/esm/components/Skeleton/Skeleton.js +14 -13
  510. package/esm/components/Skeleton/Skeleton.stories.js +1 -0
  511. package/esm/components/Skeleton/SkeletonTabs.js +17 -15
  512. package/esm/components/Skeleton/SkeletonTabs.stories.js +1 -0
  513. package/esm/components/Skeleton/SkeletonText.js +22 -19
  514. package/esm/components/Skeleton/SkeletonText.stories.js +1 -0
  515. package/esm/components/Skeleton/index.js +1 -0
  516. package/esm/components/Spinner/Spinner.js +22 -20
  517. package/esm/components/Spinner/index.js +1 -0
  518. package/esm/components/SplitButton/SplitButton.js +13 -27
  519. package/esm/components/SplitButton/index.js +1 -0
  520. package/esm/components/Spot/Spot.js +10 -19
  521. package/esm/components/Spot/SpotPopup.js +22 -21
  522. package/esm/components/Spot/SpotPulsar.js +9 -13
  523. package/esm/components/Spot/index.js +1 -0
  524. package/esm/components/Squeezer/Squeezer.js +15 -26
  525. package/esm/components/Squeezer/index.js +1 -0
  526. package/esm/components/Status/Status.js +17 -20
  527. package/esm/components/Status/Status.stories.js +1 -0
  528. package/esm/components/Status/index.js +1 -0
  529. package/esm/components/StatusMessage/StatusMessage.js +17 -15
  530. package/esm/components/StatusMessage/index.js +1 -0
  531. package/esm/components/Subnav/Subnav.js +24 -38
  532. package/esm/components/Subnav/index.js +1 -0
  533. package/esm/components/Switch/Switch.js +3 -19
  534. package/esm/components/Switch/index.js +1 -0
  535. package/esm/components/SwitchesPanel/SwitchesPanel.js +16 -16
  536. package/esm/components/SwitchesPanel/index.js +1 -0
  537. package/esm/components/SwitchesPanelItem/SwitchesPanelItem.js +3 -17
  538. package/esm/components/SwitchesPanelItem/index.js +1 -0
  539. package/esm/components/Tabs/SearchBar.js +7 -78
  540. package/esm/components/Tabs/Tab.js +8 -12
  541. package/esm/components/Tabs/Tabs.js +40 -106
  542. package/esm/components/Tabs/Tabs.stories.js +1 -0
  543. package/esm/components/Tabs/index.js +1 -0
  544. package/esm/components/Text/Text.js +16 -17
  545. package/esm/components/Text/index.js +1 -0
  546. package/esm/components/TextArea/TextArea.js +8 -26
  547. package/esm/components/TextArea/calculateNodeHeight.js +14 -21
  548. package/esm/components/TextArea/index.js +1 -0
  549. package/esm/components/Toast/Toast.js +3 -13
  550. package/esm/components/Toast/index.js +1 -0
  551. package/esm/components/Toaster/Toaster.js +45 -50
  552. package/esm/components/Toaster/index.js +1 -0
  553. package/esm/components/Toolbar/RegistryContext.js +3 -10
  554. package/esm/components/Toolbar/Toolbar.js +17 -20
  555. package/esm/components/Toolbar/ToolbarExpander.js +8 -10
  556. package/esm/components/Toolbar/ToolbarGroup.js +6 -22
  557. package/esm/components/Toolbar/ToolbarItem.js +3 -13
  558. package/esm/components/Toolbar/ToolbarMenu.js +7 -21
  559. package/esm/components/Toolbar/index.js +1 -0
  560. package/esm/components/Tooltip/Tooltip.js +28 -43
  561. package/esm/components/Tooltip/index.js +1 -0
  562. package/esm/components/Tour/Tour.js +12 -16
  563. package/esm/components/Tour/index.js +1 -0
  564. package/esm/components/Translate/Translate.js +14 -28
  565. package/esm/components/Translate/index.js +1 -0
  566. package/esm/components/VerticalContext/VerticalContext.js +1 -0
  567. package/esm/components/VerticalContext/index.js +1 -0
  568. package/esm/components/index.js +1 -0
  569. package/esm/components/intentIconMap.js +1 -0
  570. package/esm/components/utils.js +39 -60
  571. package/esm/constants.js +1 -0
  572. package/esm/index.js +1 -1
  573. package/esm/publicPath.js +3 -7
  574. package/esm/utils.js +4 -1
  575. package/package.json +68 -63
  576. package/styleguide/build/bundle.26082873.js +2 -0
  577. package/styleguide/build/{bundle.59e52792.js.LICENSE.txt → bundle.26082873.js.LICENSE.txt} +18 -7
  578. package/styleguide/images/default.png +0 -0
  579. package/styleguide/images/empty-list.png +0 -0
  580. package/styleguide/images/filtered.png +0 -0
  581. package/styleguide/images/symbols.svg +59 -1
  582. package/styleguide/index.html +2 -2
  583. package/types/package.d.ts +13 -8
  584. package/types/src/components/Button/Button.stories.d.ts +0 -1
  585. package/types/src/components/ClosingConfirmation/useClosingConfirmation.d.ts +1 -1
  586. package/types/src/components/Dialog/Dialog.stories.d.ts +0 -1
  587. package/types/src/components/DistractionFreeModeContext/DistractionFreeModeContext.d.ts +0 -1
  588. package/types/src/components/Drawer/Drawer.stories.d.ts +0 -1
  589. package/types/src/components/Form/DisabledContext.d.ts +0 -1
  590. package/types/src/components/Form/Form.d.ts +3 -3
  591. package/types/src/components/Form/Form.stories.d.ts +0 -1
  592. package/types/src/components/Form/FormContext.d.ts +0 -1
  593. package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.stories.d.ts +0 -1
  594. package/types/src/components/Icon/Icon.stories.d.ts +0 -1
  595. package/types/src/components/Icon/constants.d.ts +1 -1
  596. package/types/src/components/ItemList/ItemList.d.ts +1 -1
  597. package/types/src/components/ItemList/ItemList.stories.d.ts +24 -24
  598. package/types/src/components/List/List.stories.d.ts +0 -1
  599. package/types/src/components/Menu/Menu.stories.d.ts +0 -1
  600. package/types/src/components/OnDarkContext/OnDarkContext.d.ts +0 -1
  601. package/types/src/components/Popover/Popover.stories.d.ts +0 -1
  602. package/types/src/components/ResponsiveContext/ResponsiveContext.d.ts +0 -1
  603. package/types/src/components/Select/Select.stories.d.ts +1 -1
  604. package/types/src/components/Skeleton/SkeletonText.stories.d.ts +3 -3
  605. package/types/src/components/Status/Status.stories.d.ts +2 -2
  606. package/types/src/components/Tabs/Tabs.stories.d.ts +0 -1
  607. package/types/src/components/Toolbar/RegistryContext.d.ts +0 -1
  608. package/types/src/components/Toolbar/ToolbarItem.d.ts +1 -1
  609. package/types/src/components/VerticalContext/VerticalContext.d.ts +0 -1
  610. package/cjs/components/List/images/default.svg +0 -1
  611. package/cjs/components/List/images/filtered.svg +0 -1
  612. package/esm/components/List/images/default.svg +0 -1
  613. package/esm/components/List/images/filtered.svg +0 -1
  614. package/styleguide/build/bundle.59e52792.js +0 -2
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  // Copyright 1999-2021. Plesk International GmbH. All rights reserved.
4
4
 
5
5
  /* eslint-disable react/no-deprecated */
6
+
6
7
  import React, { Component, Fragment, cloneElement, isValidElement, createRef } from 'react';
7
8
  import PropTypes from 'prop-types';
8
9
  import classNames from 'classnames';
@@ -23,24 +24,21 @@ import VerticalContext, { VERTICAL_BREAKPOINT } from '../VerticalContext';
23
24
  import ListEmptyView from './ListEmptyView';
24
25
  import Columns, { Column } from '../Columns';
25
26
  import { FocusVisibleManager, useFocusVisible } from 'use-focus-visible';
26
-
27
27
  const getRowKey = (row, props) => {
28
28
  const {
29
29
  rowKey
30
30
  } = props;
31
-
32
31
  if (typeof rowKey === 'function') {
33
32
  return rowKey(row);
34
33
  }
35
-
36
34
  return row[rowKey];
37
35
  };
38
-
39
- const Tbody = ({
40
- baseClassName,
41
- className,
42
- ...props
43
- }) => {
36
+ const Tbody = _ref => {
37
+ let {
38
+ baseClassName,
39
+ className,
40
+ ...props
41
+ } = _ref;
44
42
  const {
45
43
  focusVisible,
46
44
  onFocus,
@@ -54,7 +52,6 @@ const Tbody = ({
54
52
  })
55
53
  }));
56
54
  };
57
-
58
55
  Tbody.propTypes = {
59
56
  onFocus: PropTypes.func,
60
57
  onBlur: PropTypes.func,
@@ -66,16 +63,17 @@ Tbody.defaultProps = {
66
63
  onBlur: undefined,
67
64
  className: undefined,
68
65
  baseClassName: `${CLS_PREFIX}list__wrapper`
69
- }; // eslint-disable-next-line react/prop-types
66
+ };
70
67
 
71
- const getHumanTotalRows = ({
72
- selectedRows,
73
- totalRows,
74
- allRowsSelected,
75
- translators
76
- }) => {
68
+ // eslint-disable-next-line react/prop-types
69
+ const getHumanTotalRows = _ref2 => {
70
+ let {
71
+ selectedRows,
72
+ totalRows,
73
+ allRowsSelected,
74
+ translators
75
+ } = _ref2;
77
76
  let mode;
78
-
79
77
  if (!allRowsSelected && selectedRows === 0) {
80
78
  mode = 'totalRows';
81
79
  } else if (allRowsSelected || selectedRows === totalRows) {
@@ -83,11 +81,9 @@ const getHumanTotalRows = ({
83
81
  } else {
84
82
  mode = 'selectedRows';
85
83
  }
86
-
87
84
  const wrapToText = element => /*#__PURE__*/React.createElement(Text, {
88
85
  fontSize: "sm"
89
86
  }, element);
90
-
91
87
  switch (mode) {
92
88
  case 'totalRows':
93
89
  return wrapToText( /*#__PURE__*/React.createElement(Translate, {
@@ -99,7 +95,6 @@ const getHumanTotalRows = ({
99
95
  },
100
96
  translators: translators
101
97
  }));
102
-
103
98
  case 'selectedRows':
104
99
  return wrapToText( /*#__PURE__*/React.createElement(Translate, {
105
100
  namespace: "List",
@@ -113,7 +108,6 @@ const getHumanTotalRows = ({
113
108
  },
114
109
  translators: translators
115
110
  }));
116
-
117
111
  case 'selectedAllRows':
118
112
  return wrapToText( /*#__PURE__*/React.createElement(Translate, {
119
113
  namespace: "List",
@@ -132,22 +126,19 @@ const getHumanTotalRows = ({
132
126
  },
133
127
  translators: translators
134
128
  }));
135
-
136
129
  default:
137
130
  return null;
138
131
  }
139
132
  };
133
+
140
134
  /**
141
135
  * `List` component is used for displaying a collection of tabular data.
142
136
  * [More details about designing of lists.](#!/Sets%20of%20Objects)
143
137
  * @since 0.0.42
144
138
  */
145
-
146
-
147
139
  class List extends Component {
148
- constructor(...args) {
149
- super(...args);
150
-
140
+ constructor() {
141
+ super(...arguments);
151
142
  _defineProperty(this, "state", {
152
143
  sortInPlace: !this.props.pagination,
153
144
  vertical: false,
@@ -158,30 +149,25 @@ class List extends Component {
158
149
  ReorderableList: () => null,
159
150
  reorderableItemWidths: []
160
151
  });
161
-
162
152
  _defineProperty(this, "anchorRef", /*#__PURE__*/createRef());
163
-
164
- _defineProperty(this, "flatData", data => data.reduce((acc, {
165
- data,
166
- ...row
167
- }) => {
153
+ _defineProperty(this, "flatData", data => data.reduce((acc, _ref3) => {
154
+ let {
155
+ data,
156
+ ...row
157
+ } = _ref3;
168
158
  const {
169
159
  virtual
170
160
  } = this.getRowProps(row);
171
-
172
161
  if (virtual) {
173
162
  return [...acc, ...(data ? this.flatData(data) : [])];
174
163
  }
175
-
176
164
  return [...acc, row, ...(data ? this.flatData(data) : [])];
177
165
  }, []));
178
-
179
166
  _defineProperty(this, "handleRowSelectionChange", (checked, rowKey) => {
180
167
  const {
181
168
  onAllRowsSelectedChange
182
169
  } = this.props;
183
170
  let selection;
184
-
185
171
  if (checked) {
186
172
  selection = this.state.selection.slice();
187
173
  selection.push(rowKey);
@@ -189,10 +175,8 @@ class List extends Component {
189
175
  selection = this.state.selection.filter(value => value !== rowKey);
190
176
  safeInvoke(onAllRowsSelectedChange, false);
191
177
  }
192
-
193
178
  this.setSelection(selection);
194
179
  });
195
-
196
180
  _defineProperty(this, "handleGlobalSelectionChange", headerChecked => {
197
181
  const {
198
182
  onAllRowsSelectedChange
@@ -203,86 +187,70 @@ class List extends Component {
203
187
  const nextSelection = [];
204
188
  this.flatData(this.props.data).forEach(row => {
205
189
  const key = getRowKey(row, this.props);
206
-
207
190
  if (row.disabled || this.isRowLoading(row)) {
208
191
  if (selection.indexOf(key) !== -1) {
209
192
  nextSelection.push(key);
210
193
  }
211
-
212
194
  return;
213
195
  }
214
-
215
196
  if (headerChecked) {
216
197
  nextSelection.push(key);
217
198
  }
218
199
  });
219
-
220
200
  if (!headerChecked) {
221
201
  safeInvoke(onAllRowsSelectedChange, false);
222
202
  }
223
-
224
203
  this.setSelection(nextSelection);
225
204
  });
226
-
227
- _defineProperty(this, "handleResize", ({
228
- bounds
229
- }) => {
205
+ _defineProperty(this, "handleResize", _ref4 => {
206
+ let {
207
+ bounds
208
+ } = _ref4;
230
209
  this.setState({
231
210
  vertical: bounds.width < this.props.vertical
232
211
  });
233
212
  });
234
-
235
213
  _defineProperty(this, "isRowLoading", row => this.props.loadingRows.indexOf(getRowKey(row, this.props)) !== -1);
236
-
237
214
  _defineProperty(this, "getRowTitle", row => {
238
215
  const {
239
216
  columns
240
217
  } = this.props;
241
218
  const column = columns.find(c => c.type === 'title');
242
-
243
219
  if (column && column.key) {
244
220
  return row[column.key];
245
221
  }
246
-
247
222
  return undefined;
248
223
  });
249
-
250
224
  _defineProperty(this, "getRowProps", row => {
251
225
  const {
252
226
  rowProps
253
227
  } = this.props;
254
-
255
228
  if (typeof rowProps === 'function') {
256
- return { ...rowProps(row)
229
+ return {
230
+ ...rowProps(row)
257
231
  };
258
232
  }
259
-
260
- return { ...rowProps
233
+ return {
234
+ ...rowProps
261
235
  };
262
236
  });
263
-
264
237
  _defineProperty(this, "isAllRowsChecked", memoize((rows, selectedKeys) => {
265
238
  const filteredRows = this.flatData(rows).filter(row => !row.disabled);
266
-
267
239
  if (filteredRows.length > 0) {
268
240
  return filteredRows.every(row => {
269
241
  const key = getRowKey(row, this.props);
270
242
  return selectedKeys.indexOf(key) !== -1;
271
243
  });
272
244
  }
273
-
274
245
  return false;
275
246
  }));
276
-
277
247
  _defineProperty(this, "isAllRowsExpanded", memoize((rows, expandedRows) => this.flatData(rows).every(row => {
278
248
  if (!this.isRowExpandable(row)) {
279
249
  return true;
280
250
  }
281
-
282
251
  const key = getRowKey(row, this.props);
283
252
  return expandedRows.indexOf(key) !== -1;
284
253
  })));
285
-
286
254
  _defineProperty(this, "handleGlobalExpandingChange", () => {
287
255
  const {
288
256
  data
@@ -294,106 +262,99 @@ class List extends Component {
294
262
  const nextExpandedRows = [];
295
263
  this.flatData(this.props.data).forEach(row => {
296
264
  const key = getRowKey(row, this.props);
297
-
298
265
  if (!this.isRowExpandable(row)) {
299
266
  if (expandedRows.indexOf(key) !== -1) {
300
267
  nextExpandedRows.push(key);
301
268
  }
302
-
303
269
  return;
304
270
  }
305
-
306
271
  if (!headerExpanded) {
307
272
  nextExpandedRows.push(key);
308
273
  }
309
274
  });
310
275
  this.setExpandedRows(nextExpandedRows);
311
276
  });
312
-
313
277
  _defineProperty(this, "createRowClickHandler", row => e => {
314
278
  if (isClickable(e)) {
315
279
  return;
316
280
  }
317
-
318
281
  if (this.isRowExpandable(row)) {
319
282
  this.handleRowExpandingChange(row);
320
283
  }
321
284
  });
322
285
  }
323
-
324
- static getDerivedStateFromProps({
325
- sortColumn,
326
- sortDirection,
327
- selection,
328
- expandedRows,
329
- notExpandableRows,
330
- renderRowBody,
331
- data,
332
- pagination,
333
- vertical,
334
- rowKey
335
- }, {
336
- prevSortColumn,
337
- prevSortDirection,
338
- prevData,
339
- prevSelection,
340
- prevPagination,
341
- prevExpandedRows,
342
- ...state
343
- }) {
286
+ static getDerivedStateFromProps(_ref5, _ref6) {
287
+ let {
288
+ sortColumn,
289
+ sortDirection,
290
+ selection,
291
+ expandedRows,
292
+ notExpandableRows,
293
+ renderRowBody,
294
+ data,
295
+ pagination,
296
+ vertical,
297
+ rowKey
298
+ } = _ref5;
299
+ let {
300
+ prevSortColumn,
301
+ prevSortDirection,
302
+ prevData,
303
+ prevSelection,
304
+ prevPagination,
305
+ prevExpandedRows,
306
+ ...state
307
+ } = _ref6;
344
308
  let nextState = {};
345
-
346
309
  if (prevSortColumn !== sortColumn || prevSortDirection !== sortDirection) {
347
- nextState = { ...nextState,
310
+ nextState = {
311
+ ...nextState,
348
312
  sortColumn,
349
313
  sortDirection
350
314
  };
351
315
  }
352
-
353
316
  if (prevData !== data) {
354
317
  if (renderRowBody && (prevData === undefined || prevData && prevData.length === 0) && data && data.length === 1) {
355
318
  const key = getRowKey(data[0], {
356
319
  rowKey
357
320
  });
358
-
359
321
  if (notExpandableRows.indexOf(key) === -1) {
360
- nextState = { ...nextState,
322
+ nextState = {
323
+ ...nextState,
361
324
  expandedRows: [...expandedRows, key]
362
325
  };
363
326
  }
364
327
  }
365
-
366
328
  const keys = data.map(row => getRowKey(row, {
367
329
  rowKey
368
330
  }));
369
331
  const nextSelection = state.selection.filter(key => keys.indexOf(key) !== -1);
370
- nextState = { ...nextState,
332
+ nextState = {
333
+ ...nextState,
371
334
  selection: nextSelection
372
335
  };
373
336
  }
374
-
375
337
  if (prevSelection !== selection) {
376
- nextState = { ...nextState,
338
+ nextState = {
339
+ ...nextState,
377
340
  selection
378
341
  };
379
342
  }
380
-
381
343
  if (prevExpandedRows !== expandedRows) {
382
- nextState = { ...nextState,
344
+ nextState = {
345
+ ...nextState,
383
346
  expandedRows
384
347
  };
385
348
  }
386
-
387
349
  if (prevPagination !== pagination) {
388
- nextState = { ...nextState,
350
+ nextState = {
351
+ ...nextState,
389
352
  sortInPlace: !pagination
390
353
  };
391
354
  }
392
-
393
355
  if (typeof vertical === 'boolean') {
394
356
  nextState.vertical = vertical;
395
357
  }
396
-
397
358
  nextState.prevSortColumn = sortColumn;
398
359
  nextState.prevSortDirection = sortDirection;
399
360
  nextState.prevData = data;
@@ -402,21 +363,11 @@ class List extends Component {
402
363
  nextState.prevExpandedRows = expandedRows;
403
364
  return nextState;
404
365
  }
405
-
406
366
  componentDidMount() {
407
367
  if (this.props.reorderable) {
408
- import(
409
- /* webpackChunkName: "react-movable" */
410
- '@plesk/react-movable').then(({
411
- List: ReorderableList
412
- }) => {
413
- this.setState({
414
- ReorderableList
415
- });
416
- });
368
+ this.applyReorderableList();
417
369
  }
418
370
  }
419
-
420
371
  componentDidUpdate(prevProps) {
421
372
  const {
422
373
  data
@@ -424,15 +375,26 @@ class List extends Component {
424
375
  const {
425
376
  data: prevData
426
377
  } = prevProps;
427
-
428
378
  if (data !== prevData && this.needScroll && this.anchorRef.current) {
429
379
  scrollIntoView(this.anchorRef.current, {
430
380
  scrollMode: 'if-needed'
431
381
  });
432
382
  this.needScroll = false;
433
383
  }
384
+ if (prevProps.reorderable !== this.props.reorderable && this.props.reorderable) {
385
+ this.applyReorderableList();
386
+ }
387
+ }
388
+ applyReorderableList() {
389
+ import( /* webpackChunkName: "react-movable" */'@plesk/react-movable').then(_ref7 => {
390
+ let {
391
+ List: ReorderableList
392
+ } = _ref7;
393
+ this.setState({
394
+ ReorderableList
395
+ });
396
+ });
434
397
  }
435
-
436
398
  getData() {
437
399
  const {
438
400
  sortInPlace,
@@ -443,34 +405,29 @@ class List extends Component {
443
405
  data,
444
406
  columns
445
407
  } = this.props;
446
-
447
408
  if (!sortInPlace) {
448
409
  return data;
449
410
  }
450
-
451
- const [column] = columns.filter(({
452
- key
453
- }) => key === sortColumn);
454
-
411
+ const [column] = columns.filter(_ref8 => {
412
+ let {
413
+ key
414
+ } = _ref8;
415
+ return key === sortColumn;
416
+ });
455
417
  const defaultSort = (a, b) => {
456
418
  if (a > b) {
457
419
  return 1;
458
420
  }
459
-
460
421
  if (a < b) {
461
422
  return -1;
462
423
  }
463
-
464
424
  return 0;
465
425
  };
466
-
467
426
  if (!column) {
468
427
  return data;
469
428
  }
470
-
471
429
  return data.sort((a, b) => (column.sort ? column.sort(a, b) : defaultSort(a[sortColumn], b[sortColumn])) * (sortDirection === 'ASC' ? 1 : -1));
472
430
  }
473
-
474
431
  sort(columnKey) {
475
432
  const {
476
433
  sortInPlace
@@ -481,14 +438,12 @@ class List extends Component {
481
438
  } = this.state;
482
439
  sortDirection = sortColumn === columnKey && sortDirection === 'ASC' ? 'DESC' : 'ASC';
483
440
  sortColumn = columnKey;
484
-
485
441
  if (sortInPlace) {
486
442
  this.setState({
487
443
  sortColumn,
488
444
  sortDirection
489
445
  });
490
446
  }
491
-
492
447
  if (this.props.onSortChange) {
493
448
  this.props.onSortChange({
494
449
  sortColumn,
@@ -496,67 +451,56 @@ class List extends Component {
496
451
  });
497
452
  }
498
453
  }
499
-
500
454
  isRowSelected(row) {
501
455
  return this.state.selection.indexOf(getRowKey(row, this.props)) !== -1;
502
456
  }
503
-
504
457
  setSelection(selection) {
505
458
  this.setState({
506
459
  selection
507
460
  });
508
-
509
461
  if (this.props.onSelectionChange) {
510
462
  this.props.onSelectionChange(selection.slice());
511
463
  }
512
464
  }
513
-
514
465
  isRowExpanded(row) {
515
466
  return this.state.expandedRows.indexOf(getRowKey(row, this.props)) !== -1;
516
467
  }
517
-
518
468
  isRowExpandable(row) {
519
469
  const {
520
470
  virtual
521
471
  } = this.getRowProps(row);
522
-
523
472
  if (virtual) {
524
473
  return false;
525
474
  }
526
-
527
475
  return this.props.notExpandableRows.indexOf(getRowKey(row, this.props)) === -1;
528
476
  }
529
-
530
477
  handleRowExpandingChange(row) {
531
478
  let expandedRows;
532
479
  const rowKey = getRowKey(row, this.props);
533
-
534
480
  if (this.isRowExpanded(row)) {
535
481
  expandedRows = this.state.expandedRows.filter(value => value !== rowKey);
536
482
  } else {
537
483
  expandedRows = this.state.expandedRows.slice();
538
484
  expandedRows.push(rowKey);
539
485
  }
540
-
541
486
  this.setExpandedRows(expandedRows);
542
487
  }
543
-
544
488
  setExpandedRows(expandedRows) {
545
489
  this.setState({
546
490
  expandedRows
547
491
  });
548
492
  safeInvoke(this.props.onExpandedRowsChange, expandedRows.slice());
549
493
  }
550
-
551
- renderRow({
552
- row,
553
- index,
554
- hasTitle,
555
- realColumn,
556
- parent,
557
- isDragged,
558
- reorderableProps
559
- }) {
494
+ renderRow(_ref9) {
495
+ let {
496
+ row,
497
+ index,
498
+ hasTitle,
499
+ realColumn,
500
+ parent,
501
+ isDragged,
502
+ reorderableProps
503
+ } = _ref9;
560
504
  const {
561
505
  baseClassName,
562
506
  renderRowBody,
@@ -566,9 +510,12 @@ class List extends Component {
566
510
  vertical,
567
511
  reorderableItemWidths
568
512
  } = this.state;
569
- const hasActions = realColumn.some(({
570
- type
571
- }) => type === 'actions');
513
+ const hasActions = realColumn.some(_ref10 => {
514
+ let {
515
+ type
516
+ } = _ref10;
517
+ return type === 'actions';
518
+ });
572
519
  const {
573
520
  className,
574
521
  virtual,
@@ -590,55 +537,50 @@ class List extends Component {
590
537
  }, className)
591
538
  }, rowProps, {
592
539
  onClick: renderRowBody ? this.createRowClickHandler(row) : undefined
593
- }), realColumn.map(({
594
- key,
595
- title,
596
- render,
597
- width,
598
- cellProps,
599
- truncate,
600
- type
601
- }, index) => {
540
+ }), realColumn.map((_ref11, index) => {
541
+ let {
542
+ key,
543
+ title,
544
+ render,
545
+ width,
546
+ cellProps,
547
+ truncate,
548
+ type
549
+ } = _ref11;
602
550
  if (skipCells > 0) {
603
551
  skipCells -= 1;
604
552
  return null;
605
553
  }
606
-
607
554
  let style;
608
-
609
555
  if (!hasTitle && width && !vertical) {
610
556
  style = {
611
557
  width
612
558
  };
613
559
  }
614
-
615
560
  if (isDragged) {
616
561
  style = {
617
562
  width: reorderableItemWidths[index]
618
563
  };
619
564
  }
620
-
621
565
  let content = render ? render(row, {
622
566
  parent
623
- }) : row[key]; // cell props from render
624
-
567
+ }) : row[key];
568
+ // cell props from render
625
569
  if (content && content.children && ! /*#__PURE__*/isValidElement(content)) {
626
570
  const {
627
571
  children,
628
572
  ...other
629
573
  } = content;
630
574
  content = children;
631
- cellProps = { ...cellProps,
575
+ cellProps = {
576
+ ...cellProps,
632
577
  ...other
633
578
  };
634
-
635
579
  if (other.colSpan) {
636
580
  skipCells += other.colSpan - 1;
637
581
  }
638
582
  }
639
-
640
583
  const isCellEmpty = !title && !content;
641
-
642
584
  if (truncate) {
643
585
  content = /*#__PURE__*/React.createElement("div", {
644
586
  className: `${baseClassName}__truncate`
@@ -646,10 +588,8 @@ class List extends Component {
646
588
  truncate: true
647
589
  }, content));
648
590
  }
649
-
650
591
  if (vertical) {
651
592
  const hasColumnTitle = type !== 'internal' && type !== 'actions' && type !== 'title' && title;
652
-
653
593
  if (!isCellEmpty && type !== 'internal') {
654
594
  content = /*#__PURE__*/React.createElement(React.Fragment, null, hasColumnTitle && /*#__PURE__*/React.createElement("div", {
655
595
  className: `${baseClassName}__cell-inner-title`
@@ -657,19 +597,17 @@ class List extends Component {
657
597
  className: `${baseClassName}__cell-inner-content`
658
598
  }, content));
659
599
  }
660
-
661
600
  if (type === 'actions') {
662
601
  content = /*#__PURE__*/React.createElement(VerticalContext.Provider, {
663
602
  value: true
664
603
  }, content);
665
604
  }
666
- } // do not render reorderable handler for nested rows
667
-
605
+ }
668
606
 
607
+ // do not render reorderable handler for nested rows
669
608
  if (key === 'reorderable' && type === 'internal' && parent) {
670
609
  content = null;
671
610
  }
672
-
673
611
  return /*#__PURE__*/React.createElement("td", _extends({
674
612
  key: key,
675
613
  style: style
@@ -693,7 +631,6 @@ class List extends Component {
693
631
  realColumn,
694
632
  parent: row
695
633
  })) : null);
696
-
697
634
  if (isDragged) {
698
635
  return /*#__PURE__*/React.createElement("div", _extends({
699
636
  className: classNames(baseClassName, `${baseClassName}--dragged`)
@@ -704,16 +641,15 @@ class List extends Component {
704
641
  })
705
642
  }, element));
706
643
  }
707
-
708
644
  return element;
709
645
  }
710
-
711
- renderRowBody({
712
- row,
713
- index,
714
- realColumn,
715
- parent
716
- }) {
646
+ renderRowBody(_ref12) {
647
+ let {
648
+ row,
649
+ index,
650
+ realColumn,
651
+ parent
652
+ } = _ref12;
717
653
  const {
718
654
  baseClassName,
719
655
  renderRowBody
@@ -721,17 +657,21 @@ class List extends Component {
721
657
  const {
722
658
  vertical
723
659
  } = this.state;
724
-
725
660
  if (!renderRowBody) {
726
661
  return null;
727
662
  }
728
-
729
- const reorderable = realColumn.find(({
730
- key
731
- }) => key === 'reorderable');
732
- const expander = realColumn.find(({
733
- key
734
- }) => key === 'expander');
663
+ const reorderable = realColumn.find(_ref13 => {
664
+ let {
665
+ key
666
+ } = _ref13;
667
+ return key === 'reorderable';
668
+ });
669
+ const expander = realColumn.find(_ref14 => {
670
+ let {
671
+ key
672
+ } = _ref14;
673
+ return key === 'expander';
674
+ });
735
675
  const isRowExpanded = this.isRowExpanded(row);
736
676
  const trRef = /*#__PURE__*/createRef();
737
677
  return /*#__PURE__*/React.createElement(CSSTransition, {
@@ -764,7 +704,6 @@ class List extends Component {
764
704
  parent
765
705
  })))))));
766
706
  }
767
-
768
707
  renderSelectAllButton() {
769
708
  const {
770
709
  allRowsSelected,
@@ -776,11 +715,9 @@ class List extends Component {
776
715
  const {
777
716
  selection
778
717
  } = this.state;
779
-
780
718
  if (allRowsSelected || selection.length === totalRows || !onSelectionChange) {
781
719
  return null;
782
720
  }
783
-
784
721
  return /*#__PURE__*/React.createElement(Button, {
785
722
  ghost: true,
786
723
  onClick: () => {
@@ -794,7 +731,6 @@ class List extends Component {
794
731
  translators: locale
795
732
  }));
796
733
  }
797
-
798
734
  renderDeselectAllButton() {
799
735
  const {
800
736
  allRowsSelected,
@@ -805,11 +741,9 @@ class List extends Component {
805
741
  const {
806
742
  selection
807
743
  } = this.state;
808
-
809
744
  if (!allRowsSelected && selection.length === 0 || !onSelectionChange) {
810
745
  return null;
811
746
  }
812
-
813
747
  return /*#__PURE__*/React.createElement(Button, {
814
748
  ghost: true,
815
749
  onClick: () => {
@@ -823,7 +757,6 @@ class List extends Component {
823
757
  translators: locale
824
758
  }));
825
759
  }
826
-
827
760
  renderToolbar() {
828
761
  const {
829
762
  toolbar,
@@ -836,19 +769,15 @@ class List extends Component {
836
769
  selection
837
770
  } = this.state;
838
771
  let selectedRowTitle;
839
-
840
772
  if (selection.length === 1) {
841
773
  const row = this.flatData(data).find(row => getRowKey(row, this.props) === selection[0]);
842
-
843
774
  if (row) {
844
775
  selectedRowTitle = this.getRowTitle(row);
845
776
  }
846
777
  }
847
-
848
778
  if (!toolbar) {
849
779
  return null;
850
780
  }
851
-
852
781
  const context = {
853
782
  selectedRows: allRowsSelected ? totalRows || /*#__PURE__*/React.createElement(Translate, {
854
783
  namespace: "List",
@@ -862,38 +791,30 @@ class List extends Component {
862
791
  value: context
863
792
  }, toolbar);
864
793
  }
865
-
866
794
  shouldBePagination() {
867
795
  const {
868
796
  totalRows,
869
797
  pagination
870
798
  } = this.props;
871
-
872
799
  if (!pagination || !totalRows) {
873
800
  return false;
874
801
  }
875
-
876
802
  if (totalRows && /*#__PURE__*/isValidElement(pagination)) {
877
803
  const {
878
804
  itemsPerPageOptions = ITEMS_PER_PAGE_OPTIONS
879
805
  } = pagination.props;
880
-
881
806
  if (Array.isArray(itemsPerPageOptions)) {
882
807
  const numericOptions = itemsPerPageOptions.filter(v => Number(v) === v);
883
-
884
808
  if (numericOptions.length) {
885
809
  const min = Math.min(...numericOptions);
886
-
887
810
  if (totalRows <= min) {
888
811
  return false;
889
812
  }
890
813
  }
891
814
  }
892
815
  }
893
-
894
816
  return true;
895
817
  }
896
-
897
818
  renderHeader() {
898
819
  const {
899
820
  baseClassName,
@@ -905,11 +826,9 @@ class List extends Component {
905
826
  selection
906
827
  } = this.state;
907
828
  const shouldBePagination = this.shouldBePagination();
908
-
909
829
  if (totalRows === undefined && !shouldBePagination) {
910
830
  return null;
911
831
  }
912
-
913
832
  return /*#__PURE__*/React.createElement("div", {
914
833
  className: `${baseClassName}__header`
915
834
  }, totalRows === undefined ? /*#__PURE__*/React.createElement("span", null) : /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
@@ -925,22 +844,18 @@ class List extends Component {
925
844
  className: `${baseClassName}__header-text`
926
845
  }, this.renderPagination('header')));
927
846
  }
928
-
929
847
  renderEmptyView() {
930
848
  const {
931
849
  emptyView,
932
850
  filtered
933
851
  } = this.props;
934
-
935
852
  if (emptyView === undefined) {
936
853
  return filtered ? /*#__PURE__*/React.createElement(ListEmptyView, {
937
854
  reason: "filtered"
938
855
  }) : /*#__PURE__*/React.createElement(ListEmptyView, null);
939
856
  }
940
-
941
857
  return emptyView;
942
858
  }
943
-
944
859
  renderPagination(placement) {
945
860
  const {
946
861
  pagination,
@@ -949,32 +864,27 @@ class List extends Component {
949
864
  const paginationProps = {
950
865
  loading
951
866
  };
952
-
953
867
  switch (placement) {
954
868
  case 'header':
955
869
  paginationProps.view = 'popover';
956
870
  break;
957
-
958
871
  case 'footer':
959
872
  paginationProps.onSelect = current => {
960
873
  this.needScroll = true;
961
874
  safeInvoke(pagination.props.onSelect, current);
962
875
  };
963
-
964
876
  if (pagination.props.onItemsPerPageChange) {
965
877
  paginationProps.onItemsPerPageChange = itemsPerPage => {
966
878
  this.needScroll = true;
967
879
  safeInvoke(pagination.props.onItemsPerPageChange, itemsPerPage);
968
880
  };
969
881
  }
970
-
971
882
  break;
972
883
  }
973
-
974
- return /*#__PURE__*/cloneElement(pagination, { ...paginationProps
884
+ return /*#__PURE__*/cloneElement(pagination, {
885
+ ...paginationProps
975
886
  });
976
887
  }
977
-
978
888
  render() {
979
889
  const {
980
890
  baseClassName,
@@ -1013,46 +923,37 @@ class List extends Component {
1013
923
  const {
1014
924
  vertical
1015
925
  } = this.state;
1016
-
1017
926
  if (false === (data && data.length > 0) && !filtered && emptyViewMode === 'all') {
1018
927
  return this.renderEmptyView();
1019
928
  }
1020
-
1021
929
  const realColumn = columns.map((column, i) => {
1022
930
  const classList = [];
1023
931
  const cellClassList = [];
1024
-
1025
932
  if (i === 0) {
1026
933
  cellClassList.push(`${baseClassName}__cell-first`);
1027
934
  }
1028
-
1029
935
  if (column.align && !vertical) {
1030
936
  const className = `${baseClassName}__cell-${column.align}`;
1031
937
  classList.push(className);
1032
938
  cellClassList.push(className);
1033
939
  }
1034
-
1035
940
  if (column.className) {
1036
941
  classList.push(column.className);
1037
942
  cellClassList.push(column.className);
1038
943
  }
1039
-
1040
- const newColumn = { ...column
944
+ const newColumn = {
945
+ ...column
1041
946
  };
1042
-
1043
947
  if (classList.length) {
1044
948
  newColumn.className = classNames(...classList);
1045
949
  }
1046
-
1047
950
  if (cellClassList.length) {
1048
951
  newColumn.cellProps = {
1049
952
  className: classNames(...cellClassList)
1050
953
  };
1051
954
  }
1052
-
1053
955
  return newColumn;
1054
956
  });
1055
-
1056
957
  if (onSelectionChange) {
1057
958
  const headerChecked = this.isAllRowsChecked(data, this.state.selection);
1058
959
  const headerCheckboxProps = {
@@ -1071,17 +972,14 @@ class List extends Component {
1071
972
  const {
1072
973
  virtual
1073
974
  } = this.getRowProps(row);
1074
-
1075
975
  if (virtual) {
1076
976
  return null;
1077
977
  }
1078
-
1079
978
  if (this.isRowLoading(row)) {
1080
979
  return /*#__PURE__*/React.createElement(Spinner, {
1081
980
  className: `${baseClassName}__spinner`
1082
981
  });
1083
982
  }
1084
-
1085
983
  const checkboxProps = {
1086
984
  checked: this.isRowSelected(row),
1087
985
  disabled: row.disabled,
@@ -1090,16 +988,13 @@ class List extends Component {
1090
988
  value: getRowKey(row, this.props)
1091
989
  }
1092
990
  };
1093
-
1094
991
  if (typeof renderSelectionCheckbox === 'function') {
1095
992
  return renderSelectionCheckbox(checkboxProps, row);
1096
993
  }
1097
-
1098
994
  return /*#__PURE__*/React.createElement(Checkbox, checkboxProps);
1099
995
  }
1100
996
  });
1101
997
  }
1102
-
1103
998
  if (renderRowBody) {
1104
999
  realColumn.unshift({
1105
1000
  key: 'expander',
@@ -1144,7 +1039,6 @@ class List extends Component {
1144
1039
  })
1145
1040
  });
1146
1041
  }
1147
-
1148
1042
  if (reorderable) {
1149
1043
  realColumn.unshift({
1150
1044
  key: 'reorderable',
@@ -1169,70 +1063,70 @@ class List extends Component {
1169
1063
  })))
1170
1064
  });
1171
1065
  }
1172
-
1173
1066
  const hasTitle = !vertical && columns.some(column => column.title);
1174
1067
  let content;
1175
-
1176
1068
  if (false === (data && data.length > 0) && (filtered || emptyViewMode === 'items')) {
1177
1069
  content = this.renderEmptyView();
1178
1070
  } else {
1179
- const renderList = ({
1180
- children,
1181
- props: reorderableProps
1182
- }) => /*#__PURE__*/React.createElement(FocusVisibleManager, null, /*#__PURE__*/React.createElement("table", _extends({
1183
- className: classNames(`${baseClassName}__table`, {
1184
- [`${baseClassName}--expandable`]: renderRowBody,
1185
- [`${baseClassName}__table--vertical`]: vertical,
1186
- [`${baseClassName}__table--reorderable`]: reorderable
1187
- })
1188
- }, reorderableProps), hasTitle && /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", {
1189
- className: classNames(`${baseClassName}__table-thead`, {
1190
- [`${baseClassName}__row--expanded`]: this.isAllRowsExpanded(data, this.state.expandedRows)
1191
- })
1192
- }, realColumn.map(({
1193
- key,
1194
- title,
1195
- sortable,
1196
- sort,
1197
- width,
1198
- render,
1199
- truncate,
1200
- type,
1201
- cellProps,
1202
- ...headerProps
1203
- }) => {
1204
- if (sortable) {
1205
- title = /*#__PURE__*/React.createElement("div", {
1206
- className: "th__action"
1207
- }, title);
1208
- headerProps.className = classNames({
1209
- 'is-sortable': sortable,
1210
- 'is-sorted is-sorted--up': this.state.sortColumn === key && this.state.sortDirection === 'ASC',
1211
- 'is-sorted is-sorted--down': this.state.sortColumn === key && this.state.sortDirection === 'DESC'
1212
- }, headerProps.className);
1213
-
1214
- headerProps.onClick = () => this.sort(key);
1215
- }
1216
-
1217
- if (width) {
1218
- headerProps.style = { ...headerProps.style,
1219
- width
1220
- };
1221
- }
1222
-
1223
- return /*#__PURE__*/React.createElement("th", _extends({
1224
- key: key
1225
- }, headerProps), title);
1226
- }))), reorderable ? children : /*#__PURE__*/React.createElement("tbody", null, children)));
1227
-
1228
- const renderItem = ({
1229
- value: {
1230
- row
1231
- },
1232
- index,
1233
- props: reorderableProps,
1234
- isDragged
1235
- }) => {
1071
+ const renderList = _ref15 => {
1072
+ let {
1073
+ children,
1074
+ props: reorderableProps
1075
+ } = _ref15;
1076
+ return /*#__PURE__*/React.createElement(FocusVisibleManager, null, /*#__PURE__*/React.createElement("table", _extends({
1077
+ className: classNames(`${baseClassName}__table`, {
1078
+ [`${baseClassName}--expandable`]: renderRowBody,
1079
+ [`${baseClassName}__table--vertical`]: vertical,
1080
+ [`${baseClassName}__table--reorderable`]: reorderable
1081
+ })
1082
+ }, reorderableProps), hasTitle && /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", {
1083
+ className: classNames(`${baseClassName}__table-thead`, {
1084
+ [`${baseClassName}__row--expanded`]: this.isAllRowsExpanded(data, this.state.expandedRows)
1085
+ })
1086
+ }, realColumn.map(_ref16 => {
1087
+ let {
1088
+ key,
1089
+ title,
1090
+ sortable,
1091
+ sort,
1092
+ width,
1093
+ render,
1094
+ truncate,
1095
+ type,
1096
+ cellProps,
1097
+ ...headerProps
1098
+ } = _ref16;
1099
+ if (sortable) {
1100
+ title = /*#__PURE__*/React.createElement("div", {
1101
+ className: "th__action"
1102
+ }, title);
1103
+ headerProps.className = classNames({
1104
+ 'is-sortable': sortable,
1105
+ 'is-sorted is-sorted--up': this.state.sortColumn === key && this.state.sortDirection === 'ASC',
1106
+ 'is-sorted is-sorted--down': this.state.sortColumn === key && this.state.sortDirection === 'DESC'
1107
+ }, headerProps.className);
1108
+ headerProps.onClick = () => this.sort(key);
1109
+ }
1110
+ if (width) {
1111
+ headerProps.style = {
1112
+ ...headerProps.style,
1113
+ width
1114
+ };
1115
+ }
1116
+ return /*#__PURE__*/React.createElement("th", _extends({
1117
+ key: key
1118
+ }, headerProps), title);
1119
+ }))), reorderable ? children : /*#__PURE__*/React.createElement("tbody", null, children)));
1120
+ };
1121
+ const renderItem = _ref17 => {
1122
+ let {
1123
+ value: {
1124
+ row
1125
+ },
1126
+ index,
1127
+ props: reorderableProps,
1128
+ isDragged
1129
+ } = _ref17;
1236
1130
  return this.renderRow({
1237
1131
  row,
1238
1132
  index,
@@ -1242,26 +1136,27 @@ class List extends Component {
1242
1136
  isDragged
1243
1137
  });
1244
1138
  };
1245
-
1246
1139
  if (reorderable) {
1247
1140
  const {
1248
1141
  ReorderableList
1249
1142
  } = this.state;
1250
1143
  content = /*#__PURE__*/React.createElement(ReorderableList, {
1251
- beforeDrag: ({
1252
- elements,
1253
- index
1254
- }) => {
1144
+ beforeDrag: _ref18 => {
1145
+ let {
1146
+ elements,
1147
+ index
1148
+ } = _ref18;
1255
1149
  const cells = Array.from(elements[index].firstElementChild.children);
1256
1150
  const reorderableItemWidths = cells.map(cell => window.getComputedStyle(cell).width);
1257
1151
  this.setState({
1258
1152
  reorderableItemWidths
1259
1153
  });
1260
1154
  },
1261
- onChange: ({
1262
- oldIndex,
1263
- newIndex
1264
- }) => {
1155
+ onChange: _ref19 => {
1156
+ let {
1157
+ oldIndex,
1158
+ newIndex
1159
+ } = _ref19;
1265
1160
  safeInvoke(onReorderEnd, {
1266
1161
  oldIndex,
1267
1162
  newIndex
@@ -1289,13 +1184,11 @@ class List extends Component {
1289
1184
  });
1290
1185
  }
1291
1186
  }
1292
-
1293
1187
  content = /*#__PURE__*/React.createElement("div", {
1294
1188
  className: classNames(`${baseClassName}__table-container`, {
1295
1189
  [`${baseClassName}__table-container--loading`]: loading
1296
1190
  })
1297
1191
  }, content);
1298
-
1299
1192
  if (sidebar) {
1300
1193
  content = /*#__PURE__*/React.createElement(Columns, {
1301
1194
  gap: "md"
@@ -1303,9 +1196,7 @@ class List extends Component {
1303
1196
  fill: true
1304
1197
  }, content), /*#__PURE__*/React.createElement(Column, null, sidebar));
1305
1198
  }
1306
-
1307
1199
  const shouldBePagination = this.shouldBePagination();
1308
-
1309
1200
  const createRoot = ref => /*#__PURE__*/React.createElement("div", _extends({
1310
1201
  ref: ref,
1311
1202
  className: classNames(baseClassName, className)
@@ -1314,21 +1205,20 @@ class List extends Component {
1314
1205
  }), content, shouldBePagination && /*#__PURE__*/React.createElement("div", {
1315
1206
  className: `${baseClassName}__footer`
1316
1207
  }, this.renderPagination('footer')));
1317
-
1318
1208
  if (typeof verticalProp === 'number') {
1319
1209
  return /*#__PURE__*/React.createElement(Measure, {
1320
1210
  bounds: true,
1321
1211
  onResize: this.handleResize
1322
- }, ({
1323
- measureRef
1324
- }) => createRoot(measureRef));
1212
+ }, _ref20 => {
1213
+ let {
1214
+ measureRef
1215
+ } = _ref20;
1216
+ return createRoot(measureRef);
1217
+ });
1325
1218
  }
1326
-
1327
1219
  return createRoot();
1328
1220
  }
1329
-
1330
1221
  }
1331
-
1332
1222
  List.propTypes = {
1333
1223
  /**
1334
1224
  * Columns definition.
@@ -1342,39 +1232,32 @@ List.propTypes = {
1342
1232
  * Unique column key.
1343
1233
  */
1344
1234
  key: PropTypes.string.isRequired,
1345
-
1346
1235
  /**
1347
1236
  * Column title.
1348
1237
  */
1349
1238
  title: PropTypes.node,
1350
-
1351
1239
  /**
1352
1240
  * Optional cell renderer function: `row => Component`. By default render value of cell.
1353
1241
  * The renderer function can also returns a configuration object like: `{children: 'cell content', colSpan: 3}`
1354
1242
  */
1355
1243
  render: PropTypes.func,
1356
-
1357
1244
  /**
1358
1245
  * Is column sortable.
1359
1246
  * Default is `false`
1360
1247
  */
1361
1248
  sortable: PropTypes.bool,
1362
-
1363
1249
  /**
1364
1250
  * Optional function for row comparison: `(row1, row2) => -1 | 0 | 1`
1365
1251
  */
1366
1252
  sort: PropTypes.func,
1367
-
1368
1253
  /**
1369
1254
  * Column alignment.
1370
1255
  */
1371
1256
  align: PropTypes.oneOf(['left', 'center', 'right']),
1372
-
1373
1257
  /**
1374
1258
  * Truncate the text in cell with an ellipsis.
1375
1259
  */
1376
1260
  truncate: PropTypes.bool,
1377
-
1378
1261
  /**
1379
1262
  * Determine type of column content.
1380
1263
  *
@@ -1384,7 +1267,6 @@ List.propTypes = {
1384
1267
  */
1385
1268
  type: PropTypes.oneOf(['title', 'controls', 'actions'])
1386
1269
  })).isRequired,
1387
-
1388
1270
  /**
1389
1271
  * Array of row objects.
1390
1272
  *
@@ -1396,145 +1278,121 @@ List.propTypes = {
1396
1278
  * Unique column key. This property can by renamed using `rowKey` property of List.
1397
1279
  */
1398
1280
  key: PropTypes.string,
1399
-
1400
1281
  /**
1401
1282
  * Optional property for disabling ability to select this row.
1402
1283
  */
1403
1284
  disabled: PropTypes.bool,
1404
-
1405
1285
  /**
1406
1286
  * Optional array of children rows.
1407
1287
  */
1408
1288
  data: PropTypes.array
1409
1289
  })),
1410
-
1411
1290
  /**
1412
1291
  * Current sort column key
1413
1292
  * @since 0.0.42
1414
1293
  */
1415
1294
  sortColumn: PropTypes.string,
1416
-
1417
1295
  /**
1418
1296
  * Sort direction of the column being sorted.
1419
1297
  * @since 0.0.42
1420
1298
  */
1421
1299
  sortDirection: PropTypes.oneOf(['ASC', 'DESC']),
1422
-
1423
1300
  /**
1424
1301
  * Sort change handler
1425
1302
  * @since 0.0.42
1426
1303
  */
1427
1304
  onSortChange: PropTypes.func,
1428
-
1429
1305
  /**
1430
1306
  * Array of keys of selected rows
1431
1307
  * @since 0.0.42
1432
1308
  */
1433
1309
  selection: PropTypes.array,
1434
-
1435
1310
  /**
1436
1311
  * Selection change handler for list. Checkboxes will only be rendered if this prop is defined.
1437
1312
  * @since 0.0.42
1438
1313
  */
1439
1314
  onSelectionChange: PropTypes.func,
1440
-
1441
1315
  /**
1442
1316
  * Renderer for a selection checkbox. Allow to replace checkboxes in the List by a custom implementation.
1443
1317
  * @since 3.19.0
1444
1318
  */
1445
1319
  renderSelectionCheckbox: PropTypes.func,
1446
-
1447
1320
  /**
1448
1321
  * Row's key getter. Could be a string or function like: `row => <unique_string>`
1449
1322
  * @since 0.0.45
1450
1323
  */
1451
1324
  rowKey: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
1452
-
1453
1325
  /**
1454
1326
  * Renderer for a row body. Should return ReactNode.
1455
1327
  * @since 1.12.0
1456
1328
  */
1457
1329
  renderRowBody: PropTypes.func,
1458
-
1459
1330
  /**
1460
1331
  * Array of keys of expanded rows
1461
1332
  * @since 1.12.0
1462
1333
  */
1463
1334
  expandedRows: PropTypes.array,
1464
-
1465
1335
  /**
1466
1336
  * Array of keys of rows which not have expand indicator
1467
1337
  * @since 1.12.0
1468
1338
  */
1469
1339
  notExpandableRows: PropTypes.array,
1470
-
1471
1340
  /**
1472
1341
  * Rows expanding change handler.
1473
1342
  * @since 1.12.0
1474
1343
  */
1475
1344
  onExpandedRowsChange: PropTypes.func,
1476
-
1477
1345
  /**
1478
1346
  * Array of keys of loading rows. They are displayed instead of checkboxes.
1479
1347
  * @since 2.5.0
1480
1348
  */
1481
1349
  loadingRows: PropTypes.array,
1482
-
1483
1350
  /**
1484
1351
  * A `Pagination` element. It displays at the top and the bottom of the list. When pagination is defined, the built-in sort is disabled.
1485
1352
  * @since 2.4.0
1486
1353
  */
1487
1354
  pagination: PropTypes.node,
1488
-
1489
1355
  /**
1490
1356
  * Total rows count, including nested rows. Usually, it uses together with pagination.
1491
1357
  * @since 2.4.0
1492
1358
  */
1493
1359
  totalRows: PropTypes.number,
1494
-
1495
1360
  /**
1496
1361
  * A `Toolbar` element.
1497
1362
  * @since 2.4.0
1498
1363
  */
1499
1364
  toolbar: PropTypes.node,
1500
-
1501
1365
  /**
1502
1366
  * A flag that all rows are selected.
1503
1367
  * @since 2.4.0
1504
1368
  */
1505
1369
  allRowsSelected: PropTypes.bool,
1506
-
1507
1370
  /**
1508
1371
  * A callback executed when the allRowsSelected prop is changed.
1509
1372
  * @since 2.4.0
1510
1373
  */
1511
1374
  onAllRowsSelectedChange: PropTypes.func,
1512
-
1513
1375
  /**
1514
1376
  * Filtered list. Manages toolbar visibility when data is absent and defines the defaults for empty view.
1515
1377
  * @since 3.0.1
1516
1378
  */
1517
1379
  filtered: PropTypes.bool,
1518
-
1519
1380
  /**
1520
1381
  * A custom view for the case when data is absent.
1521
1382
  * @since 2.5.0
1522
1383
  */
1523
1384
  emptyView: PropTypes.node,
1524
-
1525
1385
  /**
1526
1386
  * Which part of the List component should be replaced by the empty view.
1527
1387
  * @since 2.6.0
1528
1388
  * @deprecated Use `filtered` instead.
1529
1389
  */
1530
1390
  emptyViewMode: PropTypes.oneOf(['all', 'items']),
1531
-
1532
1391
  /**
1533
1392
  * A slot on the right of the items.
1534
1393
  * @since 2.6.0
1535
1394
  */
1536
1395
  sidebar: PropTypes.node,
1537
-
1538
1396
  /**
1539
1397
  * Custom localization messages.
1540
1398
  * @since 2.6.0
@@ -1546,20 +1404,17 @@ List.propTypes = {
1546
1404
  totalRows: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
1547
1405
  selectedRows: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
1548
1406
  }),
1549
-
1550
1407
  /**
1551
1408
  * Render List row's content vertically.
1552
1409
  * When some number is specified, it turns into vertical mode automatically if the List's width is less than the provided number.
1553
1410
  * @since 3.3.0
1554
1411
  */
1555
1412
  vertical: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
1556
-
1557
1413
  /**
1558
1414
  * Indicate the loading state of the list.
1559
1415
  * @since 3.3.1
1560
1416
  */
1561
1417
  loading: PropTypes.bool,
1562
-
1563
1418
  /**
1564
1419
  * Apply some props to each row.
1565
1420
  *
@@ -1570,24 +1425,20 @@ List.propTypes = {
1570
1425
  rowProps: PropTypes.oneOfType([PropTypes.shape({
1571
1426
  virtual: PropTypes.bool
1572
1427
  }), PropTypes.func]),
1573
-
1574
1428
  /**
1575
1429
  * Enable reorderable view.
1576
1430
  * @since 3.18.0
1577
1431
  */
1578
1432
  reorderable: PropTypes.bool,
1579
-
1580
1433
  /**
1581
1434
  * Reorder end handler.
1582
1435
  * @since 3.18.0
1583
1436
  */
1584
1437
  onReorderEnd: PropTypes.func,
1585
-
1586
1438
  /**
1587
1439
  * @ignore
1588
1440
  */
1589
1441
  className: PropTypes.string,
1590
-
1591
1442
  /**
1592
1443
  * @ignore
1593
1444
  */