@mailstep/design-system 0.5.1-beta.2 → 0.6.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 (299) hide show
  1. package/package.json +40 -20
  2. package/ui/Blocks/CommonGrid/CommonGrid.d.ts +5 -2
  3. package/ui/Blocks/CommonGrid/CommonGrid.js +12 -22
  4. package/ui/Blocks/CommonGrid/CommonGridContainer.d.ts +3 -0
  5. package/ui/Blocks/CommonGrid/CommonGridContainer.js +66 -0
  6. package/ui/Blocks/CommonGrid/StandardButtons.d.ts +4 -0
  7. package/ui/Blocks/CommonGrid/StandardButtons.js +36 -0
  8. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.d.ts +12 -0
  9. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +50 -0
  10. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.d.ts +11 -0
  11. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +18 -0
  12. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.d.ts +12 -0
  13. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +45 -0
  14. package/ui/Blocks/CommonGrid/components/ActionHead/index.d.ts +2 -0
  15. package/ui/Blocks/CommonGrid/components/ActionHead/index.js +2 -0
  16. package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.d.ts +6 -0
  17. package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +37 -0
  18. package/ui/Blocks/CommonGrid/components/BooleanSelect/index.d.ts +2 -0
  19. package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +2 -0
  20. package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.d.ts +13 -0
  21. package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +32 -0
  22. package/ui/Blocks/CommonGrid/components/ButtonMore/index.d.ts +2 -0
  23. package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +2 -0
  24. package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +1 -1
  25. package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.d.ts +5 -0
  26. package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +58 -0
  27. package/ui/Blocks/CommonGrid/components/ColumnTitle/index.d.ts +2 -0
  28. package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +2 -0
  29. package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.d.ts +11 -0
  30. package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +20 -0
  31. package/ui/Blocks/CommonGrid/components/ControlButtons/index.d.ts +2 -0
  32. package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +2 -0
  33. package/ui/Blocks/CommonGrid/components/DataRow.js +4 -4
  34. package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.d.ts +12 -0
  35. package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +113 -0
  36. package/ui/Blocks/CommonGrid/components/DatePickerRange/index.d.ts +2 -0
  37. package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +2 -0
  38. package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.d.ts +1 -0
  39. package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +3 -0
  40. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.d.ts +8 -0
  41. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +43 -0
  42. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.d.ts +2 -0
  43. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +2 -0
  44. package/ui/Blocks/CommonGrid/components/FilterRow.js +2 -3
  45. package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.d.ts +7 -0
  46. package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +46 -0
  47. package/ui/Blocks/CommonGrid/components/FloatingButton/index.d.ts +2 -0
  48. package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +2 -0
  49. package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.d.ts +10 -0
  50. package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +19 -0
  51. package/ui/Blocks/CommonGrid/components/GridSelect/index.d.ts +2 -0
  52. package/ui/Blocks/CommonGrid/components/GridSelect/index.js +2 -0
  53. package/ui/Blocks/CommonGrid/components/HeadCell.js +1 -4
  54. package/ui/Blocks/CommonGrid/components/IconList/IconList.d.ts +18 -0
  55. package/ui/Blocks/CommonGrid/components/IconList/IconList.js +29 -0
  56. package/ui/Blocks/CommonGrid/components/IconList/index.d.ts +2 -0
  57. package/ui/Blocks/CommonGrid/components/IconList/index.js +2 -0
  58. package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.d.ts +11 -0
  59. package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +20 -0
  60. package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +12 -0
  61. package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +47 -0
  62. package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.d.ts +2 -0
  63. package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +2 -0
  64. package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.d.ts +3 -0
  65. package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +76 -0
  66. package/ui/Blocks/CommonGrid/components/NumberRange/index.d.ts +2 -0
  67. package/ui/Blocks/CommonGrid/components/NumberRange/index.js +2 -0
  68. package/ui/Blocks/CommonGrid/components/NumberRange/types.d.ts +17 -0
  69. package/ui/Blocks/CommonGrid/components/NumberRange/types.js +1 -0
  70. package/ui/Blocks/CommonGrid/components/OversizedScroll.js +1 -4
  71. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.d.ts +6 -0
  72. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +26 -0
  73. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.d.ts +2 -0
  74. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +2 -0
  75. package/ui/Blocks/CommonGrid/components/Table.d.ts +0 -6
  76. package/ui/Blocks/CommonGrid/components/Table.js +0 -5
  77. package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.d.ts +8 -0
  78. package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +32 -0
  79. package/ui/Blocks/CommonGrid/components/TablePagination/index.d.ts +2 -0
  80. package/ui/Blocks/CommonGrid/components/TablePagination/index.js +2 -0
  81. package/ui/Blocks/CommonGrid/components/TextRange/TextRange.d.ts +4 -0
  82. package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +89 -0
  83. package/ui/Blocks/CommonGrid/components/TextRange/index.d.ts +2 -0
  84. package/ui/Blocks/CommonGrid/components/TextRange/index.js +2 -0
  85. package/ui/Blocks/CommonGrid/components/TextRange/types.d.ts +21 -0
  86. package/ui/Blocks/CommonGrid/components/TextRange/types.js +1 -0
  87. package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.d.ts +5 -0
  88. package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +22 -0
  89. package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.d.ts +4 -0
  90. package/ui/Blocks/CommonGrid/components/{icons/ArrowSimple.js → gridCells/ButtonInCell.js} +4 -2
  91. package/ui/Blocks/CommonGrid/components/gridCells/Date.d.ts +4 -0
  92. package/ui/Blocks/CommonGrid/components/gridCells/Date.js +8 -0
  93. package/ui/Blocks/CommonGrid/components/gridCells/DateTime.d.ts +4 -0
  94. package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +13 -0
  95. package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.d.ts +9 -0
  96. package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +33 -0
  97. package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.d.ts +4 -0
  98. package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +18 -0
  99. package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.d.ts +9 -0
  100. package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +15 -0
  101. package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.d.ts +6 -0
  102. package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +23 -0
  103. package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.d.ts +1 -0
  104. package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +8 -0
  105. package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.d.ts +5 -0
  106. package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +24 -0
  107. package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.d.ts +7 -0
  108. package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +30 -0
  109. package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.d.ts +4 -0
  110. package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +7 -0
  111. package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.d.ts +2 -0
  112. package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +16 -0
  113. package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.d.ts +7 -0
  114. package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +30 -0
  115. package/ui/Blocks/CommonGrid/components/gridCells/index.d.ts +14 -0
  116. package/ui/Blocks/CommonGrid/components/gridCells/index.js +14 -0
  117. package/ui/Blocks/CommonGrid/hooks/useAddFilter.d.ts +4 -0
  118. package/ui/Blocks/CommonGrid/hooks/useAddFilter.js +14 -0
  119. package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.d.ts +15 -0
  120. package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +70 -0
  121. package/ui/Blocks/CommonGrid/hooks/useFloatingButton.d.ts +3 -0
  122. package/ui/Blocks/CommonGrid/hooks/useFloatingButton.js +13 -0
  123. package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.d.ts +7 -0
  124. package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +33 -0
  125. package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.d.ts +8 -0
  126. package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.js +25 -0
  127. package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +19 -0
  128. package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +34 -0
  129. package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.d.ts +8 -0
  130. package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +15 -0
  131. package/ui/Blocks/CommonGrid/index.d.ts +7 -71
  132. package/ui/Blocks/CommonGrid/index.js +7 -15
  133. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +4 -4
  134. package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +3 -2
  135. package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +3 -2
  136. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +3 -3
  137. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +3 -3
  138. package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +2 -2
  139. package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +3 -3
  140. package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +2 -1
  141. package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.d.ts +1 -0
  142. package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.js +8 -0
  143. package/ui/Blocks/CommonGrid/storybook/utils/utils.js +1 -1
  144. package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +1 -17
  145. package/ui/Blocks/CommonGrid/styles.d.ts +14 -0
  146. package/ui/Blocks/CommonGrid/styles.js +33 -0
  147. package/ui/Blocks/CommonGrid/translations.d.ts +1 -0
  148. package/ui/Blocks/CommonGrid/translations.js +6 -0
  149. package/ui/Blocks/CommonGrid/types.d.ts +29 -15
  150. package/ui/Blocks/CommonGrid/utils/index.d.ts +4 -1
  151. package/ui/Blocks/CommonGrid/utils/index.js +19 -0
  152. package/ui/Blocks/HidePrint/HidePrint.d.ts +6 -0
  153. package/ui/Blocks/HidePrint/HidePrint.js +13 -0
  154. package/ui/Blocks/Modal/Modal.js +2 -2
  155. package/ui/Blocks/Modal/stories/Modal.stories.js +5 -1
  156. package/ui/Blocks/Modal/styles.d.ts +4 -0
  157. package/ui/Blocks/Modal/styles.js +10 -3
  158. package/ui/Blocks/Popover/index.d.ts +12 -0
  159. package/ui/Blocks/Popover/index.js +21 -0
  160. package/ui/Elements/DatePicker/DatePicker.d.ts +20 -0
  161. package/ui/Elements/DatePicker/DatePicker.js +65 -0
  162. package/ui/Elements/DatePicker/Datetime/DateTime.d.ts +95 -0
  163. package/ui/Elements/DatePicker/Datetime/DateTime.js +516 -0
  164. package/ui/Elements/DatePicker/Datetime/components/Timepicker.d.ts +8 -0
  165. package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +57 -0
  166. package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.d.ts +9 -0
  167. package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +16 -0
  168. package/ui/Elements/DatePicker/Datetime/types.d.ts +61 -0
  169. package/ui/Elements/DatePicker/Datetime/types.js +7 -0
  170. package/ui/Elements/DatePicker/Datetime/views/DaysView.d.ts +14 -0
  171. package/ui/Elements/DatePicker/Datetime/views/DaysView.js +145 -0
  172. package/ui/Elements/DatePicker/Datetime/views/MonthsView.d.ts +10 -0
  173. package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +111 -0
  174. package/ui/Elements/DatePicker/Datetime/views/YearsView.d.ts +15 -0
  175. package/ui/Elements/DatePicker/Datetime/views/YearsView.js +117 -0
  176. package/ui/Elements/DatePicker/index.d.ts +2 -0
  177. package/ui/Elements/DatePicker/index.js +2 -0
  178. package/ui/Elements/DatePicker/styles.d.ts +2 -0
  179. package/ui/Elements/DatePicker/styles.js +8 -0
  180. package/ui/Elements/DropdownMenu/DropdownMenu.d.ts +2 -0
  181. package/ui/Elements/DropdownMenu/DropdownMenu.js +36 -0
  182. package/ui/Elements/DropdownMenu/components/DefaultItem.d.ts +3 -0
  183. package/ui/Elements/DropdownMenu/components/DefaultItem.js +16 -0
  184. package/ui/Elements/DropdownMenu/components/MenuItem.d.ts +3 -0
  185. package/ui/Elements/DropdownMenu/components/MenuItem.js +51 -0
  186. package/ui/Elements/DropdownMenu/components/MenuList.d.ts +3 -0
  187. package/ui/Elements/DropdownMenu/components/MenuList.js +10 -0
  188. package/ui/Elements/DropdownMenu/index.d.ts +1 -0
  189. package/ui/Elements/DropdownMenu/index.js +1 -0
  190. package/ui/Elements/DropdownMenu/types.d.ts +41 -0
  191. package/ui/Elements/DropdownMenu/types.js +1 -0
  192. package/ui/Elements/DropdownSelect/DropdownSelect.d.ts +21 -0
  193. package/ui/Elements/DropdownSelect/DropdownSelect.js +47 -0
  194. package/ui/Elements/DropdownSelect/index.d.ts +4 -0
  195. package/ui/Elements/DropdownSelect/index.js +3 -0
  196. package/ui/Elements/ErrorMessage/ErrorMessage.js +1 -1
  197. package/ui/Elements/HighlightBox/HighlightBox.d.ts +50 -0
  198. package/ui/Elements/HighlightBox/HighlightBox.js +65 -0
  199. package/ui/Elements/HighlightBox/index.d.ts +2 -0
  200. package/ui/Elements/HighlightBox/index.js +2 -0
  201. package/ui/Elements/Icon/icons/Company.d.ts +3 -0
  202. package/ui/Elements/Icon/icons/Company.js +13 -0
  203. package/ui/Elements/Icon/icons/Integrations.d.ts +3 -0
  204. package/ui/Elements/Icon/icons/Integrations.js +13 -0
  205. package/ui/Elements/Icon/icons/ShoppingBag.d.ts +3 -0
  206. package/ui/Elements/Icon/icons/ShoppingBag.js +13 -0
  207. package/ui/Elements/Icon/icons/Truck.d.ts +3 -0
  208. package/ui/Elements/Icon/icons/Truck.js +13 -0
  209. package/ui/Elements/Icon/icons/TwoUsers.d.ts +3 -0
  210. package/ui/Elements/Icon/icons/TwoUsers.js +13 -0
  211. package/ui/Elements/Icon/icons/index.d.ts +5 -0
  212. package/ui/Elements/Icon/icons/index.js +5 -0
  213. package/ui/Elements/MultiSelect/MultiSelect.d.ts +6 -0
  214. package/ui/Elements/MultiSelect/MultiSelect.js +29 -0
  215. package/ui/Elements/MultiSelect/index.d.ts +2 -0
  216. package/ui/Elements/MultiSelect/index.js +2 -0
  217. package/ui/Elements/Pagination/Pagination.d.ts +4 -3
  218. package/ui/Elements/Pagination/Pagination.js +11 -3
  219. package/ui/Elements/Pagination/stories/Pagination.stories.d.ts +1 -1
  220. package/ui/Elements/Pagination/styled.js +6 -6
  221. package/ui/Elements/Select/Select.d.ts +3 -0
  222. package/ui/Elements/Select/Select.js +69 -0
  223. package/ui/Elements/Select/index.d.ts +2 -0
  224. package/ui/Elements/Select/index.js +2 -0
  225. package/ui/Elements/Select/styles.d.ts +5 -0
  226. package/ui/Elements/Select/styles.js +12 -0
  227. package/ui/Elements/Select/themes/CustomComponents.d.ts +8 -0
  228. package/ui/Elements/Select/themes/CustomComponents.js +125 -0
  229. package/ui/Elements/Select/themes/baseStyles.d.ts +28 -0
  230. package/ui/Elements/Select/themes/baseStyles.js +87 -0
  231. package/ui/Elements/Select/themes/formStyles.d.ts +24 -0
  232. package/ui/Elements/Select/themes/formStyles.js +102 -0
  233. package/ui/Elements/Select/themes/index.d.ts +3 -0
  234. package/ui/Elements/Select/themes/index.js +43 -0
  235. package/ui/Elements/Select/types.d.ts +55 -0
  236. package/ui/Elements/Select/types.js +1 -0
  237. package/ui/Elements/SingleSelect/SingleSelect.d.ts +20 -0
  238. package/ui/Elements/SingleSelect/SingleSelect.js +197 -0
  239. package/ui/Elements/SingleSelect/index.d.ts +2 -0
  240. package/ui/Elements/SingleSelect/index.js +2 -0
  241. package/ui/Elements/Text/types.d.ts +2 -2
  242. package/ui/Elements/Toggle/Toggle.d.ts +1 -1
  243. package/ui/Elements/Toggle/Toggle.js +2 -2
  244. package/ui/Elements/Toggle/stories/Toggle.stories.d.ts +1 -1
  245. package/ui/Elements/Toggle/types.d.ts +1 -0
  246. package/ui/Forms/Checkbox/Checkbox.js +3 -2
  247. package/ui/Forms/Checkbox/stories/Checkbox.stories.js +1 -1
  248. package/ui/Forms/Checkbox/styles.d.ts +1 -1
  249. package/ui/Forms/Checkbox/styles.js +1 -1
  250. package/ui/Forms/Input/types.d.ts +2 -2
  251. package/ui/Forms/RadioButton/RadioButton.js +4 -1
  252. package/ui/Forms/RadioButton/styles.d.ts +1 -1
  253. package/ui/Forms/RadioButton/styles.js +1 -1
  254. package/ui/Forms/TextArea/TextArea.d.ts +20 -0
  255. package/ui/Forms/TextArea/TextArea.js +34 -0
  256. package/ui/Forms/TextArea/index.d.ts +2 -0
  257. package/ui/Forms/TextArea/index.js +2 -0
  258. package/ui/Forms/TextArea/styles.d.ts +12 -0
  259. package/ui/Forms/TextArea/styles.js +31 -0
  260. package/ui/ThemeProvider/ThemeProvider.d.ts +3 -1
  261. package/ui/ThemeProvider/ThemeProvider.js +4 -2
  262. package/ui/ThemeProvider/types.d.ts +1 -0
  263. package/ui/index.d.ts +17 -3
  264. package/ui/index.es.js +42483 -8531
  265. package/ui/index.js +17 -3
  266. package/ui/index.umd.js +1658 -273
  267. package/ui/Blocks/CommonGrid/CommonGridContext.d.ts +0 -12
  268. package/ui/Blocks/CommonGrid/CommonGridContext.js +0 -45
  269. package/ui/Blocks/CommonGrid/components/ActionColumnHead.d.ts +0 -4
  270. package/ui/Blocks/CommonGrid/components/ActionColumnHead.js +0 -16
  271. package/ui/Blocks/CommonGrid/components/ButtonStrip.d.ts +0 -7
  272. package/ui/Blocks/CommonGrid/components/ButtonStrip.js +0 -35
  273. package/ui/Blocks/CommonGrid/components/ConfigForm.d.ts +0 -9
  274. package/ui/Blocks/CommonGrid/components/ConfigForm.js +0 -58
  275. package/ui/Blocks/CommonGrid/components/DefaultPaginator.d.ts +0 -3
  276. package/ui/Blocks/CommonGrid/components/DefaultPaginator.js +0 -11
  277. package/ui/Blocks/CommonGrid/components/Dialog.d.ts +0 -11
  278. package/ui/Blocks/CommonGrid/components/Dialog.js +0 -19
  279. package/ui/Blocks/CommonGrid/components/DropdownMenu.d.ts +0 -21
  280. package/ui/Blocks/CommonGrid/components/DropdownMenu.js +0 -59
  281. package/ui/Blocks/CommonGrid/components/DropdownSelect.d.ts +0 -15
  282. package/ui/Blocks/CommonGrid/components/DropdownSelect.js +0 -35
  283. package/ui/Blocks/CommonGrid/components/FloatingButton.d.ts +0 -6
  284. package/ui/Blocks/CommonGrid/components/FloatingButton.js +0 -13
  285. package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.d.ts +0 -2
  286. package/ui/Blocks/CommonGrid/hooks/useControlButtons.d.ts +0 -10
  287. package/ui/Blocks/CommonGrid/hooks/useControlButtons.js +0 -64
  288. package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.d.ts +0 -13
  289. package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.js +0 -49
  290. package/ui/Blocks/CommonGrid/storybook/utils/filters.d.ts +0 -2
  291. package/ui/Blocks/CommonGrid/storybook/utils/filters.js +0 -23
  292. package/ui/Blocks/CommonGrid/utils/public.d.ts +0 -16
  293. package/ui/Blocks/CommonGrid/utils/public.js +0 -52
  294. package/ui/Elements/Paragraph/Paragraph.d.ts +0 -2
  295. package/ui/Elements/Paragraph/Paragraph.js +0 -3
  296. package/ui/Elements/Paragraph/index.d.ts +0 -3
  297. package/ui/Elements/Paragraph/index.js +0 -3
  298. package/ui/Elements/Paragraph/stories/Paragraph.stories.d.ts +0 -17
  299. package/ui/Elements/Paragraph/stories/Paragraph.stories.js +0 -34
@@ -1,74 +1,10 @@
1
- import CommonGrid from './CommonGrid';
1
+ import CommonGrid from './CommonGridContainer';
2
2
  import withReduxActions from './HoC/withReduxActions';
3
3
  import reducer, { actionPrefix, createActions, createSelectors, createFullSelector, actionTypes } from './store';
4
+ import useFloatingButton from './hooks/useFloatingButton';
4
5
  import * as Types from './types';
5
- import * as utils from './utils/public';
6
- declare const _default: {
7
- CommonGrid: ({ components, filters, gridSelectors, gridActions, hideAllControls, totalRowsCount, isLoading, rowsData, hasColouredRows, columnsDefinitions, actionColumnDefinition, allowRowSelect, allowRowSelectOnAction, onRowAction, onRowEditClick, onRowReadClick, onRowClick, onBatchAction, columnLayout, hideColumnConfig, confirmOnReset, className, gridRef, minColumnWidth, errorMessage, extraControlButtons, perPageOptions, floatingButton, }: Types.CommonGridProps) => JSX.Element;
8
- withReduxActions: (gridName: string, prefix?: string) => import("react-redux").InferableComponentEnhancerWithProps<{}, {}>;
9
- reducer: (state: import("./store").MultiState | undefined, action: Action) => import("./store").MultiState;
10
- actionPrefix: string;
11
- actionTypes: {
12
- init: string;
13
- clearUxState: string;
14
- handleUxChange: string;
15
- openConfigForm: string;
16
- closeConfigForm: string;
17
- setColumnConfig: string;
18
- setPage: string;
19
- setRowsPerPage: string;
20
- resetFilters: string;
21
- addFilter: string;
22
- addSorting: string;
23
- clearSettings: string;
24
- resetGrid: string;
25
- setColumnWidth: string;
26
- setColumnsOrder: string;
27
- };
28
- createActions: (gridName: string) => {
29
- init: (initProps: Types.InitProps) => Action;
30
- clearUxState: () => Action;
31
- handleUxChange: (uxKey: keyof Types.UxState, uxValue: any) => Action;
32
- openConfigForm: () => Action;
33
- closeConfigForm: () => Action;
34
- setColumnConfig: (columnConfig: Types.ColumnConfig) => Action;
35
- setPage: (page: number) => Action;
36
- setColumnWidth: (columnsWidth: {
37
- [anyKey: string]: number;
38
- } | null, columnLayout: "normal" | "sticky" | "no-scroll") => Action;
39
- resetGrid: () => Action;
40
- setColumnsOrder: (columnsOrder: string[]) => Action;
41
- setRowsPerPage: (rowsPerPage: number) => Action;
42
- resetFilters: () => Action;
43
- addFilter: (column: string, value: any, filterProps: Types.FilterProps) => Action;
44
- addSorting: (column: string, direction: Types.SortingValueType) => Action;
45
- clearSettings: () => Action;
46
- };
47
- createSelectors: (gridName: string) => {
48
- getUxState: (state: {}) => Types.UxState;
49
- isConfigFormOpen: (state: {}) => boolean;
50
- getColumnConfig: (state: {}) => Types.ColumnConfig;
51
- getPage: (state: {}) => number;
52
- getRowsPerPage: (state: {}) => number;
53
- getFilter: (state: {}) => {
54
- [column: string]: {
55
- value: any;
56
- filterProps: Types.FilterProps;
57
- };
58
- };
59
- getSorting: (state: {}) => {
60
- column: string;
61
- direction: Types.SortingValueType;
62
- }[];
63
- getColumnsWidth: (state: {}) => {
64
- [anyKey: string]: number;
65
- };
66
- getColumnsWidthVariant: (state: {}) => string | undefined;
67
- getColumnsOrder: (state: {}) => string[];
68
- };
69
- createFullSelector: (gridName: string) => (state: {}) => Types.GridSelectorsType;
70
- Types: typeof Types;
71
- utils: typeof utils;
72
- };
73
- export default _default;
74
- export { CommonGrid, withReduxActions, reducer, actionPrefix, actionTypes, createActions, createSelectors, createFullSelector, Types, utils };
6
+ export * from './StandardButtons';
7
+ export * from './components/gridCells';
8
+ import { useAddFilter } from './hooks/useAddFilter';
9
+ export default CommonGrid;
10
+ export { withReduxActions, reducer, actionPrefix, actionTypes, createActions, createSelectors, createFullSelector, Types, useFloatingButton, useAddFilter, };
@@ -1,18 +1,10 @@
1
- import CommonGrid from './CommonGrid';
1
+ import CommonGrid from './CommonGridContainer';
2
2
  import withReduxActions from './HoC/withReduxActions';
3
3
  import reducer, { actionPrefix, createActions, createSelectors, createFullSelector, actionTypes } from './store';
4
+ import useFloatingButton from './hooks/useFloatingButton';
4
5
  import * as Types from './types';
5
- import * as utils from './utils/public';
6
- export default {
7
- CommonGrid: CommonGrid,
8
- withReduxActions: withReduxActions,
9
- reducer: reducer,
10
- actionPrefix: actionPrefix,
11
- actionTypes: actionTypes,
12
- createActions: createActions,
13
- createSelectors: createSelectors,
14
- createFullSelector: createFullSelector,
15
- Types: Types,
16
- utils: utils
17
- };
18
- export { CommonGrid, withReduxActions, reducer, actionPrefix, actionTypes, createActions, createSelectors, createFullSelector, Types, utils };
6
+ export * from './StandardButtons';
7
+ export * from './components/gridCells';
8
+ import { useAddFilter } from './hooks/useAddFilter';
9
+ export default CommonGrid;
10
+ export { withReduxActions, reducer, actionPrefix, actionTypes, createActions, createSelectors, createFullSelector, Types, useFloatingButton, useAddFilter, };
@@ -1,12 +1,12 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { ReduxGrid, createRandomData, enumValues, gridDummyActions } from '../utils/utils';
4
4
  import { onRowEditClick, onRowReadClick, onRowAction, onBatchAction } from '../utils/actions';
5
- import { filters } from '../utils/filters';
6
- import { useAddFilter } from '../../utils/public';
5
+ import { useAddFilter } from '../../hooks/useAddFilter';
7
6
  import withReduxActions from '../../HoC/withReduxActions';
8
7
  import { columnDefinitions, enumColumn } from '../utils/columnDefinition';
9
8
  import withRedux from '../utils/withRedux';
9
+ import { LinguiContainer } from '../utils/linguiContainer';
10
10
  var ActionColumnButtons = {
11
11
  flexBasis: 160,
12
12
  canRowRead: true,
@@ -25,7 +25,7 @@ export default {
25
25
  title: '@Blocks/CommonGrid',
26
26
  decorators: [withRedux],
27
27
  };
28
- export var ComplexWithPaginationAndRedux = function () { return (_jsxs(_Fragment, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { filters: filters, columnsDefinitions: columnDefinitions, actionColumnDefinition: ActionColumnButtons, rowsData: createRandomData(10), onRowAction: onRowAction, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, confirmOnReset: function () { return window.confirm('Are you sure you want to reset grid?'); } })] })); };
28
+ export var ComplexWithPaginationAndRedux = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, actionColumnDefinition: ActionColumnButtons, rowsData: createRandomData(10), onRowAction: onRowAction, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, confirmOnReset: function () { return window.confirm('Are you sure you want to reset grid?'); } })] })); };
29
29
  ComplexWithPaginationAndRedux.story = {
30
30
  name: 'Complex, with pagination and redux',
31
31
  };
@@ -1,14 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import CommonGrid from '../../CommonGrid';
2
+ import CommonGrid from '../../CommonGridContainer';
3
3
  import { createRandomData, gridSelectors, gridDummyActions } from '../utils/utils';
4
4
  import { columnDefinitions } from '../utils/columnDefinition';
5
5
  import withTheme from '../utils/withTheme';
6
6
  import withRouter from '../utils/withRouter';
7
7
  import withRedux from '../utils/withRedux';
8
+ import { LinguiContainer } from '../utils/linguiContainer';
8
9
  export default {
9
10
  title: '@Blocks/CommonGrid',
10
11
  decorators: [withTheme, withRouter, withRedux],
11
12
  };
12
13
  export var Default = function () {
13
- return (_jsx(CommonGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), gridActions: gridDummyActions, gridSelectors: gridSelectors }));
14
+ return (_jsx(LinguiContainer, { children: _jsx(CommonGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), gridActions: gridDummyActions, gridSelectors: gridSelectors }) }));
14
15
  };
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import CommonGrid from '../../CommonGrid';
2
+ import CommonGrid from '../../CommonGridContainer';
3
3
  import { createRandomData, gridSelectors, gridDummyActions } from '../utils/utils';
4
4
  import { columnDefinitions } from '../utils/columnDefinition';
5
+ import { LinguiContainer } from '../utils/linguiContainer';
5
6
  export default {
6
7
  title: '@Blocks/CommonGrid',
7
8
  };
8
- export var LoadingState = function () { return (_jsx(CommonGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), gridSelectors: gridSelectors, gridActions: gridDummyActions, isLoading: true, hideColumnConfig: true })); };
9
+ export var LoadingState = function () { return (_jsx(LinguiContainer, { children: _jsx(CommonGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), gridSelectors: gridSelectors, gridActions: gridDummyActions, isLoading: true, hideColumnConfig: true }) })); };
9
10
  LoadingState.story = {
10
11
  name: 'Loading state',
11
12
  };
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import CommonGrid from '../../CommonGrid';
2
+ import CommonGrid from '../../CommonGridContainer';
3
3
  import { createOversizedRandomData, gridSelectors, gridDummyActions } from '../utils/utils';
4
4
  import { oversizedColumnDefinition } from '../utils/columnDefinition';
5
- import { filters } from '../utils/filters';
5
+ import { LinguiContainer } from '../utils/linguiContainer';
6
6
  export default {
7
7
  title: '@Blocks/CommonGrid',
8
8
  };
9
- export var ManyColumnsNoScrollLayout = function () { return (_jsx(CommonGrid, { rowsData: createOversizedRandomData(5), filters: filters, columnsDefinitions: oversizedColumnDefinition, columnLayout: "no-scroll", hideColumnConfig: true, gridSelectors: gridSelectors, gridActions: gridDummyActions })); };
9
+ export var ManyColumnsNoScrollLayout = function () { return (_jsx(LinguiContainer, { children: _jsx(CommonGrid, { rowsData: createOversizedRandomData(5), columnsDefinitions: oversizedColumnDefinition, columnLayout: "no-scroll", hideColumnConfig: true, gridSelectors: gridSelectors, gridActions: gridDummyActions }) })); };
10
10
  ManyColumnsNoScrollLayout.story = {
11
11
  name: 'many columns no-scroll layout',
12
12
  };
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import CommonGrid from '../../CommonGrid';
2
+ import CommonGrid from '../../CommonGridContainer';
3
3
  import { createOversizedRandomData, gridSelectors, gridDummyActions } from '../utils/utils';
4
4
  import { oversizedColumnDefinition } from '../utils/columnDefinition';
5
- import { filters } from '../utils/filters';
5
+ import { LinguiContainer } from '../utils/linguiContainer';
6
6
  export default {
7
7
  title: '@Blocks/CommonGrid',
8
8
  };
9
- export var ManyColumnsNormalLayoutANoControls = function () { return (_jsx(CommonGrid, { rowsData: createOversizedRandomData(5), filters: filters, columnsDefinitions: oversizedColumnDefinition, hideColumnConfig: true, gridSelectors: gridSelectors, gridActions: gridDummyActions, hideAllControls: true })); };
9
+ export var ManyColumnsNormalLayoutANoControls = function () { return (_jsx(LinguiContainer, { children: _jsx(CommonGrid, { rowsData: createOversizedRandomData(5), columnsDefinitions: oversizedColumnDefinition, hideColumnConfig: true, gridSelectors: gridSelectors, gridActions: gridDummyActions }) })); };
10
10
  ManyColumnsNormalLayoutANoControls.story = {
11
11
  name: 'many columns normal layout a no controls',
12
12
  };
@@ -1,15 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ReduxGrid, createRandomData, gridSelectors, gridDummyActions } from '../utils/utils';
3
- import { filters } from '../utils/filters';
4
3
  import { onRowAction } from '../utils/actions';
5
4
  import { columnDefinitions } from '../utils/columnDefinition';
6
5
  import withTheme from '../utils/withTheme';
7
6
  import withRouter from '../utils/withRouter';
8
7
  import withRedux from '../utils/withRedux';
8
+ import { LinguiContainer } from '../utils/linguiContainer';
9
9
  export default {
10
10
  title: '@Blocks/CommonGrid',
11
11
  decorators: [withTheme, withRouter, withRedux],
12
12
  };
13
13
  export var Styled = function () {
14
- return (_jsx("div", { className: "styled", children: _jsx(ReduxGrid, { filters: filters, columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, gridActions: gridDummyActions, gridSelectors: gridSelectors }) }));
14
+ return (_jsx(LinguiContainer, { children: _jsx("div", { className: "styled", children: _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, gridActions: gridDummyActions, gridSelectors: gridSelectors }) }) }));
15
15
  };
@@ -1,14 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import CommonGrid from '../../CommonGrid';
2
+ import CommonGrid from '../../CommonGridContainer';
3
3
  import { createRandomData, gridSelectors, gridDummyActions } from '../utils/utils';
4
4
  import { columnDefinitions } from '../utils/columnDefinition';
5
5
  import { onRowAction } from '../utils/actions';
6
- import { filters } from '../utils/filters';
6
+ import { LinguiContainer } from '../utils/linguiContainer';
7
7
  export default {
8
8
  title: '@Blocks/CommonGrid',
9
9
  };
10
10
  export var WithCustomGridActions = function () {
11
- return (_jsx(CommonGrid, { filters: filters, columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, gridSelectors: gridSelectors, gridActions: gridDummyActions, hideColumnConfig: true }));
11
+ return (_jsx(LinguiContainer, { children: _jsx(CommonGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, gridSelectors: gridSelectors, gridActions: gridDummyActions, hideColumnConfig: true }) }));
12
12
  };
13
13
  WithCustomGridActions.story = {
14
14
  name: 'With custom grid actions',
@@ -3,6 +3,7 @@ import { ReduxGrid, createRandomData } from '../utils/utils';
3
3
  import { onRowEditClick, onRowReadClick, onRowAction } from '../utils/actions';
4
4
  import { columnDefinitions } from '../utils/columnDefinition';
5
5
  import withRedux from '../utils/withRedux';
6
+ import { LinguiContainer } from '../utils/linguiContainer';
6
7
  export var ActionColumnCheckboxes = {
7
8
  flexBasis: 160,
8
9
  forceCheckboxes: true,
@@ -18,7 +19,7 @@ export default {
18
19
  decorators: [withRedux],
19
20
  excludeStories: ['ActionColumnCheckboxes'],
20
21
  };
21
- export var WithForcedCheckboxesAndCustomTitle = function () { return (_jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, actionColumnDefinition: ActionColumnCheckboxes, rowsData: createRandomData(10), onRowAction: onRowAction, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, components: components })); };
22
+ export var WithForcedCheckboxesAndCustomTitle = function () { return (_jsx(LinguiContainer, { children: _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, actionColumnDefinition: ActionColumnCheckboxes, rowsData: createRandomData(10), onRowAction: onRowAction, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, components: components }) })); };
22
23
  WithForcedCheckboxesAndCustomTitle.story = {
23
24
  name: 'With forced checkboxes and custom title',
24
25
  };
@@ -0,0 +1 @@
1
+ export declare const LinguiContainer: ({ children }: any) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { i18n } from '@lingui/core';
3
+ import { I18nProvider } from '@lingui/react';
4
+ export var LinguiContainer = function (_a) {
5
+ var children = _a.children;
6
+ i18n.activate('en');
7
+ return _jsx(I18nProvider, { i18n: i18n, children: children });
8
+ };
@@ -14,7 +14,7 @@ import React from 'react';
14
14
  import faker from 'faker';
15
15
  import { rowClassSymbol } from '../../types';
16
16
  import withReduxActions from '../../HoC/withReduxActions';
17
- import CommonGrid from '../../CommonGrid';
17
+ import CommonGrid from '../../CommonGridContainer';
18
18
  export var enumValues = ['option A', 'option B', 'option C'];
19
19
  export var oversizedArrayColumns = 25;
20
20
  export var gridSelectors = {};
@@ -1,18 +1,2 @@
1
- /*
2
- import React from 'react'
3
- import Theme from '@designSystem/Theme'
4
- import Normalize, { NormalizeBaseFonts } from '@designSystem/Normalize'
5
-
6
- const withProvider = (story: Function): JSX.Element => (
7
- <Theme>
8
- <Normalize />
9
- <NormalizeBaseFonts />
10
- {story()}
11
- </Theme>
12
- )
13
-
14
- export default withProvider
15
- */
16
- // @TODO do theme
17
- var withProvider = function (story) { return (story()); };
1
+ var withProvider = function (story) { return story(); };
18
2
  export default withProvider;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ export declare const BottomWrapper: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme> & {
3
+ isFixed?: boolean | undefined;
4
+ }, "color">;
5
+ export declare const ContentContainer: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme>, "color">;
6
+ export declare const CommonGridWrap: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme>, "color">;
7
+ export declare const StyledButtonStrip: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme>, "color">;
8
+ export declare const StyledColumnButton: import("styled-components").StyledComponent<({ isLoading, loadingText, icon, appearance, disabled, sizing, buttonRef, onClick, fullWidth, ...props }: import("../../Elements/Button/types").Props) => JSX.Element, import("@xstyled/system").Theme, {}, never>;
9
+ export declare const CommonGridWithStyles: import("styled-components").StyledComponent<({ filters, gridSelectors, gridActions, isLoading, rowsData, hasColouredRows, columnsDefinitions, actionColumnDefinition, allowRowSelect, allowRowSelectOnAction, onRowAction, onRowEditClick, onRowReadClick, onRowClick, columnLayout, hideColumnConfig, className, gridRef, minColumnWidth, errorMessage, floatingButtonProps, }: import("./types").CommonGridProps & {
10
+ filters?: import("./types").FiltersConfig | undefined;
11
+ }) => JSX.Element, import("@xstyled/system").Theme, {
12
+ onRowClick?: Function | undefined;
13
+ height?: number | undefined;
14
+ }, never>;
@@ -0,0 +1,33 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import styled, { x } from '@xstyled/styled-components';
6
+ import { th } from '@xstyled/system';
7
+ import { Button } from '../../Elements/Button';
8
+ import CommonGrid from './CommonGrid';
9
+ export var BottomWrapper = styled(x.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-bottom: 11px;\n padding-top: 10px;\n position: ", ";\n bottom: 0;\n left: 0;\n width: 100%;\n background-color: ", ";\n @media (min-width: 1024px) {\n position: relative;\n padding-bottom: 11px;\n margin-bottom: 0;\n }\n & > * {\n @media (min-width: 1024px) {\n justify-content: flex-end;\n }\n }\n"], ["\n padding-bottom: 11px;\n padding-top: 10px;\n position: ", ";\n bottom: 0;\n left: 0;\n width: 100%;\n background-color: ", ";\n @media (min-width: 1024px) {\n position: relative;\n padding-bottom: 11px;\n margin-bottom: 0;\n }\n & > * {\n @media (min-width: 1024px) {\n justify-content: flex-end;\n }\n }\n"])), function (_a) {
10
+ var isFixed = _a.isFixed;
11
+ return (isFixed ? 'fixed' : 'relative');
12
+ }, function (_a) {
13
+ var isFixed = _a.isFixed, theme = _a.theme;
14
+ return (isFixed ? theme.colors.bgLightGray : 'transparent');
15
+ });
16
+ export var ContentContainer = styled(x.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n background-color: white;\n box-shadow: gridShadow;\n border-radius: 8px;\n flex-grow: 1;\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n background-color: white;\n box-shadow: gridShadow;\n border-radius: 8px;\n flex-grow: 1;\n"])));
17
+ export var CommonGridWrap = styled(x.div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 1;\n"], ["\n flex-grow: 1;\n"])));
18
+ export var StyledButtonStrip = styled(x.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n flex-wrap: wrap;\n z-index: 2;\n border-bottom: 0.5px solid ", ";\n"], ["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n flex-wrap: wrap;\n z-index: 2;\n border-bottom: 0.5px solid ", ";\n"])), th('colors.lightGray6'));
19
+ export var StyledColumnButton = styled(Button)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: sticky;\n right: 20px;\n > span > svg {\n stroke: ", ";\n width: 18px;\n height: 18px;\n }\n > span > H6 {\n display: none;\n }\n @media (min-width: 1024px) {\n > span > H6 {\n display: flex;\n margin-left: 5px;\n }\n }\n"], ["\n position: sticky;\n right: 20px;\n > span > svg {\n stroke: ", ";\n width: 18px;\n height: 18px;\n }\n > span > H6 {\n display: none;\n }\n @media (min-width: 1024px) {\n > span > H6 {\n display: flex;\n margin-left: 5px;\n }\n }\n"])), th('colors.blue2'));
20
+ export var CommonGridWithStyles = styled(CommonGrid)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: 40px;\n }\n & .gridHead {\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 1;\n padding-left: 20px;\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n position: relative;\n }\n & .sticky {\n background-color: #fafbfc;\n }\n }\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n & .sticky {\n background-color: #fafbfc;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n & .body {\n margin: 0 1px 1px 1px; // matching margin with .gridHead\n padding-left: 20px;\n flex-grow: 1;\n }\n & .gridWrapper {\n background-color: ", ";\n width: ", ";\n padding-bottom: ", ";\n\n @media (min-width: 1024px) {\n height: ", ";\n width: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 2px;\n padding-right: 2px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n & .sticky {\n background-color: #fff;\n :hover {\n background-color: #fdf4f3;\n }\n }\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &.selected,\n &.selected > .sticky {\n background-color: #fdf4f3;\n }\n\n :hover {\n background-color: #fdf4f3;\n\n .sticky {\n background-color: #fdf4f3;\n }\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n max-width: 88px;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"], ["\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: 40px;\n }\n & .gridHead {\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 1;\n padding-left: 20px;\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n position: relative;\n }\n & .sticky {\n background-color: #fafbfc;\n }\n }\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n & .sticky {\n background-color: #fafbfc;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n & .body {\n margin: 0 1px 1px 1px; // matching margin with .gridHead\n padding-left: 20px;\n flex-grow: 1;\n }\n & .gridWrapper {\n background-color: ", ";\n width: ", ";\n padding-bottom: ", ";\n\n @media (min-width: 1024px) {\n height: ", ";\n width: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 2px;\n padding-right: 2px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n & .sticky {\n background-color: #fff;\n :hover {\n background-color: #fdf4f3;\n }\n }\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &.selected,\n &.selected > .sticky {\n background-color: #fdf4f3;\n }\n\n :hover {\n background-color: #fdf4f3;\n\n .sticky {\n background-color: #fdf4f3;\n }\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n max-width: 88px;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"])), th('fonts.primary'), th('fonts.primary'), function (_a) {
21
+ var theme = _a.theme;
22
+ return theme.colors.white;
23
+ }, function (_a) {
24
+ var height = _a.height;
25
+ return (height ? 'fit-content' : 'auto');
26
+ }, function (_a) {
27
+ var height = _a.height;
28
+ return (height ? '35px' : '0');
29
+ }, function (_a) {
30
+ var height = _a.height;
31
+ return (height ? "".concat(height, "px") : '475px');
32
+ });
33
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Trans } from '@lingui/react';
3
+ /** catalog for lungui to track commonGrid translations - DO NOT REMOVE */
4
+ var Translations = function () {
5
+ return (_jsxs(_Fragment, { children: [_jsx(Trans, { id: "dataGrid.status.loadingData", message: "... loading data ..." }), _jsx(Trans, { id: "dataGrid.status.noDataFound", message: "No data found." }), _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }), _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }), _jsx(Trans, { id: "dataGrid.buttonGridConfig", message: "Configure columns" }), _jsx(Trans, { id: "dataGrid.config.title", message: "Configure columns" }), _jsx(Trans, { id: "dataGrid.config.buttonReset", message: "Reset all" }), _jsx(Trans, { id: "dataGrid.resultsPerPage", message: "Results per page" }), _jsx(Trans, { id: "manageColumn.title", message: "Manage column" }), _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }), _jsx(Trans, { id: "form.buttonCancel", message: "Cancel" }), _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }), ",", _jsx(Trans, { id: "form.buttonImport", message: "Import" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.export", message: "Export" }), ",", _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }), ",", _jsx(Trans, { id: "dataGrid.checkAll", message: "Check all" }), ",", _jsx(Trans, { id: "datagrid.filterCell.selectAllLabel", message: "select all" }), _jsx(Trans, { id: "datagrid.filterCell.optionsSelectedLabel", message: '{count} options' }), ",", _jsx(Trans, { id: "dataGrid.deleteItem", message: "Delete" }), ",", _jsx(Trans, { id: "dataGrid.columnLot.NA", message: "N/A" }), ",", _jsx(Trans, { id: "dataGrid.buttonActions", message: "Actions" }), ",", _jsx(Trans, { id: "dataGrid.errors.ipValidationError", message: "Value is not valid ip" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.all", message: "All" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.yes", message: "Yes" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.no", message: "No" }), _jsx(Trans, { id: "products.eshopFilterPlaceholder", message: "Select eshop..." }), ",", _jsx(Trans, { id: "dataGrid.checkedRowsCount", message: "Selected {checkedRowsCount} items" }), ",", _jsx(Trans, { id: "dataGrid.filterCell", message: "Type to filter" }), ",", _jsx(Trans, { id: "dataGrid.filterCell.from", message: "From" }), ",", _jsx(Trans, { id: "dataGrid.filterCell.to", message: "To" }), ",", _jsx(Trans, { id: "manageColumn.searchPlaceholder", message: "Find column..." }), ",", _jsx(Trans, { id: "dataGrid.comparator.equals", message: "Equals" }), ",", _jsx(Trans, { id: "dataGrid.comparator.notEquals", message: "Not equal" }), ",", _jsx(Trans, { id: "dataGrid.comparator.lessThan", message: "Less than" }), ",", _jsx(Trans, { id: "dataGrid.comparator.lessThanOrEquals", message: "Less than or equals" }), ",", _jsx(Trans, { id: "dataGrid.comparator.greaterThan", message: "Greater than" }), ",", _jsx(Trans, { id: "dataGrid.comparator.greaterThanOrEquals", message: "Greater than or equal" }), ",", _jsx(Trans, { id: "dataGrid.comparator.contains", message: "Contains" }), ",", _jsx(Trans, { id: "dataGrid.comparator.notContains", message: "Not contains" }), ",", _jsx(Trans, { id: "dataGrid.comparator.startsWith", message: "Starts with'" }), ",", _jsx(Trans, { id: "dataGrid.comparator.endsWith", message: "Ends with" }), ",", _jsx(Trans, { id: "select.noOptions", message: "no options" }), ",", _jsx(Trans, { id: "components.dropdown.loading", message: "Loading..." }), ",", _jsx(Trans, { id: "components.dropdown.placeholder", message: "Select..." }), ",", _jsx(Trans, { id: "components.dropdown.notReact", message: "Select related values first..." }), ",", _jsx(Trans, { id: "components.dropdown.writeMoreChars", message: "Write at least ${asyncLoadMinChars} characters." }), ",", _jsx(Trans, { id: "components.dropdown.noOptions", message: "No options" }), ",", _jsx(Trans, { id: "components.dropdown.newOption", message: "new value" }), ",", _jsx(Trans, { id: "form.general.min2Chars", message: "Minimal length is 2 characters." }), ","] }));
6
+ };
@@ -4,10 +4,6 @@ type Option = {
4
4
  value: string | number;
5
5
  label: string | number;
6
6
  };
7
- type TranslatorPublicInterfaceProps = {
8
- id?: string;
9
- defaults?: string;
10
- };
11
7
  type ButtonPublicInterfaceProps = {
12
8
  children?: React.ReactNode;
13
9
  type?: 'button' | 'submit' | 'reset';
@@ -44,8 +40,8 @@ export type FilterComponentProps<VT> = {
44
40
  };
45
41
  } | null) => void;
46
42
  value: VT | null;
47
- OverlayComponent: React.FunctionComponent;
48
- };
43
+ OverlayComponent?: React.FunctionComponent;
44
+ } & Record<string, any>;
49
45
  export type ColumnTitleComponentType = React.ComponentType<{
50
46
  title?: string | JSX.Element;
51
47
  isSortable: boolean;
@@ -53,7 +49,7 @@ export type ColumnTitleComponentType = React.ComponentType<{
53
49
  sortValue: SortingValueType;
54
50
  }>;
55
51
  export type ComponentsProps = {
56
- Translator: React.ComponentType<TranslatorPublicInterfaceProps>;
52
+ Translator: React.ComponentType<any>;
57
53
  Checkbox: React.ComponentType<CheckboxPublicInterfaceProps>;
58
54
  Button: React.ComponentType<ButtonPublicInterfaceProps>;
59
55
  Switch: React.ComponentType<SwitchPublicInterfaceProps>;
@@ -131,6 +127,7 @@ export type ColumnDefinition<ColumnName extends string = string> = ColumnBasePro
131
127
  defaultHidden?: boolean;
132
128
  sticky?: boolean;
133
129
  stickTo?: StickTo;
130
+ passProps?: any;
134
131
  };
135
132
  export type StickTo = 'left' | 'right';
136
133
  type batchAction = {
@@ -160,6 +157,7 @@ export type DataCellProps<T> = {
160
157
  rowData: T;
161
158
  onRowAction?: (id: string, field: string, value: any) => void | Promise<any>;
162
159
  column: ColumnDefinition;
160
+ children?: React.ReactNode;
163
161
  };
164
162
  type SingleColumnConfig = {
165
163
  isHidden?: boolean;
@@ -240,8 +238,6 @@ export type AsyncFilters = {
240
238
  [anyColumn: string]: Option[];
241
239
  };
242
240
  export type CommonGridProps<TData extends RowProps = RowProps> = {
243
- components?: ComponentsProps;
244
- filters?: FiltersConfig;
245
241
  gridSelectors: GridSelectorsType;
246
242
  gridActions: GridActionsType;
247
243
  isLoading?: boolean;
@@ -260,14 +256,13 @@ export type CommonGridProps<TData extends RowProps = RowProps> = {
260
256
  columnLayout?: ColumnLayout;
261
257
  confirmOnReset?: () => boolean;
262
258
  hideColumnConfig?: boolean;
263
- hideAllControls?: boolean;
264
259
  className?: string;
265
260
  gridRef?: React.MutableRefObject<HTMLElement>;
266
261
  minColumnWidth?: number;
267
262
  errorMessage?: string;
268
263
  extraControlButtons?: ExtraControlButton[];
269
264
  perPageOptions?: number[];
270
- floatingButton?: JSX.Element;
265
+ floatingButtonProps?: FloatingButtonProps;
271
266
  };
272
267
  export declare enum ExtraControlButtonPosition {
273
268
  TopLeft = "top-left",
@@ -278,13 +273,12 @@ export declare enum ExtraControlButtonPosition {
278
273
  export type ExtraControlButton = {
279
274
  node?: React.ReactNode;
280
275
  onClick?: () => void;
281
- onSelect?: (value: string | number) => void;
276
+ onSelect?: (value: string) => void;
282
277
  label?: string | JSX.Element;
283
278
  style?: 'primary' | 'secondary';
284
279
  options?: {
285
- label: string | JSX.Element;
286
- value?: string | number;
287
- onClick?: () => void;
280
+ label: string;
281
+ value: string;
288
282
  }[];
289
283
  position?: ExtraControlButtonPosition;
290
284
  hide?: boolean;
@@ -296,4 +290,24 @@ export type Group = {
296
290
  start: boolean;
297
291
  end: boolean;
298
292
  };
293
+ export type GridProps = Omit<CommonGridProps, 'filters'> & {
294
+ optimizeFilters?: boolean;
295
+ eshopSelect?: CommonGridProps['extraControlButtons'];
296
+ processCheckedValues?: () => void;
297
+ processCheckedValuesTitle?: string;
298
+ hideControlButtons?: boolean;
299
+ queryRowsParam?: number | string;
300
+ customPaginationHandler?: (page: number, rows: number) => void;
301
+ };
302
+ export type PageGridProps = Omit<GridProps, 'rowsData' | 'totalRowsCount' | 'columnsDefinitions' | 'actionColumnDefinition' | 'hideColumnConfig' | 'minColumnWidth' | 'columnLayout'>;
303
+ export type Item = {
304
+ label: string | JSX.Element;
305
+ value: string;
306
+ name: string;
307
+ };
308
+ export type FloatingButtonProps = {
309
+ options?: Item[];
310
+ onSelect?: (value: Item['value']) => void;
311
+ onClick?: () => void;
312
+ };
299
313
  export {};
@@ -1,4 +1,4 @@
1
- import { ColumnDefinition, ActionColumn, ColumnConfig, FilterProps, Group, StickTo } from '../types';
1
+ import { ColumnDefinition, ActionColumn, ColumnConfig, FilterProps, Group, StickTo, FiltersConfig } from '../types';
2
2
  export declare const getActionCellSizeProps: (column: ActionColumn) => object;
3
3
  export declare const getCellSizeProps: (column: ColumnDefinition, columnWidth: number) => object;
4
4
  export declare const getSortName: (column: ColumnDefinition) => string;
@@ -15,3 +15,6 @@ export declare const createFilterType: (columnDefinition: {
15
15
  export declare const getGroups: (columns: ColumnDefinition[]) => Group[];
16
16
  export declare const getGroupClassNames: (group?: Group) => string;
17
17
  export declare const getStickyCollClassNames: (sticky: boolean, stickTo?: StickTo) => string;
18
+ export declare const GRID_MIN_ROWS = 6;
19
+ export declare const rowHeight = 40;
20
+ export declare const getFilters: (optimizeFilters: boolean) => FiltersConfig;
@@ -1,3 +1,8 @@
1
+ import NumberRange from '../components/NumberRange';
2
+ import TextRange from '../components/TextRange';
3
+ import DatePickerRange from '../components/DatePickerRange';
4
+ import BooleanSelect from '../components/BooleanSelect';
5
+ import GridSelect from '../components/GridSelect';
1
6
  var isDefined = function (val) { return typeof val !== 'undefined'; };
2
7
  export var getActionCellSizeProps = function (column) {
3
8
  return {
@@ -58,3 +63,17 @@ export var getGroupClassNames = function (group) {
58
63
  export var getStickyCollClassNames = function (sticky, stickTo) {
59
64
  return !sticky ? '' : "".concat(stickTo ? " sticky sticky-".concat(stickTo) : ' sticky sticky-left');
60
65
  };
66
+ export var GRID_MIN_ROWS = 6;
67
+ export var rowHeight = 40;
68
+ export var getFilters = function (optimizeFilters) {
69
+ var filters = {
70
+ number: { CellComponent: NumberRange },
71
+ text: { CellComponent: TextRange },
72
+ date: { CellComponent: DatePickerRange },
73
+ flag: { CellComponent: BooleanSelect },
74
+ options: { CellComponent: GridSelect },
75
+ };
76
+ if (optimizeFilters)
77
+ filters.text.defaultExtraProps = { defaultComparator: 'eq' };
78
+ return filters;
79
+ };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ children: React.ReactNode;
4
+ };
5
+ declare const HidePrint: ({ children }: Props) => JSX.Element;
6
+ export default HidePrint;
@@ -0,0 +1,13 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ import styled from 'styled-components';
7
+ var HideWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: content;\n @media print {\n display: none;\n }\n"], ["\n display: content;\n @media print {\n display: none;\n }\n"])));
8
+ var HidePrint = function (_a) {
9
+ var children = _a.children;
10
+ return _jsx(HideWrapper, { children: children });
11
+ };
12
+ export default HidePrint;
13
+ var templateObject_1;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo, useCallback, useMemo, useEffect } from 'react';
3
3
  import { Icon, Cancel } from '../../Elements/Icon';
4
4
  import { H2, H5 } from '../../Elements/Typography';
5
- import { DialogOverlay, DialogWindow, HeaderContainer, ButtonsContainer, ContentContainer, TitleContainer, CloseButton, } from './styles';
5
+ import { DialogOverlay, DialogWindow, HeaderContainer, ButtonsContainer, ContentContainer, TitleContainer, CloseButton, ButtonsWrapper, } from './styles';
6
6
  import { x } from '@xstyled/styled-components';
7
7
  import { Button } from '../../Elements/Button';
8
8
  import { Portal } from '../../Elements/Portal';
@@ -32,5 +32,5 @@ export var Modal = memo(function (_a) {
32
32
  if (!isShown) {
33
33
  return null;
34
34
  }
35
- return (_jsx(Portal, { children: _jsx(DialogOverlay, { backgroundColor: overlayColor, children: _jsxs(DialogWindow, { ref: dialogRef, style: dialogStyle, "$backgroundColor": background, top: top, "data-cy": "dialogWindow", onClick: closeEverywhere ? closeDialog : undefined, "$minWidth": minWidth, "$minHeight": minHeight, "$maxWidth": maxWidth, "$maxHeight": maxHeight, variant: variant, children: [title && hasHeader && (_jsx(HeaderContainer, { variant: variant, children: _jsxs(TitleContainer, { children: [titleIcon && (_jsx(x.div, { as: "span", className: "icon", children: typeof titleIcon === 'string' ? _jsx(Icon, { icon: titleIcon, fill: "blue2" }) : titleIcon })), variant == 'default' ? (_jsx(H2, { mt: 0, mb: 0, variant: "bold", children: title })) : (_jsx(H5, { mt: 0, mb: 0, variant: "bold", children: title }))] }) })), withCloseIcon && (_jsx(CloseButton, { onClick: closeDialog, "data-cy": "dialogCloseBtn", children: _jsx(Cancel, { width: "11px", height: "11px" }) })), _jsx(ContentContainer, { variant: variant, children: children }), hasFooter && (onExtraAction || onCancel || onConfirm) && (_jsxs(ButtonsContainer, { hasSpaceBetween: !!onExtraAction, children: [onExtraAction && (_jsx(Button, { type: "button", onClick: onExtraAction, isLoading: isLoading, "data-cy": "extraActionBtn", appearance: "ghostDanger", children: extraActionLabel })), _jsxs(x.div, { children: [onCancel && (_jsx(Button, { type: "button", onClick: onCancel, isLoading: isLoading, "data-cy": "cancelBtn", appearance: "primaryLight", children: cancelLabel ? cancelLabel : 'Cancel' })), onConfirm && (_jsx(Button, { type: "button", onClick: onDialogConfirmClick, isLoading: isLoading, disabled: isConfirmDisabled, "data-cy": "submitBtn", children: confirmLabel ? confirmLabel : 'Submit' }))] })] }))] }) }) }));
35
+ return (_jsx(Portal, { children: _jsx(DialogOverlay, { backgroundColor: overlayColor, children: _jsxs(DialogWindow, { ref: dialogRef, style: dialogStyle, "$backgroundColor": background, top: top, "data-cy": "dialogWindow", onClick: closeEverywhere ? closeDialog : undefined, "$minWidth": minWidth, "$minHeight": minHeight, "$maxWidth": maxWidth, "$maxHeight": maxHeight, variant: variant, children: [title && hasHeader && (_jsx(HeaderContainer, { variant: variant, children: _jsxs(TitleContainer, { children: [titleIcon && (_jsx(x.div, { as: "span", className: "icon", children: typeof titleIcon === 'string' ? _jsx(Icon, { icon: titleIcon, fill: "blue2" }) : titleIcon })), variant == 'default' ? (_jsx(H2, { mt: 0, mb: 0, variant: "bold", children: title })) : (_jsx(H5, { mt: 0, mb: 0, variant: "bold", children: title }))] }) })), withCloseIcon && (_jsx(CloseButton, { onClick: closeDialog, "data-cy": "dialogCloseBtn", children: _jsx(Cancel, { width: "11px", height: "11px" }) })), _jsx(ContentContainer, { variant: variant, children: children }), hasFooter && (onExtraAction || onCancel || onConfirm) && (_jsxs(ButtonsContainer, { hasSpaceBetween: !!onExtraAction, children: [onExtraAction && (_jsx(Button, { type: "button", onClick: onExtraAction, isLoading: isLoading, "data-cy": "extraActionBtn", appearance: "ghostDanger", children: extraActionLabel })), _jsxs(ButtonsWrapper, { hasExtraAction: !!onExtraAction, hasBothButtons: !!onCancel && !!onConfirm, children: [onCancel && (_jsx(Button, { type: "button", onClick: onCancel, isLoading: isLoading, "data-cy": "cancelBtn", appearance: "primaryLight", children: cancelLabel ? cancelLabel : 'Cancel' })), onConfirm && (_jsx(Button, { type: "button", onClick: onDialogConfirmClick, isLoading: isLoading, disabled: isConfirmDisabled, "data-cy": "submitBtn", children: confirmLabel ? confirmLabel : 'Submit' }))] })] }))] }) }) }));
36
36
  });
@@ -32,7 +32,7 @@ export var ModalTopPosition = {
32
32
  title: 'Modal default version',
33
33
  children: _jsx(_Fragment, { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum id eros ac consequat." }),
34
34
  variant: 'default',
35
- top: '0'
35
+ top: '0',
36
36
  },
37
37
  };
38
38
  export var ModalWithCloseAndConfirmBtns = {
@@ -40,6 +40,10 @@ export var ModalWithCloseAndConfirmBtns = {
40
40
  children: _jsx(_Fragment, { children: "Modal with narrow width" }),
41
41
  title: 'Modal title',
42
42
  width: 'narrow',
43
+ withCloseIcon: true,
44
+ onCancel: function () { return console.log('Cancel'); },
45
+ onConfirm: function () { return console.log('Confirm'); },
46
+ onExtraAction: undefined,
43
47
  },
44
48
  };
45
49
  export var ModalWithoutCloseButton = {