@mailstep/design-system 0.8.52 → 0.9.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 (290) hide show
  1. package/package.json +22 -6
  2. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +1 -1
  3. package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +1 -1
  4. package/ui/Blocks/Header/components/UserMenu/index.js +1 -1
  5. package/ui/Blocks/Header/styles.js +1 -1
  6. package/ui/Elements/Avatar/Avatar.js +1 -1
  7. package/ui/Elements/Avatar/styles.js +1 -1
  8. package/ui/Elements/Button/styles.js +1 -1
  9. package/ui/Modules/Dashboard/Hoc/LoadingBoundary.d.ts +8 -0
  10. package/ui/Modules/Dashboard/Hoc/LoadingBoundary.js +11 -0
  11. package/ui/Modules/Dashboard/Hoc/index.d.ts +3 -0
  12. package/ui/Modules/Dashboard/Hoc/index.js +4 -0
  13. package/ui/Modules/Dashboard/Hoc/storybook/withReduxProvider.d.ts +4 -0
  14. package/ui/Modules/Dashboard/Hoc/storybook/withReduxProvider.js +14 -0
  15. package/ui/Modules/Dashboard/Hoc/withConfig.d.ts +7 -0
  16. package/ui/Modules/Dashboard/Hoc/withConfig.js +22 -0
  17. package/ui/Modules/Dashboard/Hoc/withFetch.d.ts +26 -0
  18. package/ui/Modules/Dashboard/Hoc/withFetch.js +50 -0
  19. package/ui/Modules/Dashboard/Hoc/withProps.d.ts +4 -0
  20. package/ui/Modules/Dashboard/Hoc/withProps.js +25 -0
  21. package/ui/Modules/Dashboard/assets/BarChartPreview.png +0 -0
  22. package/ui/Modules/Dashboard/assets/ColorBoxPreview.png +0 -0
  23. package/ui/Modules/Dashboard/assets/HorizontalBarPreview.png +0 -0
  24. package/ui/Modules/Dashboard/assets/NumberBoxPreview.png +0 -0
  25. package/ui/Modules/Dashboard/assets/PieChartPreview.png +0 -0
  26. package/ui/Modules/Dashboard/assets/TablePreview.png +0 -0
  27. package/ui/Modules/Dashboard/assets/TextBoxPreview.png +0 -0
  28. package/ui/Modules/Dashboard/assets/move.svg +18 -0
  29. package/ui/Modules/Dashboard/components/Config/MultiConfig.d.ts +6 -0
  30. package/ui/Modules/Dashboard/components/Config/MultiConfig.js +51 -0
  31. package/ui/Modules/Dashboard/components/Config/components/CommonConfig.d.ts +4 -0
  32. package/ui/Modules/Dashboard/components/Config/components/CommonConfig.js +20 -0
  33. package/ui/Modules/Dashboard/components/Config/components/InputConfig.d.ts +5 -0
  34. package/ui/Modules/Dashboard/components/Config/components/InputConfig.js +104 -0
  35. package/ui/Modules/Dashboard/components/Config/types.d.ts +1 -0
  36. package/ui/Modules/Dashboard/components/Config/types.js +1 -0
  37. package/ui/Modules/Dashboard/components/Dashboard/Dashboard.d.ts +9 -0
  38. package/ui/Modules/Dashboard/components/Dashboard/Dashboard.js +16 -0
  39. package/ui/Modules/Dashboard/components/Dashboard/DashboardContainer.d.ts +4 -0
  40. package/ui/Modules/Dashboard/components/Dashboard/DashboardContainer.js +31 -0
  41. package/ui/Modules/Dashboard/components/Dashboard/components/Body.d.ts +7 -0
  42. package/ui/Modules/Dashboard/components/Dashboard/components/Body.js +7 -0
  43. package/ui/Modules/Dashboard/components/Dashboard/components/HandleChange.d.ts +6 -0
  44. package/ui/Modules/Dashboard/components/Dashboard/components/HandleChange.js +25 -0
  45. package/ui/Modules/Dashboard/components/Dashboard/components/LayoutErrorBoundary.d.ts +13 -0
  46. package/ui/Modules/Dashboard/components/Dashboard/components/LayoutErrorBoundary.js +19 -0
  47. package/ui/Modules/Dashboard/components/Dashboard/dashboard2.css +124 -0
  48. package/ui/Modules/Dashboard/components/Dashboard/index.d.ts +2 -0
  49. package/ui/Modules/Dashboard/components/Dashboard/index.js +5 -0
  50. package/ui/Modules/Dashboard/components/Header/Header.d.ts +8 -0
  51. package/ui/Modules/Dashboard/components/Header/Header.js +9 -0
  52. package/ui/Modules/Dashboard/components/Header/index.d.ts +2 -0
  53. package/ui/Modules/Dashboard/components/Header/index.js +5 -0
  54. package/ui/Modules/Dashboard/components/Layout/Layout.d.ts +18 -0
  55. package/ui/Modules/Dashboard/components/Layout/Layout.js +39 -0
  56. package/ui/Modules/Dashboard/components/Layout/LayoutContainer.d.ts +7 -0
  57. package/ui/Modules/Dashboard/components/Layout/LayoutContainer.js +40 -0
  58. package/ui/Modules/Dashboard/components/Layout/components/Item/Item.d.ts +18 -0
  59. package/ui/Modules/Dashboard/components/Layout/components/Item/Item.js +79 -0
  60. package/ui/Modules/Dashboard/components/Layout/components/Item/ItemContainer.d.ts +11 -0
  61. package/ui/Modules/Dashboard/components/Layout/components/Item/ItemContainer.js +64 -0
  62. package/ui/Modules/Dashboard/components/Layout/components/Item/WidgetErrorBoundary.d.ts +14 -0
  63. package/ui/Modules/Dashboard/components/Layout/components/Item/WidgetErrorBoundary.js +28 -0
  64. package/ui/Modules/Dashboard/components/Layout/components/Item/index.d.ts +2 -0
  65. package/ui/Modules/Dashboard/components/Layout/components/Item/index.js +5 -0
  66. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfig.d.ts +13 -0
  67. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfig.js +18 -0
  68. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.d.ts +8 -0
  69. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.js +31 -0
  70. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/index.d.ts +2 -0
  71. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/index.js +5 -0
  72. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/ItemHeader.d.ts +12 -0
  73. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/ItemHeader.js +27 -0
  74. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/index.d.ts +2 -0
  75. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/index.js +5 -0
  76. package/ui/Modules/Dashboard/components/Layout/index.d.ts +2 -0
  77. package/ui/Modules/Dashboard/components/Layout/index.js +5 -0
  78. package/ui/Modules/Dashboard/components/NoData/NoData.d.ts +2 -0
  79. package/ui/Modules/Dashboard/components/NoData/NoData.js +14 -0
  80. package/ui/Modules/Dashboard/components/NoData/index.d.ts +2 -0
  81. package/ui/Modules/Dashboard/components/NoData/index.js +5 -0
  82. package/ui/Modules/Dashboard/components/Picker/Picker.d.ts +8 -0
  83. package/ui/Modules/Dashboard/components/Picker/Picker.js +38 -0
  84. package/ui/Modules/Dashboard/components/Picker/PickerContainer.d.ts +7 -0
  85. package/ui/Modules/Dashboard/components/Picker/PickerContainer.js +38 -0
  86. package/ui/Modules/Dashboard/components/Picker/components/PickerItem.d.ts +8 -0
  87. package/ui/Modules/Dashboard/components/Picker/components/PickerItem.js +25 -0
  88. package/ui/Modules/Dashboard/components/Picker/index.d.ts +2 -0
  89. package/ui/Modules/Dashboard/components/Picker/index.js +5 -0
  90. package/ui/Modules/Dashboard/components/Text/Text.d.ts +7 -0
  91. package/ui/Modules/Dashboard/components/Text/Text.js +14 -0
  92. package/ui/Modules/Dashboard/components/Text/index.d.ts +1 -0
  93. package/ui/Modules/Dashboard/components/Text/index.js +2 -0
  94. package/ui/Modules/Dashboard/components/Widgets/BarChart/BarChart.d.ts +19 -0
  95. package/ui/Modules/Dashboard/components/Widgets/BarChart/BarChart.js +52 -0
  96. package/ui/Modules/Dashboard/components/Widgets/BarChart/Config.d.ts +1 -0
  97. package/ui/Modules/Dashboard/components/Widgets/BarChart/Config.js +5 -0
  98. package/ui/Modules/Dashboard/components/Widgets/BarChart/index.d.ts +4 -0
  99. package/ui/Modules/Dashboard/components/Widgets/BarChart/index.js +6 -0
  100. package/ui/Modules/Dashboard/components/Widgets/BarChart/styles.d.ts +12 -0
  101. package/ui/Modules/Dashboard/components/Widgets/BarChart/styles.js +39 -0
  102. package/ui/Modules/Dashboard/components/Widgets/ColorBox/ColorBox.d.ts +7 -0
  103. package/ui/Modules/Dashboard/components/Widgets/ColorBox/ColorBox.js +21 -0
  104. package/ui/Modules/Dashboard/components/Widgets/ColorBox/Config.d.ts +3 -0
  105. package/ui/Modules/Dashboard/components/Widgets/ColorBox/Config.js +23 -0
  106. package/ui/Modules/Dashboard/components/Widgets/ColorBox/index.d.ts +4 -0
  107. package/ui/Modules/Dashboard/components/Widgets/ColorBox/index.js +6 -0
  108. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/EmptyWidget.d.ts +7 -0
  109. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/EmptyWidget.js +10 -0
  110. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/index.d.ts +2 -0
  111. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/index.js +5 -0
  112. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/Config.d.ts +1 -0
  113. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/Config.js +5 -0
  114. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/HorizontalBar.d.ts +4 -0
  115. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/HorizontalBar.js +38 -0
  116. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.d.ts +8 -0
  117. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.js +14 -0
  118. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/ProgressLine.d.ts +7 -0
  119. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/ProgressLine.js +14 -0
  120. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/index.d.ts +4 -0
  121. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/index.js +6 -0
  122. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/storybook.sample.d.ts +2 -0
  123. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/storybook.sample.js +33 -0
  124. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/styles.d.ts +18 -0
  125. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/styles.js +58 -0
  126. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/types.d.ts +13 -0
  127. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/types.js +1 -0
  128. package/ui/Modules/Dashboard/components/Widgets/NumberBox/Config.d.ts +4 -0
  129. package/ui/Modules/Dashboard/components/Widgets/NumberBox/Config.js +38 -0
  130. package/ui/Modules/Dashboard/components/Widgets/NumberBox/NumberBox.d.ts +5 -0
  131. package/ui/Modules/Dashboard/components/Widgets/NumberBox/NumberBox.js +38 -0
  132. package/ui/Modules/Dashboard/components/Widgets/NumberBox/index.d.ts +4 -0
  133. package/ui/Modules/Dashboard/components/Widgets/NumberBox/index.js +6 -0
  134. package/ui/Modules/Dashboard/components/Widgets/NumberBox/styles.d.ts +4 -0
  135. package/ui/Modules/Dashboard/components/Widgets/NumberBox/styles.js +25 -0
  136. package/ui/Modules/Dashboard/components/Widgets/PieChart/Config.d.ts +1 -0
  137. package/ui/Modules/Dashboard/components/Widgets/PieChart/Config.js +5 -0
  138. package/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.d.ts +21 -0
  139. package/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.js +59 -0
  140. package/ui/Modules/Dashboard/components/Widgets/PieChart/components/CenteredMetric.d.ts +10 -0
  141. package/ui/Modules/Dashboard/components/Widgets/PieChart/components/CenteredMetric.js +24 -0
  142. package/ui/Modules/Dashboard/components/Widgets/PieChart/index.d.ts +4 -0
  143. package/ui/Modules/Dashboard/components/Widgets/PieChart/index.js +6 -0
  144. package/ui/Modules/Dashboard/components/Widgets/PieChart/styles.d.ts +14 -0
  145. package/ui/Modules/Dashboard/components/Widgets/PieChart/styles.js +47 -0
  146. package/ui/Modules/Dashboard/components/Widgets/Table/Config.d.ts +9 -0
  147. package/ui/Modules/Dashboard/components/Widgets/Table/Config.js +87 -0
  148. package/ui/Modules/Dashboard/components/Widgets/Table/Table.d.ts +4 -0
  149. package/ui/Modules/Dashboard/components/Widgets/Table/Table.js +93 -0
  150. package/ui/Modules/Dashboard/components/Widgets/Table/components/IconLabelCell.d.ts +8 -0
  151. package/ui/Modules/Dashboard/components/Widgets/Table/components/IconLabelCell.js +19 -0
  152. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorList.d.ts +9 -0
  153. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorList.js +31 -0
  154. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorLocation.d.ts +8 -0
  155. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorLocation.js +15 -0
  156. package/ui/Modules/Dashboard/components/Widgets/Table/components/TableCell.d.ts +6 -0
  157. package/ui/Modules/Dashboard/components/Widgets/Table/components/TableCell.js +33 -0
  158. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useCondition.d.ts +10 -0
  159. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useCondition.js +27 -0
  160. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/usePages.d.ts +17 -0
  161. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/usePages.js +27 -0
  162. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useSort.d.ts +10 -0
  163. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useSort.js +31 -0
  164. package/ui/Modules/Dashboard/components/Widgets/Table/index.d.ts +5 -0
  165. package/ui/Modules/Dashboard/components/Widgets/Table/index.js +7 -0
  166. package/ui/Modules/Dashboard/components/Widgets/Table/storybook.sample.d.ts +73 -0
  167. package/ui/Modules/Dashboard/components/Widgets/Table/storybook.sample.js +211 -0
  168. package/ui/Modules/Dashboard/components/Widgets/Table/styles.d.ts +23 -0
  169. package/ui/Modules/Dashboard/components/Widgets/Table/styles.js +69 -0
  170. package/ui/Modules/Dashboard/components/Widgets/Table/types.d.ts +52 -0
  171. package/ui/Modules/Dashboard/components/Widgets/Table/types.js +1 -0
  172. package/ui/Modules/Dashboard/components/Widgets/TextBox/TextBox.d.ts +10 -0
  173. package/ui/Modules/Dashboard/components/Widgets/TextBox/TextBox.js +12 -0
  174. package/ui/Modules/Dashboard/components/Widgets/TextBox/index.d.ts +3 -0
  175. package/ui/Modules/Dashboard/components/Widgets/TextBox/index.js +5 -0
  176. package/ui/Modules/Dashboard/components/Widgets/index.d.ts +11 -0
  177. package/ui/Modules/Dashboard/components/Widgets/index.js +108 -0
  178. package/ui/Modules/Dashboard/components/Widgets/utils/generic.d.ts +5 -0
  179. package/ui/Modules/Dashboard/components/Widgets/utils/generic.js +20 -0
  180. package/ui/Modules/Dashboard/components/Widgets/utils/helpers.d.ts +3 -0
  181. package/ui/Modules/Dashboard/components/Widgets/utils/helpers.js +25 -0
  182. package/ui/Modules/Dashboard/components/Widgets/utils/legends.d.ts +20 -0
  183. package/ui/Modules/Dashboard/components/Widgets/utils/legends.js +57 -0
  184. package/ui/Modules/Dashboard/context/ComponentContext.d.ts +5 -0
  185. package/ui/Modules/Dashboard/context/ComponentContext.js +15 -0
  186. package/ui/Modules/Dashboard/context/LangContext.d.ts +3 -0
  187. package/ui/Modules/Dashboard/context/LangContext.js +5 -0
  188. package/ui/Modules/Dashboard/errors/ErrorMessage.d.ts +7 -0
  189. package/ui/Modules/Dashboard/errors/ErrorMessage.js +12 -0
  190. package/ui/Modules/Dashboard/errors/WidgetError.d.ts +5 -0
  191. package/ui/Modules/Dashboard/errors/WidgetError.js +10 -0
  192. package/ui/Modules/Dashboard/hooks/usePrevious.d.ts +5 -0
  193. package/ui/Modules/Dashboard/hooks/usePrevious.js +14 -0
  194. package/ui/Modules/Dashboard/hooks/useRefWithCallback.d.ts +2 -0
  195. package/ui/Modules/Dashboard/hooks/useRefWithCallback.js +16 -0
  196. package/ui/Modules/Dashboard/hooks/useResize.d.ts +6 -0
  197. package/ui/Modules/Dashboard/hooks/useResize.js +19 -0
  198. package/ui/Modules/Dashboard/index.d.ts +7 -0
  199. package/ui/Modules/Dashboard/index.js +12 -0
  200. package/ui/Modules/Dashboard/locale/cs.d.ts +24 -0
  201. package/ui/Modules/Dashboard/locale/cs.js +26 -0
  202. package/ui/Modules/Dashboard/locale/en.d.ts +24 -0
  203. package/ui/Modules/Dashboard/locale/en.js +26 -0
  204. package/ui/Modules/Dashboard/locale/index.d.ts +4 -0
  205. package/ui/Modules/Dashboard/locale/index.js +13 -0
  206. package/ui/Modules/Dashboard/locale/it.d.ts +24 -0
  207. package/ui/Modules/Dashboard/locale/it.js +26 -0
  208. package/ui/Modules/Dashboard/locale/uk.d.ts +24 -0
  209. package/ui/Modules/Dashboard/locale/uk.js +26 -0
  210. package/ui/Modules/Dashboard/store/reducers/index.d.ts +9 -0
  211. package/ui/Modules/Dashboard/store/reducers/index.js +6 -0
  212. package/ui/Modules/Dashboard/store/reducers/widgetListReducer.d.ts +41 -0
  213. package/ui/Modules/Dashboard/store/reducers/widgetListReducer.js +76 -0
  214. package/ui/Modules/Dashboard/stories/storybook.sample.d.ts +50 -0
  215. package/ui/Modules/Dashboard/stories/storybook.sample.js +237 -0
  216. package/ui/Modules/Dashboard/styles.d.ts +63 -0
  217. package/ui/Modules/Dashboard/styles.js +358 -0
  218. package/ui/Modules/Dashboard/types.d.ts +185 -0
  219. package/ui/Modules/Dashboard/types.js +1 -0
  220. package/ui/Modules/index.d.ts +1 -0
  221. package/ui/Modules/index.js +8 -0
  222. package/ui/ThemeProvider/themes/index.d.ts +224 -0
  223. package/ui/ThemeProvider/themes/index.js +3 -1
  224. package/ui/ThemeProvider/themes/mailwiseDark.d.ts +225 -0
  225. package/ui/ThemeProvider/themes/mailwiseDark.js +16 -0
  226. package/ui/ThemeProvider/types.d.ts +1 -1
  227. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +0 -41
  228. package/ui/Blocks/CommonGrid/storybook/stories/default.stories.d.ts +0 -6
  229. package/ui/Blocks/CommonGrid/storybook/stories/gridStates.stories.d.ts +0 -8
  230. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.d.ts +0 -10
  231. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.d.ts +0 -10
  232. package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.d.ts +0 -6
  233. package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.d.ts +0 -10
  234. package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.d.ts +0 -14
  235. package/ui/Blocks/CommonGrid/storybook/stories/withQuickFilter.stories.d.ts +0 -11
  236. package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.d.ts +0 -13
  237. package/ui/Blocks/Header/stories/Header.stories.d.ts +0 -52
  238. package/ui/Blocks/HidePrint/stories/HidePrint.stories.d.ts +0 -12
  239. package/ui/Blocks/ImageList/stories/ImageList.stories.d.ts +0 -14
  240. package/ui/Blocks/LanguageSwitch/stories/LanguageSwith.stories.d.ts +0 -10
  241. package/ui/Blocks/LightBox/stories/LightBox.stories.d.ts +0 -10
  242. package/ui/Blocks/LoginPage/stories/LoginPage.stories.d.ts +0 -10
  243. package/ui/Blocks/Modal/stories/Modal.stories.d.ts +0 -28
  244. package/ui/Blocks/Popover/stories/Popover.stories.d.ts +0 -16
  245. package/ui/Blocks/Scheduler/stories/Scheduler.stories.d.ts +0 -7
  246. package/ui/Blocks/SideMenu/stories/SideMenu.stories.d.ts +0 -11
  247. package/ui/Blocks/Stepper/stories/Stepper.stories.d.ts +0 -9
  248. package/ui/Blocks/Table/stories/Table.stories.d.ts +0 -12
  249. package/ui/Blocks/Tabs/stories/Tabs.stories.d.ts +0 -12
  250. package/ui/Elements/Alert/stories/Alert.stories.d.ts +0 -17
  251. package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.d.ts +0 -10
  252. package/ui/Elements/Avatar/stories/Avatar.stories.d.ts +0 -11
  253. package/ui/Elements/Badge/stories/Badge.stories.d.ts +0 -12
  254. package/ui/Elements/BarChartSymbol/stories/BarChartSymbol.stories.d.ts +0 -12
  255. package/ui/Elements/BorderedBox/stories/BorderedBox.stories.d.ts +0 -10
  256. package/ui/Elements/Button/stories/Button.stories.d.ts +0 -28
  257. package/ui/Elements/Card/stories/Card.stories.d.ts +0 -13
  258. package/ui/Elements/CheckedCircle/storries/CheckedCircle.stories.d.ts +0 -16
  259. package/ui/Elements/DatePicker/stories/DatePicker.stories.d.ts +0 -11
  260. package/ui/Elements/Dropdown/stories/Dropdown.stories.d.ts +0 -10
  261. package/ui/Elements/DropdownMenu/stories/DropdownMenu.stories.d.ts +0 -10
  262. package/ui/Elements/DropdownSelect/stories/DropdownSelect.stories.d.ts +0 -22
  263. package/ui/Elements/ErrorMessage/stories/ErrorMessage.stories.d.ts +0 -11
  264. package/ui/Elements/HighlightBox/stories/HighlightBox.stories.d.ts +0 -31
  265. package/ui/Elements/Icon/stories/BadgeIcon.stories.d.ts +0 -28
  266. package/ui/Elements/Icon/stories/Icon.stories.d.ts +0 -15
  267. package/ui/Elements/Image/stories/Image.stories.d.ts +0 -13
  268. package/ui/Elements/Label/stories/Label.stories.d.ts +0 -13
  269. package/ui/Elements/Line/stories/Line.stories.d.ts +0 -16
  270. package/ui/Elements/Link/stories/Link.stories.d.ts +0 -30
  271. package/ui/Elements/Logo/stories/Logo.stories.d.ts +0 -37
  272. package/ui/Elements/Pagination/stories/Pagination.stories.d.ts +0 -13
  273. package/ui/Elements/Portal/stories/Portal.stories.d.ts +0 -11
  274. package/ui/Elements/ProgressBar/stories/ProgressBar.stories.d.ts +0 -18
  275. package/ui/Elements/Select/stories/Select.stories.d.ts +0 -9
  276. package/ui/Elements/SimpleLink/stories/SimpleLink.stories.d.ts +0 -13
  277. package/ui/Elements/SingleSelect/stories/SingleSelect.stories.d.ts +0 -10
  278. package/ui/Elements/SpaceAround/stories/SpaceAround.stories.d.ts +0 -11
  279. package/ui/Elements/Spinner/stories/Spinner.stories.d.ts +0 -19
  280. package/ui/Elements/Table/stories/Table.stories.d.ts +0 -8
  281. package/ui/Elements/Tag/stories/Tag.stories.d.ts +0 -19
  282. package/ui/Elements/Text/stories/Text.stories.d.ts +0 -15
  283. package/ui/Elements/Toast/stories/Toast.stories.d.ts +0 -13
  284. package/ui/Elements/Toggle/stories/Toggle.stories.d.ts +0 -16
  285. package/ui/Elements/Tooltip/stories/Tooltip.stories.d.ts +0 -10
  286. package/ui/Elements/Typography/stories/Typography.stories.d.ts +0 -20
  287. package/ui/Forms/Checkbox/stories/Checkbox.stories.d.ts +0 -13
  288. package/ui/Forms/Input/stories/Input.stories.d.ts +0 -18
  289. package/ui/Forms/RadioButton/stories/RadioButton.stories.d.ts +0 -13
  290. package/ui/utils/KeyPress/KeyPress.stories.d.ts +0 -10
@@ -0,0 +1,31 @@
1
+ import { actions } from "../../store/reducers/widgetListReducer.js";
2
+ import LangContext from "../../context/LangContext.js";
3
+ import ComponentContext, { defaultComponents } from "../../context/ComponentContext.js";
4
+ import DashboardComponent from "./Dashboard.js";
5
+ import HandleChange from "./components/HandleChange.js";
6
+ import React from "react";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { useDispatch } from "react-redux";
9
+ //#region packages/ui/Modules/Dashboard/components/Dashboard/DashboardContainer.tsx
10
+ const DashboardContainer = ({ initialWidgets, onChange, lang = "en", components, ...rest }) => {
11
+ const dispatch = useDispatch();
12
+ /**
13
+ * on mount move data from props to store
14
+ */
15
+ React.useEffect(() => {
16
+ if (initialWidgets) dispatch(actions.initWidgets(initialWidgets));
17
+ }, [dispatch, JSON.stringify(initialWidgets)]);
18
+ const mergedComponents = React.useMemo(() => ({
19
+ ...defaultComponents,
20
+ ...components || {}
21
+ }), [components]);
22
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(LangContext.Provider, {
23
+ value: lang,
24
+ children: /* @__PURE__ */ jsx(ComponentContext.Provider, {
25
+ value: mergedComponents,
26
+ children: /* @__PURE__ */ jsx(DashboardComponent, { ...rest })
27
+ })
28
+ }), /* @__PURE__ */ jsx(HandleChange, { onChange })] });
29
+ };
30
+ //#endregion
31
+ export { DashboardContainer as default };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { JSX } from 'react';
3
+ interface DashboardBodyProps {
4
+ children: React.ReactElement;
5
+ }
6
+ declare const DashboardBody: ({ children }: DashboardBodyProps) => JSX.Element;
7
+ export default DashboardBody;
@@ -0,0 +1,7 @@
1
+ import styles_default from "../../../styles.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region packages/ui/Modules/Dashboard/components/Dashboard/components/Body.tsx
5
+ const DashboardBody = ({ children }) => /* @__PURE__ */ jsx(styles_default.Body, { children });
6
+ //#endregion
7
+ export { DashboardBody as default };
@@ -0,0 +1,6 @@
1
+ import type { JSX } from 'react';
2
+ import type { DashboardProps } from '../../../types';
3
+ declare const HandleChange: ({ onChange }: {
4
+ onChange: DashboardProps["onChange"];
5
+ }) => JSX.Element;
6
+ export default HandleChange;
@@ -0,0 +1,25 @@
1
+ import { selectors } from "../../../store/reducers/widgetListReducer.js";
2
+ import React from "react";
3
+ import { Fragment, jsx } from "react/jsx-runtime";
4
+ import { useSelector } from "react-redux";
5
+ //#region packages/ui/Modules/Dashboard/components/Dashboard/components/HandleChange.tsx
6
+ const useEffectChange = (onChange, widgets, deps) => {
7
+ const [wasFirstRender, setWasFirstRender] = React.useState(false);
8
+ React.useEffect(() => {
9
+ if (!onChange) return;
10
+ if (!wasFirstRender && widgets !== null) {
11
+ setWasFirstRender(true);
12
+ return;
13
+ }
14
+ onChange();
15
+ }, deps);
16
+ };
17
+ const HandleChange = ({ onChange }) => {
18
+ const widgets = useSelector(selectors.getWidgets);
19
+ useEffectChange(() => {
20
+ if (onChange && widgets !== null) onChange(widgets);
21
+ }, widgets, [onChange, JSON.stringify(widgets)]);
22
+ return /* @__PURE__ */ jsx(Fragment, {});
23
+ };
24
+ //#endregion
25
+ export { HandleChange as default };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ interface LayoutErrorBoundaryProps {
3
+ children: React.ReactNode;
4
+ }
5
+ type LayoutErrorBoundaryState = {
6
+ error: Error | null;
7
+ };
8
+ declare class LayoutErrorBoundary extends React.Component<LayoutErrorBoundaryProps, LayoutErrorBoundaryState> {
9
+ constructor(props: LayoutErrorBoundaryProps);
10
+ static getDerivedStateFromError(error: Error): LayoutErrorBoundaryState;
11
+ render(): React.ReactNode;
12
+ }
13
+ export default LayoutErrorBoundary;
@@ -0,0 +1,19 @@
1
+ import styles_default from "../../../styles.js";
2
+ import React from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region packages/ui/Modules/Dashboard/components/Dashboard/components/LayoutErrorBoundary.tsx
5
+ var LayoutErrorBoundary = class extends React.Component {
6
+ constructor(props) {
7
+ super(props);
8
+ this.state = { error: null };
9
+ }
10
+ static getDerivedStateFromError(error) {
11
+ return { error };
12
+ }
13
+ render() {
14
+ if (this.state.error) return /* @__PURE__ */ jsxs(styles_default.LayoutError, { children: [/* @__PURE__ */ jsx(styles_default.LayoutErrorTitle, { children: "Something went wrong." }), /* @__PURE__ */ jsx(styles_default.LayoutErrorMessage, { children: this.state.error?.message })] });
15
+ return this.props.children;
16
+ }
17
+ };
18
+ //#endregion
19
+ export { LayoutErrorBoundary as default };
@@ -0,0 +1,124 @@
1
+ .react-grid-layout {
2
+ transition: height .2s;
3
+ position: relative;
4
+ }
5
+
6
+ .react-grid-item {
7
+ transition: left .2s, top .2s;
8
+ }
9
+
10
+ .react-grid-item img {
11
+ pointer-events: none;
12
+ user-select: none;
13
+ }
14
+
15
+ .react-grid-item.cssTransforms {
16
+ transition-property: transform;
17
+ }
18
+
19
+ .react-grid-item.resizing {
20
+ z-index: 1;
21
+ will-change: width, height;
22
+ }
23
+
24
+ .react-grid-item.react-draggable-dragging {
25
+ z-index: 3;
26
+ will-change: transform;
27
+ transition: none;
28
+ }
29
+
30
+ .react-grid-item.dropping {
31
+ visibility: hidden;
32
+ }
33
+
34
+ .react-grid-item.react-grid-placeholder {
35
+ opacity: .2;
36
+ z-index: 2;
37
+ -webkit-user-select: none;
38
+ -moz-user-select: none;
39
+ -ms-user-select: none;
40
+ user-select: none;
41
+ -o-user-select: none;
42
+ background: red;
43
+ transition-duration: .1s;
44
+ }
45
+
46
+ .react-grid-item > .react-resizable-handle {
47
+ width: 20px;
48
+ height: 20px;
49
+ position: absolute;
50
+ }
51
+
52
+ .react-grid-item > .react-resizable-handle:after {
53
+ content: "";
54
+ border-bottom: 2px solid #0006;
55
+ border-right: 2px solid #0006;
56
+ width: 5px;
57
+ height: 5px;
58
+ position: absolute;
59
+ bottom: 3px;
60
+ right: 3px;
61
+ }
62
+
63
+ .react-resizable-hide > .react-resizable-handle {
64
+ display: none;
65
+ }
66
+
67
+ .react-grid-item > .react-resizable-handle.react-resizable-handle-sw {
68
+ cursor: sw-resize;
69
+ bottom: 0;
70
+ left: 0;
71
+ transform: rotate(90deg);
72
+ }
73
+
74
+ .react-grid-item > .react-resizable-handle.react-resizable-handle-se {
75
+ cursor: se-resize;
76
+ bottom: 0;
77
+ right: 0;
78
+ }
79
+
80
+ .react-grid-item > .react-resizable-handle.react-resizable-handle-nw {
81
+ cursor: nw-resize;
82
+ top: 0;
83
+ left: 0;
84
+ transform: rotate(180deg);
85
+ }
86
+
87
+ .react-grid-item > .react-resizable-handle.react-resizable-handle-ne {
88
+ cursor: ne-resize;
89
+ top: 0;
90
+ right: 0;
91
+ transform: rotate(270deg);
92
+ }
93
+
94
+ .react-grid-item > .react-resizable-handle.react-resizable-handle-w, .react-grid-item > .react-resizable-handle.react-resizable-handle-e {
95
+ cursor: ew-resize;
96
+ margin-top: -10px;
97
+ top: 50%;
98
+ }
99
+
100
+ .react-grid-item > .react-resizable-handle.react-resizable-handle-w {
101
+ left: 0;
102
+ transform: rotate(135deg);
103
+ }
104
+
105
+ .react-grid-item > .react-resizable-handle.react-resizable-handle-e {
106
+ right: 0;
107
+ transform: rotate(315deg);
108
+ }
109
+
110
+ .react-grid-item > .react-resizable-handle.react-resizable-handle-n, .react-grid-item > .react-resizable-handle.react-resizable-handle-s {
111
+ cursor: ns-resize;
112
+ margin-left: -10px;
113
+ left: 50%;
114
+ }
115
+
116
+ .react-grid-item > .react-resizable-handle.react-resizable-handle-n {
117
+ top: 0;
118
+ transform: rotate(225deg);
119
+ }
120
+
121
+ .react-grid-item > .react-resizable-handle.react-resizable-handle-s {
122
+ bottom: 0;
123
+ transform: rotate(45deg);
124
+ }
@@ -0,0 +1,2 @@
1
+ import DashboardContainer from './DashboardContainer';
2
+ export default DashboardContainer;
@@ -0,0 +1,5 @@
1
+ import DashboardContainer from "./DashboardContainer.js";
2
+ //#region packages/ui/Modules/Dashboard/components/Dashboard/index.ts
3
+ var Dashboard_default = DashboardContainer;
4
+ //#endregion
5
+ export { Dashboard_default as default };
@@ -0,0 +1,8 @@
1
+ import type { JSX } from 'react';
2
+ import type { WidgetDefinition } from '../../types';
3
+ interface HeaderProps {
4
+ title?: string | boolean;
5
+ widgetDefinitions: WidgetDefinition[];
6
+ }
7
+ declare const Header: ({ title, widgetDefinitions }: HeaderProps) => JSX.Element | null;
8
+ export default Header;
@@ -0,0 +1,9 @@
1
+ import styles_default from "../../styles.js";
2
+ import Text from "../Text/Text.js";
3
+ import Picker_default from "../Picker/index.js";
4
+ import "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region packages/ui/Modules/Dashboard/components/Header/Header.tsx
7
+ const Header = ({ title = "", widgetDefinitions }) => /* @__PURE__ */ jsxs(styles_default.Header, { children: [/* @__PURE__ */ jsx("h1", { children: title || title === false || /* @__PURE__ */ jsx(Text, { code: "dashboard.title" }) }), /* @__PURE__ */ jsx(Picker_default, { widgetDefinitions })] });
8
+ //#endregion
9
+ export { Header as default };
@@ -0,0 +1,2 @@
1
+ import Header from './Header';
2
+ export default Header;
@@ -0,0 +1,5 @@
1
+ import Header from "./Header.js";
2
+ //#region packages/ui/Modules/Dashboard/components/Header/index.ts
3
+ var Header_default = Header;
4
+ //#endregion
5
+ export { Header_default as default };
@@ -0,0 +1,18 @@
1
+ import type { JSX } from 'react';
2
+ import { Layout } from 'react-grid-layout';
3
+ import type { LayoutWidgetItem, WidgetDefinition } from '../../types';
4
+ export declare const rowHeight = 100;
5
+ export declare const margin: [number, number];
6
+ interface DashboardLayoutProps {
7
+ widgetDefinitions: WidgetDefinition[];
8
+ widgetList: LayoutWidgetItem[] | null;
9
+ onLayoutChange: (layout: Layout[]) => void;
10
+ openedConfigs: string[];
11
+ toggleOpenedConfig: (widgetId: string) => void;
12
+ onSetHeight: (id: string, height: number) => void;
13
+ }
14
+ /**
15
+ * Map of items
16
+ */
17
+ declare const DashboardLayout: ({ widgetList, widgetDefinitions, onLayoutChange, toggleOpenedConfig, openedConfigs, onSetHeight }: DashboardLayoutProps) => JSX.Element;
18
+ export default DashboardLayout;
@@ -0,0 +1,39 @@
1
+ import styles_default from "../../styles.js";
2
+ import Text from "../Text/Text.js";
3
+ import Item_default from "./components/Item/index.js";
4
+ import "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import GridLayout, { WidthProvider } from "react-grid-layout";
7
+ //#region packages/ui/Modules/Dashboard/components/Layout/Layout.tsx
8
+ const rowHeight = 100;
9
+ const margin = [20, 20];
10
+ const GridLayoutWithWidth = WidthProvider(GridLayout);
11
+ /**
12
+ * Map of items
13
+ */
14
+ const DashboardLayout = ({ widgetList, widgetDefinitions, onLayoutChange, toggleOpenedConfig, openedConfigs, onSetHeight }) => {
15
+ if (!widgetList?.length) return /* @__PURE__ */ jsx(styles_default.Nowidget, { children: /* @__PURE__ */ jsx(Text, { code: "layout.nowidget" }) });
16
+ return /* @__PURE__ */ jsx(GridLayoutWithWidth, {
17
+ className: "layout",
18
+ rowHeight: 100,
19
+ margin,
20
+ onLayoutChange,
21
+ layout: widgetList.map((widgetItem) => widgetItem.layout),
22
+ draggableHandle: ".drag-handle",
23
+ children: widgetList.map((widgetItem) => {
24
+ const isConfigOpen = openedConfigs.includes(widgetItem.id) || widgetItem.config === null;
25
+ return /* @__PURE__ */ jsx(styles_default.LayoutItem, {
26
+ isConfigOpen,
27
+ children: /* @__PURE__ */ jsx(Item_default, {
28
+ widgetItem,
29
+ widgetDefinitions,
30
+ toggleOpenedConfig,
31
+ isConfigOpen,
32
+ onSetHeight
33
+ })
34
+ }, widgetItem.id);
35
+ })
36
+ });
37
+ };
38
+ //#endregion
39
+ export { DashboardLayout as default, margin, rowHeight };
@@ -0,0 +1,7 @@
1
+ import type { JSX } from 'react';
2
+ import type { WidgetDefinition } from '../../types';
3
+ type DashboardLayoutContainerProps = {
4
+ widgetDefinitions: WidgetDefinition[];
5
+ };
6
+ declare const LayoutContainer: ({ widgetDefinitions }: DashboardLayoutContainerProps) => JSX.Element;
7
+ export default LayoutContainer;
@@ -0,0 +1,40 @@
1
+ import { actions, selectors } from "../../store/reducers/widgetListReducer.js";
2
+ import DashboardLayout, { margin } from "./Layout.js";
3
+ import React from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { useDispatch, useSelector } from "react-redux";
6
+ //#region packages/ui/Modules/Dashboard/components/Layout/LayoutContainer.tsx
7
+ const LayoutContainer = ({ widgetDefinitions }) => {
8
+ const dispatch = useDispatch();
9
+ const widgetList = useSelector(selectors.getWidgets);
10
+ const handleLayoutChange = React.useCallback((layouts) => {
11
+ dispatch(actions.setWidgetsLayout(layouts));
12
+ }, [dispatch]);
13
+ const [openedConfigs, setOpenedConfigs] = React.useState([]);
14
+ const handleSetHeight = React.useCallback((widgetId, height) => {
15
+ const widgetItem = widgetList?.find((widgetItem) => widgetItem.layout.i === widgetId);
16
+ if (!height || !widgetList || !widgetItem) return;
17
+ const { layout } = widgetItem;
18
+ const optimalH = Math.ceil((height + margin[1]) / (100 + margin[1]));
19
+ const newH = Math.min(Math.max(layout.minH || 0, optimalH), layout.maxH || 100);
20
+ if (layout.h !== newH) dispatch(actions.setWidgetsLayout(widgetList.map((widgetItem) => ({
21
+ ...widgetItem.layout,
22
+ ...widgetItem.layout.i === widgetId ? {
23
+ ...layout,
24
+ h: newH
25
+ } : {}
26
+ }))));
27
+ }, [widgetList, dispatch]);
28
+ return /* @__PURE__ */ jsx(DashboardLayout, {
29
+ widgetDefinitions,
30
+ widgetList,
31
+ onLayoutChange: handleLayoutChange,
32
+ toggleOpenedConfig: React.useCallback((widgetId) => {
33
+ setOpenedConfigs((state) => state.includes(widgetId) ? state.filter((id) => id !== widgetId) : [...state, widgetId]);
34
+ }, [setOpenedConfigs]),
35
+ openedConfigs,
36
+ onSetHeight: handleSetHeight
37
+ });
38
+ };
39
+ //#endregion
40
+ export { LayoutContainer as default };
@@ -0,0 +1,18 @@
1
+ import type { JSX } from 'react';
2
+ import { WidgetDefinition, WidgetConfig } from '../../../../types';
3
+ type DashboardItemProps = {
4
+ id: string;
5
+ widget: WidgetDefinition;
6
+ newConfig: WidgetConfig;
7
+ config: WidgetConfig;
8
+ onRemove: () => void;
9
+ onSave: () => void;
10
+ onCancel: () => void;
11
+ onSetConfig: (config: WidgetConfig) => void;
12
+ onSetHeight: (id: string, height: number) => void;
13
+ onSaveConfigProps: (props: Record<string, any>) => void;
14
+ isConfigOpen: boolean;
15
+ toggleConfigOpen: () => void;
16
+ };
17
+ declare const DashboardItem: ({ id, widget, newConfig, config, onRemove, onSetConfig, onSetHeight, onSave, onCancel, isConfigOpen, toggleConfigOpen, onSaveConfigProps, }: DashboardItemProps) => JSX.Element;
18
+ export default DashboardItem;
@@ -0,0 +1,79 @@
1
+ import styles_default from "../../../../styles.js";
2
+ import ComponentContext from "../../../../context/ComponentContext.js";
3
+ import ItemConfig_default from "../ItemConfig/index.js";
4
+ import usePrevious from "../../../../hooks/usePrevious.js";
5
+ import { useRefWithCallback } from "../../../../hooks/useRefWithCallback.js";
6
+ import "../../Layout.js";
7
+ import React, { useCallback, useEffect, useRef, useState } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ //#region packages/ui/Modules/Dashboard/components/Layout/components/Item/Item.tsx
10
+ const WidgetsWithFullHeight = ["table", "chart"];
11
+ const DashboardItem = ({ id, widget, newConfig, config, onRemove, onSetConfig, onSetHeight, onSave, onCancel, isConfigOpen, toggleConfigOpen, onSaveConfigProps }) => {
12
+ const { ItemHeader } = React.useContext(ComponentContext);
13
+ const Widget = widget.component;
14
+ const configInDropdown = widget.isWidgetConfigInDropdown || false;
15
+ const widgetRef = useRef(null);
16
+ const headerRef = useRef(null);
17
+ const headerHeight = (headerRef.current?.clientHeight || 0) + 40;
18
+ const wasConfigOpen = usePrevious(isConfigOpen);
19
+ const [isChanged, refCallback, ref] = useRefWithCallback();
20
+ const canChangeHeight = !WidgetsWithFullHeight.includes(widget?.code);
21
+ const [widgetWithPaginationHeight, setWidgetWithPaginationHeight] = useState(null);
22
+ const returnWidgetWithPaginationHeight = useCallback((height) => {
23
+ height && setWidgetWithPaginationHeight(height);
24
+ }, []);
25
+ useEffect(() => {
26
+ if (!configInDropdown && wasConfigOpen === false && isConfigOpen) onSetHeight(id, widget.initHeight * 100);
27
+ }, [isConfigOpen]);
28
+ useEffect(() => {
29
+ if (!configInDropdown && !isConfigOpen && canChangeHeight && wasConfigOpen === true) onSetHeight(id, (ref.current?.clientHeight || 0) + headerHeight);
30
+ }, [isConfigOpen, isChanged]);
31
+ useEffect(() => {
32
+ if (!canChangeHeight && !isConfigOpen && wasConfigOpen === true) widgetWithPaginationHeight && onSetHeight(id, widgetWithPaginationHeight + headerHeight);
33
+ }, [isConfigOpen, widgetWithPaginationHeight]);
34
+ const ItemConfigJSX = /* @__PURE__ */ jsx(ItemConfig_default, {
35
+ config: newConfig,
36
+ onCancel,
37
+ onRemove,
38
+ onSetConfig,
39
+ onSave,
40
+ component: widget.configComponent
41
+ });
42
+ return /* @__PURE__ */ jsxs(styles_default.ItemWrapper, { children: [
43
+ /* @__PURE__ */ jsx(ItemHeader, {
44
+ dragHandleClassName: "drag-handle",
45
+ widget,
46
+ config,
47
+ onSave,
48
+ headerRef,
49
+ onRemove,
50
+ isConfigOpen,
51
+ toggleConfigOpen
52
+ }),
53
+ /* @__PURE__ */ jsx(styles_default.ItemBodyWrapper, {
54
+ isConfigOpen,
55
+ children: /* @__PURE__ */ jsxs(styles_default.ItemBody, {
56
+ isConfigOpen,
57
+ inDropdown: configInDropdown,
58
+ isFullHeight: !canChangeHeight,
59
+ children: [!configInDropdown && /* @__PURE__ */ jsx(styles_default.WidgetConfig, {
60
+ isConfigOpen,
61
+ inDropdown: configInDropdown,
62
+ children: ItemConfigJSX
63
+ }), /* @__PURE__ */ jsx(styles_default.WidgetVisibility, {
64
+ isVisible: !isConfigOpen,
65
+ children: /* @__PURE__ */ jsx(Widget, {
66
+ config,
67
+ innerRef: canChangeHeight ? refCallback : widgetRef,
68
+ onSaveConfigProps,
69
+ components: widget.components,
70
+ returnWidgetWithPaginationHeight
71
+ })
72
+ })]
73
+ })
74
+ }),
75
+ configInDropdown && isConfigOpen && /* @__PURE__ */ jsx(styles_default.WidgetConfigInDropdown, { children: ItemConfigJSX })
76
+ ] });
77
+ };
78
+ //#endregion
79
+ export { DashboardItem as default };
@@ -0,0 +1,11 @@
1
+ import type { JSX } from 'react';
2
+ import type { WidgetDefinition, LayoutWidgetItem } from '../../../../types';
3
+ type ItemContainerProps = {
4
+ widgetDefinitions: WidgetDefinition[];
5
+ widgetItem: LayoutWidgetItem;
6
+ toggleOpenedConfig: (id: string) => void;
7
+ isConfigOpen: boolean;
8
+ onSetHeight: (id: string, height: number) => void;
9
+ };
10
+ declare const ItemContainer: ({ widgetItem, widgetDefinitions, toggleOpenedConfig, isConfigOpen, onSetHeight }: ItemContainerProps) => JSX.Element;
11
+ export default ItemContainer;
@@ -0,0 +1,64 @@
1
+ import { actions } from "../../../../store/reducers/widgetListReducer.js";
2
+ import { NoWidget } from "../../../Widgets/index.js";
3
+ import WidgetErrorBoundary from "./WidgetErrorBoundary.js";
4
+ import DashboardItem from "./Item.js";
5
+ import { useCallback, useMemo, useState } from "react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import throttle from "lodash/throttle";
8
+ import { useDispatch } from "react-redux";
9
+ //#region packages/ui/Modules/Dashboard/components/Layout/components/Item/ItemContainer.tsx
10
+ const SET_CONFIG_DELAY = 200;
11
+ const ItemContainer = ({ widgetItem, widgetDefinitions, toggleOpenedConfig, isConfigOpen, onSetHeight }) => {
12
+ const dispatch = useDispatch();
13
+ const [newConfig, setConfig] = useState(widgetItem.config);
14
+ const widget = widgetDefinitions.find((w) => w.code === widgetItem.code);
15
+ const toggleConfigOpen = useCallback(() => {
16
+ toggleOpenedConfig(widgetItem.id);
17
+ }, [toggleOpenedConfig, widgetItem.id]);
18
+ const handleSave = useCallback((config) => dispatch(actions.setWidgetsConfig(widgetItem.id, config)), [dispatch, widgetItem.id]);
19
+ const handleRemove = useCallback(() => dispatch(actions.removeWidget(widgetItem.id)), [widgetItem.id, dispatch]);
20
+ const setConfigThrottleted = useMemo(() => throttle(setConfig, SET_CONFIG_DELAY), [setConfig]);
21
+ const saveConfigThrottleted = useMemo(() => throttle(handleSave, SET_CONFIG_DELAY), [handleSave]);
22
+ const onSave = useCallback(() => {
23
+ if (widgetItem.config) toggleConfigOpen();
24
+ handleSave(newConfig);
25
+ }, [
26
+ handleSave,
27
+ toggleConfigOpen,
28
+ newConfig,
29
+ widgetItem.config
30
+ ]);
31
+ const onCancel = useCallback(() => {
32
+ toggleConfigOpen();
33
+ setConfig(widgetItem.config);
34
+ }, [
35
+ widgetItem.config,
36
+ setConfig,
37
+ toggleConfigOpen
38
+ ]);
39
+ const handeSaveConfigProps = useCallback((props) => {
40
+ saveConfigThrottleted({
41
+ ...newConfig,
42
+ ...props
43
+ });
44
+ }, [saveConfigThrottleted, newConfig]);
45
+ return /* @__PURE__ */ jsx(WidgetErrorBoundary, {
46
+ onRemove: handleRemove,
47
+ children: /* @__PURE__ */ jsx(DashboardItem, {
48
+ id: widgetItem.layout.i,
49
+ widget: widget || NoWidget,
50
+ config: widgetItem.config,
51
+ newConfig,
52
+ onRemove: handleRemove,
53
+ isConfigOpen,
54
+ toggleConfigOpen: !isConfigOpen ? toggleConfigOpen : onCancel,
55
+ onSetConfig: setConfigThrottleted,
56
+ onSaveConfigProps: handeSaveConfigProps,
57
+ onSave,
58
+ onCancel,
59
+ onSetHeight
60
+ })
61
+ });
62
+ };
63
+ //#endregion
64
+ export { ItemContainer as default };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ type WidgetErrorBoundaryProps = {
3
+ children: React.ReactNode;
4
+ onRemove: () => void;
5
+ };
6
+ type WidgetErrorBoundaryState = {
7
+ error: Error | null;
8
+ };
9
+ declare class WidgetErrorBoundary extends React.Component<WidgetErrorBoundaryProps, WidgetErrorBoundaryState> {
10
+ constructor(props: WidgetErrorBoundaryProps);
11
+ static getDerivedStateFromError(error: Error): WidgetErrorBoundaryState;
12
+ render(): React.ReactNode;
13
+ }
14
+ export default WidgetErrorBoundary;
@@ -0,0 +1,28 @@
1
+ import styles_default from "../../../../styles.js";
2
+ import Text from "../../../Text/Text.js";
3
+ import ComponentContext from "../../../../context/ComponentContext.js";
4
+ import React from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region packages/ui/Modules/Dashboard/components/Layout/components/Item/WidgetErrorBoundary.tsx
7
+ var WidgetErrorBoundary = class extends React.Component {
8
+ constructor(props) {
9
+ super(props);
10
+ this.state = { error: null };
11
+ }
12
+ static getDerivedStateFromError(error) {
13
+ return { error };
14
+ }
15
+ render() {
16
+ if (this.state.error) return /* @__PURE__ */ jsxs(styles_default.WidgetError, { children: [
17
+ /* @__PURE__ */ jsx(styles_default.WidgetErrorTitle, { children: "ERROR: Something went wrong." }),
18
+ /* @__PURE__ */ jsx(styles_default.WidgetErrorMessage, { children: this.state.error?.message }),
19
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ComponentContext.Consumer, { children: ({ Button }) => /* @__PURE__ */ jsx(Button, {
20
+ onClick: this.props.onRemove,
21
+ children: /* @__PURE__ */ jsx(Text, { code: "buttons.removeWidget" })
22
+ }) }) })
23
+ ] });
24
+ return this.props.children;
25
+ }
26
+ };
27
+ //#endregion
28
+ export { WidgetErrorBoundary as default };
@@ -0,0 +1,2 @@
1
+ import ItemContainer from './ItemContainer';
2
+ export default ItemContainer;
@@ -0,0 +1,5 @@
1
+ import ItemContainer from "./ItemContainer.js";
2
+ //#region packages/ui/Modules/Dashboard/components/Layout/components/Item/index.tsx
3
+ var Item_default = ItemContainer;
4
+ //#endregion
5
+ export { Item_default as default };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { JSX } from 'react';
3
+ import { WidgetConfig, ConfigProps } from '../../../../types';
4
+ interface ItemConfigProps {
5
+ config: WidgetConfig;
6
+ onRemove: () => void;
7
+ onSetConfig: (config: WidgetConfig) => void;
8
+ onSave: () => void;
9
+ onCancel: () => void;
10
+ component?: React.ComponentType<ConfigProps>;
11
+ }
12
+ declare const ItemConfig: ({ onCancel, config, onSetConfig, onSave, onRemove, component: ConfigComponent, }: ItemConfigProps) => JSX.Element;
13
+ export default ItemConfig;
@@ -0,0 +1,18 @@
1
+ import ComponentContext from "../../../../context/ComponentContext.js";
2
+ import React from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ //#region packages/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfig.tsx
5
+ const DefaultConfig = () => null;
6
+ const ItemConfig = ({ onCancel, config, onSetConfig, onSave, onRemove, component: ConfigComponent = DefaultConfig }) => {
7
+ const { ItemConfigControls } = React.useContext(ComponentContext);
8
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ConfigComponent, {
9
+ onChange: onSetConfig,
10
+ config
11
+ }) }), /* @__PURE__ */ jsx(ItemConfigControls, {
12
+ onRemove,
13
+ onSave,
14
+ onCancel
15
+ })] });
16
+ };
17
+ //#endregion
18
+ export { ItemConfig as default };