@onewelcome/react-lib-components 6.7.0 → 7.0.0

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 (395) hide show
  1. package/README.md +6 -0
  2. package/dist/cjs/DataGrid/DataGrid.cjs.js +1 -1
  3. package/dist/cjs/DataGrid/DataGrid.cjs.js.map +1 -1
  4. package/dist/cjs/DataGrid/DataGridBody/DataGridBody.cjs.js +1 -1
  5. package/dist/cjs/DataGrid/DataGridBody/DataGridBody.cjs.js.map +1 -1
  6. package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.cjs.js +2 -0
  7. package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.cjs.js.map +1 -0
  8. package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.cjs.js +2 -0
  9. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.cjs.js +2 -0
  10. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.cjs.js.map +1 -0
  11. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.cjs.js +2 -0
  12. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.cjs.js.map +1 -0
  13. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.cjs.js +2 -0
  14. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.cjs.js.map +1 -0
  15. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.cjs.js +2 -0
  16. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.cjs.js.map +1 -0
  17. package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js +2 -0
  18. package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js.map +1 -0
  19. package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.cjs.js +2 -0
  20. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.cjs.js +2 -0
  21. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.cjs.js.map +1 -0
  22. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.module.cjs.js +2 -0
  23. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.module.cjs.js.map +1 -0
  24. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterPopover.cjs.js +2 -0
  25. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterPopover.cjs.js.map +1 -0
  26. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterService.cjs.js +2 -0
  27. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterService.cjs.js.map +1 -0
  28. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js +2 -0
  29. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js.map +1 -0
  30. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilters.interfaces.cjs.js +2 -0
  31. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilters.interfaces.cjs.js.map +1 -0
  32. package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.cjs.js +2 -0
  33. package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.cjs.js.map +1 -0
  34. package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.module.cjs.js +2 -0
  35. package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.module.cjs.js.map +1 -0
  36. package/dist/cjs/DataGrid/DataGridHeader/DataGridHeader.cjs.js +1 -1
  37. package/dist/cjs/DataGrid/DataGridHeader/DataGridHeader.cjs.js.map +1 -1
  38. package/dist/cjs/Form/FileUpload/FileItem/FileItem.cjs.js +1 -1
  39. package/dist/cjs/Form/FileUpload/FileItem/FileItem.cjs.js.map +1 -1
  40. package/dist/cjs/Form/FileUpload/FileUpload.cjs.js +1 -1
  41. package/dist/cjs/Form/FileUpload/FileUpload.cjs.js.map +1 -1
  42. package/dist/cjs/Form/FileUpload/FileUpload.module.cjs.js +1 -1
  43. package/dist/cjs/Form/Select/MultiSelect/MultiOption.cjs.js +1 -1
  44. package/dist/cjs/Form/Select/MultiSelect/MultiOption.cjs.js.map +1 -1
  45. package/dist/cjs/Form/Select/MultiSelect/MultiSelect.cjs.js +1 -1
  46. package/dist/cjs/Form/Select/MultiSelect/MultiSelect.cjs.js.map +1 -1
  47. package/dist/cjs/Form/Select/MultiSelect/useSearch.cjs.js +1 -1
  48. package/dist/cjs/Form/Select/MultiSelect/useSearch.cjs.js.map +1 -1
  49. package/dist/cjs/Form/Select/SingleSelect/Select.cjs.js +1 -1
  50. package/dist/cjs/Form/Select/SingleSelect/Select.cjs.js.map +1 -1
  51. package/dist/cjs/Form/Select/SingleSelect/useSearch.cjs.js +1 -1
  52. package/dist/cjs/Form/Select/SingleSelect/useSearch.cjs.js.map +1 -1
  53. package/dist/cjs/Icon/Icon.cjs.js +1 -1
  54. package/dist/cjs/Icon/Icon.cjs.js.map +1 -1
  55. package/dist/cjs/Icon/Icon.module.cjs.js +1 -1
  56. package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.cjs.js +1 -1
  57. package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.cjs.js.map +1 -1
  58. package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.module.cjs.js +1 -1
  59. package/dist/cjs/Notifications/NotificationProvider/NotificationContext.cjs.js +1 -1
  60. package/dist/cjs/Notifications/NotificationProvider/NotificationContext.cjs.js.map +1 -1
  61. package/dist/cjs/Pagination/Pagination.cjs.js +1 -1
  62. package/dist/cjs/Pagination/Pagination.cjs.js.map +1 -1
  63. package/dist/cjs/Popover/Popover.cjs.js +1 -1
  64. package/dist/cjs/Popover/Popover.cjs.js.map +1 -1
  65. package/dist/cjs/Tag/RemoveButton.module.cjs.js +1 -1
  66. package/dist/cjs/_BaseStyling_/BaseStyling.cjs.js +1 -1
  67. package/dist/cjs/_BaseStyling_/BaseStyling.cjs.js.map +1 -1
  68. package/dist/cjs/admin/layout/MicrofrontendContainer/MicrofrontendContainer.cjs.js +2 -0
  69. package/dist/cjs/admin/layout/MicrofrontendContainer/MicrofrontendContainer.cjs.js.map +1 -0
  70. package/dist/cjs/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.cjs.js +2 -0
  71. package/dist/cjs/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.cjs.js.map +1 -0
  72. package/dist/cjs/src/components/DataGrid/DataGrid.d.ts +6 -0
  73. package/dist/cjs/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.d.ts +5 -0
  74. package/dist/cjs/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.d.ts +6 -0
  75. package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridRow.d.ts → DataGridRow/DataGridRow.d.ts} +8 -1
  76. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilter.d.ts +15 -0
  77. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.d.ts +22 -0
  78. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterService.d.ts +15 -0
  79. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterTag.d.ts +12 -0
  80. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.d.ts +57 -0
  81. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +13 -0
  82. package/dist/cjs/src/components/DataGrid/DataGridHeader/DataGridHeader.d.ts +1 -0
  83. package/dist/cjs/src/components/DataGrid/testUtils.d.ts +13 -0
  84. package/dist/cjs/src/components/Form/FileUpload/FileUpload.d.ts +2 -1
  85. package/dist/cjs/src/components/Form/Select/MultiSelect/MultiSelect.test.d.ts +2 -3
  86. package/dist/cjs/src/components/Form/Select/MultiSelect/useSearch.d.ts +2 -12
  87. package/dist/cjs/src/components/Form/Select/Select.interfaces.d.ts +1 -11
  88. package/dist/cjs/src/components/Form/Select/SingleSelect/Select.test.d.ts +2 -3
  89. package/dist/cjs/src/components/Form/Select/SingleSelect/useSearch.d.ts +2 -12
  90. package/dist/cjs/src/components/Form/Select/useSelectPositionList.d.ts +2 -2
  91. package/dist/cjs/src/components/Icon/Icon.d.ts +2 -1
  92. package/dist/cjs/src/components/_BaseStyling_/BaseStyling.d.ts +0 -26
  93. package/dist/cjs/src/hooks/useFullHeightCollapse.cjs.js +2 -0
  94. package/dist/cjs/src/hooks/useFullHeightCollapse.cjs.js.map +1 -0
  95. package/dist/cjs/src/hooks/useFullHeightCollapse.d.ts +4 -0
  96. package/dist/cjs/src/hooks/usePosition.cjs.js +1 -1
  97. package/dist/cjs/src/hooks/usePosition.cjs.js.map +1 -1
  98. package/dist/cjs/src/index.cjs.js +1 -1
  99. package/dist/cjs/src/index.d.ts +10 -21
  100. package/dist/esm/DataGrid/DataGrid.esm.js +1 -1
  101. package/dist/esm/DataGrid/DataGrid.esm.js.map +1 -1
  102. package/dist/esm/DataGrid/DataGridBody/DataGridBody.esm.js +1 -1
  103. package/dist/esm/DataGrid/DataGridBody/DataGridBody.esm.js.map +1 -1
  104. package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.esm.js +2 -0
  105. package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.esm.js.map +1 -0
  106. package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.esm.js +2 -0
  107. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.esm.js +2 -0
  108. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.esm.js.map +1 -0
  109. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.esm.js +2 -0
  110. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.esm.js.map +1 -0
  111. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.esm.js +2 -0
  112. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.esm.js.map +1 -0
  113. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.esm.js +2 -0
  114. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.esm.js.map +1 -0
  115. package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.esm.js +2 -0
  116. package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.esm.js.map +1 -0
  117. package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.esm.js +2 -0
  118. package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.esm.js +2 -0
  119. package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.esm.js.map +1 -0
  120. package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.module.esm.js +2 -0
  121. package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.module.esm.js.map +1 -0
  122. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterPopover.esm.js +2 -0
  123. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterPopover.esm.js.map +1 -0
  124. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterService.esm.js +2 -0
  125. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterService.esm.js.map +1 -0
  126. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterTag.esm.js +2 -0
  127. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterTag.esm.js.map +1 -0
  128. package/dist/esm/DataGrid/DataGridFilters/DataGridFilters.interfaces.esm.js +2 -0
  129. package/dist/esm/DataGrid/DataGridFilters/DataGridFilters.interfaces.esm.js.map +1 -0
  130. package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.esm.js +2 -0
  131. package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.esm.js.map +1 -0
  132. package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.module.esm.js +2 -0
  133. package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.module.esm.js.map +1 -0
  134. package/dist/esm/DataGrid/DataGridHeader/DataGridHeader.esm.js +1 -1
  135. package/dist/esm/DataGrid/DataGridHeader/DataGridHeader.esm.js.map +1 -1
  136. package/dist/esm/Form/FileUpload/FileItem/FileItem.esm.js +1 -1
  137. package/dist/esm/Form/FileUpload/FileItem/FileItem.esm.js.map +1 -1
  138. package/dist/esm/Form/FileUpload/FileUpload.esm.js +1 -1
  139. package/dist/esm/Form/FileUpload/FileUpload.esm.js.map +1 -1
  140. package/dist/esm/Form/FileUpload/FileUpload.module.esm.js +1 -1
  141. package/dist/esm/Form/Select/MultiSelect/MultiOption.esm.js +1 -1
  142. package/dist/esm/Form/Select/MultiSelect/MultiOption.esm.js.map +1 -1
  143. package/dist/esm/Form/Select/MultiSelect/MultiSelect.esm.js +1 -1
  144. package/dist/esm/Form/Select/MultiSelect/MultiSelect.esm.js.map +1 -1
  145. package/dist/esm/Form/Select/MultiSelect/useSearch.esm.js +1 -1
  146. package/dist/esm/Form/Select/MultiSelect/useSearch.esm.js.map +1 -1
  147. package/dist/esm/Form/Select/SingleSelect/Select.esm.js +1 -1
  148. package/dist/esm/Form/Select/SingleSelect/Select.esm.js.map +1 -1
  149. package/dist/esm/Form/Select/SingleSelect/useSearch.esm.js +1 -1
  150. package/dist/esm/Form/Select/SingleSelect/useSearch.esm.js.map +1 -1
  151. package/dist/esm/Icon/Icon.esm.js +1 -1
  152. package/dist/esm/Icon/Icon.esm.js.map +1 -1
  153. package/dist/esm/Icon/Icon.module.esm.js +1 -1
  154. package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.esm.js +1 -1
  155. package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.esm.js.map +1 -1
  156. package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.module.esm.js +1 -1
  157. package/dist/esm/Notifications/NotificationProvider/NotificationContext.esm.js +1 -1
  158. package/dist/esm/Notifications/NotificationProvider/NotificationContext.esm.js.map +1 -1
  159. package/dist/esm/Pagination/Pagination.esm.js +1 -1
  160. package/dist/esm/Pagination/Pagination.esm.js.map +1 -1
  161. package/dist/esm/Popover/Popover.esm.js +1 -1
  162. package/dist/esm/Popover/Popover.esm.js.map +1 -1
  163. package/dist/esm/Tag/RemoveButton.module.esm.js +1 -1
  164. package/dist/esm/_BaseStyling_/BaseStyling.esm.js +1 -1
  165. package/dist/esm/_BaseStyling_/BaseStyling.esm.js.map +1 -1
  166. package/dist/esm/admin/layout/MicrofrontendContainer/MicrofrontendContainer.esm.js +2 -0
  167. package/dist/esm/admin/layout/MicrofrontendContainer/MicrofrontendContainer.esm.js.map +1 -0
  168. package/dist/esm/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.esm.js +2 -0
  169. package/dist/esm/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.esm.js.map +1 -0
  170. package/dist/esm/src/components/DataGrid/DataGrid.d.ts +6 -0
  171. package/dist/esm/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.d.ts +5 -0
  172. package/dist/esm/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.d.ts +6 -0
  173. package/dist/esm/src/components/DataGrid/DataGridBody/{DataGridRow.d.ts → DataGridRow/DataGridRow.d.ts} +8 -1
  174. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilter.d.ts +15 -0
  175. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.d.ts +22 -0
  176. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterService.d.ts +15 -0
  177. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterTag.d.ts +12 -0
  178. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.d.ts +57 -0
  179. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +13 -0
  180. package/dist/esm/src/components/DataGrid/DataGridHeader/DataGridHeader.d.ts +1 -0
  181. package/dist/esm/src/components/DataGrid/testUtils.d.ts +13 -0
  182. package/dist/esm/src/components/Form/FileUpload/FileUpload.d.ts +2 -1
  183. package/dist/esm/src/components/Form/Select/MultiSelect/MultiSelect.test.d.ts +2 -3
  184. package/dist/esm/src/components/Form/Select/MultiSelect/useSearch.d.ts +2 -12
  185. package/dist/esm/src/components/Form/Select/Select.interfaces.d.ts +1 -11
  186. package/dist/esm/src/components/Form/Select/SingleSelect/Select.test.d.ts +2 -3
  187. package/dist/esm/src/components/Form/Select/SingleSelect/useSearch.d.ts +2 -12
  188. package/dist/esm/src/components/Form/Select/useSelectPositionList.d.ts +2 -2
  189. package/dist/esm/src/components/Icon/Icon.d.ts +2 -1
  190. package/dist/esm/src/components/_BaseStyling_/BaseStyling.d.ts +0 -26
  191. package/dist/esm/src/hooks/useFullHeightCollapse.d.ts +4 -0
  192. package/dist/esm/src/hooks/useFullHeightCollapse.esm.js +2 -0
  193. package/dist/esm/src/hooks/useFullHeightCollapse.esm.js.map +1 -0
  194. package/dist/esm/src/hooks/usePosition.esm.js +1 -1
  195. package/dist/esm/src/hooks/usePosition.esm.js.map +1 -1
  196. package/dist/esm/src/index.d.ts +10 -21
  197. package/dist/esm/src/index.esm.js +1 -1
  198. package/package.json +50 -49
  199. package/src/components/DataGrid/DataGrid.tsx +24 -10
  200. package/src/components/DataGrid/DataGridBody/DataGridBody.tsx +2 -2
  201. package/src/components/DataGrid/DataGridBody/{DataGridCell.module.scss → DataGridCell/DataGridCell.module.scss} +2 -2
  202. package/src/components/DataGrid/DataGridBody/{DataGridCell.tsx → DataGridCell/DataGridCell.tsx} +1 -1
  203. package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss +60 -0
  204. package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.tsx +39 -0
  205. package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss +21 -0
  206. package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.tsx +47 -0
  207. package/src/components/DataGrid/DataGridBody/{DataGridRow.module.scss → DataGridRow/DataGridRow.module.scss} +17 -1
  208. package/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.tsx +122 -0
  209. package/src/components/DataGrid/DataGridBody/__snapshots__/DataGridBody.test.tsx.snap +4 -4
  210. package/src/components/DataGrid/DataGridFilters/DataGridFilter.module.scss +105 -0
  211. package/src/components/DataGrid/DataGridFilters/DataGridFilter.tsx +150 -0
  212. package/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.tsx +181 -0
  213. package/src/components/DataGrid/DataGridFilters/DataGridFilterService.ts +97 -0
  214. package/src/components/DataGrid/DataGridFilters/DataGridFilterTag.tsx +91 -0
  215. package/src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.ts +84 -0
  216. package/src/components/{Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.scss → DataGrid/DataGridFilters/DataGridToolbar.module.scss} +27 -34
  217. package/src/components/DataGrid/DataGridFilters/DataGridToolbar.tsx +126 -0
  218. package/src/components/DataGrid/DataGridHeader/DataGridHeader.tsx +6 -1
  219. package/src/components/DataGrid/testUtils.ts +77 -0
  220. package/src/components/Form/FileUpload/FileItem/FileItem.tsx +5 -8
  221. package/src/components/Form/FileUpload/FileUpload.module.scss +9 -4
  222. package/src/components/Form/FileUpload/FileUpload.tsx +34 -15
  223. package/src/components/Form/Select/MultiSelect/MultiOption.tsx +4 -2
  224. package/src/components/Form/Select/MultiSelect/MultiSelect.tsx +1 -5
  225. package/src/components/Form/Select/MultiSelect/useSearch.tsx +6 -16
  226. package/src/components/Form/Select/Select.interfaces.ts +1 -9
  227. package/src/components/Form/Select/SingleSelect/Select.tsx +1 -5
  228. package/src/components/Form/Select/SingleSelect/useSearch.tsx +6 -18
  229. package/src/components/Icon/Icon.module.scss +5 -0
  230. package/src/components/Icon/Icon.tsx +2 -1
  231. package/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss +12 -15
  232. package/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.tsx +3 -5
  233. package/src/components/Notifications/NotificationProvider/NotificationContext.tsx +12 -16
  234. package/src/components/Pagination/Pagination.tsx +15 -6
  235. package/src/components/Popover/Popover.tsx +1 -1
  236. package/src/components/Tag/RemoveButton.module.scss +1 -0
  237. package/src/components/_BaseStyling_/BaseStyling.tsx +0 -36
  238. package/src/font/icomoon.eot +0 -0
  239. package/src/font/icomoon.svg +1 -0
  240. package/src/font/icomoon.ttf +0 -0
  241. package/src/font/icomoon.woff +0 -0
  242. package/src/font/selection.json +1 -1
  243. package/src/{components/Notifications/Snackbar/useSnackbar.ts → hooks/useFullHeightCollapse.ts} +12 -11
  244. package/src/hooks/usePosition.ts +3 -4
  245. package/src/index.ts +11 -25
  246. package/dist/cjs/DataGrid/DataGridBody/DataGridCell.cjs.js +0 -2
  247. package/dist/cjs/DataGrid/DataGridBody/DataGridCell.cjs.js.map +0 -1
  248. package/dist/cjs/DataGrid/DataGridBody/DataGridCell.module.cjs.js +0 -2
  249. package/dist/cjs/DataGrid/DataGridBody/DataGridRow.cjs.js +0 -2
  250. package/dist/cjs/DataGrid/DataGridBody/DataGridRow.cjs.js.map +0 -1
  251. package/dist/cjs/DataGrid/DataGridBody/DataGridRow.module.cjs.js +0 -2
  252. package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.cjs.js +0 -2
  253. package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.cjs.js.map +0 -1
  254. package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.cjs.js +0 -2
  255. package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.cjs.js.map +0 -1
  256. package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.cjs.js +0 -2
  257. package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.cjs.js.map +0 -1
  258. package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.cjs.js +0 -2
  259. package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.cjs.js.map +0 -1
  260. package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.cjs.js +0 -2
  261. package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.cjs.js.map +0 -1
  262. package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.cjs.js +0 -2
  263. package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.cjs.js.map +0 -1
  264. package/dist/cjs/Notifications/Snackbar/interfaces.cjs.js +0 -2
  265. package/dist/cjs/Notifications/Snackbar/interfaces.cjs.js.map +0 -1
  266. package/dist/cjs/Notifications/Snackbar/useSnackbar.cjs.js +0 -2
  267. package/dist/cjs/Notifications/Snackbar/useSnackbar.cjs.js.map +0 -1
  268. package/dist/cjs/StatusIndicator/StatusIndicator.cjs.js +0 -2
  269. package/dist/cjs/StatusIndicator/StatusIndicator.cjs.js.map +0 -1
  270. package/dist/cjs/StatusIndicator/StatusIndicator.module.cjs.js +0 -2
  271. package/dist/cjs/StatusIndicator/StatusIndicator.module.cjs.js.map +0 -1
  272. package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.cjs.js +0 -2
  273. package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.cjs.js.map +0 -1
  274. package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.module.cjs.js +0 -2
  275. package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.module.cjs.js.map +0 -1
  276. package/dist/cjs/Wizard/Wizard.cjs.js +0 -2
  277. package/dist/cjs/Wizard/Wizard.cjs.js.map +0 -1
  278. package/dist/cjs/Wizard/WizardActions/WizardActions.cjs.js +0 -2
  279. package/dist/cjs/Wizard/WizardActions/WizardActions.cjs.js.map +0 -1
  280. package/dist/cjs/Wizard/WizardStateProvider.cjs.js +0 -2
  281. package/dist/cjs/Wizard/WizardStateProvider.cjs.js.map +0 -1
  282. package/dist/cjs/Wizard/WizardSteps/WizardSteps.cjs.js +0 -2
  283. package/dist/cjs/Wizard/WizardSteps/WizardSteps.cjs.js.map +0 -1
  284. package/dist/cjs/Wizard/wizardStateReducer.cjs.js +0 -2
  285. package/dist/cjs/Wizard/wizardStateReducer.cjs.js.map +0 -1
  286. package/dist/cjs/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +0 -21
  287. package/dist/cjs/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +0 -20
  288. package/dist/cjs/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +0 -39
  289. package/dist/cjs/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +0 -27
  290. package/dist/cjs/src/components/Notifications/Snackbar/interfaces.d.ts +0 -36
  291. package/dist/cjs/src/components/Notifications/Snackbar/useSnackbar.d.ts +0 -9
  292. package/dist/cjs/src/components/StatusIndicator/StatusIndicator.d.ts +0 -9
  293. package/dist/cjs/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +0 -12
  294. package/dist/cjs/src/components/Wizard/Wizard.d.ts +0 -11
  295. package/dist/cjs/src/components/Wizard/WizardActions/WizardActions.d.ts +0 -25
  296. package/dist/cjs/src/components/Wizard/WizardStateProvider.d.ts +0 -15
  297. package/dist/cjs/src/components/Wizard/WizardSteps/WizardSteps.d.ts +0 -8
  298. package/dist/cjs/src/components/Wizard/WizardSteps/WizardSteps.test.d.ts +0 -1
  299. package/dist/cjs/src/components/Wizard/wizardStateReducer.d.ts +0 -24
  300. package/dist/esm/DataGrid/DataGridBody/DataGridCell.esm.js +0 -2
  301. package/dist/esm/DataGrid/DataGridBody/DataGridCell.esm.js.map +0 -1
  302. package/dist/esm/DataGrid/DataGridBody/DataGridCell.module.esm.js +0 -2
  303. package/dist/esm/DataGrid/DataGridBody/DataGridRow.esm.js +0 -2
  304. package/dist/esm/DataGrid/DataGridBody/DataGridRow.esm.js.map +0 -1
  305. package/dist/esm/DataGrid/DataGridBody/DataGridRow.module.esm.js +0 -2
  306. package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.esm.js +0 -2
  307. package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.esm.js.map +0 -1
  308. package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.esm.js +0 -2
  309. package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.esm.js.map +0 -1
  310. package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.esm.js +0 -2
  311. package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.esm.js.map +0 -1
  312. package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.esm.js +0 -2
  313. package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.esm.js.map +0 -1
  314. package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.esm.js +0 -2
  315. package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.esm.js.map +0 -1
  316. package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.esm.js +0 -2
  317. package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.esm.js.map +0 -1
  318. package/dist/esm/Notifications/Snackbar/interfaces.esm.js +0 -2
  319. package/dist/esm/Notifications/Snackbar/interfaces.esm.js.map +0 -1
  320. package/dist/esm/Notifications/Snackbar/useSnackbar.esm.js +0 -2
  321. package/dist/esm/Notifications/Snackbar/useSnackbar.esm.js.map +0 -1
  322. package/dist/esm/StatusIndicator/StatusIndicator.esm.js +0 -2
  323. package/dist/esm/StatusIndicator/StatusIndicator.esm.js.map +0 -1
  324. package/dist/esm/StatusIndicator/StatusIndicator.module.esm.js +0 -2
  325. package/dist/esm/StatusIndicator/StatusIndicator.module.esm.js.map +0 -1
  326. package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.esm.js +0 -2
  327. package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.esm.js.map +0 -1
  328. package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.module.esm.js +0 -2
  329. package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.module.esm.js.map +0 -1
  330. package/dist/esm/Wizard/Wizard.esm.js +0 -2
  331. package/dist/esm/Wizard/Wizard.esm.js.map +0 -1
  332. package/dist/esm/Wizard/WizardActions/WizardActions.esm.js +0 -2
  333. package/dist/esm/Wizard/WizardActions/WizardActions.esm.js.map +0 -1
  334. package/dist/esm/Wizard/WizardStateProvider.esm.js +0 -2
  335. package/dist/esm/Wizard/WizardStateProvider.esm.js.map +0 -1
  336. package/dist/esm/Wizard/WizardSteps/WizardSteps.esm.js +0 -2
  337. package/dist/esm/Wizard/WizardSteps/WizardSteps.esm.js.map +0 -1
  338. package/dist/esm/Wizard/wizardStateReducer.esm.js +0 -2
  339. package/dist/esm/Wizard/wizardStateReducer.esm.js.map +0 -1
  340. package/dist/esm/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +0 -21
  341. package/dist/esm/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.d.ts +0 -1
  342. package/dist/esm/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +0 -20
  343. package/dist/esm/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.d.ts +0 -1
  344. package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +0 -39
  345. package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.d.ts +0 -1
  346. package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +0 -27
  347. package/dist/esm/src/components/Notifications/Snackbar/interfaces.d.ts +0 -36
  348. package/dist/esm/src/components/Notifications/Snackbar/useSnackbar.d.ts +0 -9
  349. package/dist/esm/src/components/Notifications/Snackbar/useSnackbar.test.d.ts +0 -1
  350. package/dist/esm/src/components/StatusIndicator/StatusIndicator.d.ts +0 -9
  351. package/dist/esm/src/components/StatusIndicator/StatusIndicator.test.d.ts +0 -1
  352. package/dist/esm/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +0 -12
  353. package/dist/esm/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.test.d.ts +0 -1
  354. package/dist/esm/src/components/Wizard/Wizard.d.ts +0 -11
  355. package/dist/esm/src/components/Wizard/Wizard.test.d.ts +0 -1
  356. package/dist/esm/src/components/Wizard/WizardActions/WizardActions.d.ts +0 -25
  357. package/dist/esm/src/components/Wizard/WizardActions/WizardActions.test.d.ts +0 -1
  358. package/dist/esm/src/components/Wizard/WizardStateProvider.d.ts +0 -15
  359. package/dist/esm/src/components/Wizard/WizardSteps/WizardSteps.d.ts +0 -8
  360. package/dist/esm/src/components/Wizard/WizardSteps/WizardSteps.test.d.ts +0 -1
  361. package/dist/esm/src/components/Wizard/wizardStateReducer.d.ts +0 -24
  362. package/src/components/DataGrid/DataGridBody/DataGridRow.tsx +0 -58
  363. package/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.tsx +0 -92
  364. package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.scss +0 -156
  365. package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.tsx +0 -161
  366. package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.tsx +0 -219
  367. package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.tsx +0 -57
  368. package/src/components/Notifications/Snackbar/interfaces.ts +0 -62
  369. package/src/components/StatusIndicator/StatusIndicator.module.scss +0 -43
  370. package/src/components/StatusIndicator/StatusIndicator.tsx +0 -44
  371. package/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.module.scss +0 -214
  372. package/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.tsx +0 -93
  373. package/src/components/Wizard/Wizard.tsx +0 -67
  374. package/src/components/Wizard/WizardActions/WizardActions.tsx +0 -116
  375. package/src/components/Wizard/WizardStateProvider.tsx +0 -45
  376. package/src/components/Wizard/WizardSteps/WizardSteps.tsx +0 -54
  377. package/src/components/Wizard/wizardStateReducer.ts +0 -61
  378. /package/dist/cjs/DataGrid/DataGridBody/{DataGridCell.module.cjs.js.map → DataGridCell/DataGridCell.module.cjs.js.map} +0 -0
  379. /package/dist/cjs/DataGrid/DataGridBody/{DataGridRow.module.cjs.js.map → DataGridRow/DataGridRow.module.cjs.js.map} +0 -0
  380. /package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridCell.d.ts → DataGridCell/DataGridCell.d.ts} +0 -0
  381. /package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridCell.test.d.ts → DataGridCell/DataGridCell.test.d.ts} +0 -0
  382. /package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridRow.test.d.ts → DataGridDrawer/DataGridDrawerItem.test.d.ts} +0 -0
  383. /package/dist/{esm/src/components/DataGrid/DataGridBody → cjs/src/components/DataGrid/DataGridBody/DataGridRow}/DataGridRow.test.d.ts +0 -0
  384. /package/dist/cjs/src/components/{Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.d.ts → DataGrid/DataGridFilters/DataGridFilterTag.test.d.ts} +0 -0
  385. /package/dist/cjs/src/components/{Notifications/Snackbar/SnackbarItem/SnackbarItem.test.d.ts → DataGrid/DataGridFilters/DataGridToolbar.test.d.ts} +0 -0
  386. /package/dist/cjs/src/{components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.d.ts → hooks/useFullHeightCollapse.test.d.ts} +0 -0
  387. /package/dist/esm/DataGrid/DataGridBody/{DataGridCell.module.esm.js.map → DataGridCell/DataGridCell.module.esm.js.map} +0 -0
  388. /package/dist/esm/DataGrid/DataGridBody/{DataGridRow.module.esm.js.map → DataGridRow/DataGridRow.module.esm.js.map} +0 -0
  389. /package/dist/esm/src/components/DataGrid/DataGridBody/{DataGridCell.d.ts → DataGridCell/DataGridCell.d.ts} +0 -0
  390. /package/dist/esm/src/components/DataGrid/DataGridBody/{DataGridCell.test.d.ts → DataGridCell/DataGridCell.test.d.ts} +0 -0
  391. /package/dist/{cjs/src/components/Notifications/Snackbar/useSnackbar.test.d.ts → esm/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.test.d.ts} +0 -0
  392. /package/dist/{cjs/src/components/StatusIndicator/StatusIndicator.test.d.ts → esm/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.test.d.ts} +0 -0
  393. /package/dist/{cjs/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.test.d.ts → esm/src/components/DataGrid/DataGridFilters/DataGridFilterTag.test.d.ts} +0 -0
  394. /package/dist/{cjs/src/components/Wizard/Wizard.test.d.ts → esm/src/components/DataGrid/DataGridFilters/DataGridToolbar.test.d.ts} +0 -0
  395. /package/dist/{cjs/src/components/Wizard/WizardActions/WizardActions.test.d.ts → esm/src/hooks/useFullHeightCollapse.test.d.ts} +0 -0
@@ -0,0 +1,105 @@
1
+ /*
2
+ * Copyright 2022 OneWelcome B.V.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ @use "../../../mixins.module.scss";
18
+
19
+ .filter-wrapper {
20
+ display: flex;
21
+ justify-content: center;
22
+ align-items: center;
23
+ gap: 0.375rem;
24
+ padding: 0.25rem 0.75rem 0.25rem 0.5rem;
25
+ border-radius: 3.125rem;
26
+ background-color: var(--color-blue-grey100);
27
+
28
+ .filter-button {
29
+ display: flex;
30
+ justify-content: flex-start;
31
+ align-items: center;
32
+ gap: 0.375rem;
33
+ background: none;
34
+ border: none;
35
+ padding: 0 0.25rem;
36
+ cursor: pointer;
37
+
38
+ &:only-child {
39
+ margin-right: -0.25rem;
40
+ }
41
+
42
+ &:hover {
43
+ border-radius: 0.125rem;
44
+ background-color: var(--color-black10);
45
+ }
46
+
47
+ &:active {
48
+ background-color: var(--color-blue-grey400);
49
+ }
50
+
51
+ @include mixins.focusVisibleOutline($outlineOffset: 0);
52
+ }
53
+
54
+ .caption {
55
+ font-size: var(--font-size-data-grid);
56
+ line-height: var(--data-grid-line-height);
57
+ margin: 0;
58
+ font-weight: 400;
59
+
60
+ &.bold {
61
+ font-weight: 600;
62
+ }
63
+ }
64
+
65
+ .remove-icon {
66
+ font-size: 0.6rem;
67
+ }
68
+ }
69
+
70
+ .column-select-option {
71
+ text-transform: capitalize;
72
+ }
73
+
74
+ .popover {
75
+ display: flex;
76
+ flex-direction: column;
77
+ align-items: flex-start;
78
+ gap: 1rem;
79
+ padding: 1rem 0.75rem;
80
+ min-width: 40rem;
81
+
82
+ .controls {
83
+ width: 100%;
84
+ display: flex;
85
+ gap: 1rem;
86
+
87
+ & > *:last-child,
88
+ *:first-child {
89
+ flex-grow: 1.8;
90
+ flex-shrink: 0;
91
+ margin-top: 0;
92
+ }
93
+
94
+ & > *:nth-child(2) {
95
+ flex-grow: 1;
96
+ flex-shrink: 0;
97
+ margin-top: 0;
98
+ }
99
+ }
100
+
101
+ .actions {
102
+ display: flex;
103
+ gap: 1rem;
104
+ }
105
+ }
@@ -0,0 +1,150 @@
1
+ /*
2
+ * Copyright 2022 OneWelcome B.V.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React, { Fragment, createRef, useState } from "react";
18
+ import { createPortal } from "react-dom";
19
+ import { useGetDomRoot } from "../../../hooks/useGetDomRoot";
20
+ import {
21
+ DataGridColumnMetadata,
22
+ Filter,
23
+ FilterEditorMode,
24
+ FiltersAction,
25
+ PopoverTranslations,
26
+ TagTranslations
27
+ } from "./DataGridFilters.interfaces";
28
+ import { generateID } from "../../../util/helper";
29
+ import { DataGridFilterTag } from "./DataGridFilterTag";
30
+ import { DataGridFilterPopover } from "./DataGridFilterPopover";
31
+ import { useDataGridFilter } from "./DataGridFilterService";
32
+
33
+ export type Props = {
34
+ mode: FilterEditorMode;
35
+ domRoot?: HTMLElement;
36
+ filter?: Filter;
37
+ columnsMetadata: DataGridColumnMetadata[];
38
+ dispatch: React.Dispatch<FiltersAction>;
39
+ onFilterAdd?: (filter: Filter) => void;
40
+ onFilterEdit?: (filter: Filter) => void;
41
+ onFilterDelete?: (id: string) => void;
42
+ tagTranslations?: TagTranslations;
43
+ popoverTranslations?: PopoverTranslations;
44
+ };
45
+
46
+ export const DataGridFilter = ({
47
+ mode,
48
+ filter,
49
+ domRoot,
50
+ columnsMetadata,
51
+ dispatch,
52
+ onFilterAdd,
53
+ onFilterEdit,
54
+ onFilterDelete,
55
+ tagTranslations,
56
+ popoverTranslations
57
+ }: Props) => {
58
+ const wrappingDivRef = createRef<HTMLDivElement>();
59
+ const [filterOpen, setFilterOpen] = useState(false);
60
+ const { root } = useGetDomRoot(domRoot, wrappingDivRef);
61
+ const {
62
+ resetFields,
63
+ operator,
64
+ setOperator,
65
+ operators,
66
+ setOperators,
67
+ column,
68
+ setColumn,
69
+ values,
70
+ setValues,
71
+ pickedValues,
72
+ setPickedValues,
73
+ initialiseFilterValues
74
+ } = useDataGridFilter(mode, columnsMetadata);
75
+
76
+ const onFilterSubmit = () => {
77
+ if (mode === "ADD") {
78
+ const id = generateID();
79
+
80
+ dispatch({
81
+ type: "add",
82
+ payload: { id, column, operator, value: pickedValues }
83
+ });
84
+ onFilterAdd && onFilterAdd({ id, column, operator, value: pickedValues });
85
+ } else if (mode === "EDIT" && filter) {
86
+ const { id } = filter;
87
+
88
+ dispatch({
89
+ type: "edit",
90
+ payload: { id, column, operator, value: pickedValues }
91
+ });
92
+ onFilterEdit && onFilterEdit({ id, column, operator, value: pickedValues });
93
+ }
94
+
95
+ resetFields();
96
+ setFilterOpen(false);
97
+ };
98
+
99
+ const onFilterRemove = () => {
100
+ if (!filter) {
101
+ return;
102
+ }
103
+ const { id } = filter;
104
+
105
+ dispatch({ type: "remove", payload: { id } });
106
+ onFilterDelete && onFilterDelete(id);
107
+
108
+ resetFields();
109
+ setFilterOpen(false);
110
+ };
111
+ const onFilterOpen = () => {
112
+ setFilterOpen(!filterOpen);
113
+ if (!filterOpen) {
114
+ initialiseFilterValues(filter);
115
+ }
116
+ };
117
+
118
+ return (
119
+ <Fragment>
120
+ <DataGridFilterTag
121
+ mode={mode}
122
+ onFilterOpen={onFilterOpen}
123
+ onFilterRemove={onFilterRemove}
124
+ triggerRef={wrappingDivRef}
125
+ filter={filter}
126
+ />
127
+ {createPortal(
128
+ <DataGridFilterPopover
129
+ anchorRef={wrappingDivRef}
130
+ isOpen={filterOpen}
131
+ column={column}
132
+ columnsMetadata={columnsMetadata}
133
+ values={values}
134
+ pickedValues={pickedValues}
135
+ operator={operator}
136
+ operators={operators}
137
+ onFilterSubmit={onFilterSubmit}
138
+ resetFields={resetFields}
139
+ setFilterOpen={setFilterOpen}
140
+ setColumn={setColumn}
141
+ setOperator={setOperator}
142
+ setOperators={setOperators}
143
+ setValues={setValues}
144
+ setPickedValues={setPickedValues}
145
+ />,
146
+ root
147
+ )}
148
+ </Fragment>
149
+ );
150
+ };
@@ -0,0 +1,181 @@
1
+ /*
2
+ * Copyright 2022 OneWelcome B.V.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ import classes from "./DataGridFilter.module.scss";
19
+ import { Button } from "../../Button/Button";
20
+ import { Option } from "../../Form/Select/SingleSelect/Option";
21
+ import { MultiOption } from "../../Form/Select/MultiSelect/MultiOption";
22
+ import { MultiSelectWrapper } from "../../Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper";
23
+ import { SelectWrapper } from "../../Form/Wrapper/SelectWrapper/SelectWrapper";
24
+ import { Popover } from "../../Popover/Popover";
25
+ import {
26
+ DataGridColumnMetadata,
27
+ DefaultOperators,
28
+ PopoverTranslations
29
+ } from "./DataGridFilters.interfaces";
30
+
31
+ export type Props = {
32
+ anchorRef?: React.RefObject<HTMLOrSVGElement>;
33
+ isOpen: boolean;
34
+ column: string;
35
+ columnsMetadata: DataGridColumnMetadata[];
36
+ values: string[];
37
+ pickedValues: string[];
38
+ operator: string;
39
+ operators: string[];
40
+ onFilterSubmit: () => void;
41
+ resetFields: () => void;
42
+ setFilterOpen: (value: React.SetStateAction<boolean>) => void;
43
+ setColumn: (column: React.SetStateAction<string>) => void;
44
+ setOperator: (operator: React.SetStateAction<string>) => void;
45
+ setOperators: (operators: React.SetStateAction<string[]>) => void;
46
+ setValues: (values: React.SetStateAction<string[]>) => void;
47
+ setPickedValues: (pickedValues: React.SetStateAction<string[]>) => void;
48
+ translations?: PopoverTranslations;
49
+ };
50
+
51
+ export const DataGridFilterPopover = ({
52
+ anchorRef,
53
+ isOpen,
54
+ column,
55
+ columnsMetadata,
56
+ values,
57
+ pickedValues,
58
+ operator,
59
+ operators,
60
+ onFilterSubmit,
61
+ resetFields,
62
+ setFilterOpen,
63
+ setColumn,
64
+ setOperator,
65
+ setOperators,
66
+ setValues,
67
+ setPickedValues,
68
+ translations
69
+ }: Props) => {
70
+ const {
71
+ columnSelectLabel = "Filter by",
72
+ operatorSelectLabel = "Operator",
73
+ valueSelectLabel = "Value",
74
+ addNewValueLabel = "Create new",
75
+ addNewValueButtonTitle = "Add new select value",
76
+ submitButtonTitle = "Apply",
77
+ cancelButtonTitle = "Cancel"
78
+ } = translations || {};
79
+ return (
80
+ <Popover
81
+ anchorEl={anchorRef}
82
+ show={isOpen}
83
+ placement={{ horizontal: "left", vertical: "bottom" }}
84
+ transformOrigin={{ horizontal: "left", vertical: "top" }}
85
+ >
86
+ <div className={classes["popover"]}>
87
+ <div className={classes["controls"]}>
88
+ <SelectWrapper
89
+ label={columnSelectLabel}
90
+ value={column}
91
+ name={"column"}
92
+ onChange={e => {
93
+ setColumn(e.target.value);
94
+ const columnMetadata = columnsMetadata.find(({ name }) => name === e.target.value);
95
+
96
+ if (columnMetadata?.operators) {
97
+ setOperator(columnMetadata.operators[0]);
98
+ setOperators(columnMetadata.operators);
99
+ } else {
100
+ setOperator(Object.values(DefaultOperators)[0]);
101
+ setOperators(Object.values(DefaultOperators));
102
+ }
103
+
104
+ if (columnMetadata?.defaultValues) {
105
+ setPickedValues([]);
106
+ setValues(columnMetadata.defaultValues);
107
+ } else {
108
+ setPickedValues([]);
109
+ setValues([]);
110
+ }
111
+ }}
112
+ >
113
+ {columnsMetadata.map(({ name, headline }) => (
114
+ <Option className={classes["column-select-option"]} key={name} value={name}>
115
+ {headline}
116
+ </Option>
117
+ ))}
118
+ </SelectWrapper>
119
+ <SelectWrapper
120
+ label={operatorSelectLabel}
121
+ value={operator}
122
+ name={"operator"}
123
+ onChange={e => setOperator(e.target.value)}
124
+ >
125
+ {operators.map(operator => (
126
+ <Option key={operator} value={operator}>
127
+ {operator}
128
+ </Option>
129
+ ))}
130
+ </SelectWrapper>
131
+ <MultiSelectWrapper
132
+ label={valueSelectLabel}
133
+ name={"value"}
134
+ value={pickedValues}
135
+ onChange={e =>
136
+ setPickedValues(
137
+ [...Array.from(e.target.options)]
138
+ .filter(option => option.selected)
139
+ .map(option => option.value)
140
+ )
141
+ }
142
+ selectProps={{
143
+ addNew: {
144
+ label: addNewValueLabel,
145
+ onAddNew: value => {
146
+ if (value) {
147
+ setValues(prev => [...prev, value]);
148
+ setPickedValues(prev => [...prev, value]);
149
+ }
150
+ },
151
+ btnProps: { title: addNewValueButtonTitle, type: "button" }
152
+ },
153
+ search: {
154
+ enabled: true,
155
+ renderThreshold: 0
156
+ }
157
+ }}
158
+ >
159
+ {values.map(value => (
160
+ <MultiOption key={value} value={value}>
161
+ {value}
162
+ </MultiOption>
163
+ ))}
164
+ </MultiSelectWrapper>
165
+ </div>
166
+ <div className={classes["actions"]}>
167
+ <Button onClick={onFilterSubmit}>{submitButtonTitle}</Button>
168
+ <Button
169
+ variant="text"
170
+ onClick={() => {
171
+ resetFields();
172
+ setFilterOpen(false);
173
+ }}
174
+ >
175
+ {cancelButtonTitle}
176
+ </Button>
177
+ </div>
178
+ </div>
179
+ </Popover>
180
+ );
181
+ };
@@ -0,0 +1,97 @@
1
+ /*
2
+ * Copyright 2022 OneWelcome B.V.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { useState } from "react";
18
+ import {
19
+ DataGridColumnMetadata,
20
+ DefaultOperators,
21
+ Filter,
22
+ FilterEditorMode
23
+ } from "./DataGridFilters.interfaces";
24
+
25
+ export const useDataGridFilter = (
26
+ mode: FilterEditorMode,
27
+ columnsMetadata: DataGridColumnMetadata[]
28
+ ) => {
29
+ const [column, setColumn] = useState("");
30
+ const [operator, setOperator] = useState("");
31
+ const [operators, setOperators] = useState<string[]>(Object.values(DefaultOperators));
32
+ const [values, setValues] = useState<string[]>([]);
33
+ const [pickedValues, setPickedValues] = useState<string[]>([]);
34
+
35
+ //user can extend the list of picked values with custom ones. We need to make sure that the default list includes the user created values.
36
+ const mergeCustomValuesWithPredefined = (values: string[], pickedValues: string[]) => {
37
+ return Array.from(new Set([...values, ...pickedValues]));
38
+ };
39
+
40
+ const resetFields = () => {
41
+ setColumn("");
42
+ setOperator("");
43
+ setValues([]);
44
+ setPickedValues([]);
45
+ };
46
+
47
+ const initialiseFilterValues = (filter?: Filter) => {
48
+ if (mode === "ADD") {
49
+ const firstColumnMetadata = columnsMetadata[0];
50
+
51
+ if (!firstColumnMetadata) {
52
+ return;
53
+ }
54
+
55
+ setColumn(firstColumnMetadata.name);
56
+ setOperator(
57
+ firstColumnMetadata.operators
58
+ ? firstColumnMetadata.operators[0]
59
+ : Object.values(DefaultOperators)[0]
60
+ );
61
+ firstColumnMetadata.operators && setOperators(firstColumnMetadata.operators);
62
+ firstColumnMetadata.defaultValues && setValues(firstColumnMetadata.defaultValues);
63
+ }
64
+
65
+ if (mode === "EDIT" && filter) {
66
+ const { column, operator, value } = filter;
67
+ const columnMetadata = columnsMetadata.find(({ name }) => name === column);
68
+
69
+ if (!columnMetadata) {
70
+ return;
71
+ }
72
+
73
+ const { defaultValues, operators } = columnMetadata;
74
+
75
+ setColumn(column);
76
+ setOperator(operator);
77
+ operators && setOperators(operators);
78
+ setPickedValues(value);
79
+ setValues(mergeCustomValuesWithPredefined(defaultValues || [], value));
80
+ }
81
+ };
82
+
83
+ return {
84
+ resetFields,
85
+ initialiseFilterValues,
86
+ operator,
87
+ setOperator,
88
+ operators,
89
+ setOperators,
90
+ column,
91
+ setColumn,
92
+ values,
93
+ setValues,
94
+ pickedValues,
95
+ setPickedValues
96
+ };
97
+ };
@@ -0,0 +1,91 @@
1
+ /*
2
+ * Copyright 2022 OneWelcome B.V.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React, { ComponentPropsWithRef, ForwardRefRenderFunction, Fragment } from "react";
18
+ import { Icon, Icons } from "../../Icon/Icon";
19
+ import { RemoveButton } from "../../Tag/RemoveButton";
20
+ import { Typography } from "../../Typography/Typography";
21
+ import classes from "./DataGridFilter.module.scss";
22
+ import { Filter, FilterEditorMode, TagTranslations } from "./DataGridFilters.interfaces";
23
+
24
+ export interface DataGridFilterTagProps extends ComponentPropsWithRef<"div"> {
25
+ triggerRef: React.Ref<HTMLDivElement>;
26
+ filter?: Filter;
27
+ mode: FilterEditorMode;
28
+ onFilterRemove: () => void;
29
+ onFilterOpen: () => void;
30
+ translations?: TagTranslations;
31
+ }
32
+
33
+ const EditTagContent = ({ filter }: { filter: Filter }) => {
34
+ const { column, operator, value } = filter;
35
+
36
+ return (
37
+ <Fragment>
38
+ {column} {operator} {value.length > 0 && <b>{value[0]}</b>}
39
+ {value.length >= 2 && (
40
+ <>
41
+ {" "}
42
+ or <b> {value.length - 1} other</b>
43
+ </>
44
+ )}
45
+ </Fragment>
46
+ );
47
+ };
48
+
49
+ export const DataGridFilterTagComponent: ForwardRefRenderFunction<
50
+ HTMLDivElement,
51
+ DataGridFilterTagProps
52
+ > = (
53
+ {
54
+ triggerRef,
55
+ filter,
56
+ mode,
57
+ onFilterRemove,
58
+ onFilterOpen,
59
+ translations,
60
+
61
+ ...rest
62
+ }: DataGridFilterTagProps,
63
+ ref
64
+ ) => {
65
+ const { addButtonCaption = "Add filter" } = translations || {};
66
+ const shouldRenderAddTag = mode === "ADD";
67
+ const shouldRenderEditTag = mode === "EDIT" && filter;
68
+
69
+ return (
70
+ <div {...rest} ref={triggerRef} className={classes["filter-wrapper"]}>
71
+ <button type="button" className={classes["filter-button"]} onClick={onFilterOpen}>
72
+ {shouldRenderAddTag && (
73
+ <Fragment>
74
+ <Icon icon={Icons.AddCircle} />
75
+ <Typography variant="body" className={classes["caption"]}>
76
+ {addButtonCaption}
77
+ </Typography>
78
+ </Fragment>
79
+ )}
80
+ {shouldRenderEditTag && (
81
+ <Typography variant="body" className={classes["caption"]}>
82
+ <EditTagContent filter={filter} />
83
+ </Typography>
84
+ )}
85
+ </button>
86
+ {shouldRenderEditTag && <RemoveButton onRemove={onFilterRemove} />}
87
+ </div>
88
+ );
89
+ };
90
+
91
+ export const DataGridFilterTag = React.forwardRef(DataGridFilterTagComponent);
@@ -0,0 +1,84 @@
1
+ /*
2
+ * Copyright 2022 OneWelcome B.V.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export interface Filter {
18
+ id: string;
19
+ column: string;
20
+ operator: string;
21
+ value: string[];
22
+ }
23
+
24
+ export type FiltersAction =
25
+ | {
26
+ type: "add";
27
+ payload: Filter;
28
+ }
29
+ | {
30
+ type: "edit";
31
+ payload: Filter;
32
+ }
33
+ | {
34
+ type: "remove";
35
+ payload: { id: string };
36
+ }
37
+ | {
38
+ type: "clear";
39
+ };
40
+
41
+ export type FiltersState = {
42
+ filters: Filter[];
43
+ };
44
+
45
+ export type FilterEditorMode = "ADD" | "EDIT";
46
+
47
+ export enum DefaultOperators {
48
+ is = "is",
49
+ isNot = "is not",
50
+ contains = "contains",
51
+ doesNotContain = "does not contain",
52
+ isEmpty = "is empty"
53
+ }
54
+
55
+ export interface DataGridColumnMetadata {
56
+ name: string;
57
+ headline: string;
58
+ operators?: string[];
59
+ defaultValues?: string[];
60
+ }
61
+
62
+ export interface PopoverTranslations {
63
+ columnSelectLabel?: string;
64
+ operatorSelectLabel?: string;
65
+ valueSelectLabel?: string;
66
+ addNewValueLabel?: string;
67
+ addNewValueButtonTitle?: string;
68
+ submitButtonTitle?: string;
69
+ cancelButtonTitle?: string;
70
+ }
71
+
72
+ export interface TagTranslations {
73
+ addButtonCaption?: string;
74
+ }
75
+
76
+ export interface ToolbarTranslations {
77
+ clearButtonCaption?: string;
78
+ }
79
+
80
+ export interface FiltersTranslations {
81
+ toolbar?: ToolbarTranslations;
82
+ tag?: TagTranslations;
83
+ popover?: PopoverTranslations;
84
+ }