@mailstep/design-system 0.4.21 → 0.5.0-beta.10

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 (285) hide show
  1. package/package.json +33 -2
  2. package/ui/Blocks/CommonGrid/CommonGrid.d.ts +3 -0
  3. package/ui/Blocks/CommonGrid/CommonGrid.js +106 -0
  4. package/ui/Blocks/CommonGrid/CommonGridContainer.d.ts +3 -0
  5. package/ui/Blocks/CommonGrid/CommonGridContainer.js +67 -0
  6. package/ui/Blocks/CommonGrid/CommonGridContext.d.ts +9 -0
  7. package/ui/Blocks/CommonGrid/CommonGridContext.js +32 -0
  8. package/ui/Blocks/CommonGrid/HoC/withReduxActions.d.ts +2 -0
  9. package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +36 -0
  10. package/ui/Blocks/CommonGrid/StandardButtons.d.ts +6 -0
  11. package/ui/Blocks/CommonGrid/StandardButtons.js +50 -0
  12. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.d.ts +11 -0
  13. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +53 -0
  14. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.d.ts +11 -0
  15. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +18 -0
  16. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.d.ts +12 -0
  17. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +45 -0
  18. package/ui/Blocks/CommonGrid/components/ActionHead/index.d.ts +2 -0
  19. package/ui/Blocks/CommonGrid/components/ActionHead/index.js +2 -0
  20. package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.d.ts +6 -0
  21. package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +35 -0
  22. package/ui/Blocks/CommonGrid/components/BooleanSelect/index.d.ts +2 -0
  23. package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +2 -0
  24. package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.d.ts +13 -0
  25. package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +32 -0
  26. package/ui/Blocks/CommonGrid/components/ButtonMore/index.d.ts +2 -0
  27. package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +2 -0
  28. package/ui/Blocks/CommonGrid/components/ColumnFilterCell.d.ts +11 -0
  29. package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +41 -0
  30. package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.d.ts +5 -0
  31. package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +58 -0
  32. package/ui/Blocks/CommonGrid/components/ColumnTitle/index.d.ts +2 -0
  33. package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +2 -0
  34. package/ui/Blocks/CommonGrid/components/ColumnTitle.d.ts +9 -0
  35. package/ui/Blocks/CommonGrid/components/ColumnTitle.js +20 -0
  36. package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.d.ts +11 -0
  37. package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +20 -0
  38. package/ui/Blocks/CommonGrid/components/ControlButtons/index.d.ts +2 -0
  39. package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +2 -0
  40. package/ui/Blocks/CommonGrid/components/DataCell.d.ts +11 -0
  41. package/ui/Blocks/CommonGrid/components/DataCell.js +52 -0
  42. package/ui/Blocks/CommonGrid/components/DataRow.d.ts +21 -0
  43. package/ui/Blocks/CommonGrid/components/DataRow.js +110 -0
  44. package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.d.ts +12 -0
  45. package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +113 -0
  46. package/ui/Blocks/CommonGrid/components/DatePickerRange/index.d.ts +2 -0
  47. package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +2 -0
  48. package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.d.ts +1 -0
  49. package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +3 -0
  50. package/ui/Blocks/CommonGrid/components/DropdownSelect/DropdownSelect.d.ts +21 -0
  51. package/ui/Blocks/CommonGrid/components/DropdownSelect/DropdownSelect.js +47 -0
  52. package/ui/Blocks/CommonGrid/components/DropdownSelect/index.d.ts +4 -0
  53. package/ui/Blocks/CommonGrid/components/DropdownSelect/index.js +3 -0
  54. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.d.ts +8 -0
  55. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +43 -0
  56. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.d.ts +2 -0
  57. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +2 -0
  58. package/ui/Blocks/CommonGrid/components/FilterDropdown.d.ts +3 -0
  59. package/ui/Blocks/CommonGrid/components/FilterDropdown.js +36 -0
  60. package/ui/Blocks/CommonGrid/components/FilterRow.d.ts +15 -0
  61. package/ui/Blocks/CommonGrid/components/FilterRow.js +34 -0
  62. package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.d.ts +7 -0
  63. package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +45 -0
  64. package/ui/Blocks/CommonGrid/components/FloatingButton/index.d.ts +2 -0
  65. package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +2 -0
  66. package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.d.ts +10 -0
  67. package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +19 -0
  68. package/ui/Blocks/CommonGrid/components/GridSelect/index.d.ts +2 -0
  69. package/ui/Blocks/CommonGrid/components/GridSelect/index.js +2 -0
  70. package/ui/Blocks/CommonGrid/components/GroupRow.d.ts +9 -0
  71. package/ui/Blocks/CommonGrid/components/GroupRow.js +27 -0
  72. package/ui/Blocks/CommonGrid/components/HeadCell.d.ts +27 -0
  73. package/ui/Blocks/CommonGrid/components/HeadCell.js +40 -0
  74. package/ui/Blocks/CommonGrid/components/HeadRow.d.ts +15 -0
  75. package/ui/Blocks/CommonGrid/components/HeadRow.js +69 -0
  76. package/ui/Blocks/CommonGrid/components/HidePrint/HidePrint.d.ts +6 -0
  77. package/ui/Blocks/CommonGrid/components/HidePrint/HidePrint.js +13 -0
  78. package/ui/Blocks/CommonGrid/components/IconList/IconList.d.ts +18 -0
  79. package/ui/Blocks/CommonGrid/components/IconList/IconList.js +29 -0
  80. package/ui/Blocks/CommonGrid/components/IconList/index.d.ts +2 -0
  81. package/ui/Blocks/CommonGrid/components/IconList/index.js +2 -0
  82. package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.d.ts +11 -0
  83. package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +20 -0
  84. package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +12 -0
  85. package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +47 -0
  86. package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.d.ts +2 -0
  87. package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +2 -0
  88. package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.d.ts +3 -0
  89. package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +76 -0
  90. package/ui/Blocks/CommonGrid/components/NumberRange/index.d.ts +2 -0
  91. package/ui/Blocks/CommonGrid/components/NumberRange/index.js +2 -0
  92. package/ui/Blocks/CommonGrid/components/NumberRange/types.d.ts +17 -0
  93. package/ui/Blocks/CommonGrid/components/NumberRange/types.js +1 -0
  94. package/ui/Blocks/CommonGrid/components/OversizedScroll.d.ts +11 -0
  95. package/ui/Blocks/CommonGrid/components/OversizedScroll.js +21 -0
  96. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.d.ts +6 -0
  97. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +26 -0
  98. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.d.ts +2 -0
  99. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +2 -0
  100. package/ui/Blocks/CommonGrid/components/Resize.d.ts +7 -0
  101. package/ui/Blocks/CommonGrid/components/Resize.js +33 -0
  102. package/ui/Blocks/CommonGrid/components/Table.d.ts +10 -0
  103. package/ui/Blocks/CommonGrid/components/Table.js +25 -0
  104. package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.d.ts +7 -0
  105. package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +31 -0
  106. package/ui/Blocks/CommonGrid/components/TablePagination/index.d.ts +2 -0
  107. package/ui/Blocks/CommonGrid/components/TablePagination/index.js +2 -0
  108. package/ui/Blocks/CommonGrid/components/TextRange/TextRange.d.ts +4 -0
  109. package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +89 -0
  110. package/ui/Blocks/CommonGrid/components/TextRange/index.d.ts +2 -0
  111. package/ui/Blocks/CommonGrid/components/TextRange/index.js +2 -0
  112. package/ui/Blocks/CommonGrid/components/TextRange/types.d.ts +21 -0
  113. package/ui/Blocks/CommonGrid/components/TextRange/types.js +1 -0
  114. package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.d.ts +5 -0
  115. package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +22 -0
  116. package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.d.ts +4 -0
  117. package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.js +16 -0
  118. package/ui/Blocks/CommonGrid/components/gridCells/Date.d.ts +4 -0
  119. package/ui/Blocks/CommonGrid/components/gridCells/Date.js +8 -0
  120. package/ui/Blocks/CommonGrid/components/gridCells/DateTime.d.ts +4 -0
  121. package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +13 -0
  122. package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.d.ts +9 -0
  123. package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +33 -0
  124. package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.d.ts +5 -0
  125. package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +19 -0
  126. package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.d.ts +9 -0
  127. package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +15 -0
  128. package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.d.ts +6 -0
  129. package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +23 -0
  130. package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.d.ts +1 -0
  131. package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +8 -0
  132. package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.d.ts +5 -0
  133. package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +24 -0
  134. package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.d.ts +7 -0
  135. package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +30 -0
  136. package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.d.ts +4 -0
  137. package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +7 -0
  138. package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.d.ts +2 -0
  139. package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +16 -0
  140. package/ui/Blocks/CommonGrid/components/gridCells/index.d.ts +12 -0
  141. package/ui/Blocks/CommonGrid/components/gridCells/index.js +12 -0
  142. package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.d.ts +2 -0
  143. package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.js +14 -0
  144. package/ui/Blocks/CommonGrid/components/icons/Edit.d.ts +2 -0
  145. package/ui/Blocks/CommonGrid/components/icons/Edit.js +14 -0
  146. package/ui/Blocks/CommonGrid/components/icons/EyeOpen.d.ts +2 -0
  147. package/ui/Blocks/CommonGrid/components/icons/EyeOpen.js +14 -0
  148. package/ui/Blocks/CommonGrid/components/icons/Sorting.d.ts +2 -0
  149. package/ui/Blocks/CommonGrid/components/icons/Sorting.js +14 -0
  150. package/ui/Blocks/CommonGrid/components/utils.d.ts +8 -0
  151. package/ui/Blocks/CommonGrid/components/utils.js +22 -0
  152. package/ui/Blocks/CommonGrid/hooks/useColumnSizes.d.ts +12 -0
  153. package/ui/Blocks/CommonGrid/hooks/useColumnSizes.js +83 -0
  154. package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.d.ts +15 -0
  155. package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +70 -0
  156. package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.d.ts +7 -0
  157. package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +33 -0
  158. package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +19 -0
  159. package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +34 -0
  160. package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.d.ts +4 -0
  161. package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.js +21 -0
  162. package/ui/Blocks/CommonGrid/hooks/useUxReset.d.ts +3 -0
  163. package/ui/Blocks/CommonGrid/hooks/useUxReset.js +15 -0
  164. package/ui/Blocks/CommonGrid/index.d.ts +7 -0
  165. package/ui/Blocks/CommonGrid/index.js +7 -0
  166. package/ui/Blocks/CommonGrid/store/index.d.ts +58 -0
  167. package/ui/Blocks/CommonGrid/store/index.js +230 -0
  168. package/ui/Blocks/CommonGrid/store/migrateState.d.ts +3 -0
  169. package/ui/Blocks/CommonGrid/store/migrateState.js +14 -0
  170. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +11 -0
  171. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +31 -0
  172. package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.d.ts +13 -0
  173. package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.js +49 -0
  174. package/ui/Blocks/CommonGrid/storybook/stories/default.stories.d.ts +6 -0
  175. package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +14 -0
  176. package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.d.ts +10 -0
  177. package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +11 -0
  178. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.d.ts +10 -0
  179. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +12 -0
  180. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.d.ts +10 -0
  181. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +12 -0
  182. package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.d.ts +6 -0
  183. package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +15 -0
  184. package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.d.ts +10 -0
  185. package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +15 -0
  186. package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.d.ts +14 -0
  187. package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +24 -0
  188. package/ui/Blocks/CommonGrid/storybook/utils/actions.d.ts +4 -0
  189. package/ui/Blocks/CommonGrid/storybook/utils/actions.js +6 -0
  190. package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.d.ts +10 -0
  191. package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +97 -0
  192. package/ui/Blocks/CommonGrid/storybook/utils/filters.d.ts +2 -0
  193. package/ui/Blocks/CommonGrid/storybook/utils/filters.js +23 -0
  194. package/ui/Blocks/CommonGrid/storybook/utils/utils.d.ts +17 -0
  195. package/ui/Blocks/CommonGrid/storybook/utils/utils.js +66 -0
  196. package/ui/Blocks/CommonGrid/storybook/utils/withRedux.d.ts +2 -0
  197. package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +12 -0
  198. package/ui/Blocks/CommonGrid/storybook/utils/withRouter.d.ts +2 -0
  199. package/ui/Blocks/CommonGrid/storybook/utils/withRouter.js +4 -0
  200. package/ui/Blocks/CommonGrid/storybook/utils/withTheme.d.ts +2 -0
  201. package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +18 -0
  202. package/ui/Blocks/CommonGrid/styles.d.ts +12 -0
  203. package/ui/Blocks/CommonGrid/styles.js +33 -0
  204. package/ui/Blocks/CommonGrid/translations.d.ts +1 -0
  205. package/ui/Blocks/CommonGrid/translations.js +6 -0
  206. package/ui/Blocks/CommonGrid/types.d.ts +313 -0
  207. package/ui/Blocks/CommonGrid/types.js +8 -0
  208. package/ui/Blocks/CommonGrid/utils/index.d.ts +19 -0
  209. package/ui/Blocks/CommonGrid/utils/index.js +78 -0
  210. package/ui/Blocks/CommonGrid/utils/public.d.ts +16 -0
  211. package/ui/Blocks/CommonGrid/utils/public.js +52 -0
  212. package/ui/Blocks/Popover/index.d.ts +10 -0
  213. package/ui/Blocks/Popover/index.js +19 -0
  214. package/ui/Elements/DatePicker/DatePicker.d.ts +20 -0
  215. package/ui/Elements/DatePicker/DatePicker.js +65 -0
  216. package/ui/Elements/DatePicker/Datetime/DateTime.d.ts +95 -0
  217. package/ui/Elements/DatePicker/Datetime/DateTime.js +516 -0
  218. package/ui/Elements/DatePicker/Datetime/components/Timepicker.d.ts +8 -0
  219. package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +57 -0
  220. package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.d.ts +9 -0
  221. package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +16 -0
  222. package/ui/Elements/DatePicker/Datetime/types.d.ts +61 -0
  223. package/ui/Elements/DatePicker/Datetime/types.js +7 -0
  224. package/ui/Elements/DatePicker/Datetime/views/DaysView.d.ts +14 -0
  225. package/ui/Elements/DatePicker/Datetime/views/DaysView.js +145 -0
  226. package/ui/Elements/DatePicker/Datetime/views/MonthsView.d.ts +10 -0
  227. package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +111 -0
  228. package/ui/Elements/DatePicker/Datetime/views/YearsView.d.ts +15 -0
  229. package/ui/Elements/DatePicker/Datetime/views/YearsView.js +117 -0
  230. package/ui/Elements/DatePicker/index.d.ts +2 -0
  231. package/ui/Elements/DatePicker/index.js +2 -0
  232. package/ui/Elements/DatePicker/styles.d.ts +2 -0
  233. package/ui/Elements/DatePicker/styles.js +8 -0
  234. package/ui/Elements/DatePicker/utils/getLanguage.d.ts +1 -0
  235. package/ui/Elements/DatePicker/utils/getLanguage.js +10 -0
  236. package/ui/Elements/DropdownMenu/DropdownMenu.d.ts +2 -0
  237. package/ui/Elements/DropdownMenu/DropdownMenu.js +36 -0
  238. package/ui/Elements/DropdownMenu/components/DefaultItem.d.ts +3 -0
  239. package/ui/Elements/DropdownMenu/components/DefaultItem.js +16 -0
  240. package/ui/Elements/DropdownMenu/components/MenuItem.d.ts +3 -0
  241. package/ui/Elements/DropdownMenu/components/MenuItem.js +51 -0
  242. package/ui/Elements/DropdownMenu/components/MenuList.d.ts +3 -0
  243. package/ui/Elements/DropdownMenu/components/MenuList.js +10 -0
  244. package/ui/Elements/DropdownMenu/index.d.ts +1 -0
  245. package/ui/Elements/DropdownMenu/index.js +1 -0
  246. package/ui/Elements/DropdownMenu/types.d.ts +41 -0
  247. package/ui/Elements/DropdownMenu/types.js +1 -0
  248. package/ui/Elements/HighlightBox/HighlightBox.d.ts +50 -0
  249. package/ui/Elements/HighlightBox/HighlightBox.js +65 -0
  250. package/ui/Elements/HighlightBox/index.d.ts +2 -0
  251. package/ui/Elements/HighlightBox/index.js +2 -0
  252. package/ui/Elements/MultiSelect/MultiSelect.d.ts +6 -0
  253. package/ui/Elements/MultiSelect/MultiSelect.js +29 -0
  254. package/ui/Elements/MultiSelect/index.d.ts +2 -0
  255. package/ui/Elements/MultiSelect/index.js +2 -0
  256. package/ui/Elements/Pagination/Pagination.d.ts +1 -1
  257. package/ui/Elements/Pagination/Pagination.js +6 -2
  258. package/ui/Elements/Pagination/styled.js +6 -6
  259. package/ui/Elements/Select/Select.d.ts +3 -0
  260. package/ui/Elements/Select/Select.js +69 -0
  261. package/ui/Elements/Select/index.d.ts +2 -0
  262. package/ui/Elements/Select/index.js +2 -0
  263. package/ui/Elements/Select/styles.d.ts +5 -0
  264. package/ui/Elements/Select/styles.js +12 -0
  265. package/ui/Elements/Select/themes/CustomComponents.d.ts +9 -0
  266. package/ui/Elements/Select/themes/CustomComponents.js +131 -0
  267. package/ui/Elements/Select/themes/baseStyles.d.ts +28 -0
  268. package/ui/Elements/Select/themes/baseStyles.js +70 -0
  269. package/ui/Elements/Select/themes/formStyles.d.ts +23 -0
  270. package/ui/Elements/Select/themes/formStyles.js +104 -0
  271. package/ui/Elements/Select/themes/headingStyles.d.ts +17 -0
  272. package/ui/Elements/Select/themes/headingStyles.js +99 -0
  273. package/ui/Elements/Select/themes/index.d.ts +3 -0
  274. package/ui/Elements/Select/themes/index.js +61 -0
  275. package/ui/Elements/Select/themes/leftMenuStyles.d.ts +18 -0
  276. package/ui/Elements/Select/themes/leftMenuStyles.js +57 -0
  277. package/ui/Elements/Select/types.d.ts +54 -0
  278. package/ui/Elements/Select/types.js +1 -0
  279. package/ui/Elements/SingleSelect/SingleSelect.d.ts +20 -0
  280. package/ui/Elements/SingleSelect/SingleSelect.js +197 -0
  281. package/ui/Elements/SingleSelect/index.d.ts +2 -0
  282. package/ui/Elements/SingleSelect/index.js +2 -0
  283. package/ui/Forms/Input/types.d.ts +2 -2
  284. package/ui/index.es.js +868 -1104
  285. package/ui/index.umd.js +8 -5
@@ -0,0 +1,35 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { t } from '@lingui/macro';
25
+ import GridSelect from '../GridSelect';
26
+ var getFlagOptions = function () { return [
27
+ { value: '', label: t({ id: 'dataGrid.columnActive.filterOptions.all', message: 'All' }) },
28
+ { value: '1', label: t({ id: 'dataGrid.columnActive.filterOptions.yes', message: 'Yes' }) },
29
+ { value: '0', label: t({ id: 'dataGrid.columnActive.filterOptions.no', message: 'No' }) },
30
+ ]; };
31
+ var SelectFilter = function (_a) {
32
+ var restProps = __rest(_a, []);
33
+ return _jsx(GridSelect, __assign({ options: getFlagOptions() }, restProps));
34
+ };
35
+ export default SelectFilter;
@@ -0,0 +1,2 @@
1
+ import BooleanSelect from './BooleanSelect';
2
+ export default BooleanSelect;
@@ -0,0 +1,2 @@
1
+ import BooleanSelect from './BooleanSelect';
2
+ export default BooleanSelect;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ type ItemType = {
3
+ title: string | React.ReactElement;
4
+ onClick: () => void;
5
+ link?: string;
6
+ };
7
+ export type Props = {
8
+ items: ItemType[];
9
+ disabled?: boolean;
10
+ dropdownPosition?: 'top' | 'bottom';
11
+ };
12
+ declare const ButtonMore: ({ items, disabled, dropdownPosition }: Props) => JSX.Element;
13
+ export default ButtonMore;
@@ -0,0 +1,32 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
6
+ import { useCallback, useState } from 'react';
7
+ import styled from '@xstyled/styled-components';
8
+ import { useClickOutside } from '../../../Modal/hooks/useClickOutside';
9
+ import Button from '../../../../Elements/Button/Button';
10
+ import DropdownMenu from '../../../../Elements/DropdownMenu';
11
+ var ButtonWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n width: fit-content;\n"], ["\n position: relative;\n width: fit-content;\n"])));
12
+ var StyledDropdownMenu = styled(DropdownMenu)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n top: ", ";\n bottom: ", ";\n right: 0;\n width: max-content;\n z-index: 2;\n"], ["\n position: absolute;\n top: ", ";\n bottom: ", ";\n right: 0;\n width: max-content;\n z-index: 2;\n"])), function (_a) {
13
+ var dropdownPosition = _a.dropdownPosition;
14
+ return (!dropdownPosition || dropdownPosition === 'bottom' ? 'calc(100% + 8px)' : 'auto');
15
+ }, function (_a) {
16
+ var dropdownPosition = _a.dropdownPosition;
17
+ return (dropdownPosition === 'top' ? 'calc(100% + 13px)' : 'auto');
18
+ });
19
+ var ButtonMore = function (_a) {
20
+ var items = _a.items, disabled = _a.disabled, dropdownPosition = _a.dropdownPosition;
21
+ var _b = useState(false), actionsVisible = _b[0], setActionsVisible = _b[1];
22
+ var onClose = useCallback(function () {
23
+ setActionsVisible(false);
24
+ }, []);
25
+ var ref = useClickOutside({ onClose: onClose });
26
+ var handleClick = useCallback(function () {
27
+ setActionsVisible(!actionsVisible);
28
+ }, [actionsVisible]);
29
+ return (_jsxs(ButtonWrapper, { ref: ref, children: [_jsx(Button, { onClick: handleClick, icon: "ellipsisVertical", appearance: "secondaryLg", type: "button", sizing: "iconLg", "data-cy": "gridActionBtn", disabled: disabled }), _jsx(StyledDropdownMenu, { showMenu: actionsVisible, items: items, dropdownPosition: dropdownPosition })] }));
30
+ };
31
+ export default ButtonMore;
32
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,2 @@
1
+ import ButtonMore from './ButtonMore';
2
+ export default ButtonMore;
@@ -0,0 +1,2 @@
1
+ import ButtonMore from './ButtonMore';
2
+ export default ButtonMore;
@@ -0,0 +1,11 @@
1
+ import { ColumnDefinition, GridActionsType, FiltersConfig, Group } from '../types';
2
+ type Props = {
3
+ onChange: Required<GridActionsType>['addFilter'];
4
+ value?: any;
5
+ column: ColumnDefinition;
6
+ displayColumnWidth: number;
7
+ filters?: FiltersConfig;
8
+ group?: Group;
9
+ };
10
+ declare const ColumnFilterCell: ({ onChange, value, displayColumnWidth, filters, column: columnDefinition, group, }: Props) => JSX.Element;
11
+ export default ColumnFilterCell;
@@ -0,0 +1,41 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import React from 'react';
14
+ import { x } from '@xstyled/styled-components';
15
+ import { Cell } from './Table';
16
+ import { useAddFilter } from '../utils/public';
17
+ import { createFilterType, getStickyCollClassNames } from '../utils';
18
+ import { getCellSizeProps, getGroupClassNames } from '../utils';
19
+ import OverlayComponent from './FilterDropdown';
20
+ var ColumnFilterCell = function (_a) {
21
+ var onChange = _a.onChange, value = _a.value, displayColumnWidth = _a.displayColumnWidth, filters = _a.filters, columnDefinition = _a.column, group = _a.group;
22
+ var cellSizeProps = getCellSizeProps(columnDefinition, displayColumnWidth);
23
+ var handleAddFilter = useAddFilter(onChange);
24
+ var handleChange = React.useCallback(function (event) {
25
+ handleAddFilter((event === null || event === void 0 ? void 0 : event.target) ? event.target.value : event, columnDefinition);
26
+ }, [handleAddFilter, columnDefinition]);
27
+ var cellClassName = "cell".concat(getStickyCollClassNames(!!columnDefinition.sticky, columnDefinition.stickTo), " ").concat(getGroupClassNames(group));
28
+ if (!columnDefinition.filtering) {
29
+ return _jsx(Cell, __assign({ className: cellClassName }, cellSizeProps));
30
+ }
31
+ var filterType = createFilterType(columnDefinition);
32
+ var filterConfig = filters === null || filters === void 0 ? void 0 : filters[filterType];
33
+ var RenderComponent = filterConfig === null || filterConfig === void 0 ? void 0 : filterConfig.CellComponent;
34
+ if (!RenderComponent) {
35
+ console.error("ERROR, using unknown filter type ".concat(filterType));
36
+ return (_jsx(x.div, { children: _jsx("span", { children: "".concat(filterType, " filter") }) }));
37
+ }
38
+ var passProps = __assign(__assign(__assign({}, filterConfig === null || filterConfig === void 0 ? void 0 : filterConfig.defaultExtraProps), columnDefinition.filterExtraProps), (filterType == 'options' && { options: columnDefinition.filterOptions }));
39
+ return (_jsx(Cell, __assign({ className: cellClassName }, cellSizeProps, { children: _jsx(x.div, { className: "test", children: _jsx(RenderComponent, __assign({ "data-test": columnDefinition.name, name: columnDefinition.name, onChange: handleChange, value: value, OverlayComponent: OverlayComponent }, passProps)) }) })));
40
+ };
41
+ export default ColumnFilterCell;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ColumnTitleComponentType } from '../../types';
3
+ type Props = React.ComponentProps<ColumnTitleComponentType>;
4
+ declare const ColumnTitle: ({ title, isSortable, onSetSort, sortValue }: Props) => JSX.Element | null;
5
+ export default ColumnTitle;
@@ -0,0 +1,58 @@
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
6
+ import { useState, useCallback, useRef, useEffect } from 'react';
7
+ import styled, { x, css } from '@xstyled/styled-components';
8
+ import Icon from '../../../../Elements/Icon/Icon';
9
+ // ArrowWrap and WarningWrap need to have the same size to solve resizing issues
10
+ var WRAPPER_WIDTH = 35;
11
+ var Wrap = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n font-size: 0.8rem;\n"], ["\n width: 100%;\n font-size: 0.8rem;\n"])));
12
+ var Title = styled.h4(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: unset;\n align-self: center;\n flex-shrink: 1;\n"], ["\n margin: unset;\n align-self: center;\n flex-shrink: 1;\n"])));
13
+ var arrowStyles = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n & > * {\n cursor: pointer;\n }\n"], ["\n flex-direction: row;\n & > * {\n cursor: pointer;\n }\n"])));
14
+ var InlineArrowWrap = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: ", ";\n position: static;\n font-size: 1rem;\n ", "\n margin-left: 6px;\n"], ["\n display: ", ";\n position: static;\n font-size: 1rem;\n ", "\n margin-left: 6px;\n"])), function (_a) {
15
+ var $isPopup = _a.$isPopup;
16
+ return ($isPopup ? 'none' : 'flex');
17
+ }, arrowStyles);
18
+ var PopupArrowWrap = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n position: absolute;\n top: 0;\n left: -24px;\n background-color: lightGray2;\n font-size: 0.8rem;\n border-radius: 0.4rem;\n padding: 0 4px;\n ", "\n width: ", "px;\n box-shadow: tooltipShadow;\n z-index: 1;\n"], ["\n display: flex;\n position: absolute;\n top: 0;\n left: -24px;\n background-color: lightGray2;\n font-size: 0.8rem;\n border-radius: 0.4rem;\n padding: 0 4px;\n ", "\n width: ", "px;\n box-shadow: tooltipShadow;\n z-index: 1;\n"])), arrowStyles, WRAPPER_WIDTH);
19
+ var OverflowWrap = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: none;\n position: relative;\n overflow: visible;\n &:hover {\n display: block;\n }\n"], ["\n display: none;\n position: relative;\n overflow: visible;\n &:hover {\n display: block;\n }\n"])));
20
+ var WarningWrap = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: relative;\n display: ", ";\n font-size: 0.7rem;\n margin-right: 6px;\n align-self: center;\n &:hover + ", " {\n display: flex;\n }\n"], ["\n position: relative;\n display: ", ";\n font-size: 0.7rem;\n margin-right: 6px;\n align-self: center;\n &:hover + ", " {\n display: flex;\n }\n"])), function (_a) {
21
+ var $isPopup = _a.$isPopup;
22
+ return ($isPopup ? 'block' : 'none');
23
+ }, OverflowWrap);
24
+ var Content = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n justify-content: ", ";\n display: flex;\n"], ["\n justify-content: ", ";\n display: flex;\n"])), function (_a) {
25
+ var $isPopup = _a.$isPopup;
26
+ return ($isPopup ? 'space-between' : 'unset');
27
+ });
28
+ var ColumnTitle = function (_a) {
29
+ var title = _a.title, isSortable = _a.isSortable, onSetSort = _a.onSetSort, sortValue = _a.sortValue;
30
+ var _b = useState(false), isOverflowing = _b[0], setIsOverflowing = _b[1];
31
+ var onSetAsc = useCallback(function () { return onSetSort === null || onSetSort === void 0 ? void 0 : onSetSort('asc'); }, [onSetSort]);
32
+ var onSetDesc = useCallback(function () { return onSetSort === null || onSetSort === void 0 ? void 0 : onSetSort('desc'); }, [onSetSort]);
33
+ var onSetNull = useCallback(function () { return onSetSort === null || onSetSort === void 0 ? void 0 : onSetSort(null); }, [onSetSort]);
34
+ var isAsc = sortValue == 'asc';
35
+ var isDesc = sortValue == 'desc';
36
+ var wrapRef = useRef(null);
37
+ var contentRef = useRef(null);
38
+ useEffect(function () {
39
+ var wrapRefCopy = wrapRef.current;
40
+ var contentRefCopy = contentRef.current;
41
+ if (!wrapRefCopy || !contentRefCopy)
42
+ return;
43
+ var resizeObserver = new ResizeObserver(function () {
44
+ var wrapWidth = wrapRefCopy.offsetWidth;
45
+ var contentWidth = contentRefCopy.offsetWidth + 42; // width of sorting buttons
46
+ setIsOverflowing(wrapWidth <= contentWidth);
47
+ });
48
+ resizeObserver.observe(wrapRefCopy === null || wrapRefCopy === void 0 ? void 0 : wrapRefCopy.parentNode);
49
+ return function () {
50
+ resizeObserver.unobserve(wrapRefCopy === null || wrapRefCopy === void 0 ? void 0 : wrapRefCopy.parentNode);
51
+ };
52
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53
+ }, [wrapRef === null || wrapRef === void 0 ? void 0 : wrapRef.current]);
54
+ var Arrows = (_jsxs(_Fragment, { children: [_jsx(x.div, { onClick: isAsc ? onSetNull : onSetAsc, children: _jsx(Icon, { icon: "chevronUp", fill: isAsc ? 'blue2' : 'lightGray3' }) }), _jsx(x.div, { onClick: isDesc ? onSetNull : onSetDesc, children: _jsx(Icon, { icon: "chevronDown", fill: isDesc ? 'blue2' : 'lightGray3' }) })] }));
55
+ return (_jsx(Wrap, { ref: wrapRef, children: _jsxs(Content, { "$isPopup": isOverflowing, children: [_jsx("div", { children: _jsx(Title, { ref: contentRef, children: title }) }), isSortable && (_jsxs(_Fragment, { children: [_jsx(WarningWrap, { "$isPopup": isOverflowing, children: _jsx(Icon, { icon: "warningDual", fill: "black", secondaryColor: "yellow2" }) }), _jsx(OverflowWrap, { "$isPopup": isOverflowing, children: _jsx(PopupArrowWrap, { "$isPopup": isOverflowing, children: Arrows }) }), _jsx(InlineArrowWrap, { "$isPopup": isOverflowing, children: Arrows })] }))] }) }));
56
+ };
57
+ export default ColumnTitle;
58
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
@@ -0,0 +1,2 @@
1
+ import ColumnTitle from './ColumnTitle';
2
+ export default ColumnTitle;
@@ -0,0 +1,2 @@
1
+ import ColumnTitle from './ColumnTitle';
2
+ export default ColumnTitle;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { SortingValueType } from '../types';
3
+ declare const _default: React.NamedExoticComponent<{
4
+ title?: string | JSX.Element | undefined;
5
+ isSortable: boolean;
6
+ onSetSort: (value: SortingValueType) => void;
7
+ sortValue: SortingValueType;
8
+ }>;
9
+ export default _default;
@@ -0,0 +1,20 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
6
+ import React from 'react';
7
+ import styled from '@xstyled/styled-components';
8
+ import { SortingUp, SortingDown } from './icons/Sorting';
9
+ var Title = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n & + * {\n margin-left: 1em;\n }\n"], ["\n & + * {\n margin-left: 1em;\n }\n"])));
10
+ var ColumnTitle = function (_a) {
11
+ var title = _a.title, isSortable = _a.isSortable, onSetSort = _a.onSetSort, sortValue = _a.sortValue;
12
+ var handleClick = React.useCallback(function () {
13
+ var newValue = sortValue ? (sortValue == 'asc' ? 'desc' : null) : 'asc';
14
+ if (onSetSort)
15
+ onSetSort(newValue);
16
+ }, [sortValue, onSetSort]);
17
+ return (_jsxs("div", { onClick: isSortable ? handleClick : undefined, className: isSortable ? 'sortable' : '', children: [_jsx(Title, { children: title }), isSortable && sortValue === 'asc' && _jsx(SortingUp, { width: "16" }), isSortable && sortValue === 'desc' && _jsx(SortingDown, { width: "16" })] }));
18
+ };
19
+ export default React.memo(ColumnTitle);
20
+ var templateObject_1;
@@ -0,0 +1,11 @@
1
+ import { CommonGridProps, GridActionsType, GridSelectorsType } from '../../types';
2
+ export declare const Row: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
3
+ type Props = {
4
+ columns?: CommonGridProps['columnsDefinitions'];
5
+ extraControlButtons: CommonGridProps['extraControlButtons'];
6
+ eshopSelect: CommonGridProps['extraControlButtons'];
7
+ gridActions: GridActionsType;
8
+ gridSelectors: GridSelectorsType;
9
+ };
10
+ declare const ControlButtons: ({ extraControlButtons, eshopSelect, gridActions, gridSelectors }: Props) => JSX.Element;
11
+ export default ControlButtons;
@@ -0,0 +1,20 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
6
+ import styled, { x } from '@xstyled/styled-components';
7
+ import { Trans } from '@lingui/react';
8
+ import ExtraControlButtons from '../ExtraControlButtons';
9
+ import { ExtraControlButtonPosition } from '../../types';
10
+ import Button from '../../../../Elements/Button/Button';
11
+ export var Row = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
12
+ var ControlButtons = function (_a) {
13
+ var extraControlButtons = _a.extraControlButtons, eshopSelect = _a.eshopSelect, gridActions = _a.gridActions, gridSelectors = _a.gridSelectors;
14
+ var resetFilters = gridActions.resetFilters;
15
+ var filter = gridSelectors.filter;
16
+ var filtersOn = !!filter && Object.values(filter).some(function (item) { var _a; return ((_a = item.value) === null || _a === void 0 ? void 0 : _a.value) !== '' && item.value !== ''; });
17
+ return (_jsxs(Row, { children: [eshopSelect && (_jsx(x.div, { children: _jsx(ExtraControlButtons, { extraControlButtons: eshopSelect, targetPosition: ExtraControlButtonPosition.TopRight }) })), _jsx(ExtraControlButtons, { extraControlButtons: extraControlButtons, targetPosition: ExtraControlButtonPosition.TopLeft }), _jsx(x.div, { children: filtersOn && (_jsx(Button, { type: "button", onClick: resetFilters, appearance: "secondaryLg", "data-cy": "resetFiltersBtn", children: _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }) })) })] }));
18
+ };
19
+ export default ControlButtons;
20
+ var templateObject_1;
@@ -0,0 +1,2 @@
1
+ import ControlButtons from './ControlButtons';
2
+ export default ControlButtons;
@@ -0,0 +1,2 @@
1
+ import ControlButtons from './ControlButtons';
2
+ export default ControlButtons;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { ColumnDefinition, RowProps, Group } from '../types';
3
+ type DataCellPros = {
4
+ column: ColumnDefinition;
5
+ rowData: RowProps;
6
+ onRowAction?: (id: string, field: string, value: any) => void;
7
+ displayColumnWidth: number;
8
+ group: Group;
9
+ };
10
+ declare const MemoDataCell: React.NamedExoticComponent<DataCellPros>;
11
+ export default MemoDataCell;
@@ -0,0 +1,52 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import React from 'react';
14
+ import get from 'lodash/fp/get';
15
+ import { TextCell } from './Table';
16
+ import { getCellSizeProps, getGroupClassNames, getStickyCollClassNames } from '../utils';
17
+ var DataCell = function (_a) {
18
+ var column = _a.column, group = _a.group, rowData = _a.rowData, onRowAction = _a.onRowAction, displayColumnWidth = _a.displayColumnWidth;
19
+ var Wrapper = column.fixedSize ? 'div' : TextCell;
20
+ var wrapperBaseProps = column.fixedSize
21
+ ? { style: __assign(__assign({}, getCellSizeProps(column, displayColumnWidth)), { alignSelf: 'center' }) }
22
+ : getCellSizeProps(column, displayColumnWidth);
23
+ var cellClassName = "cell".concat(getStickyCollClassNames(!!column.sticky, column.stickTo), " ").concat(getGroupClassNames(group));
24
+ if (column.cellComponent) {
25
+ return (_jsx(Wrapper, __assign({ className: cellClassName }, wrapperBaseProps, { children: _jsx(column.cellComponent, { rowData: rowData, onRowAction: onRowAction, column: column }) })));
26
+ }
27
+ else {
28
+ return (_jsx(Wrapper, __assign({ className: cellClassName }, wrapperBaseProps, { children: column.formatRowValue ? column.formatRowValue(rowData) : get(column.name, rowData) })));
29
+ }
30
+ };
31
+ var MemoDataCell = React.memo(DataCell, function (prevProps, newProps) {
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
33
+ if (prevProps.rowData !== newProps.rowData ||
34
+ prevProps.displayColumnWidth !== newProps.displayColumnWidth ||
35
+ ((_a = prevProps.column) === null || _a === void 0 ? void 0 : _a.fixedSize) != ((_b = newProps.column) === null || _b === void 0 ? void 0 : _b.fixedSize) ||
36
+ ((_c = prevProps.column) === null || _c === void 0 ? void 0 : _c.flexGrow) != ((_d = newProps.column) === null || _d === void 0 ? void 0 : _d.flexGrow) ||
37
+ ((_e = prevProps.column) === null || _e === void 0 ? void 0 : _e.flexShrink) != ((_f = newProps.column) === null || _f === void 0 ? void 0 : _f.flexShrink) ||
38
+ ((_g = prevProps.group) === null || _g === void 0 ? void 0 : _g.start) != ((_h = newProps.group) === null || _h === void 0 ? void 0 : _h.start) ||
39
+ ((_j = prevProps.group) === null || _j === void 0 ? void 0 : _j.end) != ((_k = newProps.group) === null || _k === void 0 ? void 0 : _k.end)) {
40
+ return false;
41
+ }
42
+ if ((((_l = prevProps.column) === null || _l === void 0 ? void 0 : _l.formatRowValue) || ((_m = newProps.column) === null || _m === void 0 ? void 0 : _m.formatRowValue)) &&
43
+ ((_o = prevProps.column) === null || _o === void 0 ? void 0 : _o.formatRowValue) !== ((_p = newProps.column) === null || _p === void 0 ? void 0 : _p.formatRowValue)) {
44
+ return false;
45
+ }
46
+ if ((((_q = prevProps.column) === null || _q === void 0 ? void 0 : _q.cellComponent) || ((_r = newProps.column) === null || _r === void 0 ? void 0 : _r.cellComponent)) &&
47
+ (((_s = prevProps.column) === null || _s === void 0 ? void 0 : _s.cellComponent) !== ((_t = newProps.column) === null || _t === void 0 ? void 0 : _t.cellComponent) || prevProps.onRowAction !== newProps.onRowAction)) {
48
+ return false;
49
+ }
50
+ return true;
51
+ });
52
+ export default MemoDataCell;
@@ -0,0 +1,21 @@
1
+ import { ColumnDefinition, ActionColumn, RowProps, UxState, GridSelectorsType, Group } from '../types';
2
+ type DataRowProps = {
3
+ columns: ColumnDefinition[];
4
+ actionColumn?: ActionColumn;
5
+ rowData: RowProps;
6
+ rowIndex: number;
7
+ uxState: UxState;
8
+ allowRowSelect?: boolean;
9
+ allowRowSelectOnAction?: boolean;
10
+ onUxChange?: (uxKey: keyof UxState, uxValue: any) => void;
11
+ onRowEditClick?: (id: string, props: RowProps) => void;
12
+ onRowReadClick?: (id: string, props: RowProps) => void;
13
+ onRowClick?: (id: string, props: RowProps) => void;
14
+ onRowAction?: (id: string, field: string, value: any) => void;
15
+ createLink?: (params?: object) => string;
16
+ displayColumnsWidth: Required<GridSelectorsType>['columnsWidth'];
17
+ groups: Group[];
18
+ isEven?: boolean;
19
+ };
20
+ declare const DataRow: ({ columns, actionColumn, rowData, rowIndex, uxState, allowRowSelect, allowRowSelectOnAction, onUxChange, onRowEditClick, onRowReadClick, onRowClick, onRowAction, displayColumnsWidth, groups, isEven, }: DataRowProps) => JSX.Element;
21
+ export default DataRow;
@@ -0,0 +1,110 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
+ import React from 'react';
25
+ import { x } from '@xstyled/styled-components';
26
+ import { Link } from 'react-router-dom';
27
+ import { Cell, StyledDataRow } from './Table';
28
+ import MemoDataCell from './DataCell';
29
+ import EditIcon from './icons/Edit';
30
+ import EyeOpenIcon from './icons/EyeOpen';
31
+ import { getActionCellSizeProps } from '../utils';
32
+ import { rowClassSymbol } from '../types';
33
+ import { isFunction } from 'lodash/fp';
34
+ import { useTimeMeasurement } from './utils';
35
+ import Toggle from '../../../Elements/Toggle/Toggle';
36
+ import Button from '../../../Elements/Button/Button';
37
+ var EmptySpan = function (_a) {
38
+ var children = _a.children, props = __rest(_a, ["children"]);
39
+ return _jsx("span", __assign({}, props, { children: children }));
40
+ };
41
+ var DataRow = function (_a) {
42
+ var _b, _c, _d;
43
+ var columns = _a.columns, actionColumn = _a.actionColumn, rowData = _a.rowData, rowIndex = _a.rowIndex, uxState = _a.uxState, allowRowSelect = _a.allowRowSelect, allowRowSelectOnAction = _a.allowRowSelectOnAction, onUxChange = _a.onUxChange, onRowEditClick = _a.onRowEditClick, onRowReadClick = _a.onRowReadClick, onRowClick = _a.onRowClick, onRowAction = _a.onRowAction, displayColumnsWidth = _a.displayColumnsWidth, groups = _a.groups, isEven = _a.isEven;
44
+ var isChecked = !!((_b = uxState.checkedRows) === null || _b === void 0 ? void 0 : _b[rowData.id]);
45
+ var onCheckboxChange = React.useCallback(function () {
46
+ var checkedRows = __assign({}, (uxState.checkedRows || {}));
47
+ if (!isChecked) {
48
+ checkedRows[rowData.id] = true;
49
+ }
50
+ else {
51
+ delete checkedRows[rowData.id];
52
+ }
53
+ onUxChange && onUxChange('checkedRows', checkedRows);
54
+ }, [onUxChange, isChecked, uxState, rowData]);
55
+ var handleEditClick = React.useCallback(function () {
56
+ if (onRowEditClick)
57
+ onRowEditClick(rowData.id, rowData);
58
+ if (onUxChange && allowRowSelectOnAction)
59
+ onUxChange('selectedRow', rowData.id);
60
+ }, [onRowEditClick, rowData]);
61
+ var handleReadClick = React.useCallback(function () {
62
+ if (onRowReadClick)
63
+ onRowReadClick(rowData.id, rowData);
64
+ if (onUxChange && allowRowSelectOnAction)
65
+ onUxChange('selectedRow', rowData.id);
66
+ }, [onRowReadClick, rowData]);
67
+ var handleRowAction = React.useCallback(function (id, field, value) {
68
+ if (onRowAction)
69
+ onRowAction(id, field, value);
70
+ if (onUxChange && allowRowSelectOnAction)
71
+ onUxChange('selectedRow', id);
72
+ }, [onRowReadClick, rowData]);
73
+ var handleRowClick = React.useCallback(function (e) {
74
+ // test whether I should trigger event or not (because of possible button/link/input/etc in cell)
75
+ var classes = Object.values(e.target.classList);
76
+ if (!classes.includes('dataRow') && !classes.includes('cell'))
77
+ return;
78
+ if (onUxChange && allowRowSelect)
79
+ onUxChange('selectedRow', rowData.id);
80
+ if (onRowClick)
81
+ onRowClick(rowData.id, rowData);
82
+ },
83
+ // eslint-disable-next-line react-hooks/exhaustive-deps
84
+ [onRowClick, onUxChange, rowData]);
85
+ var _e = useTimeMeasurement({ handleRowClick: handleRowClick }), handleMouseDown = _e.handleMouseDown, handleMouseUp = _e.handleMouseUp;
86
+ var RowActionComponent = ((actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.createLink) ? Link : EmptySpan);
87
+ var rowActionProps = React.useCallback(function (mode) {
88
+ var _a;
89
+ return (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.createLink)
90
+ ? { to: (_a = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.createLink) === null || _a === void 0 ? void 0 : _a.call(actionColumn, { mode: mode, id: rowData.id }) }
91
+ : { onClick: { read: handleReadClick, edit: handleEditClick }[mode] };
92
+ }, [actionColumn, handleReadClick, handleEditClick]);
93
+ var rowClassName = React.useMemo(function () {
94
+ var classes = ['dataRow'];
95
+ if (isChecked)
96
+ classes.push('checked');
97
+ if (uxState.selectedRow == rowData.id && (allowRowSelect || allowRowSelectOnAction))
98
+ classes.push('selected');
99
+ if (rowData[rowClassSymbol])
100
+ classes.push(rowData[rowClassSymbol] || '');
101
+ return classes.join(' ');
102
+ // eslint-disable-next-line react-hooks/exhaustive-deps
103
+ }, [isChecked, uxState, rowData]);
104
+ var actionColumnStyle = React.useMemo(function () {
105
+ return actionColumn ? __assign({}, getActionCellSizeProps(actionColumn)) : {};
106
+ }, [actionColumn]);
107
+ var displayReadEditCell = ((_c = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _c === void 0 ? void 0 : _c.length) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowEdit) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowRead) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.forceCheckboxes);
108
+ return (_jsxs(StyledDataRow, { className: rowClassName, hasRowClick: !!onRowClick, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, isEven: isEven, children: [actionColumn && (_jsxs(_Fragment, { children: [displayReadEditCell && (_jsxs(Cell, { className: "cell", style: actionColumnStyle, children: [((_d = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _d === void 0 ? void 0 : _d.length) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.forceCheckboxes) ? (_jsx(Toggle, { checked: isChecked, onChange: onCheckboxChange, label: "" })) : null, _jsxs(x.div, { children: [(isFunction(actionColumn.canRowRead) ? actionColumn.canRowRead(rowData) : actionColumn.canRowRead) && (_jsx(RowActionComponent, __assign({}, rowActionProps('read'), { children: _jsx(Button, { type: "button", appearance: "primary", mb: "5px", ml: "5px", mr: "5px", className: "actionColumnButton", children: _jsx(EyeOpenIcon, { width: "16px", height: "16px" }) }) }))), (isFunction(actionColumn.canRowEdit) ? actionColumn.canRowEdit(rowData) : actionColumn.canRowEdit) && (_jsx(RowActionComponent, __assign({}, rowActionProps('edit'), { children: _jsx(Button, { type: "button", appearance: "primary", mt: "5px", mb: "5px", ml: "5px", mr: "5px", className: "actionColumnButton", children: _jsx(EditIcon, { width: "16px", height: "16px" }) }) })))] })] })), (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.addRowNumbers) && (_jsx(Cell, { className: "cell", style: actionColumnStyle, children: _jsx(x.div, { children: rowIndex }) }))] })), columns.map(function (column, key) { return (_jsx(MemoDataCell, { column: column, rowData: rowData, onRowAction: handleRowAction, displayColumnWidth: displayColumnsWidth[column.name], group: groups === null || groups === void 0 ? void 0 : groups[key] }, column.name)); })] }));
109
+ };
110
+ export default DataRow;
@@ -0,0 +1,12 @@
1
+ import { FilterComponentProps } from '../../types';
2
+ type InitialView = 'past' | 'future';
3
+ type DatePickerRangeProps = FilterComponentProps<Date[]> & {
4
+ filterTime?: number;
5
+ initialView?: InitialView;
6
+ };
7
+ type DateRangeProps = DatePickerRangeProps & {
8
+ error?: string;
9
+ label?: string;
10
+ };
11
+ declare const DatePickerRange: (props: DateRangeProps) => JSX.Element;
12
+ export default DatePickerRange;