@plesk/ui-library 3.31.0 → 3.31.1

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 (605) 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 +21 -61
  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 +0 -5
  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 +28 -81
  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 +67 -110
  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 +28 -71
  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 +15 -30
  136. package/cjs/components/Link/index.js +0 -2
  137. package/cjs/components/List/List.js +205 -372
  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 +20 -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 +0 -5
  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 +20 -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 +8861 -13237
  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 +1 -3
  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 +27 -65
  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 +67 -101
  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 +16 -20
  431. package/esm/components/Link/index.js +1 -0
  432. package/esm/components/List/List.js +206 -361
  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 +21 -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 +1 -3
  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 +20 -22
  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 +27 -23
  576. package/styleguide/build/bundle.a0fc0411.js +2 -0
  577. package/styleguide/build/{bundle.59e52792.js.LICENSE.txt → bundle.a0fc0411.js.LICENSE.txt} +19 -8
  578. package/styleguide/images/default.png +0 -0
  579. package/styleguide/images/filtered.png +0 -0
  580. package/styleguide/images/symbols.svg +59 -1
  581. package/styleguide/index.html +2 -2
  582. package/types/package.d.ts +8 -4
  583. package/types/src/components/Button/Button.stories.d.ts +0 -1
  584. package/types/src/components/Dialog/Dialog.stories.d.ts +0 -1
  585. package/types/src/components/DistractionFreeModeContext/DistractionFreeModeContext.d.ts +0 -1
  586. package/types/src/components/Drawer/Drawer.stories.d.ts +0 -1
  587. package/types/src/components/Form/DisabledContext.d.ts +0 -1
  588. package/types/src/components/Form/Form.stories.d.ts +0 -1
  589. package/types/src/components/Form/FormContext.d.ts +0 -1
  590. package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.stories.d.ts +0 -1
  591. package/types/src/components/Icon/Icon.stories.d.ts +0 -1
  592. package/types/src/components/Icon/constants.d.ts +1 -1
  593. package/types/src/components/List/List.stories.d.ts +0 -1
  594. package/types/src/components/Menu/Menu.stories.d.ts +0 -1
  595. package/types/src/components/OnDarkContext/OnDarkContext.d.ts +0 -1
  596. package/types/src/components/Popover/Popover.stories.d.ts +0 -1
  597. package/types/src/components/ResponsiveContext/ResponsiveContext.d.ts +0 -1
  598. package/types/src/components/Tabs/Tabs.stories.d.ts +0 -1
  599. package/types/src/components/Toolbar/RegistryContext.d.ts +0 -1
  600. package/types/src/components/VerticalContext/VerticalContext.d.ts +0 -1
  601. package/cjs/components/List/images/default.svg +0 -1
  602. package/cjs/components/List/images/filtered.svg +0 -1
  603. package/esm/components/List/images/default.svg +0 -1
  604. package/esm/components/List/images/filtered.svg +0 -1
  605. 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,18 @@ 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
- }) => {
368
+ import( /* webpackChunkName: "react-movable" */'@plesk/react-movable').then(_ref7 => {
369
+ let {
370
+ List: ReorderableList
371
+ } = _ref7;
413
372
  this.setState({
414
373
  ReorderableList
415
374
  });
416
375
  });
417
376
  }
418
377
  }
419
-
420
378
  componentDidUpdate(prevProps) {
421
379
  const {
422
380
  data
@@ -424,7 +382,6 @@ class List extends Component {
424
382
  const {
425
383
  data: prevData
426
384
  } = prevProps;
427
-
428
385
  if (data !== prevData && this.needScroll && this.anchorRef.current) {
429
386
  scrollIntoView(this.anchorRef.current, {
430
387
  scrollMode: 'if-needed'
@@ -432,7 +389,6 @@ class List extends Component {
432
389
  this.needScroll = false;
433
390
  }
434
391
  }
435
-
436
392
  getData() {
437
393
  const {
438
394
  sortInPlace,
@@ -443,34 +399,29 @@ class List extends Component {
443
399
  data,
444
400
  columns
445
401
  } = this.props;
446
-
447
402
  if (!sortInPlace) {
448
403
  return data;
449
404
  }
450
-
451
- const [column] = columns.filter(({
452
- key
453
- }) => key === sortColumn);
454
-
405
+ const [column] = columns.filter(_ref8 => {
406
+ let {
407
+ key
408
+ } = _ref8;
409
+ return key === sortColumn;
410
+ });
455
411
  const defaultSort = (a, b) => {
456
412
  if (a > b) {
457
413
  return 1;
458
414
  }
459
-
460
415
  if (a < b) {
461
416
  return -1;
462
417
  }
463
-
464
418
  return 0;
465
419
  };
466
-
467
420
  if (!column) {
468
421
  return data;
469
422
  }
470
-
471
423
  return data.sort((a, b) => (column.sort ? column.sort(a, b) : defaultSort(a[sortColumn], b[sortColumn])) * (sortDirection === 'ASC' ? 1 : -1));
472
424
  }
473
-
474
425
  sort(columnKey) {
475
426
  const {
476
427
  sortInPlace
@@ -481,14 +432,12 @@ class List extends Component {
481
432
  } = this.state;
482
433
  sortDirection = sortColumn === columnKey && sortDirection === 'ASC' ? 'DESC' : 'ASC';
483
434
  sortColumn = columnKey;
484
-
485
435
  if (sortInPlace) {
486
436
  this.setState({
487
437
  sortColumn,
488
438
  sortDirection
489
439
  });
490
440
  }
491
-
492
441
  if (this.props.onSortChange) {
493
442
  this.props.onSortChange({
494
443
  sortColumn,
@@ -496,67 +445,56 @@ class List extends Component {
496
445
  });
497
446
  }
498
447
  }
499
-
500
448
  isRowSelected(row) {
501
449
  return this.state.selection.indexOf(getRowKey(row, this.props)) !== -1;
502
450
  }
503
-
504
451
  setSelection(selection) {
505
452
  this.setState({
506
453
  selection
507
454
  });
508
-
509
455
  if (this.props.onSelectionChange) {
510
456
  this.props.onSelectionChange(selection.slice());
511
457
  }
512
458
  }
513
-
514
459
  isRowExpanded(row) {
515
460
  return this.state.expandedRows.indexOf(getRowKey(row, this.props)) !== -1;
516
461
  }
517
-
518
462
  isRowExpandable(row) {
519
463
  const {
520
464
  virtual
521
465
  } = this.getRowProps(row);
522
-
523
466
  if (virtual) {
524
467
  return false;
525
468
  }
526
-
527
469
  return this.props.notExpandableRows.indexOf(getRowKey(row, this.props)) === -1;
528
470
  }
529
-
530
471
  handleRowExpandingChange(row) {
531
472
  let expandedRows;
532
473
  const rowKey = getRowKey(row, this.props);
533
-
534
474
  if (this.isRowExpanded(row)) {
535
475
  expandedRows = this.state.expandedRows.filter(value => value !== rowKey);
536
476
  } else {
537
477
  expandedRows = this.state.expandedRows.slice();
538
478
  expandedRows.push(rowKey);
539
479
  }
540
-
541
480
  this.setExpandedRows(expandedRows);
542
481
  }
543
-
544
482
  setExpandedRows(expandedRows) {
545
483
  this.setState({
546
484
  expandedRows
547
485
  });
548
486
  safeInvoke(this.props.onExpandedRowsChange, expandedRows.slice());
549
487
  }
550
-
551
- renderRow({
552
- row,
553
- index,
554
- hasTitle,
555
- realColumn,
556
- parent,
557
- isDragged,
558
- reorderableProps
559
- }) {
488
+ renderRow(_ref9) {
489
+ let {
490
+ row,
491
+ index,
492
+ hasTitle,
493
+ realColumn,
494
+ parent,
495
+ isDragged,
496
+ reorderableProps
497
+ } = _ref9;
560
498
  const {
561
499
  baseClassName,
562
500
  renderRowBody,
@@ -566,9 +504,12 @@ class List extends Component {
566
504
  vertical,
567
505
  reorderableItemWidths
568
506
  } = this.state;
569
- const hasActions = realColumn.some(({
570
- type
571
- }) => type === 'actions');
507
+ const hasActions = realColumn.some(_ref10 => {
508
+ let {
509
+ type
510
+ } = _ref10;
511
+ return type === 'actions';
512
+ });
572
513
  const {
573
514
  className,
574
515
  virtual,
@@ -590,55 +531,50 @@ class List extends Component {
590
531
  }, className)
591
532
  }, rowProps, {
592
533
  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) => {
534
+ }), realColumn.map((_ref11, index) => {
535
+ let {
536
+ key,
537
+ title,
538
+ render,
539
+ width,
540
+ cellProps,
541
+ truncate,
542
+ type
543
+ } = _ref11;
602
544
  if (skipCells > 0) {
603
545
  skipCells -= 1;
604
546
  return null;
605
547
  }
606
-
607
548
  let style;
608
-
609
549
  if (!hasTitle && width && !vertical) {
610
550
  style = {
611
551
  width
612
552
  };
613
553
  }
614
-
615
554
  if (isDragged) {
616
555
  style = {
617
556
  width: reorderableItemWidths[index]
618
557
  };
619
558
  }
620
-
621
559
  let content = render ? render(row, {
622
560
  parent
623
- }) : row[key]; // cell props from render
624
-
561
+ }) : row[key];
562
+ // cell props from render
625
563
  if (content && content.children && ! /*#__PURE__*/isValidElement(content)) {
626
564
  const {
627
565
  children,
628
566
  ...other
629
567
  } = content;
630
568
  content = children;
631
- cellProps = { ...cellProps,
569
+ cellProps = {
570
+ ...cellProps,
632
571
  ...other
633
572
  };
634
-
635
573
  if (other.colSpan) {
636
574
  skipCells += other.colSpan - 1;
637
575
  }
638
576
  }
639
-
640
577
  const isCellEmpty = !title && !content;
641
-
642
578
  if (truncate) {
643
579
  content = /*#__PURE__*/React.createElement("div", {
644
580
  className: `${baseClassName}__truncate`
@@ -646,10 +582,8 @@ class List extends Component {
646
582
  truncate: true
647
583
  }, content));
648
584
  }
649
-
650
585
  if (vertical) {
651
586
  const hasColumnTitle = type !== 'internal' && type !== 'actions' && type !== 'title' && title;
652
-
653
587
  if (!isCellEmpty && type !== 'internal') {
654
588
  content = /*#__PURE__*/React.createElement(React.Fragment, null, hasColumnTitle && /*#__PURE__*/React.createElement("div", {
655
589
  className: `${baseClassName}__cell-inner-title`
@@ -657,19 +591,17 @@ class List extends Component {
657
591
  className: `${baseClassName}__cell-inner-content`
658
592
  }, content));
659
593
  }
660
-
661
594
  if (type === 'actions') {
662
595
  content = /*#__PURE__*/React.createElement(VerticalContext.Provider, {
663
596
  value: true
664
597
  }, content);
665
598
  }
666
- } // do not render reorderable handler for nested rows
667
-
599
+ }
668
600
 
601
+ // do not render reorderable handler for nested rows
669
602
  if (key === 'reorderable' && type === 'internal' && parent) {
670
603
  content = null;
671
604
  }
672
-
673
605
  return /*#__PURE__*/React.createElement("td", _extends({
674
606
  key: key,
675
607
  style: style
@@ -693,7 +625,6 @@ class List extends Component {
693
625
  realColumn,
694
626
  parent: row
695
627
  })) : null);
696
-
697
628
  if (isDragged) {
698
629
  return /*#__PURE__*/React.createElement("div", _extends({
699
630
  className: classNames(baseClassName, `${baseClassName}--dragged`)
@@ -704,16 +635,15 @@ class List extends Component {
704
635
  })
705
636
  }, element));
706
637
  }
707
-
708
638
  return element;
709
639
  }
710
-
711
- renderRowBody({
712
- row,
713
- index,
714
- realColumn,
715
- parent
716
- }) {
640
+ renderRowBody(_ref12) {
641
+ let {
642
+ row,
643
+ index,
644
+ realColumn,
645
+ parent
646
+ } = _ref12;
717
647
  const {
718
648
  baseClassName,
719
649
  renderRowBody
@@ -721,17 +651,21 @@ class List extends Component {
721
651
  const {
722
652
  vertical
723
653
  } = this.state;
724
-
725
654
  if (!renderRowBody) {
726
655
  return null;
727
656
  }
728
-
729
- const reorderable = realColumn.find(({
730
- key
731
- }) => key === 'reorderable');
732
- const expander = realColumn.find(({
733
- key
734
- }) => key === 'expander');
657
+ const reorderable = realColumn.find(_ref13 => {
658
+ let {
659
+ key
660
+ } = _ref13;
661
+ return key === 'reorderable';
662
+ });
663
+ const expander = realColumn.find(_ref14 => {
664
+ let {
665
+ key
666
+ } = _ref14;
667
+ return key === 'expander';
668
+ });
735
669
  const isRowExpanded = this.isRowExpanded(row);
736
670
  const trRef = /*#__PURE__*/createRef();
737
671
  return /*#__PURE__*/React.createElement(CSSTransition, {
@@ -764,7 +698,6 @@ class List extends Component {
764
698
  parent
765
699
  })))))));
766
700
  }
767
-
768
701
  renderSelectAllButton() {
769
702
  const {
770
703
  allRowsSelected,
@@ -776,11 +709,9 @@ class List extends Component {
776
709
  const {
777
710
  selection
778
711
  } = this.state;
779
-
780
712
  if (allRowsSelected || selection.length === totalRows || !onSelectionChange) {
781
713
  return null;
782
714
  }
783
-
784
715
  return /*#__PURE__*/React.createElement(Button, {
785
716
  ghost: true,
786
717
  onClick: () => {
@@ -794,7 +725,6 @@ class List extends Component {
794
725
  translators: locale
795
726
  }));
796
727
  }
797
-
798
728
  renderDeselectAllButton() {
799
729
  const {
800
730
  allRowsSelected,
@@ -805,11 +735,9 @@ class List extends Component {
805
735
  const {
806
736
  selection
807
737
  } = this.state;
808
-
809
738
  if (!allRowsSelected && selection.length === 0 || !onSelectionChange) {
810
739
  return null;
811
740
  }
812
-
813
741
  return /*#__PURE__*/React.createElement(Button, {
814
742
  ghost: true,
815
743
  onClick: () => {
@@ -823,7 +751,6 @@ class List extends Component {
823
751
  translators: locale
824
752
  }));
825
753
  }
826
-
827
754
  renderToolbar() {
828
755
  const {
829
756
  toolbar,
@@ -836,19 +763,15 @@ class List extends Component {
836
763
  selection
837
764
  } = this.state;
838
765
  let selectedRowTitle;
839
-
840
766
  if (selection.length === 1) {
841
767
  const row = this.flatData(data).find(row => getRowKey(row, this.props) === selection[0]);
842
-
843
768
  if (row) {
844
769
  selectedRowTitle = this.getRowTitle(row);
845
770
  }
846
771
  }
847
-
848
772
  if (!toolbar) {
849
773
  return null;
850
774
  }
851
-
852
775
  const context = {
853
776
  selectedRows: allRowsSelected ? totalRows || /*#__PURE__*/React.createElement(Translate, {
854
777
  namespace: "List",
@@ -862,38 +785,30 @@ class List extends Component {
862
785
  value: context
863
786
  }, toolbar);
864
787
  }
865
-
866
788
  shouldBePagination() {
867
789
  const {
868
790
  totalRows,
869
791
  pagination
870
792
  } = this.props;
871
-
872
793
  if (!pagination || !totalRows) {
873
794
  return false;
874
795
  }
875
-
876
796
  if (totalRows && /*#__PURE__*/isValidElement(pagination)) {
877
797
  const {
878
798
  itemsPerPageOptions = ITEMS_PER_PAGE_OPTIONS
879
799
  } = pagination.props;
880
-
881
800
  if (Array.isArray(itemsPerPageOptions)) {
882
801
  const numericOptions = itemsPerPageOptions.filter(v => Number(v) === v);
883
-
884
802
  if (numericOptions.length) {
885
803
  const min = Math.min(...numericOptions);
886
-
887
804
  if (totalRows <= min) {
888
805
  return false;
889
806
  }
890
807
  }
891
808
  }
892
809
  }
893
-
894
810
  return true;
895
811
  }
896
-
897
812
  renderHeader() {
898
813
  const {
899
814
  baseClassName,
@@ -905,11 +820,9 @@ class List extends Component {
905
820
  selection
906
821
  } = this.state;
907
822
  const shouldBePagination = this.shouldBePagination();
908
-
909
823
  if (totalRows === undefined && !shouldBePagination) {
910
824
  return null;
911
825
  }
912
-
913
826
  return /*#__PURE__*/React.createElement("div", {
914
827
  className: `${baseClassName}__header`
915
828
  }, totalRows === undefined ? /*#__PURE__*/React.createElement("span", null) : /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
@@ -925,22 +838,18 @@ class List extends Component {
925
838
  className: `${baseClassName}__header-text`
926
839
  }, this.renderPagination('header')));
927
840
  }
928
-
929
841
  renderEmptyView() {
930
842
  const {
931
843
  emptyView,
932
844
  filtered
933
845
  } = this.props;
934
-
935
846
  if (emptyView === undefined) {
936
847
  return filtered ? /*#__PURE__*/React.createElement(ListEmptyView, {
937
848
  reason: "filtered"
938
849
  }) : /*#__PURE__*/React.createElement(ListEmptyView, null);
939
850
  }
940
-
941
851
  return emptyView;
942
852
  }
943
-
944
853
  renderPagination(placement) {
945
854
  const {
946
855
  pagination,
@@ -949,32 +858,27 @@ class List extends Component {
949
858
  const paginationProps = {
950
859
  loading
951
860
  };
952
-
953
861
  switch (placement) {
954
862
  case 'header':
955
863
  paginationProps.view = 'popover';
956
864
  break;
957
-
958
865
  case 'footer':
959
866
  paginationProps.onSelect = current => {
960
867
  this.needScroll = true;
961
868
  safeInvoke(pagination.props.onSelect, current);
962
869
  };
963
-
964
870
  if (pagination.props.onItemsPerPageChange) {
965
871
  paginationProps.onItemsPerPageChange = itemsPerPage => {
966
872
  this.needScroll = true;
967
873
  safeInvoke(pagination.props.onItemsPerPageChange, itemsPerPage);
968
874
  };
969
875
  }
970
-
971
876
  break;
972
877
  }
973
-
974
- return /*#__PURE__*/cloneElement(pagination, { ...paginationProps
878
+ return /*#__PURE__*/cloneElement(pagination, {
879
+ ...paginationProps
975
880
  });
976
881
  }
977
-
978
882
  render() {
979
883
  const {
980
884
  baseClassName,
@@ -1013,46 +917,37 @@ class List extends Component {
1013
917
  const {
1014
918
  vertical
1015
919
  } = this.state;
1016
-
1017
920
  if (false === (data && data.length > 0) && !filtered && emptyViewMode === 'all') {
1018
921
  return this.renderEmptyView();
1019
922
  }
1020
-
1021
923
  const realColumn = columns.map((column, i) => {
1022
924
  const classList = [];
1023
925
  const cellClassList = [];
1024
-
1025
926
  if (i === 0) {
1026
927
  cellClassList.push(`${baseClassName}__cell-first`);
1027
928
  }
1028
-
1029
929
  if (column.align && !vertical) {
1030
930
  const className = `${baseClassName}__cell-${column.align}`;
1031
931
  classList.push(className);
1032
932
  cellClassList.push(className);
1033
933
  }
1034
-
1035
934
  if (column.className) {
1036
935
  classList.push(column.className);
1037
936
  cellClassList.push(column.className);
1038
937
  }
1039
-
1040
- const newColumn = { ...column
938
+ const newColumn = {
939
+ ...column
1041
940
  };
1042
-
1043
941
  if (classList.length) {
1044
942
  newColumn.className = classNames(...classList);
1045
943
  }
1046
-
1047
944
  if (cellClassList.length) {
1048
945
  newColumn.cellProps = {
1049
946
  className: classNames(...cellClassList)
1050
947
  };
1051
948
  }
1052
-
1053
949
  return newColumn;
1054
950
  });
1055
-
1056
951
  if (onSelectionChange) {
1057
952
  const headerChecked = this.isAllRowsChecked(data, this.state.selection);
1058
953
  const headerCheckboxProps = {
@@ -1071,17 +966,14 @@ class List extends Component {
1071
966
  const {
1072
967
  virtual
1073
968
  } = this.getRowProps(row);
1074
-
1075
969
  if (virtual) {
1076
970
  return null;
1077
971
  }
1078
-
1079
972
  if (this.isRowLoading(row)) {
1080
973
  return /*#__PURE__*/React.createElement(Spinner, {
1081
974
  className: `${baseClassName}__spinner`
1082
975
  });
1083
976
  }
1084
-
1085
977
  const checkboxProps = {
1086
978
  checked: this.isRowSelected(row),
1087
979
  disabled: row.disabled,
@@ -1090,16 +982,13 @@ class List extends Component {
1090
982
  value: getRowKey(row, this.props)
1091
983
  }
1092
984
  };
1093
-
1094
985
  if (typeof renderSelectionCheckbox === 'function') {
1095
986
  return renderSelectionCheckbox(checkboxProps, row);
1096
987
  }
1097
-
1098
988
  return /*#__PURE__*/React.createElement(Checkbox, checkboxProps);
1099
989
  }
1100
990
  });
1101
991
  }
1102
-
1103
992
  if (renderRowBody) {
1104
993
  realColumn.unshift({
1105
994
  key: 'expander',
@@ -1144,7 +1033,6 @@ class List extends Component {
1144
1033
  })
1145
1034
  });
1146
1035
  }
1147
-
1148
1036
  if (reorderable) {
1149
1037
  realColumn.unshift({
1150
1038
  key: 'reorderable',
@@ -1169,70 +1057,70 @@ class List extends Component {
1169
1057
  })))
1170
1058
  });
1171
1059
  }
1172
-
1173
1060
  const hasTitle = !vertical && columns.some(column => column.title);
1174
1061
  let content;
1175
-
1176
1062
  if (false === (data && data.length > 0) && (filtered || emptyViewMode === 'items')) {
1177
1063
  content = this.renderEmptyView();
1178
1064
  } 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
- }) => {
1065
+ const renderList = _ref15 => {
1066
+ let {
1067
+ children,
1068
+ props: reorderableProps
1069
+ } = _ref15;
1070
+ return /*#__PURE__*/React.createElement(FocusVisibleManager, null, /*#__PURE__*/React.createElement("table", _extends({
1071
+ className: classNames(`${baseClassName}__table`, {
1072
+ [`${baseClassName}--expandable`]: renderRowBody,
1073
+ [`${baseClassName}__table--vertical`]: vertical,
1074
+ [`${baseClassName}__table--reorderable`]: reorderable
1075
+ })
1076
+ }, reorderableProps), hasTitle && /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", {
1077
+ className: classNames(`${baseClassName}__table-thead`, {
1078
+ [`${baseClassName}__row--expanded`]: this.isAllRowsExpanded(data, this.state.expandedRows)
1079
+ })
1080
+ }, realColumn.map(_ref16 => {
1081
+ let {
1082
+ key,
1083
+ title,
1084
+ sortable,
1085
+ sort,
1086
+ width,
1087
+ render,
1088
+ truncate,
1089
+ type,
1090
+ cellProps,
1091
+ ...headerProps
1092
+ } = _ref16;
1093
+ if (sortable) {
1094
+ title = /*#__PURE__*/React.createElement("div", {
1095
+ className: "th__action"
1096
+ }, title);
1097
+ headerProps.className = classNames({
1098
+ 'is-sortable': sortable,
1099
+ 'is-sorted is-sorted--up': this.state.sortColumn === key && this.state.sortDirection === 'ASC',
1100
+ 'is-sorted is-sorted--down': this.state.sortColumn === key && this.state.sortDirection === 'DESC'
1101
+ }, headerProps.className);
1102
+ headerProps.onClick = () => this.sort(key);
1103
+ }
1104
+ if (width) {
1105
+ headerProps.style = {
1106
+ ...headerProps.style,
1107
+ width
1108
+ };
1109
+ }
1110
+ return /*#__PURE__*/React.createElement("th", _extends({
1111
+ key: key
1112
+ }, headerProps), title);
1113
+ }))), reorderable ? children : /*#__PURE__*/React.createElement("tbody", null, children)));
1114
+ };
1115
+ const renderItem = _ref17 => {
1116
+ let {
1117
+ value: {
1118
+ row
1119
+ },
1120
+ index,
1121
+ props: reorderableProps,
1122
+ isDragged
1123
+ } = _ref17;
1236
1124
  return this.renderRow({
1237
1125
  row,
1238
1126
  index,
@@ -1242,26 +1130,27 @@ class List extends Component {
1242
1130
  isDragged
1243
1131
  });
1244
1132
  };
1245
-
1246
1133
  if (reorderable) {
1247
1134
  const {
1248
1135
  ReorderableList
1249
1136
  } = this.state;
1250
1137
  content = /*#__PURE__*/React.createElement(ReorderableList, {
1251
- beforeDrag: ({
1252
- elements,
1253
- index
1254
- }) => {
1138
+ beforeDrag: _ref18 => {
1139
+ let {
1140
+ elements,
1141
+ index
1142
+ } = _ref18;
1255
1143
  const cells = Array.from(elements[index].firstElementChild.children);
1256
1144
  const reorderableItemWidths = cells.map(cell => window.getComputedStyle(cell).width);
1257
1145
  this.setState({
1258
1146
  reorderableItemWidths
1259
1147
  });
1260
1148
  },
1261
- onChange: ({
1262
- oldIndex,
1263
- newIndex
1264
- }) => {
1149
+ onChange: _ref19 => {
1150
+ let {
1151
+ oldIndex,
1152
+ newIndex
1153
+ } = _ref19;
1265
1154
  safeInvoke(onReorderEnd, {
1266
1155
  oldIndex,
1267
1156
  newIndex
@@ -1289,13 +1178,11 @@ class List extends Component {
1289
1178
  });
1290
1179
  }
1291
1180
  }
1292
-
1293
1181
  content = /*#__PURE__*/React.createElement("div", {
1294
1182
  className: classNames(`${baseClassName}__table-container`, {
1295
1183
  [`${baseClassName}__table-container--loading`]: loading
1296
1184
  })
1297
1185
  }, content);
1298
-
1299
1186
  if (sidebar) {
1300
1187
  content = /*#__PURE__*/React.createElement(Columns, {
1301
1188
  gap: "md"
@@ -1303,9 +1190,7 @@ class List extends Component {
1303
1190
  fill: true
1304
1191
  }, content), /*#__PURE__*/React.createElement(Column, null, sidebar));
1305
1192
  }
1306
-
1307
1193
  const shouldBePagination = this.shouldBePagination();
1308
-
1309
1194
  const createRoot = ref => /*#__PURE__*/React.createElement("div", _extends({
1310
1195
  ref: ref,
1311
1196
  className: classNames(baseClassName, className)
@@ -1314,21 +1199,20 @@ class List extends Component {
1314
1199
  }), content, shouldBePagination && /*#__PURE__*/React.createElement("div", {
1315
1200
  className: `${baseClassName}__footer`
1316
1201
  }, this.renderPagination('footer')));
1317
-
1318
1202
  if (typeof verticalProp === 'number') {
1319
1203
  return /*#__PURE__*/React.createElement(Measure, {
1320
1204
  bounds: true,
1321
1205
  onResize: this.handleResize
1322
- }, ({
1323
- measureRef
1324
- }) => createRoot(measureRef));
1206
+ }, _ref20 => {
1207
+ let {
1208
+ measureRef
1209
+ } = _ref20;
1210
+ return createRoot(measureRef);
1211
+ });
1325
1212
  }
1326
-
1327
1213
  return createRoot();
1328
1214
  }
1329
-
1330
1215
  }
1331
-
1332
1216
  List.propTypes = {
1333
1217
  /**
1334
1218
  * Columns definition.
@@ -1342,39 +1226,32 @@ List.propTypes = {
1342
1226
  * Unique column key.
1343
1227
  */
1344
1228
  key: PropTypes.string.isRequired,
1345
-
1346
1229
  /**
1347
1230
  * Column title.
1348
1231
  */
1349
1232
  title: PropTypes.node,
1350
-
1351
1233
  /**
1352
1234
  * Optional cell renderer function: `row => Component`. By default render value of cell.
1353
1235
  * The renderer function can also returns a configuration object like: `{children: 'cell content', colSpan: 3}`
1354
1236
  */
1355
1237
  render: PropTypes.func,
1356
-
1357
1238
  /**
1358
1239
  * Is column sortable.
1359
1240
  * Default is `false`
1360
1241
  */
1361
1242
  sortable: PropTypes.bool,
1362
-
1363
1243
  /**
1364
1244
  * Optional function for row comparison: `(row1, row2) => -1 | 0 | 1`
1365
1245
  */
1366
1246
  sort: PropTypes.func,
1367
-
1368
1247
  /**
1369
1248
  * Column alignment.
1370
1249
  */
1371
1250
  align: PropTypes.oneOf(['left', 'center', 'right']),
1372
-
1373
1251
  /**
1374
1252
  * Truncate the text in cell with an ellipsis.
1375
1253
  */
1376
1254
  truncate: PropTypes.bool,
1377
-
1378
1255
  /**
1379
1256
  * Determine type of column content.
1380
1257
  *
@@ -1384,7 +1261,6 @@ List.propTypes = {
1384
1261
  */
1385
1262
  type: PropTypes.oneOf(['title', 'controls', 'actions'])
1386
1263
  })).isRequired,
1387
-
1388
1264
  /**
1389
1265
  * Array of row objects.
1390
1266
  *
@@ -1396,145 +1272,121 @@ List.propTypes = {
1396
1272
  * Unique column key. This property can by renamed using `rowKey` property of List.
1397
1273
  */
1398
1274
  key: PropTypes.string,
1399
-
1400
1275
  /**
1401
1276
  * Optional property for disabling ability to select this row.
1402
1277
  */
1403
1278
  disabled: PropTypes.bool,
1404
-
1405
1279
  /**
1406
1280
  * Optional array of children rows.
1407
1281
  */
1408
1282
  data: PropTypes.array
1409
1283
  })),
1410
-
1411
1284
  /**
1412
1285
  * Current sort column key
1413
1286
  * @since 0.0.42
1414
1287
  */
1415
1288
  sortColumn: PropTypes.string,
1416
-
1417
1289
  /**
1418
1290
  * Sort direction of the column being sorted.
1419
1291
  * @since 0.0.42
1420
1292
  */
1421
1293
  sortDirection: PropTypes.oneOf(['ASC', 'DESC']),
1422
-
1423
1294
  /**
1424
1295
  * Sort change handler
1425
1296
  * @since 0.0.42
1426
1297
  */
1427
1298
  onSortChange: PropTypes.func,
1428
-
1429
1299
  /**
1430
1300
  * Array of keys of selected rows
1431
1301
  * @since 0.0.42
1432
1302
  */
1433
1303
  selection: PropTypes.array,
1434
-
1435
1304
  /**
1436
1305
  * Selection change handler for list. Checkboxes will only be rendered if this prop is defined.
1437
1306
  * @since 0.0.42
1438
1307
  */
1439
1308
  onSelectionChange: PropTypes.func,
1440
-
1441
1309
  /**
1442
1310
  * Renderer for a selection checkbox. Allow to replace checkboxes in the List by a custom implementation.
1443
1311
  * @since 3.19.0
1444
1312
  */
1445
1313
  renderSelectionCheckbox: PropTypes.func,
1446
-
1447
1314
  /**
1448
1315
  * Row's key getter. Could be a string or function like: `row => <unique_string>`
1449
1316
  * @since 0.0.45
1450
1317
  */
1451
1318
  rowKey: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
1452
-
1453
1319
  /**
1454
1320
  * Renderer for a row body. Should return ReactNode.
1455
1321
  * @since 1.12.0
1456
1322
  */
1457
1323
  renderRowBody: PropTypes.func,
1458
-
1459
1324
  /**
1460
1325
  * Array of keys of expanded rows
1461
1326
  * @since 1.12.0
1462
1327
  */
1463
1328
  expandedRows: PropTypes.array,
1464
-
1465
1329
  /**
1466
1330
  * Array of keys of rows which not have expand indicator
1467
1331
  * @since 1.12.0
1468
1332
  */
1469
1333
  notExpandableRows: PropTypes.array,
1470
-
1471
1334
  /**
1472
1335
  * Rows expanding change handler.
1473
1336
  * @since 1.12.0
1474
1337
  */
1475
1338
  onExpandedRowsChange: PropTypes.func,
1476
-
1477
1339
  /**
1478
1340
  * Array of keys of loading rows. They are displayed instead of checkboxes.
1479
1341
  * @since 2.5.0
1480
1342
  */
1481
1343
  loadingRows: PropTypes.array,
1482
-
1483
1344
  /**
1484
1345
  * 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
1346
  * @since 2.4.0
1486
1347
  */
1487
1348
  pagination: PropTypes.node,
1488
-
1489
1349
  /**
1490
1350
  * Total rows count, including nested rows. Usually, it uses together with pagination.
1491
1351
  * @since 2.4.0
1492
1352
  */
1493
1353
  totalRows: PropTypes.number,
1494
-
1495
1354
  /**
1496
1355
  * A `Toolbar` element.
1497
1356
  * @since 2.4.0
1498
1357
  */
1499
1358
  toolbar: PropTypes.node,
1500
-
1501
1359
  /**
1502
1360
  * A flag that all rows are selected.
1503
1361
  * @since 2.4.0
1504
1362
  */
1505
1363
  allRowsSelected: PropTypes.bool,
1506
-
1507
1364
  /**
1508
1365
  * A callback executed when the allRowsSelected prop is changed.
1509
1366
  * @since 2.4.0
1510
1367
  */
1511
1368
  onAllRowsSelectedChange: PropTypes.func,
1512
-
1513
1369
  /**
1514
1370
  * Filtered list. Manages toolbar visibility when data is absent and defines the defaults for empty view.
1515
1371
  * @since 3.0.1
1516
1372
  */
1517
1373
  filtered: PropTypes.bool,
1518
-
1519
1374
  /**
1520
1375
  * A custom view for the case when data is absent.
1521
1376
  * @since 2.5.0
1522
1377
  */
1523
1378
  emptyView: PropTypes.node,
1524
-
1525
1379
  /**
1526
1380
  * Which part of the List component should be replaced by the empty view.
1527
1381
  * @since 2.6.0
1528
1382
  * @deprecated Use `filtered` instead.
1529
1383
  */
1530
1384
  emptyViewMode: PropTypes.oneOf(['all', 'items']),
1531
-
1532
1385
  /**
1533
1386
  * A slot on the right of the items.
1534
1387
  * @since 2.6.0
1535
1388
  */
1536
1389
  sidebar: PropTypes.node,
1537
-
1538
1390
  /**
1539
1391
  * Custom localization messages.
1540
1392
  * @since 2.6.0
@@ -1546,20 +1398,17 @@ List.propTypes = {
1546
1398
  totalRows: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
1547
1399
  selectedRows: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
1548
1400
  }),
1549
-
1550
1401
  /**
1551
1402
  * Render List row's content vertically.
1552
1403
  * When some number is specified, it turns into vertical mode automatically if the List's width is less than the provided number.
1553
1404
  * @since 3.3.0
1554
1405
  */
1555
1406
  vertical: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
1556
-
1557
1407
  /**
1558
1408
  * Indicate the loading state of the list.
1559
1409
  * @since 3.3.1
1560
1410
  */
1561
1411
  loading: PropTypes.bool,
1562
-
1563
1412
  /**
1564
1413
  * Apply some props to each row.
1565
1414
  *
@@ -1570,24 +1419,20 @@ List.propTypes = {
1570
1419
  rowProps: PropTypes.oneOfType([PropTypes.shape({
1571
1420
  virtual: PropTypes.bool
1572
1421
  }), PropTypes.func]),
1573
-
1574
1422
  /**
1575
1423
  * Enable reorderable view.
1576
1424
  * @since 3.18.0
1577
1425
  */
1578
1426
  reorderable: PropTypes.bool,
1579
-
1580
1427
  /**
1581
1428
  * Reorder end handler.
1582
1429
  * @since 3.18.0
1583
1430
  */
1584
1431
  onReorderEnd: PropTypes.func,
1585
-
1586
1432
  /**
1587
1433
  * @ignore
1588
1434
  */
1589
1435
  className: PropTypes.string,
1590
-
1591
1436
  /**
1592
1437
  * @ignore
1593
1438
  */